Skip to content

Commit 1f52271

Browse files
committed
clean up
1 parent e232939 commit 1f52271

File tree

5 files changed

+7
-18
lines changed

5 files changed

+7
-18
lines changed

src/client/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ describe('outputSchema validation', () => {
822822
server.setRequestHandler(CallToolRequestSchema, async request => {
823823
if (request.params.name === 'test-tool') {
824824
return {
825-
content: [],
826825
structuredContent: { result: 'success', count: 42 }
827826
};
828827
}

src/client/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ import {
3737
ElicitRequestSchema,
3838
type RequestGeneric,
3939
type NotificationGeneric,
40-
type ResultGeneric,
41-
Result
40+
type Result
4241
} from '../types.js';
4342
import { AjvJsonSchemaValidator } from '../validation/ajv-provider.js';
4443
import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from '../validation/types.js';
@@ -151,7 +150,7 @@ export type ClientOptions = ProtocolOptions & {
151150
export class Client<
152151
RequestT extends RequestGeneric = RequestGeneric,
153152
NotificationT extends NotificationGeneric = NotificationGeneric,
154-
ResultT extends ResultGeneric = Result
153+
ResultT extends Result = Result
155154
> extends Protocol<ClientRequest | RequestT, ClientNotification | NotificationT, ClientResult | ResultT> {
156155
private _serverCapabilities?: ServerCapabilities;
157156
private _serverVersion?: Implementation;

src/server/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ import {
2929
SUPPORTED_PROTOCOL_VERSIONS,
3030
type RequestGeneric,
3131
type NotificationGeneric,
32-
type ResultGeneric,
33-
Result
32+
type Result
3433
} from '../types.js';
3534
import { AjvJsonSchemaValidator } from '../validation/ajv-provider.js';
3635
import type { JsonSchemaType, jsonSchemaValidator } from '../validation/types.js';
@@ -107,7 +106,7 @@ export type ServerOptions = ProtocolOptions & {
107106
export class Server<
108107
RequestT extends RequestGeneric = RequestGeneric,
109108
NotificationT extends NotificationGeneric = NotificationGeneric,
110-
ResultT extends ResultGeneric = Result
109+
ResultT extends Result = Result
111110
> extends Protocol<ServerRequest | RequestT, ServerNotification | NotificationT, ServerResult | ResultT> {
112111
private _clientCapabilities?: ClientCapabilities;
113112
private _clientVersion?: Implementation;

src/shared/protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
RequestInfo,
2626
type RequestGeneric,
2727
type NotificationGeneric,
28-
type ResultGeneric
28+
type Result
2929
} from '../types.js';
3030
import { Transport, TransportSendOptions } from './transport.js';
3131
import { AuthInfo } from '../server/auth/types.js';
@@ -176,7 +176,7 @@ type TimeoutInfo = {
176176
export abstract class Protocol<
177177
SendRequestT extends RequestGeneric,
178178
SendNotificationT extends NotificationGeneric,
179-
SendResultT extends ResultGeneric
179+
SendResultT extends Result
180180
> {
181181
private _transport?: Transport;
182182
private _requestMessageId = 0;

src/types.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ export const ResultSchema = z
9595
})
9696
.catchall(z.unknown());
9797

98-
/**
99-
* Generic result schema that allows any additional fields to be added to the result.
100-
*
101-
* Used in {@link JSONRPCResponseSchema} for generic shape matching.
102-
*/
103-
export const ResultSchemaGeneric = z.intersection(ResultSchema, z.record(z.string(), z.unknown()).optional());
104-
105-
export type ResultGeneric = ExpandRecursively<z.infer<typeof ResultSchemaGeneric>>;
10698
/**
10799
* A uniquely identifying ID for a request in JSON-RPC.
108100
*/
@@ -140,7 +132,7 @@ export const JSONRPCResponseSchema = z
140132
.object({
141133
jsonrpc: z.literal(JSONRPC_VERSION),
142134
id: RequestIdSchema,
143-
result: ResultSchemaGeneric
135+
result: ResultSchema
144136
})
145137
.strict();
146138

0 commit comments

Comments
 (0)