claude-flow 3.72.0 → 3.72.2
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/proven-config.json +1 -1
- package/.claude-plugin/marketplace.json +6 -6
- package/node_modules/@claude-flow/codex/.agents/skills/fast-code-edits/SKILL.md +42 -0
- package/node_modules/@claude-flow/codex/.agents/skills/graph-mincut/SKILL.md +42 -0
- package/node_modules/@claude-flow/codex/.agents/skills/injection-defense/SKILL.md +45 -0
- package/node_modules/@claude-flow/codex/.agents/skills/lora-learning/SKILL.md +39 -0
- package/node_modules/@claude-flow/codex/.agents/skills/sublinear-solver/SKILL.md +38 -0
- package/node_modules/@claude-flow/codex/.agents/skills/vector-quantization/SKILL.md +49 -0
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts.map +1 -1
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.js +6 -0
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.js.map +1 -1
- package/node_modules/@claude-flow/codex/dist/index.d.ts +3 -3
- package/node_modules/@claude-flow/codex/dist/index.js +1 -1
- package/node_modules/@claude-flow/codex/dist/templates/index.d.ts.map +1 -1
- package/node_modules/@claude-flow/codex/dist/templates/index.js +37 -0
- package/node_modules/@claude-flow/codex/dist/templates/index.js.map +1 -1
- package/node_modules/@claude-flow/codex/dist/types.d.ts +1 -1
- package/node_modules/@claude-flow/codex/dist/types.d.ts.map +1 -1
- package/node_modules/@claude-flow/codex/package.json +1 -1
- package/package.json +13 -10
- package/v3/@claude-flow/cli/catalog-manifest.json +4 -4
- package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts +6 -2
- package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js +13 -8
- package/v3/@claude-flow/cli/dist/src/commands/init.js +2 -0
- package/v3/@claude-flow/cli/dist/src/commands/neural.js +81 -71
- package/v3/@claude-flow/cli/dist/src/init/executor.js +13 -0
- package/v3/@claude-flow/cli/dist/src/init/types.d.ts +6 -0
- package/v3/@claude-flow/cli/dist/src/init/types.js +3 -0
- package/v3/@claude-flow/cli/dist/src/mcp-client.js +2 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +34 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-session-tools.d.ts +2 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-session-tools.js +4 -4
- package/v3/@claude-flow/cli/dist/src/mcp-tools/fast-apply-tools.d.ts +4 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/fast-apply-tools.js +85 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +19 -34
- package/v3/@claude-flow/cli/dist/src/mcp-tools/metaharness-tools.js +1 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js +3 -3
- package/v3/@claude-flow/cli/dist/src/mcp-tools/realpath-containment.d.ts +3 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/realpath-containment.js +39 -0
- package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.d.ts +12 -12
- package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts +1 -2
- package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js +4 -12
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts +1 -2
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js +4 -12
- package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts +1 -2
- package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js +3 -12
- package/v3/@claude-flow/cli/dist/src/ruvector/fast-apply.d.ts +46 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/fast-apply.js +73 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts +11 -1
- package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js +22 -36
- package/v3/@claude-flow/cli/dist/src/ruvector/mincut-bridge.d.ts +70 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/mincut-bridge.js +172 -0
- package/v3/@claude-flow/cli/dist/src/services/distill-oracle.d.ts +1 -1
- package/v3/@claude-flow/cli/dist/src/services/distill-oracle.js +2 -2
- package/v3/@claude-flow/cli/package.json +12 -10
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact global minimum cut over an undirected weighted graph.
|
|
3
|
+
*
|
|
4
|
+
* Fast path: `ruvector`'s `DynamicMinCut`, a wrapper over the
|
|
5
|
+
* `@ruvector/mincut-wasm` solver that ruvector ships as one of its own
|
|
6
|
+
* optional dependencies. Measured on a 1,000-node / 2,000-edge graph it is
|
|
7
|
+
* ~30x faster than a JS Stoer-Wagner (187 ms vs 6 s) and returns the same cut
|
|
8
|
+
* value. When ruvector or its wasm solver is not installed, callers fall back
|
|
9
|
+
* to their own JS implementation (`fallbackMinCut` in graph-analyzer.ts).
|
|
10
|
+
*
|
|
11
|
+
* The wasm solver rejects duplicate edges ("Edge already exists"), so edges are
|
|
12
|
+
* folded into one undirected edge per node pair with summed weight, and
|
|
13
|
+
* self-loops are dropped (they never cross a cut).
|
|
14
|
+
*/
|
|
15
|
+
let ctorPromise = null;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve ruvector's `DynamicMinCut` once. Returns null (never throws) when
|
|
18
|
+
* ruvector is absent or its `@ruvector/mincut-wasm` solver cannot load.
|
|
19
|
+
*/
|
|
20
|
+
export function loadWasmMinCut() {
|
|
21
|
+
if (!ctorPromise) {
|
|
22
|
+
ctorPromise = (async () => {
|
|
23
|
+
try {
|
|
24
|
+
const specifier = 'ruvector';
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- optional dep
|
|
26
|
+
const mod = await import(specifier);
|
|
27
|
+
const rv = mod?.DynamicMinCut ? mod : mod?.default;
|
|
28
|
+
if (typeof rv?.DynamicMinCut !== 'function')
|
|
29
|
+
return null;
|
|
30
|
+
if (typeof rv.isMinCutWasmAvailable === 'function' && !rv.isMinCutWasmAvailable())
|
|
31
|
+
return null;
|
|
32
|
+
return rv.DynamicMinCut;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
})();
|
|
38
|
+
}
|
|
39
|
+
return ctorPromise;
|
|
40
|
+
}
|
|
41
|
+
/** Test hook: forget the memoised loader result. */
|
|
42
|
+
export function resetMinCutLoader() {
|
|
43
|
+
ctorPromise = null;
|
|
44
|
+
}
|
|
45
|
+
function foldEdges(edges) {
|
|
46
|
+
const folded = new Map();
|
|
47
|
+
for (const [u, v, rawW] of edges) {
|
|
48
|
+
if (u === v)
|
|
49
|
+
continue;
|
|
50
|
+
const w = Number.isFinite(rawW) && rawW > 0 ? rawW : 1;
|
|
51
|
+
const [a, b] = u < v ? [u, v] : [v, u];
|
|
52
|
+
const key = `${a}\u0000${b}`;
|
|
53
|
+
const prev = folded.get(key);
|
|
54
|
+
if (prev)
|
|
55
|
+
prev[2] += w;
|
|
56
|
+
else
|
|
57
|
+
folded.set(key, [a, b, w]);
|
|
58
|
+
}
|
|
59
|
+
return folded;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Compute the exact minimum cut with the wasm solver. Returns null when the
|
|
63
|
+
* solver is unavailable or the input is degenerate (fewer than two nodes, no
|
|
64
|
+
* edges, or nodes with no incident edge — an isolated node is a zero-weight
|
|
65
|
+
* cut that the solver never sees, so the JS fallback answers those).
|
|
66
|
+
*/
|
|
67
|
+
export async function wasmMinCut(nodes, edges) {
|
|
68
|
+
const Ctor = await loadWasmMinCut();
|
|
69
|
+
return Ctor ? minCutWith(Ctor, nodes, edges) : null;
|
|
70
|
+
}
|
|
71
|
+
/** Synchronous variant for callers that already hold the loaded solver class. */
|
|
72
|
+
export function minCutWith(Ctor, nodes, edges) {
|
|
73
|
+
if (nodes.length < 2)
|
|
74
|
+
return null;
|
|
75
|
+
const nodeSet = new Set(nodes);
|
|
76
|
+
const folded = foldEdges(edges.filter(([u, v]) => nodeSet.has(u) && nodeSet.has(v)));
|
|
77
|
+
if (folded.size === 0)
|
|
78
|
+
return null;
|
|
79
|
+
const touched = new Set();
|
|
80
|
+
for (const [a, b] of folded.values()) {
|
|
81
|
+
touched.add(a);
|
|
82
|
+
touched.add(b);
|
|
83
|
+
}
|
|
84
|
+
if (touched.size !== nodeSet.size)
|
|
85
|
+
return null;
|
|
86
|
+
try {
|
|
87
|
+
const solver = new Ctor();
|
|
88
|
+
for (const [a, b, w] of folded.values())
|
|
89
|
+
solver.insertEdge(a, b, w);
|
|
90
|
+
const groups = solver.partition();
|
|
91
|
+
const partition1 = groups[0] ?? [];
|
|
92
|
+
const side = new Set(partition1);
|
|
93
|
+
const partition2 = groups[1] ?? nodes.filter(n => !side.has(n));
|
|
94
|
+
const cutEdges = [];
|
|
95
|
+
for (const [u, v] of edges) {
|
|
96
|
+
if (u !== v && nodeSet.has(u) && nodeSet.has(v) && side.has(u) !== side.has(v))
|
|
97
|
+
cutEdges.push([u, v]);
|
|
98
|
+
}
|
|
99
|
+
return { cutValue: solver.minCutValue(), partition1, partition2, cutEdges };
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Above this many nodes the O(n^3) JS fallback is not attempted. */
|
|
106
|
+
export const JS_FALLBACK_MAX_NODES = 300;
|
|
107
|
+
/**
|
|
108
|
+
* Minimum cut of the seed's `depth`-hop neighbourhood (edges treated as
|
|
109
|
+
* undirected, at most `maxNodes` nodes). Answers "where is the weakest
|
|
110
|
+
* boundary around this node, and what sits on its side of it?".
|
|
111
|
+
*
|
|
112
|
+
* Uses the wasm solver when available, else `fallback` (a JS exact min cut)
|
|
113
|
+
* for neighbourhoods up to JS_FALLBACK_MAX_NODES nodes. Returns null when the
|
|
114
|
+
* seed has no neighbours or no backend can handle the neighbourhood.
|
|
115
|
+
*/
|
|
116
|
+
export async function seedLocalMinCut(seed, edges, depth, maxNodes, fallback) {
|
|
117
|
+
const adj = new Map();
|
|
118
|
+
for (const [u, v] of edges) {
|
|
119
|
+
if (u === v)
|
|
120
|
+
continue;
|
|
121
|
+
if (!adj.has(u))
|
|
122
|
+
adj.set(u, new Set());
|
|
123
|
+
if (!adj.has(v))
|
|
124
|
+
adj.set(v, new Set());
|
|
125
|
+
adj.get(u).add(v);
|
|
126
|
+
adj.get(v).add(u);
|
|
127
|
+
}
|
|
128
|
+
if (!adj.has(seed))
|
|
129
|
+
return null;
|
|
130
|
+
const hops = new Map([[seed, 0]]);
|
|
131
|
+
let frontier = [seed];
|
|
132
|
+
for (let d = 1; d <= depth && frontier.length > 0 && hops.size < maxNodes; d++) {
|
|
133
|
+
const next = [];
|
|
134
|
+
for (const n of frontier) {
|
|
135
|
+
for (const m of adj.get(n) ?? []) {
|
|
136
|
+
if (hops.has(m) || hops.size >= maxNodes)
|
|
137
|
+
continue;
|
|
138
|
+
hops.set(m, d);
|
|
139
|
+
next.push(m);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
frontier = next;
|
|
143
|
+
}
|
|
144
|
+
if (hops.size < 2)
|
|
145
|
+
return null;
|
|
146
|
+
const nodes = Array.from(hops.keys());
|
|
147
|
+
const sub = edges.filter(([u, v]) => u !== v && hops.has(u) && hops.has(v));
|
|
148
|
+
let backend = 'mincut-wasm';
|
|
149
|
+
let cut = await wasmMinCut(nodes, sub);
|
|
150
|
+
if (!cut) {
|
|
151
|
+
if (nodes.length > JS_FALLBACK_MAX_NODES)
|
|
152
|
+
return null;
|
|
153
|
+
backend = 'js-fallback';
|
|
154
|
+
cut = fallback(nodes, sub);
|
|
155
|
+
}
|
|
156
|
+
const seedInFirst = cut.partition1.includes(seed);
|
|
157
|
+
const mine = seedInFirst ? cut.partition1 : cut.partition2;
|
|
158
|
+
const other = seedInFirst ? cut.partition2 : cut.partition1;
|
|
159
|
+
const seedSide = mine
|
|
160
|
+
.filter(n => n !== seed)
|
|
161
|
+
.map(n => ({ nodeId: n, depth: hops.get(n) ?? depth }))
|
|
162
|
+
.sort((a, b) => a.depth - b.depth || a.nodeId.localeCompare(b.nodeId));
|
|
163
|
+
return {
|
|
164
|
+
seedSide,
|
|
165
|
+
otherSide: other,
|
|
166
|
+
cutValue: cut.cutValue,
|
|
167
|
+
cutEdges: cut.cutEdges,
|
|
168
|
+
backend,
|
|
169
|
+
subgraphNodes: nodes.length,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=mincut-bridge.js.map
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { type VerifyTaskKind } from '../ruvector/output-verifier.js';
|
|
38
38
|
import { FableHarness, type ReflectItem, type ReflectResult } from './fable-harness.js';
|
|
39
|
-
export declare const MH_DARWIN_PIN = "0.
|
|
39
|
+
export declare const MH_DARWIN_PIN = "0.13.0";
|
|
40
40
|
export type ResolvedProvenance = 'oracle:test-exec' | 'judge:fable' | 'proxy:structural';
|
|
41
41
|
/** SWE-bench-shaped / bench-suite-mapped test spec that Tier 1 can execute. */
|
|
42
42
|
export interface TestSpec {
|
|
@@ -43,9 +43,9 @@ import { FableHarness, } from './fable-harness.js';
|
|
|
43
43
|
// behavior mid-run (the #142 pin-drift failure mode). Pin it, and let
|
|
44
44
|
// scripts/check-metaharness-pins.mjs watch this constant for drift. Kept in
|
|
45
45
|
// lock-step with the optionalDependencies pin in package.json and the plugin
|
|
46
|
-
// darwin cache (versioned by the plugin's own `~0.
|
|
46
|
+
// darwin cache (versioned by the plugin's own `~0.13.0` pin in _darwin.mjs;
|
|
47
47
|
// both are checked by scripts/check-metaharness-pins.mjs — #3366).
|
|
48
|
-
export const MH_DARWIN_PIN = '0.
|
|
48
|
+
export const MH_DARWIN_PIN = '0.13.0';
|
|
49
49
|
// ── Public API ───────────────────────────────────────────────────────────
|
|
50
50
|
/**
|
|
51
51
|
* Label each trajectory with `resolved` + honest provenance, trying the tiers
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.72.
|
|
3
|
+
"version": "3.72.2",
|
|
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",
|
|
@@ -102,15 +102,15 @@
|
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@electron/asar": "^4.3.1",
|
|
104
104
|
"@claude-flow/cli-core": "3.7.5",
|
|
105
|
-
"@claude-flow/codex": "3.0.
|
|
105
|
+
"@claude-flow/codex": "3.0.6",
|
|
106
106
|
"@claude-flow/mcp": "3.1.6",
|
|
107
|
-
"@claude-flow/neural": "3.0.
|
|
107
|
+
"@claude-flow/neural": "3.0.3",
|
|
108
108
|
"@claude-flow/plugin-agent-federation": "1.0.5",
|
|
109
109
|
"@claude-flow/security": "3.0.6",
|
|
110
110
|
"@claude-flow/shared": "3.0.7",
|
|
111
111
|
"@iarna/toml": "^2.2.5",
|
|
112
112
|
"@noble/ed25519": "2.3.0",
|
|
113
|
-
"@ruvector/rabitq-wasm": "0.1.
|
|
113
|
+
"@ruvector/rabitq-wasm": "0.1.2",
|
|
114
114
|
"ajv": "^8.20.0",
|
|
115
115
|
"bcryptjs": "^3.0.3",
|
|
116
116
|
"chalk": "^5.3.0",
|
|
@@ -128,13 +128,13 @@
|
|
|
128
128
|
"ws": "^8.21.0",
|
|
129
129
|
"yaml": "^2.8.0",
|
|
130
130
|
"zod": "^3.22.0",
|
|
131
|
-
"@claude-flow/memory": "3.2.
|
|
131
|
+
"@claude-flow/memory": "3.2.3"
|
|
132
132
|
},
|
|
133
133
|
"optionalDependencies": {
|
|
134
134
|
"@agntcy/slim-bindings": "2.1.1",
|
|
135
135
|
"@claude-flow/aidefence": "3.1.0",
|
|
136
|
-
"@claude-flow/memory": "3.2.
|
|
137
|
-
"@metaharness/darwin": "~0.
|
|
136
|
+
"@claude-flow/memory": "3.2.3",
|
|
137
|
+
"@metaharness/darwin": "~0.13.0",
|
|
138
138
|
"@metaharness/flywheel": "~0.1.10",
|
|
139
139
|
"@metaharness/radio": "~0.1.0",
|
|
140
140
|
"@metaharness/turn-credit": "~0.1.0",
|
|
@@ -142,13 +142,15 @@
|
|
|
142
142
|
"agentdb": "^3.3.0",
|
|
143
143
|
"agentic-flow": "^3.0.0",
|
|
144
144
|
"better-sqlite3": "^12.9.0",
|
|
145
|
-
"ruvector": "^0.
|
|
146
|
-
"nostr-tools": "^2.7.0"
|
|
145
|
+
"ruvector": "^0.3.13",
|
|
146
|
+
"nostr-tools": "^2.7.0",
|
|
147
|
+
"@ruvector/learning-wasm": "0.1.29",
|
|
148
|
+
"agent-booster": "^0.2.2"
|
|
147
149
|
},
|
|
148
150
|
"peerDependencies": {
|
|
149
151
|
"@metaharness/router": "^0.4.0",
|
|
150
152
|
"@ruvector/typesafe": "^0.1.0",
|
|
151
|
-
"metaharness": "^0.4.
|
|
153
|
+
"metaharness": "^0.4.20"
|
|
152
154
|
},
|
|
153
155
|
"peerDependenciesMeta": {
|
|
154
156
|
"@metaharness/router": {
|