claude-flow 3.6.18 → 3.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.6.18",
3
+ "version": "3.6.20",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -4,6 +4,7 @@
4
4
  *
5
5
  * Created with ❤️ by ruv.io
6
6
  */
7
+ import './log-filters.js';
7
8
  export declare const VERSION: string;
8
9
  export interface CLIOptions {
9
10
  name?: string;
@@ -4,33 +4,13 @@
4
4
  *
5
5
  * Created with ❤️ by ruv.io
6
6
  */
7
- // MUST run before any agentic-flow / agentdb imports this file is
8
- // imported by every entry point (bin/cli.js, ruflo/bin/ruflo.js via
9
- // dist/src/index.js, and tests). Patching the console here ensures the
10
- // suppression applies regardless of how the CLI was invoked. Previously
11
- // the suppression lived only in bin/cli.js, so the ruflo wrapper (which
12
- // imports dist/src/index.js directly) leaked the cosmetic warning.
13
- //
14
- // Tight match: requires BOTH "[AgentDB Patch]" AND "Controller index not
15
- // found" so other [AgentDB Patch] messages (real issues) still flow.
16
- {
17
- const _isCosmeticAgentdbPatchNoise = (msg) => {
18
- const s = String(msg ?? '');
19
- return s.includes('[AgentDB Patch]') && s.includes('Controller index not found');
20
- };
21
- const _origWarn = console.warn.bind(console);
22
- const _origLog = console.log.bind(console);
23
- console.warn = (...args) => {
24
- if (_isCosmeticAgentdbPatchNoise(args[0]))
25
- return;
26
- _origWarn(...args);
27
- };
28
- console.log = (...args) => {
29
- if (_isCosmeticAgentdbPatchNoise(args[0]))
30
- return;
31
- _origLog(...args);
32
- };
33
- }
7
+ // MUST be the first import installs console filter for the cosmetic
8
+ // "[AgentDB Patch] Controller index not found" warning before any
9
+ // agentic-flow / agentdb code can load. ES module imports are evaluated
10
+ // in source order, so this file runs its side effects before any other
11
+ // import in this module's import graph (including transitive imports of
12
+ // agentic-flow via commands/index.js).
13
+ import './log-filters.js';
34
14
  import { readFileSync } from 'fs';
35
15
  import { fileURLToPath } from 'url';
36
16
  import { dirname, join } from 'path';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Console filter for the cosmetic "[AgentDB Patch] Controller index not found"
3
+ * warning emitted by agentic-flow's runtime patch (it expects agentdb v1.x
4
+ * layout but we use v3). This file MUST be imported as the first side-effect
5
+ * import in any entry point so the patch is in place before agentic-flow
6
+ * (and anything that transitively imports it) loads.
7
+ *
8
+ * The previous attempt put the suppression as a top-level code block inside
9
+ * src/index.ts, but ES module imports are evaluated before the file's own
10
+ * top-level code, so transitive imports of agentic-flow were still
11
+ * triggering the warning before the suppression took effect. A dedicated
12
+ * side-effect module imported FIRST avoids that.
13
+ *
14
+ * Tight match: requires BOTH "[AgentDB Patch]" AND "Controller index not
15
+ * found". Other [AgentDB Patch] messages (real issues) flow through.
16
+ * Audit log audit_1776483149979 flagged the previous broad filter as too
17
+ * aggressive — this one is tight enough to be safe.
18
+ */
19
+ declare const isCosmeticAgentdbPatchNoise: (msg: unknown) => boolean;
20
+ declare const origWarn: (message?: any, ...optionalParams: any[]) => void;
21
+ declare const origLog: (message?: any, ...optionalParams: any[]) => void;
22
+ //# sourceMappingURL=log-filters.d.ts.map
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /**
3
+ * Console filter for the cosmetic "[AgentDB Patch] Controller index not found"
4
+ * warning emitted by agentic-flow's runtime patch (it expects agentdb v1.x
5
+ * layout but we use v3). This file MUST be imported as the first side-effect
6
+ * import in any entry point so the patch is in place before agentic-flow
7
+ * (and anything that transitively imports it) loads.
8
+ *
9
+ * The previous attempt put the suppression as a top-level code block inside
10
+ * src/index.ts, but ES module imports are evaluated before the file's own
11
+ * top-level code, so transitive imports of agentic-flow were still
12
+ * triggering the warning before the suppression took effect. A dedicated
13
+ * side-effect module imported FIRST avoids that.
14
+ *
15
+ * Tight match: requires BOTH "[AgentDB Patch]" AND "Controller index not
16
+ * found". Other [AgentDB Patch] messages (real issues) flow through.
17
+ * Audit log audit_1776483149979 flagged the previous broad filter as too
18
+ * aggressive — this one is tight enough to be safe.
19
+ */
20
+ const isCosmeticAgentdbPatchNoise = (msg) => {
21
+ const s = String(msg ?? '');
22
+ return s.includes('[AgentDB Patch]') && s.includes('Controller index not found');
23
+ };
24
+ const origWarn = console.warn.bind(console);
25
+ const origLog = console.log.bind(console);
26
+ console.warn = (...args) => {
27
+ if (isCosmeticAgentdbPatchNoise(args[0]))
28
+ return;
29
+ origWarn(...args);
30
+ };
31
+ console.log = (...args) => {
32
+ if (isCosmeticAgentdbPatchNoise(args[0]))
33
+ return;
34
+ origLog(...args);
35
+ };
36
+ //# sourceMappingURL=log-filters.js.map
@@ -1274,15 +1274,40 @@ export async function loadEmbeddingModel(options) {
1274
1274
  }
