@everworker/oneringai 0.3.1 → 0.3.2

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
@@ -22,15 +22,16 @@
22
22
  - [7. Context Management](#7-context-management)
23
23
  - [8. InContextMemory](#8-incontextmemory)
24
24
  - [9. Persistent Instructions](#9-persistent-instructions)
25
- - [10. Direct LLM Access](#10-direct-llm-access)
26
- - [11. Audio Capabilities](#11-audio-capabilities)
27
- - [12. Model Registry](#12-model-registry)
28
- - [13. Streaming](#13-streaming)
29
- - [14. OAuth for External APIs](#14-oauth-for-external-apis)
30
- - [15. Developer Tools](#15-developer-tools)
31
- - [16. Custom Tool Generation](#16-custom-tool-generation-new) — Agents create, test, and persist their own tools
32
- - [17. Document Reader](#17-document-reader) — PDF, DOCX, XLSX, PPTX, CSV, HTML, images
33
- - [18. External API Integration](#18-external-api-integration) — Scoped Registry, Vendor Templates, Tool Discovery
25
+ - [10. User Info](#10-user-info)
26
+ - [11. Direct LLM Access](#11-direct-llm-access)
27
+ - [12. Audio Capabilities](#12-audio-capabilities)
28
+ - [13. Model Registry](#13-model-registry)
29
+ - [14. Streaming](#14-streaming)
30
+ - [15. OAuth for External APIs](#15-oauth-for-external-apis)
31
+ - [16. Developer Tools](#16-developer-tools)
32
+ - [17. Custom Tool Generation](#17-custom-tool-generation-new) — Agents create, test, and persist their own tools
33
+ - [18. Document Reader](#18-document-reader) — PDF, DOCX, XLSX, PPTX, CSV, HTML, images
34
+ - [19. External API Integration](#19-external-api-integration) — Scoped Registry, Vendor Templates, Tool Discovery
34
35
  - [MCP Integration](#mcp-model-context-protocol-integration)
35
36
  - [Documentation](#documentation)
36
37
  - [Examples](#examples)
@@ -87,6 +88,7 @@ Better to see once and then dig in the code! :)
87
88
  - 🎯 **Context Management** - Algorithmic compaction with tool-result-to-memory offloading
88
89
  - 📌 **InContextMemory** - Live key-value storage directly in LLM context with optional UI display (`showInUI`)
89
90
  - 📝 **Persistent Instructions** - NEW: Agent-level custom instructions that persist across sessions on disk
91
+ - 👤 **User Info Plugin** - NEW: Per-user preferences/context automatically injected into LLM context, shared across agents
90
92
  - 🛠️ **Agentic Workflows** - Built-in tool calling and multi-turn conversations
91
93
  - 🔧 **Developer Tools** - NEW: Filesystem and shell tools for coding assistants (read, write, edit, grep, glob, bash)
92
94
  - 🧰 **Custom Tool Generation** - NEW: Let agents create, test, and persist their own reusable tools at runtime — complete meta-tool system with VM sandbox
@@ -870,7 +872,44 @@ const agent = Agent.create({
870
872
 
871
873
  **Use cases:** Agent personality/behavior, user preferences, learned rules, tool usage patterns.
872
874
 
873
- ### 10. Direct LLM Access
875
+ ### 10. User Info
876
+
877
+ Store user-specific preferences and context that are automatically injected into the LLM system message:
878
+
879
+ ```typescript
880
+ import { Agent } from '@everworker/oneringai';
881
+
882
+ const agent = Agent.create({
883
+ connector: 'openai',
884
+ model: 'gpt-4',
885
+ userId: 'alice', // Optional — defaults to 'default' user
886
+ context: {
887
+ features: {
888
+ userInfo: true,
889
+ },
890
+ },
891
+ });
892
+
893
+ // LLM can now use user_info_set/get/remove/clear tools
894
+ // Data persists to ~/.oneringai/users/alice/user_info.json
895
+ // All entries are automatically shown in context — no need to call user_info_get each turn
896
+ ```
897
+
898
+ **Key Features:**
899
+ - 📁 **Disk Persistence** - User info survives process restarts and sessions
900
+ - 🔄 **Auto-Inject** - Entries rendered as markdown and included in the system message automatically
901
+ - 👥 **User-Scoped** - Data is per-user, not per-agent — different agents share the same user data
902
+ - 🔧 **LLM-Modifiable** - Agent can update user info during execution
903
+
904
+ **Available Tools:**
905
+ - `user_info_set` - Store/update user information by key (`key`, `value`, `description?`)
906
+ - `user_info_get` - Retrieve one entry by key, or all entries if no key
907
+ - `user_info_remove` - Remove a specific entry
908
+ - `user_info_clear` - Clear all entries (requires confirmation)
909
+
910
+ **Use cases:** User preferences (theme, language, timezone), user context (role, location), accumulated knowledge about the user.
911
+
912
+ ### 11. Direct LLM Access
874
913
 
875
914
  Bypass all context management for simple, stateless LLM calls:
876
915
 
@@ -916,7 +955,7 @@ for await (const event of agent.streamDirect('Tell me a story')) {
916
955
 
917
956
  **Use cases:** Quick one-off queries, embeddings-like simplicity, testing, hybrid workflows.
918
957
 
919
- ### 11. Audio Capabilities
958
+ ### 12. Audio Capabilities
920
959
 
921
960
  Text-to-Speech and Speech-to-Text with multiple providers:
922
961
 
@@ -965,7 +1004,7 @@ const english = await stt.translate(frenchAudio);
965
1004
  - **TTS**: OpenAI (`tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`), Google (`gemini-tts`)
966
1005
  - **STT**: OpenAI (`whisper-1`, `gpt-4o-transcribe`), Groq (`whisper-large-v3` - 12x cheaper!)
967
1006
 
968
- ### 12. Model Registry
1007
+ ### 13. Model Registry
969
1008
 
970
1009
  Complete metadata for 23+ models:
971
1010
 
@@ -994,7 +1033,7 @@ console.log(`Cached: $${cachedCost}`); // $0.0293 (90% discount)
994
1033
  - **Google (7)**: Gemini 3, Gemini 2.5
995
1034
  - **Grok (9)**: Grok 4.1, Grok 4, Grok Code, Grok 3, Grok 2 Vision
996
1035
 
997
- ### 13. Streaming
1036
+ ### 14. Streaming
998
1037
 
999
1038
  Real-time responses:
1000
1039
 
@@ -1006,7 +1045,7 @@ for await (const text of StreamHelpers.textOnly(agent.stream('Hello'))) {
1006
1045
  }
1007
1046
  ```
1008
1047
 
1009
- ### 14. OAuth for External APIs
1048
+ ### 15. OAuth for External APIs
1010
1049
 
1011
1050
  ```typescript
1012
1051
  import { OAuthManager, FileStorage } from '@everworker/oneringai';
@@ -1023,7 +1062,7 @@ const oauth = new OAuthManager({
1023
1062
  const authUrl = await oauth.startAuthFlow('user123');
1024
1063
  ```
1025
1064
 
1026
- ### 15. Developer Tools
1065
+ ### 16. Developer Tools
1027
1066
 
1028
1067
  File system and shell tools for building coding assistants:
1029
1068
 
@@ -1065,7 +1104,7 @@ await agent.run('Run npm test and report any failures');
1065
1104
  - Timeout protection (default 2 min)
1066
1105
  - Output truncation for large outputs
1067
1106
 
1068
- ### 16. Custom Tool Generation (NEW)
1107
+ ### 17. Custom Tool Generation (NEW)
1069
1108
 
1070
1109
  Let agents **create their own tools** at runtime — draft, test, iterate, save, and reuse. The agent writes JavaScript code, validates it, tests it in the VM sandbox, and persists it for future use. All 6 meta-tools are auto-registered and visible in Hosea.
1071
1110
 
@@ -1085,7 +1124,7 @@ await agent.run('Create a tool that fetches weather data from the OpenWeather AP
1085
1124
  // Later: load and use a saved tool
1086
1125
  import { createFileCustomToolStorage } from '@everworker/oneringai';
1087
1126
  const storage = createFileCustomToolStorage();
1088
- const definition = await storage.load('fetch_weather');
1127
+ const definition = await storage.load(undefined, 'fetch_weather'); // undefined = default user
1089
1128
  const weatherTool = hydrateCustomTool(definition!);
1090
1129
 
1091
1130
  // Register on any agent
@@ -1096,11 +1135,11 @@ agent.tools.register(weatherTool, { source: 'custom', tags: ['weather', 'api'] }
1096
1135
 
1097
1136
  **Dynamic Descriptions:** Draft and test tools use `descriptionFactory` to show all available connectors and the full sandbox API — automatically updated when connectors are added or removed.
1098
1137
 
1099
- **Pluggable Storage:** Default `FileCustomToolStorage` saves to `~/.oneringai/custom-tools/`. Implement `ICustomToolStorage` for MongoDB, S3, or any backend.
1138
+ **Pluggable Storage:** Default `FileCustomToolStorage` saves to `~/.oneringai/users/<userId>/custom-tools/` (defaults to `~/.oneringai/users/default/custom-tools/` when no userId). Implement `ICustomToolStorage` for MongoDB, S3, or any backend.
1100
1139
 
1101
1140
  > See the [User Guide](./USER_GUIDE.md#custom-tool-generation) for the complete workflow, sandbox API reference, and examples.
1102
1141
 
1103
- ### 17. Desktop Automation Tools (NEW)
1142
+ ### 18. Desktop Automation Tools (NEW)
1104
1143
 
1105
1144
  OS-level desktop automation for building "computer use" agents — screenshot the screen, send to a vision model, receive tool calls (click, type, etc.), execute them, repeat:
1106
1145
 
@@ -1136,7 +1175,7 @@ await agent.run('Open Safari and search for "weather forecast"');
1136
1175
  - Screenshots use the `__images` convention for automatic multimodal handling across all providers (Anthropic, OpenAI, Google)
1137
1176
  - Requires `@nut-tree-fork/nut-js` as an optional peer dependency: `npm install @nut-tree-fork/nut-js`
1138
1177
 
1139
- ### 18. Document Reader
1178
+ ### 19. Document Reader
1140
1179
 
1141
1180
  Universal file-to-LLM-content converter. Reads arbitrary document formats and produces clean markdown text with optional image extraction:
1142
1181
 
@@ -1201,7 +1240,7 @@ await agent.run([
1201
1240
 
1202
1241
  See the [User Guide](./USER_GUIDE.md#document-reader) for complete API reference and configuration options.
1203
1242
 
1204
- ### 19. External API Integration
1243
+ ### 20. External API Integration
1205
1244
 
1206
1245
  Connect your AI agents to 35+ external services with enterprise-grade resilience:
1207
1246