monomind 1.7.0 → 1.8.0

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 (30) hide show
  1. package/.claude/commands/monomind-createtask.md +2 -2
  2. package/.claude/commands/monomind-do.md +1 -1
  3. package/.claude/commands/monomind-idea.md +1 -1
  4. package/.claude/commands/monomind-improve.md +3 -3
  5. package/.claude/helpers/learning-service.mjs +0 -0
  6. package/.claude/helpers/metrics-db.mjs +0 -0
  7. package/.claude/helpers/swarm-hooks.sh +0 -0
  8. package/.claude/statusline-command.sh +0 -0
  9. package/.claude/statusline.sh +0 -0
  10. package/.claude-plugin/scripts/install.sh +0 -0
  11. package/.claude-plugin/scripts/uninstall.sh +0 -0
  12. package/.claude-plugin/scripts/verify.sh +0 -0
  13. package/package.json +17 -17
  14. package/packages/@monomind/cli/bin/cli.js +0 -0
  15. package/packages/@monomind/cli/bin/mcp-server.js +0 -0
  16. package/packages/@monomind/cli/dist/src/commands/doctor.js +23 -58
  17. package/packages/@monomind/cli/dist/src/init/executor.js +10 -67
  18. package/packages/@monomind/cli/dist/src/init/helpers-generator.js +14 -14
  19. package/packages/@monomind/cli/dist/src/mcp-client.js +5 -2
  20. package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.d.ts +4 -67
  21. package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.js +40 -1250
  22. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +1 -0
  23. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +1 -0
  24. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.d.ts +9 -0
  25. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +495 -0
  26. package/packages/@monomind/cli/package.json +2 -1
  27. package/packages/@monomind/cli/README.md +0 -441
  28. package/packages/@monomind/guidance/README.md +0 -1195
  29. package/packages/@monomind/shared/README.md +0 -323
  30. package/packages/README.md +0 -514
