agentic-flow 2.0.1-alpha.32 → 2.0.1-alpha.33

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 (155) hide show
  1. package/CHANGELOG.md +0 -611
  2. package/README.md +131 -0
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/agents/claudeAgent.d.ts +0 -3
  5. package/dist/agents/claudeAgent.d.ts.map +1 -1
  6. package/dist/agents/claudeAgent.js +20 -148
  7. package/dist/agents/claudeAgent.js.map +1 -1
  8. package/dist/agents/directApiAgent.d.ts.map +1 -1
  9. package/dist/agents/directApiAgent.js +5 -6
  10. package/dist/agents/directApiAgent.js.map +1 -1
  11. package/dist/billing/mcp/tools.d.ts.map +1 -1
  12. package/dist/billing/mcp/tools.js +0 -2
  13. package/dist/billing/mcp/tools.js.map +1 -1
  14. package/dist/cli/commands/hooks.d.ts.map +1 -1
  15. package/dist/cli/commands/hooks.js +53 -3
  16. package/dist/cli/commands/hooks.js.map +1 -1
  17. package/dist/cli/commands/workers.d.ts +9 -0
  18. package/dist/cli/commands/workers.d.ts.map +1 -0
  19. package/dist/cli/commands/workers.js +370 -0
  20. package/dist/cli/commands/workers.js.map +1 -0
  21. package/dist/cli-proxy.d.ts +1 -1
  22. package/dist/cli-proxy.d.ts.map +1 -1
  23. package/dist/cli-proxy.js +38 -56
  24. package/dist/cli-proxy.js.map +1 -1
  25. package/dist/config/claudeFlow.d.ts +1 -1
  26. package/dist/core/agentdb-fast.js +3 -3
  27. package/dist/core/agentdb-fast.js.map +1 -1
  28. package/dist/core/agentdb-wrapper-enhanced.d.ts.map +1 -1
  29. package/dist/core/agentdb-wrapper-enhanced.js +17 -32
  30. package/dist/core/agentdb-wrapper-enhanced.js.map +1 -1
  31. package/dist/core/attention-native.d.ts +0 -1
  32. package/dist/core/attention-native.d.ts.map +1 -1
  33. package/dist/core/attention-native.js +1 -6
  34. package/dist/core/attention-native.js.map +1 -1
  35. package/dist/federation/integrations/supabase-adapter-debug.js +3 -3
  36. package/dist/federation/integrations/supabase-adapter-debug.js.map +1 -1
  37. package/dist/mcp/claudeFlowSdkServer.d.ts.map +1 -1
  38. package/dist/mcp/claudeFlowSdkServer.js +22 -248
  39. package/dist/mcp/claudeFlowSdkServer.js.map +1 -1
  40. package/dist/mcp/fastmcp/servers/stdio-full.js +79 -147
  41. package/dist/mcp/fastmcp/servers/stdio-full.js.map +1 -1
  42. package/dist/mcp/tools/agent-booster-tools.d.ts +2 -15
  43. package/dist/mcp/tools/agent-booster-tools.d.ts.map +1 -1
  44. package/dist/mcp/tools/agent-booster-tools.js +6 -34
  45. package/dist/mcp/tools/agent-booster-tools.js.map +1 -1
  46. package/dist/mcp/tools/sona-tools.d.ts.map +1 -1
  47. package/dist/mcp/tools/sona-tools.js +3 -15
  48. package/dist/mcp/tools/sona-tools.js.map +1 -1
  49. package/dist/optimizations/agent-booster-migration.d.ts.map +1 -1
  50. package/dist/optimizations/agent-booster-migration.js +6 -22
  51. package/dist/optimizations/agent-booster-migration.js.map +1 -1
  52. package/dist/optimizations/configuration-tuning.d.ts +1 -1
  53. package/dist/proxy/anthropic-to-gemini.d.ts.map +1 -1
  54. package/dist/proxy/anthropic-to-gemini.js.map +1 -1
  55. package/dist/proxy/anthropic-to-openrouter.d.ts.map +1 -1
  56. package/dist/proxy/anthropic-to-openrouter.js.map +1 -1
  57. package/dist/proxy/anthropic-to-requesty.d.ts.map +1 -1
  58. package/dist/proxy/anthropic-to-requesty.js.map +1 -1
  59. package/dist/proxy/quic-proxy.d.ts +1 -0
  60. package/dist/proxy/quic-proxy.d.ts.map +1 -1
  61. package/dist/proxy/quic-proxy.js +1 -2
  62. package/dist/proxy/quic-proxy.js.map +1 -1
  63. package/dist/proxy/websocket-proxy.d.ts.map +1 -1
  64. package/dist/proxy/websocket-proxy.js +0 -1
  65. package/dist/proxy/websocket-proxy.js.map +1 -1
  66. package/dist/reasoningbank/AdvancedMemory.d.ts.map +1 -1
  67. package/dist/reasoningbank/AdvancedMemory.js +1 -12
  68. package/dist/reasoningbank/AdvancedMemory.js.map +1 -1
  69. package/dist/reasoningbank/HybridBackend.d.ts +0 -9
  70. package/dist/reasoningbank/HybridBackend.d.ts.map +1 -1
  71. package/dist/reasoningbank/HybridBackend.js +4 -48
  72. package/dist/reasoningbank/HybridBackend.js.map +1 -1
  73. package/dist/reasoningbank/backend-selector.d.ts.map +1 -1
  74. package/dist/reasoningbank/backend-selector.js.map +1 -1
  75. package/dist/reasoningbank/index-new.d.ts +6 -0
  76. package/dist/reasoningbank/index-new.d.ts.map +1 -1
  77. package/dist/reasoningbank/index-new.js +7 -9
  78. package/dist/reasoningbank/index-new.js.map +1 -1
  79. package/dist/reasoningbank/index.d.ts +6 -1
  80. package/dist/reasoningbank/index.d.ts.map +1 -1
  81. package/dist/reasoningbank/index.js +7 -10
  82. package/dist/reasoningbank/index.js.map +1 -1
  83. package/dist/router/providers/onnx-local.d.ts.map +1 -1
  84. package/dist/router/providers/onnx-local.js +1 -3
  85. package/dist/router/providers/onnx-local.js.map +1 -1
  86. package/dist/services/embedding-service.d.ts.map +1 -1
  87. package/dist/services/embedding-service.js +2 -5
  88. package/dist/services/embedding-service.js.map +1 -1
  89. package/dist/services/sona-agent-training.js +1 -1
  90. package/dist/services/sona-agent-training.js.map +1 -1
  91. package/dist/services/sona-agentdb-integration.d.ts.map +1 -1
  92. package/dist/services/sona-agentdb-integration.js +5 -10
  93. package/dist/services/sona-agentdb-integration.js.map +1 -1
  94. package/dist/services/sona-service.d.ts +6 -6
  95. package/dist/services/sona-service.d.ts.map +1 -1
  96. package/dist/services/sona-service.js +1 -3
  97. package/dist/services/sona-service.js.map +1 -1
  98. package/dist/swarm/index.d.ts +0 -4
  99. package/dist/swarm/index.d.ts.map +1 -1
  100. package/dist/swarm/index.js +1 -12
  101. package/dist/swarm/index.js.map +1 -1
  102. package/dist/utils/agentdb-runtime-patch.d.ts +0 -1
  103. package/dist/utils/agentdb-runtime-patch.d.ts.map +1 -1
  104. package/dist/utils/agentdb-runtime-patch.js +2 -97
  105. package/dist/utils/agentdb-runtime-patch.js.map +1 -1
  106. package/dist/utils/cli.d.ts +1 -13
  107. package/dist/utils/cli.d.ts.map +1 -1
  108. package/dist/utils/cli.js +8 -163
  109. package/dist/utils/cli.js.map +1 -1
  110. package/dist/utils/logger.d.ts +0 -15
  111. package/dist/utils/logger.d.ts.map +1 -1
  112. package/dist/utils/logger.js +4 -111
  113. package/dist/utils/logger.js.map +1 -1
  114. package/dist/utils/rate-limiter.d.ts +1 -53
  115. package/dist/utils/rate-limiter.d.ts.map +1 -1
  116. package/dist/utils/rate-limiter.js +11 -134
  117. package/dist/utils/rate-limiter.js.map +1 -1
  118. package/dist/workers/dispatch-service.d.ts +98 -0
  119. package/dist/workers/dispatch-service.d.ts.map +1 -0
  120. package/dist/workers/dispatch-service.js +718 -0
  121. package/dist/workers/dispatch-service.js.map +1 -0
  122. package/dist/workers/hooks-integration.d.ts +79 -0
  123. package/dist/workers/hooks-integration.d.ts.map +1 -0
  124. package/dist/workers/hooks-integration.js +286 -0
  125. package/dist/workers/hooks-integration.js.map +1 -0
  126. package/dist/workers/index.d.ts +23 -0
  127. package/dist/workers/index.d.ts.map +1 -0
  128. package/dist/workers/index.js +24 -0
  129. package/dist/workers/index.js.map +1 -0
  130. package/dist/workers/mcp-tools.d.ts +56 -0
  131. package/dist/workers/mcp-tools.d.ts.map +1 -0
  132. package/dist/workers/mcp-tools.js +359 -0
  133. package/dist/workers/mcp-tools.js.map +1 -0
  134. package/dist/workers/resource-governor.d.ts +75 -0
  135. package/dist/workers/resource-governor.d.ts.map +1 -0
  136. package/dist/workers/resource-governor.js +187 -0
  137. package/dist/workers/resource-governor.js.map +1 -0
  138. package/dist/workers/ruvector-integration.d.ts +159 -0
  139. package/dist/workers/ruvector-integration.d.ts.map +1 -0
  140. package/dist/workers/ruvector-integration.js +491 -0
  141. package/dist/workers/ruvector-integration.js.map +1 -0
  142. package/dist/workers/trigger-detector.d.ts +57 -0
  143. package/dist/workers/trigger-detector.d.ts.map +1 -0
  144. package/dist/workers/trigger-detector.js +264 -0
  145. package/dist/workers/trigger-detector.js.map +1 -0
  146. package/dist/workers/types.d.ts +136 -0
  147. package/dist/workers/types.d.ts.map +1 -0
  148. package/dist/workers/types.js +6 -0
  149. package/dist/workers/types.js.map +1 -0
  150. package/dist/workers/worker-registry.d.ts +77 -0
  151. package/dist/workers/worker-registry.d.ts.map +1 -0
  152. package/dist/workers/worker-registry.js +361 -0
  153. package/dist/workers/worker-registry.js.map +1 -0
  154. package/package.json +2 -3
  155. package/scripts/postinstall.js +0 -72
