claude-flow 3.75.2 → 3.76.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 (32) hide show
  1. package/.claude/.proven-config-version +1 -0
  2. package/.claude/proven-config.json +42 -0
  3. package/node_modules/@claude-flow/plugin-agent-federation/package.json +16 -4
  4. package/node_modules/@claude-flow/security/README.md +43 -0
  5. package/node_modules/@claude-flow/security/package.json +23 -0
  6. package/package.json +2 -2
  7. package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
  8. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +1 -1
  9. package/v3/@claude-flow/cli/dist/src/init/helper-companions.js +64 -2
  10. package/v3/@claude-flow/cli/dist/src/init/settings-risk-scanner.js +16 -1
  11. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +64 -6
  12. package/v3/@claude-flow/cli/dist/src/mcp-tools/metaharness-tools.js +1 -1
  13. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +9 -2
  14. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +2 -0
  15. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +7 -3
  16. package/v3/@claude-flow/cli/dist/src/missions/schemas.d.ts +124 -124
  17. package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.d.ts +199 -199
  18. package/v3/@claude-flow/cli/dist/src/ruvector/centroid-router.d.ts +87 -0
  19. package/v3/@claude-flow/cli/dist/src/ruvector/centroid-router.js +154 -0
  20. package/v3/@claude-flow/cli/dist/src/ruvector/router-embedder.d.ts +2 -0
  21. package/v3/@claude-flow/cli/dist/src/ruvector/router-embedder.js +7 -0
  22. package/v3/@claude-flow/cli/dist/src/services/distill-oracle.d.ts +1 -1
  23. package/v3/@claude-flow/cli/dist/src/services/distill-oracle.js +2 -2
  24. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +10 -3
  25. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +33 -16
  26. package/v3/@claude-flow/cli/package.json +10 -6
  27. package/v3/@claude-flow/shared/README.md +39 -0
  28. package/v3/@claude-flow/shared/dist/core/config/schema.d.ts +114 -1516
  29. package/v3/@claude-flow/shared/dist/core/config/schema.js +4 -4
  30. package/v3/@claude-flow/shared/dist/core/config/validator.d.ts +2 -2
  31. package/v3/@claude-flow/shared/dist/core/config/validator.js +17 -3
  32. package/v3/@claude-flow/shared/package.json +25 -4
@@ -23,7 +23,7 @@ export const AgentConfigSchema = z.object({
23
23
  maxMemoryMb: z.number().int().positive().optional(),
24
24
  maxCpuPercent: z.number().min(0).max(100).optional(),
25
25
  }).optional(),
26
- metadata: z.record(z.unknown()).optional(),
26
+ metadata: z.record(z.string(), z.unknown()).optional(),
27
27
  });
28
28
  /**
29
29
  * Task configuration schema
@@ -34,7 +34,7 @@ export const TaskConfigSchema = z.object({
34
34
  priority: z.number().int().min(0).max(100).default(50),
35
35
  timeout: z.number().int().positive().optional(),
36
36
  assignedAgent: z.string().optional(),
37
- input: z.record(z.unknown()).optional(),
37
+ input: z.record(z.string(), z.unknown()).optional(),
38
38
  metadata: z.object({
39
39
  requiredCapabilities: z.array(z.string()).optional(),
40
40
  retryCount: z.number().int().min(0).optional(),
@@ -71,7 +71,7 @@ export const SwarmConfigSchema = z.object({
71
71
  batchSize: z.number().int().positive().default(10),
72
72
  flushIntervalMs: z.number().int().positive().default(100),
73
73
  }).optional(),
74
- metadata: z.record(z.unknown()).optional(),
74
+ metadata: z.record(z.string(), z.unknown()).optional(),
75
75
  });
76
76
  /**
77
77
  * Memory configuration schema
@@ -121,7 +121,7 @@ export const MCPServerConfigSchema = z.object({
121
121
  resources: z.boolean().default(true),
122
122
  prompts: z.boolean().default(true),
123
123
  logging: z.boolean().default(true),
124
- experimental: z.record(z.boolean()).optional(),
124
+ experimental: z.record(z.string(), z.boolean()).optional(),
125
125
  }).optional(),
126
126
  });
127
127
  /**
@@ -55,7 +55,7 @@ export declare class ConfigValidator {
55
55
  /**
56
56
  * Validate and throw on error
57
57
  */
