@assistant-ui/react 0.5.83 → 0.5.84

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -464,22 +464,20 @@ var useSwitchToNewThread = () => {
464
464
  var useAssistantTool = (tool) => {
465
465
  const assistantRuntime = useAssistantRuntime();
466
466
  const toolUIsStore = useToolUIsStore();
467
+ _react.useEffect.call(void 0, () => {
468
+ return tool.render ? toolUIsStore.getState().setToolUI(tool.toolName, tool.render) : void 0;
469
+ }, [toolUIsStore, tool.toolName, tool.render]);
467
470
  _react.useEffect.call(void 0, () => {
468
471
  const { toolName, render, ...rest } = tool;
469
472
  const config = {
470
473
  tools: {
471
- [tool.toolName]: rest
474
+ [toolName]: rest
472
475
  }
473
476
  };
474
- const unsub1 = assistantRuntime.registerModelConfigProvider({
477
+ return assistantRuntime.registerModelConfigProvider({
475
478
  getModelConfig: () => config
476
479
  });
477
- const unsub2 = render ? toolUIsStore.getState().setToolUI(toolName, render) : void 0;
478
- return () => {
479
- unsub1();
480
- _optionalChain([unsub2, 'optionalCall', _10 => _10()]);
481
- };
482
- }, [assistantRuntime, toolUIsStore, tool]);
480
+ }, [assistantRuntime, tool]);
483
481
  };
484
482
 
485
483
  // src/model-config/makeAssistantTool.tsx
@@ -498,9 +496,8 @@ var useAssistantToolUI = (tool) => {
498
496
  const toolUIsStore = useToolUIsStore();
499
497
  _react.useEffect.call(void 0, () => {
500
498
  if (!tool) return;
501
- const { toolName, render } = tool;
502
- return toolUIsStore.getState().setToolUI(toolName, render);
503
- }, [toolUIsStore, tool]);
499
+ return toolUIsStore.getState().setToolUI(tool.toolName, tool.render);
500
+ }, [toolUIsStore, _optionalChain([tool, 'optionalAccess', _10 => _10.toolName]), _optionalChain([tool, 'optionalAccess', _11 => _11.render])]);
504
501
  };
505
502
 
506
503
  // src/model-config/makeAssistantToolUI.tsx
@@ -527,6 +524,20 @@ var useAssistantInstructions = (instruction) => {
527
524
  }, [assistantRuntime, instruction]);
528
525
  };
529
526
 
527
+ // src/model-config/useInlineRender.tsx
528
+
529
+
530
+ var useInlineRender = (toolUI) => {
531
+ const [useToolUI] = _react.useState.call(void 0, () => _zustand.create.call(void 0, () => toolUI));
532
+ _react.useEffect.call(void 0, () => {
533
+ useToolUI.setState(toolUI);
534
+ });
535
+ return _react.useCallback.call(void 0, (args) => {
536
+ const toolUI2 = useToolUI();
537
+ return toolUI2(args);
538
+ }, []);
539
+ };
540
+
530
541
  // src/primitive-hooks/actionBar/useActionBarCopy.tsx
531
542
 
532
543
  var useActionBarCopy = ({
@@ -739,7 +750,7 @@ var useComposerAddAttachment = () => {
739
750
  input.accept = attachmentAccept;
740
751
  }
741
752
  input.onchange = (e) => {
742
- const file = _optionalChain([e, 'access', _11 => _11.target, 'access', _12 => _12.files, 'optionalAccess', _13 => _13[0]]);
753
+ const file = _optionalChain([e, 'access', _12 => _12.target, 'access', _13 => _13.files, 'optionalAccess', _14 => _14[0]]);
743
754
  if (!file) return;
744
755
  composerRuntime.addAttachment(file);
745
756
  };
@@ -815,7 +826,7 @@ var useMessageIf = (props) => {
815
826
  return false;
816
827
  if (props.hasContent === true && content.length === 0) return false;
817
828
  if (props.hasContent === false && content.length > 0) return false;
818
- if (props.submittedFeedback !== void 0 && (_nullishCoalesce(_optionalChain([submittedFeedback, 'optionalAccess', _14 => _14.type]), () => ( null))) !== props.submittedFeedback)
829
+ if (props.submittedFeedback !== void 0 && (_nullishCoalesce(_optionalChain([submittedFeedback, 'optionalAccess', _15 => _15.type]), () => ( null))) !== props.submittedFeedback)
819
830
  return false;
820
831
  return true;
821
832
  }
@@ -949,7 +960,7 @@ var ActionBarPrimitiveCopy = _react.forwardRef.call(void 0, ({ copiedDuration, o
949
960
  ref: forwardedRef,
950
961
  disabled: disabled || !callback,
951
962
  onClick: _primitive.composeEventHandlers.call(void 0, onClick, () => {
952
- _optionalChain([callback, 'optionalCall', _15 => _15()]);
963
+ _optionalChain([callback, 'optionalCall', _16 => _16()]);
953
964
  })
954
965
  }
955
966
  );
@@ -981,7 +992,7 @@ var createActionButton = (displayName, useActionButton, forwardProps = []) => {
981
992
  ref: forwardedRef,
982
993
  disabled: primitiveProps.disabled || !callback,
983
994
  onClick: _primitive.composeEventHandlers.call(void 0, primitiveProps.onClick, () => {
984
- _optionalChain([callback, 'optionalCall', _16 => _16()]);
995
+ _optionalChain([callback, 'optionalCall', _17 => _17()]);
985
996
  })
986
997
  }
987
998
  );
@@ -1030,7 +1041,7 @@ var ActionBarPrimitiveStopSpeaking = _react.forwardRef.call(void 0, (props, ref)
1030
1041
  ...props,
1031
1042
  ref,
1032
1043
  onClick: _primitive.composeEventHandlers.call(void 0, props.onClick, () => {
1033
- _optionalChain([callback, 'optionalCall', _17 => _17()]);
1044
+ _optionalChain([callback, 'optionalCall', _18 => _18()]);
1034
1045
  })
1035
1046
  }
1036
1047
  );
@@ -1044,7 +1055,7 @@ ActionBarPrimitiveStopSpeaking.displayName = "ActionBarPrimitive.StopSpeaking";
1044
1055
 
1045
1056
  var ActionBarPrimitiveFeedbackPositive = _react.forwardRef.call(void 0, ({ onClick, disabled, ...props }, forwardedRef) => {
1046
1057
  const isSubmitted = useMessage(
1047
- (u) => _optionalChain([u, 'access', _18 => _18.submittedFeedback, 'optionalAccess', _19 => _19.type]) === "positive"
1058
+ (u) => _optionalChain([u, 'access', _19 => _19.submittedFeedback, 'optionalAccess', _20 => _20.type]) === "positive"
1048
1059
  );
1049
1060
  const callback = useActionBarFeedbackPositive();
1050
1061
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1056,7 +1067,7 @@ var ActionBarPrimitiveFeedbackPositive = _react.forwardRef.call(void 0, ({ onCli
1056
1067
  ref: forwardedRef,
1057
1068
  disabled: disabled || !callback,
1058
1069
  onClick: _primitive.composeEventHandlers.call(void 0, onClick, () => {
1059
- _optionalChain([callback, 'optionalCall', _20 => _20()]);
1070
+ _optionalChain([callback, 'optionalCall', _21 => _21()]);
1060
1071
  })
1061
1072
  }
1062
1073
  );
@@ -1070,7 +1081,7 @@ ActionBarPrimitiveFeedbackPositive.displayName = "ActionBarPrimitive.FeedbackPos
1070
1081
 
1071
1082
  var ActionBarPrimitiveFeedbackNegative = _react.forwardRef.call(void 0, ({ onClick, disabled, ...props }, forwardedRef) => {
1072
1083
  const isSubmitted = useMessage(
1073
- (u) => _optionalChain([u, 'access', _21 => _21.submittedFeedback, 'optionalAccess', _22 => _22.type]) === "negative"
1084
+ (u) => _optionalChain([u, 'access', _22 => _22.submittedFeedback, 'optionalAccess', _23 => _23.type]) === "negative"
1074
1085
  );
1075
1086
  const callback = useActionBarFeedbackNegative();
1076
1087
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1082,7 +1093,7 @@ var ActionBarPrimitiveFeedbackNegative = _react.forwardRef.call(void 0, ({ onCli
1082
1093
  ref: forwardedRef,
1083
1094
  disabled: disabled || !callback,
1084
1095
  onClick: _primitive.composeEventHandlers.call(void 0, onClick, () => {
1085
- _optionalChain([callback, 'optionalCall', _23 => _23()]);
1096
+ _optionalChain([callback, 'optionalCall', _24 => _24()]);
1086
1097
  })
1087
1098
  }
1088
1099
  );
@@ -1240,7 +1251,7 @@ var AttachmentContext = _react.createContext.call(void 0,
1240
1251
  );
1241
1252
  function useAttachmentContext(options) {
1242
1253
  const context = _react.useContext.call(void 0, AttachmentContext);
1243
- if (!_optionalChain([options, 'optionalAccess', _24 => _24.optional]) && !context)
1254
+ if (!_optionalChain([options, 'optionalAccess', _25 => _25.optional]) && !context)
1244
1255
  throw new Error(
1245
1256
  "This component must be used within a ComposerPrimitive.Attachments or MessagePrimitive.Attachments component."
1246
1257
  );
@@ -1521,7 +1532,7 @@ var withSmoothContextProvider = (Component) => {
1521
1532
  };
1522
1533
  function useSmoothContext(options) {
1523
1534
  const context = _react.useContext.call(void 0, SmoothContext);
1524
- if (!_optionalChain([options, 'optionalAccess', _25 => _25.optional]) && !context)
1535
+ if (!_optionalChain([options, 'optionalAccess', _26 => _26.optional]) && !context)
1525
1536
  throw new Error(
1526
1537
  "This component must be used within a SmoothContextProvider."
1527
1538
  );
@@ -1742,7 +1753,7 @@ var BaseSubject = (_class2 = class {constructor() { _class2.prototype.__init5.ca
1742
1753
  if (this._connection) return;
1743
1754
  this._connection = this._connect();
1744
1755
  } else {
1745
- _optionalChain([this, 'access', _26 => _26._connection, 'optionalCall', _27 => _27()]);
1756
+ _optionalChain([this, 'access', _27 => _27._connection, 'optionalCall', _28 => _28()]);
1746
1757
  this._connection = void 0;
1747
1758
  }
1748
1759
  }
@@ -1847,36 +1858,36 @@ var EMPTY_ARRAY = Object.freeze([]);
1847
1858
  var getThreadComposerState = (runtime) => {
1848
1859
  return Object.freeze({
1849
1860
  type: "thread",
1850
- isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _28 => _28.isEditing]), () => ( false)),
1851
- canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _29 => _29.canCancel]), () => ( false)),
1852
- isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _30 => _30.isEmpty]), () => ( true)),
1853
- text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _31 => _31.text]), () => ( "")),
1854
- attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _32 => _32.attachments]), () => ( EMPTY_ARRAY)),
1855
- value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _33 => _33.text]), () => ( "")),
1856
- setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _34 => _34.setText, 'access', _35 => _35.bind, 'call', _36 => _36(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1857
- setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _37 => _37.setText, 'access', _38 => _38.bind, 'call', _39 => _39(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1861
+ isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _29 => _29.isEditing]), () => ( false)),
1862
+ canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _30 => _30.canCancel]), () => ( false)),
1863
+ isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _31 => _31.isEmpty]), () => ( true)),
1864
+ text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _32 => _32.text]), () => ( "")),
1865
+ attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _33 => _33.attachments]), () => ( EMPTY_ARRAY)),
1866
+ value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _34 => _34.text]), () => ( "")),
1867
+ setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _35 => _35.setText, 'access', _36 => _36.bind, 'call', _37 => _37(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1868
+ setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _38 => _38.setText, 'access', _39 => _39.bind, 'call', _40 => _40(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1858
1869
  // edit: beginEdit,
1859
- send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _40 => _40.send, 'access', _41 => _41.bind, 'call', _42 => _42(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1860
- cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _43 => _43.cancel, 'access', _44 => _44.bind, 'call', _45 => _45(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1861
- reset: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _46 => _46.reset, 'access', _47 => _47.bind, 'call', _48 => _48(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1862
- addAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _49 => _49.addAttachment, 'access', _50 => _50.bind, 'call', _51 => _51(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1863
- removeAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _52 => _52.removeAttachment, 'access', _53 => _53.bind, 'call', _54 => _54(runtime)]), () => ( METHOD_NOT_SUPPORTED))
1870
+ send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _41 => _41.send, 'access', _42 => _42.bind, 'call', _43 => _43(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1871
+ cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _44 => _44.cancel, 'access', _45 => _45.bind, 'call', _46 => _46(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1872
+ reset: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _47 => _47.reset, 'access', _48 => _48.bind, 'call', _49 => _49(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1873
+ addAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _50 => _50.addAttachment, 'access', _51 => _51.bind, 'call', _52 => _52(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1874
+ removeAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _53 => _53.removeAttachment, 'access', _54 => _54.bind, 'call', _55 => _55(runtime)]), () => ( METHOD_NOT_SUPPORTED))
1864
1875
  });
1865
1876
  };
1866
1877
  var getEditComposerState = (runtime, beginEdit) => {
1867
1878
  return Object.freeze({
1868
1879
  type: "edit",
1869
- isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _55 => _55.isEditing]), () => ( false)),
1870
- canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _56 => _56.canCancel]), () => ( false)),
1871
- isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _57 => _57.isEmpty]), () => ( true)),
1872
- text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _58 => _58.text]), () => ( "")),
1873
- attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _59 => _59.attachments]), () => ( EMPTY_ARRAY)),
1874
- value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _60 => _60.text]), () => ( "")),
1875
- setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _61 => _61.setText, 'access', _62 => _62.bind, 'call', _63 => _63(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1876
- setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _64 => _64.setText, 'access', _65 => _65.bind, 'call', _66 => _66(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1880
+ isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _56 => _56.isEditing]), () => ( false)),
1881
+ canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _57 => _57.canCancel]), () => ( false)),
1882
+ isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _58 => _58.isEmpty]), () => ( true)),
1883
+ text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _59 => _59.text]), () => ( "")),
1884
+ attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _60 => _60.attachments]), () => ( EMPTY_ARRAY)),
1885
+ value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _61 => _61.text]), () => ( "")),
1886
+ setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _62 => _62.setText, 'access', _63 => _63.bind, 'call', _64 => _64(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1887
+ setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _65 => _65.setText, 'access', _66 => _66.bind, 'call', _67 => _67(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1877
1888
  edit: beginEdit,
1878
- send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _67 => _67.send, 'access', _68 => _68.bind, 'call', _69 => _69(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1879
- cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _70 => _70.cancel, 'access', _71 => _71.bind, 'call', _72 => _72(runtime)]), () => ( METHOD_NOT_SUPPORTED))
1889
+ send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _68 => _68.send, 'access', _69 => _69.bind, 'call', _70 => _70(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
1890
+ cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _71 => _71.cancel, 'access', _72 => _72.bind, 'call', _73 => _73(runtime)]), () => ( METHOD_NOT_SUPPORTED))
1880
1891
  });
