@everworker/oneringai 0.1.3 → 0.2.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.
@@ -1,4 +1,4 @@
1
- import { I as IProvider } from './IProvider-BP49c93d.js';
1
+ import { I as IConnectorRegistry, c as IProvider } from './IProvider-DcYJ3YE-.js';
2
2
  import { EventEmitter } from 'eventemitter3';
3
3
 
4
4
  /**
@@ -268,6 +268,10 @@ interface ToolContext {
268
268
  agentId?: string;
269
269
  /** Task ID (if running in TaskAgent) */
270
270
  taskId?: string;
271
+ /** User ID — auto-populated from Agent config (userId). Also settable manually via agent.tools.setToolContext(). */
272
+ userId?: string;
273
+ /** Connector registry scoped to this agent's allowed connectors and userId */
274
+ connectorRegistry?: IConnectorRegistry;
271
275
  /** Working memory access (if agent has memory feature enabled) */
272
276
  memory?: WorkingMemoryAccess;
273
277
  /** Abort signal for cancellation */
@@ -417,16 +421,17 @@ interface ToolFunction<TArgs = any, TResult = any> {
417
421
  * The returned string replaces definition.function.description when sending to LLM.
418
422
  * The static description in definition.function.description serves as a fallback.
419
423
  *
424
+ * @param context - Current ToolContext (includes userId, agentId, etc.)
420
425
  * @returns The current tool description
421
426
  *
422
427
  * @example
423
- * // Tool with dynamic connector list:
424
- * descriptionFactory: () => {
425
- * const connectors = Connector.listAll();
428
+ * // Tool with dynamic connector list scoped to current user:
429
+ * descriptionFactory: (context) => {
430
+ * const connectors = getConnectorsForUser(context?.userId);
426
431
  * return `Execute API calls. Available connectors: ${connectors.map(c => c.name).join(', ')}`;
427
432
  * }
428
433
  */
429
- descriptionFactory?: () => string;
434
+ descriptionFactory?: (context?: ToolContext) => string;
430
435
  /**
431
436
  * Returns a human-readable description of a tool call.
432
437
  * Used for logging, UI display, and debugging.
@@ -1,4 +1,4 @@
1
- import { I as IProvider } from './IProvider-BP49c93d.cjs';
1
+ import { I as IConnectorRegistry, c as IProvider } from './IProvider-c4QCbPjn.cjs';
2
2
  import { EventEmitter } from 'eventemitter3';
3
3
 
4
4
  /**
@@ -268,6 +268,10 @@ interface ToolContext {
268
268
  agentId?: string;
269
269
  /** Task ID (if running in TaskAgent) */
270
270
  taskId?: string;
271
+ /** User ID — auto-populated from Agent config (userId). Also settable manually via agent.tools.setToolContext(). */
272
+ userId?: string;
273
+ /** Connector registry scoped to this agent's allowed connectors and userId */
274
+ connectorRegistry?: IConnectorRegistry;
271
275
  /** Working memory access (if agent has memory feature enabled) */
272
276
  memory?: WorkingMemoryAccess;
273
277
  /** Abort signal for cancellation */
@@ -417,16 +421,17 @@ interface ToolFunction<TArgs = any, TResult = any> {
417
421
  * The returned string replaces definition.function.description when sending to LLM.
418
422
  * The static description in definition.function.description serves as a fallback.
419
423
  *
424
+ * @param context - Current ToolContext (includes userId, agentId, etc.)
420
425
  * @returns The current tool description
421
426
  *
422
427
  * @example
423
- * // Tool with dynamic connector list:
424
- * descriptionFactory: () => {
425
- * const connectors = Connector.listAll();
428
+ * // Tool with dynamic connector list scoped to current user:
429
+ * descriptionFactory: (context) => {
430
+ * const connectors = getConnectorsForUser(context?.userId);
426
431
  * return `Execute API calls. Available connectors: ${connectors.map(c => c.name).join(', ')}`;
427
432
  * }
428
433
  */
429
- descriptionFactory?: () => string;
434
+ descriptionFactory?: (context?: ToolContext) => string;
430
435
  /**
431
436
  * Returns a human-readable description of a tool call.
432
437
  * Used for logging, UI display, and debugging.