Skip to content

Commit 0ca4867

Browse files
committed
passthrough removal part 2 - 0 passthrough on zod types
1 parent 5bcf53f commit 0ca4867

File tree

3 files changed

+110
-119
lines changed

3 files changed

+110
-119
lines changed

src/server/title.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('Title field backwards compatibility', () => {
7676
expect(prompts.prompts[0].name).toBe('test-prompt');
7777
expect(prompts.prompts[0].title).toBe('Test Prompt Display Name');
7878
expect(prompts.prompts[0].description).toBe('A test prompt');
79-
});
79+
}, 15_000);
8080

8181
it('should work with prompts using registerPrompt', async () => {
8282
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();

src/spec.types.test.ts

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -169,27 +169,27 @@ const sdkTypeChecks = {
169169
sdk = spec;
170170
spec = sdk;
171171
},
172-
ProgressNotification: (sdk: RemovePassthrough<WithJSONRPC<SDKTypes.ProgressNotification>>, spec: SpecTypes.ProgressNotification) => {
172+
ProgressNotification: (sdk: WithJSONRPC<SDKTypes.ProgressNotification>, spec: SpecTypes.ProgressNotification) => {
173173
sdk = spec;
174174
spec = sdk;
175175
},
176-
SubscribeRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.SubscribeRequest>>, spec: SpecTypes.SubscribeRequest) => {
176+
SubscribeRequest: (sdk: WithJSONRPCRequest<SDKTypes.SubscribeRequest>, spec: SpecTypes.SubscribeRequest) => {
177177
sdk = spec;
178178
spec = sdk;
179179
},
180-
UnsubscribeRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.UnsubscribeRequest>>, spec: SpecTypes.UnsubscribeRequest) => {
180+
UnsubscribeRequest: (sdk: WithJSONRPCRequest<SDKTypes.UnsubscribeRequest>, spec: SpecTypes.UnsubscribeRequest) => {
181181
sdk = spec;
182182
spec = sdk;
183183
},
184-
PaginatedRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.PaginatedRequest>>, spec: SpecTypes.PaginatedRequest) => {
184+
PaginatedRequest: (sdk: WithJSONRPCRequest<SDKTypes.PaginatedRequest>, spec: SpecTypes.PaginatedRequest) => {
185185
sdk = spec;
186186
spec = sdk;
187187
},
188188
PaginatedResult: (sdk: SDKTypes.PaginatedResult, spec: SpecTypes.PaginatedResult) => {
189189
sdk = spec;
190190
spec = sdk;
191191
},
192-
ListRootsRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ListRootsRequest>>, spec: SpecTypes.ListRootsRequest) => {
192+
ListRootsRequest: (sdk: WithJSONRPCRequest<SDKTypes.ListRootsRequest>, spec: SpecTypes.ListRootsRequest) => {
193193
sdk = spec;
194194
spec = sdk;
195195
},
@@ -261,7 +261,7 @@ const sdkTypeChecks = {
261261
sdk = spec;
262262
spec = sdk;
263263
},
264-
ClientNotification: (sdk: RemovePassthrough<WithJSONRPC<SDKTypes.ClientNotification>>, spec: SpecTypes.ClientNotification) => {
264+
ClientNotification: (sdk: WithJSONRPC<SDKTypes.ClientNotification>, spec: SpecTypes.ClientNotification) => {
265265
sdk = spec;
266266
spec = sdk;
267267
},
@@ -285,7 +285,7 @@ const sdkTypeChecks = {
285285
sdk = spec;
286286
spec = sdk;
287287
},
288-
ListToolsRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ListToolsRequest>>, spec: SpecTypes.ListToolsRequest) => {
288+
ListToolsRequest: (sdk: WithJSONRPCRequest<SDKTypes.ListToolsRequest>, spec: SpecTypes.ListToolsRequest) => {
289289
sdk = spec;
290290
spec = sdk;
291291
},
@@ -297,42 +297,36 @@ const sdkTypeChecks = {
297297
sdk = spec;
298298
spec = sdk;
299299
},
300-
CallToolRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.CallToolRequest>>, spec: SpecTypes.CallToolRequest) => {
300+
CallToolRequest: (sdk: WithJSONRPCRequest<SDKTypes.CallToolRequest>, spec: SpecTypes.CallToolRequest) => {
301301
sdk = spec;
302302
spec = sdk;
303303
},
304-
ToolListChangedNotification: (
305-
sdk: RemovePassthrough<WithJSONRPC<SDKTypes.ToolListChangedNotification>>,
306-
spec: SpecTypes.ToolListChangedNotification
307-
) => {
304+
ToolListChangedNotification: (sdk: WithJSONRPC<SDKTypes.ToolListChangedNotification>, spec: SpecTypes.ToolListChangedNotification) => {
308305
sdk = spec;
309306
spec = sdk;
310307
},
311308
ResourceListChangedNotification: (
312-
sdk: RemovePassthrough<WithJSONRPC<SDKTypes.ResourceListChangedNotification>>,
309+
sdk: WithJSONRPC<SDKTypes.ResourceListChangedNotification>,
313310
spec: SpecTypes.ResourceListChangedNotification
314311
) => {
315312
sdk = spec;
316313
spec = sdk;
317314
},
318315
PromptListChangedNotification: (
319-
sdk: RemovePassthrough<WithJSONRPC<SDKTypes.PromptListChangedNotification>>,
316+
sdk: WithJSONRPC<SDKTypes.PromptListChangedNotification>,
320317
spec: SpecTypes.PromptListChangedNotification
321318
) => {
322319
sdk = spec;
323320
spec = sdk;
324321
},
325322
RootsListChangedNotification: (
326-
sdk: RemovePassthrough<WithJSONRPC<SDKTypes.RootsListChangedNotification>>,
323+
sdk: WithJSONRPC<SDKTypes.RootsListChangedNotification>,
327324
spec: SpecTypes.RootsListChangedNotification
328325
) => {
329326
sdk = spec;
330327
spec = sdk;
331328
},
332-
ResourceUpdatedNotification: (
333-
sdk: RemovePassthrough<WithJSONRPC<SDKTypes.ResourceUpdatedNotification>>,
334-
spec: SpecTypes.ResourceUpdatedNotification
335-
) => {
329+
ResourceUpdatedNotification: (sdk: WithJSONRPC<SDKTypes.ResourceUpdatedNotification>, spec: SpecTypes.ResourceUpdatedNotification) => {
336330
sdk = spec;
337331
spec = sdk;
338332
},
@@ -344,25 +338,19 @@ const sdkTypeChecks = {
344338
sdk = spec;
345339
spec = sdk;
346340
},
347-
SetLevelRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.SetLevelRequest>>, spec: SpecTypes.SetLevelRequest) => {
341+
SetLevelRequest: (sdk: WithJSONRPCRequest<SDKTypes.SetLevelRequest>, spec: SpecTypes.SetLevelRequest) => {
348342
sdk = spec;
349343
spec = sdk;
350344
},
351-
PingRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.PingRequest>>, spec: SpecTypes.PingRequest) => {
345+
PingRequest: (sdk: WithJSONRPCRequest<SDKTypes.PingRequest>, spec: SpecTypes.PingRequest) => {
352346
sdk = spec;
353347
spec = sdk;
354348
},
355-
InitializedNotification: (
356-
sdk: RemovePassthrough<WithJSONRPC<SDKTypes.InitializedNotification>>,
357-
spec: SpecTypes.InitializedNotification
358-
) => {
349+
InitializedNotification: (sdk: WithJSONRPC<SDKTypes.InitializedNotification>, spec: SpecTypes.InitializedNotification) => {
359350
sdk = spec;
360351
spec = sdk;
361352
},
362-
ListResourcesRequest: (
363-
sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ListResourcesRequest>>,
364-
spec: SpecTypes.ListResourcesRequest
365-
) => {
353+
ListResourcesRequest: (sdk: WithJSONRPCRequest<SDKTypes.ListResourcesRequest>, spec: SpecTypes.ListResourcesRequest) => {
366354
sdk = spec;
367355
spec = sdk;
368356
},
@@ -371,7 +359,7 @@ const sdkTypeChecks = {
371359
spec = sdk;
372360
},
373361
ListResourceTemplatesRequest: (
374-
sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ListResourceTemplatesRequest>>,
362+
sdk: WithJSONRPCRequest<SDKTypes.ListResourceTemplatesRequest>,
375363
spec: SpecTypes.ListResourceTemplatesRequest
376364
) => {
377365
sdk = spec;
@@ -381,10 +369,7 @@ const sdkTypeChecks = {
381369
sdk = spec;
382370
spec = sdk;
383371
},
384-
ReadResourceRequest: (
385-
sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ReadResourceRequest>>,
386-
spec: SpecTypes.ReadResourceRequest
387-
) => {
372+
ReadResourceRequest: (sdk: WithJSONRPCRequest<SDKTypes.ReadResourceRequest>, spec: SpecTypes.ReadResourceRequest) => {
388373
sdk = spec;
389374
spec = sdk;
390375
},
@@ -420,15 +405,15 @@ const sdkTypeChecks = {
420405
sdk = spec;
421406
spec = sdk;
422407
},
423-
ListPromptsRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ListPromptsRequest>>, spec: SpecTypes.ListPromptsRequest) => {
408+
ListPromptsRequest: (sdk: WithJSONRPCRequest<SDKTypes.ListPromptsRequest>, spec: SpecTypes.ListPromptsRequest) => {
424409
sdk = spec;
425410
spec = sdk;
426411
},
427412
ListPromptsResult: (sdk: SDKTypes.ListPromptsResult, spec: SpecTypes.ListPromptsResult) => {
428413
sdk = spec;
429414
spec = sdk;
430415
},
431-
GetPromptRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.GetPromptRequest>>, spec: SpecTypes.GetPromptRequest) => {
416+
GetPromptRequest: (sdk: WithJSONRPCRequest<SDKTypes.GetPromptRequest>, spec: SpecTypes.GetPromptRequest) => {
432417
sdk = spec;
433418
spec = sdk;
434419
},
@@ -543,28 +528,22 @@ const sdkTypeChecks = {
543528
sdk = spec;
544529
spec = sdk;
545530
},
546-
ClientRequest: (
547-
sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ClientRequest>>,
548-
spec: FixSpecClientRequest<SpecTypes.ClientRequest>
549-
) => {
531+
ClientRequest: (sdk: WithJSONRPCRequest<SDKTypes.ClientRequest>, spec: FixSpecClientRequest<SpecTypes.ClientRequest>) => {
550532
sdk = spec;
551533
spec = sdk;
552534
},
553-
ServerRequest: (sdk: RemovePassthrough<WithJSONRPCRequest<SDKTypes.ServerRequest>>, spec: SpecTypes.ServerRequest) => {
535+
ServerRequest: (sdk: WithJSONRPCRequest<SDKTypes.ServerRequest>, spec: SpecTypes.ServerRequest) => {
554536
sdk = spec;
555537
spec = sdk;
556538
},
557539
LoggingMessageNotification: (
558-
sdk: RemovePassthrough<MakeUnknownsNotOptional<WithJSONRPC<SDKTypes.LoggingMessageNotification>>>,
540+
sdk: MakeUnknownsNotOptional<WithJSONRPC<SDKTypes.LoggingMessageNotification>>,
559541
spec: SpecTypes.LoggingMessageNotification
560542
) => {
561543
sdk = spec;
562544
spec = sdk;
563545
},
564-
ServerNotification: (
565-
sdk: MakeUnknownsNotOptional<RemovePassthrough<WithJSONRPC<SDKTypes.ServerNotification>>>,
566-
spec: SpecTypes.ServerNotification
567-
) => {
546+
ServerNotification: (sdk: MakeUnknownsNotOptional<WithJSONRPC<SDKTypes.ServerNotification>>, spec: SpecTypes.ServerNotification) => {
568547
sdk = spec;
569548
spec = sdk;
570549
},

0 commit comments

Comments
 (0)