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

Checkpoint: File edits

rUvd44d77757567
diff --git a/v3/@claude-flow/cli/src/mcp-tools/security-tools.ts b/v3/@claude-flow/cli/src/mcp-tools/security-tools.ts
index b919ec572a..b07c80f23c 100644
--- a/v3/@claude-flow/cli/src/mcp-tools/security-tools.ts
+++ b/v3/@claude-flow/cli/src/mcp-tools/security-tools.ts
@@ -11,32 +11,10 @@
*/
import type { MCPTool, MCPToolResult } from './types.js';
-import { execSync } from 'child_process';
+import { autoInstallPackage } from './auto-install.js';
// Lazy-loaded AIDefence instance
let aidefenceInstance: Awaited<ReturnType<typeof import('@claude-flow/aidefence').createAIDefence>> | null = null;
-let installAttempted = false;
-
-/**
- * Auto-install a package if not available
- */
-async function autoInstallPackage(packageName: string): Promise<boolean> {
- if (installAttempted) return false;
- installAttempted = true;
-
- try {
- console.error(`[claude-flow] Auto-installing ${packageName}...`);
- execSync(`npm install ${packageName} --no-save`, {
- stdio: ['pipe', 'pipe', 'pipe'],
- timeout: 60000, // 60 second timeout
- });
- console.error(`[claude-flow] Successfully installed ${packageName}`);
- return true;
- } catch (error) {
- console.error(`[claude-flow] Failed to auto-install ${packageName}: ${error}`);
- return false;
- }
-}
async function getAIDefence() {
if (!aidefenceInstance) {
@@ -48,7 +26,7 @@ async function getAIDefence() {
const installed = await autoInstallPackage('@claude-flow/aidefence');
if (installed) {
try {
- // Clear module cache and retry
+ // Retry import after installation
const { createAIDefence } = await import('@claude-flow/aidefence');
aidefenceInstance = createAIDefence({ enableLearning: true });
} catch {