@everworker/oneringai 0.1.4 → 0.2.1
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/README.md +171 -6
- package/dist/{ImageModel-qNJHPh4q.d.ts → IProvider-DcYJ3YE-.d.ts} +15 -328
- package/dist/{ImageModel-DSY7SNsq.d.cts → IProvider-c4QCbPjn.d.cts} +15 -328
- package/dist/ImageModel-BJ2mVPGV.d.ts +337 -0
- package/dist/ImageModel-BWN6VVS6.d.cts +337 -0
- package/dist/capabilities/agents/index.d.cts +3 -2
- package/dist/capabilities/agents/index.d.ts +3 -2
- package/dist/capabilities/images/index.cjs +8 -1
- package/dist/capabilities/images/index.cjs.map +1 -1
- package/dist/capabilities/images/index.d.cts +2 -2
- package/dist/capabilities/images/index.d.ts +2 -2
- package/dist/capabilities/images/index.js +8 -1
- package/dist/capabilities/images/index.js.map +1 -1
- package/dist/{index-NOV01LWF.d.cts → index-D62LXWdW.d.cts} +18 -6
- package/dist/{index-CEp1H4fV.d.ts → index-DVb6vfA3.d.ts} +18 -6
- package/dist/index.cjs +3438 -1352
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +987 -89
- package/dist/index.d.ts +987 -89
- package/dist/index.js +3404 -1353
- package/dist/index.js.map +1 -1
- package/package.json +14 -4
- package/dist/IProvider-BP49c93d.d.cts +0 -22
- package/dist/IProvider-BP49c93d.d.ts +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IProvider } from './IProvider-
|
|
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 —
|
|
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 =
|
|
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.
|
|
@@ -522,6 +525,15 @@ interface ToolResultContent extends BaseContent {
|
|
|
522
525
|
tool_use_id: string;
|
|
523
526
|
content: string | any;
|
|
524
527
|
error?: string;
|
|
528
|
+
/**
|
|
529
|
+
* Images extracted from tool results via the __images convention.
|
|
530
|
+
* Stored separately from `content` so they don't inflate text-based token counts.
|
|
531
|
+
* Provider converters read this field to inject native multimodal image blocks.
|
|
532
|
+
*/
|
|
533
|
+
__images?: Array<{
|
|
534
|
+
base64: string;
|
|
535
|
+
mediaType: string;
|
|
536
|
+
}>;
|
|
525
537
|
}
|
|
526
538
|
type Content = InputTextContent | InputImageContent | InputFileContent | OutputTextContent | ToolUseContent | ToolResultContent;
|
|
527
539
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IProvider } from './IProvider-
|
|
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 —
|
|
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 =
|
|
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.
|
|
@@ -522,6 +525,15 @@ interface ToolResultContent extends BaseContent {
|
|
|
522
525
|
tool_use_id: string;
|
|
523
526
|
content: string | any;
|
|
524
527
|
error?: string;
|
|
528
|
+
/**
|
|
529
|
+
* Images extracted from tool results via the __images convention.
|
|
530
|
+
* Stored separately from `content` so they don't inflate text-based token counts.
|
|
531
|
+
* Provider converters read this field to inject native multimodal image blocks.
|
|
532
|
+
*/
|
|
533
|
+
__images?: Array<{
|
|
534
|
+
base64: string;
|
|
535
|
+
mediaType: string;
|
|
536
|
+
}>;
|
|
525
537
|
}
|
|
526
538
|
type Content = InputTextContent | InputImageContent | InputFileContent | OutputTextContent | ToolUseContent | ToolResultContent;
|
|
527
539
|
|