Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(plugins): drop the variable-held agentic-flow root import

Dragan Spiridonov5b013f84978f
diff --git a/v3/@claude-flow/cli/__tests__/agentic-flow-root-import.test.ts b/v3/@claude-flow/cli/__tests__/agentic-flow-root-import.test.ts
index f5a5fdb2f3..92aacd9bbe 100644
--- a/v3/@claude-flow/cli/__tests__/agentic-flow-root-import.test.ts
+++ b/v3/@claude-flow/cli/__tests__/agentic-flow-root-import.test.ts
@@ -61,6 +61,8 @@ describe('agentic-flow root entry is never imported', () => {
it('no v3 source file imports the root entry', () => {
const v3 = resolve(CLI, '../..');
const rootImport = /(?:import\s*\(|require\s*\(|from\s+|safeImport<[^>]*>\s*\()\s*['"`]agentic-flow['"`]/;
+ // A specifier held in a variable (`const p = 'agentic-flow'; import(p)`) evades the pattern above.
+ const rootSpecifierVar = /(?:const|let|var)\s+\w+\s*=\s*['"`]agentic-flow['"`]/;
const offenders: string[] = [];
const walk = (dir: string): void => {
for (const name of readdirSync(dir)) {
@@ -69,7 +71,8 @@ describe('agentic-flow root entry is never imported', () => {
if (statSync(path).isDirectory()) { walk(path); continue; }
if (!/\.(ts|mts|cts|js|mjs|cjs)$/.test(name) || /\.test\.|\.spec\./.test(name)) continue;
readFileSync(path, 'utf8').split('\n').forEach((line, i) => {
- if (rootImport.test(line.replace(/\/\/.*$/, ''))) offenders.push(`${relative(v3, path)}:${i + 1}`);
+ const code = line.replace(/\/\/.*$/, '');
+ if (rootImport.test(code) || rootSpecifierVar.test(code)) offenders.push(`${relative(v3, path)}:${i + 1}`);
});
}
};
diff --git a/v3/@claude-flow/plugins/src/integrations/agentic-flow.ts b/v3/@claude-flow/plugins/src/integrations/agentic-flow.ts
index 6fb21865d7..e8edd7c16f 100644
--- a/v3/@claude-flow/plugins/src/integrations/agentic-flow.ts
+++ b/v3/@claude-flow/plugins/src/integrations/agentic-flow.ts
@@ -32,9 +32,11 @@ async function loadAgenticFlow(): Promise<boolean> {
try {
// Use dynamic string to bypass TypeScript module resolution
const corePath = 'agentic-flow/core';
- const agentsPath = 'agentic-flow';
agenticFlowCore = await import(/* @vite-ignore */ corePath);
- agenticFlowAgents = await import(/* @vite-ignore */ agentsPath);
+ // Never import the agentic-flow root entry: 3.0.0-alpha.x (and 2.0.0-alpha
+ // through 2.0.7) run their CLI main() on import. No published root has ever
+ // exported handleMCPCommand, so agenticFlowAgents stays null.
+ agenticFlowAgents = null;
return true;
} catch {
// agentic-flow not available - use fallback implementations