1881
1892
  };
1882
1893
  var ComposerRuntimeImpl = class {
@@ -1992,7 +2003,7 @@ var ThreadComposerRuntimeImpl = class extends ComposerRuntimeImpl {
1992
2003
  this._getState = stateBinding.getState.bind(stateBinding);
1993
2004
  }
1994
2005
  get attachments() {
1995
- return _nullishCoalesce(_optionalChain([this, 'access', _73 => _73.getState, 'call', _74 => _74(), 'optionalAccess', _75 => _75.attachments]), () => ( EMPTY_ARRAY));
2006
+ return _nullishCoalesce(_optionalChain([this, 'access', _74 => _74.getState, 'call', _75 => _75(), 'optionalAccess', _76 => _76.attachments]), () => ( EMPTY_ARRAY));
1996
2007
  }
1997
2008
  getState() {
1998
2009
  return this._getState();
@@ -2102,19 +2113,19 @@ var NestedSubscriptionSubject = class extends BaseSubject {
2102
2113
  this.notifySubscribers();
2103
2114
  };
2104
2115
  let lastState = this.binding.getState();
2105
- let innerUnsubscribe = _optionalChain([lastState, 'optionalAccess', _76 => _76.subscribe, 'call', _77 => _77(callback)]);
2116
+ let innerUnsubscribe = _optionalChain([lastState, 'optionalAccess', _77 => _77.subscribe, 'call', _78 => _78(callback)]);
2106
2117
  const onRuntimeUpdate = () => {
2107
2118
  const newState = this.binding.getState();
2108
2119
  if (newState === lastState) return;
2109
2120
  lastState = newState;
2110
- _optionalChain([innerUnsubscribe, 'optionalCall', _78 => _78()]);
2111
- innerUnsubscribe = _optionalChain([this, 'access', _79 => _79.binding, 'access', _80 => _80.getState, 'call', _81 => _81(), 'optionalAccess', _82 => _82.subscribe, 'call', _83 => _83(callback)]);
2121
+ _optionalChain([innerUnsubscribe, 'optionalCall', _79 => _79()]);
2122
+ innerUnsubscribe = _optionalChain([this, 'access', _80 => _80.binding, 'access', _81 => _81.getState, 'call', _82 => _82(), 'optionalAccess', _83 => _83.subscribe, 'call', _84 => _84(callback)]);
2112
2123
  callback();
2113
2124
  };
2114
2125
  const outerUnsubscribe = this.outerSubscribe(onRuntimeUpdate);
2115
2126
  return () => {
2116
- _optionalChain([outerUnsubscribe, 'optionalCall', _84 => _84()]);
2117
- _optionalChain([innerUnsubscribe, 'optionalCall', _85 => _85()]);
2127
+ _optionalChain([outerUnsubscribe, 'optionalCall', _85 => _85()]);
2128
+ _optionalChain([innerUnsubscribe, 'optionalCall', _86 => _86()]);
2118
2129
  };
2119
2130
  }
2120
2131
  };
