@bryan-thompson/inspector-assessment-client 1.6.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/assets/{OAuthCallback-ZcXdfhZQ.js → OAuthCallback-cGhwkoyY.js} +1 -1
  2. package/dist/assets/{OAuthDebugCallback-xt1SlIHS.js → OAuthDebugCallback-2rmUqser.js} +1 -1
  3. package/dist/assets/{index-B3lTiDVe.js → index-BnFixpvH.js} +4 -4
  4. package/dist/index.html +1 -1
  5. package/lib/lib/assessmentTypes.d.ts +670 -0
  6. package/lib/lib/assessmentTypes.d.ts.map +1 -0
  7. package/lib/lib/assessmentTypes.js +220 -0
  8. package/lib/lib/aupPatterns.d.ts +63 -0
  9. package/lib/lib/aupPatterns.d.ts.map +1 -0
  10. package/lib/lib/aupPatterns.js +344 -0
  11. package/lib/lib/prohibitedLibraries.d.ts +76 -0
  12. package/lib/lib/prohibitedLibraries.d.ts.map +1 -0
  13. package/lib/lib/prohibitedLibraries.js +364 -0
  14. package/lib/lib/securityPatterns.d.ts +64 -0
  15. package/lib/lib/securityPatterns.d.ts.map +1 -0
  16. package/lib/lib/securityPatterns.js +453 -0
  17. package/lib/services/assessment/AssessmentOrchestrator.d.ts +88 -0
  18. package/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -0
  19. package/lib/services/assessment/AssessmentOrchestrator.js +418 -0
  20. package/lib/services/assessment/ResponseValidator.d.ts +69 -0
  21. package/lib/services/assessment/ResponseValidator.d.ts.map +1 -0
  22. package/lib/services/assessment/ResponseValidator.js +1038 -0
  23. package/lib/services/assessment/TestDataGenerator.d.ts +86 -0
  24. package/lib/services/assessment/TestDataGenerator.d.ts.map +1 -0
  25. package/lib/services/assessment/TestDataGenerator.js +669 -0
  26. package/lib/services/assessment/TestScenarioEngine.d.ts +91 -0
  27. package/lib/services/assessment/TestScenarioEngine.d.ts.map +1 -0
  28. package/lib/services/assessment/TestScenarioEngine.js +505 -0
  29. package/lib/services/assessment/ToolClassifier.d.ts +61 -0
  30. package/lib/services/assessment/ToolClassifier.d.ts.map +1 -0
  31. package/lib/services/assessment/ToolClassifier.js +349 -0
  32. package/lib/services/assessment/lib/claudeCodeBridge.d.ts +160 -0
  33. package/lib/services/assessment/lib/claudeCodeBridge.d.ts.map +1 -0
  34. package/lib/services/assessment/lib/claudeCodeBridge.js +357 -0
  35. package/lib/services/assessment/modules/AUPComplianceAssessor.d.ts +100 -0
  36. package/lib/services/assessment/modules/AUPComplianceAssessor.d.ts.map +1 -0
  37. package/lib/services/assessment/modules/AUPComplianceAssessor.js +474 -0
  38. package/lib/services/assessment/modules/BaseAssessor.d.ts +71 -0
  39. package/lib/services/assessment/modules/BaseAssessor.d.ts.map +1 -0
  40. package/lib/services/assessment/modules/BaseAssessor.js +171 -0
  41. package/lib/services/assessment/modules/DocumentationAssessor.d.ts +45 -0
  42. package/lib/services/assessment/modules/DocumentationAssessor.d.ts.map +1 -0
  43. package/lib/services/assessment/modules/DocumentationAssessor.js +355 -0
  44. package/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts +25 -0
  45. package/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts.map +1 -0
  46. package/lib/services/assessment/modules/ErrorHandlingAssessor.js +564 -0
  47. package/lib/services/assessment/modules/FunctionalityAssessor.d.ts +20 -0
  48. package/lib/services/assessment/modules/FunctionalityAssessor.d.ts.map +1 -0
  49. package/lib/services/assessment/modules/FunctionalityAssessor.js +253 -0
  50. package/lib/services/assessment/modules/MCPSpecComplianceAssessor.d.ts +70 -0
  51. package/lib/services/assessment/modules/MCPSpecComplianceAssessor.d.ts.map +1 -0
  52. package/lib/services/assessment/modules/MCPSpecComplianceAssessor.js +508 -0
  53. package/lib/services/assessment/modules/ManifestValidationAssessor.d.ts +70 -0
  54. package/lib/services/assessment/modules/ManifestValidationAssessor.d.ts.map +1 -0
  55. package/lib/services/assessment/modules/ManifestValidationAssessor.js +430 -0
  56. package/lib/services/assessment/modules/PortabilityAssessor.d.ts +43 -0
  57. package/lib/services/assessment/modules/PortabilityAssessor.d.ts.map +1 -0
  58. package/lib/services/assessment/modules/PortabilityAssessor.js +347 -0
  59. package/lib/services/assessment/modules/ProhibitedLibrariesAssessor.d.ts +41 -0
  60. package/lib/services/assessment/modules/ProhibitedLibrariesAssessor.d.ts.map +1 -0
  61. package/lib/services/assessment/modules/ProhibitedLibrariesAssessor.js +256 -0
  62. package/lib/services/assessment/modules/SecurityAssessor.d.ts +176 -0
  63. package/lib/services/assessment/modules/SecurityAssessor.d.ts.map +1 -0
  64. package/lib/services/assessment/modules/SecurityAssessor.js +1333 -0
  65. package/lib/services/assessment/modules/ToolAnnotationAssessor.d.ts +96 -0
  66. package/lib/services/assessment/modules/ToolAnnotationAssessor.d.ts.map +1 -0
  67. package/lib/services/assessment/modules/ToolAnnotationAssessor.js +593 -0
  68. package/lib/services/assessment/modules/UsabilityAssessor.d.ts +21 -0
  69. package/lib/services/assessment/modules/UsabilityAssessor.d.ts.map +1 -0
  70. package/lib/services/assessment/modules/UsabilityAssessor.js +241 -0
  71. package/lib/services/assessment/modules/index.d.ts +33 -0
  72. package/lib/services/assessment/modules/index.d.ts.map +1 -0
  73. package/lib/services/assessment/modules/index.js +35 -0
  74. package/package.json +15 -3
