@claude-flow/cli 3.32.2 → 3.32.4
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.manifest.json +3 -3
- package/.claude/helpers/statusline.cjs +38 -38
- package/catalog-manifest.json +2 -2
- package/dist/src/auth/client.d.ts +89 -0
- package/dist/src/auth/client.js +242 -0
- package/dist/src/auth/constants.d.ts +7 -0
- package/dist/src/auth/constants.js +7 -0
- package/dist/src/auth/scopes.d.ts +14 -0
- package/dist/src/auth/scopes.js +21 -0
- package/dist/src/auth/security-bridge.d.ts +36 -0
- package/dist/src/auth/security-bridge.js +42 -0
- package/dist/src/auth/session.d.ts +20 -0
- package/dist/src/auth/session.js +32 -0
- package/dist/src/auth/state.d.ts +19 -0
- package/dist/src/auth/state.js +53 -0
- package/dist/src/auth/types.d.ts +27 -0
- package/dist/src/auth/types.js +11 -0
- package/dist/src/commands/auth.d.ts +15 -0
- package/dist/src/commands/auth.js +244 -0
- package/dist/src/commands/doctor.js +211 -4
- package/dist/src/commands/index.js +2 -0
- package/dist/src/commands/proxy-lifecycle.d.ts +12 -0
- package/dist/src/commands/proxy-lifecycle.js +232 -0
- package/dist/src/commands/proxy.js +92 -4
- package/dist/src/proxy/install.d.ts +29 -0
- package/dist/src/proxy/install.js +135 -0
- package/dist/src/proxy/lifecycle.d.ts +61 -0
- package/dist/src/proxy/lifecycle.js +249 -0
- package/dist/src/proxy/paths.d.ts +34 -0
- package/dist/src/proxy/paths.js +70 -0
- package/dist/src/proxy/release.d.ts +47 -0
- package/dist/src/proxy/release.js +138 -0
- package/dist/src/proxy/token-bridge.d.ts +5 -0
- package/dist/src/proxy/token-bridge.js +61 -0
- package/dist/src/proxy/verify.d.ts +44 -0
- package/dist/src/proxy/verify.js +68 -0
- package/package.json +2 -2
- package/plugins/ruflo-metaharness/scripts/smoke.sh +11 -11
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* meta-proxy release verification (ADR-307) — mirrors src/init/helper-signing.ts's
|
|
3
|
+
* raw-EdDSA `crypto.verify(null, ...)` pattern almost exactly, and matches the
|
|
4
|
+
* exact scheme confirmed live 2026-07-16 against a real v0.1.0 release: ONE
|
|
5
|
+
* combined `SHA256SUMS.sig` (raw Ed25519 over the `SHA256SUMS` file's bytes,
|
|
6
|
+
* base64-encoded — not a per-binary signature), then a per-asset SHA-256
|
|
7
|
+
* check against the matching `SHA256SUMS` line. Refuse-all-or-nothing on any
|
|
8
|
+
* mismatch, same discipline as `writeCriticalHelpers()`.
|
|
9
|
+
*
|
|
10
|
+
* @module proxy/verify
|
|
11
|
+
*/
|
|
12
|
+
import { createHash, createPublicKey, verify as cryptoVerify } from 'node:crypto';
|
|
13
|
+
/**
|
|
14
|
+
* meta-proxy's committed release-signing public key (SPKI PEM), confirmed
|
|
15
|
+
* live 2026-07-16 by verifying a real `SHA256SUMS.sig` from the v0.1.0
|
|
16
|
+
* release against it (crypto.verify -> true).
|
|
17
|
+
*/
|
|
18
|
+
export const PROXY_RELEASE_PUBKEY_PEM = `-----BEGIN PUBLIC KEY-----
|
|
19
|
+
MCowBQYDK2VwAyEAjhLDomjIGdcltYC7j+aiESQFD4LWoHaULietG1PuDjw=
|
|
20
|
+
-----END PUBLIC KEY-----`;
|
|
21
|
+
export class ReleaseVerificationError extends Error {
|
|
22
|
+
constructor(message) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = 'ReleaseVerificationError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** Raw EdDSA verify of `SHA256SUMS.sig` (base64) over `SHA256SUMS`'s exact bytes. */
|
|
28
|
+
export function verifySha256SumsSignature(sumsBytes, sigBase64, pubkeyPem = PROXY_RELEASE_PUBKEY_PEM) {
|
|
29
|
+
const pubkey = createPublicKey(pubkeyPem);
|
|
30
|
+
const sig = Buffer.from(sigBase64.trim(), 'base64');
|
|
31
|
+
return cryptoVerify(null, sumsBytes, pubkey, sig);
|
|
32
|
+
}
|
|
33
|
+
/** Parses `<sha256> <filename>` lines (sha256sum's own output format). */
|
|
34
|
+
export function parseSha256Sums(sumsText) {
|
|
35
|
+
const result = {};
|
|
36
|
+
for (const line of sumsText.split(/\r?\n/)) {
|
|
37
|
+
const match = line.match(/^([0-9a-f]{64})\s+(.+)$/i);
|
|
38
|
+
if (!match)
|
|
39
|
+
continue;
|
|
40
|
+
result[match[2]] = match[1].toLowerCase();
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
export function sha256Hex(bytes) {
|
|
45
|
+
return createHash('sha256').update(bytes).digest('hex');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Full verification: signature over SHA256SUMS, then the asset's own hash
|
|
49
|
+
* against the matching line. Throws `ReleaseVerificationError` on ANY
|
|
50
|
+
* failure — there is no partial-trust outcome, matching ADR-307's "refuses
|
|
51
|
+
* on any mismatch" requirement.
|
|
52
|
+
*/
|
|
53
|
+
export function verifyRelease(input) {
|
|
54
|
+
if (!verifySha256SumsSignature(input.sumsBytes, input.sigBase64, input.pubkeyPem)) {
|
|
55
|
+
throw new ReleaseVerificationError('SHA256SUMS.sig failed Ed25519 verification — refusing to install');
|
|
56
|
+
}
|
|
57
|
+
const sums = parseSha256Sums(input.sumsBytes.toString('utf-8'));
|
|
58
|
+
const expected = sums[input.assetFilename];
|
|
59
|
+
if (!expected) {
|
|
60
|
+
throw new ReleaseVerificationError(`SHA256SUMS has no entry for ${input.assetFilename}`);
|
|
61
|
+
}
|
|
62
|
+
const actual = sha256Hex(input.assetBytes);
|
|
63
|
+
if (actual !== expected) {
|
|
64
|
+
throw new ReleaseVerificationError(`sha256 mismatch for ${input.assetFilename}: expected ${expected.slice(0, 12)}…, got ${actual.slice(0, 12)}…`);
|
|
65
|
+
}
|
|
66
|
+
return { sha256: actual };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=verify.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.32.
|
|
3
|
+
"version": "3.32.4",
|
|
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",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"yaml": "^2.8.0"
|
|
112
112
|
},
|
|
113
113
|
"optionalDependencies": {
|
|
114
|
-
"@claude-flow/memory": "^3.0.0-alpha.21",
|
|
114
|
+
"@claude-flow/memory": "^3.0.0-alpha.21",
|
|
115
115
|
"@claude-flow/security": "^3.0.0-alpha.10",
|
|
116
116
|
"agentdb": "^3.0.0-alpha.17",
|
|
117
117
|
"agentic-flow": "^3.0.0-alpha.1",
|
|
@@ -799,8 +799,8 @@ TOOLS=$(grep -oE "name: 'metaharness_[a-z_]+'" "$WRAPPER" 2>/dev/null \
|
|
|
799
799
|
COUNT=0
|
|
800
800
|
for t in $TOOLS; do
|
|
801
801
|
COUNT=$((COUNT + 1))
|
|
802
|
-
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
803
|
-
grep -q "mcp__claude-flow__${t}" "$CMD" 2>/dev/null \
|
|
802
|
+
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
803
|
+
grep -q "mcp__claude-flow__${t}" "$CMD" 2>/dev/null \
|
|
804
804
|
|| miss="$miss ${t}-not-in-claude-md"
|
|
805
805
|
done
|
|
806
806
|
# Count derived from the wrapper source (mint deliberately excluded — see
|
|
@@ -1520,9 +1520,9 @@ grep -q "name: 'metaharness_drift_from_history'" "$WRAPPER" 2>/dev/null || miss=
|
|
|
1520
1520
|
grep -q "drift-from-history.mjs" "$WRAPPER" 2>/dev/null || miss="$miss no-script-dispatch"
|
|
1521
1521
|
grep -q "baselineSince" "$WRAPPER" 2>/dev/null || miss="$miss no-baseline-since-input"
|
|
1522
1522
|
# CLAUDE.md mentions both surfaces
|
|
1523
|
-
CMD="$ROOT/../../CLAUDE.md"
|
|
1524
|
-
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
1525
|
-
grep -q "mcp__claude-flow__metaharness_drift_from_history" "$CMD" 2>/dev/null || miss="$miss claude-md-no-mcp"
|
|
1523
|
+
CMD="$ROOT/../../CLAUDE.md"
|
|
1524
|
+
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
1525
|
+
grep -q "mcp__claude-flow__metaharness_drift_from_history" "$CMD" 2>/dev/null || miss="$miss claude-md-no-mcp"
|
|
1526
1526
|
grep -q "ruflo metaharness drift-from-history" "$CMD" 2>/dev/null || miss="$miss claude-md-no-subcommand"
|
|
1527
1527
|
# Phase 4 includes the new positive-case assertions
|
|
1528
1528
|
T="$ROOT/scripts/test-mcp-tools.mjs"
|
|
@@ -1806,9 +1806,9 @@ grep -q "audit-trend structural-distance integration" "$F" 2>/dev/null || miss="
|
|
|
1806
1806
|
grep -q "Graceful fallback when fingerprint missing" "$F" 2>/dev/null || miss="$miss no-fallback-step"
|
|
1807
1807
|
grep -q "Distance alert gate exits 1" "$F" 2>/dev/null || miss="$miss no-alert-step"
|
|
1808
1808
|
# CLAUDE.md documents the new MCP tool + subcommand
|
|
1809
|
-
CMD="$ROOT/../../CLAUDE.md"
|
|
1810
|
-
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
1811
|
-
grep -q "mcp__claude-flow__metaharness_similarity" "$CMD" 2>/dev/null || miss="$miss claude-md-no-mcp-tool"
|
|
1809
|
+
CMD="$ROOT/../../CLAUDE.md"
|
|
1810
|
+
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
1811
|
+
grep -q "mcp__claude-flow__metaharness_similarity" "$CMD" 2>/dev/null || miss="$miss claude-md-no-mcp-tool"
|
|
1812
1812
|
grep -q "ruflo metaharness similarity" "$CMD" 2>/dev/null || miss="$miss claude-md-no-subcommand"
|
|
1813
1813
|
grep -q -- "--alert-on-distance-below" "$CMD" 2>/dev/null || miss="$miss claude-md-no-distance-flag"
|
|
1814
1814
|
[[ -z "$miss" ]] && ok || bad "$miss"
|
|
@@ -2124,9 +2124,9 @@ grep -q "Ruflo remains operational if every MetaHarness package is removed" "$F"
|
|
|
2124
2124
|
# All 4 rules documented
|
|
2125
2125
|
grep -q "no-metaharness-smoke.yml" "$F" || miss="$miss no-ci-gate-ref"
|
|
2126
2126
|
# Command surface + tool surface enumerated
|
|
2127
|
-
grep -q "npx ruflo metaharness score" "$F" || miss="$miss no-cli-example"
|
|
2128
|
-
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
2129
|
-
grep -q "mcp__claude-flow__metaharness_" "$F" || miss="$miss no-mcp-tool-list"
|
|
2127
|
+
grep -q "npx ruflo metaharness score" "$F" || miss="$miss no-cli-example"
|
|
2128
|
+
# audit-allow: standalone-mcp-prefix — this checks the repository CLAUDE.md, not a plugin skill.
|
|
2129
|
+
grep -q "mcp__claude-flow__metaharness_" "$F" || miss="$miss no-mcp-tool-list"
|
|
2130
2130
|
# Routing + parallel-log integration both mentioned
|
|
2131
2131
|
grep -q "CLAUDE_FLOW_ROUTER_NEURAL\|CLAUDE_FLOW_ROUTER_PARALLEL_LOG" "$F" || miss="$miss no-routing-flags"
|
|
2132
2132
|
# 3-criteria gate
|