claude-flow 3.74.0 → 3.75.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 (93) hide show
  1. package/.claude/helpers/auto-memory-hook.mjs +262 -81
  2. package/node_modules/@claude-flow/codex/README.md +38 -0
  3. package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts +1 -0
  4. package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts.map +1 -1
  5. package/node_modules/@claude-flow/codex/dist/generators/agents-md.js +4 -4
  6. package/node_modules/@claude-flow/codex/dist/generators/agents-md.js.map +1 -1
  7. package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.d.ts +20 -0
  8. package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.d.ts.map +1 -0
  9. package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.js +104 -0
  10. package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.js.map +1 -0
  11. package/node_modules/@claude-flow/codex/dist/generators/index.d.ts +2 -0
  12. package/node_modules/@claude-flow/codex/dist/generators/index.d.ts.map +1 -1
  13. package/node_modules/@claude-flow/codex/dist/generators/index.js +2 -0
  14. package/node_modules/@claude-flow/codex/dist/generators/index.js.map +1 -1
  15. package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.d.ts +46 -0
  16. package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.d.ts.map +1 -0
  17. package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.js +162 -0
  18. package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.js.map +1 -0
  19. package/node_modules/@claude-flow/codex/dist/index.d.ts +3 -3
  20. package/node_modules/@claude-flow/codex/dist/index.js +1 -1
  21. package/node_modules/@claude-flow/codex/dist/initializer.d.ts.map +1 -1
  22. package/node_modules/@claude-flow/codex/dist/initializer.js +16 -93
  23. package/node_modules/@claude-flow/codex/dist/initializer.js.map +1 -1
  24. package/node_modules/@claude-flow/codex/package.json +8 -6
  25. package/node_modules/@claude-flow/mcp/README.md +44 -0
  26. package/node_modules/@claude-flow/mcp/package.json +16 -4
  27. package/package.json +4 -4
  28. package/v3/@claude-flow/cli/catalog-manifest.json +3 -3
  29. package/v3/@claude-flow/cli/dist/src/autopilot-state.js +17 -8
  30. package/v3/@claude-flow/cli/dist/src/commands/agent.js +2 -1
  31. package/v3/@claude-flow/cli/dist/src/commands/init.js +28 -6
  32. package/v3/@claude-flow/cli/dist/src/commands/memory-backup.js +2 -1
  33. package/v3/@claude-flow/cli/dist/src/commands/memory-distill.js +2 -1
  34. package/v3/@claude-flow/cli/dist/src/commands/memory.js +47 -3
  35. package/v3/@claude-flow/cli/dist/src/commands/neural.js +6 -5
  36. package/v3/@claude-flow/cli/dist/src/commands/plugins-host.d.ts +13 -0
  37. package/v3/@claude-flow/cli/dist/src/commands/plugins-host.js +161 -0
  38. package/v3/@claude-flow/cli/dist/src/commands/plugins.js +3 -1
  39. package/v3/@claude-flow/cli/dist/src/commands/start-all.d.ts +28 -0
  40. package/v3/@claude-flow/cli/dist/src/commands/start-all.js +99 -0
  41. package/v3/@claude-flow/cli/dist/src/commands/start.d.ts +5 -1
  42. package/v3/@claude-flow/cli/dist/src/commands/start.js +17 -10
  43. package/v3/@claude-flow/cli/dist/src/commands/swarm.js +2 -1
  44. package/v3/@claude-flow/cli/dist/src/fs-secure.js +9 -2
  45. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +15 -0
  46. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +64 -114
  47. package/v3/@claude-flow/cli/dist/src/init/dual-instructions.d.ts +29 -0
  48. package/v3/@claude-flow/cli/dist/src/init/dual-instructions.js +87 -0
  49. package/v3/@claude-flow/cli/dist/src/init/executor.js +96 -13
  50. package/v3/@claude-flow/cli/dist/src/init/index.d.ts +3 -1
  51. package/v3/@claude-flow/cli/dist/src/init/index.js +5 -1
  52. package/v3/@claude-flow/cli/dist/src/init/plugin-dedup.d.ts +61 -0
  53. package/v3/@claude-flow/cli/dist/src/init/plugin-dedup.js +130 -0
  54. package/v3/@claude-flow/cli/dist/src/init/shared-instructions.d.ts +46 -0
  55. package/v3/@claude-flow/cli/dist/src/init/shared-instructions.js +162 -0
  56. package/v3/@claude-flow/cli/dist/src/init/types.d.ts +33 -0
  57. package/v3/@claude-flow/cli/dist/src/init/types.js +3 -0
  58. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts +14 -0
  59. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +48 -5
  60. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-hierarchical-inventory-tools.d.ts +15 -0
  61. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-hierarchical-inventory-tools.js +115 -0
  62. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-inventory-tools.d.ts +21 -0
  63. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-inventory-tools.js +152 -0
  64. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +56 -7
  65. package/v3/@claude-flow/cli/dist/src/mcp-tools/aidefence-known-misses.d.ts +6 -0
  66. package/v3/@claude-flow/cli/dist/src/mcp-tools/aidefence-known-misses.js +23 -5
  67. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +21 -3
  68. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts +29 -0
  69. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +239 -19
  70. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js +53 -5
  71. package/v3/@claude-flow/cli/dist/src/memory/embedding-config.d.ts +79 -0
  72. package/v3/@claude-flow/cli/dist/src/memory/embedding-config.js +250 -0
  73. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js +2 -1
  74. package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts +28 -2
  75. package/v3/@claude-flow/cli/dist/src/memory/intelligence.js +37 -7
  76. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +42 -0
  77. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +267 -28
  78. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +1 -1
  79. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +47 -22
  80. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js +3 -2
  81. package/v3/@claude-flow/cli/dist/src/ruvector/task-embedder.d.ts +2 -1
  82. package/v3/@claude-flow/cli/dist/src/ruvector/task-embedder.js +7 -3
  83. package/v3/@claude-flow/cli/dist/src/services/daemon-autostart.d.ts +4 -6
  84. package/v3/@claude-flow/cli/dist/src/services/daemon-autostart.js +6 -46
  85. package/v3/@claude-flow/cli/dist/src/services/host-executable.d.ts +68 -0
  86. package/v3/@claude-flow/cli/dist/src/services/host-executable.js +175 -0
  87. package/v3/@claude-flow/cli/dist/src/services/host-plugin-manager.d.ts +137 -0
  88. package/v3/@claude-flow/cli/dist/src/services/host-plugin-manager.js +374 -0
  89. package/v3/@claude-flow/cli/dist/src/services/project-root.d.ts +37 -0
  90. package/v3/@claude-flow/cli/dist/src/services/project-root.js +122 -0
  91. package/v3/@claude-flow/cli/package.json +7 -7
  92. package/.claude/.proven-config-version +0 -1
  93. package/.claude/proven-config.json +0 -42
