Skip to content

Commit 893b484

Browse files
committed
lint fix
1 parent 9f62d77 commit 893b484

9 files changed

Lines changed: 141 additions & 157 deletions

File tree

packages/client/src/experimental/tasks/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import type {
1313
CreateTaskResult,
1414
GetTaskResult,
1515
ListTasksResult,
16+
Request,
1617
RequestMethod,
1718
RequestOptions,
1819
ResponseMessage,
1920
ResultTypeMap,
2021
SchemaOutput
2122
} from '@modelcontextprotocol/core';
2223
import { CallToolResultSchema, getResultSchema, ProtocolError, ProtocolErrorCode } from '@modelcontextprotocol/core';
23-
import type { Request } from '@modelcontextprotocol/core';
2424

2525
import type { Client } from '../../client/client.js';
2626

packages/core/src/experimental/tasks/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface TaskRequestsCapability {
1717

1818
/**
1919
* Asserts that task creation is supported for `tools/call`.
20-
* Used by {@linkcode @modelcontextprotocol/client!client/client.Client.assertTaskCapability | Client.assertTaskCapability} and {@linkcode @modelcontextprotocol/server!server/server.Server.assertTaskHandlerCapability | Server.assertTaskHandlerCapability}.
20+
* Used as the `assertTaskCapability` or `assertTaskHandlerCapability` callback in `TaskManagerOptions`.
2121
*
2222
* @param requests - The task requests capability object
2323
* @param method - The method being checked
@@ -52,7 +52,7 @@ export function assertToolsCallTaskCapability(
5252

5353
/**
5454
* Asserts that task creation is supported for `sampling/createMessage` or `elicitation/create`.
55-
* Used by {@linkcode @modelcontextprotocol/server!server/server.Server.assertTaskCapability | Server.assertTaskCapability} and {@linkcode @modelcontextprotocol/client!client/client.Client.assertTaskHandlerCapability | Client.assertTaskHandlerCapability}.
55+
* Used as the `assertTaskCapability` or `assertTaskHandlerCapability` callback in `TaskManagerOptions`.
5656
*
5757
* @param requests - The task requests capability object
5858
* @param method - The method being checked

packages/core/src/shared/protocol.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ type TimeoutInfo = {
282282
onTimeout: () => void;
283283
};
284284

285+
async function _noopRouteResponse(): Promise<boolean> {
286+
return false;
287+
}
288+
285289
/**
286290
* Implements MCP protocol framing on top of a pluggable transport, including
287291
* features like request/response linking, notifications, and progress.
@@ -514,10 +518,10 @@ export abstract class Protocol<ContextT extends BaseContext> {
514518
};
515519

516520
// Compose results from all modules
517-
let sendNotification: (notification: Notification) => Promise<void> =
518-
(notification: Notification) => inboundCtx.sendNotification(notification);
521+
let sendNotification: (notification: Notification) => Promise<void> = (notification: Notification) =>
522+
inboundCtx.sendNotification(notification);
519523
let sendRequest = inboundCtx.sendRequest;
520-
let routeResponse: (message: JSONRPCResponse | JSONRPCErrorResponse) => Promise<boolean> = async () => false;
524+
let routeResponse: (message: JSONRPCResponse | JSONRPCErrorResponse) => Promise<boolean> = _noopRouteResponse;
521525
let taskContext: BaseContext['task'] | undefined;
522526
let hasTaskCreationParams = false;
523527

packages/core/test/shared/protocol.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ function assertQueuedRequest(o?: QueuedMessage): asserts o is QueuedRequest {
182182
*/
183183
// eslint-disable-next-line @typescript-eslint/no-explicit-any
184184
function testRequest(proto: Protocol<BaseContext>, request: Request, resultSchema: ZodType, options?: any) {
185-
return (proto as unknown as { _requestWithSchema: (request: Request, resultSchema: ZodType, options?: unknown) => Promise<unknown> })._requestWithSchema(request, resultSchema, options);
185+
return (
186+
proto as unknown as { _requestWithSchema: (request: Request, resultSchema: ZodType, options?: unknown) => Promise<unknown> }
187+
)._requestWithSchema(request, resultSchema, options);
186188
}
187189

188190
describe('protocol tests', () => {
@@ -5264,7 +5266,9 @@ describe('Error handling for missing resolvers', () => {
52645266
});
52655267

52665268
// -- Helper: create a no-op mock module --
5267-
function createMockModule(overrides?: Partial<ProtocolModule>): ProtocolModule & { boundHost?: ProtocolModuleHost; onCloseCalled: boolean } {
5269+
function createMockModule(
5270+
overrides?: Partial<ProtocolModule>
5271+
): ProtocolModule & { boundHost?: ProtocolModuleHost; onCloseCalled: boolean } {
52685272
const mock: ProtocolModule & { boundHost?: ProtocolModuleHost; onCloseCalled: boolean } = {
52695273
boundHost: undefined,
52705274
onCloseCalled: false,

packages/server/src/experimental/tasks/server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import type {
2020
RequestMethod,
2121
RequestOptions,
2222
ResponseMessage,
23-
Result,
2423
ResultTypeMap,
2524
SchemaOutput
2625
} from '@modelcontextprotocol/core';

test/integration/test/client/client.test.ts

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,10 +2206,13 @@ describe('outputSchema validation', () => {
22062206
throw new Error('Unknown tool');
22072207
});
22082208

2209-
const client = new Client({
2210-
name: 'test-client',
2211-
version: '1.0.0'
2212-
}, { capabilities: { tasks: { requests: { tools: { call: {} } } } } });
2209+
const client = new Client(
2210+
{
2211+
name: 'test-client',
2212+
version: '1.0.0'
2213+
},
2214+
{ capabilities: { tasks: { requests: { tools: { call: {} } } } } }
2215+
);
22132216

22142217
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
22152218

@@ -2253,10 +2256,8 @@ describe('Task-based execution', () => {
22532256
},
22542257

22552258
taskStore: serverTaskStore
2256-
22572259
}
22582260
}
2259-
22602261
}
22612262
);
22622263

@@ -2293,10 +2294,13 @@ describe('Task-based execution', () => {
22932294
}
22942295
);
22952296

2296-
const client = new Client({
2297-
name: 'test-client',
2298-
version: '1.0.0'
2299-
}, { capabilities: { tasks: { requests: { tools: { call: {} } } } } });
2297+
const client = new Client(
2298+
{
2299+
name: 'test-client',
2300+
version: '1.0.0'
2301+
},
2302+
{ capabilities: { tasks: { requests: { tools: { call: {} } } } } }
2303+
);
23002304

23012305
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
23022306

@@ -2335,10 +2339,8 @@ describe('Task-based execution', () => {
23352339
},
23362340

23372341
taskStore: serverTaskStore
2338-
23392342
}
23402343
}
2341-
23422344
}
23432345
);
23442346

