@assistant-ui/react 0.5.23 → 0.5.24

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -532,12 +532,16 @@ declare namespace internal {
532
532
  export { internal_BaseAssistantRuntime as BaseAssistantRuntime, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
533
533
  }
534
534
 
535
+ type ConverterCallback<TIn> = (cache: ThreadMessage | undefined, message: TIn, idx: number) => ThreadMessage;
536
+ declare class ThreadMessageConverter {
537
+ private readonly cache;
538
+ convertMessages<TIn extends WeakKey>(messages: TIn[], converter: ConverterCallback<TIn>, keyMapper?: (m: TIn) => WeakKey): ThreadMessage[];
539
+ }
540
+
535
541
  declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
536
- store: ExternalStoreAdapter<any>;
537
542
  private _subscriptions;
538
543
  private repository;
539
544
  private assistantOptimisticId;
540
- private useStore;
541
545
  get capabilities(): {
542
546
  switchToBranch: boolean;
543
547
  edit: boolean;
@@ -548,7 +552,10 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
548
552
  messages: ThreadMessage[];
549
553
  isDisabled: boolean;
550
554
  isRunning: boolean;
555
+ converter: ThreadMessageConverter;
556
+ private _store;
551
557
  constructor(store: ExternalStoreAdapter<any>);
558
+ set store(store: ExternalStoreAdapter<any>);
552
559
  getBranches(messageId: string): string[];
553
560
  switchToBranch(branchId: string): void;
554
561
  append(message: AppendMessage): Promise<void>;
@@ -556,9 +563,6 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
556
563
  cancelRun(): void;
557
564
  subscribe(callback: () => void): Unsubscribe;
558
565
  private updateMessages;
559
- onStoreUpdated(): void;
560
- private updateData;
561
- unstable_synchronizer: () => null;
562
566
  addToolResult(options: AddToolResultOptions): void;
563
567
  }
564
568
 
@@ -566,13 +570,12 @@ declare class ExternalStoreRuntime extends BaseAssistantRuntime<ExternalStoreThr
566
570
  private readonly _proxyConfigProvider;
567
571
  constructor(store: ExternalStoreAdapter<any>);
568
572
  set store(store: ExternalStoreAdapter<any>);
569
- onStoreUpdated(): void;
570
573
  getModelConfig(): ModelConfig;
571
574
  registerModelConfigProvider(provider: ModelConfigProvider): () => void;
572
575
  switchToThread(threadId: string | null): void | Promise<void>;
573
576
  }
574
577
 
575
- declare const useExternalStoreRuntime: (store: ExternalStoreAdapter<any>) => ExternalStoreRuntime;
578
+ declare const useExternalStoreRuntime: <T>(store: ExternalStoreAdapter<T>) => ExternalStoreRuntime;
576
579
 
577
580
  declare const getExternalStoreMessage: <T>(message: ThreadMessage) => T | undefined;
578
581
 
package/dist/index.d.ts CHANGED
@@ -532,12 +532,16 @@ declare namespace internal {
532
532
  export { internal_BaseAssistantRuntime as BaseAssistantRuntime, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
533
533
  }
534
534
 
535
+ type ConverterCallback<TIn> = (cache: ThreadMessage | undefined, message: TIn, idx: number) => ThreadMessage;
536
+ declare class ThreadMessageConverter {
537
+ private readonly cache;
538
+ convertMessages<TIn extends WeakKey>(messages: TIn[], converter: ConverterCallback<TIn>, keyMapper?: (m: TIn) => WeakKey): ThreadMessage[];
539
+ }
540
+
535
541
  declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
536
- store: ExternalStoreAdapter<any>;
537
542
  private _subscriptions;
538
543
  private repository;
539
544
  private assistantOptimisticId;
540
- private useStore;
541
545
  get capabilities(): {
542
546
  switchToBranch: boolean;
543
547
  edit: boolean;
@@ -548,7 +552,10 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
548
552
  messages: ThreadMessage[];
549
553
  isDisabled: boolean;
550
554
  isRunning: boolean;
555
+ converter: ThreadMessageConverter;
556
+ private _store;
551
557
  constructor(store: ExternalStoreAdapter<any>);
558
+ set store(store: ExternalStoreAdapter<any>);
552
559
  getBranches(messageId: string): string[];
553
560
  switchToBranch(branchId: string): void;
554
561
  append(message: AppendMessage): Promise<void>;
@@ -556,9 +563,6 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
556
563
  cancelRun(): void;
557
564
  subscribe(callback: () => void): Unsubscribe;
558
565
  private updateMessages;
559
- onStoreUpdated(): void;
560
- private updateData;
561
- unstable_synchronizer: () => null;
562
566
  addToolResult(options: AddToolResultOptions): void;
563
567
  }
564
568
 
@@ -566,13 +570,12 @@ declare class ExternalStoreRuntime extends BaseAssistantRuntime<ExternalStoreThr
566
570
  private readonly _proxyConfigProvider;
567
571
  constructor(store: ExternalStoreAdapter<any>);
568
572
  set store(store: ExternalStoreAdapter<any>);
569
- onStoreUpdated(): void;
570
573
  getModelConfig(): ModelConfig;
571
574
  registerModelConfigProvider(provider: ModelConfigProvider): () => void;
572
575
  switchToThread(threadId: string | null): void | Promise<void>;
573
576
  }
