@sparkleideas/cli 3.1.0-alpha.21 → 3.1.0-alpha.23

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 (125) hide show
  1. package/.claude/agents/core/coder.md +1 -1
  2. package/.claude/agents/core/planner.md +2 -2
  3. package/.claude/agents/core/researcher.md +1 -1
  4. package/.claude/agents/core/reviewer.md +1 -1
  5. package/.claude/agents/core/tester.md +1 -1
  6. package/.claude/agents/data/data-ml-model.md +4 -4
  7. package/.claude/agents/development/dev-backend-api.md +4 -4
  8. package/.claude/agents/documentation/docs-api-openapi.md +4 -4
  9. package/.claude/agents/github/code-review-swarm.md +2 -2
  10. package/.claude/agents/github/issue-tracker.md +2 -2
  11. package/.claude/agents/github/pr-manager.md +2 -2
  12. package/.claude/agents/github/release-manager.md +2 -2
  13. package/.claude/agents/github/workflow-automation.md +2 -2
  14. package/.claude/agents/sparc/architecture.md +3 -3
  15. package/.claude/agents/sparc/pseudocode.md +2 -2
  16. package/.claude/agents/sparc/refinement.md +3 -3
  17. package/.claude/agents/sparc/specification.md +2 -2
  18. package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
  19. package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
  20. package/.claude/agents/swarm/mesh-coordinator.md +1 -1
  21. package/.claude/agents/templates/base-template-generator.md +3 -3
  22. package/.claude/agents/templates/sparc-coordinator.md +3 -3
  23. package/.claude/helpers/auto-memory-hook.mjs +365 -0
  24. package/.claude/helpers/hook-handler.cjs +271 -0
  25. package/.claude/helpers/intelligence.cjs +916 -0
  26. package/.claude/helpers/learning-service.mjs +7 -7
  27. package/.claude/helpers/memory.js +1 -1
  28. package/.claude/helpers/metrics-db.mjs +4 -4
  29. package/.claude/helpers/session.js +9 -1
  30. package/.claude/helpers/statusline.cjs +100 -32
  31. package/.claude/helpers/statusline.js +2 -2
  32. package/.claude/settings.json +86 -141
  33. package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
  34. package/.claude/skills/skill-builder/.claude-flow/metrics/agent-metrics.json +1 -0
  35. package/.claude/skills/skill-builder/.claude-flow/metrics/performance.json +87 -0
  36. package/.claude/skills/skill-builder/.claude-flow/metrics/task-metrics.json +10 -0
  37. package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
  38. package/README.md +952 -481
  39. package/bin/cli.js +2 -2
  40. package/bin/mcp-server.js +1 -1
  41. package/bin/preinstall.cjs +2 -0
  42. package/dist/src/appliance/rvfa-builder.js +4 -4
  43. package/dist/src/appliance/rvfa-format.d.ts +1 -1
  44. package/dist/src/appliance/rvfa-format.js +1 -1
  45. package/dist/src/appliance/rvfa-runner.js +8 -8
  46. package/dist/src/commands/agent.js +15 -15
  47. package/dist/src/commands/analyze.js +52 -52
  48. package/dist/src/commands/appliance-advanced.js +1 -1
  49. package/dist/src/commands/appliance.js +16 -16
  50. package/dist/src/commands/benchmark.js +14 -14
  51. package/dist/src/commands/categories.js +1 -1
  52. package/dist/src/commands/claims.js +16 -16
  53. package/dist/src/commands/completions.js +37 -37
  54. package/dist/src/commands/config.js +9 -9
  55. package/dist/src/commands/daemon.js +21 -21
  56. package/dist/src/commands/deployment.js +15 -15
  57. package/dist/src/commands/doctor.js +26 -26
  58. package/dist/src/commands/embeddings.js +48 -48
  59. package/dist/src/commands/guidance.js +22 -22
  60. package/dist/src/commands/hive-mind.js +21 -21
  61. package/dist/src/commands/hooks.js +105 -105
  62. package/dist/src/commands/init.js +32 -32
  63. package/dist/src/commands/issues.js +6 -6
  64. package/dist/src/commands/mcp.js +13 -13
  65. package/dist/src/commands/memory.js +35 -35
  66. package/dist/src/commands/migrate.js +6 -6
  67. package/dist/src/commands/neural.js +31 -31
  68. package/dist/src/commands/performance.js +13 -13
  69. package/dist/src/commands/plugins.js +26 -26
  70. package/dist/src/commands/process.js +32 -32
  71. package/dist/src/commands/progress.js +5 -5
  72. package/dist/src/commands/providers.js +13 -13
  73. package/dist/src/commands/route.js +26 -26
  74. package/dist/src/commands/ruvector/backup.js +9 -9
  75. package/dist/src/commands/ruvector/benchmark.js +4 -4
  76. package/dist/src/commands/ruvector/import.d.ts +3 -3
  77. package/dist/src/commands/ruvector/import.js +11 -11
  78. package/dist/src/commands/ruvector/index.js +9 -9
  79. package/dist/src/commands/ruvector/init.js +7 -7
  80. package/dist/src/commands/ruvector/migrate.js +5 -5
  81. package/dist/src/commands/ruvector/optimize.js +7 -7
  82. package/dist/src/commands/ruvector/setup.d.ts +3 -3
  83. package/dist/src/commands/ruvector/setup.js +9 -9
  84. package/dist/src/commands/ruvector/status.js +4 -4
  85. package/dist/src/commands/security.js +19 -19
  86. package/dist/src/commands/session.js +13 -13
  87. package/dist/src/commands/start.js +13 -13
  88. package/dist/src/commands/status.js +9 -9
  89. package/dist/src/commands/swarm.js +7 -7
  90. package/dist/src/commands/task.js +9 -9
  91. package/dist/src/commands/transfer-store.js +16 -16
  92. package/dist/src/commands/update.js +2 -2
  93. package/dist/src/commands/workflow.js +13 -13
  94. package/dist/src/config-adapter.js +3 -3
  95. package/dist/src/index.js +1 -1
  96. package/dist/src/init/claudemd-generator.js +1 -1
  97. package/dist/src/init/executor.js +6 -6
  98. package/dist/src/init/helpers-generator.js +4 -4
  99. package/dist/src/init/mcp-generator.js +7 -7
  100. package/dist/src/init/settings-generator.js +4 -4
  101. package/dist/src/init/statusline-generator.js +12 -12
  102. package/dist/src/init/types.d.ts +4 -4
  103. package/dist/src/init/types.js +3 -3
  104. package/dist/src/mcp-server.js +2 -2
  105. package/dist/src/mcp-tools/auto-install.js +5 -5
  106. package/dist/src/mcp-tools/hooks-tools.js +1 -1
  107. package/dist/src/mcp-tools/neural-tools.js +6 -6
  108. package/dist/src/mcp-tools/security-tools.js +2 -2
  109. package/dist/src/memory/memory-bridge.d.ts +4 -4
  110. package/dist/src/memory/memory-bridge.js +15 -15
  111. package/dist/src/memory/memory-initializer.js +10 -10
  112. package/dist/src/plugins/manager.js +8 -8
  113. package/dist/src/plugins/tests/demo-plugin-store.js +6 -6
  114. package/dist/src/ruvector/enhanced-model-router.js +3 -3
  115. package/dist/src/services/agentic-flow-bridge.d.ts +11 -11
  116. package/dist/src/services/agentic-flow-bridge.js +11 -11
  117. package/dist/src/services/container-worker-pool.js +2 -2
  118. package/dist/src/services/worker-queue.js +1 -1
  119. package/dist/src/suggest.js +1 -1
  120. package/dist/src/transfer/models/seraphine.js +1 -1
  121. package/dist/src/transfer/serialization/cfp.js +1 -1
  122. package/dist/src/transfer/store/discovery.js +1 -1
  123. package/dist/src/types.d.ts +1 -1
  124. package/dist/src/update/validator.js +1 -1
  125. package/package.json +10 -7
