@bryan-thompson/inspector-assessment-client 1.31.0 → 1.32.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.
Files changed (34) hide show
  1. package/dist/assets/{OAuthCallback-CXcl26vR.js → OAuthCallback-Cl2ANLYP.js} +1 -1
  2. package/dist/assets/{OAuthDebugCallback-J9s4SF_c.js → OAuthDebugCallback-Ws62T4Ns.js} +1 -1
  3. package/dist/assets/{index-_HAw2b2G.js → index-DaPIdOcS.js} +4 -4
  4. package/dist/index.html +1 -1
  5. package/lib/lib/assessment/extendedTypes.d.ts +21 -0
  6. package/lib/lib/assessment/extendedTypes.d.ts.map +1 -1
  7. package/lib/lib/assessment/resultTypes.d.ts +12 -2
  8. package/lib/lib/assessment/resultTypes.d.ts.map +1 -1
  9. package/lib/lib/moduleScoring.d.ts.map +1 -1
  10. package/lib/lib/moduleScoring.js +5 -0
  11. package/lib/services/assessment/AssessmentOrchestrator.d.ts +20 -19
  12. package/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -1
  13. package/lib/services/assessment/AssessmentOrchestrator.js +118 -152
  14. package/lib/services/assessment/modules/ConformanceAssessor.d.ts +4 -0
  15. package/lib/services/assessment/modules/ConformanceAssessor.d.ts.map +1 -1
  16. package/lib/services/assessment/modules/ConformanceAssessor.js +21 -0
  17. package/lib/services/assessment/modules/ResourceAssessor.d.ts.map +1 -1
  18. package/lib/services/assessment/modules/ResourceAssessor.js +6 -1
  19. package/lib/services/assessment/registry/AssessorDefinitions.d.ts +38 -0
  20. package/lib/services/assessment/registry/AssessorDefinitions.d.ts.map +1 -0
  21. package/lib/services/assessment/registry/AssessorDefinitions.js +370 -0
  22. package/lib/services/assessment/registry/AssessorRegistry.d.ts +124 -0
  23. package/lib/services/assessment/registry/AssessorRegistry.d.ts.map +1 -0
  24. package/lib/services/assessment/registry/AssessorRegistry.js +321 -0
  25. package/lib/services/assessment/registry/estimators.d.ts +93 -0
  26. package/lib/services/assessment/registry/estimators.d.ts.map +1 -0
  27. package/lib/services/assessment/registry/estimators.js +176 -0
  28. package/lib/services/assessment/registry/index.d.ts +13 -0
  29. package/lib/services/assessment/registry/index.d.ts.map +1 -0
  30. package/lib/services/assessment/registry/index.js +16 -0
  31. package/lib/services/assessment/registry/types.d.ts +180 -0
  32. package/lib/services/assessment/registry/types.d.ts.map +1 -0
  33. package/lib/services/assessment/registry/types.js +35 -0
  34. package/package.json +1 -1
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Registry Types for AssessorRegistry
3
+ *
4
+ * Defines interfaces and enums for the registry pattern implementation.
5
+ * These types enable declarative assessor definitions and phase-based execution.
6
+ *
7
+ * @module assessment/registry/types
8
+ * @see GitHub Issue #91
9
+ */
10
+ import type { AssessmentConfiguration } from "../../../lib/assessment/configTypes.js";
11
+ import type { MCPDirectoryAssessment } from "../../../lib/assessment/resultTypes.js";
12
+ import type { BaseAssessor } from "../modules/BaseAssessor.js";
13
+ import type { AssessmentContext } from "../AssessmentOrchestrator.js";
14
+ import type { Logger } from "../lib/logger.js";
15
+ import type { ClaudeCodeBridge } from "../lib/claudeCodeBridge.js";
16
+ /**
17
+ * Execution phases - determines order of assessment execution.
18
+ * Phase 0 ALWAYS runs first and sequentially to capture clean baselines.
19
+ */
20
+ export declare enum AssessmentPhase {
21
+ /** Temporal assessment - must run first for baseline capture before other tools trigger */
22
+ PRE = 0,
23
+ /** Core assessments: Functionality, Security, Documentation, ErrorHandling, Usability */
24
+ CORE = 1,
25
+ /** Protocol compliance assessment */
26
+ PROTOCOL = 2,
27
+ /** MCP Directory compliance: AUP, Annotations, Libraries, Manifest, Portability, APIs, Auth */
28
+ COMPLIANCE = 3,
29
+ /** Capability assessments: Resources, Prompts, CrossCapability */
30
+ CAPABILITY = 4,
31
+ /** Code quality: FileModularization, Conformance */
32
+ QUALITY = 5
33
+ }
34
+ /**
35
+ * Config flags that control whether an assessor is enabled.
36
+ * Supports OR logic for backward-compatible deprecated flags.
37
+ */
38
+ export interface AssessorConfigFlags {
39
+ /**
40
+ * Primary flag in assessmentCategories.
41
+ * This is the canonical flag name to use.
42
+ */
43
+ primary: keyof NonNullable<AssessmentConfiguration["assessmentCategories"]>;
44
+ /**
45
+ * Deprecated flags that also enable this assessor (OR logic for BC).
46
+ * If ANY of these flags is true, the assessor is enabled.
47
+ * Used for backward compatibility during deprecation periods.
48
+ */
49
+ deprecated?: Array<keyof NonNullable<AssessmentConfiguration["assessmentCategories"]>>;
50
+ /**
51
+ * Default enablement behavior:
52
+ * - true (default): Enabled unless explicitly set to false (`!== false`)
53
+ * - false: Disabled unless explicitly set to true (`=== true`)
54
+ *
55
+ * Core assessors (functionality, security, etc.) use defaultEnabled: true
56
+ * Extended assessors use defaultEnabled: false (opt-in)
57
+ */
58
+ defaultEnabled?: boolean;
59
+ }
60
+ /**
61
+ * Assessor class constructor type.
62
+ * All assessors must accept AssessmentConfiguration in constructor.
63
+ */
64
+ export type AssessorConstructor<T extends BaseAssessor = BaseAssessor> = new (config: AssessmentConfiguration) => T;
65
+ /**
66
+ * Custom setup function for assessors that need additional initialization.
67
+ * Called after construction but before Claude bridge wiring.
68
+ *
69
+ * Examples:
70
+ * - ToolAnnotationAssessor needs pattern config loaded and compiled
71
+ * - SecurityAssessor may need custom payload configuration
72
+ */
73
+ export type AssessorSetupFn<T extends BaseAssessor = BaseAssessor> = (assessor: T, config: AssessmentConfiguration, logger: Logger) => void;
74
+ /**
75
+ * Test count estimator function.
76
+ * Returns the estimated number of tests this assessor will run.
77
+ * Used for progress event emission (emitModuleStartedEvent).
78
+ */
79
+ export type TestEstimatorFn = (context: AssessmentContext, config: AssessmentConfiguration) => number;
80
+ /**
81
+ * Metadata for each assessor definition.
82
+ * Enables declarative configuration instead of imperative code.
83
+ * Single source of truth for all assessor registration.
84
+ */
85
+ export interface AssessorDefinition<T extends BaseAssessor = BaseAssessor> {
86
+ /**
87
+ * Unique identifier matching the assessor purpose.
88
+ * Used for registry lookup and property getter names.
89
+ * Convention: camelCase matching the assessmentCategories key.
90
+ * Examples: 'security', 'functionality', 'protocolCompliance'
91
+ */
92
+ id: string;
93
+ /**
94
+ * Human-readable display name for progress events and logging.
95
+ * Used in emitModuleStartedEvent and emitModuleProgress.
96
+ * Examples: 'Security', 'Protocol Compliance', 'AUP Compliance'
97
+ */
98
+ displayName: string;
99
+ /**
100
+ * Assessor class constructor.
101
+ * All assessors extend BaseAssessor<T>.
102
+ */
103
+ assessorClass: AssessorConstructor<T>;
104
+ /**
105
+ * Field name in MCPDirectoryAssessment for storing the result.
106
+ * Must match an optional field on MCPDirectoryAssessment.
107
+ */
108
+ resultField: keyof MCPDirectoryAssessment;
109
+ /**
110
+ * Execution phase (controls ordering).
111
+ * Phase 0 (PRE) always runs first and sequentially.
112
+ */
113
+ phase: AssessmentPhase;
114
+ /**
115
+ * Config flags that enable this assessor.
116
+ * Supports primary flag and deprecated alternatives for BC.
117
+ */
118
+ configFlags: AssessorConfigFlags;
119
+ /**
120
+ * Whether this assessor requires enableExtendedAssessment = true.
121
+ * Core assessors (Phase 1) set this to false.
122
+ * Extended assessors (Phases 2-5) set this to true.
123
+ */
124
+ requiresExtended: boolean;
125
+ /**
126
+ * Whether this assessor supports Claude bridge integration.
127
+ * If true, setClaudeBridge() will be called when bridge is enabled.
128
+ * Currently: SecurityAssessor, AUPComplianceAssessor, ToolAnnotationAssessor
129
+ */
130
+ supportsClaudeBridge: boolean;
131
+ /**
132
+ * Estimate test count from context (for progress events).
133
+ * Called before execution to populate emitModuleStartedEvent.
134
+ */
135
+ estimateTests: TestEstimatorFn;
136
+ /**
137
+ * Optional: Custom setup function for special initialization.
138
+ * Called after construction but before Claude bridge wiring.
139
+ * Examples: Load pattern config for ToolAnnotationAssessor
140
+ */
141
+ customSetup?: AssessorSetupFn<T>;
142
+ }
143
+ /**
144
+ * Registered assessor instance with metadata.
145
+ * Created by AssessorRegistry.registerAll() for enabled assessors.
146
+ */
147
+ export interface RegisteredAssessor<T extends BaseAssessor = BaseAssessor> {
148
+ /** The original definition */
149
+ definition: AssessorDefinition<T>;
150
+ /** Instantiated assessor */
151
+ instance: T;
152
+ /** Whether this assessor is enabled based on config */
153
+ enabled: boolean;
154
+ }
155
+ /**
156
+ * Result of a single assessor execution.
157
+ * Used internally by AssessorRegistry.executePhase().
158
+ */
159
+ export interface AssessorExecutionResult {
160
+ /** Assessor ID for result mapping */
161
+ id: string;
162
+ /** Result field name in MCPDirectoryAssessment */
163
+ resultField: keyof MCPDirectoryAssessment;
164
+ /** The assessment result (type varies by assessor) */
165
+ result: unknown;
166
+ /** Execution time in milliseconds */
167
+ executionTime: number;
168
+ }
169
+ /**
170
+ * Type guard for assessors that support Claude bridge.
171
+ * Used to safely call setClaudeBridge() method.
172
+ */
173
+ export interface ClaudeBridgeCapable {
174
+ setClaudeBridge(bridge: ClaudeCodeBridge): void;
175
+ }
176
+ /**
177
+ * Check if an assessor supports Claude bridge integration.
178
+ */
179
+ export declare function supportsClaudeBridge(assessor: BaseAssessor): assessor is BaseAssessor & ClaudeBridgeCapable;
180
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/registry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,oBAAY,eAAe;IACzB,2FAA2F;IAC3F,GAAG,IAAI;IACP,yFAAyF;IACzF,IAA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AE,mBAAmB,CAAC;IAEjC;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,aAAa,EAAE,eAAe,CAAC;IAE/B;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IACvE,8BAA8B;IAC9B,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAElC,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,CAAC;IAEZ,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IAEX,kDAAkD;IAClD,WAAW,EAAE,MAAM,sBAAsB,CAAC;IAE1C,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAEhB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACjD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,GACrB,QAAQ,IAAI,YAAY,GAAG,mBAAmB,CAKhD"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Registry Types for AssessorRegistry
3
+ *
4
+ * Defines interfaces and enums for the registry pattern implementation.
5
+ * These types enable declarative assessor definitions and phase-based execution.
6
+ *
7
+ * @module assessment/registry/types
8
+ * @see GitHub Issue #91
9
+ */
10
+ /**
11
+ * Execution phases - determines order of assessment execution.
12
+ * Phase 0 ALWAYS runs first and sequentially to capture clean baselines.
13
+ */
14
+ export var AssessmentPhase;
15
+ (function (AssessmentPhase) {
16
+ /** Temporal assessment - must run first for baseline capture before other tools trigger */
17
+ AssessmentPhase[AssessmentPhase["PRE"] = 0] = "PRE";
18
+ /** Core assessments: Functionality, Security, Documentation, ErrorHandling, Usability */
19
+ AssessmentPhase[AssessmentPhase["CORE"] = 1] = "CORE";
20
+ /** Protocol compliance assessment */
21
+ AssessmentPhase[AssessmentPhase["PROTOCOL"] = 2] = "PROTOCOL";
22
+ /** MCP Directory compliance: AUP, Annotations, Libraries, Manifest, Portability, APIs, Auth */
23
+ AssessmentPhase[AssessmentPhase["COMPLIANCE"] = 3] = "COMPLIANCE";
24
+ /** Capability assessments: Resources, Prompts, CrossCapability */
25
+ AssessmentPhase[AssessmentPhase["CAPABILITY"] = 4] = "CAPABILITY";
26
+ /** Code quality: FileModularization, Conformance */
27
+ AssessmentPhase[AssessmentPhase["QUALITY"] = 5] = "QUALITY";
28
+ })(AssessmentPhase || (AssessmentPhase = {}));
29
+ /**
30
+ * Check if an assessor supports Claude bridge integration.
31
+ */
32
+ export function supportsClaudeBridge(assessor) {
33
+ return (typeof assessor.setClaudeBridge ===
34
+ "function");
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bryan-thompson/inspector-assessment-client",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "Client-side application for the Enhanced MCP Inspector with assessment capabilities",
5
5
  "license": "MIT",
6
6
  "author": "Bryan Thompson <bryan@triepod.ai>",