@assistant-ui/react 0.5.98 → 0.5.99

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. package/dist/api/AssistantRuntime.d.ts +4 -4
  2. package/dist/api/AssistantRuntime.d.ts.map +1 -1
  3. package/dist/api/AssistantRuntime.js +7 -7
  4. package/dist/api/AssistantRuntime.js.map +1 -1
  5. package/dist/api/AssistantRuntime.mjs +7 -9
  6. package/dist/api/AssistantRuntime.mjs.map +1 -1
  7. package/dist/api/ComposerRuntime.d.ts +7 -0
  8. package/dist/api/ComposerRuntime.d.ts.map +1 -1
  9. package/dist/api/ComposerRuntime.js +13 -0
  10. package/dist/api/ComposerRuntime.js.map +1 -1
  11. package/dist/api/ComposerRuntime.mjs +13 -0
  12. package/dist/api/ComposerRuntime.mjs.map +1 -1
  13. package/dist/api/MessageRuntime.d.ts.map +1 -1
  14. package/dist/api/MessageRuntime.js +0 -5
  15. package/dist/api/MessageRuntime.js.map +1 -1
  16. package/dist/api/MessageRuntime.mjs +0 -5
  17. package/dist/api/MessageRuntime.mjs.map +1 -1
  18. package/dist/api/RuntimePathTypes.d.ts +16 -1
  19. package/dist/api/RuntimePathTypes.d.ts.map +1 -1
  20. package/dist/api/RuntimePathTypes.js.map +1 -1
  21. package/dist/api/ThreadListItemRuntime.d.ts +29 -0
  22. package/dist/api/ThreadListItemRuntime.d.ts.map +1 -0
  23. package/dist/api/ThreadListItemRuntime.js +61 -0
  24. package/dist/api/ThreadListItemRuntime.js.map +1 -0
  25. package/dist/api/ThreadListItemRuntime.mjs +36 -0
  26. package/dist/api/ThreadListItemRuntime.mjs.map +1 -0
  27. package/dist/api/ThreadListRuntime.d.ts +51 -0
  28. package/dist/api/ThreadListRuntime.d.ts.map +1 -0
  29. package/dist/api/ThreadListRuntime.js +128 -0
  30. package/dist/api/ThreadListRuntime.js.map +1 -0
  31. package/dist/api/ThreadListRuntime.mjs +105 -0
  32. package/dist/api/ThreadListRuntime.mjs.map +1 -0
  33. package/dist/api/ThreadRuntime.d.ts +3 -0
  34. package/dist/api/ThreadRuntime.d.ts.map +1 -1
  35. package/dist/api/ThreadRuntime.js +1 -1
  36. package/dist/api/ThreadRuntime.js.map +1 -1
  37. package/dist/api/ThreadRuntime.mjs +1 -1
  38. package/dist/api/ThreadRuntime.mjs.map +1 -1
  39. package/dist/api/index.d.ts +1 -1
  40. package/dist/api/index.d.ts.map +1 -1
  41. package/dist/api/index.js.map +1 -1
  42. package/dist/context/providers/AssistantRuntimeProvider.d.ts.map +1 -1
  43. package/dist/context/providers/AssistantRuntimeProvider.js +7 -9
  44. package/dist/context/providers/AssistantRuntimeProvider.js.map +1 -1
  45. package/dist/context/providers/AssistantRuntimeProvider.mjs +7 -9
  46. package/dist/context/providers/AssistantRuntimeProvider.mjs.map +1 -1
  47. package/dist/context/providers/AttachmentRuntimeProvider.d.ts +6 -5
  48. package/dist/context/providers/AttachmentRuntimeProvider.d.ts.map +1 -1
  49. package/dist/context/providers/AttachmentRuntimeProvider.js.map +1 -1
  50. package/dist/context/providers/AttachmentRuntimeProvider.mjs.map +1 -1
  51. package/dist/context/providers/ContentPartRuntimeProvider.d.ts +6 -5
  52. package/dist/context/providers/ContentPartRuntimeProvider.d.ts.map +1 -1
  53. package/dist/context/providers/ContentPartRuntimeProvider.js +1 -4
  54. package/dist/context/providers/ContentPartRuntimeProvider.js.map +1 -1
  55. package/dist/context/providers/ContentPartRuntimeProvider.mjs +1 -4
  56. package/dist/context/providers/ContentPartRuntimeProvider.mjs.map +1 -1
  57. package/dist/context/providers/MessageRuntimeProvider.d.ts +6 -5
  58. package/dist/context/providers/MessageRuntimeProvider.d.ts.map +1 -1
  59. package/dist/context/providers/MessageRuntimeProvider.js.map +1 -1
  60. package/dist/context/providers/MessageRuntimeProvider.mjs.map +1 -1
  61. package/dist/context/providers/TextContentPartProvider.d.ts +7 -6
  62. package/dist/context/providers/TextContentPartProvider.d.ts.map +1 -1
  63. package/dist/context/providers/TextContentPartProvider.js +5 -1
  64. package/dist/context/providers/TextContentPartProvider.js.map +1 -1
  65. package/dist/context/providers/TextContentPartProvider.mjs +5 -1
  66. package/dist/context/providers/TextContentPartProvider.mjs.map +1 -1
  67. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +13 -0
  68. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -0
  69. package/dist/context/providers/ThreadListItemRuntimeProvider.js +62 -0
  70. package/dist/context/providers/ThreadListItemRuntimeProvider.js.map +1 -0
  71. package/dist/context/providers/ThreadListItemRuntimeProvider.mjs +39 -0
  72. package/dist/context/providers/ThreadListItemRuntimeProvider.mjs.map +1 -0
  73. package/dist/context/react/AssistantContext.d.ts +35 -11
  74. package/dist/context/react/AssistantContext.d.ts.map +1 -1
  75. package/dist/context/react/AssistantContext.js +4 -4
  76. package/dist/context/react/AssistantContext.js.map +1 -1
  77. package/dist/context/react/AssistantContext.mjs +3 -3
  78. package/dist/context/react/AssistantContext.mjs.map +1 -1
  79. package/dist/context/react/ThreadListItemContext.d.ts +58 -0
  80. package/dist/context/react/ThreadListItemContext.d.ts.map +1 -0
  81. package/dist/context/react/ThreadListItemContext.js +53 -0
  82. package/dist/context/react/ThreadListItemContext.js.map +1 -0
  83. package/dist/context/react/ThreadListItemContext.mjs +25 -0
  84. package/dist/context/react/ThreadListItemContext.mjs.map +1 -0
  85. package/dist/context/react/index.d.ts +1 -1
  86. package/dist/context/react/index.d.ts.map +1 -1
  87. package/dist/context/react/index.js +2 -2
  88. package/dist/context/react/index.js.map +1 -1
  89. package/dist/context/react/index.mjs +2 -2
  90. package/dist/context/react/index.mjs.map +1 -1
  91. package/dist/internal.d.ts +1 -1
  92. package/dist/internal.d.ts.map +1 -1
  93. package/dist/internal.js.map +1 -1
  94. package/dist/internal.mjs.map +1 -1
  95. package/dist/primitives/index.d.ts +2 -0
  96. package/dist/primitives/index.d.ts.map +1 -1
  97. package/dist/primitives/index.js +6 -0
  98. package/dist/primitives/index.js.map +1 -1
  99. package/dist/primitives/index.mjs +4 -0
  100. package/dist/primitives/index.mjs.map +1 -1
  101. package/dist/primitives/threadList/ThreadListItems.d.ts +11 -0
  102. package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -0
  103. package/dist/primitives/threadList/ThreadListItems.js +72 -0
  104. package/dist/primitives/threadList/ThreadListItems.js.map +1 -0
  105. package/dist/primitives/threadList/ThreadListItems.mjs +48 -0
  106. package/dist/primitives/threadList/ThreadListItems.mjs.map +1 -0
  107. package/dist/primitives/threadList/ThreadListNew.d.ts +13 -0
  108. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -0
  109. package/dist/primitives/threadList/ThreadListNew.js +43 -0
  110. package/dist/primitives/threadList/ThreadListNew.js.map +1 -0
  111. package/dist/primitives/threadList/ThreadListNew.mjs +21 -0
  112. package/dist/primitives/threadList/ThreadListNew.mjs.map +1 -0
  113. package/dist/primitives/threadList/index.d.ts +3 -0
  114. package/dist/primitives/threadList/index.d.ts.map +1 -0
  115. package/dist/primitives/threadList/index.js +34 -0
  116. package/dist/primitives/threadList/index.js.map +1 -0
  117. package/dist/primitives/threadList/index.mjs +8 -0
  118. package/dist/primitives/threadList/index.mjs.map +1 -0
  119. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +13 -0
  120. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -0
  121. package/dist/primitives/threadListItem/ThreadListItemArchive.js +43 -0
  122. package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -0
  123. package/dist/primitives/threadListItem/ThreadListItemArchive.mjs +21 -0
  124. package/dist/primitives/threadListItem/ThreadListItemArchive.mjs.map +1 -0
  125. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +13 -0
  126. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -0
  127. package/dist/primitives/threadListItem/ThreadListItemDelete.js +43 -0
  128. package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -0
  129. package/dist/primitives/threadListItem/ThreadListItemDelete.mjs +21 -0
  130. package/dist/primitives/threadListItem/ThreadListItemDelete.mjs.map +1 -0
  131. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +13 -0
  132. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -0
  133. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +43 -0
  134. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -0
  135. package/dist/primitives/threadListItem/ThreadListItemUnarchive.mjs +21 -0
  136. package/dist/primitives/threadListItem/ThreadListItemUnarchive.mjs.map +1 -0
  137. package/dist/primitives/threadListItem/index.d.ts +4 -0
  138. package/dist/primitives/threadListItem/index.d.ts.map +1 -0
  139. package/dist/primitives/threadListItem/index.js +37 -0
  140. package/dist/primitives/threadListItem/index.js.map +1 -0
  141. package/dist/primitives/threadListItem/index.mjs +10 -0
  142. package/dist/primitives/threadListItem/index.mjs.map +1 -0
  143. package/dist/runtimes/composer/BaseComposerRuntimeCore.d.ts +5 -1
  144. package/dist/runtimes/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
  145. package/dist/runtimes/composer/BaseComposerRuntimeCore.js +14 -5
  146. package/dist/runtimes/composer/BaseComposerRuntimeCore.js.map +1 -1
  147. package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs +14 -5
  148. package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs.map +1 -1
  149. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
  150. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js +2 -1
  151. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
  152. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs +2 -1
  153. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs.map +1 -1
  154. package/dist/runtimes/core/AssistantRuntimeCore.d.ts +2 -2
  155. package/dist/runtimes/core/AssistantRuntimeCore.d.ts.map +1 -1
  156. package/dist/runtimes/core/AssistantRuntimeCore.js.map +1 -1
  157. package/dist/runtimes/core/BaseAssistantRuntimeCore.d.ts +2 -2
  158. package/dist/runtimes/core/BaseAssistantRuntimeCore.d.ts.map +1 -1
  159. package/dist/runtimes/core/BaseAssistantRuntimeCore.js.map +1 -1
  160. package/dist/runtimes/core/BaseAssistantRuntimeCore.mjs.map +1 -1
  161. package/dist/runtimes/core/ComposerRuntimeCore.d.ts +3 -0
  162. package/dist/runtimes/core/ComposerRuntimeCore.d.ts.map +1 -1
  163. package/dist/runtimes/core/ComposerRuntimeCore.js.map +1 -1
  164. package/dist/runtimes/core/{ThreadManagerRuntimeCore.d.ts → ThreadListRuntimeCore.d.ts} +7 -6
  165. package/dist/runtimes/core/ThreadListRuntimeCore.d.ts.map +1 -0
  166. package/dist/runtimes/core/{ThreadManagerRuntimeCore.js → ThreadListRuntimeCore.js} +4 -4
  167. package/dist/runtimes/core/ThreadListRuntimeCore.js.map +1 -0
  168. package/dist/runtimes/core/ThreadListRuntimeCore.mjs +1 -0
  169. package/dist/runtimes/core/subscribeToMainThread.js +2 -2
  170. package/dist/runtimes/core/subscribeToMainThread.js.map +1 -1
  171. package/dist/runtimes/core/subscribeToMainThread.mjs +2 -2
  172. package/dist/runtimes/core/subscribeToMainThread.mjs.map +1 -1
  173. package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts +8 -8
  174. package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts.map +1 -1
  175. package/dist/runtimes/external-store/ExternalStoreAdapter.js.map +1 -1
  176. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts +2 -2
  177. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
  178. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js +8 -8
  179. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js.map +1 -1
  180. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs +8 -8
  181. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs.map +1 -1
  182. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +35 -0
  183. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -0
  184. package/dist/runtimes/external-store/{ExternalStoreThreadManagementAdapter.js → ExternalStoreThreadListRuntimeCore.js} +17 -8
  185. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -0
  186. package/dist/runtimes/external-store/{ExternalStoreThreadManagementAdapter.mjs → ExternalStoreThreadListRuntimeCore.mjs} +13 -4
  187. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs.map +1 -0
  188. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts +1 -1
  189. package/dist/runtimes/local/LocalRuntimeCore.d.ts +2 -2
  190. package/dist/runtimes/local/LocalRuntimeCore.d.ts.map +1 -1
  191. package/dist/runtimes/local/LocalRuntimeCore.js +7 -7
  192. package/dist/runtimes/local/LocalRuntimeCore.js.map +1 -1
  193. package/dist/runtimes/local/LocalRuntimeCore.mjs +7 -7
  194. package/dist/runtimes/local/LocalRuntimeCore.mjs.map +1 -1
  195. package/dist/runtimes/local/{LocalThreadManagerRuntimeCore.d.ts → LocalThreadListRuntimeCore.d.ts} +16 -6
  196. package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts.map +1 -0
  197. package/dist/runtimes/local/{LocalThreadManagerRuntimeCore.js → LocalThreadListRuntimeCore.js} +11 -8
  198. package/dist/runtimes/local/LocalThreadListRuntimeCore.js.map +1 -0
  199. package/dist/runtimes/local/{LocalThreadManagerRuntimeCore.mjs → LocalThreadListRuntimeCore.mjs} +7 -4
  200. package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs.map +1 -0
  201. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
  202. package/dist/runtimes/local/LocalThreadRuntimeCore.js +2 -1
  203. package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
  204. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +2 -1
  205. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
  206. package/dist/types/AssistantTypes.d.ts +2 -0
  207. package/dist/types/AssistantTypes.d.ts.map +1 -1
  208. package/dist/types/AssistantTypes.js.map +1 -1
  209. package/package.json +7 -7
  210. package/src/api/AssistantRuntime.ts +9 -12
  211. package/src/api/ComposerRuntime.ts +17 -0
  212. package/src/api/MessageRuntime.ts +0 -9
  213. package/src/api/RuntimePathTypes.ts +10 -1
  214. package/src/api/ThreadListItemRuntime.ts +67 -0
  215. package/src/api/ThreadListRuntime.ts +159 -0
  216. package/src/api/ThreadRuntime.ts +2 -1
  217. package/src/api/index.ts +1 -4
  218. package/src/context/providers/AssistantRuntimeProvider.tsx +7 -9
  219. package/src/context/providers/AttachmentRuntimeProvider.tsx +6 -4
  220. package/src/context/providers/ContentPartRuntimeProvider.tsx +8 -7
  221. package/src/context/providers/MessageRuntimeProvider.tsx +6 -4
  222. package/src/context/providers/TextContentPartProvider.tsx +11 -7
  223. package/src/context/providers/ThreadListItemRuntimeProvider.tsx +54 -0
  224. package/src/context/react/AssistantContext.ts +4 -4
  225. package/src/context/react/ThreadListItemContext.ts +39 -0
  226. package/src/context/react/index.ts +2 -2
  227. package/src/internal.ts +1 -1
  228. package/src/primitives/index.ts +2 -0
  229. package/src/primitives/threadList/ThreadListItems.tsx +73 -0
  230. package/src/primitives/threadList/ThreadListNew.ts +25 -0
  231. package/src/primitives/threadList/index.ts +2 -0
  232. package/src/primitives/threadListItem/ThreadListItemArchive.ts +25 -0
  233. package/src/primitives/threadListItem/ThreadListItemDelete.ts +25 -0
  234. package/src/primitives/threadListItem/ThreadListItemUnarchive.ts +25 -0
  235. package/src/primitives/threadListItem/index.ts +3 -0
  236. package/src/runtimes/composer/BaseComposerRuntimeCore.tsx +19 -5
  237. package/src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx +3 -2
  238. package/src/runtimes/core/AssistantRuntimeCore.tsx +2 -2
  239. package/src/runtimes/core/BaseAssistantRuntimeCore.tsx +2 -2
  240. package/src/runtimes/core/ComposerRuntimeCore.tsx +4 -0
  241. package/src/runtimes/core/{ThreadManagerRuntimeCore.tsx → ThreadListRuntimeCore.tsx} +7 -5
  242. package/src/runtimes/core/subscribeToMainThread.ts +2 -2
  243. package/src/runtimes/external-store/ExternalStoreAdapter.tsx +8 -8
  244. package/src/runtimes/external-store/ExternalStoreRuntimeCore.tsx +8 -8
  245. package/src/runtimes/external-store/{ExternalStoreThreadManagementAdapter.tsx → ExternalStoreThreadListRuntimeCore.tsx} +16 -6
  246. package/src/runtimes/local/LocalRuntimeCore.tsx +7 -7
  247. package/src/runtimes/local/{LocalThreadManagerRuntimeCore.tsx → LocalThreadListRuntimeCore.tsx} +11 -7
  248. package/src/runtimes/local/LocalThreadRuntimeCore.tsx +2 -1
  249. package/src/types/AssistantTypes.ts +3 -0
  250. package/dist/api/ThreadManagerRuntime.d.ts +0 -32
  251. package/dist/api/ThreadManagerRuntime.d.ts.map +0 -1
  252. package/dist/api/ThreadManagerRuntime.js +0 -73
  253. package/dist/api/ThreadManagerRuntime.js.map +0 -1
  254. package/dist/api/ThreadManagerRuntime.mjs +0 -48
  255. package/dist/api/ThreadManagerRuntime.mjs.map +0 -1
  256. package/dist/runtimes/core/ThreadManagerRuntimeCore.d.ts.map +0 -1
  257. package/dist/runtimes/core/ThreadManagerRuntimeCore.js.map +0 -1
  258. package/dist/runtimes/core/ThreadManagerRuntimeCore.mjs +0 -1
  259. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.d.ts +0 -25
  260. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.d.ts.map +0 -1
  261. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.js.map +0 -1
  262. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.mjs.map +0 -1
  263. package/dist/runtimes/local/LocalThreadManagerRuntimeCore.d.ts.map +0 -1
  264. package/dist/runtimes/local/LocalThreadManagerRuntimeCore.js.map +0 -1
  265. package/dist/runtimes/local/LocalThreadManagerRuntimeCore.mjs.map +0 -1
  266. package/src/api/ThreadManagerRuntime.ts +0 -80
  267. /package/dist/runtimes/core/{ThreadManagerRuntimeCore.mjs.map → ThreadListRuntimeCore.mjs.map} +0 -0
