@monoes/monomindcli 2.5.4 → 2.5.6

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 (130) hide show
  1. package/.claude/commands/mastermind/topology.md +121 -0
  2. package/.claude/commands/mastermind.md +121 -102
  3. package/.claude/helpers/control-start.cjs +22 -2
  4. package/.claude/helpers/control-stop.cjs +95 -0
  5. package/.claude/helpers/graphify-freshen.cjs +6 -0
  6. package/.claude/helpers/hook-handler.cjs +13 -5
  7. package/.claude/helpers/utils/monograph.cjs +33 -10
  8. package/.claude/helpers/utils/system-pressure.cjs +46 -0
  9. package/.claude/settings.json +448 -0
  10. package/README.md +10 -3
  11. package/bin/cli.js +16 -6
  12. package/bin/mcp-server.js +17 -8
  13. package/dist/src/commands/agent-lifecycle.js +1 -1
  14. package/dist/src/commands/agent-lifecycle.js.map +1 -1
  15. package/dist/src/commands/agent-ops.js +1 -1
  16. package/dist/src/commands/agent-ops.js.map +1 -1
  17. package/dist/src/commands/cleanup.d.ts.map +1 -1
  18. package/dist/src/commands/cleanup.js +53 -1
  19. package/dist/src/commands/cleanup.js.map +1 -1
  20. package/dist/src/commands/config.js +1 -1
  21. package/dist/src/commands/config.js.map +1 -1
  22. package/dist/src/commands/hooks-coverage-commands.js +1 -1
  23. package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
  24. package/dist/src/commands/hooks.js +1 -1
  25. package/dist/src/commands/hooks.js.map +1 -1
  26. package/dist/src/commands/index.d.ts.map +1 -1
  27. package/dist/src/commands/index.js +4 -0
  28. package/dist/src/commands/index.js.map +1 -1
  29. package/dist/src/commands/init-wizard.js +3 -3
  30. package/dist/src/commands/init-wizard.js.map +1 -1
  31. package/dist/src/commands/init.js +2 -2
  32. package/dist/src/commands/mcp.js +2 -2
  33. package/dist/src/commands/mcp.js.map +1 -1
  34. package/dist/src/commands/memory-admin.d.ts.map +1 -1
  35. package/dist/src/commands/memory-admin.js +8 -7
  36. package/dist/src/commands/memory-admin.js.map +1 -1
  37. package/dist/src/commands/memory-list.js +2 -2
  38. package/dist/src/commands/memory-list.js.map +1 -1
  39. package/dist/src/commands/memory.d.ts +1 -1
  40. package/dist/src/commands/memory.js +4 -4
  41. package/dist/src/commands/memory.js.map +1 -1
  42. package/dist/src/commands/neural-core.js +1 -1
  43. package/dist/src/commands/neural-core.js.map +1 -1
  44. package/dist/src/commands/performance.d.ts.map +1 -1
  45. package/dist/src/commands/performance.js +8 -9
  46. package/dist/src/commands/performance.js.map +1 -1
  47. package/dist/src/commands/status.js +2 -2
  48. package/dist/src/commands/status.js.map +1 -1
  49. package/dist/src/commands/swarm.js +1 -1
  50. package/dist/src/commands/swarm.js.map +1 -1
  51. package/dist/src/index.js +1 -1
  52. package/dist/src/index.js.map +1 -1
  53. package/dist/src/init/claudemd-generator.js +2 -2
  54. package/dist/src/init/executor.d.ts.map +1 -1
  55. package/dist/src/init/executor.js +13 -6
  56. package/dist/src/init/executor.js.map +1 -1
  57. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  58. package/dist/src/init/helpers-generator.js +66 -3
  59. package/dist/src/init/helpers-generator.js.map +1 -1
  60. package/dist/src/init/shared-instructions-generator.d.ts +1 -1
  61. package/dist/src/init/shared-instructions-generator.js +1 -1
  62. package/dist/src/init/statusline-generator.d.ts +1 -1
  63. package/dist/src/init/statusline-generator.js +2 -2
  64. package/dist/src/init/types.d.ts +1 -1
  65. package/dist/src/init/types.d.ts.map +1 -1
  66. package/dist/src/knowledge/document-pipeline.d.ts +1 -1
  67. package/dist/src/knowledge/document-pipeline.js +3 -3
  68. package/dist/src/knowledge/document-pipeline.js.map +1 -1
  69. package/dist/src/mcp-client.d.ts +13 -51
  70. package/dist/src/mcp-client.d.ts.map +1 -1
  71. package/dist/src/mcp-client.js +79 -134
  72. package/dist/src/mcp-client.js.map +1 -1
  73. package/dist/src/mcp-server.d.ts.map +1 -1
  74. package/dist/src/mcp-server.js +4 -3
  75. package/dist/src/mcp-server.js.map +1 -1
  76. package/dist/src/mcp-tools/browser-tools.d.ts.map +1 -1
  77. package/dist/src/mcp-tools/browser-tools.js +45 -19
  78. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  79. package/dist/src/mcp-tools/guidance-tools.js +1 -1
  80. package/dist/src/mcp-tools/guidance-tools.js.map +1 -1
  81. package/dist/src/mcp-tools/hive-mind-tools.js +2 -2
  82. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  83. package/dist/src/mcp-tools/hooks-intelligence.js +2 -2
  84. package/dist/src/mcp-tools/hooks-intelligence.js.map +1 -1
  85. package/dist/src/mcp-tools/knowledge-tools.js +1 -1
  86. package/dist/src/mcp-tools/knowledge-tools.js.map +1 -1
  87. package/dist/src/mcp-tools/monograph-compat.js +2 -2
  88. package/dist/src/mcp-tools/monograph-compat.js.map +1 -1
  89. package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
  90. package/dist/src/mcp-tools/monograph-tools.js +22 -9
  91. package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
  92. package/dist/src/mcp-tools/neural-tools.d.ts +1 -1
  93. package/dist/src/mcp-tools/neural-tools.js +3 -3
  94. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  95. package/dist/src/mcp-tools/system-tools.js +1 -1
  96. package/dist/src/mcp-tools/system-tools.js.map +1 -1
  97. package/dist/src/memory/embedding-operations.js +2 -2
  98. package/dist/src/memory/embedding-operations.js.map +1 -1
  99. package/dist/src/memory/hnsw-operations.d.ts.map +1 -1
  100. package/dist/src/memory/hnsw-operations.js +53 -26
  101. package/dist/src/memory/hnsw-operations.js.map +1 -1
  102. package/dist/src/memory/intelligence.js +2 -2
  103. package/dist/src/memory/intelligence.js.map +1 -1
  104. package/dist/src/memory/memory-bridge.d.ts +7 -3
  105. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  106. package/dist/src/memory/memory-bridge.js +24 -10
  107. package/dist/src/memory/memory-bridge.js.map +1 -1
  108. package/dist/src/memory/memory-crud.js +2 -2
  109. package/dist/src/memory/memory-crud.js.map +1 -1
  110. package/dist/src/memory/memory-initializer.d.ts +2 -2
  111. package/dist/src/memory/memory-initializer.js +6 -6
  112. package/dist/src/memory/memory-initializer.js.map +1 -1
  113. package/dist/src/memory/memory-read.js +4 -4
  114. package/dist/src/memory/memory-read.js.map +1 -1
  115. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  116. package/dist/src/orgrt/daemon.js +12 -6
  117. package/dist/src/orgrt/daemon.js.map +1 -1
  118. package/dist/src/orgrt/mailbox.d.ts +1 -0
  119. package/dist/src/orgrt/mailbox.d.ts.map +1 -1
  120. package/dist/src/orgrt/mailbox.js +4 -0
  121. package/dist/src/orgrt/mailbox.js.map +1 -1
  122. package/dist/src/orgrt/policy.js +1 -1
  123. package/dist/src/orgrt/policy.js.map +1 -1
  124. package/dist/src/orgrt/server.d.ts.map +1 -1
  125. package/dist/src/orgrt/server.js +25 -0
  126. package/dist/src/orgrt/server.js.map +1 -1
  127. package/dist/src/ui/dashboard.html +327 -611
  128. package/dist/src/ui/server.mjs +165 -22
  129. package/dist/tsconfig.tsbuildinfo +1 -1
  130. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+ const os = require('os');
