@dcyfr/ai 3.0.1 → 3.0.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +11 -30
  3. package/README.md +216 -145
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/ai/agents/agent-router.d.ts.map +1 -1
  6. package/dist/ai/agents/agent-router.js +3 -1
  7. package/dist/ai/agents/agent-router.js.map +1 -1
  8. package/dist/ai/config/loader.d.ts +5 -1
  9. package/dist/ai/config/loader.d.ts.map +1 -1
  10. package/dist/ai/config/loader.js +24 -4
  11. package/dist/ai/config/loader.js.map +1 -1
  12. package/dist/ai/core/provider-registry.d.ts +9 -1
  13. package/dist/ai/core/provider-registry.d.ts.map +1 -1
  14. package/dist/ai/core/provider-registry.js +97 -138
  15. package/dist/ai/core/provider-registry.js.map +1 -1
  16. package/dist/ai/core/telemetry-engine.d.ts +1 -1
  17. package/dist/ai/core/telemetry-engine.d.ts.map +1 -1
  18. package/dist/ai/core/telemetry-engine.js +14 -10
  19. package/dist/ai/core/telemetry-engine.js.map +1 -1
  20. package/dist/ai/delegation/contract-manager.d.ts.map +1 -1
  21. package/dist/ai/delegation/contract-manager.js +5 -2
  22. package/dist/ai/delegation/contract-manager.js.map +1 -1
  23. package/dist/ai/delegation/execution-mode-dashboard.d.ts.map +1 -1
  24. package/dist/ai/delegation/execution-mode-dashboard.js +4 -2
  25. package/dist/ai/delegation/execution-mode-dashboard.js.map +1 -1
  26. package/dist/ai/mcp/servers/shared/utils.d.ts.map +1 -1
  27. package/dist/ai/mcp/servers/shared/utils.js +4 -2
  28. package/dist/ai/mcp/servers/shared/utils.js.map +1 -1
  29. package/dist/ai/memory/file-memory-adapter.d.ts.map +1 -1
  30. package/dist/ai/memory/file-memory-adapter.js +11 -13
  31. package/dist/ai/memory/file-memory-adapter.js.map +1 -1
  32. package/dist/ai/memory/working-memory-persistence.d.ts.map +1 -1
  33. package/dist/ai/memory/working-memory-persistence.js +4 -2
  34. package/dist/ai/memory/working-memory-persistence.js.map +1 -1
  35. package/dist/ai/metacognition/config.d.ts +41 -0
  36. package/dist/ai/metacognition/config.d.ts.map +1 -0
  37. package/dist/ai/metacognition/config.js +51 -0
  38. package/dist/ai/metacognition/config.js.map +1 -0
  39. package/dist/ai/metacognition/governance.d.ts +68 -0
  40. package/dist/ai/metacognition/governance.d.ts.map +1 -0
  41. package/dist/ai/metacognition/governance.js +118 -0
  42. package/dist/ai/metacognition/governance.js.map +1 -0
  43. package/dist/ai/metacognition/index.d.ts +24 -0
  44. package/dist/ai/metacognition/index.d.ts.map +1 -0
  45. package/dist/ai/metacognition/index.js +18 -0
  46. package/dist/ai/metacognition/index.js.map +1 -0
  47. package/dist/ai/metacognition/ledger.d.ts +121 -0
  48. package/dist/ai/metacognition/ledger.d.ts.map +1 -0
  49. package/dist/ai/metacognition/ledger.js +268 -0
  50. package/dist/ai/metacognition/ledger.js.map +1 -0
  51. package/dist/ai/metacognition/runtime.d.ts +205 -0
  52. package/dist/ai/metacognition/runtime.d.ts.map +1 -0
  53. package/dist/ai/metacognition/runtime.js +391 -0
  54. package/dist/ai/metacognition/runtime.js.map +1 -0
  55. package/dist/ai/metacognition/telemetry.d.ts +144 -0
  56. package/dist/ai/metacognition/telemetry.d.ts.map +1 -0
  57. package/dist/ai/metacognition/telemetry.js +149 -0
  58. package/dist/ai/metacognition/telemetry.js.map +1 -0
  59. package/dist/ai/metacognition/transfer.d.ts +153 -0
  60. package/dist/ai/metacognition/transfer.d.ts.map +1 -0
  61. package/dist/ai/metacognition/transfer.js +182 -0
  62. package/dist/ai/metacognition/transfer.js.map +1 -0
  63. package/dist/ai/metacognition/types.d.ts +302 -0
  64. package/dist/ai/metacognition/types.d.ts.map +1 -0
  65. package/dist/ai/metacognition/types.js +79 -0
  66. package/dist/ai/metacognition/types.js.map +1 -0
  67. package/dist/ai/runtime/agent-runtime.d.ts.map +1 -1
  68. package/dist/ai/runtime/agent-runtime.js +12 -18
  69. package/dist/ai/runtime/agent-runtime.js.map +1 -1
  70. package/dist/ai/src/capability-manifest-generator.d.ts.map +1 -1
  71. package/dist/ai/src/capability-manifest-generator.js +11 -5
  72. package/dist/ai/src/capability-manifest-generator.js.map +1 -1
  73. package/dist/ai/src/cli/telemetry-dashboard.js +3 -3
  74. package/dist/ai/src/cli/telemetry-dashboard.js.map +1 -1
  75. package/dist/ai/src/compaction/memory-compaction.d.ts.map +1 -1
  76. package/dist/ai/src/compaction/memory-compaction.js +5 -4
  77. package/dist/ai/src/compaction/memory-compaction.js.map +1 -1
  78. package/dist/ai/src/integrations/linear/index.d.ts +19 -0
  79. package/dist/ai/src/integrations/linear/index.d.ts.map +1 -0
  80. package/dist/ai/src/integrations/linear/index.js +20 -0
  81. package/dist/ai/src/integrations/linear/index.js.map +1 -0
  82. package/dist/ai/src/integrations/linear/issue-mapper.d.ts +93 -0
  83. package/dist/ai/src/integrations/linear/issue-mapper.d.ts.map +1 -0
  84. package/dist/ai/src/integrations/linear/issue-mapper.js +186 -0
  85. package/dist/ai/src/integrations/linear/issue-mapper.js.map +1 -0
  86. package/dist/ai/src/integrations/linear/linear-client.d.ts +199 -0
  87. package/dist/ai/src/integrations/linear/linear-client.d.ts.map +1 -0
  88. package/dist/ai/src/integrations/linear/linear-client.js +300 -0
  89. package/dist/ai/src/integrations/linear/linear-client.js.map +1 -0
  90. package/dist/ai/src/plugins/security/secret-detector.js +3 -3
  91. package/dist/ai/src/plugins/security/secret-detector.js.map +1 -1
  92. package/dist/ai/src/runtime/agent-runtime.js +1 -1
  93. package/dist/ai/src/runtime/agent-runtime.js.map +1 -1
  94. package/dist/ai/src/security/prompt-scan-worker.d.ts +63 -0
  95. package/dist/ai/src/security/prompt-scan-worker.d.ts.map +1 -0
  96. package/dist/ai/src/security/prompt-scan-worker.js +177 -0
  97. package/dist/ai/src/security/prompt-scan-worker.js.map +1 -0
  98. package/dist/ai/src/telemetry/delegation-telemetry.d.ts +10 -0
  99. package/dist/ai/src/telemetry/delegation-telemetry.d.ts.map +1 -1
  100. package/dist/ai/src/telemetry/delegation-telemetry.js +23 -0
  101. package/dist/ai/src/telemetry/delegation-telemetry.js.map +1 -1
  102. package/dist/ai/types/index.d.ts +8 -3
  103. package/dist/ai/types/index.d.ts.map +1 -1
  104. package/dist/ai/types/index.js.map +1 -1
  105. package/dist/ai/utils/safe-fs.d.ts +19 -0
  106. package/dist/ai/utils/safe-fs.d.ts.map +1 -0
  107. package/dist/ai/utils/safe-fs.js +64 -0
  108. package/dist/ai/utils/safe-fs.js.map +1 -0
  109. package/package.json +33 -22