@@ -2193,7 +2204,7 @@ var MessageRuntimeImpl = class {
2193
2204
  const state = this._core.getState();
2194
2205
  if (!state) throw new Error("Message is not available");
2195
2206
  const thread = this._threadBinding.getState();
2196
- if (_optionalChain([thread, 'access', _86 => _86.speech, 'optionalAccess', _87 => _87.messageId]) === state.id) {
2207
+ if (_optionalChain([thread, 'access', _87 => _87.speech, 'optionalAccess', _88 => _88.messageId]) === state.id) {
2197
2208
  this._threadBinding.getState().stopSpeaking();
2198
2209
  } else {
2199
2210
  throw new Error("Message is not being spoken");
@@ -2286,7 +2297,7 @@ var MessageRuntimeImpl = class {
2286
2297
  },
2287
2298
  getState: () => {
2288
2299
  const attachments = this.getState().attachments;
2289
- const attachment = _optionalChain([attachments, 'optionalAccess', _88 => _88[idx]]);
2300
+ const attachment = _optionalChain([attachments, 'optionalAccess', _89 => _89[idx]]);
2290
2301
  if (!attachment) return SKIP_UPDATE;
2291
2302
  return {
2292
2303
  ...attachment,
@@ -2369,7 +2380,7 @@ var MessageContentPartImpl = ({
2369
2380
  };
2370
2381
  var MessageContentPart = _react.memo.call(void 0,
2371
2382
  MessageContentPartImpl,
2372
- (prev, next) => prev.partIndex === next.partIndex && _optionalChain([prev, 'access', _89 => _89.components, 'optionalAccess', _90 => _90.Text]) === _optionalChain([next, 'access', _91 => _91.components, 'optionalAccess', _92 => _92.Text]) && _optionalChain([prev, 'access', _93 => _93.components, 'optionalAccess', _94 => _94.Image]) === _optionalChain([next, 'access', _95 => _95.components, 'optionalAccess', _96 => _96.Image]) && _optionalChain([prev, 'access', _97 => _97.components, 'optionalAccess', _98 => _98.UI]) === _optionalChain([next, 'access', _99 => _99.components, 'optionalAccess', _100 => _100.UI]) && _optionalChain([prev, 'access', _101 => _101.components, 'optionalAccess', _102 => _102.tools]) === _optionalChain([next, 'access', _103 => _103.components, 'optionalAccess', _104 => _104.tools])
2383
+ (prev, next) => prev.partIndex === next.partIndex && _optionalChain([prev, 'access', _90 => _90.components, 'optionalAccess', _91 => _91.Text]) === _optionalChain([next, 'access', _92 => _92.components, 'optionalAccess', _93 => _93.Text]) && _optionalChain([prev, 'access', _94 => _94.components, 'optionalAccess', _95 => _95.Image]) === _optionalChain([next, 'access', _96 => _96.components, 'optionalAccess', _97 => _97.Image]) && _optionalChain([prev, 'access', _98 => _98.components, 'optionalAccess', _99 => _99.UI]) === _optionalChain([next, 'access', _100 => _100.components, 'optionalAccess', _101 => _101.UI]) && _optionalChain([prev, 'access', _102 => _102.components, 'optionalAccess', _103 => _103.tools]) === _optionalChain([next, 'access', _104 => _104.components, 'optionalAccess', _105 => _105.tools])
2373
2384
  );
2374
2385
  var MessagePrimitiveContent = ({
2375
2386
  components
@@ -2435,11 +2446,11 @@ var getComponent = (components, attachment) => {
2435
2446
  const type = attachment.type;
2436
2447
  switch (type) {
2437
2448
  case "image":
2438
- return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _105 => _105.Image]), () => ( _optionalChain([components, 'optionalAccess', _106 => _106.Attachment])));
2449
+ return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _106 => _106.Image]), () => ( _optionalChain([components, 'optionalAccess', _107 => _107.Attachment])));
2439
2450
  case "document":
2440
- return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _107 => _107.Document]), () => ( _optionalChain([components, 'optionalAccess', _108 => _108.Attachment])));
2451
+ return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _108 => _108.Document]), () => ( _optionalChain([components, 'optionalAccess', _109 => _109.Attachment])));
2441
2452
  case "file":
2442
- return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _109 => _109.File]), () => ( _optionalChain([components, 'optionalAccess', _110 => _110.Attachment])));
2453
+ return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _110 => _110.File]), () => ( _optionalChain([components, 'optionalAccess', _111 => _111.Attachment])));
2443
2454
  default:
2444
2455
  const _exhaustiveCheck = type;
2445
2456
  throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
@@ -2462,7 +2473,7 @@ var MessageAttachmentImpl = ({ components, attachmentIndex }) => {
2462
2473
  };
2463
2474
  var MessageAttachment = _react.memo.call(void 0,
2464
2475
  MessageAttachmentImpl,
2465
- (prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access', _111 => _111.components, 'optionalAccess', _112 => _112.Image]) === _optionalChain([next, 'access', _113 => _113.components, 'optionalAccess', _114 => _114.Image]) && _optionalChain([prev, 'access', _115 => _115.components, 'optionalAccess', _116 => _116.Document]) === _optionalChain([next, 'access', _117 => _117.components, 'optionalAccess', _118 => _118.Document]) && _optionalChain([prev, 'access', _119 => _119.components, 'optionalAccess', _120 => _120.File]) === _optionalChain([next, 'access', _121 => _121.components, 'optionalAccess', _122 => _122.File]) && _optionalChain([prev, 'access', _123 => _123.components, 'optionalAccess', _124 => _124.Attachment]) === _optionalChain([next, 'access', _125 => _125.components, 'optionalAccess', _126 => _126.Attachment])
2476
+ (prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access', _112 => _112.components, 'optionalAccess', _113 => _113.Image]) === _optionalChain([next, 'access', _114 => _114.components, 'optionalAccess', _115 => _115.Image]) && _optionalChain([prev, 'access', _116 => _116.components, 'optionalAccess', _117 => _117.Document]) === _optionalChain([next, 'access', _118 => _118.components, 'optionalAccess', _119 => _119.Document]) && _optionalChain([prev, 'access', _120 => _120.components, 'optionalAccess', _121 => _121.File]) === _optionalChain([next, 'access', _122 => _122.components, 'optionalAccess', _123 => _123.File]) && _optionalChain([prev, 'access', _124 => _124.components, 'optionalAccess', _125 => _125.Attachment]) === _optionalChain([next, 'access', _126 => _126.components, 'optionalAccess', _127 => _127.Attachment])
2466
2477
  );
2467
2478
  var MessagePrimitiveAttachments = ({ components }) => {
2468
2479
  const attachmentsCount = useMessage(({ message }) => {
@@ -2588,7 +2599,7 @@ var ComposerPrimitiveInput = _react.forwardRef.call(void 0,
2588
2599
  const { isRunning } = threadRuntime.getState();
2589
2600
  if (!isRunning) {
2590
2601
  e.preventDefault();
2591
- _optionalChain([textareaRef, 'access', _127 => _127.current, 'optionalAccess', _128 => _128.closest, 'call', _129 => _129("form"), 'optionalAccess', _130 => _130.requestSubmit, 'call', _131 => _131()]);
2602
+ _optionalChain([textareaRef, 'access', _128 => _128.current, 'optionalAccess', _129 => _129.closest, 'call', _130 => _130("form"), 'optionalAccess', _131 => _131.requestSubmit, 'call', _132 => _132()]);
2592
2603
  }
2593
2604
  }
2594
2605
  };
@@ -2662,11 +2673,11 @@ var getComponent2 = (components, attachment) => {
2662
2673
  const type = attachment.type;
2663
2674
  switch (type) {
2664
2675
  case "image":
2665
- return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _132 => _132.Image]), () => ( _optionalChain([components, 'optionalAccess', _133 => _133.Attachment])));
2676
+ return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _133 => _133.Image]), () => ( _optionalChain([components, 'optionalAccess', _134 => _134.Attachment])));
2666
2677
  case "document":
2667
- return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _134 => _134.Document]), () => ( _optionalChain([components, 'optionalAccess', _135 => _135.Attachment])));
2678
+ return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _135 => _135.Document]), () => ( _optionalChain([components, 'optionalAccess', _136 => _136.Attachment])));
2668
2679
  case "file":
2669
- return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _136 => _136.File]), () => ( _optionalChain([components, 'optionalAccess', _137 => _137.Attachment])));
2680
+ return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _137 => _137.File]), () => ( _optionalChain([components, 'optionalAccess', _138 => _138.Attachment])));
2670
2681
  default:
2671
2682
  const _exhaustiveCheck = type;
2672
2683
  throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
@@ -2689,7 +2700,7 @@ var ComposerAttachmentImpl = ({ components, attachmentIndex }) => {
2689
2700
  };
