@assistant-ui/core 0.2.10 → 0.2.12

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 (362) hide show
  1. package/dist/adapters/attachment.d.ts.map +1 -1
  2. package/dist/adapters/attachment.js +22 -12
  3. package/dist/adapters/attachment.js.map +1 -1
  4. package/dist/adapters/directive-formatter.js.map +1 -1
  5. package/dist/adapters/speech.js.map +1 -1
  6. package/dist/index.d.ts +3 -1
  7. package/dist/index.js +2 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/internal.js +1 -1
  10. package/dist/model-context/frame/host.js.map +1 -1
  11. package/dist/model-context/frame/provider.js.map +1 -1
  12. package/dist/model-context/registry.js.map +1 -1
  13. package/dist/model-context/types.js.map +1 -1
  14. package/dist/react/AssistantProvider.js +1 -1
  15. package/dist/react/AssistantRuntimeProvider.d.ts +1 -1
  16. package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
  17. package/dist/react/AssistantRuntimeProvider.js +1 -1
  18. package/dist/react/RuntimeAdapter.js +4 -2
  19. package/dist/react/RuntimeAdapter.js.map +1 -1
  20. package/dist/react/adapters/LocalStorageThreadListAdapter.js +1 -1
  21. package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
  22. package/dist/react/client/DataRenderers.d.ts.map +1 -1
  23. package/dist/react/client/DataRenderers.js +6 -5
  24. package/dist/react/client/DataRenderers.js.map +1 -1
  25. package/dist/react/client/Interactables.d.ts.map +1 -1
  26. package/dist/react/client/Interactables.js +30 -29
  27. package/dist/react/client/Interactables.js.map +1 -1
  28. package/dist/react/client/Tools.d.ts.map +1 -1
  29. package/dist/react/client/Tools.js +10 -9
  30. package/dist/react/client/Tools.js.map +1 -1
  31. package/dist/react/index.d.ts +5 -4
  32. package/dist/react/index.js +3 -2
  33. package/dist/react/model-context/define-mcp-toolkit.js.map +1 -1
  34. package/dist/react/model-context/define-toolkit.d.ts +9 -12
  35. package/dist/react/model-context/define-toolkit.d.ts.map +1 -1
  36. package/dist/react/model-context/define-toolkit.js +1 -1
  37. package/dist/react/model-context/define-toolkit.js.map +1 -1
  38. package/dist/react/model-context/external-tool.d.ts +14 -0
  39. package/dist/react/model-context/external-tool.d.ts.map +1 -0
  40. package/dist/react/model-context/external-tool.js +17 -0
  41. package/dist/react/model-context/external-tool.js.map +1 -0
  42. package/dist/react/model-context/human-tool.d.ts +27 -0
  43. package/dist/react/model-context/human-tool.d.ts.map +1 -0
  44. package/dist/react/model-context/human-tool.js +30 -0
  45. package/dist/react/model-context/human-tool.js.map +1 -0
  46. package/dist/react/model-context/toolbox.d.ts +3 -3
  47. package/dist/react/model-context/toolbox.js.map +1 -1
  48. package/dist/react/model-context/useAssistantContext.js +1 -1
  49. package/dist/react/model-context/useAssistantContext.js.map +1 -1
  50. package/dist/react/model-context/useAssistantDataUI.js +1 -1
  51. package/dist/react/model-context/useAssistantDataUI.js.map +1 -1
  52. package/dist/react/model-context/useAssistantInstructions.js +1 -1
  53. package/dist/react/model-context/useAssistantInstructions.js.map +1 -1
  54. package/dist/react/model-context/useAssistantInteractable.js +1 -1
  55. package/dist/react/model-context/useAssistantInteractable.js.map +1 -1
  56. package/dist/react/model-context/useAssistantTool.js +1 -1
  57. package/dist/react/model-context/useAssistantTool.js.map +1 -1
  58. package/dist/react/model-context/useAssistantToolUI.js +1 -1
  59. package/dist/react/model-context/useAssistantToolUI.js.map +1 -1
  60. package/dist/react/model-context/useAuiToolOverrides.js +1 -1
  61. package/dist/react/model-context/useAuiToolOverrides.js.map +1 -1
  62. package/dist/react/model-context/useInlineRender.js +1 -1
  63. package/dist/react/model-context/useInlineRender.js.map +1 -1
  64. package/dist/react/model-context/useInteractableState.js +1 -1
  65. package/dist/react/model-context/useInteractableState.js.map +1 -1
  66. package/dist/react/model-context/useToolArgsStatus.js +1 -1
  67. package/dist/react/primitive-hooks/useActionBarCopy.js +1 -1
  68. package/dist/react/primitive-hooks/useActionBarCopy.js.map +1 -1
  69. package/dist/react/primitive-hooks/useActionBarEdit.js +1 -1
  70. package/dist/react/primitive-hooks/useActionBarEdit.js.map +1 -1
  71. package/dist/react/primitive-hooks/useActionBarFeedback.js +1 -1
  72. package/dist/react/primitive-hooks/useActionBarFeedback.js.map +1 -1
  73. package/dist/react/primitive-hooks/useActionBarReload.js +1 -1
  74. package/dist/react/primitive-hooks/useActionBarReload.js.map +1 -1
  75. package/dist/react/primitive-hooks/useActionBarSpeak.js +1 -1
  76. package/dist/react/primitive-hooks/useActionBarSpeak.js.map +1 -1
  77. package/dist/react/primitive-hooks/useActionBarStopSpeaking.js +1 -1
  78. package/dist/react/primitive-hooks/useActionBarStopSpeaking.js.map +1 -1
  79. package/dist/react/primitive-hooks/useBranchPickerNext.js +1 -1
  80. package/dist/react/primitive-hooks/useBranchPickerNext.js.map +1 -1
  81. package/dist/react/primitive-hooks/useBranchPickerPrevious.js +1 -1
  82. package/dist/react/primitive-hooks/useBranchPickerPrevious.js.map +1 -1
  83. package/dist/react/primitive-hooks/useComposerAddAttachment.js +1 -1
  84. package/dist/react/primitive-hooks/useComposerAddAttachment.js.map +1 -1
  85. package/dist/react/primitive-hooks/useComposerCancel.js +1 -1
  86. package/dist/react/primitive-hooks/useComposerCancel.js.map +1 -1
  87. package/dist/react/primitive-hooks/useComposerDictate.js +1 -1
  88. package/dist/react/primitive-hooks/useComposerDictate.js.map +1 -1
  89. package/dist/react/primitive-hooks/useComposerSend.js +1 -1
  90. package/dist/react/primitive-hooks/useComposerSend.js.map +1 -1
  91. package/dist/react/primitive-hooks/useEditComposerCancel.js +1 -1
  92. package/dist/react/primitive-hooks/useEditComposerCancel.js.map +1 -1
  93. package/dist/react/primitive-hooks/useEditComposerSend.js +1 -1
  94. package/dist/react/primitive-hooks/useEditComposerSend.js.map +1 -1
  95. package/dist/react/primitive-hooks/useMessageBranching.js +1 -1
  96. package/dist/react/primitive-hooks/useMessageBranching.js.map +1 -1
  97. package/dist/react/primitive-hooks/useMessageReload.js +1 -1
  98. package/dist/react/primitive-hooks/useMessageReload.js.map +1 -1
  99. package/dist/react/primitive-hooks/useSuggestionTrigger.js +1 -1
  100. package/dist/react/primitive-hooks/useSuggestionTrigger.js.map +1 -1
  101. package/dist/react/primitive-hooks/useThreadListItemArchive.js +1 -1
  102. package/dist/react/primitive-hooks/useThreadListItemArchive.js.map +1 -1
  103. package/dist/react/primitive-hooks/useThreadListItemDelete.js +1 -1
  104. package/dist/react/primitive-hooks/useThreadListItemDelete.js.map +1 -1
  105. package/dist/react/primitive-hooks/useThreadListItemTrigger.js +1 -1
  106. package/dist/react/primitive-hooks/useThreadListItemTrigger.js.map +1 -1
  107. package/dist/react/primitive-hooks/useThreadListItemUnarchive.js +1 -1
  108. package/dist/react/primitive-hooks/useThreadListItemUnarchive.js.map +1 -1
  109. package/dist/react/primitive-hooks/useThreadListLoadMore.js +1 -1
  110. package/dist/react/primitive-hooks/useThreadListLoadMore.js.map +1 -1
  111. package/dist/react/primitive-hooks/useThreadListNew.js +1 -1
  112. package/dist/react/primitive-hooks/useThreadListNew.js.map +1 -1
  113. package/dist/react/primitive-hooks/useVoice.js +1 -1
  114. package/dist/react/primitive-hooks/useVoice.js.map +1 -1
  115. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts +1 -1
  116. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js +1 -1
  117. package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
  118. package/dist/react/primitives/composer/ComposerAttachments.js +1 -1
  119. package/dist/react/primitives/composer/ComposerAttachments.js.map +1 -1
  120. package/dist/react/primitives/composer/ComposerQueue.js +1 -1
  121. package/dist/react/primitives/composer/ComposerQueue.js.map +1 -1
  122. package/dist/react/primitives/generativeUI/GenerativeUI.js +1 -1
  123. package/dist/react/primitives/generativeUI/GenerativeUI.js.map +1 -1
  124. package/dist/react/primitives/message/MessageAttachments.js +1 -1
  125. package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
  126. package/dist/react/primitives/message/MessageGroupedParts.js +1 -1
  127. package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
  128. package/dist/react/primitives/message/MessageParts.d.ts +1 -1
  129. package/dist/react/primitives/message/MessageParts.js +1 -1
  130. package/dist/react/primitives/message/MessageParts.js.map +1 -1
  131. package/dist/react/primitives/message/MessageQuote.js +1 -1
  132. package/dist/react/primitives/part/PartMessages.d.ts +2 -2
  133. package/dist/react/primitives/part/PartMessages.js +3 -3
  134. package/dist/react/primitives/part/PartMessages.js.map +1 -1
  135. package/dist/react/primitives/thread/ThreadMessages.js +1 -1
  136. package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
  137. package/dist/react/primitives/thread/ThreadSuggestions.js +1 -1
  138. package/dist/react/primitives/thread/ThreadSuggestions.js.map +1 -1
  139. package/dist/react/primitives/threadList/ThreadListItems.js +1 -1
  140. package/dist/react/primitives/threadList/ThreadListItems.js.map +1 -1
  141. package/dist/react/providers/AttachmentByIndexProvider.js.map +1 -1
  142. package/dist/react/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
  143. package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js.map +1 -1
  144. package/dist/react/providers/MessageByIndexProvider.js.map +1 -1
  145. package/dist/react/providers/PartByIndexProvider.js.map +1 -1
  146. package/dist/react/providers/QueueItemByIndexProvider.js.map +1 -1
  147. package/dist/react/providers/ReadonlyThreadProvider.js +1 -1
  148. package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
  149. package/dist/react/providers/SuggestionByIndexProvider.js.map +1 -1
  150. package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
  151. package/dist/react/providers/TextMessagePartProvider.js +4 -3
  152. package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
  153. package/dist/react/providers/ThreadListItemByIndexProvider.js.map +1 -1
  154. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +7 -0
  155. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
  156. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +1 -1
  157. package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
  158. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +7 -0
  159. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
  160. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +1 -1
  161. package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
  162. package/dist/react/runtimes/RuntimeAdapterProvider.js +1 -1
  163. package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +1 -1
  164. package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
  165. package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js +1 -1
  166. package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js.map +1 -1
  167. package/dist/react/runtimes/createMessageConverter.d.ts +2 -2
  168. package/dist/react/runtimes/createMessageConverter.d.ts.map +1 -1
  169. package/dist/react/runtimes/createMessageConverter.js.map +1 -1
  170. package/dist/react/runtimes/external-message-converter.d.ts +4 -3
  171. package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
  172. package/dist/react/runtimes/external-message-converter.js +1 -1
  173. package/dist/react/runtimes/external-message-converter.js.map +1 -1
  174. package/dist/react/runtimes/useExternalStoreRuntime.js +1 -1
  175. package/dist/react/runtimes/useExternalStoreSharedOptions.js +1 -1
  176. package/dist/react/runtimes/useLocalRuntime.d.ts +2 -1
  177. package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
  178. package/dist/react/runtimes/useLocalRuntime.js +4 -3
  179. package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
  180. package/dist/react/runtimes/useRemoteThreadListRuntime.js +1 -1
  181. package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
  182. package/dist/react/utils/groupParts.d.ts +1 -1
  183. package/dist/react/utils/groupParts.js.map +1 -1
  184. package/dist/runtime/api/attachment-runtime.js.map +1 -1
  185. package/dist/runtime/api/composer-runtime.d.ts +8 -2
  186. package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
  187. package/dist/runtime/api/composer-runtime.js +14 -0
  188. package/dist/runtime/api/composer-runtime.js.map +1 -1
  189. package/dist/runtime/api/message-part-runtime.js.map +1 -1
  190. package/dist/runtime/api/message-runtime.js +1 -1
  191. package/dist/runtime/api/message-runtime.js.map +1 -1
  192. package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
  193. package/dist/runtime/api/thread-runtime.d.ts +7 -0
  194. package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
  195. package/dist/runtime/api/thread-runtime.js.map +1 -1
  196. package/dist/runtime/base/base-composer-runtime-core.d.ts +4 -0
  197. package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
  198. package/dist/runtime/base/base-composer-runtime-core.js +7 -1
  199. package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
  200. package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
  201. package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +4 -0
  202. package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
  203. package/dist/runtime/base/default-thread-composer-runtime-core.js +17 -1
  204. package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
  205. package/dist/runtime/interfaces/composer-runtime-core.d.ts +6 -1
  206. package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
  207. package/dist/runtime/interfaces/thread-runtime-core.d.ts +4 -0
  208. package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
  209. package/dist/runtime/queue/external-thread-queue-adapter.d.ts +20 -0
  210. package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -0
  211. package/dist/runtime/queue/external-thread-queue-adapter.js +0 -0
  212. package/dist/runtime/queue/message-queue.d.ts +20 -0
  213. package/dist/runtime/queue/message-queue.d.ts.map +1 -0
  214. package/dist/runtime/queue/message-queue.js +97 -0
  215. package/dist/runtime/queue/message-queue.js.map +1 -0
  216. package/dist/runtime/utils/message-repository.js.map +1 -1
  217. package/dist/runtime/utils/thread-message-like.js.map +1 -1
  218. package/dist/runtimes/external-store/external-store-adapter.d.ts +3 -1
  219. package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
  220. package/dist/runtimes/external-store/external-store-runtime-core.js.map +1 -1
  221. package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +4 -0
  222. package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
  223. package/dist/runtimes/external-store/external-store-thread-runtime-core.js +20 -2
  224. package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
  225. package/dist/runtimes/local/local-runtime-core.js.map +1 -1
  226. package/dist/runtimes/local/local-runtime-options.d.ts +5 -0
  227. package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
  228. package/dist/runtimes/local/local-thread-runtime-core.d.ts +7 -0
  229. package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
  230. package/dist/runtimes/local/local-thread-runtime-core.js +45 -0
  231. package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
  232. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +3 -0
  233. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts.map +1 -1
  234. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +3 -0
  235. package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
  236. package/dist/runtimes/remote-thread-list/empty-thread-core.d.ts.map +1 -1
  237. package/dist/runtimes/remote-thread-list/empty-thread-core.js +3 -0
  238. package/dist/runtimes/remote-thread-list/empty-thread-core.js.map +1 -1
  239. package/dist/runtimes/remote-thread-list/remote-thread-state.js.map +1 -1
  240. package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
  241. package/dist/store/clients/chain-of-thought-client.d.ts.map +1 -1
  242. package/dist/store/clients/chain-of-thought-client.js +6 -5
  243. package/dist/store/clients/chain-of-thought-client.js.map +1 -1
  244. package/dist/store/clients/model-context-client.d.ts.map +1 -1
  245. package/dist/store/clients/model-context-client.js +6 -5
  246. package/dist/store/clients/model-context-client.js.map +1 -1
  247. package/dist/store/clients/no-op-composer-client.d.ts.map +1 -1
  248. package/dist/store/clients/no-op-composer-client.js +4 -3
  249. package/dist/store/clients/no-op-composer-client.js.map +1 -1
  250. package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
  251. package/dist/store/clients/runtime-adapter.js +7 -6
  252. package/dist/store/clients/runtime-adapter.js.map +1 -1
  253. package/dist/store/clients/suggestions.d.ts.map +1 -1
  254. package/dist/store/clients/suggestions.js +7 -6
  255. package/dist/store/clients/suggestions.js.map +1 -1
  256. package/dist/store/clients/thread-message-client.d.ts.map +1 -1
  257. package/dist/store/clients/thread-message-client.js +13 -12
  258. package/dist/store/clients/thread-message-client.js.map +1 -1
  259. package/dist/store/index.d.ts +1 -1
  260. package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
  261. package/dist/store/runtime-clients/attachment-runtime-client.js +3 -3
  262. package/dist/store/runtime-clients/attachment-runtime-client.js.map +1 -1
  263. package/dist/store/runtime-clients/composer-runtime-client.d.ts +12 -5
  264. package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
  265. package/dist/store/runtime-clients/composer-runtime-client.js +32 -16
  266. package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
  267. package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
  268. package/dist/store/runtime-clients/message-part-runtime-client.js +3 -3
  269. package/dist/store/runtime-clients/message-part-runtime-client.js.map +1 -1
  270. package/dist/store/runtime-clients/message-runtime-client.d.ts +6 -3
  271. package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
  272. package/dist/store/runtime-clients/message-runtime-client.js +17 -16
  273. package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
  274. package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
  275. package/dist/store/runtime-clients/thread-list-item-runtime-client.js +8 -7
  276. package/dist/store/runtime-clients/thread-list-item-runtime-client.js.map +1 -1
  277. package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
  278. package/dist/store/runtime-clients/thread-list-runtime-client.js +11 -10
  279. package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
  280. package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
  281. package/dist/store/runtime-clients/thread-runtime-client.js +15 -14
  282. package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
  283. package/dist/store/runtime-clients/useSubscribable.d.ts +7 -0
  284. package/dist/store/runtime-clients/useSubscribable.d.ts.map +1 -0
  285. package/dist/store/runtime-clients/useSubscribable.js +16 -0
  286. package/dist/store/runtime-clients/useSubscribable.js.map +1 -0
  287. package/dist/store/scope-registration.d.ts +1 -1
  288. package/dist/store/scopes/composer.d.ts +1 -1
  289. package/dist/store/scopes/queue-item.d.ts +2 -1
  290. package/dist/store/scopes/queue-item.d.ts.map +1 -1
  291. package/dist/store/scopes/queue-item.js +6 -0
  292. package/dist/store/scopes/queue-item.js.map +1 -0
  293. package/dist/store/scopes/thread.d.ts +1 -1
  294. package/dist/store/scopes/threads.d.ts +1 -1
  295. package/dist/types/message.d.ts +2 -1
  296. package/dist/types/message.d.ts.map +1 -1
  297. package/dist/types/message.js.map +1 -1
  298. package/dist/utils/composite-context-provider.d.ts +1 -1
  299. package/dist/utils/composite-context-provider.js +3 -1
  300. package/dist/utils/composite-context-provider.js.map +1 -1
  301. package/dist/utils/json/is-json.js.map +1 -1
  302. package/dist/utils/text.js.map +1 -1
  303. package/package.json +14 -10
  304. package/src/adapters/attachment.ts +24 -4
  305. package/src/index.ts +8 -0
  306. package/src/react/RuntimeAdapter.ts +6 -4
  307. package/src/react/client/DataRenderers.ts +48 -42
  308. package/src/react/client/Interactables.ts +263 -267
  309. package/src/react/client/Tools.ts +122 -129
  310. package/src/react/index.ts +3 -1
  311. package/src/react/model-context/define-toolkit.test.ts +14 -7
  312. package/src/react/model-context/define-toolkit.ts +18 -19
  313. package/src/react/model-context/external-tool.ts +16 -0
  314. package/src/react/model-context/{hitl.ts → human-tool.ts} +13 -8
  315. package/src/react/model-context/toolbox.ts +3 -3
  316. package/src/react/primitives/message/MessageGroupedParts.tsx +1 -1
  317. package/src/react/primitives/part/PartMessages.tsx +2 -2
  318. package/src/react/providers/TextMessagePartProvider.tsx +31 -32
  319. package/src/react/runtimes/createMessageConverter.ts +2 -1
  320. package/src/react/runtimes/external-message-converter.ts +5 -3
  321. package/src/react/runtimes/useLocalRuntime.ts +2 -0
  322. package/src/runtime/api/composer-runtime.ts +26 -0
  323. package/src/runtime/base/base-composer-runtime-core.ts +11 -0
  324. package/src/runtime/base/default-thread-composer-runtime-core.ts +22 -0
  325. package/src/runtime/interfaces/composer-runtime-core.ts +7 -0
  326. package/src/runtime/interfaces/thread-runtime-core.ts +5 -0
  327. package/src/runtime/queue/external-thread-queue-adapter.ts +14 -0
  328. package/src/runtime/queue/message-queue.ts +128 -0
  329. package/src/runtimes/external-store/external-store-adapter.ts +3 -0
  330. package/src/runtimes/external-store/external-store-thread-runtime-core.ts +31 -2
  331. package/src/runtimes/local/local-runtime-options.ts +6 -0
  332. package/src/runtimes/local/local-thread-runtime-core.ts +70 -0
  333. package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +4 -0
  334. package/src/runtimes/remote-thread-list/empty-thread-core.ts +4 -0
  335. package/src/store/clients/chain-of-thought-client.ts +24 -25
  336. package/src/store/clients/model-context-client.ts +22 -19
  337. package/src/store/clients/no-op-composer-client.ts +69 -66
  338. package/src/store/clients/runtime-adapter.ts +9 -6
  339. package/src/store/clients/suggestions.ts +41 -40
  340. package/src/store/clients/thread-message-client.ts +127 -132
  341. package/src/store/runtime-clients/attachment-runtime-client.ts +7 -3
  342. package/src/store/runtime-clients/composer-runtime-client.ts +142 -113
  343. package/src/store/runtime-clients/message-part-runtime-client.ts +16 -14
  344. package/src/store/runtime-clients/message-runtime-client.ts +124 -122
  345. package/src/store/runtime-clients/thread-list-item-runtime-client.ts +44 -45
  346. package/src/store/runtime-clients/thread-list-runtime-client.ts +83 -80
  347. package/src/store/runtime-clients/thread-runtime-client.ts +113 -119
  348. package/src/store/runtime-clients/{tap-subscribable.ts → useSubscribable.ts} +4 -4
  349. package/src/store/scopes/queue-item.ts +2 -0
  350. package/src/tests/attachment-adapters.test.ts +86 -0
  351. package/src/tests/external-store-thread-runtime-core.test.ts +125 -0
  352. package/src/tests/message-queue.test.ts +168 -0
  353. package/src/types/message.ts +2 -0
  354. package/src/utils/composite-context-provider.ts +3 -1
  355. package/dist/react/model-context/hitl.d.ts +0 -23
  356. package/dist/react/model-context/hitl.d.ts.map +0 -1
  357. package/dist/react/model-context/hitl.js +0 -26
  358. package/dist/react/model-context/hitl.js.map +0 -1
  359. package/dist/store/runtime-clients/tap-subscribable.d.ts +0 -7
  360. package/dist/store/runtime-clients/tap-subscribable.d.ts.map +0 -1
  361. package/dist/store/runtime-clients/tap-subscribable.js +0 -16
  362. package/dist/store/runtime-clients/tap-subscribable.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import { resource, tapEffect, tapMemo, tapState } from "@assistant-ui/tap";
