@claude-flow/cli 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 (33) hide show
  1. package/.claude/helpers/helpers.manifest.json +2 -2
  2. package/README.md +29 -21
  3. package/catalog-manifest.json +2 -2
  4. package/dist/src/commands/agent.js +2 -0
  5. package/dist/src/commands/funnel.d.ts +1 -0
  6. package/dist/src/commands/funnel.js +37 -2
  7. package/dist/src/commands/hooks.js +16 -2
  8. package/dist/src/commands/init.js +70 -16
  9. package/dist/src/commands/mcp.js +15 -0
  10. package/dist/src/commands/swarm.js +2 -0
  11. package/dist/src/funnel/activation.d.ts +30 -0
  12. package/dist/src/funnel/activation.js +69 -0
  13. package/dist/src/funnel/events.js +4 -1
  14. package/dist/src/funnel/index.d.ts +2 -1
  15. package/dist/src/funnel/index.js +2 -1
  16. package/dist/src/funnel/message-transport.d.ts +12 -0
  17. package/dist/src/funnel/message-transport.js +23 -1
  18. package/dist/src/funnel/types.d.ts +2 -2
  19. package/dist/src/init/first-win.d.ts +24 -0
  20. package/dist/src/init/first-win.js +97 -0
  21. package/dist/src/mcp-tools/agent-tools.js +2 -0
  22. package/dist/src/mcp-tools/swarm-tools.js +2 -0
  23. package/dist/src/missions/schemas.d.ts +117 -117
  24. package/dist/src/mods/command-registry/schema.d.ts +121 -121
  25. package/dist/src/transfer/store/download.d.ts +1 -1
  26. package/dist/src/transfer/store/download.js +22 -21
  27. package/dist/src/transfer/store/publish.d.ts +1 -1
  28. package/dist/src/transfer/store/publish.js +13 -14
  29. package/node_modules/@claude-flow/codex/dist/cli.js +0 -0
  30. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +0 -0
  31. package/node_modules/@claude-flow/plugin-agent-federation/package.json +5 -5
  32. package/node_modules/@claude-flow/security/dist/input-validator.d.ts +6 -6
  33. package/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
  /**
File without changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/plugin-agent-federation",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Cross-installation agent federation with zero-trust security, PII-gated data flow, and compliance-grade audit trails.",
5
5
  "homepage": "https://github.com/ruvnet/ruflo",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "@claude-flow/shared": "^3.0.0",
27
27
  "@claude-flow/security": "^3.0.0",
28
28
  "@types/ws": "^8.18.1",
29
- "agentic-flow": "2.0.12-fix.8",
29
+ "agentic-flow": "2.0.14",
30
30
  "typescript": "^5.4.0",
31
31
  "vitest": "^4.1.0"
32
32
  },
@@ -46,11 +46,11 @@
46
46
  "sourceDependencies": {
47
47
  "dependencies": {
48
48
  "@noble/ed25519": "^2.0.0",
49
- "ws": "^8.20.0"
49
+ "ws": "^8.21.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "agentic-flow": ">=2.0.12-fix.8 <4.0.0",
53
- "midstreamer": ">=0.3.1"
52
+ "agentic-flow": "^2.0.14 || ^3.0.0",
53
+ "midstreamer": "^0.3.2"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "agentic-flow": {
@@ -159,14 +159,14 @@ export declare const SpawnAgentSchema: z.ZodObject<{
159
159
  timeout: z.ZodOptional<z.ZodNumber>;
160
160
  }, "strip", z.ZodTypeAny, {
161
161
  type: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
162
+ id?: string | undefined;
162
163
  config?: Record<string, unknown> | undefined;
163
164
  timeout?: number | undefined;
164
- id?: string | undefined;
165
165
  }, {
166
166
  type: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
167
+ id?: string | undefined;
167
168
  config?: Record<string, unknown> | undefined;
168
169
  timeout?: number | undefined;
169
- id?: string | undefined;
170
170
  }>;
171
171
  /**
172
172
  * Task input schema
@@ -181,13 +181,13 @@ export declare const TaskInputSchema: z.ZodObject<{
181
181
  taskId: string;
182
182
  content: string;
183
183
  agentType: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
184
- priority?: "critical" | "high" | "medium" | "low" | undefined;
184
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
185
185
  metadata?: Record<string, unknown> | undefined;
186
186
  }, {
187
187
  taskId: string;
188
188
  content: string;
189
189
  agentType: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
190
- priority?: "critical" | "high" | "medium" | "low" | undefined;
190
+ priority?: "low" | "medium" | "high" | "critical" | undefined;
191
191
  metadata?: Record<string, unknown> | undefined;
192
192
  }>;
193
193
  /**
@@ -234,16 +234,16 @@ export declare const ExecutorConfigSchema: z.ZodObject<{
234
234
  cwd: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
235
235
  allowSudo: z.ZodDefault<z.ZodBoolean>;
236
236
  }, "strip", z.ZodTypeAny, {
237
- allowedCommands: string[];
238
237
  timeout: number;
238
+ allowedCommands: string[];
239
239
  maxBuffer: number;
240
240
  allowSudo: boolean;
241
241
  blockedPatterns?: string[] | undefined;
242
242
  cwd?: string | undefined;
243
243
  }, {
244
244
  allowedCommands: string[];
245
- blockedPatterns?: string[] | undefined;
246
245
  timeout?: number | undefined;
246
+ blockedPatterns?: string[] | undefined;
247
247
  maxBuffer?: number | undefined;
248
248
  cwd?: string | undefined;
249
249
  allowSudo?: boolean | undefined;
package/package.json CHANGED
@@ -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",