@everworker/oneringai 0.4.1 → 0.4.3

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 CHANGED
@@ -69,6 +69,10 @@ Or read the more detailed installation / setup instructions [here](https://githu
69
69
 
70
70
  Better to see once and then dig in the code! :)
71
71
 
72
+ ## YOUetal
73
+
74
+ Showcasing another amazing "built with oneringai": ["no saas" agentic business team](https://youetal.ai)
75
+
72
76
  ## Features
73
77
 
74
78
  - ✨ **Unified API** - One interface for 10+ AI providers (OpenAI, Anthropic, Google, Groq, DeepSeek, and more)
@@ -1286,13 +1290,35 @@ console.log(execution.status); // 'completed' | 'failed'
1286
1290
  ```
1287
1291
 
1288
1292
  **Key Features:**
1289
- - 🔗 **Task Dependencies** - DAG-based ordering via `dependsOn`
1290
- - 🧠 **Memory Bridging** - In-context memory (`context_set`) + working memory (`memory_store`) persist across tasks while conversation is cleared
1291
- - 🔍 **LLM Validation** - Self-reflection against completion criteria with configurable score thresholds
1292
- - 🔄 **Retry Logic** - Configurable `maxAttempts` per task with automatic retry on validation failure
1293
- - 📊 **Progress Tracking** - Real-time callbacks and progress percentage
1294
- - ⚙️ **Failure Modes** - `fail-fast` (default) or `continue` for independent tasks
1295
- - 🎨 **Custom Prompts** - Override system, task, or validation prompts
1293
+ - **Task Dependencies** - DAG-based ordering via `dependsOn`
1294
+ - **Memory Bridging** - In-context memory (`context_set`) + working memory (`memory_store`) persist across tasks while conversation is cleared
1295
+ - **LLM Validation** - Self-reflection against completion criteria with configurable score thresholds
1296
+ - **Retry Logic** - Configurable `maxAttempts` per task with automatic retry on validation failure
1297
+ - **Smart Error Classification** - Permanent errors (auth, config, model-not-found) skip retry; transient errors retry normally
1298
+ - **Control Flow** - `map`, `fold`, and `until` flows with optional per-iteration timeout (`iterationTimeoutMs`)
1299
+ - **Progress Tracking** - Real-time callbacks and progress percentage
1300
+ - **Failure Modes** - `fail-fast` (default) or `continue` for independent tasks
1301
+ - **Custom Prompts** - Override system, task, or validation prompts
1302
+ - **`ROUTINE_KEYS` export** - Well-known ICM/WM key constants for custom integrations
1303
+
1304
+ **Control Flow with Timeout:**
1305
+
1306
+ ```typescript
1307
+ const routine = createRoutineDefinition({
1308
+ name: 'Process Batch',
1309
+ tasks: [{
1310
+ name: 'Process Each',
1311
+ description: 'Process each item',
1312
+ controlFlow: {
1313
+ type: 'map',
1314
+ sourceKey: '__items',
1315
+ resultKey: '__results',
1316
+ iterationTimeoutMs: 60000, // 1 min per item
1317
+ tasks: [{ name: 'Process', description: 'Handle the current item' }],
1318
+ },
1319
+ }],
1320
+ });
1321
+ ```
1296
1322
 
1297
1323
  **Routine Persistence:** Save and load routine definitions with `FileRoutineDefinitionStorage` (or implement `IRoutineDefinitionStorage` for custom backends). Per-user isolation via optional `userId`. Integrated into `StorageRegistry` as `routineDefinitions`.
1298
1324
 
@@ -1704,4 +1730,4 @@ MIT License - See [LICENSE](./LICENSE) file.
1704
1730
 
1705
1731
  ---
1706
1732
 
1707
- **Version:** 0.3.2 | **Last Updated:** 2026-02-19 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
1733
+ **Version:** 0.4.3 | **Last Updated:** 2026-02-25 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
@@ -11,7 +11,7 @@ import { V as Vendor } from './Vendor-DYh_bzwo.cjs';
11
11
  */
12
12
 
13
13
  /**
14
- * No authentication (for testing/mock providers)
14
+ * No authentication (for testing/mock providers and local services like Ollama)
15
15
  */
16
16
  interface NoneConnectorAuth {
17
17
  type: 'none';
@@ -204,6 +204,13 @@ interface ITokenStorage {
204
204
  * @returns True if token exists
205
205
  */
206
206
  hasToken(key: string): Promise<boolean>;
207
+ /**
208
+ * List all storage keys (for account enumeration).
209
+ * Optional — implementations that support it enable multi-account listing.
210
+ *
211
+ * @returns Array of all stored token keys
212
+ */
213
+ listKeys?(): Promise<string[]>;
207
214
  }
208
215
 
209
216
  /**
@@ -406,22 +413,43 @@ declare class Connector {
406
413
  /**
407
414
  * Get the current access token (for OAuth, JWT, or API key)
408
415
  * Handles automatic refresh if needed
416
+ *
417
+ * @param userId - Optional user identifier for multi-user support
418
+ * @param accountId - Optional account alias for multi-account support (e.g., 'work', 'personal')
409
419
  */
410
- getToken(userId?: string): Promise<string>;
420
+ getToken(userId?: string, accountId?: string): Promise<string>;
411
421
  /**
412
422
  * Start OAuth authorization flow
413
423
  * Returns the URL to redirect the user to
424
+ *
425
+ * @param userId - Optional user identifier for multi-user support
426
+ * @param accountId - Optional account alias for multi-account support (e.g., 'work', 'personal')
414
427
  */
415
- startAuth(userId?: string): Promise<string>;
428
+ startAuth(userId?: string, accountId?: string): Promise<string>;
416
429
  /**
417
430
  * Handle OAuth callback
418
431
  * Call this after user is redirected back from OAuth provider
432
+ *
433
+ * @param callbackUrl - Full callback URL with code and state parameters
434
+ * @param userId - Optional user identifier (can be extracted from state if embedded)
435
+ * @param accountId - Optional account alias (can be extracted from state if embedded)
419
436
  */
420
- handleCallback(callbackUrl: string, userId?: string): Promise<void>;
437
+ handleCallback(callbackUrl: string, userId?: string, accountId?: string): Promise<void>;
421
438
  /**
422
439
  * Check if the connector has a valid token
440
+ *
441
+ * @param userId - Optional user identifier for multi-user support
442
+ * @param accountId - Optional account alias for multi-account support
443
+ */
444
+ hasValidToken(userId?: string, accountId?: string): Promise<boolean>;
445
+ /**
446
+ * List account aliases for a user on this connector.
447
+ * Only applicable for OAuth connectors with multi-account support.
448
+ *
449
+ * @param userId - Optional user identifier
450
+ * @returns Array of account aliases (e.g., ['work', 'personal'])
423
451
  */
424
- hasValidToken(userId?: string): Promise<boolean>;
452
+ listAccounts(userId?: string): Promise<string[]>;
425
453
  /**
426
454
  * Get vendor-specific options from config
427
455
  */
@@ -457,9 +485,10 @@ declare class Connector {
457
485
  * @param endpoint - API endpoint (relative to baseURL) or full URL
458
486
  * @param options - Fetch options with connector-specific settings
459
487
  * @param userId - Optional user ID for multi-user OAuth
488
+ * @param accountId - Optional account alias for multi-account OAuth
460
489
  * @returns Fetch Response
461
490
  */
462
- fetch(endpoint: string, options?: ConnectorFetchOptions, userId?: string): Promise<Response>;
491
+ fetch(endpoint: string, options?: ConnectorFetchOptions, userId?: string, accountId?: string): Promise<Response>;
463
492
  /**
464
493
  * Make an authenticated fetch request and parse JSON response
465
494
  * Throws on non-OK responses
@@ -467,9 +496,10 @@ declare class Connector {
467
496
  * @param endpoint - API endpoint (relative to baseURL) or full URL
468
497
  * @param options - Fetch options with connector-specific settings
469
498
  * @param userId - Optional user ID for multi-user OAuth
499
+ * @param accountId - Optional account alias for multi-account OAuth
470
500
  * @returns Parsed JSON response
471
501
  */
472
- fetchJSON<T = unknown>(endpoint: string, options?: ConnectorFetchOptions, userId?: string): Promise<T>;
502
+ fetchJSON<T = unknown>(endpoint: string, options?: ConnectorFetchOptions, userId?: string, accountId?: string): Promise<T>;
473
503
  private sleep;
474
504
  private logRequest;
475
505
  private logResponse;
@@ -11,7 +11,7 @@ import { V as Vendor } from './Vendor-DYh_bzwo.js';
11
11
  */
12
12
 
13
13
  /**
14
- * No authentication (for testing/mock providers)
14
+ * No authentication (for testing/mock providers and local services like Ollama)
15
15
  */
16
16
  interface NoneConnectorAuth {
17
17
  type: 'none';
@@ -204,6 +204,13 @@ interface ITokenStorage {
204
204
  * @returns True if token exists
205
205
  */
206
206
  hasToken(key: string): Promise<boolean>;
207
+ /**
208
+ * List all storage keys (for account enumeration).
209
+ * Optional — implementations that support it enable multi-account listing.
210
+ *
211
+ * @returns Array of all stored token keys
212
+ */
213
+ listKeys?(): Promise<string[]>;
207
214
  }
208
215
 
209
216
  /**
@@ -406,22 +413,43 @@ declare class Connector {
406
413
  /**
407
414
  * Get the current access token (for OAuth, JWT, or API key)
408
415
  * Handles automatic refresh if needed
416
+ *
417
+ * @param userId - Optional user identifier for multi-user support
418
+ * @param accountId - Optional account alias for multi-account support (e.g., 'work', 'personal')
409
419
  */
410
- getToken(userId?: string): Promise<string>;
420
+ getToken(userId?: string, accountId?: string): Promise<string>;
411
421
  /**
412
422
  * Start OAuth authorization flow
413
423
  * Returns the URL to redirect the user to
424
+ *
425
+ * @param userId - Optional user identifier for multi-user support
426
+ * @param accountId - Optional account alias for multi-account support (e.g., 'work', 'personal')
414
427
  */
415
- startAuth(userId?: string): Promise<string>;
428
+ startAuth(userId?: string, accountId?: string): Promise<string>;
416
429
  /**
417
430
  * Handle OAuth callback
418
431
  * Call this after user is redirected back from OAuth provider
432
+ *
433
+ * @param callbackUrl - Full callback URL with code and state parameters
434
+ * @param userId - Optional user identifier (can be extracted from state if embedded)
435
+ * @param accountId - Optional account alias (can be extracted from state if embedded)
419
436
  */
420
- handleCallback(callbackUrl: string, userId?: string): Promise<void>;
437
+ handleCallback(callbackUrl: string, userId?: string, accountId?: string): Promise<void>;
421
438
  /**
422
439
  * Check if the connector has a valid token
440
+ *
441
+ * @param userId - Optional user identifier for multi-user support
442
+ * @param accountId - Optional account alias for multi-account support
443
+ */
444
+ hasValidToken(userId?: string, accountId?: string): Promise<boolean>;
445
+ /**
446
+ * List account aliases for a user on this connector.
447
+ * Only applicable for OAuth connectors with multi-account support.
448
+ *
449
+ * @param userId - Optional user identifier
450
+ * @returns Array of account aliases (e.g., ['work', 'personal'])
423
451
  */
424
- hasValidToken(userId?: string): Promise<boolean>;
452
+ listAccounts(userId?: string): Promise<string[]>;
425
453
  /**
426
454
  * Get vendor-specific options from config
427
455
  */
@@ -457,9 +485,10 @@ declare class Connector {
457
485
  * @param endpoint - API endpoint (relative to baseURL) or full URL
458
486
  * @param options - Fetch options with connector-specific settings
459
487
  * @param userId - Optional user ID for multi-user OAuth
488
+ * @param accountId - Optional account alias for multi-account OAuth
460
489
  * @returns Fetch Response
461
490
  */
462
- fetch(endpoint: string, options?: ConnectorFetchOptions, userId?: string): Promise<Response>;
491
+ fetch(endpoint: string, options?: ConnectorFetchOptions, userId?: string, accountId?: string): Promise<Response>;
463
492
  /**
464
493
  * Make an authenticated fetch request and parse JSON response
465
494
  * Throws on non-OK responses
@@ -467,9 +496,10 @@ declare class Connector {
467
496
  * @param endpoint - API endpoint (relative to baseURL) or full URL
468
497
  * @param options - Fetch options with connector-specific settings
469
498
  * @param userId - Optional user ID for multi-user OAuth
499
+ * @param accountId - Optional account alias for multi-account OAuth
470
500
  * @returns Parsed JSON response
471
501
  */
472
- fetchJSON<T = unknown>(endpoint: string, options?: ConnectorFetchOptions, userId?: string): Promise<T>;
502
+ fetchJSON<T = unknown>(endpoint: string, options?: ConnectorFetchOptions, userId?: string, accountId?: string): Promise<T>;
473
503
  private sleep;
474
504
  private logRequest;
475
505
  private logResponse;
@@ -1,4 +1,4 @@
1
- import { e as IProvider, b as Connector } from './IProvider-Br817mKc.cjs';
1
+ import { e as IProvider, b as Connector } from './IProvider-B8sqUzJG.cjs';
2
2
  import { V as Vendor } from './Vendor-DYh_bzwo.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { e as IProvider, b as Connector } from './IProvider-BUbU5UwV.js';
1
+ import { e as IProvider, b as Connector } from './IProvider-CxDUGl6n.js';
2
2
  import { V as Vendor } from './Vendor-DYh_bzwo.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- export { y as AfterToolContext, z as AgentEventName, A as AgentEvents, B as AgenticLoopEventName, D as AgenticLoopEvents, G as ApprovalResult, J as ApproveToolContext, m as AuditEntry, K as BeforeToolContext, aH as ExecutionCompleteEvent, X as ExecutionConfig, E as ExecutionContext, l as ExecutionMetrics, aI as ExecutionStartEvent, j as HistoryMode, Y as Hook, H as HookConfig, Z as HookManager, n as HookName, aJ as LLMRequestEvent, aK as LLMResponseEvent, a6 as ModifyingHook, aL as ToolCompleteEvent, an as ToolModification, aM as ToolStartEvent } from '../../index-CR5PHkck.cjs';
2
- import '../../IProvider-Br817mKc.cjs';
1
+ export { a2 as AfterToolContext, a3 as AgentEventName, w as AgentEvents, a4 as AgenticLoopEventName, a5 as AgenticLoopEvents, a6 as ApprovalResult, a7 as ApproveToolContext, z as AuditEntry, a8 as BeforeToolContext, b8 as ExecutionCompleteEvent, ah as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, b9 as ExecutionStartEvent, v as HistoryMode, ai as Hook, H as HookConfig, aj as HookManager, D as HookName, ba as LLMRequestEvent, bb as LLMResponseEvent, as as ModifyingHook, bc as ToolCompleteEvent, aO as ToolModification, bd as ToolStartEvent } from '../../index-CEjKTeSb.cjs';
2
+ import '../../IProvider-B8sqUzJG.cjs';
3
3
  import '../../Vendor-DYh_bzwo.cjs';
4
4
  import 'eventemitter3';
@@ -1,4 +1,4 @@
1
- export { y as AfterToolContext, z as AgentEventName, A as AgentEvents, B as AgenticLoopEventName, D as AgenticLoopEvents, G as ApprovalResult, J as ApproveToolContext, m as AuditEntry, K as BeforeToolContext, aH as ExecutionCompleteEvent, X as ExecutionConfig, E as ExecutionContext, l as ExecutionMetrics, aI as ExecutionStartEvent, j as HistoryMode, Y as Hook, H as HookConfig, Z as HookManager, n as HookName, aJ as LLMRequestEvent, aK as LLMResponseEvent, a6 as ModifyingHook, aL as ToolCompleteEvent, an as ToolModification, aM as ToolStartEvent } from '../../index-Cb7N9QIj.js';
2
- import '../../IProvider-BUbU5UwV.js';
1
+ export { a2 as AfterToolContext, a3 as AgentEventName, w as AgentEvents, a4 as AgenticLoopEventName, a5 as AgenticLoopEvents, a6 as ApprovalResult, a7 as ApproveToolContext, z as AuditEntry, a8 as BeforeToolContext, b8 as ExecutionCompleteEvent, ah as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, b9 as ExecutionStartEvent, v as HistoryMode, ai as Hook, H as HookConfig, aj as HookManager, D as HookName, ba as LLMRequestEvent, bb as LLMResponseEvent, as as ModifyingHook, bc as ToolCompleteEvent, aO as ToolModification, bd as ToolStartEvent } from '../../index-CzGnmqOs.js';
2
+ import '../../IProvider-CxDUGl6n.js';
3
3
  import '../../Vendor-DYh_bzwo.js';
4
4
  import 'eventemitter3';