574
577
 
575
- declare const useExternalStoreRuntime: (store: ExternalStoreAdapter<any>) => ExternalStoreRuntime;
578
+ declare const useExternalStoreRuntime: <T>(store: ExternalStoreAdapter<T>) => ExternalStoreRuntime;
576
579
 
577
580
  declare const getExternalStoreMessage: <T>(message: ThreadMessage) => T | undefined;
578
581
 
package/dist/index.js CHANGED
@@ -2144,6 +2144,13 @@ var MessageRepository = (_class4 = class {constructor() { _class4.prototype.__in
2144
2144
  }
2145
2145
  }
2146
2146
  if (operation !== "cut") {
2147
+ for (let current = newParent; current; current = current.prev) {
2148
+ if (current.current.id === child.current.id) {
2149
+ throw new Error(
2150
+ "MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui."
2151
+ );
2152
+ }
2153
+ }
2147
2154
  newParentOrRoot.children = [
2148
2155
  ...newParentOrRoot.children,
2149
2156
  child.current.id
@@ -2893,18 +2900,12 @@ var useLocalRuntime = (adapter, options) => {
2893
2900
  return runtime;
2894
2901
  };
2895
2902
 
2896
- // src/runtimes/external-store/ExternalStoreThreadRuntime.tsx
2897
-
2898
-
2899
2903
  // src/runtimes/external-store/getExternalStoreMessage.tsx
2900
2904
  var symbolInnerMessage = Symbol("innerMessage");
2901
2905
  var getExternalStoreMessage = (message) => {
2902
2906
  return message[symbolInnerMessage];
2903
2907
  };
2904
2908
 
2905
- // src/runtimes/external-store/useExternalStoreSync.tsx
2906
-
2907
-
2908
2909
  // src/runtimes/external-store/ThreadMessageConverter.ts
2909
2910
  var ThreadMessageConverter = (_class6 = class {constructor() { _class6.prototype.__init16.call(this); }
2910
2911
  __init16() {this.cache = /* @__PURE__ */ new WeakMap()}
@@ -2925,6 +2926,7 @@ var AUTO_STATUS_COMPLETE = Object.freeze({
2925
2926
  type: "complete",
2926
2927
  reason: "unknown"
2927
2928
  });
2929
+ var isAutoStatus = (status) => status === AUTO_STATUS_RUNNING || status === AUTO_STATUS_COMPLETE;
2928
2930
  var getAutoStatus = (isLast, isRunning) => isLast && isRunning ? AUTO_STATUS_RUNNING : AUTO_STATUS_COMPLETE;
2929
2931
 
2930
2932
  // src/runtimes/external-store/ThreadMessageLike.tsx
@@ -2995,106 +2997,114 @@ var fromThreadMessageLike = (like, fallbackId, fallbackStatus) => {
2995
2997
  }
2996
2998
  };
2997
2999
 
2998
- // src/runtimes/external-store/useExternalStoreSync.tsx
2999
- var useExternalStoreSync = (adapter, updateData) => {
3000
- const adapterRef = _react.useRef.call(void 0, adapter);
3001
- _react.useInsertionEffect.call(void 0, () => {
3002
- adapterRef.current = adapter;
3003
- });
3004
- const [converter, convertCallback] = _react.useMemo.call(void 0, () => {
3005
- const converter2 = _nullishCoalesce(adapter.convertMessage, () => ( ((m) => m)));
3006
- const convertCallback2 = (cache, m, idx) => {
3007
- const autoStatus = getAutoStatus(
3008
- adapterRef.current.messages.at(-1) === m,
3009
- _nullishCoalesce(adapterRef.current.isRunning, () => ( false))
3010
- );
3011
- if (cache && (cache.role !== "assistant" || cache.status === autoStatus))
3012
- return cache;
3013
- const newMessage = fromThreadMessageLike(
3014
- converter2(m, idx),
3015
- idx.toString(),
3016
- autoStatus
3017
- );
3018
- newMessage[symbolInnerMessage] = m;
3019
- return newMessage;
3020
- };
3021
- return [new ThreadMessageConverter(), convertCallback2];
3022
- }, [adapter.convertMessage]);
3023
- _react.useEffect.call(void 0, () => {
3024
- updateData(
3025
- _nullishCoalesce(adapter.isDisabled, () => ( false)),
3026
- _nullishCoalesce(adapter.isRunning, () => ( false)),
3027
- converter.convertMessages(adapter.messages, convertCallback)
3028
- );
3029
- }, [
3030
- updateData,
3031
- converter,
3032
- convertCallback,
3033
- adapter.isDisabled,
3034
- adapter.isRunning,
3035
- adapter.messages
3036
- ]);
3037
- };
3038
-
3039
3000
  // src/runtimes/external-store/ExternalStoreThreadRuntime.tsx
3040
3001
  var hasUpcomingMessage = (isRunning, messages) => {
3041
3002
  return isRunning && _optionalChain([messages, 'access', _108 => _108[messages.length - 1], 'optionalAccess', _109 => _109.role]) !== "assistant";
3042
3003
  };
3043
3004
  var ExternalStoreThreadRuntime = (_class7 = class {
3044
- constructor(store) {;_class7.prototype.__init17.call(this);_class7.prototype.__init18.call(this);_class7.prototype.__init19.call(this);_class7.prototype.__init20.call(this);_class7.prototype.__init21.call(this);_class7.prototype.__init22.call(this);_class7.prototype.__init23.call(this);_class7.prototype.__init24.call(this);_class7.prototype.__init25.call(this);
3045
- this.store = store;
3046
- this.updateData(
3047
- _nullishCoalesce(store.isDisabled, () => ( false)),
3048
- _nullishCoalesce(store.isRunning, () => ( false)),
3049
- store.messages
3050
- );
3051
- this.useStore = _zustand.create.call(void 0, () => ({
3052
- store
3053
- }));
3054
- }
3055
3005
  __init17() {this._subscriptions = /* @__PURE__ */ new Set()}
3056
3006
  __init18() {this.repository = new MessageRepository()}
3057
3007
  __init19() {this.assistantOptimisticId = null}
3058
-
3059
3008
  get capabilities() {
3060
3009
  return {
3061
- switchToBranch: this.store.setMessages !== void 0,
3062
- edit: this.store.onEdit !== void 0,
3063
- reload: this.store.onReload !== void 0,
3064
- cancel: this.store.onCancel !== void 0,
3065
- copy: this.store.onCopy !== null
3010
+ switchToBranch: this._store.setMessages !== void 0,
3011
+ edit: this._store.onEdit !== void 0,
3012
+ reload: this._store.onReload !== void 0,
3013
+ cancel: this._store.onCancel !== void 0,
3014
+ copy: this._store.onCopy !== null
3066
3015
  };
3067
3016
  }
3068
3017
  __init20() {this.messages = []}
3069
3018
  __init21() {this.isDisabled = false}
3070
3019
  __init22() {this.isRunning = false}
3020
+ __init23() {this.converter = new ThreadMessageConverter()}
3021
+
3022
+ constructor(store) {;_class7.prototype.__init17.call(this);_class7.prototype.__init18.call(this);_class7.prototype.__init19.call(this);_class7.prototype.__init20.call(this);_class7.prototype.__init21.call(this);_class7.prototype.__init22.call(this);_class7.prototype.__init23.call(this);_class7.prototype.__init24.call(this);
3023
+ this.store = store;
3024
+ }
3025
+ set store(store) {
3026
+ const oldStore = this._store;
3027
+ if (oldStore) {
3028
+ if (oldStore.convertMessage !== store.convertMessage) {
3029
+ this.converter = new ThreadMessageConverter();
3030
+ } else if (oldStore.isDisabled === store.isDisabled && oldStore.isRunning === store.isRunning && oldStore.messages === store.messages) {
3031
+ return;
3032
+ }
3033
+ }
3034
+ this._store = store;
3035
+ const isRunning = _nullishCoalesce(store.isRunning, () => ( false));
3036
+ const isDisabled = _nullishCoalesce(store.isDisabled, () => ( false));
3037
+ const convertCallback = (cache, m, idx) => {
3038
+ if (!store.convertMessage) return m;
3039
+ const isLast = idx === store.messages.length - 1;
3040
+ const autoStatus = getAutoStatus(isLast, isRunning);
3041
+ if (cache && (cache.role !== "assistant" || !isAutoStatus(cache.status) || cache.status === autoStatus))
3042
+ return cache;
3043
+ const newMessage = fromThreadMessageLike(
3044
+ store.convertMessage(m, idx),
3045
+ idx.toString(),
3046
+ autoStatus
3047
+ );
3048
+ newMessage[symbolInnerMessage] = m;
3049
+ return newMessage;
3050
+ };
3051
+ const messages = this.converter.convertMessages(
3052
+ store.messages,
3053
+ convertCallback
3054
+ );
3055
+ for (let i = 0; i < messages.length; i++) {
3056
+ const message = messages[i];
3057
+ const parent = messages[i - 1];
3058
+ this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _113 => _113.id]), () => ( null)), message);
3059
+ }
3060
+ if (this.assistantOptimisticId) {
3061
+ this.repository.deleteMessage(this.assistantOptimisticId);
3062
+ this.assistantOptimisticId = null;
3063
+ }
3064
+ if (hasUpcomingMessage(isRunning, messages)) {
3065
+ this.assistantOptimisticId = this.repository.appendOptimisticMessage(
3066
+ _nullishCoalesce(_optionalChain([messages, 'access', _114 => _114.at, 'call', _115 => _115(-1), 'optionalAccess', _116 => _116.id]), () => ( null)),
3067
+ {
3068
+ role: "assistant",
3069
+ content: []
3070
+ }
3071
+ );
3072
+ }
3073
+ this.repository.resetHead(
3074
+ _nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages, 'access', _117 => _117.at, 'call', _118 => _118(-1), 'optionalAccess', _119 => _119.id]))), () => ( null))
3075
+ );
3076
+ this.messages = this.repository.getMessages();
3077
+ this.isDisabled = isDisabled;
3078
+ this.isRunning = isRunning;
3079
+ for (const callback of this._subscriptions) callback();
3080
+ }
3071
3081
  getBranches(messageId) {
3072
3082
  return this.repository.getBranches(messageId);
3073
3083
  }
