@claude-flow/cli 3.72.2 → 3.74.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 (52) hide show
  1. package/.claude/helpers/.helpers-version +1 -1
  2. package/.claude/helpers/auto-memory-hook.mjs +53 -224
  3. package/.claude/helpers/helpers.manifest.json +6 -6
  4. package/.claude/helpers/hook-handler.cjs +10 -89
  5. package/.claude/helpers/intelligence.cjs +1 -23
  6. package/.claude/helpers/statusline.cjs +14 -29
  7. package/README.md +29 -21
  8. package/catalog-manifest.json +2 -2
  9. package/dist/src/commands/agent.js +2 -0
  10. package/dist/src/commands/doctor.js +5 -3
  11. package/dist/src/commands/funnel.d.ts +1 -0
  12. package/dist/src/commands/funnel.js +37 -2
  13. package/dist/src/commands/hooks.js +16 -2
  14. package/dist/src/commands/init.js +70 -16
  15. package/dist/src/commands/mcp.js +15 -0
  16. package/dist/src/commands/swarm.js +2 -0
  17. package/dist/src/funnel/activation.d.ts +30 -0
  18. package/dist/src/funnel/activation.js +69 -0
  19. package/dist/src/funnel/events.js +4 -1
  20. package/dist/src/funnel/index.d.ts +2 -1
  21. package/dist/src/funnel/index.js +2 -1
  22. package/dist/src/funnel/message-transport.d.ts +12 -0
  23. package/dist/src/funnel/message-transport.js +23 -1
  24. package/dist/src/funnel/types.d.ts +2 -2
  25. package/dist/src/init/first-win.d.ts +24 -0
  26. package/dist/src/init/first-win.js +97 -0
  27. package/dist/src/mcp-tools/agent-tools.js +2 -0
  28. package/dist/src/mcp-tools/memory-tools.js +17 -0
  29. package/dist/src/mcp-tools/metaharness-tools.js +19 -0
  30. package/dist/src/mcp-tools/swarm-tools.js +2 -0
  31. package/dist/src/memory/memory-bridge.d.ts +2 -0
  32. package/dist/src/memory/memory-bridge.js +1 -1
  33. package/dist/src/memory/memory-initializer.d.ts +2 -0
  34. package/dist/src/memory/memory-initializer.js +1 -1
  35. package/dist/src/metaharness/darwin-lib.d.ts +68 -0
  36. package/dist/src/metaharness/darwin-lib.js +150 -0
  37. package/dist/src/transfer/store/download.d.ts +1 -1
  38. package/dist/src/transfer/store/download.js +22 -21
  39. package/dist/src/transfer/store/publish.d.ts +1 -1
  40. package/dist/src/transfer/store/publish.js +13 -14
  41. package/node_modules/@claude-flow/plugin-agent-federation/package.json +5 -5
  42. package/node_modules/@claude-flow/security/dist/input-validator.d.ts +138 -106
  43. package/node_modules/@claude-flow/security/dist/input-validator.d.ts.map +1 -1
  44. package/node_modules/@claude-flow/security/dist/input-validator.js +23 -26
  45. package/node_modules/@claude-flow/security/dist/input-validator.js.map +1 -1
  46. package/node_modules/@claude-flow/security/package.json +2 -2
  47. package/package.json +10 -10
  48. package/plugins/ruflo-metaharness/.claude-plugin/plugin.json +1 -1
  49. package/plugins/ruflo-metaharness/CHANGELOG.md +3 -0
  50. package/plugins/ruflo-metaharness/scripts/_darwin.mjs +13 -0
  51. package/plugins/ruflo-metaharness/scripts/bench.mjs +34 -2
  52. package/plugins/ruflo-metaharness/scripts/smoke.sh +4 -4