@@ -2375,10 +2377,13 @@ describe('Task-based execution', () => {
23752377
}
23762378
);
23772379

2378-
const client = new Client({
2379-
name: 'test-client',
2380-
version: '1.0.0'
2381-
}, { capabilities: { tasks: { requests: { tools: { call: {} } } } } });
2380+
const client = new Client(
2381+
{
2382+
name: 'test-client',
2383+
version: '1.0.0'
2384+
},
2385+
{ capabilities: { tasks: { requests: { tools: { call: {} } } } } }
2386+
);
23822387

23832388
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
23842389

@@ -2418,10 +2423,8 @@ describe('Task-based execution', () => {
24182423
},
24192424

24202425
taskStore: serverTaskStore
2421-
24222426
}
24232427
}
2424-
24252428
}
24262429
);
24272430

@@ -2458,10 +2461,13 @@ describe('Task-based execution', () => {
24582461
}
24592462
);
24602463

2461-
const client = new Client({
2462-
name: 'test-client',
2463-
version: '1.0.0'
2464-
}, { capabilities: { tasks: { requests: { tools: { call: {} } } } } });
2464+
const client = new Client(
2465+
{
2466+
name: 'test-client',
2467+
version: '1.0.0'
2468+
},
2469+
{ capabilities: { tasks: { requests: { tools: { call: {} } } } } }
2470+
);
24652471

24662472
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
24672473

@@ -2505,10 +2511,8 @@ describe('Task-based execution', () => {
25052511
},
25062512

25072513
taskStore: serverTaskStore
2508-
25092514
}
25102515
}
2511-
25122516
}
25132517
);
25142518

@@ -2545,10 +2549,13 @@ describe('Task-based execution', () => {
25452549
}
25462550
);
25472551

2548-
const client = new Client({
2549-
name: 'test-client',
2550-
version: '1.0.0'
2551-
}, { capabilities: { tasks: { requests: { tools: { call: {} } } } } });
2552+
const client = new Client(
2553+
{
2554+
name: 'test-client',
2555+
version: '1.0.0'
2556+
},
2557+
{ capabilities: { tasks: { requests: { tools: { call: {} } } } } }
2558+
);
25522559

25532560
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
25542561

@@ -2615,10 +2622,8 @@ describe('Task-based execution', () => {
26152622
},
26162623

26172624
taskStore: clientTaskStore
2618-
26192625
}
26202626
}
2621-
26222627
}
26232628
);
26242629

@@ -2710,10 +2715,8 @@ describe('Task-based execution', () => {
27102715
},
27112716

27122717
taskStore: clientTaskStore
2713-
27142718
}
27152719
}
2716-
27172720
}
27182721
);
27192722

@@ -2804,10 +2807,8 @@ describe('Task-based execution', () => {
28042807
},
28052808

28062809
taskStore: clientTaskStore
2807-
28082810
}
28092811
}
2810-
28112812
}
28122813
);
28132814

@@ -2897,10 +2898,8 @@ describe('Task-based execution', () => {
28972898
},
28982899

28992900
taskStore: clientTaskStore
2900-
29012901
}
29022902
}
2903-
29042903
}
29052904
);
29062905

@@ -3002,10 +3001,8 @@ describe('Task-based execution', () => {
30023001
},
30033002

30043003
taskStore: serverTaskStore
3005-
30063004
}
30073005
}
3008-
30093006
}
30103007
);
30113008

@@ -3130,10 +3127,8 @@ describe('Task-based execution', () => {
31303127
},
31313128

31323129
taskStore: serverTaskStore
3133-
31343130
}
31353131
}
3136-
31373132
}
31383133
);
31393134

@@ -3180,10 +3175,8 @@ describe('Task-based execution', () => {
31803175
},
31813176

31823177
taskStore: serverTaskStore
3183-
31843178
}
31853179
}
3186-
31873180
}
31883181
);
31893182

@@ -3230,10 +3223,8 @@ describe('Task-based execution', () => {
32303223
},
32313224

32323225
taskStore: clientTaskStore
3233-
32343226
}
32353227
}
3236-
32373228
}
32383229
);
32393230

@@ -3287,10 +3278,8 @@ test('should respect server task capabilities', async () => {
32873278
},
32883279

32893280
taskStore: serverTaskStore
3290-
32913281
}
32923282
}
3293-
32943283
}
32953284
);
32963285

0 commit comments

Comments
 (0)