claude-flow 3.75.2 → 3.75.3
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/node_modules/@claude-flow/plugin-agent-federation/package.json +16 -4
- package/node_modules/@claude-flow/security/README.md +43 -0
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts +3 -3
- package/node_modules/@claude-flow/security/package.json +23 -0
- package/package.json +2 -2
- package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
- package/v3/@claude-flow/cli/dist/src/init/helper-companions.js +64 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +5 -0
- package/v3/@claude-flow/cli/dist/src/missions/schemas.d.ts +124 -124
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.d.ts +199 -199
- package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +10 -3
- package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +33 -16
- package/v3/@claude-flow/cli/package.json +4 -4
- package/v3/@claude-flow/shared/README.md +39 -0
- package/v3/@claude-flow/shared/dist/core/config/schema.d.ts +114 -1516
- package/v3/@claude-flow/shared/dist/core/config/schema.js +4 -4
- package/v3/@claude-flow/shared/dist/core/config/validator.d.ts +2 -2
- package/v3/@claude-flow/shared/dist/core/config/validator.js +17 -3
- package/v3/@claude-flow/shared/package.json +25 -4
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
"name": "@claude-flow/plugin-agent-federation",
|
|
3
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
|
-
"homepage": "https://
|
|
5
|
+
"homepage": "https://ruv.io",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ruvnet/ruflo.git",
|
|
9
|
+
"directory": "v3/@claude-flow/plugin-agent-federation"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ruvnet/ruflo/issues"
|
|
13
|
+
},
|
|
6
14
|
"type": "module",
|
|
7
15
|
"main": "dist/index.js",
|
|
8
16
|
"types": "dist/index.d.ts",
|
|
@@ -33,11 +41,15 @@
|
|
|
33
41
|
"keywords": [
|
|
34
42
|
"federation",
|
|
35
43
|
"multi-agent",
|
|
36
|
-
"
|
|
44
|
+
"ai-agents",
|
|
45
|
+
"zero-trust",
|
|
37
46
|
"pii",
|
|
38
47
|
"security",
|
|
39
|
-
"audit",
|
|
40
|
-
"compliance"
|
|
48
|
+
"audit-trail",
|
|
49
|
+
"compliance",
|
|
50
|
+
"claude-flow-plugin",
|
|
51
|
+
"claude-flow",
|
|
52
|
+
"ruflo"
|
|
41
53
|
],
|
|
42
54
|
"author": "Claude Flow Team",
|
|
43
55
|
"license": "MIT",
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/ruvnet/ruflo/main/docs/assets/readme/packages/security-boundary-quickstart.svg" alt="@claude-flow/security quickstart: a valid email passes, an invalid one is rejected with a ZodError, a bcrypt hash verifies, and a 48-character API key is generated." width="100%"></p>
|
|
2
|
+
|
|
1
3
|
# @claude-flow/security
|
|
2
4
|
|
|
5
|
+
**Security primitives for the system boundary of an agent app:** validate input, hash passwords, generate credentials, and block command injection and path traversal.
|
|
6
|
+
|
|
3
7
|
[](https://www.npmjs.com/package/@claude-flow/security)
|
|
4
8
|
[](https://www.npmjs.com/package/@claude-flow/security)
|
|
5
9
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -24,6 +28,45 @@
|
|
|
24
28
|
npm install @claude-flow/security
|
|
25
29
|
```
|
|
26
30
|
|
|
31
|
+
<!-- weaver:seo:quickstart -->
|
|
32
|
+
## Supported environments
|
|
33
|
+
|
|
34
|
+
- Node.js, ESM (`import`). The quickstart below was run on Node 22 (Linux x64).
|
|
35
|
+
- Pure JavaScript dependencies (`bcryptjs`, `zod`, `@noble/ed25519`). No native build step.
|
|
36
|
+
- Works standalone. The Ruflo CLI (`@claude-flow/cli`) isn't required.
|
|
37
|
+
|
|
38
|
+
## Quickstart (verified)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install @claude-flow/security
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
// quickstart.mjs
|
|
46
|
+
import { InputValidator, EmailSchema, PasswordHasher, createCredentialGenerator } from '@claude-flow/security';
|
|
47
|
+
|
|
48
|
+
console.log('email ok:', InputValidator.validate(EmailSchema, 'user@example.com'));
|
|
49
|
+
try { InputValidator.validate(EmailSchema, 'not-an-email'); } catch (e) { console.log('rejected:', e.constructor.name); }
|
|
50
|
+
|
|
51
|
+
const hasher = new PasswordHasher({ rounds: 12 });
|
|
52
|
+
const hash = await hasher.hash('CorrectHorseBatteryStaple9');
|
|
53
|
+
console.log('hash prefix:', hash.slice(0, 7), 'verify:', await hasher.verify('CorrectHorseBatteryStaple9', hash));
|
|
54
|
+
|
|
55
|
+
const apiKey = createCredentialGenerator().generateApiKey('ck_live_');
|
|
56
|
+
console.log('api key prefix:', apiKey.key.slice(0, 8), 'length:', apiKey.key.length);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Expected output (`node quickstart.mjs`, @claude-flow/security 3.0.7):
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
email ok: user@example.com
|
|
63
|
+
rejected: ZodError
|
|
64
|
+
hash prefix: $2b$12$ verify: true
|
|
65
|
+
api key prefix: ck_live_ length: 48
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Next:** add prompt-injection and jailbreak detection for LLM input with [`@claude-flow/aidefence`](https://www.npmjs.com/package/@claude-flow/aidefence).
|
|
69
|
+
|
|
27
70
|
## Standalone use (without the Ruflo CLI)
|
|
28
71
|
|
|
29
72
|
This is a plain library — every primitive (`PasswordHasher`,
|
|
@@ -243,10 +243,10 @@ export declare const TaskInputSchema: z.ZodObject<{
|
|
|
243
243
|
"project-coordinator": "project-coordinator";
|
|
244
244
|
}>;
|
|
245
245
|
priority: z.ZodOptional<z.ZodEnum<{
|
|
246
|
-
critical: "critical";
|
|
247
|
-
high: "high";
|
|
248
|
-
medium: "medium";
|
|
249
246
|
low: "low";
|
|
247
|
+
medium: "medium";
|
|
248
|
+
high: "high";
|
|
249
|
+
critical: "critical";
|
|
250
250
|
}>>;
|
|
251
251
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
252
252
|
}, z.core.$strip>;
|
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
"version": "3.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Security module - CVE fixes, input validation, path security",
|
|
6
|
+
"homepage": "https://ruv.io",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ruvnet/ruflo.git",
|
|
10
|
+
"directory": "v3/@claude-flow/security"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ruvnet/ruflo/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"security",
|
|
17
|
+
"input-validation",
|
|
18
|
+
"path-traversal",
|
|
19
|
+
"command-injection",
|
|
20
|
+
"password-hashing",
|
|
21
|
+
"bcrypt",
|
|
22
|
+
"credential-management",
|
|
23
|
+
"zod",
|
|
24
|
+
"ai-agents",
|
|
25
|
+
"claude-flow",
|
|
26
|
+
"ruflo",
|
|
27
|
+
"typescript"
|
|
28
|
+
],
|
|
6
29
|
"main": "dist/index.js",
|
|
7
30
|
"types": "dist/index.d.ts",
|
|
8
31
|
"files": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.75.
|
|
3
|
+
"version": "3.75.3",
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"v3/@claude-flow/codex",
|
|
6
6
|
"v3/@claude-flow/mcp",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@claude-flow/neural": "3.0.3",
|
|
76
76
|
"@claude-flow/plugin-agent-federation": "1.0.7",
|
|
77
77
|
"@claude-flow/security": "3.0.7",
|
|
78
|
-
"@claude-flow/shared": "3.0.
|
|
78
|
+
"@claude-flow/shared": "3.0.8",
|
|
79
79
|
"@electron/asar": "^4.3.1",
|
|
80
80
|
"@iarna/toml": "^2.2.5",
|
|
81
81
|
"@noble/ed25519": "2.3.0",
|
|
@@ -12,9 +12,40 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import * as fs from 'fs';
|
|
14
14
|
import * as path from 'path';
|
|
15
|
+
import { randomUUID } from 'node:crypto';
|
|
15
16
|
export const COMMONJS_COMPANION_HELPERS = ['session.cjs', 'memory.cjs'];
|
|
17
|
+
/** Missing is distinct from unreadable, a symlink (including dangling), or another file type. */
|
|
18
|
+
function companionState(target) {
|
|
19
|
+
try {
|
|
20
|
+
const stat = fs.lstatSync(target);
|
|
21
|
+
return stat.isFile() && !stat.isSymbolicLink() ? 'regular' : 'unsafe';
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
return error.code === 'ENOENT' ? 'missing' : 'unsafe';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** The project/user root can itself be an alias; its helper directories may not be links. */
|
|
28
|
+
function safeHelpersDirectory(helpersDir) {
|
|
29
|
+
try {
|
|
30
|
+
for (const directory of [path.dirname(helpersDir), helpersDir]) {
|
|
31
|
+
const stat = fs.lstatSync(directory);
|
|
32
|
+
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
16
41
|
export async function ensureCommonJsCompanions(helpersDir, force = false) {
|
|
17
|
-
|
|
42
|
+
helpersDir = path.resolve(helpersDir);
|
|
43
|
+
if (!safeHelpersDirectory(helpersDir))
|
|
44
|
+
return [];
|
|
45
|
+
const missing = COMMONJS_COMPANION_HELPERS.filter((name) => {
|
|
46
|
+
const state = companionState(path.join(helpersDir, name));
|
|
47
|
+
return state === 'missing' || (force && state === 'regular');
|
|
48
|
+
});
|
|
18
49
|
if (missing.length === 0)
|
|
19
50
|
return [];
|
|
20
51
|
const gen = await import('./helpers-generator.js');
|
|
@@ -24,11 +55,42 @@ export async function ensureCommonJsCompanions(helpersDir, force = false) {
|
|
|
24
55
|
};
|
|
25
56
|
const written = [];
|
|
26
57
|
for (const name of missing) {
|
|
58
|
+
const target = path.join(helpersDir, name);
|
|
59
|
+
const temporary = path.join(helpersDir, `.${name}.${randomUUID()}.tmp`);
|
|
60
|
+
let created = false;
|
|
27
61
|
try {
|
|
28
|
-
|
|
62
|
+
// The import above yields: recheck before writing, and again before publication.
|
|
63
|
+
if (!safeHelpersDirectory(helpersDir))
|
|
64
|
+
continue;
|
|
65
|
+
const state = companionState(target);
|
|
66
|
+
if (state === 'unsafe' || (!force && state === 'regular'))
|
|
67
|
+
continue;
|
|
68
|
+
const descriptor = fs.openSync(temporary, 'wx', 0o755);
|
|
69
|
+
created = true;
|
|
70
|
+
try {
|
|
71
|
+
fs.writeFileSync(descriptor, content[name](), { encoding: 'utf-8' });
|
|
72
|
+
fs.fchmodSync(descriptor, 0o755);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
fs.closeSync(descriptor);
|
|
76
|
+
}
|
|
77
|
+
if (!safeHelpersDirectory(helpersDir))
|
|
78
|
+
continue;
|
|
79
|
+
const finalState = companionState(target);
|
|
80
|
+
if (finalState === 'unsafe' || (!force && finalState === 'regular'))
|
|
81
|
+
continue;
|
|
82
|
+
fs.renameSync(temporary, target);
|
|
29
83
|
written.push(name);
|
|
30
84
|
}
|
|
31
85
|
catch { /* best-effort: hook-handler degrades gracefully without it */ }
|
|
86
|
+
finally {
|
|
87
|
+
if (created) {
|
|
88
|
+
try {
|
|
89
|
+
fs.unlinkSync(temporary);
|
|
90
|
+
}
|
|
91
|
+
catch { /* renamed or already removed */ }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
32
94
|
}
|
|
33
95
|
return written;
|
|
34
96
|
}
|
|
@@ -392,6 +392,11 @@ export const taskTools = [
|
|
|
392
392
|
if (newStatus === 'in_progress' && !task.startedAt) {
|
|
393
393
|
task.startedAt = new Date().toISOString();
|
|
394
394
|
}
|
|
395
|
+
// Reopening a finished task (completed/failed/cancelled -> pending/in_progress) makes it unfinished
|
|
396
|
+
// again, so it must not keep reporting the completedAt of the run that was undone.
|
|
397
|
+
if (newStatus === 'pending' || newStatus === 'in_progress') {
|
|
398
|
+
task.completedAt = null;
|
|
399
|
+
}
|
|
395
400
|
// A finished task frees its workers, as task_complete and task_cancel do; otherwise a worker
|
|
396
401
|
// whose task was finished through task_update stays `busy` forever, and a later task_complete
|
|
397
402
|
// returns early because the status already reads completed.
|