@@ -1,323 +0,0 @@
1
- # @monomind/shared
2
-
3
- [![npm version](https://img.shields.io/npm/v/@monomind/shared.svg)](https://www.npmjs.com/package/@monomind/shared)
4
- [![npm downloads](https://img.shields.io/npm/dm/@monomind/shared.svg)](https://www.npmjs.com/package/@monomind/shared)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
7
- [![Core](https://img.shields.io/badge/Module-Core-blue.svg)](https://github.com/nokhodian/monomind)
8
-
9
- > Shared utilities, types, and core infrastructure for Monomind V1 - the foundation module used by all other @monomind packages.
10
-
11
- ## Features
12
-
13
- - **Core Types** - Agent, Task, Memory, MCP, and Swarm type definitions
14
- - **Core Interfaces** - Agent, Task, Memory, Event, and Coordinator interfaces
15
- - **Configuration** - Schema validation, loading, and default values
16
- - **Event System** - Event bus, coordinator, and handler utilities
17
- - **Hooks System** - Pre/post execution hooks for extensibility
18
- - **MCP Infrastructure** - Server, transport, connection pool, and tool registry
19
- - **Health Monitoring** - Health checks and monitoring utilities
20
-
21
- ## Installation
22
-
23
- ```bash
24
- npm install @monomind/shared
25
- ```
26
-
27
- ## Quick Start
28
-
29
- ```typescript
30
- import {
31
- AgentState,
32
- TaskDefinition,
33
- MemoryEntry,
34
- EventBus,
35
- ConfigLoader
36
- } from '@monomind/shared';
37
-
38
- // Use shared types
39
- const agent: AgentState = {
40
- id: { id: 'agent-1', swarmId: 'swarm-1', type: 'coder' },
41
- name: 'Code Agent',
42
- type: 'coder',
43
- status: 'idle'
44
- };
45
-
46
- // Use configuration
47
- const config = await ConfigLoader.load('./config.json');
48
-
49
- // Use event system
50
- const eventBus = new EventBus();
51
- eventBus.on('task.completed', (event) => {
52
- console.log(`Task ${event.taskId} completed`);
53
- });
54
- ```
55
-
56
- ## Package Exports
57
-
58
- ```typescript
59
- // Main entry (recommended - includes all modules)
60
- import { ... } from '@monomind/shared';
61
-
62
- // Submodule exports (for tree-shaking or specific imports)
63
- import { ... } from '@monomind/shared/types'; // Type definitions
64
- import { ... } from '@monomind/shared/core'; // Config, interfaces, orchestrator
65
- import { ... } from '@monomind/shared/events'; // Event sourcing (ADR-007)
66
- import { ... } from '@monomind/shared/hooks'; // Hooks system
67
- import { ... } from '@monomind/shared/mcp'; // MCP server infrastructure
68
- import { ... } from '@monomind/shared/security'; // Security utilities
69
- import { ... } from '@monomind/shared/resilience'; // Retry, circuit breaker, rate limiter
70
- ```
71
-
72
- ## API Reference
73
-
74
- ### Types
75
-
76
- ```typescript
77
- import type {
78
- // Agent types
79
- AgentId,
80
- AgentState,
81
- AgentType,
82
- AgentStatus,
83
- AgentCapabilities,
84
- AgentMetrics,
85
-
86
- // Task types
87
- TaskId,
88
- TaskDefinition,
89
- TaskType,
90
- TaskStatus,
91
- TaskPriority,
92
-
93
- // Memory types
94
- MemoryEntry,
95
- MemoryType,
96
- SearchResult,
97
-
98
- // Swarm types
99
- SwarmId,
100
- SwarmStatus,
101
- SwarmEvent,
102
- CoordinatorConfig,
103
-
104
- // MCP types
105
- MCPTool,
106
- MCPRequest,
107
- MCPResponse
108
- } from '@monomind/shared/types';
109
- ```
110
-
111
- ### Core Interfaces
112
-
113
- ```typescript
114
- import type {
115
- IAgent,
116
- ITask,
117
- IMemory,
118
- ICoordinator,
119
- IEventHandler
120
- } from '@monomind/shared/core';
121
-
122
- // Agent interface
123
- interface IAgent {
124
- getId(): AgentId;
125
- getState(): AgentState;
126
- execute(task: TaskDefinition): Promise<TaskResult>;
127
- handleMessage(message: Message): Promise<void>;
128
- }
129
-
130
- // Memory interface
131
- interface IMemory {
132
- store(entry: MemoryEntry): Promise<string>;
133
- retrieve(id: string): Promise<MemoryEntry | null>;
134
- search(query: SearchQuery): Promise<SearchResult[]>;
135
- delete(id: string): Promise<boolean>;
136
- }
137
-
138
- // Coordinator interface
139
- interface ICoordinator {
140
- initialize(): Promise<void>;
141
- shutdown(): Promise<void>;
142
- registerAgent(agent: IAgent): Promise<string>;
143
- submitTask(task: TaskDefinition): Promise<string>;
144
- }
145
- ```
146
-
147
- ### Configuration
148
-
149
- ```typescript
150
- import {
151
- ConfigLoader,
152
- ConfigValidator,
153
- defaultConfig,
154
- ConfigSchema
155
- } from '@monomind/shared/core';
156
-
157
- // Load configuration
158
- const config = await ConfigLoader.load('./config.json');
159
- const config2 = await ConfigLoader.loadFromEnv();
160
-
161
- // Validate configuration
162
- const errors = ConfigValidator.validate(config);
163
- if (errors.length > 0) {
164
- console.error('Invalid config:', errors);
165
- }
166
-
167
- // Default configuration
168
- const defaults = defaultConfig();
169
- ```
170
-
171
- ### Event System
172
-
173
- ```typescript
174
- import { EventBus, EventCoordinator } from '@monomind/shared/events';
175
-
176
- const eventBus = new EventBus();
177
-
178
- // Subscribe to events
179
- eventBus.on('agent.joined', (event) => {
180
- console.log(`Agent ${event.agentId} joined`);
181
- });
182
-
183
- eventBus.on('task.*', (event) => {
184
- console.log(`Task event: ${event.type}`);
185
- });
186
-
187
- // Emit events
188
- eventBus.emit({
189
- type: 'task.completed',
190
- taskId: 'task-1',
191
- result: { success: true }
192
- });
193
-
194
- // Event coordinator for complex workflows
195
- const coordinator = new EventCoordinator();
196
- coordinator.orchestrate([
197
- { event: 'step1.done', handler: () => startStep2() },
198
- { event: 'step2.done', handler: () => startStep3() }
199
- ]);
200
- ```
201
-
202
- ### Hooks System
203
-
204
- ```typescript
205
- import { HooksManager, Hook } from '@monomind/shared/hooks';
206
-
207
- const hooks = new HooksManager();
208
-
209
- // Register pre-execution hook
210
- hooks.register('pre:task', async (context) => {
211
- console.log(`Starting task: ${context.taskId}`);
212
- return { ...context, startTime: Date.now() };
213
- });
214
-
215
- // Register post-execution hook
216
- hooks.register('post:task', async (context, result) => {
217
- const duration = Date.now() - context.startTime;
218
- console.log(`Task completed in ${duration}ms`);
219
- });
220
-
221
- // Execute with hooks
222
- const result = await hooks.execute('task', context, async (ctx) => {
223
- return await runTask(ctx);
224
- });
225
- ```
226
-
227
- ### MCP Infrastructure
228
-
229
- ```typescript
230
- import {
231
- createMCPServer,
232
- createToolRegistry,
233
- createConnectionPool,
234
- createSessionManager,
235
- defineTool,
236
- quickStart,
237
- } from '@monomind/shared/mcp';
238
-
239
- // Quick start - simplest way to create an MCP server
240
- const server = await quickStart({
241
- transport: 'stdio',
242
- name: 'My MCP Server',
243
- });
244
-
245
- // Tool registry
246
- const registry = createToolRegistry();
247
- registry.register(defineTool({
248
- name: 'swarm_init',
249
- description: 'Initialize a swarm',
250
- inputSchema: { type: 'object', properties: { topology: { type: 'string' } } },
251
- handler: async (params) => ({ result: 'initialized' }),
252
- }));
253
-
254
- // Connection pool
255
- const pool = createConnectionPool({
256
- maxConnections: 10,
257
- acquireTimeoutMs: 30000,
258
- });
259
-
260
- // Session manager
261
- const sessions = createSessionManager({ timeoutMs: 3600000 });
262
- const session = await sessions.create({ clientInfo: { name: 'client' } });
263
- ```
264
-
265
- ### Health Monitor
266
-
267
- ```typescript
268
- import { HealthMonitor, HealthCheck } from '@monomind/shared/core';
269
-
270
- const monitor = new HealthMonitor();
271
-
272
- // Register health checks
273
- monitor.register('database', async () => {
274
- const connected = await db.ping();
275
- return { healthy: connected, latency: pingTime };
276
- });
277
-
278
- monitor.register('memory', async () => {
279
- const usage = process.memoryUsage();
280
- return { healthy: usage.heapUsed < MAX_HEAP, usage };
281
- });
282
-
283
- // Run health checks
284
- const report = await monitor.check();
285
- // { overall: 'healthy', checks: { database: {...}, memory: {...} } }
286
- ```
287
-
288
- ## TypeScript Types
289
-
290
- All types are fully exported and documented:
291
-
292
- ```typescript
293
- // Re-export all types
294
- export * from './types/agent.types';
295
- export * from './types/task.types';
296
- export * from './types/memory.types';
297
- export * from './types/swarm.types';
298
- export * from './types/mcp.types';
299
- ```
300
-
301
- ## Dependencies
302
-
303
- - `sql.js` - SQLite WASM for cross-platform persistence
304
-
305
- ## Used By
306
-
307
- This package is a dependency of all other @monomind modules:
308
-
309
- - [@monomind/cli](../cli) - CLI module
310
- - [@monomind/security](../security) - Security & validation
311
- - [@monomind/memory](../memory) - AgentDB & HNSW indexing
312
- - [@monomind/neural](../neural) - SONA learning & RL algorithms
313
- - [@monomind/performance](../performance) - Benchmarking & optimization
314
- - [@monomind/swarm](../swarm) - 15-agent coordination
315
- - [@monomind/integration](../integration) - agentic-flow@alpha bridge
316
- - [@monomind/testing](../testing) - TDD framework & fixtures
317
- - [@monomind/deployment](../deployment) - Release management
318
- - [@monomind/embeddings](../embeddings) - Embedding service
319
- - [@monomind/hooks](../hooks) - Hooks system
320
-
321
- ## License
322
-
323
- MIT