@voltagent/core 1.2.6 → 1.2.7

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
@@ -1618,20 +1618,39 @@ type RetrieverOptions = {
1618
1618
  [key: string]: any;
1619
1619
  };
1620
1620
  /**
1621
- * Options passed to retrieve method
1621
+ * Options passed to retrieve method.
1622
+ * Includes all operation context fields for user-specific and context-aware retrieval.
1622
1623
  */
1623
- interface RetrieveOptions {
1624
+ interface RetrieveOptions extends Partial<OperationContext> {
1624
1625
  /**
1625
1626
  * User-managed context map for this specific retrieval operation
1626
1627
  * Can be used to store metadata, results, or any custom data
1628
+ *
1629
+ * Inherited from OperationContext but explicitly documented here for clarity
1627
1630
  */
1628
1631
  context?: Map<string | symbol, unknown>;
1629
1632
  /**
1630
1633
  * Optional logger instance for this retrieval operation.
1631
1634
  * Provides execution-scoped logging with full context.
1632
1635
  * Available when retriever is called from an agent or workflow context.
1636
+ *
1637
+ * Inherited from OperationContext but explicitly documented here for clarity
1633
1638
  */
1634
1639
  logger?: Logger;
1640
+ /**
1641
+ * Optional user identifier for user-specific retrieval.
1642
+ * Can be used to filter results by user or implement multi-tenant retrieval.
1643
+ *
1644
+ * Inherited from OperationContext
1645
+ */
1646
+ userId?: string;
1647
+ /**
1648
+ * Optional conversation identifier for conversation-aware retrieval.
1649
+ * Can be used to retrieve conversation-specific context or history.
1650
+ *
1651
+ * Inherited from OperationContext
1652
+ */
1653
+ conversationId?: string;
1635
1654
  }
1636
1655
  /**
1637
1656
  * Retriever interface for retrieving relevant information
package/dist/index.d.ts CHANGED
@@ -1618,20 +1618,39 @@ type RetrieverOptions = {
1618
1618
  [key: string]: any;
1619
1619
  };
1620
1620
  /**
1621
- * Options passed to retrieve method
1621
+ * Options passed to retrieve method.
1622
+ * Includes all operation context fields for user-specific and context-aware retrieval.
1622
1623
  */
1623
- interface RetrieveOptions {
1624
+ interface RetrieveOptions extends Partial<OperationContext> {
1624
1625
  /**
1625
1626
  * User-managed context map for this specific retrieval operation
1626
1627
  * Can be used to store metadata, results, or any custom data
1628
+ *
1629
+ * Inherited from OperationContext but explicitly documented here for clarity
1627
1630
  */
1628
1631
  context?: Map<string | symbol, unknown>;
1629
1632
  /**
1630
1633
  * Optional logger instance for this retrieval operation.
1631
1634
  * Provides execution-scoped logging with full context.
1632
1635
  * Available when retriever is called from an agent or workflow context.
1636
+ *
1637
+ * Inherited from OperationContext but explicitly documented here for clarity
1633
1638
  */
1634
1639
  logger?: Logger;
1640
+ /**
1641
+ * Optional user identifier for user-specific retrieval.
1642
+ * Can be used to filter results by user or implement multi-tenant retrieval.
1643
+ *
1644
+ * Inherited from OperationContext
1645
+ */
1646
+ userId?: string;
1647
+ /**
1648
+ * Optional conversation identifier for conversation-aware retrieval.
1649
+ * Can be used to retrieve conversation-specific context or history.
1650
+ *
1651
+ * Inherited from OperationContext
1652
+ */
1653
+ conversationId?: string;
1635
1654
  }
1636
1655
  /**
1637
1656
  * Retriever interface for retrieving relevant information
package/dist/index.js CHANGED
@@ -20918,10 +20918,8 @@ var createRetrieverTool = /* @__PURE__ */ __name((retriever, options = {}) => {
20918
20918
  query: import_zod6.z.string().describe("The search query to find relevant information")
20919
20919
  }),
20920
20920
  execute: /* @__PURE__ */ __name(async ({ query }, options2) => {
20921
- const context8 = options2?.context;
20922
- const logger = options2?.logger;
20923
20921
  const startTime = Date.now();
20924
- logger?.debug(
20922
+ options2?.logger?.debug(
20925
20923
  buildRetrieverLogMessage(toolName, "start" /* START */, "search started"),
20926
20924
  buildLogContext("retriever" /* RETRIEVER */, toolName, "start" /* START */, {
20927
20925
  event: LogEvents.RETRIEVER_SEARCH_STARTED,
@@ -20929,11 +20927,8 @@ var createRetrieverTool = /* @__PURE__ */ __name((retriever, options = {}) => {
20929
20927
  })
20930
20928
  );
20931
20929
  try {
20932
- const result = await retriever.retrieve(query, {
20933
- context: context8,
20934
- logger
20935
- });
20936
- logger?.debug(
20930
+ const result = await retriever.retrieve(query, options2 ?? {});
20931
+ options2?.logger?.debug(
20937
20932
  buildRetrieverLogMessage(toolName, "complete" /* COMPLETE */, "search completed"),
20938
20933
  buildLogContext("retriever" /* RETRIEVER */, toolName, "complete" /* COMPLETE */, {
20939
20934
  event: LogEvents.RETRIEVER_SEARCH_COMPLETED,
@@ -20943,7 +20938,7 @@ var createRetrieverTool = /* @__PURE__ */ __name((retriever, options = {}) => {
20943
20938
  );
20944
20939
  return result;
20945
20940
  } catch (error) {
20946
- logger?.error(
20941
+ options2?.logger?.error(
20947
20942
  buildRetrieverLogMessage(toolName, "error" /* ERROR */, "search failed"),
20948
20943
  buildLogContext("retriever" /* RETRIEVER */, toolName, "error" /* ERROR */, {
20949
20944
  event: LogEvents.RETRIEVER_SEARCH_FAILED,