@everworker/oneringai 0.4.3 → 0.4.4

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
@@ -34,6 +34,7 @@
34
34
  - [20. Routine Execution](#20-routine-execution) — Multi-step workflows with task dependencies, validation, and memory bridging
35
35
  - [21. External API Integration](#21-external-api-integration) — Scoped Registry, Vendor Templates, Tool Discovery
36
36
  - [22. Microsoft Graph Connector Tools](#22-microsoft-graph-connector-tools-new) — Email, calendar, meetings, and Teams transcripts
37
+ - [23. Tool Catalog](#23-tool-catalog-new) — Dynamic tool loading/unloading for agents with 100+ tools
37
38
  - [MCP Integration](#mcp-model-context-protocol-integration)
38
39
  - [Documentation](#documentation)
39
40
  - [Examples](#examples)
@@ -54,12 +55,16 @@
54
55
  | **[User Guide](./USER_GUIDE.md)** | Comprehensive guide covering every feature with examples — connectors, agents, context, plugins, audio, video, search, MCP, OAuth, and more |
55
56
  | **[API Reference](./API_REFERENCE.md)** | Auto-generated reference for all 600+ public exports — classes, interfaces, types, and functions with signatures |
56
57
  | [CHANGELOG](./CHANGELOG.md) | Version history and migration notes |
57
- | [MCP Integration](./MCP_INTEGRATION.md) | Model Context Protocol setup and usage |
58
- | [Architecture (CLAUDE.md)](./CLAUDE.md) | Internal architecture guide |
59
- | [Testing Guide](./TESTING.md) | How to run and write tests |
60
58
 
61
59
  ---
62
60
 
61
+ ## Tutorial / Architecture Series
62
+
63
+ **Part 0**. [One Lib to Rule Them All: Why We Built OneRingAI](https://medium.com/superstringtheory/one-library-to-rule-them-all-why-we-built-oneringai-689f904874d6): introduction and architecture overview
64
+
65
+ **Part 1**. [Your AI Agent Forgets Everything. Here’s How We Fixed It.](https://medium.com/superstringtheory/your-ai-agent-forgets-everything-heres-how-we-fixed-it-276b39aedbb3): context management plugins
66
+
67
+
63
68
  ## HOSEA APP
64
69
  We realize that library alone in these times is not enough to get you excited, so we built a FREE FOREVER desktop app on top of this library to showcase its power! It's as easy to start using as cloning this library's repo, and then `cd apps/hosea` and then `npm install` and then `npm run dev`. Or watch the video first:
65
70
 
@@ -109,6 +114,9 @@ Showcasing another amazing "built with oneringai": ["no saas" agentic business t
109
114
  - 📦 **Vendor Templates** - NEW: Pre-configured auth templates for 43+ services (GitHub, Slack, Stripe, etc.)
110
115
  - 📧 **Microsoft Graph Tools** - NEW: Email, calendar, meetings, and Teams transcripts via Microsoft Graph API
111
116
  - 🔁 **Routine Execution** - NEW: Multi-step workflows with task dependencies, LLM validation, retry logic, and memory bridging between tasks
117
+ - 📊 **Execution Recording** - NEW: Persist full routine execution history with `createExecutionRecorder()` — replaces manual hook wiring
118
+ - ⏰ **Scheduling & Triggers** - NEW: `SimpleScheduler` for interval/one-time schedules, `EventEmitterTrigger` for webhook/queue-driven execution
119
+ - 📦 **Tool Catalog** - NEW: Dynamic tool loading/unloading — agents discover and load only the categories they need at runtime
112
120
  - 🔄 **Streaming** - Real-time responses with event streams
113
121
  - 📝 **TypeScript** - Full type safety and IntelliSense support
114
122
 
@@ -788,6 +796,8 @@ const agent = Agent.create({
788
796
  | `workingMemory` | `true` | WorkingMemoryPluginNextGen | `memory_store/retrieve/delete/list` |
789
797
  | `inContextMemory` | `false` | InContextMemoryPluginNextGen | `context_set/delete/list` |
790
798
  | `persistentInstructions` | `false` | PersistentInstructionsPluginNextGen | `instructions_set/remove/list/clear` |
799
+ | `userInfo` | `false` | UserInfoPluginNextGen | `user_info_set/get/remove/clear`, `todo_add/update/remove` |
800
+ | `toolCatalog` | `false` | ToolCatalogPluginNextGen | `tool_catalog_search/load/unload` |
791
801
 
792
802
  **AgentContextNextGen architecture:**
793
803
  - **Plugin-first design** - All features are composable plugins
@@ -910,13 +920,20 @@ const agent = Agent.create({
910
920
  - 👥 **User-Scoped** - Data is per-user, not per-agent — different agents share the same user data
911
921
  - 🔧 **LLM-Modifiable** - Agent can update user info during execution
912
922
 
913
- **Available Tools:**
923
+ **User Info Tools:**
914
924
  - `user_info_set` - Store/update user information by key (`key`, `value`, `description?`)
915
925
  - `user_info_get` - Retrieve one entry by key, or all entries if no key
916
926
  - `user_info_remove` - Remove a specific entry
917
927
  - `user_info_clear` - Clear all entries (requires confirmation)
918
928
 
919
- **Use cases:** User preferences (theme, language, timezone), user context (role, location), accumulated knowledge about the user.
929
+ **TODO Tools** (built into the same plugin):
930
+ - `todo_add` - Create a TODO (`title`, `description?`, `people?`, `dueDate?`, `tags?`)
931
+ - `todo_update` - Update a TODO (`id`, plus any fields to change including `status: 'done'`)
932
+ - `todo_remove` - Delete a TODO by id
933
+
934
+ TODOs are stored alongside user info and rendered in a separate **"Current TODOs"** checklist in context. The agent proactively suggests creating TODOs when conversation implies action items, reminds about due/overdue items once per day, and auto-cleans completed TODOs after 48 hours.
935
+
936
+ **Use cases:** User preferences (theme, language, timezone), user context (role, location), accumulated knowledge about the user, task/TODO tracking with deadlines and people.
920
937
 
921
938
  ### 11. Direct LLM Access
922
939
 
@@ -1311,7 +1328,7 @@ const routine = createRoutineDefinition({
1311
1328
  description: 'Process each item',
1312
1329
  controlFlow: {
1313
1330
  type: 'map',
1314
- sourceKey: '__items',
1331
+ source: '__items',
1315
1332
  resultKey: '__results',
1316
1333
  iterationTimeoutMs: 60000, // 1 min per item
1317
1334
  tasks: [{ name: 'Process', description: 'Handle the current item' }],
@@ -1320,6 +1337,46 @@ const routine = createRoutineDefinition({
1320
1337
  });
1321
1338
  ```
1322
1339
 
1340
+ **Execution Recording:** Persist full execution history (steps, task snapshots, progress) with `createExecutionRecorder()`. Replaces ~140 lines of manual hook wiring with a single factory call:
1341
+
1342
+ ```typescript
1343
+ import {
1344
+ createRoutineExecutionRecord, createExecutionRecorder,
1345
+ type IRoutineExecutionStorage,
1346
+ } from '@everworker/oneringai';
1347
+
1348
+ const record = createRoutineExecutionRecord(definition, 'openai', 'gpt-4');
1349
+ const execId = await storage.insert(userId, record);
1350
+ const recorder = createExecutionRecorder({ storage, executionId: execId });
1351
+
1352
+ executeRoutine({
1353
+ definition, agent, inputs,
1354
+ hooks: recorder.hooks,
1355
+ onTaskStarted: recorder.onTaskStarted,
1356
+ onTaskComplete: recorder.onTaskComplete,
1357
+ onTaskFailed: recorder.onTaskFailed,
1358
+ onTaskValidation: recorder.onTaskValidation,
1359
+ })
1360
+ .then(exec => recorder.finalize(exec))
1361
+ .catch(err => recorder.finalize(null, err));
1362
+ ```
1363
+
1364
+ **Scheduling & Triggers:** Run routines on a timer or from external events:
1365
+
1366
+ ```typescript
1367
+ import { SimpleScheduler, EventEmitterTrigger } from '@everworker/oneringai';
1368
+
1369
+ // Schedule: run every hour
1370
+ const scheduler = new SimpleScheduler();
1371
+ scheduler.schedule('hourly-report', { intervalMs: 3600000 }, () => executeRoutine({ ... }));
1372
+
1373
+ // Event trigger: run from webhook
1374
+ const trigger = new EventEmitterTrigger();
1375
+ trigger.on('new-order', (payload) => executeRoutine({ ... }));
1376
+ // In your webhook handler:
1377
+ trigger.emit('new-order', { orderId: '123' });
1378
+ ```
1379
+
1323
1380
  **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`.
1324
1381
 
1325
1382
  ```typescript
@@ -1582,6 +1639,46 @@ await agent.run('Find available meeting slots for alice and bob this week');
1582
1639
 
1583
1640
  Supports both **delegated** (`/me` — user signs in) and **application** (`/users/{id}` — app-only) permission modes. See the [User Guide](./USER_GUIDE.md#microsoft-graph-connector-tools) for full parameter reference.
1584
1641
 
1642
+ ### 23. Tool Catalog (NEW)
1643
+
1644
+ When agents have 100+ available tools, sending all definitions to the LLM wastes tokens and degrades performance. The Tool Catalog lets agents discover and load only the categories they need:
1645
+
1646
+ ```typescript
1647
+ import { Agent, ToolCatalogRegistry } from '@everworker/oneringai';
1648
+
1649
+ // Register custom categories (built-in tools auto-register)
1650
+ ToolCatalogRegistry.registerCategory({
1651
+ name: 'knowledge',
1652
+ displayName: 'Knowledge Graph',
1653
+ description: 'Search entities, get facts, manage references',
1654
+ });
1655
+ ToolCatalogRegistry.registerTools('knowledge', [
1656
+ { name: 'entity_search', displayName: 'Entity Search', description: 'Search entities', tool: entitySearchTool, safeByDefault: true },
1657
+ ]);
1658
+
1659
+ // Enable tool catalog on an agent
1660
+ const agent = Agent.create({
1661
+ connector: 'openai',
1662
+ model: 'gpt-4',
1663
+ context: {
1664
+ features: { toolCatalog: true },
1665
+ },
1666
+ toolCategories: ['filesystem', 'knowledge'], // optional scope
1667
+ });
1668
+
1669
+ // Agent gets 3 metatools: tool_catalog_search, tool_catalog_load, tool_catalog_unload
1670
+ // It can browse categories, load what it needs, and unload when done
1671
+ await agent.run('Search for information about quantum computing');
1672
+ ```
1673
+
1674
+ **Key Features:**
1675
+ - **Dynamic loading** — Agent loads only needed categories, saving token budget
1676
+ - **Category scoping** — Restrict visible categories per agent (allowlist/blocklist)
1677
+ - **Connector discovery** — Connector tools auto-discovered as categories
1678
+ - **Registry API** — `ToolCatalogRegistry.resolveTools()` for app-level tool resolution
1679
+
1680
+ See the [User Guide](./USER_GUIDE.md#tool-catalog) for full documentation.
1681
+
1585
1682
  ---
1586
1683
 
1587
1684
  ## MCP (Model Context Protocol) Integration
@@ -1730,4 +1827,4 @@ MIT License - See [LICENSE](./LICENSE) file.
1730
1827
 
1731
1828
  ---
1732
1829
 
1733
- **Version:** 0.4.3 | **Last Updated:** 2026-02-25 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
1830
+ **Version:** 0.4.4 | **Last Updated:** 2026-02-26 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
@@ -1,4 +1,4 @@
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';
1
+ export { a3 as AfterToolContext, a4 as AgentEventName, w as AgentEvents, a5 as AgenticLoopEventName, a6 as AgenticLoopEvents, a7 as ApprovalResult, a8 as ApproveToolContext, z as AuditEntry, a9 as BeforeToolContext, be as ExecutionCompleteEvent, al as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, bf as ExecutionStartEvent, v as HistoryMode, am as Hook, H as HookConfig, an as HookManager, D as HookName, bg as LLMRequestEvent, bh as LLMResponseEvent, aw as ModifyingHook, bi as ToolCompleteEvent, aU as ToolModification, bj as ToolStartEvent } from '../../index-DmYrHH7d.cjs';
2
2
  import '../../IProvider-B8sqUzJG.cjs';
3
3
  import '../../Vendor-DYh_bzwo.cjs';
4
4
  import 'eventemitter3';
@@ -1,4 +1,4 @@
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';
1
+ export { a3 as AfterToolContext, a4 as AgentEventName, w as AgentEvents, a5 as AgenticLoopEventName, a6 as AgenticLoopEvents, a7 as ApprovalResult, a8 as ApproveToolContext, z as AuditEntry, a9 as BeforeToolContext, be as ExecutionCompleteEvent, al as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, bf as ExecutionStartEvent, v as HistoryMode, am as Hook, H as HookConfig, an as HookManager, D as HookName, bg as LLMRequestEvent, bh as LLMResponseEvent, aw as ModifyingHook, bi as ToolCompleteEvent, aU as ToolModification, bj as ToolStartEvent } from '../../index-Dyl6pHfq.js';
2
2
  import '../../IProvider-CxDUGl6n.js';
3
3
  import '../../Vendor-DYh_bzwo.js';
4
4
  import 'eventemitter3';