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

rUvf61abd27ce10
diff --git a/v3/@claude-flow/cli/agents/architect.yaml b/v3/@claude-flow/cli/agents/architect.yaml
index 47b9157e70..a7336d2e3f 100644
--- a/v3/@claude-flow/cli/agents/architect.yaml
+++ b/v3/@claude-flow/cli/agents/architect.yaml
@@ -8,4 +8,4 @@ capabilities:
optimizations:
- context-caching
- memory-persistence
-createdAt: "2026-01-13T21:17:37.853Z"
+createdAt: "2026-01-14T00:04:04.115Z"
diff --git a/v3/@claude-flow/cli/agents/coder.yaml b/v3/@claude-flow/cli/agents/coder.yaml
index 93b7e92c43..36fbb5e99f 100644
--- a/v3/@claude-flow/cli/agents/coder.yaml
+++ b/v3/@claude-flow/cli/agents/coder.yaml
@@ -8,4 +8,4 @@ capabilities:
optimizations:
- flash-attention
- token-reduction
-createdAt: "2026-01-13T21:17:37.853Z"
+createdAt: "2026-01-14T00:04:04.114Z"
diff --git a/v3/@claude-flow/cli/agents/reviewer.yaml b/v3/@claude-flow/cli/agents/reviewer.yaml
index ad7d4ea0d8..3887672633 100644
--- a/v3/@claude-flow/cli/agents/reviewer.yaml
+++ b/v3/@claude-flow/cli/agents/reviewer.yaml
@@ -7,4 +7,4 @@ capabilities:
- best-practices
optimizations:
- incremental-analysis
-createdAt: "2026-01-13T21:17:37.854Z"
+createdAt: "2026-01-14T00:04:04.115Z"
diff --git a/v3/@claude-flow/cli/agents/security-architect.yaml b/v3/@claude-flow/cli/agents/security-architect.yaml
index dbf188c787..9e50d893df 100644
--- a/v3/@claude-flow/cli/agents/security-architect.yaml
+++ b/v3/@claude-flow/cli/agents/security-architect.yaml
@@ -7,4 +7,4 @@ capabilities:
- security-review
optimizations:
- pattern-matching
-createdAt: "2026-01-13T21:17:37.853Z"
+createdAt: "2026-01-14T00:04:04.115Z"
diff --git a/v3/@claude-flow/cli/agents/tester.yaml b/v3/@claude-flow/cli/agents/tester.yaml
index c887d169c4..f8b2093f34 100644
--- a/v3/@claude-flow/cli/agents/tester.yaml
+++ b/v3/@claude-flow/cli/agents/tester.yaml
@@ -7,4 +7,4 @@ capabilities:
- coverage
optimizations:
- parallel-execution
-createdAt: "2026-01-13T21:17:37.853Z"
+createdAt: "2026-01-14T00:04:04.115Z"
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 3a9ec3910c..718c219721 100644
--- a/v3/@claude-flow/cli/src/mcp-tools/security-tools.ts
+++ b/v3/@claude-flow/cli/src/mcp-tools/security-tools.ts
@@ -17,8 +17,11 @@ import { createRequire } from 'module';
// Create require for CJS-style imports (allows cache clearing)
const require = createRequire(import.meta.url);
+// AIDefence instance type
+type AIDefenceInstance = ReturnType<typeof import('@claude-flow/aidefence').createAIDefence>;
+
// Lazy-loaded AIDefence instance
-let aidefenceInstance: ReturnType<typeof import('@claude-flow/aidefence').createAIDefence> | null = null;
+let aidefenceInstance: AIDefenceInstance | null = null;
/**
* Clear require cache for a module (allows re-import after install)
@@ -32,39 +35,43 @@ function clearRequireCache(moduleName: string): void {
}
}
-async function getAIDefence() {
- if (!aidefenceInstance) {
- const packageName = '@claude-flow/aidefence';
+/**
+ * Get or create AIDefence instance (throws if unavailable)
+ */
+async function getAIDefence(): Promise<AIDefenceInstance> {
+ if (aidefenceInstance) {
+ return aidefenceInstance;
+ }
- // First attempt - try to load
- try {
- const aidefence = require(packageName);
- aidefenceInstance = aidefence.createAIDefence({ enableLearning: true });
- return aidefenceInstance;
- } catch {
- // Package not found
- }
+ const packageName = '@claude-flow/aidefence';
- // Second attempt - auto-install and retry
- console.error(`[claude-flow] ${packageName} not found, attempting auto-install...`);
- const installed = await autoInstallPackage(packageName);
-
- if (installed) {
- // Clear cache and retry
- clearRequireCache(packageName);
- try {
- const aidefence = require(packageName);
- aidefenceInstance = aidefence.createAIDefence({ enableLearning: true });
- console.error(`[claude-flow] ${packageName} loaded successfully after install`);
- return aidefenceInstance;
- } catch (retryError) {
- throw new Error(`AIDefence installed but failed to load: ${retryError}. Try restarting the MCP server.`);
- }
- } else {
- throw new Error('AIDefence package not available. Install with: npm install @claude-flow/aidefence');
- }
+ // First attempt - try to load
+ try {
+ const aidefence = require(packageName);
+ aidefenceInstance = aidefence.createAIDefence({ enableLearning: true });
+ return aidefenceInstance;
+ } catch {
+ // Package not found, continue to auto-install
+ }
+
+ // Second attempt - auto-install and retry
+ console.error(`[claude-flow] ${packageName} not found, attempting auto-install...`);
+ const installed = await autoInstallPackage(packageName);
+
+ if (!installed) {
+ throw new Error('AIDefence package not available. Install with: npm install @claude-flow/aidefence');
+ }
+
+ // Clear cache and retry
+ clearRequireCache(packageName);
+ try {
+ const aidefence = require(packageName);
+ aidefenceInstance = aidefence.createAIDefence({ enableLearning: true });
+ console.error(`[claude-flow] ${packageName} loaded successfully after install`);
+ return aidefenceInstance;
+ } catch (retryError) {
+ throw new Error(`AIDefence installed but failed to load: ${retryError}. Try restarting the MCP server.`);
}
- return aidefenceInstance;
}
/**