2690
2701
  var ComposerAttachment = _react.memo.call(void 0,
2691
2702
  ComposerAttachmentImpl,
2692
- (prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access', _138 => _138.components, 'optionalAccess', _139 => _139.Image]) === _optionalChain([next, 'access', _140 => _140.components, 'optionalAccess', _141 => _141.Image]) && _optionalChain([prev, 'access', _142 => _142.components, 'optionalAccess', _143 => _143.Document]) === _optionalChain([next, 'access', _144 => _144.components, 'optionalAccess', _145 => _145.Document]) && _optionalChain([prev, 'access', _146 => _146.components, 'optionalAccess', _147 => _147.File]) === _optionalChain([next, 'access', _148 => _148.components, 'optionalAccess', _149 => _149.File]) && _optionalChain([prev, 'access', _150 => _150.components, 'optionalAccess', _151 => _151.Attachment]) === _optionalChain([next, 'access', _152 => _152.components, 'optionalAccess', _153 => _153.Attachment])
2703
+ (prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access', _139 => _139.components, 'optionalAccess', _140 => _140.Image]) === _optionalChain([next, 'access', _141 => _141.components, 'optionalAccess', _142 => _142.Image]) && _optionalChain([prev, 'access', _143 => _143.components, 'optionalAccess', _144 => _144.Document]) === _optionalChain([next, 'access', _145 => _145.components, 'optionalAccess', _146 => _146.Document]) && _optionalChain([prev, 'access', _147 => _147.components, 'optionalAccess', _148 => _148.File]) === _optionalChain([next, 'access', _149 => _149.components, 'optionalAccess', _150 => _150.File]) && _optionalChain([prev, 'access', _151 => _151.components, 'optionalAccess', _152 => _152.Attachment]) === _optionalChain([next, 'access', _153 => _153.components, 'optionalAccess', _154 => _154.Attachment])
2693
2704
  );
2694
2705
  var ComposerPrimitiveAttachments = ({ components }) => {
2695
2706
  const attachmentsCount = useComposer((s) => s.attachments.length);
@@ -3033,7 +3044,7 @@ var subscribeToMainThread = (runtime, callback) => {
3033
3044
  let first = true;
3034
3045
  let cleanup;
3035
3046
  const inner = () => {
3036
- _optionalChain([cleanup, 'optionalCall', _154 => _154()]);
3047
+ _optionalChain([cleanup, 'optionalCall', _155 => _155()]);
3037
3048
  cleanup = runtime.threadManager.mainThread.subscribe(callback);
3038
3049
  if (!first) {
3039
3050
  callback();
@@ -3044,7 +3055,7 @@ var subscribeToMainThread = (runtime, callback) => {
3044
3055
  inner();
3045
3056
  return () => {
3046
3057
  unsubscribe();
3047
- _optionalChain([cleanup, 'optionalCall', _155 => _155()]);
3058
+ _optionalChain([cleanup, 'optionalCall', _156 => _156()]);
3048
3059
  };
3049
3060
  };
3050
3061
 
@@ -3059,13 +3070,13 @@ var ProxyConfigProvider = (_class5 = class {constructor() { _class5.prototype.__
3059
3070
  }
3060
3071
  registerModelConfigProvider(provider) {
3061
3072
  this._providers.add(provider);
3062
- const unsubscribe = _optionalChain([provider, 'access', _156 => _156.subscribe, 'optionalCall', _157 => _157(() => {
3073
+ const unsubscribe = _optionalChain([provider, 'access', _157 => _157.subscribe, 'optionalCall', _158 => _158(() => {
3063
3074
  this.notifySubscribers();
3064
3075
  })]);
3065
3076
  this.notifySubscribers();
3066
3077
  return () => {
3067
3078
  this._providers.delete(provider);
3068
- _optionalChain([unsubscribe, 'optionalCall', _158 => _158()]);
3079
+ _optionalChain([unsubscribe, 'optionalCall', _159 => _159()]);
3069
3080
  this.notifySubscribers();
3070
3081
  };
3071
3082
  }
@@ -3110,7 +3121,7 @@ var isAttachmentComplete = (a) => a.status.type === "complete";
3110
3121
  var BaseComposerRuntimeCore = (_class7 = class {constructor() { _class7.prototype.__init12.call(this);_class7.prototype.__init13.call(this);_class7.prototype.__init14.call(this);_class7.prototype.__init15.call(this); }
3111
3122
  __init12() {this.isEditing = true}
3112
3123
  getAttachmentAccept() {
3113
- return _nullishCoalesce(_optionalChain([this, 'access', _159 => _159.getAttachmentAdapter, 'call', _160 => _160(), 'optionalAccess', _161 => _161.accept]), () => ( "*"));
3124
+ return _nullishCoalesce(_optionalChain([this, 'access', _160 => _160.getAttachmentAdapter, 'call', _161 => _161(), 'optionalAccess', _162 => _162.accept]), () => ( "*"));
3114
3125
  }
3115
3126
  __init13() {this._attachments = []}
3116
3127
  set attachments(value) {
@@ -3142,7 +3153,7 @@ var BaseComposerRuntimeCore = (_class7 = class {constructor() { _class7.prototyp
3142
3153
  this.attachments.map(async (a) => {
3143
3154
  if (isAttachmentComplete(a)) return a;
3144
3155
  const result = await adapter.send(a);
3145
- if (_optionalChain([result, 'access', _162 => _162.status, 'optionalAccess', _163 => _163.type]) !== "complete") {
3156
+ if (_optionalChain([result, 'access', _163 => _163.status, 'optionalAccess', _164 => _164.type]) !== "complete") {
3146
3157
  result.status = { type: "complete" };
3147
3158
  }
3148
3159
  return result;
@@ -3201,7 +3212,7 @@ var DefaultThreadComposerRuntimeCore = (_class8 = class extends BaseComposerRunt
3201
3212
  return super.attachments;
3202
3213
  }
3203
3214
  getAttachmentAdapter() {
3204
- return _optionalChain([this, 'access', _164 => _164.runtime, 'access', _165 => _165.adapters, 'optionalAccess', _166 => _166.attachments]);
3215
+ return _optionalChain([this, 'access', _165 => _165.runtime, 'access', _166 => _166.adapters, 'optionalAccess', _167 => _167.attachments]);
3205
3216
  }
3206
3217
  connect() {
3207
3218
  return this.runtime.subscribe(() => {
@@ -3214,7 +3225,7 @@ var DefaultThreadComposerRuntimeCore = (_class8 = class extends BaseComposerRunt
3214
3225
  async handleSend(message) {
3215
3226
  this.runtime.append({
3216
3227
  ...message,
3217
- parentId: _nullishCoalesce(_optionalChain([this, 'access', _167 => _167.runtime, 'access', _168 => _168.messages, 'access', _169 => _169.at, 'call', _170 => _170(-1), 'optionalAccess', _171 => _171.id]), () => ( null))
3228
+ parentId: _nullishCoalesce(_optionalChain([this, 'access', _168 => _168.runtime, 'access', _169 => _169.messages, 'access', _170 => _170.at, 'call', _171 => _171(-1), 'optionalAccess', _172 => _172.id]), () => ( null))
3218
3229
  });
3219
3230
  }
3220
3231
  async cancel() {
@@ -3333,7 +3344,7 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
3333
3344
  }
3334
3345
  }
3335
3346
  getMessages() {
3336
- const messages2 = new Array(_nullishCoalesce(_optionalChain([this, 'access', _172 => _172.head, 'optionalAccess', _173 => _173.level]), () => ( 0)));
3347
+ const messages2 = new Array(_nullishCoalesce(_optionalChain([this, 'access', _173 => _173.head, 'optionalAccess', _174 => _174.level]), () => ( 0)));
3337
3348
  for (let current = this.head; current; current = current.prev) {
3338
3349
  messages2[current.level] = current.current;
3339
3350
  }
@@ -3371,7 +3382,7 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
3371
3382
  "MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui."
3372
3383
  );
3373
3384
  return {
3374
- parentId: _nullishCoalesce(_optionalChain([message, 'access', _174 => _174.prev, 'optionalAccess', _175 => _175.current, 'access', _176 => _176.id]), () => ( null)),
3385
+ parentId: _nullishCoalesce(_optionalChain([message, 'access', _175 => _175.prev, 'optionalAccess', _176 => _176.current, 'access', _177 => _177.id]), () => ( null)),
3375
3386
  message: message.current
3376
3387
  };
3377
3388
  }
@@ -3455,11 +3466,11 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
3455
3466
  for (const [, message] of this.messages) {
3456
3467
  exportItems.push({
3457
3468
  message: message.current,
3458
- parentId: _nullishCoalesce(_optionalChain([message, 'access', _177 => _177.prev, 'optionalAccess', _178 => _178.current, 'access', _179 => _179.id]), () => ( null))
3469
+ parentId: _nullishCoalesce(_optionalChain([message, 'access', _178 => _178.prev, 'optionalAccess', _179 => _179.current, 'access', _180 => _180.id]), () => ( null))
3459
3470
  });
3460
3471
  }
3461
3472
  return {
3462
- headId: _nullishCoalesce(_optionalChain([this, 'access', _180 => _180.head, 'optionalAccess', _181 => _181.current, 'access', _182 => _182.id]), () => ( null)),
3473
+ headId: _nullishCoalesce(_optionalChain([this, 'access', _181 => _181.head, 'optionalAccess', _182 => _182.current, 'access', _183 => _183.id]), () => ( null)),
3463
3474
  messages: exportItems
3464
3475
  };
3465
3476
  }
@@ -3467,7 +3478,7 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
3467
3478
  for (const { message, parentId } of messages2) {
3468
3479
  this.addOrUpdateMessage(parentId, message);
3469
3480
  }
3470
- this.resetHead(_nullishCoalesce(_nullishCoalesce(headId, () => ( _optionalChain([messages2, 'access', _183 => _183.at, 'call', _184 => _184(-1), 'optionalAccess', _185 => _185.message, 'access', _186 => _186.id]))), () => ( null)));
3481
+ this.resetHead(_nullishCoalesce(_nullishCoalesce(headId, () => ( _optionalChain([messages2, 'access', _184 => _184.at, 'call', _185 => _185(-1), 'optionalAccess', _186 => _186.message, 'access', _187 => _187.id]))), () => ( null)));
3471
3482
  }
3472
3483
  }, _class9);
3473
3484
 
@@ -3571,7 +3582,7 @@ TooltipIconButton.displayName = "TooltipIconButton";
3571
3582
  var toAppendMessage = (messages2, message) => {
3572
3583
  if (typeof message === "string") {
3573
3584
  return {
3574
- parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _187 => _187.at, 'call', _188 => _188(-1), 'optionalAccess', _189 => _189.id]), () => ( null)),
3585
+ parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _188 => _188.at, 'call', _189 => _189(-1), 'optionalAccess', _190 => _190.id]), () => ( null)),
3575
3586
  role: "user",
3576
3587
  content: [{ type: "text", text: message }],
3577
3588
  attachments: []
@@ -3581,7 +3592,7 @@ var toAppendMessage = (messages2, message) => {
3581
3592
  return message;
3582
3593
  }
3583
3594
  return {
3584
- parentId: _nullishCoalesce(_nullishCoalesce(message.parentId, () => ( _optionalChain([messages2, 'access', _190 => _190.at, 'call', _191 => _191(-1), 'optionalAccess', _192 => _192.id]))), () => ( null)),
3595
+ parentId: _nullishCoalesce(_nullishCoalesce(message.parentId, () => ( _optionalChain([messages2, 'access', _191 => _191.at, 'call', _192 => _192(-1), 'optionalAccess', _193 => _193.id]))), () => ( null)),
3585
3596
  role: _nullishCoalesce(message.role, () => ( "user")),
3586
3597
  content: message.content,
3587
3598
  attachments: _nullishCoalesce(message.attachments, () => ( []))
@@ -3593,7 +3604,7 @@ var getThreadState = (runtime) => {
3593
3604
  threadId: runtime.threadId,
3594
3605
  capabilities: runtime.capabilities,
3595
3606
  isDisabled: runtime.isDisabled,
3596
- isRunning: _optionalChain([lastMessage, 'optionalAccess', _193 => _193.role]) !== "assistant" ? false : lastMessage.status.type === "running",
3607
+ isRunning: _optionalChain([lastMessage, 'optionalAccess', _194 => _194.role]) !== "assistant" ? false : lastMessage.status.type === "running",
3597
3608
  messages: runtime.messages,
3598
3609
  suggestions: runtime.suggestions,
3599
3610
  extras: runtime.extras,
@@ -3771,7 +3782,7 @@ var ThreadRuntimeImpl = (_class10 = class {
3771
3782
  if (!message) return void 0;
3772
3783
  return {
3773
3784
  message,
3774
- parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _194 => _194[idx - 1], 'optionalAccess', _195 => _195.id]), () => ( null))
3785
+ parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _195 => _195[idx - 1], 'optionalAccess', _196 => _196.id]), () => ( null))
3775
3786
  };
3776
3787
  }
3777
3788
  );
@@ -3800,12 +3811,12 @@ var ThreadRuntimeImpl = (_class10 = class {
3800
3811
  return {
3801
3812
  ...message,
3802
3813
  message,
3803
- isLast: _optionalChain([messages2, 'access', _196 => _196.at, 'call', _197 => _197(-1), 'optionalAccess', _198 => _198.id]) === message.id,
3814
+ isLast: _optionalChain([messages2, 'access', _197 => _197.at, 'call', _198 => _198(-1), 'optionalAccess', _199 => _199.id]) === message.id,
3804
3815
  parentId,
3805
3816
  branches,
3806
3817
  branchNumber: branches.indexOf(message.id) + 1,
3807
3818
  branchCount: branches.length,
3808
- speech: _optionalChain([speechState, 'optionalAccess', _199 => _199.messageId]) === message.id ? speechState : void 0,
3819
+ speech: _optionalChain([speechState, 'optionalAccess', _200 => _200.messageId]) === message.id ? speechState : void 0,
3809
3820
  submittedFeedback
3810
3821
  };
3811
3822
  },
@@ -3989,7 +4000,7 @@ var fromLanguageModelMessages = (lm, { mergeSteps }) => {
3989
4000
  });
3990
4001
  if (mergeSteps) {
3991
4002
  const previousMessage = messages2[messages2.length - 1];
3992
- if (_optionalChain([previousMessage, 'optionalAccess', _200 => _200.role]) === "assistant") {
4003
+ if (_optionalChain([previousMessage, 'optionalAccess', _201 => _201.role]) === "assistant") {
3993
4004
  previousMessage.content.push(...newContent);
3994
4005
  break;
3995
4006
  }
@@ -4002,7 +4013,7 @@ var fromLanguageModelMessages = (lm, { mergeSteps }) => {
4002
4013
  }
4003
4014
  case "tool": {
4004
4015
  const previousMessage = messages2[messages2.length - 1];
4005
- if (_optionalChain([previousMessage, 'optionalAccess', _201 => _201.role]) !== "assistant")
4016
+ if (_optionalChain([previousMessage, 'optionalAccess', _202 => _202.role]) !== "assistant")
4006
4017
  throw new Error(
4007
4018
  "A tool message must be preceded by an assistant message."
4008
4019
  );
@@ -4132,7 +4143,7 @@ function assistantDecoderStream() {
4132
4143
  case "c" /* ToolCallDelta */: {
4133
4144
  const { toolCallId, argsTextDelta } = value;
4134
4145
  const toolName = toolCallNames.get(toolCallId);
4135
- if (_optionalChain([currentToolCall, 'optionalAccess', _202 => _202.id]) === toolCallId) {
4146
+ if (_optionalChain([currentToolCall, 'optionalAccess', _203 => _203.id]) === toolCallId) {
4136
4147
  currentToolCall.argsText += argsTextDelta;
4137
4148
  }
4138
4149
  controller.enqueue({
@@ -4276,7 +4287,7 @@ var useEdgeRuntime = (options) => {
4276
4287
  };
4277
4288
 
4278
4289
  // src/runtimes/local/shouldContinue.tsx
4279
- var shouldContinue = (result) => _optionalChain([result, 'access', _203 => _203.status, 'optionalAccess', _204 => _204.type]) === "requires-action" && result.status.reason === "tool-calls" && result.content.every((c) => c.type !== "tool-call" || !!c.result);
4290
+ var shouldContinue = (result) => _optionalChain([result, 'access', _204 => _204.status, 'optionalAccess', _205 => _205.type]) === "requires-action" && result.status.reason === "tool-calls" && result.content.every((c) => c.type !== "tool-call" || !!c.result);
4280
4291
 
4281
4292
  // src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx
4282
4293
  var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
@@ -4296,7 +4307,7 @@ var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
4296
4307
  return true;
4297
4308
  }
4298
4309
  getAttachmentAdapter() {
4299
- return _optionalChain([this, 'access', _205 => _205.runtime, 'access', _206 => _206.adapters, 'optionalAccess', _207 => _207.attachments]);
4310
+ return _optionalChain([this, 'access', _206 => _206.runtime, 'access', _207 => _207.adapters, 'optionalAccess', _208 => _208.attachments]);
4300
4311
  }
4301
4312
 
4302
4313
 
@@ -4377,7 +4388,7 @@ var BaseThreadRuntimeCore = (_class11 = class {
4377
4388
  return this._submittedFeedback[messageId];
4378
4389
  }
4379
4390
  submitFeedback({ messageId, type }) {
4380
- const adapter = _optionalChain([this, 'access', _208 => _208.adapters, 'optionalAccess', _209 => _209.feedback]);
4391
+ const adapter = _optionalChain([this, 'access', _209 => _209.adapters, 'optionalAccess', _210 => _210.feedback]);
4381
4392
  if (!adapter) throw new Error("Feedback adapter not configured");
4382
4393
  const { message } = this.repository.getMessage(messageId);
4383
4394
  adapter.submit({ message, type });
@@ -4387,10 +4398,10 @@ var BaseThreadRuntimeCore = (_class11 = class {
4387
4398
 
4388
4399
 
4389
4400
  speak(messageId) {
4390
- const adapter = _optionalChain([this, 'access', _210 => _210.adapters, 'optionalAccess', _211 => _211.speech]);
4401
+ const adapter = _optionalChain([this, 'access', _211 => _211.adapters, 'optionalAccess', _212 => _212.speech]);
4391
4402
  if (!adapter) throw new Error("Speech adapter not configured");
4392
4403
  const { message } = this.repository.getMessage(messageId);
4393
- _optionalChain([this, 'access', _212 => _212._stopSpeaking, 'optionalCall', _213 => _213()]);
4404
+ _optionalChain([this, 'access', _213 => _213._stopSpeaking, 'optionalCall', _214 => _214()]);
4394
4405
  const utterance = adapter.speak(getThreadMessageText(message));
4395
4406
  const unsub = utterance.subscribe(() => {
4396
4407
  if (utterance.status.type === "ended") {
@@ -4425,7 +4436,7 @@ var BaseThreadRuntimeCore = (_class11 = class {
4425
4436
  __init26() {this._eventSubscribers = /* @__PURE__ */ new Map()}
4426
4437
  unstable_on(event, callback) {
4427
4438
  if (event === "model-config-update") {
4428
- return _nullishCoalesce(_optionalChain([this, 'access', _214 => _214.configProvider, 'access', _215 => _215.subscribe, 'optionalCall', _216 => _216(callback)]), () => ( (() => {
4439
+ return _nullishCoalesce(_optionalChain([this, 'access', _215 => _215.configProvider, 'access', _216 => _216.subscribe, 'optionalCall', _217 => _217(callback)]), () => ( (() => {
4429
4440
  })));
4430
4441
  }
4431
4442
  const subscribers = this._eventSubscribers.get(event);
@@ -4472,17 +4483,17 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
4472
4483
  if (this._options === options) return;
4473
4484
  this._options = options;
4474
4485
  let hasUpdates = false;
4475
- const canSpeak = _optionalChain([options, 'access', _217 => _217.adapters, 'optionalAccess', _218 => _218.speech]) !== void 0;
4486
+ const canSpeak = _optionalChain([options, 'access', _218 => _218.adapters, 'optionalAccess', _219 => _219.speech]) !== void 0;
4476
4487
  if (this.capabilities.speech !== canSpeak) {
4477
4488
  this.capabilities.speech = canSpeak;
4478
4489
  hasUpdates = true;
4479
4490
  }
4480
- const canAttach = _optionalChain([options, 'access', _219 => _219.adapters, 'optionalAccess', _220 => _220.attachments]) !== void 0;
4491
+ const canAttach = _optionalChain([options, 'access', _220 => _220.adapters, 'optionalAccess', _221 => _221.attachments]) !== void 0;
4481
4492
  if (this.capabilities.attachments !== canAttach) {
4482
4493
  this.capabilities.attachments = canAttach;
4483
4494
  hasUpdates = true;
4484
4495
  }
4485
- const canFeedback = _optionalChain([options, 'access', _221 => _221.adapters, 'optionalAccess', _222 => _222.feedback]) !== void 0;
4496
+ const canFeedback = _optionalChain([options, 'access', _222 => _222.adapters, 'optionalAccess', _223 => _223.feedback]) !== void 0;
4486
4497
  if (this.capabilities.feedback !== canFeedback) {
4487
4498
  this.capabilities.feedback = canFeedback;
4488
4499
  hasUpdates = true;
@@ -4518,13 +4529,13 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
4518
4529
  }
4519
4530
  async performRoundtrip(parentId, message) {
4520
4531
  const messages2 = this.repository.getMessages();
4521
- _optionalChain([this, 'access', _223 => _223.abortController, 'optionalAccess', _224 => _224.abort, 'call', _225 => _225()]);
4532
+ _optionalChain([this, 'access', _224 => _224.abortController, 'optionalAccess', _225 => _225.abort, 'call', _226 => _226()]);
4522
4533
  this.abortController = new AbortController();
4523
4534
  const initialContent = message.content;
4524
- const initialSteps = _optionalChain([message, 'access', _226 => _226.metadata, 'optionalAccess', _227 => _227.steps]);
4525
- const initalCustom = _optionalChain([message, 'access', _228 => _228.metadata, 'optionalAccess', _229 => _229.custom]);
4535
+ const initialSteps = _optionalChain([message, 'access', _227 => _227.metadata, 'optionalAccess', _228 => _228.steps]);
4536
+ const initalCustom = _optionalChain([message, 'access', _229 => _229.metadata, 'optionalAccess', _230 => _230.custom]);
4526
4537
  const updateMessage = (m) => {
4527
- const newSteps = _optionalChain([m, 'access', _230 => _230.metadata, 'optionalAccess', _231 => _231.steps]) || _optionalChain([m, 'access', _232 => _232.metadata, 'optionalAccess', _233 => _233.roundtrips]);
4538
+ const newSteps = _optionalChain([m, 'access', _231 => _231.metadata, 'optionalAccess', _232 => _232.steps]) || _optionalChain([m, 'access', _233 => _233.metadata, 'optionalAccess', _234 => _234.roundtrips]);
4528
4539
  const steps2 = newSteps ? [..._nullishCoalesce(initialSteps, () => ( [])), ...newSteps] : void 0;
4529
4540
  message = {
4530
4541
  ...message,
@@ -4536,7 +4547,7 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
4536
4547
  metadata: {
4537
4548
  ...message.metadata,
4538
4549
  ...steps2 ? { roundtrips: steps2, steps: steps2 } : void 0,
4539
- ..._optionalChain([m, 'access', _234 => _234.metadata, 'optionalAccess', _235 => _235.custom]) ? {
4550
+ ..._optionalChain([m, 'access', _235 => _235.metadata, 'optionalAccess', _236 => _236.custom]) ? {
4540
4551
  custom: { ..._nullishCoalesce(initalCustom, () => ( {})), ...m.metadata.custom }
4541
4552
  } : void 0
4542
4553
  }
@@ -4546,7 +4557,7 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
4546
4557
  this._notifySubscribers();
4547
4558
  };
4548
4559
  const maxSteps = this._options.maxSteps ? this._options.maxSteps : (_nullishCoalesce(this._options.maxToolRoundtrips, () => ( 1))) + 1;
4549
- const steps = _nullishCoalesce(_optionalChain([message, 'access', _236 => _236.metadata, 'optionalAccess', _237 => _237.steps, 'optionalAccess', _238 => _238.length]), () => ( 0));
4560
+ const steps = _nullishCoalesce(_optionalChain([message, 'access', _237 => _237.metadata, 'optionalAccess', _238 => _238.steps, 'optionalAccess', _239 => _239.length]), () => ( 0));
4550
4561
  if (steps >= maxSteps) {
4551
4562
  updateMessage({
4552
4563
  status: {
@@ -4598,7 +4609,7 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
4598
4609
  return message;
4599
4610
  }
4600
4611
  cancelRun() {
4601
- _optionalChain([this, 'access', _239 => _239.abortController, 'optionalAccess', _240 => _240.abort, 'call', _241 => _241()]);
4612
+ _optionalChain([this, 'access', _240 => _240.abortController, 'optionalAccess', _241 => _241.abort, 'call', _242 => _242()]);
4602
4613
  this.abortController = null;
4603
4614
  }
4604
4615
  addToolResult({
@@ -4746,7 +4757,7 @@ var getExportFromInitialMessages = (initialMessages) => {
4746
4757
  const messages2 = fromCoreMessages(initialMessages);
4747
4758
  return {
4748
4759
  messages: messages2.map((m, idx) => ({
4749
- parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _242 => _242[idx - 1], 'optionalAccess', _243 => _243.id]), () => ( null)),
4760
+ parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _243 => _243[idx - 1], 'optionalAccess', _244 => _244.id]), () => ( null)),
4750
4761
  message: m
4751
4762
  }))
4752
4763
  };
@@ -4857,7 +4868,7 @@ var ExternalStoreThreadManagerRuntimeCore = (_class14 = class {
4857
4868
  this._notifySubscribers();
4858
4869
  }
4859
4870
  switchToThread(threadId) {
4860
- if (_optionalChain([this, 'access', _244 => _244._mainThread, 'optionalAccess', _245 => _245.threadId]) === threadId) return;
4871
+ if (_optionalChain([this, 'access', _245 => _245._mainThread, 'optionalAccess', _246 => _246.threadId]) === threadId) return;
4861
4872
  const onSwitchToThread = this.adapter.onSwitchToThread;
4862
4873
  if (!onSwitchToThread)
4863
4874
  throw new Error(
@@ -5012,7 +5023,7 @@ var fromThreadMessageLike = (like, fallbackId, fallbackStatus) => {
5012
5023
  // src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx
5013
5024
  var EMPTY_ARRAY3 = Object.freeze([]);
5014
5025
  var hasUpcomingMessage = (isRunning, messages2) => {
5015
- return isRunning && _optionalChain([messages2, 'access', _246 => _246[messages2.length - 1], 'optionalAccess', _247 => _247.role]) !== "assistant";
5026
+ return isRunning && _optionalChain([messages2, 'access', _247 => _247[messages2.length - 1], 'optionalAccess', _248 => _248.role]) !== "assistant";
5016
5027
  };
5017
5028
  var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntimeCore {
5018
5029
  __init37() {this.assistantOptimisticId = null}
@@ -5065,11 +5076,11 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5065
5076
  edit: this._store.onEdit !== void 0,
5066
5077
  reload: this._store.onReload !== void 0,
5067
5078
  cancel: this._store.onCancel !== void 0,
5068
- speech: _optionalChain([this, 'access', _251 => _251._store, 'access', _252 => _252.adapters, 'optionalAccess', _253 => _253.speech]) !== void 0,
5069
- unstable_copy: _optionalChain([this, 'access', _254 => _254._store, 'access', _255 => _255.unstable_capabilities, 'optionalAccess', _256 => _256.copy]) !== false,
5079
+ speech: _optionalChain([this, 'access', _252 => _252._store, 'access', _253 => _253.adapters, 'optionalAccess', _254 => _254.speech]) !== void 0,
5080
+ unstable_copy: _optionalChain([this, 'access', _255 => _255._store, 'access', _256 => _256.unstable_capabilities, 'optionalAccess', _257 => _257.copy]) !== false,
5070
5081
  // default true
5071
- attachments: !!_optionalChain([this, 'access', _257 => _257._store, 'access', _258 => _258.adapters, 'optionalAccess', _259 => _259.attachments]),
5072
- feedback: !!_optionalChain([this, 'access', _260 => _260._store, 'access', _261 => _261.adapters, 'optionalAccess', _262 => _262.feedback])
5082
+ attachments: !!_optionalChain([this, 'access', _258 => _258._store, 'access', _259 => _259.adapters, 'optionalAccess', _260 => _260.attachments]),
5083
+ feedback: !!_optionalChain([this, 'access', _261 => _261._store, 'access', _262 => _262.adapters, 'optionalAccess', _263 => _263.feedback])
5073
5084
  };
5074
5085
  if (oldStore) {
5075
5086
  if (oldStore.convertMessage !== store.convertMessage) {
@@ -5096,7 +5107,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5096
5107
  for (let i = 0; i < messages2.length; i++) {
5097
5108
  const message = messages2[i];
5098
5109
  const parent = messages2[i - 1];
5099
- this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _263 => _263.id]), () => ( null)), message);
5110
+ this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _264 => _264.id]), () => ( null)), message);
5100
5111
  }
5101
5112
  if (this.assistantOptimisticId) {
5102
5113
  this.repository.deleteMessage(this.assistantOptimisticId);
@@ -5104,7 +5115,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5104
5115
  }
5105
5116
  if (hasUpcomingMessage(isRunning, messages2)) {
5106
5117
  this.assistantOptimisticId = this.repository.appendOptimisticMessage(
5107
- _nullishCoalesce(_optionalChain([messages2, 'access', _264 => _264.at, 'call', _265 => _265(-1), 'optionalAccess', _266 => _266.id]), () => ( null)),
5118
+ _nullishCoalesce(_optionalChain([messages2, 'access', _265 => _265.at, 'call', _266 => _266(-1), 'optionalAccess', _267 => _267.id]), () => ( null)),
5108
5119
  {
5109
5120
  role: "assistant",
5110
5121
  content: []
@@ -5112,7 +5123,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5112
5123
  );
5113
5124
  }
5114
5125
  this.repository.resetHead(
5115
- _nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages2, 'access', _267 => _267.at, 'call', _268 => _268(-1), 'optionalAccess', _269 => _269.id]))), () => ( null))
5126
+ _nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages2, 'access', _268 => _268.at, 'call', _269 => _269(-1), 'optionalAccess', _270 => _270.id]))), () => ( null))
5116
5127
  );
5117
5128
  this._messages = this.repository.getMessages();
5118
5129
  this._notifySubscribers();
@@ -5124,7 +5135,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5124
5135
  this.updateMessages(this.repository.getMessages());
5125
5136
  }
5126
5137
  async append(message) {
5127
- if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _270 => _270.messages, 'access', _271 => _271.at, 'call', _272 => _272(-1), 'optionalAccess', _273 => _273.id]), () => ( null)))) {
5138
+ if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _271 => _271.messages, 'access', _272 => _272.at, 'call', _273 => _273(-1), 'optionalAccess', _274 => _274.id]), () => ( null)))) {
5128
5139
  if (!this._store.onEdit)
5129
5140
  throw new Error("Runtime does not support editing messages.");
5130
5141
  await this._store.onEdit(message);
@@ -5147,7 +5158,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5147
5158
  }
5148
5159
  let messages2 = this.repository.getMessages();
5149
5160
  const previousMessage = messages2[messages2.length - 1];
5150
- if (_optionalChain([previousMessage, 'optionalAccess', _274 => _274.role]) === "user" && previousMessage.id === _optionalChain([messages2, 'access', _275 => _275.at, 'call', _276 => _276(-1), 'optionalAccess', _277 => _277.id])) {
5161
+ if (_optionalChain([previousMessage, 'optionalAccess', _275 => _275.role]) === "user" && previousMessage.id === _optionalChain([messages2, 'access', _276 => _276.at, 'call', _277 => _277(-1), 'optionalAccess', _278 => _278.id])) {
5151
5162
  this.repository.deleteMessage(previousMessage.id);
5152
5163
  if (!this.composer.text.trim()) {
5153
5164
  this.composer.setText(getThreadMessageText(previousMessage));
@@ -5166,7 +5177,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
5166
5177
  this._store.onAddToolResult(options);
5167
5178
  }
5168
5179
  __init42() {this.updateMessages = (messages2) => {
5169
- _optionalChain([this, 'access', _278 => _278._store, 'access', _279 => _279.setMessages, 'optionalCall', _280 => _280(
5180
+ _optionalChain([this, 'access', _279 => _279._store, 'access', _280 => _280.setMessages, 'optionalCall', _281 => _281(
5170
5181
  messages2.flatMap(getExternalStoreMessage).filter((m) => m != null)
5171
5182
  )]);
5172
5183
  }}
@@ -5178,7 +5189,7 @@ var getThreadManagerAdapter = (store) => {
5178
5189
  threadId: store.threadId,
5179
5190
  onSwitchToNewThread: store.onSwitchToNewThread,
5180
5191
  onSwitchToThread: store.onSwitchToThread,
5181
- ..._optionalChain([store, 'access', _281 => _281.adapters, 'optionalAccess', _282 => _282.threadManager])
5192
+ ..._optionalChain([store, 'access', _282 => _282.adapters, 'optionalAccess', _283 => _283.threadManager])
5182
5193
  };
5183
5194
  };
5184
5195
  var ExternalStoreRuntimeCore = class extends BaseAssistantRuntimeCore {
@@ -5600,7 +5611,7 @@ var ThreadConfigProvider = ({
5600
5611
  }) => {
5601
5612
  const hasAssistant = !!useAssistantRuntime({ optional: true });
5602
5613
  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 });
5603
- if (!_optionalChain([config, 'optionalAccess', _283 => _283.runtime])) return configProvider;
5614
+ if (!_optionalChain([config, 'optionalAccess', _284 => _284.runtime])) return configProvider;
5604
5615
  if (hasAssistant) {
5605
5616
  throw new Error(
5606
5617
  "You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
@@ -5928,7 +5939,7 @@ var AssistantMessageContent = _react.forwardRef.call(void 0, ({ components: comp
5928
5939
  {
5929
5940
  components: {
5930
5941
  ...componentsProp,
5931
- Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _284 => _284.Text]), () => ( components.Text)), () => ( content_part_default.Text)),
5942
+ Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _285 => _285.Text]), () => ( components.Text)), () => ( content_part_default.Text)),
5932
5943
  tools: toolsComponents
5933
5944
  }
5934
5945
  }
@@ -6039,7 +6050,7 @@ var useAttachmentSrc = () => {
6039
6050
  const { file, src } = useAttachment((a) => {
6040
6051
  if (a.type !== "image") return {};
6041
6052
  if (a.file) return { file: a.file };
6042
- const src2 = _optionalChain([a, 'access', _285 => _285.content, 'optionalAccess', _286 => _286.filter, 'call', _287 => _287((c) => c.type === "image"), 'access', _288 => _288[0], 'optionalAccess', _289 => _289.image]);
6053
+ const src2 = _optionalChain([a, 'access', _286 => _286.content, 'optionalAccess', _287 => _287.filter, 'call', _288 => _288((c) => c.type === "image"), 'access', _289 => _289[0], 'optionalAccess', _290 => _290.image]);
6043
6054
  if (!src2) return {};
6044
6055
  return { src: src2 };
6045
6056
  });
@@ -6183,7 +6194,7 @@ var ComposerAttachments = ({ components }) => {
6183
6194
  {
6184
6195
  components: {
6185
6196
  ...components,
6186
- Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _290 => _290.Attachment]), () => ( attachment_default))
6197
+ Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _291 => _291.Attachment]), () => ( attachment_default))
6187
6198
  }
6188
6199
  }
6189
6200
  ) });
@@ -6316,7 +6327,7 @@ var ThreadWelcomeSuggestions = () => {
6316
6327
  const suggestions2 = useThread((t) => t.suggestions);
6317
6328
  const { welcome: { suggestions } = {} } = useThreadConfig();
6318
6329
  const finalSuggestions = suggestions2.length ? suggestions2 : suggestions;
6319
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([finalSuggestions, 'optionalAccess', _291 => _291.map, 'call', _292 => _292((suggestion, idx) => {
6330
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([finalSuggestions, 'optionalAccess', _292 => _292.map, 'call', _293 => _293((suggestion, idx) => {
6320
6331
  const key = `${suggestion.prompt}-${idx}`;
6321
6332
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestion, { suggestion }, key);
6322
6333
  })]) });
@@ -6394,7 +6405,7 @@ var UserMessageContent = _react.forwardRef.call(void 0, ({ components, ...props
6394
6405
  {
6395
6406
  components: {
6396
6407
  ...components,
6397
- Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _293 => _293.Text]), () => ( content_part_default.Text))
6408
+ Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _294 => _294.Text]), () => ( content_part_default.Text))
6398
6409
  }
6399
6410
  }
6400
6411
  ) });
@@ -6411,7 +6422,7 @@ var UserMessageAttachments = ({
6411
6422
  {
6412
6423
  components: {
6413
6424
  ...components,
6414
- Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _294 => _294.Attachment]), () => ( attachment_default))
6425
+ Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _295 => _295.Attachment]), () => ( attachment_default))
6415
6426
  }
6416
6427
  }
6417
6428
  ) }) });
