@assistant-ui/react 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -91,11 +91,6 @@ declare namespace index$3 {
91
91
  export { ComposerCancel as Cancel, ComposerIf as If, ComposerInput as Input, ComposerRoot as Root, ComposerSend as Send };
92
92
  }
93
93
 
94
- type BranchState = {
95
- branchId: number;
96
- branchCount: number;
97
- };
98
-
99
94
  type ComposerState = {
100
95
  isEditing: boolean;
101
96
  canCancel: boolean;
@@ -129,18 +124,23 @@ type ThreadMessageToolCallPart = {
129
124
  };
130
125
  type ThreadUserMessageContent = ThreadMessageTextPart | ThreadMessageImagePart | ThreadMessageUIPart;
131
126
  type ThreadAssistantMessageContent = ThreadMessageTextPart | ThreadMessageImagePart | ThreadMessageUIPart | ThreadMessageToolCallPart;
132
- type ThreadUserMessage = {
127
+ type ThreadMessageBase = {
133
128
  id: string;
129
+ parentId: string;
130
+ createdAt: Date;
131
+ branchId: number;
132
+ branchCount: number;
133
+ };
134
+ type ThreadUserMessage = ThreadMessageBase & {
134
135
  role: "user";
135
136
  content: ThreadUserMessageContent[];
136
137
  };
137
- type ThreadAssistantMessage = {
138
- id: string;
138
+ type ThreadAssistantMessage = ThreadMessageBase & {
139
139
  role: "assistant";
140
140
  content: ThreadAssistantMessageContent[];
141
141
  };
142
142
  type ThreadMessage = ThreadUserMessage | ThreadAssistantMessage;
143
- type CreateThreadMessage = Omit<ThreadUserMessage, "id">;
143
+ type CreateThreadMessage = Omit<ThreadUserMessage, "id" | "branchId" | "branchCount" | "createdAt" | "role">;
144
144
 
145
145
  type MessageProviderProps = {
146
146
  children?: React.ReactNode;
@@ -267,6 +267,7 @@ type RSCMessage = {
267
267
  id: string;
268
268
  role: "user" | "assistant";
269
269
  display: ReactNode;
270
+ createdAt?: Date;
270
271
  };
271
272
  type VercelAIAssistantProviderProps = PropsWithChildren<{
272
273
  messages: RSCMessage[];
@@ -276,7 +277,6 @@ declare const VercelRSCAssistantProvider: FC<VercelAIAssistantProviderProps>;
276
277
 
277
278
  type MessageState = {
278
279
  message: ThreadMessage;
279
- branchState: BranchState;
280
280
  isLast: boolean;
281
281
  isCopied: boolean;
282
282
  setIsCopied: (value: boolean) => void;
package/dist/index.d.ts CHANGED
@@ -91,11 +91,6 @@ declare namespace index$3 {
91
91
  export { ComposerCancel as Cancel, ComposerIf as If, ComposerInput as Input, ComposerRoot as Root, ComposerSend as Send };
92
92
  }
93
93
 
94
- type BranchState = {
95
- branchId: number;
96
- branchCount: number;
97
- };
98
-
99
94
  type ComposerState = {
100
95
  isEditing: boolean;
101
96
  canCancel: boolean;
@@ -129,18 +124,23 @@ type ThreadMessageToolCallPart = {
129
124
  };
130
125
  type ThreadUserMessageContent = ThreadMessageTextPart | ThreadMessageImagePart | ThreadMessageUIPart;
131
126
  type ThreadAssistantMessageContent = ThreadMessageTextPart | ThreadMessageImagePart | ThreadMessageUIPart | ThreadMessageToolCallPart;
132
- type ThreadUserMessage = {
127
+ type ThreadMessageBase = {
133
128
  id: string;
129
+ parentId: string;
130
+ createdAt: Date;
131
+ branchId: number;
132
+ branchCount: number;
133
+ };
134
+ type ThreadUserMessage = ThreadMessageBase & {
134
135
  role: "user";
135
136
  content: ThreadUserMessageContent[];
136
137
  };
137
- type ThreadAssistantMessage = {
138
- id: string;
138
+ type ThreadAssistantMessage = ThreadMessageBase & {
139
139
  role: "assistant";
140
140
  content: ThreadAssistantMessageContent[];
141
141
  };
142
142
  type ThreadMessage = ThreadUserMessage | ThreadAssistantMessage;
143
- type CreateThreadMessage = Omit<ThreadUserMessage, "id">;
143
+ type CreateThreadMessage = Omit<ThreadUserMessage, "id" | "branchId" | "branchCount" | "createdAt" | "role">;
144
144
 
145
145
  type MessageProviderProps = {
146
146
  children?: React.ReactNode;
@@ -267,6 +267,7 @@ type RSCMessage = {
267
267
  id: string;
268
268
  role: "user" | "assistant";
269
269
  display: ReactNode;
270
+ createdAt?: Date;
270
271
  };
271
272
  type VercelAIAssistantProviderProps = PropsWithChildren<{
272
273
  messages: RSCMessage[];
@@ -276,7 +277,6 @@ declare const VercelRSCAssistantProvider: FC<VercelAIAssistantProviderProps>;
276
277
 
277
278
  type MessageState = {
278
279
  message: ThreadMessage;
279
- branchState: BranchState;
280
280
  isLast: boolean;
281
281
  isCopied: boolean;
282
282
  setIsCopied: (value: boolean) => void;