@uptiqai/widgets-sdk 1.194.0 → 1.196.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -163,6 +163,20 @@ declare type ContextualKnowledgeElement = ConversationElement & ContextualKnowle
163
163
  type: ConversationElementType.CONTEXTUAL_KNOWLEDGE;
164
164
  };
165
165
 
166
+ export declare type Conversation = {
167
+ id: string;
168
+ executionId: string;
169
+ appId: string;
170
+ accountId: string;
171
+ agentId: string;
172
+ title?: string;
173
+ conversation?: (UserMessage_2 | AiMessage)[];
174
+ createdAt: Date;
175
+ updatedAt: Date;
176
+ createdBy: string;
177
+ updatedBy: string;
178
+ };
179
+
166
180
  declare type ConversationElement = {
167
181
  id: string;
168
182
  type: ConversationElementType;
@@ -185,6 +199,15 @@ declare enum ConversationElementType {
185
199
  ERROR = "error"
186
200
  }
187
201
 
202
+ export declare type ConversationListItem = {
203
+ id: string;
204
+ executionId: string;
205
+ agentId: string;
206
+ title?: string;
207
+ createdAt: Date;
208
+ updatedAt: Date;
209
+ };
210
+
188
211
  export declare const createHeadlessAgentInstance: (params: CreateHeadlessAgentInstanceParams) => HeadlessAgentInstance;
189
212
 
190
213
  export declare type CreateHeadlessAgentInstanceParams = Pick<CreateWidgetInstanceParams, 'config' | 'user' | 'instanceId'>;
@@ -274,10 +297,17 @@ export declare type FullScreenChatWidgetRef = {
274
297
  close: () => void;
275
298
  };
276
299
 
300
+ export declare type GetConversationsResult = {
301
+ conversations: ConversationListItem[];
302
+ total: number;
303
+ };
304
+
277
305
  export declare type HeadlessAgentInstance = {
278
306
  emit: (event: 'query', payload: QueryPayload) => void;
279
307
  on: <T extends HeadlessEventType>(event: T, handler: HeadlessEventHandler<T>) => () => void;
280
308
  cleanup: () => void;
309
+ getConversation: (executionId: string) => Promise<Conversation>;
310
+ listConversations: (params?: ListConversationsParams) => Promise<GetConversationsResult>;
281
311
  };
282
312
 
283
313
  declare type HeadlessEventHandler<T extends HeadlessEventType> = T extends 'agent-interrupt' ? (message: AgentInterruptEvent) => void : never;
@@ -288,6 +318,13 @@ declare type IntegrationServiceId = 'twilio-whatsapp' | 'resend' | 'stripe' | 'r
288
318
 
289
319
  export declare type IntermediateAgentMessage = Omit<SdkAgentMessage, 'intermediateMessages'>;
290
320
 
321
+ export declare type ListConversationsParams = {
322
+ page?: number;
323
+ pageSize?: number;
324
+ userId?: string;
325
+ filterByUid?: boolean;
326
+ };
327
+
291
328
  /** Display info for the model that generated a message, resolved on the backend. */
292
329
  declare type ModelDisplayInfo = {
293
330
  id: string;