@assistant-ui/react 0.5.14 → 0.5.15

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -564,8 +564,8 @@ type ExternalStoreMessageConverterAdapter<T> = {
564
564
  convertMessage: ExternalStoreMessageConverter<T>;
565
565
  };
566
566
  type ExternalStoreAdapterBase<T> = {
567
- threadId?: string;
568
- isRunning?: boolean;
567
+ threadId?: string | undefined;
568
+ isRunning?: boolean | undefined;
569
569
  messages: T[];
570
570
  setMessages?: ((messages: T[]) => void) | undefined;
571
571
  onNew: (message: AppendMessage) => Promise<void>;
package/dist/index.d.ts CHANGED
@@ -564,8 +564,8 @@ type ExternalStoreMessageConverterAdapter<T> = {
564
564
  convertMessage: ExternalStoreMessageConverter<T>;
565
565
  };
566
566
  type ExternalStoreAdapterBase<T> = {
567
- threadId?: string;
568
- isRunning?: boolean;
567
+ threadId?: string | undefined;
568
+ isRunning?: boolean | undefined;
569
569
  messages: T[];
570
570
  setMessages?: ((messages: T[]) => void) | undefined;
571
571
  onNew: (message: AppendMessage) => Promise<void>;
package/dist/index.js CHANGED
@@ -3688,7 +3688,6 @@ var AUTO_STATUS_COMPLETE = Object.freeze({
3688
3688
  type: "complete",
3689
3689
  reason: "unknown"
3690
3690
  });
3691
- var isAutoStatus = (status) => status === AUTO_STATUS_RUNNING || status === AUTO_STATUS_COMPLETE;
3692
3691
  var getAutoStatus = (isLast, isRunning) => isLast && isRunning ? AUTO_STATUS_RUNNING : AUTO_STATUS_COMPLETE;
3693
3692
 
3694
3693
  // src/runtimes/external-store/ThreadMessageLike.tsx
@@ -3772,9 +3771,8 @@ var useExternalStoreSync = (adapter, updateData) => {
3772
3771
  adapterRef.current.messages.at(-1) === m,
3773
3772
  adapterRef.current.isRunning ?? false
3774
3773
  );
3775
- if (cache && (cache.role !== "assistant" || !isAutoStatus(cache.status) || cache.status.type === autoStatus.type))
3774
+ if (cache && (cache.role !== "assistant" || cache.status === autoStatus))
3776
3775
  return cache;
3777
- if (cache) return cache;
3778
3776
  const newMessage = fromThreadMessageLike(
3779
3777
  converter2(m, idx),
3780
3778
  idx.toString(),