claude-flow 3.56.2 → 3.56.4

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.
Files changed (72) hide show
  1. package/.claude/helpers/auto-memory-hook.mjs +13 -8
  2. package/.claude/helpers/hook-handler.cjs +19 -14
  3. package/.claude/helpers/learning-service.mjs +5 -2
  4. package/.claude/helpers/session.cjs +56 -10
  5. package/.claude/helpers/statusline.cjs +1338 -1328
  6. package/.claude-plugin/scripts/ruflo-hook.cjs +14 -2
  7. package/node_modules/@claude-flow/mcp/dist/resource-registry.d.ts +1 -0
  8. package/node_modules/@claude-flow/mcp/dist/resource-registry.d.ts.map +1 -1
  9. package/node_modules/@claude-flow/mcp/dist/resource-registry.js +10 -4
  10. package/node_modules/@claude-flow/mcp/dist/resource-registry.js.map +1 -1
  11. package/node_modules/@claude-flow/mcp/dist/sampling.d.ts.map +1 -1
  12. package/node_modules/@claude-flow/mcp/dist/sampling.js +13 -6
  13. package/node_modules/@claude-flow/mcp/dist/sampling.js.map +1 -1
  14. package/node_modules/@claude-flow/mcp/dist/task-manager.d.ts.map +1 -1
  15. package/node_modules/@claude-flow/mcp/dist/task-manager.js +10 -1
  16. package/node_modules/@claude-flow/mcp/dist/task-manager.js.map +1 -1
  17. package/node_modules/@claude-flow/mcp/dist/tool-registry.d.ts +1 -0
  18. package/node_modules/@claude-flow/mcp/dist/tool-registry.d.ts.map +1 -1
  19. package/node_modules/@claude-flow/mcp/dist/tool-registry.js +17 -11
  20. package/node_modules/@claude-flow/mcp/dist/tool-registry.js.map +1 -1
  21. package/node_modules/@claude-flow/mcp/package.json +1 -1
  22. package/node_modules/@claude-flow/security/dist/index.d.ts +1 -1
  23. package/node_modules/@claude-flow/security/dist/index.d.ts.map +1 -1
  24. package/node_modules/@claude-flow/security/dist/index.js +1 -1
  25. package/node_modules/@claude-flow/security/dist/index.js.map +1 -1
  26. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts +9 -1
  27. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts.map +1 -1
  28. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js +15 -2
  29. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js.map +1 -1
  30. package/node_modules/@claude-flow/security/package.json +1 -1
  31. package/package.json +4 -4
  32. package/v3/@claude-flow/cli/README.md +62 -158
  33. package/v3/@claude-flow/cli/catalog-manifest.json +5 -5
  34. package/v3/@claude-flow/cli/dist/src/commands/doctor.js +7 -13
  35. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +3 -6
  36. package/v3/@claude-flow/cli/dist/src/commands/init.js +3 -10
  37. package/v3/@claude-flow/cli/dist/src/commands/metaharness.js +9 -14
  38. package/v3/@claude-flow/cli/dist/src/commands/plugins.js +81 -8
  39. package/v3/@claude-flow/cli/dist/src/commands/security-code-patterns.d.ts +40 -0
  40. package/v3/@claude-flow/cli/dist/src/commands/security-code-patterns.js +192 -0
  41. package/v3/@claude-flow/cli/dist/src/commands/security.js +8 -11
  42. package/v3/@claude-flow/cli/dist/src/commands/status.js +8 -10
  43. package/v3/@claude-flow/cli/dist/src/init/executor.d.ts +1 -1
  44. package/v3/@claude-flow/cli/dist/src/init/executor.js +25 -16
  45. package/v3/@claude-flow/cli/dist/src/init/helper-commands.d.ts +18 -0
  46. package/v3/@claude-flow/cli/dist/src/init/helper-commands.js +142 -0
  47. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +128 -29
  48. package/v3/@claude-flow/cli/dist/src/init/settings-generator.js +36 -103
  49. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +6 -2
  50. package/v3/@claude-flow/cli/dist/src/mcp-tools/metaharness-tools.js +7 -10
  51. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +24 -3
  52. package/v3/@claude-flow/cli/dist/src/mcp-tools/testgen-tools.js +8 -12
  53. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js +9 -8
  54. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +10 -4
  55. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +10 -1
  56. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +2 -19
  57. package/v3/@claude-flow/cli/dist/src/memory/shared-sqlite.d.ts +6 -0
  58. package/v3/@claude-flow/cli/dist/src/memory/shared-sqlite.js +35 -7
  59. package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts +3 -1
  60. package/v3/@claude-flow/cli/dist/src/plugins/manager.js +31 -10
  61. package/v3/@claude-flow/cli/dist/src/plugins/own-install.d.ts +15 -0
  62. package/v3/@claude-flow/cli/dist/src/plugins/own-install.js +51 -0
  63. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts +26 -2
  64. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js +108 -81
  65. package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts +1 -1
  66. package/v3/@claude-flow/cli/dist/src/plugins/store/index.js +1 -1
  67. package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts +5 -0
  68. package/v3/@claude-flow/cli/dist/src/plugins/trust-policy.d.ts +13 -0
  69. package/v3/@claude-flow/cli/dist/src/plugins/trust-policy.js +29 -0
  70. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js +18 -6
  71. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js +3 -1
  72. package/v3/@claude-flow/cli/package.json +6 -6
