Skip to content

Commit 67988c2

Browse files
chipgptmattzcarey
authored andcommitted
delint
1 parent 68eee4d commit 67988c2

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

src/client/index.test.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,17 +1269,20 @@ test('should handle tool list changed notification with auto refresh', async ()
12691269
tools: []
12701270
}));
12711271

1272-
const client = new Client({
1273-
name: 'test-client',
1274-
version: '1.0.0',
1275-
}, {
1276-
toolListChangedOptions: {
1277-
autoRefresh: true,
1278-
onToolListChanged: (err, tools) => {
1279-
notifications.push([err, tools]);
1272+
const client = new Client(
1273+
{
1274+
name: 'test-client',
1275+
version: '1.0.0'
1276+
},
1277+
{
1278+
toolListChangedOptions: {
1279+
autoRefresh: true,
1280+
onToolListChanged: (err, tools) => {
1281+
notifications.push([err, tools]);
1282+
}
12801283
}
12811284
}
1282-
});
1285+
);
12831286

12841287
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
12851288

@@ -1353,17 +1356,20 @@ test('should handle tool list changed notification with manual refresh', async (
13531356
tools: []
13541357
}));
13551358

1356-
const client = new Client({
1357-
name: 'test-client',
1358-
version: '1.0.0',
1359-
}, {
1360-
toolListChangedOptions: {
1361-
autoRefresh: false,
1362-
onToolListChanged: (err, tools) => {
1363-
notifications.push([err, tools]);
1359+
const client = new Client(
1360+
{
1361+
name: 'test-client',
1362+
version: '1.0.0'
1363+
},
1364+
{
1365+
toolListChangedOptions: {
1366+
autoRefresh: false,
1367+
onToolListChanged: (err, tools) => {
1368+
notifications.push([err, tools]);
1369+
}
13641370
}
13651371
}
1366-
});
1372+
);
13671373

13681374
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
13691375

src/client/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export type ClientOptions = ProtocolOptions & {
169169
/**
170170
* Configure automatic refresh behavior for tool list changed notifications
171171
*
172-
* @example
172+
* @example
173173
* ```ts
174174
* {
175175
* autoRefresh: true,
@@ -191,7 +191,7 @@ export type ClientOptions = ProtocolOptions & {
191191
* autoRefresh: false,
192192
* onToolListChanged: (err, tools) => {
193193
* // err is always null when autoRefresh is false
194-
*
194+
*
195195
* // Manually refresh the tool list
196196
* const result = await this.listTools();
197197
* console.log('Tool list changed:', result.tools);
@@ -810,7 +810,7 @@ export class Client<
810810
const toolListChangedOptions: ToolListChangedOptions = {
811811
autoRefresh: !!options.autoRefresh,
812812
debounceMs: options.debounceMs ?? 300,
813-
onToolListChanged: options.onToolListChanged,
813+
onToolListChanged: options.onToolListChanged
814814
};
815815
this._toolListChangedOptions = toolListChangedOptions;
816816
this.setNotificationHandler(ToolListChangedNotificationSchema, () => {
@@ -819,12 +819,12 @@ export class Client<
819819
toolListChangedOptions.onToolListChanged?.(null, null);
820820
return;
821821
}
822-
822+
823823
// Clear any pending debounce timer
824824
if (this._toolListChangedDebounceTimer) {
825825
clearTimeout(this._toolListChangedDebounceTimer);
826826
}
827-
827+
828828
// Set up debounced refresh
829829
this._toolListChangedDebounceTimer = setTimeout(async () => {
830830
let tools: Tool[] | null = null;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ export const ToolListChangedOptionsSchema = z.object({
14061406
*
14071407
* If `autoRefresh` is true, this callback will be called with updated tool list.
14081408
*/
1409-
onToolListChanged: z.function(z.tuple([z.instanceof(Error).nullable(), z.array(ToolSchema).nullable()]), z.void()),
1409+
onToolListChanged: z.function(z.tuple([z.instanceof(Error).nullable(), z.array(ToolSchema).nullable()]), z.void())
14101410
});
14111411

14121412
export type ToolListChangedOptions = z.infer<typeof ToolListChangedOptionsSchema>;

0 commit comments

Comments
 (0)