@claude-flow/cli 3.10.39 → 3.10.41
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/session.js +28 -6
- package/README.md +1 -1
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +14 -1
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +16 -0
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/init/settings-generator.js +1 -1
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +166 -19
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +26 -1
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +2 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +2 -0
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.js +20 -12
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/model-router.d.ts +25 -12
- package/dist/src/ruvector/model-router.d.ts.map +1 -1
- package/dist/src/ruvector/model-router.js +25 -12
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-generator.js","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GA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,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAyrBrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA8BnE"}
|
|
@@ -65,10 +65,51 @@ const CONFIG = {
|
|
|
65
65
|
const CWD = process.cwd();
|
|
66
66
|
|
|
67
67
|
// ─── Delegation cache ───────────────────────────────────────────
|
|
68
|
-
// Cache the CLI JSON result for
|
|
69
|
-
// (
|
|
68
|
+
// Cache the CLI JSON result for 60s so rapid prompt re-renders
|
|
69
|
+
// (Claude Code refreshes the statusline several times a second while
|
|
70
|
+
// streaming) don't re-invoke the CLI each time. #2337: bumped 10s→60s
|
|
71
|
+
// because 10s was far too short for how often Claude Code re-renders.
|
|
70
72
|
const CACHE_FILE = path.join(os.tmpdir(), 'ruflo-statusline-cache-' + require('crypto').createHash('md5').update(CWD).digest('hex').slice(0, 8) + '.json');
|
|
71
|
-
const CACHE_TTL_MS =
|
|
73
|
+
const CACHE_TTL_MS = 60000;
|
|
74
|
+
|
|
75
|
+
// #2337: resolve an already-installed @claude-flow/cli (or ruflo) bin so we
|
|
76
|
+
// can invoke it directly via \`node\`. The previous version called
|
|
77
|
+
// \`npx --yes @claude-flow/cli@latest\` on every uncached render, which forces
|
|
78
|
+
// a registry resolution + cold-start of the entire CLI per render. With
|
|
79
|
+
// multiple concurrent Claude Code sessions this storms the host (reporter
|
|
80
|
+
// saw load average 40-65 on a 12-core box).
|
|
81
|
+
//
|
|
82
|
+
// Returns the absolute path to bin/cli.js or null. Mirrors getPkgVersion()'s
|
|
83
|
+
// path probing (project, monorepo, plugin marketplace, global node_modules
|
|
84
|
+
// including custom-prefix layouts like ~/.npm-global).
|
|
85
|
+
function resolveCliBin() {
|
|
86
|
+
try {
|
|
87
|
+
const home = os.homedir();
|
|
88
|
+
const candidates = [
|
|
89
|
+
path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'bin', 'cli.js'),
|
|
90
|
+
path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
91
|
+
path.join(CWD, 'node_modules', 'ruflo', 'bin', 'cli.js'),
|
|
92
|
+
path.join(CWD, 'v3', '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
93
|
+
];
|
|
94
|
+
try {
|
|
95
|
+
const binDir = path.dirname(process.execPath);
|
|
96
|
+
const globalModuleDirs = [path.join(binDir, '..', 'lib', 'node_modules'), path.join(binDir, 'node_modules')];
|
|
97
|
+
for (const prefix of [process.env.npm_config_prefix, process.env.PREFIX, path.join(home, '.npm-global')]) {
|
|
98
|
+
if (prefix) globalModuleDirs.push(path.join(prefix, 'lib', 'node_modules'));
|
|
99
|
+
}
|
|
100
|
+
for (const gm of globalModuleDirs) {
|
|
101
|
+
candidates.push(
|
|
102
|
+
path.join(gm, 'ruflo', 'bin', 'cli.js'),
|
|
103
|
+
path.join(gm, '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
} catch { /* ignore */ }
|
|
107
|
+
for (const p of candidates) {
|
|
108
|
+
if (fs.existsSync(p)) return p;
|
|
109
|
+
}
|
|
110
|
+
} catch { /* ignore */ }
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
72
113
|
|
|
73
114
|
function readCache() {
|
|
74
115
|
try {
|
|
@@ -99,16 +140,25 @@ function getStatuslineData() {
|
|
|
99
140
|
if (cached) return cached;
|
|
100
141
|
|
|
101
142
|
try {
|
|
143
|
+
// #2337: prefer an already-installed CLI bin via direct \`node\` invocation
|
|
144
|
+
// — no npx, no registry round-trip, no @latest re-resolve per render.
|
|
145
|
+
// Fall back to \`npx --prefer-offline @claude-flow/cli\` (no @latest) only
|
|
146
|
+
// when nothing is installed locally, so a cold environment still works.
|
|
147
|
+
const cliBin = resolveCliBin();
|
|
148
|
+
const cmd = cliBin
|
|
149
|
+
? '"' + process.execPath + '" "' + cliBin + '" hooks statusline --json 2>/dev/null'
|
|
150
|
+
: 'npx --prefer-offline @claude-flow/cli hooks statusline --json 2>/dev/null';
|
|
102
151
|
const raw = execSync(
|
|
103
|
-
|
|
152
|
+
cmd,
|
|
104
153
|
{ encoding: 'utf-8', timeout: 8000, stdio: ['pipe', 'pipe', 'pipe'], cwd: CWD }
|
|
105
154
|
).trim();
|
|
106
155
|
// The CLI may emit preamble lines before the JSON — find the first '{'.
|
|
107
156
|
const jsonStart = raw.indexOf('{');
|
|
108
157
|
if (jsonStart === -1) throw new Error('no JSON in CLI output');
|
|
109
158
|
const data = JSON.parse(raw.slice(jsonStart));
|
|
110
|
-
// Overlay
|
|
111
|
-
|
|
159
|
+
// Overlay every block the CLI JSON omits (adrs/agentdb/tests/hooks/integration)
|
|
160
|
+
// with real local reads, so those segments reflect actual state instead of 0.
|
|
161
|
+
applyLocalOverlays(data);
|
|
112
162
|
writeCache(data);
|
|
113
163
|
return data;
|
|
114
164
|
} catch { /* CLI unavailable or timed out */ }
|
|
@@ -141,13 +191,40 @@ function getLocalADRCount() {
|
|
|
141
191
|
return { count: total, implemented: total, compliance: 0 };
|
|
142
192
|
}
|
|
143
193
|
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const adrs = getLocalADRCount();
|
|
194
|
+
// ─── Local overlays for segments the CLI JSON omits ──────────────
|
|
195
|
+
// 'hooks statusline --json' only returns user/v3Progress/security/swarm/system.
|
|
196
|
+
// agentdb/tests/hooks/integration are never populated, so without these overlays
|
|
197
|
+
// they render as a permanent 0. Each reader is cheap and degrades to zeros.
|
|
149
198
|
|
|
150
|
-
|
|
199
|
+
// Real AgentDB stats from the local memory DB. Vectors live in .swarm/memory.db
|
|
200
|
+
// (sql.js + HNSW); ruvector.db is an opaque redb store counted only toward size.
|
|
201
|
+
// One read-only sqlite3 query (mode=ro never takes a write lock the daemon owns).
|
|
202
|
+
function getLocalAgentDB() {
|
|
203
|
+
const result = { vectorCount: 0, dbSizeKB: 0, hasHnsw: false };
|
|
204
|
+
try {
|
|
205
|
+
let bytes = 0;
|
|
206
|
+
for (const f of ['.swarm/memory.db', 'ruvector.db']) {
|
|
207
|
+
try { bytes += fs.statSync(path.join(CWD, f)).size; } catch { /* missing */ }
|
|
208
|
+
}
|
|
209
|
+
result.dbSizeKB = Math.round(bytes / 1024);
|
|
210
|
+
|
|
211
|
+
const memDb = path.join(CWD, '.swarm', 'memory.db');
|
|
212
|
+
if (fs.existsSync(memDb)) {
|
|
213
|
+
const Q = String.fromCharCode(34);
|
|
214
|
+
const sql = Q + 'SELECT (SELECT COUNT(*) FROM memory_entries WHERE embedding IS NOT NULL)||' + "'|'" + '||(SELECT COUNT(*) FROM vector_indexes);' + Q;
|
|
215
|
+
const out = safeExec("sqlite3 'file:" + memDb + "?mode=ro' " + sql, 1500);
|
|
216
|
+
if (out && out.indexOf('|') !== -1) {
|
|
217
|
+
const parts = out.split('|');
|
|
218
|
+
result.vectorCount = parseInt(parts[0], 10) || 0;
|
|
219
|
+
result.hasHnsw = (parseInt(parts[1], 10) || 0) > 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} catch { /* ignore */ }
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Count test files via a bounded directory walk (no file reads).
|
|
227
|
+
function getLocalTests() {
|
|
151
228
|
let testFiles = 0;
|
|
152
229
|
function countTests(dir, depth) {
|
|
153
230
|
if ((depth || 0) > 4) return;
|
|
@@ -163,19 +240,82 @@ function buildLocalFallback() {
|
|
|
163
240
|
} catch { /* ignore */ }
|
|
164
241
|
}
|
|
165
242
|
for (const d of ['tests', 'test', '__tests__', 'src', 'v3']) countTests(path.join(CWD, d));
|
|
243
|
+
return { testFiles, testCases: testFiles * 4 };
|
|
244
|
+
}
|
|
166
245
|
|
|
167
|
-
|
|
246
|
+
// Count configured hooks from project .claude/settings.json. Claude Code hooks
|
|
247
|
+
// have no enabled/disabled flag, so every configured hook counts as enabled.
|
|
248
|
+
function getLocalHooks() {
|
|
249
|
+
const result = { enabled: 0, total: 0 };
|
|
250
|
+
try {
|
|
251
|
+
const settings = readJSON(path.join(CWD, '.claude', 'settings.json'));
|
|
252
|
+
const hooks = settings && settings.hooks;
|
|
253
|
+
if (hooks && typeof hooks === 'object') {
|
|
254
|
+
let n = 0;
|
|
255
|
+
for (const ev of Object.keys(hooks)) {
|
|
256
|
+
const groups = hooks[ev];
|
|
257
|
+
if (Array.isArray(groups)) {
|
|
258
|
+
for (const g of groups) {
|
|
259
|
+
if (g && Array.isArray(g.hooks)) n += g.hooks.length;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
result.total = n;
|
|
264
|
+
result.enabled = n;
|
|
265
|
+
}
|
|
266
|
+
} catch { /* ignore */ }
|
|
267
|
+
return result;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Best-effort integration block: DB presence + locally-configured stdio MCP
|
|
271
|
+
// servers (project .mcp.json + global ~/.claude.json). Remote connectors are
|
|
272
|
+
// account-managed and not present in local config, so they are not counted.
|
|
273
|
+
function getLocalIntegration() {
|
|
274
|
+
const integration = { mcpServers: { enabled: 0, total: 0 }, hasDatabase: false };
|
|
275
|
+
try {
|
|
276
|
+
for (const f of ['.swarm/memory.db', 'ruvector.db']) {
|
|
277
|
+
if (fs.existsSync(path.join(CWD, f))) { integration.hasDatabase = true; break; }
|
|
278
|
+
}
|
|
279
|
+
const names = new Set();
|
|
280
|
+
const projMcp = readJSON(path.join(CWD, '.mcp.json'));
|
|
281
|
+
if (projMcp && projMcp.mcpServers) for (const k of Object.keys(projMcp.mcpServers)) names.add(k);
|
|
282
|
+
const claudeJson = readJSON(path.join(os.homedir(), '.claude.json'));
|
|
283
|
+
if (claudeJson) {
|
|
284
|
+
if (claudeJson.mcpServers) for (const k of Object.keys(claudeJson.mcpServers)) names.add(k);
|
|
285
|
+
const proj = claudeJson.projects && claudeJson.projects[CWD];
|
|
286
|
+
if (proj && proj.mcpServers && !Array.isArray(proj.mcpServers)) {
|
|
287
|
+
for (const k of Object.keys(proj.mcpServers)) names.add(k);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
integration.mcpServers.total = names.size;
|
|
291
|
+
integration.mcpServers.enabled = names.size;
|
|
292
|
+
} catch { /* ignore */ }
|
|
293
|
+
return integration;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Overlay every locally-derived block onto the CLI data (mutates in place).
|
|
297
|
+
function applyLocalOverlays(data) {
|
|
298
|
+
data.adrs = getLocalADRCount();
|
|
299
|
+
data.agentdb = getLocalAgentDB();
|
|
300
|
+
data.tests = getLocalTests();
|
|
301
|
+
data.hooks = getLocalHooks();
|
|
302
|
+
data.integration = getLocalIntegration();
|
|
303
|
+
return data;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Minimal local fallback when the CLI is not installed or times out.
|
|
307
|
+
// Returns a structure that matches the CLI JSON schema so the renderer works.
|
|
308
|
+
function buildLocalFallback() {
|
|
309
|
+
const memMB = Math.floor(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
310
|
+
|
|
311
|
+
return applyLocalOverlays({
|
|
168
312
|
user: { name: 'user', gitBranch: '', modelName: 'Claude Code' },
|
|
169
313
|
v3Progress: { domainsCompleted: 0, totalDomains: 5, dddProgress: 0, patternsLearned: 0, sessionsCompleted: 0 },
|
|
170
314
|
security: { status: 'NONE', cvesFixed: 0, totalCves: 0 },
|
|
171
315
|
swarm: { activeAgents: 0, maxAgents: CONFIG.maxAgents, coordinationActive: false },
|
|
172
316
|
system: { memoryMB: memMB, contextPct: 0, intelligencePct: 0, subAgents: 0 },
|
|
173
|
-
adrs,
|
|
174
|
-
hooks: { enabled: 0, total: 0 },
|
|
175
|
-
agentdb: { vectorCount: 0, dbSizeKB: 0, hasHnsw: false },
|
|
176
|
-
tests: { testFiles, testCases: testFiles * 4 },
|
|
177
317
|
lastUpdated: new Date().toISOString(),
|
|
178
|
-
};
|
|
318
|
+
});
|
|
179
319
|
}
|
|
180
320
|
|
|
181
321
|
// ANSI colors
|
|
@@ -375,7 +515,14 @@ function getPkgVersion() {
|
|
|
375
515
|
// (bin/node_modules) layouts.
|
|
376
516
|
try {
|
|
377
517
|
const binDir = path.dirname(process.execPath);
|
|
378
|
-
|
|
518
|
+
const globalModuleDirs = [path.join(binDir, '..', 'lib', 'node_modules'), path.join(binDir, 'node_modules')];
|
|
519
|
+
// #2221 follow-up: a custom npm prefix (e.g. ~/.npm-global) is decoupled from
|
|
520
|
+
// the node binary location, so the binDir-derived probes above all miss. Also
|
|
521
|
+
// probe the npm prefix from the environment and the common ~/.npm-global default.
|
|
522
|
+
for (const prefix of [process.env.npm_config_prefix, process.env.PREFIX, path.join(home, '.npm-global')]) {
|
|
523
|
+
if (prefix) globalModuleDirs.push(path.join(prefix, 'lib', 'node_modules'));
|
|
524
|
+
}
|
|
525
|
+
for (const gm of globalModuleDirs) {
|
|
379
526
|
pkgPaths.push(
|
|
380
527
|
path.join(gm, 'ruflo', 'package.json'),
|
|
381
528
|
path.join(gm, '@claude-flow', 'cli', 'package.json'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusline-generator.js","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAoB;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAE5C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA6BM,SAAS
|
|
1
|
+
{"version":3,"file":"statusline-generator.js","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAoB;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAE5C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA6BM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwpBvB,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAChC,OAAO,sCAAsC,CAAC;IAChD,CAAC;IAED,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/hooks-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,YAAY,CAAC;AAiBzD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASzD;AAwqBD,eAAO,MAAM,YAAY,EAAE,OAwC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAyE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OA6C7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAgF9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAgLxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAoE1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OA8CvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OA2F1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"hooks-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/hooks-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAK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;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAwGhC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,OAgNpC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,OAiGpC,CAAC;AAGF,eAAO,MAAM,0BAA0B,EAAE,OA8MxC,CAAC;AAgQF,eAAO,MAAM,eAAe,EAAE,OA8C7B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,OAwIjC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAuD/B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAkE/B,CAAC;AAiBF,eAAO,MAAM,eAAe,EAAE,OA+C7B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAgC/B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAuB7B,CAAC;AAeF,eAAO,MAAM,YAAY,EAAE,OAmI1B,CAAC;AAqBF,eAAO,MAAM,iBAAiB,EAAE,OA0C/B,CAAC;AAOF,eAAO,MAAM,iBAAiB,EAAE,OAwB/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAoFhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,OAc3C,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAAO,EA6C/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1239,6 +1239,9 @@ export const hooksPostTask = {
|
|
|
1239
1239
|
quality: { type: 'number', description: 'Quality score (0-1)' },
|
|
1240
1240
|
task: { type: 'string', description: 'Task description text (used for learning keyword extraction)' },
|
|
1241
1241
|
storeDecisions: { type: 'boolean', description: 'Also store routing decision in memory DB' },
|
|
1242
|
+
// ADR-147 P2: nested-subagent spawn-tree capture
|
|
1243
|
+
parentAgentId: { type: 'string', description: 'ID of the parent agent (from Claude Code\'s parent_agent_id OTel span tag / x-claude-code-parent-agent-id header). Omit for top-level work.' },
|
|
1244
|
+
depth: { type: 'number', description: 'Chain depth from root lead session (0 = lead, 1+ = subagent). Used by ADR-147 P3 depth-aware guardrail.' },
|
|
1242
1245
|
},
|
|
1243
1246
|
required: ['taskId'],
|
|
1244
1247
|
},
|
|
@@ -1258,6 +1261,22 @@ export const hooksPostTask = {
|
|
|
1258
1261
|
if (!v.valid)
|
|
1259
1262
|
return { success: false, error: v.error };
|
|
1260
1263
|
}
|
|
1264
|
+
// ADR-147 P2: validate spawn-tree lineage if provided
|
|
1265
|
+
const parentAgentId = params.parentAgentId;
|
|
1266
|
+
if (parentAgentId !== undefined) {
|
|
1267
|
+
const v = validateIdentifier(parentAgentId, 'parentAgentId');
|
|
1268
|
+
if (!v.valid)
|
|
1269
|
+
return { success: false, error: v.error };
|
|
1270
|
+
}
|
|
1271
|
+
const depthRaw = params.depth;
|
|
1272
|
+
let depth;
|
|
1273
|
+
if (depthRaw !== undefined && depthRaw !== null) {
|
|
1274
|
+
const n = Number(depthRaw);
|
|
1275
|
+
if (!Number.isInteger(n) || n < 0 || n > 32) {
|
|
1276
|
+
return { success: false, error: 'depth must be a non-negative integer ≤ 32' };
|
|
1277
|
+
}
|
|
1278
|
+
depth = n;
|
|
1279
|
+
}
|
|
1261
1280
|
// Phase 3: Wire recordFeedback through bridge → LearningSystem + ReasoningBank
|
|
1262
1281
|
let feedbackResult = null;
|
|
1263
1282
|
try {
|
|
@@ -1269,6 +1288,9 @@ export const hooksPostTask = {
|
|
|
1269
1288
|
agent,
|
|
1270
1289
|
duration: params.duration || undefined,
|
|
1271
1290
|
patterns: params.patterns || undefined,
|
|
1291
|
+
// ADR-147 P2: forward spawn-tree lineage so it lands in feedback + memory
|
|
1292
|
+
parentAgentId,
|
|
1293
|
+
depth,
|
|
1272
1294
|
});
|
|
1273
1295
|
}
|
|
1274
1296
|
catch {
|
|
@@ -3931,7 +3953,10 @@ export const hooksModelRoute = {
|
|
|
3931
3953
|
alternatives: result.alternatives,
|
|
3932
3954
|
inferenceTimeUs: result.inferenceTimeUs,
|
|
3933
3955
|
costMultiplier: result.costMultiplier,
|
|
3934
|
-
|
|
3956
|
+
// Historical name kept for telemetry / dashboard schema stability.
|
|
3957
|
+
// The shipped router is the heuristic + Thompson-bandit described in
|
|
3958
|
+
// ruvector/model-router.ts — not a neural network. See #2329.
|
|
3959
|
+
implementation: 'heuristic-thompson-bandit',
|
|
3935
3960
|
};
|
|
3936
3961
|
},
|
|
3937
3962
|
};
|