@mcpspec/shared 1.0.2 → 1.1.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/README.md +3 -1
- package/dist/index.d.ts +132 -2
- package/dist/index.js +34 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,8 @@ Internal shared package for [MCPSpec](https://www.npmjs.com/package/mcpspec). Pr
|
|
|
23
23
|
- `MCPScore` — Quality scoring
|
|
24
24
|
- `WSClientMessage`, `WSServerMessage` — WebSocket protocol
|
|
25
25
|
- `ErrorTemplate` — Error formatting
|
|
26
|
-
- `
|
|
26
|
+
- `Recording`, `RecordingStep`, `RecordingStepDiff`, `RecordingDiff` — Recording & replay types
|
|
27
|
+
- `SavedServerConnection`, `SavedCollection`, `SavedRecording`, `TestRunRecord` — API types
|
|
27
28
|
- `ApiResponse`, `ApiListResponse`, `ApiError` — API response wrappers
|
|
28
29
|
|
|
29
30
|
### Zod Schemas
|
|
@@ -40,6 +41,7 @@ Internal shared package for [MCPSpec](https://www.npmjs.com/package/mcpspec). Pr
|
|
|
40
41
|
- `createCollectionSchema`, `updateCollectionSchema` — Collection API payloads
|
|
41
42
|
- `triggerRunSchema`, `inspectConnectSchema`, `inspectCallSchema` — Action schemas
|
|
42
43
|
- `auditStartSchema`, `benchmarkStartSchema`, `docsGenerateSchema`, `scoreCalculateSchema` — Feature schemas
|
|
44
|
+
- `saveRecordingSchema`, `replayRecordingSchema`, `saveInspectRecordingSchema` — Recording schemas
|
|
43
45
|
|
|
44
46
|
### Constants
|
|
45
47
|
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,15 @@ interface TestRunRecord {
|
|
|
57
57
|
completedAt?: string;
|
|
58
58
|
duration?: number;
|
|
59
59
|
}
|
|
60
|
+
interface SavedRecording {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
serverName?: string;
|
|
65
|
+
data: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
}
|
|
60
69
|
interface ApiResponse<T> {
|
|
61
70
|
data: T;
|
|
62
71
|
}
|
|
@@ -149,6 +158,7 @@ interface TestDefinition {
|
|
|
149
158
|
expect?: SimpleExpectation[];
|
|
150
159
|
expectError?: boolean;
|
|
151
160
|
extract?: ExtractionDefinition[];
|
|
161
|
+
rawResponse?: boolean;
|
|
152
162
|
}
|
|
153
163
|
type SimpleExpectation = {
|
|
154
164
|
exists: string;
|
|
@@ -226,6 +236,8 @@ interface SecurityScanConfig {
|
|
|
226
236
|
acknowledgeRisk?: boolean;
|
|
227
237
|
timeout?: number;
|
|
228
238
|
maxProbesPerTool?: number;
|
|
239
|
+
excludeTools?: string[];
|
|
240
|
+
dryRun?: boolean;
|
|
229
241
|
}
|
|
230
242
|
interface SecurityScanResult {
|
|
231
243
|
id: string;
|
|
@@ -282,10 +294,49 @@ interface MCPScore {
|
|
|
282
294
|
documentation: number;
|
|
283
295
|
errorHandling: number;
|
|
284
296
|
schemaQuality: number;
|
|
285
|
-
|
|
297
|
+
responsiveness: number;
|
|
286
298
|
security: number;
|
|
287
299
|
};
|
|
288
300
|
}
|
|
301
|
+
interface RecordingStep {
|
|
302
|
+
tool: string;
|
|
303
|
+
input: Record<string, unknown>;
|
|
304
|
+
output: unknown[];
|
|
305
|
+
isError?: boolean;
|
|
306
|
+
durationMs?: number;
|
|
307
|
+
}
|
|
308
|
+
interface Recording {
|
|
309
|
+
id: string;
|
|
310
|
+
name: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
serverName?: string;
|
|
313
|
+
tools: Array<{
|
|
314
|
+
name: string;
|
|
315
|
+
description?: string;
|
|
316
|
+
}>;
|
|
317
|
+
steps: RecordingStep[];
|
|
318
|
+
createdAt: string;
|
|
319
|
+
}
|
|
320
|
+
interface RecordingStepDiff {
|
|
321
|
+
index: number;
|
|
322
|
+
tool: string;
|
|
323
|
+
type: 'matched' | 'changed' | 'added' | 'removed';
|
|
324
|
+
original?: RecordingStep;
|
|
325
|
+
replayed?: RecordingStep;
|
|
326
|
+
outputDiff?: string;
|
|
327
|
+
}
|
|
328
|
+
interface RecordingDiff {
|
|
329
|
+
recordingId: string;
|
|
330
|
+
recordingName: string;
|
|
331
|
+
replayedAt: string;
|
|
332
|
+
steps: RecordingStepDiff[];
|
|
333
|
+
summary: {
|
|
334
|
+
matched: number;
|
|
335
|
+
changed: number;
|
|
336
|
+
added: number;
|
|
337
|
+
removed: number;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
289
340
|
type WSClientMessage = {
|
|
290
341
|
type: 'subscribe';
|
|
291
342
|
channel: string;
|
|
@@ -442,6 +493,7 @@ declare const auditStartSchema: z.ZodObject<{
|
|
|
442
493
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
443
494
|
mode: z.ZodDefault<z.ZodEnum<["passive", "active", "aggressive"]>>;
|
|
444
495
|
rules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
496
|
+
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
445
497
|
}, "strip", z.ZodTypeAny, {
|
|
446
498
|
transport: "stdio" | "sse" | "streamable-http";
|
|
447
499
|
mode: "passive" | "active" | "aggressive";
|
|
@@ -450,6 +502,7 @@ declare const auditStartSchema: z.ZodObject<{
|
|
|
450
502
|
url?: string | undefined;
|
|
451
503
|
env?: Record<string, string> | undefined;
|
|
452
504
|
rules?: string[] | undefined;
|
|
505
|
+
excludeTools?: string[] | undefined;
|
|
453
506
|
}, {
|
|
454
507
|
transport: "stdio" | "sse" | "streamable-http";
|
|
455
508
|
command?: string | undefined;
|
|
@@ -458,6 +511,35 @@ declare const auditStartSchema: z.ZodObject<{
|
|
|
458
511
|
env?: Record<string, string> | undefined;
|
|
459
512
|
mode?: "passive" | "active" | "aggressive" | undefined;
|
|
460
513
|
rules?: string[] | undefined;
|
|
514
|
+
excludeTools?: string[] | undefined;
|
|
515
|
+
}>;
|
|
516
|
+
declare const auditDryRunSchema: z.ZodObject<{
|
|
517
|
+
transport: z.ZodEnum<["stdio", "sse", "streamable-http"]>;
|
|
518
|
+
command: z.ZodOptional<z.ZodString>;
|
|
519
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
520
|
+
url: z.ZodOptional<z.ZodString>;
|
|
521
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
522
|
+
mode: z.ZodDefault<z.ZodEnum<["passive", "active", "aggressive"]>>;
|
|
523
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
524
|
+
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
525
|
+
}, "strip", z.ZodTypeAny, {
|
|
526
|
+
transport: "stdio" | "sse" | "streamable-http";
|
|
527
|
+
mode: "passive" | "active" | "aggressive";
|
|
528
|
+
command?: string | undefined;
|
|
529
|
+
args?: string[] | undefined;
|
|
530
|
+
url?: string | undefined;
|
|
531
|
+
env?: Record<string, string> | undefined;
|
|
532
|
+
rules?: string[] | undefined;
|
|
533
|
+
excludeTools?: string[] | undefined;
|
|
534
|
+
}, {
|
|
535
|
+
transport: "stdio" | "sse" | "streamable-http";
|
|
536
|
+
command?: string | undefined;
|
|
537
|
+
args?: string[] | undefined;
|
|
538
|
+
url?: string | undefined;
|
|
539
|
+
env?: Record<string, string> | undefined;
|
|
540
|
+
mode?: "passive" | "active" | "aggressive" | undefined;
|
|
541
|
+
rules?: string[] | undefined;
|
|
542
|
+
excludeTools?: string[] | undefined;
|
|
461
543
|
}>;
|
|
462
544
|
declare const benchmarkStartSchema: z.ZodObject<{
|
|
463
545
|
transport: z.ZodEnum<["stdio", "sse", "streamable-http"]>;
|
|
@@ -515,6 +597,54 @@ declare const docsGenerateSchema: z.ZodObject<{
|
|
|
515
597
|
env?: Record<string, string> | undefined;
|
|
516
598
|
format?: "html" | "markdown" | undefined;
|
|
517
599
|
}>;
|
|
600
|
+
declare const saveRecordingSchema: z.ZodObject<{
|
|
601
|
+
name: z.ZodString;
|
|
602
|
+
description: z.ZodOptional<z.ZodString>;
|
|
603
|
+
serverName: z.ZodOptional<z.ZodString>;
|
|
604
|
+
data: z.ZodString;
|
|
605
|
+
}, "strip", z.ZodTypeAny, {
|
|
606
|
+
name: string;
|
|
607
|
+
data: string;
|
|
608
|
+
description?: string | undefined;
|
|
609
|
+
serverName?: string | undefined;
|
|
610
|
+
}, {
|
|
611
|
+
name: string;
|
|
612
|
+
data: string;
|
|
613
|
+
description?: string | undefined;
|
|
614
|
+
serverName?: string | undefined;
|
|
615
|
+
}>;
|
|
616
|
+
declare const replayRecordingSchema: z.ZodObject<{
|
|
617
|
+
transport: z.ZodEnum<["stdio", "sse", "streamable-http"]>;
|
|
618
|
+
command: z.ZodOptional<z.ZodString>;
|
|
619
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
620
|
+
url: z.ZodOptional<z.ZodString>;
|
|
621
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
622
|
+
}, "strip", z.ZodTypeAny, {
|
|
623
|
+
transport: "stdio" | "sse" | "streamable-http";
|
|
624
|
+
command?: string | undefined;
|
|
625
|
+
args?: string[] | undefined;
|
|
626
|
+
url?: string | undefined;
|
|
627
|
+
env?: Record<string, string> | undefined;
|
|
628
|
+
}, {
|
|
629
|
+
transport: "stdio" | "sse" | "streamable-http";
|
|
630
|
+
command?: string | undefined;
|
|
631
|
+
args?: string[] | undefined;
|
|
632
|
+
url?: string | undefined;
|
|
633
|
+
env?: Record<string, string> | undefined;
|
|
634
|
+
}>;
|
|
635
|
+
declare const saveInspectRecordingSchema: z.ZodObject<{
|
|
636
|
+
sessionId: z.ZodString;
|
|
637
|
+
name: z.ZodString;
|
|
638
|
+
description: z.ZodOptional<z.ZodString>;
|
|
639
|
+
}, "strip", z.ZodTypeAny, {
|
|
640
|
+
name: string;
|
|
641
|
+
sessionId: string;
|
|
642
|
+
description?: string | undefined;
|
|
643
|
+
}, {
|
|
644
|
+
name: string;
|
|
645
|
+
sessionId: string;
|
|
646
|
+
description?: string | undefined;
|
|
647
|
+
}>;
|
|
518
648
|
declare const scoreCalculateSchema: z.ZodObject<{
|
|
519
649
|
transport: z.ZodEnum<["stdio", "sse", "streamable-http"]>;
|
|
520
650
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -1059,4 +1189,4 @@ declare const rateLimitConfigSchema: z.ZodObject<{
|
|
|
1059
1189
|
maxConcurrent?: number | undefined;
|
|
1060
1190
|
}>;
|
|
1061
1191
|
|
|
1062
|
-
export { type ApiError, type ApiListResponse, type ApiResponse, type AssertionDefinition, type AssertionResult, type AssertionType, type BenchmarkConfig, type BenchmarkResult, type BenchmarkStats, type CollectionDefinition, type ConnectionConfig, type ConnectionState, DEFAULT_RATE_LIMIT, DEFAULT_TIMEOUTS, EXIT_CODES, type EnvironmentDefinition, type ErrorTemplate, type ExitCode, type ExtractionDefinition, type MCPScore, type ManagedProcess, type MessageDirection, type ProcessConfig, type ProfileEntry, type ProtocolLogEntry, type RateLimitConfig, type ReporterType, type SavedCollection, type SavedServerConnection, type SecurityFinding, type SecurityScanConfig, type SecurityScanMode, type SecurityScanResult, type SecurityScanSummary, type ServerConfig, type SeverityLevel, type SimpleExpectation, type TestDefinition, type TestResult, type TestRunRecord, type TestRunResult, type TestSummary, type TimeoutConfig, type TransportType, type WSClientMessage, type WSServerMessage, type WaterfallEntry, assertionDefinitionSchema, auditStartSchema, benchmarkStartSchema, collectionSchema, createCollectionSchema, createServerSchema, docsGenerateSchema, environmentSchema, extractionSchema, inspectCallSchema, inspectConnectSchema, rateLimitConfigSchema, scoreCalculateSchema, serverConfigSchema, simpleExpectationSchema, testDefinitionSchema, timeoutConfigSchema, triggerRunSchema, updateCollectionSchema, updateServerSchema };
|
|
1192
|
+
export { type ApiError, type ApiListResponse, type ApiResponse, type AssertionDefinition, type AssertionResult, type AssertionType, type BenchmarkConfig, type BenchmarkResult, type BenchmarkStats, type CollectionDefinition, type ConnectionConfig, type ConnectionState, DEFAULT_RATE_LIMIT, DEFAULT_TIMEOUTS, EXIT_CODES, type EnvironmentDefinition, type ErrorTemplate, type ExitCode, type ExtractionDefinition, type MCPScore, type ManagedProcess, type MessageDirection, type ProcessConfig, type ProfileEntry, type ProtocolLogEntry, type RateLimitConfig, type Recording, type RecordingDiff, type RecordingStep, type RecordingStepDiff, type ReporterType, type SavedCollection, type SavedRecording, type SavedServerConnection, type SecurityFinding, type SecurityScanConfig, type SecurityScanMode, type SecurityScanResult, type SecurityScanSummary, type ServerConfig, type SeverityLevel, type SimpleExpectation, type TestDefinition, type TestResult, type TestRunRecord, type TestRunResult, type TestSummary, type TimeoutConfig, type TransportType, type WSClientMessage, type WSServerMessage, type WaterfallEntry, assertionDefinitionSchema, auditDryRunSchema, auditStartSchema, benchmarkStartSchema, collectionSchema, createCollectionSchema, createServerSchema, docsGenerateSchema, environmentSchema, extractionSchema, inspectCallSchema, inspectConnectSchema, rateLimitConfigSchema, replayRecordingSchema, saveInspectRecordingSchema, saveRecordingSchema, scoreCalculateSchema, serverConfigSchema, simpleExpectationSchema, testDefinitionSchema, timeoutConfigSchema, triggerRunSchema, updateCollectionSchema, updateServerSchema };
|
package/dist/index.js
CHANGED
|
@@ -75,7 +75,18 @@ var auditStartSchema = z.object({
|
|
|
75
75
|
url: z.string().optional(),
|
|
76
76
|
env: z.record(z.string()).optional(),
|
|
77
77
|
mode: z.enum(["passive", "active", "aggressive"]).default("passive"),
|
|
78
|
-
rules: z.array(z.string()).optional()
|
|
78
|
+
rules: z.array(z.string()).optional(),
|
|
79
|
+
excludeTools: z.array(z.string()).optional()
|
|
80
|
+
});
|
|
81
|
+
var auditDryRunSchema = z.object({
|
|
82
|
+
transport: z.enum(["stdio", "sse", "streamable-http"]),
|
|
83
|
+
command: z.string().optional(),
|
|
84
|
+
args: z.array(z.string()).optional(),
|
|
85
|
+
url: z.string().optional(),
|
|
86
|
+
env: z.record(z.string()).optional(),
|
|
87
|
+
mode: z.enum(["passive", "active", "aggressive"]).default("passive"),
|
|
88
|
+
rules: z.array(z.string()).optional(),
|
|
89
|
+
excludeTools: z.array(z.string()).optional()
|
|
79
90
|
});
|
|
80
91
|
var benchmarkStartSchema = z.object({
|
|
81
92
|
transport: z.enum(["stdio", "sse", "streamable-http"]),
|
|
@@ -97,6 +108,24 @@ var docsGenerateSchema = z.object({
|
|
|
97
108
|
env: z.record(z.string()).optional(),
|
|
98
109
|
format: z.enum(["markdown", "html"]).default("markdown")
|
|
99
110
|
});
|
|
111
|
+
var saveRecordingSchema = z.object({
|
|
112
|
+
name: z.string().min(1),
|
|
113
|
+
description: z.string().optional(),
|
|
114
|
+
serverName: z.string().optional(),
|
|
115
|
+
data: z.string().min(1)
|
|
116
|
+
});
|
|
117
|
+
var replayRecordingSchema = z.object({
|
|
118
|
+
transport: z.enum(["stdio", "sse", "streamable-http"]),
|
|
119
|
+
command: z.string().optional(),
|
|
120
|
+
args: z.array(z.string()).optional(),
|
|
121
|
+
url: z.string().optional(),
|
|
122
|
+
env: z.record(z.string()).optional()
|
|
123
|
+
});
|
|
124
|
+
var saveInspectRecordingSchema = z.object({
|
|
125
|
+
sessionId: z.string().min(1),
|
|
126
|
+
name: z.string().min(1),
|
|
127
|
+
description: z.string().optional()
|
|
128
|
+
});
|
|
100
129
|
var scoreCalculateSchema = z.object({
|
|
101
130
|
transport: z.enum(["stdio", "sse", "streamable-http"]),
|
|
102
131
|
command: z.string().optional(),
|
|
@@ -201,6 +230,7 @@ export {
|
|
|
201
230
|
DEFAULT_TIMEOUTS,
|
|
202
231
|
EXIT_CODES,
|
|
203
232
|
assertionDefinitionSchema,
|
|
233
|
+
auditDryRunSchema,
|
|
204
234
|
auditStartSchema,
|
|
205
235
|
benchmarkStartSchema,
|
|
206
236
|
collectionSchema,
|
|
@@ -212,6 +242,9 @@ export {
|
|
|
212
242
|
inspectCallSchema,
|
|
213
243
|
inspectConnectSchema,
|
|
214
244
|
rateLimitConfigSchema,
|
|
245
|
+
replayRecordingSchema,
|
|
246
|
+
saveInspectRecordingSchema,
|
|
247
|
+
saveRecordingSchema,
|
|
215
248
|
scoreCalculateSchema,
|
|
216
249
|
serverConfigSchema,
|
|
217
250
|
simpleExpectationSchema,
|