58
- static validateOrThrow<TInput, TOutput>(schema: z.ZodType<TOutput, z.ZodTypeDef, TInput>, data: unknown, configName: string): TOutput;
58
+ static validateOrThrow<TInput, TOutput>(schema: z.ZodType<TOutput, TInput>, data: unknown, configName: string): TOutput;
59
59
  /**
60
60
  * Validate agent config or throw
61
61
  */
@@ -87,6 +87,6 @@ export declare class ConfigValidator {
87
87
  /**
88
88
  * Check if data matches schema
89
89
  */
90
- static isValid<TInput, TOutput>(schema: z.ZodType<TOutput, z.ZodTypeDef, TInput>, data: unknown): boolean;
90
+ static isValid<TInput, TOutput>(schema: z.ZodType<TOutput, TInput>, data: unknown): boolean;
91
91
  }
92
92
  //# sourceMappingURL=validator.d.ts.map
@@ -8,12 +8,24 @@ import { AgentConfigSchema, TaskConfigSchema, SwarmConfigSchema, MemoryConfigSch
8
8
  * Convert Zod error to validation errors
9
9
  */
10
10
  function zodErrorToValidationErrors(error) {
11
- return error.errors.map((e) => ({
12
- path: e.path.join('.'),
11
+ return error.issues.map((e) => ({
12
+ path: e.path.map(String).join('.'),
13
13
  message: e.message,
14
14
  code: e.code,
15
15
  }));
16
16
  }
17
+ function isZodErrorLike(error) {
18
+ if (!(error instanceof Error) || error.name !== 'ZodError')
19
+ return false;
20
+ const issues = error.issues;
21
+ return (Array.isArray(issues) &&
22
+ issues.length > 0 &&
23
+ issues.every((i) => i !== null &&
24
+ typeof i === 'object' &&
25
+ Array.isArray(i.path) &&
26
+ typeof i.message === 'string' &&
27
+ typeof i.code === 'string'));
28
+ }
17
29
  /**
18
30
  * Generic validation function
19
31
  * Uses parse + try/catch to get output types with defaults applied
@@ -27,7 +39,9 @@ function validate(schema, data) {
27
39
  };
28
40
  }
29
41
  catch (error) {
30
- if (error instanceof z.ZodError) {
42
+ // Callers may pass a schema built with another zod copy (e.g. zod 3),
43
+ // whose ZodError is not an instance of this one. Match on shape.
44
+ if (error instanceof z.ZodError || isZodErrorLike(error)) {
31
45
  return {
32
46
  success: false,
33
47
  errors: zodErrorToValidationErrors(error),
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@claude-flow/shared",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "type": "module",
5
- "description": "Shared module - common types, events, utilities, core interfaces",
5
+ "description": "Shared types, event bus, config schemas and validators, MCP transport helpers and resilience utilities used by the Ruflo (claude-flow) V3 packages.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
@@ -30,11 +30,11 @@
30
30
  "dependencies": {
31
31
  "@types/ws": "^8.5.10",
32
32
  "cors": "^2.8.5",
33
- "express": "^4.22.2 || ^5.0.0",
33
+ "express": "^4.22.3 || ^5.1.0",
34
34
  "helmet": "^7.2.0",
35
35
  "sql.js": "^1.10.3",
36
36
  "ws": "^8.21.0",
37
- "zod": "^3.22.4"
37
+ "zod": "^4.6.7"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/cors": "^2.8.17",
@@ -45,5 +45,26 @@
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
48
+ },
49
+ "keywords": [
50
+ "ruflo",
51
+ "claude-flow",
52
+ "shared",
53
+ "types",
54
+ "event-bus",
55
+ "config-validation",
56
+ "zod",
57
+ "mcp",
58
+ "resilience",
59
+ "typescript"
60
+ ],
61
+ "homepage": "https://ruv.io",
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/ruvnet/ruflo.git",
65
+ "directory": "v3/@claude-flow/shared"
66
+ },
67
+ "bugs": {
68
+ "url": "https://github.com/ruvnet/ruflo/issues"
48
69
  }
49
70
  }