@everworker/oneringai 0.4.3 → 0.4.5
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 +113 -13
- package/dist/capabilities/agents/index.d.cts +1 -1
- package/dist/capabilities/agents/index.d.ts +1 -1
- package/dist/capabilities/images/index.cjs.map +1 -1
- package/dist/capabilities/images/index.js.map +1 -1
- package/dist/{index-CzGnmqOs.d.ts → index-C6ApwIzB.d.ts} +323 -1
- package/dist/{index-CEjKTeSb.d.cts → index-CsQOVhqe.d.cts} +323 -1
- package/dist/index.cjs +2880 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +568 -18
- package/dist/index.d.ts +568 -18
- package/dist/index.js +2864 -37
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
|
@@ -87,7 +92,7 @@ Showcasing another amazing "built with oneringai": ["no saas" agentic business t
|
|
|
87
92
|
- 🔌 **Tool Execution Plugins** - NEW: Pluggable pipeline for logging, analytics, UI updates, custom behavior
|
|
88
93
|
- 💾 **Session Persistence** - Save and resume conversations with full state restoration
|
|
89
94
|
- 👤 **Multi-User Support** - Set `userId` once, flows automatically to all tool executions and session metadata
|
|
90
|
-
- 🔒 **
|
|
95
|
+
- 🔒 **Auth Identities** - Restrict agents to specific connectors (and accounts), composable with access policies
|
|
91
96
|
- 🤖 **Universal Agent** - ⚠️ *Deprecated* - Use `Agent` with plugins instead
|
|
92
97
|
- 🤖 **Task Agents** - ⚠️ *Deprecated* - Use `Agent` with `WorkingMemoryPluginNextGen`
|
|
93
98
|
- 🔬 **Research Agent** - ⚠️ *Deprecated* - Use `Agent` with search tools
|
|
@@ -109,10 +114,13 @@ 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
|
|
|
115
|
-
> **v0.2.0 — Multi-User Support:** Set `userId` once on an agent and it automatically flows to all tool executions, OAuth token retrieval, session metadata, and connector scoping. Combine with `
|
|
123
|
+
> **v0.2.0 — Multi-User Support:** Set `userId` once on an agent and it automatically flows to all tool executions, OAuth token retrieval, session metadata, and connector scoping. Combine with `identities` and access policies for complete multi-tenant isolation. See [Multi-User Support](#multi-user-support-userid) and [Auth Identities](#auth-identities-identities) in the User Guide.
|
|
116
124
|
|
|
117
125
|
## Quick Start
|
|
118
126
|
|
|
@@ -446,7 +454,10 @@ const agent = Agent.create({
|
|
|
446
454
|
connector: 'openai',
|
|
447
455
|
model: 'gpt-4',
|
|
448
456
|
userId: 'user-123', // Flows to all tool executions automatically
|
|
449
|
-
|
|
457
|
+
identities: [ // Only these connectors visible to tools
|
|
458
|
+
{ connector: 'github' },
|
|
459
|
+
{ connector: 'slack' },
|
|
460
|
+
],
|
|
450
461
|
tools: [weatherTool, emailTool],
|
|
451
462
|
context: {
|
|
452
463
|
features: {
|
|
@@ -677,7 +688,7 @@ const agent = Agent.create({
|
|
|
677
688
|
},
|
|
678
689
|
});
|
|
679
690
|
|
|
680
|
-
// Agent now has memory_store, memory_retrieve, memory_delete,
|
|
691
|
+
// Agent now has memory_store, memory_retrieve, memory_delete, memory_query tools
|
|
681
692
|
await agent.run('Check weather for SF and remember the result');
|
|
682
693
|
```
|
|
683
694
|
|
|
@@ -785,9 +796,11 @@ const agent = Agent.create({
|
|
|
785
796
|
**Available Features:**
|
|
786
797
|
| Feature | Default | Plugin | Associated Tools |
|
|
787
798
|
|---------|---------|--------|------------------|
|
|
788
|
-
| `workingMemory` | `true` | WorkingMemoryPluginNextGen | `memory_store/retrieve/delete/
|
|
799
|
+
| `workingMemory` | `true` | WorkingMemoryPluginNextGen | `memory_store/retrieve/delete/query/cleanup_raw` |
|
|
789
800
|
| `inContextMemory` | `false` | InContextMemoryPluginNextGen | `context_set/delete/list` |
|
|
790
801
|
| `persistentInstructions` | `false` | PersistentInstructionsPluginNextGen | `instructions_set/remove/list/clear` |
|
|
802
|
+
| `userInfo` | `false` | UserInfoPluginNextGen | `user_info_set/get/remove/clear`, `todo_add/update/remove` |
|
|
803
|
+
| `toolCatalog` | `false` | ToolCatalogPluginNextGen | `tool_catalog_search/load/unload` |
|
|
791
804
|
|
|
792
805
|
**AgentContextNextGen architecture:**
|
|
793
806
|
- **Plugin-first design** - All features are composable plugins
|
|
@@ -910,13 +923,20 @@ const agent = Agent.create({
|
|
|
910
923
|
- 👥 **User-Scoped** - Data is per-user, not per-agent — different agents share the same user data
|
|
911
924
|
- 🔧 **LLM-Modifiable** - Agent can update user info during execution
|
|
912
925
|
|
|
913
|
-
**
|
|
926
|
+
**User Info Tools:**
|
|
914
927
|
- `user_info_set` - Store/update user information by key (`key`, `value`, `description?`)
|
|
915
928
|
- `user_info_get` - Retrieve one entry by key, or all entries if no key
|
|
916
929
|
- `user_info_remove` - Remove a specific entry
|
|
917
930
|
- `user_info_clear` - Clear all entries (requires confirmation)
|
|
918
931
|
|
|
919
|
-
**
|
|
932
|
+
**TODO Tools** (built into the same plugin):
|
|
933
|
+
- `todo_add` - Create a TODO (`title`, `description?`, `people?`, `dueDate?`, `tags?`)
|
|
934
|
+
- `todo_update` - Update a TODO (`id`, plus any fields to change including `status: 'done'`)
|
|
935
|
+
- `todo_remove` - Delete a TODO by id
|
|
936
|
+
|
|
937
|
+
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.
|
|
938
|
+
|
|
939
|
+
**Use cases:** User preferences (theme, language, timezone), user context (role, location), accumulated knowledge about the user, task/TODO tracking with deadlines and people.
|
|
920
940
|
|
|
921
941
|
### 11. Direct LLM Access
|
|
922
942
|
|
|
@@ -954,7 +974,7 @@ for await (const event of agent.streamDirect('Tell me a story')) {
|
|
|
954
974
|
|
|
955
975
|
**Comparison:**
|
|
956
976
|
|
|
957
|
-
| Aspect | `run()`
|
|
977
|
+
| Aspect | `run()` | `runDirect()` |
|
|
958
978
|
|--------|-------------------|---------------|
|
|
959
979
|
| History tracking | ✅ | ❌ |
|
|
960
980
|
| Memory/Cache | ✅ | ❌ |
|
|
@@ -1311,7 +1331,7 @@ const routine = createRoutineDefinition({
|
|
|
1311
1331
|
description: 'Process each item',
|
|
1312
1332
|
controlFlow: {
|
|
1313
1333
|
type: 'map',
|
|
1314
|
-
|
|
1334
|
+
source: '__items',
|
|
1315
1335
|
resultKey: '__results',
|
|
1316
1336
|
iterationTimeoutMs: 60000, // 1 min per item
|
|
1317
1337
|
tasks: [{ name: 'Process', description: 'Handle the current item' }],
|
|
@@ -1320,6 +1340,46 @@ const routine = createRoutineDefinition({
|
|
|
1320
1340
|
});
|
|
1321
1341
|
```
|
|
1322
1342
|
|
|
1343
|
+
**Execution Recording:** Persist full execution history (steps, task snapshots, progress) with `createExecutionRecorder()`. Replaces ~140 lines of manual hook wiring with a single factory call:
|
|
1344
|
+
|
|
1345
|
+
```typescript
|
|
1346
|
+
import {
|
|
1347
|
+
createRoutineExecutionRecord, createExecutionRecorder,
|
|
1348
|
+
type IRoutineExecutionStorage,
|
|
1349
|
+
} from '@everworker/oneringai';
|
|
1350
|
+
|
|
1351
|
+
const record = createRoutineExecutionRecord(definition, 'openai', 'gpt-4');
|
|
1352
|
+
const execId = await storage.insert(userId, record);
|
|
1353
|
+
const recorder = createExecutionRecorder({ storage, executionId: execId });
|
|
1354
|
+
|
|
1355
|
+
executeRoutine({
|
|
1356
|
+
definition, agent, inputs,
|
|
1357
|
+
hooks: recorder.hooks,
|
|
1358
|
+
onTaskStarted: recorder.onTaskStarted,
|
|
1359
|
+
onTaskComplete: recorder.onTaskComplete,
|
|
1360
|
+
onTaskFailed: recorder.onTaskFailed,
|
|
1361
|
+
onTaskValidation: recorder.onTaskValidation,
|
|
1362
|
+
})
|
|
1363
|
+
.then(exec => recorder.finalize(exec))
|
|
1364
|
+
.catch(err => recorder.finalize(null, err));
|
|
1365
|
+
```
|
|
1366
|
+
|
|
1367
|
+
**Scheduling & Triggers:** Run routines on a timer or from external events:
|
|
1368
|
+
|
|
1369
|
+
```typescript
|
|
1370
|
+
import { SimpleScheduler, EventEmitterTrigger } from '@everworker/oneringai';
|
|
1371
|
+
|
|
1372
|
+
// Schedule: run every hour
|
|
1373
|
+
const scheduler = new SimpleScheduler();
|
|
1374
|
+
scheduler.schedule('hourly-report', { intervalMs: 3600000 }, () => executeRoutine({ ... }));
|
|
1375
|
+
|
|
1376
|
+
// Event trigger: run from webhook
|
|
1377
|
+
const trigger = new EventEmitterTrigger();
|
|
1378
|
+
trigger.on('new-order', (payload) => executeRoutine({ ... }));
|
|
1379
|
+
// In your webhook handler:
|
|
1380
|
+
trigger.emit('new-order', { orderId: '123' });
|
|
1381
|
+
```
|
|
1382
|
+
|
|
1323
1383
|
**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
1384
|
|
|
1325
1385
|
```typescript
|
|
@@ -1582,6 +1642,46 @@ await agent.run('Find available meeting slots for alice and bob this week');
|
|
|
1582
1642
|
|
|
1583
1643
|
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
1644
|
|
|
1645
|
+
### 23. Tool Catalog (NEW)
|
|
1646
|
+
|
|
1647
|
+
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:
|
|
1648
|
+
|
|
1649
|
+
```typescript
|
|
1650
|
+
import { Agent, ToolCatalogRegistry } from '@everworker/oneringai';
|
|
1651
|
+
|
|
1652
|
+
// Register custom categories (built-in tools auto-register)
|
|
1653
|
+
ToolCatalogRegistry.registerCategory({
|
|
1654
|
+
name: 'knowledge',
|
|
1655
|
+
displayName: 'Knowledge Graph',
|
|
1656
|
+
description: 'Search entities, get facts, manage references',
|
|
1657
|
+
});
|
|
1658
|
+
ToolCatalogRegistry.registerTools('knowledge', [
|
|
1659
|
+
{ name: 'entity_search', displayName: 'Entity Search', description: 'Search entities', tool: entitySearchTool, safeByDefault: true },
|
|
1660
|
+
]);
|
|
1661
|
+
|
|
1662
|
+
// Enable tool catalog on an agent
|
|
1663
|
+
const agent = Agent.create({
|
|
1664
|
+
connector: 'openai',
|
|
1665
|
+
model: 'gpt-4',
|
|
1666
|
+
context: {
|
|
1667
|
+
features: { toolCatalog: true },
|
|
1668
|
+
toolCategories: ['filesystem', 'knowledge'], // optional scope
|
|
1669
|
+
},
|
|
1670
|
+
});
|
|
1671
|
+
|
|
1672
|
+
// Agent gets 3 metatools: tool_catalog_search, tool_catalog_load, tool_catalog_unload
|
|
1673
|
+
// It can browse categories, load what it needs, and unload when done
|
|
1674
|
+
await agent.run('Search for information about quantum computing');
|
|
1675
|
+
```
|
|
1676
|
+
|
|
1677
|
+
**Key Features:**
|
|
1678
|
+
- **Dynamic loading** — Agent loads only needed categories, saving token budget
|
|
1679
|
+
- **Category scoping** — Restrict visible categories per agent (allowlist/blocklist)
|
|
1680
|
+
- **Connector discovery** — Connector tools auto-discovered as categories
|
|
1681
|
+
- **Registry API** — `ToolCatalogRegistry.resolveTools()` for app-level tool resolution
|
|
1682
|
+
|
|
1683
|
+
See the [User Guide](./USER_GUIDE.md#tool-catalog) for full documentation.
|
|
1684
|
+
|
|
1585
1685
|
---
|
|
1586
1686
|
|
|
1587
1687
|
## MCP (Model Context Protocol) Integration
|
|
@@ -1730,4 +1830,4 @@ MIT License - See [LICENSE](./LICENSE) file.
|
|
|
1730
1830
|
|
|
1731
1831
|
---
|
|
1732
1832
|
|
|
1733
|
-
**Version:** 0.4.
|
|
1833
|
+
**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 {
|
|
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-CsQOVhqe.cjs';
|
|
2
2
|
import '../../IProvider-B8sqUzJG.cjs';
|
|
3
3
|
import '../../Vendor-DYh_bzwo.cjs';
|
|
4
4
|
import 'eventemitter3';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
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-C6ApwIzB.js';
|
|
2
2
|
import '../../IProvider-CxDUGl6n.js';
|
|
3
3
|
import '../../Vendor-DYh_bzwo.js';
|
|
4
4
|
import 'eventemitter3';
|