@assistant-ui/react 0.5.98 → 0.5.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) 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} +21 -9
  185. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -0
  186. package/dist/runtimes/external-store/{ExternalStoreThreadManagementAdapter.mjs → ExternalStoreThreadListRuntimeCore.mjs} +17 -5
  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/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
  190. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js +8 -3
  191. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
  192. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs +8 -3
  193. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs.map +1 -1
  194. package/dist/runtimes/local/LocalRuntimeCore.d.ts +2 -2
  195. package/dist/runtimes/local/LocalRuntimeCore.d.ts.map +1 -1
  196. package/dist/runtimes/local/LocalRuntimeCore.js +7 -7
  197. package/dist/runtimes/local/LocalRuntimeCore.js.map +1 -1
  198. package/dist/runtimes/local/LocalRuntimeCore.mjs +7 -7
  199. package/dist/runtimes/local/LocalRuntimeCore.mjs.map +1 -1
  200. package/dist/runtimes/local/{LocalThreadManagerRuntimeCore.d.ts → LocalThreadListRuntimeCore.d.ts} +16 -6
  201. package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts.map +1 -0
  202. package/dist/runtimes/local/{LocalThreadManagerRuntimeCore.js → LocalThreadListRuntimeCore.js} +11 -8
  203. package/dist/runtimes/local/LocalThreadListRuntimeCore.js.map +1 -0
  204. package/dist/runtimes/local/{LocalThreadManagerRuntimeCore.mjs → LocalThreadListRuntimeCore.mjs} +7 -4
  205. package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs.map +1 -0
  206. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
  207. package/dist/runtimes/local/LocalThreadRuntimeCore.js +2 -1
  208. package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
  209. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +2 -1
  210. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
  211. package/dist/types/AssistantTypes.d.ts +2 -0
  212. package/dist/types/AssistantTypes.d.ts.map +1 -1
  213. package/dist/types/AssistantTypes.js.map +1 -1
  214. package/package.json +7 -7
  215. package/src/api/AssistantRuntime.ts +9 -12
  216. package/src/api/ComposerRuntime.ts +17 -0
  217. package/src/api/MessageRuntime.ts +0 -9
  218. package/src/api/RuntimePathTypes.ts +10 -1
  219. package/src/api/ThreadListItemRuntime.ts +67 -0
  220. package/src/api/ThreadListRuntime.ts +159 -0
  221. package/src/api/ThreadRuntime.ts +2 -1
  222. package/src/api/index.ts +1 -4
  223. package/src/context/providers/AssistantRuntimeProvider.tsx +7 -9
  224. package/src/context/providers/AttachmentRuntimeProvider.tsx +6 -4
  225. package/src/context/providers/ContentPartRuntimeProvider.tsx +8 -7
  226. package/src/context/providers/MessageRuntimeProvider.tsx +6 -4
  227. package/src/context/providers/TextContentPartProvider.tsx +11 -7
  228. package/src/context/providers/ThreadListItemRuntimeProvider.tsx +54 -0
  229. package/src/context/react/AssistantContext.ts +4 -4
  230. package/src/context/react/ThreadListItemContext.ts +39 -0
  231. package/src/context/react/index.ts +2 -2
  232. package/src/internal.ts +1 -1
  233. package/src/primitives/index.ts +2 -0
  234. package/src/primitives/threadList/ThreadListItems.tsx +73 -0
  235. package/src/primitives/threadList/ThreadListNew.ts +25 -0
  236. package/src/primitives/threadList/index.ts +2 -0
  237. package/src/primitives/threadListItem/ThreadListItemArchive.ts +25 -0
  238. package/src/primitives/threadListItem/ThreadListItemDelete.ts +25 -0
  239. package/src/primitives/threadListItem/ThreadListItemUnarchive.ts +25 -0
  240. package/src/primitives/threadListItem/index.ts +3 -0
  241. package/src/runtimes/composer/BaseComposerRuntimeCore.tsx +19 -5
  242. package/src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx +3 -2
  243. package/src/runtimes/core/AssistantRuntimeCore.tsx +2 -2
  244. package/src/runtimes/core/BaseAssistantRuntimeCore.tsx +2 -2
  245. package/src/runtimes/core/ComposerRuntimeCore.tsx +4 -0
  246. package/src/runtimes/core/{ThreadManagerRuntimeCore.tsx → ThreadListRuntimeCore.tsx} +7 -5
  247. package/src/runtimes/core/subscribeToMainThread.ts +2 -2
  248. package/src/runtimes/external-store/ExternalStoreAdapter.tsx +8 -8
  249. package/src/runtimes/external-store/ExternalStoreRuntimeCore.tsx +8 -8
  250. package/src/runtimes/external-store/{ExternalStoreThreadManagementAdapter.tsx → ExternalStoreThreadListRuntimeCore.tsx} +24 -9
  251. package/src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx +8 -3
  252. package/src/runtimes/local/LocalRuntimeCore.tsx +7 -7
  253. package/src/runtimes/local/{LocalThreadManagerRuntimeCore.tsx → LocalThreadListRuntimeCore.tsx} +11 -7
  254. package/src/runtimes/local/LocalThreadRuntimeCore.tsx +2 -1
  255. package/src/types/AssistantTypes.ts +3 -0
  256. package/dist/api/ThreadManagerRuntime.d.ts +0 -32
  257. package/dist/api/ThreadManagerRuntime.d.ts.map +0 -1
  258. package/dist/api/ThreadManagerRuntime.js +0 -73
  259. package/dist/api/ThreadManagerRuntime.js.map +0 -1
  260. package/dist/api/ThreadManagerRuntime.mjs +0 -48
  261. package/dist/api/ThreadManagerRuntime.mjs.map +0 -1
  262. package/dist/runtimes/core/ThreadManagerRuntimeCore.d.ts.map +0 -1
  263. package/dist/runtimes/core/ThreadManagerRuntimeCore.js.map +0 -1
  264. package/dist/runtimes/core/ThreadManagerRuntimeCore.mjs +0 -1
  265. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.d.ts +0 -25
  266. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.d.ts.map +0 -1
  267. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.js.map +0 -1
  268. package/dist/runtimes/external-store/ExternalStoreThreadManagementAdapter.mjs.map +0 -1
  269. package/dist/runtimes/local/LocalThreadManagerRuntimeCore.d.ts.map +0 -1
  270. package/dist/runtimes/local/LocalThreadManagerRuntimeCore.js.map +0 -1
  271. package/dist/runtimes/local/LocalThreadManagerRuntimeCore.mjs.map +0 -1
  272. package/src/api/ThreadManagerRuntime.ts +0 -80
  273. /package/dist/runtimes/core/{ThreadManagerRuntimeCore.mjs.map → ThreadListRuntimeCore.mjs.map} +0 -0