@@ -0,0 +1,150 @@
1
+ /**
2
+ * In-process access to @metaharness/darwin (ADR-526).
3
+ *
4
+ * darwin is a regular dependency of the CLI, so the long-lived MCP server can
5
+ * import it once and answer `metaharness_bench --op verify` and every
6
+ * `metaharness_gepa` op without spawning `node bench.mjs` → `node darwin/cli.js`
7
+ * per call. Each function returns the same {exitCode, json} pair the plugin
8
+ * script would have produced, so callers keep the existing
9
+ * {success, data, degraded, exitCode} contract.
10
+ *
11
+ * Graceful degradation (ADR-150 rule 3) still holds: if the import fails, every
12
+ * function returns null and the caller falls back to the subprocess path.
13
+ */
14
+ import { existsSync, readFileSync } from 'node:fs';
15
+ import { resolve } from 'node:path';
16
+ // The specifiers are held in variables so a missing package degrades at
17
+ // runtime instead of failing the CLI's own type-check or bundling.
18
+ const ROOT_SPEC = '@metaharness/darwin';
19
+ const GEPA_SPEC = '@metaharness/darwin/gepa';
20
+ let rootPromise = null;
21
+ let gepaPromise = null;
22
+ export function loadDarwin() {
23
+ rootPromise ??= import(ROOT_SPEC).then((m) => m, () => null);
24
+ return rootPromise;
25
+ }
26
+ export function loadDarwinGepa() {
27
+ gepaPromise ??= import(GEPA_SPEC).then((m) => m, () => null);
28
+ return gepaPromise;
29
+ }
30
+ /** Test hook: forget the cached modules. */
31
+ export function resetDarwinCache() {
32
+ rootPromise = null;
33
+ gepaPromise = null;
34
+ }
35
+ /**
36
+ * `bench verify <suite>` in-process. Mirrors plugins/ruflo-metaharness/scripts/bench.mjs:
37
+ * exit 2 + no payload for a missing path, exit 1 when the suite fails to load
38
+ * (darwin's loadSuite throws on tamper) or its hash does not match, exit 0 otherwise.
39
+ * Returns null when darwin cannot be imported.
40
+ */
41
+ export async function benchVerify(suitePath) {
42
+ const darwin = await loadDarwin();
43
+ if (!darwin)
44
+ return null;
45
+ if (!suitePath || !existsSync(resolve(suitePath)))
46
+ return { exitCode: 2, json: null };
47
+ const start = Date.now();
48
+ const file = resolve(suitePath);
49
+ try {
50
+ const suite = await darwin.bench.loadSuite(file);
51
+ const check = darwin.bench.verifySuite(suite);
52
+ const tasks = Array.isArray(suite.tasks) ? suite.tasks.length : 0;
53
+ const data = {
54
+ op: 'verify',
55
+ suiteId: suite.id,
56
+ version: suite.version,
57
+ tasks,
58
+ hashOk: check.ok,
59
+ hash: check.actual,
60
+ // Same line the darwin CLI prints, so readers of the old shape keep working.
61
+ stdoutTail: `Suite ${suite.id}@${suite.version}: ${tasks} tasks, hash ${check.ok ? 'OK' : 'MISMATCH'} (${String(check.actual).slice(0, 12)}…)\n`,
62
+ durationMs: Date.now() - start,
63
+ };
64
+ return { exitCode: check.ok ? 0 : 1, json: { success: check.ok, data, generatedAt: new Date().toISOString() } };
65
+ }
66
+ catch (e) {
67
+ const data = { op: 'verify', error: e instanceof Error ? e.message : String(e), durationMs: Date.now() - start };
68
+ return { exitCode: 1, json: { success: false, data, generatedAt: new Date().toISOString() } };
69
+ }
70
+ }
71
+ const GEPA_OPS = ['genome', 'validate', 'render', 'analyze'];
72
+ function readJson(path) {
73
+ try {
74
+ return { ok: true, value: JSON.parse(readFileSync(path, 'utf8')) };
75
+ }
76
+ catch {
77
+ return { ok: false };
78
+ }
79
+ }
80
+ /**
81
+ * GEPA genome ops in-process. Mirrors plugins/ruflo-metaharness/scripts/gepa.mjs,
82
+ * including its exit codes: 2 for input errors (no payload), 1 for an invalid
83
+ * genome with alertOnInvalid, 0 otherwise. Returns null when darwin/gepa cannot
84
+ * be imported.
85
+ */
86
+ export async function gepaOp(input) {
87
+ if (!GEPA_OPS.includes(input.op))
88
+ return { exitCode: 2, json: null };
89
+ const gepa = await loadDarwinGepa();
90
+ if (!gepa)
91
+ return null;
92
+ const start = Date.now();
93
+ let out;
94
+ try {
95
+ const loadGenome = () => {
96
+ if (input.path) {
97
+ if (!existsSync(input.path))
98
+ return null;
99
+ return { genome: gepa.loadGenome(readFileSync, input.path), source: input.path };
100
+ }
101
+ return { genome: gepa.loadCand6Genome(), source: gepa.CAND6_GENOME_PATH };
102
+ };
103
+ if (input.op === 'genome') {
104
+ const loaded = loadGenome();
105
+ if (!loaded)
106
+ return { exitCode: 2, json: null };
107
+ const errors = gepa.validateGenome(loaded.genome);
108
+ out = { op: 'genome', source: loaded.source, valid: errors.length === 0, errors, genome: loaded.genome };
109
+ }
110
+ else if (input.op === 'validate') {
111
+ let raw;
112
+ if (input.path) {
113
+ if (!existsSync(input.path))
114
+ return { exitCode: 2, json: null };
115
+ const r = readJson(input.path);
116
+ if (!r.ok)
117
+ return { exitCode: 2, json: null };
118
+ raw = r.value;
119
+ }
120
+ else {
121
+ raw = gepa.loadCand6Genome();
122
+ }
123
+ const errors = gepa.validateGenome(raw);
124
+ out = { op: 'validate', source: input.path ?? gepa.CAND6_GENOME_PATH, valid: errors.length === 0, errors };
125
+ }
126
+ else if (input.op === 'render') {
127
+ const loaded = loadGenome();
128
+ if (!loaded)
129
+ return { exitCode: 2, json: null };
130
+ const system = gepa.buildSystemFromGenome(loaded.genome, input.ext, input.glob);
131
+ out = { op: 'render', source: loaded.source, chars: system.length, system };
132
+ }
133
+ else {
134
+ if (!input.transcript || !existsSync(input.transcript))
135
+ return { exitCode: 2, json: null };
136
+ const r = readJson(input.transcript);
137
+ if (!r.ok || !Array.isArray(r.value))
138
+ return { exitCode: 2, json: null };
139
+ out = { op: 'analyze', source: input.transcript, entries: r.value.length, analysis: gepa.analyzeTranscript(r.value) };
140
+ }
141
+ }
142
+ catch {
143
+ // gepa.mjs exits 2 on any thrown error (its main().catch handler).
144
+ return { exitCode: 2, json: null };
145
+ }
146
+ out.durationMs = Date.now() - start;
147
+ const exitCode = input.alertOnInvalid && out.valid === false ? 1 : 0;
148
+ return { exitCode, json: out };
149
+ }
150
+ //# sourceMappingURL=darwin-lib.js.map
@@ -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/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": {
@@ -54,7 +54,7 @@ export declare const EmailSchema: z.ZodString;
54
54
  /**
55
55
  * Password schema with complexity requirements
56
56
  */
