@voltagent/core 1.1.36 → 1.1.37

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.mts CHANGED
@@ -666,6 +666,30 @@ interface WorkflowStateEntry {
666
666
  };
667
667
  suspendData?: any;
668
668
  };
669
+ /**
670
+ * Stream events collected during execution
671
+ * Used for timeline visualization in UI
672
+ */
673
+ events?: Array<{
674
+ id: string;
675
+ type: string;
676
+ name?: string;
677
+ from?: string;
678
+ startTime: string;
679
+ endTime?: string;
680
+ status?: string;
681
+ input?: any;
682
+ output?: any;
683
+ metadata?: Record<string, unknown>;
684
+ context?: Record<string, unknown>;
685
+ }>;
686
+ /** Final output of the workflow execution */
687
+ output?: unknown;
688
+ /** Cancellation metadata */
689
+ cancellation?: {
690
+ cancelledAt: Date;
691
+ reason?: string;
692
+ };
669
693
  /** User ID if applicable */
670
694
  userId?: string;
671
695
  /** Conversation ID if applicable */
@@ -809,10 +833,10 @@ interface VectorItem$1 {
809
833
  * Handles persistence of conversations and messages
810
834
  */
811
835
  interface StorageAdapter {
812
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
813
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
814
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
815
- clearMessages(userId: string, conversationId?: string): Promise<void>;
836
+ addMessage(message: UIMessage, userId: string, conversationId: string, context?: OperationContext): Promise<void>;
837
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
838
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, context?: OperationContext): Promise<UIMessage[]>;
839
+ clearMessages(userId: string, conversationId?: string, context?: OperationContext): Promise<void>;
816
840
  createConversation(input: CreateConversationInput): Promise<Conversation>;
817
841
  getConversation(id: string): Promise<Conversation | null>;
818
842
  getConversations(resourceId: string): Promise<Conversation[]>;
@@ -1071,7 +1095,7 @@ declare class Memory {
1071
1095
  /**
1072
1096
  * Get messages from a conversation
1073
1097
  */
1074
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
1098
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, context?: OperationContext): Promise<UIMessage[]>;
1075
1099
  /**
1076
1100
  * Save a single message
1077
1101
  */
@@ -1079,15 +1103,15 @@ declare class Memory {
1079
1103
  /**
1080
1104
  * Add a single message (alias for consistency with existing API)
1081
1105
  */
1082
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
1106
+ addMessage(message: UIMessage, userId: string, conversationId: string, context?: OperationContext): Promise<void>;
1083
1107
  /**
1084
1108
  * Add multiple messages in batch
1085
1109
  */
1086
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
1110
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
1087
1111
  /**
1088
1112
  * Clear messages for a user
1089
1113
  */
1090
- clearMessages(userId: string, conversationId?: string): Promise<void>;
1114
+ clearMessages(userId: string, conversationId?: string, context?: OperationContext): Promise<void>;
1091
1115
  /**
1092
1116
  * Get a conversation by ID
1093
1117
  */
@@ -1235,7 +1259,7 @@ declare class Memory {
1235
1259
  */
1236
1260
  saveMessageWithContext(message: UIMessage, userId: string, conversationId: string, context?: {
1237
1261
  logger?: Logger;
1238
- }): Promise<void>;
1262
+ }, operationContext?: OperationContext): Promise<void>;
1239
1263
  /**
1240
1264
  * Get messages with semantic search support
1241
1265
  * Simple version without event publishing (handled by MemoryManagerV2)
@@ -1249,7 +1273,7 @@ declare class Memory {
1249
1273
  semanticLimit?: number;
1250
1274
  semanticThreshold?: number;
1251
1275
  mergeStrategy?: "prepend" | "append" | "interleave";
1252
- }): Promise<UIMessage[]>;
1276
+ }, operationContext?: OperationContext): Promise<UIMessage[]>;
1253
1277
  /**
1254
1278
  * Internal: Set resource ID (agent ID)
1255
1279
  */
@@ -6598,9 +6622,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6598
6622
  agentId: z.ZodString;
6599
6623
  }, "strip", z.ZodTypeAny, {
6600
6624
  type: "thought" | "analysis";
6601
- title: string;
6602
6625
  id: string;
6603
6626
  reasoning: string;
6627
+ title: string;
6604
6628
  historyEntryId: string;
6605
6629
  agentId: string;
6606
6630
  timestamp: string;
@@ -6610,9 +6634,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6610
6634
  next_action?: NextAction | undefined;
6611
6635
  }, {
6612
6636
  type: "thought" | "analysis";
6613
- title: string;
6614
6637
  id: string;
6615
6638
  reasoning: string;
6639
+ title: string;
6616
6640
  historyEntryId: string;
6617
6641
  agentId: string;
6618
6642
  timestamp: string;
@@ -6769,19 +6793,19 @@ declare class InMemoryStorageAdapter implements StorageAdapter {
6769
6793
  /**
6770
6794
  * Add a single message
6771
6795
  */
6772
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
6796
+ addMessage(message: UIMessage, userId: string, conversationId: string, _context?: OperationContext): Promise<void>;
6773
6797
  /**
6774
6798
  * Add multiple messages
6775
6799
  */
6776
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
6800
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
6777
6801
  /**
6778
6802
  * Get messages with optional filtering
6779
6803
  */
6780
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
6804
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, _context?: OperationContext): Promise<UIMessage[]>;
6781
6805
  /**
6782
6806
  * Clear messages for a user
6783
6807
  */
6784
- clearMessages(userId: string, conversationId?: string): Promise<void>;
6808
+ clearMessages(userId: string, conversationId?: string, _context?: OperationContext): Promise<void>;
6785
6809
  /**
6786
6810
  * Create a new conversation
6787
6811
  */
package/dist/index.d.ts CHANGED
@@ -666,6 +666,30 @@ interface WorkflowStateEntry {
666
666
  };
667
667
  suspendData?: any;
668
668
  };
