Skip to content

Commit 0e8ac6a

Browse files
fix: format client.ts and server.ts (import sorting + prettier)
1 parent 58801aa commit 0e8ac6a

File tree

2 files changed

+112
-110
lines changed

2 files changed

+112
-110
lines changed

packages/client/src/client/client.ts

Lines changed: 68 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
assertClientRequestTaskCapability,
4141
assertToolsCallTaskCapability,
4242
CallToolResultSchema,
43-
TaskManager,
4443
CompleteResultSchema,
4544
CreateMessageRequestSchema,
4645
CreateMessageResultSchema,
@@ -63,7 +62,8 @@ import {
6362
Protocol,
6463
ReadResourceResultSchema,
6564
safeParse,
66-
SUPPORTED_PROTOCOL_VERSIONS
65+
SUPPORTED_PROTOCOL_VERSIONS,
66+
TaskManager
6767
} from '@modelcontextprotocol/core';
6868

6969
import { ExperimentalClientTasks } from '../experimental/tasks/client.js';
@@ -142,71 +142,72 @@ export function getSupportedElicitationModes(capabilities: ClientCapabilities['e
142142
return { supportsFormMode, supportsUrlMode };
143143
}
144144

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

211212
/**
212213
* 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
Result,
2929
ServerCapabilities,
3030
ServerNotification,
31-
TaskManagerOptions,
3231
ServerRequest,
3332
ServerResult,
33+
TaskManagerOptions,
3434
ToolResultContent,
3535
ToolUseContent
3636
} from '@modelcontextprotocol/core';
@@ -59,48 +59,49 @@ import {
5959

6060
import { ExperimentalServerTasks } from '../experimental/tasks/server.js';
6161

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

105106
/**
106107
* An MCP server on top of a pluggable transport.

0 commit comments

Comments
 (0)