monomind 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 (74) hide show
  1. package/README.md +10 -3
  2. package/package.json +1 -1
  3. package/packages/@monomind/cli/.claude/commands/mastermind/topology.md +121 -0
  4. package/packages/@monomind/cli/.claude/commands/mastermind.md +121 -102
  5. package/packages/@monomind/cli/.claude/helpers/control-start.cjs +22 -2
  6. package/packages/@monomind/cli/.claude/helpers/control-stop.cjs +95 -0
  7. package/packages/@monomind/cli/.claude/helpers/graphify-freshen.cjs +6 -0
  8. package/packages/@monomind/cli/.claude/helpers/hook-handler.cjs +13 -5
  9. package/packages/@monomind/cli/.claude/helpers/utils/monograph.cjs +33 -10
  10. package/packages/@monomind/cli/.claude/helpers/utils/system-pressure.cjs +46 -0
  11. package/packages/@monomind/cli/.claude/settings.json +448 -0
  12. package/packages/@monomind/cli/README.md +10 -3
  13. package/packages/@monomind/cli/bin/cli.js +16 -6
  14. package/packages/@monomind/cli/bin/mcp-server.js +17 -8
  15. package/packages/@monomind/cli/dist/src/commands/agent-lifecycle.js +1 -1
  16. package/packages/@monomind/cli/dist/src/commands/agent-ops.js +1 -1
  17. package/packages/@monomind/cli/dist/src/commands/cleanup.js +53 -1
  18. package/packages/@monomind/cli/dist/src/commands/config.js +1 -1
  19. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +1 -1
  20. package/packages/@monomind/cli/dist/src/commands/hooks.js +1 -1
  21. package/packages/@monomind/cli/dist/src/commands/index.js +4 -0
  22. package/packages/@monomind/cli/dist/src/commands/init-wizard.js +3 -3
  23. package/packages/@monomind/cli/dist/src/commands/init.js +2 -2
  24. package/packages/@monomind/cli/dist/src/commands/mcp.js +2 -2
  25. package/packages/@monomind/cli/dist/src/commands/memory-admin.js +8 -7
  26. package/packages/@monomind/cli/dist/src/commands/memory-list.js +2 -2
  27. package/packages/@monomind/cli/dist/src/commands/memory.d.ts +1 -1
  28. package/packages/@monomind/cli/dist/src/commands/memory.js +4 -4
  29. package/packages/@monomind/cli/dist/src/commands/neural-core.js +1 -1
  30. package/packages/@monomind/cli/dist/src/commands/performance.js +8 -9
  31. package/packages/@monomind/cli/dist/src/commands/status.js +2 -2
  32. package/packages/@monomind/cli/dist/src/commands/swarm.js +1 -1
  33. package/packages/@monomind/cli/dist/src/index.js +1 -1
  34. package/packages/@monomind/cli/dist/src/init/claudemd-generator.js +2 -2
  35. package/packages/@monomind/cli/dist/src/init/executor.js +13 -6
  36. package/packages/@monomind/cli/dist/src/init/helpers-generator.js +66 -3
  37. package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.d.ts +1 -1
  38. package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.js +1 -1
  39. package/packages/@monomind/cli/dist/src/init/statusline-generator.d.ts +1 -1
  40. package/packages/@monomind/cli/dist/src/init/statusline-generator.js +2 -2
  41. package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -1
  42. package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.d.ts +1 -1
  43. package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.js +3 -3
  44. package/packages/@monomind/cli/dist/src/mcp-client.d.ts +13 -51
  45. package/packages/@monomind/cli/dist/src/mcp-client.js +79 -134
  46. package/packages/@monomind/cli/dist/src/mcp-server.js +4 -3
  47. package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.js +45 -19
  48. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +1 -1
  49. package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +2 -2
  50. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-intelligence.js +2 -2
  51. package/packages/@monomind/cli/dist/src/mcp-tools/knowledge-tools.js +1 -1
  52. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.js +2 -2
  53. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +22 -9
  54. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +1 -1
  55. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +3 -3
  56. package/packages/@monomind/cli/dist/src/mcp-tools/system-tools.js +1 -1
  57. package/packages/@monomind/cli/dist/src/memory/embedding-operations.js +2 -2
  58. package/packages/@monomind/cli/dist/src/memory/hnsw-operations.js +53 -26
  59. package/packages/@monomind/cli/dist/src/memory/intelligence.js +2 -2
  60. package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +7 -3
  61. package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +24 -10
  62. package/packages/@monomind/cli/dist/src/memory/memory-crud.js +2 -2
  63. package/packages/@monomind/cli/dist/src/memory/memory-initializer.d.ts +2 -2
  64. package/packages/@monomind/cli/dist/src/memory/memory-initializer.js +6 -6
  65. package/packages/@monomind/cli/dist/src/memory/memory-read.js +4 -4
  66. package/packages/@monomind/cli/dist/src/orgrt/daemon.js +12 -6
  67. package/packages/@monomind/cli/dist/src/orgrt/mailbox.d.ts +1 -0
  68. package/packages/@monomind/cli/dist/src/orgrt/mailbox.js +4 -0
  69. package/packages/@monomind/cli/dist/src/orgrt/policy.js +1 -1
  70. package/packages/@monomind/cli/dist/src/orgrt/server.js +25 -0
  71. package/packages/@monomind/cli/dist/src/ui/dashboard.html +327 -611
  72. package/packages/@monomind/cli/dist/src/ui/server.mjs +165 -22
  73. package/packages/@monomind/cli/package.json +1 -1
  74. package/scripts/growth-content-calendar.mjs +140 -0