669
+ /**
670
+ * Stream events collected during execution
671
+ * Used for timeline visualization in UI
672
+ */
673
+ events?: Array<{
674
+ id: string;
675
+ type: string;
676
+ name?: string;
677
+ from?: string;
678
+ startTime: string;
679
+ endTime?: string;
680
+ status?: string;
681
+ input?: any;
682
+ output?: any;
683
+ metadata?: Record<string, unknown>;
684
+ context?: Record<string, unknown>;
685
+ }>;
686
+ /** Final output of the workflow execution */
687
+ output?: unknown;
688
+ /** Cancellation metadata */
689
+ cancellation?: {
690
+ cancelledAt: Date;
691
+ reason?: string;
692
+ };
669
693
  /** User ID if applicable */
670
694
  userId?: string;
671
695
  /** Conversation ID if applicable */
@@ -809,10 +833,10 @@ interface VectorItem$1 {
809
833
  * Handles persistence of conversations and messages
810
834
  */
811
835
  interface StorageAdapter {
812
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
813
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
814
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
815
- clearMessages(userId: string, conversationId?: string): Promise<void>;
836
+ addMessage(message: UIMessage, userId: string, conversationId: string, context?: OperationContext): Promise<void>;
837
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
838
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, context?: OperationContext): Promise<UIMessage[]>;
839
+ clearMessages(userId: string, conversationId?: string, context?: OperationContext): Promise<void>;
816
840
  createConversation(input: CreateConversationInput): Promise<Conversation>;
817
841
  getConversation(id: string): Promise<Conversation | null>;
818
842
  getConversations(resourceId: string): Promise<Conversation[]>;
@@ -1071,7 +1095,7 @@ declare class Memory {
1071
1095
  /**
1072
1096
  * Get messages from a conversation
1073
1097
  */
1074
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
1098
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, context?: OperationContext): Promise<UIMessage[]>;
1075
1099
  /**
1076
1100
  * Save a single message
1077
1101
  */
@@ -1079,15 +1103,15 @@ declare class Memory {
1079
1103
  /**
1080
1104
  * Add a single message (alias for consistency with existing API)
1081
1105
  */
1082
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
1106
+ addMessage(message: UIMessage, userId: string, conversationId: string, context?: OperationContext): Promise<void>;
1083
1107
  /**
1084
1108
  * Add multiple messages in batch
1085
1109
  */
1086
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
1110
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
1087
1111
  /**
1088
1112
  * Clear messages for a user
1089
1113
  */
1090
- clearMessages(userId: string, conversationId?: string): Promise<void>;
1114
+ clearMessages(userId: string, conversationId?: string, context?: OperationContext): Promise<void>;
1091
1115
  /**
1092
1116
  * Get a conversation by ID
1093
1117
  */
@@ -1235,7 +1259,7 @@ declare class Memory {
1235
1259
  */
1236
1260
  saveMessageWithContext(message: UIMessage, userId: string, conversationId: string, context?: {
1237
1261
  logger?: Logger;
1238
- }): Promise<void>;
1262
+ }, operationContext?: OperationContext): Promise<void>;
1239
1263
  /**
1240
1264
  * Get messages with semantic search support
1241
1265
  * Simple version without event publishing (handled by MemoryManagerV2)
@@ -1249,7 +1273,7 @@ declare class Memory {
1249
1273
  semanticLimit?: number;
1250
1274
  semanticThreshold?: number;
1251
1275
  mergeStrategy?: "prepend" | "append" | "interleave";
1252
- }): Promise<UIMessage[]>;
1276
+ }, operationContext?: OperationContext): Promise<UIMessage[]>;
1253
1277
  /**
1254
1278
  * Internal: Set resource ID (agent ID)
1255
1279
  */
@@ -6598,9 +6622,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6598
6622
  agentId: z.ZodString;
6599
6623
  }, "strip", z.ZodTypeAny, {
6600
6624
  type: "thought" | "analysis";
6601
- title: string;
6602
6625
  id: string;
6603
6626
  reasoning: string;
6627
+ title: string;
6604
6628
  historyEntryId: string;
6605
6629
  agentId: string;
6606
6630
  timestamp: string;
@@ -6610,9 +6634,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6610
6634
  next_action?: NextAction | undefined;
6611
6635
  }, {
6612
6636
  type: "thought" | "analysis";
6613
- title: string;
6614
6637
  id: string;
6615
6638
  reasoning: string;
6639
+ title: string;
6616
6640
  historyEntryId: string;
6617
6641
  agentId: string;
6618
6642
  timestamp: string;
@@ -6769,19 +6793,19 @@ declare class InMemoryStorageAdapter implements StorageAdapter {
6769
6793
  /**
6770
6794
  * Add a single message
6771
6795
  */
6772
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
6796
+ addMessage(message: UIMessage, userId: string, conversationId: string, _context?: OperationContext): Promise<void>;
6773
6797
  /**
6774
6798
  * Add multiple messages
6775
6799
  */
6776
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
6800
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
6777
6801
  /**
6778
6802
  * Get messages with optional filtering
6779
6803
  */
6780
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
6804
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, _context?: OperationContext): Promise<UIMessage[]>;
6781
6805
  /**
6782
6806
  * Clear messages for a user
6783
6807
  */
6784
- clearMessages(userId: string, conversationId?: string): Promise<void>;
6808
+ clearMessages(userId: string, conversationId?: string, _context?: OperationContext): Promise<void>;
6785
6809
  /**
6786
6810
  * Create a new conversation
6787
6811
  */