1275
1275
  }
1276
1276
  try {
1277
- // Try to import @xenova/transformers for ONNX embeddings
1278
- const transformers = await import('@xenova/transformers').catch(() => null);
1279
- if (transformers) {
1277
+ // ADR-094: prefer @huggingface/transformers (clears protobufjs <7.5.5
1278
+ // critical RCE chain), fall back to legacy @xenova/transformers.
1279
+ // Inlined here rather than depending on @claude-flow/embeddings to
1280
+ // avoid a circular optional-dep at install time; the logic mirrors
1281
+ // @claude-flow/embeddings/src/transformers-loader.ts.
1282
+ let transformersSource = null;
1283
+ let pipelineFn = null;
1284
+ {
1285
+ const tryLoad = async (specifier) => {
1286
+ try {
1287
+ return (await import(specifier));
1288
+ }
1289
+ catch {
1290
+ return null;
1291
+ }
1292
+ };
1293
+ const hf = await tryLoad('@huggingface/transformers');
1294
+ if (hf && typeof hf.pipeline === 'function') {
1295
+ pipelineFn = hf.pipeline;
1296
+ transformersSource = '@huggingface/transformers';
1297
+ }
1298
+ else {
1299
+ const xen = await tryLoad('@xenova/transformers');
1300
+ if (xen && typeof xen.pipeline === 'function') {
1301
+ pipelineFn = xen.pipeline;
1302
+ transformersSource = '@xenova/transformers';
1303
+ }
1304
+ }
1305
+ }
1306
+ if (pipelineFn && transformersSource) {
1280
1307
  if (verbose) {
1281
- console.log('Loading ONNX embedding model (all-MiniLM-L6-v2)...');
1308
+ console.log(`Loading ONNX embedding model via ${transformersSource} (all-MiniLM-L6-v2)...`);
1282
1309
  }
1283
- // Use small, fast model for local embeddings
1284
- const { pipeline } = transformers;
1285
- const embedder = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
1310
+ const embedder = await pipelineFn('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
1286
1311
  embeddingModelState = {
1287
1312
  loaded: true,
1288
1313
  model: embedder,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.6.18",
3
+ "version": "3.6.20",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",