@assistant-ui/react 0.7.91 → 0.8.1

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 (304) hide show
  1. package/dist/cloud/auiV0.js.map +1 -1
  2. package/dist/cloud/auiV0.mjs.map +1 -1
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +0 -1
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/internal.d.ts +0 -1
  10. package/dist/internal.d.ts.map +1 -1
  11. package/dist/internal.js +0 -3
  12. package/dist/internal.js.map +1 -1
  13. package/dist/internal.mjs +0 -2
  14. package/dist/internal.mjs.map +1 -1
  15. package/dist/model-context/ModelContextTypes.d.ts +11 -0
  16. package/dist/model-context/ModelContextTypes.d.ts.map +1 -1
  17. package/dist/model-context/ModelContextTypes.js.map +1 -1
  18. package/dist/model-context/ModelContextTypes.mjs.map +1 -1
  19. package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
  20. package/dist/model-context/makeAssistantVisible.js +4 -2
  21. package/dist/model-context/makeAssistantVisible.js.map +1 -1
  22. package/dist/model-context/makeAssistantVisible.mjs +4 -2
  23. package/dist/model-context/makeAssistantVisible.mjs.map +1 -1
  24. package/dist/primitives/contentPart/index.d.ts +0 -1
  25. package/dist/primitives/contentPart/index.d.ts.map +1 -1
  26. package/dist/primitives/contentPart/index.js +0 -3
  27. package/dist/primitives/contentPart/index.js.map +1 -1
  28. package/dist/primitives/contentPart/index.mjs +0 -2
  29. package/dist/primitives/contentPart/index.mjs.map +1 -1
  30. package/dist/primitives/index.d.ts +0 -1
  31. package/dist/primitives/index.d.ts.map +1 -1
  32. package/dist/primitives/index.js +0 -3
  33. package/dist/primitives/index.js.map +1 -1
  34. package/dist/primitives/index.mjs +0 -2
  35. package/dist/primitives/index.mjs.map +1 -1
  36. package/dist/primitives/message/MessageContent.d.ts +1 -2
  37. package/dist/primitives/message/MessageContent.d.ts.map +1 -1
  38. package/dist/primitives/message/MessageContent.js +2 -7
  39. package/dist/primitives/message/MessageContent.js.map +1 -1
  40. package/dist/primitives/message/MessageContent.mjs +2 -7
  41. package/dist/primitives/message/MessageContent.mjs.map +1 -1
  42. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
  43. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js +1 -3
  44. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
  45. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs +1 -3
  46. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs.map +1 -1
  47. package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
  48. package/dist/runtimes/edge/converters/toCoreMessages.js +1 -6
  49. package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
  50. package/dist/runtimes/edge/converters/toCoreMessages.mjs +1 -6
  51. package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
  52. package/dist/runtimes/edge/converters/toLanguageModelMessages.js.map +1 -1
  53. package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs.map +1 -1
  54. package/dist/runtimes/external-store/ThreadMessageLike.d.ts +2 -2
  55. package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
  56. package/dist/runtimes/external-store/ThreadMessageLike.js +0 -3
  57. package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
  58. package/dist/runtimes/external-store/ThreadMessageLike.mjs +0 -3
  59. package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
  60. package/dist/runtimes/remote-thread-list/adapter/cloud.d.ts.map +1 -1
  61. package/dist/runtimes/remote-thread-list/adapter/cloud.js +1 -7
  62. package/dist/runtimes/remote-thread-list/adapter/cloud.js.map +1 -1
  63. package/dist/runtimes/remote-thread-list/adapter/cloud.mjs +1 -7
  64. package/dist/runtimes/remote-thread-list/adapter/cloud.mjs.map +1 -1
  65. package/dist/types/AssistantTypes.d.ts +3 -7
  66. package/dist/types/AssistantTypes.d.ts.map +1 -1
  67. package/dist/types/AssistantTypes.js.map +1 -1
  68. package/dist/types/ContentPartComponentTypes.d.ts +1 -3
  69. package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
  70. package/dist/types/ContentPartComponentTypes.js.map +1 -1
  71. package/dist/types/index.d.ts +1 -1
  72. package/dist/types/index.d.ts.map +1 -1
  73. package/dist/types/index.js.map +1 -1
  74. package/package.json +1 -21
  75. package/src/cloud/auiV0.ts +1 -1
  76. package/src/index.ts +0 -1
  77. package/src/internal.ts +0 -1
  78. package/src/model-context/ModelContextTypes.ts +19 -0
  79. package/src/model-context/makeAssistantVisible.tsx +4 -2
  80. package/src/primitives/contentPart/index.ts +0 -1
  81. package/src/primitives/index.ts +0 -1
  82. package/src/primitives/message/MessageContent.tsx +0 -9
  83. package/src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx +1 -3
  84. package/src/runtimes/edge/converters/toCoreMessages.ts +11 -14
  85. package/src/runtimes/edge/converters/toLanguageModelMessages.ts +2 -2
  86. package/src/runtimes/external-store/ThreadMessageLike.tsx +0 -6
  87. package/src/runtimes/remote-thread-list/adapter/cloud.tsx +4 -13
  88. package/src/types/AssistantTypes.ts +4 -9
  89. package/src/types/ContentPartComponentTypes.tsx +0 -4
  90. package/src/types/index.ts +0 -2
  91. package/dist/primitives/contentPart/ContentPartDisplay.d.ts +0 -9
  92. package/dist/primitives/contentPart/ContentPartDisplay.d.ts.map +0 -1
  93. package/dist/primitives/contentPart/ContentPartDisplay.js +0 -37
  94. package/dist/primitives/contentPart/ContentPartDisplay.js.map +0 -1
  95. package/dist/primitives/contentPart/ContentPartDisplay.mjs +0 -13
  96. package/dist/primitives/contentPart/ContentPartDisplay.mjs.map +0 -1
  97. package/dist/primitives/contentPart/useContentPartDisplay.d.ts +0 -8
  98. package/dist/primitives/contentPart/useContentPartDisplay.d.ts.map +0 -1
  99. package/dist/primitives/contentPart/useContentPartDisplay.js +0 -42
  100. package/dist/primitives/contentPart/useContentPartDisplay.js.map +0 -1
  101. package/dist/primitives/contentPart/useContentPartDisplay.mjs +0 -18
  102. package/dist/primitives/contentPart/useContentPartDisplay.mjs.map +0 -1
  103. package/dist/styles/index.css +0 -1261
  104. package/dist/styles/index.css.map +0 -1
  105. package/dist/styles/modal.css +0 -143
  106. package/dist/styles/modal.css.map +0 -1
  107. package/dist/styles/tailwindcss/base-components.css +0 -69
  108. package/dist/styles/tailwindcss/base-components.css.json +0 -48
  109. package/dist/styles/tailwindcss/modal.css +0 -29
  110. package/dist/styles/tailwindcss/modal.css.json +0 -26
  111. package/dist/styles/tailwindcss/thread.css +0 -262
  112. package/dist/styles/tailwindcss/thread.css.json +0 -183
  113. package/dist/styles/themes/default.css +0 -64
  114. package/dist/styles/themes/default.css.json +0 -46
  115. package/dist/styles/themes/shadcn-extras.css +0 -4
  116. package/dist/styles/themes/shadcn-extras.css.json +0 -5
  117. package/dist/tailwindcss/index.d.ts +0 -49
  118. package/dist/tailwindcss/index.d.ts.map +0 -1
  119. package/dist/tailwindcss/index.js +0 -189
  120. package/dist/tailwindcss/index.js.map +0 -1
  121. package/dist/tailwindcss/index.mjs +0 -181
  122. package/dist/tailwindcss/index.mjs.map +0 -1
  123. package/dist/ui/assistant-action-bar.d.ts +0 -24
  124. package/dist/ui/assistant-action-bar.d.ts.map +0 -1
  125. package/dist/ui/assistant-action-bar.js +0 -193
  126. package/dist/ui/assistant-action-bar.js.map +0 -1
  127. package/dist/ui/assistant-action-bar.mjs +0 -181
  128. package/dist/ui/assistant-action-bar.mjs.map +0 -1
  129. package/dist/ui/assistant-message.d.ts +0 -13
  130. package/dist/ui/assistant-message.d.ts.map +0 -1
  131. package/dist/ui/assistant-message.js +0 -107
  132. package/dist/ui/assistant-message.js.map +0 -1
  133. package/dist/ui/assistant-message.mjs +0 -77
  134. package/dist/ui/assistant-message.mjs.map +0 -1
  135. package/dist/ui/assistant-modal.d.ts +0 -23
  136. package/dist/ui/assistant-modal.d.ts.map +0 -1
  137. package/dist/ui/assistant-modal.js +0 -126
  138. package/dist/ui/assistant-modal.js.map +0 -1
  139. package/dist/ui/assistant-modal.mjs +0 -99
  140. package/dist/ui/assistant-modal.mjs.map +0 -1
  141. package/dist/ui/attachment-ui.d.ts +0 -12
  142. package/dist/ui/attachment-ui.d.ts.map +0 -1
  143. package/dist/ui/attachment-ui.js +0 -170
  144. package/dist/ui/attachment-ui.js.map +0 -1
  145. package/dist/ui/attachment-ui.mjs +0 -160
  146. package/dist/ui/attachment-ui.mjs.map +0 -1
  147. package/dist/ui/base/CircleStopIcon.d.ts +0 -3
  148. package/dist/ui/base/CircleStopIcon.d.ts.map +0 -1
  149. package/dist/ui/base/CircleStopIcon.js +0 -45
  150. package/dist/ui/base/CircleStopIcon.js.map +0 -1
  151. package/dist/ui/base/CircleStopIcon.mjs +0 -20
  152. package/dist/ui/base/CircleStopIcon.mjs.map +0 -1
  153. package/dist/ui/base/avatar.d.ts +0 -12
  154. package/dist/ui/base/avatar.d.ts.map +0 -1
  155. package/dist/ui/base/avatar.js +0 -69
  156. package/dist/ui/base/avatar.js.map +0 -1
  157. package/dist/ui/base/avatar.mjs +0 -31
  158. package/dist/ui/base/avatar.mjs.map +0 -1
  159. package/dist/ui/base/button.d.ts +0 -16
  160. package/dist/ui/base/button.d.ts.map +0 -1
  161. package/dist/ui/base/button.js +0 -66
  162. package/dist/ui/base/button.js.map +0 -1
  163. package/dist/ui/base/button.mjs +0 -40
  164. package/dist/ui/base/button.mjs.map +0 -1
  165. package/dist/ui/base/dialog.d.ts +0 -9
  166. package/dist/ui/base/dialog.d.ts.map +0 -1
  167. package/dist/ui/base/dialog.js +0 -80
  168. package/dist/ui/base/dialog.js.map +0 -1
  169. package/dist/ui/base/dialog.mjs +0 -40
  170. package/dist/ui/base/dialog.mjs.map +0 -1
  171. package/dist/ui/base/index.d.ts +0 -6
  172. package/dist/ui/base/index.d.ts.map +0 -1
  173. package/dist/ui/base/index.js +0 -55
  174. package/dist/ui/base/index.js.map +0 -1
  175. package/dist/ui/base/index.mjs +0 -25
  176. package/dist/ui/base/index.mjs.map +0 -1
  177. package/dist/ui/base/tooltip-icon-button.d.ts +0 -17
  178. package/dist/ui/base/tooltip-icon-button.d.ts.map +0 -1
  179. package/dist/ui/base/tooltip-icon-button.js +0 -44
  180. package/dist/ui/base/tooltip-icon-button.js.map +0 -1
  181. package/dist/ui/base/tooltip-icon-button.mjs +0 -19
  182. package/dist/ui/base/tooltip-icon-button.mjs.map +0 -1
  183. package/dist/ui/base/tooltip.d.ts +0 -6
  184. package/dist/ui/base/tooltip.d.ts.map +0 -1
  185. package/dist/ui/base/tooltip.js +0 -57
  186. package/dist/ui/base/tooltip.js.map +0 -1
  187. package/dist/ui/base/tooltip.mjs +0 -20
  188. package/dist/ui/base/tooltip.mjs.map +0 -1
  189. package/dist/ui/branch-picker.d.ts +0 -15
  190. package/dist/ui/branch-picker.d.ts.map +0 -1
  191. package/dist/ui/branch-picker.js +0 -89
  192. package/dist/ui/branch-picker.js.map +0 -1
  193. package/dist/ui/branch-picker.mjs +0 -69
  194. package/dist/ui/branch-picker.mjs.map +0 -1
  195. package/dist/ui/composer.d.ts +0 -25
  196. package/dist/ui/composer.d.ts.map +0 -1
  197. package/dist/ui/composer.js +0 -168
  198. package/dist/ui/composer.js.map +0 -1
  199. package/dist/ui/composer.mjs +0 -138
  200. package/dist/ui/composer.mjs.map +0 -1
  201. package/dist/ui/content-part.d.ts +0 -7
  202. package/dist/ui/content-part.d.ts.map +0 -1
  203. package/dist/ui/content-part.js +0 -61
  204. package/dist/ui/content-part.js.map +0 -1
  205. package/dist/ui/content-part.mjs +0 -27
  206. package/dist/ui/content-part.mjs.map +0 -1
  207. package/dist/ui/edit-composer.d.ts +0 -22
  208. package/dist/ui/edit-composer.d.ts.map +0 -1
  209. package/dist/ui/edit-composer.js +0 -77
  210. package/dist/ui/edit-composer.js.map +0 -1
  211. package/dist/ui/edit-composer.mjs +0 -57
  212. package/dist/ui/edit-composer.mjs.map +0 -1
  213. package/dist/ui/index.d.ts +0 -75
  214. package/dist/ui/index.d.ts.map +0 -1
  215. package/dist/ui/index.js +0 -86
  216. package/dist/ui/index.js.map +0 -1
  217. package/dist/ui/index.mjs +0 -38
  218. package/dist/ui/index.mjs.map +0 -1
  219. package/dist/ui/thread-config.d.ts +0 -162
  220. package/dist/ui/thread-config.d.ts.map +0 -1
  221. package/dist/ui/thread-config.js +0 -63
  222. package/dist/ui/thread-config.js.map +0 -1
  223. package/dist/ui/thread-config.mjs +0 -41
  224. package/dist/ui/thread-config.mjs.map +0 -1
  225. package/dist/ui/thread-list-item.d.ts +0 -13
  226. package/dist/ui/thread-list-item.d.ts.map +0 -1
  227. package/dist/ui/thread-list-item.js +0 -94
  228. package/dist/ui/thread-list-item.js.map +0 -1
  229. package/dist/ui/thread-list-item.mjs +0 -64
  230. package/dist/ui/thread-list-item.mjs.map +0 -1
  231. package/dist/ui/thread-list.d.ts +0 -27
  232. package/dist/ui/thread-list.d.ts.map +0 -1
  233. package/dist/ui/thread-list.js +0 -91
  234. package/dist/ui/thread-list.js.map +0 -1
  235. package/dist/ui/thread-list.mjs +0 -61
  236. package/dist/ui/thread-list.mjs.map +0 -1
  237. package/dist/ui/thread-welcome.d.ts +0 -21
  238. package/dist/ui/thread-welcome.d.ts.map +0 -1
  239. package/dist/ui/thread-welcome.js +0 -101
  240. package/dist/ui/thread-welcome.js.map +0 -1
  241. package/dist/ui/thread-welcome.mjs +0 -81
  242. package/dist/ui/thread-welcome.mjs.map +0 -1
  243. package/dist/ui/thread.d.ts +0 -30
  244. package/dist/ui/thread.d.ts.map +0 -1
  245. package/dist/ui/thread.js +0 -152
  246. package/dist/ui/thread.js.map +0 -1
  247. package/dist/ui/thread.mjs +0 -125
  248. package/dist/ui/thread.mjs.map +0 -1
  249. package/dist/ui/user-action-bar.d.ts +0 -16
  250. package/dist/ui/user-action-bar.d.ts.map +0 -1
  251. package/dist/ui/user-action-bar.js +0 -63
  252. package/dist/ui/user-action-bar.js.map +0 -1
  253. package/dist/ui/user-action-bar.mjs +0 -43
  254. package/dist/ui/user-action-bar.mjs.map +0 -1
  255. package/dist/ui/user-message.d.ts +0 -13
  256. package/dist/ui/user-message.d.ts.map +0 -1
  257. package/dist/ui/user-message.js +0 -96
  258. package/dist/ui/user-message.js.map +0 -1
  259. package/dist/ui/user-message.mjs +0 -65
  260. package/dist/ui/user-message.mjs.map +0 -1
  261. package/dist/ui/utils/withDefaults.d.ts +0 -7
  262. package/dist/ui/utils/withDefaults.d.ts.map +0 -1
  263. package/dist/ui/utils/withDefaults.js +0 -66
  264. package/dist/ui/utils/withDefaults.js.map +0 -1
  265. package/dist/ui/utils/withDefaults.mjs +0 -30
  266. package/dist/ui/utils/withDefaults.mjs.map +0 -1
  267. package/src/primitives/contentPart/ContentPartDisplay.tsx +0 -20
  268. package/src/primitives/contentPart/useContentPartDisplay.tsx +0 -21
  269. package/src/styles/base.css +0 -37
  270. package/src/styles/index.css +0 -4
  271. package/src/styles/modal.css +0 -1
  272. package/src/styles/tailwindcss/base-components.css +0 -69
  273. package/src/styles/tailwindcss/modal.css +0 -29
  274. package/src/styles/tailwindcss/thread.css +0 -262
  275. package/src/styles/themes/default.css +0 -64
  276. package/src/styles/themes/shadcn-extras.css +0 -4
  277. package/src/tailwindcss/index.ts +0 -149
  278. package/src/ui/assistant-action-bar.tsx +0 -301
  279. package/src/ui/assistant-message.tsx +0 -96
  280. package/src/ui/assistant-modal.tsx +0 -146
  281. package/src/ui/attachment-ui.tsx +0 -211
  282. package/src/ui/base/CircleStopIcon.tsx +0 -17
  283. package/src/ui/base/avatar.tsx +0 -41
  284. package/src/ui/base/button.tsx +0 -42
  285. package/src/ui/base/dialog.tsx +0 -113
  286. package/src/ui/base/index.ts +0 -15
  287. package/src/ui/base/tooltip-icon-button.tsx +0 -29
  288. package/src/ui/base/tooltip.tsx +0 -22
  289. package/src/ui/branch-picker.tsx +0 -117
  290. package/src/ui/composer.tsx +0 -210
  291. package/src/ui/content-part.tsx +0 -23
  292. package/src/ui/edit-composer.tsx +0 -98
  293. package/src/ui/index.ts +0 -98
  294. package/src/ui/thread-config.tsx +0 -246
  295. package/src/ui/thread-list-item.tsx +0 -91
  296. package/src/ui/thread-list.tsx +0 -78
  297. package/src/ui/thread-welcome.tsx +0 -140
  298. package/src/ui/thread.tsx +0 -176
  299. package/src/ui/user-action-bar.tsx +0 -66
  300. package/src/ui/user-message.tsx +0 -92
  301. package/src/ui/utils/withDefaults.tsx +0 -35
  302. package/tailwindcss/README.md +0 -1
  303. package/tailwindcss/package-lock.json +0 -6
  304. package/tailwindcss/package.json +0 -5