3
+
4
+ const PRESSURE_THRESHOLD = 0.10; // 10% free = critical
5
+
6
+ /**
7
+ * Returns { free, total, freeRatio, level } for logging.
8
+ * On macOS, `memory_pressure`'s bare invocation has no query mode — it
9
+ * always exits 0 regardless of actual pressure (see `man memory_pressure`:
10
+ * exit-code levels only apply to its -l/-S simulate-pressure flags, not to
11
+ * reading real system state). What IS real there is its printed
12
+ * "System-wide memory free percentage: NN%" line, which accounts for
13
+ * inactive/purgeable/compressed pages that os.freemem() ignores — so that
14
+ * line, not the exit code, is the authoritative signal on macOS.
15
+ */
16
+ function getMemoryInfo() {
17
+ const free = os.freemem();
18
+ const total = os.totalmem();
19
+ let freeRatio = total > 0 ? free / total : 1;
20
+
21
+ if (process.platform === 'darwin') {
22
+ try {
23
+ const { execSync } = require('child_process');
24
+ const out = execSync('memory_pressure', { timeout: 2000, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });
25
+ const match = out.match(/free percentage:\s*(\d+)%/);
26
+ if (match) freeRatio = parseInt(match[1], 10) / 100;
27
+ } catch { /* use os.freemem() fallback */ }
28
+ }
29
+
30
+ const usedMB = Math.round(total * (1 - freeRatio) / 1024 / 1024);
31
+ const totalMB = Math.round(total / 1024 / 1024);
32
+ const level = freeRatio < 0.05 ? 'urgent' : freeRatio < 0.10 ? 'critical' : freeRatio < 0.20 ? 'warn' : 'normal';
33
+ return { free, total, freeRatio, usedMB, totalMB, level };
34
+ }
35
+
36
+ /**
37
+ * Returns true when the system is under critical memory pressure.
38
+ * Derived from getMemoryInfo()'s freeRatio (real free% on macOS via
39
+ * memory_pressure's output, os.freemem() elsewhere) — not from any command
40
+ * exit code, since memory_pressure's bare invocation always exits 0.
41
+ */
42
+ function isMemoryPressureCritical() {
43
+ return getMemoryInfo().freeRatio < PRESSURE_THRESHOLD;
44
+ }
45
+
46
+ module.exports = { isMemoryPressureCritical, getMemoryInfo };
@@ -0,0 +1,448 @@
1
+ {
2
+ "model": "claude-opus-4-6",
3
+ "customInstructions": "Follow the project's CLAUDE.md guidelines. Use concurrent execution for all operations. Prioritize v1 implementation with security-first development, 15-agent swarm coordination, phased performance optimization, and cross-platform helper automation.",
4
+ "env": {},
5
+ "permissions": {
6
+ "allow": [
7
+ "Bash(npx @monomind*)",
8
+ "Bash(npx monomind*)",
9
+ "Bash(node .claude/*)",
10
+ "Bash(npm run:*)",
11
+ "Bash(npm test:*)",
12
+ "Bash(git status)",
13
+ "Bash(git diff:*)",
14
+ "Bash(git log:*)",
15
+ "Bash(git add:*)",
16
+ "Bash(git commit:*)",
17
+ "Bash(git push)",
18
+ "Bash(git config:*)",
19
+ "Bash(git tag:*)",
20
+ "Bash(git branch:*)",
21
+ "Bash(git checkout:*)",
22
+ "Bash(git stash:*)",
23
+ "Bash(jq:*)",
24
+ "Bash(node:*)",
25
+ "Bash(which:*)",
26
+ "Bash(pwd)",
27
+ "Bash(ls:*)",
28
+ "Bash(npx:*)",
29
+ "mcp__monomind__*"
30
+ ],
31
+ "deny": [
32
+ "Read(./.env)",
33
+ "Read(./.env.*)",
34
+ "Bash(rm -rf /)"
35
+ ]
36
+ },
37
+ "hooks": {
38
+ "PreToolUse": [
39
+ {
40
+ "matcher": "Bash",
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" pre-bash",
45
+ "timeout": 5000
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "matcher": "Grep|Glob",
51
+ "hooks": [
52
+ {
53
+ "type": "command",
54
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" pre-search",
55
+ "timeout": 4000
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "matcher": "Write|Edit|MultiEdit",
61
+ "hooks": [
62
+ {
63
+ "type": "command",
64
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" pre-write",
65
+ "timeout": 3000
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "matcher": ".*",
71
+ "hooks": [
72
+ {
73
+ "type": "command",
74
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" pre-tool",
75
+ "timeout": 2000
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ "matcher": "Bash|Write|Edit|MultiEdit",
81
+ "hooks": [
82
+ {
83
+ "type": "command",
84
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/handlers/capture-handler.cjs\" pretool",
85
+ "timeout": 2000
86
+ }
87
+ ]
88
+ }
89
+ ],
90
+ "PostToolUse": [
91
+ {
92
+ "matcher": "Write|Edit|MultiEdit",
93
+ "hooks": [
94
+ {
95
+ "type": "command",
96
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" post-edit",
97
+ "timeout": 10000
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "matcher": "ScheduleWakeup",
103
+ "hooks": [
104
+ {
105
+ "type": "command",
106
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/loop-tracker.cjs\"",
107
+ "timeout": 3000
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "matcher": "mcp__monomind__monograph_.*",
113
+ "hooks": [
114
+ {
115
+ "type": "command",
116
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" post-graph-tool",
117
+ "timeout": 2000
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ "matcher": ".*",
123
+ "hooks": [
124
+ {
125
+ "type": "command",
126
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" post-tool",
127
+ "timeout": 2000
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "matcher": "Bash|Write|Edit|MultiEdit",
133
+ "hooks": [
134
+ {
135
+ "type": "command",
136
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/handlers/capture-handler.cjs\" posttool",
137
+ "timeout": 3000
138
+ }
139
+ ]
140
+ }
141
+ ],
142
+ "Notification": [
143
+ {
144
+ "hooks": [
145
+ {
146
+ "type": "command",
147
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" notification",
148
+ "timeout": 2000
149
+ }
150
+ ]
151
+ }
152
+ ],
153
+ "UserPromptSubmit": [
154
+ {
155
+ "matcher": "",
156
+ "hooks": [{ "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/monolean-tracker.cjs\"", "timeout": 3000 }]
157
+ },
158
+ {
159
+ "hooks": [
160
+ {
161
+ "type": "command",
162
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" route",
163
+ "timeout": 10000
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "hooks": [
169
+ {
170
+ "type": "command",
171
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" user-prompt",
172
+ "timeout": 2000
173
+ }
174
+ ]
175
+ }
176
+ ],
177
+ "SessionStart": [
178
+ {
179
+ "matcher": "",
180
+ "hooks": [{ "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/mastermind-activate.cjs\"", "timeout": 5000 }]
181
+ },
182
+ {
183
+ "matcher": "",
184
+ "hooks": [{ "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/monolean-activate.cjs\"", "timeout": 5000 }]
185
+ },
186
+ {
187
+ "hooks": [
188
+ {
189
+ "type": "command",
190
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" session-restore",
191
+ "timeout": 15000
192
+ },
193
+ {
194
+ "type": "command",
195
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/graphify-freshen.cjs\"",
196
+ "timeout": 5000
197
+ },
198
+ {
199
+ "type": "command",
200
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/control-start.cjs\"",
201
+ "timeout": 5000
202
+ },
203
+ {
204
+ "type": "command",
205
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" session-start",
206
+ "timeout": 2000
207
+ }
208
+ ]
209
+ }
210
+ ],
211
+ "SessionEnd": [
212
+ {
213
+ "hooks": [
214
+ {
215
+ "type": "command",
216
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" session-end",
217
+ "timeout": 10000
218
+ },
219
+ {
220
+ "type": "command",
221
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/control-stop.cjs\" --session",
222
+ "timeout": 5000
223
+ },
224
+ {
225
+ "type": "command",
226
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" session-end",
227
+ "timeout": 2000
228
+ }
229
+ ]
230
+ }
231
+ ],
232
+ "Stop": [
233
+ {
234
+ "hooks": [
235
+ {
236
+ "type": "command",
237
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" stop",
238
+ "timeout": 2000
239
+ }
240
+ ]
241
+ }
242
+ ],
243
+ "PreCompact": [
244
+ {
245
+ "matcher": "manual",
246
+ "hooks": [
247
+ {
248
+ "type": "command",
249
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" compact-manual"
250
+ },
251
+ {
252
+ "type": "command",
253
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" session-end",
254
+ "timeout": 5000
255
+ },
256
+ {
257
+ "type": "command",
258
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" compact",
259
+ "timeout": 2000
260
+ }
261
+ ]
262
+ },
263
+ {
264
+ "matcher": "auto",
265
+ "hooks": [
266
+ {
267
+ "type": "command",
268
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" compact-auto"
269
+ },
270
+ {
271
+ "type": "command",
272
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" session-end",
273
+ "timeout": 6000
274
+ },
275
+ {
276
+ "type": "command",
277
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" compact",
278
+ "timeout": 2000
279
+ }
280
+ ]
281
+ }
282
+ ],
283
+ "SubagentStart": [
284
+ {
285
+ "matcher": "",
286
+ "hooks": [{ "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/monolean-propagate.cjs\"", "timeout": 3000 }]
287
+ },
288
+ {
289
+ "hooks": [
290
+ {
291
+ "type": "command",
292
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" agent-start",
293
+ "timeout": 3000
294
+ },
295
+ {
296
+ "type": "command",
297
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" pre-task",
298
+ "timeout": 3000
299
+ },
300
+ {
301
+ "type": "command",
302
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/handlers/capture-handler.cjs\" subagent-start",
303
+ "timeout": 4000
304
+ },
305
+ {
306
+ "type": "command",
307
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" subagent-start",
308
+ "timeout": 2000
309
+ }
310
+ ]
311
+ }
312
+ ],
313
+ "SubagentStop": [
314
+ {
315
+ "hooks": [
316
+ {
317
+ "type": "command",
318
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/handlers/capture-handler.cjs\" subagent-stop",
319
+ "timeout": 8000
320
+ },
321
+ {
322
+ "type": "command",
323
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/event-logger.cjs\" subagent-stop",
324
+ "timeout": 2000
325
+ }
326
+ ]
327
+ }
328
+ ]
329
+ },
330
+ "attribution": {
331
+ "commit": "Co-Authored-By: nokhodian <nokhodian@gmail.com>",
332
+ "pr": "\ud83e\udd16 Generated with [monomind](https://github.com/monoes/monomind)"
333
+ },
334
+ "monomind": {
335
+ "version": "3.5.2",
336
+ "enabled": true,
337
+ "swarm": {
338
+ "topology": "hierarchical-mesh",
339
+ "maxAgents": 15
340
+ },
341
+ "memory": {
342
+ "backend": "hybrid",
343
+ "enableHNSW": true,
344
+ "learningBridge": {
345
+ "enabled": true
346
+ },
347
+ "memoryGraph": {
348
+ "enabled": true
349
+ },
350
+ "agentScopes": {
351
+ "enabled": true
352
+ }
353
+ },
354
+ "neural": {
355
+ "enabled": true
356
+ },
357
+ "daemon": {
358
+ "autoStart": true,
359
+ "workers": [
360
+ "map",
361
+ "audit",
362
+ "optimize",
363
+ "consolidate",
364
+ "testgaps",
365
+ "ultralearn",
366
+ "deepdive",
367
+ "document",
368
+ "refactor",
369
+ "benchmark"
370
+ ],
371
+ "schedules": {
372
+ "audit": {
373
+ "interval": "1h",
374
+ "priority": "critical"
375
+ },
376
+ "optimize": {
377
+ "interval": "30m",
378
+ "priority": "high"
379
+ },
380
+ "consolidate": {
381
+ "interval": "2h",
382
+ "priority": "low"
383
+ },
384
+ "document": {
385
+ "interval": "1h",
386
+ "priority": "normal"
387
+ },
388
+ "deepdive": {
389
+ "interval": "4h",
390
+ "priority": "normal"
391
+ },
392
+ "ultralearn": {
393
+ "interval": "1h",
394
+ "priority": "normal"
395
+ }
396
+ }
397
+ },
398
+ "learning": {
399
+ "enabled": true,
400
+ "autoTrain": true,
401
+ "patterns": [
402
+ "coordination",
403
+ "optimization",
404
+ "prediction"
405
+ ],
406
+ "retention": {
407
+ "shortTerm": "24h",
408
+ "longTerm": "30d"
409
+ }
410
+ },
411
+ "adr": {
412
+ "autoGenerate": true,
413
+ "directory": "docs/adrs",
414
+ "template": "madr"
415
+ },
416
+ "security": {
417
+ "autoScan": true,
418
+ "scanOnEdit": true,
419
+ "cveCheck": true,
420
+ "threatModel": true
421
+ }
422
+ },
423
+ "agents": {
424
+ "source": ".claude/agents",
425
+ "customAgents": []
426
+ },
427
+ "skills": {
428
+ "source": ".claude/commands",
429
+ "enabled": true
430
+ },
431
+ "statusLine": {
432
+ "type": "command",
433
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/statusline.cjs\""
434
+ },
435
+ "mcpServers": {
436
+ "monomind": {
437
+ "command": "npx",
438
+ "args": [
439
+ "monomind@latest",
440
+ "mcp",
441
+ "start"
442
+ ]
443
+ }
444
+ },
445
+ "enabledMcpjsonServers": [
446
+ "monomind"
447
+ ]
448
+ }
package/README.md CHANGED
@@ -140,9 +140,12 @@ monomind org status [name] # runtime state for one or all orgs
140
140
  monomind org list # list every org + status
141
141
  monomind org serve [--cross-process] # host-only mode, runs scheduled orgs
142
142
  monomind org delete <name> # remove an org
143
+ monomind org memory <name> # cross-run KG memory: stats (default) | search <q> | rules | rollback <run-ref>
143
144
  ```
144
145
 
145
- > **Note:** the older `/mastermind:createorg` + `/mastermind:runorg` prompt-orchestrated flow is deprecated it has no delivery guarantees or ground-truth event stream. It still runs for orgs not yet migrated, but new orgs should use `monomind org run` directly against a hand-authored `.monomind/orgs/<name>.json`.
146
+ `org` has 16 subcommands total (run, stop, status, serve, test-loop, logs, report, memory, questions, answer, create, validate, migrate, list, delete, mark-complete) `org memory` is the newest addition.
147
+
148
+ > **Note:** `/mastermind:runorg` now delegates directly to the Org Runtime v2 daemon (the same path as `monomind org run`) — there is no boss agent, no monotask board, and no manual curl calls in this path. The old prompt-orchestrated flow (Task-tool boss agent, monotask board, manual dashboard event posting) is retired to `/mastermind:runorgv1`, reachable only by that explicit legacy name, kept only for orgs not yet migrated off the v1 config shape. New orgs should use `monomind org run` (or `/mastermind:runorg`) against a hand-authored `.monomind/orgs/<name>.json`.
146
149
 
147
150
  ---
148
151
 
@@ -223,7 +226,7 @@ monomind doc list # what's indexed
223
226
  monomind doc export # portable OKF bundle — move your brain between machines
224
227
  ```
225
228
 
226
- **And it follows you across projects.** Ingest a path from *outside* the current project (`monomind doc ingest ~/notes`, or add `--global`) and it lands in your personal global brain at `~/.monomind/global-brain` — searchable from every project on the machine. All retrieval (CLI search, per-prompt injection, the dashboard) merges both stores automatically, with project knowledge winning ties and global hits labeled `[global]`. `doc export --global` moves your whole brain between machines as an OKF bundle — still no cloud, ever.
229
+ **And it follows you across projects.** Ingest a path from *outside* the current project (`monomind doc ingest ~/notes`, or add `--global`) and it lands in your personal global brain at `~/.monomind/global-brain` (override with `MONOMIND_GLOBAL_BRAIN_DIR`) kept as a sibling of `~/.monomind/projects` specifically so `monomind cleanup --data` can never prune it — searchable from every project on the machine. All retrieval (CLI search, per-prompt injection, the dashboard) merges both stores automatically, with project knowledge winning ties and global hits labeled `[global]`. `doc export --global` moves your whole brain between machines as an OKF bundle — still no cloud, ever.
227
230
 
228
231
  Retrieval quality is a tested invariant, not a hope: a golden-set eval (paraphrase queries against notes written in different vocabulary) runs in CI with an 80% recall bar.
229
232
 
@@ -309,6 +312,8 @@ const result = await fence.detect(userInput);
309
312
  // result.safe · result.threats · result.overallRisk
310
313
  ```
311
314
 
315
+ In Claude Code, the live pre-bash/pre-write gate is wired up via its own lazy-loaded integration in `.claude/helpers/handlers/gates-handler.cjs` (`MONOMIND_MONOFENCE_GATE=off` to disable) — not via monofence-ai's `registerSecurityHooks()` API, which is a separate integration point consumed only by `@monoes/hooks`' in-process `HookExecutor`.
316
+
312
317
  ---
313
318
 
314
319
  ## 📋 49 Mastermind Commands
@@ -353,7 +358,7 @@ Everything runs from inside Claude Code via slash commands. Here's the highlight
353
358
  | Package | npm | Purpose |
354
359
  |---|---|---|
355
360
  | `monomind` | [![npm](https://img.shields.io/npm/v/monomind?style=flat-square&color=00D2AA)](https://www.npmjs.com/package/monomind) | Umbrella — **install this one** |
356
- | `@monoes/monomindcli` | [![npm](https://img.shields.io/npm/v/@monoes/monomindcli?style=flat-square&color=4F46E5)](https://www.npmjs.com/package/@monoes/monomindcli) | CLI engine (31 commands) |
361
+ | `@monoes/monomindcli` | [![npm](https://img.shields.io/npm/v/@monoes/monomindcli?style=flat-square&color=4F46E5)](https://www.npmjs.com/package/@monoes/monomindcli) | CLI engine (32 commands) |
357
362
  | `monofence-ai` | [![npm](https://img.shields.io/npm/v/monofence-ai?style=flat-square&color=EF4444)](https://www.npmjs.com/package/monofence-ai) | AI manipulation defence |
358
363
  | `@monoes/monograph` | [![npm](https://img.shields.io/npm/v/@monoes/monograph?style=flat-square&color=F59E0B)](https://www.npmjs.com/package/@monoes/monograph) | Code knowledge graph |
359
364
 
@@ -393,6 +398,8 @@ graph TD
393
398
  ## Resources
394
399
 
395
400
  - 📖 [Full Documentation](https://monoes.github.io/monomind/)
401
+ - 🖥️ [CLI Command Reference](https://github.com/monoes/monomind/blob/main/docs/commands/cli-reference.md)
402
+ - 🏢 [Org Runtime v2 Architecture](https://github.com/monoes/monomind/blob/main/docs/concepts/org-runtime.md)
396
403
  - 🏢 [Autonomous Orgs](https://monoes.github.io/monomind/#orgs)
397
404
  - ⚡ [Mastermind Reference](https://monoes.github.io/monomind/#mastermind)
398
405
  - 📋 [All Slash Commands](https://monoes.github.io/monomind/#slash)
package/bin/cli.js CHANGED
@@ -84,17 +84,27 @@ if (isMCPMode) {
84
84
 
85
85
  for (const line of lines) {
86
86
  if (line.trim()) {
87
+ let parsed;
87
88
  try {
88
- const message = JSON.parse(line);
89
- const response = await handleMessage(message);
89
+ parsed = JSON.parse(line);
90
+ } catch {
91
+ console.log(JSON.stringify({
92
+ jsonrpc: '2.0',
93
+ id: null,
94
+ error: { code: -32700, message: 'Parse error' },
95
+ }));
96
+ continue;
97
+ }
98
+ try {
99
+ const response = await handleMessage(parsed);
90
100
  if (response) {
91
101
  console.log(JSON.stringify(response));
92
102
  }
93
103
  } catch (error) {
94
104
  console.log(JSON.stringify({
95
105
  jsonrpc: '2.0',
96
- id: null,
97
- error: { code: -32700, message: 'Parse error' },
106
+ id: parsed.id ?? null,
107
+ error: { code: -32603, message: error instanceof Error ? error.message : 'Internal error' },
98
108
  }));
99
109
  }
100
110
  }
@@ -132,7 +142,7 @@ if (isMCPMode) {
132
142
  };
133
143
 
134
144
  case 'tools/list': {
135
- const tools = listMCPTools();
145
+ const tools = await listMCPTools();
136
146
  return {
137
147
  jsonrpc: '2.0',
138
148
  id: message.id,
@@ -150,7 +160,7 @@ if (isMCPMode) {
150
160
  const toolName = params.name;
151
161
  const toolParams = params.arguments || {};
152
162
 
153
- if (!hasTool(toolName)) {
163
+ if (!await hasTool(toolName)) {
154
164
  return {
155
165
  jsonrpc: '2.0',
156
166
  id: message.id,
package/bin/mcp-server.js CHANGED
@@ -41,22 +41,31 @@ process.stdin.on('data', async (chunk) => {
41
41
 
42
42
  for (const line of lines) {
43
43
  if (line.trim()) {
44
+ let parsed;
44
45
  try {
45
- const message = JSON.parse(line);
46
- const response = await handleMessage(message);
46
+ parsed = JSON.parse(line);
47
+ } catch {
48
+ console.log(JSON.stringify({
49
+ jsonrpc: '2.0',
50
+ id: null,
51
+ error: { code: -32700, message: 'Parse error' },
52
+ }));
53
+ continue;
54
+ }
55
+ try {
56
+ const response = await handleMessage(parsed);
47
57
  if (response) {
48
58
  console.log(JSON.stringify(response));
49
59
  }
50
60
  } catch (error) {
51
61
  console.error(
52
- `[${new Date().toISOString()}] ERROR [monomind-mcp] Failed to parse:`,
62
+ `[${new Date().toISOString()}] ERROR [monomind-mcp] handler error:`,
53
63
  error instanceof Error ? error.message : String(error)
54
64
  );
55
- // Send parse error response
56
65
  console.log(JSON.stringify({
57
66
  jsonrpc: '2.0',
58
- id: null,
59
- error: { code: -32700, message: 'Parse error' },
67
+ id: parsed.id ?? null,
68
+ error: { code: -32603, message: error instanceof Error ? error.message : 'Internal error' },
60
69
  }));
61
70
  }
62
71
  }
@@ -122,7 +131,7 @@ async function handleMessage(message) {
122
131
  }
123
132
 
124
133
  case 'tools/list': {
125
- const tools = listMCPTools();
134
+ const tools = await listMCPTools();
126
135
  return {
127
136
  jsonrpc: '2.0',
128
137
  id: message.id,
@@ -140,7 +149,7 @@ async function handleMessage(message) {
140
149
  const toolName = params.name;
141
150
  const toolParams = params.arguments || {};
142
151
 
143
- if (!hasTool(toolName)) {
152
+ if (!await hasTool(toolName)) {
144
153
  return {
145
154
  jsonrpc: '2.0',
146
155
  id: message.id,
@@ -44,7 +44,7 @@ export const AGENT_TYPES = [
44
44
  { value: 'optimizer', label: 'Optimizer', hint: 'Performance optimization and bottleneck analysis' },
45
45
  { value: 'security-architect', label: 'Security Architect', hint: 'Security architecture and threat modeling' },
46
46
  { value: 'security-auditor', label: 'Security Auditor', hint: 'CVE remediation and security testing' },
47
- { value: 'memory-specialist', label: 'Memory Specialist', hint: 'LanceDB ANN search (150x-12,500x faster)' },
47
+ { value: 'memory-specialist', label: 'Memory Specialist', hint: 'SQLite-backed ANN search (150x-12,500x faster)' },
48
48
  { value: 'swarm-specialist', label: 'Swarm Specialist', hint: 'Unified coordination engine' },
49
49
  { value: 'performance-engineer', label: 'Performance Engineer', hint: '2.49x-7.47x optimization targets' },
50
50
  { value: 'core-architect', label: 'Core Architect', hint: 'Domain-driven design restructure' },