@@ -494,6 +494,17 @@ function fallbackLouvain(nodes, edges) {
494
494
  let improved = true;
495
495
  const maxIterations = 10;
496
496
  let iteration = 0;
497
+ // Community total weighted degree. Maintained incrementally (±nodeDegree on
498
+ // each accepted move) rather than rebuilt from a full scan of `community`
499
+ // inside the per-node loop below — the rebuild was O(n) per node (O(n^2) per
500
+ // pass), matching neither the reference Louvain implementations (networkx's
501
+ // `Stot`, python-louvain's `status.degrees`, both updated in O(1) per move)
502
+ // nor the algorithm's own linear-on-sparse-data design intent.
503
+ const communityTotal = new Map();
504
+ for (const node of nodes) {
505
+ const c = community.get(node);
506
+ communityTotal.set(c, (communityTotal.get(c) || 0) + (degree.get(node) || 0));
507
+ }
497
508
  while (improved && iteration < maxIterations) {
498
509
  improved = false;
499
510
  iteration++;
@@ -507,17 +518,16 @@ function fallbackLouvain(nodes, edges) {
507
518
  const neighborCommunity = community.get(neighbor);
508
519
  communityWeights.set(neighborCommunity, (communityWeights.get(neighborCommunity) || 0) + weight);
509
520
  }
510
- // Calculate community totals
511
- const communityTotal = new Map();
512
- for (const [n, c] of Array.from(community.entries())) {
513
- communityTotal.set(c, (communityTotal.get(c) || 0) + (degree.get(n) || 0));
514
- }
515
521
  let bestCommunity = currentCommunity;
516
522
  let bestGain = 0;
517
523
  for (const [targetCommunity, edgeWeight] of Array.from(communityWeights.entries())) {
518
524
  if (targetCommunity === currentCommunity)
519
525
  continue;
520
- // Calculate modularity gain
526
+ // Calculate modularity gain. `currentTotal` still includes this
527
+ // node's own degree (not yet removed) — the `+ nodeDegree` term
528
+ // below backs it out, so `communityTotal` must stay un-patched for
529
+ // `node` until after the move decision, matching the pre-existing
530
+ // formula this complexity fix leaves unchanged.
521
531
  const currentTotal = communityTotal.get(currentCommunity) || 0;
522
532
  const targetTotal = communityTotal.get(targetCommunity) || 0;
523
533
  const currentEdges = communityWeights.get(currentCommunity) || 0;
@@ -530,6 +540,8 @@ function fallbackLouvain(nodes, edges) {
530
540
  }
531
541
  if (bestCommunity !== currentCommunity) {
532
542
  community.set(node, bestCommunity);
543
+ communityTotal.set(currentCommunity, (communityTotal.get(currentCommunity) || 0) - nodeDegree);
544
+ communityTotal.set(bestCommunity, (communityTotal.get(bestCommunity) || 0) + nodeDegree);
533
545
  improved = true;
534
546
  }
535
547
  }
@@ -264,7 +264,9 @@ export async function verifyEd25519Signature(message, signature, publicKey) {
264
264
  const ed = await import('@noble/ed25519');
265
265
  // Handle prefixed public key (e.g., "ed25519:abc123...")
266
266
  const pubKeyHex = publicKey.replace(/^ed25519:/, '');
267
- const isValid = await ed.verifyAsync(Buffer.from(signature, 'hex'), new TextEncoder().encode(message), Buffer.from(pubKeyHex, 'hex'));
267
+ // RFC 8032 strict mode: rejects small-order public keys, against which
268
+ // signatures can be forged under the library's default ZIP-215 rules.
269
+ const isValid = await ed.verifyAsync(Buffer.from(signature, 'hex'), new TextEncoder().encode(message), Buffer.from(pubKeyHex, 'hex'), { zip215: false });
268
270
  return isValid;
269
271
  }
270
272
  catch (error) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.56.2",
3
+ "version": "3.56.4",
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",
@@ -100,10 +100,10 @@
100
100
  "dependencies": {
101
101
  "@claude-flow/cli-core": "3.7.0",
102
102
  "@claude-flow/codex": "3.0.3",
103
- "@claude-flow/mcp": "3.1.0",
103
+ "@claude-flow/mcp": "3.1.1",
104
104
  "@claude-flow/neural": "3.0.0",
105
105
  "@claude-flow/plugin-agent-federation": "1.0.1",
106
- "@claude-flow/security": "3.0.3",
106
+ "@claude-flow/security": "3.0.4",
107
107
  "@claude-flow/shared": "3.0.2",
108
108
  "@iarna/toml": "^2.2.5",
109
109
  "@noble/ed25519": "2.3.0",
@@ -125,17 +125,17 @@
125
125
  "ws": "^8.21.0",
126
126
  "yaml": "^2.8.0",
127
127
  "zod": "^3.22.0",
128
- "@claude-flow/memory": "3.0.2"
128
+ "@claude-flow/memory": "3.0.4"
129
129
  },
130
130
  "optionalDependencies": {
131
131
  "@agntcy/slim-bindings": "2.0.0-alpha.5",
132
- "@claude-flow/memory": "3.0.2",
132
+ "@claude-flow/memory": "3.0.4",
133
133
  "@metaharness/darwin": "~0.10.2",
134
134
  "@metaharness/flywheel": "~0.1.10",
135
135
  "@metaharness/radio": "~0.1.0",
136
136
  "@metaharness/turn-credit": "~0.1.0",
137
137
  "@napi-rs/keyring": "1.3.0",
138
- "agentdb": "^3.0.0-alpha.17",
138
+ "agentdb": "^3.0.0-alpha.20",
139
139
  "agentic-flow": "^3.0.0-alpha.1",
140
140
  "better-sqlite3": "^12.9.0",
141
141
  "ruvector": "^0.2.27",