@@ -0,0 +1,58 @@
1
+ import { ReadonlyStore } from "../ReadonlyStore";
2
+ import { UseBoundStore } from "zustand";
3
+ import { ThreadListItemRuntime } from "../../api/ThreadListItemRuntime";
4
+ import { ThreadListItemState } from "../../api/ThreadListItemRuntime";
5
+ export type ThreadListItemContextValue = {
6
+ useThreadListItemRuntime: UseBoundStore<ReadonlyStore<ThreadListItemRuntime>>;
7
+ useThreadListItem: UseBoundStore<ReadonlyStore<ThreadListItemState>>;
8
+ };
9
+ export declare const ThreadListItemContext: import("react").Context<ThreadListItemContextValue | null>;
10
+ export declare const useThreadListItemContext: {
11
+ (options?: {
12
+ optional?: false | undefined;
13
+ } | undefined): ThreadListItemContextValue;
14
+ (options?: {
15
+ optional?: boolean | undefined;
16
+ } | undefined): ThreadListItemContextValue | null;
17
+ };
18
+ export declare function useThreadListItemRuntime(options?: {
19
+ optional?: false | undefined;
20
+ }): ThreadListItemRuntime;
21
+ export declare function useThreadListItemRuntime(options?: {
22
+ optional?: boolean | undefined;
23
+ }): ThreadListItemRuntime | null;
24
+ export declare const useThreadListItem: {
25
+ (): Readonly<{
26
+ threadId: string;
27
+ title?: string;
28
+ }>;
29
+ <TSelected>(selector: (state: Readonly<{
30
+ threadId: string;
31
+ title?: string;
32
+ }>) => TSelected): TSelected;
33
+ (options: {
34
+ optional: true;
35
+ }): Readonly<{
36
+ threadId: string;
37
+ title?: string;
38
+ }> | null;
39
+ <TSelected>(options: {
40
+ optional: true;
41
+ selector?: (state: Readonly<{
42
+ threadId: string;
43
+ title?: string;
44
+ }>) => TSelected;
45
+ }): TSelected | null;
46
+ }, useThreadListItemStore: {
47
+ (): ReadonlyStore<Readonly<{
48
+ threadId: string;
49
+ title?: string;
50
+ }>>;
51
+ (options: {
52
+ optional: true;
53
+ }): ReadonlyStore<Readonly<{
54
+ threadId: string;
55
+ title?: string;
56
+ }>> | null;
57
+ };
58
+ //# sourceMappingURL=ThreadListItemContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadListItemContext.d.ts","sourceRoot":"","sources":["../../../src/context/react/ThreadListItemContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,MAAM,0BAA0B,GAAG;IACvC,wBAAwB,EAAE,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC9E,iBAAiB,EAAE,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,qBAAqB,4DACsB,CAAC;AAEzD,eAAO,MAAM,wBAAwB;;;;;;;CAGpC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACjD,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CAC9B,GAAG,qBAAqB,CAAC;AAC1B,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACjD,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,GAAG,qBAAqB,GAAG,IAAI,CAAC;AASjC,eAAO,MAAQ,iBAAiB;;;;;;;;;;;;;;;;;;;;;;GAAE,sBAAsB;;;;;;;;;;;CACe,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/context/react/ThreadListItemContext.ts
22
+ var ThreadListItemContext_exports = {};
23
+ __export(ThreadListItemContext_exports, {
24
+ ThreadListItemContext: () => ThreadListItemContext,
25
+ useThreadListItem: () => useThreadListItem,
26
+ useThreadListItemContext: () => useThreadListItemContext,
27
+ useThreadListItemRuntime: () => useThreadListItemRuntime,
28
+ useThreadListItemStore: () => useThreadListItemStore
29
+ });
30
+ module.exports = __toCommonJS(ThreadListItemContext_exports);
31
+ var import_react = require("react");
32
+ var import_createContextStoreHook = require("./utils/createContextStoreHook.cjs");
33
+ var import_createContextHook = require("./utils/createContextHook.cjs");
34
+ var ThreadListItemContext = (0, import_react.createContext)(null);
35
+ var useThreadListItemContext = (0, import_createContextHook.createContextHook)(
36
+ ThreadListItemContext,
37
+ "a component passed to <ThreadListPrimitive.Items components={...}>"
38
+ );
39
+ function useThreadListItemRuntime(options) {
40
+ const context = useThreadListItemContext(options);
41
+ if (!context) return null;
42
+ return context.useThreadListItemRuntime();
43
+ }
44
+ var { useThreadListItem, useThreadListItemStore } = (0, import_createContextStoreHook.createContextStoreHook)(useThreadListItemContext, "useThreadListItem");
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ ThreadListItemContext,
48
+ useThreadListItem,
49
+ useThreadListItemContext,
50
+ useThreadListItemRuntime,
51
+ useThreadListItemStore
52
+ });
53
+ //# sourceMappingURL=ThreadListItemContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/react/ThreadListItemContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { ReadonlyStore } from \"../ReadonlyStore\";\nimport { createContextStoreHook } from \"./utils/createContextStoreHook\";\nimport { createContextHook } from \"./utils/createContextHook\";\nimport { UseBoundStore } from \"zustand\";\nimport { ThreadListItemRuntime } from \"../../api/ThreadListItemRuntime\";\nimport { ThreadListItemState } from \"../../api/ThreadListItemRuntime\";\n\nexport type ThreadListItemContextValue = {\n useThreadListItemRuntime: UseBoundStore<ReadonlyStore<ThreadListItemRuntime>>;\n useThreadListItem: UseBoundStore<ReadonlyStore<ThreadListItemState>>;\n};\n\nexport const ThreadListItemContext =\n createContext<ThreadListItemContextValue | null>(null);\n\nexport const useThreadListItemContext = createContextHook(\n ThreadListItemContext,\n \"a component passed to <ThreadListPrimitive.Items components={...}>\",\n);\n\nexport function useThreadListItemRuntime(options?: {\n optional?: false | undefined;\n}): ThreadListItemRuntime;\nexport function useThreadListItemRuntime(options?: {\n optional?: boolean | undefined;\n}): ThreadListItemRuntime | null;\nexport function useThreadListItemRuntime(options?: {\n optional?: boolean | undefined;\n}) {\n const context = useThreadListItemContext(options);\n if (!context) return null;\n return context.useThreadListItemRuntime();\n}\n\nexport const { useThreadListItem, useThreadListItemStore } =\n createContextStoreHook(useThreadListItemContext, \"useThreadListItem\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8B;AAE9B,oCAAuC;AACvC,+BAAkC;AAU3B,IAAM,4BACX,4BAAiD,IAAI;AAEhD,IAAM,+BAA2B;AAAA,EACtC;AAAA,EACA;AACF;AAQO,SAAS,yBAAyB,SAEtC;AACD,QAAM,UAAU,yBAAyB,OAAO;AAChD,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,QAAQ,yBAAyB;AAC1C;AAEO,IAAM,EAAE,mBAAmB,uBAAuB,QACvD,sDAAuB,0BAA0B,mBAAmB;","names":[]}
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ // src/context/react/ThreadListItemContext.ts
4
+ import { createContext } from "react";
5
+ import { createContextStoreHook } from "./utils/createContextStoreHook.mjs";
6
+ import { createContextHook } from "./utils/createContextHook.mjs";
7
+ var ThreadListItemContext = createContext(null);
8
+ var useThreadListItemContext = createContextHook(
9
+ ThreadListItemContext,
10
+ "a component passed to <ThreadListPrimitive.Items components={...}>"
11
+ );
12
+ function useThreadListItemRuntime(options) {
13
+ const context = useThreadListItemContext(options);
14
+ if (!context) return null;
15
+ return context.useThreadListItemRuntime();
16
+ }
17
+ var { useThreadListItem, useThreadListItemStore } = createContextStoreHook(useThreadListItemContext, "useThreadListItem");
18
+ export {
19
+ ThreadListItemContext,
20
+ useThreadListItem,
21
+ useThreadListItemContext,
22
+ useThreadListItemRuntime,
23
+ useThreadListItemStore
24
+ };
25
+ //# sourceMappingURL=ThreadListItemContext.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/react/ThreadListItemContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { ReadonlyStore } from \"../ReadonlyStore\";\nimport { createContextStoreHook } from \"./utils/createContextStoreHook\";\nimport { createContextHook } from \"./utils/createContextHook\";\nimport { UseBoundStore } from \"zustand\";\nimport { ThreadListItemRuntime } from \"../../api/ThreadListItemRuntime\";\nimport { ThreadListItemState } from \"../../api/ThreadListItemRuntime\";\n\nexport type ThreadListItemContextValue = {\n useThreadListItemRuntime: UseBoundStore<ReadonlyStore<ThreadListItemRuntime>>;\n useThreadListItem: UseBoundStore<ReadonlyStore<ThreadListItemState>>;\n};\n\nexport const ThreadListItemContext =\n createContext<ThreadListItemContextValue | null>(null);\n\nexport const useThreadListItemContext = createContextHook(\n ThreadListItemContext,\n \"a component passed to <ThreadListPrimitive.Items components={...}>\",\n);\n\nexport function useThreadListItemRuntime(options?: {\n optional?: false | undefined;\n}): ThreadListItemRuntime;\nexport function useThreadListItemRuntime(options?: {\n optional?: boolean | undefined;\n}): ThreadListItemRuntime | null;\nexport function useThreadListItemRuntime(options?: {\n optional?: boolean | undefined;\n}) {\n const context = useThreadListItemContext(options);\n if (!context) return null;\n return context.useThreadListItemRuntime();\n}\n\nexport const { useThreadListItem, useThreadListItemStore } =\n createContextStoreHook(useThreadListItemContext, \"useThreadListItem\");\n"],"mappings":";;;AAEA,SAAS,qBAAqB;AAE9B,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAU3B,IAAM,wBACX,cAAiD,IAAI;AAEhD,IAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AACF;AAQO,SAAS,yBAAyB,SAEtC;AACD,QAAM,UAAU,yBAAyB,OAAO;AAChD,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,QAAQ,yBAAyB;AAC1C;AAEO,IAAM,EAAE,mBAAmB,uBAAuB,IACvD,uBAAuB,0BAA0B,mBAAmB;","names":[]}
@@ -1,4 +1,4 @@
1
- export { useAssistantRuntime, useThreadManager, useToolUIs, useToolUIsStore,
1
+ export { useAssistantRuntime, useThreadList, useToolUIs, useToolUIsStore,
2
2
  /**
3
3
  * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,eAAe;AAEf;;GAEG;AACH,mBAAmB;AACnB;;GAEG;AACH,wBAAwB;AACxB;;GAEG;AACH,wBAAwB;AAExB;;GAEG;AACH,KAAK,qBAAqB;AAC1B;;GAEG;AACH,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,oBAAoB;AAEpB;;GAEG;AACH,iBAAiB;AAEjB;;GAEG;AACH,cAAc;AAEd;;GAEG;AACH,sBAAsB;AAEtB;;GAEG;AACH,gBAAgB;AAEhB;;GAEG;AACH,qBAAqB;AAErB;;GAEG;AACH,qBAAqB,EAErB,iBAAiB,EAEjB,sBAAsB;AAEtB;;GAEG;AACH,sBAAsB;AAEtB;;GAEG;AACH,KAAK,kBAAkB;AACvB;;GAEG;AACH,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,eAAe,EAEf,eAAe,EAEf,oBAAoB;AAEpB;;GAEG;AACH,eAAe;AAEf;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,KAAK,mBAAmB;AACxB;;GAEG;AACH,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,cAAc;AAEd;;GAEG;AACH,mBAAmB;AAEnB;;GAEG;AACH,KAAK,uBAAuB;AAC5B;;GAEG;AACH,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,WAAW;AAEX;;GAEG;AACH,gBAAgB;AAEhB;;GAEG;AACH,KAAK,oBAAoB;AACzB;;GAEG;AACH,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,aAAa,EACb,oBAAoB,GASrB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,eAAe;AAEf;;GAEG;AACH,mBAAmB;AACnB;;GAEG;AACH,wBAAwB;AACxB;;GAEG;AACH,wBAAwB;AAExB;;GAEG;AACH,KAAK,qBAAqB;AAC1B;;GAEG;AACH,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,oBAAoB;AAEpB;;GAEG;AACH,iBAAiB;AAEjB;;GAEG;AACH,cAAc;AAEd;;GAEG;AACH,sBAAsB;AAEtB;;GAEG;AACH,gBAAgB;AAEhB;;GAEG;AACH,qBAAqB;AAErB;;GAEG;AACH,qBAAqB,EAErB,iBAAiB,EAEjB,sBAAsB;AAEtB;;GAEG;AACH,sBAAsB;AAEtB;;GAEG;AACH,KAAK,kBAAkB;AACvB;;GAEG;AACH,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,eAAe,EAEf,eAAe,EAEf,oBAAoB;AAEpB;;GAEG;AACH,eAAe;AAEf;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,KAAK,mBAAmB;AACxB;;GAEG;AACH,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,cAAc;AAEd;;GAEG;AACH,mBAAmB;AAEnB;;GAEG;AACH,KAAK,uBAAuB;AAC5B;;GAEG;AACH,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,WAAW;AAEX;;GAEG;AACH,gBAAgB;AAEhB;;GAEG;AACH,KAAK,oBAAoB;AACzB;;GAEG;AACH,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,aAAa,EACb,oBAAoB,GASrB,MAAM,qBAAqB,CAAC"}
@@ -49,7 +49,7 @@ __export(react_exports, {
49
49
  useThreadComposer: () => import_ThreadContext.useThreadComposer,
50
50
  useThreadComposerStore: () => import_ThreadContext.useThreadComposerStore,
51
51
  useThreadContext: () => import_ThreadContext.useThreadContext,
52
- useThreadManager: () => import_AssistantContext.useThreadManager,
52
+ useThreadList: () => import_AssistantContext.useThreadList,
53
53
  useThreadMessages: () => import_ThreadContext.useThreadMessages,
54
54
  useThreadMessagesStore: () => import_ThreadContext.useThreadMessagesStore,
55
55
  useThreadModelConfig: () => import_ThreadContext.useThreadModelConfig,
@@ -99,7 +99,7 @@ var import_AttachmentContext = require("./AttachmentContext.cjs");
99
99
  useThreadComposer,
100
100
  useThreadComposerStore,
101
101
  useThreadContext,
102
- useThreadManager,
102
+ useThreadList,
103
103
  useThreadMessages,
104
104
  useThreadMessagesStore,
105
105
  useThreadModelConfig,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/react/index.ts"],"sourcesContent":["export {\n useAssistantRuntime,\n useThreadManager,\n useToolUIs,\n useToolUIsStore,\n\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActions,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActionsStore,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantRuntimeStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type AssistantContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useAssistantContext,\n} from \"./AssistantContext\";\n\nexport {\n useThreadRuntime,\n useThread,\n useThreadComposer,\n useThreadModelConfig,\n\n /**\n * @deprecated Use `useThread().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessages,\n\n /**\n * @deprecated Use `useThreadRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useThreadStore,\n\n /**\n * @deprecated Use `useThreadRuntime().getState().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessagesStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActions,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActionsStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadRuntimeStore,\n // TODO move out of runtime context after 0.6.0\n useThreadViewport,\n // TODO move out of runtime context after 0.6.0\n useThreadViewportStore,\n\n /**\n * @deprecated Use `useThreadRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useThreadComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ThreadContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useThreadContext,\n} from \"./ThreadContext\";\nexport {\n useMessageRuntime,\n useMessage,\n useEditComposer,\n // TODO move out of runtime context after 0.6.0\n useMessageUtils,\n // TODO move out of runtime context after 0.6.0\n useMessageUtilsStore,\n\n /**\n * @deprecated Use `useMessageRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useMessageStore,\n\n /**\n * @deprecated Use `useMessageRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useEditComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type MessageContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useMessageContext,\n} from \"./MessageContext\";\nexport {\n useContentPartRuntime,\n useContentPart,\n\n /**\n * @deprecated Use `useContentPartRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useContentPartStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ContentPartContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useContentPartContext,\n} from \"./ContentPartContext\";\nexport {\n useComposerRuntime,\n useComposer,\n\n /**\n * @deprecated Use `useComposerRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ComposerContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useComposerContext,\n} from \"./ComposerContext\";\n\nexport {\n useAttachment,\n useAttachmentRuntime,\n\n // TODO decide if we want to export/drop these? \n // useEditComposerAttachment,\n // useEditComposerAttachmentRuntime,\n // useMessageAttachment,\n // useMessageAttachmentRuntime,\n // useThreadComposerAttachment,\n // useThreadComposerAttachmentRuntime,\n} from \"./AttachmentContext\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BA2BO;AAEP,2BAqDO;AACP,4BA2BO;AACP,gCAiBO;AACP,6BAiBO;AAEP,+BAWO;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/react/index.ts"],"sourcesContent":["export {\n useAssistantRuntime,\n useThreadList,\n useToolUIs,\n useToolUIsStore,\n\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActions,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActionsStore,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantRuntimeStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type AssistantContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useAssistantContext,\n} from \"./AssistantContext\";\n\nexport {\n useThreadRuntime,\n useThread,\n useThreadComposer,\n useThreadModelConfig,\n\n /**\n * @deprecated Use `useThread().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessages,\n\n /**\n * @deprecated Use `useThreadRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useThreadStore,\n\n /**\n * @deprecated Use `useThreadRuntime().getState().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessagesStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActions,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActionsStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadRuntimeStore,\n // TODO move out of runtime context after 0.6.0\n useThreadViewport,\n // TODO move out of runtime context after 0.6.0\n useThreadViewportStore,\n\n /**\n * @deprecated Use `useThreadRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useThreadComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ThreadContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useThreadContext,\n} from \"./ThreadContext\";\nexport {\n useMessageRuntime,\n useMessage,\n useEditComposer,\n // TODO move out of runtime context after 0.6.0\n useMessageUtils,\n // TODO move out of runtime context after 0.6.0\n useMessageUtilsStore,\n\n /**\n * @deprecated Use `useMessageRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useMessageStore,\n\n /**\n * @deprecated Use `useMessageRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useEditComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type MessageContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useMessageContext,\n} from \"./MessageContext\";\nexport {\n useContentPartRuntime,\n useContentPart,\n\n /**\n * @deprecated Use `useContentPartRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useContentPartStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ContentPartContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useContentPartContext,\n} from \"./ContentPartContext\";\nexport {\n useComposerRuntime,\n useComposer,\n\n /**\n * @deprecated Use `useComposerRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ComposerContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useComposerContext,\n} from \"./ComposerContext\";\n\nexport {\n useAttachment,\n useAttachmentRuntime,\n\n // TODO decide if we want to export/drop these?\n // useEditComposerAttachment,\n // useEditComposerAttachmentRuntime,\n // useMessageAttachment,\n // useMessageAttachmentRuntime,\n // useThreadComposerAttachment,\n // useThreadComposerAttachmentRuntime,\n} from \"./AttachmentContext\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BA2BO;AAEP,2BAqDO;AACP,4BA2BO;AACP,gCAiBO;AACP,6BAiBO;AAEP,+BAWO;","names":[]}
@@ -1,7 +1,7 @@
1
1
  // src/context/react/index.ts
2
2
  import {
3
3
  useAssistantRuntime,
4
- useThreadManager,
4
+ useThreadList,
5
5
  useToolUIs,
6
6
  useToolUIsStore,
7
7
  useAssistantActions,
@@ -81,7 +81,7 @@ export {
81
81
  useThreadComposer,
82
82
  useThreadComposerStore,
83
83
  useThreadContext,
84
- useThreadManager,
84
+ useThreadList,
85
85
  useThreadMessages,
86
86
  useThreadMessagesStore,
87
87
  useThreadModelConfig,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/react/index.ts"],"sourcesContent":["export {\n useAssistantRuntime,\n useThreadManager,\n useToolUIs,\n useToolUIsStore,\n\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActions,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActionsStore,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantRuntimeStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type AssistantContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useAssistantContext,\n} from \"./AssistantContext\";\n\nexport {\n useThreadRuntime,\n useThread,\n useThreadComposer,\n useThreadModelConfig,\n\n /**\n * @deprecated Use `useThread().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessages,\n\n /**\n * @deprecated Use `useThreadRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useThreadStore,\n\n /**\n * @deprecated Use `useThreadRuntime().getState().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessagesStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActions,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActionsStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadRuntimeStore,\n // TODO move out of runtime context after 0.6.0\n useThreadViewport,\n // TODO move out of runtime context after 0.6.0\n useThreadViewportStore,\n\n /**\n * @deprecated Use `useThreadRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useThreadComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ThreadContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useThreadContext,\n} from \"./ThreadContext\";\nexport {\n useMessageRuntime,\n useMessage,\n useEditComposer,\n // TODO move out of runtime context after 0.6.0\n useMessageUtils,\n // TODO move out of runtime context after 0.6.0\n useMessageUtilsStore,\n\n /**\n * @deprecated Use `useMessageRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useMessageStore,\n\n /**\n * @deprecated Use `useMessageRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useEditComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type MessageContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useMessageContext,\n} from \"./MessageContext\";\nexport {\n useContentPartRuntime,\n useContentPart,\n\n /**\n * @deprecated Use `useContentPartRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useContentPartStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ContentPartContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useContentPartContext,\n} from \"./ContentPartContext\";\nexport {\n useComposerRuntime,\n useComposer,\n\n /**\n * @deprecated Use `useComposerRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ComposerContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useComposerContext,\n} from \"./ComposerContext\";\n\nexport {\n useAttachment,\n useAttachmentRuntime,\n\n // TODO decide if we want to export/drop these? \n // useEditComposerAttachment,\n // useEditComposerAttachmentRuntime,\n // useMessageAttachment,\n // useMessageAttachmentRuntime,\n // useThreadComposerAttachment,\n // useThreadComposerAttachmentRuntime,\n} from \"./AttachmentContext\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAKA;AAAA,EAIA;AAAA,EAIA;AAAA,EASA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAEA;AAAA,EAEA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EAKA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OASK;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/react/index.ts"],"sourcesContent":["export {\n useAssistantRuntime,\n useThreadList,\n useToolUIs,\n useToolUIsStore,\n\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActions,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantActionsStore,\n /**\n * @deprecated Use `useAssistantRuntime()` instead. This will be removed in 0.6.0.\n */\n useAssistantRuntimeStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type AssistantContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useAssistantRuntime } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useAssistantContext,\n} from \"./AssistantContext\";\n\nexport {\n useThreadRuntime,\n useThread,\n useThreadComposer,\n useThreadModelConfig,\n\n /**\n * @deprecated Use `useThread().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessages,\n\n /**\n * @deprecated Use `useThreadRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useThreadStore,\n\n /**\n * @deprecated Use `useThreadRuntime().getState().messages` instead. This will be removed in 0.6.0.\n */\n useThreadMessagesStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActions,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadActionsStore,\n\n /**\n * @deprecated Use `useThreadRuntime()` instead. This will be removed in 0.6.0.\n */\n useThreadRuntimeStore,\n // TODO move out of runtime context after 0.6.0\n useThreadViewport,\n // TODO move out of runtime context after 0.6.0\n useThreadViewportStore,\n\n /**\n * @deprecated Use `useThreadRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useThreadComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ThreadContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useThread } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useThreadContext,\n} from \"./ThreadContext\";\nexport {\n useMessageRuntime,\n useMessage,\n useEditComposer,\n // TODO move out of runtime context after 0.6.0\n useMessageUtils,\n // TODO move out of runtime context after 0.6.0\n useMessageUtilsStore,\n\n /**\n * @deprecated Use `useMessageRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useMessageStore,\n\n /**\n * @deprecated Use `useMessageRuntime().composer.getState()` instead. This will be removed in 0.6.0.\n */\n useEditComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type MessageContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useMessage } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useMessageContext,\n} from \"./MessageContext\";\nexport {\n useContentPartRuntime,\n useContentPart,\n\n /**\n * @deprecated Use `useContentPartRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useContentPartStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ContentPartContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useContentPart } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useContentPartContext,\n} from \"./ContentPartContext\";\nexport {\n useComposerRuntime,\n useComposer,\n\n /**\n * @deprecated Use `useComposerRuntime().getState()` instead. This will be removed in 0.6.0.\n */\n useComposerStore,\n\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n type ComposerContextValue,\n /**\n * @deprecated You can import the hooks directly, e.g. `import { useComposer } from \"@assistant-ui/react\"`. This will be removed in 0.6.0.\n */\n useComposerContext,\n} from \"./ComposerContext\";\n\nexport {\n useAttachment,\n useAttachmentRuntime,\n\n // TODO decide if we want to export/drop these?\n // useEditComposerAttachment,\n // useEditComposerAttachmentRuntime,\n // useMessageAttachment,\n // useMessageAttachmentRuntime,\n // useThreadComposerAttachment,\n // useThreadComposerAttachmentRuntime,\n} from \"./AttachmentContext\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAKA;AAAA,EAIA;AAAA,EAIA;AAAA,EASA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAKA;AAAA,EAEA;AAAA,EAEA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EAKA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAKA;AAAA,EASA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OASK;","names":[]}
