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(cli): prevent TS2307 for optional @claude-flow/codex import (#1346)

Tima8e51bd54d17a
diff --git a/v3/@claude-flow/cli/src/commands/init.ts b/v3/@claude-flow/cli/src/commands/init.ts
index e570496a16..939523087a 100644
--- a/v3/@claude-flow/cli/src/commands/init.ts
+++ b/v3/@claude-flow/cli/src/commands/init.ts
@@ -40,9 +40,11 @@ async function initCodexAction(
let CodexInitializer: any;
// Try multiple resolution strategies for the @claude-flow/codex package
+ // Use a variable to prevent TypeScript from statically resolving the optional module
+ const codexModuleId = '@claude-flow/codex';
const resolutionStrategies = [
// Strategy 1: Direct import (works if installed as CLI dependency)
- async () => (await import('@claude-flow/codex')).CodexInitializer,
+ async () => (await import(codexModuleId)).CodexInitializer,
// Strategy 2: Project node_modules (works if installed in user's project)
async () => {
const projectPath = path.join(ctx.cwd, 'node_modules', '@claude-flow', 'codex', 'dist', 'index.js');