1
+ import { useEffect, useMemo, useState } from "react";
2
+ import { resource } from "@assistant-ui/tap";
2
3
  import type { ClientOutput } from "@assistant-ui/store";
3
4
  import { CompositeContextProvider } from "../../utils/composite-context-provider";
4
5
  import type { ModelContextState } from "../scopes/model-context";
@@ -28,23 +29,25 @@ const deriveState = (
28
29
  return { modelName, toolNames };
29
30
  };
30
31
 
31
- export const ModelContext = resource((): ClientOutput<"modelContext"> => {
32
- const composite = tapMemo(() => new CompositeContextProvider(), []);
33
- const [state, setState] = tapState<ModelContextState>(() =>
34
- deriveState(composite, INITIAL_STATE),
35
- );
32
+ export const ModelContext = resource(
33
+ function ModelContext(): ClientOutput<"modelContext"> {
34
+ const composite = useMemo(() => new CompositeContextProvider(), []);
35
+ const [state, setState] = useState<ModelContextState>(() =>
36
+ deriveState(composite, INITIAL_STATE),
37
+ );
36
38
 
37
- tapEffect(() => {
38
- setState((prev) => deriveState(composite, prev));
39
- return composite.subscribe(() => {
39
+ useEffect(() => {
40
40
  setState((prev) => deriveState(composite, prev));
41
- });
42
- }, [composite]);
43
-
44
- return {
45
- getState: () => deriveState(composite, state),
46
- getModelContext: () => composite.getModelContext(),
47
- subscribe: (callback) => composite.subscribe(callback),
48
- register: (provider) => composite.registerModelContextProvider(provider),
49
- };
50
- });
41
+ return composite.subscribe(() => {
42
+ setState((prev) => deriveState(composite, prev));
43
+ });
44
+ }, [composite]);
45
+
46
+ return {
47
+ getState: () => deriveState(composite, state),
48
+ getModelContext: () => composite.getModelContext(),
49
+ subscribe: (callback) => composite.subscribe(callback),
50
+ register: (provider) => composite.registerModelContextProvider(provider),
51
+ };
52
+ },
53
+ );
@@ -1,71 +1,74 @@
1
- import { resource, tapMemo } from "@assistant-ui/tap";
1
+ import { useMemo } from "react";
2
+ import { resource } from "@assistant-ui/tap";
2
3
  import type { ClientOutput } from "@assistant-ui/store";