57
- export declare const PasswordSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
57
+ export declare const PasswordSchema: z.ZodString;
58
58
  /**
59
59
  * UUID schema
60
60
  */
@@ -62,7 +62,7 @@ export declare const UUIDSchema: z.ZodString;
62
62
  /**
63
63
  * URL schema with HTTPS enforcement
64
64
  */
65
- export declare const HttpsUrlSchema: z.ZodEffects<z.ZodString, string, string>;
65
+ export declare const HttpsUrlSchema: z.ZodString;
66
66
  /**
67
67
  * URL schema (allows HTTP for development)
68
68
  */
@@ -78,19 +78,40 @@ export declare const PortSchema: z.ZodNumber;
78
78
  /**
79
79
  * IP address schema (v4)
80
80
  */
81
- export declare const IPv4Schema: z.ZodString;
81
+ export declare const IPv4Schema: z.ZodIPv4;
82
82
  /**
83
83
  * IP address schema (v4 or v6)
84
84
  */
85
- export declare const IPSchema: z.ZodString;
85
+ export declare const IPSchema: z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>;
86
86
  /**
87
87
  * User role schema
88
88
  */
89
- export declare const UserRoleSchema: z.ZodEnum<["admin", "operator", "developer", "viewer", "service"]>;
89
+ export declare const UserRoleSchema: z.ZodEnum<{
90
+ admin: "admin";
91
+ operator: "operator";
92
+ developer: "developer";
93
+ viewer: "viewer";
94
+ service: "service";
95
+ }>;
90
96
  /**
91
97
  * Permission schema
92
98
  */