@@ -6514,10 +6525,10 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
6514
6525
  thread_exports.Messages,
6515
6526
  {
6516
6527
  components: {
6517
- UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _295 => _295.UserMessage]), () => ( user_message_default)),
6518
- EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _296 => _296.EditComposer]), () => ( edit_composer_default)),
6519
- AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _297 => _297.AssistantMessage]), () => ( assistant_message_default)),
6520
- SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _298 => _298.SystemMessage]), () => ( SystemMessage))
6528
+ UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _296 => _296.UserMessage]), () => ( user_message_default)),
6529
+ EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _297 => _297.EditComposer]), () => ( edit_composer_default)),
6530
+ AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _298 => _298.AssistantMessage]), () => ( assistant_message_default)),
6531
+ SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _299 => _299.SystemMessage]), () => ( SystemMessage))
6521
6532
  },
6522
6533
  ...rest
6523
6534
  }
@@ -6528,7 +6539,7 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
6528
6539
  ThreadMessages.displayName = "ThreadMessages";
6529
6540
  var ThreadFollowupSuggestions = () => {
6530
6541
  const suggestions = useThread((t) => t.suggestions);
6531
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, thread_exports.If, { empty: false, running: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "aui-thread-followup-suggestions", children: _optionalChain([suggestions, 'optionalAccess', _299 => _299.map, 'call', _300 => _300((suggestion, idx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6542
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, thread_exports.If, { empty: false, running: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "aui-thread-followup-suggestions", children: _optionalChain([suggestions, 'optionalAccess', _300 => _300.map, 'call', _301 => _301((suggestion, idx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6532
6543
  thread_exports.Suggestion,
6533
6544
  {
6534
6545
  className: "aui-thread-followup-suggestion",
@@ -6763,5 +6774,6 @@ var assistant_modal_default = Object.assign(AssistantModal, exports12);
6763
6774
 
6764
6775
 
6765
6776
 
6766
- exports.ActionBarPrimitive = actionBar_exports; exports.AssistantActionBar = assistant_action_bar_default; exports.AssistantMessage = assistant_message_default; exports.AssistantModal = assistant_modal_default; exports.AssistantModalPrimitive = assistantModal_exports; exports.AssistantRuntimeProvider = AssistantRuntimeProvider; exports.AttachmentPrimitive = attachment_exports; exports.AttachmentUI = attachment_default; exports.BranchPicker = branch_picker_default; exports.BranchPickerPrimitive = branchPicker_exports; exports.Composer = composer_default; exports.ComposerAttachment = attachment_default; exports.ComposerPrimitive = composer_exports; exports.CompositeAttachmentAdapter = CompositeAttachmentAdapter; exports.ContentPart = content_part_default; exports.ContentPartPrimitive = contentPart_exports; exports.EdgeChatAdapter = EdgeChatAdapter; exports.EditComposer = edit_composer_default; exports.INTERNAL = internal_exports; exports.MessagePrimitive = message_exports; exports.SimpleImageAttachmentAdapter = SimpleImageAttachmentAdapter; exports.SimpleTextAttachmentAdapter = SimpleTextAttachmentAdapter; exports.TextContentPartProvider = TextContentPartProvider; exports.Thread = thread_default; exports.ThreadConfigProvider = ThreadConfigProvider; exports.ThreadPrimitive = thread_exports; exports.ThreadWelcome = thread_welcome_default; exports.UserActionBar = user_action_bar_default; exports.UserMessage = user_message_default; exports.UserMessageAttachment = attachment_default; exports.WebSpeechSynthesisAdapter = WebSpeechSynthesisAdapter; exports.fromCoreMessage = fromCoreMessage; exports.fromCoreMessages = fromCoreMessages; exports.fromLanguageModelMessages = fromLanguageModelMessages; exports.fromLanguageModelTools = fromLanguageModelTools; exports.getExternalStoreMessage = getExternalStoreMessage; exports.makeAssistantTool = makeAssistantTool; exports.makeAssistantToolUI = makeAssistantToolUI; exports.streamUtils = streamUtils; exports.subscribeToMainThread = subscribeToMainThread; exports.toCoreMessage = _chunkC6UZOY5Ajs.toCoreMessage; exports.toCoreMessages = _chunkC6UZOY5Ajs.toCoreMessages; exports.toLanguageModelMessages = _chunkC6UZOY5Ajs.toLanguageModelMessages; exports.toLanguageModelTools = _chunkC6UZOY5Ajs.toLanguageModelTools; exports.useActionBarCopy = useActionBarCopy; exports.useActionBarEdit = useActionBarEdit; exports.useActionBarFeedbackNegative = useActionBarFeedbackNegative; exports.useActionBarFeedbackPositive = useActionBarFeedbackPositive; exports.useActionBarReload = useActionBarReload; exports.useActionBarSpeak = useActionBarSpeak; exports.useActionBarStopSpeaking = useActionBarStopSpeaking; exports.useAppendMessage = useAppendMessage; exports.useAssistantActions = useAssistantActions; exports.useAssistantActionsStore = useAssistantActionsStore; exports.useAssistantContext = useAssistantContext; exports.useAssistantInstructions = useAssistantInstructions; exports.useAssistantRuntime = useAssistantRuntime; exports.useAssistantRuntimeStore = useAssistantRuntimeStore; exports.useAssistantTool = useAssistantTool; exports.useAssistantToolUI = useAssistantToolUI; exports.useBranchPickerCount = useBranchPickerCount; exports.useBranchPickerNext = useBranchPickerNext; exports.useBranchPickerNumber = useBranchPickerNumber; exports.useBranchPickerPrevious = useBranchPickerPrevious; exports.useComposer = useComposer; exports.useComposerAddAttachment = useComposerAddAttachment; exports.useComposerCancel = useComposerCancel; exports.useComposerContext = useComposerContext; exports.useComposerIf = useComposerIf; exports.useComposerRuntime = useComposerRuntime; exports.useComposerSend = useComposerSend; exports.useComposerStore = useComposerStore; exports.useContentPart = useContentPart; exports.useContentPartContext = useContentPartContext; exports.useContentPartDisplay = useContentPartDisplay; exports.useContentPartImage = useContentPartImage; exports.useContentPartRuntime = useContentPartRuntime; exports.useContentPartStore = useContentPartStore; exports.useContentPartText = useContentPartText; exports.useDangerousInBrowserRuntime = useDangerousInBrowserRuntime; exports.useEdgeRuntime = useEdgeRuntime; exports.useEditComposer = useEditComposer; exports.useEditComposerStore = useEditComposerStore; exports.useExternalMessageConverter = useExternalMessageConverter; exports.useExternalStoreRuntime = useExternalStoreRuntime; exports.useLocalRuntime = useLocalRuntime; exports.useMessage = useMessage; exports.useMessageContext = useMessageContext; exports.useMessageIf = useMessageIf; exports.useMessageRuntime = useMessageRuntime; exports.useMessageStore = useMessageStore; exports.useMessageUtils = useMessageUtils; exports.useMessageUtilsStore = useMessageUtilsStore; exports.useSwitchToNewThread = useSwitchToNewThread; exports.useThread = useThread; exports.useThreadActions = useThreadActions; exports.useThreadActionsStore = useThreadActionsStore; exports.useThreadComposer = useThreadComposer; exports.useThreadComposerStore = useThreadComposerStore; exports.useThreadConfig = useThreadConfig; exports.useThreadContext = useThreadContext; exports.useThreadEmpty = useThreadEmpty; exports.useThreadIf = useThreadIf; exports.useThreadManager = useThreadManager; exports.useThreadMessages = useThreadMessages; exports.useThreadMessagesStore = useThreadMessagesStore; exports.useThreadModelConfig = useThreadModelConfig; exports.useThreadRuntime = useThreadRuntime; exports.useThreadRuntimeStore = useThreadRuntimeStore; exports.useThreadScrollToBottom = useThreadScrollToBottom; exports.useThreadStore = useThreadStore; exports.useThreadSuggestion = useThreadSuggestion; exports.useThreadViewport = useThreadViewport; exports.useThreadViewportStore = useThreadViewportStore; exports.useToolUIs = useToolUIs; exports.useToolUIsStore = useToolUIsStore;
6777
+
6778
+ exports.ActionBarPrimitive = actionBar_exports; exports.AssistantActionBar = assistant_action_bar_default; exports.AssistantMessage = assistant_message_default; exports.AssistantModal = assistant_modal_default; exports.AssistantModalPrimitive = assistantModal_exports; exports.AssistantRuntimeProvider = AssistantRuntimeProvider; exports.AttachmentPrimitive = attachment_exports; exports.AttachmentUI = attachment_default; exports.BranchPicker = branch_picker_default; exports.BranchPickerPrimitive = branchPicker_exports; exports.Composer = composer_default; exports.ComposerAttachment = attachment_default; exports.ComposerPrimitive = composer_exports; exports.CompositeAttachmentAdapter = CompositeAttachmentAdapter; exports.ContentPart = content_part_default; exports.ContentPartPrimitive = contentPart_exports; exports.EdgeChatAdapter = EdgeChatAdapter; exports.EditComposer = edit_composer_default; exports.INTERNAL = internal_exports; exports.MessagePrimitive = message_exports; exports.SimpleImageAttachmentAdapter = SimpleImageAttachmentAdapter; exports.SimpleTextAttachmentAdapter = SimpleTextAttachmentAdapter; exports.TextContentPartProvider = TextContentPartProvider; exports.Thread = thread_default; exports.ThreadConfigProvider = ThreadConfigProvider; exports.ThreadPrimitive = thread_exports; exports.ThreadWelcome = thread_welcome_default; exports.UserActionBar = user_action_bar_default; exports.UserMessage = user_message_default; exports.UserMessageAttachment = attachment_default; exports.WebSpeechSynthesisAdapter = WebSpeechSynthesisAdapter; exports.fromCoreMessage = fromCoreMessage; exports.fromCoreMessages = fromCoreMessages; exports.fromLanguageModelMessages = fromLanguageModelMessages; exports.fromLanguageModelTools = fromLanguageModelTools; exports.getExternalStoreMessage = getExternalStoreMessage; exports.makeAssistantTool = makeAssistantTool; exports.makeAssistantToolUI = makeAssistantToolUI; exports.streamUtils = streamUtils; exports.subscribeToMainThread = subscribeToMainThread; exports.toCoreMessage = _chunkC6UZOY5Ajs.toCoreMessage; exports.toCoreMessages = _chunkC6UZOY5Ajs.toCoreMessages; exports.toLanguageModelMessages = _chunkC6UZOY5Ajs.toLanguageModelMessages; exports.toLanguageModelTools = _chunkC6UZOY5Ajs.toLanguageModelTools; exports.useActionBarCopy = useActionBarCopy; exports.useActionBarEdit = useActionBarEdit; exports.useActionBarFeedbackNegative = useActionBarFeedbackNegative; exports.useActionBarFeedbackPositive = useActionBarFeedbackPositive; exports.useActionBarReload = useActionBarReload; exports.useActionBarSpeak = useActionBarSpeak; exports.useActionBarStopSpeaking = useActionBarStopSpeaking; exports.useAppendMessage = useAppendMessage; exports.useAssistantActions = useAssistantActions; exports.useAssistantActionsStore = useAssistantActionsStore; exports.useAssistantContext = useAssistantContext; exports.useAssistantInstructions = useAssistantInstructions; exports.useAssistantRuntime = useAssistantRuntime; exports.useAssistantRuntimeStore = useAssistantRuntimeStore; exports.useAssistantTool = useAssistantTool; exports.useAssistantToolUI = useAssistantToolUI; exports.useBranchPickerCount = useBranchPickerCount; exports.useBranchPickerNext = useBranchPickerNext; exports.useBranchPickerNumber = useBranchPickerNumber; exports.useBranchPickerPrevious = useBranchPickerPrevious; exports.useComposer = useComposer; exports.useComposerAddAttachment = useComposerAddAttachment; exports.useComposerCancel = useComposerCancel; exports.useComposerContext = useComposerContext; exports.useComposerIf = useComposerIf; exports.useComposerRuntime = useComposerRuntime; exports.useComposerSend = useComposerSend; exports.useComposerStore = useComposerStore; exports.useContentPart = useContentPart; exports.useContentPartContext = useContentPartContext; exports.useContentPartDisplay = useContentPartDisplay; exports.useContentPartImage = useContentPartImage; exports.useContentPartRuntime = useContentPartRuntime; exports.useContentPartStore = useContentPartStore; exports.useContentPartText = useContentPartText; exports.useDangerousInBrowserRuntime = useDangerousInBrowserRuntime; exports.useEdgeRuntime = useEdgeRuntime; exports.useEditComposer = useEditComposer; exports.useEditComposerStore = useEditComposerStore; exports.useExternalMessageConverter = useExternalMessageConverter; exports.useExternalStoreRuntime = useExternalStoreRuntime; exports.useInlineRender = useInlineRender; exports.useLocalRuntime = useLocalRuntime; exports.useMessage = useMessage; exports.useMessageContext = useMessageContext; exports.useMessageIf = useMessageIf; exports.useMessageRuntime = useMessageRuntime; exports.useMessageStore = useMessageStore; exports.useMessageUtils = useMessageUtils; exports.useMessageUtilsStore = useMessageUtilsStore; exports.useSwitchToNewThread = useSwitchToNewThread; exports.useThread = useThread; exports.useThreadActions = useThreadActions; exports.useThreadActionsStore = useThreadActionsStore; exports.useThreadComposer = useThreadComposer; exports.useThreadComposerStore = useThreadComposerStore; exports.useThreadConfig = useThreadConfig; exports.useThreadContext = useThreadContext; exports.useThreadEmpty = useThreadEmpty; exports.useThreadIf = useThreadIf; exports.useThreadManager = useThreadManager; exports.useThreadMessages = useThreadMessages; exports.useThreadMessagesStore = useThreadMessagesStore; exports.useThreadModelConfig = useThreadModelConfig; exports.useThreadRuntime = useThreadRuntime; exports.useThreadRuntimeStore = useThreadRuntimeStore; exports.useThreadScrollToBottom = useThreadScrollToBottom; exports.useThreadStore = useThreadStore; exports.useThreadSuggestion = useThreadSuggestion; exports.useThreadViewport = useThreadViewport; exports.useThreadViewportStore = useThreadViewportStore; exports.useToolUIs = useToolUIs; exports.useToolUIsStore = useToolUIsStore;
6767
6779
  //# sourceMappingURL=index.js.map