@@ -9,6 +9,18 @@ const { _getRecentEdits } = require('./telemetry.cjs');
9
9
 
10
10
  const CWD = process.env.CLAUDE_PROJECT_DIR || process.cwd();
11
11
 
12
+ // Node's require(esm) support (used below to load @monoes/monograph's ESM
13
+ // entry file) unconditionally prints an ExperimentalWarning to stderr the
14
+ // first time it fires per process. That warning can't be try/caught since
15
+ // it's emitted via process.emitWarning, not thrown — and Claude Code's hook
16
+ // runner surfaces any stderr output as a scary "hook error" even though the
17
+ // hook itself succeeds. Filter out just that one warning; let others through.
18
+ var _origEmitWarning = process.emitWarning;
19
+ process.emitWarning = function (warning) {
20
+ if (typeof warning === 'string' && /CommonJS module .* is loading ES Module/.test(warning)) return;
21
+ return _origEmitWarning.apply(process, arguments);
22
+ };
23
+
12
24
  // @monoes/monograph is "type":"module" with an exports map that has no
13
25
  // "require" condition — a bare `require('@monoes/monograph')` (or
14
26
  // require() of its package directory) always throws "No exports main
@@ -340,22 +352,32 @@ function _graphGateMarkQueried(sessionId) {
340
352
  } catch (e) { /* non-fatal */ }
341
353
  }
342
354
 
355
+ // Returns 'block' (hard block, exitCode 2), 'warn' (allow but remind), or false (no action).
343
356
  function _graphGateShouldBlock(sessionId) {
344
- // MONOMIND_GRAPH_GATE=off disables the gate entirely — for headless/CI runs
345
- // (claude -p, org agents, scripted probes) where each run is a fresh session
346
- // that would otherwise eat one deliberate block on its first grep/find.
347
357
  if (String(process.env.MONOMIND_GRAPH_GATE || '').toLowerCase() === 'off') return false;
348
358
  if (!sessionId || !_isGraphFresh()) return false;
349
359
  var sessions = _graphGateReadSessions();
350
360
  var s = sessions[sessionId] || { queried: false, blockedOnce: false };
351
- if (s.queried || s.blockedOnce) return false;
352
- s.blockedOnce = true;
353
- s.ts = Date.now();
354
- sessions[sessionId] = s;
361
+ if (s.queried) return false;
362
+ if (!s.blockedOnce) {
363
+ s.blockedOnce = true;
364
+ s.ts = Date.now();
365
+ sessions[sessionId] = s;
366
+ try { _graphGateWriteSessions(sessions); } catch (e) { return false; }
367
+ return 'block';
368
+ }
369
+ // Already blocked once but monograph still not called — warn without blocking
370
+ // so subagents without MCP access don't deadlock.
371
+ return 'warn';
372
+ }
373
+
374
+ function _getNodeCount() {
355
375
  try {
356
- _graphGateWriteSessions(sessions);
357
- } catch (e) { return false; }
358
- return true;
376
+ var db = _openMonographDb();
377
+ if (!db) return null;
378
+ try { return db.prepare('SELECT COUNT(*) AS c FROM nodes').get().c; }
379
+ finally { db.close(); }
380
+ } catch (e) { return null; }
359
381
  }
360
382
 
361
383
  function _injectCompactGraphMap() {
@@ -579,5 +601,6 @@ module.exports = {
579
601
  _maybeRebuildMonograph,
580
602
  _graphGateShouldBlock,
581
603
  _graphGateMarkQueried,
604
+ _getNodeCount,
582
605
  injectGodNodesContext,
583
606
  };
@@ -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
+ }
@@ -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)
@@ -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,