@@ -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";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,YAAY,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,qBAAqB,CAAC;AAE7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,qBAAqB,CAAC;AAE7B,cAAc,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal.ts"],"sourcesContent":["export type { ThreadRuntimeCore } from \"./runtimes/core/ThreadRuntimeCore\";\nexport type { ThreadManagerRuntimeCore } from \"./runtimes/core/ThreadManagerRuntimeCore\";\nexport { DefaultThreadComposerRuntimeCore } from \"./runtimes/composer/DefaultThreadComposerRuntimeCore\";\nexport { ProxyConfigProvider } from \"./utils/ProxyConfigProvider\";\nexport { MessageRepository } from \"./runtimes/utils/MessageRepository\";\nexport { BaseAssistantRuntimeCore } from \"./runtimes/core/BaseAssistantRuntimeCore\";\nexport { TooltipIconButton } from \"./ui/base/tooltip-icon-button\";\nexport { generateId } from \"./utils/idUtils\";\nexport { AssistantRuntimeImpl } from \"./api/AssistantRuntime\";\nexport {\n ThreadRuntimeImpl,\n type ThreadRuntimeCoreBinding,\n} from \"./api/ThreadRuntime\";\n\nexport * from \"./utils/smooth\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8CAAiD;AACjD,iCAAoC;AACpC,+BAAkC;AAClC,sCAAyC;AACzC,iCAAkC;AAClC,qBAA2B;AAC3B,8BAAqC;AACrC,2BAGO;AAEP,6BAAc,qCAdd;","names":[]}
1
+ {"version":3,"sources":["../src/internal.ts"],"sourcesContent":["export type { ThreadRuntimeCore } from \"./runtimes/core/ThreadRuntimeCore\";\nexport type { ThreadListRuntimeCore } from \"./runtimes/core/ThreadListRuntimeCore\";\nexport { DefaultThreadComposerRuntimeCore } from \"./runtimes/composer/DefaultThreadComposerRuntimeCore\";\nexport { ProxyConfigProvider } from \"./utils/ProxyConfigProvider\";\nexport { MessageRepository } from \"./runtimes/utils/MessageRepository\";\nexport { BaseAssistantRuntimeCore } from \"./runtimes/core/BaseAssistantRuntimeCore\";\nexport { TooltipIconButton } from \"./ui/base/tooltip-icon-button\";\nexport { generateId } from \"./utils/idUtils\";\nexport { AssistantRuntimeImpl } from \"./api/AssistantRuntime\";\nexport {\n ThreadRuntimeImpl,\n type ThreadRuntimeCoreBinding,\n} from \"./api/ThreadRuntime\";\n\nexport * from \"./utils/smooth\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8CAAiD;AACjD,iCAAoC;AACpC,+BAAkC;AAClC,sCAAyC;AACzC,iCAAkC;AAClC,qBAA2B;AAC3B,8BAAqC;AACrC,2BAGO;AAEP,6BAAc,qCAdd;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal.ts"],"sourcesContent":["export type { ThreadRuntimeCore } from \"./runtimes/core/ThreadRuntimeCore\";\nexport type { ThreadManagerRuntimeCore } from \"./runtimes/core/ThreadManagerRuntimeCore\";\nexport { DefaultThreadComposerRuntimeCore } from \"./runtimes/composer/DefaultThreadComposerRuntimeCore\";\nexport { ProxyConfigProvider } from \"./utils/ProxyConfigProvider\";\nexport { MessageRepository } from \"./runtimes/utils/MessageRepository\";\nexport { BaseAssistantRuntimeCore } from \"./runtimes/core/BaseAssistantRuntimeCore\";\nexport { TooltipIconButton } from \"./ui/base/tooltip-icon-button\";\nexport { generateId } from \"./utils/idUtils\";\nexport { AssistantRuntimeImpl } from \"./api/AssistantRuntime\";\nexport {\n ThreadRuntimeImpl,\n type ThreadRuntimeCoreBinding,\n} from \"./api/ThreadRuntime\";\n\nexport * from \"./utils/smooth\";\n"],"mappings":";AAEA,SAAS,wCAAwC;AACjD,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,OAEK;AAEP,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/internal.ts"],"sourcesContent":["export type { ThreadRuntimeCore } from \"./runtimes/core/ThreadRuntimeCore\";\nexport type { ThreadListRuntimeCore } from \"./runtimes/core/ThreadListRuntimeCore\";\nexport { DefaultThreadComposerRuntimeCore } from \"./runtimes/composer/DefaultThreadComposerRuntimeCore\";\nexport { ProxyConfigProvider } from \"./utils/ProxyConfigProvider\";\nexport { MessageRepository } from \"./runtimes/utils/MessageRepository\";\nexport { BaseAssistantRuntimeCore } from \"./runtimes/core/BaseAssistantRuntimeCore\";\nexport { TooltipIconButton } from \"./ui/base/tooltip-icon-button\";\nexport { generateId } from \"./utils/idUtils\";\nexport { AssistantRuntimeImpl } from \"./api/AssistantRuntime\";\nexport {\n ThreadRuntimeImpl,\n type ThreadRuntimeCoreBinding,\n} from \"./api/ThreadRuntime\";\n\nexport * from \"./utils/smooth\";\n"],"mappings":";AAEA,SAAS,wCAAwC;AACjD,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,OAEK;AAEP,cAAc;","names":[]}
@@ -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
  export type * from "./actionBar/types";