3074
3084
  switchToBranch(branchId) {
3075
- if (!this.store.setMessages)
3085
+ if (!this._store.setMessages)
3076
3086
  throw new Error("Runtime does not support switching branches.");
3077
3087
  this.repository.switchToBranch(branchId);
3078
3088
  this.updateMessages(this.repository.getMessages());
3079
3089
  }
3080
3090
  async append(message) {
3081
3091
  if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _120 => _120.messages, 'access', _121 => _121.at, 'call', _122 => _122(-1), 'optionalAccess', _123 => _123.id]), () => ( null)))) {
3082
- if (!this.store.onEdit)
3092
+ if (!this._store.onEdit)
3083
3093
  throw new Error("Runtime does not support editing messages.");
3084
- await this.store.onEdit(message);
3094
+ await this._store.onEdit(message);
3085
3095
  } else {
3086
- await this.store.onNew(message);
3096
+ await this._store.onNew(message);
3087
3097
  }
3088
3098
  }
3089
3099
  async startRun(parentId) {
3090
- if (!this.store.onReload)
3100
+ if (!this._store.onReload)
3091
3101
  throw new Error("Runtime does not support reloading messages.");
3092
- await this.store.onReload(parentId);
3102
+ await this._store.onReload(parentId);
3093
3103
  }
