@claude-flow/cli 3.38.19 → 3.38.21
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-version +1 -1
- package/.claude/helpers/helpers.manifest.json +3 -3
- package/.claude/helpers/statusline.cjs +71 -4
- package/catalog-manifest.json +4 -4
- package/dist/src/commands/proxy-lifecycle.js +6 -5
- package/dist/src/log-filters.d.ts +3 -3
- package/dist/src/memory/memory-initializer.js +28 -8
- package/dist/src/proxy/activation.d.ts +14 -0
- package/dist/src/proxy/activation.js +210 -0
- package/dist/src/proxy/install.js +3 -0
- package/dist/src/proxy/paths.d.ts +2 -0
- package/dist/src/proxy/paths.js +4 -0
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts +6 -6
- package/package.json +1 -1
- 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 -269
- 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/audit_1783607120257_lh05rb_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783607120257_lh05rb_result.log +0 -13
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608020362_j3096j_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608020362_j3096j_result.log +0 -120
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608776347_261b61_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783608776347_261b61_result.log +0 -85
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783609621359_s5i6ye_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783609621359_s5i6ye_result.log +0 -13
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610087998_qihv9v_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610087998_qihv9v_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610773920_qlzmxo_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783610773920_qlzmxo_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783611376090_xpqf1z_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783611376090_xpqf1z_result.log +0 -16
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612097184_9rqfor_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612097184_9rqfor_result.log +0 -138
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612811574_4u602j_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783612811574_4u602j_result.log +0 -16
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783613750487_a46ttn_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783613750487_a46ttn_result.log +0 -107
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783614289360_figwc0_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783614289360_figwc0_result.log +0 -200
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615067640_l7tm6a_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615067640_l7tm6a_result.log +0 -54
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783615825308_44nor5_result.log +0 -85
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783616524771_ut1ftw_result.log +0 -266
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783617323039_fs3x5a_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618049184_1f4yah_result.log +0 -96
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783618793925_4ee7tf_result.log +0 -481
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783619642574_yjr4mm_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783619642574_yjr4mm_result.log +0 -104
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783620392771_oduto0_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783620392771_oduto0_result.log +0 -148
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621183670_gd0p1x_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621183670_gd0p1x_result.log +0 -111
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621738388_z4k48b_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783621738388_z4k48b_result.log +0 -89
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783622493677_zwc35w_prompt.log +0 -19
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/audit_1783622493677_zwc35w_result.log +0 -207
- 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/optimize_1783607181736_t12f4y_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783607181736_t12f4y_result.log +0 -78
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783608341266_zhk0fl_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783608341266_zhk0fl_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783609420180_7xw817_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783609420180_7xw817_result.log +0 -72
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783610535307_2pxofp_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783610535307_2pxofp_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783611437445_ofwnpb_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783611437445_ofwnpb_result.log +0 -60
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783612556827_1cb112_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783612556827_1cb112_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783613579531_18xiax_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783613579531_18xiax_result.log +0 -74
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783614650481_2zdz7w_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783614650481_2zdz7w_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783615742328_rjj69d_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783615742328_rjj69d_result.log +0 -65
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783616767230_1iad99_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783616767230_1iad99_result.log +0 -68
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783617783537_rqagku_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783617783537_rqagku_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783618817343_r1lbhr_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783618817343_r1lbhr_result.log +0 -65
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783619907773_8msfw3_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783619907773_8msfw3_result.log +0 -77
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783621009302_hybdum_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783621009302_hybdum_result.log +0 -64
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783622083681_nznpnx_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783622083681_nznpnx_result.log +0 -56
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/optimize_1783623208340_olsbaw_prompt.log +0 -14
- 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/logs/headless/testgaps_1783606516743_zftbaa_result.log +0 -92
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783608038317_jrd66e_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783608038317_jrd66e_result.log +0 -92
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783609388416_mc3zoe_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783609388416_mc3zoe_result.log +0 -82
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783610821384_tzqvlb_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783610821384_tzqvlb_result.log +0 -17
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783612023285_buygpo_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783612023285_buygpo_result.log +0 -57
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783613599301_6f78cw_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783613599301_6f78cw_result.log +0 -60
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783615000844_v95ues_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783615000844_v95ues_result.log +0 -69
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783616341693_bl5d9o_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783616341693_bl5d9o_result.log +0 -64
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783617832831_ha6s8d_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783617832831_ha6s8d_result.log +0 -42
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783619384959_s5iiwf_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783619384959_s5iiwf_result.log +0 -47
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783620946263_d7ovai_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783620946263_d7ovai_result.log +0 -52
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783622473846_t839e5_prompt.log +0 -14
- package/plugins/ruflo-metaharness/.claude-flow/logs/headless/testgaps_1783622473846_t839e5_result.log +0 -96
- 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 -55
- package/plugins/ruflo-metaharness/.claude-flow/metrics/security-audit.json +0 -206
- package/plugins/ruflo-metaharness/.claude-flow/metrics/test-gaps.json +0 -95
- package/plugins/ruflo-metaharness/.claude-flow/neural/stats.json +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
3.38.
|
|
1
|
+
3.38.21
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": {
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.21",
|
|
4
4
|
"files": {
|
|
5
5
|
"auto-memory-hook.mjs": "85fe05c757421c52137c0bc8545a0896bab6b4714538c2a11d1d0835bfcc8c1c",
|
|
6
6
|
"hook-handler.cjs": "dae295fb9ae2626b89899c19a20cc911541af82b52d2eeb9b214d618b96e9a86",
|
|
7
7
|
"intelligence.cjs": "30e42ed7ec4ca5a94ac54fdb1330d2d47ac5f3fdeeef207753574723a9e77b5c",
|
|
8
|
-
"statusline.cjs": "
|
|
8
|
+
"statusline.cjs": "4a48353b4f1566fa4379b00fd0321b6676a22b6cc91fbbd8380ac5183d619468"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"signature": "
|
|
11
|
+
"signature": "wxXkWxgHyxCi4QwBfHeomKd+yB4yFN7BGjt34e4fo/Y8TuhUuRqSiw7y+WV2euDa734J/lEx9mP7xMwg4dw2Cw==",
|
|
12
12
|
"algorithm": "ed25519"
|
|
13
13
|
}
|
|
@@ -556,6 +556,68 @@ function getLocalSecurity(cliSecurity) {
|
|
|
556
556
|
return base;
|
|
557
557
|
}
|
|
558
558
|
|
|
559
|
+
// Cached pattern count. The store is routinely >10MB (14.5MB / 1277 patterns on
|
|
560
|
+
// the machine this was diagnosed on, costing 53ms to read+parse), and the
|
|
561
|
+
// statusline re-renders on every prompt, so the parse is keyed on the file's
|
|
562
|
+
// mtime+size and reused until the store actually changes.
|
|
563
|
+
const PATTERN_COUNT_CACHE = path.join(os.tmpdir(), 'ruflo-statusline-patterns-' + require('crypto').createHash('md5').update(CWD).digest('hex').slice(0, 8) + '.json');
|
|
564
|
+
|
|
565
|
+
function countPatternsCached(file) {
|
|
566
|
+
let stat;
|
|
567
|
+
try { stat = fs.statSync(file); } catch { return 0; }
|
|
568
|
+
const key = stat.mtimeMs + ':' + stat.size;
|
|
569
|
+
|
|
570
|
+
try {
|
|
571
|
+
const memo = JSON.parse(fs.readFileSync(PATTERN_COUNT_CACHE, 'utf-8'));
|
|
572
|
+
if (memo && memo[file] && memo[file].key === key) return memo[file].count;
|
|
573
|
+
} catch { /* no memo yet, or unreadable — fall through and recount */ }
|
|
574
|
+
|
|
575
|
+
let count = 0;
|
|
576
|
+
try {
|
|
577
|
+
const raw = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
578
|
+
if (Array.isArray(raw)) count = raw.length;
|
|
579
|
+
else if (raw && Array.isArray(raw.patterns)) count = raw.patterns.length;
|
|
580
|
+
else if (raw && typeof raw === 'object') count = Object.keys(raw).length;
|
|
581
|
+
} catch { return 0; }
|
|
582
|
+
|
|
583
|
+
try {
|
|
584
|
+
let memo = {};
|
|
585
|
+
try { memo = JSON.parse(fs.readFileSync(PATTERN_COUNT_CACHE, 'utf-8')) || {}; } catch { /* start fresh */ }
|
|
586
|
+
memo[file] = { key, count };
|
|
587
|
+
fs.writeFileSync(PATTERN_COUNT_CACHE, JSON.stringify(memo));
|
|
588
|
+
} catch { /* cache is an optimisation, never a requirement */ }
|
|
589
|
+
|
|
590
|
+
return count;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// `system` is nominally CLI-populated, but the pattern store is on disk, so a
|
|
594
|
+
// dead CLI must not render as "no learning". Without this, every candidate in
|
|
595
|
+
// resolveCliBinCandidates() failing (a source-only marketplace checkout, or an
|
|
596
|
+
// npx fetch that dies in a workspace root) silently degraded the brain to a
|
|
597
|
+
// hardcoded 0% while the overlaid segments beside it kept showing live data —
|
|
598
|
+
// indistinguishable from a genuine zero. Same reasoning as getLocalAgentDB(),
|
|
599
|
+
// which had to start reading locally after the statusline reported "Vectors 0"
|
|
600
|
+
// on a database holding thousands.
|
|
601
|
+
function getLocalIntelligence(current) {
|
|
602
|
+
const base = (current && typeof current === 'object') ? current : {};
|
|
603
|
+
if (typeof base.intelligencePct === 'number' && base.intelligencePct > 0) return base;
|
|
604
|
+
|
|
605
|
+
for (const file of [
|
|
606
|
+
path.join(CWD, '.claude-flow', 'neural', 'patterns.json'),
|
|
607
|
+
path.join(os.homedir(), '.claude-flow', 'neural', 'patterns.json'),
|
|
608
|
+
]) {
|
|
609
|
+
const n = countPatternsCached(file);
|
|
610
|
+
if (n > 0) {
|
|
611
|
+
base.intelligencePct = Math.min(100, Math.floor(n / 10));
|
|
612
|
+
return base;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// No CLI value and no local store: unknown, which is not the same as zero.
|
|
617
|
+
base.intelligencePct = null;
|
|
618
|
+
return base;
|
|
619
|
+
}
|
|
620
|
+
|
|
559
621
|
// Overlay every locally-derived block onto the CLI data (mutates in place).
|
|
560
622
|
function applyLocalOverlays(data) {
|
|
561
623
|
data.adrs = getLocalADRCount();
|
|
@@ -566,6 +628,7 @@ function applyLocalOverlays(data) {
|
|
|
566
628
|
// Security overlay: recompute freshness from disk on every render so cached
|
|
567
629
|
// CLI JSON can never freeze the pill at PENDING. See getLocalSecurity() above.
|
|
568
630
|
data.security = getLocalSecurity(data.security);
|
|
631
|
+
data.system = getLocalIntelligence(data.system);
|
|
569
632
|
return data;
|
|
570
633
|
}
|
|
571
634
|
|
|
@@ -579,7 +642,7 @@ function buildLocalFallback() {
|
|
|
579
642
|
v3Progress: { domainsCompleted: 0, totalDomains: 5, dddProgress: 0, patternsLearned: 0, sessionsCompleted: 0 },
|
|
580
643
|
security: { status: 'NONE', findings: 0, cvesFixed: 0, totalCves: 0 },
|
|
581
644
|
swarm: { activeAgents: 0, maxAgents: CONFIG.maxAgents, coordinationActive: false },
|
|
582
|
-
system: { memoryMB: memMB, contextPct: 0, intelligencePct:
|
|
645
|
+
system: { memoryMB: memMB, contextPct: 0, intelligencePct: null, subAgents: 0 },
|
|
583
646
|
lastUpdated: new Date().toISOString(),
|
|
584
647
|
});
|
|
585
648
|
}
|
|
@@ -941,7 +1004,11 @@ function generateStatusline() {
|
|
|
941
1004
|
const activeAgents = swarm.activeAgents || 0;
|
|
942
1005
|
const maxAgents = swarm.maxAgents || CONFIG.maxAgents;
|
|
943
1006
|
const coordinationActive = swarm.coordinationActive || false;
|
|
944
|
-
|
|
1007
|
+
// null/undefined means "no source answered", which must not collapse to 0 --
|
|
1008
|
+
// that is exactly the ambiguity this segment used to present.
|
|
1009
|
+
const intelligencePct = (typeof system.intelligencePct === 'number')
|
|
1010
|
+
? system.intelligencePct
|
|
1011
|
+
: null;
|
|
945
1012
|
const memoryMB = system.memoryMB || 0;
|
|
946
1013
|
const subAgents = system.subAgents || 0;
|
|
947
1014
|
const findings = Math.max(0, security.findings || 0);
|
|
@@ -997,14 +1064,14 @@ function generateStatusline() {
|
|
|
997
1064
|
// do next; diagnostic detail moves to `ruflo status --verbose`.
|
|
998
1065
|
const agentsColor = activeAgents > 0 ? c.brightGreen : c.dim;
|
|
999
1066
|
const hooksColor = hooksEnabled > 0 ? c.brightGreen : c.dim;
|
|
1000
|
-
const intellColor = intelligencePct >= 80 ? c.brightGreen : intelligencePct >= 40 ? c.brightYellow : c.dim;
|
|
1067
|
+
const intellColor = intelligencePct === null ? c.dim : intelligencePct >= 80 ? c.brightGreen : intelligencePct >= 40 ? c.brightYellow : c.dim;
|
|
1001
1068
|
const swarmInd = coordinationActive ? c.brightGreen + '◉' + c.reset + ' ' : c.dim + '○' + c.reset + ' ';
|
|
1002
1069
|
const healthAllGreen = (secStatus === 'CLEAN' || secStatus === 'NONE') && findings === 0;
|
|
1003
1070
|
const opsParts = [];
|
|
1004
1071
|
opsParts.push(c.cyan + 'Swarm ' + swarmInd + agentsColor + activeAgents + c.reset + '/' + c.brightWhite + maxAgents + c.reset);
|
|
1005
1072
|
if (subAgents > 0) opsParts.push(c.brightPurple + '👥 ' + subAgents + c.reset);
|
|
1006
1073
|
opsParts.push(c.cyan + 'Hooks ' + hooksColor + hooksEnabled + c.reset + '/' + c.brightWhite + hooksTotal + c.reset);
|
|
1007
|
-
opsParts.push(intellColor + '🧠 ' + intelligencePct + '%' + c.reset);
|
|
1074
|
+
opsParts.push(intellColor + '🧠 ' + (intelligencePct === null ? '—' : intelligencePct + '%') + c.reset);
|
|
1008
1075
|
opsParts.push(c.brightCyan + '💾 ' + memoryMB + 'MB' + c.reset);
|
|
1009
1076
|
// Health: one glyph when green, terse copy when there's something to act on.
|
|
1010
1077
|
if (healthAllGreen) {
|
package/catalog-manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generation":
|
|
4
|
-
"generatedAt": "2026-
|
|
5
|
-
"gitSha": "
|
|
3
|
+
"generation": 6,
|
|
4
|
+
"generatedAt": "2026-09-02T13:38:52.286Z",
|
|
5
|
+
"gitSha": "b3db0180",
|
|
6
6
|
"catalog": {
|
|
7
|
-
"agents":
|
|
7
|
+
"agents": 167,
|
|
8
8
|
"tools": 397,
|
|
9
9
|
"skills": 34
|
|
10
10
|
},
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { output } from '../output.js';
|
|
9
9
|
import { hasConsent, recordConsent, revokeConsent } from '../funnel/index.js';
|
|
10
|
-
import {
|
|
10
|
+
import { uninstallProxy } from '../proxy/install.js';
|
|
11
|
+
import { installAndActivateProxy } from '../proxy/activation.js';
|
|
11
12
|
import { startForeground, startBackground, stopProxy, getProxyStatus, readProxyLogTail, watchProxyLog, ProxyNotInstalledError, ProxyAlreadyRunningError, } from '../proxy/lifecycle.js';
|
|
12
13
|
import { proxyTokenPath } from '../proxy/paths.js';
|
|
13
14
|
import { removeInjectedToken, startTokenRefreshPump } from '../proxy/token-bridge.js';
|
|
@@ -135,8 +136,8 @@ const installSub = {
|
|
|
135
136
|
try {
|
|
136
137
|
const spinner = output.createSpinner({ text: `Installing meta-proxy ${version}...`, spinner: 'dots' });
|
|
137
138
|
spinner.start();
|
|
138
|
-
const result = await
|
|
139
|
-
spinner.succeed(`meta-proxy ${version} installed`);
|
|
139
|
+
const result = await installAndActivateProxy(version, (line) => spinner.setText(line));
|
|
140
|
+
spinner.succeed(`meta-proxy ${version} installed and verified effective`);
|
|
140
141
|
output.writeln(` binary: ${result.binaryPath}`);
|
|
141
142
|
output.writeln(` sha256: ${result.sha256}`);
|
|
142
143
|
return { success: true, data: result };
|
|
@@ -172,8 +173,8 @@ const updateSub = {
|
|
|
172
173
|
try {
|
|
173
174
|
const spinner = output.createSpinner({ text: `Updating meta-proxy to ${version}...`, spinner: 'dots' });
|
|
174
175
|
spinner.start();
|
|
175
|
-
const result = await
|
|
176
|
-
spinner.succeed(`meta-proxy updated to ${version}`);
|
|
176
|
+
const result = await installAndActivateProxy(version, (line) => spinner.setText(line));
|
|
177
|
+
spinner.succeed(`meta-proxy updated to ${version} and verified effective`);
|
|
177
178
|
output.writeln(` binary: ${result.binaryPath}`);
|
|
178
179
|
return { success: true, data: result };
|
|
179
180
|
}
|
|
@@ -40,7 +40,7 @@ declare const STDERR_REDIRECT_PREFIXES: string[];
|
|
|
40
40
|
declare const AGENTDB_MOCK_FALLBACK_DROP_PREFIXES: string[];
|
|
41
41
|
declare const shouldRedirectToStderr: (msg: unknown) => boolean;
|
|
42
42
|
declare const isAgentdbMockFallbackNoise: (msg: unknown) => boolean;
|
|
43
|
-
declare const origWarn: (
|
|
44
|
-
declare const origLog: (
|
|
45
|
-
declare const origError: (
|
|
43
|
+
declare const origWarn: (...data: any[]) => void;
|
|
44
|
+
declare const origLog: (...data: any[]) => void;
|
|
45
|
+
declare const origError: (...data: any[]) => void;
|
|
46
46
|
//# sourceMappingURL=log-filters.d.ts.map
|
|
@@ -1250,13 +1250,33 @@ export async function checkAndMigrateLegacy(options) {
|
|
|
1250
1250
|
* (ReasoningBank, SkillLibrary, ExplainableRecall, etc.) are instantiated.
|
|
1251
1251
|
*
|
|
1252
1252
|
* Uses the memory-bridge's getControllerRegistry() which lazily creates
|
|
1253
|
-
* a singleton ControllerRegistry
|
|
1254
|
-
*
|
|
1253
|
+
* a singleton ControllerRegistry. Deliberately called with NO dbPath so the
|
|
1254
|
+
* bridge resolves its own dedicated file via `getAgentDbPath()` — the same
|
|
1255
|
+
* resolution every other bridge call (bridgeStoreEntry, bridgeGetEntry, ...)
|
|
1256
|
+
* uses when it omits `dbPath`. After this call, all enabled controllers are
|
|
1257
|
+
* ready for immediate use.
|
|
1255
1258
|
*
|
|
1256
|
-
*
|
|
1257
|
-
*
|
|
1259
|
+
* #3155: this used to be called with the sql.js-facing `memory.db` path
|
|
1260
|
+
* (the one just written by the block above, via `resolveDbPath()`), which
|
|
1261
|
+
* seeded the process-wide ControllerRegistry singleton with THAT file as
|
|
1262
|
+
* AgentDB's native better-sqlite3 database — instead of the dedicated
|
|
1263
|
+
* `agentdb-memory.db` sibling `getAgentDbPath()` exists specifically to
|
|
1264
|
+
* provide (#2786, so native better-sqlite3 doesn't hit a possibly-encrypted
|
|
1265
|
+
* `memory.db`). Because `initializeMemoryDatabase()` only reaches this call
|
|
1266
|
+
* on a database's FIRST-EVER init (the `#1791.6` already-exists branch above
|
|
1267
|
+
* returns early without activating anything), a bridge started against a
|
|
1268
|
+
* brand-new `.swarm/` directory would activate the registry against
|
|
1269
|
+
* `memory.db`, store/retrieve correctly for that process's lifetime, and
|
|
1270
|
+
* then a SUBSEQUENT process — where `.swarm/memory.db` already exists so
|
|
1271
|
+
* this init path is skipped — would have its first bridge call activate the
|
|
1272
|
+
* registry against `agentdb-memory.db` instead (via the `dbPath ||
|
|
1273
|
+
* getAgentDbPath()` fallback in memory-bridge.ts's `getRegistry()`), an
|
|
1274
|
+
* empty file that never received the earlier writes. Restarting the bridge
|
|
1275
|
+
* therefore silently lost read access to everything it had written, with no
|
|
1276
|
+
* error anywhere. Passing no dbPath here makes both code paths agree on
|
|
1277
|
+
* `agentdb-memory.db` every time, regardless of init history.
|
|
1258
1278
|
*/
|
|
1259
|
-
async function activateControllerRegistry(
|
|
1279
|
+
async function activateControllerRegistry(verbose) {
|
|
1260
1280
|
const startTime = performance.now();
|
|
1261
1281
|
const activated = [];
|
|
1262
1282
|
const failed = [];
|
|
@@ -1265,7 +1285,7 @@ async function activateControllerRegistry(dbPath, verbose) {
|
|
|
1265
1285
|
if (!bridge) {
|
|
1266
1286
|
return { activated, failed, initTimeMs: performance.now() - startTime };
|
|
1267
1287
|
}
|
|
1268
|
-
const registry = await bridge.getControllerRegistry(
|
|
1288
|
+
const registry = await bridge.getControllerRegistry();
|
|
1269
1289
|
if (!registry) {
|
|
1270
1290
|
return { activated, failed, initTimeMs: performance.now() - startTime };
|
|
1271
1291
|
}
|
|
@@ -1708,7 +1728,7 @@ export async function initializeMemoryDatabase(options) {
|
|
|
1708
1728
|
fs.writeFileSync(schemaPath, MEMORY_SCHEMA_V3 + '\n' + getInitialMetadata(backend));
|
|
1709
1729
|
// ADR-053: Activate ControllerRegistry so controllers (ReasoningBank,
|
|
1710
1730
|
// SkillLibrary, ExplainableRecall, etc.) are instantiated during init
|
|
1711
|
-
const controllerResult = await activateControllerRegistry(
|
|
1731
|
+
const controllerResult = await activateControllerRegistry(verbose);
|
|
1712
1732
|
return {
|
|
1713
1733
|
success: true,
|
|
1714
1734
|
backend,
|
|
@@ -1768,7 +1788,7 @@ export async function initializeMemoryDatabase(options) {
|
|
|
1768
1788
|
sqliteHeader[27] = 0x20; // leaf payload
|
|
1769
1789
|
writeFileRestricted(dbPath, sqliteHeader, { encrypt: true });
|
|
1770
1790
|
// ADR-053: Activate ControllerRegistry even on fallback path
|
|
1771
|
-
const controllerResult = await activateControllerRegistry(
|
|
1791
|
+
const controllerResult = await activateControllerRegistry(verbose);
|
|
1772
1792
|
return {
|
|
1773
1793
|
success: true,
|
|
1774
1794
|
backend,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type InstallResult } from './install.js';
|
|
2
|
+
export interface EffectiveProxy {
|
|
3
|
+
version: string;
|
|
4
|
+
pid: number;
|
|
5
|
+
executable: string;
|
|
6
|
+
}
|
|
7
|
+
type Wait = (milliseconds: number) => Promise<void>;
|
|
8
|
+
export declare function probeEffectiveProxy(fetcher?: typeof fetch, platform?: NodeJS.Platform): Promise<EffectiveProxy | null>;
|
|
9
|
+
export declare function acquireProxyInstallLease(wait?: Wait): Promise<() => void>;
|
|
10
|
+
export declare function installAndActivateProxy(version: string, log?: (line: string) => void): Promise<InstallResult & {
|
|
11
|
+
pid: number;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=activation.d.ts.map
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/** Transactional activation of the daemon that actually owns the proxy port. */
|
|
2
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
3
|
+
import * as fs from 'node:fs';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
import { installProxy } from './install.js';
|
|
7
|
+
import { isLoopbackBind, proxyBinaryPath, proxyConfigPath, proxyInstallLockPath, proxyInstallManifestPath, proxyLogFilePath, proxyPidFilePath, } from './paths.js';
|
|
8
|
+
const waitNormally = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
9
|
+
function processExists(pid) {
|
|
10
|
+
try {
|
|
11
|
+
process.kill(pid, 0);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return error.code === 'EPERM';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function effectiveEndpoint() {
|
|
19
|
+
let bind = '127.0.0.1:11435';
|
|
20
|
+
try {
|
|
21
|
+
const match = fs.readFileSync(proxyConfigPath(), 'utf8').match(/^bind\s*=\s*"([^"]+)"\s*$/m);
|
|
22
|
+
if (match?.[1])
|
|
23
|
+
bind = match[1];
|
|
24
|
+
}
|
|
25
|
+
catch { /* documented default */ }
|
|
26
|
+
if (!isLoopbackBind(bind))
|
|
27
|
+
throw new Error(`Refusing to probe non-loopback Meta-Proxy bind "${bind}".`);
|
|
28
|
+
return `http://${bind}`;
|
|
29
|
+
}
|
|
30
|
+
function executableFor(pid, platform) {
|
|
31
|
+
try {
|
|
32
|
+
if (platform === 'linux') {
|
|
33
|
+
const result = spawnSync('readlink', ['-f', `/proc/${pid}/exe`], { encoding: 'utf8', timeout: 2_000 });
|
|
34
|
+
return result.status === 0 ? result.stdout.trim() || null : null;
|
|
35
|
+
}
|
|
36
|
+
if (platform === 'win32') {
|
|
37
|
+
const command = `$p = Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}'; if ($null -ne $p) { [Console]::Out.Write($p.ExecutablePath) }`;
|
|
38
|
+
const result = spawnSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', command], { encoding: 'utf8', timeout: 2_000, windowsHide: true });
|
|
39
|
+
return result.status === 0 ? result.stdout.trim() || null : null;
|
|
40
|
+
}
|
|
41
|
+
const result = spawnSync('ps', ['-p', String(pid), '-o', 'comm='], { encoding: 'utf8', timeout: 2_000 });
|
|
42
|
+
return result.status === 0 ? result.stdout.trim() || null : null;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function isSupportedOwner(executable, platform) {
|
|
49
|
+
const name = platform === 'win32' ? 'meta-proxy.exe' : 'meta-proxy';
|
|
50
|
+
const normalize = (value) => platform === 'win32' ? path.resolve(value).toLowerCase() : path.resolve(value);
|
|
51
|
+
const allowed = [
|
|
52
|
+
proxyBinaryPath(),
|
|
53
|
+
path.join(homedir(), '.metaharness', 'meta-proxy', 'bin', name),
|
|
54
|
+
path.join(homedir(), '.metaharness', 'bin', name),
|
|
55
|
+
path.join(homedir(), '.cargo', 'bin', name),
|
|
56
|
+
].map(normalize);
|
|
57
|
+
return allowed.includes(normalize(executable));
|
|
58
|
+
}
|
|
59
|
+
export async function probeEffectiveProxy(fetcher = globalThis.fetch, platform = process.platform) {
|
|
60
|
+
const endpoint = effectiveEndpoint();
|
|
61
|
+
try {
|
|
62
|
+
const controller = new AbortController();
|
|
63
|
+
const timer = setTimeout(() => controller.abort(), 1_000);
|
|
64
|
+
let response;
|
|
65
|
+
try {
|
|
66
|
+
response = await fetcher(`${endpoint}/version`, { signal: controller.signal });
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
clearTimeout(timer);
|
|
70
|
+
}
|
|
71
|
+
if (!response.ok)
|
|
72
|
+
return null;
|
|
73
|
+
const body = await response.json();
|
|
74
|
+
if (typeof body.version !== 'string' || !/^\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/.test(body.version))
|
|
75
|
+
return null;
|
|
76
|
+
if (!Number.isSafeInteger(body.pid) || Number(body.pid) <= 0)
|
|
77
|
+
return null;
|
|
78
|
+
const executable = executableFor(Number(body.pid), platform);
|
|
79
|
+
return executable ? { version: body.version, pid: Number(body.pid), executable } : null;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export async function acquireProxyInstallLease(wait = waitNormally) {
|
|
86
|
+
const lock = proxyInstallLockPath();
|
|
87
|
+
fs.mkdirSync(path.dirname(lock), { recursive: true, mode: 0o700 });
|
|
88
|
+
for (let attempt = 0; attempt < 200; attempt++) {
|
|
89
|
+
try {
|
|
90
|
+
fs.mkdirSync(lock, { mode: 0o700 });
|
|
91
|
+
fs.writeFileSync(path.join(lock, 'owner'), `${process.pid}\n`, { mode: 0o600 });
|
|
92
|
+
return () => fs.rmSync(lock, { recursive: true, force: true });
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (error.code !== 'EEXIST')
|
|
96
|
+
throw error;
|
|
97
|
+
try {
|
|
98
|
+
const age = Date.now() - fs.statSync(lock).mtimeMs;
|
|
99
|
+
const owner = Number.parseInt(fs.readFileSync(path.join(lock, 'owner'), 'utf8').trim(), 10);
|
|
100
|
+
if (age > 120_000 && (!Number.isSafeInteger(owner) || owner <= 0 || !processExists(owner))) {
|
|
101
|
+
fs.rmSync(lock, { recursive: true, force: true });
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch { /* another installer may still be writing its owner */ }
|
|
106
|
+
await wait(50);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
throw new Error('Another Ruflo/MetaHarness installer still owns the Meta-Proxy install lease.');
|
|
110
|
+
}
|
|
111
|
+
async function stopEffective(wait) {
|
|
112
|
+
const owner = await probeEffectiveProxy();
|
|
113
|
+
if (!owner)
|
|
114
|
+
return null;
|
|
115
|
+
if (!isSupportedOwner(owner.executable, process.platform)) {
|
|
116
|
+
throw new Error(`Meta-Proxy port owner pid ${owner.pid} is not a recognized Ruflo/MetaHarness binary; refusing to signal it.`);
|
|
117
|
+
}
|
|
118
|
+
process.kill(owner.pid, 'SIGTERM');
|
|
119
|
+
for (let attempt = 0; attempt < 40; attempt++) {
|
|
120
|
+
await wait(50);
|
|
121
|
+
const current = await probeEffectiveProxy();
|
|
122
|
+
if (!current || current.pid !== owner.pid)
|
|
123
|
+
return owner;
|
|
124
|
+
}
|
|
125
|
+
throw new Error(`Stale Meta-Proxy pid ${owner.pid} did not stop.`);
|
|
126
|
+
}
|
|
127
|
+
function launch(binary) {
|
|
128
|
+
fs.mkdirSync(path.dirname(proxyLogFilePath()), { recursive: true, mode: 0o700 });
|
|
129
|
+
const log = fs.openSync(proxyLogFilePath(), 'a', 0o600);
|
|
130
|
+
try {
|
|
131
|
+
const child = spawn(binary, [], { detached: true, stdio: ['ignore', log, log], windowsHide: true });
|
|
132
|
+
if (!child.pid)
|
|
133
|
+
throw new Error('Meta-Proxy did not return a process id.');
|
|
134
|
+
child.unref();
|
|
135
|
+
fs.writeFileSync(proxyPidFilePath(), `${child.pid}\n`, { mode: 0o600 });
|
|
136
|
+
return child.pid;
|
|
137
|
+
}
|
|
138
|
+
finally {
|
|
139
|
+
fs.closeSync(log);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async function launchAndVerify(binary, version, wait) {
|
|
143
|
+
const pid = launch(binary);
|
|
144
|
+
for (let attempt = 0; attempt < 100; attempt++) {
|
|
145
|
+
await wait(50);
|
|
146
|
+
const current = await probeEffectiveProxy();
|
|
147
|
+
if (current?.pid === pid && current.version === version && path.resolve(current.executable) === path.resolve(binary))
|
|
148
|
+
return current;
|
|
149
|
+
if (current && current.pid !== pid) {
|
|
150
|
+
try {
|
|
151
|
+
process.kill(pid, 'SIGTERM');
|
|
152
|
+
}
|
|
153
|
+
catch { /* already exited */ }
|
|
154
|
+
throw new Error(`Competing Meta-Proxy pid ${current.pid} won the port with version ${current.version}.`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
process.kill(pid, 'SIGTERM');
|
|
159
|
+
}
|
|
160
|
+
catch { /* already exited */ }
|
|
161
|
+
throw new Error(`Meta-Proxy v${version} did not become the effective daemon.`);
|
|
162
|
+
}
|
|
163
|
+
export async function installAndActivateProxy(version, log) {
|
|
164
|
+
const wait = waitNormally;
|
|
165
|
+
const binary = proxyBinaryPath();
|
|
166
|
+
const manifest = proxyInstallManifestPath();
|
|
167
|
+
const binaryBackup = `${binary}.rollback`;
|
|
168
|
+
const manifestBackup = `${manifest}.rollback`;
|
|
169
|
+
let release = null;
|
|
170
|
+
let prior = null;
|
|
171
|
+
try {
|
|
172
|
+
release = await acquireProxyInstallLease(wait);
|
|
173
|
+
prior = await stopEffective(wait);
|
|
174
|
+
fs.rmSync(binaryBackup, { force: true });
|
|
175
|
+
fs.rmSync(manifestBackup, { force: true });
|
|
176
|
+
if (fs.existsSync(binary))
|
|
177
|
+
fs.copyFileSync(binary, binaryBackup);
|
|
178
|
+
if (fs.existsSync(manifest))
|
|
179
|
+
fs.copyFileSync(manifest, manifestBackup);
|
|
180
|
+
const installed = await installProxy({ version, log });
|
|
181
|
+
const effective = await launchAndVerify(installed.binaryPath, installed.version, wait);
|
|
182
|
+
return { ...installed, pid: effective.pid };
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
const failure = error instanceof Error ? error.message : String(error);
|
|
186
|
+
if (fs.existsSync(binaryBackup)) {
|
|
187
|
+
try {
|
|
188
|
+
await stopEffective(wait);
|
|
189
|
+
fs.rmSync(binary, { force: true });
|
|
190
|
+
fs.renameSync(binaryBackup, binary);
|
|
191
|
+
fs.rmSync(manifest, { force: true });
|
|
192
|
+
if (fs.existsSync(manifestBackup))
|
|
193
|
+
fs.renameSync(manifestBackup, manifest);
|
|
194
|
+
if (prior)
|
|
195
|
+
await launchAndVerify(prior.executable === binary ? binary : prior.executable, prior.version, wait);
|
|
196
|
+
}
|
|
197
|
+
catch (rollbackError) {
|
|
198
|
+
throw new Error(`${failure} Rollback failed: ${rollbackError instanceof Error ? rollbackError.message : String(rollbackError)}`);
|
|
199
|
+
}
|
|
200
|
+
throw new Error(`${failure} Previous Meta-Proxy ${prior ? 'was restored and verified' : 'binary was restored; it was not running before the upgrade'}.`);
|
|
201
|
+
}
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
finally {
|
|
205
|
+
fs.rmSync(binaryBackup, { force: true });
|
|
206
|
+
fs.rmSync(manifestBackup, { force: true });
|
|
207
|
+
release?.();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=activation.js.map
|
|
@@ -143,6 +143,9 @@ export async function installProxy(opts) {
|
|
|
143
143
|
const tmp = `${finalPath}.tmp`;
|
|
144
144
|
fs.copyFileSync(extractedBinaryPath, tmp);
|
|
145
145
|
fs.chmodSync(tmp, 0o755);
|
|
146
|
+
// The activation transaction has already stopped and backed up the old
|
|
147
|
+
// daemon. Windows rename does not replace an existing executable.
|
|
148
|
+
fs.rmSync(finalPath, { force: true });
|
|
146
149
|
fs.renameSync(tmp, finalPath);
|
|
147
150
|
const liveSha = sha256Hex(fs.readFileSync(finalPath));
|
|
148
151
|
const manifest = {
|
|
@@ -10,6 +10,8 @@ export declare function proxyPidFilePath(): string;
|
|
|
10
10
|
export declare function proxyLockFilePath(): string;
|
|
11
11
|
export declare function proxyLogFilePath(): string;
|
|
12
12
|
export declare function proxyInstallManifestPath(): string;
|
|
13
|
+
/** Shared by Ruflo and MetaHarness so two IDE windows cannot race an upgrade. */
|
|
14
|
+
export declare function proxyInstallLockPath(): string;
|
|
13
15
|
export declare function proxyConfigPath(): string;
|
|
14
16
|
export declare function proxyTokenPath(): string;
|
|
15
17
|
export declare function proxyInjectedTokenPath(): string;
|
package/dist/src/proxy/paths.js
CHANGED
|
@@ -23,6 +23,10 @@ export function proxyLogFilePath() {
|
|
|
23
23
|
export function proxyInstallManifestPath() {
|
|
24
24
|
return join(funnelStateDir(), 'proxy', 'install-manifest.json');
|
|
25
25
|
}
|
|
26
|
+
/** Shared by Ruflo and MetaHarness so two IDE windows cannot race an upgrade. */
|
|
27
|
+
export function proxyInstallLockPath() {
|
|
28
|
+
return join(funnelStateDir(), 'meta-proxy-install.lock');
|
|
29
|
+
}
|
|
26
30
|
export function proxyConfigPath() {
|
|
27
31
|
return join(funnelStateDir(), 'proxy-config.toml');
|
|
28
32
|
}
|
|
@@ -159,14 +159,14 @@ export declare const SpawnAgentSchema: z.ZodObject<{
|
|
|
159
159
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
160
160
|
}, "strip", z.ZodTypeAny, {
|
|
161
161
|
type: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
|
|
162
|
-
id?: string | undefined;
|
|
163
162
|
config?: Record<string, unknown> | undefined;
|
|
164
163
|
timeout?: number | undefined;
|
|
164
|
+
id?: string | undefined;
|
|
165
165
|
}, {
|
|
166
166
|
type: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
|
|
167
|
-
id?: string | undefined;
|
|
168
167
|
config?: Record<string, unknown> | undefined;
|
|
169
168
|
timeout?: number | undefined;
|
|
169
|
+
id?: string | undefined;
|
|
170
170
|
}>;
|
|
171
171
|
/**
|
|
172
172
|
* Task input schema
|
|
@@ -181,13 +181,13 @@ export declare const TaskInputSchema: z.ZodObject<{
|
|
|
181
181
|
taskId: string;
|
|
182
182
|
content: string;
|
|
183
183
|
agentType: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
|
|
184
|
-
priority?: "
|
|
184
|
+
priority?: "critical" | "high" | "medium" | "low" | undefined;
|
|
185
185
|
metadata?: Record<string, unknown> | undefined;
|
|
186
186
|
}, {
|
|
187
187
|
taskId: string;
|
|
188
188
|
content: string;
|
|
189
189
|
agentType: "coder" | "reviewer" | "tester" | "planner" | "researcher" | "security-architect" | "security-auditor" | "memory-specialist" | "swarm-specialist" | "integration-architect" | "performance-engineer" | "core-architect" | "test-architect" | "queen-coordinator" | "project-coordinator";
|
|
190
|
-
priority?: "
|
|
190
|
+
priority?: "critical" | "high" | "medium" | "low" | undefined;
|
|
191
191
|
metadata?: Record<string, unknown> | undefined;
|
|
192
192
|
}>;
|
|
193
193
|
/**
|
|
@@ -234,16 +234,16 @@ export declare const ExecutorConfigSchema: z.ZodObject<{
|
|
|
234
234
|
cwd: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
235
235
|
allowSudo: z.ZodDefault<z.ZodBoolean>;
|
|
236
236
|
}, "strip", z.ZodTypeAny, {
|
|
237
|
-
timeout: number;
|
|
238
237
|
allowedCommands: string[];
|
|
238
|
+
timeout: number;
|
|
239
239
|
maxBuffer: number;
|
|
240
240
|
allowSudo: boolean;
|
|
241
241
|
blockedPatterns?: string[] | undefined;
|
|
242
242
|
cwd?: string | undefined;
|
|
243
243
|
}, {
|
|
244
244
|
allowedCommands: string[];
|
|
245
|
-
timeout?: number | undefined;
|
|
246
245
|
blockedPatterns?: string[] | undefined;
|
|
246
|
+
timeout?: number | undefined;
|
|
247
247
|
maxBuffer?: number | undefined;
|
|
248
248
|
cwd?: string | undefined;
|
|
249
249
|
allowSudo?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.21",
|
|
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",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Default package name (ruvnet WASM convention); override with RUFLO_LATTICE_WASM_PKG. */
|
|
2
|
-
export declare const LATTICE_WASM_PKG: string;
|
|
3
|
-
export type LatticeModel = 'minilm' | 'bge' | 'paraphrase-minilm' | 'qwen3-0.6b' | string;
|
|
4
|
-
export declare const DEFAULT_LATTICE_MODEL: LatticeModel;
|
|
5
|
-
/** Is the Lattice WASM embedder installed + initializable? Cached; never throws. */
|
|
6
|
-
export declare function latticeAvailable(): Promise<boolean>;
|
|
7
|
-
/** The models Lattice reports (empty until availability is probed). */
|
|
8
|
-
export declare function latticeModels(): LatticeModel[];
|
|
9
|
-
/**
|
|
10
|
-
* Embed `text` with `model` via Lattice WASM. Returns null on any failure so the
|
|
11
|
-
* caller can fall through to the next tier. Never throws.
|
|
12
|
-
*/
|
|
13
|
-
export declare function latticeEmbed(text: string, model?: LatticeModel): Promise<number[] | null>;
|
|
14
|
-
//# sourceMappingURL=lattice-wasm.d.ts.map
|