@@ -7,7 +7,7 @@
7
7
  * Features:
8
8
  * - Persistent pattern storage via AgentDB
9
9
  * - HNSW indexing for 150x-12,500x faster search
10
- * - ONNX embeddings via @sparkleideas/agentic-flow@alpha
10
+ * - ONNX embeddings via agentic-flow@alpha
11
11
  * - Session-level pattern loading and consolidation
12
12
  * - Short-term → Long-term pattern promotion
13
13
  *
@@ -27,7 +27,7 @@ import Database from 'better-sqlite3';
27
27
  const __filename = fileURLToPath(import.meta.url);
28
28
  const __dirname = dirname(__filename);
29
29
  const PROJECT_ROOT = join(__dirname, '../..');
30
- const DATA_DIR = join(PROJECT_ROOT, '.@sparkleideas/claude-flow/learning');
30
+ const DATA_DIR = join(PROJECT_ROOT, '.claude-flow/learning');
31
31
  const DB_PATH = join(DATA_DIR, 'patterns.db');
32
32
  const METRICS_PATH = join(DATA_DIR, 'learning-metrics.json');
33
33
 
@@ -444,7 +444,7 @@ class HNSWIndex {
444
444
  }
445
445
 
446
446
  // =============================================================================
447
- // Embedding Service (ONNX via @sparkleideas/agentic-flow@alpha OptimizedEmbedder)
447
+ // Embedding Service (ONNX via agentic-flow@alpha OptimizedEmbedder)
448
448
  // =============================================================================
449
449
 