10
12
  export type * from "./assistantModal/types";
11
13
  export type * from "./branchPicker/types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,qBAAqB,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,oBAAoB,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,gBAAgB,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,UAAU,CAAC;AAE5C,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,qBAAqB,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,oBAAoB,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,gBAAgB,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAE5D,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,gBAAgB,CAAC"}
@@ -37,6 +37,8 @@ __export(primitives_exports, {
37
37
  ComposerPrimitive: () => ComposerPrimitive,
38
38
  ContentPartPrimitive: () => ContentPartPrimitive,
39
39
  MessagePrimitive: () => MessagePrimitive,
40
+ ThreadListItemPrimitive: () => ThreadListItemPrimitive,
41
+ ThreadListPrimitive: () => ThreadListPrimitive,
40
42
  ThreadPrimitive: () => ThreadPrimitive
41
43
  });
42
44
  module.exports = __toCommonJS(primitives_exports);
@@ -48,6 +50,8 @@ var ComposerPrimitive = __toESM(require("./composer/index.cjs"));
48
50
  var ContentPartPrimitive = __toESM(require("./contentPart/index.cjs"));
49
51
  var MessagePrimitive = __toESM(require("./message/index.cjs"));
50
52
  var ThreadPrimitive = __toESM(require("./thread/index.cjs"));
