@claude-flow/cli 3.5.60 → 3.5.62
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/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +17 -2
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +81 -2
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +1 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -1
- package/dist/src/memory/intelligence.js +38 -4
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +42 -0
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAszBrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA8BnE"}
|
|
@@ -456,7 +456,7 @@ function getHooksStatus() {
|
|
|
456
456
|
return { enabled, total };
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
// AgentDB stats — count real entries
|
|
459
|
+
// AgentDB stats — count real entries from all data stores
|
|
460
460
|
function getAgentDBStats() {
|
|
461
461
|
let vectorCount = 0;
|
|
462
462
|
let dbSizeKB = 0;
|
|
@@ -475,7 +475,22 @@ function getAgentDBStats() {
|
|
|
475
475
|
} catch { /* fall back */ }
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
// 2. Count entries from
|
|
478
|
+
// 2. Count entries from hooks memory store (.claude-flow/memory/store.json)
|
|
479
|
+
const hooksStorePath = path.join(CWD, '.claude-flow', 'memory', 'store.json');
|
|
480
|
+
const hooksStoreStat = safeStat(hooksStorePath);
|
|
481
|
+
if (hooksStoreStat) {
|
|
482
|
+
dbSizeKB += hooksStoreStat.size / 1024;
|
|
483
|
+
try {
|
|
484
|
+
const store = JSON.parse(fs.readFileSync(hooksStorePath, 'utf-8'));
|
|
485
|
+
if (store && store.entries) {
|
|
486
|
+
const entryCount = Object.keys(store.entries).length;
|
|
487
|
+
vectorCount = Math.max(vectorCount, entryCount);
|
|
488
|
+
if (entryCount > 0) namespaces++;
|
|
489
|
+
}
|
|
490
|
+
} catch { /* fall back */ }
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// 3. Count entries from ranked-context.json
|
|
479
494
|
try {
|
|
480
495
|
const ranked = readJSON(path.join(CWD, '.claude-flow', 'data', 'ranked-context.json'));
|
|
481
496
|
if (ranked && ranked.entries && ranked.entries.length > vectorCount) vectorCount = ranked.entries.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusline-generator.js","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAoB;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAE5C,OAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2xBvB,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAChC,OAAO,sCAAsC,CAAC;IAChD,CAAC;IAED,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/hooks-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,YAAY,CAAC;AAgrBzD,eAAO,MAAM,YAAY,EAAE,OAsC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OA4C3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAkC7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAiD9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OA6KxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAyD1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OA8CvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAoF1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"hooks-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/hooks-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,YAAY,CAAC;AAgrBzD,eAAO,MAAM,YAAY,EAAE,OAsC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OA4C3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAkC7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAiD9B,CAAC;AAEF,eAAO,MAA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O,MAAM,iBAAiB,EAAE,OAgE/B,CAAC;AAiBF,eAAO,MAAM,eAAe,EAAE,OAyC7B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OA8B/B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAuB7B,CAAC;AAqBF,eAAO,MAAM,iBAAiB,EAAE,OAuC/B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAAO,EAwC/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1128,6 +1128,14 @@ export const hooksPostTask = {
|
|
|
1128
1128
|
catch {
|
|
1129
1129
|
// Non-fatal
|
|
1130
1130
|
}
|
|
1131
|
+
// Record trajectory via intelligence module (SONA + ReasoningBank)
|
|
1132
|
+
try {
|
|
1133
|
+
const intelligence = await import('../memory/intelligence.js');
|
|
1134
|
+
await intelligence.recordTrajectory([{ type: 'result', content: params.task || taskId, metadata: { success, agent, quality }, timestamp: Date.now() }], success ? 'success' : 'failure');
|
|
1135
|
+
}
|
|
1136
|
+
catch {
|
|
1137
|
+
// Intelligence module not available — non-fatal
|
|
1138
|
+
}
|
|
1131
1139
|
// Persist routing outcome for runtime learning (file-based, always reliable)
|
|
1132
1140
|
const taskText = params.task || '';
|
|
1133
1141
|
const outcomeKeywords = extractKeywords(taskText);
|
|
@@ -1164,6 +1172,32 @@ export const hooksPostTask = {
|
|
|
1164
1172
|
catch { /* non-critical */ }
|
|
1165
1173
|
}
|
|
1166
1174
|
const duration = Date.now() - startTime;
|
|
1175
|
+
// Persist to auto-memory-store for statusline visibility
|
|
1176
|
+
try {
|
|
1177
|
+
const dataDir = join(getProjectCwd(), '.claude-flow', 'data');
|
|
1178
|
+
if (!existsSync(dataDir))
|
|
1179
|
+
mkdirSync(dataDir, { recursive: true });
|
|
1180
|
+
const storePath = join(dataDir, 'auto-memory-store.json');
|
|
1181
|
+
let store = [];
|
|
1182
|
+
try {
|
|
1183
|
+
if (existsSync(storePath)) {
|
|
1184
|
+
const parsed = JSON.parse(readFileSync(storePath, 'utf-8'));
|
|
1185
|
+
store = Array.isArray(parsed) ? parsed : [];
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
catch { /* start fresh */ }
|
|
1189
|
+
store.push({
|
|
1190
|
+
id: `task-${taskId}`,
|
|
1191
|
+
key: taskId,
|
|
1192
|
+
content: `Task ${success ? 'completed' : 'failed'}: ${taskText || taskId}${agent ? ` (agent: ${agent})` : ''}`,
|
|
1193
|
+
namespace: 'tasks',
|
|
1194
|
+
type: 'task-outcome',
|
|
1195
|
+
metadata: { agent, success, quality },
|
|
1196
|
+
createdAt: Date.now(),
|
|
1197
|
+
});
|
|
1198
|
+
writeFileSync(storePath, JSON.stringify(store, null, 2), 'utf-8');
|
|
1199
|
+
}
|
|
1200
|
+
catch { /* non-critical */ }
|
|
1167
1201
|
return {
|
|
1168
1202
|
taskId,
|
|
1169
1203
|
success,
|
|
@@ -1526,6 +1560,16 @@ export const hooksSessionStart = {
|
|
|
1526
1560
|
};
|
|
1527
1561
|
}
|
|
1528
1562
|
}
|
|
1563
|
+
// Initialize intelligence module (SONA + local ReasoningBank)
|
|
1564
|
+
let intelligenceStatus = { sonaEnabled: false, reasoningBankEnabled: false };
|
|
1565
|
+
try {
|
|
1566
|
+
const intelligence = await import('../memory/intelligence.js');
|
|
1567
|
+
const initResult = await intelligence.initializeIntelligence();
|
|
1568
|
+
intelligenceStatus = { sonaEnabled: initResult.sonaEnabled, reasoningBankEnabled: initResult.reasoningBankEnabled };
|
|
1569
|
+
}
|
|
1570
|
+
catch {
|
|
1571
|
+
// Intelligence module not available — non-fatal
|
|
1572
|
+
}
|
|
1529
1573
|
// Phase 5: Wire ReflexionMemory session start via bridge
|
|
1530
1574
|
let sessionMemory = null;
|
|
1531
1575
|
try {
|
|
@@ -1544,6 +1588,41 @@ export const hooksSessionStart = {
|
|
|
1544
1588
|
catch {
|
|
1545
1589
|
// Bridge not available
|
|
1546
1590
|
}
|
|
1591
|
+
// Persist session record to auto-memory-store for statusline visibility
|
|
1592
|
+
try {
|
|
1593
|
+
const dataDir = join(getProjectCwd(), '.claude-flow', 'data');
|
|
1594
|
+
if (!existsSync(dataDir))
|
|
1595
|
+
mkdirSync(dataDir, { recursive: true });
|
|
1596
|
+
const storePath = join(dataDir, 'auto-memory-store.json');
|
|
1597
|
+
let store = [];
|
|
1598
|
+
try {
|
|
1599
|
+
if (existsSync(storePath)) {
|
|
1600
|
+
const raw = readFileSync(storePath, 'utf-8');
|
|
1601
|
+
const parsed = JSON.parse(raw);
|
|
1602
|
+
store = Array.isArray(parsed) ? parsed : [];
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
catch { /* start fresh */ }
|
|
1606
|
+
// Add session entry (dedup by session ID)
|
|
1607
|
+
const entryId = `session-${sessionId}`;
|
|
1608
|
+
const existing = store.findIndex((e) => e.id === entryId);
|
|
1609
|
+
const entry = {
|
|
1610
|
+
id: entryId,
|
|
1611
|
+
key: sessionId,
|
|
1612
|
+
content: `Session started: ${sessionId}`,
|
|
1613
|
+
namespace: 'sessions',
|
|
1614
|
+
type: 'session',
|
|
1615
|
+
createdAt: Date.now(),
|
|
1616
|
+
};
|
|
1617
|
+
if (existing >= 0)
|
|
1618
|
+
store[existing] = entry;
|
|
1619
|
+
else
|
|
1620
|
+
store.push(entry);
|
|
1621
|
+
writeFileSync(storePath, JSON.stringify(store, null, 2), 'utf-8');
|
|
1622
|
+
}
|
|
1623
|
+
catch {
|
|
1624
|
+
// Non-critical — statusline just won't show this session
|
|
1625
|
+
}
|
|
1547
1626
|
return {
|
|
1548
1627
|
sessionId,
|
|
1549
1628
|
started: new Date().toISOString(),
|
|
@@ -1558,8 +1637,8 @@ export const hooksSessionStart = {
|
|
|
1558
1637
|
sessionMemory: sessionMemory || { controller: 'none', restoredPatterns: 0 },
|
|
1559
1638
|
previousSession: restoreLatest ? {
|
|
1560
1639
|
id: `session-${Date.now() - 86400000}`,
|
|
1561
|
-
tasksRestored: sessionMemory?.restoredPatterns ||
|
|
1562
|
-
memoryRestored: sessionMemory?.restoredPatterns ||
|
|
1640
|
+
tasksRestored: sessionMemory?.restoredPatterns || 0,
|
|
1641
|
+
memoryRestored: sessionMemory?.restoredPatterns || 0,
|
|
1563
1642
|
} : null,
|
|
1564
1643
|
};
|
|
1565
1644
|
},
|