@@ -0,0 +1,418 @@
1
+ /**
2
+ * Assessment Orchestrator
3
+ * Coordinates all assessment modules and manages the assessment workflow
4
+ */
5
+ import { DEFAULT_ASSESSMENT_CONFIG, } from "../../lib/assessmentTypes.js";
6
+ // Core assessment modules
7
+ import { FunctionalityAssessor } from "./modules/FunctionalityAssessor.js";
8
+ import { SecurityAssessor } from "./modules/SecurityAssessor.js";
9
+ import { DocumentationAssessor } from "./modules/DocumentationAssessor.js";
10
+ import { ErrorHandlingAssessor } from "./modules/ErrorHandlingAssessor.js";
11
+ import { UsabilityAssessor } from "./modules/UsabilityAssessor.js";
12
+ // Extended assessment modules
13
+ import { MCPSpecComplianceAssessor } from "./modules/MCPSpecComplianceAssessor.js";
14
+ // New MCP Directory Compliance Gap assessors
15
+ import { AUPComplianceAssessor } from "./modules/AUPComplianceAssessor.js";
16
+ import { ToolAnnotationAssessor } from "./modules/ToolAnnotationAssessor.js";
17
+ import { ProhibitedLibrariesAssessor } from "./modules/ProhibitedLibrariesAssessor.js";
18
+ import { ManifestValidationAssessor } from "./modules/ManifestValidationAssessor.js";
19
+ import { PortabilityAssessor } from "./modules/PortabilityAssessor.js";
20
+ // Claude Code integration for intelligent analysis
21
+ import { ClaudeCodeBridge, FULL_CLAUDE_CODE_CONFIG, } from "./lib/claudeCodeBridge.js";
22
+ import { TestDataGenerator } from "./TestDataGenerator.js";
23
+ export class AssessmentOrchestrator {
24
+ config;
25
+ startTime = 0;
26
+ totalTestsRun = 0;
27
+ // Claude Code Bridge for intelligent analysis
28
+ claudeBridge;
29
+ claudeEnabled = false;
30
+ // Core assessors
31
+ functionalityAssessor;
32
+ securityAssessor;
33
+ documentationAssessor;
34
+ errorHandlingAssessor;
35
+ usabilityAssessor;
36
+ // Extended assessors
37
+ mcpSpecAssessor;
38
+ // New MCP Directory Compliance Gap assessors
39
+ aupComplianceAssessor;
40
+ toolAnnotationAssessor;
41
+ prohibitedLibrariesAssessor;
42
+ manifestValidationAssessor;
43
+ portabilityAssessor;
44
+ constructor(config = {}) {
45
+ this.config = { ...DEFAULT_ASSESSMENT_CONFIG, ...config };
46
+ // Initialize Claude Code Bridge if enabled in config
47
+ if (this.config.claudeCode?.enabled) {
48
+ this.initializeClaudeBridge(this.config.claudeCode);
49
+ }
50
+ // Initialize core assessors
51
+ this.functionalityAssessor = new FunctionalityAssessor(this.config);
52
+ this.securityAssessor = new SecurityAssessor(this.config);
53
+ this.documentationAssessor = new DocumentationAssessor(this.config);
54
+ this.errorHandlingAssessor = new ErrorHandlingAssessor(this.config);
55
+ this.usabilityAssessor = new UsabilityAssessor(this.config);
56
+ // Initialize extended assessors if enabled
57
+ if (this.config.enableExtendedAssessment) {
58
+ if (this.config.assessmentCategories?.mcpSpecCompliance) {
59
+ this.mcpSpecAssessor = new MCPSpecComplianceAssessor(this.config);
60
+ }
61
+ // Initialize new MCP Directory Compliance Gap assessors
62
+ if (this.config.assessmentCategories?.aupCompliance) {
63
+ this.aupComplianceAssessor = new AUPComplianceAssessor(this.config);
64
+ // Wire up Claude bridge for semantic analysis
65
+ if (this.claudeBridge) {
66
+ this.aupComplianceAssessor.setClaudeBridge(this.claudeBridge);
67
+ }
68
+ }
69
+ if (this.config.assessmentCategories?.toolAnnotations) {
70
+ this.toolAnnotationAssessor = new ToolAnnotationAssessor(this.config);
71
+ // Wire up Claude bridge for behavior inference
72
+ if (this.claudeBridge) {
73
+ this.toolAnnotationAssessor.setClaudeBridge(this.claudeBridge);
74
+ }
75
+ }
76
+ if (this.config.assessmentCategories?.prohibitedLibraries) {
77
+ this.prohibitedLibrariesAssessor = new ProhibitedLibrariesAssessor(this.config);
78
+ }
79
+ if (this.config.assessmentCategories?.manifestValidation) {
80
+ this.manifestValidationAssessor = new ManifestValidationAssessor(this.config);
81
+ }
82
+ if (this.config.assessmentCategories?.portability) {
83
+ this.portabilityAssessor = new PortabilityAssessor(this.config);
84
+ }
85
+ }
86
+ // Wire up Claude bridge to TestDataGenerator for intelligent test generation
87
+ if (this.claudeBridge) {
88
+ TestDataGenerator.setClaudeBridge(this.claudeBridge);
89
+ }
90
+ }
91
+ /**
92
+ * Initialize Claude Code Bridge for intelligent analysis
93
+ * This enables semantic AUP violation analysis, behavior inference, and intelligent test generation
94
+ */
95
+ initializeClaudeBridge(bridgeConfig) {
96
+ try {
97
+ this.claudeBridge = new ClaudeCodeBridge(bridgeConfig);
98
+ this.claudeEnabled = true;
99
+ console.log("[AssessmentOrchestrator] Claude Code Bridge initialized with features:", bridgeConfig.features);
100
+ }
101
+ catch (error) {
102
+ console.warn("[AssessmentOrchestrator] Failed to initialize Claude Code Bridge:", error);
103
+ this.claudeEnabled = false;
104
+ }
105
+ }
106
+ /**
107
+ * Enable Claude Code integration programmatically
108
+ * Call this method to enable Claude features after construction
109
+ */
110
+ enableClaudeCode(config) {
111
+ const bridgeConfig = {
112
+ ...FULL_CLAUDE_CODE_CONFIG,
113
+ ...config,
114
+ enabled: true,
115
+ };
116
+ this.initializeClaudeBridge(bridgeConfig);
117
+ // Wire up to existing assessors
118
+ if (this.claudeBridge) {
119
+ if (this.aupComplianceAssessor) {
120
+ this.aupComplianceAssessor.setClaudeBridge(this.claudeBridge);
121
+ }
122
+ if (this.toolAnnotationAssessor) {
123
+ this.toolAnnotationAssessor.setClaudeBridge(this.claudeBridge);
124
+ }
125
+ TestDataGenerator.setClaudeBridge(this.claudeBridge);
126
+ }
127
+ }
128
+ /**
129
+ * Check if Claude Code integration is enabled and available
130
+ */
131
+ isClaudeEnabled() {
132
+ return this.claudeEnabled && this.claudeBridge !== undefined;
133
+ }
134
+ /**
135
+ * Get Claude Code Bridge for external access
136
+ */
137
+ getClaudeBridge() {
138
+ return this.claudeBridge;
139
+ }
140
+ /**
141
+ * Reset test counts for all assessors
142
+ */
143
+ resetAllTestCounts() {
144
+ this.functionalityAssessor.resetTestCount();
145
+ this.securityAssessor.resetTestCount();
146
+ this.documentationAssessor.resetTestCount();
147
+ this.errorHandlingAssessor.resetTestCount();
148
+ this.usabilityAssessor.resetTestCount();
149
+ if (this.mcpSpecAssessor) {
150
+ this.mcpSpecAssessor.resetTestCount();
151
+ }
152
+ // Reset new assessors
153
+ if (this.aupComplianceAssessor) {
154
+ this.aupComplianceAssessor.resetTestCount();
155
+ }
156
+ if (this.toolAnnotationAssessor) {
157
+ this.toolAnnotationAssessor.resetTestCount();
158
+ }
159
+ if (this.prohibitedLibrariesAssessor) {
160
+ this.prohibitedLibrariesAssessor.resetTestCount();
161
+ }
162
+ if (this.manifestValidationAssessor) {
163
+ this.manifestValidationAssessor.resetTestCount();
164
+ }
165
+ if (this.portabilityAssessor) {
166
+ this.portabilityAssessor.resetTestCount();
167
+ }
168
+ }
169
+ /**
170
+ * Run a complete assessment on an MCP server
171
+ */
172
+ async runFullAssessment(context) {
173
+ this.startTime = Date.now();
174
+ this.totalTestsRun = 0;
175
+ this.resetAllTestCounts();
176
+ // Run assessments in parallel if enabled
177
+ const assessmentPromises = [];
178
+ const assessmentResults = {};
179
+ if (this.config.parallelTesting) {
180
+ // Core assessments
181
+ assessmentPromises.push(this.functionalityAssessor
182
+ .assess(context)
183
+ .then((r) => (assessmentResults.functionality = r)), this.securityAssessor
184
+ .assess(context)
185
+ .then((r) => (assessmentResults.security = r)), this.documentationAssessor
186
+ .assess(context)
187
+ .then((r) => (assessmentResults.documentation = r)), this.errorHandlingAssessor
188
+ .assess(context)
189
+ .then((r) => (assessmentResults.errorHandling = r)), this.usabilityAssessor
190
+ .assess(context)
191
+ .then((r) => (assessmentResults.usability = r)));
192
+ // Extended assessments
193
+ if (this.mcpSpecAssessor) {
194
+ assessmentPromises.push(this.mcpSpecAssessor
195
+ .assess(context)
196
+ .then((r) => (assessmentResults.mcpSpecCompliance = r)));
197
+ }
198
+ // New MCP Directory Compliance Gap assessments
199
+ if (this.aupComplianceAssessor) {
200
+ assessmentPromises.push(this.aupComplianceAssessor
201
+ .assess(context)
202
+ .then((r) => (assessmentResults.aupCompliance = r)));
203
+ }
204
+ if (this.toolAnnotationAssessor) {
205
+ assessmentPromises.push(this.toolAnnotationAssessor
206
+ .assess(context)
207
+ .then((r) => (assessmentResults.toolAnnotations = r)));
208
+ }
209
+ if (this.prohibitedLibrariesAssessor) {
210
+ assessmentPromises.push(this.prohibitedLibrariesAssessor
211
+ .assess(context)
212
+ .then((r) => (assessmentResults.prohibitedLibraries = r)));
213
+ }
214
+ if (this.manifestValidationAssessor) {
215
+ assessmentPromises.push(this.manifestValidationAssessor
216
+ .assess(context)
217
+ .then((r) => (assessmentResults.manifestValidation = r)));
218
+ }
219
+ if (this.portabilityAssessor) {
220
+ assessmentPromises.push(this.portabilityAssessor
221
+ .assess(context)
222
+ .then((r) => (assessmentResults.portability = r)));
223
+ }
224
+ await Promise.all(assessmentPromises);
225
+ }
226
+ else {
227
+ // Sequential execution
228
+ assessmentResults.functionality =
229
+ await this.functionalityAssessor.assess(context);
230
+ assessmentResults.security = await this.securityAssessor.assess(context);
231
+ assessmentResults.documentation =
232
+ await this.documentationAssessor.assess(context);
233
+ assessmentResults.errorHandling =
234
+ await this.errorHandlingAssessor.assess(context);
235
+ assessmentResults.usability =
236
+ await this.usabilityAssessor.assess(context);
237
+ if (this.mcpSpecAssessor) {
238
+ assessmentResults.mcpSpecCompliance =
239
+ await this.mcpSpecAssessor.assess(context);
240
+ }
241
+ // New MCP Directory Compliance Gap assessments (sequential)
242
+ if (this.aupComplianceAssessor) {
243
+ assessmentResults.aupCompliance =
244
+ await this.aupComplianceAssessor.assess(context);
245
+ }
246
+ if (this.toolAnnotationAssessor) {
247
+ assessmentResults.toolAnnotations =
248
+ await this.toolAnnotationAssessor.assess(context);
249
+ }
250
+ if (this.prohibitedLibrariesAssessor) {
251
+ assessmentResults.prohibitedLibraries =
252
+ await this.prohibitedLibrariesAssessor.assess(context);
253
+ }
254
+ if (this.manifestValidationAssessor) {
255
+ assessmentResults.manifestValidation =
256
+ await this.manifestValidationAssessor.assess(context);
257
+ }
258
+ if (this.portabilityAssessor) {
259
+ assessmentResults.portability =
260
+ await this.portabilityAssessor.assess(context);
261
+ }
262
+ }
263
+ // Collect test counts from all assessors
264
+ this.totalTestsRun = this.collectTotalTestCount();
265
+ // Determine overall status
266
+ const overallStatus = this.determineOverallStatus(assessmentResults);
267
+ // Generate summary and recommendations
268
+ const summary = this.generateSummary(assessmentResults);
269
+ const recommendations = this.generateRecommendations(assessmentResults);
270
+ const executionTime = Date.now() - this.startTime;
271
+ return {
272
+ serverName: context.serverName,
273
+ assessmentDate: new Date().toISOString(),
274
+ assessorVersion: "2.0.0",
275
+ ...assessmentResults,
276
+ overallStatus,
277
+ summary,
278
+ recommendations,
279
+ executionTime,
280
+ totalTestsRun: this.totalTestsRun,
281
+ mcpProtocolVersion: this.config.mcpProtocolVersion,
282
+ };
283
+ }
284
+ /**
285
+ * Legacy assess method for backward compatibility
286
+ */
287
+ async assess(serverName, tools, callTool, serverInfo, readmeContent, packageJson) {
288
+ const context = {
289
+ serverName,
290
+ tools,
291
+ callTool,
292
+ readmeContent,
293
+ packageJson,
294
+ serverInfo,
295
+ config: this.config,
296
+ };
297
+ return this.runFullAssessment(context);
298
+ }
299
+ collectTotalTestCount() {
300
+ let total = 0;
301
+ // Get actual test counts from assessors
302
+ const functionalityCount = this.functionalityAssessor.getTestCount();
303
+ const securityCount = this.securityAssessor.getTestCount();
304
+ const documentationCount = this.documentationAssessor.getTestCount();
305
+ const errorHandlingCount = this.errorHandlingAssessor.getTestCount();
306
+ const usabilityCount = this.usabilityAssessor.getTestCount();
307
+ const mcpSpecCount = this.mcpSpecAssessor?.getTestCount() || 0;
308
+ // New assessor counts
309
+ const aupCount = this.aupComplianceAssessor?.getTestCount() || 0;
310
+ const annotationCount = this.toolAnnotationAssessor?.getTestCount() || 0;
311
+ const librariesCount = this.prohibitedLibrariesAssessor?.getTestCount() || 0;
312
+ const manifestCount = this.manifestValidationAssessor?.getTestCount() || 0;
313
+ const portabilityCount = this.portabilityAssessor?.getTestCount() || 0;
314
+ console.log("[AssessmentOrchestrator] Test counts by assessor:", {
315
+ functionality: functionalityCount,
316
+ security: securityCount,
317
+ documentation: documentationCount,
318
+ errorHandling: errorHandlingCount,
319
+ usability: usabilityCount,
320
+ mcpSpec: mcpSpecCount,
321
+ aupCompliance: aupCount,
322
+ toolAnnotations: annotationCount,
323
+ prohibitedLibraries: librariesCount,
324
+ manifestValidation: manifestCount,
325
+ portability: portabilityCount,
326
+ });
327
+ total =
328
+ functionalityCount +
329
+ securityCount +
330
+ documentationCount +
331
+ errorHandlingCount +
332
+ usabilityCount +
333
+ mcpSpecCount +
334
+ aupCount +
335
+ annotationCount +
336
+ librariesCount +
337
+ manifestCount +
338
+ portabilityCount;
339
+ console.log("[AssessmentOrchestrator] Total test count:", total);
340
+ return total;
341
+ }
342
+ determineOverallStatus(results) {
343
+ const statuses = [];
344
+ // Collect all statuses
345
+ Object.values(results).forEach((assessment) => {
346
+ if (assessment?.status) {
347
+ statuses.push(assessment.status);
348
+ }
349
+ });
350
+ // If any critical category fails, overall fails
351
+ if (statuses.includes("FAIL"))
352
+ return "FAIL";
353
+ // If any category needs more info, overall needs more info
354
+ if (statuses.includes("NEED_MORE_INFO"))
355
+ return "NEED_MORE_INFO";
356
+ // All must pass for overall pass
357
+ return "PASS";
358
+ }
359
+ generateSummary(results) {
360
+ const parts = [];
361
+ const totalCategories = Object.keys(results).length;
362
+ const passedCategories = Object.values(results).filter((r) => r?.status === "PASS").length;
363
+ parts.push(`Assessment complete: ${passedCategories}/${totalCategories} categories passed.`);
364
+ // Add key findings
365
+ if (results.security?.vulnerabilities?.length > 0) {
366
+ parts.push(`Found ${results.security.vulnerabilities.length} security vulnerabilities.`);
367
+ }
368
+ if (results.functionality?.brokenTools?.length > 0) {
369
+ parts.push(`${results.functionality.brokenTools.length} tools are not functioning correctly.`);
370
+ }
371
+ // New assessor findings
372
+ if (results.aupCompliance?.violations?.length > 0) {
373
+ const criticalCount = results.aupCompliance.violations.filter((v) => v.severity === "CRITICAL").length;
374
+ if (criticalCount > 0) {
375
+ parts.push(`CRITICAL: ${criticalCount} AUP violation(s) detected.`);
376
+ }
377
+ else {
378
+ parts.push(`${results.aupCompliance.violations.length} AUP item(s) flagged for review.`);
379
+ }
380
+ }
381
+ if (results.toolAnnotations?.missingAnnotationsCount > 0) {
382
+ parts.push(`${results.toolAnnotations.missingAnnotationsCount} tools missing annotations.`);
383
+ }
384
+ if (results.prohibitedLibraries?.matches?.length > 0) {
385
+ const blockingCount = results.prohibitedLibraries.matches.filter((m) => m.severity === "BLOCKING").length;
386
+ if (blockingCount > 0) {
387
+ parts.push(`BLOCKING: ${blockingCount} prohibited library/libraries detected.`);
388
+ }
389
+ }
390
+ if (results.portability?.usesBundleRoot) {
391
+ parts.push("Uses ${BUNDLE_ROOT} anti-pattern.");
392
+ }
393
+ return parts.join(" ");
394
+ }
395
+ generateRecommendations(results) {
396
+ const recommendations = [];
397
+ // Aggregate recommendations from all assessments
398
+ Object.values(results).forEach((assessment) => {
399
+ if (assessment?.recommendations) {
400
+ recommendations.push(...assessment.recommendations);
401
+ }
402
+ });
403
+ // De-duplicate and prioritize
404
+ return [...new Set(recommendations)].slice(0, 10);
405
+ }
406
+ /**
407
+ * Get assessment configuration
408
+ */
409
+ getConfig() {
410
+ return this.config;
411
+ }
412
+ /**
413
+ * Update assessment configuration
414
+ */
415
+ updateConfig(config) {
416
+ this.config = { ...this.config, ...config };
417
+ }
418
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Response Validator for MCP Tool Testing
3
+ * Validates that tool responses are actually functional, not just present
4
+ */
5
+ import { CompatibilityCallToolResult, Tool } from "@modelcontextprotocol/sdk/types.js";
6
+ export interface ValidationResult {
7
+ isValid: boolean;
8
+ isError: boolean;
9
+ confidence: number;
10
+ issues: string[];
11
+ evidence: string[];
12
+ classification: "fully_working" | "partially_working" | "connectivity_only" | "broken" | "error";
13
+ }
14
+ export interface ValidationContext {
15
+ tool: Tool;
16
+ input: Record<string, unknown>;
17
+ response: CompatibilityCallToolResult;
18
+ scenarioCategory?: "happy_path" | "edge_case" | "boundary" | "error_case";
19
+ }
20
+ export declare class ResponseValidator {
21
+ /**
22
+ * Validate a tool response comprehensively
23
+ */
24
+ static validateResponse(context: ValidationContext): ValidationResult;
25
+ /**
26
+ * Check if error is a business logic error (not a tool failure)
27
+ * These errors indicate the tool is working correctly but rejecting invalid business data
28
+ */
29
+ static isBusinessLogicError(context: ValidationContext): boolean;
30
+ /**
31
+ * Validate error responses are proper and informative
32
+ * NOTE: Currently unused - kept for potential future use
33
+ */
34
+ private static validateErrorResponse;
35
+ /**
36
+ * Validate response structure matches expectations
37
+ * NOTE: Currently unused - kept for potential future use
38
+ */
39
+ private static validateResponseStructure;
40
+ /**
41
+ * Validate response content is meaningful
42
+ * NOTE: Currently unused - kept for potential future use
43
+ */
44
+ private static validateResponseContent;
45
+ /**
46
+ * Validate semantic correctness based on input/output relationship
47
+ * NOTE: Currently unused - kept for potential future use
48
+ */
49
+ private static validateSemanticCorrectness;
50
+ /**
51
+ * Validate tool-specific logic and patterns
52
+ * NOTE: Currently unused - kept for potential future use
53
+ */
54
+ private static validateToolSpecificLogic;
55
+ /**
56
+ * Find query-like parameter in input
57
+ */
58
+ private static findQueryParameter;
59
+ /**
60
+ * Validate structured output against outputSchema (MCP 2025-06-18 feature)
61
+ * NOTE: Currently unused - kept for potential future use
62
+ */
63
+ private static validateStructuredOutput;
64
+ /**
65
+ * Calculate confidence score for a set of validation results
66
+ */
67
+ static calculateOverallConfidence(results: ValidationResult[]): number;
68
+ }
69
+ //# sourceMappingURL=ResponseValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseValidator.d.ts","sourceRoot":"","sources":["../../../src/services/assessment/ResponseValidator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,2BAA2B,EAC3B,IAAI,EACL,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EACV,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,QAAQ,GACR,OAAO,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,2BAA2B,CAAC;IACtC,gBAAgB,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;CAC3E;AAED,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB;IA2ErE;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO;IAmShE;;;OAGG;IAEH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IA0CpC;;;OAGG;IAEH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAoCxC;;;OAGG;IAEH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAsMtC;;;OAGG;IAEH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IA6S1C;;;OAGG;IAEH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAwSxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IA4BjC;;;OAGG;IAEH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAkDvC;;OAEG;IACH,MAAM,CAAC,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM;CAsBvE"}