@assistant-ui/react 0.15.12 → 0.15.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/augmentations.d.ts +3 -25
  2. package/dist/augmentations.d.ts.map +1 -1
  3. package/dist/client/InMemoryThreadList.d.ts.map +1 -1
  4. package/dist/client/InMemoryThreadList.js +41 -32
  5. package/dist/client/InMemoryThreadList.js.map +1 -1
  6. package/dist/index.d.ts +3 -5
  7. package/dist/index.js +3 -5
  8. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.js +48 -24
  9. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.js.map +1 -1
  10. package/package.json +5 -5
  11. package/src/augmentations.ts +4 -2
  12. package/src/client/InMemoryThreadList.ts +10 -4
  13. package/src/index.ts +3 -2
  14. package/src/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.test.ts +26 -1
  15. package/src/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.ts +57 -31
  16. package/src/tests/augmentations.test.ts +39 -0
  17. package/src/tests/in-memory-thread-list.test.tsx +87 -3
  18. package/dist/client/ExternalThread.d.ts +0 -48
  19. package/dist/client/ExternalThread.d.ts.map +0 -1
  20. package/dist/client/ExternalThread.js +0 -1348
  21. package/dist/client/ExternalThread.js.map +0 -1
  22. package/dist/client/SingleThreadList.d.ts +0 -9
  23. package/dist/client/SingleThreadList.d.ts.map +0 -1
  24. package/dist/client/SingleThreadList.js +0 -171
  25. package/dist/client/SingleThreadList.js.map +0 -1
  26. package/src/client/ExternalThread.ts +0 -1147
  27. package/src/client/SingleThreadList.ts +0 -118
  28. package/src/tests/external-thread-attachments.test.tsx +0 -370
  29. package/src/tests/external-thread-branches.test.tsx +0 -160
  30. package/src/tests/external-thread-feedback.test.tsx +0 -204
  31. package/src/tests/external-thread-parity.test.tsx +0 -494
  32. package/src/tests/external-thread-speech.test.tsx +0 -328
@@ -1,30 +1,8 @@
1
+ import { Assistant as Assistant$1 } from "@assistant-ui/core";
1
2
  //#region src/augmentations.d.ts
2
- /**
3
- * Module augmentation namespace for assistant-ui type extensions.
4
- *
5
- * @example
6
- * ```typescript
7
- * declare module "@assistant-ui/react" {
8
- * namespace Assistant {
9
- * interface Commands {
10
- * myCustomCommand: {
11
- * type: "my-custom-command";
12
- * data: string;
13
- * };
14
- * }
15
- *
16
- * interface ExternalState {
17
- * myCustomState: {
18
- * foo: string;
19
- * };
20
- * }
21
- * }
22
- * }
23
- * ```
24
- */
25
3
  declare namespace Assistant {
26
- interface Commands {}
27
- interface ExternalState {}
4
+ interface Commands extends Assistant$1.Commands {}
5
+ interface ExternalState extends Assistant$1.ExternalState {}
28
6
  }
29
7
  type UserCommands = Assistant.Commands[keyof Assistant.Commands];
30
8
  type UserExternalState = keyof Assistant.ExternalState extends never ? Record<string, unknown> : Assistant.ExternalState[keyof Assistant.ExternalState];