@@ -14,10 +14,12 @@ import {
14
14
  ContentPartState,
15
15
  } from "../../api/ContentPartRuntime";
16
16
 
17
- type TextContentPartProviderProps = {
18
- text: string;
19
- isRunning?: boolean | undefined;
20
- };
17
+ export namespace TextContentPartProvider {
18
+ export type Props = PropsWithChildren<{
19
+ text: string;
20
+ isRunning?: boolean | undefined;
21
+ }>;
22
+ }
21
23
 
22
24
  const COMPLETE_STATUS: ContentPartStatus = {
23
25
  type: "complete",
@@ -27,9 +29,11 @@ const RUNNING_STATUS: ContentPartStatus = {
27
29
  type: "running",
28
30
  };
29
31
 
30
- export const TextContentPartProvider: FC<
31
- PropsWithChildren<TextContentPartProviderProps>
32
- > = ({ children, text, isRunning }) => {
32
+ export const TextContentPartProvider: FC<TextContentPartProvider.Props> = ({
33
+ children,
34
+ text,
35
+ isRunning,
36
+ }) => {
33
37
  const [context] = useState<ContentPartContextValue>(() => {
34
38
  const useContentPartRuntime = create(
35
39
  // TODO
@@ -0,0 +1,54 @@
1
+ "use client";
2
+
3
+ import { type FC, type PropsWithChildren, useEffect, useState } from "react";
4
+ import { create } from "zustand";
5
+ import {
6
+ ThreadListItemContext,
7
+ type ThreadListItemContextValue,
8
+ } from "../react/ThreadListItemContext";
9
+ import { writableStore } from "../ReadonlyStore";
10
+ import { ThreadListItemRuntime } from "../../api/ThreadListItemRuntime";
11
+
12
+ export namespace ThreadListItemRuntimeProvider {
13
+ export type Props = PropsWithChildren<{
14
+ runtime: ThreadListItemRuntime;
15
+ }>;
16
+ }
17
+
18
+ const useThreadListItemRuntimeStore = (runtime: ThreadListItemRuntime) => {
19
+ const [store] = useState(() => create(() => runtime));
20
+
21
+ useEffect(() => {
22
+ writableStore(store).setState(runtime, true);
23
+ }, [runtime, store]);
24
+
25
+ return store;
26
+ };
27
+
28
+ export const useThreadListItemStore = (runtime: ThreadListItemRuntime) => {
29
+ const [store] = useState(() => create(() => runtime.getState()));
30
+ useEffect(() => {
31
+ const updateState = () =>
32
+ writableStore(store).setState(runtime.getState(), true);
33
+ updateState();
34
+ return runtime.subscribe(updateState);
35
+ }, [runtime, store]);
36
+
37
+ return store;
38
+ };
39
+
40
+ export const ThreadListItemRuntimeProvider: FC<
41
+ ThreadListItemRuntimeProvider.Props
42
+ > = ({ runtime, children }) => {
43
+ const useThreadListItemRuntime = useThreadListItemRuntimeStore(runtime);
44
+ const useThreadListItem = useThreadListItemStore(runtime);
45
+ const [context] = useState<ThreadListItemContextValue>(() => {
46
+ return { useThreadListItemRuntime, useThreadListItem };
47
+ });
48
+
49
+ return (
50
+ <ThreadListItemContext.Provider value={context}>
51
+ {children}
52
+ </ThreadListItemContext.Provider>
53
+ );
54
+ };
@@ -7,12 +7,12 @@ import { createContextHook } from "./utils/createContextHook";
7
7
  import { createContextStoreHook } from "./utils/createContextStoreHook";
8
8
  import { UseBoundStore } from "zustand";
9
9
  import { AssistantRuntime } from "../../api/AssistantRuntime";
10
- import { ThreadManagerState } from "../../api/ThreadManagerRuntime";
10
+ import { ThreadListState } from "../../api/ThreadListRuntime";
11
11
 
12
12
  export type AssistantContextValue = {
13
13
  useToolUIs: UseBoundStore<ReadonlyStore<AssistantToolUIsState>>;
14
14
  useAssistantRuntime: UseBoundStore<ReadonlyStore<AssistantRuntime>>;
15
- useThreadManager: UseBoundStore<ReadonlyStore<ThreadManagerState>>;
15
+ useThreadList: UseBoundStore<ReadonlyStore<ThreadListState>>;
16
16
 
17
17
  /**
18
18
  * @deprecated Use `useAssistantRuntime` instead. This will be removed in 0.6.0.
@@ -68,7 +68,7 @@ export const { useToolUIs, useToolUIsStore } = createContextStoreHook(
68
68
  "useToolUIs",
69
69
  );
70
70
 
71
- export const { useThreadManager } = createContextStoreHook(
71
+ export const { useThreadList } = createContextStoreHook(
72
72
  useAssistantContext,
73
- "useThreadManager",
73
+ "useThreadList",
74
74
  );
@@ -0,0 +1,39 @@
1
+ "use client";
2
+
3
+ import { createContext } from "react";
4
+ import { ReadonlyStore } from "../ReadonlyStore";
5
+ import { createContextStoreHook } from "./utils/createContextStoreHook";
6
+ import { createContextHook } from "./utils/createContextHook";
7
+ import { UseBoundStore } from "zustand";
8
+ import { ThreadListItemRuntime } from "../../api/ThreadListItemRuntime";
9
+ import { ThreadListItemState } from "../../api/ThreadListItemRuntime";
10
+
11
+ export type ThreadListItemContextValue = {
12
+ useThreadListItemRuntime: UseBoundStore<ReadonlyStore<ThreadListItemRuntime>>;
13
+ useThreadListItem: UseBoundStore<ReadonlyStore<ThreadListItemState>>;
14
+ };
15
+
16
+ export const ThreadListItemContext =
17
+ createContext<ThreadListItemContextValue | null>(null);
18
+
19
+ export const useThreadListItemContext = createContextHook(
20
+ ThreadListItemContext,
21
+ "a component passed to <ThreadListPrimitive.Items components={...}>",
22
+ );
23
+
24
+ export function useThreadListItemRuntime(options?: {
25
+ optional?: false | undefined;
26
+ }): ThreadListItemRuntime;
27
+ export function useThreadListItemRuntime(options?: {
28
+ optional?: boolean | undefined;
29
+ }): ThreadListItemRuntime | null;
30
+ export function useThreadListItemRuntime(options?: {
31
+ optional?: boolean | undefined;
32
+ }) {
33
+ const context = useThreadListItemContext(options);
34
+ if (!context) return null;
35
+ return context.useThreadListItemRuntime();
36
+ }
37
+
38
+ export const { useThreadListItem, useThreadListItemStore } =
39
+ createContextStoreHook(useThreadListItemContext, "useThreadListItem");
@@ -1,6 +1,6 @@
1
1
  export {
2
2
  useAssistantRuntime,
3
- useThreadManager,
3
+ useThreadList,
4
4
  useToolUIs,
5
5
  useToolUIsStore,
6
6
 
@@ -150,7 +150,7 @@ export {
150
150
  useAttachment,
151
151
  useAttachmentRuntime,
152
152
 
153
- // TODO decide if we want to export/drop these?
153
+ // TODO decide if we want to export/drop these?
154
154
  // useEditComposerAttachment,
155
155
  // useEditComposerAttachmentRuntime,
156
156
  // useMessageAttachment,
package/src/internal.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { ThreadRuntimeCore } from "./runtimes/core/ThreadRuntimeCore";
2
- export type { ThreadManagerRuntimeCore } from "./runtimes/core/ThreadManagerRuntimeCore";
2
+ export type { ThreadListRuntimeCore } from "./runtimes/core/ThreadListRuntimeCore";
3
3
  export { DefaultThreadComposerRuntimeCore } from "./runtimes/composer/DefaultThreadComposerRuntimeCore";
4
4
  export { ProxyConfigProvider } from "./utils/ProxyConfigProvider";
5
5
  export { MessageRepository } from "./runtimes/utils/MessageRepository";
@@ -6,6 +6,8 @@ export * as ComposerPrimitive from "./composer";
6
6
  export * as ContentPartPrimitive from "./contentPart";
7
7
  export * as MessagePrimitive from "./message";
8
8
  export * as ThreadPrimitive from "./thread";
9
+ export * as ThreadListPrimitive from "./threadList";
10
+ export * as ThreadListItemPrimitive from "./threadListItem";
9
11
 
10
12
  export type * from "./actionBar/types";
11
13
  export type * from "./assistantModal/types";
@@ -0,0 +1,73 @@
1
+ "use client";
2
+
3
+ import { ComponentType, FC, memo, useMemo } from "react";
4
+ import { ThreadListItemRuntimeProvider } from "../../context/providers/ThreadListItemRuntimeProvider";
5
+ import { useAssistantRuntime, useThreadList } from "../../context";
6
+
7
+ export namespace MessagePrimitiveContent {
8
+ export type Props = {
9
+ archived?: boolean | undefined;
10
+ components: {
11
+ ThreadListItem: ComponentType;
12
+ };
13
+ };
14
+ }
15
+
16
+ type ThreadListItemProps = {
17
+ partIndex: number;
18
+ archived: boolean;
19
+ components: MessagePrimitiveContent.Props["components"];
20
+ };
21
+
22
+ const ThreadListItemImpl: FC<ThreadListItemProps> = ({
23
+ partIndex,
24
+ archived,
25
+ components,
26
+ }) => {
27
+ const assistantRuntime = useAssistantRuntime();
28
+ const runtime = useMemo(
29
+ () =>
30
+ archived
31
+ ? assistantRuntime.threadList.getThreadListArchivedItemByIndex(
32
+ partIndex,
33
+ )
34
+ : assistantRuntime.threadList.getThreadListItemByIndex(partIndex),
35
+ [assistantRuntime, partIndex],
36
+ );
37
+
38
+ const ThreadListItemComponent = components.ThreadListItem;
39
+
40
+ return (
41
+ <ThreadListItemRuntimeProvider runtime={runtime}>
42
+ <ThreadListItemComponent />
43
+ </ThreadListItemRuntimeProvider>
44
+ );
45
+ };
46
+
47
+ const ThreadListItem = memo(
48
+ ThreadListItemImpl,
49
+ (prev, next) =>
50
+ prev.partIndex === next.partIndex &&
51
+ prev.archived === next.archived &&
52
+ prev.components.ThreadListItem === next.components.ThreadListItem,
53
+ );
54
+
55
+ export const ThreadListPrimitiveItems: FC<MessagePrimitiveContent.Props> = ({
56
+ archived = false,
57
+ components,
58
+ }) => {
59
+ const contentLength = useThreadList((s) =>
60
+ archived ? s.archivedThreads.length : s.threads.length,
61
+ );
62
+
63
+ return Array.from({ length: contentLength }, (_, index) => (
64
+ <ThreadListItem
65
+ key={index}
66
+ partIndex={index}
67
+ archived={archived}
68
+ components={components}
69
+ />
70
+ ));
71
+ };
72
+
73
+ ThreadListPrimitiveItems.displayName = "ThreadListPrimitive.Items";
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import {
4
+ ActionButtonElement,
5
+ ActionButtonProps,
6
+ createActionButton,
7
+ } from "../../utils/createActionButton";
8
+ import { useAssistantRuntime } from "../../context";
9
+
10
+ const useThreadListNew = () => {
11
+ const runtime = useAssistantRuntime();
12
+ return () => {
13
+ runtime.switchToNewThread();
14
+ };
15
+ };
16
+
17
+ export namespace ThreadListPrimitiveNew {
18
+ export type Element = ActionButtonElement;
19
+ export type Props = ActionButtonProps<typeof useThreadListNew>;
20
+ }
21
+
22
+ export const ThreadListPrimitiveNew = createActionButton(
23
+ "ThreadListPrimitive.New",
24
+ useThreadListNew,
25
+ );
@@ -0,0 +1,2 @@
1
+ export { ThreadListPrimitiveNew as New } from "./ThreadListNew";
2
+ export { ThreadListPrimitiveItems as Items } from "./ThreadListItems";
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import {
4
+ ActionButtonElement,
5
+ ActionButtonProps,
6
+ createActionButton,
7
+ } from "../../utils/createActionButton";
8
+ import { useThreadListItemRuntime } from "../../context/react/ThreadListItemContext";
9
+
10
+ const useThreadListItemArchive = () => {
11
+ const runtime = useThreadListItemRuntime();
12
+ return () => {
13
+ runtime.archive();
14
+ };
15
+ };
16
+
17
+ export namespace ThreadListItemPrimitiveArchive {
18
+ export type Element = ActionButtonElement;
19
+ export type Props = ActionButtonProps<typeof useThreadListItemArchive>;
20
+ }
21
+
22
+ export const ThreadListItemPrimitiveArchive = createActionButton(
23
+ "ThreadListItemPrimitive.Archive",
24
+ useThreadListItemArchive,
25
+ );
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import {
4
+ ActionButtonElement,
5
+ ActionButtonProps,
6
+ createActionButton,
7
+ } from "../../utils/createActionButton";
8
+ import { useThreadListItemRuntime } from "../../context/react/ThreadListItemContext";
9
+
10
+ const useThreadListItemDelete = () => {
11
+ const runtime = useThreadListItemRuntime();
12
+ return () => {
13
+ runtime.delete();
14
+ };
15
+ };
16
+
17
+ export namespace ThreadListItemPrimitiveDelete {
18
+ export type Element = ActionButtonElement;
19
+ export type Props = ActionButtonProps<typeof useThreadListItemDelete>;
20
+ }
21
+
22
+ export const ThreadListItemPrimitiveDelete = createActionButton(
23
+ "ThreadListItemPrimitive.Delete",
24
+ useThreadListItemDelete,
25
+ );
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import {
4
+ ActionButtonElement,
5
+ ActionButtonProps,
6
+ createActionButton,
7
+ } from "../../utils/createActionButton";
8
+ import { useThreadListItemRuntime } from "../../context/react/ThreadListItemContext";
9
+
10
+ const useThreadListItemUnarchive = () => {
11
+ const runtime = useThreadListItemRuntime();
12
+ return () => {
13
+ runtime.unarchive();
14
+ };
15
+ };
16
+
17
+ export namespace ThreadListItemPrimitiveUnarchive {
18
+ export type Element = ActionButtonElement;
19
+ export type Props = ActionButtonProps<typeof useThreadListItemUnarchive>;
20
+ }
21
+
22
+ export const ThreadListItemPrimitiveUnarchive = createActionButton(
23
+ "ThreadListItemPrimitive.Unarchive",
24
+ useThreadListItemUnarchive,
25
+ );
@@ -0,0 +1,3 @@
1
+ export { ThreadListItemPrimitiveArchive as Archive } from "./ThreadListItemArchive";
2
+ export { ThreadListItemPrimitiveUnarchive as Unarchive } from "./ThreadListItemUnarchive";
3
+ export { ThreadListItemPrimitiveDelete as Delete } from "./ThreadListItemDelete";
@@ -6,6 +6,7 @@ import {
6
6
  import { AppendMessage, Unsubscribe } from "../../types";
7
7
  import { AttachmentAdapter } from "../attachment";
8
8
  import { ComposerRuntimeCore } from "../core/ComposerRuntimeCore";
9
+ import { MessageRole } from "../../types/AssistantTypes";
9
10
 
10
11
  const isAttachmentComplete = (a: Attachment): a is CompleteAttachment =>
11
12
  a.status.type === "complete";
@@ -20,14 +21,15 @@ export abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
20
21
  }
21
22
 
22
23
  private _attachments: readonly Attachment[] = [];
23
- protected set attachments(value: readonly Attachment[]) {
24
- this._attachments = value;
25
- this.notifySubscribers();
26
- }
27
24
  public get attachments() {
28
25
  return this._attachments;
29
26
  }
30
27
 
28
+ protected setAttachments(value: readonly Attachment[]) {
29
+ this._attachments = value;
30
+ this.notifySubscribers();
31
+ }
32
+
31
33
  public abstract get canCancel(): boolean;
32
34
 
33
35
  public get isEmpty() {
@@ -40,6 +42,17 @@ export abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
40
42
  return this._text;
41
43
  }
42
44
 
45
+ private _role: MessageRole = "user";
46
+
47
+ get role() {
48
+ return this._role;
49
+ }
50
+
51
+ setRole(role: MessageRole) {
52
+ this._role = role;
53
+ this.notifySubscribers();
54
+ }
55
+
43
56
  setText(value: string) {
44
57
  this._text = value;
45
58
  this.notifySubscribers();
@@ -47,6 +60,7 @@ export abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
47
60
 
48
61
  reset() {
49
62
  this._text = "";
63
+ this._role = "user";
50
64
  this._attachments = [];
51
65
  this.notifySubscribers();
52
66
  }
@@ -69,7 +83,7 @@ export abstract class BaseComposerRuntimeCore implements ComposerRuntimeCore {
69
83
  : [];
70
84
 
71
85
  const message: Omit<AppendMessage, "parentId"> = {
72
- role: "user",
86
+ role: this.role,
73
87
  content: this.text ? [{ type: "text", text: this.text }] : [],
74
88
  attachments,
75
89
  };
@@ -28,11 +28,12 @@ export class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {
28
28
  this._previousText = getThreadMessageText(message);
29
29
  this.setText(this._previousText);
30
30
 
31
+ this.setRole(message.role);
32
+ this.setAttachments(message.attachments ?? []);
33
+
31
34
  this._nonTextParts = message.content.filter(
32
35
  (part) => part.type !== "text" && part.type !== "ui",
33
36
  );
34
-
35
- this.attachments = message.attachments ?? [];
36
37
  }
37
38
 
38
39
  public async handleSend(message: Omit<AppendMessage, "parentId">) {
@@ -1,9 +1,9 @@
1
1
  import type { ModelConfigProvider } from "../../types/ModelConfigTypes";
2
2
  import type { Unsubscribe } from "../../types/Unsubscribe";
3
- import { ThreadManagerRuntimeCore } from "./ThreadManagerRuntimeCore";
3
+ import { ThreadListRuntimeCore } from "./ThreadListRuntimeCore";
4
4
 
5
5
  export type AssistantRuntimeCore = {
6
- readonly threadManager: ThreadManagerRuntimeCore;
6
+ readonly threadList: ThreadListRuntimeCore;
7
7
 
8
8
  registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
9
9
  };
@@ -2,11 +2,11 @@ import { type ModelConfigProvider } from "../../types/ModelConfigTypes";
2
2
  import type { Unsubscribe } from "../../types/Unsubscribe";
3
3
  import type { AssistantRuntimeCore } from "./AssistantRuntimeCore";
4
4
  import { ProxyConfigProvider } from "../../utils/ProxyConfigProvider";
5
- import { ThreadManagerRuntimeCore } from "./ThreadManagerRuntimeCore";
5
+ import { ThreadListRuntimeCore } from "./ThreadListRuntimeCore";
6
6
 
7
7
  export abstract class BaseAssistantRuntimeCore implements AssistantRuntimeCore {
8
8
  protected readonly _proxyConfigProvider = new ProxyConfigProvider();
9
- public abstract get threadManager(): ThreadManagerRuntimeCore;
9
+ public abstract get threadList(): ThreadListRuntimeCore;
10
10
 
11
11
  constructor() {}
12
12
 
@@ -1,4 +1,5 @@
1
1
  import type { Attachment, PendingAttachment, Unsubscribe } from "../../types";
2
+ import { MessageRole } from "../../types/AssistantTypes";
2
3
 
3
4
  export type ComposerRuntimeCore = Readonly<{
4
5
  attachments: readonly Attachment[];
@@ -15,6 +16,9 @@ export type ComposerRuntimeCore = Readonly<{
15
16
  text: string;
16
17
  setText: (value: string) => void;
17
18
 
19
+ role: MessageRole;
20
+ setRole: (role: MessageRole) => void;
21
+
18
22
  /**
19
23
  * @deprecated This method will be removed in 0.6.0. Submit feedback if you need this functionality.
20
24
  */
@@ -1,16 +1,18 @@
1
1
  import { Unsubscribe } from "../../types";
2
2
  import { ThreadRuntimeCore } from "./ThreadRuntimeCore";
3
3
 
4
- export type ThreadManagerMetadata = {
4
+ export type ThreadListMetadata = Readonly<{
5
5
  threadId: string;
6
6
  title?: string;
7
- };
7
+ }>;
8
8
 
9
- export type ThreadManagerRuntimeCore = {
9
+ export type ThreadListRuntimeCore = {
10
10
  mainThread: ThreadRuntimeCore;
11
11
 
12
- threads: readonly ThreadManagerMetadata[];
13
- archivedThreads: readonly ThreadManagerMetadata[];
12
+ threads: readonly ThreadListMetadata[];
13
+ archivedThreads: readonly ThreadListMetadata[];
14
+
15
+ getThreadMetadataById(threadId: string): ThreadListMetadata | undefined;
14
16
 
15
17
  switchToThread(threadId: string): void;
16
18
  switchToNewThread(): void;
@@ -12,7 +12,7 @@ export const subscribeToMainThread = (
12
12
  let cleanup: Unsubscribe | undefined;
13
13
  const inner = () => {
14
14
  cleanup?.();
15
- cleanup = runtime.threadManager.mainThread.subscribe(callback);
15
+ cleanup = runtime.threadList.mainThread.subscribe(callback);
16
16
 
17
17
  if (!first) {
18
18
  callback();
@@ -20,7 +20,7 @@ export const subscribeToMainThread = (
20
20
  first = false;
21
21
  };
22
22
 
23
- const unsubscribe = runtime.threadManager.mainThread.subscribe(inner);
23
+ const unsubscribe = runtime.threadList.mainThread.subscribe(inner);
24
24
  inner();
25
25
 
26
26
  return () => {
@@ -6,13 +6,13 @@ import {
6
6
  } from "../core/ThreadRuntimeCore";
7
7
  import { FeedbackAdapter } from "../feedback/FeedbackAdapter";
8
8
  import { SpeechSynthesisAdapter } from "../speech/SpeechAdapterTypes";
9
- import { ThreadManagerMetadata } from "../core/ThreadManagerRuntimeCore";
9
+ import { ThreadListMetadata } from "../core/ThreadListRuntimeCore";
10
10
  import { ThreadMessageLike } from "./ThreadMessageLike";
11
11
 
12
- export type ExternalStoreThreadManagerAdapter = {
12
+ export type ExternalStoreThreadListAdapter = {
13
13
  threadId?: string | undefined;
14
- threads?: readonly ThreadManagerMetadata[] | undefined;
15
- archivedThreads?: readonly ThreadManagerMetadata[] | undefined;
14
+ threads?: readonly ThreadListMetadata[] | undefined;
15
+ archivedThreads?: readonly ThreadListMetadata[] | undefined;
16
16
  onSwitchToNewThread?: (() => Promise<void> | void) | undefined;
17
17
  onSwitchToThread?: ((threadId: string) => Promise<void> | void) | undefined;
18
18
  onRename?: (
@@ -35,16 +35,16 @@ type ExternalStoreMessageConverterAdapter<T> = {
35
35
 
36
36
  type ExternalStoreAdapterBase<T> = {
37
37
  /**
38
- * @deprecated Use `adapters.threadManager.threadId` instead. This will be removed in 0.6.0.
38
+ * @deprecated Use `adapterst.threadList.threadId` instead. This will be removed in 0.6.0.
39
39
  */
40
40
  threadId?: string | undefined;
41
41
 
42
42
  /**
43
- * @deprecated Use `adapters.threadManager.onSwitchToThread` instead. This will be removed in 0.6.0.
43
+ * @deprecated Use `adapters..threadList.onSwitchToThread` instead. This will be removed in 0.6.0.
44
44
  */
45
45
  onSwitchToThread?: ((threadId: string) => Promise<void> | void) | undefined;
46
46
  /**
47
- * @deprecated Use `adapters.threadManager.onSwitchToNewThread` instead. This will be removed in 0.6.0.
47
+ * @deprecated Use `adapters.threadList.onSwitchToNewThread` instead. This will be removed in 0.6.0.
48
48
  */
49
49
  onSwitchToNewThread?: (() => Promise<void> | void) | undefined;
50
50
 
@@ -68,7 +68,7 @@ type ExternalStoreAdapterBase<T> = {
68
68
  attachments?: AttachmentAdapter | undefined;
69
69
  speech?: SpeechSynthesisAdapter | undefined;
70
70
  feedback?: FeedbackAdapter | undefined;
71
- threadManager?: ExternalStoreThreadManagerAdapter | undefined;
71
+ threadList?: ExternalStoreThreadListAdapter | undefined;
72
72
  }
73
73
  | undefined;
74
74
  unstable_capabilities?:
@@ -1,27 +1,27 @@
1
1
  import { BaseAssistantRuntimeCore } from "../../internal";
2
- import { ExternalStoreThreadManagerRuntimeCore } from "./ExternalStoreThreadManagementAdapter";
2
+ import { ExternalStoreThreadListRuntimeCore } from "./ExternalStoreThreadListRuntimeCore";
3
3
  import { ExternalStoreAdapter } from "./ExternalStoreAdapter";
4
4
  import { ExternalStoreThreadRuntimeCore } from "./ExternalStoreThreadRuntimeCore";
5
5
 
6
- const getThreadManagerAdapter = (store: ExternalStoreAdapter<any>) => {
6
+ const getThreadListAdapter = (store: ExternalStoreAdapter<any>) => {
7
7
  return {
8
8
  threadId: store.threadId,
9
9
  onSwitchToNewThread: store.onSwitchToNewThread,
10
10
  onSwitchToThread: store.onSwitchToThread,
11
- ...store.adapters?.threadManager,
11
+ ...store.adapters?.threadList,
12
12
  };
13
13
  };
14
14
 
15
15
  export class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {
16
- public readonly threadManager;
16
+ public readonly threadList;
17
17
 
18
18
  private _store: ExternalStoreAdapter<any>;
19
19
 
20
20
  constructor(store: ExternalStoreAdapter<any>) {
21
21
  super();
22
22
  this._store = store;
23
- this.threadManager = new ExternalStoreThreadManagerRuntimeCore(
24
- getThreadManagerAdapter(store),
23
+ this.threadList = new ExternalStoreThreadListRuntimeCore(
24
+ getThreadListAdapter(store),
25
25
  (threadId) =>
26
26
  new ExternalStoreThreadRuntimeCore(
27
27
  this._proxyConfigProvider,
@@ -33,7 +33,7 @@ export class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {
33
33
 
34
34
  public setStore(store: ExternalStoreAdapter<any>) {
35
35
  this._store = store;
36
- this.threadManager.setAdapter(getThreadManagerAdapter(store));
37
- this.threadManager.mainThread.setStore(store);
36
+ this.threadList.setAdapter(getThreadListAdapter(store));
37
+ this.threadList.mainThread.setStore(store);
38
38
  }
39
39
  }