monomind 1.10.56 → 1.10.57

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 (23) hide show
  1. package/package.json +1 -1
  2. package/packages/@monomind/cli/dist/src/commands/mcp.d.ts +1 -1
  3. package/packages/@monomind/cli/dist/src/commands/update.d.ts +1 -1
  4. package/packages/@monomind/cli/dist/src/index.d.ts +1 -1
  5. package/packages/@monomind/cli/dist/src/init/helpers-generator.d.ts +1 -1
  6. package/packages/@monomind/cli/dist/src/mcp-tools/auto-install.d.ts +4 -4
  7. package/packages/@monomind/cli/dist/src/mcp-tools/autopilot-tools.d.ts +1 -1
  8. package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.d.ts +1 -1
  9. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.d.ts +1 -1
  10. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +48 -14
  11. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +2 -2
  12. package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.d.ts +1 -1
  13. package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.d.ts +1 -1
  14. package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +3 -3
  15. package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.d.ts +1 -1
  16. package/packages/@monomind/cli/dist/src/ruvector/index.d.ts +12 -1
  17. package/packages/@monomind/cli/dist/src/ruvector/index.js +30 -0
  18. package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.d.ts +1 -1
  19. package/packages/@monomind/cli/dist/src/transfer/ipfs/upload.d.ts +1 -1
  20. package/packages/@monomind/cli/dist/src/transfer/storage/gcs.d.ts +1 -1
  21. package/packages/@monomind/cli/dist/src/update/checker.d.ts +1 -1
  22. package/packages/@monomind/cli/dist/src/update/index.d.ts +1 -1
  23. package/packages/@monomind/cli/package.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monomind",
3
- "version": "1.10.56",
3
+ "version": "1.10.57",
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",
@@ -2,7 +2,7 @@
2
2
  * CLI MCP Command
3
3
  * MCP server control and management with real server integration
4
4
  *
5
- * @module @monoes/cli/commands/mcp
5
+ * @module @monomind/cli/commands/mcp
6
6
  * @version 3.0.0
7
7
  */
8
8
  import type { Command } from '../types.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * CLI Update Command
3
- * Auto-update system for @monoes packages (ADR-025)
3
+ * Auto-update system for @monomind packages (ADR-025)
4
4
  */
5
5
  import type { Command } from '../types.js';
6
6
  declare const updateCommand: Command;