450
450
  class EmbeddingService {
@@ -460,7 +460,7 @@ class EmbeddingService {
460
460
  if (this.initialized) return;
461
461
 
462
462
  try {
463
- // Dynamically import @sparkleideas/agentic-flow OptimizedEmbedder
463
+ // Dynamically import agentic-flow OptimizedEmbedder
464
464
  const agenticFlowPath = join(PROJECT_ROOT, 'node_modules/agentic-flow/dist/embeddings/optimized-embedder.js');
465
465
 
466
466
  if (existsSync(agenticFlowPath)) {
@@ -474,10 +474,10 @@ class EmbeddingService {
474
474
 
475
475
  await this.embedder.init();
476
476
  this.useAgenticFlow = true;
477
- console.log('[Embedding] Initialized: @sparkleideas/agentic-flow OptimizedEmbedder (ONNX)');
477
+ console.log('[Embedding] Initialized: agentic-flow OptimizedEmbedder (ONNX)');
478
478
  } else {
479
479
  this.useAgenticFlow = false;
480
- console.log('[Embedding] @sparkleideas/agentic-flow not found, using fallback hash embeddings');
480
+ console.log('[Embedding] agentic-flow not found, using fallback hash embeddings');
481
481
  }
482
482
 
483
483
  this.initialized = true;
@@ -501,7 +501,7 @@ class EmbeddingService {
501
501
 
502
502
  if (this.useAgenticFlow && this.embedder) {
503
503
  try {
504
- // Use @sparkleideas/agentic-flow OptimizedEmbedder
504
+ // Use agentic-flow OptimizedEmbedder
505
505
  embedding = await this.embedder.embed(text.slice(0, 500));
506
506
  } catch (e) {
507
507
  console.log(`[Embedding] ONNX failed, using fallback: ${e.message}`);
@@ -7,7 +7,7 @@
7
7
  const fs = require('fs');
8
8
  const path = require('path');
9
9
 
10
- const MEMORY_DIR = path.join(process.cwd(), '.@sparkleideas/claude-flow', 'data');
10
+ const MEMORY_DIR = path.join(process.cwd(), '.claude-flow', 'data');
11
11
  const MEMORY_FILE = path.join(MEMORY_DIR, 'memory.json');
12
12
 
13
13
  function loadMemory() {
@@ -14,7 +14,7 @@ import { execSync } from 'child_process';
14
14
  const __dirname = dirname(fileURLToPath(import.meta.url));
15
15
  const PROJECT_ROOT = join(__dirname, '../..');
16
16
  const V3_DIR = join(PROJECT_ROOT, 'v3');
17
- const DB_PATH = join(PROJECT_ROOT, '.@sparkleideas/claude-flow', 'metrics.db');
17
+ const DB_PATH = join(PROJECT_ROOT, '.claude-flow', 'metrics.db');
18
18
 
19
19
  // Ensure directory exists
20
20
  const dbDir = dirname(DB_PATH);
@@ -255,7 +255,7 @@ async function syncMetrics() {
255
255
  if (existsSync(modulesDir)) {
256
256
  const entries = readdirSync(modulesDir, { withFileTypes: true });
257
257
  for (const entry of entries) {
258
- // Skip hidden directories (like .@sparkleideas/agentic-flow, .@sparkleideas/claude-flow)
258
+ // Skip hidden directories (like .agentic-flow, .claude-flow)
259
259
  if (entry.isDirectory() && !entry.name.startsWith('.')) {
260
260
  const moduleDir = join(modulesDir, entry.name);
261
261
  const { files, lines } = countFilesAndLines(moduleDir);
@@ -388,8 +388,8 @@ function getMetricsJSON() {
388
388
  */
389
389
  function exportToJSON() {
390
390
  const metrics = getMetricsJSON();
391
- const metricsDir = join(PROJECT_ROOT, '.@sparkleideas/claude-flow/metrics');
392
- const securityDir = join(PROJECT_ROOT, '.@sparkleideas/claude-flow/security');
391
+ const metricsDir = join(PROJECT_ROOT, '.claude-flow/metrics');
392
+ const securityDir = join(PROJECT_ROOT, '.claude-flow/security');
393
393
 
394
394
  if (!existsSync(metricsDir)) mkdirSync(metricsDir, { recursive: true });
395
395
  if (!existsSync(securityDir)) mkdirSync(securityDir, { recursive: true });
@@ -7,7 +7,7 @@
7
7
  const fs = require('fs');
8
8
  const path = require('path');
9
9
 
10
- const SESSION_DIR = path.join(process.cwd(), '.@sparkleideas/claude-flow', 'sessions');
10
+ const SESSION_DIR = path.join(process.cwd(), '.claude-flow', 'sessions');
11
11
  const SESSION_FILE = path.join(SESSION_DIR, 'current.json');
12
12
 
13
13
  const commands = {
@@ -100,6 +100,14 @@ const commands = {
100
100
  return session;
101
101
  },
102
102
 
103
+ get: (key) => {
104
+ if (!fs.existsSync(SESSION_FILE)) return null;
105
+ try {
106
+ const session = JSON.parse(fs.readFileSync(SESSION_FILE, 'utf-8'));
107
+ return key ? (session.context || {})[key] : session.context;
108
+ } catch { return null; }
109
+ },
110
+
103
111
  metric: (name) => {
104
112
  if (!fs.existsSync(SESSION_FILE)) {
105
113
  return null;
@@ -135,48 +135,104 @@ function getUserInfo() {
135
135
  return { name, gitBranch, modelName };
136
136
  }
137
137
 
138
- // Get learning stats from memory database
138
+ // Get learning stats from intelligence loop data (ADR-050)
139
139
  function getLearningStats() {
140
- const memoryPaths = [
141
- path.join(process.cwd(), '.swarm', 'memory.db'),
142
- path.join(process.cwd(), '.claude', 'memory.db'),
143
- path.join(process.cwd(), 'data', 'memory.db'),
144
- ];
145
-
146
140
  let patterns = 0;
147
141
  let sessions = 0;
148
142
  let trajectories = 0;
143
+ let edges = 0;
144
+ let confidenceMean = 0;
145
+ let accessedCount = 0;
146
+ let trend = 'STABLE';
147
+
148
+ // PRIMARY: Read from intelligence loop data files
149
+ const dataDir = path.join(process.cwd(), '.claude-flow', 'data');
150
+
151
+ // 1. graph-state.json — authoritative node/edge counts
152
+ const graphPath = path.join(dataDir, 'graph-state.json');
153
+ if (fs.existsSync(graphPath)) {
154
+ try {
155
+ const graph = JSON.parse(fs.readFileSync(graphPath, 'utf-8'));
156
+ patterns = graph.nodes ? Object.keys(graph.nodes).length : 0;
157
+ edges = Array.isArray(graph.edges) ? graph.edges.length : 0;
158
+ } catch (e) { /* ignore */ }
159
+ }
160
+
161
+ // 2. ranked-context.json — confidence and access data
162
+ const rankedPath = path.join(dataDir, 'ranked-context.json');
163
+ if (fs.existsSync(rankedPath)) {
164
+ try {
165
+ const ranked = JSON.parse(fs.readFileSync(rankedPath, 'utf-8'));
166
+ if (ranked.entries && ranked.entries.length > 0) {
167
+ patterns = Math.max(patterns, ranked.entries.length);
168
+ let confSum = 0;
169
+ let accCount = 0;
170
+ for (let i = 0; i < ranked.entries.length; i++) {
171
+ confSum += (ranked.entries[i].confidence || 0);
172
+ if ((ranked.entries[i].accessCount || 0) > 0) accCount++;
173
+ }
174
+ confidenceMean = confSum / ranked.entries.length;
175
+ accessedCount = accCount;
176
+ }
177
+ } catch (e) { /* ignore */ }
178
+ }
149
179
 
150
- // Try to read from sqlite database
151
- for (const dbPath of memoryPaths) {
152
- if (fs.existsSync(dbPath)) {
180
+ // 3. intelligence-snapshot.json trend history
181
+ const snapshotPath = path.join(dataDir, 'intelligence-snapshot.json');
182
+ if (fs.existsSync(snapshotPath)) {
183
+ try {
184
+ const snapshot = JSON.parse(fs.readFileSync(snapshotPath, 'utf-8'));
185
+ if (snapshot.history && snapshot.history.length >= 2) {
186
+ const first = snapshot.history[0];
187
+ const last = snapshot.history[snapshot.history.length - 1];
188
+ const confDrift = (last.confidenceMean || 0) - (first.confidenceMean || 0);
189
+ trend = confDrift > 0.01 ? 'IMPROVING' : confDrift < -0.01 ? 'DECLINING' : 'STABLE';
190
+ sessions = Math.max(sessions, snapshot.history.length);
191
+ }
192
+ } catch (e) { /* ignore */ }
193
+ }
194
+
195
+ // 4. auto-memory-store.json — fallback entry count
196
+ if (patterns === 0) {
197
+ const autoMemPath = path.join(dataDir, 'auto-memory-store.json');
198
+ if (fs.existsSync(autoMemPath)) {
153
199
  try {
154
- // Count entries in memory file (rough estimate from file size)
155
- const stats = fs.statSync(dbPath);
156
- const sizeKB = stats.size / 1024;
157
- // Estimate: ~2KB per pattern on average
158
- patterns = Math.floor(sizeKB / 2);
159
- sessions = Math.max(1, Math.floor(patterns / 10));
160
- trajectories = Math.floor(patterns / 5);
161
- break;
162
- } catch (e) {
163
- // Ignore
200
+ const data = JSON.parse(fs.readFileSync(autoMemPath, 'utf-8'));
201
+ patterns = Array.isArray(data) ? data.length : (data.entries ? data.entries.length : 0);
202
+ } catch (e) { /* ignore */ }
203
+ }
204
+ }
205
+
206
+ // FALLBACK: Legacy memory.db file-size estimation
207
+ if (patterns === 0) {
208
+ const memoryPaths = [
209
+ path.join(process.cwd(), '.swarm', 'memory.db'),
210
+ path.join(process.cwd(), '.claude', 'memory.db'),
211
+ path.join(process.cwd(), 'data', 'memory.db'),
212
+ ];
213
+ for (let j = 0; j < memoryPaths.length; j++) {
214
+ if (fs.existsSync(memoryPaths[j])) {
215
+ try {
216
+ const dbStats = fs.statSync(memoryPaths[j]);
217
+ patterns = Math.floor(dbStats.size / 1024 / 2);
218
+ break;
219
+ } catch (e) { /* ignore */ }
164
220
  }
165
221
  }
166
222
  }
167
223
 
168
- // Also check for session files
224
+ // Session count from session files
169
225
  const sessionsPath = path.join(process.cwd(), '.claude', 'sessions');
170
226
  if (fs.existsSync(sessionsPath)) {
171
227
  try {
172
228
  const sessionFiles = fs.readdirSync(sessionsPath).filter(f => f.endsWith('.json'));
173
229
  sessions = Math.max(sessions, sessionFiles.length);
174
- } catch (e) {
175
- // Ignore
176
- }
230
+ } catch (e) { /* ignore */ }
177
231
  }
178
232
 
179
- return { patterns, sessions, trajectories };
233
+ trajectories = Math.floor(patterns / 5);
234
+
235
+ return { patterns, sessions, trajectories, edges, confidenceMean, accessedCount, trend };
180
236
  }
181
237
 
182
238
  // Get V3 progress from learning state (grows as system learns)
@@ -250,10 +306,10 @@ function getSwarmStatus() {
250
306
  try {
251
307
  if (isWindows) {
252
308
  // Windows: use tasklist and findstr
253
- const ps = execSync('tasklist 2>NUL | findstr /I "@sparkleideas/agentic-flow" 2>NUL | find /C /V "" 2>NUL || echo 0', { encoding: 'utf-8' });
309
+ const ps = execSync('tasklist 2>NUL | findstr /I "agentic-flow" 2>NUL | find /C /V "" 2>NUL || echo 0', { encoding: 'utf-8' });
254
310
  activeAgents = Math.max(0, parseInt(ps.trim()) || 0);
255
311
  } else {
256
- const ps = execSync('ps aux 2>/dev/null | grep -c @sparkleideas/agentic-flow || echo "0"', { encoding: 'utf-8' });
312
+ const ps = execSync('ps aux 2>/dev/null | grep -c agentic-flow || echo "0"', { encoding: 'utf-8' });
257
313
  activeAgents = Math.max(0, parseInt(ps.trim()) - 1);
258
314
  }
259
315
  coordinationActive = activeAgents > 0;
@@ -290,20 +346,32 @@ function getSystemMetrics() {
290
346
  // Get learning stats for intelligence %
291
347
  const learning = getLearningStats();
292
348
 
293
- // Intelligence % based on learned patterns (0 patterns = 0%, 1000+ = 100%)
294
- const intelligencePct = Math.min(100, Math.floor((learning.patterns / 10) * 1));
349
+ // Intelligence % from REAL intelligence loop data (ADR-050)
350
+ // Composite: 40% confidence mean + 30% access ratio + 30% pattern density
351
+ let intelligencePct = 0;
352
+ if (learning.confidenceMean > 0 || (learning.patterns > 0 && learning.accessedCount > 0)) {
353
+ const confScore = Math.min(100, Math.floor(learning.confidenceMean * 100));
354
+ const accessRatio = learning.patterns > 0 ? (learning.accessedCount / learning.patterns) : 0;
355
+ const accessScore = Math.min(100, Math.floor(accessRatio * 100));
356
+ const densityScore = Math.min(100, Math.floor(learning.patterns / 5));
357
+ intelligencePct = Math.floor(confScore * 0.4 + accessScore * 0.3 + densityScore * 0.3);
358
+ }
359
+ // Fallback: legacy pattern count
360
+ if (intelligencePct === 0 && learning.patterns > 0) {
361
+ intelligencePct = Math.min(100, Math.floor(learning.patterns / 10));
362
+ }
295
363
 
296
- // Context % based on session history (0 sessions = 0%, grows with usage)
364
+ // Context % based on session history
297
365
  const contextPct = Math.min(100, Math.floor(learning.sessions * 5));
298
366
 
299
367
  // Count active sub-agents from process list
300
368
  try {
301
369
  if (isWindows) {
302
370
  // Windows: use tasklist and findstr for agent counting
303
- const agents = execSync('tasklist 2>NUL | findstr /I "@sparkleideas/claude-flow" 2>NUL | find /C /V "" 2>NUL || echo 0', { encoding: 'utf-8' });
371
+ const agents = execSync('tasklist 2>NUL | findstr /I "claude-flow" 2>NUL | find /C /V "" 2>NUL || echo 0', { encoding: 'utf-8' });
304
372
  subAgents = Math.max(0, parseInt(agents.trim()) || 0);
305
373
  } else {
306
- const agents = execSync('ps aux 2>/dev/null | grep -c "@sparkleideas/claude-flow.*agent" || echo "0"', { encoding: 'utf-8' });
374
+ const agents = execSync('ps aux 2>/dev/null | grep -c "claude-flow.*agent" || echo "0"', { encoding: 'utf-8' });
307
375
  subAgents = Math.max(0, parseInt(agents.trim()) - 1);
308
376
  }
309
377
  } catch (e) {
@@ -172,7 +172,7 @@ function getSwarmStatus() {
172
172
  let coordinationActive = false;
173
173
 
174
174
  try {
175
- const ps = execSync('ps aux 2>/dev/null | grep -c @sparkleideas/agentic-flow || echo "0"', { encoding: 'utf-8' });
175
+ const ps = execSync('ps aux 2>/dev/null | grep -c agentic-flow || echo "0"', { encoding: 'utf-8' });
176
176
  activeAgents = Math.max(0, parseInt(ps.trim()) - 1);
177
177
  coordinationActive = activeAgents > 0;
178
178
  } catch (e) {
@@ -210,7 +210,7 @@ function getSystemMetrics() {
210
210
 
211
211
  // Count active sub-agents from process list
212
212
  try {
213
- const agents = execSync('ps aux 2>/dev/null | grep -c "@sparkleideas/claude-flow.*agent" || echo "0"', { encoding: 'utf-8' });
213
+ const agents = execSync('ps aux 2>/dev/null | grep -c "claude-flow.*agent" || echo "0"', { encoding: 'utf-8' });
214
214
  subAgents = Math.max(0, parseInt(agents.trim()) - 1);
215
215
  } catch (e) {
216
216
  // Ignore
@@ -1,123 +1,95 @@
1
1
  {
2
+ "env": {
3
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
4
+ "CLAUDE_FLOW_V3_ENABLED": "true",
5
+ "CLAUDE_FLOW_HOOKS_ENABLED": "true"
6
+ },
2
7
  "hooks": {
3
8
  "PreToolUse": [
4
9
  {
5
- "matcher": "^(Write|Edit|MultiEdit)$",
6
- "hooks": [
7
- {
8
- "type": "command",
9
- "command": "[ -n \"$TOOL_INPUT_file_path\" ] && npx @sparkleideas/cli@latest hooks pre-edit --file \"$TOOL_INPUT_file_path\" 2>/dev/null || true",
10
- "timeout": 5000,
11
- "continueOnError": true
12
- }
13
- ]
14
- },
15
- {
16
- "matcher": "^Bash$",
17
- "hooks": [
18
- {
19
- "type": "command",
20
- "command": "[ -n \"$TOOL_INPUT_command\" ] && npx @sparkleideas/cli@latest hooks pre-command --command \"$TOOL_INPUT_command\" 2>/dev/null || true",
21
- "timeout": 5000,
22
- "continueOnError": true
23
- }
24
- ]
25
- },
26
- {
27
- "matcher": "^Task$",
10
+ "matcher": "Bash",
28
11
  "hooks": [
29
12
  {
30
13
  "type": "command",
31
- "command": "[ -n \"$TOOL_INPUT_prompt\" ] && npx @sparkleideas/cli@latest hooks pre-task --task-id \"task-$(date +%s)\" --description \"$TOOL_INPUT_prompt\" 2>/dev/null || true",
32
- "timeout": 5000,
33
- "continueOnError": true
14
+ "command": "node .claude/helpers/hook-handler.cjs pre-bash",
15
+ "timeout": 5000
34
16
  }
35
17
  ]
36
18
  }
37
19
  ],
38
20
  "PostToolUse": [
39
21
  {
40
- "matcher": "^(Write|Edit|MultiEdit)$",
22
+ "matcher": "Write|Edit|MultiEdit",
41
23
  "hooks": [
42
24
  {
43
25
  "type": "command",
44
- "command": "[ -n \"$TOOL_INPUT_file_path\" ] && npx @sparkleideas/cli@latest hooks post-edit --file \"$TOOL_INPUT_file_path\" --success \"${TOOL_SUCCESS:-true}\" 2>/dev/null || true",
45
- "timeout": 5000,
46
- "continueOnError": true
26
+ "command": "node .claude/helpers/hook-handler.cjs post-edit",
27
+ "timeout": 10000
47
28
  }
48
29
  ]
49
- },
30
+ }
31
+ ],
32
+ "UserPromptSubmit": [
50
33
  {
51
- "matcher": "^Bash$",
52
34
  "hooks": [
53
35
  {
54
36
  "type": "command",
55
- "command": "[ -n \"$TOOL_INPUT_command\" ] && npx @sparkleideas/cli@latest hooks post-command --command \"$TOOL_INPUT_command\" --success \"${TOOL_SUCCESS:-true}\" 2>/dev/null || true",
56
- "timeout": 5000,
57
- "continueOnError": true
37
+ "command": "node .claude/helpers/hook-handler.cjs route",
38
+ "timeout": 10000
58
39
  }
59
40
  ]
60
- },
41
+ }
42
+ ],
43
+ "SessionStart": [
61
44
  {
62
- "matcher": "^Task$",
45
+ "matcher": "startup|resume",
63
46
  "hooks": [
64
47
  {
65
48
  "type": "command",
66
- "command": "[ -n \"$TOOL_RESULT_agent_id\" ] && npx @sparkleideas/cli@latest hooks post-task --task-id \"$TOOL_RESULT_agent_id\" --success \"${TOOL_SUCCESS:-true}\" 2>/dev/null || true",
67
- "timeout": 5000,
49
+ "command": "node .claude/helpers/hook-handler.cjs session-restore",
50
+ "timeout": 15000,
68
51
  "continueOnError": true
69
- }
70
- ]
71
- }
72
- ],
73
- "UserPromptSubmit": [
74
- {
75
- "hooks": [
52
+ },
76
53
  {
77
54
  "type": "command",
78
- "command": "[ -n \"$PROMPT\" ] && npx @sparkleideas/cli@latest hooks route --task \"$PROMPT\" || true",
79
- "timeout": 5000,
55
+ "command": "node .claude/helpers/auto-memory-hook.mjs import",
56
+ "timeout": 8000,
80
57
  "continueOnError": true
81
58
  }
82
59
  ]
83
60
  }
84
61
  ],
85
- "SessionStart": [
62
+ "SessionEnd": [
86
63
  {
87
64
  "hooks": [
88
65
  {
89
66
  "type": "command",
90
- "command": "npx @sparkleideas/cli@latest daemon start --quiet 2>/dev/null || true",
91
- "timeout": 5000,
92
- "continueOnError": true
93
- },
94
- {
95
- "type": "command",
96
- "command": "[ -n \"$SESSION_ID\" ] && npx @sparkleideas/cli@latest hooks session-restore --session-id \"$SESSION_ID\" 2>/dev/null || true",
67
+ "command": "node .claude/helpers/hook-handler.cjs session-end",
97
68
  "timeout": 10000,
98
69
  "continueOnError": true
99
70
  }
100
71
  ]
101
72
  }
102
73
  ],
103
- "Stop": [
74
+ "SubagentStart": [
104
75
  {
105
76
  "hooks": [
106
77
  {
107
78
  "type": "command",
108
- "command": "echo '{\"ok\": true}'",
109
- "timeout": 1000
79
+ "command": "node .claude/helpers/hook-handler.cjs status",
80
+ "timeout": 3000,
81
+ "continueOnError": true
110
82
  }
111
83
  ]
112
84
  }
113
85
  ],
114
- "Notification": [
86
+ "Stop": [
115
87
  {
116
88
  "hooks": [
117
89
  {
118
90
  "type": "command",
119
- "command": "[ -n \"$NOTIFICATION_MESSAGE\" ] && npx @sparkleideas/cli@latest memory store --namespace notifications --key \"notify-$(date +%s)\" --value \"$NOTIFICATION_MESSAGE\" 2>/dev/null || true",
120
- "timeout": 3000,
91
+ "command": "node .claude/helpers/auto-memory-hook.mjs sync",
92
+ "timeout": 10000,
121
93
  "continueOnError": true
122
94
  }
123
95
  ]
@@ -126,24 +98,44 @@
126
98
  },
127
99
  "statusLine": {
128
100
  "type": "command",
129
- "command": "npx @sparkleideas/cli@latest hooks statusline 2>/dev/null || node .claude/helpers/statusline.cjs 2>/dev/null || echo \"▊ Claude Flow V3\"",
101
+ "command": "node .claude/helpers/statusline.cjs",
130
102
  "refreshMs": 5000,
131
103
  "enabled": true
132
104
  },
133
105
  "permissions": {
134
106
  "allow": [
135
- "Bash(npx @sparkleideas/claude-flow:*)",
136
- "Bash(npx @sparkleideas/cli:*)",
107
+ "Bash(npx @claude-flow*)",
108
+ "Bash(npx claude-flow*)",
109
+ "Bash(node .claude/*)",
137
110
  "mcp__claude-flow__:*"
138
111
  ],
139
- "deny": []
112
+ "deny": [
113
+ "Read(./.env)",
114
+ "Read(./.env.*)"
115
+ ]
116
+ },
117
+ "attribution": {
118
+ "commit": "Co-Authored-By: claude-flow <ruv@ruv.net>",
119
+ "pr": "Generated with [claude-flow](https://github.com/ruvnet/claude-flow)"
140
120
  },
141
121
  "claudeFlow": {
142
- "version": "3.0.0",
122
+ "version": "3.1.0",
143
123
  "enabled": true,
144
124
  "modelPreferences": {
145
- "default": "claude-opus-4-5-20251101",
146
- "routing": "claude-3-5-haiku-20241022"
125
+ "default": "claude-opus-4-6",
126
+ "routing": "claude-haiku-4-5-20251001"
127
+ },
128
+ "agentTeams": {
129
+ "enabled": true,
130
+ "teammateMode": "auto",
131
+ "taskListEnabled": true,
132
+ "mailboxEnabled": true,
133
+ "coordination": {
134
+ "autoAssignOnIdle": true,
135
+ "trainPatternsOnComplete": true,
136
+ "notifyLeadOnComplete": true,
137
+ "sharedMemoryNamespace": "agent-teams"
138
+ }
147
139
  },
148
140
  "swarm": {
149
141
  "topology": "hierarchical-mesh",
@@ -151,87 +143,40 @@
151
143
  },
152
144
  "memory": {
153
145
  "backend": "hybrid",
154
- "enableHNSW": true
146
+ "enableHNSW": true,
147
+ "learningBridge": {
148
+ "enabled": true,
149
+ "sonaMode": "balanced",
150
+ "confidenceDecayRate": 0.005,
151
+ "accessBoostAmount": 0.03,
152
+ "consolidationThreshold": 10
153
+ },
154
+ "memoryGraph": {
155
+ "enabled": true,
156
+ "pageRankDamping": 0.85,
157
+ "communityAlgorithm": "label-propagation"
158
+ },
159
+ "agentScopes": {
160
+ "enabled": true,
161
+ "scopes": ["project", "local", "user"]
162
+ }
155
163
  },
156
164
  "neural": {
157
165
  "enabled": true
158
166
  },
167
+ "security": {
168
+ "autoScan": true,
169
+ "scanOnEdit": true,
170
+ "cveCheck": true
171
+ },
159
172
  "daemon": {
160
173
  "autoStart": true,
161
- "workers": [
162
- "map",
163
- "audit",
164
- "optimize",
165
- "consolidate",
166
- "testgaps",
167
- "ultralearn",
168
- "deepdive",
169
- "document",
170
- "refactor",
171
- "benchmark"
172
- ],
173
- "schedules": {
174
- "audit": {
175
- "interval": "1h",
176
- "priority": "critical"
177
- },
178
- "optimize": {
179
- "interval": "30m",
180
- "priority": "high"
181
- },
182
- "consolidate": {
183
- "interval": "2h",
184
- "priority": "low"
185
- },
186
- "document": {
187
- "interval": "1h",
188
- "priority": "normal",
189
- "triggers": [
190
- "adr-update",
191
- "api-change"
192
- ]
193
- },
194
- "deepdive": {
195
- "interval": "4h",
196
- "priority": "normal",
197
- "triggers": [
198
- "complex-change"
199
- ]
200
- },
201
- "ultralearn": {
202
- "interval": "1h",
203
- "priority": "normal"
204
- }
205
- }
174
+ "workers": ["map", "audit", "optimize", "consolidate", "testgaps", "ultralearn"]
206
175
  },
207
176
  "learning": {
208
177
  "enabled": true,
209
178
  "autoTrain": true,
210
- "patterns": [
211
- "coordination",
212
- "optimization",
213
- "prediction"
214
- ],
215
- "retention": {
216
- "shortTerm": "24h",
217
- "longTerm": "30d"
218
- }
219
- },
220
- "adr": {
221
- "autoGenerate": true,
222
- "directory": "/docs/adr",
223
- "template": "madr"
224
- },
225
- "ddd": {
226
- "trackDomains": true,
227
- "validateBoundedContexts": true,
228
- "directory": "/docs/ddd"
229
- },
230
- "security": {
231
- "autoScan": true,
232
- "scanOnEdit": true,
233
- "cveCheck": true,
234
- "threatModel": true
179
+ "patterns": ["coordination", "optimization", "prediction"]
235
180
  }
236
181
  }
237
- }
182
+ }
@@ -11,8 +11,8 @@ Implements ReasoningBank's adaptive learning system for AI agents to learn from
11
11
 
12
12
  ## Prerequisites
13
13
 
14
- - agentic-flow v1.5.11+
15
- - AgentDB v1.0.4+ (for persistence)
14
+ - agentic-flow v3.0.0-alpha.1+
15
+ - AgentDB v3.0.0-alpha.10+ (for persistence)
16
16
  - Node.js 18+
17
17
 
18
18
  ## Quick Start