claude-flow 3.72.2 → 3.73.0

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 (37) hide show
  1. package/.claude/proven-config.json +1 -1
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/README.md +29 -21
  4. package/README.zh-CN.md +69 -4
  5. package/node_modules/@claude-flow/codex/dist/cli.js +0 -0
  6. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
  7. package/node_modules/@claude-flow/plugin-agent-federation/package.json +5 -5
  8. package/node_modules/@claude-flow/security/dist/input-validator.d.ts +6 -6
  9. package/package.json +2 -2
  10. package/v3/@claude-flow/cli/README.md +29 -21
  11. package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
  12. package/v3/@claude-flow/cli/dist/src/commands/agent.js +2 -0
  13. package/v3/@claude-flow/cli/dist/src/commands/funnel.d.ts +1 -0
  14. package/v3/@claude-flow/cli/dist/src/commands/funnel.js +37 -2
  15. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +16 -2
  16. package/v3/@claude-flow/cli/dist/src/commands/init.js +70 -16
  17. package/v3/@claude-flow/cli/dist/src/commands/mcp.js +15 -0
  18. package/v3/@claude-flow/cli/dist/src/commands/swarm.js +2 -0
  19. package/v3/@claude-flow/cli/dist/src/funnel/activation.d.ts +30 -0
  20. package/v3/@claude-flow/cli/dist/src/funnel/activation.js +69 -0
  21. package/v3/@claude-flow/cli/dist/src/funnel/events.js +4 -1
  22. package/v3/@claude-flow/cli/dist/src/funnel/index.d.ts +2 -1
  23. package/v3/@claude-flow/cli/dist/src/funnel/index.js +2 -1
  24. package/v3/@claude-flow/cli/dist/src/funnel/message-transport.d.ts +12 -0
  25. package/v3/@claude-flow/cli/dist/src/funnel/message-transport.js +23 -1
  26. package/v3/@claude-flow/cli/dist/src/funnel/types.d.ts +2 -2
  27. package/v3/@claude-flow/cli/dist/src/init/first-win.d.ts +24 -0
  28. package/v3/@claude-flow/cli/dist/src/init/first-win.js +97 -0
  29. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +2 -0
  30. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js +2 -0
  31. package/v3/@claude-flow/cli/dist/src/missions/schemas.d.ts +117 -117
  32. package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.d.ts +121 -121
  33. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +1 -1
  34. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +22 -21
  35. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts +1 -1
  36. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js +13 -14
  37. package/v3/@claude-flow/cli/package.json +5 -5
