Skip to content

Commit 45d7e10

Browse files
fix: format client.ts and server.ts (import sorting + prettier)
1 parent fd290ea commit 45d7e10

File tree

2 files changed

+111
-109
lines changed

2 files changed

+111
-109
lines changed

packages/client/src/client/client.ts

Lines changed: 67 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
assertClientRequestTaskCapability,
4242
assertToolsCallTaskCapability,
4343
CallToolResultSchema,
44-
TaskManager,
4544
CompleteResultSchema,
4645
CreateMessageRequestSchema,
4746
CreateMessageResultSchema,
@@ -69,6 +68,7 @@ import {
6968
ResourceListChangedNotificationSchema,
7069
safeParse,
7170
SUPPORTED_PROTOCOL_VERSIONS,
71+
TaskManager,
7272
ToolListChangedNotificationSchema
7373
} from '@modelcontextprotocol/core';
7474

@@ -148,71 +148,72 @@ export function getSupportedElicitationModes(capabilities: ClientCapabilities['e
148148
return { supportsFormMode, supportsUrlMode };
149149
}
150150

151-
export type ClientOptions = ProtocolOptions & Partial<TaskManagerOptions> & {
152-
/**
153-
* Capabilities to advertise as being supported by this client.
154-
*/
155-
capabilities?: ClientCapabilities;
156-
157-
/**
158-
* JSON Schema validator for tool output validation.
159-
*
160-
* The validator is used to validate structured content returned by tools
161-
* against their declared output schemas.
162-
*
163-
* @default AjvJsonSchemaValidator
164-
*
165-
* @example
166-
* ```typescript
167-
* // ajv
168-
* const client = new Client(
169-
* { name: 'my-client', version: '1.0.0' },
170-
* {
171-
* capabilities: {},
172-
* jsonSchemaValidator: new AjvJsonSchemaValidator()
173-
* }
174-
* );
175-
*
176-
* // @cfworker/json-schema
177-
* const client = new Client(
178-
* { name: 'my-client', version: '1.0.0' },
179-
* {
180-
* capabilities: {},
181-
* jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
182-
* }
183-
* );
184-
* ```
185-
*/
186-
jsonSchemaValidator?: jsonSchemaValidator;
187-
188-
/**
189-
* Configure handlers for list changed notifications (tools, prompts, resources).
190-
*
191-
* @example
192-
* ```typescript
193-
* const client = new Client(
194-
* { name: 'my-client', version: '1.0.0' },
195-
* {
196-
* listChanged: {
197-
* tools: {
198-
* onChanged: (error, tools) => {
199-
* if (error) {
200-
* console.error('Failed to refresh tools:', error);
201-
* return;
202-
* }
203-
* console.log('Tools updated:', tools);
204-
* }
205-
* },
206-
* prompts: {
207-
* onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
208-
* }
209-
* }
210-
* }
211-
* );
212-
* ```
213-
*/
214-
listChanged?: ListChangedHandlers;
215-
};
151+
export type ClientOptions = ProtocolOptions &
152+
Partial<TaskManagerOptions> & {
153+
/**
154+
* Capabilities to advertise as being supported by this client.
155+
*/
156+
capabilities?: ClientCapabilities;
157+
158+
/**
159+
* JSON Schema validator for tool output validation.
160+
*
161+
* The validator is used to validate structured content returned by tools
162+
* against their declared output schemas.
163+
*
164+
* @default AjvJsonSchemaValidator
165+
*
166+
* @example
167+
* ```typescript
168+
* // ajv
169+
* const client = new Client(
170+
* { name: 'my-client', version: '1.0.0' },
171+
* {
172+
* capabilities: {},
173+
* jsonSchemaValidator: new AjvJsonSchemaValidator()
174+
* }
175+
* );
176+
*
177+
* // @cfworker/json-schema
178+
* const client = new Client(
179+
* { name: 'my-client', version: '1.0.0' },
180+
* {
181+
* capabilities: {},
182+
* jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
183+
* }
184+
* );
185+
* ```
186+
*/
187+
jsonSchemaValidator?: jsonSchemaValidator;
188+
189+
/**
190+
* Configure handlers for list changed notifications (tools, prompts, resources).
191+
*
192+
* @example
193+
* ```typescript
194+
* const client = new Client(
195+
* { name: 'my-client', version: '1.0.0' },
196+
* {
197+
* listChanged: {
198+
* tools: {
199+
* onChanged: (error, tools) => {
200+
* if (error) {
201+
* console.error('Failed to refresh tools:', error);
202+
* return;
203+
* }
204+
* console.log('Tools updated:', tools);
205+
* }
206+
* },
207+
* prompts: {
208+
* onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
209+
* }
210+
* }
211+
* }
212+
* );
213+
* ```
214+
*/
215+
listChanged?: ListChangedHandlers;
216+
};
216217

217218
/**
218219
* An MCP client on top of a pluggable transport.

packages/server/src/server/server.ts

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import type {
2828
SchemaOutput,
2929
ServerCapabilities,
3030
ServerNotification,
31-
TaskManagerOptions,
3231
ServerRequest,
3332
ServerResult,
33+
TaskManagerOptions,
3434
ToolResultContent,
3535
ToolUseContent,
3636
ZodV3Internal,
@@ -66,48 +66,49 @@ import {
6666

6767
import { ExperimentalServerTasks } from '../experimental/tasks/server.js';
6868

69-
export type ServerOptions = ProtocolOptions & Partial<TaskManagerOptions> & {
70-
/**
71-
* Capabilities to advertise as being supported by this server.
72-
*/
73-
capabilities?: ServerCapabilities;
74-
75-
/**
76-
* Optional instructions describing how to use the server and its features.
77-
*/
78-
instructions?: string;
79-
80-
/**
81-
* JSON Schema validator for elicitation response validation.
82-
*
83-
* The validator is used to validate user input returned from elicitation
84-
* requests against the requested schema.
85-
*
86-
* @default AjvJsonSchemaValidator
87-
*
88-
* @example
89-
* ```typescript
90-
* // ajv (default)
91-
* const server = new Server(
92-
* { name: 'my-server', version: '1.0.0' },
93-
* {
94-
* capabilities: {}
95-
* jsonSchemaValidator: new AjvJsonSchemaValidator()
96-
* }
97-
* );
98-
*
99-
* // @cfworker/json-schema
100-
* const server = new Server(
101-
* { name: 'my-server', version: '1.0.0' },
102-
* {
103-
* capabilities: {},
104-
* jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
105-
* }
106-
* );
107-
* ```
108-
*/
109-
jsonSchemaValidator?: jsonSchemaValidator;
110-
};
69+
export type ServerOptions = ProtocolOptions &
70+
Partial<TaskManagerOptions> & {
71+
/**
72+
* Capabilities to advertise as being supported by this server.
73+
*/
74+
capabilities?: ServerCapabilities;
75+
76+
/**
77+
* Optional instructions describing how to use the server and its features.
78+
*/
79+
instructions?: string;
80+
81+
/**
82+
* JSON Schema validator for elicitation response validation.
83+
*
84+
* The validator is used to validate user input returned from elicitation
85+
* requests against the requested schema.
86+
*
87+
* @default AjvJsonSchemaValidator
88+
*
89+
* @example
90+
* ```typescript
91+
* // ajv (default)
92+
* const server = new Server(
93+
* { name: 'my-server', version: '1.0.0' },
94+
* {
95+
* capabilities: {}
96+
* jsonSchemaValidator: new AjvJsonSchemaValidator()
97+
* }
98+
* );
99+
*
100+
* // @cfworker/json-schema
101+
* const server = new Server(
102+
* { name: 'my-server', version: '1.0.0' },
103+
* {
104+
* capabilities: {},
105+
* jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
106+
* }
107+
* );
108+
* ```
109+
*/
110+
jsonSchemaValidator?: jsonSchemaValidator;
111+
};
111112

112113
/**
113114
* An MCP server on top of a pluggable transport.

0 commit comments

Comments
 (0)