monomind 1.17.0 → 1.17.1

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 (91) hide show
  1. package/.claude/agents/engineering/engineering-security-engineer.md +1 -1
  2. package/.claude/commands/mastermind/_repeat.md +4 -0
  3. package/.claude/commands/mastermind/master.md +52 -1
  4. package/.claude/scheduled_tasks.lock +1 -1
  5. package/.claude/skills/mastermind/_repeat.md +2 -0
  6. package/package.json +1 -1
  7. package/packages/@monomind/cli/.claude/agents/engineering/engineering-security-engineer.md +1 -1
  8. package/packages/@monomind/cli/.claude/commands/mastermind/_repeat.md +4 -0
  9. package/packages/@monomind/cli/.claude/commands/mastermind/master.md +52 -1
  10. package/packages/@monomind/cli/.claude/skills/mastermind/_repeat.md +2 -0
  11. package/packages/@monomind/cli/dist/src/__tests__/browse-analyzer.test.js +42 -59
  12. package/packages/@monomind/cli/dist/src/browser/dashboard/server.js +18 -0
  13. package/packages/@monomind/cli/dist/src/browser/dashboard/ui.html +37 -125
  14. package/packages/@monomind/cli/dist/src/commands/agent-lifecycle.d.ts +17 -0
  15. package/packages/@monomind/cli/dist/src/commands/agent-lifecycle.js +320 -0
  16. package/packages/@monomind/cli/dist/src/commands/agent-ops.d.ts +9 -0
  17. package/packages/@monomind/cli/dist/src/commands/agent-ops.js +329 -0
  18. package/packages/@monomind/cli/dist/src/commands/agent.js +5 -907
  19. package/packages/@monomind/cli/dist/src/commands/analyze-ast.d.ts +26 -0
  20. package/packages/@monomind/cli/dist/src/commands/analyze-ast.js +284 -0
  21. package/packages/@monomind/cli/dist/src/commands/analyze-boundaries.d.ts +14 -0
  22. package/packages/@monomind/cli/dist/src/commands/analyze-boundaries.js +295 -0
  23. package/packages/@monomind/cli/dist/src/commands/analyze-diff.d.ts +8 -0
  24. package/packages/@monomind/cli/dist/src/commands/analyze-diff.js +395 -0
  25. package/packages/@monomind/cli/dist/src/commands/analyze-graph.d.ts +14 -0
  26. package/packages/@monomind/cli/dist/src/commands/analyze-graph.js +304 -0
  27. package/packages/@monomind/cli/dist/src/commands/analyze-imports.d.ts +11 -0
  28. package/packages/@monomind/cli/dist/src/commands/analyze-imports.js +287 -0
  29. package/packages/@monomind/cli/dist/src/commands/analyze-symbols.d.ts +14 -0
  30. package/packages/@monomind/cli/dist/src/commands/analyze-symbols.js +302 -0
  31. package/packages/@monomind/cli/dist/src/commands/analyze.d.ts +38 -0
  32. package/packages/@monomind/cli/dist/src/commands/analyze.js +12 -1827
  33. package/packages/@monomind/cli/dist/src/commands/doctor-env-checks.d.ts +26 -0
  34. package/packages/@monomind/cli/dist/src/commands/doctor-env-checks.js +189 -0
  35. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +19 -0
  36. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +388 -0
  37. package/packages/@monomind/cli/dist/src/commands/doctor.js +51 -942
  38. package/packages/@monomind/cli/dist/src/commands/hive-mind-comms.d.ts +11 -0
  39. package/packages/@monomind/cli/dist/src/commands/hive-mind-comms.js +242 -0
  40. package/packages/@monomind/cli/dist/src/commands/hive-mind-helpers.d.ts +35 -0
  41. package/packages/@monomind/cli/dist/src/commands/hive-mind-helpers.js +203 -0
  42. package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.d.ts +8 -0
  43. package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.js +233 -0
  44. package/packages/@monomind/cli/dist/src/commands/hive-mind-spawn.d.ts +12 -0
  45. package/packages/@monomind/cli/dist/src/commands/hive-mind-spawn.js +274 -0
  46. package/packages/@monomind/cli/dist/src/commands/hive-mind.js +10 -1129
  47. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.d.ts +4 -4
  48. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +19 -819
  49. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.d.ts +7 -0
  50. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +334 -0
  51. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.d.ts +7 -0
  52. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.js +399 -0
  53. package/packages/@monomind/cli/dist/src/commands/init-subcommands.d.ts +8 -0
  54. package/packages/@monomind/cli/dist/src/commands/init-subcommands.js +156 -0
  55. package/packages/@monomind/cli/dist/src/commands/init-upgrade.d.ts +6 -0
  56. package/packages/@monomind/cli/dist/src/commands/init-upgrade.js +203 -0
  57. package/packages/@monomind/cli/dist/src/commands/init-wizard.d.ts +6 -0
  58. package/packages/@monomind/cli/dist/src/commands/init-wizard.js +246 -0
  59. package/packages/@monomind/cli/dist/src/commands/init.js +6 -623
  60. package/packages/@monomind/cli/dist/src/commands/memory-admin.d.ts +10 -0
  61. package/packages/@monomind/cli/dist/src/commands/memory-admin.js +433 -0
  62. package/packages/@monomind/cli/dist/src/commands/memory-crud.d.ts +9 -0
  63. package/packages/@monomind/cli/dist/src/commands/memory-crud.js +342 -0
  64. package/packages/@monomind/cli/dist/src/commands/memory-list.d.ts +10 -0
  65. package/packages/@monomind/cli/dist/src/commands/memory-list.js +321 -0
  66. package/packages/@monomind/cli/dist/src/commands/memory-transfer.d.ts +9 -0
  67. package/packages/@monomind/cli/dist/src/commands/memory-transfer.js +372 -0
  68. package/packages/@monomind/cli/dist/src/commands/memory.d.ts +6 -0
  69. package/packages/@monomind/cli/dist/src/commands/memory.js +10 -1441
  70. package/packages/@monomind/cli/dist/src/commands/neural-core.d.ts +8 -0
  71. package/packages/@monomind/cli/dist/src/commands/neural-core.js +274 -0
  72. package/packages/@monomind/cli/dist/src/commands/neural-optimize.d.ts +7 -0
  73. package/packages/@monomind/cli/dist/src/commands/neural-optimize.js +332 -0
  74. package/packages/@monomind/cli/dist/src/commands/neural-registry.d.ts +7 -0
  75. package/packages/@monomind/cli/dist/src/commands/neural-registry.js +290 -0
  76. package/packages/@monomind/cli/dist/src/commands/neural.js +3 -974
  77. package/packages/@monomind/cli/dist/src/commands/platforms.js +327 -7
  78. package/packages/@monomind/cli/dist/src/commands/security-cve.d.ts +6 -0
  79. package/packages/@monomind/cli/dist/src/commands/security-cve.js +310 -0
  80. package/packages/@monomind/cli/dist/src/commands/security-misc.d.ts +9 -0
  81. package/packages/@monomind/cli/dist/src/commands/security-misc.js +293 -0
  82. package/packages/@monomind/cli/dist/src/commands/security-scan.d.ts +18 -0
  83. package/packages/@monomind/cli/dist/src/commands/security-scan.js +328 -0
  84. package/packages/@monomind/cli/dist/src/commands/security.js +3 -958
  85. package/packages/@monomind/cli/dist/src/commands/session.js +1 -1
  86. package/packages/@monomind/cli/dist/src/commands/swarm.js +23 -17
  87. package/packages/@monomind/cli/dist/src/mcp-tools/swarm-tools.js +77 -0
  88. package/packages/@monomind/cli/dist/src/parser.js +11 -6
  89. package/packages/@monomind/cli/dist/src/routing/llm-caller.js +1 -2
  90. package/packages/@monomind/cli/package.json +2 -3
  91. package/packages/@monomind/cli/scripts/understand-analyze.mjs +1 -1
