@assistant-ui/react 0.5.36 → 0.5.38

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -155,6 +155,9 @@ declare class LocalRuntime extends BaseAssistantRuntime<LocalThreadRuntime> {
155
155
  set adapter(adapter: ChatModelAdapter);
156
156
  registerModelConfigProvider(provider: ModelConfigProvider): () => void;
157
157
  switchToThread(threadId: string | null): LocalThreadRuntime;
158
+ reset({ initialMessages, }?: {
159
+ initialMessages?: readonly CoreMessage[] | undefined;
160
+ }): void;
158
161
  }
159
162
 
160
163
  declare const useLocalRuntime: (adapter: ChatModelAdapter, options?: LocalRuntimeOptions) => LocalRuntime;
@@ -442,6 +445,7 @@ type AssistantToolUIsState = Readonly<{
442
445
  type AssistantContextValue = {
443
446
  useModelConfig: ReadonlyStore<AssistantModelConfigState>;
444
447
  useToolUIs: ReadonlyStore<AssistantToolUIsState>;
448
+ useAssistantRuntime: ReadonlyStore<AssistantRuntime>;
445
449
  useAssistantActions: ReadonlyStore<AssistantActionsState>;
446
450
  };
447
451
  declare function useAssistantContext(): AssistantContextValue;
package/dist/index.d.ts CHANGED
@@ -155,6 +155,9 @@ declare class LocalRuntime extends BaseAssistantRuntime<LocalThreadRuntime> {
155
155
  set adapter(adapter: ChatModelAdapter);
156
156
  registerModelConfigProvider(provider: ModelConfigProvider): () => void;
157
157
  switchToThread(threadId: string | null): LocalThreadRuntime;
158
+ reset({ initialMessages, }?: {
159
+ initialMessages?: readonly CoreMessage[] | undefined;
160
+ }): void;
158
161
  }
159
162
 
160
163
  declare const useLocalRuntime: (adapter: ChatModelAdapter, options?: LocalRuntimeOptions) => LocalRuntime;
@@ -442,6 +445,7 @@ type AssistantToolUIsState = Readonly<{
442
445
  type AssistantContextValue = {
443
446
  useModelConfig: ReadonlyStore<AssistantModelConfigState>;
444
447
  useToolUIs: ReadonlyStore<AssistantToolUIsState>;
448
+ useAssistantRuntime: ReadonlyStore<AssistantRuntime>;
445
449
  useAssistantActions: ReadonlyStore<AssistantActionsState>;
446
450
  };
447
451
  declare function useAssistantContext(): AssistantContextValue;
package/dist/index.js CHANGED
@@ -1298,6 +1298,19 @@ var LocalRuntime = class extends BaseAssistantRuntime {
1298
1298
  this.thread.adapter
1299
1299
  );
1300
1300
  }
1301
+ reset({
1302
+ initialMessages
1303
+ } = {}) {
1304
+ this.switchToThread(null);
1305
+ if (!initialMessages) return;
1306
+ const messages = fromCoreMessages(initialMessages);
1307
+ this.thread.import({
1308
+ messages: messages.map((m, idx) => ({
1309
+ parentId: _nullishCoalesce(_optionalChain([messages, 'access', _52 => _52[idx - 1], 'optionalAccess', _53 => _53.id]), () => ( null)),
1310
+ message: m
1311
+ }))
1312
+ });
1313
+ }
1301
1314
  };
1302
1315
 
1303
1316
  // src/runtimes/local/useLocalRuntime.tsx
@@ -1415,7 +1428,7 @@ var getThreadMessageText = (message) => {
1415
1428
 
1416
1429
  // src/runtimes/external-store/ExternalStoreThreadRuntime.tsx
1417
1430
  var hasUpcomingMessage = (isRunning, messages) => {
1418
- return isRunning && _optionalChain([messages, 'access', _52 => _52[messages.length - 1], 'optionalAccess', _53 => _53.role]) !== "assistant";
1431
+ return isRunning && _optionalChain([messages, 'access', _54 => _54[messages.length - 1], 'optionalAccess', _55 => _55.role]) !== "assistant";
1419
1432
  };
1420
1433
  var ExternalStoreThreadRuntime = (_class7 = class {
1421
1434
  __init18() {this._subscriptions = /* @__PURE__ */ new Set()}
@@ -1483,7 +1496,7 @@ var ExternalStoreThreadRuntime = (_class7 = class {
1483
1496
  for (let i = 0; i < messages.length; i++) {
1484
1497
  const message = messages[i];
1485
1498
  const parent = messages[i - 1];
1486
- this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _57 => _57.id]), () => ( null)), message);
1499
+ this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _59 => _59.id]), () => ( null)), message);
1487
1500
  }
