agentic-qe 3.7.19 → 3.7.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.
Files changed (77) hide show
  1. package/.claude/agents/v3/qe-deployment-advisor.md +14 -0
  2. package/.claude/agents/v3/qe-gap-detector.md +8 -0
  3. package/.claude/agents/v3/qe-impact-analyzer.md +11 -0
  4. package/.claude/agents/v3/qe-queen-coordinator.md +45 -0
  5. package/.claude/agents/v3/qe-root-cause-analyzer.md +11 -0
  6. package/.claude/agents/v3/qe-security-scanner.md +25 -16
  7. package/.claude/helpers/brain-checkpoint.cjs +3 -3
  8. package/.claude/helpers/statusline-v3.cjs +4 -3
  9. package/.claude/skills/skills-manifest.json +1 -1
  10. package/CHANGELOG.md +27 -0
  11. package/assets/agents/v3/qe-deployment-advisor.md +14 -0
  12. package/assets/agents/v3/qe-gap-detector.md +8 -0
  13. package/assets/agents/v3/qe-impact-analyzer.md +11 -0
  14. package/assets/agents/v3/qe-queen-coordinator.md +45 -0
  15. package/assets/agents/v3/qe-root-cause-analyzer.md +11 -0
  16. package/assets/agents/v3/qe-security-scanner.md +25 -16
  17. package/assets/helpers/statusline-v3.cjs +4 -3
  18. package/dist/adapters/claude-flow/model-router-bridge.d.ts +0 -6
  19. package/dist/adapters/claude-flow/model-router-bridge.js +4 -17
  20. package/dist/adapters/claude-flow/pretrain-bridge.d.ts +0 -6
  21. package/dist/adapters/claude-flow/pretrain-bridge.js +6 -19
  22. package/dist/adapters/claude-flow/trajectory-bridge.d.ts +0 -6
  23. package/dist/adapters/claude-flow/trajectory-bridge.js +21 -23
  24. package/dist/cli/bundle.js +1821 -986
  25. package/dist/coordination/protocols/security-audit.d.ts +3 -6
  26. package/dist/coordination/protocols/security-audit.js +8 -88
  27. package/dist/coordination/queen-coordinator.d.ts +13 -0
  28. package/dist/coordination/queen-coordinator.js +76 -0
  29. package/dist/coordination/queen-task-management.d.ts +2 -0
  30. package/dist/coordination/queen-task-management.js +10 -0
  31. package/dist/coordination/queen-types.d.ts +3 -0
  32. package/dist/coordination/task-executor.js +7 -5
  33. package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +25 -1
  34. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +140 -11
  35. package/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +2 -0
  36. package/dist/domains/security-compliance/services/scanners/scanner-types.js +1 -0
  37. package/dist/domains/test-execution/services/mincut-test-optimizer.js +2 -0
  38. package/dist/governance/continue-gate-integration.js +1 -1
  39. package/dist/governance/feature-flags.js +2 -2
  40. package/dist/init/agents-installer.d.ts +2 -0
  41. package/dist/init/agents-installer.js +13 -0
  42. package/dist/init/enhancements/claude-flow-adapter.js +51 -24
  43. package/dist/init/init-wizard.js +1 -1
  44. package/dist/init/phases/07-hooks.js +6 -6
  45. package/dist/init/settings-merge.js +2 -0
  46. package/dist/integrations/ruvector/brain-rvf-exporter.js +14 -2
  47. package/dist/learning/experience-capture-middleware.js +3 -1
  48. package/dist/learning/qe-reasoning-bank.js +3 -3
  49. package/dist/learning/sqlite-persistence.js +16 -0
  50. package/dist/learning/token-tracker.js +4 -2
  51. package/dist/mcp/bundle.js +1183 -504
  52. package/dist/routing/agent-dependency-graph.d.ts +77 -0
  53. package/dist/routing/agent-dependency-graph.js +359 -0
  54. package/dist/routing/co-execution-repository.d.ts +68 -0
  55. package/dist/routing/co-execution-repository.js +184 -0
  56. package/dist/routing/index.d.ts +6 -0
  57. package/dist/routing/index.js +6 -0
  58. package/dist/routing/qe-task-router.d.ts +7 -0
  59. package/dist/routing/qe-task-router.js +63 -1
  60. package/dist/routing/signal-merger.d.ts +81 -0
  61. package/dist/routing/signal-merger.js +136 -0
  62. package/dist/routing/types.d.ts +1 -0
  63. package/dist/shared/llm/providers/azure-openai.js +3 -2
  64. package/dist/shared/llm/providers/bedrock.js +3 -2
  65. package/dist/shared/llm/providers/claude.js +3 -2
  66. package/dist/shared/llm/providers/gemini.js +3 -2
  67. package/dist/shared/llm/providers/openai.js +3 -2
  68. package/dist/shared/llm/providers/openrouter.js +3 -2
  69. package/dist/shared/llm/retry.d.ts +10 -0
  70. package/dist/shared/llm/retry.js +16 -0
  71. package/dist/shared/llm/router/agent-router-config.d.ts +2 -1
  72. package/dist/shared/llm/router/agent-router-config.js +38 -88
  73. package/dist/validation/index.d.ts +2 -0
  74. package/dist/validation/index.js +4 -0
  75. package/dist/validation/steps/agent-mcp-validator.d.ts +88 -0
  76. package/dist/validation/steps/agent-mcp-validator.js +254 -0
  77. package/package.json +1 -1