53
+ var ThreadListPrimitive = __toESM(require("./threadList/index.cjs"));
54
+ var ThreadListItemPrimitive = __toESM(require("./threadListItem/index.cjs"));
51
55
  // Annotate the CommonJS export names for ESM import in node:
52
56
  0 && (module.exports = {
53
57
  ActionBarPrimitive,
@@ -57,6 +61,8 @@ var ThreadPrimitive = __toESM(require("./thread/index.cjs"));
57
61
  ComposerPrimitive,
58
62
  ContentPartPrimitive,
59
63
  MessagePrimitive,
64
+ ThreadListItemPrimitive,
65
+ ThreadListPrimitive,
60
66
  ThreadPrimitive
61
67
  });
62
68
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\n\nexport type * from \"./actionBar/types\";\nexport type * from \"./assistantModal/types\";\nexport type * from \"./branchPicker/types\";\nexport type * from \"./composer/types\";\nexport type * from \"./contentPart/types\";\nexport type * from \"./message/types\";\nexport type * from \"./thread/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAoC;AACpC,8BAAyC;AACzC,0BAAqC;AACrC,4BAAuC;AACvC,wBAAmC;AACnC,2BAAsC;AACtC,uBAAkC;AAClC,sBAAiC;","names":[]}
1
+ {"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport type * from \"./actionBar/types\";\nexport type * from \"./assistantModal/types\";\nexport type * from \"./branchPicker/types\";\nexport type * from \"./composer/types\";\nexport type * from \"./contentPart/types\";\nexport type * from \"./message/types\";\nexport type * from \"./thread/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAoC;AACpC,8BAAyC;AACzC,0BAAqC;AACrC,4BAAuC;AACvC,wBAAmC;AACnC,2BAAsC;AACtC,uBAAkC;AAClC,sBAAiC;AACjC,0BAAqC;AACrC,8BAAyC;","names":[]}
@@ -7,6 +7,8 @@ import * as ComposerPrimitive from "./composer/index.mjs";
7
7
  import * as ContentPartPrimitive from "./contentPart/index.mjs";