@@ -4,8 +4,9 @@
4
4
  *
5
5
  * github.com/monoes/monomind
6
6
  */
7
- import { existsSync, writeFileSync, mkdirSync, readFileSync, statSync } from 'fs';
8
- import { join, dirname, resolve } from 'path';
7
+ import { existsSync, writeFileSync, mkdirSync, readFileSync, statSync, readdirSync } from 'fs';
8
+ import { join, dirname, resolve, basename } from 'path';
9
+ import { homedir } from 'os';
9
10
  import { output } from '../output.js';
10
11
  export const SUPPORTED_PLATFORMS = [
11
12
  'claude', 'gemini', 'cursor', 'vscode', 'copilot',
@@ -18,20 +19,39 @@ const PLATFORM_CONFIG_FILES = {
18
19
  cursor: ['.cursorrules', '.cursor/rules/monomind.mdc'],
19
20
  vscode: ['.github/copilot-instructions.md'],
20
21
  copilot: ['.github/copilot-instructions.md'],
21
- opencode: ['AGENTS.md'],
22
+ opencode: ['OpenCode.md'],
22
23
  aider: ['.aider.conf.yml'],
23
24
  kiro: ['.kiro/steering/monomind.md'],
24
25
  trae: ['.trae/rules/monomind.md'],
25
26
  claw: ['.claw/config.md'],
26
27
  droid: ['DROID.md'],
27
- antigravity: ['.antigravity/config.md'],
28
+ antigravity: ['.agents/rules/monomind.md'],
28
29
  hermes: ['HERMES.md'],
29
30
  codex: ['AGENTS.md'],
30
31
  };
32
+ /**
33
+ * YAML/MDC frontmatter to prepend for platform rule files that require it.
34
+ * Cursor .mdc files use MDC YAML frontmatter; agy workspace rules use alwaysApply.
35
+ */
36
+ const FILE_FRONTMATTER = {
37
+ '.cursor/rules/monomind.mdc': [
38
+ '---',
39
+ 'description: Monomind monograph knowledge graph integration',
40
+ 'alwaysApply: true',
41
+ '---',
42
+ ].join('\n'),
43
+ '.agents/rules/monomind.md': [
44
+ '---',
45
+ 'name: monomind-integration',
46
+ 'alwaysApply: true',
47
+ 'description: Enable monomind monograph knowledge graph',
48
+ '---',
49
+ ].join('\n'),
50
+ };
31
51
  const MONOMIND_BLOCK_START = '<!-- monomind:start -->';
32
52
  const MONOMIND_BLOCK_END = '<!-- monomind:end -->';
33
- function getMonomindInstructions() {
34
- return `${MONOMIND_BLOCK_START}
53
+ function getMonomindInstructions(relPath) {
54
+ const body = `${MONOMIND_BLOCK_START}
35
55
  # Monograph Knowledge Graph
36
56
 
37
57
  This repository is indexed by Monograph. Before starting complex tasks:
@@ -40,8 +60,296 @@ This repository is indexed by Monograph. Before starting complex tasks:
40
60
  - Use \`monograph_impact\` to understand change blast radius
41
61
 
42
62
  Graph is at \`.monomind/monograph.db\`. Rebuild with: \`npx monograph build\`
63
+
64
+ # Mastermind Skills
65
+
66
+ If mastermind skills are installed, invoke the matching skill BEFORE any response or action.
67
+ Even a 1% chance a skill applies means you must check first.
68
+
69
+ Skills live in \`~/.agents/skills/\` (Codex/Gemini/Copilot/Cursor) or \`~/.claude/skills/\` (Claude Code).
70
+ Load the relevant \`SKILL.md\` before acting on any non-trivial task.
43
71
  ${MONOMIND_BLOCK_END}
44
72
  `;
73
+ const frontmatter = relPath ? FILE_FRONTMATTER[relPath] : undefined;
74
+ return frontmatter ? `${frontmatter}\n\n${body}` : body;
75
+ }
76
+ // The mastermind-activate script (embedded so setup can write it to platform-specific locations).
77
+ // Walks up from process.cwd() to find master.md, extracts the MASTERMIND PROTOCOL section,
78
+ // and writes it to stdout for SessionStart hook injection.
79
+ const MASTERMIND_ACTIVATE_SCRIPT = `'use strict';
80
+ const fs = require('fs');
81
+ const path = require('path');
82
+
83
+ function findMasterPath() {
84
+ const candidates = [];
85
+ if (process.env.CLAUDE_PROJECT_DIR) candidates.push(process.env.CLAUDE_PROJECT_DIR);
86
+ let dir = process.cwd();
87
+ for (let i = 0; i < 12; i++) {
88
+ candidates.push(dir);
89
+ const parent = path.dirname(dir);
90
+ if (parent === dir) break;
91
+ dir = parent;
92
+ }
93
+ for (const base of candidates) {
94
+ const p = path.join(base, '.claude', 'commands', 'mastermind', 'master.md');
95
+ if (fs.existsSync(p)) return p;
96
+ }
97
+ return null;
98
+ }
99
+
100
+ function extractProtocol(content) {
101
+ const marker = '\\n---\\n\\n**If $ARGUMENTS is empty:**';
102
+ const idx = content.indexOf(marker);
103
+ if (idx !== -1) return content.slice(0, idx).trim();
104
+ const fallback = content.indexOf('\\n**MASTERMIND** —');
105
+ if (fallback !== -1) return content.slice(0, fallback).trim();
106
+ return content.trim();
107
+ }
108
+
109
+ const masterPath = findMasterPath();
110
+ if (!masterPath) process.exit(0);
111
+
112
+ try {
113
+ let raw = fs.readFileSync(masterPath, 'utf8');
114
+ const body = raw.replace(/^---[\\s\\S]*?---\\s*/, '');
115
+ const protocol = extractProtocol(body);
116
+ if (protocol) process.stdout.write(protocol + '\\n');
117
+ } catch { process.exit(0); }
118
+ `;
119
+ // ──────────────────────────────────────────────────────────────
120
+ // Skills packaging helpers
121
+ // ──────────────────────────────────────────────────────────────
122
+ /** Walk up from cwd to find the mastermind commands directory. */
123
+ function findMastermindSourceDir() {
124
+ let dir = process.cwd();
125
+ for (let i = 0; i < 12; i++) {
126
+ const candidate = join(dir, '.claude', 'commands', 'mastermind');
127
+ if (existsSync(candidate))
128
+ return candidate;
129
+ const parent = dirname(dir);
130
+ if (parent === dir)
131
+ break;
132
+ dir = parent;
133
+ }
134
+ return null;
135
+ }
136
+ /**
137
+ * Copy mastermind skill files into targetDir as <skill-name>/SKILL.md packages.
138
+ * Files starting with _ are internal helpers and are skipped.
139
+ * master.md → targetDir/mastermind/SKILL.md (root routing skill)
140
+ * build.md → targetDir/mastermind-build/SKILL.md
141
+ *
142
+ * Also copies the references/ subdir alongside mastermind/SKILL.md so
143
+ * platforms that follow relative links (e.g. agy's antigravity-tools.md) can resolve them.
144
+ */
145
+ function installMastermindSkills(targetDir, sourceDir) {
146
+ const written = [];
147
+ const files = readdirSync(sourceDir).filter(f => f.endsWith('.md') && !f.startsWith('_'));
148
+ for (const file of files) {
149
+ const name = basename(file, '.md');
150
+ const skillDir = name === 'master'
151
+ ? join(targetDir, 'mastermind')
152
+ : join(targetDir, `mastermind-${name}`);
153
+ const destFile = join(skillDir, 'SKILL.md');
154
+ if (!existsSync(destFile)) {
155
+ mkdirSync(skillDir, { recursive: true });
156
+ const content = readFileSync(join(sourceDir, file), 'utf8');
157
+ writeFileSync(destFile, content, 'utf8');
158
+ written.push(destFile);
159
+ }
160
+ // Copy references/ alongside the mastermind umbrella skill (checked independently)
161
+ if (name === 'master') {
162
+ const refSrc = join(sourceDir, 'references');
163
+ if (existsSync(refSrc)) {
164
+ const refDest = join(skillDir, 'references');
165
+ mkdirSync(refDest, { recursive: true });
166
+ for (const ref of readdirSync(refSrc).filter(f => f.endsWith('.md'))) {
167
+ const destRef = join(refDest, ref);
168
+ if (!existsSync(destRef)) {
169
+ writeFileSync(destRef, readFileSync(join(refSrc, ref), 'utf8'), 'utf8');
170
+ written.push(destRef);
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ return written;
177
+ }
178
+ // ──────────────────────────────────────────────────────────────
179
+ // Global setup helpers (platform-specific, user-level config)
180
+ // ──────────────────────────────────────────────────────────────
181
+ function setupCodex(activateScriptPath) {
182
+ const home = homedir();
183
+ const codexDir = join(home, '.codex');
184
+ mkdirSync(codexDir, { recursive: true });
185
+ // Write the activate script
186
+ writeFileSync(activateScriptPath, MASTERMIND_ACTIVATE_SCRIPT, 'utf8');
187
+ // Merge a [[hooks]] entry into ~/.codex/config.toml
188
+ const configPath = join(codexDir, 'config.toml');
189
+ const hookBlock = [
190
+ '',
191
+ '# monomind:start',
192
+ '[[hooks]]',
193
+ 'event = "SessionStart"',
194
+ 'matcher = ""',
195
+ '[[hooks.hooks]]',
196
+ 'type = "command"',
197
+ `command = "node ${activateScriptPath}"`,
198
+ 'statusMessage = "Loading mastermind protocol"',
199
+ 'timeout = 5000',
200
+ '# monomind:end',
201
+ ].join('\n');
202
+ let config = existsSync(configPath) ? readFileSync(configPath, 'utf8') : '';
203
+ const written = [];
204
+ if (!config.includes('# monomind:start')) {
205
+ writeFileSync(configPath, config + hookBlock, 'utf8');
206
+ written.push(configPath, activateScriptPath);
207
+ }
208
+ // Install mastermind skills to ~/.agents/skills/ (shared cross-runtime dir)
209
+ const sourceDir = findMastermindSourceDir();
210
+ if (sourceDir) {
211
+ const skillsDir = join(home, '.agents', 'skills');
212
+ written.push(...installMastermindSkills(skillsDir, sourceDir));
213
+ }
214
+ return written;
215
+ }
216
+ function setupCursor(activateScriptPath, repoPath) {
217
+ // Write the activate script to ~/.cursor/
218
+ writeFileSync(activateScriptPath, MASTERMIND_ACTIVATE_SCRIPT, 'utf8');
219
+ // Merge SessionStart hook into .cursor/settings.json (project-level)
220
+ const settingsPath = join(repoPath, '.cursor', 'settings.json');
221
+ mkdirSync(dirname(settingsPath), { recursive: true });
222
+ let settings = {};
223
+ if (existsSync(settingsPath)) {
224
+ try {
225
+ settings = JSON.parse(readFileSync(settingsPath, 'utf8'));
226
+ }
227
+ catch { /* keep empty */ }
228
+ }
229
+ const hooks = settings['hooks'] ?? {};
230
+ const sessionStart = hooks['SessionStart'] ?? [];
231
+ const alreadyAdded = sessionStart.some((h) => typeof h === 'object' && h !== null &&
232
+ h['hooks']?.some?.((inner) => typeof inner === 'object' && inner !== null &&
233
+ inner['command']?.includes('monomind-activate')));
234
+ const written = [];
235
+ if (!alreadyAdded) {
236
+ sessionStart.push({
237
+ matcher: '',
238
+ hooks: [{ type: 'command', command: `node "${activateScriptPath}"`, timeout: 5000 }],
239
+ });
240
+ hooks['SessionStart'] = sessionStart;
241
+ settings['hooks'] = hooks;
242
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
243
+ written.push(settingsPath, activateScriptPath);
244
+ }
245
+ // Install mastermind skills to ~/.agents/skills/ (Cursor shares the cross-runtime dir)
246
+ const sourceDir = findMastermindSourceDir();
247
+ if (sourceDir) {
248
+ const skillsDir = join(homedir(), '.agents', 'skills');
249
+ written.push(...installMastermindSkills(skillsDir, sourceDir));
250
+ }
251
+ return written;
252
+ }
253
+ function setupAntigravity() {
254
+ const home = homedir();
255
+ const pluginDir = join(home, '.gemini', 'antigravity-cli', 'plugins', 'monomind');
256
+ const rulesDir = join(pluginDir, 'rules');
257
+ mkdirSync(rulesDir, { recursive: true });
258
+ const pluginJson = join(pluginDir, 'plugin.json');
259
+ const ruleFile = join(rulesDir, 'mastermind.md');
260
+ const written = [];
261
+ if (!existsSync(pluginJson)) {
262
+ writeFileSync(pluginJson, JSON.stringify({
263
+ name: 'monomind',
264
+ version: '1.0.0',
265
+ description: 'Monomind monograph knowledge graph and mastermind skills for Antigravity CLI',
266
+ }, null, 2), 'utf8');
267
+ written.push(pluginJson);
268
+ }
269
+ if (!existsSync(ruleFile)) {
270
+ writeFileSync(ruleFile, [
271
+ '---',
272
+ 'name: monomind-integration',
273
+ 'alwaysApply: true',
274
+ 'description: Enable monomind monograph and mastermind skills',
275
+ '---',
276
+ '',
277
+ '# Monomind Integration',
278
+ '',
279
+ 'This project uses Monograph for knowledge graph navigation.',
280
+ 'Before starting complex tasks, use `view_file` on `.monomind/monograph.db` context',
281
+ 'and invoke the relevant mastermind skill SKILL.md before acting.',
282
+ '',
283
+ '## Monograph',
284
+ '- `monograph_query` — BM25 search the knowledge graph',
285
+ '- `monograph_impact` — blast radius before any change',
286
+ '- `monograph_neighbors` — explore dependencies',
287
+ '',
288
+ '## Mastermind Skills',
289
+ 'Check `~/.gemini/skills/` for installed mastermind skills.',
290
+ 'Load SKILL.md with `view_file` (IsSkillFile: true) before acting on non-trivial tasks.',
291
+ ].join('\n'), 'utf8');
292
+ written.push(ruleFile);
293
+ }
294
+ // Install mastermind skills to ~/.gemini/skills/ (agy's skill dir)
295
+ const sourceDir = findMastermindSourceDir();
296
+ if (sourceDir) {
297
+ const skillsDir = join(home, '.gemini', 'skills');
298
+ written.push(...installMastermindSkills(skillsDir, sourceDir));
299
+ }
300
+ return written;
301
+ }
302
+ async function handleSetup(ctx) {
303
+ const platform = ctx.flags['platform'];
304
+ const all = ctx.flags['all'];
305
+ let repoPath;
306
+ try {
307
+ repoPath = resolveRepoPath(ctx.flags['path'] ?? '.');
308
+ }
309
+ catch (err) {
310
+ output.error(`Invalid --path: ${err instanceof Error ? err.message : String(err)}`);
311
+ return { success: false, exitCode: 1 };
312
+ }
313
+ if (!platform && !all) {
314
+ output.error('Specify --platform <name> or --all');
315
+ output.info(`Platforms with global setup: cursor, codex, antigravity`);
316
+ return { success: false, exitCode: 1 };
317
+ }
318
+ const targets = all ? [...SUPPORTED_PLATFORMS] : [platform];
319
+ const home = homedir();
320
+ let totalFiles = 0;
321
+ for (const p of targets) {
322
+ let written = [];
323
+ try {
324
+ if (p === 'codex') {
325
+ written = setupCodex(join(home, '.codex', 'monomind-activate.cjs'));
326
+ }
327
+ else if (p === 'cursor') {
328
+ written = setupCursor(join(home, '.cursor', 'monomind-activate.cjs'), repoPath);
329
+ }
330
+ else if (p === 'antigravity') {
331
+ written = setupAntigravity();
332
+ }
333
+ else {
334
+ output.info(`[${p}] No global setup needed — use \`platforms install\``);
335
+ continue;
336
+ }
337
+ }
338
+ catch (err) {
339
+ output.error(`[${p}] Setup failed: ${err instanceof Error ? err.message : String(err)}`);
340
+ continue;
341
+ }
342
+ if (written.length > 0) {
343
+ for (const f of written)
344
+ output.success(`[${p}] ✓ ${f}`);
345
+ totalFiles += written.length;
346
+ }
347
+ else {
348
+ output.info(`[${p}] Already set up — skipped`);
349
+ }
350
+ }
351
+ output.success(`Done. ${totalFiles} file(s) written.`);
352
+ return { success: true };
45
353
  }
46
354
  /**
47
355
  * Maximum size for a platform config file we will read or append to.
@@ -87,9 +395,9 @@ function assertWithinRoot(fullPath, repoRoot) {
87
395
  }
88
396
  function installPlatform(platform, repoPath) {
89
397
  const files = PLATFORM_CONFIG_FILES[platform];
90
- const instructions = getMonomindInstructions();
91
398
  const written = [];
92
399
  for (const relPath of files) {
400
+ const instructions = getMonomindInstructions(relPath);
93
401
  const fullPath = resolve(join(repoPath, relPath));
94
402
  assertWithinRoot(fullPath, repoPath);
95
403
  const dir = dirname(fullPath);
@@ -268,9 +576,21 @@ export const platformsCommand = {
268
576
  ],
269
577
  action: handleUninstall,
270
578
  },
579
+ {
580
+ name: 'setup',
581
+ description: 'Write global (user-level) SessionStart hooks and plugin packages for cursor, codex, and antigravity',
582
+ options: platformOptions,
583
+ examples: [
584
+ { command: 'monomind platforms setup --platform codex', description: 'Wire SessionStart hook into ~/.codex/config.toml' },
585
+ { command: 'monomind platforms setup --platform cursor', description: 'Wire SessionStart hook into .cursor/settings.json' },
586
+ { command: 'monomind platforms setup --platform antigravity', description: 'Install monomind plugin into ~/.gemini/antigravity-cli/plugins/' },
587
+ ],
588
+ action: handleSetup,
589
+ },
271
590
  ],
272
591
  examples: [
273
592
  { command: 'monomind platforms install --all', description: 'Install Monograph context for all platforms' },
593
+ { command: 'monomind platforms setup --platform codex', description: 'Wire Codex SessionStart hook (run once per machine)' },
274
594
  { command: 'monomind platforms uninstall --platform cursor', description: 'Remove context from Cursor config' },
275
595
  ],
276
596
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Security CVE command — NVD/OSV lookups and npm audit vulnerability listing
3
+ */
4
+ import type { Command } from '../types.js';
5
+ export declare const cveCommand: Command;
6
+ //# sourceMappingURL=security-cve.d.ts.map