@@ -10,6 +10,10 @@
10
10
  * node auto-memory-hook.mjs sync # SessionEnd: sync insights back to MEMORY.md
11
11
  * node auto-memory-hook.mjs status # Show bridge status
12
12
  * node auto-memory-hook.mjs read <namespace> <key> # Read-only exact lookup, prints JSON
13
+ * node auto-memory-hook.mjs read --all <namespace> <key> # Read-only: every match + multiplicity
14
+ * node auto-memory-hook.mjs read-id <id> # Read-only lookup by entry id
15
+ * node auto-memory-hook.mjs dedupe <namespace> <key> [--keep <id>] [--apply]
16
+ * # Dry run unless --apply: keep one entry for the key
13
17
  *
14
18
  * import and sync exit 1 when they fail (never 2, which Claude Code treats as
15
19
  * "block"), so a failed write is visible without stopping the session.
@@ -17,9 +21,10 @@
17
21
 
18
22
  import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync, unlinkSync, rmdirSync, rmSync, statSync } from 'fs';
19
23
  import { execFileSync } from 'child_process';
24
+ import { createRequire } from 'module';
20
25
  import { homedir } from 'os';
21
26
  import { join, dirname, resolve, sep } from 'path';
22
- import { fileURLToPath } from 'url';
27
+ import { fileURLToPath, pathToFileURL } from 'url';
23
28
 
24
29
  const __filename = fileURLToPath(import.meta.url);
25
30
  const __dirname = dirname(__filename);
@@ -51,12 +56,13 @@ const dim = (msg) => console.log(` ${DIM}${msg}${RESET}`);
51
56
  // be resolved, self-learning imports are a no-op — the user must see this and be
52
57
  // told exactly how to fix it (on both stdout, so it shows in the Claude Code hook
53
58
  // transcript, and stderr, per the issue's requested channel).
