claude-flow 3.74.1 → 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.
- package/.claude/helpers/auto-memory-hook.mjs +262 -81
- package/node_modules/@claude-flow/codex/README.md +38 -0
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts.map +1 -1
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.js +4 -4
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.js.map +1 -1
- package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.d.ts +20 -0
- package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.js +104 -0
- package/node_modules/@claude-flow/codex/dist/generators/dual-instructions.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.d.ts +2 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.d.ts.map +1 -1
- package/node_modules/@claude-flow/codex/dist/generators/index.js +2 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.js.map +1 -1
- package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.d.ts +46 -0
- package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.js +162 -0
- package/node_modules/@claude-flow/codex/dist/generators/shared-instructions.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/index.d.ts +3 -3
- package/node_modules/@claude-flow/codex/dist/index.js +1 -1
- package/node_modules/@claude-flow/codex/dist/initializer.d.ts.map +1 -1
- package/node_modules/@claude-flow/codex/dist/initializer.js +16 -93
- package/node_modules/@claude-flow/codex/dist/initializer.js.map +1 -1
- package/node_modules/@claude-flow/codex/package.json +8 -6
- package/node_modules/@claude-flow/mcp/README.md +44 -0
- package/node_modules/@claude-flow/mcp/package.json +16 -4
- package/package.json +4 -4
- package/v3/@claude-flow/cli/catalog-manifest.json +3 -3
- package/v3/@claude-flow/cli/dist/src/autopilot-state.js +17 -8
- package/v3/@claude-flow/cli/dist/src/commands/agent.js +2 -1
- package/v3/@claude-flow/cli/dist/src/commands/init.js +28 -6
- package/v3/@claude-flow/cli/dist/src/commands/memory-backup.js +2 -1
- package/v3/@claude-flow/cli/dist/src/commands/memory-distill.js +2 -1
- package/v3/@claude-flow/cli/dist/src/commands/memory.js +47 -3
- package/v3/@claude-flow/cli/dist/src/commands/neural.js +6 -5
- package/v3/@claude-flow/cli/dist/src/commands/plugins-host.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/commands/plugins-host.js +161 -0
- package/v3/@claude-flow/cli/dist/src/commands/plugins.js +3 -1
- package/v3/@claude-flow/cli/dist/src/commands/start-all.d.ts +28 -0
- package/v3/@claude-flow/cli/dist/src/commands/start-all.js +99 -0
- package/v3/@claude-flow/cli/dist/src/commands/start.d.ts +5 -1
- package/v3/@claude-flow/cli/dist/src/commands/start.js +17 -10
- package/v3/@claude-flow/cli/dist/src/commands/swarm.js +2 -1
- package/v3/@claude-flow/cli/dist/src/fs-secure.js +9 -2
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +15 -0
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +64 -114
- package/v3/@claude-flow/cli/dist/src/init/dual-instructions.d.ts +29 -0
- package/v3/@claude-flow/cli/dist/src/init/dual-instructions.js +87 -0
- package/v3/@claude-flow/cli/dist/src/init/executor.js +96 -13
- package/v3/@claude-flow/cli/dist/src/init/index.d.ts +3 -1
- package/v3/@claude-flow/cli/dist/src/init/index.js +5 -1
- package/v3/@claude-flow/cli/dist/src/init/plugin-dedup.d.ts +61 -0
- package/v3/@claude-flow/cli/dist/src/init/plugin-dedup.js +130 -0
- package/v3/@claude-flow/cli/dist/src/init/shared-instructions.d.ts +46 -0
- package/v3/@claude-flow/cli/dist/src/init/shared-instructions.js +162 -0
- package/v3/@claude-flow/cli/dist/src/init/types.d.ts +33 -0
- package/v3/@claude-flow/cli/dist/src/init/types.js +3 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts +14 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +48 -5
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-hierarchical-inventory-tools.d.ts +15 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-hierarchical-inventory-tools.js +115 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-inventory-tools.d.ts +21 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-inventory-tools.js +152 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +56 -7
- package/v3/@claude-flow/cli/dist/src/mcp-tools/aidefence-known-misses.d.ts +6 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/aidefence-known-misses.js +23 -5
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +21 -3
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts +29 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +239 -19
- package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js +53 -5
- package/v3/@claude-flow/cli/dist/src/memory/embedding-config.d.ts +79 -0
- package/v3/@claude-flow/cli/dist/src/memory/embedding-config.js +250 -0
- package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js +2 -1
- package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts +28 -2
- package/v3/@claude-flow/cli/dist/src/memory/intelligence.js +37 -7
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +42 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +267 -28
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +1 -1
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +47 -22
- package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js +3 -2
- package/v3/@claude-flow/cli/dist/src/ruvector/task-embedder.d.ts +2 -1
- package/v3/@claude-flow/cli/dist/src/ruvector/task-embedder.js +7 -3
- package/v3/@claude-flow/cli/dist/src/services/daemon-autostart.d.ts +4 -6
- package/v3/@claude-flow/cli/dist/src/services/daemon-autostart.js +6 -46
- package/v3/@claude-flow/cli/dist/src/services/host-executable.d.ts +68 -0
- package/v3/@claude-flow/cli/dist/src/services/host-executable.js +175 -0
- package/v3/@claude-flow/cli/dist/src/services/host-plugin-manager.d.ts +137 -0
- package/v3/@claude-flow/cli/dist/src/services/host-plugin-manager.js +374 -0
- package/v3/@claude-flow/cli/dist/src/services/project-root.d.ts +37 -0
- package/v3/@claude-flow/cli/dist/src/services/project-root.js +122 -0
- package/v3/@claude-flow/cli/package.json +7 -7
|
@@ -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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
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
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
-
|
|
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
|
|
462
|
-
if (!memPkg
|
|
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
|
|
548
|
-
if (!memPkg
|
|
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
|
-
|
|
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
|
|
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(`
|
|
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
|
|
637
|
-
// directory,
|
|
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
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
654
|
-
return
|
|
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
|
-
|
|
657
|
-
|
|
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
|
|
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
|
+

|
|
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 -->
|
|
@@ -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;
|
|
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
|
-
| \`
|
|
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
|
-
| \`
|
|
391
|
+
| \`coordination_orchestrate\` | Task coordination | \`coordination_orchestrate({task: "implement feature", strategy: "parallel"})\` |
|
|
392
392
|
| \`neural_train\` | Train neural patterns | \`neural_train({iterations: 10})\` |
|
|
393
|
-
| \`
|
|
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,
|
|
1
|
+
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/generators/agents-md.ts"],"names":[],"mappings":"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"}
|
|
@@ -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"}
|