1488
1501
  if (this.assistantOptimisticId) {
1489
1502
  this.repository.deleteMessage(this.assistantOptimisticId);
@@ -1491,7 +1504,7 @@ var ExternalStoreThreadRuntime = (_class7 = class {
1491
1504
  }
1492
1505
  if (hasUpcomingMessage(isRunning, messages)) {
1493
1506
  this.assistantOptimisticId = this.repository.appendOptimisticMessage(
1494
- _nullishCoalesce(_optionalChain([messages, 'access', _58 => _58.at, 'call', _59 => _59(-1), 'optionalAccess', _60 => _60.id]), () => ( null)),
1507
+ _nullishCoalesce(_optionalChain([messages, 'access', _60 => _60.at, 'call', _61 => _61(-1), 'optionalAccess', _62 => _62.id]), () => ( null)),
1495
1508
  {
1496
1509
  role: "assistant",
1497
1510
  content: []
@@ -1499,7 +1512,7 @@ var ExternalStoreThreadRuntime = (_class7 = class {
1499
1512
  );
1500
1513
  }
1501
1514
  this.repository.resetHead(
1502
- _nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages, 'access', _61 => _61.at, 'call', _62 => _62(-1), 'optionalAccess', _63 => _63.id]))), () => ( null))
1515
+ _nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages, 'access', _63 => _63.at, 'call', _64 => _64(-1), 'optionalAccess', _65 => _65.id]))), () => ( null))
1503
1516
  );
1504
1517
  this.messages = this.repository.getMessages();
1505
1518
  this.notifySubscribers();