54
- function warnMemoryUnavailable() {
59
+ function warnMemoryUnavailable(searched = []) {
55
60
  const line1 = `[AutoMemory] @claude-flow/memory not resolvable from ${MODULE_ROOT} — self-learning imports are DISABLED.`;
56
61
  const line2 = ' Fix: npm i -D @claude-flow/memory (or re-run: npx ruflo@latest init, then npx ruflo@latest doctor --fix)';
57
- console.log(`${YELLOW}${line1}${RESET}`);
58
- console.log(`${YELLOW}${line2}${RESET}`);
59
- process.stderr.write(`${line1}\n${line2}\n`);
62
+ // #4851: name every place the resolver looked, so the cause is visible.
63
+ const lines = [line1, line2, ...(searched.length ? [' Searched:', ...searched.map((s) => ` - ${s}`)] : [])];
64
+ for (const l of lines) console.log(`${YELLOW}${l}${RESET}`);
65
+ process.stderr.write(lines.join('\n') + '\n');
60
66
  }
61
67
 
62
68
  const DEBUG = !!(process.env.RUFLO_DEBUG || process.env.DEBUG);
@@ -361,57 +367,118 @@ class JsonFileBackend {
361
367
  // Resolve memory package path (local dev or npm installed)
362
368
  // ============================================================================
363
369
 
364
- async function loadMemoryPackage() {
365
- // Strategy 0 (#2545): sidecar recorded by `init` / `doctor --fix`. On the
366
- // documented `npx ruflo` path @claude-flow/memory (an optionalDependency of
367
- // the CLI) lands in the npx cache, which is NOT on the walk-up path from the
368
- // project — so init resolves it from the CLI's own context and records the
369
- // absolute path here. This is the only strategy that works on that install.
370
+ // #4851: SessionStart runs this helper directly, so it must find the package
371
+ // itself when the sidecar written by init / upgrade / doctor is missing (a
372
+ // fresh worktree: .claude-flow/ is gitignored) or stale. Every candidate comes
373
+ // from MODULE_ROOT or the helper's own location, never CLAUDE_PROJECT_DIR, and
374
+ // is used only if it exports AutoMemoryBridge. No network, no install.
375
+ const MEMORY_PKG = '@claude-flow/memory';
376
+ const SIDECAR_PATH = join(MODULE_ROOT, '.claude-flow', 'memory-package.json');
377
+ // Packages that carry @claude-flow/memory as a dependency; ruflo and
378
+ // claude-flow reach it through their own @claude-flow/cli.
379
+ const CLI_HOSTS = [['@claude-flow/cli'], ['ruflo', '@claude-flow/cli'], ['claude-flow', '@claude-flow/cli']];
380
+
381
+ function sidecarDistPath(file) {
370
382
  try {
371
- const sidecar = join(MODULE_ROOT, '.claude-flow', 'memory-package.json');
372
- if (existsSync(sidecar)) {
373
- const rec = JSON.parse(readFileSync(sidecar, 'utf-8'));
374
- if (rec?.distPath && existsSync(rec.distPath)) {
375
- return await import(`file://${rec.distPath}`);
376
- }
377
- }
378
- } catch { /* fall through */ }
383
+ const rec = JSON.parse(readFileSync(file, 'utf-8'));
384
+ return rec && typeof rec.distPath === 'string' && rec.distPath ? rec.distPath : null;
385
+ } catch { return null; }
386
+ }
379
387
 
380
- // Strategy 1: Local dev (built dist)
381
- const localDist = join(MODULE_ROOT, 'v3/@claude-flow/memory/dist/index.js');
382
- if (existsSync(localDist)) {
383
- try {
384
- return await import(`file://${localDist}`);
385
- } catch { /* fall through */ }
388
+ /** require.resolve(spec) as if called from a module in `dir`, or null. */
389
+ function resolveFrom(dir, spec) {
390
+ try { return createRequire(join(dir, 'package.json')).resolve(spec); } catch { return null; }
391
+ }
392
+
393
+ /** The package.json of `name` as seen from `dir`: require.resolve, then a node_modules walk-up. */
394
+ function packageJsonFrom(dir, name) {
395
+ const viaRequire = resolveFrom(dir, `${name}/package.json`);
396
+ if (viaRequire) return viaRequire;
397
+ for (let d = resolve(dir); ; d = dirname(d)) {
398
+ const candidate = join(d, 'node_modules', ...name.split('/'), 'package.json');
399
+ if (existsSync(candidate)) return candidate;
400
+ if (dirname(d) === d) return null;
386
401
  }
402
+ }
387
403
 
388
- // Strategy 2: Use createRequire for CJS-style resolution (handles nested node_modules
389
- // when installed as a transitive dependency via npx ruflo / npx @claude-flow/cli@latest)
390
- try {
391
- const { createRequire } = await import('module');
392
- const require = createRequire(join(MODULE_ROOT, 'package.json'));
393
- return require('@claude-flow/memory');
394
- } catch { /* fall through */ }
404
+ /**
405
+ * The CLI's own module context, which is where recordMemoryPackagePath()
406
+ * resolves from: find the installed @claude-flow/cli (directly or under ruflo /
407
+ * claude-flow) and require.resolve the memory package from there.
408
+ */
409
+ function memoryFromCliPackage(dir) {
410
+ for (const chain of CLI_HOSTS) {
411
+ let pkgJson = packageJsonFrom(dir, chain[0]);
412
+ for (let i = 1; pkgJson && i < chain.length; i++) pkgJson = packageJsonFrom(dirname(pkgJson), chain[i]);
413
+ const found = pkgJson && resolveFrom(dirname(pkgJson), MEMORY_PKG);
414
+ if (found) return found;
415
+ }
416
+ return null;
417
+ }
395
418
 
396
- // Strategy 3: ESM import (works when @claude-flow/memory is a direct dependency)
419
+ /** The resolution strategies, in order; each find() yields a dist path or null. */
420
+ function memoryCandidates() {
421
+ const list = [{ source: 'sidecar', label: `sidecar ${SIDECAR_PATH}`, find: () => sidecarDistPath(SIDECAR_PATH) }];
422
+ // A fresh git worktree has no sidecar of its own, but its main checkout usually does.
423
+ const main = mainCheckoutRoot(MODULE_ROOT);
424
+ if (main) {
425
+ const mainSidecar = join(main, '.claude-flow', 'memory-package.json');
426
+ list.push({ source: 'main-checkout-sidecar', label: `sidecar ${mainSidecar}`, find: () => sidecarDistPath(mainSidecar) });
427
+ }
428
+ const localDist = join(MODULE_ROOT, 'v3/@claude-flow/memory/dist/index.js');
429
+ list.push(
430
+ { source: 'local-dist', label: localDist, find: () => (existsSync(localDist) ? localDist : null) },
431
+ { source: 'project-root', label: `require.resolve from ${MODULE_ROOT}`, find: () => resolveFrom(MODULE_ROOT, MEMORY_PKG) },
432
+ { source: 'helper-dir', label: `require.resolve from ${__dirname}`, find: () => resolveFrom(__dirname, MEMORY_PKG) },
433
+ { source: 'cli-package', label: `@claude-flow/cli dependencies from ${MODULE_ROOT}`, find: () => memoryFromCliPackage(MODULE_ROOT) },
434
+ { source: 'cli-package', label: `@claude-flow/cli dependencies from ${__dirname}`, find: () => memoryFromCliPackage(__dirname) },
435
+ );
436
+ return list;
437
+ }
438
+
439
+ function memoryPackageVersion(distPath) {
440
+ try { return JSON.parse(readFileSync(resolve(dirname(distPath), '..', 'package.json'), 'utf-8')).version ?? null; } catch { return null; }
441
+ }
442
+
443
+ /** Same record shape as recordMemoryPackagePath(). Best effort, atomic. */
444
+ function recordSidecar(distPath) {
397
445
  try {
398
- return await import('@claude-flow/memory');
399
- } catch { /* fall through */ }
400
-
401
- // Strategy 4: Walk up from MODULE_ROOT looking for @claude-flow/memory in any node_modules
402
- let searchDir = MODULE_ROOT;
403
- const { parse } = await import('path');
404
- while (searchDir !== parse(searchDir).root) {
405
- const candidate = join(searchDir, 'node_modules', '@claude-flow', 'memory', 'dist', 'index.js');
406
- if (existsSync(candidate)) {
407
- try {
408
- return await import(`file://${candidate}`);
409
- } catch { /* fall through */ }
446
+ mkdirSync(dirname(SIDECAR_PATH), { recursive: true });
447
+ const record = { distPath, version: memoryPackageVersion(distPath), resolvedBy: 'auto-memory-hook', resolvedAt: new Date().toISOString() };
448
+ writeFileAtomic(SIDECAR_PATH, JSON.stringify(record, null, 2));
449
+ return true;
450
+ } catch { return false; }
451
+ }
452
+
453
+ /**
454
+ * Returns { pkg, distPath, source, searched }. pkg is null when no candidate
455
+ * exports AutoMemoryBridge, and `searched` then lists every place tried and why
456
+ * it failed. With record: true, a package found anywhere but this helper's own
457
+ * sidecar is written to that sidecar, so the next session takes the fast path.
458
+ */
459
+ async function resolveMemoryPackage({ record = false } = {}) {
460
+ const searched = [];
461
+ const tried = new Set();
462
+ for (const c of memoryCandidates()) {
463
+ let distPath = null;
464
+ try { distPath = c.find(); } catch { /* treated as not found */ }
465
+ if (!distPath) { searched.push(`${c.label}: not found`); continue; }
466
+ if (tried.has(distPath)) continue;
467
+ tried.add(distPath);
468
+ if (!existsSync(distPath)) { searched.push(`${c.label}: ${distPath} does not exist`); continue; }
469
+ let pkg;
470
+ try { pkg = await import(pathToFileURL(distPath).href); } catch (e) {
471
+ searched.push(`${c.label}: ${distPath} failed to load (${e && e.message ? e.message : e})`);
472
+ continue;
473
+ }
474
+ if (!pkg || typeof pkg.AutoMemoryBridge !== 'function') {
475
+ searched.push(`${c.label}: ${distPath} has no AutoMemoryBridge export`);
476
+ continue;
410
477
  }
411
- searchDir = dirname(searchDir);
478
+ if (record && c.source !== 'sidecar') recordSidecar(distPath);
479
+ return { pkg, distPath, source: c.source, searched };
412
480
  }
413
-
414
- return null;
481
+ return { pkg: null, distPath: null, source: null, searched };
415
482
  }
416
483
 
417
484
  // ============================================================================
@@ -458,9 +525,9 @@ function readConfig() {
458
525
  async function doImport() {
459
526
  log('Importing auto memory files into bridge...');
460
527
 
461
- const memPkg = await loadMemoryPackage();
462
- if (!memPkg || !memPkg.AutoMemoryBridge) {
463
- warnMemoryUnavailable();
528
+ const { pkg: memPkg, searched } = await resolveMemoryPackage({ record: true });
529
+ if (!memPkg) {
530
+ warnMemoryUnavailable(searched);
464
531
  return;
465
532
  }
466
533
 
@@ -544,9 +611,9 @@ async function doSync() {
544
611
  return;
545
612
  }
546
613
 
547
- const memPkg = await loadMemoryPackage();
548
- if (!memPkg || !memPkg.AutoMemoryBridge) {
549
- warnMemoryUnavailable();
614
+ const { pkg: memPkg, searched } = await resolveMemoryPackage({ record: true });
615
+ if (!memPkg) {
616
+ warnMemoryUnavailable(searched);
550
617
  return;
551
618
  }
552
619
 
@@ -609,15 +676,16 @@ async function doSync() {
609
676
  }
610
677
 
611
678
  async function doStatus() {
612
- const memPkg = await loadMemoryPackage();
679
+ // Read-only: status reports where the package resolves but never records it.
680
+ const { pkg: memPkg, distPath, source } = await resolveMemoryPackage();
613
681
  const config = readConfig();
614
682
 
615
- const sidecar = join(MODULE_ROOT, '.claude-flow', 'memory-package.json');
616
- const hasSidecar = existsSync(sidecar);
683
+ const hasSidecar = existsSync(SIDECAR_PATH);
617
684
 
618
685
  console.log('\n=== Auto Memory Bridge Status ===\n');
619
686
  console.log(` Package: ${memPkg ? '✅ Available' : '❌ Not found — self-learning DISABLED (fix: npm i -D @claude-flow/memory)'}`);
620
- console.log(` Resolver: ${hasSidecar ? '✅ .claude-flow/memory-package.json' : '⏸ no sidecar (run: npx ruflo@latest doctor --fix)'}`);
687
+ if (memPkg) console.log(` Resolved via: ${source} (${distPath})`);
688
+ console.log(` Resolver: ${hasSidecar ? '✅ .claude-flow/memory-package.json' : memPkg ? '⏸ no sidecar yet (the next import records one)' : '⏸ no sidecar (run: npx ruflo@latest doctor --fix)'}`);
621
689
  console.log(` Store: ${existsSync(STORE_PATH) ? '✅ ' + STORE_PATH : '⏸ Not initialized'}`);
622
690
  console.log(` LearningBridge: ${config.learningBridge.enabled ? '✅ Enabled' : '⏸ Disabled'}`);
623
691
  console.log(` MemoryGraph: ${config.memoryGraph.enabled ? '✅ Enabled' : '⏸ Disabled'}`);
@@ -633,32 +701,143 @@ async function doStatus() {
633
701
  console.log('');
634
702
  }
635
703
 
636
- // Read-only exact lookup (#4685). It never loads the memory package, creates a
637
- // directory, takes the write lock or calls shutdown, so it cannot change the store.
704
+ // Read-only lookups (#4685, #4852). They never load the memory package, create
705
+ // a directory, take the write lock or call shutdown, so they cannot change the store.
638
706
  const READ_SCHEMA_VERSION = 1;
639
- async function doRead(namespace, key) {
640
- const out = { schemaVersion: READ_SCHEMA_VERSION, store: STORE_PATH, storePresent: false, namespace: namespace ?? null, key: key ?? null, found: false, entry: null };
641
- const refuse = (code, message) => {
642
- out.error = { code, message };
643
- console.log(JSON.stringify(out, null, 2));
644
- return 1;
645
- };
707
+
708
+ /** Print the JSON result; a refusal adds `error` and returns exit code 1. */
709
+ function emit(out, code, message, extra) {
710
+ if (code) out.error = { code, message, ...extra };
711
+ console.log(JSON.stringify(out, null, 2));
712
+ return code ? 1 : 0;
713
+ }
714
+
715
+ /** Load the store read-only into out.storePresent; returns the entries, or a StoreError. */
716
+ function loadStoreForRead(out) {
717
+ try {
718
+ const data = readStoreFile(STORE_PATH);
719
+ out.storePresent = data !== null;
720
+ return data || [];
721
+ } catch (err) {
722
+ out.storePresent = true; // readStoreFile only throws for a file that exists
723
+ return err;
724
+ }
725
+ }
726
+
727
+ const keyMatches = (entries, namespace, key) => entries.filter((e) => e.namespace === namespace && e.key === key);
728
+ /** What a refusal or dry run shows about an entry: enough to choose between duplicates. */
729
+ const describeEntry = (e) => ({ id: e.id, createdAt: e.createdAt ?? null, updatedAt: e.updatedAt ?? null });
730
+
731
+ // `read <ns> <key>` returns the single match. `read --all <ns> <key>` returns
732
+ // every match with its multiplicity, so a duplicated key can be inspected.
733
+ async function doRead(args) {
734
+ const all = args.includes('--all');
735
+ const [namespace, key] = args.filter((a) => a !== '--all');
736
+ const out = { schemaVersion: READ_SCHEMA_VERSION, store: STORE_PATH, storePresent: false, namespace: namespace ?? null, key: key ?? null };
737
+ if (all) Object.assign(out, { multiplicity: 0, entries: [] });
738
+ else Object.assign(out, { found: false, entry: null });
646
739
  if (typeof namespace !== 'string' || !namespace || typeof key !== 'string' || !key) {
647
- return refuse('USAGE', 'usage: auto-memory-hook.mjs read <namespace> <key>');
740
+ return emit(out, 'USAGE', 'usage: auto-memory-hook.mjs read [--all] <namespace> <key>');
741
+ }
742
+ const entries = loadStoreForRead(out);
743
+ if (entries instanceof Error) return emit(out, entries.code || 'STORE_READ_FAILED', entries.message);
744
+ const matches = keyMatches(entries, namespace, key);
745
+ if (all) {
746
+ out.multiplicity = matches.length;
747
+ out.entries = matches;
748
+ return emit(out);
749
+ }
750
+ if (matches.length > 1) {
751
+ // #4852: name the entries, so the caller can pick one with read-id or dedupe.
752
+ return emit(out, 'AMBIGUOUS_KEY',
753
+ `${matches.length} entries share namespace ${JSON.stringify(namespace)} and key ${JSON.stringify(key)}; inspect them with read --all or read-id, or collapse them with dedupe`,
754
+ { matches: matches.map(describeEntry) });
755
+ }
756
+ if (matches.length === 1) { out.found = true; out.entry = matches[0]; }
757
+ return emit(out);
758
+ }
759
+
760
+ // `read-id <id>` returns the entry with that id, whatever its key.
761
+ async function doReadId(args) {
762
+ const [id] = args;
763
+ const out = { schemaVersion: READ_SCHEMA_VERSION, store: STORE_PATH, storePresent: false, id: id ?? null, found: false, entry: null };
764
+ if (typeof id !== 'string' || !id) return emit(out, 'USAGE', 'usage: auto-memory-hook.mjs read-id <id>');
765
+ const entries = loadStoreForRead(out);
766
+ if (entries instanceof Error) return emit(out, entries.code || 'STORE_READ_FAILED', entries.message);
767
+ const entry = entries.find((e) => e.id === id);
768
+ if (entry) { out.found = true; out.entry = entry; }
769
+ return emit(out);
770
+ }
771
+
772
+ /** Newest first by updatedAt (then createdAt); ties broken by ascending id. */
773
+ function newestFirst(a, b) {
774
+ const t = (e) => (Number.isFinite(e.updatedAt) ? e.updatedAt : Number.isFinite(e.createdAt) ? e.createdAt : 0);
775
+ return t(b) - t(a) || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
776
+ }
777
+
778
+ /** Which entry survives and which go; a { refuse } result when --keep names a non-match. */
779
+ function planDedupe(entries, namespace, key, keepId) {
780
+ const matches = keyMatches(entries, namespace, key).sort(newestFirst);
781
+ if (keepId !== undefined && !matches.some((e) => e.id === keepId)) {
782
+ const elsewhere = entries.some((e) => e.id === keepId);
783
+ return { refuse: { code: 'UNKNOWN_ID', message: elsewhere
784
+ ? `entry ${JSON.stringify(keepId)} exists but does not have namespace ${JSON.stringify(namespace)} and key ${JSON.stringify(key)}`
785
+ : `no entry has id ${JSON.stringify(keepId)}`, matches: matches.map(describeEntry) } };
786
+ }
787
+ const keep = matches.length ? (keepId !== undefined ? matches.find((e) => e.id === keepId) : matches[0]) : null;
788
+ return { matches, keep, remove: matches.filter((e) => e !== keep) };
789
+ }
790
+
791
+ // `dedupe <ns> <key> [--keep <id>] [--apply]`. A dry run by default: it reads
792
+ // the store and reports the plan. With --apply it removes the other entries of
793
+ // that namespace+key, and nothing else, through the locked atomic write path
794
+ // and a readback check.
795
+ async function doDedupe(args) {
796
+ const apply = args.includes('--apply');
797
+ const keepAt = args.indexOf('--keep');
798
+ const keepId = keepAt >= 0 ? args[keepAt + 1] : undefined;
799
+ const [namespace, key] = args.filter((a, i) => a !== '--apply' && i !== keepAt && !(keepAt >= 0 && i === keepAt + 1));
800
+ const out = { schemaVersion: READ_SCHEMA_VERSION, store: STORE_PATH, storePresent: false, namespace: namespace ?? null, key: key ?? null, dryRun: !apply, multiplicity: 0, keep: null, remove: [], applied: false };
801
+ if (typeof namespace !== 'string' || !namespace || typeof key !== 'string' || !key || (keepAt >= 0 && (typeof keepId !== 'string' || !keepId || keepId.startsWith('--')))) {
802
+ return emit(out, 'USAGE', 'usage: auto-memory-hook.mjs dedupe <namespace> <key> [--keep <id>] [--apply]');
803
+ }
804
+ const report = (plan) => {
805
+ out.multiplicity = plan.matches.length;
806
+ out.keep = plan.keep ? describeEntry(plan.keep) : null;
807
+ out.remove = plan.remove.map(describeEntry);
808
+ };
809
+
810
+ if (!apply) {
811
+ const entries = loadStoreForRead(out);
812
+ if (entries instanceof Error) return emit(out, entries.code || 'STORE_READ_FAILED', entries.message);
813
+ const plan = planDedupe(entries, namespace, key, keepId);
814
+ if (plan.refuse) { const { code, message, ...extra } = plan.refuse; return emit(out, code, message, extra); }
815
+ report(plan);
816
+ return emit(out);
648
817
  }
649
- const backend = new JsonFileBackend(STORE_PATH);
818
+
819
+ // Plan and write under one lock, from a fresh read, so what is reported is what was applied.
820
+ let refusal = null;
650
821
  try {
651
- await backend.initialize();
822
+ withStoreLock(STORE_PATH, () => {
823
+ const entries = readStoreFile(STORE_PATH);
824
+ out.storePresent = entries !== null;
825
+ const plan = planDedupe(entries || [], namespace, key, keepId);
826
+ if (plan.refuse) { refusal = plan.refuse; return; }
827
+ report(plan);
828
+ if (!plan.remove.length) return;
829
+ const removed = new Set(plan.remove.map((e) => e.id));
830
+ const kept = entries.filter((e) => !removed.has(e.id));
831
+ writeFileAtomic(STORE_PATH, JSON.stringify(kept, null, 2));
832
+ verifyStoreFile(STORE_PATH, new Map(kept.map((e) => [e.id, e])), removed, sameJson);
833
+ out.applied = true;
834
+ });
652
835
  } catch (err) {
653
- out.storePresent = true; // initialize() only throws for a file that exists
654
- return refuse(err.code || 'STORE_READ_FAILED', err.message);
836
+ if (err instanceof StoreError && err.code !== 'STORE_READBACK_MISMATCH') out.storePresent = true;
837
+ return emit(out, err.code || 'DEDUPE_FAILED', err.message);
655
838
  }
656
- out.storePresent = backend.storePresent;
657
- const matches = await backend.query({ namespace, key });
658
- if (matches.length > 1) return refuse('AMBIGUOUS_KEY', `${matches.length} entries share namespace ${JSON.stringify(namespace)} and key ${JSON.stringify(key)}`);
659
- if (matches.length === 1) { out.found = true; out.entry = matches[0]; }
660
- console.log(JSON.stringify(out, null, 2));
661
- return 0;
839
+ if (refusal) { const { code, message, ...extra } = refusal; return emit(out, code, message, extra); }
840
+ return emit(out);
662
841
  }
663
842
 
664
843
  // ============================================================================
@@ -668,7 +847,7 @@ async function doRead(namespace, key) {
668
847
  // Older settings.json files run `node -e "…import(file)" import`, where the
669
848
  // subcommand lands in argv[1] and argv[2] is empty, so both hooks fell through
670
849
  // to `status` and never imported or synced (#4058). Accept that shape too.
671
- const COMMANDS = ['import', 'sync', 'status', 'read'];
850
+ const COMMANDS = ['import', 'sync', 'status', 'read', 'read-id', 'dedupe'];
672
851
  const argvBase = process.argv[2] ? 2 : 1;
673
852
  const command = process.argv[2] || (COMMANDS.includes(process.argv[1]) ? process.argv[1] : 'status');
674
853
  const commandArgs = process.argv.slice(argvBase + 1);
@@ -694,9 +873,11 @@ try {
694
873
  case 'import': await doImport(); break;
695
874
  case 'sync': await doSync(); break;
696
875
  case 'status': await doStatus(); break;
697
- case 'read': exitCode = await doRead(commandArgs[0], commandArgs[1]); break;
876
+ case 'read': exitCode = await doRead(commandArgs); break;
877
+ case 'read-id': exitCode = await doReadId(commandArgs); break;
878
+ case 'dedupe': exitCode = await doDedupe(commandArgs); break;
698
879
  default:
699
- console.log('Usage: auto-memory-hook.mjs <import|sync|status|read <namespace> <key>>');
880
+ console.log('Usage: auto-memory-hook.mjs <import|sync|status|read [--all] <namespace> <key>|read-id <id>|dedupe <namespace> <key> [--keep <id>] [--apply]>');
700
881
  break;
701
882
  }
702
883
  } catch (err) {
@@ -1,5 +1,37 @@
1
1
  # @claude-flow/codex
2
2
 
3
+ <!-- adr-356:quickstart:start -->
4
+ ![Animated diagram: CLAUDE.md and settings are migrated into AGENTS.md, config.toml and skills for the Codex CLI](https://raw.githubusercontent.com/ruvnet/ruflo/main/v3/@claude-flow/codex/assets/codex-flow.svg)
5
+
6
+ **@claude-flow/codex** — Generates and validates the files the OpenAI Codex CLI reads (AGENTS.md, config.toml, skills) and migrates a Claude Code project to them.
7
+
8
+ **Supported environments:** Node.js 18+ · ESM
9
+
10
+ ## Quickstart
11
+
12
+ ```bash
13
+ npm install @claude-flow/codex
14
+ ```
15
+
16
+ ```js
17
+ import { generateAgentsMd, validateAgentsMd } from '@claude-flow/codex';
18
+
19
+ const md = await generateAgentsMd({ projectName: 'demo', template: 'default' });
20
+ const result = await validateAgentsMd(md);
21
+ console.log(md.split('\n')[0]);
22
+ console.log('valid:', result.valid);
23
+ ```
24
+
25
+ Expected output:
26
+
27
+ ```text
28
+ # demo
29
+ valid: true
30
+ ```
31
+
32
+ Used by [`@claude-flow/cli`](https://www.npmjs.com/package/@claude-flow/cli) for `init --codex`.
33
+ <!-- adr-356:quickstart:end -->
34
+
3
35
  <p align="center">
4
36
  <strong>OpenAI Codex CLI Adapter for Claude Flow V3</strong><br/>
5
37
  <em>Self-learning multi-agent orchestration following the <a href="https://agentics.org">Agentics Foundation</a> standard</em>
@@ -1137,3 +1169,9 @@ MIT
1137
1169
 
1138
1170
  - Documentation: https://github.com/ruvnet/ruflo
1139
1171
  - Issues: https://github.com/ruvnet/ruflo/issues
1172
+
1173
+ <!-- adr-356:footer:start -->
1174
+ ---
1175
+
1176
+ Built by [rUv](https://ruv.io) · [ruv.io](https://ruv.io) · [Source](https://github.com/ruvnet/ruflo/tree/main/v3/@claude-flow/codex)
1177
+ <!-- adr-356:footer:end -->
@@ -5,6 +5,7 @@
5
5
  * Following the Agentic AI Foundation standard
6
6
  */
7
7
  import type { AgentsMdOptions } from '../types.js';
8
+ export declare function concurrentRufloWorkflow(): string;
8
9
  /**
9
10
  * Generate an AGENTS.md file based on the provided options
10
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/generators/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,aAAa,CAAC;AA6DrE;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAchF"}
1
+ {"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/generators/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,aAAa,CAAC;AAGrE,wBAAgB,uBAAuB,IAAI,MAAM,CAwDhD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAchF"}
@@ -5,7 +5,7 @@
5
5
  * Following the Agentic AI Foundation standard
6
6
  */
7
7
  import { BUILT_IN_SKILLS } from '../templates/index.js';
8
- function concurrentRufloWorkflow() {
8
+ export function concurrentRufloWorkflow() {
9
9
  return `## Ruflo + Codex Automated Workflow
10
10
 
11
11
  Ruflo is the coordination ledger and policy decision point; Codex workers execute code, tests, and commands. A Ruflo coordination call records work but never replaces implementation.
@@ -247,7 +247,7 @@ Use MCP tools for coordination, then keep coding:
247
247
  | \`swarm_init\` | Start coordination | \`swarm_init({topology: "hierarchical"})\` |
248
248
  | \`memory_store\` | Save patterns | \`memory_store({key: "auth", value: "JWT"})\` |
249
249
  | \`memory_search\` | Find patterns | \`memory_search({query: "auth patterns"})\` |
250
- | \`task_orchestrate\` | Assign work | \`task_orchestrate({task: "implement"})\` |
250
+ | \`task_create\` | Track work | \`task_create({type: "feature", description: "implement"})\` |
251
251
 
252
252
  ## Code Standards
253
253
 
@@ -388,9 +388,9 @@ npx ruflo mcp tools
388
388
  | \`agent_spawn\` | Spawn new agents | \`agent_spawn({type: "coder", name: "dev-1"})\` |
389
389
  | \`memory_store\` | Store in AgentDB | \`memory_store({key: "pattern", value: "..."})\` |
390
390
  | \`memory_search\` | Semantic search | \`memory_search({query: "auth patterns"})\` |
391
- | \`task_orchestrate\` | Task coordination | \`task_orchestrate({task: "implement feature"})\` |
391
+ | \`coordination_orchestrate\` | Task coordination | \`coordination_orchestrate({task: "implement feature", strategy: "parallel"})\` |
392
392
  | \`neural_train\` | Train neural patterns | \`neural_train({iterations: 10})\` |
393
- | \`benchmark_run\` | Performance benchmarks | \`benchmark_run({type: "all"})\` |
393
+ | \`performance_benchmark\` | Performance benchmarks | \`performance_benchmark({suite: "all"})\` |
394
394
 
395
395
  ## Hooks System
396
396
 
@@ -1 +1 @@
1
- {"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/generators/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,SAAS,uBAAuB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDR,CAAC;AACF,CAAC;AAED;;GAEG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kB,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAAwB;IAClD,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+M5B,CAAC;IAEA,OAAO,IAAI,GAAG,kBAAkB,CAAC;AACnC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @claude-flow/codex - dual-host instruction files (#2638)
3
+ *
4
+ * In a project set up for both Claude Code and Codex, AGENTS.md is the single
5
+ * source: the shared sections (shared-instructions.ts) plus the Codex-only
6
+ * ones. Claude Code reads it through the `@AGENTS.md` import in CLAUDE.md, so
7
+ * CLAUDE.md carries only Claude-specific notes and repeats nothing.
8
+ *
9
+ * Single-host AGENTS.md (generateAgentsMd) is untouched by this module.
10
+ */
11
+ import type { AgentsMdOptions } from '../types.js';
12
+ /** AGENTS.md for a dual project: shared sections once, then Codex-only sections. */
13
+ export declare function generateDualAgentsMd(options: AgentsMdOptions): string;
14
+ /**
15
+ * CLAUDE.md for a dual project created by the Codex initializer: the import
16
+ * plus Claude Code notes only. (`ruflo init --dual` writes a richer Claude
17
+ * overlay itself; this initializer then leaves that file alone.)
18
+ */
19
+ export declare function generateDualClaudeMdStub(projectName: string, skills: string[]): string;
20
+ //# sourceMappingURL=dual-instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dual-instructions.d.ts","sourceRoot":"","sources":["../../src/generators/dual-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6EnD,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CActF"}