package/README.md CHANGED
@@ -1,42 +1,61 @@
1
- # @dcyfr/ai
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/dcyfr-labs/dcyfr-labs/main/public/images/dcyfr-avatar.svg" alt="DCYFR Logo" width="120" height="120" />
3
+ <h1>@dcyfr/ai</h1>
4
+ <p><em>Portable AI agent harness with plugin architecture for multi-provider integration, telemetry tracking, and quality validation.</em></p>
5
+ </div>
6
+
7
+ <!-- README-META
8
+ tlp_clearance: GREEN
9
+ status: active
10
+ name: dcyfr-ai
11
+ description: Portable AI agent harness with plugin architecture
12
+ last_validated: 2026-03-29
13
+ -->
2
14
 
3
15
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/dcyfr/dcyfr-ai)
4
16
 
5
- > Portable AI agent harness with plugin architecture for multi-provider integration, telemetry tracking, and quality validation.
6
-
7
- [![npm](https://img.shields.io/npm/v/@dcyfr/ai?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
8
- [![Downloads](https://img.shields.io/npm/dm/@dcyfr/ai?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
17
+ [![npm](https://img.shields.io/npm/v/@dcyfr/ai?logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
18
+ [![Downloads](https://img.shields.io/npm/dm/@dcyfr/ai?logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
9
19
  [![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](https://opensource.org/licenses/MIT)
10
- [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
11
- [![Bundle Size](https://img.shields.io/badge/Bundle%20Size-~200KB%20gzipped-28a745?style=flat-square&logo=webpack)](https://bundlephobia.com/package/@dcyfr/ai)
20
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
21
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@dcyfr/ai?label=Bundle%20Size&logo=webpack)](https://bundlephobia.com/package/@dcyfr/ai)
12
22
 
13
23
  Portable AI agent harness with plugin architecture for managing multiple AI providers, tracking telemetry, and ensuring quality compliance.
14
24
 
25
+ ## About DCYFR
26
+
27
+ `@dcyfr/ai` is maintained by **DCYFR Labs** as part of the DCYFR AI tooling portfolio.
28
+
29
+ - **DCYFR** is a registered trademark of DCYFR Labs.
30
+ - Primary domain: [www.dcyfr.ai](https://www.dcyfr.ai)
31
+ - Trademark guidance: [../TRADEMARK.md](../TRADEMARK.md)
32
+ - Licensing details: [LICENSE](./LICENSE)
33
+
15
34
  ## 🔍 @dcyfr/ai vs. Alternatives
16
35
 
17
- | Feature | @dcyfr/ai | LangChain | Vercel AI SDK | AutoGPT |
18
- | ------------------ | ------------------- | ------------ | ------------- | ------------ |
19
- | Multi-Provider | ✅ | ✅ | ✅ | ❌ |
20
- | Plugin System | ✅ Custom | ✅ Complex | ❌ | ❌ |
21
- | Telemetry | ✅ Built-in | ❌ | ❌ | ❌ |
22
- | Zero Config | ✅ | ❌ | ✅ | ❌ |
23
- | Bundle Size | ~200KB gzipped | ~2.3MB | ~450KB | N/A |
24
- | TypeScript | ✅ Strict | Partial | ✅ | ❌ |
25
- | Quality Gates | ✅ | ❌ | ❌ | ❌ |
26
- | Config System | YAML/JSON/package | Code-only | Code-only | JSON |
27
- | Learning Curve | Low | High | Low | High |
36
+ | Feature | @dcyfr/ai | LangChain | Vercel AI SDK | AutoGPT |
37
+ | -------------- | ------------------------------ | ---------- | ------------- | ------- |
38
+ | Multi-Provider | ✅ | ✅ | ✅ | ❌ |
39
+ | Plugin System | ✅ Custom | ✅ Complex | ❌ | ❌ |
40
+ | Telemetry | ✅ Built-in | ❌ | ❌ | ❌ |
41
+ | Zero Config | ✅ | ❌ | ✅ | ❌ |
42
+ | Bundle Size | [![](https://img.shields.io/bundlephobia/minzip/@dcyfr/ai)](https://bundlephobia.com/package/@dcyfr/ai) | ~2.3MB | ~450KB | N/A |
43
+ | TypeScript | ✅ Strict | Partial | ✅ | ❌ |
44
+ | Quality Gates | ✅ | ❌ | ❌ | ❌ |
45
+ | Config System | YAML/JSON/package | Code-only | Code-only | JSON |
46
+ | Learning Curve | Low | High | Low | High |
28
47
 
29
48
  ---
30
49
 
31
50
  ## 📊 npm Statistics
32
51
 
33
- [![npm](https://img.shields.io/npm/v/@dcyfr/ai?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
34
- [![Downloads](https://img.shields.io/npm/dm/@dcyfr/ai?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
35
- [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@dcyfr/ai?style=flat-square&logo=webpack)](https://bundlephobia.com/package/@dcyfr/ai)
52
+ [![npm](https://img.shields.io/npm/v/@dcyfr/ai?logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
53
+ [![Downloads](https://img.shields.io/npm/dm/@dcyfr/ai?logo=npm&logoColor=white)](https://www.npmjs.com/package/@dcyfr/ai)
54
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@dcyfr/ai?logo=webpack)](https://bundlephobia.com/package/@dcyfr/ai)
36
55
 
37
56
  - **Weekly Downloads:** Check [npm stats](https://www.npmjs.com/package/@dcyfr/ai)
38
- - **Dependencies:** 12 production dependencies (zero bloat)
39
- - **Bundle Size:** ~200KB gzipped with tree shaking
57
+ - **Dependencies:** 28 production dependencies
58
+ - **Bundle Size:** See badge above ([![minzip](https://img.shields.io/bundlephobia/minzip/@dcyfr/ai)](https://bundlephobia.com/package/@dcyfr/ai))
40
59
  - **TypeScript:** Full type definitions included
41
60
  - **ESM Support:** ✅ Full ESM modules with tree shaking
42
61
 
@@ -83,10 +102,6 @@ Portable AI agent harness with plugin architecture for managing multiple AI prov
83
102
  - ⚙️ **Configuration System** - YAML/JSON config with three-layer merge
84
103
  - 📊 **Comprehensive Telemetry** - Track usage, costs, quality metrics, performance
85
104
  - ✅ **Validation Harness** - Quality gates with parallel/serial execution
86
- - 💾 **Pluggable Storage** - Memory, file-based, or custom adapters
87
- - ⚡ **Type-Safe** - Full TypeScript support with Zod validation
88
- - 📦 **Lightweight** - ~200KB gzipped bundle size
89
- - 🛠️ **CLI Tools** - Config validation and initialization
90
105
 
91
106
  ## Installation
92
107
 
@@ -105,7 +120,7 @@ npx @dcyfr/ai config:init
105
120
  This creates a `.dcyfr.yaml` configuration file:
106
121
 
107
122
  ```yaml
108
- version: '1.0.0'
123
+ version: "1.0.0"
109
124
  projectName: my-app
110
125
 
111
126
  agents:
@@ -124,7 +139,7 @@ agents:
124
139
  ### 2. Load and Use Configuration
125
140
 
126
141
  ```typescript
127
- import { loadConfig, ValidationFramework } from '@dcyfr/ai';
142
+ import { loadConfig, ValidationFramework } from "@dcyfr/ai";
128
143
 
129
144
  // Load configuration (auto-detects .dcyfr.yaml, .dcyfr.json, package.json)
130
145
  const config = await loadConfig();
@@ -142,7 +157,7 @@ const report = await framework.validate({
142
157
  config: config.agents,
143
158
  });
144
159
 
145
- console.log(`Validation: ${report.valid ? 'PASS' : 'FAIL'}`);
160
+ console.log(`Validation: ${report.valid ? "PASS" : "FAIL"}`);
146
161
  ```
147
162
 
148
163
  ### 3. Validate Configuration
@@ -161,7 +176,7 @@ npx @dcyfr/ai config:validate --verbose
161
176
 
162
177
  ### Migrating from LangChain
163
178
 
164
- **Why migrate:** 10x smaller bundle (~200KB vs 2.3MB), built-in telemetry, simpler API
179
+ **Why migrate:** Smaller bundle footprint than LangChain (see [bundlephobia](https://bundlephobia.com/package/@dcyfr/ai)), built-in telemetry, simpler API
165
180
 
166
181
  ```typescript
167
182
  // LangChain (before)
@@ -172,21 +187,24 @@ const model = new ChatOpenAI({ temperature: 0.9 });
172
187
  const response = await model.call([new HumanMessage("Hello")]);
173
188
 
174
189
  // @dcyfr/ai (after)
175
- import { AgentRuntime } from '@dcyfr/ai';
190
+ import { AgentRuntime } from "@dcyfr/ai";
176
191
 
177
192
  const runtime = new AgentRuntime({
178
- provider: 'openai',
179
- model: 'gpt-4',
180
- temperature: 0.9
193
+ provider: "openai",
194
+ model: "gpt-4",
195
+ temperature: 0.9,
181
196
  });
182
197
 
183
- const response = await runtime.chat({ messages: [{ role: 'user', content: 'Hello' }] });
198
+ const response = await runtime.chat({
199
+ messages: [{ role: "user", content: "Hello" }],
200
+ });
184
201
  ```
185
202
 
186
203
  **Key Differences:**
204
+
187
205
  - Simpler configuration (YAML/JSON vs code-only)
188
206
  - Built-in telemetry tracking (no additional setup)
189
- - Smaller bundle size (200KB vs 2.3MB)
207
+ - Smaller bundle size than LangChain (see [bundlephobia](https://bundlephobia.com/package/@dcyfr/ai))
190
208
  - Type-safe validation with Zod
191
209
  - Quality gates included out of the box
192
210
 
@@ -196,32 +214,35 @@ const response = await runtime.chat({ messages: [{ role: 'user', content: 'Hello
196
214
 
197
215
  ```typescript
198
216
  // Vercel AI SDK (before)
199
- import { openai } from '@ai-sdk/openai';
200
- import { generateText } from 'ai';
217
+ import { openai } from "@ai-sdk/openai";
218
+ import { generateText } from "ai";
201
219
 
202
220
  const { text } = await generateText({
203
- model: openai('gpt-4-turbo'),
204
- prompt: 'Hello'
221
+ model: openai("gpt-4-turbo"),
222
+ prompt: "Hello",
205
223
  });
206
224
 
207
225
  // @dcyfr/ai (after)
208
- import { AgentRuntime, ValidationFramework } from '@dcyfr/ai';
226
+ import { AgentRuntime, ValidationFramework } from "@dcyfr/ai";
209
227
 
210
228
  const runtime = new AgentRuntime({
211
- provider: 'openai',
212
- model: 'gpt-4-turbo'
229
+ provider: "openai",
230
+ model: "gpt-4-turbo",
213
231
  });
214
232
 
215
233
  const response = await runtime.chat({
216
- messages: [{ role: 'user', content: 'Hello' }]
234
+ messages: [{ role: "user", content: "Hello" }],
217
235
  });
218
236
 
219
237
  // Bonus: Built-in validation
220
238
  const validator = new ValidationFramework();
221
- const report = await validator.validate({ /* config */ });
239
+ const report = await validator.validate({
240
+ /* config */
241
+ });
222
242
  ```
223
243
 
224
244
  **Key Differences:**
245
+
225
246
  - Configuration system (YAML/JSON files)
226
247
  - Validation harness with quality gates
227
248
  - Comprehensive telemetry tracking
@@ -237,7 +258,7 @@ const report = await validator.validate({ /* config */ });
237
258
  ### Prerequisites
238
259
 
239
260
  ```bash
240
- # Node.js 18+ required
261
+ # Node.js 24+ required
241
262
  node --version
242
263
 
243
264
  # Install @dcyfr/ai
@@ -251,23 +272,23 @@ export ANTHROPIC_API_KEY=your_anthropic_key
251
272
  ### 1. Basic AgentRuntime Setup
252
273
 
253
274
  ```typescript
254
- import {
255
- AgentRuntime,
256
- ProviderRegistry,
257
- TelemetryEngine,
258
- DCYFRMemory
259
- } from '@dcyfr/ai';
275
+ import {
276
+ AgentRuntime,
277
+ ProviderRegistry,
278
+ TelemetryEngine,
279
+ DCYFRMemory,
280
+ } from "@dcyfr/ai";
260
281
 
261
282
  // Initialize components
262
283
  const providerRegistry = new ProviderRegistry();
263
- const telemetryEngine = new TelemetryEngine({ storage: 'sqlite' });
264
- const memory = new DCYFRMemory({ storage: 'memory' });
284
+ const telemetryEngine = new TelemetryEngine({ storage: "sqlite" });
285
+ const memory = new DCYFRMemory({ storage: "memory" });
265
286
 
266
287
  // Create runtime
267
288
  const runtime = new AgentRuntime({
268
289
  providerRegistry,
269
290
  memory,
270
- telemetry: telemetryEngine
291
+ telemetry: telemetryEngine,
271
292
  });
272
293
 
273
294
  // Verify setup
@@ -278,13 +299,13 @@ console.log(`Runtime ready: ${runtime.isReady()}`);
278
299
 
279
300
  ```typescript
280
301
  // Simple task execution
281
- const result = await runtime.executeTask('Explain quantum computing briefly');
302
+ const result = await runtime.executeTask("Explain quantum computing briefly");
282
303
 
283
304
  if (result.success) {
284
- console.log('Output:', result.output);
285
- console.log('Memory used:', result.memoryRetrievalUsed);
305
+ console.log("Output:", result.output);
306
+ console.log("Memory used:", result.memoryRetrievalUsed);
286
307
  } else {
287
- console.error('Error:', result.error);
308
+ console.error("Error:", result.error);
288
309
  }
289
310
  ```
290
311
 
@@ -292,16 +313,19 @@ if (result.success) {
292
313
 
293
314
  ```typescript
294
315
  // Task with memory context
295
- const result = await runtime.executeTask('Continue the quantum computing explanation', {
296
- timeout: 30000,
297
- memoryConfig: {
298
- maxResults: 10, // Maximum context entries
299
- minScore: 0.7 // Relevance threshold (0.0-1.0)
300
- }
301
- });
316
+ const result = await runtime.executeTask(
317
+ "Continue the quantum computing explanation",
318
+ {
319
+ timeout: 30000,
320
+ memoryConfig: {
321
+ maxResults: 10, // Maximum context entries
322
+ minScore: 0.7, // Relevance threshold (0.0-1.0)
323
+ },
324
+ },
325
+ );
302
326
 
303
327
  // Memory is automatically retrieved, injected, and persisted
304
- console.log('Previous context used:', result.memoryRetrievalUsed);
328
+ console.log("Previous context used:", result.memoryRetrievalUsed);
305
329
  ```
306
330
 
307
331
  ### 4. Working Memory for Multi-Step Tasks
@@ -311,45 +335,45 @@ console.log('Previous context used:', result.memoryRetrievalUsed);
311
335
  const workingMemory = runtime.getWorkingMemory();
312
336
 
313
337
  // Step 1: Research overview
314
- workingMemory.set('research-topic', 'AI ethics');
338
+ workingMemory.set("research-topic", "AI ethics");
315
339
  const overviewResult = await runtime.executeTask(
316
- 'Provide overview of AI ethics and key considerations'
340
+ "Provide overview of AI ethics and key considerations",
317
341
  );
318
342
 
319
- // Step 2: Deep dive (with context from step 1)
320
- workingMemory.set('overview-complete', overviewResult.output);
343
+ // Step 2: Deep dive (with context from step 1)
344
+ workingMemory.set("overview-complete", overviewResult.output);
321
345
  const deepDiveResult = await runtime.executeTask(
322
- 'Analyze specific ethical challenges in AI deployment'
346
+ "Analyze specific ethical challenges in AI deployment",
323
347
  );
324
348
 
325
- console.log('Working memory keys:', Array.from(workingMemory.keys()));
349
+ console.log("Working memory keys:", Array.from(workingMemory.keys()));
326
350
  ```
327
351
 
328
352
  ### 5. Hook System for Extensions
329
353
 
330
354
  ```typescript
331
355
  // Add before-execution hook
332
- runtime.addHook('beforeExecute', async (task: string) => {
356
+ runtime.addHook("beforeExecute", async (task: string) => {
333
357
  console.log(`🚀 Starting task: ${task}`);
334
-
358
+
335
359
  // Custom validation
336
- if (task.includes('sensitive')) {
337
- return { approved: false, reason: 'Sensitive content detected' };
360
+ if (task.includes("sensitive")) {
361
+ return { approved: false, reason: "Sensitive content detected" };
338
362
  }
339
-
363
+
340
364
  return { approved: true };
341
365
  });
342
366
 
343
367
  // Add after-execution hook
344
- runtime.addHook('afterExecute', async (task, result, success) => {
345
- console.log(`✅ Task completed: ${success ? 'SUCCESS' : 'FAILED'}`);
346
-
368
+ runtime.addHook("afterExecute", async (task, result, success) => {
369
+ console.log(`✅ Task completed: ${success ? "SUCCESS" : "FAILED"}`);
370
+
347
371
  // Custom telemetry
348
372
  if (success) {
349
373
  await customAnalytics.track({
350
374
  task: task.substring(0, 50),
351
375
  duration: result.duration,
352
- memoryUsed: result.memoryRetrievalUsed
376
+ memoryUsed: result.memoryRetrievalUsed,
353
377
  });
354
378
  }
355
379
  });
@@ -362,16 +386,16 @@ runtime.addHook('afterExecute', async (task, result, success) => {
362
386
  const runtime = new AgentRuntime({
363
387
  providerRegistry: new ProviderRegistry(),
364
388
  memory,
365
- telemetry
389
+ telemetry,
366
390
  });
367
391
 
368
392
  // Providers automatically fallback: OpenAI → Anthropic → Ollama
369
- const result = await runtime.executeTask('Analyze market trends');
393
+ const result = await runtime.executeTask("Analyze market trends");
370
394
 
371
395
  // Check which provider was used
372
396
  const events = await telemetryEngine.getEvents();
373
- const lastExecution = events.filter(e => e.type === 'start').pop();
374
- console.log('Provider used:', lastExecution?.provider);
397
+ const lastExecution = events.filter((e) => e.type === "start").pop();
398
+ console.log("Provider used:", lastExecution?.provider);
375
399
  ```
376
400
 
377
401
  ### 7. Telemetry Monitoring & Analysis
@@ -385,10 +409,12 @@ const events = await telemetry.getEvents();
385
409
  console.log(`Total events: ${events.length}`);
386
410
 
387
411
  // Filter memory events
388
- const memoryEvents = events.filter(e => e.type === 'memory_retrieval');
389
- const hitRate = memoryEvents.length > 0
390
- ? memoryEvents.filter(e => e.memoriesRelevant > 0).length / memoryEvents.length
391
- : 0;
412
+ const memoryEvents = events.filter((e) => e.type === "memory_retrieval");
413
+ const hitRate =
414
+ memoryEvents.length > 0
415
+ ? memoryEvents.filter((e) => e.memoriesRelevant > 0).length /
416
+ memoryEvents.length
417
+ : 0;
392
418
  console.log(`Memory hit rate: ${(hitRate * 100).toFixed(1)}%`);
393
419
  ```
394
420
 
@@ -417,18 +443,21 @@ npx @dcyfr/ai telemetry --export usage_data.csv
417
443
  ### 9. Provider Setup
418
444
 
419
445
  **OpenAI:**
446
+
420
447
  ```bash
421
448
  export OPENAI_API_KEY=sk-your-key-here
422
449
  # Supports: gpt-4, gpt-4o, gpt-3.5-turbo
423
450
  ```
424
451
 
425
452
  **Anthropic:**
453
+
426
454
  ```bash
427
- export ANTHROPIC_API_KEY=sk-ant-your-key-here
455
+ export ANTHROPIC_API_KEY=sk-ant-your-key-here
428
456
  # Supports: claude-3-5-sonnet, claude-3-haiku, claude-3-opus
429
457
  ```
430
458
 
431
459
  **Ollama (Local):**
460
+
432
461
  ```bash
433
462
  # Install Ollama
434
463
  curl -fsSL https://ollama.ai/install.sh | sh
@@ -444,31 +473,33 @@ export OLLAMA_HOST=localhost:11434
444
473
  ### 10. Configuration Examples
445
474
 
446
475
  **Development:**
476
+
447
477
  ```typescript
448
478
  const devConfig = {
449
479
  providerRegistry: new ProviderRegistry(),
450
- memory: new DCYFRMemory({
451
- storage: 'memory',
452
- maxEntries: 100
480
+ memory: new DCYFRMemory({
481
+ storage: "memory",
482
+ maxEntries: 100,
483
+ }),
484
+ telemetry: new TelemetryEngine({
485
+ storage: "memory", // No persistence for dev
453
486
  }),
454
- telemetry: new TelemetryEngine({
455
- storage: 'memory' // No persistence for dev
456
- })
457
487
  };
458
488
  ```
459
489
 
460
490
  **Production:**
461
- ```typescript
491
+
492
+ ```typescript
462
493
  const prodConfig = {
463
494
  providerRegistry: new ProviderRegistry(),
464
- memory: new DCYFRMemory({
465
- storage: 'file',
466
- filePath: './data/memory.json'
495
+ memory: new DCYFRMemory({
496
+ storage: "file",
497
+ filePath: "./data/memory.json",
498
+ }),
499
+ telemetry: new TelemetryEngine({
500
+ storage: "sqlite",
501
+ dbPath: "./data/telemetry.db",
467
502
  }),
468
- telemetry: new TelemetryEngine({
469
- storage: 'sqlite',
470
- dbPath: './data/telemetry.db'
471
- })
472
503
  };
473
504
  ```
474
505
 
@@ -482,10 +513,11 @@ npm run demo -- --topic "quantum computing applications"
482
513
  ```
483
514
 
484
515
  This example demonstrates:
516
+
485
517
  - 5-step autonomous research pipeline
486
518
  - Memory context integration
487
519
  - Working memory coordination
488
- - Hook system extensions
520
+ - Hook system extensions
489
521
  - Telemetry monitoring
490
522
  - Provider fallback handling
491
523
  - Configuration management
@@ -499,41 +531,45 @@ Build agents that operate independently with persistent memory, scheduled execut
499
531
  ### Subpath Imports
500
532
 
501
533
  ```typescript
502
- import { FileMemoryAdapter, SQLiteIndex, flushWorkingMemory } from '@dcyfr/ai/memory';
503
- import { ContextCompactor, MemoryCompaction } from '@dcyfr/ai/compaction';
504
- import { SkillRegistry } from '@dcyfr/ai/skills';
505
- import { MCPToolBridge } from '@dcyfr/ai/mcp';
506
- import { SessionManager } from '@dcyfr/ai/session';
507
- import { AgentScheduler } from '@dcyfr/ai/scheduler';
508
- import { MessageGateway, TelegramAdapter, CLIAdapter } from '@dcyfr/ai/gateway';
534
+ import {
535
+ FileMemoryAdapter,
536
+ SQLiteIndex,
537
+ flushWorkingMemory,
538
+ } from "@dcyfr/ai/memory";
539
+ import { ContextCompactor, MemoryCompaction } from "@dcyfr/ai/compaction";
540
+ import { SkillRegistry } from "@dcyfr/ai/skills";
541
+ import { MCPToolBridge } from "@dcyfr/ai/mcp";
542
+ import { SessionManager } from "@dcyfr/ai/session";
543
+ import { AgentScheduler } from "@dcyfr/ai/scheduler";
544
+ import { MessageGateway, TelegramAdapter, CLIAdapter } from "@dcyfr/ai/gateway";
509
545
  ```
510
546
 
511
547
  ### Key Capabilities
512
548
 
513
- | Module | Description |
514
- |--------|-------------|
515
- | **File Memory** | Markdown-based persistent memory with SHA-256 dedup and optional SQLite FTS5 hybrid search |
516
- | **Context Compaction** | LLM-powered pre-flush summarization to prevent context overflow |
517
- | **Skill Injection** | BM25-powered matching of `.md` skill files to inject relevant knowledge |
518
- | **MCP Tool Bridge** | Bridges MCP server tool discovery → AgentRuntime tools |
519
- | **Session Management** | Trust-level tool policies (full/sandboxed/readonly), session lifecycle |
520
- | **Agent Scheduler** | Built-in cron parser, webhooks, event subscriptions, quiet hours |
521
- | **Messaging Gateway** | Telegram/CLI/HTTP adapters, input sanitization, rate limiting |
522
- | **Memory Compaction** | Cross-backend dedup, monthly conversation summarization, stale fact archival |
523
- | **Working Memory** | Persist `Map<string, unknown>` as human-readable Markdown |
549
+ | Module | Description |
550
+ | ---------------------- | ------------------------------------------------------------------------------------------ |
551
+ | **File Memory** | Markdown-based persistent memory with SHA-256 dedup and optional SQLite FTS5 hybrid search |
552
+ | **Context Compaction** | LLM-powered pre-flush summarization to prevent context overflow |
553
+ | **Skill Injection** | BM25-powered matching of `.md` skill files to inject relevant knowledge |
554
+ | **MCP Tool Bridge** | Bridges MCP server tool discovery → AgentRuntime tools |
555
+ | **Session Management** | Trust-level tool policies (full/sandboxed/readonly), session lifecycle |
556
+ | **Agent Scheduler** | Built-in cron parser, webhooks, event subscriptions, quiet hours |
557
+ | **Messaging Gateway** | Telegram/CLI/HTTP adapters, input sanitization, rate limiting |
558
+ | **Memory Compaction** | Cross-backend dedup, monthly conversation summarization, stale fact archival |
559
+ | **Working Memory** | Persist `Map<string, unknown>` as human-readable Markdown |
524
560
 
525
561
  ### Quick Example
526
562
 
527
563
  ```typescript
528
- import { MessageGateway, TelegramAdapter } from '@dcyfr/ai/gateway';
529
- import { SessionManager } from '@dcyfr/ai/session';
530
- import { AgentScheduler } from '@dcyfr/ai/scheduler';
564
+ import { MessageGateway, TelegramAdapter } from "@dcyfr/ai/gateway";
565
+ import { SessionManager } from "@dcyfr/ai/session";
566
+ import { AgentScheduler } from "@dcyfr/ai/scheduler";
531
567
 
532
568
  // Create a messaging gateway with platform adapters
533
569
  const gateway = new MessageGateway({
534
570
  adapters: [new TelegramAdapter({ sendFn: telegramBot.sendMessage })],
535
571
  trustRules: [
536
- { name: 'admin', userIds: ['admin-id'], trustLevel: 'full', priority: 10 },
572
+ { name: "admin", userIds: ["admin-id"], trustLevel: "full", priority: 10 },
537
573
  ],
538
574
  });
539
575
 
@@ -541,7 +577,7 @@ const gateway = new MessageGateway({
541
577
  const scheduler = new AgentScheduler({
542
578
  executor: async (task) => runAgent(task),
543
579
  });
544
- scheduler.schedule('0 9 * * *', { name: 'morning-report' });
580
+ scheduler.schedule("0 9 * * *", { name: "morning-report" });
545
581
  scheduler.start();
546
582
  ```
547
583
 
@@ -591,6 +627,7 @@ graph TB
591
627
  ### File Formats
592
628
 
593
629
  Supports multiple configuration formats (auto-detected):
630
+
594
631
  - `.dcyfr.yaml` / `.dcyfr.yml` - YAML format (recommended)
595
632
  - `.dcyfr.json` / `dcyfr.config.json` - JSON format
596
633
  - `package.json` - Under `dcyfr` key
@@ -622,7 +659,7 @@ DCYFR comes with specialized validation agents:
622
659
 
623
660
  - **Design Token Validator** - Enforces design system compliance
624
661
  - **Barrel Export Checker** - Ensures import conventions
625
- - **PageLayout Enforcer** - Validates layout usage patterns
662
+ - **PageLayout Enforcer** - Validates layout usage patterns
626
663
  - **Test Data Guardian** - Prevents production data in tests
627
664
 
628
665
  See `@dcyfr/agents` for specialized DCYFR agents.
@@ -630,13 +667,13 @@ See `@dcyfr/agents` for specialized DCYFR agents.
630
667
  ### Custom Plugins
631
668
 
632
669
  ```typescript
633
- import { PluginLoader } from '@dcyfr/ai';
670
+ import { PluginLoader } from "@dcyfr/ai";
634
671
 
635
672
  const customPlugin = {
636
673
  manifest: {
637
- name: 'my-validator',
638
- version: '1.0.0',
639
- description: 'Custom validation logic',
674
+ name: "my-validator",
675
+ version: "1.0.0",
676
+ description: "Custom validation logic",
640
677
  },
641
678
  async onValidate(context) {
642
679
  // Your validation logic
@@ -683,6 +720,9 @@ npx @dcyfr/ai help
683
720
  ## Examples
684
721
 
685
722
  See [examples/](./examples/) directory:
723
+
724
+ - [Examples index](./examples/README.md) - prerequisites and run commands
725
+
686
726
  - `basic-usage.ts` - Getting started
687
727
  - `plugin-system.ts` - Plugin development
688
728
  - `configuration.ts` - Configuration usage
@@ -699,6 +739,7 @@ See [examples/](./examples/) directory:
699
739
  - [Quick Release Guide](./docs/RELEASE_QUICK_START.md) - TL;DR for releases
700
740
 
701
741
  ### Plugin Marketplace Security
742
+
702
743
  - [GVISOR_SETUP.md](./docs/guides/GVISOR_SETUP.md) - gVisor runtime sandboxing for untrusted plugins
703
744
  - [BEHAVIORAL_ANOMALY_DETECTION.md](./docs/guides/BEHAVIORAL_ANOMALY_DETECTION.md) - Behavioral anomaly detection system
704
745
  - [CERTIFICATION_PROGRAM.md](./docs/guides/CERTIFICATION_PROGRAM.md) - Plugin Certification Program (Bronze/Silver/Gold tiers)
@@ -714,6 +755,7 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.
714
755
  We use [Changesets](https://github.com/changesets/changesets) for automated versioning and publishing.
715
756
 
716
757
  **For contributors:**
758
+
717
759
  ```bash
718
760
  # Add a changeset describing your changes
719
761
  npm run changeset
@@ -724,6 +766,7 @@ git commit -m "feat: your feature"
724
766
  ```
725
767
 
726
768
  **For maintainers:**
769
+
727
770
  - Changesets automatically creates Release PRs
728
771
  - Merging a Release PR publishes to npm
729
772
  - See [Release Management](./docs/RELEASE_MANAGEMENT.md) for full details
@@ -737,11 +780,13 @@ git commit -m "feat: your feature"
737
780
  ### Installation Issues
738
781
 
739
782
  **Issue: `npm install @dcyfr/ai` fails with 404**
783
+
740
784
  - **Cause:** Package may not be published yet or npm registry issue
741
785
  - **Solution:** Verify package exists: `npm view @dcyfr/ai`, or install from GitHub: `npm install git+https://github.com/dcyfr/dcyfr-ai.git`
742
786
  - **Check:** Visit https://www.npmjs.com/package/@dcyfr/ai to confirm publication status
743
787
 
744
788
  **Issue: "Cannot find module '@dcyfr/ai'"**
789
+
745
790
  - **Cause:** Package not in `node_modules` or incorrect import path
746
791
  - **Solution:** Run `npm install`, verify import: `import { loadConfig } from '@dcyfr/ai'`
747
792
  - **TypeScript:** Ensure `moduleResolution: "bundler"` or `"node16"` in tsconfig.json
@@ -749,6 +794,7 @@ git commit -m "feat: your feature"
749
794
  ### Configuration Issues
750
795
 
751
796
  **Issue: `.dcyfr.yaml` not detected**
797
+
752
798
  - **Cause:** File in wrong location or invalid YAML syntax
753
799
  - **Solution:**
754
800
  1. Place `.dcyfr.yaml` in project root (same directory as package.json)
@@ -757,18 +803,21 @@ git commit -m "feat: your feature"
757
803
  - **Alternative:** Use `.dcyfr.json` or add `dcyfr` key to `package.json`
758
804
 
759
805
  **Issue: "Invalid configuration schema"**
806
+
760
807
  - **Cause:** Missing required fields or incorrect types
761
808
  - **Solution:**
762
809
  1. Run `npx @dcyfr/ai config:schema` to see full schema
763
810
  2. Ensure required fields present: `version`, `projectName`
764
811
  3. Check types match (strings in quotes, booleans without quotes, arrays with brackets)
765
812
  - **Example:** Valid config minimum:
813
+
766
814
  ```yaml
767
- version: '1.0.0'
815
+ version: "1.0.0"
768
816
  projectName: my-app
769
817
  ```
770
818
 
771
819
  **Issue: Environment variables not overriding config**
820
+
772
821
  - **Cause:** Incorrect env var naming or precedence
773
822
  - **Solution:** Use `DCYFR_` prefix with nested path: `DCYFR_AGENTS_DESIGNTOKENS_COMPLIANCE=0.95`
774
823
  - **Format:** `DCYFR_<SECTION>_<SUBSECTION>_<KEY>=<value>` (uppercase, underscores)
@@ -777,6 +826,7 @@ projectName: my-app
777
826
  ### Plugin Issues
778
827
 
779
828
  **Issue: Custom plugin not loading**
829
+
780
830
  - **Cause:** Plugin doesn't implement required interface or missing manifest
781
831
  - **Solution:** Ensure plugin exports:
782
832
  1. `manifest` object with `name`, `version`, `description`
@@ -785,10 +835,12 @@ projectName: my-app
785
835
  - **Example:** See [examples/plugin-system.ts](./examples/plugin-system.ts)
786
836
 
787
837
  **Issue: Validation fails with "No plugins loaded"**
838
+
788
839
  - **Cause:** Plugins not registered with PluginLoader before validation
789
840
  - **Solution:**
841
+
790
842
  ```typescript
791
- import { PluginLoader } from '@dcyfr/ai';
843
+ import { PluginLoader } from "@dcyfr/ai";
792
844
  const loader = new PluginLoader();
793
845
  await loader.loadPlugin(myPlugin);
794
846
  await loader.runValidation();
@@ -797,6 +849,7 @@ await loader.runValidation();
797
849
  ### CLI Issues
798
850
 
799
851
  **Issue: `npx @dcyfr/ai` command not found**
852
+
800
853
  - **Cause:** Package not installed or PATH issue
801
854
  - **Solution:**
802
855
  - Local: Add to devDependencies: `npm install --save-dev @dcyfr/ai`
@@ -804,6 +857,7 @@ await loader.runValidation();
804
857
  - npx: Use full package name: `npx @dcyfr/ai@latest`
805
858
 
806
859
  **Issue: CLI commands hang or timeout**
860
+
807
861
  - **Cause:** Large project or slow file system operations
808
862
  - **Solution:**
809
863
  1. Use `--files` flag to target specific files: `npx @dcyfr/ai validate --files "src/**/*.ts"`
@@ -827,19 +881,21 @@ A: Yes, but TypeScript is strongly recommended for better type safety and IDE su
827
881
  **Q: How do I create a custom validation plugin?**
828
882
 
829
883
  A: Implement the `Plugin` interface with `manifest` and `onValidate` method:
884
+
830
885
  ```typescript
831
886
  export const myPlugin = {
832
887
  manifest: {
833
- name: 'my-plugin',
834
- version: '1.0.0',
835
- description: 'My custom validation'
888
+ name: "my-plugin",
889
+ version: "1.0.0",
890
+ description: "My custom validation",
836
891
  },
837
892
  async onValidate(context) {
838
893
  // Your validation logic here
839
894
  return { passed: true, issues: [] };
840
- }
895
+ },
841
896
  };
842
897
  ```
898
+
843
899
  See [docs/plugins.md](./docs/plugins.md) and [examples/plugin-system.ts](./examples/plugin-system.ts) for complete guide.
844
900
 
845
901
  **Q: What's the difference between @dcyfr/ai and @dcyfr/agents?**
@@ -849,6 +905,7 @@ A: `@dcyfr/ai` is the **public harness** (plugin architecture, config management
849
905
  **Q: Can I use this with other AI providers (non-Claude)?**
850
906
 
851
907
  A: Yes! The harness supports multi-provider integration including Claude, GitHub Copilot, Groq, Ollama, OpenAI, Anthropic. Configure providers in `.dcyfr.yaml`:
908
+
852
909
  ```yaml
853
910
  providers:
854
911
  - name: openai
@@ -860,12 +917,14 @@ providers:
860
917
  **Q: How do I track telemetry and costs?**
861
918
 
862
919
  A: Use the `TelemetryEngine` with storage adapters:
920
+
863
921
  ```typescript
864
- import { TelemetryEngine, FileStorageAdapter } from '@dcyfr/ai';
922
+ import { TelemetryEngine, FileStorageAdapter } from "@dcyfr/ai";
865
923
  const telemetry = new TelemetryEngine({
866
- storage: new FileStorageAdapter('./telemetry')
924
+ storage: new FileStorageAdapter("./telemetry"),
867
925
  });
868
926
  ```
927
+
869
928
  Telemetry tracks: API calls, token usage, costs, latency, quality scores.
870
929
 
871
930
  **Q: Is this harness production-ready?**
@@ -879,21 +938,24 @@ A: Yes! @dcyfr/ai is used in production at dcyfr-labs and other projects. It has
879
938
  ## 📊 Performance Benchmarks
880
939
 
881
940
  ### Framework Performance
941
+
882
942
  - **Config Loading:** ~10ms (cached), ~50ms (first load with file I/O)
883
943
  - **Validation Framework:** Parallel execution 2-5x faster than serial (depends on plugin count)
884
944
  - **Plugin System:** Minimal overhead ~5ms per plugin registration
885
- - **Bundle Size:** ~200KB gzipped (includes Zod validation library)
945
+ - **Bundle Size:** See [bundlephobia.com/@dcyfr/ai](https://bundlephobia.com/package/@dcyfr/ai) for current minzip size
886
946
 
887
947
  ### Recommended Usage Patterns
948
+
888
949
  - **Use parallel validation** for independent checks (faster): `mode: 'parallel'`
889
950
  - **Cache config loading** (use singleton pattern): Load once, reuse across app
890
951
  - **Batch telemetry writes** (reduce I/O overhead): Buffer writes, flush periodically
891
952
  - **Lazy load plugins** (faster startup): Only load plugins you need for current validation
892
953
 
893
954
  ### Comparison with Alternatives
955
+
894
956
  - **vs. Custom Scripts:** 10-20x faster due to optimized plugin execution
895
957
  - **vs. Serial Validation:** 2-5x faster with parallel execution mode
896
- - **vs. LangChain:** ~10x smaller bundle size (~200KB vs 2MB+)
958
+ - **vs. LangChain:** Smaller bundle footprint ([bundlephobia](https://bundlephobia.com/package/@dcyfr/ai))
897
959
 
898
960
  [⬆️ Back to top](#dcyfr-ai)
899
961
 
@@ -902,11 +964,14 @@ A: Yes! @dcyfr/ai is used in production at dcyfr-labs and other projects. It has
902
964
  ## 🔒 Security
903
965
 
904
966
  ### Reporting Vulnerabilities
967
+
905
968
  Found a security issue? Report it privately:
969
+
906
970
  - **GitHub Security Advisories:** [dcyfr-ai/security](https://github.com/dcyfr/dcyfr-ai/security/advisories/new)
907
971
  - **Expected Response:** Within 48 hours
908
972
 
909
973
  ### Security Considerations
974
+
910
975
  - **No API keys stored:** Use environment variables for sensitive data (Zod validates but doesn't store)
911
976
  - **Zod validation:** All inputs validated with schemas before processing
912
977
  - **No remote code execution:** Plugins run in local environment only (no sandboxing yet - see limitations)
@@ -914,6 +979,7 @@ Found a security issue? Report it privately:
914
979
  - **Dependencies:** Regular Dependabot updates, npm audit on CI
915
980
 
916
981
  ### Best Practices
982
+
917
983
  - Never commit `.env` files (use `.env.example`)
918
984
  - Use environment variables for API keys: `${OPENAI_API_KEY}`
919
985
  - Review plugin code before loading (plugins have full access to filesystem)
@@ -927,6 +993,7 @@ Found a security issue? Report it privately:
927
993
  ## ⚙️ Known Limitations
928
994
 
929
995
  ### Current Constraints
996
+
930
997
  - **Plugin isolation:** Plugins run in same process (no sandboxing yet) - trust plugin code before loading
931
998
  - **File-based telemetry only:** No database storage adapter yet (planned for v2.0)
932
999
  - **Config caching:** Requires manual cache invalidation on config changes (no hot-reload yet)
@@ -934,11 +1001,13 @@ Found a security issue? Report it privately:
934
1001
  - **TypeScript required for development:** JavaScript works at runtime but TypeScript recommended for development
935
1002
 
936
1003
  ### Platform-Specific Issues
1004
+
937
1005
  - **Windows:** Path separators handled automatically but some plugins may have issues
938
1006
  - **Node.js version:** Requires ≥24.13.0 (uses native fetch, modern APIs)
939
1007
  - **ESM-only:** Package is ESM (ECMAScript Modules) - CommonJS require() not supported
940
1008
 
941
1009
  ### Planned Improvements
1010
+
942
1011
  - [ ] Database storage adapter for telemetry (PostgreSQL, SQLite)
943
1012
  - [ ] Plugin sandboxing for security (worker threads or VM isolation)
944
1013
  - [ ] Hot-reload config watching (auto-reload on file changes)
@@ -959,10 +1028,12 @@ See [GitHub Issues](https://github.com/dcyfr/dcyfr-ai/issues) for tracked featur
959
1028
  ### Commercial Use
960
1029
 
961
1030
  This package is dual-licensed:
1031
+
962
1032
  - **MIT License** for personal, educational, and non-commercial use (free)
963
1033
  - **Commercial License** for business and revenue-generating use (paid)
964
1034
 
965
1035
  **Commercial use includes:**
1036
+
966
1037
  - Using @dcyfr/ai in SaaS products or revenue-generating services
967
1038
  - Deploying in companies with >5 employees
968
1039
  - Providing paid consulting/services using @dcyfr/ai