@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.
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +53 -224
- package/.claude/helpers/helpers.manifest.json +6 -6
- package/.claude/helpers/hook-handler.cjs +10 -89
- package/.claude/helpers/intelligence.cjs +1 -23
- package/.claude/helpers/statusline.cjs +14 -29
- package/README.md +29 -21
- package/catalog-manifest.json +2 -2
- package/dist/src/commands/agent.js +2 -0
- package/dist/src/commands/doctor.js +5 -3
- package/dist/src/commands/funnel.d.ts +1 -0
- package/dist/src/commands/funnel.js +37 -2
- package/dist/src/commands/hooks.js +16 -2
- package/dist/src/commands/init.js +70 -16
- package/dist/src/commands/mcp.js +15 -0
- package/dist/src/commands/swarm.js +2 -0
- package/dist/src/funnel/activation.d.ts +30 -0
- package/dist/src/funnel/activation.js +69 -0
- package/dist/src/funnel/events.js +4 -1
- package/dist/src/funnel/index.d.ts +2 -1
- package/dist/src/funnel/index.js +2 -1
- package/dist/src/funnel/message-transport.d.ts +12 -0
- package/dist/src/funnel/message-transport.js +23 -1
- package/dist/src/funnel/types.d.ts +2 -2
- package/dist/src/init/first-win.d.ts +24 -0
- package/dist/src/init/first-win.js +97 -0
- package/dist/src/mcp-tools/agent-tools.js +2 -0
- package/dist/src/mcp-tools/memory-tools.js +17 -0
- package/dist/src/mcp-tools/metaharness-tools.js +19 -0
- package/dist/src/mcp-tools/swarm-tools.js +2 -0
- package/dist/src/memory/memory-bridge.d.ts +2 -0
- package/dist/src/memory/memory-bridge.js +1 -1
- package/dist/src/memory/memory-initializer.d.ts +2 -0
- package/dist/src/memory/memory-initializer.js +1 -1
- package/dist/src/metaharness/darwin-lib.d.ts +68 -0
- package/dist/src/metaharness/darwin-lib.js +150 -0
- package/dist/src/transfer/store/download.d.ts +1 -1
- package/dist/src/transfer/store/download.js +22 -21
- package/dist/src/transfer/store/publish.d.ts +1 -1
- package/dist/src/transfer/store/publish.js +13 -14
- package/node_modules/@claude-flow/plugin-agent-federation/package.json +5 -5
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts +138 -106
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts.map +1 -1
- package/node_modules/@claude-flow/security/dist/input-validator.js +23 -26
- package/node_modules/@claude-flow/security/dist/input-validator.js.map +1 -1
- package/node_modules/@claude-flow/security/package.json +2 -2
- package/package.json +10 -10
- package/plugins/ruflo-metaharness/.claude-plugin/plugin.json +1 -1
- package/plugins/ruflo-metaharness/CHANGELOG.md +3 -0
- package/plugins/ruflo-metaharness/scripts/_darwin.mjs +13 -0
- package/plugins/ruflo-metaharness/scripts/bench.mjs +34 -2
- 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
|
|
@@ -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]
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
|
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
|
-
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const
|
|
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:
|
|
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.
|
|
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.
|
|
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.
|
|
49
|
+
"ws": "^8.21.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"agentic-flow": "
|
|
53
|
-
"midstreamer": "
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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<
|
|
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<
|
|
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
|
-
},
|
|
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.
|
|
116
|
-
role: z.ZodEnum<
|
|
117
|
-
|
|
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
|
-
},
|
|
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<
|
|
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
|
-
},
|
|
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<
|
|
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<
|
|
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
|
-
},
|
|
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<
|
|
178
|
-
|
|
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
|
-
},
|
|
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.
|
|
256
|
+
export declare const CommandArgumentSchema: z.ZodString;
|
|
197
257
|
/**
|
|
198
258
|
* Path schema
|
|
199
259
|
*/
|
|
200
|
-
export declare const PathSchema: z.
|
|
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
|
-
},
|
|
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
|
|
231
|
-
blockedPatterns: z.ZodOptional<z.ZodArray<z.ZodString
|
|
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.
|
|
280
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
235
281
|
allowSudo: z.ZodDefault<z.ZodBoolean>;
|
|
236
|
-
},
|
|
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.
|
|
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.
|
|
303
|
+
static safeParse<T>(schema: z.ZodType<T>, input: unknown): z.ZodSafeParseResult<T>;
|
|
272
304
|
/**
|
|
273
305
|
* Validates email
|
|
274
306
|
*/
|