@sparkleideas/claude-flow-patch 3.1.0-alpha.44.patch.10
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/AGENTS.md +162 -0
- package/CLAUDE.md +506 -0
- package/README.md +351 -0
- package/bin/claude-flow-patch.mjs +148 -0
- package/check-patches.sh +195 -0
- package/lib/categories.json +15 -0
- package/lib/common.py +97 -0
- package/lib/discover.mjs +181 -0
- package/lib/discover.sh +160 -0
- package/package.json +86 -0
- package/patch/010-CF-001-doctor-yaml/README.md +11 -0
- package/patch/010-CF-001-doctor-yaml/fix.py +20 -0
- package/patch/010-CF-001-doctor-yaml/sentinel +1 -0
- package/patch/020-CF-002-config-export-yaml/README.md +11 -0
- package/patch/020-CF-002-config-export-yaml/fix.py +130 -0
- package/patch/020-CF-002-config-export-yaml/sentinel +1 -0
- package/patch/030-DM-001-daemon-log-zero/README.md +12 -0
- package/patch/030-DM-001-daemon-log-zero/fix.py +37 -0
- package/patch/030-DM-001-daemon-log-zero/sentinel +1 -0
- package/patch/040-DM-002-cpu-load-threshold/README.md +11 -0
- package/patch/040-DM-002-cpu-load-threshold/fix.py +6 -0
- package/patch/040-DM-002-cpu-load-threshold/sentinel +1 -0
- package/patch/050-DM-003-macos-freemem/README.md +11 -0
- package/patch/050-DM-003-macos-freemem/fix.py +7 -0
- package/patch/050-DM-003-macos-freemem/sentinel +1 -0
- package/patch/060-DM-004-preload-worker-stub/README.md +11 -0
- package/patch/060-DM-004-preload-worker-stub/fix.py +34 -0
- package/patch/060-DM-004-preload-worker-stub/sentinel +1 -0
- package/patch/070-DM-005-consolidation-worker-stub/README.md +11 -0
- package/patch/070-DM-005-consolidation-worker-stub/fix.py +46 -0
- package/patch/070-DM-005-consolidation-worker-stub/sentinel +1 -0
- package/patch/080-EM-001-embedding-ignores-config/README.md +11 -0
- package/patch/080-EM-001-embedding-ignores-config/fix.py +111 -0
- package/patch/080-EM-001-embedding-ignores-config/sentinel +1 -0
- package/patch/090-EM-002-transformers-cache-eacces/README.md +11 -0
- package/patch/090-EM-002-transformers-cache-eacces/fix.sh +12 -0
- package/patch/090-EM-002-transformers-cache-eacces/sentinel +1 -0
- package/patch/100-GV-001-hnsw-ghost-vectors/README.md +11 -0
- package/patch/100-GV-001-hnsw-ghost-vectors/fix.py +34 -0
- package/patch/100-GV-001-hnsw-ghost-vectors/sentinel +1 -0
- package/patch/110-HK-001-post-edit-file-path/README.md +44 -0
- package/patch/110-HK-001-post-edit-file-path/fix.py +23 -0
- package/patch/110-HK-001-post-edit-file-path/sentinel +1 -0
- package/patch/120-HK-002-hooks-tools-stub/README.md +36 -0
- package/patch/120-HK-002-hooks-tools-stub/fix.py +155 -0
- package/patch/120-HK-002-hooks-tools-stub/sentinel +1 -0
- package/patch/130-HK-003-metrics-hardcoded/README.md +30 -0
- package/patch/130-HK-003-metrics-hardcoded/fix.py +82 -0
- package/patch/130-HK-003-metrics-hardcoded/sentinel +1 -0
- package/patch/135-HK-004-respect-daemon-autostart/README.md +11 -0
- package/patch/135-HK-004-respect-daemon-autostart/fix.py +14 -0
- package/patch/135-HK-004-respect-daemon-autostart/sentinel +1 -0
- package/patch/137-HK-005-daemon-pid-guard/README.md +11 -0
- package/patch/137-HK-005-daemon-pid-guard/fix.py +53 -0
- package/patch/137-HK-005-daemon-pid-guard/sentinel +2 -0
- package/patch/140-HW-001-stdin-hang/README.md +11 -0
- package/patch/140-HW-001-stdin-hang/fix.py +6 -0
- package/patch/140-HW-001-stdin-hang/sentinel +1 -0
- package/patch/150-HW-002-failures-swallowed/README.md +11 -0
- package/patch/150-HW-002-failures-swallowed/fix.py +42 -0
- package/patch/150-HW-002-failures-swallowed/sentinel +1 -0
- package/patch/160-HW-003-aggressive-intervals/README.md +11 -0
- package/patch/160-HW-003-aggressive-intervals/fix.py +52 -0
- package/patch/160-HW-003-aggressive-intervals/sentinel +3 -0
- package/patch/170-IN-001-intelligence-stub/README.md +64 -0
- package/patch/170-IN-001-intelligence-stub/fix.py +63 -0
- package/patch/170-IN-001-intelligence-stub/sentinel +1 -0
- package/patch/180-MM-001-memory-persist-path/README.md +27 -0
- package/patch/180-MM-001-memory-persist-path/fix.py +54 -0
- package/patch/180-MM-001-memory-persist-path/sentinel +1 -0
- package/patch/190-NS-001-discovery-default-namespace/README.md +16 -0
- package/patch/190-NS-001-discovery-default-namespace/fix.py +68 -0
- package/patch/190-NS-001-discovery-default-namespace/sentinel +2 -0
- package/patch/200-NS-002-targeted-require-namespace/README.md +19 -0
- package/patch/200-NS-002-targeted-require-namespace/fix.py +158 -0
- package/patch/200-NS-002-targeted-require-namespace/sentinel +2 -0
- package/patch/210-NS-003-namespace-typo-pattern/README.md +15 -0
- package/patch/210-NS-003-namespace-typo-pattern/fix.py +23 -0
- package/patch/210-NS-003-namespace-typo-pattern/sentinel +1 -0
- package/patch/220-RS-001-better-sqlite3-node24/README.md +54 -0
- package/patch/220-RS-001-better-sqlite3-node24/fix.py +27 -0
- package/patch/220-RS-001-better-sqlite3-node24/rebuild.sh +31 -0
- package/patch/220-RS-001-better-sqlite3-node24/sentinel +2 -0
- package/patch/230-RV-001-force-learn-tick/README.md +31 -0
- package/patch/230-RV-001-force-learn-tick/fix.py +14 -0
- package/patch/230-RV-001-force-learn-tick/sentinel +2 -0
- package/patch/240-RV-002-trajectory-load/README.md +28 -0
- package/patch/240-RV-002-trajectory-load/fix.py +14 -0
- package/patch/240-RV-002-trajectory-load/sentinel +2 -0
- package/patch/250-RV-003-trajectory-stats-sync/README.md +31 -0
- package/patch/250-RV-003-trajectory-stats-sync/fix.py +18 -0
- package/patch/250-RV-003-trajectory-stats-sync/sentinel +2 -0
- package/patch/260-SG-001-init-settings/README.md +29 -0
- package/patch/260-SG-001-init-settings/fix.py +143 -0
- package/patch/260-SG-001-init-settings/sentinel +4 -0
- package/patch/270-SG-003-init-helpers-all-paths/README.md +60 -0
- package/patch/270-SG-003-init-helpers-all-paths/fix.py +165 -0
- package/patch/270-SG-003-init-helpers-all-paths/sentinel +3 -0
- package/patch/280-UI-001-intelligence-stats-crash/README.md +11 -0
- package/patch/280-UI-001-intelligence-stats-crash/fix.py +57 -0
- package/patch/280-UI-001-intelligence-stats-crash/sentinel +1 -0
- package/patch/290-UI-002-neural-status-not-loaded/README.md +11 -0
- package/patch/290-UI-002-neural-status-not-loaded/fix.py +19 -0
- package/patch/290-UI-002-neural-status-not-loaded/sentinel +1 -0
- package/patch/300-DM-006-log-rotation/README.md +12 -0
- package/patch/300-DM-006-log-rotation/fix.py +72 -0
- package/patch/300-DM-006-log-rotation/sentinel +2 -0
- package/patch/310-HW-004-runwithtimeout-orphan/README.md +11 -0
- package/patch/310-HW-004-runwithtimeout-orphan/fix.py +10 -0
- package/patch/310-HW-004-runwithtimeout-orphan/sentinel +1 -0
- package/patch/320-SG-004-wizard-parity/README.md +40 -0
- package/patch/320-SG-004-wizard-parity/fix.py +208 -0
- package/patch/320-SG-004-wizard-parity/sentinel +3 -0
- package/patch/330-SG-005-start-all-subcommand/README.md +32 -0
- package/patch/330-SG-005-start-all-subcommand/fix.py +58 -0
- package/patch/330-SG-005-start-all-subcommand/sentinel +1 -0
- package/patch-all.sh +199 -0
- package/repair-post-init.sh +263 -0
- package/scripts/preflight.mjs +249 -0
- package/scripts/upstream-log.mjs +257 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// scripts/upstream-log.mjs — Show recent @claude-flow/cli releases with changes.
|
|
3
|
+
//
|
|
4
|
+
// Usage:
|
|
5
|
+
// node scripts/upstream-log.mjs [count] # default: 10
|
|
6
|
+
// node scripts/upstream-log.mjs 20 # last 20 releases
|
|
7
|
+
// node scripts/upstream-log.mjs --diff # also diff deps against our baseline
|
|
8
|
+
// node scripts/upstream-log.mjs --full # show complete GitHub issue bodies
|
|
9
|
+
//
|
|
10
|
+
// Requires: npm, gh (optional, for commit messages)
|
|
11
|
+
|
|
12
|
+
import { execSync } from 'node:child_process';
|
|
13
|
+
import { readFileSync } from 'node:fs';
|
|
14
|
+
import { resolve, dirname } from 'node:path';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
|
|
17
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
const ROOT = resolve(__dirname, '..');
|
|
19
|
+
|
|
20
|
+
// ── Args ──
|
|
21
|
+
|
|
22
|
+
const flags = ['--diff', '--full'];
|
|
23
|
+
const args = process.argv.slice(2).filter(a => !flags.includes(a));
|
|
24
|
+
const showDiff = process.argv.includes('--diff');
|
|
25
|
+
const fullDetail = process.argv.includes('--full');
|
|
26
|
+
const count = parseInt(args[0], 10) || 10;
|
|
27
|
+
|
|
28
|
+
// ── Our baseline + latest from npm ──
|
|
29
|
+
|
|
30
|
+
let baseline = null;
|
|
31
|
+
try {
|
|
32
|
+
const readme = readFileSync(resolve(ROOT, 'README.md'), 'utf-8');
|
|
33
|
+
const match = readme.match(/@claude-flow\/cli.*?\*\*v?(3\.\d+\.\d+-alpha\.\d+)\*\*/);
|
|
34
|
+
baseline = match?.[1] ?? null;
|
|
35
|
+
} catch { /* no README */ }
|
|
36
|
+
|
|
37
|
+
const latest = run('npm view @claude-flow/cli@latest version').trim() || null;
|
|
38
|
+
|
|
39
|
+
// ── Helpers ──
|
|
40
|
+
|
|
41
|
+
function run(cmd) {
|
|
42
|
+
try {
|
|
43
|
+
return execSync(cmd, { encoding: 'utf-8', timeout: 30000 }).trim();
|
|
44
|
+
} catch {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ── Fetch npm version timeline ──
|
|
50
|
+
|
|
51
|
+
const timeJson = run('npm view @claude-flow/cli time --json');
|
|
52
|
+
if (!timeJson) {
|
|
53
|
+
console.error('ERROR: Could not fetch version data from npm.');
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const times = JSON.parse(timeJson);
|
|
58
|
+
delete times.created;
|
|
59
|
+
delete times.modified;
|
|
60
|
+
|
|
61
|
+
// Sort by publish date descending, take last N (+1 for window boundary)
|
|
62
|
+
const allVersions = Object.entries(times)
|
|
63
|
+
.sort((a, b) => new Date(b[1]) - new Date(a[1]));
|
|
64
|
+
|
|
65
|
+
const versions = allVersions.slice(0, count);
|
|
66
|
+
|
|
67
|
+
// ── Fetch GitHub commits with timestamps ──
|
|
68
|
+
|
|
69
|
+
const commits = []; // { time: Date, title: string, body: string }
|
|
70
|
+
|
|
71
|
+
function fetchCommits() {
|
|
72
|
+
// Fetch as JSON to preserve full multi-line commit messages
|
|
73
|
+
const raw = run('gh api repos/ruvnet/claude-flow/commits?per_page=100');
|
|
74
|
+
if (!raw) return;
|
|
75
|
+
try {
|
|
76
|
+
const data = JSON.parse(raw);
|
|
77
|
+
for (const item of data) {
|
|
78
|
+
const time = new Date(item.commit?.author?.date);
|
|
79
|
+
const fullMsg = item.commit?.message ?? '';
|
|
80
|
+
const lines = fullMsg.split('\n');
|
|
81
|
+
const title = lines[0] || '';
|
|
82
|
+
// Body is everything after the first blank line
|
|
83
|
+
const blankIdx = lines.findIndex((l, i) => i > 0 && l.trim() === '');
|
|
84
|
+
const body = blankIdx >= 0
|
|
85
|
+
? lines.slice(blankIdx + 1).filter(l => l.trim()).join('\n').trim()
|
|
86
|
+
: '';
|
|
87
|
+
if (!isNaN(time.getTime()) && title) {
|
|
88
|
+
commits.push({ time, title, body });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} catch { /* gh not available or parse error */ }
|
|
92
|
+
// Sort oldest first for window matching
|
|
93
|
+
commits.sort((a, b) => a.time - b.time);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
fetchCommits();
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Find commits between prevTime (exclusive) and thisTime (inclusive).
|
|
100
|
+
* Skip version-bump-only and checkpoint commits.
|
|
101
|
+
*/
|
|
102
|
+
function commitsForWindow(thisTime, prevTime) {
|
|
103
|
+
const start = prevTime ? new Date(prevTime) : new Date(0);
|
|
104
|
+
const end = new Date(thisTime);
|
|
105
|
+
return commits
|
|
106
|
+
.filter(c => c.time > start && c.time <= end)
|
|
107
|
+
.filter(c => !/^Bump to 3\.\d/.test(c.title))
|
|
108
|
+
.filter(c => !/^Checkpoint:/.test(c.title));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ── GitHub issue details ──
|
|
112
|
+
|
|
113
|
+
const issueCache = new Map();
|
|
114
|
+
|
|
115
|
+
function fetchIssue(num) {
|
|
116
|
+
if (issueCache.has(num)) return issueCache.get(num);
|
|
117
|
+
const raw = run(`gh api repos/ruvnet/claude-flow/issues/${num}`);
|
|
118
|
+
if (!raw) { issueCache.set(num, null); return null; }
|
|
119
|
+
try {
|
|
120
|
+
const data = JSON.parse(raw);
|
|
121
|
+
const rawBody = (data.body ?? '').trim();
|
|
122
|
+
const labels = (data.labels ?? []).map(l => l.name);
|
|
123
|
+
|
|
124
|
+
// Summary: filtered lines for compact view
|
|
125
|
+
const summary = rawBody.split('\n')
|
|
126
|
+
.filter(l => l.trim())
|
|
127
|
+
.filter(l => !l.startsWith('##'))
|
|
128
|
+
.filter(l => !l.startsWith('```'))
|
|
129
|
+
.filter(l => !l.startsWith('Fixes #'))
|
|
130
|
+
.filter(l => !l.startsWith('Co-Authored'))
|
|
131
|
+
.filter(l => !l.startsWith('🤖'))
|
|
132
|
+
.slice(0, 6)
|
|
133
|
+
.map(l => l.trim());
|
|
134
|
+
|
|
135
|
+
const result = { title: data.title, state: data.state, labels, summary, fullBody: rawBody };
|
|
136
|
+
issueCache.set(num, result);
|
|
137
|
+
return result;
|
|
138
|
+
} catch { issueCache.set(num, null); return null; }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Extract GitHub issue numbers from a commit title, e.g. "(#1165)" -> [1165]
|
|
143
|
+
*/
|
|
144
|
+
function extractIssueRefs(title) {
|
|
145
|
+
const matches = [...title.matchAll(/#(\d+)/g)];
|
|
146
|
+
return matches.map(m => parseInt(m[1], 10));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ── Dep diff helper ──
|
|
150
|
+
|
|
151
|
+
function getDeps(version) {
|
|
152
|
+
const raw = run(`npm view @claude-flow/cli@${version} dependencies --json`);
|
|
153
|
+
return raw ? JSON.parse(raw) : {};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// ── Output ──
|
|
157
|
+
|
|
158
|
+
console.log(`Last ${versions.length} releases of @claude-flow/cli`);
|
|
159
|
+
if (latest) console.log(`Latest on npm: ${latest}`);
|
|
160
|
+
if (baseline) console.log(`Patch baseline: ${baseline}`);
|
|
161
|
+
if (latest && baseline && latest !== baseline) {
|
|
162
|
+
const ahead = allVersions.findIndex(([v]) => v === baseline) - allVersions.findIndex(([v]) => v === latest);
|
|
163
|
+
if (ahead > 0) console.log(`Upstream is ${ahead} version${ahead > 1 ? 's' : ''} ahead of baseline`);
|
|
164
|
+
}
|
|
165
|
+
console.log('');
|
|
166
|
+
|
|
167
|
+
for (let i = 0; i < versions.length; i++) {
|
|
168
|
+
const [version, time] = versions[i];
|
|
169
|
+
const date = time.slice(0, 10);
|
|
170
|
+
const isBaseline = version === baseline;
|
|
171
|
+
const marker = isBaseline ? ' <-- patch baseline' : '';
|
|
172
|
+
|
|
173
|
+
console.log(` ${version} ${date}${marker}`);
|
|
174
|
+
|
|
175
|
+
// Previous version's time is the window boundary
|
|
176
|
+
const prevTime = versions[i + 1]?.[1] ?? allVersions[allVersions.indexOf(versions[i]) + 1]?.[1];
|
|
177
|
+
const windowCommits = commitsForWindow(time, prevTime);
|
|
178
|
+
|
|
179
|
+
const seenIssues = new Set();
|
|
180
|
+
for (const c of windowCommits.slice(0, 5)) {
|
|
181
|
+
console.log(` - ${c.title}`);
|
|
182
|
+
if (c.body) {
|
|
183
|
+
const bodyLines = c.body.split('\n')
|
|
184
|
+
.filter(l => l.trim())
|
|
185
|
+
.filter(l => !l.startsWith('Co-Authored-By'))
|
|
186
|
+
.filter(l => !l.startsWith('Published:'));
|
|
187
|
+
for (const bl of (fullDetail ? bodyLines : bodyLines.slice(0, 6))) {
|
|
188
|
+
console.log(` ${bl.trim()}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Fetch linked GitHub issues for additional context
|
|
192
|
+
for (const issueNum of extractIssueRefs(c.title)) {
|
|
193
|
+
if (seenIssues.has(issueNum)) continue;
|
|
194
|
+
seenIssues.add(issueNum);
|
|
195
|
+
const issue = fetchIssue(issueNum);
|
|
196
|
+
if (!issue) continue;
|
|
197
|
+
|
|
198
|
+
if (fullDetail && issue.fullBody) {
|
|
199
|
+
// --full: show complete issue body
|
|
200
|
+
console.log(` Issue #${issueNum}: ${issue.title} [${issue.state}]`);
|
|
201
|
+
if (issue.labels.length > 0) {
|
|
202
|
+
console.log(` Labels: ${issue.labels.join(', ')}`);
|
|
203
|
+
}
|
|
204
|
+
for (const bl of issue.fullBody.split('\n')) {
|
|
205
|
+
console.log(` ${bl}`);
|
|
206
|
+
}
|
|
207
|
+
} else if (issue.summary.length > 0) {
|
|
208
|
+
// Compact: show summary lines not already in the commit body
|
|
209
|
+
const extra = issue.summary.filter(l => !c.body?.includes(l));
|
|
210
|
+
if (extra.length > 0) {
|
|
211
|
+
console.log(` Issue #${issueNum}: ${issue.title} [${issue.state}]`);
|
|
212
|
+
for (const bl of extra.slice(0, 4)) {
|
|
213
|
+
console.log(` ${bl}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (windowCommits.length > 5) {
|
|
220
|
+
console.log(` ... and ${windowCommits.length - 5} more`);
|
|
221
|
+
}
|
|
222
|
+
if (windowCommits.length === 0 && commits.length > 0) {
|
|
223
|
+
console.log(' (version bump only)');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ── Dep diff against baseline ──
|
|
228
|
+
|
|
229
|
+
if (showDiff && baseline) {
|
|
230
|
+
const latest = versions[0]?.[0];
|
|
231
|
+
if (latest && latest !== baseline) {
|
|
232
|
+
console.log('');
|
|
233
|
+
console.log(`Dependency diff: ${baseline} -> ${latest}`);
|
|
234
|
+
console.log('');
|
|
235
|
+
|
|
236
|
+
const oldDeps = getDeps(baseline);
|
|
237
|
+
const newDeps = getDeps(latest);
|
|
238
|
+
|
|
239
|
+
const allKeys = new Set([...Object.keys(oldDeps), ...Object.keys(newDeps)]);
|
|
240
|
+
let anyChange = false;
|
|
241
|
+
|
|
242
|
+
for (const key of [...allKeys].sort()) {
|
|
243
|
+
const oldV = oldDeps[key];
|
|
244
|
+
const newV = newDeps[key];
|
|
245
|
+
if (oldV !== newV) {
|
|
246
|
+
anyChange = true;
|
|
247
|
+
if (!oldV) console.log(` + ${key}: ${newV}`);
|
|
248
|
+
else if (!newV) console.log(` - ${key}: ${oldV}`);
|
|
249
|
+
else console.log(` ~ ${key}: ${oldV} -> ${newV}`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!anyChange) console.log(' (no dependency changes)');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
console.log('');
|