3
4
  import type { ComposerState } from "../scopes/composer";
4
5
 
5
- export const NoOpComposerClient = resource(
6
- ({ type }: { type: "edit" | "thread" }): ClientOutput<"composer"> => {
7
- const state = tapMemo<ComposerState>(() => {
8
- return {
9
- isEditing: false,
10
- isEmpty: true,
11
- text: "",
12
- attachmentAccept: "*",
13
- attachments: [],
14
- role: "user",
15
- runConfig: {},
16
- canCancel: false,
17
- canSend: false,
18
- type: type,
19
- dictation: undefined,
20
- quote: undefined,
21
- queue: [],
22
- };
23
- }, [type]);
24
-
6
+ export const NoOpComposerClient = resource(function NoOpComposerClient({
7
+ type,
8
+ }: {
9
+ type: "edit" | "thread";
10
+ }): ClientOutput<"composer"> {
11
+ const state = useMemo<ComposerState>(() => {
25
12
  return {
26
- getState: () => state,
27
- setText: () => {
28
- throw new Error("Not supported");
29
- },
30
- setRole: () => {
31
- throw new Error("Not supported");
32
- },
33
- setRunConfig: () => {
34
- throw new Error("Not supported");
35
- },
36
- addAttachment: () => {
37
- throw new Error("Not supported");
38
- },
39
- clearAttachments: () => {
40
- throw new Error("Not supported");
41
- },
42
- attachment: () => {
43
- throw new Error("Not supported");
44
- },
45
- reset: () => {
46
- throw new Error("Not supported");
47
- },
48
- send: () => {
49
- throw new Error("Not supported");
50
- },
51
- cancel: () => {
52
- throw new Error("Not supported");
53
- },
54
- startDictation: () => {
55
- throw new Error("Not supported");
56
- },
57
- stopDictation: () => {
58
- throw new Error("Not supported");
59
- },
60
- beginEdit: () => {
61
- throw new Error("Not supported");
62
- },
63
- setQuote: () => {
64
- throw new Error("Not supported");
65
- },
66
- queueItem: () => {
67
- throw new Error("Not supported");
68
- },
13
+ isEditing: false,
14
+ isEmpty: true,
15
+ text: "",
16
+ attachmentAccept: "*",
17
+ attachments: [],
18
+ role: "user",
19
+ runConfig: {},
20
+ canCancel: false,
21
+ canSend: false,
22
+ type: type,
23
+ dictation: undefined,
24
+ quote: undefined,
25
+ queue: [],
69
26
  };
70
- },
71
- );
27
+ }, [type]);
28
+
29
+ return {
30
+ getState: () => state,
31
+ setText: () => {
32
+ throw new Error("Not supported");
33
+ },
34
+ setRole: () => {
35
+ throw new Error("Not supported");
36
+ },
37
+ setRunConfig: () => {
38
+ throw new Error("Not supported");
39
+ },
40
+ addAttachment: () => {
41
+ throw new Error("Not supported");
42
+ },
43
+ clearAttachments: () => {
44
+ throw new Error("Not supported");
45
+ },
46
+ attachment: () => {
47
+ throw new Error("Not supported");
48
+ },
49
+ reset: () => {
50
+ throw new Error("Not supported");
51
+ },
52
+ send: () => {
53
+ throw new Error("Not supported");
54
+ },
55
+ cancel: () => {
56
+ throw new Error("Not supported");
57
+ },
58
+ startDictation: () => {
59
+ throw new Error("Not supported");
60
+ },
61
+ stopDictation: () => {
62
+ throw new Error("Not supported");
63
+ },
64
+ beginEdit: () => {
65
+ throw new Error("Not supported");
66
+ },
67
+ setQuote: () => {
68
+ throw new Error("Not supported");
69
+ },
70
+ queueItem: () => {
71
+ throw new Error("Not supported");
72
+ },
73
+ };
74
+ });
@@ -1,8 +1,9 @@
1
- import { resource, tapEffect, tapResource } from "@assistant-ui/tap";
1
+ import { useEffect } from "react";
2
+ import { useResource, resource } from "@assistant-ui/tap";
2
3
  import type { AssistantRuntime } from "../../runtime/api/assistant-runtime";
