claude-flow 3.7.0-alpha.20 โ†’ 3.7.0-alpha.22

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.
Files changed (34) hide show
  1. package/.claude/scheduled_tasks.lock +1 -1
  2. package/README.md +2 -0
  3. package/package.json +1 -1
  4. package/v3/@claude-flow/cli/README.md +2 -0
  5. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +7 -7
  6. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +101 -24
  7. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js +6 -6
  8. package/v3/@claude-flow/cli/dist/src/mcp-tools/autopilot-tools.js +10 -10
  9. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-session-tools.js +5 -5
  10. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js +23 -23
  11. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js +12 -12
  12. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js +6 -6
  13. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js +7 -7
  14. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js +8 -8
  15. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js +10 -10
  16. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js +5 -5
  17. package/v3/@claude-flow/cli/dist/src/mcp-tools/guidance-tools.js +21 -21
  18. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +9 -9
  19. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +36 -36
  20. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +79 -17
  21. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js +6 -6
  22. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js +6 -6
  23. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js +4 -4
  24. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js +10 -10
  25. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js +6 -6
  26. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +5 -5
  27. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js +4 -4
  28. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js +7 -7
  29. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +7 -7
  30. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js +5 -5
  31. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js +11 -11
  32. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js +10 -10
  33. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +10 -10
  34. package/v3/@claude-flow/cli/package.json +1 -1
@@ -1 +1 @@
1
- {"sessionId":"e8acbe6b-1513-4c00-ac30-2b486317c5b1","pid":7565,"procStart":"Sat May 9 13:35:07 2026","acquiredAt":1778338395740}
1
+ {"sessionId":"fd9b0530-a395-4da0-9b21-a26731cef01f","pid":91923,"procStart":"Mon May 11 02:12:51 2026","acquiredAt":1778466450635}
package/README.md CHANGED
@@ -263,6 +263,8 @@ The difference: some channels are trusted, some aren't. [`@claude-flow/plugin-ag
263
263
 
264
264
  You don't configure handshakes or manage certificates. You `federation init`, `federation join`, and your agents start talking. The protocol handles identity, the PII pipeline handles data safety, and the audit trail handles compliance.
265
265
 
266
+ > **๐Ÿ“˜ Full user guide:** [`docs/federation/`](./docs/federation/) โ€” setup, MCP tools, trust levels, circuit breaker, and the (opt-in) WireGuard mesh layer that ties packet-layer reachability to federation trust. ADR-111 deep-dive at [`docs/federation/phase7-mesh-bringup.md`](./docs/federation/phase7-mesh-bringup.md).
267
+
266
268
  <details>
267
269
  <summary><strong>Federation capabilities</strong></summary>
268
270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.7.0-alpha.20",
3
+ "version": "3.7.0-alpha.22",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -263,6 +263,8 @@ The difference: some channels are trusted, some aren't. [`@claude-flow/plugin-ag
263
263
 
264
264
  You don't configure handshakes or manage certificates. You `federation init`, `federation join`, and your agents start talking. The protocol handles identity, the PII pipeline handles data safety, and the audit trail handles compliance.
265
265
 
266
+ > **๐Ÿ“˜ Full user guide:** [`docs/federation/`](./docs/federation/) โ€” setup, MCP tools, trust levels, circuit breaker, and the (opt-in) WireGuard mesh layer that ties packet-layer reachability to federation trust. ADR-111 deep-dive at [`docs/federation/phase7-mesh-bringup.md`](./docs/federation/phase7-mesh-bringup.md).
267
+
266
268
  <details>
267
269
  <summary><strong>Federation capabilities</strong></summary>
268
270
 
