@bryan-thompson/inspector-assessment-client 1.22.14 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{OAuthCallback-DDbR9we4.js → OAuthCallback-BT-Si9Gp.js} +1 -1
- package/dist/assets/{OAuthDebugCallback-Bel6ibpN.js → OAuthDebugCallback-Ds58vrvK.js} +1 -1
- package/dist/assets/{index-DiyPO_Zj.css → index-Df9Sx1jt.css} +0 -548
- package/dist/assets/{index-B55OPPJA.js → index-DkE5fYd3.js} +210 -10742
- package/dist/index.html +2 -2
- package/lib/lib/assessment/configTypes.d.ts +75 -0
- package/lib/lib/assessment/configTypes.d.ts.map +1 -0
- package/lib/lib/assessment/configTypes.js +201 -0
- package/lib/lib/assessment/constants.d.ts +10 -0
- package/lib/lib/assessment/constants.d.ts.map +1 -0
- package/lib/lib/assessment/constants.js +61 -0
- package/lib/lib/assessment/coreTypes.d.ts +159 -0
- package/lib/lib/assessment/coreTypes.d.ts.map +1 -0
- package/lib/lib/assessment/coreTypes.js +101 -0
- package/lib/lib/assessment/extendedTypes.d.ts +415 -0
- package/lib/lib/assessment/extendedTypes.d.ts.map +1 -0
- package/lib/lib/assessment/extendedTypes.js +9 -0
- package/lib/lib/assessment/index.d.ts +23 -0
- package/lib/lib/assessment/index.d.ts.map +1 -0
- package/lib/lib/assessment/index.js +48 -0
- package/lib/lib/assessment/progressTypes.d.ts +160 -0
- package/lib/lib/assessment/progressTypes.d.ts.map +1 -0
- package/lib/lib/assessment/progressTypes.js +9 -0
- package/lib/lib/assessment/resultTypes.d.ts +568 -0
- package/lib/lib/assessment/resultTypes.d.ts.map +1 -0
- package/lib/lib/assessment/resultTypes.js +9 -0
- package/lib/lib/assessmentTypes.d.ts +18 -1342
- package/lib/lib/assessmentTypes.d.ts.map +1 -1
- package/lib/lib/assessmentTypes.js +19 -341
- package/lib/services/assessment/AssessmentOrchestrator.d.ts +5 -0
- package/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -1
- package/lib/services/assessment/AssessmentOrchestrator.js +24 -6
- package/lib/services/assessment/lib/concurrencyLimit.d.ts +12 -0
- package/lib/services/assessment/lib/concurrencyLimit.d.ts.map +1 -1
- package/lib/services/assessment/lib/concurrencyLimit.js +22 -0
- package/lib/services/assessment/lib/logger.d.ts +98 -0
- package/lib/services/assessment/lib/logger.d.ts.map +1 -0
- package/lib/services/assessment/lib/logger.js +153 -0
- package/lib/services/assessment/modules/BaseAssessor.d.ts +7 -3
- package/lib/services/assessment/modules/BaseAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/BaseAssessor.js +8 -2
- package/lib/services/assessment/modules/SecurityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/SecurityAssessor.js +9 -4
- package/package.json +1 -1
package/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/mcp.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>MCP Inspector</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DkE5fYd3.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Df9Sx1jt.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root" class="w-full"></div>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assessment Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Configuration interfaces and preset configurations for assessments.
|
|
5
|
+
*
|
|
6
|
+
* @module assessment/configTypes
|
|
7
|
+
*/
|
|
8
|
+
import { LoggingConfig, LogLevel, DEFAULT_LOGGING_CONFIG } from "../../services/assessment/lib/logger.js";
|
|
9
|
+
export type { LoggingConfig, LogLevel };
|
|
10
|
+
export { DEFAULT_LOGGING_CONFIG };
|
|
11
|
+
/**
|
|
12
|
+
* Claude Code Bridge Configuration
|
|
13
|
+
* Enables integration with Claude Code CLI for intelligent analysis
|
|
14
|
+
*/
|
|
15
|
+
export interface ClaudeCodeConfig {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
features: {
|
|
18
|
+
intelligentTestGeneration: boolean;
|
|
19
|
+
aupSemanticAnalysis: boolean;
|
|
20
|
+
annotationInference: boolean;
|
|
21
|
+
documentationQuality: boolean;
|
|
22
|
+
};
|
|
23
|
+
timeout: number;
|
|
24
|
+
workingDir?: string;
|
|
25
|
+
maxRetries?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface AssessmentConfiguration {
|
|
28
|
+
testTimeout: number;
|
|
29
|
+
/** Security-specific test timeout in ms (default: 5000). Lower than testTimeout for fast payload testing. */
|
|
30
|
+
securityTestTimeout?: number;
|
|
31
|
+
delayBetweenTests?: number;
|
|
32
|
+
skipBrokenTools: boolean;
|
|
33
|
+
reviewerMode?: boolean;
|
|
34
|
+
enableExtendedAssessment?: boolean;
|
|
35
|
+
documentationVerbosity?: "minimal" | "standard" | "verbose";
|
|
36
|
+
parallelTesting?: boolean;
|
|
37
|
+
maxParallelTests?: number;
|
|
38
|
+
scenariosPerTool?: number;
|
|
39
|
+
maxToolsToTestForErrors?: number;
|
|
40
|
+
selectedToolsForTesting?: string[];
|
|
41
|
+
securityPatternsToTest?: number;
|
|
42
|
+
enableDomainTesting?: boolean;
|
|
43
|
+
mcpProtocolVersion?: string;
|
|
44
|
+
enableSourceCodeAnalysis?: boolean;
|
|
45
|
+
patternConfigPath?: string;
|
|
46
|
+
claudeCode?: ClaudeCodeConfig;
|
|
47
|
+
temporalInvocations?: number;
|
|
48
|
+
/** Logging configuration for diagnostic output */
|
|
49
|
+
logging?: LoggingConfig;
|
|
50
|
+
assessmentCategories?: {
|
|
51
|
+
functionality: boolean;
|
|
52
|
+
security: boolean;
|
|
53
|
+
documentation: boolean;
|
|
54
|
+
errorHandling: boolean;
|
|
55
|
+
usability: boolean;
|
|
56
|
+
mcpSpecCompliance?: boolean;
|
|
57
|
+
aupCompliance?: boolean;
|
|
58
|
+
toolAnnotations?: boolean;
|
|
59
|
+
prohibitedLibraries?: boolean;
|
|
60
|
+
manifestValidation?: boolean;
|
|
61
|
+
portability?: boolean;
|
|
62
|
+
externalAPIScanner?: boolean;
|
|
63
|
+
authentication?: boolean;
|
|
64
|
+
temporal?: boolean;
|
|
65
|
+
resources?: boolean;
|
|
66
|
+
prompts?: boolean;
|
|
67
|
+
crossCapability?: boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export declare const DEFAULT_ASSESSMENT_CONFIG: AssessmentConfiguration;
|
|
71
|
+
export declare const REVIEWER_MODE_CONFIG: AssessmentConfiguration;
|
|
72
|
+
export declare const DEVELOPER_MODE_CONFIG: AssessmentConfiguration;
|
|
73
|
+
export declare const AUDIT_MODE_CONFIG: AssessmentConfiguration;
|
|
74
|
+
export declare const CLAUDE_ENHANCED_AUDIT_CONFIG: AssessmentConfiguration;
|
|
75
|
+
//# sourceMappingURL=configTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/assessment/configTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,QAAQ,EACR,sBAAsB,EACvB,MAAM,kCAAkC,CAAC;AAG1C,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QACR,yBAAyB,EAAE,OAAO,CAAC;QACnC,mBAAmB,EAAE,OAAO,CAAC;QAC7B,mBAAmB,EAAE,OAAO,CAAC;QAC7B,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IAEzB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,sBAAsB,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAI5D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kDAAkD;IAClD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,oBAAoB,CAAC,EAAE;QACrB,aAAa,EAAE,OAAO,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC;QAClB,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;QACvB,SAAS,EAAE,OAAO,CAAC;QACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAE5B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAMD,eAAO,MAAM,yBAAyB,EAAE,uBAiCvC,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,uBAkClC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,uBAiCnC,CAAC;AAIF,eAAO,MAAM,iBAAiB,EAAE,uBAiC/B,CAAC;AAIF,eAAO,MAAM,4BAA4B,EAAE,uBA4C1C,CAAC"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assessment Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Configuration interfaces and preset configurations for assessments.
|
|
5
|
+
*
|
|
6
|
+
* @module assessment/configTypes
|
|
7
|
+
*/
|
|
8
|
+
import { DEFAULT_LOGGING_CONFIG, } from "../../services/assessment/lib/logger.js";
|
|
9
|
+
export { DEFAULT_LOGGING_CONFIG };
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Configuration Presets
|
|
12
|
+
// ============================================================================
|
|
13
|
+
export const DEFAULT_ASSESSMENT_CONFIG = {
|
|
14
|
+
testTimeout: 30000, // 30 seconds per tool
|
|
15
|
+
delayBetweenTests: 0, // No delay by default
|
|
16
|
+
skipBrokenTools: false,
|
|
17
|
+
reviewerMode: false,
|
|
18
|
+
enableExtendedAssessment: true, // Enable MCP Spec Compliance assessment by default
|
|
19
|
+
parallelTesting: false,
|
|
20
|
+
maxParallelTests: 5,
|
|
21
|
+
securityPatternsToTest: 8, // Test all security patterns by default
|
|
22
|
+
enableDomainTesting: true, // Enable advanced security testing by default (all 8 backend patterns)
|
|
23
|
+
mcpProtocolVersion: "2025-06",
|
|
24
|
+
enableSourceCodeAnalysis: false, // Source code analysis disabled by default (requires sourceCodePath)
|
|
25
|
+
logging: { level: "info" }, // Standard verbosity
|
|
26
|
+
assessmentCategories: {
|
|
27
|
+
functionality: true,
|
|
28
|
+
security: true,
|
|
29
|
+
documentation: true,
|
|
30
|
+
errorHandling: true,
|
|
31
|
+
usability: true,
|
|
32
|
+
mcpSpecCompliance: false,
|
|
33
|
+
// New assessors - disabled by default, enable for MCP Directory compliance audits
|
|
34
|
+
aupCompliance: false,
|
|
35
|
+
toolAnnotations: false,
|
|
36
|
+
prohibitedLibraries: false,
|
|
37
|
+
manifestValidation: false,
|
|
38
|
+
portability: false,
|
|
39
|
+
externalAPIScanner: false,
|
|
40
|
+
authentication: false,
|
|
41
|
+
// New capability assessors - disabled by default
|
|
42
|
+
resources: false,
|
|
43
|
+
prompts: false,
|
|
44
|
+
crossCapability: false,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
// Reviewer mode configuration: optimized for fast, human-assisted reviews
|
|
48
|
+
// Focuses on Anthropic's 5 core requirements only
|
|
49
|
+
export const REVIEWER_MODE_CONFIG = {
|
|
50
|
+
testTimeout: 10000, // 10 seconds per tool (faster)
|
|
51
|
+
delayBetweenTests: 100, // Small delay for rate limiting
|
|
52
|
+
skipBrokenTools: true, // Skip broken tools to save time
|
|
53
|
+
reviewerMode: true,
|
|
54
|
+
enableExtendedAssessment: false, // Disable extended assessments (not required for directory approval)
|
|
55
|
+
parallelTesting: true, // Faster execution
|
|
56
|
+
maxParallelTests: 5,
|
|
57
|
+
scenariosPerTool: 1, // Single realistic test per tool
|
|
58
|
+
securityPatternsToTest: 3, // Test only 3 critical security patterns
|
|
59
|
+
enableDomainTesting: false, // Use basic security testing for speed (3 patterns)
|
|
60
|
+
mcpProtocolVersion: "2025-06",
|
|
61
|
+
enableSourceCodeAnalysis: false,
|
|
62
|
+
logging: { level: "warn" }, // Minimal noise for fast reviews
|
|
63
|
+
assessmentCategories: {
|
|
64
|
+
functionality: true,
|
|
65
|
+
security: true,
|
|
66
|
+
documentation: true,
|
|
67
|
+
errorHandling: true,
|
|
68
|
+
usability: true,
|
|
69
|
+
mcpSpecCompliance: false, // Not part of Anthropic's 5 core requirements
|
|
70
|
+
// New assessors - disabled in reviewer mode for speed
|
|
71
|
+
aupCompliance: false,
|
|
72
|
+
toolAnnotations: false,
|
|
73
|
+
prohibitedLibraries: false,
|
|
74
|
+
manifestValidation: false,
|
|
75
|
+
portability: false,
|
|
76
|
+
externalAPIScanner: false,
|
|
77
|
+
authentication: false,
|
|
78
|
+
// New capability assessors - disabled in reviewer mode for speed
|
|
79
|
+
resources: false,
|
|
80
|
+
prompts: false,
|
|
81
|
+
crossCapability: false,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
// Developer mode configuration: comprehensive testing for debugging
|
|
85
|
+
export const DEVELOPER_MODE_CONFIG = {
|
|
86
|
+
testTimeout: 30000, // 30 seconds per tool
|
|
87
|
+
delayBetweenTests: 500, // Moderate delay for thorough testing
|
|
88
|
+
skipBrokenTools: false,
|
|
89
|
+
reviewerMode: false,
|
|
90
|
+
enableExtendedAssessment: true,
|
|
91
|
+
parallelTesting: false, // Sequential for easier debugging
|
|
92
|
+
maxParallelTests: 5,
|
|
93
|
+
securityPatternsToTest: 8, // Test all security patterns
|
|
94
|
+
enableDomainTesting: true, // Enable advanced security testing (all 8 backend patterns)
|
|
95
|
+
mcpProtocolVersion: "2025-06",
|
|
96
|
+
enableSourceCodeAnalysis: true, // Enable source code analysis if path provided
|
|
97
|
+
logging: { level: "debug" }, // Full diagnostic output for debugging
|
|
98
|
+
assessmentCategories: {
|
|
99
|
+
functionality: true,
|
|
100
|
+
security: true,
|
|
101
|
+
documentation: true,
|
|
102
|
+
errorHandling: true,
|
|
103
|
+
usability: true,
|
|
104
|
+
mcpSpecCompliance: true, // Include extended assessments
|
|
105
|
+
// New assessors - enabled in developer mode for comprehensive testing
|
|
106
|
+
aupCompliance: true,
|
|
107
|
+
toolAnnotations: true,
|
|
108
|
+
prohibitedLibraries: true,
|
|
109
|
+
manifestValidation: false, // MCPB bundle-specific, disabled by default
|
|
110
|
+
portability: false, // MCPB bundle-specific, disabled by default
|
|
111
|
+
externalAPIScanner: true,
|
|
112
|
+
authentication: true,
|
|
113
|
+
// New capability assessors - enabled in developer mode
|
|
114
|
+
resources: true,
|
|
115
|
+
prompts: true,
|
|
116
|
+
crossCapability: true,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
// MCP Directory Audit mode: focuses on compliance gap assessors
|
|
120
|
+
// Use for pre-submission validation to Anthropic MCP Directory
|
|
121
|
+
export const AUDIT_MODE_CONFIG = {
|
|
122
|
+
testTimeout: 30000,
|
|
123
|
+
delayBetweenTests: 100,
|
|
124
|
+
skipBrokenTools: false,
|
|
125
|
+
reviewerMode: false,
|
|
126
|
+
enableExtendedAssessment: true,
|
|
127
|
+
parallelTesting: true, // Parallel for faster audits
|
|
128
|
+
maxParallelTests: 5,
|
|
129
|
+
securityPatternsToTest: 8,
|
|
130
|
+
enableDomainTesting: true,
|
|
131
|
+
mcpProtocolVersion: "2025-06",
|
|
132
|
+
enableSourceCodeAnalysis: true, // Deep analysis for audits
|
|
133
|
+
logging: { level: "info" }, // Standard verbosity for audits
|
|
134
|
+
assessmentCategories: {
|
|
135
|
+
functionality: true,
|
|
136
|
+
security: true,
|
|
137
|
+
documentation: true,
|
|
138
|
+
errorHandling: true,
|
|
139
|
+
usability: true,
|
|
140
|
+
mcpSpecCompliance: true,
|
|
141
|
+
// All new assessors enabled for audit mode
|
|
142
|
+
aupCompliance: true,
|
|
143
|
+
toolAnnotations: true,
|
|
144
|
+
prohibitedLibraries: true,
|
|
145
|
+
manifestValidation: false, // MCPB bundle-specific, disabled by default
|
|
146
|
+
portability: false, // MCPB bundle-specific, disabled by default
|
|
147
|
+
externalAPIScanner: true,
|
|
148
|
+
authentication: true,
|
|
149
|
+
// New capability assessors - enabled in audit mode
|
|
150
|
+
resources: true,
|
|
151
|
+
prompts: true,
|
|
152
|
+
crossCapability: true,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
// Claude-enhanced audit mode: uses Claude Code for intelligent analysis
|
|
156
|
+
// Reduces false positives in AUP scanning and improves test quality
|
|
157
|
+
export const CLAUDE_ENHANCED_AUDIT_CONFIG = {
|
|
158
|
+
testTimeout: 30000,
|
|
159
|
+
delayBetweenTests: 100,
|
|
160
|
+
skipBrokenTools: false,
|
|
161
|
+
reviewerMode: false,
|
|
162
|
+
enableExtendedAssessment: true,
|
|
163
|
+
parallelTesting: false, // Sequential when using Claude to avoid rate limiting
|
|
164
|
+
maxParallelTests: 1,
|
|
165
|
+
securityPatternsToTest: 8,
|
|
166
|
+
enableDomainTesting: true,
|
|
167
|
+
mcpProtocolVersion: "2025-06",
|
|
168
|
+
enableSourceCodeAnalysis: true,
|
|
169
|
+
logging: { level: "info" }, // Standard verbosity (Claude output is already verbose)
|
|
170
|
+
// Claude Code integration enabled
|
|
171
|
+
claudeCode: {
|
|
172
|
+
enabled: true,
|
|
173
|
+
features: {
|
|
174
|
+
intelligentTestGeneration: true, // Generate semantically meaningful test params
|
|
175
|
+
aupSemanticAnalysis: true, // Reduce false positives in AUP scanning
|
|
176
|
+
annotationInference: true, // Detect annotation misalignments
|
|
177
|
+
documentationQuality: true, // Assess documentation quality semantically
|
|
178
|
+
},
|
|
179
|
+
timeout: 90000, // 90 seconds for Claude calls
|
|
180
|
+
maxRetries: 2,
|
|
181
|
+
},
|
|
182
|
+
assessmentCategories: {
|
|
183
|
+
functionality: true,
|
|
184
|
+
security: true,
|
|
185
|
+
documentation: true,
|
|
186
|
+
errorHandling: true,
|
|
187
|
+
usability: true,
|
|
188
|
+
mcpSpecCompliance: true,
|
|
189
|
+
aupCompliance: true,
|
|
190
|
+
toolAnnotations: true,
|
|
191
|
+
prohibitedLibraries: true,
|
|
192
|
+
manifestValidation: false, // MCPB bundle-specific, disabled by default
|
|
193
|
+
portability: false, // MCPB bundle-specific, disabled by default
|
|
194
|
+
externalAPIScanner: true,
|
|
195
|
+
authentication: true,
|
|
196
|
+
// New capability assessors - enabled in Claude mode
|
|
197
|
+
resources: true,
|
|
198
|
+
prompts: true,
|
|
199
|
+
crossCapability: true,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assessment Constants
|
|
3
|
+
*
|
|
4
|
+
* Constant values used in security testing.
|
|
5
|
+
*
|
|
6
|
+
* @module assessment/constants
|
|
7
|
+
*/
|
|
8
|
+
import type { SecurityTestResult } from "./resultTypes.js";
|
|
9
|
+
export declare const PROMPT_INJECTION_TESTS: Omit<SecurityTestResult, "vulnerable" | "evidence">[];
|
|
10
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/assessment/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,eAAO,MAAM,sBAAsB,EAAE,IAAI,CACvC,kBAAkB,EAClB,YAAY,GAAG,UAAU,CAC1B,EAqDA,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assessment Constants
|
|
3
|
+
*
|
|
4
|
+
* Constant values used in security testing.
|
|
5
|
+
*
|
|
6
|
+
* @module assessment/constants
|
|
7
|
+
*/
|
|
8
|
+
// Backend API security patterns (8 total) - tests API security, not LLM behaviors
|
|
9
|
+
export const PROMPT_INJECTION_TESTS = [
|
|
10
|
+
// Critical Injection (3)
|
|
11
|
+
{
|
|
12
|
+
testName: "Command Injection",
|
|
13
|
+
description: "Test if tool executes system commands",
|
|
14
|
+
payload: "; rm -rf /; echo 'test'",
|
|
15
|
+
riskLevel: "HIGH",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
testName: "SQL Injection",
|
|
19
|
+
description: "Test if tool properly escapes SQL commands",
|
|
20
|
+
payload: "'; DROP TABLE users;--",
|
|
21
|
+
riskLevel: "HIGH",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
testName: "Path Traversal",
|
|
25
|
+
description: "Test if tool allows access to files outside intended directory",
|
|
26
|
+
payload: "../../../etc/passwd",
|
|
27
|
+
riskLevel: "HIGH",
|
|
28
|
+
},
|
|
29
|
+
// Input Validation (3)
|
|
30
|
+
{
|
|
31
|
+
testName: "Type Safety",
|
|
32
|
+
description: "Test if tool validates parameter types correctly",
|
|
33
|
+
payload: "not_a_number",
|
|
34
|
+
riskLevel: "MEDIUM",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
testName: "Boundary Testing",
|
|
38
|
+
description: "Test edge cases and boundary conditions",
|
|
39
|
+
payload: "",
|
|
40
|
+
riskLevel: "LOW",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
testName: "Required Fields",
|
|
44
|
+
description: "Test if tool validates required parameters",
|
|
45
|
+
payload: "MISSING_REQUIRED",
|
|
46
|
+
riskLevel: "MEDIUM",
|
|
47
|
+
},
|
|
48
|
+
// Protocol Compliance (2)
|
|
49
|
+
{
|
|
50
|
+
testName: "MCP Error Format",
|
|
51
|
+
description: "Verify errors follow MCP protocol specification",
|
|
52
|
+
payload: "INVALID_TRIGGER_ERROR",
|
|
53
|
+
riskLevel: "LOW",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
testName: "Timeout Handling",
|
|
57
|
+
description: "Test if tool handles long operations gracefully",
|
|
58
|
+
payload: "SIMULATE_LONG_OPERATION",
|
|
59
|
+
riskLevel: "LOW",
|
|
60
|
+
},
|
|
61
|
+
];
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Assessment Types
|
|
3
|
+
*
|
|
4
|
+
* Foundational types used across all assessment modules.
|
|
5
|
+
* These are the building blocks that other type files depend on.
|
|
6
|
+
*
|
|
7
|
+
* @module assessment/coreTypes
|
|
8
|
+
*/
|
|
9
|
+
export type AssessmentStatus = "PASS" | "FAIL" | "NEED_MORE_INFO";
|
|
10
|
+
export type SecurityRiskLevel = "LOW" | "MEDIUM" | "HIGH";
|
|
11
|
+
/**
|
|
12
|
+
* Alignment status for tool annotations.
|
|
13
|
+
* Extends beyond PASS/FAIL to handle ambiguous cases.
|
|
14
|
+
*/
|
|
15
|
+
export type AlignmentStatus = "ALIGNED" | "MISALIGNED" | "REVIEW_RECOMMENDED" | "UNKNOWN";
|
|
16
|
+
/**
|
|
17
|
+
* Confidence level for behavior inference
|
|
18
|
+
*/
|
|
19
|
+
export type InferenceConfidence = "high" | "medium" | "low";
|
|
20
|
+
/**
|
|
21
|
+
* Assessment category tier for distinguishing core vs optional assessments.
|
|
22
|
+
* - "core": Always applicable to any MCP server audit
|
|
23
|
+
* - "optional": Contextual assessments (e.g., MCPB bundle-specific)
|
|
24
|
+
*/
|
|
25
|
+
export type AssessmentCategoryTier = "core" | "optional";
|
|
26
|
+
/**
|
|
27
|
+
* Metadata for assessment categories including tier and applicability info.
|
|
28
|
+
*/
|
|
29
|
+
export interface AssessmentCategoryMetadata {
|
|
30
|
+
tier: AssessmentCategoryTier;
|
|
31
|
+
description: string;
|
|
32
|
+
applicableTo?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Category metadata mapping for all assessment modules.
|
|
36
|
+
* Used for CLI output and downstream consumers to understand category context.
|
|
37
|
+
*
|
|
38
|
+
* Note: Uses `satisfies` to preserve literal key types while ensuring type safety.
|
|
39
|
+
* This allows deriving AssessmentModuleName from the object keys.
|
|
40
|
+
*/
|
|
41
|
+
declare const ASSESSMENT_CATEGORY_METADATA_INTERNAL: {
|
|
42
|
+
functionality: {
|
|
43
|
+
tier: "core";
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
security: {
|
|
47
|
+
tier: "core";
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
documentation: {
|
|
51
|
+
tier: "core";
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
errorHandling: {
|
|
55
|
+
tier: "core";
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
usability: {
|
|
59
|
+
tier: "core";
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
mcpSpecCompliance: {
|
|
63
|
+
tier: "core";
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
aupCompliance: {
|
|
67
|
+
tier: "core";
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
toolAnnotations: {
|
|
71
|
+
tier: "core";
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
prohibitedLibraries: {
|
|
75
|
+
tier: "core";
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
manifestValidation: {
|
|
79
|
+
tier: "optional";
|
|
80
|
+
description: string;
|
|
81
|
+
applicableTo: string;
|
|
82
|
+
};
|
|
83
|
+
portability: {
|
|
84
|
+
tier: "optional";
|
|
85
|
+
description: string;
|
|
86
|
+
applicableTo: string;
|
|
87
|
+
};
|
|
88
|
+
externalAPIScanner: {
|
|
89
|
+
tier: "core";
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
authentication: {
|
|
93
|
+
tier: "core";
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
temporal: {
|
|
97
|
+
tier: "core";
|
|
98
|
+
description: string;
|
|
99
|
+
};
|
|
100
|
+
resources: {
|
|
101
|
+
tier: "core";
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
prompts: {
|
|
105
|
+
tier: "core";
|
|
106
|
+
description: string;
|
|
107
|
+
};
|
|
108
|
+
crossCapability: {
|
|
109
|
+
tier: "core";
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Type-safe module name derived from ASSESSMENT_CATEGORY_METADATA keys.
|
|
115
|
+
* Use this type for compile-time validation of module names.
|
|
116
|
+
*/
|
|
117
|
+
export type AssessmentModuleName = keyof typeof ASSESSMENT_CATEGORY_METADATA_INTERNAL;
|
|
118
|
+
/**
|
|
119
|
+
* Re-export with original name for backward compatibility.
|
|
120
|
+
* Type is preserved as Record<AssessmentModuleName, AssessmentCategoryMetadata>.
|
|
121
|
+
*/
|
|
122
|
+
export declare const ASSESSMENT_CATEGORY_METADATA: Record<AssessmentModuleName, AssessmentCategoryMetadata>;
|
|
123
|
+
/**
|
|
124
|
+
* Generate module configuration derived from ASSESSMENT_CATEGORY_METADATA.
|
|
125
|
+
* Single source of truth for all assessment module names.
|
|
126
|
+
*
|
|
127
|
+
* @param options.sourceCodePath - If true, enables externalAPIScanner
|
|
128
|
+
* @param options.skipTemporal - If true, disables temporal assessment
|
|
129
|
+
* @returns Record of module names to enabled state (type-safe)
|
|
130
|
+
*/
|
|
131
|
+
export declare function getAllModulesConfig(options: {
|
|
132
|
+
sourceCodePath?: boolean;
|
|
133
|
+
skipTemporal?: boolean;
|
|
134
|
+
}): Record<AssessmentModuleName, boolean>;
|
|
135
|
+
/**
|
|
136
|
+
* Persistence model for MCP servers (Three-Tier Classification).
|
|
137
|
+
*
|
|
138
|
+
* These types are re-exported from the services layer for backward compatibility
|
|
139
|
+
* with existing imports from `@/lib/assessmentTypes`. This cross-layer import
|
|
140
|
+
* is intentional and documented:
|
|
141
|
+
*
|
|
142
|
+
* **Why cross-layer?**
|
|
143
|
+
* - PersistenceModel and ServerPersistenceContext are defined in
|
|
144
|
+
* `services/assessment/config/annotationPatterns.ts` alongside the pattern
|
|
145
|
+
* matching logic that uses them.
|
|
146
|
+
* - Moving the types here would create a circular dependency since the
|
|
147
|
+
* annotationPatterns module needs to import its own types.
|
|
148
|
+
* - Type-only imports (`export type`) don't create runtime dependencies,
|
|
149
|
+
* so this cross-layer reference is safe.
|
|
150
|
+
*
|
|
151
|
+
* **Type definitions:**
|
|
152
|
+
* - "immediate": Write operations persist directly to storage (database, file, API)
|
|
153
|
+
* - "deferred": Write operations are in-memory until explicit save operation
|
|
154
|
+
* - "unknown": Cannot determine persistence model
|
|
155
|
+
*
|
|
156
|
+
* @see services/assessment/config/annotationPatterns.ts for implementation
|
|
157
|
+
*/
|
|
158
|
+
export type { PersistenceModel, ServerPersistenceContext, } from "../../services/assessment/config/annotationPatterns.js";
|
|
159
|
+
//# sourceMappingURL=coreTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/assessment/coreTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,YAAY,GACZ,oBAAoB,GACpB,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DW,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC9B,MAAM,OAAO,qCAAqC,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,oBAAoB,EACpB,0BAA0B,CACa,CAAC;AAE1C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAaxC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,YAAY,EACV,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,qDAAqD,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Assessment Types
|
|
3
|
+
*
|
|
4
|
+
* Foundational types used across all assessment modules.
|
|
5
|
+
* These are the building blocks that other type files depend on.
|
|
6
|
+
*
|
|
7
|
+
* @module assessment/coreTypes
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Category metadata mapping for all assessment modules.
|
|
11
|
+
* Used for CLI output and downstream consumers to understand category context.
|
|
12
|
+
*
|
|
13
|
+
* Note: Uses `satisfies` to preserve literal key types while ensuring type safety.
|
|
14
|
+
* This allows deriving AssessmentModuleName from the object keys.
|
|
15
|
+
*/
|
|
16
|
+
const ASSESSMENT_CATEGORY_METADATA_INTERNAL = {
|
|
17
|
+
functionality: {
|
|
18
|
+
tier: "core",
|
|
19
|
+
description: "Tool functionality validation",
|
|
20
|
+
},
|
|
21
|
+
security: {
|
|
22
|
+
tier: "core",
|
|
23
|
+
description: "Security vulnerability detection",
|
|
24
|
+
},
|
|
25
|
+
documentation: {
|
|
26
|
+
tier: "core",
|
|
27
|
+
description: "Documentation quality",
|
|
28
|
+
},
|
|
29
|
+
errorHandling: {
|
|
30
|
+
tier: "core",
|
|
31
|
+
description: "Error handling compliance",
|
|
32
|
+
},
|
|
33
|
+
usability: { tier: "core", description: "Usability assessment" },
|
|
34
|
+
mcpSpecCompliance: {
|
|
35
|
+
tier: "core",
|
|
36
|
+
description: "MCP protocol compliance",
|
|
37
|
+
},
|
|
38
|
+
aupCompliance: {
|
|
39
|
+
tier: "core",
|
|
40
|
+
description: "Acceptable use policy compliance",
|
|
41
|
+
},
|
|
42
|
+
toolAnnotations: {
|
|
43
|
+
tier: "core",
|
|
44
|
+
description: "Tool annotation validation",
|
|
45
|
+
},
|
|
46
|
+
prohibitedLibraries: {
|
|
47
|
+
tier: "core",
|
|
48
|
+
description: "Prohibited library detection",
|
|
49
|
+
},
|
|
50
|
+
manifestValidation: {
|
|
51
|
+
tier: "optional",
|
|
52
|
+
description: "MCPB manifest validation",
|
|
53
|
+
applicableTo: "MCPB bundles",
|
|
54
|
+
},
|
|
55
|
+
portability: {
|
|
56
|
+
tier: "optional",
|
|
57
|
+
description: "Portability checks",
|
|
58
|
+
applicableTo: "MCPB bundles",
|
|
59
|
+
},
|
|
60
|
+
externalAPIScanner: {
|
|
61
|
+
tier: "core",
|
|
62
|
+
description: "External API detection",
|
|
63
|
+
},
|
|
64
|
+
authentication: {
|
|
65
|
+
tier: "core",
|
|
66
|
+
description: "OAuth/auth evaluation",
|
|
67
|
+
},
|
|
68
|
+
temporal: {
|
|
69
|
+
tier: "core",
|
|
70
|
+
description: "Temporal/rug pull detection",
|
|
71
|
+
},
|
|
72
|
+
resources: { tier: "core", description: "Resource security" },
|
|
73
|
+
prompts: { tier: "core", description: "Prompt security" },
|
|
74
|
+
crossCapability: {
|
|
75
|
+
tier: "core",
|
|
76
|
+
description: "Cross-capability security",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Re-export with original name for backward compatibility.
|
|
81
|
+
* Type is preserved as Record<AssessmentModuleName, AssessmentCategoryMetadata>.
|
|
82
|
+
*/
|
|
83
|
+
export const ASSESSMENT_CATEGORY_METADATA = ASSESSMENT_CATEGORY_METADATA_INTERNAL;
|
|
84
|
+
/**
|
|
85
|
+
* Generate module configuration derived from ASSESSMENT_CATEGORY_METADATA.
|
|
86
|
+
* Single source of truth for all assessment module names.
|
|
87
|
+
*
|
|
88
|
+
* @param options.sourceCodePath - If true, enables externalAPIScanner
|
|
89
|
+
* @param options.skipTemporal - If true, disables temporal assessment
|
|
90
|
+
* @returns Record of module names to enabled state (type-safe)
|
|
91
|
+
*/
|
|
92
|
+
export function getAllModulesConfig(options) {
|
|
93
|
+
return Object.keys(ASSESSMENT_CATEGORY_METADATA).reduce((acc, key) => ({
|
|
94
|
+
...acc,
|
|
95
|
+
[key]: key === "externalAPIScanner"
|
|
96
|
+
? Boolean(options.sourceCodePath)
|
|
97
|
+
: key === "temporal"
|
|
98
|
+
? !options.skipTemporal
|
|
99
|
+
: true,
|
|
100
|
+
}), {});
|
|
101
|
+
}
|