@voltagent/core 1.1.35 → 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
  */
@@ -1307,6 +1331,10 @@ declare class LoggerProxy implements Logger {
1307
1331
  * Get the actual logger instance with bindings applied
1308
1332
  */
1309
1333
  private getActualLogger;
1334
+ /**
1335
+ * Check if a log level should be logged based on the configured level
1336
+ */
1337
+ private shouldLog;
1310
1338
  /**
1311
1339
  * Emit log via OpenTelemetry Logs API if available
1312
1340
  */
@@ -6594,9 +6622,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6594
6622
  agentId: z.ZodString;
6595
6623
  }, "strip", z.ZodTypeAny, {
6596
6624
  type: "thought" | "analysis";
6597
- title: string;
6598
6625
  id: string;
6599
6626
  reasoning: string;
6627
+ title: string;
6600
6628
  historyEntryId: string;
6601
6629
  agentId: string;
6602
6630
  timestamp: string;
@@ -6606,9 +6634,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6606
6634
  next_action?: NextAction | undefined;
6607
6635
  }, {
6608
6636
  type: "thought" | "analysis";
6609
- title: string;
6610
6637
  id: string;
6611
6638
  reasoning: string;
6639
+ title: string;
6612
6640
  historyEntryId: string;
6613
6641
  agentId: string;
6614
6642
  timestamp: string;
@@ -6765,19 +6793,19 @@ declare class InMemoryStorageAdapter implements StorageAdapter {
6765
6793
  /**
6766
6794
  * Add a single message
6767
6795
  */
6768
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
6796
+ addMessage(message: UIMessage, userId: string, conversationId: string, _context?: OperationContext): Promise<void>;
6769
6797
  /**
6770
6798
  * Add multiple messages
6771
6799
  */
6772
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
6800
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
6773
6801
  /**
6774
6802
  * Get messages with optional filtering
6775
6803
  */
6776
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
6804
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, _context?: OperationContext): Promise<UIMessage[]>;
6777
6805
  /**
6778
6806
  * Clear messages for a user
6779
6807
  */
6780
- clearMessages(userId: string, conversationId?: string): Promise<void>;
6808
+ clearMessages(userId: string, conversationId?: string, _context?: OperationContext): Promise<void>;
6781
6809
  /**
6782
6810
  * Create a new conversation
6783
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
  */
@@ -1307,6 +1331,10 @@ declare class LoggerProxy implements Logger {
1307
1331
  * Get the actual logger instance with bindings applied
1308
1332
  */
1309
1333
  private getActualLogger;
1334
+ /**
1335
+ * Check if a log level should be logged based on the configured level
1336
+ */
1337
+ private shouldLog;
1310
1338
  /**
1311
1339
  * Emit log via OpenTelemetry Logs API if available
1312
1340
  */
@@ -6594,9 +6622,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6594
6622
  agentId: z.ZodString;
6595
6623
  }, "strip", z.ZodTypeAny, {
6596
6624
  type: "thought" | "analysis";
6597
- title: string;
6598
6625
  id: string;
6599
6626
  reasoning: string;
6627
+ title: string;
6600
6628
  historyEntryId: string;
6601
6629
  agentId: string;
6602
6630
  timestamp: string;
@@ -6606,9 +6634,9 @@ declare const ReasoningStepSchema: z.ZodObject<{
6606
6634
  next_action?: NextAction | undefined;
6607
6635
  }, {
6608
6636
  type: "thought" | "analysis";
6609
- title: string;
6610
6637
  id: string;
6611
6638
  reasoning: string;
6639
+ title: string;
6612
6640
  historyEntryId: string;
6613
6641
  agentId: string;
6614
6642
  timestamp: string;
@@ -6765,19 +6793,19 @@ declare class InMemoryStorageAdapter implements StorageAdapter {
6765
6793
  /**
6766
6794
  * Add a single message
6767
6795
  */
6768
- addMessage(message: UIMessage, userId: string, conversationId: string): Promise<void>;
6796
+ addMessage(message: UIMessage, userId: string, conversationId: string, _context?: OperationContext): Promise<void>;
6769
6797
  /**
6770
6798
  * Add multiple messages
6771
6799
  */
6772
- addMessages(messages: UIMessage[], userId: string, conversationId: string): Promise<void>;
6800
+ addMessages(messages: UIMessage[], userId: string, conversationId: string, context?: OperationContext): Promise<void>;
6773
6801
  /**
6774
6802
  * Get messages with optional filtering
6775
6803
  */
6776
- getMessages(userId: string, conversationId: string, options?: GetMessagesOptions): Promise<UIMessage[]>;
6804
+ getMessages(userId: string, conversationId: string, options?: GetMessagesOptions, _context?: OperationContext): Promise<UIMessage[]>;
6777
6805
  /**
6778
6806
  * Clear messages for a user
6779
6807
  */
6780
- clearMessages(userId: string, conversationId?: string): Promise<void>;
6808
+ clearMessages(userId: string, conversationId?: string, _context?: OperationContext): Promise<void>;
6781
6809
  /**
6782
6810
  * Create a new conversation
6783
6811
  */