@assistant-ui/react 0.5.69 → 0.5.71

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,22 +101,16 @@ type MessageStatus = {
101
101
  type ThreadSystemMessage = MessageCommonProps & {
102
102
  role: "system";
103
103
  content: [TextContentPart];
104
- status?: undefined;
105
- attachments?: undefined;
106
- metadata?: undefined;
107
104
  };
108
105
  type ThreadUserMessage = MessageCommonProps & {
109
106
  role: "user";
110
107
  content: ThreadUserContentPart[];
111
108
  attachments: readonly CompleteAttachment[];
112
- status?: undefined;
113
- metadata?: undefined;
114
109
  };
115
110
  type ThreadAssistantMessage = MessageCommonProps & {
116
111
  role: "assistant";
117
112
  content: ThreadAssistantContentPart[];
118
113
  status: MessageStatus;
119
- attachments?: undefined;
120
114
  /**
121
115
  * @deprecated Use `metadata.roundtrips` instead.
122
116
  */
@@ -130,7 +124,12 @@ type AppendMessage = CoreMessage & {
130
124
  parentId: string | null;
131
125
  attachments?: readonly CompleteAttachment[] | undefined;
132
126
  };
133
- type ThreadMessage = ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage;
127
+ type BaseThreadMessage = {
128
+ status?: ThreadAssistantMessage["status"];
129
+ metadata?: ThreadAssistantMessage["metadata"];
130
+ attachments?: ThreadUserMessage["attachments"];
131
+ };
132
+ type ThreadMessage = BaseThreadMessage & (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage);
134
133
  /** Core Message Types (without UI content parts) */
135
134
  type CoreUserContentPart = TextContentPart | ImageContentPart;
136
135
  type CoreAssistantContentPart = TextContentPart | CoreToolCallContentPart;
@@ -101,22 +101,16 @@ type MessageStatus = {
101
101
  type ThreadSystemMessage = MessageCommonProps & {
102
102
  role: "system";
103
103
  content: [TextContentPart];
104
- status?: undefined;
105
- attachments?: undefined;
106
- metadata?: undefined;
107
104
  };
108
105
  type ThreadUserMessage = MessageCommonProps & {
109
106
  role: "user";
110
107
  content: ThreadUserContentPart[];
111
108
  attachments: readonly CompleteAttachment[];
112
- status?: undefined;
113
- metadata?: undefined;
114
109
  };
115
110
  type ThreadAssistantMessage = MessageCommonProps & {
116
111
  role: "assistant";
117
112
  content: ThreadAssistantContentPart[];
118
113
  status: MessageStatus;
119
- attachments?: undefined;
120
114
  /**
121
115
  * @deprecated Use `metadata.roundtrips` instead.
122
116
  */
@@ -130,7 +124,12 @@ type AppendMessage = CoreMessage & {
130
124
  parentId: string | null;
131
125
  attachments?: readonly CompleteAttachment[] | undefined;
132
126
  };
133
- type ThreadMessage = ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage;
127
+ type BaseThreadMessage = {
128
+ status?: ThreadAssistantMessage["status"];
129
+ metadata?: ThreadAssistantMessage["metadata"];
130
+ attachments?: ThreadUserMessage["attachments"];
131
+ };
132
+ type ThreadMessage = BaseThreadMessage & (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage);
134
133
  /** Core Message Types (without UI content parts) */
135
134
  type CoreUserContentPart = TextContentPart | ImageContentPart;
136
135
  type CoreAssistantContentPart = TextContentPart | CoreToolCallContentPart;