@@ -50,7 +50,7 @@ export declare class CLI {
50
50
  /**
51
51
  * Initialize optional subsystems at startup (non-blocking, all failures are silent).
52
52
  * Wires TierManager, ObservabilityBus + TraceCollector, and SwarmCheckpointer
53
- * so that packages/@monoes/* actually contribute to the live runtime.
53
+ * so that packages/@monomind/* actually contribute to the live runtime.
54
54
  */
55
55
  private initSubsystems;
56
56
  /**
@@ -38,7 +38,7 @@ export declare function generateIntelligenceStub(): string;
38
38
  /**
39
39
  * Generate a minimal auto-memory-hook.mjs fallback for fresh installs.
40
40
  * This ESM script handles import/sync/status commands gracefully when
41
- * @monoes/memory is not installed. Gets overwritten when source copy succeeds.
41
+ * @monomind/memory is not installed. Gets overwritten when source copy succeeds.
42
42
  */
43
43
  export declare function generateAutoMemoryHook(): string;
44
44
  /**
@@ -46,11 +46,11 @@ export declare function resetInstallAttempts(): void;
46
46
  * Optional package dependencies and their purposes
47
47
  */
48
48
  export declare const OPTIONAL_PACKAGES: {
49
- readonly '@monoes/aidefence': {
49
+ readonly '@monomind/aidefence': {
50
50
  readonly description: "AI manipulation defense (prompt injection, PII detection)";
51
51
  readonly tools: readonly ["aidefence_scan", "aidefence_analyze", "aidefence_stats", "aidefence_learn"];
52
52
  };
53
- readonly '@monoes/embeddings': {
53
+ readonly '@monomind/embeddings': {
54
54
  readonly description: "Vector embeddings with ONNX support";
55
55
  readonly tools: readonly ["embeddings_generate", "embeddings_search", "embeddings_batch"];
56
56
  };
@@ -65,11 +65,11 @@ declare const _default: {
65
65
  isPackageAvailable: typeof isPackageAvailable;
66
66
  resetInstallAttempts: typeof resetInstallAttempts;
67
67
  OPTIONAL_PACKAGES: {
68
- readonly '@monoes/aidefence': {
68
+ readonly '@monomind/aidefence': {
69
69
  readonly description: "AI manipulation defense (prompt injection, PII detection)";
70
70
  readonly tools: readonly ["aidefence_scan", "aidefence_analyze", "aidefence_stats", "aidefence_learn"];
71
71
  };
72
- readonly '@monoes/embeddings': {
72
+ readonly '@monomind/embeddings': {
73
73
  readonly description: "Vector embeddings with ONNX support";
74
74
  readonly tools: readonly ["embeddings_generate", "embeddings_search", "embeddings_batch"];
75
75
  };
@@ -5,7 +5,7 @@
5
5
  * Allows programmatic control of the autopilot loop via MCP.
6
6
  *
7
7
  * ADR-072: Autopilot Integration
8
- * @module @monoes/cli/mcp-tools/autopilot
8
+ * @module @monomind/cli/mcp-tools/autopilot
9
9
  */
10
10
  import type { MCPTool } from './types.js';
11
11
  export declare const autopilotTools: MCPTool[];
@@ -4,7 +4,7 @@
4
4
  * Implements MCP tools for ADR-016: Collaborative Issue Claims
5
5
  * Provides programmatic access to claim operations for MCP clients.
6
6
  *
7
- * @module @monoes/cli/mcp-tools/claims
7
+ * @module @monomind/cli/mcp-tools/claims
8
8
  */
9
9
  import type { MCPTool } from './types.js';
10
10
  export declare const claimsTools: MCPTool[];
@@ -4,7 +4,7 @@
4
4
  * Helps the system navigate Monomind's capabilities by providing structured
5
5
  * discovery of tools, commands, agents, skills, and recommended workflows.
6
6
  *
7
- * @module @monoes/cli/mcp-tools/guidance
7
+ * @module @monomind/cli/mcp-tools/guidance
8
8
  */
9
9
  import { type MCPTool } from './types.js';
10
10
  /**
@@ -533,6 +533,50 @@ function suggestAgentsForTask(task) {
533
533
  // Canonical set of valid monomind agent type strings.
534
534
  // Patterns whose type is not in this set (e.g. 'action', 'observation', 'routing')
535
535
  // are structural labels, not agent names, and must be excluded from routing.
536
+ // Singleton neural router — initialized once per process and reused across route calls.
537
+ // Creating + destroying NeuralLearningSystem on every call would read learned-state.json
538
+ // on each invocation and call consolidateEWC() on cleanup, both of which are wrong.
539
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
540
+ let _neuralRouterInstance = null;
541
+ let _neuralRouterInitPromise = null;
542
+ async function applyNeuralAdaptation(text, dimensions) {
543
+ if (!_neuralRouterInitPromise) {
544
+ _neuralRouterInitPromise = (async () => {
545
+ try {
546
+ const neural = await import('@monomind/neural').catch(() => null);
547
+ if (neural?.createNeuralLearningSystem) {
548
+ const sys = neural.createNeuralLearningSystem('balanced');
549
+ await sys.initialize();
550
+ _neuralRouterInstance = sys;
551
+ }
552
+ }
553
+ catch {
554
+ _neuralRouterInstance = null;
555
+ }
556
+ })();
557
+ }
558
+ await _neuralRouterInitPromise;
559
+ if (!_neuralRouterInstance)
560
+ return null;
561
+ try {
562
+ const base = new Float32Array(dimensions);
563
+ // Use a hash embedding as the base for the LoRA transform
564
+ const words = text.toLowerCase().split(/\s+/);
565
+ for (let i = 0; i < dimensions; i++) {
566
+ let v = 0;
567
+ for (let w = 0; w < words.length; w++) {
568
+ for (let c = 0; c < words[w].length; c++) {
569
+ v += Math.sin((words[w].charCodeAt(c) * (i + 1) + w * 17) * 0.0137);
570
+ }
571
+ }
572
+ base[i] = v;
573
+ }
574
+ return await _neuralRouterInstance.getSONAManager().applyAdaptations(base);
575
+ }
576
+ catch {
577
+ return null;
578
+ }
579
+ }
536
580
  const VALID_AGENT_TYPES = new Set([
537
581
  'coder', 'reviewer', 'tester', 'planner', 'researcher',
538
582
  'architect', 'security-architect', 'security-auditor',
@@ -841,23 +885,13 @@ export const hooksRoute = {
841
885
  let backendInfo = '';
842
886
  const queryText = context ? `${task} ${context}` : task;
843
887
  // Apply LoRA adaptations from the neural system when available.
844
- // This is the path where learned weights actually influence routing:
845
- // the query embedding is transformed by the session-trained LoRA before
846
- // being compared against the semantic router's pattern embeddings.
888
+ // The adapted embedding reflects what was learned in prior sessions
889
+ // (loaded from learned-state.json during _neuralRouterInstance.initialize()).
847
890
  let queryEmbedding = generateSimpleEmbedding(queryText);
848
891
  try {
849
- const neural = await import('@monomind/neural').catch(() => null);
850
- if (neural?.createNeuralLearningSystem) {
851
- const sys = neural.createNeuralLearningSystem('balanced');
852
- await sys.initialize();
853
- // applyAdaptations uses the LoRA weights from learned-state.json
854
- // (loaded during initialize()) to transform the query embedding.
855
- const base = generateSimpleEmbedding(queryText, 768);
856
- const adapted = await sys.getSONAManager().applyAdaptations(base);
857
- // Down-project to 384 to match the semantic router's expected dimension
892
+ const adapted = await applyNeuralAdaptation(queryText, 768);
893
+ if (adapted)
858
894
  queryEmbedding = adapted.slice(0, 384);
859
- await sys.cleanup();
860
- }
861
895
  }
862
896
  catch { /* fall through to hash embedding */ }
863
897
  // Try native VectorDb (HNSW-backed)
@@ -4,12 +4,12 @@
4
4
  * V2 Compatibility - Neural network and ML tools
5
5
  *
6
6
  * ✅ HYBRID Implementation:
7
- * - Uses @monoes/embeddings for REAL ML embeddings when available
7
+ * - Uses @monomind/embeddings for REAL ML embeddings when available
8
8
  * - Falls back to deterministic hash-based embeddings when ML model not installed
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
  *
12
- * Note: For production neural features, use @monoes/neural module
12
+ * Note: For production neural features, use @monomind/neural module
13
13
  */
14
14
  import { type MCPTool } from './types.js';
15
15
  export declare const neuralTools: MCPTool[];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Provides MCP tools for checking and syncing V1 implementation progress.
5
5
  *
6
- * @module @monoes/cli/mcp-tools/progress
6
+ * @module @monomind/cli/mcp-tools/progress
7
7
  */
8
8
  import type { MCPTool } from './types.js';
9
9
  /**
@@ -2,7 +2,7 @@
2
2
  * Transfer MCP Tools
3
3
  * Pattern and plugin sharing via IPFS-based decentralized registry
4
4
  *
5
- * @module @monoes/cli/mcp-tools/transfer-tools
5
+ * @module @monomind/cli/mcp-tools/transfer-tools
6
6
  * @version 3.0.0
7
7
  */
8
8
  import type { MCPTool } from './types.js';
@@ -4,9 +4,9 @@
4
4
  * Runs without TTY for daemon processes and scheduled tasks
5
5
  *
6
6
  * Usage:
7
- * npx @monoes/cli headless --worker <type>
8
- * npx @monoes/cli headless --daemon
9
- * npx @monoes/cli headless --benchmark
7
+ * npx @monomind/cli headless --worker <type>
8
+ * npx @monomind/cli headless --daemon
9
+ * npx @monomind/cli headless --benchmark
10
10
  *
11
11
  * Environment:
12
12
  * MONOMIND_HEADLESS=true
@@ -8,7 +8,7 @@
8
8
  * Published API (v0.1.0): WasmAgent, WasmGallery, WasmMcpServer,
9
9
  * WasmRvfBuilder, JsModelProvider, initSync.
10
10
  *
11
- * @module @monoes/cli/ruvector/agent-wasm
11
+ * @module @monomind/cli/ruvector/agent-wasm
12
12
  */
13
13
  export interface WasmAgentConfig {
14
14
  model?: string;
@@ -14,12 +14,22 @@
14
14
  */
15
15
  export { DiffClassifier, createDiffClassifier, analyzeDiff, analyzeDiffSync, assessFileRisk, assessOverallRisk, classifyDiff, suggestReviewers, getGitDiffNumstat, getGitDiffNumstatAsync, clearDiffCache, clearAllDiffCaches, type DiffClassification, type DiffHunk, type DiffChange, type FileDiff, type DiffAnalysis, type DiffClassifierConfig, type DiffFile, type RiskLevel, type FileRisk, type OverallRisk, type DiffAnalysisResult, } from './diff-classifier.js';
16
16
  export interface QLearningRouter {
17
- route: (task: string) => Promise<RouteDecision>;
17
+ route: (task: string, context?: unknown) => Promise<RouteDecision>;
18
+ initialize?: () => Promise<void>;
19
+ getStats?: () => Record<string, unknown>;
20
+ update?: (feedback: unknown) => void;
21
+ reset?: () => void;
22
+ export?: () => unknown;
23
+ import?: (data: unknown) => void;
18
24
  }
19
25
  export interface RouteDecision {
20
26
  agentType: string;
21
27
  confidence: number;
22
28
  reasoning?: string;
29
+ route?: string;
30
+ qValues?: number[];
31
+ explored?: boolean;
32
+ alternatives?: string[];
23
33
  }
24
34
  export interface QLearningRouterConfig {
25
35
  learningRate?: number;
@@ -39,6 +49,7 @@ export interface LoadBalanceStats {
39
49
  [expert: string]: number;
40
50
  }
41
51
  export type ExpertType = string;
52
+ export declare function createQLearningRouter(_config?: QLearningRouterConfig): QLearningRouter;
42
53
  export { isRuvllmWasmAvailable, initRuvllmWasm, getRuvllmStatus, createHnswRouter, createSonaInstant, createMicroLora, formatChat, createKvCache, createGenerateConfig, createBufferPool, createInferenceArena, HNSW_MAX_SAFE_PATTERNS, type HnswRouterConfig, type HnswPattern, type HnswRouteResult, type SonaConfig, type MicroLoraConfig, type ChatMessage, type GenerateOptions, type RuvllmStatus, } from './ruvllm-wasm.js';
43
54
  export { isAgentWasmAvailable, initAgentWasm, createWasmAgent, promptWasmAgent, executeWasmTool, getWasmAgent, listWasmAgents, terminateWasmAgent, getWasmAgentState, getWasmAgentTools, getWasmAgentTodos, exportWasmState, createWasmMcpServer, listGalleryTemplates, getGalleryCount, getGalleryCategories, searchGalleryTemplates, getGalleryTemplate, createAgentFromTemplate, buildRvfContainer, buildRvfFromTemplate, type WasmAgentConfig, type WasmAgentInfo, type GalleryTemplate, type GalleryTemplateDetail, type ToolResult, } from './agent-wasm.js';
44
55
  /**
@@ -13,6 +13,36 @@
13
13
  * @module @monomind/cli/ruvector
14
14
  */
15
15
  export { DiffClassifier, createDiffClassifier, analyzeDiff, analyzeDiffSync, assessFileRisk, assessOverallRisk, classifyDiff, suggestReviewers, getGitDiffNumstat, getGitDiffNumstatAsync, clearDiffCache, clearAllDiffCaches, } from './diff-classifier.js';
16
+ export function createQLearningRouter(_config) {
17
+ const agentTypes = ['coder', 'tester', 'reviewer', 'architect', 'researcher', 'optimizer', 'debugger', 'documenter'];
18
+ return {
19
+ async route(task) {
20
+ const lower = task.toLowerCase();
21
+ let agentType = 'coder';
22
+ if (lower.includes('test'))
23
+ agentType = 'tester';
24
+ else if (lower.includes('review') || lower.includes('security'))
25
+ agentType = 'reviewer';
26
+ else if (lower.includes('design') || lower.includes('architect'))
27
+ agentType = 'architect';
28
+ else if (lower.includes('research') || lower.includes('analyz'))
29
+ agentType = 'researcher';
30
+ else if (lower.includes('optim') || lower.includes('perform'))
31
+ agentType = 'optimizer';
32
+ else if (lower.includes('debug') || lower.includes('fix') || lower.includes('bug'))
33
+ agentType = 'debugger';
34
+ else if (lower.includes('doc'))
35
+ agentType = 'documenter';
36
+ return { agentType, confidence: 0.75, reasoning: 'keyword-based routing', route: agentType, qValues: [], explored: false, alternatives: agentTypes.filter(a => a !== agentType).slice(0, 3) };
37
+ },
38
+ async initialize() { },
39
+ getStats() { return {}; },
40
+ update() { },
41
+ reset() { },
42
+ export() { return {}; },
43
+ import() { },
44
+ };
45
+ }
16
46
  // ── RuVector LLM WASM (inference utilities) ─────────────────
17
47
  export { isRuvllmWasmAvailable, initRuvllmWasm, getRuvllmStatus, createHnswRouter, createSonaInstant, createMicroLora, formatChat, createKvCache, createGenerateConfig, createBufferPool, createInferenceArena, HNSW_MAX_SAFE_PATTERNS, } from './ruvllm-wasm.js';
18
48
  // ── Agent WASM (sandboxed agent runtime) ────────────────────
@@ -18,7 +18,7 @@
18
18
  * - GenerateConfig float precision loss (f32 roundtrip)
19
19
  * - MicroLoRA apply() hardcoded to 768 dims regardless of config
20
20
  *
21
- * @module @monoes/cli/ruvector/ruvllm-wasm
21
+ * @module @monomind/cli/ruvector/ruvllm-wasm
22
22
  */
23
23
  export interface HnswRouterConfig {
24
24
  dimensions: number;
@@ -2,7 +2,7 @@
2
2
  * IPFS Upload Module
3
3
  * Real upload support via web3.storage, Pinata, or local IPFS
4
4
  *
5
- * @module @monoes/cli/transfer/ipfs/upload
5
+ * @module @monomind/cli/transfer/ipfs/upload
6
6
  * @version 3.0.0
7
7
  */
8
8
  import type { PinningService } from '../types.js';
@@ -2,7 +2,7 @@
2
2
  * Google Cloud Storage Backend
3
3
  * Real storage implementation using gcloud CLI or GCS APIs
4
4
  *
5
- * @module @monoes/cli/transfer/storage/gcs
5
+ * @module @monomind/cli/transfer/storage/gcs
6
6
  * @version 3.0.0
7
7
  */
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Update checker for @monoes packages
2
+ * Update checker for @monomind packages
3
3
  * Queries npm registry and compares versions
4
4
  */
5
5
  export interface UpdateCheckResult {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Auto-update system for @monoes packages
2
+ * Auto-update system for @monomind packages
3
3
  *
4
4
  * Features:
5
5
  * - Rate-limited update checks (24h default)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.10.56",
3
+ "version": "1.10.57",
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",