@@ -1 +1 @@
1
- {"version":3,"file":"augmentations.d.ts","names":[],"sources":["../src/augmentations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;kBAuBiB;YACE;YAEA;;KAGP,eAAe,UAAU,eAAe,UAAU;KAClD,0BAA0B,UAAU,8BAC5C,0BACA,UAAU,oBAAoB,UAAU"}
1
+ {"version":3,"file":"augmentations.d.ts","names":[],"sources":["../src/augmentations.ts"],"mappings":";;kBAyBiB;YACE,iBAAiB,YAAc;YAE/B,sBAAsB,YAAc;;KAG3C,eAAe,UAAU,eAAe,UAAU;KAClD,0BAA0B,UAAU,8BAC5C,0BACA,UAAU,oBAAoB,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"InMemoryThreadList.d.ts","names":[],"sources":["../../src/client/InMemoryThreadList.ts"],"mappings":";;;KAeY;EACV,SAAS,qBAAqB,gBAAgB;EAC9C,oBAAoB;EACpB;;cA+LW,gDAAkB,SAAA,0BAAA,OAAA"}
1
+ {"version":3,"file":"InMemoryThreadList.d.ts","names":[],"sources":["../../src/client/InMemoryThreadList.ts"],"mappings":";;;KAgBY;EACV,SAAS,qBAAqB,gBAAgB;EAC9C,oBAAoB;EACpB;;cAgMW,gDAAkB,SAAA,0BAAA,OAAA"}
@@ -1,8 +1,9 @@
1
1
  import { Derived, attachTransformScopes, useClientLookup, useClientResource } from "@assistant-ui/store";
2
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
3
  import { DataRenderers, Tools } from "@assistant-ui/core/react";
4
+ import { generateId } from "@assistant-ui/core";
4
5
  import { useState } from "@assistant-ui/tap/react-shim";
5
- import { ModelContext, Suggestions } from "@assistant-ui/core/store";
6
+ import { ModelContext } from "@assistant-ui/core/store";
6
7
  import { resource, withKey } from "@assistant-ui/tap";
7
8
  //#region src/client/InMemoryThreadList.ts
8
9
  const RESOLVED_PROMISE = Promise.resolve();
@@ -71,7 +72,7 @@ const useThreadListItemClient = (props) => {
71
72
  };
72
73
  const ThreadListItemClient = resource(useThreadListItemClient);
73
74
  const useInMemoryThreadList = (props) => {
74
- const $ = c(57);
75
+ const $ = c(60);
75
76
  const { thread: threadFactory, onSwitchToThread, onSwitchToNewThread } = props;
76
77
  const [mainThreadId, setMainThreadId] = useState("main");
77
78
  const [threads, setThreads] = useState(_temp3);
@@ -142,7 +143,7 @@ const useInMemoryThreadList = (props) => {
142
143
  let t6;
143
144
  if ($[8] !== onSwitchToNewThread) {
144
145
  t6 = () => {
145
- const newId = `thread-${Date.now()}`;
146
+ const newId = `thread-${generateId()}`;
146
147
  setThreads((prev_5) => [...prev_5, {
147
148
  id: newId,
148
149
  title: "New Thread",
@@ -259,8 +260,14 @@ const useInMemoryThreadList = (props) => {
259
260
  $[44] = t17;
260
261
  } else t17 = $[44];
261
262
  let t18;
262
- if ($[45] !== mainThreadId || $[46] !== threadListItems || $[47] !== threads) {
263
- t18 = (selector) => {
263
+ if ($[45] !== mainThreadClient.methods) {
264
+ t18 = () => mainThreadClient.methods.unstable_refetchThread?.() ?? RESOLVED_PROMISE;
265
+ $[45] = mainThreadClient.methods;
266
+ $[46] = t18;
267
+ } else t18 = $[46];
268
+ let t19;
269
+ if ($[47] !== mainThreadId || $[48] !== threadListItems || $[49] !== threads) {
270
+ t19 = (selector) => {
264
271
  if (selector === "main") {
265
272
  const index = threads.findIndex((t_10) => t_10.id === mainThreadId);
266
273
  return threadListItems.get({ index: index === -1 ? 0 : index });
@@ -271,38 +278,39 @@ const useInMemoryThreadList = (props) => {
271
278
  }
272
279
  return threadListItems.get(selector);
273
280
  };
274
- $[45] = mainThreadId;
275
- $[46] = threadListItems;
276
- $[47] = threads;
277
- $[48] = t18;
278
- } else t18 = $[48];
279
- let t19;
280
- if ($[49] !== mainThreadClient.methods) {
281
- t19 = () => mainThreadClient.methods;
282
- $[49] = mainThreadClient.methods;
281
+ $[47] = mainThreadId;
282
+ $[48] = threadListItems;
283
+ $[49] = threads;
283
284
  $[50] = t19;
284
285
  } else t19 = $[50];
285
286
  let t20;
286
- if ($[51] !== handleSwitchToNewThread || $[52] !== handleSwitchToThread || $[53] !== t17 || $[54] !== t18 || $[55] !== t19) {
287
- t20 = {
287
+ if ($[51] !== mainThreadClient.methods) {
288
+ t20 = () => mainThreadClient.methods;
289
+ $[51] = mainThreadClient.methods;
290
+ $[52] = t20;
291
+ } else t20 = $[52];
292
+ let t21;
293
+ if ($[53] !== handleSwitchToNewThread || $[54] !== handleSwitchToThread || $[55] !== t17 || $[56] !== t18 || $[57] !== t19 || $[58] !== t20) {
294
+ t21 = {
288
295
  getState: t17,
289
296
  switchToThread: handleSwitchToThread,
290
297
  switchToNewThread: handleSwitchToNewThread,
291
298
  getLoadThreadsPromise: _temp8,
292
299
  reload: _temp9,
293
- reloadMainThread: _temp0,
294
- loadMore: _temp1,
295
- item: t18,
296
- thread: t19
300
+ reloadMainThread: t18,
301
+ loadMore: _temp0,
302
+ item: t19,
303
+ thread: t20
297
304
  };
298
- $[51] = handleSwitchToNewThread;
299
- $[52] = handleSwitchToThread;
300
- $[53] = t17;
301
- $[54] = t18;
302
- $[55] = t19;
303
- $[56] = t20;
304
- } else t20 = $[56];
305
- return t20;
305
+ $[53] = handleSwitchToNewThread;
306
+ $[54] = handleSwitchToThread;
307
+ $[55] = t17;
308
+ $[56] = t18;
309
+ $[57] = t19;
310
+ $[58] = t20;
311
+ $[59] = t21;
312
+ } else t21 = $[59];
313
+ return t21;
306
314
  };
307
315
  const InMemoryThreadList = resource(useInMemoryThreadList);
308
316
  attachTransformScopes(useInMemoryThreadList, (scopes, parent) => {
@@ -324,7 +332,11 @@ attachTransformScopes(useInMemoryThreadList, (scopes, parent) => {
324
332
  if (!scopes.modelContext && parent.modelContext.source === null) scopes.modelContext = ModelContext();
325
333
  if (!scopes.tools && parent.tools.source === null) scopes.tools = Tools({});
326
334
  if (!scopes.dataRenderers && parent.dataRenderers.source === null) scopes.dataRenderers = DataRenderers();
327
- if (!scopes.suggestions && parent.suggestions.source === null) scopes.suggestions = Suggestions();
335
+ if (!scopes.suggestions && parent.suggestions.source === null) scopes.suggestions = Derived({
336
+ source: "thread",
337
+ query: {},
338
+ get: (aui) => aui.thread.suggestions()
339
+ });
328
340
  });
329
341
  function _temp() {}
330
342
  function _temp2() {}
@@ -356,9 +368,6 @@ function _temp9() {
356
368
  function _temp0() {
357
369
  return RESOLVED_PROMISE;
358
370
  }
359
- function _temp1() {
360
- return RESOLVED_PROMISE;
361
- }
362
371
  //#endregion
363
372
  export { InMemoryThreadList };
364
373
 
@@ -1 +1 @@
1
- {"version":3,"file":"InMemoryThreadList.js","names":["useState","useMemo","resource","withKey","ResourceElement","ClientOutput","useClientLookup","Derived","attachTransformScopes","useClientResource","ModelContext","Suggestions","Tools","DataRenderers","RESOLVED_PROMISE","Promise","resolve","InMemoryThreadListProps","thread","threadId","onSwitchToThread","onSwitchToNewThread","ThreadData","id","title","status","custom","Record","useThreadListItemClient","props","$","_c","data","isRunning","onSwitchTo","onRename","onUpdateCustom","onArchive","onUnarchive","onDelete","t0","remoteId","undefined","externalId","state","t1","t2","t3","getState","switchTo","rename","updateCustom","archive","unarchive","delete","generateTitle","_temp","initialize","detach","_temp2","ThreadListItemClient","useInMemoryThreadList","threadFactory","mainThreadId","setMainThreadId","threads","setThreads","_temp3","handleSwitchToThread","Symbol","for","threadId_0","prev","map","t","handleRename","threadId_1","prev_0","t_0","const","handleArchive","threadId_2","prev_1","t_1","handleUnarchive","t4","threadId_3","prev_2","t_2","handleUpdateCustom","t5","threadId_4","prev_3","filter","t_3","prev_4","find","t_4","handleDelete","t6","newId","Date","now","prev_5","handleSwitchToNewThread","t7","mainThreadClient","t8","t9","t_5","title_0","custom_0","threadListItems","t10","t11","t12","t13","t14","t15","regularThreads","_temp4","archivedThreads","_temp5","_temp6","_temp7","t16","newThreadId","isLoading","isLoadingMore","hasMore","threadIds","archivedThreadIds","threadItems","main","t17","t18","selector","index","findIndex","t_10","get","index_0","t_11","t19","methods","t20","switchToThread","switchToNewThread","getLoadThreadsPromise","_temp8","reload","_temp9","reloadMainThread","_temp0","loadMore","_temp1","item","InMemoryThreadList","scopes","parent","source","query","type","aui","threadListItem","composer","modelContext","tools","dataRenderers","suggestions","t_6","t_7","t_8","t_9"],"sources":["../../src/client/InMemoryThreadList.ts"],"sourcesContent":["import { useState, useMemo } from \"react\";\nimport { resource, withKey, type ResourceElement } from \"@assistant-ui/tap\";\nimport {\n type ClientOutput,\n useClientLookup,\n Derived,\n attachTransformScopes,\n useClientResource,\n} from \"@assistant-ui/store\";\n\nimport { ModelContext, Suggestions } from \"@assistant-ui/core/store\";\nimport { Tools, DataRenderers } from \"@assistant-ui/core/react\";\n\nconst RESOLVED_PROMISE = Promise.resolve();\n\nexport type InMemoryThreadListProps = {\n thread: (threadId: string) => ResourceElement<ClientOutput<\"thread\">>;\n onSwitchToThread?: (threadId: string) => void;\n onSwitchToNewThread?: () => void;\n};\n\ntype ThreadData = {\n id: string;\n title?: string;\n status: \"regular\" | \"archived\";\n custom?: Record<string, unknown> | undefined;\n};\n\n// ThreadListItem Client\nconst useThreadListItemClient = (props: {\n data: ThreadData;\n isRunning: boolean;\n onSwitchTo: () => void;\n onRename: (title: string) => void;\n onUpdateCustom: (custom: Record<string, unknown> | undefined) => void;\n onArchive: () => void;\n onUnarchive: () => void;\n onDelete: () => void;\n}): ClientOutput<\"threadListItem\"> => {\n const {\n data,\n isRunning,\n onSwitchTo,\n onRename,\n onUpdateCustom,\n onArchive,\n onUnarchive,\n onDelete,\n } = props;\n const state = useMemo(\n () => ({\n id: data.id,\n remoteId: undefined,\n externalId: undefined,\n title: data.title,\n status: data.status,\n custom: data.custom,\n isRunning,\n }),\n [data.id, data.title, data.status, data.custom, isRunning],\n );\n\n return {\n getState: () => state,\n switchTo: onSwitchTo,\n rename: onRename,\n updateCustom: onUpdateCustom,\n archive: onArchive,\n unarchive: onUnarchive,\n delete: onDelete,\n generateTitle: () => {},\n initialize: async () => ({ remoteId: data.id, externalId: undefined }),\n detach: () => {},\n };\n};\n\nconst ThreadListItemClient = resource(useThreadListItemClient);\n\n// InMemoryThreadList Client\nconst useInMemoryThreadList = (\n props: InMemoryThreadListProps,\n): ClientOutput<\"threads\"> => {\n const {\n thread: threadFactory,\n onSwitchToThread,\n onSwitchToNewThread,\n } = props;\n\n const [mainThreadId, setMainThreadId] = useState(\"main\");\n const [threads, setThreads] = useState<readonly ThreadData[]>(() => [\n { id: \"main\", title: \"Main Thread\", status: \"regular\" },\n ]);\n\n const handleSwitchToThread = (threadId: string) => {\n setMainThreadId(threadId);\n onSwitchToThread?.(threadId);\n };\n\n const handleRename = (threadId: string, title: string) => {\n setThreads((prev) =>\n prev.map((t) => (t.id === threadId ? { ...t, title } : t)),\n );\n };\n\n const handleArchive = (threadId: string) => {\n setThreads((prev) =>\n prev.map((t) =>\n t.id === threadId ? { ...t, status: \"archived\" as const } : t,\n ),\n );\n };\n\n const handleUnarchive = (threadId: string) => {\n setThreads((prev) =>\n prev.map((t) =>\n t.id === threadId ? { ...t, status: \"regular\" as const } : t,\n ),\n );\n };\n\n const handleUpdateCustom = (\n threadId: string,\n custom: Record<string, unknown> | undefined,\n ) => {\n setThreads((prev) =>\n prev.map((t) => (t.id === threadId ? { ...t, custom } : t)),\n );\n };\n\n const handleDelete = (threadId: string) => {\n setThreads((prev) => prev.filter((t) => t.id !== threadId));\n setMainThreadId((prev) =>\n prev === threadId\n ? threads.find((t) => t.id !== threadId)?.id || \"main\"\n : prev,\n );\n };\n\n const handleSwitchToNewThread = () => {\n const newId = `thread-${Date.now()}`;\n setThreads((prev) => [\n ...prev,\n { id: newId, title: \"New Thread\", status: \"regular\" },\n ]);\n setMainThreadId(newId);\n onSwitchToNewThread?.();\n };\n\n // Only the main thread is mounted, so it is the only thread that can run.\n const mainThreadClient = useClientResource(threadFactory(mainThreadId));\n\n const threadListItems = useClientLookup(\n threads.map((t) =>\n withKey(\n t.id,\n ThreadListItemClient({\n data: t,\n isRunning: t.id === mainThreadId && mainThreadClient.state.isRunning,\n onSwitchTo: () => handleSwitchToThread(t.id),\n onRename: (title) => handleRename(t.id, title),\n onUpdateCustom: (custom) => handleUpdateCustom(t.id, custom),\n onArchive: () => handleArchive(t.id),\n onUnarchive: () => handleUnarchive(t.id),\n onDelete: () => handleDelete(t.id),\n }),\n ),\n ),\n );\n\n const state = useMemo(() => {\n const regularThreads = threads.filter((t) => t.status === \"regular\");\n const archivedThreads = threads.filter((t) => t.status === \"archived\");\n\n return {\n mainThreadId,\n newThreadId: null,\n isLoading: false,\n isLoadingMore: false,\n hasMore: false,\n threadIds: regularThreads.map((t) => t.id),\n archivedThreadIds: archivedThreads.map((t) => t.id),\n threadItems: threadListItems.state,\n main: mainThreadClient.state,\n };\n }, [mainThreadId, threads, threadListItems.state, mainThreadClient.state]);\n\n return {\n getState: () => state,\n switchToThread: handleSwitchToThread,\n switchToNewThread: handleSwitchToNewThread,\n getLoadThreadsPromise: () => RESOLVED_PROMISE,\n reload: () => RESOLVED_PROMISE,\n reloadMainThread: () => RESOLVED_PROMISE,\n loadMore: () => RESOLVED_PROMISE,\n item: (selector) => {\n if (selector === \"main\") {\n const index = threads.findIndex((t) => t.id === mainThreadId);\n return threadListItems.get({ index: index === -1 ? 0 : index });\n }\n if (\"id\" in selector) {\n const index = threads.findIndex((t) => t.id === selector.id);\n return threadListItems.get({ index });\n }\n return threadListItems.get(selector);\n },\n thread: () => mainThreadClient.methods,\n };\n};\n\nexport const InMemoryThreadList = resource(useInMemoryThreadList);\n\nattachTransformScopes(useInMemoryThreadList, (scopes, parent) => {\n scopes.thread ??= Derived({\n source: \"threads\",\n query: { type: \"main\" },\n get: (aui) => aui.threads.thread(\"main\"),\n });\n scopes.threadListItem ??= Derived({\n source: \"threads\",\n query: { type: \"main\" },\n get: (aui) => aui.threads.item(\"main\"),\n });\n scopes.composer ??= Derived({\n source: \"thread\",\n query: {},\n get: (aui) => aui.threads.thread(\"main\").composer(),\n });\n\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n if (!scopes.tools && parent.tools.source === null) {\n scopes.tools = Tools({});\n }\n if (!scopes.dataRenderers && parent.dataRenderers.source === null) {\n scopes.dataRenderers = DataRenderers();\n }\n if (!scopes.suggestions && parent.suggestions.source === null) {\n scopes.suggestions = Suggestions();\n }\n});\n"],"mappings":";;;;;;;AAaA,MAAMc,mBAAmBC,QAAQC,QAAQ;AAgBzC,MAAMY,2BAA0BC,UAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAU9B,MAAA,EAAAC,MAAAC,WAAAC,YAAAC,UAAAC,gBAAAC,WAAAC,aAAAC,aASIV;CAAM,IAAAW;CAAA,IAAAV,EAAA,OAAAE,KAAAN,UAAAI,EAAA,OAAAE,KAAAT,MAAAO,EAAA,OAAAE,KAAAP,UAAAK,EAAA,OAAAE,KAAAR,SAAAM,EAAA,OAAAG,WAAA;EAEDO,KAAA;GAAAjB,IACDS,KAAIT;GAAGkB,UACDC,KAAAA;GAASC,YACPD,KAAAA;GAASlB,OACdQ,KAAIR;GAAMC,QACTO,KAAIP;GAAOC,QACXM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W,MACvDF,OAAOW,cAAc9J,YAAY;AAErC,CAAC;AAnN+B,SAAA6C,QAAA,CAAA;AAAA,SAAAG,SAAA,CAAA;AAkDF,SAAAQ,SAAA;CAAA,OAUwC,CAClE;EAAA5C,IAAM;EAAMC,OAAS;EAAaC,QAAU;CAAU,CAAC;AACxD;AAZ2B,SAAA+F,OAAAkD,KAAA;CAAA,OA2FmBhG,IAACjD,WAAY;AAAS;AA3FzC,SAAAiG,OAAAiD,KAAA;CAAA,OA4FoBjG,IAACjD,WAAY;AAAU;AA5F3C,SAAAkG,OAAAiD,KAAA;CAAA,OAoGalG,IAACnD;AAAG;AApGjB,SAAAqG,OAAAiD,KAAA;CAAA,OAqGsBnG,IAACnD;AAAG;AArG1B,SAAA8H,SAAA;CAAA,OA+GGvI;AAAgB;AA/GnB,SAAAyI,SAAA;CAAA,OAgHZzI;AAAgB;AAhHJ,SAAA2I,SAAA;CAAA,OAiHF3I;AAAgB;AAjHd,SAAA6I,SAAA;CAAA,OAkHV7I;AAAgB"}
1
+ {"version":3,"file":"InMemoryThreadList.js","names":["useState","useMemo","resource","withKey","ResourceElement","ClientOutput","useClientLookup","Derived","attachTransformScopes","useClientResource","generateId","ModelContext","Tools","DataRenderers","RESOLVED_PROMISE","Promise","resolve","InMemoryThreadListProps","thread","threadId","onSwitchToThread","onSwitchToNewThread","ThreadData","id","title","status","custom","Record","useThreadListItemClient","props","$","_c","data","isRunning","onSwitchTo","onRename","onUpdateCustom","onArchive","onUnarchive","onDelete","t0","remoteId","undefined","externalId","state","t1","t2","t3","getState","switchTo","rename","updateCustom","archive","unarchive","delete","generateTitle","_temp","initialize","detach","_temp2","ThreadListItemClient","useInMemoryThreadList","threadFactory","mainThreadId","setMainThreadId","threads","setThreads","_temp3","handleSwitchToThread","Symbol","for","threadId_0","prev","map","t","handleRename","threadId_1","prev_0","t_0","const","handleArchive","threadId_2","prev_1","t_1","handleUnarchive","t4","threadId_3","prev_2","t_2","handleUpdateCustom","t5","threadId_4","prev_3","filter","t_3","prev_4","find","t_4","handleDelete","t6","newId","prev_5","handleSwitchToNewThread","t7","mainThreadClient","t8","t9","t_5","title_0","custom_0","threadListItems","t10","t11","t12","t13","t14","t15","regularThreads","_temp4","archivedThreads","_temp5","_temp6","_temp7","t16","newThreadId","isLoading","isLoadingMore","hasMore","threadIds","archivedThreadIds","threadItems","main","t17","t18","methods","unstable_refetchThread","t19","selector","index","findIndex","t_10","get","index_0","t_11","t20","t21","switchToThread","switchToNewThread","getLoadThreadsPromise","_temp8","reload","_temp9","reloadMainThread","loadMore","_temp0","item","InMemoryThreadList","scopes","parent","source","query","type","aui","threadListItem","composer","modelContext","tools","dataRenderers","suggestions","t_6","t_7","t_8","t_9"],"sources":["../../src/client/InMemoryThreadList.ts"],"sourcesContent":["import { useState, useMemo } from \"react\";\nimport { resource, withKey, type ResourceElement } from \"@assistant-ui/tap\";\nimport {\n type ClientOutput,\n useClientLookup,\n Derived,\n attachTransformScopes,\n useClientResource,\n} from \"@assistant-ui/store\";\nimport { generateId } from \"@assistant-ui/core\";\n\nimport { ModelContext } from \"@assistant-ui/core/store\";\nimport { Tools, DataRenderers } from \"@assistant-ui/core/react\";\n\nconst RESOLVED_PROMISE = Promise.resolve();\n\nexport type InMemoryThreadListProps = {\n thread: (threadId: string) => ResourceElement<ClientOutput<\"thread\">>;\n onSwitchToThread?: (threadId: string) => void;\n onSwitchToNewThread?: () => void;\n};\n\ntype ThreadData = {\n id: string;\n title?: string;\n status: \"regular\" | \"archived\";\n custom?: Record<string, unknown> | undefined;\n};\n\n// ThreadListItem Client\nconst useThreadListItemClient = (props: {\n data: ThreadData;\n isRunning: boolean;\n onSwitchTo: () => void;\n onRename: (title: string) => void;\n onUpdateCustom: (custom: Record<string, unknown> | undefined) => void;\n onArchive: () => void;\n onUnarchive: () => void;\n onDelete: () => void;\n}): ClientOutput<\"threadListItem\"> => {\n const {\n data,\n isRunning,\n onSwitchTo,\n onRename,\n onUpdateCustom,\n onArchive,\n onUnarchive,\n onDelete,\n } = props;\n const state = useMemo(\n () => ({\n id: data.id,\n remoteId: undefined,\n externalId: undefined,\n title: data.title,\n status: data.status,\n custom: data.custom,\n isRunning,\n }),\n [data.id, data.title, data.status, data.custom, isRunning],\n );\n\n return {\n getState: () => state,\n switchTo: onSwitchTo,\n rename: onRename,\n updateCustom: onUpdateCustom,\n archive: onArchive,\n unarchive: onUnarchive,\n delete: onDelete,\n generateTitle: () => {},\n initialize: async () => ({ remoteId: data.id, externalId: undefined }),\n detach: () => {},\n };\n};\n\nconst ThreadListItemClient = resource(useThreadListItemClient);\n\n// InMemoryThreadList Client\nconst useInMemoryThreadList = (\n props: InMemoryThreadListProps,\n): ClientOutput<\"threads\"> => {\n const {\n thread: threadFactory,\n onSwitchToThread,\n onSwitchToNewThread,\n } = props;\n\n const [mainThreadId, setMainThreadId] = useState(\"main\");\n const [threads, setThreads] = useState<readonly ThreadData[]>(() => [\n { id: \"main\", title: \"Main Thread\", status: \"regular\" },\n ]);\n\n const handleSwitchToThread = (threadId: string) => {\n setMainThreadId(threadId);\n onSwitchToThread?.(threadId);\n };\n\n const handleRename = (threadId: string, title: string) => {\n setThreads((prev) =>\n prev.map((t) => (t.id === threadId ? { ...t, title } : t)),\n );\n };\n\n const handleArchive = (threadId: string) => {\n setThreads((prev) =>\n prev.map((t) =>\n t.id === threadId ? { ...t, status: \"archived\" as const } : t,\n ),\n );\n };\n\n const handleUnarchive = (threadId: string) => {\n setThreads((prev) =>\n prev.map((t) =>\n t.id === threadId ? { ...t, status: \"regular\" as const } : t,\n ),\n );\n };\n\n const handleUpdateCustom = (\n threadId: string,\n custom: Record<string, unknown> | undefined,\n ) => {\n setThreads((prev) =>\n prev.map((t) => (t.id === threadId ? { ...t, custom } : t)),\n );\n };\n\n const handleDelete = (threadId: string) => {\n setThreads((prev) => prev.filter((t) => t.id !== threadId));\n setMainThreadId((prev) =>\n prev === threadId\n ? threads.find((t) => t.id !== threadId)?.id || \"main\"\n : prev,\n );\n };\n\n const handleSwitchToNewThread = () => {\n const newId = `thread-${generateId()}`;\n setThreads((prev) => [\n ...prev,\n { id: newId, title: \"New Thread\", status: \"regular\" },\n ]);\n setMainThreadId(newId);\n onSwitchToNewThread?.();\n };\n\n // Only the main thread is mounted, so it is the only thread that can run.\n const mainThreadClient = useClientResource(threadFactory(mainThreadId));\n\n const threadListItems = useClientLookup(\n threads.map((t) =>\n withKey(\n t.id,\n ThreadListItemClient({\n data: t,\n isRunning: t.id === mainThreadId && mainThreadClient.state.isRunning,\n onSwitchTo: () => handleSwitchToThread(t.id),\n onRename: (title) => handleRename(t.id, title),\n onUpdateCustom: (custom) => handleUpdateCustom(t.id, custom),\n onArchive: () => handleArchive(t.id),\n onUnarchive: () => handleUnarchive(t.id),\n onDelete: () => handleDelete(t.id),\n }),\n ),\n ),\n );\n\n const state = useMemo(() => {\n const regularThreads = threads.filter((t) => t.status === \"regular\");\n const archivedThreads = threads.filter((t) => t.status === \"archived\");\n\n return {\n mainThreadId,\n newThreadId: null,\n isLoading: false,\n isLoadingMore: false,\n hasMore: false,\n threadIds: regularThreads.map((t) => t.id),\n archivedThreadIds: archivedThreads.map((t) => t.id),\n threadItems: threadListItems.state,\n main: mainThreadClient.state,\n };\n }, [mainThreadId, threads, threadListItems.state, mainThreadClient.state]);\n\n return {\n getState: () => state,\n switchToThread: handleSwitchToThread,\n switchToNewThread: handleSwitchToNewThread,\n getLoadThreadsPromise: () => RESOLVED_PROMISE,\n reload: () => RESOLVED_PROMISE,\n reloadMainThread: () =>\n mainThreadClient.methods.unstable_refetchThread?.() ?? RESOLVED_PROMISE,\n loadMore: () => RESOLVED_PROMISE,\n item: (selector) => {\n if (selector === \"main\") {\n const index = threads.findIndex((t) => t.id === mainThreadId);\n return threadListItems.get({ index: index === -1 ? 0 : index });\n }\n if (\"id\" in selector) {\n const index = threads.findIndex((t) => t.id === selector.id);\n return threadListItems.get({ index });\n }\n return threadListItems.get(selector);\n },\n thread: () => mainThreadClient.methods,\n };\n};\n\nexport const InMemoryThreadList = resource(useInMemoryThreadList);\n\nattachTransformScopes(useInMemoryThreadList, (scopes, parent) => {\n scopes.thread ??= Derived({\n source: \"threads\",\n query: { type: \"main\" },\n get: (aui) => aui.threads.thread(\"main\"),\n });\n scopes.threadListItem ??= Derived({\n source: \"threads\",\n query: { type: \"main\" },\n get: (aui) => aui.threads.item(\"main\"),\n });\n scopes.composer ??= Derived({\n source: \"thread\",\n query: {},\n get: (aui) => aui.threads.thread(\"main\").composer(),\n });\n\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n if (!scopes.tools && parent.tools.source === null) {\n scopes.tools = Tools({});\n }\n if (!scopes.dataRenderers && parent.dataRenderers.source === null) {\n scopes.dataRenderers = DataRenderers();\n }\n if (!scopes.suggestions && parent.suggestions.source === null) {\n scopes.suggestions = Derived({\n source: \"thread\",\n query: {},\n get: (aui) => aui.thread.suggestions(),\n });\n }\n});\n"],"mappings":";;;;;;;;AAcA,MAAMc,mBAAmBC,QAAQC,QAAQ;AAgBzC,MAAMY,2BAA0BC,UAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAU9B,MAAA,EAAAC,MAAAC,WAAAC,YAAAC,UAAAC,gBAAAC,WAAAC,aAAAC,aASIV;CAAM,IAAAW;CAAA,IAAAV,EAAA,OAAAE,KAAAN,UAAAI,EAAA,OAAAE,KAAAT,MAAAO,EAAA,OAAAE,KAAAP,UAAAK,EAAA,OAAAE,KAAAR,SAAAM,EAAA,OAAAG,WAAA;EAEDO,KAAA;GAAAjB,IACDS,KAAIT;GAAGkB,UACDC,KAAAA;GAASC,YACPD,KAAAA;GAASlB,OACdQ,KAAIR;GAAMC,QACTO,KAAIP;GAAOC,QACXM,KAAIN;GAAOO;EAErB;EAACH,EAAA,KAAAE,KAAAN;EAAAI,EAAA,KAAAE,KAAAT;EAAAO,EAAA,KAAAE,KAAAP;EAAAK,EAAA,KAAAE,KAAAR;EAAAM,EAAA,KAAAG;EAAAH,EAAA,K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gBAAgB1J,cAAc;CAEvC,IAAI,CAACgJ,OAAOW,eAAeV,OAAOU,YAAYT,WAAW,MACvDF,OAAOW,cAAcjK,QAAQ;EAC3BwJ,QAAQ;EACRC,OAAO,CAAC;EACRnB,MAAMqB,QAAQA,IAAIhJ,OAAOsJ,YAAY;CACvC,CAAC;AAEL,CAAC;AAxN+B,SAAAhH,QAAA,CAAA;AAAA,SAAAG,SAAA,CAAA;AAkDF,SAAAQ,SAAA;CAAA,OAUwC,CAClE;EAAA5C,IAAM;EAAMC,OAAS;EAAaC,QAAU;CAAU,CAAC;AACxD;AAZ2B,SAAA6F,OAAAmD,KAAA;CAAA,OA2FmB/F,IAACjD,WAAY;AAAS;AA3FzC,SAAA+F,OAAAkD,KAAA;CAAA,OA4FoBhG,IAACjD,WAAY;AAAU;AA5F3C,SAAAgG,OAAAkD,KAAA;CAAA,OAoGajG,IAACnD;AAAG;AApGjB,SAAAmG,OAAAkD,KAAA;CAAA,OAqGsBlG,IAACnD;AAAG;AArG1B,SAAA8H,SAAA;CAAA,OA+GGvI;AAAgB;AA/GnB,SAAAyI,SAAA;CAAA,OAgHZzI;AAAgB;AAhHJ,SAAA4I,SAAA;CAAA,OAmHV5I;AAAgB"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  /// <reference types="@assistant-ui/core/react" />
2
2
  import { Assistant } from "./augmentations.js";
3
- import { ExternalThread, ExternalThreadMessage, ExternalThreadProps } from "./client/ExternalThread.js";
4
3
  import { InMemoryThreadList, InMemoryThreadListProps } from "./client/InMemoryThreadList.js";
5
- import { SingleThreadList } from "./client/SingleThreadList.js";
6
4
  import { AssistantRuntimeProvider } from "./legacy-runtime/AssistantRuntimeProvider.js";
7
5
  import { ThreadListItemByIndexProvider, ThreadListItemRuntimeProvider } from "./context/providers/ThreadListItemProvider.js";
8
6
  import { MessageByIndexProvider } from "./context/providers/MessageByIndexProvider.js";
@@ -77,7 +75,7 @@ import "./mcp-apps/index.js";
77
75
  import { AssistantClient, AssistantEventCallback, AssistantEventName, AssistantEventPayload, AssistantEventScope, AssistantEventSelector, AssistantState, AuiConfig, AuiIf, AuiProvider, useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
78
76
  import { AssistantContextConfig, AssistantDataUI, AssistantDataUIProps, AssistantInteractableProps, AssistantTool, AssistantToolProps, AssistantToolUI, AssistantToolUIProps, DataMessagePartComponent, DataMessagePartProps, DataRenderers, EmptyMessagePartComponent, EmptyMessagePartProps, EnrichedPartState, FileMessagePartComponent, FileMessagePartProps, GenerativeUIComponentRegistry, GenerativeUIMessagePartComponent, GenerativeUIMessagePartProps, GenerativeUIRender, GenerativeUIRenderError, GenerativeUIRenderProps, GroupByContext, ImageMessagePartComponent, ImageMessagePartProps, Interactables, McpAppResourceOutput, McpToolkitDefinition, McpToolkitEntry, McpToolkitToolConfig, PartState, ProviderToolConfig, QuoteMessagePartComponent, QuoteMessagePartProps, ReasoningGroupComponent, ReasoningGroupProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, RuntimeAdapterProvider, RuntimeAdapters, SourceMessagePartComponent, SourceMessagePartProps, TextMessagePartComponent, TextMessagePartProps, ToolArgsStatus, ToolCallMessagePartComponent, ToolCallMessagePartProps, ToolCallText, ToolDefinition, Toolkit, ToolkitDefinition, ToolkitDefinitionEntry, Tools, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, Unstable_InferInteractableState, Unstable_InteractableConfig, Unstable_InteractableDefinition, Unstable_InteractablePersistedState, Unstable_InteractablePersistenceAdapter, Unstable_InteractablePersistenceStatus, Unstable_InteractableRegistration, Unstable_InteractableStateSchema, Unstable_InteractableToolConfig, Unstable_InteractableToolRenderProps, Unstable_InteractableVersionInfo, Unstable_InteractablesClientSchema, Unstable_InteractablesConfig, Unstable_InteractablesMethods, Unstable_InteractablesState, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
79
77
  import { AssistantCloud } from "assistant-cloud";
80
- import { AddToolResultOptions, AppendMessage, AssistantFrameHost, AssistantFrameProvider, AssistantRuntime, Attachment, AttachmentAdapter, AttachmentRuntime, AttachmentState, AttachmentStatus, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, ChatModelRunUpdate, CompleteAttachment, ComposerRuntime, ComposerState, CompositeAttachmentAdapter, CreateAppendMessage, CreateAttachment, CreateResumeRunConfig, CreateStartRunConfig, DataMessagePart, DictationAdapter, DictationState, EditComposerRuntime, EditComposerState, ExportedMessageRepository, ExportedMessageRepositoryItem, ExternalStoreAdapter, ExternalStoreBranchChange, ExternalStoreMessageConverter, ExternalStoreSharedOptions, ExternalStoreThreadData, ExternalStoreThreadListAdapter, ExternalThreadBranchAdapter, ExternalThreadQueueAdapter, FRAME_MESSAGE_CHANNEL, FeedbackAdapter, FileMessagePart, FrameMessage, FrameMessageType, GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec, GenericThreadHistoryAdapter, ImageMessagePart, InMemoryThreadListAdapter, LanguageModelConfig, LanguageModelV1CallSettings, LocalRuntimeOptionsBase, MessageFormatAdapter, MessageFormatItem, MessageFormatRepository, MessagePartRuntime, MessagePartState, MessagePartStatus, MessagePartStreamStatus, MessageQueueController, MessageQueueDriver, MessageRuntime, MessageState, MessageStatus, MessageStorageEntry, MessageTiming, ModelContext, ModelContextProvider, ModelContextRegistry, ModelContextRegistryInstructionHandle, ModelContextRegistryProviderHandle, ModelContextRegistryToolHandle, PartProviderMetadata, PendingAttachment, QuoteInfo, RealtimeVoiceAdapter, ReasoningMessagePart, RemoteThreadListAdapter, RemoteThreadListProviderComponent, RespondToToolApprovalOptions, SerializedModelContext, SerializedTool, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SourceMessagePart, SourceProviderMetadata, SpeechSynthesisAdapter, SubmitFeedbackOptions, SuggestionAdapter, TextMessagePart, ThreadAssistantMessage, ThreadAssistantMessagePart, ThreadComposerRuntime, ThreadComposerState, ThreadHistoryAdapter, ThreadListItemRuntime, ThreadListItemState, ThreadListItemStatus, ThreadListRuntime, ThreadListState, ThreadMessage, ThreadMessageLike, ThreadRuntime, ThreadState, ThreadSuggestion, ThreadSystemMessage, ThreadUserMessage, ThreadUserMessagePart, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolCallMessagePart, ToolCallMessagePartStatus, ToolCallTiming, ToolModelContentPart, Unstable_AudioMessagePart, Unstable_DirectiveFormatter, Unstable_DirectiveSegment, Unstable_InteractableSnapshotEntry, Unstable_InteractableVersion, Unstable_TriggerItem, Unsubscribe, VoiceSessionControls, VoiceSessionHelpers, VoiceSessionState, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, mergeModelContexts, pickExternalStoreSharedOptions, tool, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
78
+ import { AddToolResultOptions, AppendMessage, AssistantFrameHost, AssistantFrameProvider, AssistantRuntime, Attachment, AttachmentAdapter, AttachmentRuntime, AttachmentState, AttachmentStatus, ChatModelAdapter, ChatModelRunOptions, ChatModelRunResult, ChatModelRunUpdate, CompleteAttachment, ComposerRuntime, ComposerState, CompositeAttachmentAdapter, CreateAppendMessage, CreateAttachment, CreateResumeRunConfig, CreateStartRunConfig, DataMessagePart, DictationAdapter, DictationState, EditComposerRuntime, EditComposerState, ExportedMessageRepository, ExportedMessageRepositoryItem, ExternalStoreAdapter, ExternalStoreBranchChange, ExternalStoreMessageConverter, ExternalStoreSharedOptions, ExternalStoreThreadData, ExternalStoreThreadListAdapter, ExternalThreadBranchAdapter, ExternalThreadQueueAdapter, FRAME_MESSAGE_CHANNEL, FeedbackAdapter, FileMessagePart, FrameMessage, FrameMessageType, GenerativeUIMessagePart, GenerativeUINode, GenerativeUISpec, GenericThreadHistoryAdapter, ImageMessagePart, InMemoryThreadListAdapter, LanguageModelConfig, LanguageModelV1CallSettings, LocalRuntimeOptionsBase, MessageFormatAdapter, MessageFormatItem, MessageFormatRepository, MessageNotSentError, MessagePartRuntime, MessagePartState, MessagePartStatus, MessagePartStreamStatus, MessageQueueController, MessageQueueDriver, MessageRuntime, MessageState, MessageStatus, MessageStorageEntry, MessageTiming, ModelContext, ModelContextProvider, ModelContextRegistry, ModelContextRegistryInstructionHandle, ModelContextRegistryProviderHandle, ModelContextRegistryToolHandle, PartProviderMetadata, PendingAttachment, QuoteInfo, RealtimeVoiceAdapter, ReasoningMessagePart, RemoteThreadListAdapter, RemoteThreadListProviderComponent, RespondToToolApprovalOptions, SerializedModelContext, SerializedTool, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SourceMessagePart, SourceProviderMetadata, SpeechSynthesisAdapter, SubmitFeedbackOptions, SuggestionAdapter, TextMessagePart, ThreadAssistantMessage, ThreadAssistantMessagePart, ThreadComposerRuntime, ThreadComposerState, ThreadHistoryAdapter, ThreadListItemRuntime, ThreadListItemState, ThreadListItemStatus, ThreadListRuntime, ThreadListState, ThreadMessage, ThreadMessageLike, ThreadRuntime, ThreadState, ThreadSuggestion, ThreadSystemMessage, ThreadUserMessage, ThreadUserMessagePart, ToolApprovalOption, ToolApprovalOptionKind, ToolApprovalResponse, ToolCallMessagePart, ToolCallMessagePartStatus, ToolCallTiming, ToolModelContentPart, Unstable_AudioMessagePart, Unstable_DirectiveFormatter, Unstable_DirectiveSegment, Unstable_InteractableSnapshotEntry, Unstable_InteractableVersion, Unstable_TriggerItem, Unsubscribe, VoiceSessionControls, VoiceSessionHelpers, VoiceSessionState, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
81
79
  import { Tool } from "assistant-stream";
82
- import { ChainOfThoughtClient, ComposerSendOptions, ModelContext as ModelContextClient, QueueItemMethods, QueueItemState, SuggestionConfig, Suggestions } from "@assistant-ui/core/store";
83
- export { actionBarMore_d_exports as ActionBarMorePrimitive, actionBar_d_exports as ActionBarPrimitive, type AddToolResultOptions, type AppendMessage, type Assistant, type AssistantClient, AssistantCloud, type AssistantContextConfig, type AssistantDataUI, type AssistantDataUIProps, type AssistantEventCallback, type AssistantEventName, type AssistantEventPayload, type AssistantEventScope, type AssistantEventSelector, AssistantFrameHost, AssistantFrameProvider, type AssistantInteractableProps, assistantModal_d_exports as AssistantModalPrimitive, type AssistantRuntime, AssistantRuntimeProvider, type AssistantState, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantTransportCommand, type AssistantTransportConnectionMetadata, type AssistantTransportProtocol, type Attachment, type AttachmentAdapter, attachment_d_exports as AttachmentPrimitive, type AttachmentRuntime, type AttachmentState, type AttachmentStatus, AuiConfig, AuiIf, AuiProvider, branchPicker_d_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, chainOfThought_d_exports as ChainOfThoughtPrimitive, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, CloudFileAttachmentAdapter, type CompleteAttachment, ComposerAttachmentByIndexProvider, composer_d_exports as ComposerPrimitive, type ComposerRuntime, type ComposerSendOptions, type ComposerState, CompositeAttachmentAdapter, type CreateAppendMessage, type CreateAttachment, type CreateResumeRunConfig, type CreateStartRunConfig, type DataMessagePart, type DataMessagePartComponent, type DataMessagePartProps, DataRenderers, DevToolsHooks, DevToolsProviderApi, type DictationAdapter, type DictationState, type EditComposerRuntime, type EditComposerState, type EmptyMessagePartComponent, type EmptyMessagePartProps, type EnrichedPartState, error_d_exports as ErrorPrimitive, ExportedMessageRepository, type ExportedMessageRepositoryItem, type ExternalStoreAdapter, type ExternalStoreBranchChange, type ExternalStoreMessageConverter, type ExternalStoreSharedOptions, type ExternalStoreThreadData, type ExternalStoreThreadListAdapter, ExternalThread, type ExternalThreadBranchAdapter, type ExternalThreadMessage, type ExternalThreadProps, type ExternalThreadQueueAdapter, FRAME_MESSAGE_CHANNEL, type FeedbackAdapter, type FileMessagePart, type FileMessagePartComponent, type FileMessagePartProps, type FrameMessage, type FrameMessageType, type GenerativeUIComponentRegistry, type GenerativeUIMessagePart, type GenerativeUIMessagePartComponent, type GenerativeUIMessagePartProps, type GenerativeUINode, GenerativeUIRender, GenerativeUIRenderError, type GenerativeUIRenderProps, type GenerativeUISpec, type GenericThreadHistoryAdapter, type GroupByContext, internal_d_exports as INTERNAL, type ImageMessagePart, type ImageMessagePartComponent, type ImageMessagePartProps, InMemoryThreadList, InMemoryThreadListAdapter, type InMemoryThreadListProps, Interactables, type LanguageModelConfig, type LanguageModelV1CallSettings, type LocalRuntimeOptions, type LocalRuntimeOptionsBase, type McpAppDisplayMode, type McpAppHostContext, type McpAppHostInfo, type McpAppMetadata, McpAppRenderer, type McpAppRendererOptions, type McpAppResource, type McpAppResourceCSP, type McpAppResourceMeta, type McpAppResourceOutput, type McpAppSandboxConfig, type McpAppToolCallParams, type McpAppsHost, McpAppsRemoteHost, type McpAppsRemoteHostOptions, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, type MessageFormatAdapter, type MessageFormatItem, type MessageFormatRepository, messagePart_d_exports as MessagePartPrimitive, type MessagePartRuntime, type MessagePartState, type MessagePartStatus, type MessagePartStreamStatus, message_d_exports as MessagePrimitive, MessageProvider, type MessageQueueController, type MessageQueueDriver, type MessageRuntime, type MessageState, type MessageStatus, type MessageStorageEntry, type MessageTiming, type ModelContext, ModelContextClient, type ModelContextProvider, ModelContextRegistry, type ModelContextRegistryInstructionHandle, type ModelContextRegistryProviderHandle, type ModelContextRegistryToolHandle, PartByIndexProvider, type PartProviderMetadata, type PartState, type PendingAttachment, type ProviderToolConfig, type QueueItemMethods, queueItem_d_exports as QueueItemPrimitive, type QueueItemState, type QuoteInfo, type QuoteMessagePartComponent, type QuoteMessagePartProps, ReadonlyThreadProvider, type RealtimeVoiceAdapter, type ReasoningGroupComponent, type ReasoningGroupProps, type ReasoningMessagePart, type ReasoningMessagePartComponent, type ReasoningMessagePartProps, type RemoteThreadListAdapter, type RemoteThreadListProviderComponent, type RespondToToolApprovalOptions, RuntimeAdapterProvider, type RuntimeAdapters, selectionToolbar_d_exports as SelectionToolbarPrimitive, type SendCommandsRequestBody, type SerializedModelContext, type SerializedTool, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, type SmoothOptions, type SourceMessagePart, type SourceMessagePartComponent, type SourceMessagePartProps, type SourceProviderMetadata, type SpeechSynthesisAdapter, type SubmitFeedbackOptions, type SuggestionAdapter, SuggestionByIndexProvider, type SuggestionConfig, suggestion_d_exports as SuggestionPrimitive, Suggestions, type TextMessagePart, type TextMessagePartComponent, type TextMessagePartProps, TextMessagePartProvider, type ThreadAssistantMessage, type ThreadAssistantMessagePart, type ThreadComposerRuntime, type ThreadComposerState, type ThreadHistoryAdapter, ThreadListItemByIndexProvider, threadListItemMore_d_exports as ThreadListItemMorePrimitive, threadListItem_d_exports as ThreadListItemPrimitive, type ThreadListItemRuntime, ThreadListItemRuntimeProvider, type ThreadListItemState, type ThreadListItemStatus, threadList_d_exports as ThreadListPrimitive, type ThreadListRuntime, type ThreadListState, type ThreadMessage, type ThreadMessageLike, thread_d_exports as ThreadPrimitive, type ThreadRuntime, type ThreadState, type ThreadSuggestion, type ThreadSystemMessage, type ThreadUserMessage, type ThreadUserMessagePart, type ThreadViewportState, type Tool, type ToolApprovalOption, type ToolApprovalOptionKind, type ToolApprovalResponse, type ToolArgsStatus, type ToolCallMessagePart, type ToolCallMessagePartComponent, type ToolCallMessagePartMcpMetadata, type ToolCallMessagePartProps, type ToolCallMessagePartStatus, type ToolCallText, type ToolCallTiming, type ToolDefinition, type ToolExecutionStatus, type ToolModelContentPart, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, Tools, type Unstable_AudioMessagePart, type Unstable_AudioMessagePartComponent, type Unstable_AudioMessagePartProps, type Unstable_ComposerInput, type Unstable_ComposerInputHistory, type Unstable_DirectiveFormatter, type Unstable_DirectiveSegment, type Unstable_IconComponent, type Unstable_InferInteractableState, type Unstable_InteractableConfig, type Unstable_InteractableDefinition, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractableRegistration, type Unstable_InteractableSnapshotEntry, type Unstable_InteractableStateSchema, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableVersion, type Unstable_InteractableVersionInfo, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, type Unstable_InteractablesMethods, type Unstable_InteractablesState, type Unstable_Mention, type Unstable_MentionCategory, type Unstable_MentionDirective, type Unstable_MessageStallDetection, type Unstable_MessageStallDetectionOptions, type Unstable_ModelContextToolsOptions, type RegisteredTrigger as Unstable_RegisteredTrigger, type Unstable_SlashCommand, type Unstable_SlashCommandAction, type TriggerBehavior as Unstable_TriggerBehavior, type Unstable_TriggerItem, type Unstable_TriggerPopoverAriaProps, type Unstable_UseComposerInputOptions, type Unstable_UseLiveCompletionAdapterOptions, type Unstable_UseMentionAdapterOptions, type Unstable_UseSlashCommandAdapterOptions, type Unsubscribe, type VoiceSessionControls, type VoiceSessionHelpers, type VoiceSessionState, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, getMcpAppFromToolPart, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, makeAssistantVisible, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, unstable_Interactables, convertExternalMessages as unstable_convertExternalMessages, createMessageConverter as unstable_createMessageConverter, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useComposerInput, unstable_useComposerInputHistory, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useMessageStallDetection, unstable_useSlashCommandAdapter, unstable_useThreadMessageIds, unstable_useTriggerPopoverAriaProps, useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, useAssistantContext, useAssistantDataUI, useAssistantFrameHost, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessagePartData, useMessagePartFile, useMessagePartImage, useMessagePartReasoning, useMessagePartSource, useMessagePartText, useMessageQuote, useMessageTiming, useRemoteThreadListRuntime, useRuntimeAdapters, useScrollLock, useSmooth, useThreadViewport, useThreadViewportAutoScroll, useThreadViewportStore, useToolArgsStatus, useToolCallElapsed, useVoiceControls, useVoiceState, useVoiceVolume };
80
+ import { ChainOfThoughtClient, ComposerSendOptions, ExternalThread, ExternalThreadMessage, ExternalThreadProps, ModelContext as ModelContextClient, QueueItemMethods, QueueItemState, SingleThreadList, SuggestionConfig, Suggestions } from "@assistant-ui/core/store";
81
+ export { actionBarMore_d_exports as ActionBarMorePrimitive, actionBar_d_exports as ActionBarPrimitive, type AddToolResultOptions, type AppendMessage, type Assistant, type AssistantClient, AssistantCloud, type AssistantContextConfig, type AssistantDataUI, type AssistantDataUIProps, type AssistantEventCallback, type AssistantEventName, type AssistantEventPayload, type AssistantEventScope, type AssistantEventSelector, AssistantFrameHost, AssistantFrameProvider, type AssistantInteractableProps, assistantModal_d_exports as AssistantModalPrimitive, type AssistantRuntime, AssistantRuntimeProvider, type AssistantState, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AssistantTransportCommand, type AssistantTransportConnectionMetadata, type AssistantTransportProtocol, type Attachment, type AttachmentAdapter, attachment_d_exports as AttachmentPrimitive, type AttachmentRuntime, type AttachmentState, type AttachmentStatus, AuiConfig, AuiIf, AuiProvider, branchPicker_d_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, chainOfThought_d_exports as ChainOfThoughtPrimitive, type ChatModelAdapter, type ChatModelRunOptions, type ChatModelRunResult, type ChatModelRunUpdate, CloudFileAttachmentAdapter, type CompleteAttachment, ComposerAttachmentByIndexProvider, composer_d_exports as ComposerPrimitive, type ComposerRuntime, type ComposerSendOptions, type ComposerState, CompositeAttachmentAdapter, type CreateAppendMessage, type CreateAttachment, type CreateResumeRunConfig, type CreateStartRunConfig, type DataMessagePart, type DataMessagePartComponent, type DataMessagePartProps, DataRenderers, DevToolsHooks, DevToolsProviderApi, type DictationAdapter, type DictationState, type EditComposerRuntime, type EditComposerState, type EmptyMessagePartComponent, type EmptyMessagePartProps, type EnrichedPartState, error_d_exports as ErrorPrimitive, ExportedMessageRepository, type ExportedMessageRepositoryItem, type ExternalStoreAdapter, type ExternalStoreBranchChange, type ExternalStoreMessageConverter, type ExternalStoreSharedOptions, type ExternalStoreThreadData, type ExternalStoreThreadListAdapter, ExternalThread, type ExternalThreadBranchAdapter, type ExternalThreadMessage, type ExternalThreadProps, type ExternalThreadQueueAdapter, FRAME_MESSAGE_CHANNEL, type FeedbackAdapter, type FileMessagePart, type FileMessagePartComponent, type FileMessagePartProps, type FrameMessage, type FrameMessageType, type GenerativeUIComponentRegistry, type GenerativeUIMessagePart, type GenerativeUIMessagePartComponent, type GenerativeUIMessagePartProps, type GenerativeUINode, GenerativeUIRender, GenerativeUIRenderError, type GenerativeUIRenderProps, type GenerativeUISpec, type GenericThreadHistoryAdapter, type GroupByContext, internal_d_exports as INTERNAL, type ImageMessagePart, type ImageMessagePartComponent, type ImageMessagePartProps, InMemoryThreadList, InMemoryThreadListAdapter, type InMemoryThreadListProps, Interactables, type LanguageModelConfig, type LanguageModelV1CallSettings, type LocalRuntimeOptions, type LocalRuntimeOptionsBase, type McpAppDisplayMode, type McpAppHostContext, type McpAppHostInfo, type McpAppMetadata, McpAppRenderer, type McpAppRendererOptions, type McpAppResource, type McpAppResourceCSP, type McpAppResourceMeta, type McpAppResourceOutput, type McpAppSandboxConfig, type McpAppToolCallParams, type McpAppsHost, McpAppsRemoteHost, type McpAppsRemoteHostOptions, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, type MessageFormatAdapter, type MessageFormatItem, type MessageFormatRepository, MessageNotSentError, messagePart_d_exports as MessagePartPrimitive, type MessagePartRuntime, type MessagePartState, type MessagePartStatus, type MessagePartStreamStatus, message_d_exports as MessagePrimitive, MessageProvider, type MessageQueueController, type MessageQueueDriver, type MessageRuntime, type MessageState, type MessageStatus, type MessageStorageEntry, type MessageTiming, type ModelContext, ModelContextClient, type ModelContextProvider, ModelContextRegistry, type ModelContextRegistryInstructionHandle, type ModelContextRegistryProviderHandle, type ModelContextRegistryToolHandle, PartByIndexProvider, type PartProviderMetadata, type PartState, type PendingAttachment, type ProviderToolConfig, type QueueItemMethods, queueItem_d_exports as QueueItemPrimitive, type QueueItemState, type QuoteInfo, type QuoteMessagePartComponent, type QuoteMessagePartProps, ReadonlyThreadProvider, type RealtimeVoiceAdapter, type ReasoningGroupComponent, type ReasoningGroupProps, type ReasoningMessagePart, type ReasoningMessagePartComponent, type ReasoningMessagePartProps, type RemoteThreadListAdapter, type RemoteThreadListProviderComponent, type RespondToToolApprovalOptions, RuntimeAdapterProvider, type RuntimeAdapters, selectionToolbar_d_exports as SelectionToolbarPrimitive, type SendCommandsRequestBody, type SerializedModelContext, type SerializedTool, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, type SmoothOptions, type SourceMessagePart, type SourceMessagePartComponent, type SourceMessagePartProps, type SourceProviderMetadata, type SpeechSynthesisAdapter, type SubmitFeedbackOptions, type SuggestionAdapter, SuggestionByIndexProvider, type SuggestionConfig, suggestion_d_exports as SuggestionPrimitive, Suggestions, type TextMessagePart, type TextMessagePartComponent, type TextMessagePartProps, TextMessagePartProvider, type ThreadAssistantMessage, type ThreadAssistantMessagePart, type ThreadComposerRuntime, type ThreadComposerState, type ThreadHistoryAdapter, ThreadListItemByIndexProvider, threadListItemMore_d_exports as ThreadListItemMorePrimitive, threadListItem_d_exports as ThreadListItemPrimitive, type ThreadListItemRuntime, ThreadListItemRuntimeProvider, type ThreadListItemState, type ThreadListItemStatus, threadList_d_exports as ThreadListPrimitive, type ThreadListRuntime, type ThreadListState, type ThreadMessage, type ThreadMessageLike, thread_d_exports as ThreadPrimitive, type ThreadRuntime, type ThreadState, type ThreadSuggestion, type ThreadSystemMessage, type ThreadUserMessage, type ThreadUserMessagePart, type ThreadViewportState, type Tool, type ToolApprovalOption, type ToolApprovalOptionKind, type ToolApprovalResponse, type ToolArgsStatus, type ToolCallMessagePart, type ToolCallMessagePartComponent, type ToolCallMessagePartMcpMetadata, type ToolCallMessagePartProps, type ToolCallMessagePartStatus, type ToolCallText, type ToolCallTiming, type ToolDefinition, type ToolExecutionStatus, type ToolModelContentPart, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, Tools, type Unstable_AudioMessagePart, type Unstable_AudioMessagePartComponent, type Unstable_AudioMessagePartProps, type Unstable_ComposerInput, type Unstable_ComposerInputHistory, type Unstable_DirectiveFormatter, type Unstable_DirectiveSegment, type Unstable_IconComponent, type Unstable_InferInteractableState, type Unstable_InteractableConfig, type Unstable_InteractableDefinition, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractableRegistration, type Unstable_InteractableSnapshotEntry, type Unstable_InteractableStateSchema, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableVersion, type Unstable_InteractableVersionInfo, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, type Unstable_InteractablesMethods, type Unstable_InteractablesState, type Unstable_Mention, type Unstable_MentionCategory, type Unstable_MentionDirective, type Unstable_MessageStallDetection, type Unstable_MessageStallDetectionOptions, type Unstable_ModelContextToolsOptions, type RegisteredTrigger as Unstable_RegisteredTrigger, type Unstable_SlashCommand, type Unstable_SlashCommandAction, type TriggerBehavior as Unstable_TriggerBehavior, type Unstable_TriggerItem, type Unstable_TriggerPopoverAriaProps, type Unstable_UseComposerInputOptions, type Unstable_UseLiveCompletionAdapterOptions, type Unstable_UseMentionAdapterOptions, type Unstable_UseSlashCommandAdapterOptions, type Unsubscribe, type VoiceSessionControls, type VoiceSessionHelpers, type VoiceSessionState, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, getMcpAppFromToolPart, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, makeAssistantVisible, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, unstable_Interactables, convertExternalMessages as unstable_convertExternalMessages, createMessageConverter as unstable_createMessageConverter, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useComposerInput, unstable_useComposerInputHistory, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useMessageStallDetection, unstable_useSlashCommandAdapter, unstable_useThreadMessageIds, unstable_useTriggerPopoverAriaProps, useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, useAssistantContext, useAssistantDataUI, useAssistantFrameHost, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessagePartData, useMessagePartFile, useMessagePartImage, useMessagePartReasoning, useMessagePartSource, useMessagePartText, useMessageQuote, useMessageTiming, useRemoteThreadListRuntime, useRuntimeAdapters, useScrollLock, useSmooth, useThreadViewport, useThreadViewportAutoScroll, useThreadViewportStore, useToolArgsStatus, useToolCallElapsed, useVoiceControls, useVoiceState, useVoiceVolume };
package/dist/index.js CHANGED
@@ -53,8 +53,6 @@ import { useMessageQuote } from "./hooks/useMessageQuote.js";
53
53
  import { useMessageTiming } from "./hooks/useMessageTiming.js";
54
54
  import { useToolCallElapsed } from "./hooks/useToolCallElapsed.js";
55
55
  import { unstable_useMessageStallDetection } from "./unstable/useMessageStallDetection.js";
56
- import { SingleThreadList } from "./client/SingleThreadList.js";
57
- import { ExternalThread } from "./client/ExternalThread.js";
58
56
  import { InMemoryThreadList } from "./client/InMemoryThreadList.js";
59
57
  import { internal_exports } from "./internal.js";
60
58
  import { unstable_useMentionAdapter } from "./unstable/useMentionAdapter.js";
@@ -68,6 +66,6 @@ import { McpAppsRemoteHost } from "./mcp-apps/McpAppsRemoteHost.js";
68
66
  import { AuiConfig, AuiIf, AuiProvider, useAui, useAuiEvent, useAuiState } from "@assistant-ui/store";
69
67
  import { DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, RuntimeAdapterProvider, Tools, defineMcpToolkit, defineToolkit, externalTool, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, providerTool, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useRuntimeAdapters, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume } from "@assistant-ui/core/react";
70
68
  import { AssistantCloud } from "assistant-cloud";
71
- import { AssistantFrameHost, AssistantFrameProvider, CompositeAttachmentAdapter, ExportedMessageRepository, FRAME_MESSAGE_CHANNEL, InMemoryThreadListAdapter, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, mergeModelContexts, pickExternalStoreSharedOptions, tool, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
72
- import { ChainOfThoughtClient, ModelContext as ModelContextClient, Suggestions } from "@assistant-ui/core/store";
73
- export { actionBarMore_exports as ActionBarMorePrimitive, actionBar_exports as ActionBarPrimitive, AssistantCloud, AssistantFrameHost, AssistantFrameProvider, assistantModal_exports as AssistantModalPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, chainOfThought_exports as ChainOfThoughtPrimitive, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, DevToolsHooks, DevToolsProviderApi, error_exports as ErrorPrimitive, ExportedMessageRepository, ExternalThread, FRAME_MESSAGE_CHANNEL, GenerativeUIRender, GenerativeUIRenderError, internal_exports as INTERNAL, InMemoryThreadList, InMemoryThreadListAdapter, Interactables, McpAppRenderer, McpAppsRemoteHost, MessageAttachmentByIndexProvider, MessageByIndexProvider, messagePart_exports as MessagePartPrimitive, message_exports as MessagePrimitive, MessageProvider, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, ReadonlyThreadProvider, RuntimeAdapterProvider, selectionToolbar_exports as SelectionToolbarPrimitive, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItemMore_exports as ThreadListItemMorePrimitive, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, getMcpAppFromToolPart, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, makeAssistantVisible, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, unstable_Interactables, convertExternalMessages as unstable_convertExternalMessages, createMessageConverter as unstable_createMessageConverter, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useComposerInput, unstable_useComposerInputHistory, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useMessageStallDetection, unstable_useSlashCommandAdapter, unstable_useThreadMessageIds, unstable_useTriggerPopoverAriaProps, useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, useAssistantContext, useAssistantDataUI, useAssistantFrameHost, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessagePartData, useMessagePartFile, useMessagePartImage, useMessagePartReasoning, useMessagePartSource, useMessagePartText, useMessageQuote, useMessageTiming, useRemoteThreadListRuntime, useRuntimeAdapters, useScrollLock, useSmooth, useThreadViewport, useThreadViewportAutoScroll, useThreadViewportStore, useToolArgsStatus, useToolCallElapsed, useVoiceControls, useVoiceState, useVoiceVolume };
69
+ import { AssistantFrameHost, AssistantFrameProvider, CompositeAttachmentAdapter, ExportedMessageRepository, FRAME_MESSAGE_CHANNEL, InMemoryThreadListAdapter, MessageNotSentError, ModelContextRegistry, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, fromThreadMessageLike, generateId, getExternalStoreMessages, isMessageNotSentError, mergeModelContexts, pickExternalStoreSharedOptions, tool, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions } from "@assistant-ui/core";
70
+ import { ChainOfThoughtClient, ExternalThread, ModelContext as ModelContextClient, SingleThreadList, Suggestions } from "@assistant-ui/core/store";
71
+ export { actionBarMore_exports as ActionBarMorePrimitive, actionBar_exports as ActionBarPrimitive, AssistantCloud, AssistantFrameHost, AssistantFrameProvider, assistantModal_exports as AssistantModalPrimitive, AssistantRuntimeProvider, attachment_exports as AttachmentPrimitive, AuiConfig, AuiIf, AuiProvider, branchPicker_exports as BranchPickerPrimitive, ChainOfThoughtByIndicesProvider, ChainOfThoughtClient, chainOfThought_exports as ChainOfThoughtPrimitive, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, composer_exports as ComposerPrimitive, CompositeAttachmentAdapter, DataRenderers, DevToolsHooks, DevToolsProviderApi, error_exports as ErrorPrimitive, ExportedMessageRepository, ExternalThread, FRAME_MESSAGE_CHANNEL, GenerativeUIRender, GenerativeUIRenderError, internal_exports as INTERNAL, InMemoryThreadList, InMemoryThreadListAdapter, Interactables, McpAppRenderer, McpAppsRemoteHost, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessageNotSentError, messagePart_exports as MessagePartPrimitive, message_exports as MessagePrimitive, MessageProvider, ModelContextClient, ModelContextRegistry, PartByIndexProvider, queueItem_exports as QueueItemPrimitive, ReadonlyThreadProvider, RuntimeAdapterProvider, selectionToolbar_exports as SelectionToolbarPrimitive, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, SingleThreadList, SuggestionByIndexProvider, suggestion_exports as SuggestionPrimitive, Suggestions, TextMessagePartProvider, ThreadListItemByIndexProvider, threadListItemMore_exports as ThreadListItemMorePrimitive, threadListItem_exports as ThreadListItemPrimitive, ThreadListItemRuntimeProvider, threadList_exports as ThreadListPrimitive, thread_exports as ThreadPrimitive, Tools, WebSpeechDictationAdapter, WebSpeechSynthesisAdapter, bindExternalStoreMessage, createMessageQueue, createVoiceSession, defineMcpToolkit, defineToolkit, externalTool, fromThreadMessageLike, generateId, getExternalStoreMessages, getMcpAppFromToolPart, groupPartByType, hitl, hitlTool, humanTool, isMessageNotSentError, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, makeAssistantVisible, mergeModelContexts, pickExternalStoreSharedOptions, providerTool, stubTool, tool, unstable_Interactables, convertExternalMessages as unstable_convertExternalMessages, createMessageConverter as unstable_createMessageConverter, unstable_defaultDirectiveFormatter, unstable_formatInteractableSnapshot, unstable_getInteractableSnapshots, unstable_getInteractableVersions, unstable_interactableTool, unstable_useComposerInput, unstable_useComposerInputHistory, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useLiveCompletionAdapter, unstable_useMentionAdapter, unstable_useMessageStallDetection, unstable_useSlashCommandAdapter, unstable_useThreadMessageIds, unstable_useTriggerPopoverAriaProps, useTriggerPopoverRootContext as unstable_useTriggerPopoverRootContext, useTriggerPopoverRootContextOptional as unstable_useTriggerPopoverRootContextOptional, useTriggerPopoverScopeContext as unstable_useTriggerPopoverScopeContext, useTriggerPopoverScopeContextOptional as unstable_useTriggerPopoverScopeContextOptional, useTriggerPopoverTriggers as unstable_useTriggerPopoverTriggers, useTriggerPopoverTriggersOptional as unstable_useTriggerPopoverTriggersOptional, useAssistantContext, useAssistantDataUI, useAssistantFrameHost, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAssistantTransportRuntime, useAssistantTransportSendCommand, useAssistantTransportState, useAui, useAuiEvent, useAuiState, useAuiToolOverrides, useCloudThreadListAdapter, useCloudThreadListRuntime, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessagePartData, useMessagePartFile, useMessagePartImage, useMessagePartReasoning, useMessagePartSource, useMessagePartText, useMessageQuote, useMessageTiming, useRemoteThreadListRuntime, useRuntimeAdapters, useScrollLock, useSmooth, useThreadViewport, useThreadViewportAutoScroll, useThreadViewportStore, useToolArgsStatus, useToolCallElapsed, useVoiceControls, useVoiceState, useVoiceVolume };
@@ -92,6 +92,24 @@ const createReplayBoundaryStream = async (response, { setReplaying, waitForRende
92
92
  const reader = body.getReader();
93
93
  let bytesForwarded = 0;
94
94
  let replayFinished = false;
95
+ let readerCleanup;
96
+ const releaseReader = () => {
97
+ if (readerCleanup) return readerCleanup;
98
+ reader.releaseLock();
99
+ readerCleanup = Promise.resolve();
100
+ return readerCleanup;
101
+ };
102
+ const cancelReader = (reason) => {
103
+ if (readerCleanup) return readerCleanup;
104
+ readerCleanup = (async () => {
105
+ try {
106
+ await reader.cancel(reason);
107
+ } finally {
108
+ reader.releaseLock();
109
+ }
110
+ })();
111
+ return readerCleanup;
112
+ };
95
113
  const finishReplay = async () => {
96
114
  if (replayFinished) return;
97
115
  replayFinished = true;
@@ -101,37 +119,43 @@ const createReplayBoundaryStream = async (response, { setReplaying, waitForRende
101
119
  };
102
120
  return new ReadableStream({
103
121
  async pull(controller) {
104
- const { done, value } = await reader.read();
105
- if (done) {
106
- await finishReplay();
107
- controller.close();
108
- return;
109
- }
110
- if (replayFinished) {
111
- controller.enqueue(value);
112
- return;
113
- }
114
- const nextBytesForwarded = bytesForwarded + value.byteLength;
115
- if (nextBytesForwarded < replayContentLength) {
116
- bytesForwarded = nextBytesForwarded;
117
- controller.enqueue(value);
118
- return;
119
- }
120
- if (nextBytesForwarded === replayContentLength) {
121
- controller.enqueue(value);
122
+ try {
123
+ const { done, value } = await reader.read();
124
+ if (done) {
125
+ await releaseReader();
126
+ await finishReplay();
127
+ controller.close();
128
+ return;
129
+ }
130
+ if (replayFinished) {
131
+ controller.enqueue(value);
132
+ return;
133
+ }
134
+ const nextBytesForwarded = bytesForwarded + value.byteLength;
135
+ if (nextBytesForwarded < replayContentLength) {
136
+ bytesForwarded = nextBytesForwarded;
137
+ controller.enqueue(value);
138
+ return;
139
+ }
140
+ if (nextBytesForwarded === replayContentLength) {
141
+ controller.enqueue(value);
142
+ await finishReplay();
143
+ return;
144
+ }
145
+ const replayBytesInChunk = replayContentLength - bytesForwarded;
146
+ controller.enqueue(value.subarray(0, replayBytesInChunk));
122
147
  await finishReplay();
123
- return;
148
+ controller.enqueue(value.subarray(replayBytesInChunk));
149
+ } catch (error) {
150
+ await cancelReader(error).catch(() => {});
151
+ throw error;
124
152
  }
125
- const replayBytesInChunk = replayContentLength - bytesForwarded;
126
- controller.enqueue(value.subarray(0, replayBytesInChunk));
127
- await finishReplay();
128
- controller.enqueue(value.subarray(replayBytesInChunk));
129
153
  },
130
154
  async cancel(reason) {
131
155
  const wasFinished = replayFinished;
132
156
  replayFinished = true;
133
157
  if (!wasFinished) setReplaying(false);
134
- await reader.cancel(reason);
158
+ await cancelReader(reason);
135
159
  }
136
160
  });
137
161
  };
@@ -1 +1 @@
1
- {"version":3,"file":"replayBoundaryStream.js","names":["c","_c","useCallback","useEffect","useRef","useState","REPLAY_CONTENT_LENGTH_HEADER","ReplayBoundaryStreamOptions","setReplaying","value","waitForRender","Promise","useReplayRenderWait","$","renderTicket","setRenderTicket","mountedRef","nextTicketRef","t0","Symbol","for","waitersRef","t1","committedTicket","pendingWaiters","waiter","current","undefined","ticket","resolve","push","resolveWaiters","t2","t3","t4","t5","t6","setTimeout","parseReplayContentLength","headers","Headers","raw","get","boundary","Number","isSafeInteger","createReplayBoundaryStream","response","Response","waitForReplayRender","ReadableStream","Uint8Array","body","replayContentLength","reader","getReader","bytesForwarded","replayFinished","finishReplay","pull","controller","done","read","close","enqueue","nextBytesForwarded","byteLength","replayBytesInChunk","subarray","cancel","reason","wasFinished"],"sources":["../../../../src/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport const REPLAY_CONTENT_LENGTH_HEADER = \"Aui-Replay-Content-Length\";\n\ntype ReplayBoundaryStreamOptions = {\n setReplaying: (value: boolean) => void;\n waitForRender: () => Promise<void>;\n};\n\nexport const useReplayRenderWait = () => {\n const [renderTicket, setRenderTicket] = useState(0);\n const mountedRef = useRef(true);\n const nextTicketRef = useRef(0);\n const waitersRef = useRef<Array<{ ticket: number; resolve: () => void }>>([]);\n\n const resolveWaiters = useCallback((committedTicket?: number) => {\n const pendingWaiters = [];\n\n for (const waiter of waitersRef.current) {\n if (committedTicket === undefined || waiter.ticket <= committedTicket) {\n waiter.resolve();\n } else {\n pendingWaiters.push(waiter);\n }\n }\n\n waitersRef.current = pendingWaiters;\n }, []);\n\n useEffect(() => {\n mountedRef.current = true;\n resolveWaiters(renderTicket);\n }, [renderTicket, resolveWaiters]);\n\n useEffect(\n () => () => {\n mountedRef.current = false;\n resolveWaiters();\n },\n [resolveWaiters],\n );\n\n return useCallback(\n () =>\n new Promise<void>((resolve) => {\n setTimeout(() => {\n if (!mountedRef.current) {\n resolve();\n return;\n }\n\n const ticket = nextTicketRef.current + 1;\n nextTicketRef.current = ticket;\n waitersRef.current.push({ ticket, resolve });\n setRenderTicket(ticket);\n }, 0);\n }),\n [],\n );\n};\n\nconst parseReplayContentLength = (headers: Headers): number => {\n const raw = headers.get(REPLAY_CONTENT_LENGTH_HEADER);\n if (raw == null) return 0;\n\n const boundary = Number(raw);\n return Number.isSafeInteger(boundary) && boundary > 0 ? boundary : 0;\n};\n\n// Gates replay bytes until isReplaying:true renders, then releases live bytes after isReplaying:false renders.\nexport const createReplayBoundaryStream = async (\n response: Response,\n {\n setReplaying,\n waitForRender: waitForReplayRender,\n }: ReplayBoundaryStreamOptions,\n): Promise<ReadableStream<Uint8Array>> => {\n const body = response.body as ReadableStream<Uint8Array>;\n const replayContentLength = parseReplayContentLength(response.headers);\n\n if (replayContentLength <= 0) {\n return body;\n }\n\n setReplaying(true);\n await waitForReplayRender();\n\n const reader = body.getReader();\n let bytesForwarded = 0;\n let replayFinished = false;\n\n const finishReplay = async () => {\n if (replayFinished) return;\n replayFinished = true;\n\n // Let replay bytes drain before rendering live mode, then render live mode before releasing live bytes.\n await waitForReplayRender();\n setReplaying(false);\n await waitForReplayRender();\n };\n\n return new ReadableStream<Uint8Array>({\n async pull(controller) {\n const { done, value } = await reader.read();\n\n if (done) {\n await finishReplay();\n controller.close();\n return;\n }\n\n if (replayFinished) {\n controller.enqueue(value);\n return;\n }\n\n const nextBytesForwarded = bytesForwarded + value.byteLength;\n\n if (nextBytesForwarded < replayContentLength) {\n bytesForwarded = nextBytesForwarded;\n controller.enqueue(value);\n return;\n }\n\n if (nextBytesForwarded === replayContentLength) {\n controller.enqueue(value);\n await finishReplay();\n return;\n }\n\n const replayBytesInChunk = replayContentLength - bytesForwarded;\n\n controller.enqueue(value.subarray(0, replayBytesInChunk));\n await finishReplay();\n controller.enqueue(value.subarray(replayBytesInChunk));\n },\n async cancel(reason) {\n const wasFinished = replayFinished;\n replayFinished = true;\n if (!wasFinished) setReplaying(false);\n await reader.cancel(reason);\n },\n });\n};\n"],"mappings":";;;;AAIA,MAAaM,+BAA+B;AAO5C,MAAaM,4BAAsB;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CACjC,MAAA,CAAAa,cAAAC,mBAAwCV,SAAS,CAAC;CAClD,MAAAW,aAAmBZ,OAAO,IAAI;CAC9B,MAAAa,gBAAsBb,OAAO,CAAC;CAAE,IAAAc;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAC0CF,KAAA,CAAA;EAAEL,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAA5E,MAAAQ,aAAmBjB,OA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MAAMiD,aAAa;IACnB;GACF;GAEA,MAAMS,qBAAqBd,sBAAsBG;GAEjDI,WAAWI,QAAQvD,MAAM2D,SAAS,GAAGD,kBAAkB,CAAC;GACxD,MAAMT,aAAa;GACnBE,WAAWI,QAAQvD,MAAM2D,SAASD,kBAAkB,CAAC;EACvD;EACA,MAAME,OAAOC,QAAQ;GACnB,MAAMC,cAAcd;GACpBA,iBAAiB;GACjB,IAAI,CAACc,aAAa/D,aAAa,KAAK;GACpC,MAAM8C,OAAOe,OAAOC,MAAM;EAC5B;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"replayBoundaryStream.js","names":["c","_c","useCallback","useEffect","useRef","useState","REPLAY_CONTENT_LENGTH_HEADER","ReplayBoundaryStreamOptions","setReplaying","value","waitForRender","Promise","useReplayRenderWait","$","renderTicket","setRenderTicket","mountedRef","nextTicketRef","t0","Symbol","for","waitersRef","t1","committedTicket","pendingWaiters","waiter","current","undefined","ticket","resolve","push","resolveWaiters","t2","t3","t4","t5","t6","setTimeout","parseReplayContentLength","headers","Headers","raw","get","boundary","Number","isSafeInteger","createReplayBoundaryStream","response","Response","waitForReplayRender","ReadableStream","Uint8Array","body","replayContentLength","reader","getReader","bytesForwarded","replayFinished","readerCleanup","releaseReader","releaseLock","cancelReader","reason","cancel","finishReplay","pull","controller","done","read","close","enqueue","nextBytesForwarded","byteLength","replayBytesInChunk","subarray","error","catch","wasFinished"],"sources":["../../../../src/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport const REPLAY_CONTENT_LENGTH_HEADER = \"Aui-Replay-Content-Length\";\n\ntype ReplayBoundaryStreamOptions = {\n setReplaying: (value: boolean) => void;\n waitForRender: () => Promise<void>;\n};\n\nexport const useReplayRenderWait = () => {\n const [renderTicket, setRenderTicket] = useState(0);\n const mountedRef = useRef(true);\n const nextTicketRef = useRef(0);\n const waitersRef = useRef<Array<{ ticket: number; resolve: () => void }>>([]);\n\n const resolveWaiters = useCallback((committedTicket?: number) => {\n const pendingWaiters = [];\n\n for (const waiter of waitersRef.current) {\n if (committedTicket === undefined || waiter.ticket <= committedTicket) {\n waiter.resolve();\n } else {\n pendingWaiters.push(waiter);\n }\n }\n\n waitersRef.current = pendingWaiters;\n }, []);\n\n useEffect(() => {\n mountedRef.current = true;\n resolveWaiters(renderTicket);\n }, [renderTicket, resolveWaiters]);\n\n useEffect(\n () => () => {\n mountedRef.current = false;\n resolveWaiters();\n },\n [resolveWaiters],\n );\n\n return useCallback(\n () =>\n new Promise<void>((resolve) => {\n setTimeout(() => {\n if (!mountedRef.current) {\n resolve();\n return;\n }\n\n const ticket = nextTicketRef.current + 1;\n nextTicketRef.current = ticket;\n waitersRef.current.push({ ticket, resolve });\n setRenderTicket(ticket);\n }, 0);\n }),\n [],\n );\n};\n\nconst parseReplayContentLength = (headers: Headers): number => {\n const raw = headers.get(REPLAY_CONTENT_LENGTH_HEADER);\n if (raw == null) return 0;\n\n const boundary = Number(raw);\n return Number.isSafeInteger(boundary) && boundary > 0 ? boundary : 0;\n};\n\n// Gates replay bytes until isReplaying:true renders, then releases live bytes after isReplaying:false renders.\nexport const createReplayBoundaryStream = async (\n response: Response,\n {\n setReplaying,\n waitForRender: waitForReplayRender,\n }: ReplayBoundaryStreamOptions,\n): Promise<ReadableStream<Uint8Array>> => {\n const body = response.body as ReadableStream<Uint8Array>;\n const replayContentLength = parseReplayContentLength(response.headers);\n\n if (replayContentLength <= 0) {\n return body;\n }\n\n setReplaying(true);\n await waitForReplayRender();\n\n const reader = body.getReader();\n let bytesForwarded = 0;\n let replayFinished = false;\n let readerCleanup: Promise<void> | undefined;\n\n const releaseReader = () => {\n if (readerCleanup) return readerCleanup;\n reader.releaseLock();\n readerCleanup = Promise.resolve();\n return readerCleanup;\n };\n\n const cancelReader = (reason?: unknown) => {\n if (readerCleanup) return readerCleanup;\n readerCleanup = (async () => {\n try {\n await reader.cancel(reason);\n } finally {\n reader.releaseLock();\n }\n })();\n return readerCleanup;\n };\n\n const finishReplay = async () => {\n if (replayFinished) return;\n replayFinished = true;\n\n // Let replay bytes drain before rendering live mode, then render live mode before releasing live bytes.\n await waitForReplayRender();\n setReplaying(false);\n await waitForReplayRender();\n };\n\n return new ReadableStream<Uint8Array>({\n async pull(controller) {\n try {\n const { done, value } = await reader.read();\n\n if (done) {\n await releaseReader();\n await finishReplay();\n controller.close();\n return;\n }\n\n if (replayFinished) {\n controller.enqueue(value);\n return;\n }\n\n const nextBytesForwarded = bytesForwarded + value.byteLength;\n\n if (nextBytesForwarded < replayContentLength) {\n bytesForwarded = nextBytesForwarded;\n controller.enqueue(value);\n return;\n }\n\n if (nextBytesForwarded === replayContentLength) {\n controller.enqueue(value);\n await finishReplay();\n return;\n }\n\n const replayBytesInChunk = replayContentLength - bytesForwarded;\n\n controller.enqueue(value.subarray(0, replayBytesInChunk));\n await finishReplay();\n controller.enqueue(value.subarray(replayBytesInChunk));\n } catch (error) {\n await cancelReader(error).catch(() => {});\n throw error;\n }\n },\n async cancel(reason) {\n const wasFinished = replayFinished;\n replayFinished = true;\n if (!wasFinished) setReplaying(false);\n await cancelReader(reason);\n },\n });\n};\n"],"mappings":";;;;AAIA,MAAaM,+BAA+B;AAO5C,MAAaM,4BAAsB;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CACjC,MAAA,CAAAa,cAAAC,mBAAwCV,SAAS,CAAC;CAClD,MAAAW,aAAmBZ,OAAO,IAAI;CAC9B,MAAAa,gBAAsBb,OAAO,CAAC;CAAE,IAAAc;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAC0CF,KAAA,CAAA;EAAEL,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAA5E,MAAAQ,aAAmBjB,OAAuDc,EAAE;CAAE,IAAAI;CAAA,IAAAT,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAE3CE,MAAAC,oBAAA;GACjC,M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A,IAAIZ,gBAAgB;KAClBS,WAAWI,QAAQ7D,KAAK;KACxB;IACF;IAEA,MAAM8D,qBAAqBf,iBAAiB/C,MAAM+D;IAElD,IAAID,qBAAqBlB,qBAAqB;KAC5CG,iBAAiBe;KACjBL,WAAWI,QAAQ7D,KAAK;KACxB;IACF;IAEA,IAAI8D,uBAAuBlB,qBAAqB;KAC9Ca,WAAWI,QAAQ7D,KAAK;KACxB,MAAMuD,aAAa;KACnB;IACF;IAEA,MAAMS,qBAAqBpB,sBAAsBG;IAEjDU,WAAWI,QAAQ7D,MAAMiE,SAAS,GAAGD,kBAAkB,CAAC;IACxD,MAAMT,aAAa;IACnBE,WAAWI,QAAQ7D,MAAMiE,SAASD,kBAAkB,CAAC;GACvD,SAASE,OAAO;IACd,MAAMd,aAAac,KAAK,CAAC,CAACC,YAAY,CAAC,CAAC;IACxC,MAAMD;GACR;EACF;EACA,MAAMZ,OAAOD,QAAQ;GACnB,MAAMe,cAAcpB;GACpBA,iBAAiB;GACjB,IAAI,CAACoB,aAAarE,aAAa,KAAK;GACpC,MAAMqD,aAAaC,MAAM;EAC3B;CACF,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/react",
3
- "version": "0.15.12",
3
+ "version": "0.15.14",
4
4
  "description": "Open-source TypeScript/React library for building production-grade AI chat experiences",
5
5
  "keywords": [
6
6
  "ai",
@@ -55,9 +55,9 @@
55
55
  ],
56
56
  "sideEffects": false,
57
57
  "dependencies": {
58
- "@assistant-ui/core": "^0.3.11",
59
- "@assistant-ui/store": "^0.3.8",
60
- "@assistant-ui/tap": "^0.9.11",
58
+ "@assistant-ui/core": "^0.3.13",
59
+ "@assistant-ui/store": "^0.3.9",
60
+ "@assistant-ui/tap": "^0.9.12",
61
61
  "@radix-ui/primitive": "^1.1.7",
62
62
  "@radix-ui/react-collection": "^1.1.15",
63
63
  "@radix-ui/react-compose-refs": "^1.1.5",
@@ -66,7 +66,7 @@
66
66
  "@radix-ui/react-use-callback-ref": "^1.1.4",
67
67
  "@radix-ui/react-use-controllable-state": "^1.2.6",
68
68
  "@radix-ui/react-use-escape-keydown": "^1.1.5",
69
- "assistant-cloud": "^0.1.39",
69
+ "assistant-cloud": "^0.1.40",
70
70
  "assistant-stream": "^0.3.37",
71
71
  "radix-ui": "^1.6.7",
72
72
  "react-textarea-autosize": "^8.5.9",
@@ -21,10 +21,12 @@
21
21
  * }
22
22
  * ```
23
23
  */
24
+ import type { Assistant as CoreAssistant } from "@assistant-ui/core";
25
+
24
26
  export namespace Assistant {
25
- export interface Commands {}
27
+ export interface Commands extends CoreAssistant.Commands {}
26
28
 
27
- export interface ExternalState {}
29
+ export interface ExternalState extends CoreAssistant.ExternalState {}
28
30
  }
29
31
 
30
32
  export type UserCommands = Assistant.Commands[keyof Assistant.Commands];