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: resolve import.meta module compatibility issue in claude-flow wrapper

rUv03e4febc617b
diff --git a/src/cli/simple-commands/init/templates/claude-flow-universal b/src/cli/simple-commands/init/templates/claude-flow-universal
index 1ee6a93ef8..94287517c4 100644
--- a/src/cli/simple-commands/init/templates/claude-flow-universal
+++ b/src/cli/simple-commands/init/templates/claude-flow-universal
@@ -11,12 +11,20 @@
const { resolve } = await import('path');
const { fileURLToPath } = await import('url');
+ // Detect if we're running in ES module context
+ let __dirname;
try {
- // Try to use import.meta.url (ES modules)
- const __filename = fileURLToPath(import.meta.url);
- const __dirname = resolve(__filename, '..');
+ // Check if import.meta is available (ES modules)
+ if (typeof import.meta !== 'undefined' && import.meta.url) {
+ const __filename = fileURLToPath(import.meta.url);
+ __dirname = resolve(__filename, '..');
+ } else {
+ // Fallback for CommonJS
+ __dirname = process.cwd();
+ }
} catch {
// Fallback for CommonJS
+ __dirname = process.cwd();
}
// Try multiple strategies to find claude-flow