3094
3104
  cancelRun() {
3095
- if (!this.store.onCancel)
3105
+ if (!this._store.onCancel)
3096
3106
  throw new Error("Runtime does not support cancelling runs.");
3097
- this.store.onCancel();
3107
+ this._store.onCancel();
3098
3108
  if (this.assistantOptimisticId) {
3099
3109
  this.repository.deleteMessage(this.assistantOptimisticId);
3100
3110
  this.assistantOptimisticId = null;
@@ -3108,67 +3118,27 @@ var ExternalStoreThreadRuntime = (_class7 = class {
3108
3118
  this._subscriptions.add(callback);
3109
3119
  return () => this._subscriptions.delete(callback);
3110
3120
  }
3111
- __init23() {this.updateMessages = (messages) => {
3112
- _optionalChain([this, 'access', _124 => _124.store, 'access', _125 => _125.setMessages, 'optionalCall', _126 => _126(
3121
+ __init24() {this.updateMessages = (messages) => {
3122
+ _optionalChain([this, 'access', _124 => _124._store, 'access', _125 => _125.setMessages, 'optionalCall', _126 => _126(
3113
3123
  messages.flatMap(getExternalStoreMessage).filter((m) => m != null)
3114
3124
  )]);
3115
3125
  }}
3116
- onStoreUpdated() {
3117
- if (this.useStore.getState().store !== this.store) {
3118
- this.useStore.setState({ store: this.store });
3119
- }
3120
- }
3121
- __init24() {this.updateData = (isDisabled, isRunning, vm) => {
3122
- for (let i = 0; i < vm.length; i++) {
3123
- const message = vm[i];
3124
- const parent = vm[i - 1];
3125
- this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _127 => _127.id]), () => ( null)), message);
3126
- }
3127
- if (this.assistantOptimisticId) {
3128
- this.repository.deleteMessage(this.assistantOptimisticId);
3129
- this.assistantOptimisticId = null;
3130
- }
3131
- if (hasUpcomingMessage(isRunning, vm)) {
3132
- this.assistantOptimisticId = this.repository.appendOptimisticMessage(
3133
- _nullishCoalesce(_optionalChain([vm, 'access', _128 => _128.at, 'call', _129 => _129(-1), 'optionalAccess', _130 => _130.id]), () => ( null)),
3134
- {
3135
- role: "assistant",
3136
- content: []
3137
- }
3138
- );
3139
- }
3140
- this.repository.resetHead(
3141
- _nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([vm, 'access', _131 => _131.at, 'call', _132 => _132(-1), 'optionalAccess', _133 => _133.id]))), () => ( null))
3142
- );
3143
- this.messages = this.repository.getMessages();
3144
- this.isDisabled = isDisabled;
3145
- this.isRunning = isRunning;
3146
- for (const callback of this._subscriptions) callback();
3147
- }}
3148
- __init25() {this.unstable_synchronizer = () => {
3149
- const { store } = this.useStore();
3150
- useExternalStoreSync(store, this.updateData);
3151
- return null;
3152
- }}
3153
3126
  addToolResult(options) {
3154
- if (!this.store.onAddToolResult)
3127
+ if (!this._store.onAddToolResult)
3155
3128
  throw new Error("Runtime does not support tool results.");
3156
- this.store.onAddToolResult(options);
3129
+ this._store.onAddToolResult(options);
3157
3130
  }
3158
3131
  }, _class7);
