@@ -5,6 +5,7 @@ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
55
66import { MCP_SERVER_CLI_SCRIPT } from "./constants.js" ;
77import { LLMToolCall } from "./accuracy-result-storage/result-storage.js" ;
8+ import { VercelMCPClient , VercelMCPClientTools } from "./agent.js" ;
89
910type ToolResultGeneratorFn = ( ...parameters : unknown [ ] ) => CallToolResult | Promise < CallToolResult > ;
1011export type MockedTools = Record < string , ToolResultGeneratorFn > ;
@@ -22,15 +23,15 @@ export class AccuracyTestingClient {
2223 private mockedTools : MockedTools = { } ;
2324 private llmToolCalls : LLMToolCall [ ] = [ ] ;
2425
25- private constructor ( private readonly vercelMCPClient : Awaited < ReturnType < typeof createMCPClient > > ) { }
26+ private constructor ( private readonly vercelMCPClient : VercelMCPClient ) { }
2627
27- async close ( ) {
28+ async close ( ) : Promise < void > {
2829 await this . vercelMCPClient ?. close ( ) ;
2930 }
3031
31- async vercelTools ( ) {
32+ async vercelTools ( ) : Promise < VercelMCPClientTools > {
3233 const vercelTools = ( await this . vercelMCPClient ?. tools ( ) ) ?? { } ;
33- const rewrappedVercelTools : typeof vercelTools = { } ;
34+ const rewrappedVercelTools : VercelMCPClientTools = { } ;
3435 for ( const [ toolName , tool ] of Object . entries ( vercelTools ) ) {
3536 rewrappedVercelTools [ toolName ] = createVercelTool ( {
3637 ...tool ,
@@ -65,20 +66,20 @@ export class AccuracyTestingClient {
6566 return rewrappedVercelTools ;
6667 }
6768
68- getLLMToolCalls ( ) {
69+ getLLMToolCalls ( ) : LLMToolCall [ ] {
6970 return this . llmToolCalls ;
7071 }
7172
72- mockTools ( mockedTools : MockedTools ) {
73+ mockTools ( mockedTools : MockedTools ) : void {
7374 this . mockedTools = mockedTools ;
7475 }
7576
76- resetForTests ( ) {
77+ resetForTests ( ) : void {
7778 this . mockTools ( { } ) ;
7879 this . llmToolCalls = [ ] ;
7980 }
8081
81- static async initializeClient ( mdbConnectionString : string ) {
82+ static async initializeClient ( mdbConnectionString : string ) : Promise < AccuracyTestingClient > {
8283 const clientTransport = new StdioClientTransport ( {
8384 command : process . execPath ,
8485 args : [ MCP_SERVER_CLI_SCRIPT , "--connectionString" , mdbConnectionString ] ,
0 commit comments