@@ -36,7 +36,7 @@ export declare class PatternDownloader {
36
36
  */
37
37
  private verifyChecksum;
38
38
  /**
39
- * Verify content signature using crypto
39
+ * Verify an Ed25519 signature over the content. Any error is a failure.
40
40
  */
41
41
  private verifySignature;
42
42
  /**
@@ -75,15 +75,20 @@ export class PatternDownloader {
75
75
  console.log(`[Download] Checksum verified!`);
76
76
  }
77
77
  }
78
- // Verify signature if available
78
+ // Verify signature if available. A pattern that carries a signature
79
+ // which does not verify is refused rather than written.
79
80
  if (pattern.signature && pattern.publicKey) {
80
- const sigVerified = this.verifySignature(content, pattern.signature, pattern.publicKey);
81
+ const sigVerified = await this.verifySignature(content, pattern.signature, pattern.publicKey);
81
82
  if (!sigVerified) {
82
- console.warn(`[Download] Warning: Signature verification failed!`);
83
- }
84
- else {
85
- console.log(`[Download] Signature verified!`);
83
+ console.warn(`[Download] Signature verification failed, not writing the pattern.`);
84
+ return {
85
+ success: false,
86
+ pattern,
87
+ verified: false,
88
+ size: content.length,
89
+ };
86
90
  }
91
+ console.log(`[Download] Signature verified!`);
87
92
  }
88
93
  // Write to file
89
94
  fs.writeFileSync(outputPath, content);
@@ -228,28 +233,24 @@ export class PatternDownloader {
228
233
  return actualChecksum === expectedChecksum;
229
234
  }
230
235
  /**
231
- * Verify content signature using crypto
236
+ * Verify an Ed25519 signature over the content. Any error is a failure.
232
237
  */
233
- verifySignature(content, signature, publicKey) {
234
- // Check signature format
238
+ async verifySignature(content, signature, publicKey) {
235
239
  if (!signature.startsWith('ed25519:') || !publicKey.startsWith('ed25519:')) {
236
240
  return false;
237
241
  }
238
242
  try {
239
- // For HMAC-based signatures (used in publish.ts)
240
- const sigHex = signature.replace('ed25519:', '');
241
- const keyHex = publicKey.replace('ed25519:', '');
242
- // Verify HMAC signature
243
- const expectedSig = crypto
244
- .createHmac('sha256', keyHex)
245
- .update(content)
246
- .digest('hex');
247
- // Constant-time comparison to prevent timing attacks
248
- return crypto.timingSafeEqual(Buffer.from(sigHex, 'hex'), Buffer.from(expectedSig, 'hex'));
243
+ const ed = await import('@noble/ed25519');
244
+ const sigBytes = Buffer.from(signature.slice('ed25519:'.length), 'hex');
245
+ const pubBytes = Buffer.from(publicKey.slice('ed25519:'.length), 'hex');
246
+ if (sigBytes.length !== 64 || pubBytes.length !== 32) {
247
+ return false;
248
+ }
249
+ // RFC 8032 strict mode, as in transfer/ipfs/client.ts.
250
+ return await ed.verifyAsync(sigBytes, content, pubBytes, { zip215: false });
249
251
  }
250
252
  catch {
251
- // If crypto verification fails, check basic format
252
- return signature.length > 20 && publicKey.length > 20;
253
+ return false;
253
254
  }
254
255
  }
255
256
  /**
@@ -16,7 +16,7 @@ export declare class PatternPublisher {
16
16
  */
17
17
  publishPattern(cfp: CFPFormat, options: PublishOptions): Promise<PublishResult>;
18
18
  /**
19
- * Sign content with private key
19
+ * Sign content with Ed25519. The private key file holds a 32-byte hex seed.
20
20
  */
21
21
  private signContent;
22
22
  /**
@@ -37,7 +37,7 @@ export class PatternPublisher {
37
37
  let signature;
38
38
  let publicKey;
39
39
  if (options.privateKeyPath && fs.existsSync(options.privateKeyPath)) {
40
- const signResult = this.signContent(contentBuffer, options.privateKeyPath);
40
+ const signResult = await this.signContent(contentBuffer, options.privateKeyPath);
41
41
  signature = signResult.signature;
42
42
  publicKey = signResult.publicKey;
43
43
  console.log(`[Publish] Content signed`);
@@ -148,21 +148,20 @@ export class PatternPublisher {
148
148
  }
149
149
  }
150
150
  /**
151
- * Sign content with private key
151
+ * Sign content with Ed25519. The private key file holds a 32-byte hex seed.
152
152
  */
153
- signContent(content, privateKeyPath) {
154
- // In production: Use actual Ed25519 signing
155
- // For demo: Generate mock signature
156
- const privateKey = fs.readFileSync(privateKeyPath, 'utf-8').trim();
157
- const signature = crypto
158
- .createHmac('sha256', privateKey)
159
- .update(content)
160
- .digest('hex');
161
- const publicKey = 'ed25519:' +
162
- crypto.createHash('sha256').update(privateKey).digest('hex').slice(0, 32);
153
+ async signContent(content, privateKeyPath) {
154
+ const ed = await import('@noble/ed25519');
155
+ const raw = fs.readFileSync(privateKeyPath, 'utf-8').trim();
156
+ const seed = Buffer.from(raw, 'hex');
157
+ if (seed.length !== 32 || seed.toString('hex') !== raw.toLowerCase()) {
158
+ throw new Error(`[Publish] Ed25519 private key at ${privateKeyPath} must be a 32-byte hex seed.`);
159
+ }
160
+ const pub = await ed.getPublicKeyAsync(seed);
161
+ const sig = await ed.signAsync(content, seed);
163
162
  return {
164
- signature: `ed25519:${signature}`,
165
- publicKey,
163
+ signature: 'ed25519:' + Buffer.from(sig).toString('hex'),
164
+ publicKey: 'ed25519:' + Buffer.from(pub).toString('hex'),
166
165
  };
167
166
  }
168
167
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.72.2",
3
+ "version": "3.73.0",
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",
@@ -105,12 +105,13 @@
105
105
  "@claude-flow/codex": "3.0.6",
106
106
  "@claude-flow/mcp": "3.1.6",
107
107
  "@claude-flow/neural": "3.0.3",
108
- "@claude-flow/plugin-agent-federation": "1.0.5",
108
+ "@claude-flow/plugin-agent-federation": "1.0.7",
109
109
  "@claude-flow/security": "3.0.6",
110
110
  "@claude-flow/shared": "3.0.7",
111
111
  "@iarna/toml": "^2.2.5",
112
112
  "@noble/ed25519": "2.3.0",
113
113
  "@ruvector/rabitq-wasm": "0.1.2",
114
+ "agentic-flow": "^3.0.0",
114
115
  "ajv": "^8.20.0",
115
116
  "bcryptjs": "^3.0.3",
116
117
  "chalk": "^5.3.0",
@@ -132,15 +133,14 @@
132
133
  },
133
134
  "optionalDependencies": {
134
135
  "@agntcy/slim-bindings": "2.1.1",
135
- "@claude-flow/aidefence": "3.1.0",
136
+ "@claude-flow/aidefence": "3.1.1",
136
137
  "@claude-flow/memory": "3.2.3",
137
138
  "@metaharness/darwin": "~0.13.0",
138
139
  "@metaharness/flywheel": "~0.1.10",
139
140
  "@metaharness/radio": "~0.1.0",
140
141
  "@metaharness/turn-credit": "~0.1.0",
141
142
  "@napi-rs/keyring": "1.3.0",
142
- "agentdb": "^3.3.0",
143
- "agentic-flow": "^3.0.0",
143
+ "agentdb": "^3.6.0",
144
144
  "better-sqlite3": "^12.9.0",
145
145
  "ruvector": "^0.3.13",
146
146
  "nostr-tools": "^2.7.0",