@@ -228,7 +228,7 @@ export const agentTools = [
228
228
  // updating the agent record with lastResult / taskCount / status.
229
229
  // No mock โ€” actual HTTP request to api.anthropic.com.
230
230
  name: 'agent_execute',
231
- description: 'Execute a task on a spawned agent โ€” calls the Anthropic Messages API with the agent\'s configured model. Requires ANTHROPIC_API_KEY in env.',
231
+ description: 'Run a task on a previously-spawned agent_spawn record via the Anthropic Messages API with that agent\'s configured model. Use when native Task tool is wrong because (a) you need the spawned agent\'s persistent config (model, instructions, cost-tracking attribution) to apply to this turn, (b) the result needs to feed back into the agent\'s lifecycle (taskCount, lastResult, swarm-coordinated state), or (c) you want explicit model routing via the spawn record\'s `model` field instead of inheriting. For one-shot Claude prompts without a tracked agent, native Task is fine. Requires ANTHROPIC_API_KEY in env.',
232
232
  category: 'agent',
233
233
  inputSchema: {
234
234
  type: 'object',
@@ -261,7 +261,7 @@ export const agentTools = [
261
261
  },
262
262
  {
263
263
  name: 'agent_terminate',
264
- description: 'Terminate an agent',
264
+ description: 'Remove a Ruflo-tracked agent from the registry and free its swarm slot. Use when you need to (a) clean up a spawned agent so its cost-tracking row finalizes, (b) reclaim a swarm-topology slot for another agent, or (c) end a stuck agent without restarting the whole swarm. For one-shot Task tool invocations that already self-terminate, this tool is not needed. Pair with agent_list first to confirm the agentId.',
265
265
  category: 'agent',
266
266
  inputSchema: {
267
267
  type: 'object',
@@ -296,7 +296,7 @@ export const agentTools = [
296
296
  },
297
297
  {
298
298
  name: 'agent_status',
299
- description: 'Get agent status',
299
+ description: 'Read the lifecycle state of a single tracked agent: idle/running/stopped, current taskCount, lastResult, model, health score. Use when native Task tool is wrong because you need agent-level state (status across turns, accumulated taskCount, last error, swarm coordination) rather than a one-shot response. For inspecting a Task you just ran, native Task output is fine. Pair with agent_list to find the agentId first.',
300
300
  category: 'agent',
301
301
  inputSchema: {
302
302
  type: 'object',
@@ -333,7 +333,7 @@ export const agentTools = [
333
333
  },
334
334
  {
335
335
  name: 'agent_list',
336
- description: 'List all agents',
336
+ description: 'List every Ruflo-tracked agent in the registry with its type, model, status, and taskCount. Use when native Task tool is wrong because you need to see the swarm-wide agent inventory across turns (which agents exist, their roles, their cost-tracking handles) rather than spawn a new one-shot Task. Filter by status/domain/agentType if needed. For starting a fresh single-shot subagent, native Task is fine.',
337
337
  category: 'agent',
338
338
  inputSchema: {
339
339
  type: 'object',
@@ -388,7 +388,7 @@ export const agentTools = [
388
388
  },
389
389
  {
390
390
  name: 'agent_pool',
391
- description: 'Manage agent pool',
391
+ description: 'Manage a fixed-size warm pool of pre-spawned agents to skip cold-start cost on bursty workloads. Use when native Task is wrong because (a) you have a queue of similar tasks and want to amortize spawn latency, (b) cost-tracking wants stable agentIds across requests, or (c) swarm topology requires a known agent count at all times. For one-shot work, just call agent_spawn or native Task. Pool sizes and warm/idle thresholds are set per-pool.',
392
392
  category: 'agent',
393
393
  inputSchema: {
394
394
  type: 'object',
@@ -505,7 +505,7 @@ export const agentTools = [
505
505
  },
506
506
  {
507
507
  name: 'agent_health',
508
- description: 'Check agent health',
508
+ description: 'Compute an agent\'s rolling health score (0-1) from recent task success ratio + response-latency p50/p95 + error rate. Use when native Task tool is wrong because you\'re running a long-lived agent (autonomous loop / hive-mind worker / federation peer) and need to detect degradation before the breaker trips it. For one-shot Task invocations there is no history to score. Pair with hooks_post-task so the scores stay current.',
509
509
  category: 'agent',
510
510
  inputSchema: {
511
511
  type: 'object',
@@ -580,7 +580,7 @@ export const agentTools = [
580
580
  },
581
581
  {
582
582
  name: 'agent_update',
583
- description: 'Update agent status or config',
583
+ description: 'Mutate a tracked agent\'s config (model, instructions, status, health) without re-spawning. Use when native Task tool is wrong because the agent already has accumulated state (taskCount, swarm membership, cost-tracking attribution) and you only need to tweak one field โ€” for example, promoting an idle agent to running on a new task, or rotating its model from haiku to sonnet mid-loop. For a brand-new subagent, agent_spawn (or native Task) is the right call.',
584
584
  category: 'agent',
585
585
  inputSchema: {
586
586
  type: 'object',
@@ -51,7 +51,7 @@ async function getBridge() {
51
51
  // ===== agentdb_health โ€” Controller health check =====
52
52
  export const agentdbHealth = {
53
53
  name: 'agentdb_health',
54
- description: 'Get AgentDB v3 controller health status including cache stats and attestation count',
54
+ description: 'Get AgentDB v3 controller health status including cache stats and attestation count Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
55
55
  inputSchema: {
56
56
  type: 'object',
57
57
  properties: {},
@@ -72,7 +72,7 @@ export const agentdbHealth = {
72
72
  // ===== agentdb_controllers โ€” List all controllers =====
73
73
  export const agentdbControllers = {
74
74
  name: 'agentdb_controllers',
75
- description: 'List all AgentDB v3 controllers and their initialization status',
75
+ description: 'List all AgentDB v3 controllers and their initialization status Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
76
76
  inputSchema: {
77
77
  type: 'object',
78
78
  properties: {},
@@ -98,7 +98,7 @@ export const agentdbControllers = {
98
98
  // ===== agentdb_pattern_store โ€” Store via ReasoningBank =====
99
99
  export const agentdbPatternStore = {
100
100
  name: 'agentdb_pattern-store',
101
- description: 'Store a pattern directly via ReasoningBank controller',
101
+ description: 'Store a pattern directly via ReasoningBank controller Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
102
102
  inputSchema: {
103
103
  type: 'object',
104
104
  properties: {
@@ -167,7 +167,7 @@ export const agentdbPatternStore = {
167
167
  // ===== agentdb_pattern_search โ€” Search via ReasoningBank =====
168
168
  export const agentdbPatternSearch = {
169
169
  name: 'agentdb_pattern-search',
170
- description: 'Search patterns via ReasoningBank controller with BM25+semantic hybrid',
170
+ description: 'Search patterns via ReasoningBank controller with BM25+semantic hybrid Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
171
171
  inputSchema: {
172
172
  type: 'object',
173
173
  properties: {
@@ -185,13 +185,90 @@ export const agentdbPatternSearch = {
185
185
  const query = validateString(params.query, 'query', 10_000);
186
186
  if (!query)
187
187
  return { results: [], error: 'query is required (non-empty string, max 10KB)' };
188
+ const topK = validatePositiveInt(params.topK, 5, MAX_TOP_K);
189
+ const minConfidence = validateScore(params.minConfidence, 0.3);
188
190
  const bridge = await getBridge();
189
- const result = await bridge.bridgeSearchPatterns({
190
- query,
191
- topK: validatePositiveInt(params.topK, 5, MAX_TOP_K),
192
- minConfidence: validateScore(params.minConfidence, 0.3),
193
- });
194
- return result ?? { results: [], controller: 'unavailable' };
191
+ const result = await bridge.bridgeSearchPatterns({ query, topK, minConfidence });
192
+ if (result && Array.isArray(result.results) && result.results.length > 0) {
193
+ return result;
194
+ }
195
+ // #1889 โ€” symmetric fallback. pattern-store writes to the `pattern`
196
+ // namespace via memory_store when ReasoningBank is unavailable; the
197
+ // search path used to return an empty list with `controller: 'unavailable'`
198
+ // even though the user's pattern was sitting in that namespace. We now
199
+ // tier the fallback so freshly-written entries are findable before HNSW
200
+ // catches up:
201
+ // 1. Try semantic search via searchEntries (HNSW-backed)
202
+ // 2. If that returns 0, list the namespace and substring-match the query
203
+ // against each entry's pattern text. Deterministic; survives
204
+ // embedding-index latency and threshold tuning.
205
+ try {
206
+ const { searchEntries, listEntries } = await import('../memory/memory-initializer.js');
207
+ const parseEntry = (e) => {
208
+ const raw = typeof e.content === 'string' ? e.content : e.value;
209
+ if (typeof raw !== 'string')
210
+ return null;
211
+ try {
212
+ const parsed = JSON.parse(raw);
213
+ const confidence = typeof parsed.confidence === 'number' ? parsed.confidence : 0.8;
214
+ if (confidence < minConfidence)
215
+ return null;
216
+ return {
217
+ patternId: e.key ?? e.id,
218
+ pattern: parsed.pattern,
219
+ type: parsed.type ?? 'general',
220
+ confidence,
221
+ score: typeof e.score === 'number' ? e.score : undefined,
222
+ };
223
+ }
224
+ catch {
225
+ return null;
226
+ }
227
+ };
228
+ // Tier 1 โ€” semantic
229
+ let results = [];
230
+ let tier = 'semantic';
231
+ try {
232
+ const semantic = await searchEntries({ query, namespace: 'pattern', limit: topK });
233
+ results = (semantic?.results ?? [])
234
+ .map(parseEntry)
235
+ .filter((r) => r !== null);
236
+ }
237
+ catch { /* fall through to tier 2 */ }
238
+ // Tier 2 โ€” substring scan (catches just-written entries before HNSW indexes them)
239
+ if (results.length === 0) {
240
+ tier = 'substring';
241
+ const all = await listEntries({ namespace: 'pattern', limit: 200 });
242
+ const qLower = query.toLowerCase();
243
+ const matched = [];
244
+ for (const e of (all?.entries ?? [])) {
245
+ const parsed = parseEntry(e);
246
+ if (!parsed)
247
+ continue;
248
+ const text = typeof parsed.pattern === 'string' ? parsed.pattern.toLowerCase() : '';
249
+ if (text.includes(qLower))
250
+ matched.push(parsed);
251
+ if (matched.length >= topK)
252
+ break;
253
+ }
254
+ results = matched;
255
+ }
256
+ // #1889 โ€” controller label must match pattern-store's so the smoke
257
+ // round-trip sees both ends agree. The store reports
258
+ // `memory-store-fallback`; we use the same name + a `tier` field
259
+ // to expose which sub-strategy fired.
260
+ return {
261
+ results,
262
+ controller: 'memory-store-fallback',
263
+ tier,
264
+ note: result
265
+ ? `ReasoningBank returned 0 results; tier=${tier} from pattern namespace.`
266
+ : `ReasoningBank controller unavailable; tier=${tier} from pattern namespace.`,
267
+ };
268
+ }
269
+ catch (fallbackErr) {
270
+ return { results: [], controller: 'unavailable', fallbackError: sanitizeError(fallbackErr) };
271
+ }
195
272
  }
196
273
  catch (error) {
197
274
  return { results: [], error: sanitizeError(error) };
@@ -201,7 +278,7 @@ export const agentdbPatternSearch = {
201
278
  // ===== agentdb_feedback โ€” Record task feedback =====
202
279
  export const agentdbFeedback = {
203
280
  name: 'agentdb_feedback',
204
- description: 'Record task feedback for learning via LearningSystem + ReasoningBank controllers',
281
+ description: 'Record task feedback for learning via LearningSystem + ReasoningBank controllers Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
205
282
  inputSchema: {
206
283
  type: 'object',
207
284
  properties: {
@@ -242,7 +319,7 @@ export const agentdbFeedback = {
242
319
  // ===== agentdb_causal_edge โ€” Record causal relationships =====
243
320
  export const agentdbCausalEdge = {
244
321
  name: 'agentdb_causal-edge',
245
- description: 'Record a causal edge between two memory entries via CausalMemoryGraph',
322
+ description: 'Record a causal edge between two memory entries via CausalMemoryGraph Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
246
323
  inputSchema: {
247
324
  type: 'object',
248
325
  properties: {
@@ -304,7 +381,7 @@ export const agentdbCausalEdge = {
304
381
  // ===== agentdb_route โ€” Route via SemanticRouter =====
305
382
  export const agentdbRoute = {
306
383
  name: 'agentdb_route',
307
- description: 'Route a task via AgentDB SemanticRouter or LearningSystem recommendAlgorithm',
384
+ description: 'Route a task via AgentDB SemanticRouter or LearningSystem recommendAlgorithm Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
308
385
  inputSchema: {
309
386
  type: 'object',
310
387
  properties: {
@@ -341,7 +418,7 @@ export const agentdbRoute = {
341
418
  // ===== agentdb_session_start โ€” Session with ReflexionMemory =====
342
419
  export const agentdbSessionStart = {
343
420
  name: 'agentdb_session-start',
344
- description: 'Start a session with ReflexionMemory episodic replay',
421
+ description: 'Start a session with ReflexionMemory episodic replay Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
345
422
  inputSchema: {
346
423
  type: 'object',
347
424
  properties: {
@@ -378,7 +455,7 @@ export const agentdbSessionStart = {
378
455
  // ===== agentdb_session_end โ€” End session + NightlyLearner =====
379
456
  export const agentdbSessionEnd = {
380
457
  name: 'agentdb_session-end',
381
- description: 'End session, persist to ReflexionMemory, trigger NightlyLearner consolidation',
458
+ description: 'End session, persist to ReflexionMemory, trigger NightlyLearner consolidation Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
382
459
  inputSchema: {
383
460
  type: 'object',
384
461
  properties: {
@@ -417,7 +494,7 @@ export const agentdbSessionEnd = {
417
494
  // ===== agentdb_hierarchical_store โ€” Store to hierarchical memory =====
418
495
  export const agentdbHierarchicalStore = {
419
496
  name: 'agentdb_hierarchical-store',
420
- description: 'Store to hierarchical memory with tier (working, episodic, semantic)',
497
+ description: 'Store to hierarchical memory with tier (working, episodic, semantic) Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
421
498
  inputSchema: {
422
499
  type: 'object',
423
500
  properties: {
@@ -467,7 +544,7 @@ export const agentdbHierarchicalStore = {
467
544
  // ===== agentdb_hierarchical_recall โ€” Recall from hierarchical memory =====
468
545
  export const agentdbHierarchicalRecall = {
469
546
  name: 'agentdb_hierarchical-recall',
470
- description: 'Recall from hierarchical memory with optional tier filter',
547
+ description: 'Recall from hierarchical memory with optional tier filter Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
471
548
  inputSchema: {
472
549
  type: 'object',
473
550
  properties: {
@@ -510,7 +587,7 @@ export const agentdbHierarchicalRecall = {
510
587
  // ===== agentdb_consolidate โ€” Run memory consolidation =====
511
588
  export const agentdbConsolidate = {
512
589
  name: 'agentdb_consolidate',
513
- description: 'Run memory consolidation to promote entries across tiers and compress old data',
590
+ description: 'Run memory consolidation to promote entries across tiers and compress old data Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
514
591
  inputSchema: {
515
592
  type: 'object',
516
593
  properties: {
@@ -535,7 +612,7 @@ export const agentdbConsolidate = {
535
612
  // ===== agentdb_batch โ€” Batch operations (insert, update, delete) =====
536
613
  export const agentdbBatch = {
537
614
  name: 'agentdb_batch',
538
- description: 'Batch operations on AgentDB episodes (insert, update, delete). Note: entries are stored in the AgentDB episodes table, not the memory_search namespace. Use memory_store for entries that should be searchable via memory_search.',
615
+ description: 'Batch operations on AgentDB episodes (insert, update, delete). Note: entries are stored in the AgentDB episodes table, not the memory_search namespace. Use memory_store for entries that should be searchable via memory_search. Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
539
616
  inputSchema: {
540
617
  type: 'object',
541
618
  properties: {
@@ -604,7 +681,7 @@ export const agentdbBatch = {
604
681
  // ===== agentdb_context_synthesize โ€” Synthesize context from memories =====
605
682
  export const agentdbContextSynthesize = {
606
683
  name: 'agentdb_context-synthesize',
607
- description: 'Synthesize context from stored memories for a given query',
684
+ description: 'Synthesize context from stored memories for a given query Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
608
685
  inputSchema: {
609
686
  type: 'object',
610
687
  properties: {
@@ -636,7 +713,7 @@ export const agentdbContextSynthesize = {
636
713
  // ===== agentdb_semantic_route โ€” Route via SemanticRouter =====
637
714
  export const agentdbSemanticRoute = {
638
715
  name: 'agentdb_semantic-route',
639
- description: 'Route an input via AgentDB SemanticRouter for intent classification',
716
+ description: 'Route an input via AgentDB SemanticRouter for intent classification Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
640
717
  inputSchema: {
641
718
  type: 'object',
642
719
  properties: {
@@ -664,7 +741,7 @@ export const agentdbSemanticRoute = {
664
741
  // ===== #1784: Delete tools โ€” symmetry for hierarchical-store + causal-edge =====
665
742
  export const agentdbHierarchicalDelete = {
666
743
  name: 'agentdb_hierarchical-delete',
667
- description: 'Delete a hierarchical-memory entry by key. Returns controller="native-unsupported" when the entry is in a backend without a public delete API.',
744
+ description: 'Delete a hierarchical-memory entry by key. Returns controller="native-unsupported" when the entry is in a backend without a public delete API. Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
668
745
  inputSchema: {
669
746
  type: 'object',
670
747
  properties: {
@@ -705,7 +782,7 @@ export const agentdbHierarchicalDelete = {
705
782
  };
706
783
  export const agentdbCausalEdgeDelete = {
707
784
  name: 'agentdb_causal-edge-delete',
708
- description: 'Delete a causal edge between two memory entries. Returns controller="native-unsupported" when the edge lives in graph-node native storage (no public delete API).',
785
+ description: 'Delete a causal edge between two memory entries. Returns controller="native-unsupported" when the edge lives in graph-node native storage (no public delete API). Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
709
786
  inputSchema: {
710
787
  type: 'object',
711
788
  properties: {
@@ -741,7 +818,7 @@ export const agentdbCausalEdgeDelete = {
741
818
  };
742
819
  export const agentdbCausalNodeDelete = {
743
820
  name: 'agentdb_causal-node-delete',
744
- description: 'Cascade-delete a causal node and all its incident edges from the SQL fallback. Native graph-node entries are unaffected (no delete API in the binding).',
821
+ description: 'Cascade-delete a causal node and all its incident edges from the SQL fallback. Native graph-node entries are unaffected (no delete API in the binding). Use when generic memory_* tools are wrong because you need AgentDB-specific controllers (HNSW vector search, hierarchical tiers, causal-graph links, pattern store/recall, RaBitQ quantization). For simple key-value persistence, memory_store/memory_retrieve are simpler. For unrelated file work, native Read/Write are fine.',
745
822
  inputSchema: {
746
823
  type: 'object',
747
824
  properties: {
@@ -10,7 +10,7 @@ import { analyzeDiff, assessFileRisk, assessOverallRisk, classifyDiff, suggestRe
10
10
  */
11
11
  export const analyzeDiffTool = {
12
12
  name: 'analyze_diff',
13
- description: 'Analyze git diff for change risk assessment and classification',
13
+ description: 'Analyze git diff for change risk assessment and classification Use when native `git diff` / `grep` / static analysis is wrong because you want LLM-graded change classification, reviewer recommendations, or risk scoring. For literal-text inspection, native tools are fine.',
14
14
  category: 'analyze',
15
15
  tags: ['diff', 'risk', 'classification', 'git'],
16
16
  inputSchema: {
@@ -85,7 +85,7 @@ export const analyzeDiffTool = {
85
85
  */
86
86
  export const diffRiskTool = {
87
87
  name: 'analyze_diff-risk',
88
- description: 'Quick risk assessment for git diff',
88
+ description: 'Quick risk assessment for git diff Use when native `git diff` / `grep` / static analysis is wrong because you want LLM-graded change classification, reviewer recommendations, or risk scoring. For literal-text inspection, native tools are fine.',
89
89
  category: 'analyze',
90
90
  tags: ['diff', 'risk', 'git'],
91
91
  inputSchema: {
@@ -130,7 +130,7 @@ export const diffRiskTool = {
130
130
  */
131
131
  export const diffClassifyTool = {
132
132
  name: 'analyze_diff-classify',
133
- description: 'Classify git diff change type',
133
+ description: 'Classify git diff change type Use when native `git diff` / `grep` / static analysis is wrong because you want LLM-graded change classification, reviewer recommendations, or risk scoring. For literal-text inspection, native tools are fine.',
134
134
  category: 'analyze',
135
135
  tags: ['diff', 'classification', 'git'],
136
136
  inputSchema: {
@@ -174,7 +174,7 @@ export const diffClassifyTool = {
174
174
  */
175
175
  export const diffReviewersTool = {
176
176
  name: 'analyze_diff-reviewers',
177
- description: 'Suggest reviewers for git diff changes',
177
+ description: 'Suggest reviewers for git diff changes Use when native `git diff` / `grep` / static analysis is wrong because you want LLM-graded change classification, reviewer recommendations, or risk scoring. For literal-text inspection, native tools are fine.',
178
178
  category: 'analyze',
179
179
  tags: ['diff', 'reviewers', 'git'],
180
180
  inputSchema: {
@@ -225,7 +225,7 @@ export const diffReviewersTool = {
225
225
  */
226
226
  export const fileRiskTool = {
227
227
  name: 'analyze_file-risk',
228
- description: 'Assess risk for a specific file change',
228
+ description: 'Assess risk for a specific file change Use when native `git diff` / `grep` / static analysis is wrong because you want LLM-graded change classification, reviewer recommendations, or risk scoring. For literal-text inspection, native tools are fine.',
229
229
  category: 'analyze',
230
230
  tags: ['file', 'risk'],
231
231
  inputSchema: {
@@ -280,7 +280,7 @@ export const fileRiskTool = {
280
280
  */
281
281
  export const diffStatsTool = {
282
282
  name: 'analyze_diff-stats',
283
- description: 'Get quick statistics for git diff',
283
+ description: 'Get quick statistics for git diff Use when native `git diff` / `grep` / static analysis is wrong because you want LLM-graded change classification, reviewer recommendations, or risk scoring. For literal-text inspection, native tools are fine.',
284
284
  category: 'analyze',
285
285
  tags: ['diff', 'stats', 'git'],
286
286
  inputSchema: {
@@ -15,7 +15,7 @@ function ok(data) {
15
15
  // โ”€โ”€ MCP Tool Definitions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
16
16
  const autopilotStatus = {
17
17
  name: 'autopilot_status',
18
- description: 'Get autopilot state including enabled status, iteration count, task progress, and learning metrics.',
18
+ description: 'Get autopilot state including enabled status, iteration count, task progress, and learning metrics. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
19
19
  category: 'autopilot',
20
20
  inputSchema: { type: 'object', properties: {} },
21
21
  handler: async () => {
@@ -36,7 +36,7 @@ const autopilotStatus = {
36
36
  };
37
37
  const autopilotEnable = {
38
38
  name: 'autopilot_enable',
39
- description: 'Enable autopilot persistent completion. Agents will be re-engaged when tasks remain incomplete.',
39
+ description: 'Enable autopilot persistent completion. Agents will be re-engaged when tasks remain incomplete. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
40
40
  category: 'autopilot',
41
41
  inputSchema: { type: 'object', properties: {} },
42
42
  handler: async () => {
@@ -51,7 +51,7 @@ const autopilotEnable = {
51
51
  };
52
52
  const autopilotDisable = {
53
53
  name: 'autopilot_disable',
54
- description: 'Disable autopilot. Agents will be allowed to stop even if tasks remain.',
54
+ description: 'Disable autopilot. Agents will be allowed to stop even if tasks remain. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
55
55
  category: 'autopilot',
56
56
  inputSchema: { type: 'object', properties: {} },
57
57
  handler: async () => {
@@ -64,7 +64,7 @@ const autopilotDisable = {
64
64
  };
65
65
  const autopilotConfig = {
66
66
  name: 'autopilot_config',
67
- description: 'Configure autopilot limits: max iterations (1-1000), timeout in minutes (1-1440), and task sources.',
67
+ description: 'Configure autopilot limits: max iterations (1-1000), timeout in minutes (1-1440), and task sources. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
68
68
  category: 'autopilot',
69
69
  inputSchema: {
70
70
  type: 'object',
@@ -91,7 +91,7 @@ const autopilotConfig = {
91
91
  };
92
92
  const autopilotReset = {
93
93
  name: 'autopilot_reset',
94
- description: 'Reset autopilot iteration counter and restart the timer.',
94
+ description: 'Reset autopilot iteration counter and restart the timer. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
95
95
  category: 'autopilot',
96
96
  inputSchema: { type: 'object', properties: {} },
97
97
  handler: async () => {
@@ -107,7 +107,7 @@ const autopilotReset = {
107
107
  };
108
108
  const autopilotLog = {
109
109
  name: 'autopilot_log',
110
- description: 'Retrieve the autopilot event log. Shows enable/disable events, re-engagements, completions.',
110
+ description: 'Retrieve the autopilot event log. Shows enable/disable events, re-engagements, completions. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
111
111
  category: 'autopilot',
112
112
  inputSchema: {
113
113
  type: 'object',
@@ -123,7 +123,7 @@ const autopilotLog = {
123
123
  };
124
124
  const autopilotProgress = {
125
125
  name: 'autopilot_progress',
126
- description: 'Detailed task progress broken down by source (team-tasks, swarm-tasks, file-checklist).',
126
+ description: 'Detailed task progress broken down by source (team-tasks, swarm-tasks, file-checklist). Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
127
127
  category: 'autopilot',
128
128
  inputSchema: { type: 'object', properties: {} },
129
129
  handler: async () => {
@@ -148,7 +148,7 @@ const autopilotProgress = {
148
148
  };
149
149
  const autopilotLearn = {
150
150
  name: 'autopilot_learn',
151
- description: 'Discover success patterns from past task completions. Requires AgentDB for full functionality.',
151
+ description: 'Discover success patterns from past task completions. Requires AgentDB for full functionality. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
152
152
  category: 'autopilot',
153
153
  inputSchema: { type: 'object', properties: {} },
154
154
  handler: async () => {
@@ -165,7 +165,7 @@ const autopilotLearn = {
165
165
  };
166
166
  const autopilotHistory = {
167
167
  name: 'autopilot_history',
168
- description: 'Search past completion episodes by keyword. Requires AgentDB.',
168
+ description: 'Search past completion episodes by keyword. Requires AgentDB. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
169
169
  category: 'autopilot',
170
170
  inputSchema: {
171
171
  type: 'object',
@@ -191,7 +191,7 @@ const autopilotHistory = {
191
191
  };
192
192
  const autopilotPredict = {
193
193
  name: 'autopilot_predict',
194
- description: 'Predict the optimal next action based on current state and learned patterns.',
194
+ description: 'Predict the optimal next action based on current state and learned patterns. Use when running long-horizon goals that should resume automatically across sessions โ€” Claude Code has no native autonomous-loop scheduler. Pair with autopilot_enable + a goal description, then let cron fires advance the work. For interactive single-task sessions, native Task is fine.',
195
195
  category: 'autopilot',
196
196
  inputSchema: { type: 'object', properties: {} },
197
197
  handler: async () => {
@@ -68,7 +68,7 @@ export const browserSessionTools = [
68
68
  // ==========================================================================
69
69
  {
70
70
  name: 'browser_session_record',
71
- description: 'Open a named, traced browser session: allocate an RVF cognitive container, begin a ruvector trajectory, then open the URL via agent-browser. Returns the session id and rvf path.',
71
+ description: 'Open a named, traced browser session: allocate an RVF cognitive container, begin a ruvector trajectory, then open the URL via agent-browser. Returns the session id and rvf path. Use when native WebFetch is wrong because you need real browser automation โ€” JS-heavy SPA scraping, login flows with cookie reuse, replay against DOM-drifted versions, AIDefence PII gating before content reaches Claude. For static HTML pages, native WebFetch is faster and free.',
72
72
  category: 'browser-session',
73
73
  tags: ['session', 'rvf', 'trajectory', 'lifecycle'],
74
74
  inputSchema: {
@@ -134,7 +134,7 @@ export const browserSessionTools = [
134
134
  // ==========================================================================
135
135
  {
136
136
  name: 'browser_session_end',
137
- description: 'End a recorded browser session: trajectory-end with verdict, rvf compact, AIDefence pre-store gate (best-effort), and AgentDB index in the browser-sessions namespace.',
137
+ description: 'End a recorded browser session: trajectory-end with verdict, rvf compact, AIDefence pre-store gate (best-effort), and AgentDB index in the browser-sessions namespace. Use when native WebFetch is wrong because you need real browser automation โ€” JS-heavy SPA scraping, login flows with cookie reuse, replay against DOM-drifted versions, AIDefence PII gating before content reaches Claude. For static HTML pages, native WebFetch is faster and free.',
138
138
  category: 'browser-session',
139
139
  tags: ['session', 'rvf', 'trajectory', 'lifecycle', 'agentdb'],
140
140
  inputSchema: {
@@ -195,7 +195,7 @@ export const browserSessionTools = [
195
195
  // ==========================================================================
196
196
  {
197
197
  name: 'browser_session_replay',
198
- description: 'Load a recorded session trajectory and return its steps so the caller can dispatch them through the 23 browser_* tools. Does NOT itself drive the browser โ€” replay execution is caller-orchestrated to keep this tool a primitive (ADR-0001 ยง7).',
198
+ description: 'Load a recorded session trajectory and return its steps so the caller can dispatch them through the 23 browser_* tools. Does NOT itself drive the browser โ€” replay execution is caller-orchestrated to keep this tool a primitive (ADR-0001 ยง7). Use when native WebFetch is wrong because you need real browser automation โ€” JS-heavy SPA scraping, login flows with cookie reuse, replay against DOM-drifted versions, AIDefence PII gating before content reaches Claude. For static HTML pages, native WebFetch is faster and free.',
199
199
  category: 'browser-session',
200
200
  tags: ['session', 'replay', 'trajectory', 'lifecycle'],
201
201
  inputSchema: {
@@ -249,7 +249,7 @@ export const browserSessionTools = [
249
249
  // ==========================================================================
250
250
  {
251
251
  name: 'browser_template_apply',
252
- description: 'Fetch a recipe from the browser-templates AgentDB namespace and return it for caller-level execution.',
252
+ description: 'Fetch a recipe from the browser-templates AgentDB namespace and return it for caller-level execution. Use when native WebFetch is wrong because you need real browser automation โ€” JS-heavy SPA scraping, login flows with cookie reuse, replay against DOM-drifted versions, AIDefence PII gating before content reaches Claude. For static HTML pages, native WebFetch is faster and free.',
253
253
  category: 'browser-session',
254
254
  tags: ['template', 'agentdb', 'extract'],
255
255
  inputSchema: {
@@ -280,7 +280,7 @@ export const browserSessionTools = [
280
280
  // ==========================================================================
281
281
  {
282
282
  name: 'browser_cookie_use',
283
- description: 'Fetch a vault handle for a host from the browser-cookies AgentDB namespace. Raw cookie values are NEVER returned โ€” only the opaque handle plus expiry / AIDefence verdict.',
283
+ description: 'Fetch a vault handle for a host from the browser-cookies AgentDB namespace. Raw cookie values are NEVER returned โ€” only the opaque handle plus expiry / AIDefence verdict. Use when native WebFetch is wrong because you need real browser automation โ€” JS-heavy SPA scraping, login flows with cookie reuse, replay against DOM-drifted versions, AIDefence PII gating before content reaches Claude. For static HTML pages, native WebFetch is faster and free.',
284
284
  category: 'browser-session',
285
285
  tags: ['cookie', 'agentdb', 'aidefence', 'auth'],
286
286
  inputSchema: {