3159
3132
 
3160
3133
  // src/runtimes/external-store/ExternalStoreRuntime.tsx
3161
3134
  var ExternalStoreRuntime = (_class8 = class extends BaseAssistantRuntime {
3162
- __init26() {this._proxyConfigProvider = new ProxyConfigProvider()}
3135
+ __init25() {this._proxyConfigProvider = new ProxyConfigProvider()}
3163
3136
  constructor(store) {
3164
- super(new ExternalStoreThreadRuntime(store));_class8.prototype.__init26.call(this);;
3137
+ super(new ExternalStoreThreadRuntime(store));_class8.prototype.__init25.call(this);;
3165
3138
  }
3166
3139
  set store(store) {
3167
3140
  this.thread.store = store;
3168
3141
  }
3169
- onStoreUpdated() {
3170
- return this.thread.onStoreUpdated();
3171
- }
3172
3142
  getModelConfig() {
3173
3143
  return this._proxyConfigProvider.getModelConfig();
3174
3144
  }
@@ -3195,9 +3165,6 @@ var useExternalStoreRuntime = (store) => {
3195
3165
  _react.useInsertionEffect.call(void 0, () => {
3196
3166
  runtime.store = store;
3197
3167
  });
3198
- _react.useEffect.call(void 0, () => {
3199
- runtime.onStoreUpdated();
3200
- });
3201
3168
  return runtime;
3202
3169
  };
3203
3170
 
@@ -3217,7 +3184,7 @@ var ThreadConfigProvider = ({
3217
3184
  }) => {
3218
3185
  const assistant = useAssistantContext({ optional: true });
3219
3186
  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 });
3220
- if (!_optionalChain([config, 'optionalAccess', _134 => _134.runtime])) return configProvider;
3187
+ if (!_optionalChain([config, 'optionalAccess', _127 => _127.runtime])) return configProvider;
3221
3188
  if (assistant) {
3222
3189
  throw new Error(
3223
3190
  "You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
@@ -3433,7 +3400,7 @@ var AssistantMessageContent = _react.forwardRef.call(void 0, ({ components: comp
3433
3400
  {
3434
3401
  components: {
3435
3402
  ...componentsProp,
3436
- Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _135 => _135.Text]), () => ( components.Text)), () => ( content_part_default.Text))
3403
+ Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _128 => _128.Text]), () => ( components.Text)), () => ( content_part_default.Text))
3437
3404
  }