93
- export declare const PermissionSchema: z.ZodEnum<["swarm.create", "swarm.read", "swarm.update", "swarm.delete", "swarm.scale", "agent.spawn", "agent.read", "agent.terminate", "task.create", "task.read", "task.cancel", "metrics.read", "system.admin", "api.access"]>;
99
+ export declare const PermissionSchema: z.ZodEnum<{
100
+ "swarm.create": "swarm.create";
101
+ "swarm.read": "swarm.read";
102
+ "swarm.update": "swarm.update";
103
+ "swarm.delete": "swarm.delete";
104
+ "swarm.scale": "swarm.scale";
105
+ "agent.spawn": "agent.spawn";
106
+ "agent.read": "agent.read";
107
+ "agent.terminate": "agent.terminate";
108
+ "task.create": "task.create";
109
+ "task.read": "task.read";
110
+ "task.cancel": "task.cancel";
111
+ "metrics.read": "metrics.read";
112
+ "system.admin": "system.admin";
113
+ "api.access": "api.access";
114
+ }>;
94
115
  /**
95
116
  * Login request schema
96
117
  */
@@ -98,106 +119,145 @@ export declare const LoginRequestSchema: z.ZodObject<{
98
119
  email: z.ZodString;
99
120
  password: z.ZodString;
100
121
  mfaCode: z.ZodOptional<z.ZodString>;
101
- }, "strip", z.ZodTypeAny, {
102
- email: string;
103
- password: string;
104
- mfaCode?: string | undefined;
105
- }, {
106
- email: string;
107
- password: string;
108
- mfaCode?: string | undefined;
109
- }>;
122
+ }, z.core.$strip>;
110
123
  /**
111
124
  * User creation schema
112
125
  */
113
126
  export declare const CreateUserSchema: z.ZodObject<{
114
127
  email: z.ZodString;
115
- password: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
116
- role: z.ZodEnum<["admin", "operator", "developer", "viewer", "service"]>;
117
- permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["swarm.create", "swarm.read", "swarm.update", "swarm.delete", "swarm.scale", "agent.spawn", "agent.read", "agent.terminate", "task.create", "task.read", "task.cancel", "metrics.read", "system.admin", "api.access"]>, "many">>;
128
+ password: z.ZodString;
129
+ role: z.ZodEnum<{
130
+ admin: "admin";
131
+ operator: "operator";
132
+ developer: "developer";
133
+ viewer: "viewer";
134
+ service: "service";
135
+ }>;
136
+ permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
137
+ "swarm.create": "swarm.create";
138
+ "swarm.read": "swarm.read";
139
+ "swarm.update": "swarm.update";
140
+ "swarm.delete": "swarm.delete";
141
+ "swarm.scale": "swarm.scale";
142
+ "agent.spawn": "agent.spawn";
143
+ "agent.read": "agent.read";
144
+ "agent.terminate": "agent.terminate";
145
+ "task.create": "task.create";
146
+ "task.read": "task.read";
147
+ "task.cancel": "task.cancel";
148
+ "metrics.read": "metrics.read";
149
+ "system.admin": "system.admin";
150
+ "api.access": "api.access";
151
+ }>>>;
118
152
  isActive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
119
- }, "strip", z.ZodTypeAny, {
120
- email: string;
121
- password: string;
122
- role: "admin" | "operator" | "developer" | "viewer" | "service";
123
- isActive: boolean;
124
- permissions?: ("swarm.create" | "swarm.read" | "swarm.update" | "swarm.delete" | "swarm.scale" | "agent.spawn" | "agent.read" | "agent.terminate" | "task.create" | "task.read" | "task.cancel" | "metrics.read" | "system.admin" | "api.access")[] | undefined;
125
- }, {
126
- email: string;
127
- password: string;
128
- role: "admin" | "operator" | "developer" | "viewer" | "service";
129
- permissions?: ("swarm.create" | "swarm.read" | "swarm.update" | "swarm.delete" | "swarm.scale" | "agent.spawn" | "agent.read" | "agent.terminate" | "task.create" | "task.read" | "task.cancel" | "metrics.read" | "system.admin" | "api.access")[] | undefined;
130
- isActive?: boolean | undefined;
131
- }>;
153
+ }, z.core.$strip>;
132
154
  /**
133
155
  * API key creation schema
134
156
  */
135
157
  export declare const CreateApiKeySchema: z.ZodObject<{
136
158
  name: z.ZodString;
137
- permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["swarm.create", "swarm.read", "swarm.update", "swarm.delete", "swarm.scale", "agent.spawn", "agent.read", "agent.terminate", "task.create", "task.read", "task.cancel", "metrics.read", "system.admin", "api.access"]>, "many">>;
159
+ permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
160
+ "swarm.create": "swarm.create";
161
+ "swarm.read": "swarm.read";
162
+ "swarm.update": "swarm.update";
163
+ "swarm.delete": "swarm.delete";
164
+ "swarm.scale": "swarm.scale";
165
+ "agent.spawn": "agent.spawn";
166
+ "agent.read": "agent.read";
167
+ "agent.terminate": "agent.terminate";
168
+ "task.create": "task.create";
169
+ "task.read": "task.read";
170
+ "task.cancel": "task.cancel";
171
+ "metrics.read": "metrics.read";
172
+ "system.admin": "system.admin";
173
+ "api.access": "api.access";
174
+ }>>>;
138
175
  expiresAt: z.ZodOptional<z.ZodDate>;