8
8
  import * as MessagePrimitive from "./message/index.mjs";
9
9
  import * as ThreadPrimitive from "./thread/index.mjs";
10
+ import * as ThreadListPrimitive from "./threadList/index.mjs";
11
+ import * as ThreadListItemPrimitive from "./threadListItem/index.mjs";
10
12
  export {
11
13
  ActionBarPrimitive,
12
14
  AssistantModalPrimitive,
@@ -15,6 +17,8 @@ export {
15
17
  ComposerPrimitive,
16
18
  ContentPartPrimitive,
17
19
  MessagePrimitive,
20
+ ThreadListItemPrimitive,
21
+ ThreadListPrimitive,
18
22
  ThreadPrimitive
19
23
  };
20
24
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\n\nexport type * from \"./actionBar/types\";\nexport type * from \"./assistantModal/types\";\nexport type * from \"./branchPicker/types\";\nexport type * from \"./composer/types\";\nexport type * from \"./contentPart/types\";\nexport type * from \"./message/types\";\nexport type * from \"./thread/types\";\n"],"mappings":";AAAA,YAAY,wBAAwB;AACpC,YAAY,6BAA6B;AACzC,YAAY,yBAAyB;AACrC,YAAY,2BAA2B;AACvC,YAAY,uBAAuB;AACnC,YAAY,0BAA0B;AACtC,YAAY,sBAAsB;AAClC,YAAY,qBAAqB;","names":[]}
1
+ {"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as ContentPartPrimitive from \"./contentPart\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport type * from \"./actionBar/types\";\nexport type * from \"./assistantModal/types\";\nexport type * from \"./branchPicker/types\";\nexport type * from \"./composer/types\";\nexport type * from \"./contentPart/types\";\nexport type * from \"./message/types\";\nexport type * from \"./thread/types\";\n"],"mappings":";AAAA,YAAY,wBAAwB;AACpC,YAAY,6BAA6B;AACzC,YAAY,yBAAyB;AACrC,YAAY,2BAA2B;AACvC,YAAY,uBAAuB;AACnC,YAAY,0BAA0B;AACtC,YAAY,sBAAsB;AAClC,YAAY,qBAAqB;AACjC,YAAY,yBAAyB;AACrC,YAAY,6BAA6B;","names":[]}
@@ -0,0 +1,11 @@
1
+ import { ComponentType, FC } from "react";
2
+ export declare namespace MessagePrimitiveContent {
3
+ type Props = {
4
+ archived?: boolean | undefined;
5
+ components: {
6
+ ThreadListItem: ComponentType;
7
+ };
8
+ };
9
+ }
10
+ export declare const ThreadListPrimitiveItems: FC<MessagePrimitiveContent.Props>;
11
+ //# sourceMappingURL=ThreadListItems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadListItems.d.ts","sourceRoot":"","sources":["../../../src/primitives/threadList/ThreadListItems.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAIzD,yBAAiB,uBAAuB,CAAC;IACvC,KAAY,KAAK,GAAG;QAClB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/B,UAAU,EAAE;YACV,cAAc,EAAE,aAAa,CAAC;SAC/B,CAAC;KACH,CAAC;CACH;AAyCD,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAgBtE,CAAC"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/primitives/threadList/ThreadListItems.tsx
22
+ var ThreadListItems_exports = {};
23
+ __export(ThreadListItems_exports, {
24
+ ThreadListPrimitiveItems: () => ThreadListPrimitiveItems
25
+ });
26
+ module.exports = __toCommonJS(ThreadListItems_exports);
27
+ var import_react = require("react");
28
+ var import_ThreadListItemRuntimeProvider = require("../../context/providers/ThreadListItemRuntimeProvider.cjs");
29
+ var import_context = require("../../context/index.cjs");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var ThreadListItemImpl = ({
32
+ partIndex,
33
+ archived,
34
+ components
35
+ }) => {
36
+ const assistantRuntime = (0, import_context.useAssistantRuntime)();
37
+ const runtime = (0, import_react.useMemo)(
38
+ () => archived ? assistantRuntime.threadList.getThreadListArchivedItemByIndex(
39
+ partIndex
40
+ ) : assistantRuntime.threadList.getThreadListItemByIndex(partIndex),
41
+ [assistantRuntime, partIndex]
42
+ );
43
+ const ThreadListItemComponent = components.ThreadListItem;
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThreadListItemRuntimeProvider.ThreadListItemRuntimeProvider, { runtime, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadListItemComponent, {}) });
45
+ };
46
+ var ThreadListItem = (0, import_react.memo)(
47
+ ThreadListItemImpl,
48
+ (prev, next) => prev.partIndex === next.partIndex && prev.archived === next.archived && prev.components.ThreadListItem === next.components.ThreadListItem
49
+ );
50
+ var ThreadListPrimitiveItems = ({
51
+ archived = false,
52
+ components
53
+ }) => {
54
+ const contentLength = (0, import_context.useThreadList)(
55
+ (s) => archived ? s.archivedThreads.length : s.threads.length
56
+ );
57
+ return Array.from({ length: contentLength }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ ThreadListItem,
59
+ {
60
+ partIndex: index,
61
+ archived,
62
+ components
63
+ },
64
+ index
65
+ ));
66
+ };
67
+ ThreadListPrimitiveItems.displayName = "ThreadListPrimitive.Items";
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ ThreadListPrimitiveItems
71
+ });
72
+ //# sourceMappingURL=ThreadListItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/primitives/threadList/ThreadListItems.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, FC, memo, useMemo } from \"react\";\nimport { ThreadListItemRuntimeProvider } from \"../../context/providers/ThreadListItemRuntimeProvider\";\nimport { useAssistantRuntime, useThreadList } from \"../../context\";\n\nexport namespace MessagePrimitiveContent {\n export type Props = {\n archived?: boolean | undefined;\n components: {\n ThreadListItem: ComponentType;\n };\n };\n}\n\ntype ThreadListItemProps = {\n partIndex: number;\n archived: boolean;\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst ThreadListItemImpl: FC<ThreadListItemProps> = ({\n partIndex,\n archived,\n components,\n}) => {\n const assistantRuntime = useAssistantRuntime();\n const runtime = useMemo(\n () =>\n archived\n ? assistantRuntime.threadList.getThreadListArchivedItemByIndex(\n partIndex,\n )\n : assistantRuntime.threadList.getThreadListItemByIndex(partIndex),\n [assistantRuntime, partIndex],\n );\n\n const ThreadListItemComponent = components.ThreadListItem;\n\n return (\n <ThreadListItemRuntimeProvider runtime={runtime}>\n <ThreadListItemComponent />\n </ThreadListItemRuntimeProvider>\n );\n};\n\nconst ThreadListItem = memo(\n ThreadListItemImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.archived === next.archived &&\n prev.components.ThreadListItem === next.components.ThreadListItem,\n);\n\nexport const ThreadListPrimitiveItems: FC<MessagePrimitiveContent.Props> = ({\n archived = false,\n components,\n}) => {\n const contentLength = useThreadList((s) =>\n archived ? s.archivedThreads.length : s.threads.length,\n );\n\n return Array.from({ length: contentLength }, (_, index) => (\n <ThreadListItem\n key={index}\n partIndex={index}\n archived={archived}\n components={components}\n />\n ));\n};\n\nThreadListPrimitiveItems.displayName = \"ThreadListPrimitive.Items\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAiD;AACjD,2CAA8C;AAC9C,qBAAmD;AAqC7C;AApBN,IAAM,qBAA8C,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,uBAAmB,oCAAoB;AAC7C,QAAM,cAAU;AAAA,IACd,MACE,WACI,iBAAiB,WAAW;AAAA,MAC1B;AAAA,IACF,IACA,iBAAiB,WAAW,yBAAyB,SAAS;AAAA,IACpE,CAAC,kBAAkB,SAAS;AAAA,EAC9B;AAEA,QAAM,0BAA0B,WAAW;AAE3C,SACE,4CAAC,sEAA8B,SAC7B,sDAAC,2BAAwB,GAC3B;AAEJ;AAEA,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,cAAc,KAAK,aACxB,KAAK,aAAa,KAAK,YACvB,KAAK,WAAW,mBAAmB,KAAK,WAAW;AACvD;AAEO,IAAM,2BAA8D,CAAC;AAAA,EAC1E,WAAW;AAAA,EACX;AACF,MAAM;AACJ,QAAM,oBAAgB;AAAA,IAAc,CAAC,MACnC,WAAW,EAAE,gBAAgB,SAAS,EAAE,QAAQ;AAAA,EAClD;AAEA,SAAO,MAAM,KAAK,EAAE,QAAQ,cAAc,GAAG,CAAC,GAAG,UAC/C;AAAA,IAAC;AAAA;AAAA,MAEC,WAAW;AAAA,MACX;AAAA,MACA;AAAA;AAAA,IAHK;AAAA,EAIP,CACD;AACH;AAEA,yBAAyB,cAAc;","names":[]}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+
3
+ // src/primitives/threadList/ThreadListItems.tsx
4
+ import { memo, useMemo } from "react";
5
+ import { ThreadListItemRuntimeProvider } from "../../context/providers/ThreadListItemRuntimeProvider.mjs";
6
+ import { useAssistantRuntime, useThreadList } from "../../context/index.mjs";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var ThreadListItemImpl = ({
9
+ partIndex,
10
+ archived,
11
+ components
12
+ }) => {
13
+ const assistantRuntime = useAssistantRuntime();
14
+ const runtime = useMemo(
15
+ () => archived ? assistantRuntime.threadList.getThreadListArchivedItemByIndex(
16
+ partIndex
17
+ ) : assistantRuntime.threadList.getThreadListItemByIndex(partIndex),
18
+ [assistantRuntime, partIndex]
19
+ );
20
+ const ThreadListItemComponent = components.ThreadListItem;
21
+ return /* @__PURE__ */ jsx(ThreadListItemRuntimeProvider, { runtime, children: /* @__PURE__ */ jsx(ThreadListItemComponent, {}) });
22
+ };
23
+ var ThreadListItem = memo(
24
+ ThreadListItemImpl,
25
+ (prev, next) => prev.partIndex === next.partIndex && prev.archived === next.archived && prev.components.ThreadListItem === next.components.ThreadListItem
26
+ );
27
+ var ThreadListPrimitiveItems = ({
28
+ archived = false,
29
+ components
30
+ }) => {
31
+ const contentLength = useThreadList(
32
+ (s) => archived ? s.archivedThreads.length : s.threads.length
33
+ );
34
+ return Array.from({ length: contentLength }, (_, index) => /* @__PURE__ */ jsx(
35
+ ThreadListItem,
36
+ {
37
+ partIndex: index,
38
+ archived,
39
+ components
40
+ },
41
+ index
42
+ ));
43
+ };
44
+ ThreadListPrimitiveItems.displayName = "ThreadListPrimitive.Items";
45
+ export {
46
+ ThreadListPrimitiveItems
47
+ };
48
+ //# sourceMappingURL=ThreadListItems.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/primitives/threadList/ThreadListItems.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentType, FC, memo, useMemo } from \"react\";\nimport { ThreadListItemRuntimeProvider } from \"../../context/providers/ThreadListItemRuntimeProvider\";\nimport { useAssistantRuntime, useThreadList } from \"../../context\";\n\nexport namespace MessagePrimitiveContent {\n export type Props = {\n archived?: boolean | undefined;\n components: {\n ThreadListItem: ComponentType;\n };\n };\n}\n\ntype ThreadListItemProps = {\n partIndex: number;\n archived: boolean;\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst ThreadListItemImpl: FC<ThreadListItemProps> = ({\n partIndex,\n archived,\n components,\n}) => {\n const assistantRuntime = useAssistantRuntime();\n const runtime = useMemo(\n () =>\n archived\n ? assistantRuntime.threadList.getThreadListArchivedItemByIndex(\n partIndex,\n )\n : assistantRuntime.threadList.getThreadListItemByIndex(partIndex),\n [assistantRuntime, partIndex],\n );\n\n const ThreadListItemComponent = components.ThreadListItem;\n\n return (\n <ThreadListItemRuntimeProvider runtime={runtime}>\n <ThreadListItemComponent />\n </ThreadListItemRuntimeProvider>\n );\n};\n\nconst ThreadListItem = memo(\n ThreadListItemImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.archived === next.archived &&\n prev.components.ThreadListItem === next.components.ThreadListItem,\n);\n\nexport const ThreadListPrimitiveItems: FC<MessagePrimitiveContent.Props> = ({\n archived = false,\n components,\n}) => {\n const contentLength = useThreadList((s) =>\n archived ? s.archivedThreads.length : s.threads.length,\n );\n\n return Array.from({ length: contentLength }, (_, index) => (\n <ThreadListItem\n key={index}\n partIndex={index}\n archived={archived}\n components={components}\n />\n ));\n};\n\nThreadListPrimitiveItems.displayName = \"ThreadListPrimitive.Items\";\n"],"mappings":";;;AAEA,SAA4B,MAAM,eAAe;AACjD,SAAS,qCAAqC;AAC9C,SAAS,qBAAqB,qBAAqB;AAqC7C;AApBN,IAAM,qBAA8C,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,mBAAmB,oBAAoB;AAC7C,QAAM,UAAU;AAAA,IACd,MACE,WACI,iBAAiB,WAAW;AAAA,MAC1B;AAAA,IACF,IACA,iBAAiB,WAAW,yBAAyB,SAAS;AAAA,IACpE,CAAC,kBAAkB,SAAS;AAAA,EAC9B;AAEA,QAAM,0BAA0B,WAAW;AAE3C,SACE,oBAAC,iCAA8B,SAC7B,8BAAC,2BAAwB,GAC3B;AAEJ;AAEA,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,cAAc,KAAK,aACxB,KAAK,aAAa,KAAK,YACvB,KAAK,WAAW,mBAAmB,KAAK,WAAW;AACvD;AAEO,IAAM,2BAA8D,CAAC;AAAA,EAC1E,WAAW;AAAA,EACX;AACF,MAAM;AACJ,QAAM,gBAAgB;AAAA,IAAc,CAAC,MACnC,WAAW,EAAE,gBAAgB,SAAS,EAAE,QAAQ;AAAA,EAClD;AAEA,SAAO,MAAM,KAAK,EAAE,QAAQ,cAAc,GAAG,CAAC,GAAG,UAC/C;AAAA,IAAC;AAAA;AAAA,MAEC,WAAW;AAAA,MACX;AAAA,MACA;AAAA;AAAA,IAHK;AAAA,EAIP,CACD;AACH;AAEA,yBAAyB,cAAc;","names":[]}
@@ -0,0 +1,13 @@
1
+ import { ActionButtonElement, ActionButtonProps } from "../../utils/createActionButton";
2
+ declare const useThreadListNew: () => () => void;
3
+ export declare namespace ThreadListPrimitiveNew {
4
+ type Element = ActionButtonElement;
5
+ type Props = ActionButtonProps<typeof useThreadListNew>;
6
+ }
7
+ export declare const ThreadListPrimitiveNew: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
8
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
9
+ } & {
10
+ asChild?: boolean;
11
+ }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
12
+ export {};
13
+ //# sourceMappingURL=ThreadListNew.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadListNew.d.ts","sourceRoot":"","sources":["../../../src/primitives/threadList/ThreadListNew.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AAGxC,QAAA,MAAM,gBAAgB,kBAKrB,CAAC;AAEF,yBAAiB,sBAAsB,CAAC;IACtC,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,gBAAgB,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,sBAAsB;;;;6DAGlC,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/primitives/threadList/ThreadListNew.ts
22
+ var ThreadListNew_exports = {};
23
+ __export(ThreadListNew_exports, {
24
+ ThreadListPrimitiveNew: () => ThreadListPrimitiveNew
25
+ });
26
+ module.exports = __toCommonJS(ThreadListNew_exports);
27
+ var import_createActionButton = require("../../utils/createActionButton.cjs");
28
+ var import_context = require("../../context/index.cjs");
29
+ var useThreadListNew = () => {
30
+ const runtime = (0, import_context.useAssistantRuntime)();
31
+ return () => {
32
+ runtime.switchToNewThread();
33
+ };
34
+ };
35
+ var ThreadListPrimitiveNew = (0, import_createActionButton.createActionButton)(
36
+ "ThreadListPrimitive.New",
37
+ useThreadListNew
38
+ );
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ ThreadListPrimitiveNew
42
+ });
43
+ //# sourceMappingURL=ThreadListNew.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/primitives/threadList/ThreadListNew.ts"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useAssistantRuntime } from \"../../context\";\n\nconst useThreadListNew = () => {\n const runtime = useAssistantRuntime();\n return () => {\n runtime.switchToNewThread();\n };\n};\n\nexport namespace ThreadListPrimitiveNew {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadListNew>;\n}\n\nexport const ThreadListPrimitiveNew = createActionButton(\n \"ThreadListPrimitive.New\",\n useThreadListNew,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAIO;AACP,qBAAoC;AAEpC,IAAM,mBAAmB,MAAM;AAC7B,QAAM,cAAU,oCAAoB;AACpC,SAAO,MAAM;AACX,YAAQ,kBAAkB;AAAA,EAC5B;AACF;AAOO,IAAM,6BAAyB;AAAA,EACpC;AAAA,EACA;AACF;","names":[]}