🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix: auto-populate AgentDB stats from hook activity
Reuven216956316462
diff --git a/v3/@claude-flow/cli/src/init/statusline-generator.ts b/v3/@claude-flow/cli/src/init/statusline-generator.tsindex 51021ea8de..30f197201b 100644--- a/v3/@claude-flow/cli/src/init/statusline-generator.ts+++ b/v3/@claude-flow/cli/src/init/statusline-generator.ts@@ -460,7 +460,7 @@ function getHooksStatus() {return { enabled, total };}-// AgentDB stats — count real entries, not file-size heuristics+// AgentDB stats — count real entries from all data storesfunction getAgentDBStats() {let vectorCount = 0;let dbSizeKB = 0;@@ -479,7 +479,22 @@ function getAgentDBStats() {} catch { /* fall back */ }}- // 2. Count entries from ranked-context.json+ // 2. Count entries from hooks memory store (.claude-flow/memory/store.json)+ const hooksStorePath = path.join(CWD, '.claude-flow', 'memory', 'store.json');+ const hooksStoreStat = safeStat(hooksStorePath);+ if (hooksStoreStat) {+ dbSizeKB += hooksStoreStat.size / 1024;+ try {+ const store = JSON.parse(fs.readFileSync(hooksStorePath, 'utf-8'));+ if (store && store.entries) {+ const entryCount = Object.keys(store.entries).length;+ vectorCount = Math.max(vectorCount, entryCount);+ if (entryCount > 0) namespaces++;+ }+ } catch { /* fall back */ }+ }++ // 3. Count entries from ranked-context.jsontry {const ranked = readJSON(path.join(CWD, '.claude-flow', 'data', 'ranked-context.json'));if (ranked && ranked.entries && ranked.entries.length > vectorCount) vectorCount = ranked.entries.length;diff --git a/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts b/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.tsindex 440a3016ae..bc9cfaf03e 100644--- a/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts+++ b/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts@@ -1322,6 +1322,30 @@ export const hooksPostTask: MCPTool = {const duration = Date.now() - startTime;+ // Persist to auto-memory-store for statusline visibility+ try {+ const dataDir = join(getProjectCwd(), '.claude-flow', 'data');+ if (!existsSync(dataDir)) mkdirSync(dataDir, { recursive: true });+ const storePath = join(dataDir, 'auto-memory-store.json');+ let store: Array<Record<string, unknown>> = [];+ try {+ if (existsSync(storePath)) {+ const parsed = JSON.parse(readFileSync(storePath, 'utf-8'));+ store = Array.isArray(parsed) ? parsed : [];+ }+ } catch { /* start fresh */ }+ store.push({+ id: `task-${taskId}`,+ key: taskId,+ content: `Task ${success ? 'completed' : 'failed'}: ${taskText || taskId}${agent ? ` (agent: ${agent})` : ''}`,+ namespace: 'tasks',+ type: 'task-outcome',+ metadata: { agent, success, quality },+ createdAt: Date.now(),+ });+ writeFileSync(storePath, JSON.stringify(store, null, 2), 'utf-8');+ } catch { /* non-critical */ }+return {taskId,success,@@ -1719,6 +1743,37 @@ export const hooksSessionStart: MCPTool = {// Bridge not available}+ // Persist session record to auto-memory-store for statusline visibility+ try {+ const dataDir = join(getProjectCwd(), '.claude-flow', 'data');+ if (!existsSync(dataDir)) mkdirSync(dataDir, { recursive: true });+ const storePath = join(dataDir, 'auto-memory-store.json');+ let store: Array<Record<string, unknown>> = [];+ try {+ if (existsSync(storePath)) {+ const raw = readFileSync(storePath, 'utf-8');+ const parsed = JSON.parse(raw);+ store = Array.isArray(parsed) ? parsed : [];+ }+ } catch { /* start fresh */ }+ // Add session entry (dedup by session ID)+ const entryId = `session-${sessionId}`;+ const existing = store.findIndex((e: Record<string, unknown>) => e.id === entryId);+ const entry = {+ id: entryId,+ key: sessionId,+ content: `Session started: ${sessionId}`,+ namespace: 'sessions',+ type: 'session',+ createdAt: Date.now(),+ };+ if (existing >= 0) store[existing] = entry;+ else store.push(entry);+ writeFileSync(storePath, JSON.stringify(store, null, 2), 'utf-8');+ } catch {+ // Non-critical — statusline just won't show this session+ }+return {sessionId,started: new Date().toISOString(),@@ -1733,8 +1788,8 @@ export const hooksSessionStart: MCPTool = {sessionMemory: sessionMemory || { controller: 'none', restoredPatterns: 0 },previousSession: restoreLatest ? {id: `session-${Date.now() - 86400000}`,- tasksRestored: sessionMemory?.restoredPatterns || 3,- memoryRestored: sessionMemory?.restoredPatterns || 15,+ tasksRestored: sessionMemory?.restoredPatterns || 0,+ memoryRestored: sessionMemory?.restoredPatterns || 0,} : null,};},