3
4
  import { ThreadListClient } from "../runtime-clients/thread-list-runtime-client";
4
5
  import {
5
- tapAssistantClientRef,
6
+ useAssistantClientRef,
6
7
  Derived,
7
8
  type ScopesConfig,
8
9
  type AssistantClient,
@@ -10,16 +11,18 @@ import {
10
11
  import { ModelContext } from "./model-context-client";
11
12
  import { Suggestions } from "./suggestions";
12
13
 
13
- export const RuntimeAdapterResource = resource((runtime: AssistantRuntime) => {
14
- const clientRef = tapAssistantClientRef();
14
+ export const RuntimeAdapterResource = resource(function RuntimeAdapterResource(
15
+ runtime: AssistantRuntime,
16
+ ) {
17
+ const clientRef = useAssistantClientRef();
15
18
 
16
- tapEffect(() => {
19
+ useEffect(() => {
17
20
  return runtime.registerModelContextProvider(
18
21
  clientRef.current!.modelContext(),
19
22
  );
20
23
  }, [runtime, clientRef]);
21
24
 
22
- return tapResource(
25
+ return useResource(
23
26
  ThreadListClient({
24
27
  runtime: runtime.threads,
25
28
  __internal_assistantRuntime: runtime,
@@ -1,6 +1,7 @@
1
- import { resource, tapState, withKey } from "@assistant-ui/tap";
1
+ import { useState } from "react";
2
+ import { resource, withKey } from "@assistant-ui/tap";
2
3
  import type { ClientOutput } from "@assistant-ui/store";
3
- import { tapClientLookup } from "@assistant-ui/store";
4
+ import { useClientLookup } from "@assistant-ui/store";
4
5
  import type { SuggestionsState } from "../scopes/suggestions";
5
6
  import type { SuggestionState } from "../scopes/suggestion";
6
7
 
@@ -8,53 +9,53 @@ export type SuggestionConfig =
8
9
  | string
9
10
  | { title: string; label: string; prompt: string };
10
11
 
11
- const SuggestionClient = resource(
12
- (state: SuggestionState): ClientOutput<"suggestion"> => {
13
- return {
14
- getState: () => state,
15
- };
16
- },
17
- );
12
+ const SuggestionClient = resource(function SuggestionClient(
13
+ state: SuggestionState,
14
+ ): ClientOutput<"suggestion"> {
15
+ return {
16
+ getState: () => state,
17
+ };
18
+ });
18
19
 
19
- const SuggestionsResource = resource(
20
- (suggestions?: SuggestionConfig[]): ClientOutput<"suggestions"> => {
21
- const [state] = tapState<SuggestionsState>(() => {
22
- const normalizedSuggestions = (suggestions ?? []).map((s) => {
23
- if (typeof s === "string") {
24
- return {
25
- title: s,
26
- label: "",
27
- prompt: s,
28
- };
29
- }
20
+ const SuggestionsResource = resource(function SuggestionsResource(
21
+ suggestions?: SuggestionConfig[],
22
+ ): ClientOutput<"suggestions"> {
23
+ const [state] = useState<SuggestionsState>(() => {
24
+ const normalizedSuggestions = (suggestions ?? []).map((s) => {
25
+ if (typeof s === "string") {
30
26
  return {
31
- title: s.title,
32
- label: s.label,
33
- prompt: s.prompt,
27
+ title: s,
28
+ label: "",
29
+ prompt: s,
34
30
  };
35
- });
36
-
31
+ }
37
32
  return {
38
- suggestions: normalizedSuggestions,
33
+ title: s.title,
34
+ label: s.label,
35
+ prompt: s.prompt,
39
36
  };
40
37
  });
41
38
 
42
- const suggestionClients = tapClientLookup(
43
- () =>
44
- state.suggestions.map((suggestion, index) =>
45
- withKey(index, SuggestionClient(suggestion)),
46
- ),
47
- [state.suggestions],
48
- );
49
-
50
39
  return {
51
- getState: () => state,
52
- suggestion: ({ index }: { index: number }) => {
53
- return suggestionClients.get({ index });
54
- },
40
+ suggestions: normalizedSuggestions,
55
41
  };
56
- },
57
- );
42
+ });
43
+
44
+ const suggestionClients = useClientLookup(
45
+ () =>
46
+ state.suggestions.map((suggestion, index) =>
47
+ withKey(index, SuggestionClient(suggestion)),
48
+ ),
49
+ [state.suggestions],
50
+ );
51
+
52
+ return {
53
+ getState: () => state,
54
+ suggestion: ({ index }: { index: number }) => {
55
+ return suggestionClients.get({ index });
56
+ },
57
+ };
58
+ });
58
59
 
59
60
  export const Suggestions: {
60
61
  (): import("@assistant-ui/tap").ResourceElement<
@@ -4,49 +4,46 @@ import type {
4
4
  ThreadMessage,
5
5
  } from "../../types/message";
6
6
  import type { Attachment } from "../../types/attachment";
7
- import {
8
- resource,
9
- tapMemo,
10
- tapState,
11
- tapResource,
12
- withKey,
13
- } from "@assistant-ui/tap";
7
+ import { useMemo, useState } from "react";
8
+ import { useResource, resource, withKey } from "@assistant-ui/tap";
14
9
  import type { ClientOutput } from "@assistant-ui/store";
15
- import { tapClientLookup } from "@assistant-ui/store";
10
+ import { useClientLookup } from "@assistant-ui/store";
16
11
  import type { MessageState } from "../scopes/message";
17
12
  import type { PartState } from "../scopes/part";
18
13
  import { NoOpComposerClient } from "./no-op-composer-client";
19
14
 
20
- const ThreadMessagePartClient = resource(
21
- ({
22
- part,
23
- }: {
24
- part: ThreadAssistantMessagePart | ThreadUserMessagePart;
25
- }): ClientOutput<"part"> => {
26
- const state = tapMemo<PartState>(() => {
27
- return {
28
- ...part,
29
- status: { type: "complete" },
30
- };
31
- }, [part]);
32
-
15
+ const ThreadMessagePartClient = resource(function ThreadMessagePartClient({
16
+ part,
17
+ }: {
18
+ part: ThreadAssistantMessagePart | ThreadUserMessagePart;
19
+ }): ClientOutput<"part"> {
20
+ const state = useMemo<PartState>(() => {
33
21
  return {
34
- getState: () => state,
35
- addToolResult: () => {
36
- throw new Error("Not supported");
37
- },
38
- resumeToolCall: () => {
39
- throw new Error("Not supported");
40
- },
41
- respondToToolApproval: () => {
42
- throw new Error("Not supported");
43
- },
22
+ ...part,
23
+ status: { type: "complete" },
44
24
  };
45
- },
46
- );
25
+ }, [part]);
26
+
27
+ return {
28
+ getState: () => state,
29
+ addToolResult: () => {
30
+ throw new Error("Not supported");
31
+ },
32
+ resumeToolCall: () => {
33
+ throw new Error("Not supported");
34
+ },
35
+ respondToToolApproval: () => {
36
+ throw new Error("Not supported");
37
+ },
38
+ };
39
+ });
47
40
 
48
41
  const ThreadMessageAttachmentClient = resource(
49
- ({ attachment }: { attachment: Attachment }): ClientOutput<"attachment"> => {
42
+ function ThreadMessageAttachmentClient({
43
+ attachment,
44
+ }: {
45
+ attachment: Attachment;
46
+ }): ClientOutput<"attachment"> {
50
47
  return {
51
48
  getState: () => attachment,
52
49
  remove: () => {
@@ -63,111 +60,109 @@ export type ThreadMessageClientProps = {
63
60
  branchCount?: number;
64
61
  };
65
62
 
66
- export const ThreadMessageClient = resource(
67
- ({
68
- message,
69
- index,
70
- isLast = true,
71
- branchNumber = 1,
72
- branchCount = 1,
73
- }: ThreadMessageClientProps): ClientOutput<"message"> => {
74
- const [isCopiedState, setIsCopied] = tapState(false);
75
- const [isHoveringState, setIsHovering] = tapState(false);
63
+ export const ThreadMessageClient = resource(function ThreadMessageClient({
64
+ message,
65
+ index,
66
+ isLast = true,
67
+ branchNumber = 1,
68
+ branchCount = 1,
69
+ }: ThreadMessageClientProps): ClientOutput<"message"> {
70
+ const [isCopiedState, setIsCopied] = useState(false);
71
+ const [isHoveringState, setIsHovering] = useState(false);
76
72
 
77
- const parts = tapClientLookup(
78
- () =>
79
- message.content.map((part, idx) =>
80
- withKey(
81
- "toolCallId" in part && part.toolCallId != null
82
- ? `toolCallId-${part.toolCallId}`
83
- : `index-${idx}`,
84
- ThreadMessagePartClient({ part }),
85
- ),
73
+ const parts = useClientLookup(
74
+ () =>
75
+ message.content.map((part, idx) =>
76
+ withKey(
77
+ "toolCallId" in part && part.toolCallId != null
78
+ ? `toolCallId-${part.toolCallId}`
79
+ : `index-${idx}`,
80
+ ThreadMessagePartClient({ part }),
86
81
  ),
87
- [message.content],
88
- );
82
+ ),
83
+ [message.content],
84
+ );
89
85
 
90
- const attachments = tapClientLookup(
91
- () =>
92
- (message.attachments ?? []).map((attachment) =>
93
- withKey(attachment.id, ThreadMessageAttachmentClient({ attachment })),
94
- ),
95
- [message.attachments],
96
- );
86
+ const attachments = useClientLookup(
87
+ () =>
88
+ (message.attachments ?? []).map((attachment) =>
89
+ withKey(attachment.id, ThreadMessageAttachmentClient({ attachment })),
90
+ ),
91
+ [message.attachments],
92
+ );
97
93
 
98
- const composer = tapResource(NoOpComposerClient({ type: "edit" }));
99
- const composerState = composer.getState();
94
+ const composer = useResource(NoOpComposerClient({ type: "edit" }));
95
+ const composerState = composer.getState();
100
96
 
101
- const state = tapMemo<MessageState>(() => {
102
- return {
103
- ...message,
104
- parts: parts.state,
105
- composer: composerState,
106
- parentId: null,
107
- index,
108
- isLast,
109
- branchNumber,
110
- branchCount,
111
- speech: undefined,
112
- isCopied: isCopiedState,
113
- isHovering: isHoveringState,
114
- };
115
- }, [
116
- message,
97
+ const state = useMemo<MessageState>(() => {
98
+ return {
99
+ ...message,
100
+ parts: parts.state,
101
+ composer: composerState,
102
+ parentId: null,
117
103
  index,
118
- isCopiedState,
119
- isHoveringState,
120
104
  isLast,
121
- parts.state,
122
- composerState,
123
105
  branchNumber,
124
106
  branchCount,
125
- ]);
126
-
127
- return {
128
- getState: () => state,
129
- composer: () => composer,
130
- part: (selector) => {
131
- if ("index" in selector) {
132
- return parts.get({ index: selector.index });
133
- } else {
134
- return parts.get({ key: `toolCallId-${selector.toolCallId}` });
135
- }
136
- },
137
- attachment: (selector) => {
138
- if ("id" in selector) {
139
- return attachments.get({ key: selector.id });
140
- } else {
141
- return attachments.get(selector);
142
- }
143
- },
144
- reload: () => {
145
- throw new Error("Not supported in ThreadMessageProvider");
146
- },
147
- speak: () => {
148
- throw new Error("Not supported in ThreadMessageProvider");
149
- },
150
- stopSpeaking: () => {
151
- throw new Error("Not supported in ThreadMessageProvider");
152
- },
153
- submitFeedback: () => {
154
- throw new Error("Not supported in ThreadMessageProvider");
155
- },
156
- switchToBranch: () => {
157
- throw new Error("Not supported in ThreadMessageProvider");
158
- },
159
- getCopyText: () => {
160
- return message.content
161
- .map((part) => {
162
- if ("text" in part && typeof part.text === "string") {
163
- return part.text;
164
- }
165
- return "";
166
- })
167
- .join("\n");
168
- },
169
- setIsCopied,
170
- setIsHovering,
107
+ speech: undefined,
108
+ isCopied: isCopiedState,
109
+ isHovering: isHoveringState,
171
110
  };
172
- },
173
- );
111
+ }, [
112
+ message,
113
+ index,
114
+ isCopiedState,
115
+ isHoveringState,
116
+ isLast,
117
+ parts.state,
118
+ composerState,
119
+ branchNumber,
120
+ branchCount,
121
+ ]);
122
+
123
+ return {
124
+ getState: () => state,
125
+ composer: () => composer,
126
+ part: (selector) => {
127
+ if ("index" in selector) {
128
+ return parts.get({ index: selector.index });
129
+ } else {
130
+ return parts.get({ key: `toolCallId-${selector.toolCallId}` });
131
+ }
132
+ },
133
+ attachment: (selector) => {
134
+ if ("id" in selector) {
135
+ return attachments.get({ key: selector.id });
136
+ } else {
137
+ return attachments.get(selector);
138
+ }
139
+ },
140
+ reload: () => {
141
+ throw new Error("Not supported in ThreadMessageProvider");
142
+ },
143
+ speak: () => {
144
+ throw new Error("Not supported in ThreadMessageProvider");
145
+ },
146
+ stopSpeaking: () => {
147
+ throw new Error("Not supported in ThreadMessageProvider");
148
+ },
149
+ submitFeedback: () => {
150
+ throw new Error("Not supported in ThreadMessageProvider");
151
+ },
152
+ switchToBranch: () => {
153
+ throw new Error("Not supported in ThreadMessageProvider");
154
+ },
155
+ getCopyText: () => {
156
+ return message.content
157
+ .map((part) => {
158
+ if ("text" in part && typeof part.text === "string") {
159
+ return part.text;
160
+ }
161
+ return "";
162
+ })
163
+ .join("\n");
164
+ },
165
+ setIsCopied,
166
+ setIsHovering,
167
+ };
168
+ });
@@ -1,11 +1,15 @@
1
1
  import { resource } from "@assistant-ui/tap";
2
2
  import type { ClientOutput } from "@assistant-ui/store";
3
3
  import type { AttachmentRuntime } from "../../runtime/api/attachment-runtime";
4
- import { tapSubscribable } from "./tap-subscribable";
4
+ import { useSubscribable } from "./useSubscribable";
5
5
 
6
6
  export const AttachmentRuntimeClient = resource(
7
- ({ runtime }: { runtime: AttachmentRuntime }): ClientOutput<"attachment"> => {
8
- const state = tapSubscribable(runtime);
7
+ function AttachmentRuntimeClient({
8
+ runtime,
9
+ }: {
10
+ runtime: AttachmentRuntime;
11
+ }): ClientOutput<"attachment"> {
12
+ const state = useSubscribable(runtime);
9
13
 
10
14
  return {
11
15
  getState: () => state,