@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.
- package/.claude/agents/core/coder.md +1 -1
- package/.claude/agents/core/planner.md +2 -2
- package/.claude/agents/core/researcher.md +1 -1
- package/.claude/agents/core/reviewer.md +1 -1
- package/.claude/agents/core/tester.md +1 -1
- package/.claude/agents/data/data-ml-model.md +4 -4
- package/.claude/agents/development/dev-backend-api.md +4 -4
- package/.claude/agents/documentation/docs-api-openapi.md +4 -4
- package/.claude/agents/github/code-review-swarm.md +2 -2
- package/.claude/agents/github/issue-tracker.md +2 -2
- package/.claude/agents/github/pr-manager.md +2 -2
- package/.claude/agents/github/release-manager.md +2 -2
- package/.claude/agents/github/workflow-automation.md +2 -2
- package/.claude/agents/sparc/architecture.md +3 -3
- package/.claude/agents/sparc/pseudocode.md +2 -2
- package/.claude/agents/sparc/refinement.md +3 -3
- package/.claude/agents/sparc/specification.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
- package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
- package/.claude/agents/swarm/mesh-coordinator.md +1 -1
- package/.claude/agents/templates/base-template-generator.md +3 -3
- package/.claude/agents/templates/sparc-coordinator.md +3 -3
- package/.claude/helpers/auto-memory-hook.mjs +365 -0
- package/.claude/helpers/hook-handler.cjs +271 -0
- package/.claude/helpers/intelligence.cjs +916 -0
- package/.claude/helpers/learning-service.mjs +7 -7
- package/.claude/helpers/memory.js +1 -1
- package/.claude/helpers/metrics-db.mjs +4 -4
- package/.claude/helpers/session.js +9 -1
- package/.claude/helpers/statusline.cjs +100 -32
- package/.claude/helpers/statusline.js +2 -2
- package/.claude/settings.json +86 -141
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/skill-builder/.claude-flow/metrics/agent-metrics.json +1 -0
- package/.claude/skills/skill-builder/.claude-flow/metrics/performance.json +87 -0
- package/.claude/skills/skill-builder/.claude-flow/metrics/task-metrics.json +10 -0
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/README.md +952 -481
- package/bin/cli.js +2 -2
- package/bin/mcp-server.js +1 -1
- package/bin/preinstall.cjs +2 -0
- package/dist/src/appliance/rvfa-builder.js +4 -4
- package/dist/src/appliance/rvfa-format.d.ts +1 -1
- package/dist/src/appliance/rvfa-format.js +1 -1
- package/dist/src/appliance/rvfa-runner.js +8 -8
- package/dist/src/commands/agent.js +15 -15
- package/dist/src/commands/analyze.js +52 -52
- package/dist/src/commands/appliance-advanced.js +1 -1
- package/dist/src/commands/appliance.js +16 -16
- package/dist/src/commands/benchmark.js +14 -14
- package/dist/src/commands/categories.js +1 -1
- package/dist/src/commands/claims.js +16 -16
- package/dist/src/commands/completions.js +37 -37
- package/dist/src/commands/config.js +9 -9
- package/dist/src/commands/daemon.js +21 -21
- package/dist/src/commands/deployment.js +15 -15
- package/dist/src/commands/doctor.js +26 -26
- package/dist/src/commands/embeddings.js +48 -48
- package/dist/src/commands/guidance.js +22 -22
- package/dist/src/commands/hive-mind.js +21 -21
- package/dist/src/commands/hooks.js +105 -105
- package/dist/src/commands/init.js +32 -32
- package/dist/src/commands/issues.js +6 -6
- package/dist/src/commands/mcp.js +13 -13
- package/dist/src/commands/memory.js +35 -35
- package/dist/src/commands/migrate.js +6 -6
- package/dist/src/commands/neural.js +31 -31
- package/dist/src/commands/performance.js +13 -13
- package/dist/src/commands/plugins.js +26 -26
- package/dist/src/commands/process.js +32 -32
- package/dist/src/commands/progress.js +5 -5
- package/dist/src/commands/providers.js +13 -13
- package/dist/src/commands/route.js +26 -26
- package/dist/src/commands/ruvector/backup.js +9 -9
- package/dist/src/commands/ruvector/benchmark.js +4 -4
- package/dist/src/commands/ruvector/import.d.ts +3 -3
- package/dist/src/commands/ruvector/import.js +11 -11
- package/dist/src/commands/ruvector/index.js +9 -9
- package/dist/src/commands/ruvector/init.js +7 -7
- package/dist/src/commands/ruvector/migrate.js +5 -5
- package/dist/src/commands/ruvector/optimize.js +7 -7
- package/dist/src/commands/ruvector/setup.d.ts +3 -3
- package/dist/src/commands/ruvector/setup.js +9 -9
- package/dist/src/commands/ruvector/status.js +4 -4
- package/dist/src/commands/security.js +19 -19
- package/dist/src/commands/session.js +13 -13
- package/dist/src/commands/start.js +13 -13
- package/dist/src/commands/status.js +9 -9
- package/dist/src/commands/swarm.js +7 -7
- package/dist/src/commands/task.js +9 -9
- package/dist/src/commands/transfer-store.js +16 -16
- package/dist/src/commands/update.js +2 -2
- package/dist/src/commands/workflow.js +13 -13
- package/dist/src/config-adapter.js +3 -3
- package/dist/src/index.js +1 -1
- package/dist/src/init/claudemd-generator.js +1 -1
- package/dist/src/init/executor.js +6 -6
- package/dist/src/init/helpers-generator.js +4 -4
- package/dist/src/init/mcp-generator.js +7 -7
- package/dist/src/init/settings-generator.js +4 -4
- package/dist/src/init/statusline-generator.js +12 -12
- package/dist/src/init/types.d.ts +4 -4
- package/dist/src/init/types.js +3 -3
- package/dist/src/mcp-server.js +2 -2
- package/dist/src/mcp-tools/auto-install.js +5 -5
- package/dist/src/mcp-tools/hooks-tools.js +1 -1
- package/dist/src/mcp-tools/neural-tools.js +6 -6
- package/dist/src/mcp-tools/security-tools.js +2 -2
- package/dist/src/memory/memory-bridge.d.ts +4 -4
- package/dist/src/memory/memory-bridge.js +15 -15
- package/dist/src/memory/memory-initializer.js +10 -10
- package/dist/src/plugins/manager.js +8 -8
- package/dist/src/plugins/tests/demo-plugin-store.js +6 -6
- package/dist/src/ruvector/enhanced-model-router.js +3 -3
- package/dist/src/services/agentic-flow-bridge.d.ts +11 -11
- package/dist/src/services/agentic-flow-bridge.js +11 -11
- package/dist/src/services/container-worker-pool.js +2 -2
- package/dist/src/services/worker-queue.js +1 -1
- package/dist/src/suggest.js +1 -1
- package/dist/src/transfer/models/seraphine.js +1 -1
- package/dist/src/transfer/serialization/cfp.js +1 -1
- package/dist/src/transfer/store/discovery.js +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/update/validator.js +1 -1
- 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
|
|
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, '
|
|
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
|
|
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
|
|
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:
|
|
477
|
+
console.log('[Embedding] Initialized: agentic-flow OptimizedEmbedder (ONNX)');
|
|
478
478
|
} else {
|
|
479
479
|
this.useAgenticFlow = false;
|
|
480
|
-
console.log('[Embedding]
|
|
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
|
|
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(), '
|
|
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, '
|
|
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
|
|
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, '
|
|
392
|
-
const securityDir = join(PROJECT_ROOT, '
|
|
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(), '
|
|
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
|
|
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
|
-
//
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
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 "
|
|
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
|
|
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 %
|
|
294
|
-
|
|
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
|
|
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 "
|
|
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 "
|
|
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
|
|
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 "
|
|
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
|
package/.claude/settings.json
CHANGED
|
@@ -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": "
|
|
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": "
|
|
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": "
|
|
22
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
41
23
|
"hooks": [
|
|
42
24
|
{
|
|
43
25
|
"type": "command",
|
|
44
|
-
"command": "
|
|
45
|
-
"timeout":
|
|
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": "
|
|
56
|
-
"timeout":
|
|
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": "
|
|
45
|
+
"matcher": "startup|resume",
|
|
63
46
|
"hooks": [
|
|
64
47
|
{
|
|
65
48
|
"type": "command",
|
|
66
|
-
"command": "
|
|
67
|
-
"timeout":
|
|
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": "
|
|
79
|
-
"timeout":
|
|
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
|
-
"
|
|
62
|
+
"SessionEnd": [
|
|
86
63
|
{
|
|
87
64
|
"hooks": [
|
|
88
65
|
{
|
|
89
66
|
"type": "command",
|
|
90
|
-
"command": "
|
|
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
|
-
"
|
|
74
|
+
"SubagentStart": [
|
|
104
75
|
{
|
|
105
76
|
"hooks": [
|
|
106
77
|
{
|
|
107
78
|
"type": "command",
|
|
108
|
-
"command": "
|
|
109
|
-
"timeout":
|
|
79
|
+
"command": "node .claude/helpers/hook-handler.cjs status",
|
|
80
|
+
"timeout": 3000,
|
|
81
|
+
"continueOnError": true
|
|
110
82
|
}
|
|
111
83
|
]
|
|
112
84
|
}
|
|
113
85
|
],
|
|
114
|
-
"
|
|
86
|
+
"Stop": [
|
|
115
87
|
{
|
|
116
88
|
"hooks": [
|
|
117
89
|
{
|
|
118
90
|
"type": "command",
|
|
119
|
-
"command": "
|
|
120
|
-
"timeout":
|
|
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": "
|
|
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 @
|
|
136
|
-
"Bash(npx
|
|
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.
|
|
122
|
+
"version": "3.1.0",
|
|
143
123
|
"enabled": true,
|
|
144
124
|
"modelPreferences": {
|
|
145
|
-
"default": "claude-opus-4-
|
|
146
|
-
"routing": "claude-
|
|
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
|
|
15
|
-
- AgentDB
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|