package/CHANGELOG.md CHANGED
@@ -2,617 +2,6 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [2.0.1-alpha.29] - 2025-12-31
6
-
7
- ### Added
8
- - **E2B Sandbox Integration**: Secure cloud sandboxes for AI code execution
9
- - Firecracker-based isolation with Code Interpreter support
10
- - Python, JavaScript, and shell execution
11
- - File system access and package installation
12
- - `E2BSandboxManager`, `runInE2BSandbox()`, `isE2BAvailable()`
13
-
14
- - **Query Control System**: Runtime control of active SDK queries
15
- - Change model mid-execution (`setModel()`)
16
- - Switch permission modes (`setPermissionMode()`)
17
- - Interrupt, resume, and abort queries
18
- - Query introspection (commands, models, MCP status)
19
- - `createQueryController()`, `getActiveQueries()`, `abortAllQueries()`
20
-
21
- - **Plugins System**: Flexible plugin loading and management
22
- - Load from local filesystem, NPM packages, remote URLs, or inline
23
- - Plugin tool execution with typed definitions
24
- - Checksum verification for remote plugins
25
- - `loadPlugin()`, `getAllPluginTools()`, `executePluginTool()`, `defineTool()`
26
-
27
- - **Streaming Input Mode**: Async iterable prompts for SDK
28
- - `StreamingPromptBuilder` with fluent API
29
- - `InteractivePromptStream` for real-time input
30
- - Transform, filter, batch, and rate-limit operations
31
- - `streamingPrompt()`, `createInteractiveStream()`, `fromArray()`
32
-
33
- - **Security Module**: Comprehensive security hardening
34
- - Path sanitization with traversal protection
35
- - Command injection detection (20+ patterns)
36
- - Secret redaction (API keys, tokens, DB URLs, private keys)
37
- - Rate limiting with sliding window
38
- - Audit logging with file persistence
39
- - `sanitizePath()`, `validateCommand()`, `redactSecrets()`, `checkRateLimit()`, `auditLog()`
40
-
41
- ### Tests
42
- - 47 security tests covering all security functions
43
- - 46 SDK module tests for E2B, query control, plugins, and streaming
44
- - All 93 tests passing
45
-
46
- ## [2.0.1-alpha.28] - 2025-12-31
47
-
48
- ### Added
49
- - **SDK Structured Outputs**: `outputFormat` with JSON schema support
50
- - **SDK Sandbox Configuration**: Environment variable control for sandbox mode
51
- - **Beta Features**: 1M context window support (`SDK_ENABLE_BETAS=true`)
52
- - **Query Limits**: `maxTurns` and `maxBudgetUsd` controls
53
- - **File Checkpointing**: Persistent session state (`SDK_FILE_CHECKPOINTING=true`)
54
-
55
- ### Environment Variables
56
- - `SDK_OUTPUT_SCHEMA` - JSON schema for structured output
57
- - `SDK_ENABLE_SANDBOX` - Enable SDK sandbox mode
58
- - `SDK_ENABLE_BETAS` - Enable beta features (1M context)
59
- - `SDK_MAX_TURNS` - Maximum conversation turns
60
- - `SDK_MAX_BUDGET_USD` - Maximum cost limit
61
- - `SDK_FILE_CHECKPOINTING` - Enable file checkpointing
62
-
63
- ## [2.0.1-alpha.27] - 2025-12-31
64
-
65
- ### Fixed
66
- - **Permission Handler**: Overly broad command substitution blocking
67
- - Changed `/\$\(.*\)/` to specific dangerous patterns
68
- - Safe patterns like `$(date)` now allowed
69
- - **Memory Leaks**: Added TTL-based cleanup for Maps
70
- - `activeTrajectories`: 5-minute TTL with 2-minute cleanup
71
- - `activeSessions`: 30-minute TTL with 5-minute cleanup
72
- - **Agent Converter**: Added 1-minute cache for converted agents
73
- - `invalidateAgentCache()` function for manual cache clearing
74
-
75
- ### Added
76
- - New dangerous patterns: `git push --force`, `npm publish`, `cat .env`
77
- - TTL cleanup intervals for trajectory and session Maps
78
- - Agent conversion caching for performance
79
-
80
- ### Tests
81
- - 20 permission handler tests (all passing)
82
- - Includes git force push, npm publish, safe command substitution
83
-
84
- ## [2.0.1-alpha.26] - 2025-12-31
85
-
86
- ### Added
87
- - **SDK Integration Module**: Full Claude Agent SDK v0.1.76 support
88
- - Hooks bridge with trajectory tracking
89
- - Session management with resume/fork
90
- - Custom permission handlers
91
- - Agent converter for subagent spawning
92
- - All 17 SDK tools enabled
93
-
94
- ### Exports (src/sdk/index.ts)
95
- - Hooks: `preToolUseHook`, `postToolUseHook`, `sessionStartHook`, etc.
96
- - Sessions: `captureSessionId`, `getResumeOptions`, `getForkOptions`
97
- - Permissions: `customPermissionHandler`, `strictPermissionHandler`
98
- - Agents: `convertAgentToSdkFormat`, `getAgentsForUseCase`
99
-
100
- ## [2.0.1-alpha.25] - 2025-12-31
101
-
102
- ### Added
103
- - **Multi-Algorithm Learning Engine**: 9 specialized RL algorithms for different task types
104
-
105
- | Algorithm | Task Type | Why |
106
- |----------------------|---------------------|----------------------------------|
107
- | double-q | agent-routing | Reduces overestimation bias |
108
- | sarsa | error-avoidance | Conservative, on-policy |
109
- | actor-critic | confidence-scoring | Continuous 0-1 scores |
110
- | ppo | context-ranking | Stable preference learning |
111
- | decision-transformer | trajectory-learning | Sequence patterns |
112
- | td-lambda | memory-recall | Better credit assignment |
113
- | q-learning | pattern-matching | Fast value-based matching |
114
- | reinforce | exploration | Policy gradient for novel tasks |
115
- | a2c | multi-agent | Advantage estimation |
116
-
117
- ### New Functions (IntelligenceBridge)
118
- - `getAlgorithmForTask(taskType)` - Get recommended algorithm and reason
119
- - `learnFromEpisode(taskType, state, action, reward, nextState, done)` - Learn with appropriate algorithm
120
- - `getActionValue(taskType, state, action)` - Get Q-value or policy probability
121
- - `getMultiAlgorithmStats()` - Get per-algorithm episode counts and avg rewards
122
-
123
- ### Updated
124
- - `ruvector` upgraded to `^0.1.69` with multi-algorithm learning engine
125
- - `getIntelligenceStats()` now includes `multiAlgorithmStats`
126
- - Features list now includes `multi-algorithm-rl`
127
-
128
- ### Usage
129
- ```typescript
130
- import { getAlgorithmForTask, learnFromEpisode } from 'agentic-flow/hooks';
131
-
132
- // Get recommended algorithm for a task
133
- const { algorithm, reason } = getAlgorithmForTask('agent-routing');
134
- // => { algorithm: 'double-q', reason: 'Reduces overestimation bias...' }
135
-
136
- // Learn from an episode
137
- const result = await learnFromEpisode(
138
- 'error-avoidance', // Uses SARSA (conservative)
139
- 'state',
140
- 'action',
141
- 0.9, // reward
142
- 'nextState',
143
- true // done
144
- );
145
- ```
146
-
147
- ## [2.0.1-alpha.24] - 2025-12-31
148
-
149
- ### Added
150
- - **Tiered TensorCompress**: Dynamic compression based on access frequency
151
- - **Hot patterns** (>80% freq): No compression (0% savings) - fastest access
152
- - **Warm patterns** (40-80% freq): Half precision (50% savings)
153
- - **Cool patterns** (10-40% freq): PQ8 quantization (87.5% savings)
154
- - **Cold patterns** (1-10% freq): PQ4 quantization (93.75% savings)
155
- - **Archive patterns** (<1% freq): Binary (96.9% savings)
156
-
157
- ### Improved
158
- - **Access Frequency Tracking**: Each pattern tracks total accesses, creation time
159
- - **Dynamic Tier Migration**: Patterns automatically move between tiers based on usage
160
- - **Periodic Recompression**: Background process migrates patterns every 5 minutes
161
- - **Memory Efficiency**: Up to 96.9% memory savings for rarely-used patterns
162
- - **Stats Display**: New compression tier distribution table in `enhanced_booster_stats`
163
-
164
- ### IntelligenceBridge Integration
165
- - **TensorCompress in Hooks**: Tiered compression now integrated into hooks intelligence layer
166
- - **storePattern**: New patterns start as "hot" (no compression), migrate based on access
167
- - **findSimilarPatterns**: Tracks accesses for automatic tier migration
168
- - **routeTaskIntelligent**: Pattern results now tracked for compression decisions
169
- - **getIntelligenceStats**: Now includes `compressionStats` with tier distribution
170
- - **Backward Compatible**: Existing patterns continue to work without modification
171
-
172
- ### Technical Details
173
- - Access frequency = 50% access ratio + 30% recency (24hr decay) + 20% success rate
174
- - New patterns start as "hot" (no compression) since they're likely to be reused
175
- - Recompression runs non-blocking in background during apply()
176
- - Backward-compatible with older pattern files (auto-migrates fields)
177
-
178
- ### Stats Output
179
- ```
180
- 🗜️ Tiered Compression:
181
- ┌─────────────────────────────────────────────────┐
182
- │ Tier │ Count │ Access Freq │ Memory Save │
183
- ├─────────────────────────────────────────────────┤
184
- │ 🔥 Hot │ 15 │ >80% │ 0% │
185
- │ 🌡️ Warm │ 8 │ 40-80% │ 50% │
186
- │ ❄️ Cool │ 12 │ 10-40% │ 87.5% │
187
- │ 🧊 Cold │ 25 │ 1-10% │ 93.75% │
188
- │ 📦 Archive│ 40 │ <1% │ 96.9% │
189
- └─────────────────────────────────────────────────┘
190
- Compression Ratio: 4.2:1
191
- Memory Savings: 76.2%
192
- ```
193
-
194
- ## [2.0.1-alpha.23] - 2025-12-31
195
-
196
- ### Added
197
- - **Enhanced Agent Booster v2**: Full RuVector intelligence stack upgrade
198
- - **Semantic Fuzzy Matching**: Match similar patterns (var x → var y) with 91%+ similarity
199
- - **ONNX Embeddings**: Semantic code understanding with async initialization
200
- - **Parallel Batch Apply**: 4x faster multi-file edits
201
- - **Context-Aware Prefetch**: Pre-warm cache based on file context
202
- - **Error Pattern Learning**: Learn what NOT to do from failed edits
203
- - **TensorCompress**: 10x more patterns in memory
204
- - **Co-Edit Graph**: Track which files are edited together
205
-
206
- ### New MCP Tools
207
- - `enhanced_booster_batch` - Apply multiple edits in parallel
208
- - `enhanced_booster_prefetch` - Pre-warm cache for a file
209
- - `enhanced_booster_likely_files` - Get files likely to be edited next
210
-
211
- ### Performance v2
212
- | Strategy | Latency | Description |
213
- |----------|---------|-------------|
214
- | exact_cache | **0ms** | Identical pattern match |
215
- | fuzzy_match | **0-5ms** | Similar pattern (91%+ similarity) |
216
- | gnn_match | 1-10ms | GNN differentiable search |
217
- | agent_booster | ~650ms | Fallback to underlying engine |
218
-
219
- ### Test Results
220
- ```
221
- 🎯 Step 2: Exact cache hit → 0ms
222
- 🔮 Step 4: Fuzzy match → 0ms (91.9% similarity)
223
- ⚡ Step 5: Batch (4 edits) → 0ms total, 4/4 fuzzy matches
224
- ```
225
-
226
- ## [2.0.1-alpha.22] - 2025-12-31
227
-
228
- ### Added
229
- - **RuVector-Enhanced Agent Booster**: Supercharged code editing with self-learning
230
- - **HNSW Pattern Cache**: 0ms cache hits vs 650ms baseline (~infinite speedup)
231
- - **SONA Learning**: Continuously improves from edit success/failure
232
- - **GNN Matching**: Differentiable search for similar patterns
233
- - **Embedding Support**: Hash-based (fast) or ONNX (semantic)
234
-
235
- ### New Files
236
- - `src/intelligence/agent-booster-enhanced.ts` - Main enhanced booster module
237
- - `src/mcp/tools/enhanced-booster-tools.ts` - MCP tools for enhanced booster
238
-
239
- ### New MCP Tools
240
- - `enhanced_booster_edit` - Apply edit with RuVector intelligence
241
- - `enhanced_booster_edit_file` - Edit file with auto-learning
242
- - `enhanced_booster_stats` - View cache hit rate, patterns learned
243
- - `enhanced_booster_pretrain` - Pre-cache common patterns
244
- - `enhanced_booster_benchmark` - Compare enhanced vs baseline
245
- - `enhanced_booster_record_outcome` - Feedback for learning
246
-
247
- ### Performance
248
- | Metric | Baseline | Enhanced |
249
- |--------|----------|----------|
250
- | Cache Hit Latency | N/A | **0ms** |
251
- | Pattern Match | 650ms | 0-5ms |
252
- | Learning | None | SONA + EWC++ |
253
- | Pattern Capacity | 0 | 10,000+ |
254
-
255
- ### Usage
256
- ```typescript
257
- import { getEnhancedBooster } from 'agentic-flow/intelligence';
258
-
259
- const booster = getEnhancedBooster();
260
- await booster.pretrain(); // Cache common patterns
261
-
262
- const result = await booster.apply({
263
- code: 'var x = 1;',
264
- edit: 'const x = 1;',
265
- language: 'javascript'
266
- });
267
- // First call: agent_booster (650ms)
268
- // Second call: cache_hit (0ms)!
269
- ```
270
-
271
- ## [2.0.1-alpha.21] - 2025-12-31
272
-
273
- ### Fixed
274
- - **Windows Agent Booster Error**: Resolved "Cannot find package 'agent-booster'" error
275
- - Made all `agent-booster` imports optional with try-catch wrappers
276
- - Added null checks for AgentBooster in all MCP tools and handlers
277
- - Graceful fallback when agent-booster is not available
278
- - Removed `file:` dependency that required local package
279
-
280
- ### Changed
281
- - `claudeFlowSdkServer.ts`: Agent Booster tools return helpful error message when unavailable
282
- - `agent-booster-tools.ts`: All handlers check for booster availability before use
283
- - `agent-booster-migration.ts`: Engine initialization now optional, fallback to traditional edits
284
-
285
- ### Notes
286
- - Agent Booster tools will gracefully degrade on Windows
287
- - CLI-based agent-booster commands (`npx agent-booster@0.2.2`) still work on all platforms
288
- - Native import-based agent-booster requires Linux/macOS
289
-
290
- ## [2.0.1-alpha.20] - 2025-12-31
291
-
292
- ### Fixed
293
- - **Windows Compatibility**: Full persistence without native module compilation
294
- - `better-sqlite3` moved to optionalDependencies
295
- - **sql.js (WASM SQLite)** fallback for Windows persistence
296
- - Automatic backend selection: native → WASM → memory
297
- - No Visual Studio Build Tools required
298
-
299
- ### Added
300
- - **WASM SQLite Cache**: Cross-platform persistence via sql.js
301
- - Stores embeddings in `~/.agentic-flow/embedding-cache-wasm.db`
302
- - Debounced file writes (1s) for performance
303
- - Same 9000x speedup on Windows
304
-
305
- ### Changed
306
- - EmbeddingCache auto-selects backend (priority order):
307
- 1. Native SQLite (better-sqlite3) - Fastest, ~0.045ms
308
- 2. WASM SQLite (sql.js) - Cross-platform, ~0.1ms
309
- 3. In-memory LRU - No persistence, ~0.01ms
310
- - New `getBackendType()` method: returns 'native' | 'wasm' | 'memory'
311
-
312
- ### Performance
313
- | Backend | Time | Persistence | Platform |
314
- |---------|------|-------------|----------|
315
- | Native SQLite | ~0.045ms | ✓ | Linux/macOS |
316
- | WASM SQLite | ~0.1ms | ✓ | Windows/All |
317
- | Memory | ~0.01ms | ✗ | Fallback |
318
-
319
- ## [2.0.1-alpha.19] - 2025-12-31
320
-
321
- ### Added
322
- - **Cache Pretrain**: Pre-populate embedding cache for faster cold starts
323
- - `pretrain(sources)` - Pretrain from files, globs, or text arrays
324
- - `pretrainCodePatterns()` - 45 common programming patterns (~3ms)
325
- - `pretrainFromRepo(path)` - Crawl and cache entire repositories
326
-
327
- - **AI-Enhanced Pretrain** (ruvector integration):
328
- - `pretrainWithAI()` - Uses attention mechanisms for intelligent caching
329
- - `pretrainIntelligent()` - 5-stage analysis (patterns, AST, git, deps, chunks)
330
- - `pretrainIncremental()` - Only cache changed files (git diff)
331
- - `pretrainSemantic()` - Code-aware chunking (functions, classes, interfaces)
332
- - `prefetchForContext()` - Context-aware prefetch based on current task
333
-
334
- - **Attention-Guided Caching**:
335
- - `HyperbolicAttention` - Hierarchical code structure (AST trees)
336
- - `MoEAttention` - Expert routing (frontend/backend/data/test)
337
- - `GraphRoPeAttention` - Dependency graph understanding
338
- - `FastGRNN` - Pattern prediction for smart prefetch
339
-
340
- - **Smart Pretraining Features**:
341
- - Semantic chunking by code boundaries (not fixed size)
342
- - Priority-based caching of frequently accessed patterns
343
- - Background pretraining (non-blocking)
344
- - Git history analysis (cache hot files first)
345
- - Dependency graph caching
346
-
347
- ### Performance (pretrain)
348
- | Operation | Time | Notes |
349
- |-----------|------|-------|
350
- | Code patterns | ~3ms | 45 patterns, one-time |
351
- | Custom texts | ~0.3ms | 5 texts batch |
352
- | Cached query | ~0.01ms | Memory cache hit |
353
- | Incremental | ~50ms | Git-based, 20 commits |
354
- | AI pretrain | ~200ms | Full 5-stage analysis |
355
- | Context prefetch | ~5ms | Task-aware prediction |
356
-
357
- ## [2.0.1-alpha.18] - 2025-12-31
358
-
359
- ### Added
360
- - **Persistent SQLite Embedding Cache**: Cross-session embedding persistence
361
- - New `EmbeddingCache` class with SQLite (better-sqlite3) backend
362
- - **9000x faster** cached lookups: ~0.045ms vs ~400ms ONNX inference
363
- - Batch writes with transactions: 0.016ms per embedding
364
- - Stored at `~/.agentic-flow/embedding-cache.db`
365
- - LRU eviction with configurable max entries (default: 10,000)
366
- - Automatic cleanup of entries older than 30 days
367
- - WAL mode for concurrent access
368
-
369
- - **Cache Hierarchy** (checked in order):
370
- 1. In-memory LRU cache (~0.001ms) - fastest, ephemeral
371
- 2. Persistent SQLite cache (~0.045ms) - persists across sessions
372
- 3. ONNX inference (~400ms) - only on complete cache miss
373
-
374
- - **EmbeddingService Cache Methods**:
375
- - `clearPersistentCache()` - Clear SQLite cache
376
- - `clearAllCaches()` - Clear both memory and persistent caches
377
- - `getPersistentCacheStats()` - Get cache statistics
378
-
379
- - **Environment Variables**:
380
- - `AGENTIC_FLOW_PERSISTENT_CACHE=true|false` (default: true)
381
-
382
- ### Performance (with persistent cache)
383
- | Operation | Time | Notes |
384
- |-----------|------|-------|
385
- | ONNX cold | ~400ms | First inference + cache write |
386
- | SQLite read | ~0.045ms | Persistent cache lookup |
387
- | SQLite batch write | 0.016ms/ea | Transactional batch insert |
388
- | Memory cache | ~0.001ms | In-memory LRU lookup |
389
- | **Speedup** | **9000x** | SQLite vs ONNX inference |
390
-
391
- ### Changed
392
- - EmbeddingService now checks persistent cache before ONNX inference
393
- - Only semantic (ONNX) embeddings are persisted (simple hash-based are not)
394
-
395
- ## [2.0.1-alpha.17] - 2025-12-31
396
-
397
- ### Added
398
- - **10 Attention Mechanisms** (ruvector@0.1.63):
399
- - `MultiHeadAttention` - Pattern matching
400
- - `FlashAttention` - Memory-efficient O(n)
401
- - `HyperbolicAttention` - Hierarchical data (AST, trees)
402
- - `LinearAttention` - O(n) real-time hooks
403
- - `LocalGlobalAttention` - Long document summarization
404
- - `MoEAttention` - Multi-agent routing
405
- - `GraphRoPeAttention` - Code structure analysis
406
- - `EdgeFeaturedAttention` - Import/dependency graphs
407
- - `DualSpaceAttention` - Euclidean + Hyperbolic
408
-
409
- - **Extended Worker Pool Operations**:
410
- - `speculativeEmbed(files)` - Pre-embed for post-edit
411
- - `analyzeAST(files)` - Multi-file parallel AST
412
- - `analyzeComplexity(files)` - Cyclomatic metrics
413
- - `buildDependencyGraph(files)` - Import graph
414
- - `securityScan(files)` - Parallel SAST
415
- - `ragRetrieve(query, chunks)` - Parallel RAG
416
- - `rankContext(query, contexts)` - Relevance ranking
417
- - `deduplicate(texts)` - Semantic deduplication
418
- - `gitBlame(files)` - Parallel blame analysis
419
- - `gitChurn(patterns, since)` - Code churn metrics
420
-
421
- - **Parallel Attention Compute**:
422
- - `parallelAttentionCompute()` - 3-4x faster multi-query
423
- - `batchAttentionCompute()` - Batch Q-K-V sets
424
- - `computeFlashAttentionAsync()` - Non-blocking flash
425
- - `getAttentionForUseCase()` - Auto-select attention type
426
-
427
- - **Training Utilities**:
428
- - `AdamOptimizer` - Attention parameter training
429
- - `infoNceLoss()` - Contrastive learning
430
- - `mineHardNegatives()` - Hard negative mining
431
- - `benchmarkAttention()` - Performance comparison
432
-
433
- ### Changed
434
- - Updated ruvector dependency: 0.1.62 → 0.1.63
435
- - Intelligence bridge supports all attention mechanisms
436
-
437
- ## [2.0.1-alpha.16] - 2025-12-31
438
-
439
- ### Added
440
- - **Parallel Intelligence** (ruvector@0.1.62): Full parallel worker integration
441
- - `queueEpisode()` + `flushEpisodeBatch()` - 3-4x faster batch Q-learning
442
- - `matchPatternsParallel(files)` - Multi-file parallel pretrain
443
- - `indexMemoriesBackground(memories)` - Non-blocking hook indexing
444
- - `searchParallel(query, topK)` - Parallel shard similarity search
445
- - `analyzeFilesParallel(files)` - Multi-file AST routing
446
- - `analyzeCommitsParallel(commits)` - Faster co-edit detection
447
-
448
- - **Auto-detection for parallel mode**:
449
- - MCP server (`MCP_SERVER=1`): Workers enabled automatically
450
- - CLI hooks (`RUVECTOR_CLI=1`): Fast sequential mode
451
- - Manual: `RUVECTOR_PARALLEL=1` to force enable
452
-
453
- ### Changed
454
- - Updated ruvector dependency: 0.1.61 → 0.1.62
455
- - Intelligence bridge now lazy-loads parallel engine
456
-
457
- ## [2.0.1-alpha.15] - 2025-12-31
458
-
459
- ### Added
460
- - **Parallel Worker Embeddings**: 7 worker threads for parallel ONNX processing
461
- - Uses ruvector@0.1.61 with parallel worker pool
462
- - SIMD128 enabled (6x faster single-threaded, 7x parallel)
463
- - Auto-detection: defaults to ONNX when SIMD available
464
-
465
- - **Advanced Embedding Features**:
466
- - `similarityMatrix(texts)` - NxN pairwise similarity computation
467
- - `semanticSearch(query, topK)` - Search against pre-built corpus
468
- - `findDuplicates(texts, threshold)` - Near-duplicate detection
469
- - `clusterTexts(texts, k)` - K-means semantic clustering
470
- - `streamEmbed(texts, batchSize)` - Memory-efficient streaming
471
-
472
- - **Parallel Use Cases** (from ruvector@0.1.61):
473
- | Use Case | Current | With Workers | Benefit |
474
- |--------------------|--------------------|-------------------|--------------------------|
475
- | Q-learning updates | Sequential | Parallel batch | Faster learning |
476
- | Pattern matching | 1 file at a time | 4+ files parallel | 3-4x faster pretrain |
477
- | Memory indexing | Blocking | Background | Non-blocking hooks |
478
- | Similarity search | Sequential scan | Parallel shards | Faster recall |
479
- | Code analysis | Single AST | Multi-file AST | Faster routing |
480
- | Git history | Sequential commits | Parallel commits | Faster co-edit detection |
481
-
482
- ### Changed
483
- - EmbeddingService now uses ruvector@0.1.61 (not ruvector-onnx-embeddings-wasm directly)
484
- - Default backend changed from 'simple' to 'auto' (auto-detects ONNX/SIMD)
485
- - Updated dependency: ruvector ^0.1.61
486
-
487
- ### Performance (7 workers + SIMD)
488
- - Cold start: ~1.5s (includes model download, worker init)
489
- - Warm embedding: ~100-200ms per text (parallelized)
490
- - Batch embedding: Up to 7x faster with parallel workers
491
-
492
- ## [2.0.1-alpha.14] - 2025-12-31
493
-
494
- ### Added
495
- - **ONNX Embeddings with SIMD**: Real semantic embeddings via ruvector-onnx-embeddings-wasm
496
- - SIMD128 enabled for 6x faster embedding generation
497
- - 100% semantic accuracy (correctly identifies related/unrelated texts)
498
- - all-MiniLM-L6-v2 model (384 dimensions)
499
- - Configure with `AGENTIC_FLOW_EMBEDDINGS=onnx`
500
-
501
- - **EmbeddingService**: Unified embedding interface
502
- - Simple backend: ~0.04ms (hash-based, fast but not semantic)
503
- - ONNX backend: ~400ms with SIMD (true semantic similarity)
504
- - LRU cache for repeated embeddings
505
- - Auto-fallback to simple if ONNX fails
506
-
507
- - **Embedding Benchmark**: Compare simple vs ONNX embeddings
508
- - Run with: `node --experimental-wasm-modules dist/intelligence/embedding-benchmark.js`
509
- - Shows latency, accuracy, and semantic similarity comparisons
510
-
511
- ### Changed
512
- - Updated intelligence-bridge.ts to use EmbeddingService
513
- - Added onnxruntime-node and ruvector-onnx-embeddings-wasm dependencies
514
-
515
- ### Performance (SIMD enabled)
516
- - Cold start: ~1.5s (includes model download)
517
- - Warm embedding: ~400ms per text
518
- - Batch embedding: ~400ms per text (sequential)
519
-
520
- ## [2.0.1-alpha.13] - 2025-12-31
521
-
522
- ### Added
523
- - **SQLite Persistence**: Learning data now persists across npx calls and CLI invocations
524
- - New `IntelligenceStore` class with cross-platform SQLite (better-sqlite3)
525
- - Stores trajectories, routings, patterns, and operations
526
- - Works on Linux, macOS, and Windows
527
- - Database stored in `.agentic-flow/intelligence.db`
528
-
529
- ### Changed
530
- - **Intelligence Stats**: Now shows persisted data from SQLite
531
- - Trajectories count persists across CLI invocations
532
- - Routings count persists across CLI invocations
533
- - New "Persistence (SQLite)" section in stats output
534
-
535
- ### Verified
536
- - Trajectories persist: created in one call, visible in next
537
- - Routings persist: recorded for each routing decision
538
- - Cross-platform SQLite with WAL mode for better concurrency
539
-
540
- ## [2.0.1-alpha.12] - 2025-12-31
541
-
542
- ### Fixed
543
- - **HNSW Enabled Status**: Fixed intelligence stats showing "HNSW: Enabled: false"
544
- - Reordered initialization to call `getIntelligence()` before `getIntelligenceStats()`
545
- - Now correctly shows "HNSW: Enabled: true" with 150x speedup
546
-
547
- ### Verified
548
- - All intelligence stats display correctly
549
- - HNSW enabled and operational
550
-
551
- ## [2.0.1-alpha.11] - 2025-12-31
552
-
553
- ### Fixed
554
- - **AdamOptimizer Constructor**: Fixed "Failed to convert napi value Undefined into rust type `f64`" error
555
- - AdamOptimizer now correctly receives all 4 required parameters: learning_rate, beta1, beta2, epsilon
556
- - **Silent Warnings**: Removed noisy AgentDB controller warnings for v2+ installations
557
- - **RuVector HNSW**: Verified HNSW indexing works with M=16, efConstruction=200, achieving 1ms search times
558
-
559
- ### Verified
560
- - Hooks run without any error messages
561
- - Intelligence stats display cleanly
562
- - RuVector backend with HNSW fully operational
563
-
564
- ## [2.0.1-alpha.10] - 2025-12-31
565
-
566
- ### Fixed
567
- - **ruvector VectorDB/VectorDb Case Mismatch**: Fixed critical bug where @ruvector/core exports `VectorDb` but ruvector checks for `VectorDB`
568
- - Updated postinstall.js with regex-based patching for whitespace-insensitive matching
569
- - Added patch marker (`// AGENTIC-FLOW-PATCHED: VectorDb alias`) for idempotent patching
570
- - Hooks now work correctly with `npx agentic-flow hooks init` and `npx agentic-flow hooks metrics`
571
-
572
- ### Tested
573
- - Verified postinstall patch applies correctly on fresh install
574
- - Hooks init creates .claude/settings.json properly
575
- - Hooks metrics command executes without VectorDB errors
576
-
577
- ## [2.0.1-alpha.9] - 2025-12-31
578
-
579
- ### Added
580
- - **Runtime Patching System**: Added agentdb-runtime-patch.ts for runtime fixes
581
- - Automatic AgentDB ESM import resolution patching
582
- - Automatic ruvector VectorDB/VectorDb case mismatch fixing
583
- - Works with npm install, npm install -g, and npx contexts
584
-
585
- ### Changed
586
- - **Hook System Migration**: Updated from ruvector hooks to agentic-flow@alpha hooks
587
- - New environment variables: AGENTIC_FLOW_INTELLIGENCE, AGENTIC_FLOW_LEARNING_RATE
588
- - Updated CLAUDE.md documentation with new hook commands
589
-
590
- ## [2.0.1-alpha.8] - 2025-12-31
591
-
592
- ### Fixed
593
- - **TypeScript Compilation**: Fixed all 11 TypeScript errors in the core package
594
- - Fixed AgentDBConfig property mismatch (`path` → `dbPath`)
595
- - Fixed RuvectorLayer constructor signature (added dropout parameter)
596
- - Fixed MoEAttention constructor to use config object
597
- - Fixed SONAEngine type cast for proper interface compatibility
598
- - Fixed ReasoningPattern local interface for type safety
599
- - Fixed DebugStream.logConnection argument handling
600
- - Added try-catch for optional AttentionService import
601
- - Fixed AgentDB import to use named export
602
-
603
- ### Changed
604
- - **Type Safety Improvements**:
605
- - Local ReasoningPattern interface now includes all required fields (similarity, approach, taskType)
606
- - Added proper type casts for cross-module compatibility
607
- - GNN initialization now uses RuvectorLayer instead of deprecated GraphNeuralNetwork
608
-
609
- ### Tested
610
- - ✅ All TypeScript compilation passes with zero errors
611
- - ✅ Build completes successfully
612
- - ✅ Retry and logging tests pass
613
-
614
- ---
615
-
616
5
  ## [2.0.1-alpha.4] - 2025-12-03
617
6
 
618
7
  ### Added