@mcpspec/shared 1.0.3 → 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 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
- - `SavedServerConnection`, `SavedCollection`, `TestRunRecord` — API types
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
  }
@@ -289,6 +298,45 @@ interface MCPScore {
289
298
  security: number;
290
299
  };
291
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
+ }
292
340
  type WSClientMessage = {
293
341
  type: 'subscribe';
294
342
  channel: string;
@@ -549,6 +597,54 @@ declare const docsGenerateSchema: z.ZodObject<{
549
597
  env?: Record<string, string> | undefined;
550
598
  format?: "html" | "markdown" | undefined;
551
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
+ }>;
552
648
  declare const scoreCalculateSchema: z.ZodObject<{
553
649
  transport: z.ZodEnum<["stdio", "sse", "streamable-http"]>;
554
650
  command: z.ZodOptional<z.ZodString>;
@@ -1093,4 +1189,4 @@ declare const rateLimitConfigSchema: z.ZodObject<{
1093
1189
  maxConcurrent?: number | undefined;
1094
1190
  }>;
1095
1191
 
1096
- 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, auditDryRunSchema, 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
@@ -108,6 +108,24 @@ var docsGenerateSchema = z.object({
108
108
  env: z.record(z.string()).optional(),
109
109
  format: z.enum(["markdown", "html"]).default("markdown")
110
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
+ });
111
129
  var scoreCalculateSchema = z.object({
112
130
  transport: z.enum(["stdio", "sse", "streamable-http"]),
113
131
  command: z.string().optional(),
@@ -224,6 +242,9 @@ export {
224
242
  inspectCallSchema,
225
243
  inspectConnectSchema,
226
244
  rateLimitConfigSchema,
245
+ replayRecordingSchema,
246
+ saveInspectRecordingSchema,
247
+ saveRecordingSchema,
227
248
  scoreCalculateSchema,
228
249
  serverConfigSchema,
229
250
  simpleExpectationSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpspec/shared",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",