3438
3405
  }
3439
3406
  ) });
@@ -3608,7 +3575,7 @@ var ThreadWelcomeSuggestion = ({
3608
3575
  };
3609
3576
  var ThreadWelcomeSuggestions = () => {
3610
3577
  const { welcome: { suggestions } = {} } = useThreadConfig();
3611
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([suggestions, 'optionalAccess', _136 => _136.map, 'call', _137 => _137((suggestion, idx) => {
3578
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([suggestions, 'optionalAccess', _129 => _129.map, 'call', _130 => _130((suggestion, idx) => {
3612
3579
  const key = `${suggestion.prompt}-${idx}`;
3613
3580
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestion, { suggestion }, key);
3614
3581
  })]) });
@@ -3686,7 +3653,7 @@ var UserMessageContent = _react.forwardRef.call(void 0,
3686
3653
  {
3687
3654
  components: {
3688
3655
  ...components,
3689
- Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _138 => _138.Text]), () => ( content_part_default.Text))
3656
+ Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _131 => _131.Text]), () => ( content_part_default.Text))
3690
3657
  }
3691
3658
  }
3692
3659
  ) });
@@ -3788,10 +3755,10 @@ var ThreadMessages = ({ components, ...rest }) => {
3788
3755
  thread_exports.Messages,
3789
3756
  {
3790
3757
  components: {
3791
- UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _139 => _139.UserMessage]), () => ( user_message_default)),
3792
- EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _140 => _140.EditComposer]), () => ( edit_composer_default)),
3793
- AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _141 => _141.AssistantMessage]), () => ( assistant_message_default)),
3794
- SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _142 => _142.SystemMessage]), () => ( SystemMessage))
3758
+ UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _132 => _132.UserMessage]), () => ( user_message_default)),
3759
+ EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _133 => _133.EditComposer]), () => ( edit_composer_default)),
3760
+ AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _134 => _134.AssistantMessage]), () => ( assistant_message_default)),
3761
+ SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _135 => _135.SystemMessage]), () => ( SystemMessage))
3795
3762
  },
3796
3763
  ...rest
3797
3764
  }