@@ -223,100 +223,50 @@ export const AGENT_CATEGORY_MAP = {
223
223
  // Default Capability Requirements by Category
224
224
  // ============================================================================
225
225
  /**
226
- * Default capability requirements for each agent category
226
+ * Capability presets 4 distinct profiles that all 9 categories map to.
227
+ * Avoids repeating the same boolean matrix for categories that share the same needs.
227
228
  */
228
- export const DEFAULT_CATEGORY_CAPABILITIES = {
229
- security: {
230
- requiresReasoning: true,
231
- requiresTools: true,
232
- requiresVision: false,
233
- requiresExtendedThinking: true,
234
- requiresJsonMode: true,
235
- minContextSize: 100000,
236
- costSensitivity: 'low',
237
- latencySensitivity: 'low',
238
- },
239
- 'test-generation': {
240
- requiresReasoning: true,
241
- requiresTools: true,
242
- requiresVision: false,
243
- requiresExtendedThinking: false,
244
- requiresJsonMode: true,
245
- minContextSize: 50000,
246
- costSensitivity: 'medium',
247
- latencySensitivity: 'medium',
248
- },
249
- 'code-analysis': {
250
- requiresReasoning: true,
251
- requiresTools: true,
252
- requiresVision: false,
253
- requiresExtendedThinking: false,
254
- requiresJsonMode: true,
255
- minContextSize: 50000,
256
- costSensitivity: 'medium',
257
- latencySensitivity: 'medium',
229
+ const CAPABILITY_PRESETS = {
230
+ /** Deep reasoning + extended thinking, large context, cost-insensitive */
231
+ heavyweight: {
232
+ requiresReasoning: true, requiresTools: true, requiresVision: false,
233
+ requiresExtendedThinking: true, requiresJsonMode: true,
234
+ minContextSize: 100000, costSensitivity: 'low', latencySensitivity: 'low',
258
235
  },
259
- performance: {
260
- requiresReasoning: false,
261
- requiresTools: true,
262
- requiresVision: false,
263
- requiresExtendedThinking: false,
264
- requiresJsonMode: true,
265
- minContextSize: 16000,
266
- costSensitivity: 'high',
267
- latencySensitivity: 'high',
236
+ /** Reasoning + tools, medium context, balanced cost/latency */
237
+ standard: {
238
+ requiresReasoning: true, requiresTools: true, requiresVision: false,
239
+ requiresExtendedThinking: false, requiresJsonMode: true,
240
+ minContextSize: 50000, costSensitivity: 'medium', latencySensitivity: 'medium',
268
241
  },
269
- documentation: {
270
- requiresReasoning: false,
271
- requiresTools: false,
272
- requiresVision: false,
273
- requiresExtendedThinking: false,
274
- requiresJsonMode: false,
275
- minContextSize: 16000,
276
- costSensitivity: 'high',
277
- latencySensitivity: 'medium',
242
+ /** Tools only, small context, latency-sensitive */
243
+ lightweight: {
244
+ requiresReasoning: false, requiresTools: true, requiresVision: false,
245
+ requiresExtendedThinking: false, requiresJsonMode: true,
246
+ minContextSize: 16000, costSensitivity: 'medium', latencySensitivity: 'high',
278
247
  },
279
- learning: {
280
- requiresReasoning: true,
281
- requiresTools: true,
282
- requiresVision: false,
283
- requiresExtendedThinking: false,
284
- requiresJsonMode: true,
285
- minContextSize: 50000,
286
- costSensitivity: 'medium',
287
- latencySensitivity: 'medium',
288
- },
289
- coordination: {
290
- requiresReasoning: false,
291
- requiresTools: true,
292
- requiresVision: false,
293
- requiresExtendedThinking: false,
294
- requiresJsonMode: true,
295
- minContextSize: 16000,
296
- costSensitivity: 'medium',
297
- latencySensitivity: 'high',
298
- },
299
- simple: {
300
- requiresReasoning: false,
301
- requiresTools: false,
302
- requiresVision: false,
303
- requiresExtendedThinking: false,
304
- requiresJsonMode: false,
305
- minContextSize: 4000,
306
- costSensitivity: 'high',
307
- latencySensitivity: 'medium',
308
- },
309
- general: {
310
- requiresReasoning: false,
311
- requiresTools: true,
312
- requiresVision: false,
313
- requiresExtendedThinking: false,
314
- requiresJsonMode: false,
315
- minContextSize: 16000,
316
- costSensitivity: 'medium',
317
- latencySensitivity: 'medium',
248
+ /** No special requirements, smallest context, cost-sensitive */
249
+ minimal: {
250
+ requiresReasoning: false, requiresTools: false, requiresVision: false,
251
+ requiresExtendedThinking: false, requiresJsonMode: false,
252
+ minContextSize: 4000, costSensitivity: 'high', latencySensitivity: 'medium',
318
253
  },
319
254
  };
255
+ /**
256
+ * Default capability requirements for each agent category.
257
+ * Categories map to one of 4 presets, with per-category overrides where needed.
258
+ */
259
+ export const DEFAULT_CATEGORY_CAPABILITIES = {
260
+ security: CAPABILITY_PRESETS.heavyweight,
261
+ 'test-generation': CAPABILITY_PRESETS.standard,
262
+ 'code-analysis': CAPABILITY_PRESETS.standard,
263
+ learning: CAPABILITY_PRESETS.standard,
264
+ performance: { ...CAPABILITY_PRESETS.lightweight, costSensitivity: 'high' },
265
+ coordination: CAPABILITY_PRESETS.lightweight,
266
+ general: { ...CAPABILITY_PRESETS.lightweight, requiresJsonMode: false, latencySensitivity: 'medium' },
267
+ documentation: { ...CAPABILITY_PRESETS.minimal, minContextSize: 16000 },
268
+ simple: CAPABILITY_PRESETS.minimal,
269
+ };
320
270
  // ============================================================================
321
271
  // Core Functions
322
272
  // ============================================================================
@@ -23,4 +23,6 @@ export type { VersionComparisonConfig, SkillVersion, VersionComparisonResult, Ve
23
23
  export { runPipeline, formatPipelineReport, } from './pipeline.js';
24
24
  export type { StepCategory, StepSeverity, StepStatus, Finding, ValidationContext, ValidationStep, StepResult, PipelineConfig, PipelineResult, } from './pipeline.js';
25
25
  export { REQUIREMENTS_VALIDATION_STEPS, createRequirementsPipeline, formatCheckStep, completenessCheckStep, investCriteriaStep, smartAcceptanceStep, testabilityScoreStep, vagueTermStep, informationDensityStep, traceabilityCheckStep, implementationLeakageStep, domainComplianceStep, dependencyAnalysisStep, bddScenarioStep, holisticQualityStep, } from './steps/requirements.js';
26
+ export { scanMcpReferences, deduplicateByServer, getAvailableMcpServers, validateAgentMcpDeps, validateFleetMcpDeps, } from './steps/agent-mcp-validator.js';
27
+ export type { McpToolReference, AgentMcpValidationResult, FleetMcpValidationResult, } from './steps/agent-mcp-validator.js';
26
28
  //# sourceMappingURL=index.d.ts.map
@@ -46,4 +46,8 @@ export { runPipeline, formatPipelineReport, } from './pipeline.js';
46
46
  export { REQUIREMENTS_VALIDATION_STEPS, createRequirementsPipeline,
47
47
  // Individual steps
48
48
  formatCheckStep, completenessCheckStep, investCriteriaStep, smartAcceptanceStep, testabilityScoreStep, vagueTermStep, informationDensityStep, traceabilityCheckStep, implementationLeakageStep, domainComplianceStep, dependencyAnalysisStep, bddScenarioStep, holisticQualityStep, } from './steps/requirements.js';
49
+ // ============================================================================
50
+ // Agent MCP Dependency Validation (Issue #342 Item 1)
51
+ // ============================================================================
52
+ export { scanMcpReferences, deduplicateByServer, getAvailableMcpServers, validateAgentMcpDeps, validateFleetMcpDeps, } from './steps/agent-mcp-validator.js';
49
53
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Agent MCP Dependency Validator (Issue #342, Item 1)
3
+ *
4
+ * Scans agent .md definitions for mcp__* tool references and validates
5
+ * them against currently available MCP servers.
6
+ *
7
+ * Inspired by Skillsmith's dependency intelligence:
8
+ * - Regex scanner for mcp__server__tool references
9
+ * - Context-aware confidence: prose refs = 0.9, code block refs = 0.5
10
+ * - 100KB input cap for ReDoS prevention
11
+ * - Advisory warnings only (never blocks spawn)
12
+ */
13
+ /** An MCP tool reference found in an agent definition */
14
+ export interface McpToolReference {
15
+ /** Full tool name: mcp__server__tool */
16
+ readonly toolName: string;
17
+ /** MCP server name extracted from the reference */
18
+ readonly serverName: string;
19
+ /** Tool action name */
20
+ readonly actionName: string;
21
+ /** Confidence: 0.9 for prose, 0.5 for code blocks */
22
+ readonly confidence: number;
23
+ /** Whether found in a code block or prose */
24
+ readonly context: 'prose' | 'code-block';
25
+ /** Line number where found (1-based) */
26
+ readonly lineNumber: number;
27
+ }
28
+ /** Result of validating a single agent's MCP dependencies */
29
+ export interface AgentMcpValidationResult {
30
+ /** Agent name */
31
+ readonly agentName: string;
32
+ /** All MCP tool references found */
33
+ readonly references: McpToolReference[];
34
+ /** Unique MCP servers referenced */
35
+ readonly requiredServers: string[];
36
+ /** Servers that are currently available */
37
+ readonly availableServers: string[];
38
+ /** Servers that are missing (required but not available) */
39
+ readonly missingServers: string[];
40
+ /** Advisory warnings */
41
+ readonly warnings: string[];
42
+ /** Whether all dependencies are satisfied */
43
+ readonly allSatisfied: boolean;
44
+ }
45
+ /** Result of validating all agents' MCP dependencies */
46
+ export interface FleetMcpValidationResult {
47
+ /** Per-agent results */
48
+ readonly agents: AgentMcpValidationResult[];
49
+ /** Total unique MCP servers referenced across all agents */
50
+ readonly totalServersReferenced: number;
51
+ /** Servers missing across any agent */
52
+ readonly globalMissingServers: string[];
53
+ /** Agents with unsatisfied dependencies */
54
+ readonly agentsWithMissingDeps: string[];
55
+ /** Summary warnings */
56
+ readonly warnings: string[];
57
+ /** Scan duration in ms */
58
+ readonly durationMs: number;
59
+ }
60
+ /**
61
+ * Scan agent markdown content for MCP tool references.
62
+ * Returns references with context-aware confidence scoring.
63
+ *
64
+ * @param content - Agent .md file content
65
+ * @param _agentName - Agent name for reporting (reserved for future use)
66
+ * @returns Array of MCP tool references found
67
+ */
68
+ export declare function scanMcpReferences(content: string, _agentName: string): McpToolReference[];
69
+ /**
70
+ * Deduplicate MCP references by server, keeping all refs grouped per server.
71
+ */
72
+ export declare function deduplicateByServer(references: McpToolReference[]): Map<string, McpToolReference[]>;
73
+ /**
74
+ * Get the list of currently available MCP servers.
75
+ * Checks Claude Code's MCP configuration files.
76
+ */
77
+ export declare function getAvailableMcpServers(projectRoot: string): string[];
78
+ /**
79
+ * Validate a single agent's MCP dependencies.
80
+ * ADVISORY ONLY -- returns warnings, never blocks.
81
+ */
82
+ export declare function validateAgentMcpDeps(agentFilePath: string, agentName: string, availableServers: string[]): AgentMcpValidationResult;
83
+ /**
84
+ * Validate MCP dependencies across all agents in a directory.
85
+ * Returns advisory warnings only -- never blocks installation or spawn.
86
+ */
87
+ export declare function validateFleetMcpDeps(agentsDir: string, projectRoot: string): FleetMcpValidationResult;
88
+ //# sourceMappingURL=agent-mcp-validator.d.ts.map
@@ -0,0 +1,254 @@
1
+ /**
2
+ * Agent MCP Dependency Validator (Issue #342, Item 1)
3
+ *
4
+ * Scans agent .md definitions for mcp__* tool references and validates
5
+ * them against currently available MCP servers.
6
+ *
7
+ * Inspired by Skillsmith's dependency intelligence:
8
+ * - Regex scanner for mcp__server__tool references
9
+ * - Context-aware confidence: prose refs = 0.9, code block refs = 0.5
10
+ * - 100KB input cap for ReDoS prevention
11
+ * - Advisory warnings only (never blocks spawn)
12
+ */
13
+ import { readFileSync, existsSync, readdirSync } from 'fs';
14
+ import { join } from 'path';
15
+ // ============================================================================
16
+ // Constants
17
+ // ============================================================================
18
+ /** Max input size to scan (100KB, ReDoS prevention per Skillsmith) */
19
+ const MAX_SCAN_SIZE_BYTES = 100 * 1024;
20
+ /**
21
+ * Regex to detect MCP tool references.
22
+ * Matches: mcp__server-name__tool_action
23
+ * Per Skillsmith pattern: mcp__([a-z][a-z0-9-]*)__([a-z][a-z0-9_]*)
24
+ */
25
+ const MCP_TOOL_REGEX = /mcp__([a-z][a-z0-9-]*)__([a-z][a-z0-9_]*)/g;
26
+ /** Regex to detect fenced code block boundaries (``` ... ```) */
27
+ const CODE_BLOCK_REGEX = /^```/;
28
+ // ============================================================================
29
+ // Scanner
30
+ // ============================================================================
31
+ /**
32
+ * Scan agent markdown content for MCP tool references.
33
+ * Returns references with context-aware confidence scoring.
34
+ *
35
+ * @param content - Agent .md file content
36
+ * @param _agentName - Agent name for reporting (reserved for future use)
37
+ * @returns Array of MCP tool references found
38
+ */
39
+ export function scanMcpReferences(content, _agentName) {
40
+ // ReDoS prevention: cap input size
41
+ const safeContent = content.length > MAX_SCAN_SIZE_BYTES
42
+ ? content.slice(0, MAX_SCAN_SIZE_BYTES)
43
+ : content;
44
+ const references = [];
45
+ const lines = safeContent.split('\n');
46
+ let inCodeBlock = false;
47
+ for (let i = 0; i < lines.length; i++) {
48
+ const line = lines[i];
49
+ // Track code block boundaries
50
+ if (CODE_BLOCK_REGEX.test(line.trim())) {
51
+ inCodeBlock = !inCodeBlock;
52
+ continue;
53
+ }
54
+ // Find all MCP references on this line
55
+ let match;
56
+ const lineRegex = new RegExp(MCP_TOOL_REGEX.source, 'g');
57
+ while ((match = lineRegex.exec(line)) !== null) {
58
+ const serverName = match[1];
59
+ const actionName = match[2];
60
+ const toolName = match[0];
61
+ const context = inCodeBlock ? 'code-block' : 'prose';
62
+ // Skillsmith confidence: prose = 0.9, code block = 0.5
63
+ const confidence = context === 'prose' ? 0.9 : 0.5;
64
+ references.push({
65
+ toolName,
66
+ serverName,
67
+ actionName,
68
+ confidence,
69
+ context,
70
+ lineNumber: i + 1,
71
+ });
72
+ }
73
+ }
74
+ return references;
75
+ }
76
+ /**
77
+ * Deduplicate MCP references by server, keeping all refs grouped per server.
78
+ */
79
+ export function deduplicateByServer(references) {
80
+ const byServer = new Map();
81
+ for (const ref of references) {
82
+ if (!byServer.has(ref.serverName)) {
83
+ byServer.set(ref.serverName, []);
84
+ }
85
+ byServer.get(ref.serverName).push(ref);
86
+ }
87
+ return byServer;
88
+ }
89
+ /**
90
+ * Get the list of currently available MCP servers.
91
+ * Checks Claude Code's MCP configuration files.
92
+ */
93
+ export function getAvailableMcpServers(projectRoot) {
94
+ const servers = [];
95
+ // Check project-level and common MCP config paths
96
+ const mcpConfigPaths = [
97
+ join(projectRoot, '.claude', 'mcp.json'),
98
+ join(projectRoot, '.mcp.json'),
99
+ ];
100
+ // Also check home directory for user-level config
101
+ const homeDir = process.env.HOME || process.env.USERPROFILE || '';
102
+ if (homeDir) {
103
+ mcpConfigPaths.push(join(homeDir, '.claude', 'mcp.json'));
104
+ }
105
+ for (const configPath of mcpConfigPaths) {
106
+ if (!existsSync(configPath))
107
+ continue;
108
+ try {
109
+ const content = readFileSync(configPath, 'utf-8');
110
+ const config = JSON.parse(content);
111
+ // MCP config format: { "mcpServers": { "server-name": { ... } } }
112
+ if (config.mcpServers && typeof config.mcpServers === 'object') {
113
+ servers.push(...Object.keys(config.mcpServers));
114
+ }
115
+ }
116
+ catch {
117
+ // Non-critical: skip malformed config
118
+ }
119
+ }
120
+ return [...new Set(servers)];
121
+ }
122
+ /**
123
+ * Validate a single agent's MCP dependencies.
124
+ * ADVISORY ONLY -- returns warnings, never blocks.
125
+ */
126
+ export function validateAgentMcpDeps(agentFilePath, agentName, availableServers) {
127
+ if (!existsSync(agentFilePath)) {
128
+ return {
129
+ agentName,
130
+ references: [],
131
+ requiredServers: [],
132
+ availableServers,
133
+ missingServers: [],
134
+ warnings: [`Agent file not found: ${agentFilePath}`],
135
+ allSatisfied: true,
136
+ };
137
+ }
138
+ let content;
139
+ try {
140
+ content = readFileSync(agentFilePath, 'utf-8');
141
+ }
142
+ catch {
143
+ return {
144
+ agentName,
145
+ references: [],
146
+ requiredServers: [],
147
+ availableServers,
148
+ missingServers: [],
149
+ warnings: [`Failed to read agent file: ${agentFilePath}`],
150
+ allSatisfied: true,
151
+ };
152
+ }
153
+ // Scan for MCP references
154
+ const references = scanMcpReferences(content, agentName);
155
+ // Deduplicate by server
156
+ const byServer = deduplicateByServer(references);
157
+ const requiredServers = [...byServer.keys()];
158
+ // Check which servers are available
159
+ const availableSet = new Set(availableServers);
160
+ const missingServers = requiredServers.filter(s => !availableSet.has(s));
161
+ // Generate advisory warnings for missing servers
162
+ const warnings = [];
163
+ for (const missing of missingServers) {
164
+ const refs = byServer.get(missing) || [];
165
+ const maxConfidence = Math.max(...refs.map(r => r.confidence));
166
+ const refCount = refs.length;
167
+ const contexts = [...new Set(refs.map(r => r.context))].join(', ');
168
+ warnings.push(`[advisory] Agent "${agentName}" references MCP server "${missing}" ` +
169
+ `(${refCount} tool ref${refCount > 1 ? 's' : ''}, confidence: ${maxConfidence}, ` +
170
+ `context: ${contexts}) but server is not configured. ` +
171
+ `Agent may have reduced capabilities.`);
172
+ }
173
+ return {
174
+ agentName,
175
+ references,
176
+ requiredServers,
177
+ availableServers,
178
+ missingServers,
179
+ warnings,
180
+ allSatisfied: missingServers.length === 0,
181
+ };
182
+ }
183
+ /**
184
+ * Validate MCP dependencies across all agents in a directory.
185
+ * Returns advisory warnings only -- never blocks installation or spawn.
186
+ */
187
+ export function validateFleetMcpDeps(agentsDir, projectRoot) {
188
+ const startTime = Date.now();
189
+ const agentResults = [];
190
+ const allWarnings = [];
191
+ // Get available MCP servers
192
+ const availableServers = getAvailableMcpServers(projectRoot);
193
+ if (!existsSync(agentsDir)) {
194
+ return {
195
+ agents: [],
196
+ totalServersReferenced: 0,
197
+ globalMissingServers: [],
198
+ agentsWithMissingDeps: [],
199
+ warnings: [`Agents directory not found: ${agentsDir}`],
200
+ durationMs: Date.now() - startTime,
201
+ };
202
+ }
203
+ // Scan all .md files in the agents directory
204
+ try {
205
+ const entries = readdirSync(agentsDir);
206
+ for (const entry of entries) {
207
+ if (!entry.endsWith('.md'))
208
+ continue;
209
+ const agentName = entry.replace('.md', '');
210
+ const agentPath = join(agentsDir, entry);
211
+ const result = validateAgentMcpDeps(agentPath, agentName, availableServers);
212
+ agentResults.push(result);
213
+ allWarnings.push(...result.warnings);
214
+ }
215
+ // Also scan subagents directory
216
+ const subagentsDir = join(agentsDir, 'subagents');
217
+ if (existsSync(subagentsDir)) {
218
+ const subentries = readdirSync(subagentsDir);
219
+ for (const entry of subentries) {
220
+ if (!entry.endsWith('.md'))
221
+ continue;
222
+ const agentName = entry.replace('.md', '');
223
+ const agentPath = join(subagentsDir, entry);
224
+ const result = validateAgentMcpDeps(agentPath, agentName, availableServers);
225
+ agentResults.push(result);
226
+ allWarnings.push(...result.warnings);
227
+ }
228
+ }
229
+ }
230
+ catch (err) {
231
+ allWarnings.push(`Error scanning agents directory: ${err.message}`);
232
+ }
233
+ // Aggregate results
234
+ const allServers = new Set();
235
+ const allMissing = new Set();
236
+ const agentsWithMissing = [];
237
+ for (const result of agentResults) {
238
+ for (const server of result.requiredServers)
239
+ allServers.add(server);
240
+ for (const missing of result.missingServers)
241
+ allMissing.add(missing);
242
+ if (result.missingServers.length > 0)
243
+ agentsWithMissing.push(result.agentName);
244
+ }
245
+ return {
246
+ agents: agentResults,
247
+ totalServersReferenced: allServers.size,
248
+ globalMissingServers: [...allMissing],
249
+ agentsWithMissingDeps: agentsWithMissing,
250
+ warnings: allWarnings,
251
+ durationMs: Date.now() - startTime,
252
+ };
253
+ }
254
+ //# sourceMappingURL=agent-mcp-validator.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-qe",
3
- "version": "3.7.19",
3
+ "version": "3.7.21",
4
4
  "description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",