monomind 1.16.3 → 1.16.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monomind",
3
- "version": "1.16.3",
3
+ "version": "1.16.4",
4
4
  "description": "Monomind - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -554,7 +554,6 @@ async function checkMonoesMemory() {
554
554
  return { name: 'Vector Memory', status: 'warn', message: 'Vector memory check failed' };
555
555
  }
556
556
  }
557
- // Check agentic-flow v1 integration (filesystem-based to avoid slow WASM/DB init)
558
557
  // Resolve the path to the bundled (npm-installed) copy of a helper file.
559
558
  // Walks up from this module's location to find the package root, then joins
560
559
  // the relative path. Returns null if not found.
@@ -639,49 +638,6 @@ async function checkHelpersFresh() {
639
638
  return { name: 'Helper Files', status: 'warn', message: `check failed: ${e instanceof Error ? e.message : 'unknown'}` };
640
639
  }
641
640
  }
642
- async function checkAgenticFlow() {
643
- try {
644
- // Walk common node_modules paths to find agentic-flow/package.json
645
- const candidates = [
646
- join(process.cwd(), 'node_modules', 'agentic-flow', 'package.json'),
647
- join(process.cwd(), '..', 'node_modules', 'agentic-flow', 'package.json'),
648
- ];
649
- let pkgJsonPath = null;
650
- for (const p of candidates) {
651
- if (existsSync(p)) {
652
- pkgJsonPath = p;
653
- break;
654
- }
655
- }
656
- if (!pkgJsonPath) {
657
- return {
658
- name: 'agentic-flow',
659
- status: 'warn',
660
- message: 'Not installed (optional — embeddings/routing will use fallbacks)',
661
- fix: 'npm install agentic-flow@latest'
662
- };
663
- }
664
- if (statSync(pkgJsonPath).size > MAX_DOCTOR_PKG_BYTES) {
665
- return { name: 'agentic-flow', status: 'warn', message: 'package.json too large to parse' };
666
- }
667
- const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));
668
- const version = pkg.version || 'unknown';
669
- const exports = pkg.exports || {};
670
- const features = [
671
- exports['./reasoningbank'] ? 'ReasoningBank' : null,
672
- exports['./router'] ? 'Router' : null,
673
- exports['./transport/quic'] ? 'QUIC' : null,
674
- ].filter(Boolean);
675
- return {
676
- name: 'agentic-flow',
677
- status: 'pass',
678
- message: `v${version}${features.length ? ' (' + features.join(', ') + ')' : ' (installed)'}`
679
- };
680
- }
681
- catch {
682
- return { name: 'agentic-flow', status: 'warn', message: 'Check failed' };
683
- }
684
- }
685
641
  // Check @monoes native acceleration integration (sona/router/attention/learning-wasm)
686
642
  // Format a 0..1 accuracy as a whole-percent string, or 'n/a' when null.