139
- }, "strip", z.ZodTypeAny, {
140
- name: string;
141
- permissions?: ("swarm.create" | "swarm.read" | "swarm.update" | "swarm.delete" | "swarm.scale" | "agent.spawn" | "agent.read" | "agent.terminate" | "task.create" | "task.read" | "task.cancel" | "metrics.read" | "system.admin" | "api.access")[] | undefined;
142
- expiresAt?: Date | undefined;
143
- }, {
144
- name: string;
145
- permissions?: ("swarm.create" | "swarm.read" | "swarm.update" | "swarm.delete" | "swarm.scale" | "agent.spawn" | "agent.read" | "agent.terminate" | "task.create" | "task.read" | "task.cancel" | "metrics.read" | "system.admin" | "api.access")[] | undefined;
146
- expiresAt?: Date | undefined;
147
- }>;
176
+ }, z.core.$strip>;
148
177
  /**
149
178
  * Agent type schema
150
179
  */
151
- export declare const AgentTypeSchema: z.ZodEnum<["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"]>;
180
+ export declare const AgentTypeSchema: z.ZodEnum<{
181
+ coder: "coder";
182
+ reviewer: "reviewer";
183
+ tester: "tester";
184
+ planner: "planner";
185
+ researcher: "researcher";
186
+ "security-architect": "security-architect";
187
+ "security-auditor": "security-auditor";
188
+ "memory-specialist": "memory-specialist";
189
+ "swarm-specialist": "swarm-specialist";
190
+ "integration-architect": "integration-architect";
191
+ "performance-engineer": "performance-engineer";
192
+ "core-architect": "core-architect";
193
+ "test-architect": "test-architect";
194
+ "queen-coordinator": "queen-coordinator";
195
+ "project-coordinator": "project-coordinator";
196
+ }>;
152
197
  /**
153
198
  * Agent spawn request schema
154
199
  */
155
200
  export declare const SpawnAgentSchema: z.ZodObject<{
156
- type: z.ZodEnum<["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"]>;
201
+ type: z.ZodEnum<{
202
+ coder: "coder";
203
+ reviewer: "reviewer";
204
+ tester: "tester";
205
+ planner: "planner";
206
+ researcher: "researcher";
207
+ "security-architect": "security-architect";
208
+ "security-auditor": "security-auditor";
209
+ "memory-specialist": "memory-specialist";
210
+ "swarm-specialist": "swarm-specialist";
211
+ "integration-architect": "integration-architect";
212
+ "performance-engineer": "performance-engineer";
213
+ "core-architect": "core-architect";
214
+ "test-architect": "test-architect";
215
+ "queen-coordinator": "queen-coordinator";
216
+ "project-coordinator": "project-coordinator";
217
+ }>;
157
218
  id: z.ZodOptional<z.ZodString>;
158
219
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
159
220
  timeout: z.ZodOptional<z.ZodNumber>;
160
- }, "strip", z.ZodTypeAny, {
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
- config?: Record<string, unknown> | undefined;
163
- timeout?: number | undefined;
164
- id?: string | undefined;
165
- }, {
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
- config?: Record<string, unknown> | undefined;
168
- timeout?: number | undefined;
169
- id?: string | undefined;
170
- }>;
221
+ }, z.core.$strip>;
171
222
  /**
172
223
  * Task input schema
173
224
  */