@@ -1517,7 +1530,7 @@ var ExternalStoreThreadRuntime = (_class7 = class {
1517
1530
  this.updateMessages(this.repository.getMessages());
1518
1531
  }
1519
1532
  async append(message) {
1520
- if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _64 => _64.messages, 'access', _65 => _65.at, 'call', _66 => _66(-1), 'optionalAccess', _67 => _67.id]), () => ( null)))) {
1533
+ if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _66 => _66.messages, 'access', _67 => _67.at, 'call', _68 => _68(-1), 'optionalAccess', _69 => _69.id]), () => ( null)))) {
1521
1534
  if (!this._store.onEdit)
1522
1535
  throw new Error("Runtime does not support editing messages.");
1523
1536
  await this._store.onEdit(message);
@@ -1540,7 +1553,7 @@ var ExternalStoreThreadRuntime = (_class7 = class {
1540
1553
  }
1541
1554
  let messages = this.repository.getMessages();
1542
1555
  const previousMessage = messages[messages.length - 1];
1543
- if (_optionalChain([previousMessage, 'optionalAccess', _68 => _68.role]) === "user" && previousMessage.id === _optionalChain([messages, 'access', _69 => _69.at, 'call', _70 => _70(-1), 'optionalAccess', _71 => _71.id])) {
1556
+ if (_optionalChain([previousMessage, 'optionalAccess', _70 => _70.role]) === "user" && previousMessage.id === _optionalChain([messages, 'access', _71 => _71.at, 'call', _72 => _72(-1), 'optionalAccess', _73 => _73.id])) {
1544
1557
  this.repository.deleteMessage(previousMessage.id);
1545
1558
  if (!this.composer.text.trim()) {
1546
1559
  this.composer.setText(getThreadMessageText(previousMessage));
@@ -1558,7 +1571,7 @@ var ExternalStoreThreadRuntime = (_class7 = class {
1558
1571
  return () => this._subscriptions.delete(callback);
1559
1572
  }
1560
1573
  __init26() {this.updateMessages = (messages) => {
1561
- _optionalChain([this, 'access', _72 => _72._store, 'access', _73 => _73.setMessages, 'optionalCall', _74 => _74(
1574
+ _optionalChain([this, 'access', _74 => _74._store, 'access', _75 => _75.setMessages, 'optionalCall', _76 => _76(
1562
1575
  messages.flatMap(getExternalStoreMessage).filter((m) => m != null)
1563
1576
  )]);
1564
1577
  }}
@@ -1723,6 +1736,12 @@ var makeAssistantActionsStore = (runtimeRef) => _zustand.create.call(void 0,
1723
1736
  })
1724
1737
  );
1725
1738
 
1739
+ // src/context/stores/AssistantRuntime.tsx
1740
+
1741
+ var makeAssistantRuntimeStore = (runtime) => {
1742
+ return _zustand.create.call(void 0, () => runtime);
1743
+ };
1744
+
1726
1745
  // src/context/providers/AssistantProvider.tsx
1727
1746
 
1728
1747
  var AssistantProvider = ({ children, runtime }) => {
@@ -1731,15 +1750,25 @@ var AssistantProvider = ({ children, runtime }) => {
1731
1750
  runtimeRef.current = runtime;
1732
1751
  });
1733
1752
  const [context] = _react.useState.call(void 0, () => {
1753
+ const useAssistantRuntime = makeAssistantRuntimeStore(runtime);
1734
1754
  const useModelConfig = makeAssistantModelConfigStore();
1735
1755
  const useToolUIs = makeAssistantToolUIsStore();
1736
1756
  const useAssistantActions = makeAssistantActionsStore(runtimeRef);
1737
- return { useModelConfig, useToolUIs, useAssistantActions };
1757
+ return {
1758
+ useModelConfig,
1759
+ useToolUIs,
1760
+ useAssistantRuntime,
1761
+ useAssistantActions
1762
+ };
1738
1763
  });
1739
1764
  const getModelConfig = context.useModelConfig();
1740
1765
  _react.useEffect.call(void 0, () => {
1741
1766
  return runtime.registerModelConfigProvider(getModelConfig);
1742
1767
  }, [runtime, getModelConfig]);
1768
+ _react.useEffect.call(void 0,
1769
+ () => context.useAssistantRuntime.setState(runtime, true),
1770
+ [runtime, context]
1771
+ );
1743
1772
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssistantContext.Provider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadProvider, { provider: runtime, children }) });
1744
1773
  };
1745
1774
 
@@ -1758,7 +1787,7 @@ var AssistantRuntimeProvider = _react.memo.call(void 0, AssistantRuntimeProvider
1758
1787
  var MessageContext = _react.createContext.call(void 0, null);
1759
1788
  function useMessageContext(options) {
1760
1789
  const context = _react.useContext.call(void 0, MessageContext);
1761
- if (!_optionalChain([options, 'optionalAccess', _75 => _75.optional]) && !context)
1790
+ if (!_optionalChain([options, 'optionalAccess', _77 => _77.optional]) && !context)
1762
1791
  throw new Error(
1763
1792
  "This component can only be used inside a component passed to <ThreadPrimitive.Messages components={...} />."
1764
1793
  );
@@ -1785,7 +1814,7 @@ var ContentPartContext = _react.createContext.call(void 0,
1785
1814
  );
1786
1815
  function useContentPartContext(options) {
1787
1816
  const context = _react.useContext.call(void 0, ContentPartContext);
1788
- if (!_optionalChain([options, 'optionalAccess', _76 => _76.optional]) && !context)
1817
+ if (!_optionalChain([options, 'optionalAccess', _78 => _78.optional]) && !context)
1789
1818
  throw new Error(
1790
1819
  "This component can only be used inside a component passed to <MessagePrimitive.Content components={...} >."
1791
1820
  );
@@ -1797,13 +1826,13 @@ function useContentPartContext(options) {
1797
1826
  var toAppendMessage = (useThreadMessages, message) => {
1798
1827
  if (typeof message === "string") {
1799
1828
  return {
1800
- parentId: _nullishCoalesce(_optionalChain([useThreadMessages, 'access', _77 => _77.getState, 'call', _78 => _78(), 'access', _79 => _79.at, 'call', _80 => _80(-1), 'optionalAccess', _81 => _81.id]), () => ( null)),
1829
+ parentId: _nullishCoalesce(_optionalChain([useThreadMessages, 'access', _79 => _79.getState, 'call', _80 => _80(), 'access', _81 => _81.at, 'call', _82 => _82(-1), 'optionalAccess', _83 => _83.id]), () => ( null)),
1801
1830
  role: "user",
1802
1831
  content: [{ type: "text", text: message }]
1803
1832
  };
1804
1833
  }
1805
1834
  return {
1806
- parentId: _nullishCoalesce(_nullishCoalesce(message.parentId, () => ( _optionalChain([useThreadMessages, 'access', _82 => _82.getState, 'call', _83 => _83(), 'access', _84 => _84.at, 'call', _85 => _85(-1), 'optionalAccess', _86 => _86.id]))), () => ( null)),
1835
+ parentId: _nullishCoalesce(_nullishCoalesce(message.parentId, () => ( _optionalChain([useThreadMessages, 'access', _84 => _84.getState, 'call', _85 => _85(), 'access', _86 => _86.at, 'call', _87 => _87(-1), 'optionalAccess', _88 => _88.id]))), () => ( null)),
1807
1836
  role: _nullishCoalesce(message.role, () => ( "user")),
1808
1837
  content: message.content
1809
1838
  };
@@ -1855,7 +1884,7 @@ var useAssistantTool = (tool) => {
1855
1884
  const unsub2 = render ? setToolUI(toolName, render) : void 0;
1856
1885
  return () => {
1857
1886
  unsub1();
1858
- _optionalChain([unsub2, 'optionalCall', _87 => _87()]);
1887
+ _optionalChain([unsub2, 'optionalCall', _89 => _89()]);
1859
1888
  };
1860
1889
  }, [registerModelConfigProvider, setToolUI, tool]);
1861
1890
  };
@@ -2284,7 +2313,7 @@ var createActionButton = (displayName, useActionButton, forwardProps = []) => {
2284
2313
  ...primitiveProps,
2285
2314
  ref: forwardedRef,
2286
2315
  onClick: _primitive.composeEventHandlers.call(void 0, primitiveProps.onClick, () => {
2287
- _optionalChain([callback, 'optionalCall', _88 => _88()]);
2316
+ _optionalChain([callback, 'optionalCall', _90 => _90()]);
2288
2317
  })
2289
2318
  }
2290
2319
  );
@@ -2592,7 +2621,7 @@ var getContentPartState = ({ message }, useContentPart, partIndex) => {
2592
2621
  }
2593
2622
  }
2594
2623
  const status = toContentPartStatus(message, partIndex, part);
2595
- const currentState = _optionalChain([useContentPart, 'optionalAccess', _89 => _89.getState, 'call', _90 => _90()]);
2624
+ const currentState = _optionalChain([useContentPart, 'optionalAccess', _91 => _91.getState, 'call', _92 => _92()]);
2596
2625
  if (currentState && currentState.part === part && currentState.status === status)
2597
2626
  return null;
2598
2627
  return Object.freeze({ part, status });
@@ -2740,7 +2769,7 @@ var MessageContentPartImpl = ({
2740
2769
  };
2741
2770
  var MessageContentPart = _react.memo.call(void 0,
2742
2771
  MessageContentPartImpl,
2743
- (prev, next) => prev.partIndex === next.partIndex && _optionalChain([prev, 'access', _91 => _91.components, 'optionalAccess', _92 => _92.Text]) === _optionalChain([next, 'access', _93 => _93.components, 'optionalAccess', _94 => _94.Text]) && _optionalChain([prev, 'access', _95 => _95.components, 'optionalAccess', _96 => _96.Image]) === _optionalChain([next, 'access', _97 => _97.components, 'optionalAccess', _98 => _98.Image]) && _optionalChain([prev, 'access', _99 => _99.components, 'optionalAccess', _100 => _100.UI]) === _optionalChain([next, 'access', _101 => _101.components, 'optionalAccess', _102 => _102.UI]) && _optionalChain([prev, 'access', _103 => _103.components, 'optionalAccess', _104 => _104.tools]) === _optionalChain([next, 'access', _105 => _105.components, 'optionalAccess', _106 => _106.tools])
2772
+ (prev, next) => prev.partIndex === next.partIndex && _optionalChain([prev, 'access', _93 => _93.components, 'optionalAccess', _94 => _94.Text]) === _optionalChain([next, 'access', _95 => _95.components, 'optionalAccess', _96 => _96.Text]) && _optionalChain([prev, 'access', _97 => _97.components, 'optionalAccess', _98 => _98.Image]) === _optionalChain([next, 'access', _99 => _99.components, 'optionalAccess', _100 => _100.Image]) && _optionalChain([prev, 'access', _101 => _101.components, 'optionalAccess', _102 => _102.UI]) === _optionalChain([next, 'access', _103 => _103.components, 'optionalAccess', _104 => _104.UI]) && _optionalChain([prev, 'access', _105 => _105.components, 'optionalAccess', _106 => _106.tools]) === _optionalChain([next, 'access', _107 => _107.components, 'optionalAccess', _108 => _108.tools])
2744
2773
  );
2745
2774
  var MessagePrimitiveContent = ({
2746
2775
  components
@@ -2855,7 +2884,7 @@ var ComposerPrimitiveInput = _react.forwardRef.call(void 0,
2855
2884
  const { isRunning } = useThread.getState();
2856
2885
  if (!isRunning) {
2857
2886
  e.preventDefault();
2858
- _optionalChain([textareaRef, 'access', _107 => _107.current, 'optionalAccess', _108 => _108.closest, 'call', _109 => _109("form"), 'optionalAccess', _110 => _110.requestSubmit, 'call', _111 => _111()]);
2887
+ _optionalChain([textareaRef, 'access', _109 => _109.current, 'optionalAccess', _110 => _110.closest, 'call', _111 => _111("form"), 'optionalAccess', _112 => _112.requestSubmit, 'call', _113 => _113()]);
2859
2888
  }
2860
2889
  }
2861
2890
  };
@@ -3158,15 +3187,15 @@ var makeMessageUtilsStore = () => _zustand.create.call(void 0, (set) => ({
3158
3187
  // src/context/providers/MessageProvider.tsx
3159
3188
 
3160
3189
  var getIsLast = (messages, message) => {
3161
- return _optionalChain([messages, 'access', _112 => _112[messages.length - 1], 'optionalAccess', _113 => _113.id]) === message.id;
3190
+ return _optionalChain([messages, 'access', _114 => _114[messages.length - 1], 'optionalAccess', _115 => _115.id]) === message.id;
3162
3191
  };
3163
3192
  var getMessageState = (messages, getBranches, useMessage, messageIndex) => {
3164
- const parentId = _nullishCoalesce(_optionalChain([messages, 'access', _114 => _114[messageIndex - 1], 'optionalAccess', _115 => _115.id]), () => ( null));
3193
+ const parentId = _nullishCoalesce(_optionalChain([messages, 'access', _116 => _116[messageIndex - 1], 'optionalAccess', _117 => _117.id]), () => ( null));
3165
3194
  const message = messages[messageIndex];
3166
3195
  if (!message) return null;
3167
3196
  const isLast = getIsLast(messages, message);
3168
3197
  const branches = getBranches(message.id);
3169
- const currentState = _optionalChain([useMessage, 'optionalAccess', _116 => _116.getState, 'call', _117 => _117()]);
3198
+ const currentState = _optionalChain([useMessage, 'optionalAccess', _118 => _118.getState, 'call', _119 => _119()]);
3170
3199
  if (currentState && currentState.message === message && currentState.parentId === parentId && currentState.branches === branches && currentState.isLast === isLast)
3171
3200
  return null;
3172
3201
  return Object.freeze({
@@ -3293,7 +3322,7 @@ var ThreadPrimitiveMessagesImpl = ({
3293
3322
  ThreadPrimitiveMessagesImpl.displayName = "ThreadPrimitive.Messages";
3294
3323
  var ThreadPrimitiveMessages = _react.memo.call(void 0,
3295
3324
  ThreadPrimitiveMessagesImpl,
3296
- (prev, next) => _optionalChain([prev, 'access', _118 => _118.components, 'optionalAccess', _119 => _119.Message]) === _optionalChain([next, 'access', _120 => _120.components, 'optionalAccess', _121 => _121.Message]) && _optionalChain([prev, 'access', _122 => _122.components, 'optionalAccess', _123 => _123.UserMessage]) === _optionalChain([next, 'access', _124 => _124.components, 'optionalAccess', _125 => _125.UserMessage]) && _optionalChain([prev, 'access', _126 => _126.components, 'optionalAccess', _127 => _127.EditComposer]) === _optionalChain([next, 'access', _128 => _128.components, 'optionalAccess', _129 => _129.EditComposer]) && _optionalChain([prev, 'access', _130 => _130.components, 'optionalAccess', _131 => _131.AssistantMessage]) === _optionalChain([next, 'access', _132 => _132.components, 'optionalAccess', _133 => _133.AssistantMessage]) && _optionalChain([prev, 'access', _134 => _134.components, 'optionalAccess', _135 => _135.SystemMessage]) === _optionalChain([next, 'access', _136 => _136.components, 'optionalAccess', _137 => _137.SystemMessage])
3325
+ (prev, next) => _optionalChain([prev, 'access', _120 => _120.components, 'optionalAccess', _121 => _121.Message]) === _optionalChain([next, 'access', _122 => _122.components, 'optionalAccess', _123 => _123.Message]) && _optionalChain([prev, 'access', _124 => _124.components, 'optionalAccess', _125 => _125.UserMessage]) === _optionalChain([next, 'access', _126 => _126.components, 'optionalAccess', _127 => _127.UserMessage]) && _optionalChain([prev, 'access', _128 => _128.components, 'optionalAccess', _129 => _129.EditComposer]) === _optionalChain([next, 'access', _130 => _130.components, 'optionalAccess', _131 => _131.EditComposer]) && _optionalChain([prev, 'access', _132 => _132.components, 'optionalAccess', _133 => _133.AssistantMessage]) === _optionalChain([next, 'access', _134 => _134.components, 'optionalAccess', _135 => _135.AssistantMessage]) && _optionalChain([prev, 'access', _136 => _136.components, 'optionalAccess', _137 => _137.SystemMessage]) === _optionalChain([next, 'access', _138 => _138.components, 'optionalAccess', _139 => _139.SystemMessage])
3297
3326
  );
3298
3327
 
3299
3328
  // src/primitives/thread/ThreadScrollToBottom.tsx
@@ -3325,7 +3354,7 @@ var ThreadConfigProvider = ({
3325
3354
  }) => {
3326
3355
  const assistant = useAssistantContext({ optional: true });
3327
3356
  const configProvider = config && Object.keys(_nullishCoalesce(config, () => ( {}))).length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
3328
- if (!_optionalChain([config, 'optionalAccess', _138 => _138.runtime])) return configProvider;
3357
+ if (!_optionalChain([config, 'optionalAccess', _140 => _140.runtime])) return configProvider;
3329
3358
  if (assistant) {
3330
3359
  throw new Error(
3331
3360
  "You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
@@ -3541,7 +3570,7 @@ var AssistantMessageContent = _react.forwardRef.call(void 0, ({ components: comp
3541
3570
  {
3542
3571
  components: {
3543
3572
  ...componentsProp,
3544
- Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _139 => _139.Text]), () => ( components.Text)), () => ( content_part_default.Text))
3573
+ Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _141 => _141.Text]), () => ( components.Text)), () => ( content_part_default.Text))
3545
3574
  }
3546
3575
  }
3547
3576
  ) });
@@ -3718,7 +3747,7 @@ var ThreadWelcomeSuggestion = ({
3718
3747
  };
3719
3748
  var ThreadWelcomeSuggestions = () => {
3720
3749
  const { welcome: { suggestions } = {} } = useThreadConfig();
3721
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([suggestions, 'optionalAccess', _140 => _140.map, 'call', _141 => _141((suggestion, idx) => {
3750
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([suggestions, 'optionalAccess', _142 => _142.map, 'call', _143 => _143((suggestion, idx) => {
3722
3751
  const key = `${suggestion.prompt}-${idx}`;
3723
3752
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestion, { suggestion }, key);
3724
3753
  })]) });
@@ -3796,7 +3825,7 @@ var UserMessageContent = _react.forwardRef.call(void 0,
3796
3825
  {
3797
3826
  components: {
3798
3827
  ...components,
3799
- Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _142 => _142.Text]), () => ( content_part_default.Text))
3828
+ Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _144 => _144.Text]), () => ( content_part_default.Text))
3800
3829
  }
3801
3830
  }
3802
3831
  ) });
@@ -3898,10 +3927,10 @@ var ThreadMessages = ({ components, ...rest }) => {
3898
3927
  thread_exports.Messages,
3899
3928
  {
3900
3929
  components: {
3901
- UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _143 => _143.UserMessage]), () => ( user_message_default)),
3902
- EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _144 => _144.EditComposer]), () => ( edit_composer_default)),
3903
- AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _145 => _145.AssistantMessage]), () => ( assistant_message_default)),
3904
- SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _146 => _146.SystemMessage]), () => ( SystemMessage))
3930
+ UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _145 => _145.UserMessage]), () => ( user_message_default)),
3931
+ EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _146 => _146.EditComposer]), () => ( edit_composer_default)),
3932
+ AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _147 => _147.AssistantMessage]), () => ( assistant_message_default)),
3933
+ SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _148 => _148.SystemMessage]), () => ( SystemMessage))
3905
3934
  },
3906
3935
  ...rest
3907
3936
  }