@claude-flow/cli 3.25.6 → 3.26.1
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-version +1 -0
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/helpers.manifest.json +5 -4
- package/.claude/helpers/hook-handler.cjs +129 -0
- package/.claude/helpers/statusline.cjs +781 -505
- package/.claude/proven-config.json +42 -0
- package/catalog-manifest.json +12 -0
- package/dist/src/commands/advisor.d.ts +15 -0
- package/dist/src/commands/advisor.js +94 -0
- package/dist/src/commands/doctor.js +77 -3
- package/dist/src/commands/funnel.d.ts +13 -0
- package/dist/src/commands/funnel.js +103 -0
- package/dist/src/commands/hooks.js +112 -46
- package/dist/src/commands/index.js +10 -0
- package/dist/src/commands/init.js +44 -0
- package/dist/src/commands/proxy.d.ts +21 -0
- package/dist/src/commands/proxy.js +310 -0
- package/dist/src/commands/security.js +29 -0
- package/dist/src/commands/settings.d.ts +19 -0
- package/dist/src/commands/settings.js +180 -0
- package/dist/src/commands/version.d.ts +42 -0
- package/dist/src/commands/version.js +106 -0
- package/dist/src/funnel/advisor-tip.d.ts +58 -0
- package/dist/src/funnel/advisor-tip.js +92 -0
- package/dist/src/funnel/attribution.d.ts +37 -0
- package/dist/src/funnel/attribution.js +101 -0
- package/dist/src/funnel/consent.d.ts +22 -0
- package/dist/src/funnel/consent.js +55 -0
- package/dist/src/funnel/credit-errors.d.ts +31 -0
- package/dist/src/funnel/credit-errors.js +88 -0
- package/dist/src/funnel/credit-notifier.d.ts +44 -0
- package/dist/src/funnel/credit-notifier.js +74 -0
- package/dist/src/funnel/disclosure.d.ts +46 -0
- package/dist/src/funnel/disclosure.js +97 -0
- package/dist/src/funnel/enrollment.d.ts +36 -0
- package/dist/src/funnel/enrollment.js +64 -0
- package/dist/src/funnel/environment.d.ts +17 -0
- package/dist/src/funnel/environment.js +39 -0
- package/dist/src/funnel/event-transport.d.ts +51 -0
- package/dist/src/funnel/event-transport.js +199 -0
- package/dist/src/funnel/events.d.ts +42 -0
- package/dist/src/funnel/events.js +150 -0
- package/dist/src/funnel/index.d.ts +20 -0
- package/dist/src/funnel/index.js +20 -0
- package/dist/src/funnel/insights.d.ts +49 -0
- package/dist/src/funnel/insights.js +120 -0
- package/dist/src/funnel/local-signals.d.ts +15 -0
- package/dist/src/funnel/local-signals.js +68 -0
- package/dist/src/funnel/message-transport.d.ts +51 -0
- package/dist/src/funnel/message-transport.js +149 -0
- package/dist/src/funnel/messages.d.ts +55 -0
- package/dist/src/funnel/messages.js +160 -0
- package/dist/src/funnel/power-saver-notifier.d.ts +44 -0
- package/dist/src/funnel/power-saver-notifier.js +92 -0
- package/dist/src/funnel/precedence.d.ts +16 -0
- package/dist/src/funnel/precedence.js +85 -0
- package/dist/src/funnel/promo.d.ts +41 -0
- package/dist/src/funnel/promo.js +144 -0
- package/dist/src/funnel/rate-limit-notifier.d.ts +55 -0
- package/dist/src/funnel/rate-limit-notifier.js +102 -0
- package/dist/src/funnel/rotation.d.ts +19 -0
- package/dist/src/funnel/rotation.js +70 -0
- package/dist/src/funnel/state.d.ts +13 -0
- package/dist/src/funnel/state.js +52 -0
- package/dist/src/funnel/toggle-cooldown.d.ts +17 -0
- package/dist/src/funnel/toggle-cooldown.js +32 -0
- package/dist/src/funnel/types.d.ts +86 -0
- package/dist/src/funnel/types.js +26 -0
- package/dist/src/init/executor.js +9 -3
- package/dist/src/init/helper-refresh.d.ts +33 -2
- package/dist/src/init/helper-refresh.js +102 -12
- package/dist/src/init/helpers-generator.js +52 -0
- package/dist/src/init/statusline-generator.js +292 -116
- package/dist/src/services/daemon-autostart.js +28 -5
- package/dist/src/services/fable-harness.d.ts +39 -0
- package/dist/src/services/fable-harness.js +41 -0
- package/package.json +13 -4
- package/dist/src/ruvector/lattice-wasm.d.ts +0 -14
- package/dist/src/ruvector/lattice-wasm.js +0 -144
- package/plugins/ruflo-metaharness/.claude-flow/daemon-state.json +0 -178
- package/plugins/ruflo-metaharness/.claude-flow/daemon.pid +0 -1
- package/plugins/ruflo-metaharness/.claude-flow/data/pending-insights.jsonl +0 -5
- package/plugins/ruflo-metaharness/.claude-flow/logs/daemon.log +0 -43
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783604774864_ozbujc_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783604774864_ozbujc_result.log +0 -108
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783605513587_ulvmpb_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783605513587_ulvmpb_result.log +0 -209
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783606368867_ahysui_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783606368867_ahysui_result.log +0 -192
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783604894861_v6n3ut_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783604894861_v6n3ut_result.log +0 -66
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783605934532_9h8ikb_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783605934532_9h8ikb_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783605134860_9jssz9_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783605134860_9jssz9_result.log +0 -69
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783606516743_zftbaa_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/metrics/backup.json +0 -7
- package/plugins/ruflo-metaharness/.claude-flow/metrics/codebase-map.json +0 -11
- package/plugins/ruflo-metaharness/.claude-flow/metrics/consolidation.json +0 -16
- package/plugins/ruflo-metaharness/.claude-flow/metrics/harness-loop.json +0 -83
- package/plugins/ruflo-metaharness/.claude-flow/metrics/performance.json +0 -67
- package/plugins/ruflo-metaharness/.claude-flow/metrics/security-audit.json +0 -191
- package/plugins/ruflo-metaharness/.claude-flow/metrics/test-gaps.json +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/neural/stats.json +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.25.6
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": {
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.1",
|
|
4
4
|
"files": {
|
|
5
5
|
"auto-memory-hook.mjs": "68be7e9a9eba7bf9c4e8a230db7bf61a243b965639f8504842799d6c6ca28762",
|
|
6
|
-
"hook-handler.cjs": "
|
|
7
|
-
"intelligence.cjs": "bd1f8e4b034944aee1df0391dc47ac2e8cc4b3aa542c65407a59d49620bbf76b"
|
|
6
|
+
"hook-handler.cjs": "2a18a761f0dc4839df8b6eeadf8f0ceb6badcc5bf14414c91555711a5e9d4bdc",
|
|
7
|
+
"intelligence.cjs": "bd1f8e4b034944aee1df0391dc47ac2e8cc4b3aa542c65407a59d49620bbf76b",
|
|
8
|
+
"statusline.cjs": "8abc67b7512e66fe5f8fe6cc5f099f827de6f7e2023a493f920090248d326e01"
|
|
8
9
|
}
|
|
9
10
|
},
|
|
10
|
-
"signature": "
|
|
11
|
+
"signature": "WJv7lzA3G5RhBcD8z7v1+uGwPHY6aIEoIPgOW5QjH3fRHvL0vMC7tVR+1QviVQtQY0hblBYrK4bpvFqzoFukAw==",
|
|
11
12
|
"algorithm": "ed25519"
|
|
12
13
|
}
|
|
@@ -15,9 +15,79 @@
|
|
|
15
15
|
|
|
16
16
|
const path = require('path');
|
|
17
17
|
const fs = require('fs');
|
|
18
|
+
const os = require('os');
|
|
18
19
|
|
|
19
20
|
const helpersDir = __dirname;
|
|
20
21
|
|
|
22
|
+
// Resolve an installed @claude-flow/cli (or ruflo) bin — mirrors
|
|
23
|
+
// statusline-generator.ts's resolveCliBin() candidate list. Used only to
|
|
24
|
+
// spawn the detached funnel-refresh helper below; failures are silent (no
|
|
25
|
+
// candidate found just means the refresh never fires this session).
|
|
26
|
+
function resolveCliBinForHook() {
|
|
27
|
+
try {
|
|
28
|
+
const home = os.homedir();
|
|
29
|
+
const cwd = process.cwd();
|
|
30
|
+
const candidates = [
|
|
31
|
+
path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'bin', 'cli.js'),
|
|
32
|
+
path.join(cwd, 'node_modules', '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
33
|
+
path.join(cwd, 'node_modules', 'ruflo', 'bin', 'cli.js'),
|
|
34
|
+
path.join(cwd, 'v3', '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
35
|
+
// helpersDir is .claude/helpers/ inside the package itself when this
|
|
36
|
+
// file is running from a real @claude-flow/cli install (not a project
|
|
37
|
+
// that merely copied the helper) — its bin/ is two levels up.
|
|
38
|
+
path.join(helpersDir, '..', '..', 'bin', 'cli.js'),
|
|
39
|
+
];
|
|
40
|
+
for (const p of candidates) {
|
|
41
|
+
if (fs.existsSync(p)) return p;
|
|
42
|
+
}
|
|
43
|
+
} catch (e) { /* ignore */ }
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Fire-and-forget doesn't work when the CALLER is itself a short-lived
|
|
48
|
+
// subprocess (confirmed live: two consecutive statusline renders 5s apart
|
|
49
|
+
// both saw an empty funnel-messages-cache, because the async HTTPS fetch
|
|
50
|
+
// inside a `void refreshRemoteMessages()` call gets killed when the spawning
|
|
51
|
+
// process exits before the request completes). Spawning fully DETACHED +
|
|
52
|
+
// unref'd decouples the refresh's lifetime from this hook's — it keeps
|
|
53
|
+
// running (up to message-transport.ts's own 4s fetch timeout) even after
|
|
54
|
+
// session-restore's own process has already exited, so it actually gets a
|
|
55
|
+
// chance to write the cache. Never awaited here — must not add to
|
|
56
|
+
// SessionStart's own timeout budget.
|
|
57
|
+
function spawnDetachedFunnelRefresh() {
|
|
58
|
+
try {
|
|
59
|
+
const cliBin = resolveCliBinForHook();
|
|
60
|
+
if (!cliBin) return;
|
|
61
|
+
const { spawn } = require('child_process');
|
|
62
|
+
const child = spawn(process.execPath, [cliBin, 'hooks', 'refresh-funnel', '--quiet'], {
|
|
63
|
+
detached: true,
|
|
64
|
+
stdio: 'ignore',
|
|
65
|
+
env: process.env,
|
|
66
|
+
});
|
|
67
|
+
child.unref();
|
|
68
|
+
} catch (e) { /* best-effort only */ }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Same detached/unref'd pattern as spawnDetachedFunnelRefresh() above, for
|
|
72
|
+
// ADR-316's co-pilot advisor tip. Safe to call on EVERY session-restore:
|
|
73
|
+
// refresh-advisor's own action checks consent + a 24h TTL BEFORE spending
|
|
74
|
+
// anything, so an unconsented or already-fresh install is a fast no-op file
|
|
75
|
+
// read, never a network call. Never awaited here — must not add to
|
|
76
|
+
// SessionStart's own timeout budget.
|
|
77
|
+
function spawnDetachedAdvisorRefresh() {
|
|
78
|
+
try {
|
|
79
|
+
const cliBin = resolveCliBinForHook();
|
|
80
|
+
if (!cliBin) return;
|
|
81
|
+
const { spawn } = require('child_process');
|
|
82
|
+
const child = spawn(process.execPath, [cliBin, 'hooks', 'refresh-advisor', '--quiet'], {
|
|
83
|
+
detached: true,
|
|
84
|
+
stdio: 'ignore',
|
|
85
|
+
env: process.env,
|
|
86
|
+
});
|
|
87
|
+
child.unref();
|
|
88
|
+
} catch (e) { /* best-effort only */ }
|
|
89
|
+
}
|
|
90
|
+
|
|
21
91
|
// Safe require with stdout suppression - the helper modules have CLI
|
|
22
92
|
// sections that run unconditionally on require(), so we mute console
|
|
23
93
|
// during the require to prevent noisy output.
|
|
@@ -168,6 +238,57 @@ const handlers = {
|
|
|
168
238
|
} else {
|
|
169
239
|
console.log('[INFO] Router not available, using default routing');
|
|
170
240
|
}
|
|
241
|
+
|
|
242
|
+
// Rate-limit -> sponsored-capacity nudge (ADR-312/313). Fires here,
|
|
243
|
+
// client-side, BEFORE the API call this prompt would make — so it still
|
|
244
|
+
// reaches the transcript even if that call then fails from the rate
|
|
245
|
+
// limit. Cheap local file reads only; never a network call or a child
|
|
246
|
+
// process, so it cannot add latency to prompt submission.
|
|
247
|
+
try {
|
|
248
|
+
const rlFunnelEnv = process.env.RUFLO_FUNNEL;
|
|
249
|
+
const rlDisabledByEnv = rlFunnelEnv !== undefined && /^(0|false|off|no)$/i.test(String(rlFunnelEnv).trim());
|
|
250
|
+
const rlCiVars = ['CI', 'GITHUB_ACTIONS', 'GITLAB_CI', 'CIRCLECI', 'TRAVIS', 'BUILDKITE', 'JENKINS_URL', 'TEAMCITY_VERSION', 'TF_BUILD'];
|
|
251
|
+
const rlIsCi = rlCiVars.some((v) => {
|
|
252
|
+
const val = process.env[v];
|
|
253
|
+
return val !== undefined && val !== '' && val !== '0' && String(val).toLowerCase() !== 'false';
|
|
254
|
+
});
|
|
255
|
+
const rlHome = path.join(os.homedir(), '.ruflo');
|
|
256
|
+
let rlUserDisabled = false;
|
|
257
|
+
try {
|
|
258
|
+
const rlUserCfg = JSON.parse(fs.readFileSync(path.join(rlHome, 'funnel.json'), 'utf8'));
|
|
259
|
+
rlUserDisabled = !!(rlUserCfg && rlUserCfg.enabled === false);
|
|
260
|
+
} catch (e) { /* absent/malformed = not disabled */ }
|
|
261
|
+
let rlProjectDisabled = false;
|
|
262
|
+
try {
|
|
263
|
+
const rlProjCfg = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'claude-flow.config.json'), 'utf8'));
|
|
264
|
+
rlProjectDisabled = !!(rlProjCfg && rlProjCfg.funnel && rlProjCfg.funnel.enabled === false);
|
|
265
|
+
} catch (e) { /* absent/malformed = not disabled */ }
|
|
266
|
+
|
|
267
|
+
if (!rlDisabledByEnv && !rlIsCi && !rlUserDisabled && !rlProjectDisabled) {
|
|
268
|
+
let rlStatus = null;
|
|
269
|
+
try { rlStatus = JSON.parse(fs.readFileSync(path.join(rlHome, 'rate-limit-status.json'), 'utf8')); } catch (e) { /* not flagged */ }
|
|
270
|
+
let rlIsLimited = false;
|
|
271
|
+
if (rlStatus && rlStatus.limited) {
|
|
272
|
+
if (rlStatus.since) {
|
|
273
|
+
const rlSinceMs = Date.parse(rlStatus.since);
|
|
274
|
+
rlIsLimited = isNaN(rlSinceMs) ? true : (Date.now() - rlSinceMs) < 6 * 60 * 60 * 1000;
|
|
275
|
+
} else {
|
|
276
|
+
rlIsLimited = true;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (rlIsLimited) {
|
|
280
|
+
let rlConsented = false;
|
|
281
|
+
try {
|
|
282
|
+
const rlConsentFile = JSON.parse(fs.readFileSync(path.join(rlHome, 'consent.json'), 'utf8'));
|
|
283
|
+
const rlReceipt = rlConsentFile && rlConsentFile['sponsored-downtime'];
|
|
284
|
+
rlConsented = !!(rlReceipt && rlReceipt.granted === true && rlReceipt.at !== null && rlReceipt.policyVersion === 1);
|
|
285
|
+
} catch (e) { /* not consented */ }
|
|
286
|
+
if (!rlConsented) {
|
|
287
|
+
console.log('[COGNITUM] Hit your Claude usage limit? Free sponsored capacity is available at cognitum.one/meta-llm — run: ruflo proxy sponsor-enable --yes');
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
} catch (e) { /* nudge must never break the hook */ }
|
|
171
292
|
},
|
|
172
293
|
|
|
173
294
|
'pre-bash': () => {
|
|
@@ -234,6 +355,14 @@ const handlers = {
|
|
|
234
355
|
console.log(`[INTELLIGENCE] Loaded ${initResult.nodes} patterns, ${initResult.edges} edges`);
|
|
235
356
|
}
|
|
236
357
|
}
|
|
358
|
+
// Warm the funnel message cache once per session (see
|
|
359
|
+
// spawnDetachedFunnelRefresh's doc comment for why this must happen
|
|
360
|
+
// here, detached, rather than as the statusline's own fire-and-forget).
|
|
361
|
+
spawnDetachedFunnelRefresh();
|
|
362
|
+
// ADR-316 co-pilot advisor tip — same detached pattern; cheap no-op
|
|
363
|
+
// when not consented or still within the 24h TTL (see refresh-advisor's
|
|
364
|
+
// own doc comment).
|
|
365
|
+
spawnDetachedAdvisorRefresh();
|
|
237
366
|
},
|
|
238
367
|
|
|
239
368
|
'session-end': async () => {
|