174
225
  export declare const TaskInputSchema: z.ZodObject<{
175
226
  taskId: z.ZodString;
176
227
  content: z.ZodString;
177
- agentType: z.ZodEnum<["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"]>;
178
- priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
228
+ agentType: z.ZodEnum<{
229
+ coder: "coder";
230
+ reviewer: "reviewer";
231
+ tester: "tester";
232
+ planner: "planner";
233
+ researcher: "researcher";
234
+ "security-architect": "security-architect";
235
+ "security-auditor": "security-auditor";
236
+ "memory-specialist": "memory-specialist";
237
+ "swarm-specialist": "swarm-specialist";
238
+ "integration-architect": "integration-architect";
239
+ "performance-engineer": "performance-engineer";
240
+ "core-architect": "core-architect";
241
+ "test-architect": "test-architect";
242
+ "queen-coordinator": "queen-coordinator";
243
+ "project-coordinator": "project-coordinator";
244
+ }>;
245
+ priority: z.ZodOptional<z.ZodEnum<{
246
+ critical: "critical";
247
+ high: "high";
248
+ medium: "medium";
249
+ low: "low";
250
+ }>>;
179
251
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
180
- }, "strip", z.ZodTypeAny, {
181
- taskId: string;
182
- content: string;
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;
185
- metadata?: Record<string, unknown> | undefined;
186
- }, {
187
- taskId: string;
188
- content: string;
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;
191
- metadata?: Record<string, unknown> | undefined;
192
- }>;
252
+ }, z.core.$strip>;
193
253
  /**
194
254
  * Command argument schema
195
255
  */
196
- export declare const CommandArgumentSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
256
+ export declare const CommandArgumentSchema: z.ZodString;
197
257
  /**
198
258
  * Path schema
199
259
  */
200
- export declare const PathSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
260
+ export declare const PathSchema: z.ZodString;
201
261
  /**
202
262
  * Security configuration schema
203
263
  */
@@ -208,46 +268,18 @@ export declare const SecurityConfigSchema: z.ZodObject<{
208
268
  maxLoginAttempts: z.ZodDefault<z.ZodNumber>;
209
269
  lockoutDuration: z.ZodDefault<z.ZodNumber>;
210
270
  requireMFA: z.ZodDefault<z.ZodBoolean>;
211
- }, "strip", z.ZodTypeAny, {
212
- bcryptRounds: number;
213
- jwtExpiresIn: string;
214
- sessionTimeout: number;
215
- maxLoginAttempts: number;
216
- lockoutDuration: number;
217
- requireMFA: boolean;
218
- }, {
219
- bcryptRounds?: number | undefined;
220
- jwtExpiresIn?: string | undefined;
221
- sessionTimeout?: number | undefined;
222
- maxLoginAttempts?: number | undefined;
223
- lockoutDuration?: number | undefined;
224
- requireMFA?: boolean | undefined;
225
- }>;
271
+ }, z.core.$strip>;
226
272
  /**
227
273
  * Executor configuration schema
228
274
  */
229
275
  export declare const ExecutorConfigSchema: z.ZodObject<{
230
- allowedCommands: z.ZodArray<z.ZodString, "many">;
231
- blockedPatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
276
+ allowedCommands: z.ZodArray<z.ZodString>;
277
+ blockedPatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
232
278
  timeout: z.ZodDefault<z.ZodNumber>;
233
279
  maxBuffer: z.ZodDefault<z.ZodNumber>;
234
- cwd: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
280
+ cwd: z.ZodOptional<z.ZodString>;
235
281
  allowSudo: z.ZodDefault<z.ZodBoolean>;
236
- }, "strip", z.ZodTypeAny, {
237
- allowedCommands: string[];
238
- timeout: number;
239
- maxBuffer: number;
240
- allowSudo: boolean;
241
- blockedPatterns?: string[] | undefined;
242
- cwd?: string | undefined;
243
- }, {
244
- allowedCommands: string[];
245
- blockedPatterns?: string[] | undefined;
246
- timeout?: number | undefined;
247
- maxBuffer?: number | undefined;
248
- cwd?: string | undefined;
249
- allowSudo?: boolean | undefined;
250
- }>;
282
+ }, z.core.$strip>;
251
283
  /**
252
284
  * Sanitizes a string by removing dangerous characters
253
285
  */
@@ -264,11 +296,11 @@ export declare class InputValidator {
264
296
  /**
265
297
  * Validates input against a schema
266
298
  */
267
- static validate<T>(schema: z.ZodSchema<T>, input: unknown): T;
299
+ static validate<T>(schema: z.ZodType<T>, input: unknown): T;
268
300
  /**
269
301
  * Safely validates input, returning result
270
302
  */
271
- static safeParse<T>(schema: z.ZodSchema<T>, input: unknown): z.SafeParseReturnType<unknown, T>;
303
+ static safeParse<T>(schema: z.ZodType<T>, input: unknown): z.ZodSafeParseResult<T>;
272
304
  /**
273
305
  * Validates email
274
306
  */