@@ -11,13 +11,7 @@ import { RuntimeAdapterProvider } from "../../adapters/RuntimeAdapterProvider.mj
11
11
  import { toCoreMessages } from "../../edge/index.mjs";
12
12
  import { InMemoryThreadListAdapter } from "./in-memory.mjs";
13
13
  import { jsx } from "react/jsx-runtime";
14
- var getEnvVariable = (name) => {
15
- if (typeof process !== "undefined" && process.env && typeof process.env[name] === "string") {
16
- return process.env[name];
17
- }
18
- return void 0;
19
- };
20
- var baseUrl = getEnvVariable("NEXT_PUBLIC_ASSISTANT_BASE_URL");
14
+ var baseUrl = typeof process !== "undefined" && process?.env?.["NEXT_PUBLIC_ASSISTANT_BASE_URL"];
21
15
  var autoCloud = baseUrl ? new AssistantCloud({ baseUrl, anonymous: true }) : void 0;
22
16
  var useCloudThreadListAdapter = (adapter) => {
23
17
  const adapterRef = useRef(adapter);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/runtimes/remote-thread-list/adapter/cloud.tsx"],"sourcesContent":["import {\n FC,\n PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport { AssistantCloud } from \"../../../cloud\";\nimport { RemoteThreadListAdapter } from \"../types\";\nimport { useAssistantCloudThreadHistoryAdapter } from \"../../../cloud/AssistantCloudThreadHistoryAdapter\";\nimport { RuntimeAdapterProvider } from \"../../adapters/RuntimeAdapterProvider\";\nimport { toCoreMessages } from \"../../edge\";\nimport { InMemoryThreadListAdapter } from \"./in-memory\";\n\ntype ThreadData = {\n externalId: string;\n};\ntype CloudThreadListAdapterOptions = {\n cloud?: AssistantCloud | undefined;\n\n create?(): Promise<ThreadData>;\n delete?(threadId: string): Promise<void>;\n};\n\nconst getEnvVariable = (name: string): string | undefined => {\n if (\n typeof process !== \"undefined\" &&\n process.env &&\n typeof process.env[name] === \"string\"\n ) {\n return process.env[name];\n }\n\n return undefined;\n};\n\nconst baseUrl = getEnvVariable(\"NEXT_PUBLIC_ASSISTANT_BASE_URL\");\nconst autoCloud = baseUrl\n ? new AssistantCloud({ baseUrl, anonymous: true })\n : undefined;\n\nexport const useCloudThreadListAdapter = (\n adapter: CloudThreadListAdapterOptions,\n): RemoteThreadListAdapter => {\n const adapterRef = useRef(adapter);\n useEffect(() => {\n adapterRef.current = adapter;\n }, [adapter]);\n\n const unstable_Provider = useCallback<FC<PropsWithChildren>>(\n ({ children }) => {\n const history = useAssistantCloudThreadHistoryAdapter({\n get current() {\n return adapterRef.current.cloud ?? autoCloud!;\n },\n });\n const adapters = useMemo(() => ({ history }), [history]);\n\n return (\n <RuntimeAdapterProvider adapters={adapters}>\n {children}\n </RuntimeAdapterProvider>\n );\n },\n [],\n );\n\n const cloud = adapter.cloud ?? autoCloud;\n if (!cloud) return new InMemoryThreadListAdapter();\n\n return {\n list: async () => {\n const { threads } = await cloud.threads.list();\n return {\n threads: threads.map((t) => ({\n status: t.is_archived ? \"archived\" : \"regular\",\n remoteId: t.id,\n title: t.title,\n externalId: t.external_id ?? undefined,\n })),\n };\n },\n\n initialize: async () => {\n const createTask = adapter.create?.() ?? Promise.resolve();\n const t = await createTask;\n const external_id = t ? t.externalId : undefined;\n const { thread_id: remoteId } = await cloud.threads.create({\n last_message_at: new Date(),\n external_id,\n });\n\n return { externalId: external_id, remoteId: remoteId };\n },\n\n rename: async (threadId, newTitle) => {\n return cloud.threads.update(threadId, { title: newTitle });\n },\n archive: async (threadId) => {\n return cloud.threads.update(threadId, { is_archived: true });\n },\n unarchive: async (threadId) => {\n return cloud.threads.update(threadId, { is_archived: false });\n },\n delete: async (threadId) => {\n await adapter.delete?.(threadId);\n return cloud.threads.delete(threadId);\n },\n\n generateTitle: async (threadId, messages) => {\n return cloud.runs.stream({\n thread_id: threadId,\n assistant_id: \"system/thread_title\",\n messages: toCoreMessages(messages),\n });\n },\n\n unstable_Provider,\n };\n};\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAE/B,SAAS,6CAA6C;AACtD,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,iCAAiC;AA+ClC;AAnCR,IAAM,iBAAiB,CAAC,SAAqC;AAC3D,MACE,OAAO,YAAY,eACnB,QAAQ,OACR,OAAO,QAAQ,IAAI,IAAI,MAAM,UAC7B;AACA,WAAO,QAAQ,IAAI,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;AAEA,IAAM,UAAU,eAAe,gCAAgC;AAC/D,IAAM,YAAY,UACd,IAAI,eAAe,EAAE,SAAS,WAAW,KAAK,CAAC,IAC/C;AAEG,IAAM,4BAA4B,CACvC,YAC4B;AAC5B,QAAM,aAAa,OAAO,OAAO;AACjC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,oBAAoB;AAAA,IACxB,CAAC,EAAE,SAAS,MAAM;AAChB,YAAM,UAAU,sCAAsC;AAAA,QACpD,IAAI,UAAU;AACZ,iBAAO,WAAW,QAAQ,SAAS;AAAA,QACrC;AAAA,MACF,CAAC;AACD,YAAM,WAAW,QAAQ,OAAO,EAAE,QAAQ,IAAI,CAAC,OAAO,CAAC;AAEvD,aACE,oBAAC,0BAAuB,UACrB,UACH;AAAA,IAEJ;AAAA,IACA,CAAC;AAAA,EAC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c;AAAA,QACd,UAAU,eAAe,QAAQ;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,IAEA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/runtimes/remote-thread-list/adapter/cloud.tsx"],"sourcesContent":["import {\n FC,\n PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport { AssistantCloud } from \"../../../cloud\";\nimport { RemoteThreadListAdapter } from \"../types\";\nimport { useAssistantCloudThreadHistoryAdapter } from \"../../../cloud/AssistantCloudThreadHistoryAdapter\";\nimport { RuntimeAdapterProvider } from \"../../adapters/RuntimeAdapterProvider\";\nimport { toCoreMessages } from \"../../edge\";\nimport { InMemoryThreadListAdapter } from \"./in-memory\";\n\ntype ThreadData = {\n externalId: string;\n};\n\ntype CloudThreadListAdapterOptions = {\n cloud?: AssistantCloud | undefined;\n\n create?(): Promise<ThreadData>;\n delete?(threadId: string): Promise<void>;\n};\n\nconst baseUrl =\n typeof process !== \"undefined\" &&\n process?.env?.[\"NEXT_PUBLIC_ASSISTANT_BASE_URL\"];\nconst autoCloud = baseUrl\n ? new AssistantCloud({ baseUrl, anonymous: true })\n : undefined;\n\nexport const useCloudThreadListAdapter = (\n adapter: CloudThreadListAdapterOptions,\n): RemoteThreadListAdapter => {\n const adapterRef = useRef(adapter);\n useEffect(() => {\n adapterRef.current = adapter;\n }, [adapter]);\n\n const unstable_Provider = useCallback<FC<PropsWithChildren>>(\n ({ children }) => {\n const history = useAssistantCloudThreadHistoryAdapter({\n get current() {\n return adapterRef.current.cloud ?? autoCloud!;\n },\n });\n const adapters = useMemo(() => ({ history }), [history]);\n\n return (\n <RuntimeAdapterProvider adapters={adapters}>\n {children}\n </RuntimeAdapterProvider>\n );\n },\n [],\n );\n\n const cloud = adapter.cloud ?? autoCloud;\n if (!cloud) return new InMemoryThreadListAdapter();\n\n return {\n list: async () => {\n const { threads } = await cloud.threads.list();\n return {\n threads: threads.map((t) => ({\n status: t.is_archived ? \"archived\" : \"regular\",\n remoteId: t.id,\n title: t.title,\n externalId: t.external_id ?? undefined,\n })),\n };\n },\n\n initialize: async () => {\n const createTask = adapter.create?.() ?? Promise.resolve();\n const t = await createTask;\n const external_id = t ? t.externalId : undefined;\n const { thread_id: remoteId } = await cloud.threads.create({\n last_message_at: new Date(),\n external_id,\n });\n\n return { externalId: external_id, remoteId: remoteId };\n },\n\n rename: async (threadId, newTitle) => {\n return cloud.threads.update(threadId, { title: newTitle });\n },\n archive: async (threadId) => {\n return cloud.threads.update(threadId, { is_archived: true });\n },\n unarchive: async (threadId) => {\n return cloud.threads.update(threadId, { is_archived: false });\n },\n delete: async (threadId) => {\n await adapter.delete?.(threadId);\n return cloud.threads.delete(threadId);\n },\n\n generateTitle: async (threadId, messages) => {\n return cloud.runs.stream({\n thread_id: threadId,\n assistant_id: \"system/thread_title\",\n messages: toCoreMessages(messages),\n });\n },\n\n unstable_Provider,\n };\n};\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAE/B,SAAS,6CAA6C;AACtD,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,iCAAiC;AAsClC;AAzBR,IAAM,UACJ,OAAO,YAAY,eACnB,SAAS,MAAM,gCAAgC;AACjD,IAAM,YAAY,UACd,IAAI,eAAe,EAAE,SAAS,WAAW,KAAK,CAAC,IAC/C;AAEG,IAAM,4BAA4B,CACvC,YAC4B;AAC5B,QAAM,aAAa,OAAO,OAAO;AACjC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,oBAAoB;AAAA,IACxB,CAAC,EAAE,SAAS,MAAM;AAChB,YAAM,UAAU,sCAAsC;AAAA,QACpD,IAAI,UAAU;AACZ,iBAAO,WAAW,QAAQ,SAAS;AAAA,QACrC;AAAA,MACF,CAAC;AACD,YAAM,WAAW,QAAQ,OAAO,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;AAAA,IACtC;AAAA,IAEA,eAAe,OAAO,UAAU,aAAa;AAC3C,aAAO,MAAM,KAAK,OAAO;AAAA,QACvB,WAAW;AAAA,QACX,cAAc;AAAA,QACd,UAAU,eAAe,QAAQ;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,IAEA;AAAA,EACF;AACF;","names":[]}
@@ -1,4 +1,3 @@
1
- import type { ReactNode } from "react";
2
1
  import { CompleteAttachment } from "./AttachmentTypes";
3
2
  import { ReadonlyJSONObject, ReadonlyJSONValue } from "../utils/json/json-value";
4
3
  export type MessageRole = "user" | "assistant" | "system";
@@ -63,10 +62,7 @@ export type Unstable_AudioContentPart = {
63
62
  * <Thread assistantMessage={{ components: { Text: MyText } }} userMessage={{ components: { Text: MyText } }} />
64
63
  * ```
65
64
  */
66
- export type UIContentPart = {
67
- readonly type: "ui";
68
- readonly display: ReactNode;
69
- };
65
+ export type UIContentPart = never;
70
66
  export type CoreToolCallContentPart<TArgs = ReadonlyJSONObject, TResult = unknown> = {
71
67
  readonly type: "tool-call";
72
68
  readonly toolCallId: string;
@@ -78,8 +74,8 @@ export type CoreToolCallContentPart<TArgs = ReadonlyJSONObject, TResult = unknow
78
74
  export type ToolCallContentPart<TArgs = ReadonlyJSONObject, TResult = unknown> = CoreToolCallContentPart<TArgs, TResult> & {
79
75
  readonly argsText: string;
80
76
  };
81
- export type ThreadUserContentPart = TextContentPart | ImageContentPart | FileContentPart | Unstable_AudioContentPart | UIContentPart;
82
- export type ThreadAssistantContentPart = TextContentPart | ReasoningContentPart | ToolCallContentPart | UIContentPart;
77
+ export type ThreadUserContentPart = TextContentPart | ImageContentPart | FileContentPart | Unstable_AudioContentPart;
78
+ export type ThreadAssistantContentPart = TextContentPart | ReasoningContentPart | ToolCallContentPart;
83
79
  type MessageCommonProps = {
84
80
  readonly id: string;
85
81
  readonly createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantTypes.d.ts","sourceRoot":"","sources":["../../src/types/AssistantTypes.ts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AC;QACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC1C,CAAC;IACF,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CAAC,mBAAmB,GAAG,iBAAiB,GAAG,sBAAsB,CAAC,CAAC;AAErE,oDAAoD;AAEpD,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,yBAAyB,CAAC;AAC9B,MAAM,MAAM,wBAAwB,GAChC,eAAe,GACf,uBAAuB,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,eAAe,GACf,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/AssistantTypes.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { CompleteAttachment } from \"./AttachmentTypes\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\n\nexport type MessageRole = \"user\" | \"assistant\" | \"system\";\n\nexport type TextContentPart = {\n readonly type: \"text\";\n readonly text: string;\n};\n\nexport type ReasoningContentPart = {\n readonly type: \"reasoning\";\n readonly text: string;\n};\n\nexport type ImageContentPart = {\n readonly type: \"image\";\n readonly image: string;\n};\n\nexport type FileContentPart = {\n readonly type: \"file\";\n readonly data: string;\n readonly mimeType: string;\n};\n\nexport type Unstable_AudioContentPart = {\n readonly type: \"audio\";\n readonly audio: {\n readonly data: string;\n readonly format: \"mp3\" | \"wav\";\n };\n};\n\n/**\n * @deprecated UI content parts are deprecated and will be removed in v0.8.0.\n * Migration guide for external-store users using UI content parts:\n * If you must, store UI elements on your external store messages, update your\n * external store converter:\n * ```ts\n * const UI_PLACEHOLDER = Object.freeze({ type: \"text\", text: \"UI content placeholder\" });\n * const convertMessage = (message: TMessage): ThreadMessageLike => ({\n * content: [\n * // other content parts,\n * UI_PLACEHOLDER\n * ],\n * });\n * ```\n *\n * Then, define a custom `TextContentPartComponent`:\n *\n * ```tsx\n * const MyText: FC = () => {\n * const isUIPlaceholder = useContentPart(p => p === UI_PLACEHOLDER);\n *\n * // this assumes that you have a `display` field on your original message objects before conversion.\n * const ui = useMessage(m => isUIPlaceholder ? getExternalStoreMessage(m).display : undefined);\n * if (ui) {\n * return ui;\n * }\n *\n * return <MarkdownText />; // your default text component\n * }\n * ```\n *\n * Pass this component to your Thread:\n *\n * ```tsx\n * <Thread assistantMessage={{ components: { Text: MyText } }} userMessage={{ components: { Text: MyText } }} />\n * ```\n */\nexport type UIContentPart = {\n readonly type: \"ui\";\n readonly display: ReactNode;\n};\n\nexport type CoreToolCallContentPart<\n TArgs = ReadonlyJSONObject,\n TResult = unknown,\n> = {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: TArgs;\n readonly result?: TResult | undefined;\n readonly isError?: boolean | undefined;\n};\n\nexport type ToolCallContentPart<\n TArgs = ReadonlyJSONObject,\n TResult = unknown,\n> = CoreToolCallContentPart<TArgs, TResult> & {\n readonly argsText: string;\n};\n\nexport type ThreadUserContentPart =\n | TextContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart\n | UIContentPart;\n\nexport type ThreadAssistantContentPart =\n | TextContentPart\n | ReasoningContentPart\n | ToolCallContentPart\n | UIContentPart;\n\ntype MessageCommonProps = {\n readonly id: string;\n readonly createdAt: Date;\n};\n\nexport type ThreadStep = {\n readonly usage?:\n | {\n readonly promptTokens: number;\n readonly completionTokens: number;\n }\n | undefined;\n};\n\nexport type ContentPartStatus =\n | {\n readonly type: \"running\";\n }\n | {\n readonly type: \"complete\";\n }\n | {\n readonly type: \"incomplete\";\n readonly reason:\n | \"cancelled\"\n | \"length\"\n | \"content-filter\"\n | \"other\"\n | \"error\";\n readonly error?: unknown;\n };\n\nexport type ToolCallContentPartStatus =\n | {\n readonly type: \"requires-action\";\n readonly reason: \"tool-calls\";\n }\n | ContentPartStatus;\n\nexport type MessageStatus =\n | {\n readonly type: \"running\";\n }\n | {\n readonly type: \"requires-action\";\n readonly reason: \"tool-calls\";\n }\n | {\n readonly type: \"complete\";\n readonly reason: \"stop\" | \"unknown\";\n }\n | {\n readonly type: \"incomplete\";\n readonly reason:\n | \"cancelled\"\n | \"tool-calls\"\n | \"length\"\n | \"content-filter\"\n | \"other\"\n | \"error\";\n readonly error?: ReadonlyJSONValue;\n };\n\nexport type ThreadSystemMessage = MessageCommonProps & {\n readonly role: \"system\";\n readonly content: readonly [TextContentPart];\n readonly metadata: {\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type ThreadUserMessage = MessageCommonProps & {\n readonly role: \"user\";\n readonly content: readonly ThreadUserContentPart[];\n readonly attachments: readonly CompleteAttachment[];\n readonly metadata: {\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type ThreadAssistantMessage = MessageCommonProps & {\n readonly role: \"assistant\";\n readonly content: readonly ThreadAssistantContentPart[];\n readonly status: MessageStatus;\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly ThreadStep[];\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type RunConfig = {\n // TODO allow user customization via global type overrides\n readonly custom?: Record<string, unknown>;\n};\n\nexport type AppendMessage = CoreMessage & {\n parentId: string | null;\n\n /** The ID of the message that was edited or undefined. */\n sourceId: string | null;\n runConfig: RunConfig | undefined;\n\n attachments: readonly CompleteAttachment[];\n startRun?: boolean | undefined;\n};\n\ntype BaseThreadMessage = {\n readonly status?: ThreadAssistantMessage[\"status\"];\n readonly metadata: {\n readonly unstable_annotations?: readonly ReadonlyJSONValue[];\n readonly unstable_data?: readonly ReadonlyJSONValue[];\n readonly steps?: readonly ThreadStep[];\n readonly custom: Record<string, unknown>;\n };\n readonly attachments?: ThreadUserMessage[\"attachments\"];\n};\n\nexport type ThreadMessage = BaseThreadMessage &\n (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage);\n\n/** Core Message Types (without UI content parts) */\n\nexport type CoreUserContentPart =\n | TextContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart;\nexport type CoreAssistantContentPart =\n | TextContentPart\n | CoreToolCallContentPart;\n\nexport type CoreSystemMessage = {\n role: \"system\";\n content: readonly [TextContentPart];\n};\n\nexport type CoreUserMessage = {\n role: \"user\";\n content: readonly CoreUserContentPart[];\n};\n\nexport type CoreAssistantMessage = {\n role: \"assistant\";\n content: readonly CoreAssistantContentPart[];\n};\n\nexport type CoreMessage =\n | CoreSystemMessage\n | CoreUserMessage\n | CoreAssistantMessage;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/AssistantTypes.ts"],"sourcesContent":["\nimport { CompleteAttachment } from \"./AttachmentTypes\";\nimport {\n ReadonlyJSONObject,\n ReadonlyJSONValue,\n} from \"../utils/json/json-value\";\n\nexport type MessageRole = \"user\" | \"assistant\" | \"system\";\n\nexport type TextContentPart = {\n readonly type: \"text\";\n readonly text: string;\n};\n\nexport type ReasoningContentPart = {\n readonly type: \"reasoning\";\n readonly text: string;\n};\n\nexport type ImageContentPart = {\n readonly type: \"image\";\n readonly image: string;\n};\n\nexport type FileContentPart = {\n readonly type: \"file\";\n readonly data: string;\n readonly mimeType: string;\n};\n\nexport type Unstable_AudioContentPart = {\n readonly type: \"audio\";\n readonly audio: {\n readonly data: string;\n readonly format: \"mp3\" | \"wav\";\n };\n};\n\n/**\n * @deprecated UI content parts are deprecated and will be removed in v0.8.0.\n * Migration guide for external-store users using UI content parts:\n * If you must, store UI elements on your external store messages, update your\n * external store converter:\n * ```ts\n * const UI_PLACEHOLDER = Object.freeze({ type: \"text\", text: \"UI content placeholder\" });\n * const convertMessage = (message: TMessage): ThreadMessageLike => ({\n * content: [\n * // other content parts,\n * UI_PLACEHOLDER\n * ],\n * });\n * ```\n *\n * Then, define a custom `TextContentPartComponent`:\n *\n * ```tsx\n * const MyText: FC = () => {\n * const isUIPlaceholder = useContentPart(p => p === UI_PLACEHOLDER);\n *\n * // this assumes that you have a `display` field on your original message objects before conversion.\n * const ui = useMessage(m => isUIPlaceholder ? getExternalStoreMessage(m).display : undefined);\n * if (ui) {\n * return ui;\n * }\n *\n * return <MarkdownText />; // your default text component\n * }\n * ```\n *\n * Pass this component to your Thread:\n *\n * ```tsx\n * <Thread assistantMessage={{ components: { Text: MyText } }} userMessage={{ components: { Text: MyText } }} />\n * ```\n */\nexport type UIContentPart = never;\n\nexport type CoreToolCallContentPart<\n TArgs = ReadonlyJSONObject,\n TResult = unknown,\n> = {\n readonly type: \"tool-call\";\n readonly toolCallId: string;\n readonly toolName: string;\n readonly args: TArgs;\n readonly result?: TResult | undefined;\n readonly isError?: boolean | undefined;\n};\n\nexport type ToolCallContentPart<\n TArgs = ReadonlyJSONObject,\n TResult = unknown,\n> = CoreToolCallContentPart<TArgs, TResult> & {\n readonly argsText: string;\n};\n\nexport type ThreadUserContentPart =\n | TextContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart;\n\nexport type ThreadAssistantContentPart =\n | TextContentPart\n | ReasoningContentPart\n | ToolCallContentPart;\n\ntype MessageCommonProps = {\n readonly id: string;\n readonly createdAt: Date;\n};\n\nexport type ThreadStep = {\n readonly usage?:\n | {\n readonly promptTokens: number;\n readonly completionTokens: number;\n }\n | undefined;\n};\n\nexport type ContentPartStatus =\n | {\n readonly type: \"running\";\n }\n | {\n readonly type: \"complete\";\n }\n | {\n readonly type: \"incomplete\";\n readonly reason:\n | \"cancelled\"\n | \"length\"\n | \"content-filter\"\n | \"other\"\n | \"error\";\n readonly error?: unknown;\n };\n\nexport type ToolCallContentPartStatus =\n | {\n readonly type: \"requires-action\";\n readonly reason: \"tool-calls\";\n }\n | ContentPartStatus;\n\nexport type MessageStatus =\n | {\n readonly type: \"running\";\n }\n | {\n readonly type: \"requires-action\";\n readonly reason: \"tool-calls\";\n }\n | {\n readonly type: \"complete\";\n readonly reason: \"stop\" | \"unknown\";\n }\n | {\n readonly type: \"incomplete\";\n readonly reason:\n | \"cancelled\"\n | \"tool-calls\"\n | \"length\"\n | \"content-filter\"\n | \"other\"\n | \"error\";\n readonly error?: ReadonlyJSONValue;\n };\n\nexport type ThreadSystemMessage = MessageCommonProps & {\n readonly role: \"system\";\n readonly content: readonly [TextContentPart];\n readonly metadata: {\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type ThreadUserMessage = MessageCommonProps & {\n readonly role: \"user\";\n readonly content: readonly ThreadUserContentPart[];\n readonly attachments: readonly CompleteAttachment[];\n readonly metadata: {\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type ThreadAssistantMessage = MessageCommonProps & {\n readonly role: \"assistant\";\n readonly content: readonly ThreadAssistantContentPart[];\n readonly status: MessageStatus;\n readonly metadata: {\n readonly unstable_annotations: readonly ReadonlyJSONValue[];\n readonly unstable_data: readonly ReadonlyJSONValue[];\n readonly steps: readonly ThreadStep[];\n readonly custom: Record<string, unknown>;\n };\n};\n\nexport type RunConfig = {\n // TODO allow user customization via global type overrides\n readonly custom?: Record<string, unknown>;\n};\n\nexport type AppendMessage = CoreMessage & {\n parentId: string | null;\n\n /** The ID of the message that was edited or undefined. */\n sourceId: string | null;\n runConfig: RunConfig | undefined;\n\n attachments: readonly CompleteAttachment[];\n startRun?: boolean | undefined;\n};\n\ntype BaseThreadMessage = {\n readonly status?: ThreadAssistantMessage[\"status\"];\n readonly metadata: {\n readonly unstable_annotations?: readonly ReadonlyJSONValue[];\n readonly unstable_data?: readonly ReadonlyJSONValue[];\n readonly steps?: readonly ThreadStep[];\n readonly custom: Record<string, unknown>;\n };\n readonly attachments?: ThreadUserMessage[\"attachments\"];\n};\n\nexport type ThreadMessage = BaseThreadMessage &\n (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage);\n\n/** Core Message Types (without UI content parts) */\n\nexport type CoreUserContentPart =\n | TextContentPart\n | ImageContentPart\n | FileContentPart\n | Unstable_AudioContentPart;\nexport type CoreAssistantContentPart =\n | TextContentPart\n | CoreToolCallContentPart;\n\nexport type CoreSystemMessage = {\n role: \"system\";\n content: readonly [TextContentPart];\n};\n\nexport type CoreUserMessage = {\n role: \"user\";\n content: readonly CoreUserContentPart[];\n};\n\nexport type CoreAssistantMessage = {\n role: \"assistant\";\n content: readonly CoreAssistantContentPart[];\n};\n\nexport type CoreMessage =\n | CoreSystemMessage\n | CoreUserMessage\n | CoreAssistantMessage;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from "react";
2
- import type { ContentPartStatus, FileContentPart, ImageContentPart, ReasoningContentPart, TextContentPart, ToolCallContentPart, UIContentPart, Unstable_AudioContentPart } from "./AssistantTypes";
2
+ import type { ContentPartStatus, FileContentPart, ImageContentPart, ReasoningContentPart, TextContentPart, ToolCallContentPart, Unstable_AudioContentPart } from "./AssistantTypes";
3
3
  import { ContentPartState } from "../api/ContentPartRuntime";
4
4
  export type EmptyContentPartProps = {
5
5
  status: ContentPartStatus;
@@ -15,8 +15,6 @@ export type FileContentPartProps = ContentPartState & FileContentPart;
15
15
  export type FileContentPartComponent = ComponentType<FileContentPartProps>;
16
16
  export type Unstable_AudioContentPartProps = ContentPartState & Unstable_AudioContentPart;
17
17
  export type Unstable_AudioContentPartComponent = ComponentType<Unstable_AudioContentPartProps>;
18
- export type UIContentPartProps = ContentPartState & UIContentPart;
19
- export type UIContentPartComponent = ComponentType<UIContentPartProps>;
20
18
  export type ToolCallContentPartProps<TArgs = any, TResult = unknown> = ContentPartState & ToolCallContentPart<TArgs, TResult> & {
21
19
  addResult: (result: any) => void;
22
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPartComponentTypes.d.ts","sourceRoot":"","sources":["../../src/types/ContentPartComponentTypes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE3E,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAChF,MAAM,MAAM,6BAA6B,GACvC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAE3C,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AACxE,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,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AC,CAAC;AAE3E,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAChF,MAAM,MAAM,6BAA6B,GACvC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAE3C,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AACxE,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE3E,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,GAC3D,yBAAyB,CAAC;AAC5B,MAAM,MAAM,kCAAkC,GAC5C,aAAa,CAAC,8BAA8B,CAAC,CAAC;AAEhD,MAAM,MAAM,wBAAwB,CAClC,KAAK,GAAG,GAAG,EACX,OAAO,GAAG,OAAO,IACf,gBAAgB,GAClB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG;IACpC,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC,CAAC;AAEJ,MAAM,MAAM,4BAA4B,CACtC,KAAK,GAAG,GAAG,EACX,OAAO,GAAG,GAAG,IACX,aAAa,CAAC,wBAAwB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/ContentPartComponentTypes.tsx"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport type {\n ContentPartStatus,\n FileContentPart,\n ImageContentPart,\n ReasoningContentPart,\n TextContentPart,\n ToolCallContentPart,\n UIContentPart,\n Unstable_AudioContentPart,\n} from \"./AssistantTypes\";\nimport { ContentPartState } from \"../api/ContentPartRuntime\";\n\nexport type EmptyContentPartProps = {\n status: ContentPartStatus;\n};\nexport type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;\n\nexport type TextContentPartProps = ContentPartState & TextContentPart;\nexport type TextContentPartComponent = ComponentType<TextContentPartProps>;\n\nexport type ReasoningContentPartProps = ContentPartState & ReasoningContentPart;\nexport type ReasoningContentPartComponent =\n ComponentType<ReasoningContentPartProps>;\n\nexport type ImageContentPartProps = ContentPartState & ImageContentPart;\nexport type ImageContentPartComponent = ComponentType<ImageContentPartProps>;\n\nexport type FileContentPartProps = ContentPartState & FileContentPart;\nexport type FileContentPartComponent = ComponentType<FileContentPartProps>;\n\nexport type Unstable_AudioContentPartProps = ContentPartState &\n Unstable_AudioContentPart;\nexport type Unstable_AudioContentPartComponent =\n ComponentType<Unstable_AudioContentPartProps>;\n\nexport type UIContentPartProps = ContentPartState & UIContentPart;\nexport type UIContentPartComponent = ComponentType<UIContentPartProps>;\n\nexport type ToolCallContentPartProps<\n TArgs = any,\n TResult = unknown,\n> = ContentPartState &\n ToolCallContentPart<TArgs, TResult> & {\n addResult: (result: any) => void;\n };\n\nexport type ToolCallContentPartComponent<\n TArgs = any,\n TResult = any,\n> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/ContentPartComponentTypes.tsx"],"sourcesContent":["import type { ComponentType } from \"react\";\nimport type {\n ContentPartStatus,\n FileContentPart,\n ImageContentPart,\n ReasoningContentPart,\n TextContentPart,\n ToolCallContentPart,\n Unstable_AudioContentPart,\n} from \"./AssistantTypes\";\nimport { ContentPartState } from \"../api/ContentPartRuntime\";\n\nexport type EmptyContentPartProps = {\n status: ContentPartStatus;\n};\nexport type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;\n\nexport type TextContentPartProps = ContentPartState & TextContentPart;\nexport type TextContentPartComponent = ComponentType<TextContentPartProps>;\n\nexport type ReasoningContentPartProps = ContentPartState & ReasoningContentPart;\nexport type ReasoningContentPartComponent =\n ComponentType<ReasoningContentPartProps>;\n\nexport type ImageContentPartProps = ContentPartState & ImageContentPart;\nexport type ImageContentPartComponent = ComponentType<ImageContentPartProps>;\n\nexport type FileContentPartProps = ContentPartState & FileContentPart;\nexport type FileContentPartComponent = ComponentType<FileContentPartProps>;\n\nexport type Unstable_AudioContentPartProps = ContentPartState &\n Unstable_AudioContentPart;\nexport type Unstable_AudioContentPartComponent =\n ComponentType<Unstable_AudioContentPartProps>;\n\nexport type ToolCallContentPartProps<\n TArgs = any,\n TResult = unknown,\n> = ContentPartState &\n ToolCallContentPart<TArgs, TResult> & {\n addResult: (result: any) => void;\n };\n\nexport type ToolCallContentPartComponent<\n TArgs = any,\n TResult = any,\n> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,5 +1,5 @@
1
1
  export type { Attachment, PendingAttachment, CompleteAttachment, AttachmentStatus, } from "./AttachmentTypes";
2
2
  export type { AppendMessage, TextContentPart, ReasoningContentPart, ImageContentPart, FileContentPart, Unstable_AudioContentPart, ToolCallContentPart, UIContentPart, MessageStatus, ThreadUserContentPart, ThreadAssistantContentPart, ThreadSystemMessage, ThreadAssistantMessage, ThreadUserMessage, ThreadMessage, CoreUserContentPart, CoreAssistantContentPart, CoreSystemMessage, CoreUserMessage, CoreAssistantMessage, CoreMessage, } from "./AssistantTypes";
3
- export type { EmptyContentPartProps, EmptyContentPartComponent, TextContentPartProps, TextContentPartComponent, ReasoningContentPartProps, ReasoningContentPartComponent, ImageContentPartProps, ImageContentPartComponent, FileContentPartProps, FileContentPartComponent, Unstable_AudioContentPartProps, Unstable_AudioContentPartComponent, UIContentPartProps, UIContentPartComponent, ToolCallContentPartProps, ToolCallContentPartComponent, } from "./ContentPartComponentTypes";
3
+ export type { EmptyContentPartProps, EmptyContentPartComponent, TextContentPartProps, TextContentPartComponent, ReasoningContentPartProps, ReasoningContentPartComponent, ImageContentPartProps, ImageContentPartComponent, FileContentPartProps, FileContentPartComponent, Unstable_AudioContentPartProps, Unstable_AudioContentPartComponent, ToolCallContentPartProps, ToolCallContentPartComponent, } from "./ContentPartComponentTypes";
4
4
  export type { Unsubscribe } from "./Unsubscribe";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,aAAa,EAGb,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EAGb,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,aAAa,EAGb,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EAGb,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export type {\n Attachment,\n PendingAttachment,\n CompleteAttachment,\n AttachmentStatus,\n} from \"./AttachmentTypes\";\n\nexport type {\n AppendMessage,\n TextContentPart,\n ReasoningContentPart,\n ImageContentPart,\n FileContentPart,\n Unstable_AudioContentPart,\n ToolCallContentPart,\n UIContentPart,\n MessageStatus,\n\n // thread message types\n ThreadUserContentPart,\n ThreadAssistantContentPart,\n ThreadSystemMessage,\n ThreadAssistantMessage,\n ThreadUserMessage,\n ThreadMessage,\n\n // core message types\n CoreUserContentPart,\n CoreAssistantContentPart,\n CoreSystemMessage,\n CoreUserMessage,\n CoreAssistantMessage,\n CoreMessage,\n} from \"./AssistantTypes\";\n\nexport type {\n EmptyContentPartProps,\n EmptyContentPartComponent,\n TextContentPartProps,\n TextContentPartComponent,\n ReasoningContentPartProps,\n ReasoningContentPartComponent,\n ImageContentPartProps,\n ImageContentPartComponent,\n FileContentPartProps,\n FileContentPartComponent,\n Unstable_AudioContentPartProps,\n Unstable_AudioContentPartComponent,\n UIContentPartProps,\n UIContentPartComponent,\n ToolCallContentPartProps,\n ToolCallContentPartComponent,\n} from \"./ContentPartComponentTypes\";\n\nexport type { Unsubscribe } from \"./Unsubscribe\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export type {\n Attachment,\n PendingAttachment,\n CompleteAttachment,\n AttachmentStatus,\n} from \"./AttachmentTypes\";\n\nexport type {\n AppendMessage,\n TextContentPart,\n ReasoningContentPart,\n ImageContentPart,\n FileContentPart,\n Unstable_AudioContentPart,\n ToolCallContentPart,\n UIContentPart,\n MessageStatus,\n\n // thread message types\n ThreadUserContentPart,\n ThreadAssistantContentPart,\n ThreadSystemMessage,\n ThreadAssistantMessage,\n ThreadUserMessage,\n ThreadMessage,\n\n // core message types\n CoreUserContentPart,\n CoreAssistantContentPart,\n CoreSystemMessage,\n CoreUserMessage,\n CoreAssistantMessage,\n CoreMessage,\n} from \"./AssistantTypes\";\n\nexport type {\n EmptyContentPartProps,\n EmptyContentPartComponent,\n TextContentPartProps,\n TextContentPartComponent,\n ReasoningContentPartProps,\n ReasoningContentPartComponent,\n ImageContentPartProps,\n ImageContentPartComponent,\n FileContentPartProps,\n FileContentPartComponent,\n Unstable_AudioContentPartProps,\n Unstable_AudioContentPartComponent,\n ToolCallContentPartProps,\n ToolCallContentPartComponent,\n} from \"./ContentPartComponentTypes\";\n\nexport type { Unsubscribe } from \"./Unsubscribe\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "conversational-ui",
30
30
  "conversational-ai"
31
31
  ],
32
- "version": "0.7.91",
32
+ "version": "0.8.1",
33
33
  "license": "MIT",
34
34
  "exports": {
35
35
  ".": {
@@ -41,14 +41,6 @@
41
41
  "types": "./dist/edge.d.ts",
42
42
  "import": "./dist/edge.mjs",
43
43
  "require": "./dist/edge.js"
44
- },
45
- "./tailwindcss": {
46
- "types": "./dist/tailwindcss/index.d.ts",
47
- "import": "./dist/tailwindcss/index.mjs",
48
- "require": "./dist/tailwindcss/index.js"
49
- },
50
- "./styles/*": {
51
- "default": "./dist/styles/*"
52
44
  }
53
45
  },
54
46
  "source": "./src/index.ts",
@@ -59,7 +51,6 @@
59
51
  "dist",
60
52
  "generated",
61
53
  "edge",
62
- "tailwindcss",
63
54
  "src",
64
55
  "README.md"
65
56
  ],
@@ -67,20 +58,14 @@
67
58
  "dependencies": {
68
59
  "@ai-sdk/provider": "^1.0.7",
69
60
  "@radix-ui/primitive": "^1.1.1",
70
- "@radix-ui/react-avatar": "^1.1.3",
71
61
  "@radix-ui/react-compose-refs": "^1.1.1",
72
62
  "@radix-ui/react-context": "^1.1.1",
73
- "@radix-ui/react-dialog": "^1.1.6",
74
63
  "@radix-ui/react-popover": "^1.1.6",
75
64
  "@radix-ui/react-primitive": "^2.0.2",
76
65
  "@radix-ui/react-slot": "^1.1.2",
77
- "@radix-ui/react-tooltip": "^1.1.8",
78
66
  "@radix-ui/react-use-callback-ref": "^1.1.0",
79
67
  "@radix-ui/react-use-escape-keydown": "^1.1.0",
80
- "class-variance-authority": "^0.7.1",
81
- "classnames": "^2.5.1",
82
68
  "json-schema": "^0.4.0",
83
- "lucide-react": "^0.475.0",
84
69
  "nanoid": "3.3.8",
85
70
  "react-textarea-autosize": "^8.5.7",
86
71
  "secure-json-parse": "^3.0.2",
@@ -106,15 +91,10 @@
106
91
  "devDependencies": {
107
92
  "@types/json-schema": "^7.0.15",
108
93
  "@types/node": "^22.13.1",
109
- "autoprefixer": "^10.4.20",
110
94
  "eslint": "^9",
111
95
  "eslint-config-next": "15.1.6",
112
- "postcss": "^8.5.1",
113
- "tailwindcss": "^3.4.17",
114
- "tailwindcss-animate": "^1.0.7",
115
96
  "tsx": "^4.19.2",
116
97
  "@assistant-ui/tsbuildutils": "^0.0.1",
117
- "@assistant-ui/tailwindcss-transformer": "0.1.0",
118
98
  "@assistant-ui/tsconfig": "0.0.0"
119
99
  },
120
100
  "publishConfig": {
@@ -98,7 +98,7 @@ export const auiV0Encode = (message: ThreadMessage): AuiV0Message => {
98
98
  }
99
99
 
100
100
  default: {
101
- const unhandledType: "ui" | "image" | "file" | "audio" = type;
101
+ const unhandledType: "image" | "file" | "audio" = type;
102
102
  throw new Error(
103
103
  `Content part type not supported by aui/v0: ${unhandledType}`,
104
104
  );
package/src/index.ts CHANGED
@@ -5,7 +5,6 @@ export * from "./model-context";
5
5
  export * from "./primitives";
6
6
  export * from "./runtimes";
7
7
  export * from "./types";
8
- export * from "./ui";
9
8
 
10
9
  export { useToolArgsFieldStatus as unstable_useToolArgsFieldStatus } from "./utils/json/parse-partial-json";
11
10
 
package/src/internal.ts CHANGED
@@ -4,7 +4,6 @@ export { DefaultThreadComposerRuntimeCore } from "./runtimes/composer/DefaultThr
4
4
  export { CompositeContextProvider } from "./utils/CompositeContextProvider";
5
5
  export { MessageRepository } from "./runtimes/utils/MessageRepository";
6
6
  export { BaseAssistantRuntimeCore } from "./runtimes/core/BaseAssistantRuntimeCore";
7
- export { TooltipIconButton } from "./ui/base/tooltip-icon-button";
8
7
  export { generateId } from "./utils/idUtils";
9
8
  export { AssistantRuntimeImpl } from "./api/AssistantRuntime";
10
9
  export {
@@ -32,6 +32,21 @@ export type ToolExecuteFunction<TArgs, TResult> = (
32
32
  },
33
33
  ) => TResult | Promise<TResult>;
34
34
 
35
+ export type ToolStreamCallFunction<TArgs, TResult> = (
36
+ iterator: AsyncGenerator<
37
+ {
38
+ args: TArgs;
39
+ argsTextDelta: string;
40
+ },
41
+ void,
42
+ unknown
43
+ >,
44
+ context: {
45
+ toolCallId: string;
46
+ abortSignal: AbortSignal;
47
+ },
48
+ ) => TResult | Promise<TResult>;
49
+
35
50
  type OnSchemaValidationErrorFunction<TResult> = ToolExecuteFunction<
36
51
  unknown,
37
52
  TResult
@@ -41,6 +56,10 @@ export type Tool<TArgs = unknown, TResult = unknown> = {
41
56
  description?: string | undefined;
42
57
  parameters: z.ZodSchema<TArgs> | JSONSchema7;
43
58
  execute?: ToolExecuteFunction<TArgs, TResult>;
59
+ /**
60
+ * @deprecated TODO not yet implemented
61
+ */
62
+ experimental_streamCall?: ToolStreamCallFunction<TArgs, TResult>;
44
63
  experimental_onSchemaValidationError?: OnSchemaValidationErrorFunction<TResult>;
45
64
  };
46
65
 
@@ -75,8 +75,10 @@ export const makeAssistantVisible = <T extends ComponentType<any>>(
75
75
  return assistant.registerModelContextProvider({
76
76
  getModelContext: () => {
77
77
  return {
78
- ...(config?.clickable ? { tools: { click } } : {}),
79
- ...(config?.editable ? { tools: { edit } } : {}),
78
+ tools: {
79
+ ...(config?.clickable ? { click } : {}),
80
+ ...(config?.editable ? { edit } : {}),
81
+ },
80
82
  system: !isNestedReadable // only pass content if this readable isn't nested in another readable
81
83
  ? componentRef.current?.outerHTML
82
84
  : undefined,
@@ -1,4 +1,3 @@
1
1
  export { ContentPartPrimitiveText as Text } from "./ContentPartText";
2
2
  export { ContentPartPrimitiveImage as Image } from "./ContentPartImage";
3
- export { ContentPartPrimitiveDisplay as Display } from "./ContentPartDisplay";
4
3
  export { ContentPartPrimitiveInProgress as InProgress } from "./ContentPartInProgress";
@@ -9,7 +9,6 @@ export * as ThreadPrimitive from "./thread";
9
9
  export * as ThreadListPrimitive from "./threadList";
10
10
  export * as ThreadListItemPrimitive from "./threadListItem";
11
11
 
12
- export { useContentPartDisplay } from "./contentPart/useContentPartDisplay";
13
12
  export { useContentPartImage } from "./contentPart/useContentPartImage";
14
13
  export { useContentPartText } from "./contentPart/useContentPartText";
15
14
  export { useContentPartReasoning } from "./contentPart/useContentPartReasoning";
@@ -14,7 +14,6 @@ import {
14
14
  import { ContentPartRuntimeProvider } from "../../context/providers/ContentPartRuntimeProvider";
15
15
  import { ContentPartPrimitiveText } from "../contentPart/ContentPartText";
16
16
  import { ContentPartPrimitiveImage } from "../contentPart/ContentPartImage";
17
- import { ContentPartPrimitiveDisplay } from "../contentPart/ContentPartDisplay";
18
17
  import type {
19
18
  Unstable_AudioContentPartComponent,
20
19
  EmptyContentPartComponent,
@@ -22,7 +21,6 @@ import type {
22
21
  TextContentPartComponent,
23
22
  ToolCallContentPartComponent,
24
23
  ToolCallContentPartProps,
25
- UIContentPartComponent,
26
24
  FileContentPartComponent,
27
25
  ReasoningContentPartComponent,
28
26
  } from "../../types/ContentPartComponentTypes";
@@ -39,7 +37,6 @@ export namespace MessagePrimitiveContent {
39
37
  Image?: ImageContentPartComponent | undefined;
40
38
  File?: FileContentPartComponent | undefined;
41
39
  Unstable_Audio?: Unstable_AudioContentPartComponent | undefined;
42
- UI?: UIContentPartComponent | undefined;
43
40
  tools?:
44
41
  | {
45
42
  by_name?:
@@ -80,7 +77,6 @@ const defaultComponents = {
80
77
  Image: () => <ContentPartPrimitiveImage />,
81
78
  File: () => null,
82
79
  Unstable_Audio: () => null,
83
- UI: () => <ContentPartPrimitiveDisplay />,
84
80
  } satisfies MessagePrimitiveContent.Props["components"];
85
81
 
86
82
  type MessageContentPartComponentProps = {
@@ -94,7 +90,6 @@ const MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({
94
90
  Image = defaultComponents.Image,
95
91
  File = defaultComponents.File,
96
92
  Unstable_Audio: Audio = defaultComponents.Unstable_Audio,
97
- UI = defaultComponents.UI,
98
93
  tools = {},
99
94
  } = {},
100
95
  }) => {
@@ -131,9 +126,6 @@ const MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({
131
126
  case "audio":
132
127
  return <Audio {...part} />;
133
128
 
134
- case "ui":
135
- return <UI {...part} />;
136
-
137
129
  default:
138
130
  const unhandledType: never = type;
139
131
  throw new Error(`Unknown content part type: ${unhandledType}`);
@@ -171,7 +163,6 @@ const MessageContentPart = memo(
171
163
  prev.components?.Image === next.components?.Image &&
172
164
  prev.components?.File === next.components?.File &&
173
165
  prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&
174
- prev.components?.UI === next.components?.UI &&
175
166
  prev.components?.tools === next.components?.tools,
176
167
  );
177
168
 
@@ -33,9 +33,7 @@ export class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {
33
33
  this.setRole(message.role);
34
34
  this.setAttachments(message.attachments ?? []);
35
35
 
36
- this._nonTextParts = message.content.filter(
37
- (part) => part.type !== "text" && part.type !== "ui",
38
- );
36
+ this._nonTextParts = message.content.filter((part) => part.type !== "text");
39
37
 
40
38
  // Use the runConfig from the regular (non-edit) composer as the initial runConfig for the edit composer
41
39
  this.setRunConfig({ ...runtime.composer.runConfig });
@@ -21,15 +21,16 @@ export const toCoreMessage = <T extends boolean = false>(
21
21
  case "assistant":
22
22
  return {
23
23
  role,
24
- content: message.content.map((part) => {
25
- if (part.type === "reasoning") return null; // reasoning parts are omitted
26
- if (part.type === "ui") throw new Error("UI parts are not supported");
27
- if (part.type === "tool-call") {
28
- const { argsText, ...rest } = part;
29
- return rest;
30
- }
31
- return part;
32
- }).filter(c => !!c),
24
+ content: message.content
25
+ .map((part) => {
26
+ if (part.type === "reasoning") return null; // reasoning parts are omitted
27
+ if (part.type === "tool-call") {
28
+ const { argsText, ...rest } = part;
29
+ return rest;
30
+ }
31
+ return part;
32
+ })
33
+ .filter((c) => !!c),
33
34
  ...(includeId ? { unstable_id: message.id } : {}),
34
35
  };
35
36
 
@@ -37,11 +38,7 @@ export const toCoreMessage = <T extends boolean = false>(
37
38
  return {
38
39
  role,
39
40
  content: [
40
- ...message.content.map((part) => {
41
- if (part.type === "ui")
42
- throw new Error("UI parts are not supported");
43
- return part;
44
- }),
41
+ ...message.content,
45
42
  ...message.attachments.map((a) => a.content).flat(),
46
43
  ],
47
44
  ...(includeId ? { unstable_id: message.id } : {}),
@@ -133,7 +133,7 @@ export function toLanguageModelMessages(
133
133
  }
134
134
 
135
135
  default: {
136
- const unhandledType: "ui" | "audio" = type;
136
+ const unhandledType: "audio" = type;
137
137
  throw new Error(
138
138
  `Unspported content part type: ${unhandledType}`,
139
139
  );
@@ -163,7 +163,7 @@ export function toLanguageModelMessages(
163
163
  break;
164
164
  }
165
165
  default: {
166
- const unhandledType: "ui" = type;
166
+ const unhandledType: never = type;
167
167
  throw new Error(`Unhandled content part type: ${unhandledType}`);
168
168
  }
169
169
  }
@@ -3,7 +3,6 @@ import {
3
3
  MessageStatus,
4
4
  TextContentPart,
5
5
  ImageContentPart,
6
- UIContentPart,
7
6
  ThreadMessage,
8
7
  ThreadAssistantContentPart,
9
8
  ThreadAssistantMessage,
@@ -40,7 +39,6 @@ export type ThreadMessageLike = {
40
39
  readonly result?: any | undefined;
41
40
  readonly isError?: boolean | undefined;
42
41
  }
43
- | UIContentPart
44
42
  )[];
45
43
  readonly id?: string | undefined;
46
44
  readonly createdAt?: Date | undefined;
@@ -97,9 +95,6 @@ export const fromThreadMessageLike = (
97
95
  if (part.text.trim().length === 0) return null;
98
96
  return part;
99
97
 
100
- case "ui":
101
- return part;
102
-
103
98
  case "tool-call": {
104
99
  if (part.args) {
105
100
  return {
@@ -143,7 +138,6 @@ export const fromThreadMessageLike = (
143
138
  const type = part.type;
144
139
  switch (type) {
145
140
  case "text":
146
- case "ui":
147
141
  case "image":
148
142
  case "audio":
149
143
  case "file":
@@ -16,6 +16,7 @@ import { InMemoryThreadListAdapter } from "./in-memory";
16
16
  type ThreadData = {
17
17
  externalId: string;
18
18
  };
19
+
19
20
  type CloudThreadListAdapterOptions = {
20
21
  cloud?: AssistantCloud | undefined;
21
22
 
@@ -23,19 +24,9 @@ type CloudThreadListAdapterOptions = {
23
24
  delete?(threadId: string): Promise<void>;
24
25
  };
25
26
 
26
- const getEnvVariable = (name: string): string | undefined => {
27
- if (
28
- typeof process !== "undefined" &&
29
- process.env &&
30
- typeof process.env[name] === "string"
31
- ) {
32
- return process.env[name];
33
- }
34
-
35
- return undefined;
36
- };
37
-
38
- const baseUrl = getEnvVariable("NEXT_PUBLIC_ASSISTANT_BASE_URL");
27
+ const baseUrl =
28
+ typeof process !== "undefined" &&
29
+ process?.env?.["NEXT_PUBLIC_ASSISTANT_BASE_URL"];
39
30
  const autoCloud = baseUrl
40
31
  ? new AssistantCloud({ baseUrl, anonymous: true })
41
32
  : undefined;
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+
2
2
  import { CompleteAttachment } from "./AttachmentTypes";
3
3
  import {
4
4
  ReadonlyJSONObject,
@@ -73,10 +73,7 @@ export type Unstable_AudioContentPart = {
73
73
  * <Thread assistantMessage={{ components: { Text: MyText } }} userMessage={{ components: { Text: MyText } }} />
74
74
  * ```
75
75
  */
76
- export type UIContentPart = {
77
- readonly type: "ui";
78
- readonly display: ReactNode;
79
- };
76
+ export type UIContentPart = never;
80
77
 
81
78
  export type CoreToolCallContentPart<
82
79
  TArgs = ReadonlyJSONObject,
@@ -101,14 +98,12 @@ export type ThreadUserContentPart =
101
98
  | TextContentPart
102
99
  | ImageContentPart
103
100
  | FileContentPart
104
- | Unstable_AudioContentPart
105
- | UIContentPart;
101
+ | Unstable_AudioContentPart;
106
102
 
107
103
  export type ThreadAssistantContentPart =
108
104
  | TextContentPart
109
105
  | ReasoningContentPart
110
- | ToolCallContentPart
111
- | UIContentPart;
106
+ | ToolCallContentPart;
112
107
 
113
108
  type MessageCommonProps = {
114
109
  readonly id: string;
@@ -6,7 +6,6 @@ import type {
6
6
  ReasoningContentPart,
7
7
  TextContentPart,
8
8
  ToolCallContentPart,
9
- UIContentPart,
10
9
  Unstable_AudioContentPart,
11
10
  } from "./AssistantTypes";
12
11
  import { ContentPartState } from "../api/ContentPartRuntime";
@@ -34,9 +33,6 @@ export type Unstable_AudioContentPartProps = ContentPartState &
34
33
  export type Unstable_AudioContentPartComponent =
35
34
  ComponentType<Unstable_AudioContentPartProps>;
36
35
 
37
- export type UIContentPartProps = ContentPartState & UIContentPart;
38
- export type UIContentPartComponent = ComponentType<UIContentPartProps>;
39
-
40
36
  export type ToolCallContentPartProps<
41
37
  TArgs = any,
42
38
  TResult = unknown,
@@ -46,8 +46,6 @@ export type {
46
46
  FileContentPartComponent,
47
47
  Unstable_AudioContentPartProps,
48
48
  Unstable_AudioContentPartComponent,
49
- UIContentPartProps,
50
- UIContentPartComponent,
51
49
  ToolCallContentPartProps,
52
50
  ToolCallContentPartComponent,
53
51
  } from "./ContentPartComponentTypes";
@@ -1,9 +0,0 @@
1
- import type { FC } from "react";
2
- export declare namespace ContentPartPrimitiveDisplay {
3
- type Props = Record<string, never>;
4
- }
5
- /**
6
- * @deprecated UI content parts are deprecated and will be removed in the next major version.
7
- */
8
- export declare const ContentPartPrimitiveDisplay: FC<ContentPartPrimitiveDisplay.Props>;
9
- //# sourceMappingURL=ContentPartDisplay.d.ts.map