@voltagent/core 0.1.54 → 0.1.55

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
@@ -3498,6 +3498,11 @@ declare class Agent<TProvider extends {
3498
3498
  * Supervisor configuration for agents with subagents
3499
3499
  */
3500
3500
  private readonly supervisorConfig?;
3501
+ /**
3502
+ * User-defined context passed at agent creation
3503
+ * Can be overridden during execution
3504
+ */
3505
+ private readonly defaultUserContext?;
3501
3506
  /**
3502
3507
  * Create a new agent
3503
3508
  */
package/dist/index.js CHANGED
@@ -8228,6 +8228,11 @@ var Agent = class {
8228
8228
  * Supervisor configuration for agents with subagents
8229
8229
  */
8230
8230
  supervisorConfig;
8231
+ /**
8232
+ * User-defined context passed at agent creation
8233
+ * Can be overridden during execution
8234
+ */
8235
+ defaultUserContext;
8231
8236
  /**
8232
8237
  * Create a new agent
8233
8238
  */
@@ -8248,6 +8253,7 @@ var Agent = class {
8248
8253
  this.maxSteps = options.maxSteps;
8249
8254
  this.voltOpsClient = options.voltOpsClient;
8250
8255
  this.supervisorConfig = options.supervisorConfig;
8256
+ this.defaultUserContext = options.userContext;
8251
8257
  if (options.hooks) {
8252
8258
  this.hooks = options.hooks;
8253
8259
  } else {
@@ -8636,7 +8642,7 @@ ${retrieverContext}`;
8636
8642
  });
8637
8643
  const opContext = {
8638
8644
  operationId: historyEntry.id,
8639
- userContext: (options.parentOperationContext?.userContext || options.userContext) ?? /* @__PURE__ */ new Map(),
8645
+ userContext: (options.parentOperationContext?.userContext || options.userContext || this.defaultUserContext) ?? /* @__PURE__ */ new Map(),
8640
8646
  historyEntry,
8641
8647
  isActive: true,
8642
8648
  parentAgentId: options.parentAgentId,