687
643
  function fmtPct(v) {
@@ -880,7 +836,7 @@ export const doctorCommand = {
880
836
  {
881
837
  name: 'component',
882
838
  short: 'c',
883
- description: 'Check specific component (version, node, npm, config, daemon, memory, api, git, mcp, claude, disk, typescript, monograph, graph-freshness, memory-pkg, helpers, agentic-flow, monoes, gates, gitignore)',
839
+ description: 'Check specific component (version, node, npm, config, daemon, memory, api, git, mcp, claude, disk, typescript, monograph, graph-freshness, memory-pkg, helpers, monoes, gates, gitignore)',
884
840
  type: 'string'
885
841
  },
886
842
  {
@@ -926,7 +882,6 @@ export const doctorCommand = {
926
882
  checkMonographFreshness,
927
883
  checkMonoesMemory,
928
884
  checkHelpersFresh,
929
- checkAgenticFlow,
930
885
  checkMonoesIntegration,
931
886
  checkGuidanceGates,
932
887
  checkGitignoreCoverage,
@@ -949,7 +904,6 @@ export const doctorCommand = {
949
904
  'graph-freshness': checkMonographFreshness,
950
905
  'memory-pkg': checkMonoesMemory,
951
906
  'helpers': checkHelpersFresh,
952
- 'agentic-flow': checkAgenticFlow,
953
907
  'monoes': checkMonoesIntegration,
954
908
  'gates': checkGuidanceGates,
955
909
  'gitignore': checkGitignoreCoverage,
@@ -880,7 +880,7 @@ export const statuslineCommand = {
880
880
  try {
881
881
  const psCmd = isWindows
882
882
  ? 'tasklist /FI "IMAGENAME eq node.exe" 2>NUL | findstr /I /C:"node" >NUL && echo 1 || echo 0'
883
- : 'ps aux 2>/dev/null | grep -c agentic-flow || echo "0"';
883
+ : 'ps aux 2>/dev/null | grep -c "mcp.*start" || echo "0"';
884
884
  const ps = execSync(psCmd, { encoding: 'utf-8' });
885
885
  const raw = parseInt(ps.trim());
886
886
  activeAgents = Math.max(0, isWindows ? raw : raw - 1);
@@ -5,10 +5,10 @@
5
5
  */
6
6
  import { output } from '../output.js';
7
7
  import { callMCPTool, MCPClientError } from '../mcp-client.js';
8
- // Token Optimizer command - integrates agentic-flow Agent Booster
8
+ // Token Optimizer command
9
9
  export const tokenOptimizeCommand = {
10
10
  name: 'token-optimize',
11
- description: 'Token optimization via agentic-flow Agent Booster (30-50% savings)',
11
+ description: 'Token optimization via memory-based context retrieval (30-50% savings)',
12
12
  options: [
13
13
  { name: 'query', short: 'q', type: 'string', description: 'Query for compact context retrieval' },
14
14
  { name: 'agents', short: 'A', type: 'number', description: 'Agent count for optimal config', default: '6' },
@@ -25,7 +25,7 @@ export const tokenOptimizeCommand = {
25
25
  const agentCount = parseInt(ctx.flags['agents'] || '6', 10);
26
26
  const showReport = ctx.flags['report'];
27
27
  const showStats = ctx.flags['stats'];
28
- const spinner = output.createSpinner({ text: 'Checking agentic-flow integration...', spinner: 'dots' });
28
+ const spinner = output.createSpinner({ text: 'Checking memory integration...', spinner: 'dots' });
29
29
  spinner.start();
30
30
  // Inline TokenOptimizer (self-contained, no external imports)
31
31
  const stats = {
@@ -35,26 +35,8 @@ export const tokenOptimizeCommand = {
35
35
  cacheMisses: 0,
36
36
  memoriesRetrieved: 0,
37
37
  };
38
- let agenticFlowAvailable = false;
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- let reasoningBank = null;
41
38
  try {
42
- // Check if agentic-flow v1 is available
43
- const rb = await import('agentic-flow/reasoningbank').catch(() => null);
44
- if (rb) {
45
- agenticFlowAvailable = true;
46
- if (typeof rb.retrieveMemories === 'function') {
47
- reasoningBank = rb;
48
- }
49
- }
50
- else {
51
- // Legacy check for older agentic-flow
52
- const af = await import('agentic-flow').catch(() => null);
53
- if (af)
54
- agenticFlowAvailable = true;
55
- }
56
- const versionLabel = agenticFlowAvailable ? `agentic-flow v1 detected (ReasoningBank: ${reasoningBank ? 'active' : 'unavailable'})` : 'agentic-flow not available (using fallbacks)';
57
- spinner.succeed(versionLabel);
39
+ spinner.succeed('Memory-based token optimization active');
58
40
  output.writeln();
59
41
  // Anti-drift config (hardcoded optimal values from research)
60
42
  const config = {
@@ -69,27 +51,9 @@ export const tokenOptimizeCommand = {
69
51
  `Batch Size: ${config.batchSize}\n` +
70
52
  `Cache: ${config.cacheSizeMB}MB\n` +
71
53
  `Success Rate: ${(config.expectedSuccessRate * 100)}%`);
72
- // If query provided, get compact context via ReasoningBank
73
- if (query && reasoningBank) {
74
- output.writeln();
75
- output.printInfo(`Retrieving compact context for: "${query}"`);
76
- const memories = await reasoningBank.retrieveMemories(query, { k: 5 });
77
- const compactPrompt = reasoningBank.formatMemoriesForPrompt ? reasoningBank.formatMemoriesForPrompt(memories) : '';
78
- // Estimate based on actual query vs compact prompt size difference
79
- const queryTokenEstimate = Math.ceil((query?.length || 0) / 4);
80
- const used = Math.ceil((compactPrompt?.length || 0) / 4);
81
- const tokensSaved = Math.max(0, queryTokenEstimate - used);
82
- stats.totalTokensSaved += tokensSaved;
83
- stats.memoriesRetrieved += Array.isArray(memories) ? memories.length : 0;
84
- output.writeln(` Memories found: ${Array.isArray(memories) ? memories.length : 0}`);
85
- output.writeln(` Tokens saved: ${output.success(String(tokensSaved))}`);
86
- if (compactPrompt) {
87
- output.writeln(` Compact prompt (${compactPrompt.length} chars)`);
88
- }
89
- }
90
- else if (query) {
54
+ if (query) {
91
55
  output.writeln();
92
- output.printInfo('ReasoningBank not available - query skipped');
56
+ output.printInfo(`Context retrieval for: "${query}" — use monomind memory search`);
93
57
  }
94
58
  // Simulate some token savings for demo
95
59
  stats.totalTokensSaved += 200;
@@ -112,7 +76,6 @@ export const tokenOptimizeCommand = {
112
76
  { metric: 'Cache Hit Rate', value: `${hitRate}%` },
113
77
  { metric: 'Memories Retrieved', value: String(stats.memoriesRetrieved) },
114
78
  { metric: 'Est. Monthly Savings', value: `$${savings}` },
115
- { metric: 'Agentic-Flow Active', value: agenticFlowAvailable ? '✓' : '✗' },
116
79
  ],
117
80
  });
118
81
  }
@@ -131,9 +94,9 @@ export const tokenOptimizeCommand = {
131
94
  | Cache Hit Rate | ${hitRate}% |
132
95
  | Memories Retrieved | ${stats.memoriesRetrieved} |
133
96
  | Est. Monthly Savings | $${savings} |
134
- | Agentic-Flow Active | ${agenticFlowAvailable ? '✓' : '✗'} |`);
97
+ | Memories Retrieved | ${stats.memoriesRetrieved} |`);
135
98
  }
136
- return { success: true, data: { config, stats: { ...stats, agenticFlowAvailable } } };
99
+ return { success: true, data: { config, stats } };
137
100
  }
138
101
  catch (error) {
139
102
  spinner.fail('TokenOptimizer failed');
@@ -757,9 +757,9 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
757
757
  if (!fs.existsSync(activityPath)) {
758
758
  const activity = {
759
759
  timestamp: new Date().toISOString(),
760
- processes: { agentic_flow: 0, mcp_server: 0, estimated_agents: 0 },
760
+ processes: { mcp_server: 0, estimated_agents: 0 },
761
761
  swarm: { active: false, agent_count: 0, coordination_active: false },
762
- integration: { agentic_flow_active: false, mcp_active: false },
762
+ integration: { mcp_active: false },
763
763
  _initialized: true
764
764
  };
765
765
  atomicWriteFile(activityPath, JSON.stringify(activity, null, 2));
@@ -1582,7 +1582,6 @@ async function writeInitialMetrics(targetDir, options, result) {
1582
1582
  const activity = {
1583
1583
  timestamp: new Date().toISOString(),
1584
1584
  processes: {
1585
- agentic_flow: 0,
1586
1585
  mcp_server: 0,
1587
1586
  estimated_agents: 0
1588
1587
  },
@@ -1592,7 +1591,6 @@ async function writeInitialMetrics(targetDir, options, result) {
1592
1591
  coordination_active: false
1593
1592
  },
1594
1593
  integration: {
1595
- agentic_flow_active: false,
1596
1594
  mcp_active: false
1597
1595
  },
1598
1596
  _initialized: true
@@ -1977,7 +1975,6 @@ npx monomind@latest hive-mind consensus --propose "task"
1977
1975
  ### Integrated Packages
1978
1976
  | Package | Version | Purpose |
1979
1977
  |---------|---------|---------|
1980
- | agentic-flow | 3.0.0-alpha.1 | Core coordination + ReasoningBank + Router |
1981
1978
  | @lancedb/lancedb | latest | Vector database (ANN search) |
1982
1979
 
1983
1980
  ### Optional Integrations
@@ -4,8 +4,8 @@
4
4
  * V2 Compatibility - Neural network and ML tools
5
5
  *
6
6
  * ✅ HYBRID Implementation:
7
- * - Uses agentic-flow/reasoningbank for REAL ML embeddings when available
8
- * - Falls back to deterministic hash-based embeddings when ML model not installed
7
+ * - Uses monovector ONNX embeddings when available
8
+ * - Falls back to deterministic hash-based embeddings otherwise
9
9
  * - Pattern storage and search with cosine similarity (real math in all tiers)
10
10
  * - Training stores patterns as searchable embeddings (not simulated)
11
11
  *
@@ -4,8 +4,8 @@
4
4
  * V2 Compatibility - Neural network and ML tools
5
5
  *
6
6
  * ✅ HYBRID Implementation:
7
- * - Uses agentic-flow/reasoningbank for REAL ML embeddings when available
8
- * - Falls back to deterministic hash-based embeddings when ML model not installed
7
+ * - Uses monovector ONNX embeddings when available
8
+ * - Falls back to deterministic hash-based embeddings otherwise
9
9
  * - Pattern storage and search with cosine similarity (real math in all tiers)
10
10
  * - Training stores patterns as searchable embeddings (not simulated)
11
11
  *
@@ -16,19 +16,28 @@ import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync, statSyn
16
16
  import { join } from 'node:path';
17
17
  const MAX_NEURAL_STORE_BYTES = 50 * 1024 * 1024; // 50 MB
18
18
  const NEURAL_RESERVED_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
19
- // Try to import real embeddings agentic-flow v1 ReasoningBank when available,
20
- // otherwise the deterministic hash fallback below.
19
+ // Embeddings via monovector ONNX when available; deterministic hash fallback otherwise.
21
20
  let realEmbeddings = null;
22
21
  let embeddingServiceName = 'none';
23
22
  try {
24
- const rb = await import('agentic-flow/reasoningbank').catch(() => null);
25
- if (rb?.computeEmbedding) {
26
- realEmbeddings = { embed: async (text) => Array.from(await rb.computeEmbedding(text)) };
27
- embeddingServiceName = 'agentic-flow/reasoningbank';
23
+ const monovector = await import('monovector').catch(() => null);
24
+ if (monovector?.getOptimizedOnnxEmbedder) {
25
+ await monovector.initOnnxEmbedder?.();
26
+ const onnxEmb = monovector.getOptimizedOnnxEmbedder();
27
+ if (onnxEmb?.embed) {
28
+ const probe = await onnxEmb.embed('test');
29
+ const hasNonZero = ArrayBuffer.isView(probe) || Array.isArray(probe)
30
+ ? [...probe].some((v) => v !== 0)
31
+ : false;
32
+ if (probe && probe.length > 0 && hasNonZero) {
33
+ realEmbeddings = { embed: async (text) => Array.from(await onnxEmb.embed(text)) };
34
+ embeddingServiceName = 'monovector/onnx';
35
+ }
36
+ }
28
37
  }
29
38
  }
30
39
  catch {
31
- // No embedding provider available, will use fallback
40
+ // No ONNX embedding provider available, will use hash fallback
32
41
  }
33
42
  // Storage paths
34
43
  const STORAGE_DIR = '.monomind';
@@ -76,25 +76,6 @@ export async function loadEmbeddingModel(options) {
76
76
  loadTime: Date.now() - startTime
77
77
  };
78
78
  }
79
- // Fallback: Check for agentic-flow ReasoningBank embeddings (v1)
80
- const reasoningBank = await import('agentic-flow/reasoningbank').catch(() => null);
81
- if (reasoningBank?.computeEmbedding) {
82
- if (verbose) {
83
- console.log('Loading agentic-flow ReasoningBank embedding model...');
84
- }
85
- embeddingModelState = {
86
- loaded: true,
87
- model: { embed: reasoningBank.computeEmbedding },
88
- tokenizer: null,
89
- dimensions: 768
90
- };
91
- return {
92
- success: true,
93
- dimensions: 768,
94
- modelName: 'agentic-flow/reasoningbank',
95
- loadTime: Date.now() - startTime
96
- };
97
- }
98
79
  // Fallback: Check for monovector ONNX embedder (bundled MiniLM-L6-v2 since v0.2.15)
99
80
  // v0.2.16: LoRA B=0 fix makes AdaptiveEmbedder safe (identity when untrained)
100
81
  // Note: isReady() returns false until first embed() call (lazy init), so we
@@ -108,7 +89,8 @@ export async function loadEmbeddingModel(options) {
108
89
  if (onnxEmb?.embed) {
109
90
  // Probe embed to trigger lazy ONNX init and verify it works
110
91
  const probe = await onnxEmb.embed('test');
111
- if (probe && probe.length > 0 && (Array.isArray(probe) ? probe.some((v) => v !== 0) : true)) {
92
+ const probeArr = ArrayBuffer.isView(probe) ? Array.from(probe) : (Array.isArray(probe) ? probe : []);
93
+ if (probe && probe.length > 0 && probeArr.some((v) => v !== 0)) {
112
94
  if (verbose) {
113
95
  console.log(`Loading monovector ONNX embedder (all-MiniLM-L6-v2, ${probe.length}d)...`);
114
96
  }
@@ -131,25 +113,6 @@ export async function loadEmbeddingModel(options) {
131
113
  // monovector ONNX init failed, continue to next fallback
132
114
  }
133
115
  }
134
- // Legacy fallback: Check for agentic-flow core embeddings
135
- const agenticFlow = await import('agentic-flow').catch(() => null);
136
- if (agenticFlow && agenticFlow.embeddings) {
137
- if (verbose) {
138
- console.log('Loading agentic-flow embedding model...');
139
- }
140
- embeddingModelState = {
141
- loaded: true,
142
- model: agenticFlow.embeddings,
143
- tokenizer: null,
144
- dimensions: 768
145
- };
146
- return {
147
- success: true,
148
- dimensions: 768,
149
- modelName: 'agentic-flow',
150
- loadTime: Date.now() - startTime
151
- };
152
- }
153
116
  // No ONNX model available - use fallback
154
117
  embeddingModelState = {
155
118
  loaded: true,
@@ -65,8 +65,6 @@ INSERT OR REPLACE INTO metadata (key, value) VALUES
65
65
 
66
66
  -- Create default vector index configuration
67
67
  -- Dimensions match BRIDGE_EMBEDDING_DIMS=384 (Xenova/all-MiniLM-L6-v2).
68
- -- 768 was a legacy value from the agentic-flow era; 384 is the actual
69
- -- embedding size used by memory-bridge.ts and LanceDB.
70
68
  INSERT OR IGNORE INTO vector_indexes (id, name, dimensions) VALUES
71
69
  ('default', 'default', 384),
72
70
  ('patterns', 'patterns', 384);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.16.3",
3
+ "version": "1.16.4",
4
4
  "type": "module",
5
5
  "description": "Monomind CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",
@@ -94,7 +94,6 @@
94
94
  "optionalDependencies": {
95
95
  "sql.js": "^1.14.1",
96
96
  "@monoes/memory": "^1.0.0",
97
- "agentic-flow": "^3.0.0-alpha.1",
98
97
  "@huggingface/transformers": "^3.8.1",
99
98
  "monofence-ai": "*",
100
99
  "@monomind/hooks": "*",