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