Update test framework: fix run_tests.py to support all test files, add auto-import-check for test files

This commit is contained in:
qiaoxinjiu
2026-05-09 15:11:30 +08:00
parent eb053a347f
commit eaba8328da
21739 changed files with 2236758 additions and 719 deletions

3
node_modules/mcp-evals/dist/cli.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=cli.d.ts.map

1
node_modules/mcp-evals/dist/cli.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}

66
node_modules/mcp-evals/dist/cli.js generated vendored Normal file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env node
import { runAllEvals } from './index.js';
import * as dotenv from 'dotenv';
import { loadYamlEvalConfig } from './yaml-loader.js';
import path from 'path';
import { createRequire } from 'module';
// Load .env file
dotenv.config();
// Register tsx as a loader
const require = createRequire(import.meta.url);
require('tsx');
async function main() {
const userEvalsPath = process.argv[2];
const userServerPath = process.argv[3];
if (!userEvalsPath) {
console.error('Please provide a path to your evals file');
console.error('Usage: npx mcp-eval <evals-path> <server-path>');
console.error(' <evals-path> can be a .ts/.js or .yaml/.yml file');
process.exit(1);
}
if (!userServerPath) {
console.error('Please provide a path to your server file');
console.error('Usage: npx mcp-eval <evals-path> <server-path>');
console.error(' <evals-path> can be a .ts/.js or .yaml/.yml file');
process.exit(1);
}
const absoluteEvalsPath = path.resolve(process.cwd(), userEvalsPath);
const absoluteServerPath = path.resolve(process.cwd(), userServerPath);
console.log('Running evals file:', absoluteEvalsPath);
console.log('Using server file:', absoluteServerPath);
try {
let config;
// Check file extension to determine how to load the config
const fileExtension = path.extname(absoluteEvalsPath).toLowerCase();
if (fileExtension === '.yaml' || fileExtension === '.yml') {
// Load YAML configuration
config = loadYamlEvalConfig(absoluteEvalsPath, absoluteServerPath);
}
else {
// Import the TypeScript/JavaScript file
const module = await import(absoluteEvalsPath);
config = module.default;
if (!config || !config.evals) {
console.error('Invalid config: must export a default config with evals array');
process.exit(1);
}
}
console.log('Running all evaluations...\n');
const results = await runAllEvals(config, absoluteServerPath);
console.log('\nEvaluation Results:');
for (const [name, result] of results.entries()) {
console.log(`\n${name}:`);
console.log(JSON.stringify(result, null, 2));
}
process.exit(0);
}
catch (error) {
console.error('Error running evaluations:', error);
process.exit(1);
}
}
main().catch(error => {
console.error('Error running evaluations:', error);
process.exit(1);
});
//# sourceMappingURL=cli.js.map

1
node_modules/mcp-evals/dist/cli.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,iBAAiB;AACjB,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,2BAA2B;AAC3B,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,OAAO,CAAC,KAAK,CAAC,CAAC;AAEf,KAAK,UAAU,IAAI;IACjB,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEvC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC1D,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD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C,8BAA8B,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAE9D,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}

9
node_modules/mcp-evals/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import { type LanguageModel } from "ai";
import { EvalConfig } from './types.js';
export declare function runEvals(model: LanguageModel | undefined, prompt: string, serverPath: string): Promise<string>;
export declare function grade(model: LanguageModel | undefined, prompt: string, serverPath?: string): Promise<string>;
export declare function runAllEvals(config: EvalConfig, serverPath: string): Promise<Map<string, any>>;
export * from './types.js';
export { metrics } from './metrics.js';
export type { MetricsConfig } from './metrics.js';
//# sourceMappingURL=index.d.ts.map

1
node_modules/mcp-evals/dist/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,IAAI,CAAC;AAEZ,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,wBAAsB,QAAQ,CAAC,KAAK,EAAE,aAAa,YAAa,EAAE,MAAM,EAAE,MAAM,EAAC,UAAU,EAAE,MAAM,mBAuClG;AAED,wBAAsB,KAAK,CAAC,KAAK,EAAE,aAAa,YAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,mBAwCjG;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAiCvE;AAGD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}

112
node_modules/mcp-evals/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,112 @@
import { Experimental_StdioMCPTransport } from "ai/mcp-stdio";
import { experimental_createMCPClient, streamText, } from "ai";
import { openai } from "@ai-sdk/openai";
const defaultModel = openai("gpt-4o");
export async function runEvals(model = defaultModel, prompt, serverPath) {
const transport = new Experimental_StdioMCPTransport({
command: "tsx",
args: [serverPath],
env: Object.fromEntries(Object.entries(process.env).filter(([_, v]) => v !== undefined))
});
const client = await experimental_createMCPClient({
transport,
});
const tools = await client.tools();
try {
const result = streamText({
model,
tools,
system: "You are an assistant responsible for evaluating the results of calling various tools. Given the user's query, use the tools available to you to answer the question.",
prompt,
maxRetries: 1,
maxSteps: 10,
onError: ({ error }) => {
console.error(error);
},
});
let fullText = '';
for await (const chunk of result.fullStream) {
if (chunk.type === 'text-delta') {
fullText += chunk.textDelta;
}
}
return fullText;
}
catch (error) {
console.error('Error in runEvals:', error);
throw error;
}
}
export async function grade(model = defaultModel, prompt, serverPath) {
const finalServerPath = serverPath || process.argv[3]; // Use provided serverPath or CLI args
if (!finalServerPath) {
throw new Error('Server path not provided');
}
const result = await runEvals(model, prompt, finalServerPath);
const evalSystemPromt = `You are an expert evaluator assessing how well an LLM answers a given question. Review the provided answer and score it from 1 to 5 in each of the following categories:
Accuracy Does the answer contain factual errors or hallucinations?
Completeness Does the answer fully address all parts of the question?
Relevance Is the information directly related to the question?
Clarity Is the explanation easy to understand and well-structured?
Reasoning Does the answer show logical thinking or provide evidence or rationale?
Return your evaluation as a JSON object in the format:
{
"accuracy": 1-5,
"completeness": 1-5,
"relevance": 1-5,
"clarity": 1-5,
"reasoning": 1-5,
"overall_comments": "A short paragraph summarizing the strengths and weaknesses of the answer."
}`;
const evalPromt = `Here is the user input: ${prompt}
Here is the LLM's answer: ${result}`;
const evalResult = streamText({
model,
maxRetries: 1,
maxSteps: 10,
system: evalSystemPromt,
prompt: evalPromt,
onError: ({ error }) => {
console.error(error);
},
});
for await (const _ of evalResult.fullStream) {
}
return await evalResult.text;
}
export async function runAllEvals(config, serverPath) {
const results = new Map();
let transport;
try {
transport = new Experimental_StdioMCPTransport({
command: "tsx",
args: [serverPath],
env: Object.fromEntries(Object.entries(process.env).filter(([_, v]) => v !== undefined))
});
const client = await experimental_createMCPClient({
transport,
});
for (const evaluation of config.evals) {
console.log(`Running ${evaluation.name}...`);
try {
const result = await evaluation.run(config.model);
results.set(evaluation.name, result);
}
catch (error) {
console.error(`Error running ${evaluation.name}:`, error);
results.set(evaluation.name, { error: error instanceof Error ? error.message : String(error) });
}
}
return results;
}
finally {
// Clean up the transport
if (transport) {
await transport.close?.();
}
}
}
// Export everything needed by consumers
export * from './types.js';
export { metrics } from './metrics.js';
//# sourceMappingURL=index.js.map

1
node_modules/mcp-evals/dist/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,4BAA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cAAc,CAAC"}

23
node_modules/mcp-evals/dist/metrics.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
export interface MetricsConfig {
metricsPort?: number;
otelExporterUrl?: string;
serviceName?: string;
debug?: boolean;
enableTracing?: boolean;
otelEndpoint?: string;
}
declare class Metrics {
private static instance;
private sdk;
private tracer;
private registry;
private metrics;
private metricsServer;
private constructor();
static initialize(metricsPort?: number, options?: {}): Metrics;
}
export declare const metrics: {
initialize: (metricsPort?: number, options?: {}) => Metrics;
};
export {};
//# sourceMappingURL=metrics.d.ts.map

1
node_modules/mcp-evals/dist/metrics.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAEH,cAAM,OAAO;IACX,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAU;IACjC,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,OAAO,CAIb;IACF,OAAO,CAAC,aAAa,CAAsB;IAE3C,OAAO;IAkEP,MAAM,CAAC,UAAU,CAAC,WAAW,SAAO,EAAE,OAAO,KAAK;CAkEnD;AAED,eAAO,MAAM,OAAO;;CAEnB,CAAC"}

142
node_modules/mcp-evals/dist/metrics.js generated vendored Normal file
View File

@@ -0,0 +1,142 @@
// @ts-nocheck
// metrics.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { NodeSDK } from '@opentelemetry/sdk-node';
import { resourceFromAttributes } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { trace, SpanStatusCode } from '@opentelemetry/api';
import { Registry, Counter, Histogram } from 'prom-client';
import express from 'express';
class Metrics {
static instance;
sdk;
tracer;
registry;
metrics;
metricsServer;
constructor(options = {}) {
// Initialize OpenTelemetry if tracing is enabled
if (options.enableTracing) {
// Default to local collector endpoint if not specified
const otelEndpoint = options.otelEndpoint || 'http://localhost:4318/v1/traces';
console.log(`Configuring OpenTelemetry with endpoint: ${otelEndpoint}`);
const exporterOptions = {
url: otelEndpoint,
headers: {}, // Additional headers if needed
concurrencyLimit: 10
};
this.sdk = new NodeSDK({
resource: resourceFromAttributes({
[SemanticResourceAttributes.SERVICE_NAME]: options.serviceName || 'mcp-server',
}),
spanProcessor: new SimpleSpanProcessor(new OTLPTraceExporter(exporterOptions)),
});
// Start the SDK
try {
this.sdk.start();
console.log(`OpenTelemetry SDK started successfully, sending traces to ${otelEndpoint}`);
}
catch (error) {
console.error('Failed to start OpenTelemetry SDK:', error);
}
}
else {
console.log('OpenTelemetry tracing is disabled');
}
this.tracer = trace.getTracer('mcp-tracer');
// Initialize Prometheus metrics
this.registry = new Registry();
this.metrics = {
toolCalls: new Counter({
name: 'mcp_tool_calls_total',
help: 'Total number of tool calls',
labelNames: ['tool_name'],
registers: [this.registry]
}),
toolErrors: new Counter({
name: 'mcp_tool_errors_total',
help: 'Total number of tool errors',
labelNames: ['tool_name'],
registers: [this.registry]
}),
toolLatency: new Histogram({
name: 'mcp_tool_latency_seconds',
help: 'Tool call latency in seconds',
labelNames: ['tool_name'],
buckets: [0.1, 0.5, 1, 2, 5],
registers: [this.registry]
})
};
// Setup metrics server
this.metricsServer = express();
this.metricsServer.get('/metrics', async (req, res) => {
res.set('Content-Type', this.registry.contentType);
res.end(await this.registry.metrics());
});
}
static initialize(metricsPort = 9090, options = {}) {
if (!Metrics.instance) {
Metrics.instance = new Metrics(options);
// Patch the McpServer prototype to add instrumentation
const originalTool = McpServer.prototype.tool;
McpServer.prototype.tool = function (...args) {
// The tool method can be called with multiple signatures:
// (name, description, parameters, handler)
// (name, description, parameters, options, handler)
const name = args[0];
const description = args[1];
const parameters = args[2];
// Last arg is always the handler
const handler = args[args.length - 1];
// Check if options are present (second to last argument when length > 4)
const hasOptions = args.length > 4;
const options = hasOptions ? args[3] : undefined;
// Create new args array with wrapped handler
const newArgs = hasOptions
? [name, description, parameters, options]
: [name, description, parameters];
// Add wrapped handler that includes instrumentation
newArgs.push(async (...handlerArgs) => {
const span = Metrics.instance.tracer.startSpan(`tool.${name}`);
const startTime = process.hrtime();
try {
// Increment tool calls counter
Metrics.instance.metrics.toolCalls.inc({ tool_name: name });
const result = await handler(...handlerArgs);
span.setStatus({ code: SpanStatusCode.OK });
return result;
}
catch (error) {
// Increment error counter
Metrics.instance.metrics.toolErrors.inc({ tool_name: name });
span.setStatus({
code: SpanStatusCode.ERROR,
message: error instanceof Error ? error.message : String(error)
});
throw error;
}
finally {
// Record latency
const [seconds, nanoseconds] = process.hrtime(startTime);
const duration = seconds + nanoseconds / 1e9;
Metrics.instance.metrics.toolLatency.observe({ tool_name: name }, duration);
span.end();
}
});
// Call original tool method with new args
return originalTool.apply(this, newArgs);
};
// Start metrics server
Metrics.instance.metricsServer.listen(metricsPort, () => {
console.log(`Metrics server listening on port ${metricsPort}`);
});
}
return Metrics.instance;
}
}
export const metrics = {
initialize: (metricsPort = 9090, options = {}) => Metrics.initialize(metricsPort, options)
};
//# sourceMappingURL=metrics.js.map

1
node_modules/mcp-evals/dist/metrics.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EA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C;wBAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;wBAC5E,IAAI,CAAC,GAAG,EAAE,CAAC;oBACf,CAAC;gBACL,CAAC,CAAC,CAAC;gBAEH,0CAA0C;gBAC1C,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC3C,CAAC,CAAC;YAEF,uBAAuB;YACvB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE;gBACtD,OAAO,CAAC,GAAG,CAAC,oCAAoC,WAAW,EAAE,CAAC,CAAC;YACjE,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC,QAAQ,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,UAAU,EAAE,CAAC,WAAW,GAAG,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC;CAC3F,CAAC"}

34
node_modules/mcp-evals/dist/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import { type LanguageModel } from 'ai';
export interface EvalResult {
accuracy: number;
completeness: number;
relevance: number;
clarity: number;
reasoning: number;
overall_comments: string;
}
export interface EvalFunction {
name: string;
description: string;
run: (model: LanguageModel) => Promise<EvalResult>;
}
export interface EvalConfig {
model: LanguageModel;
evals: EvalFunction[];
}
export interface YamlModelConfig {
provider: 'openai' | 'anthropic';
name: string;
api_key?: string;
}
export interface YamlEval {
name: string;
description: string;
prompt: string;
expected_result?: string;
}
export interface YamlEvalConfig {
model?: YamlModelConfig;
evals: YamlEval[];
}
//# sourceMappingURL=types.d.ts.map

1
node_modules/mcp-evals/dist/types.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB"}

2
node_modules/mcp-evals/dist/types.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

1
node_modules/mcp-evals/dist/types.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}

14
node_modules/mcp-evals/dist/yaml-loader.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { YamlEvalConfig, EvalConfig } from './types.js';
/**
* Load and parse a YAML configuration file
*/
export declare function loadYamlConfig(filePath: string): YamlEvalConfig;
/**
* Convert a YAML configuration to an EvalConfig
*/
export declare function yamlConfigToEvalConfig(yamlConfig: YamlEvalConfig, serverPath: string): EvalConfig;
/**
* Load a YAML config file and convert it to an EvalConfig
*/
export declare function loadYamlEvalConfig(filePath: string, serverPath: string): EvalConfig;
//# sourceMappingURL=yaml-loader.d.ts.map

1
node_modules/mcp-evals/dist/yaml-loader.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"yaml-loader.d.ts","sourceRoot":"","sources":["../src/yaml-loader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAY,UAAU,EAAgB,MAAM,YAAY,CAAC;AAGhF;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAwB/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAkDjG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAGnF"}

96
node_modules/mcp-evals/dist/yaml-loader.js generated vendored Normal file
View File

@@ -0,0 +1,96 @@
import * as yaml from 'js-yaml';
import * as fs from 'fs';
import * as path from 'path';
import { openai } from "@ai-sdk/openai";
import { anthropic } from "@ai-sdk/anthropic";
import { grade } from './index.js';
/**
* Load and parse a YAML configuration file
*/
export function loadYamlConfig(filePath) {
try {
const absolutePath = path.resolve(filePath);
const fileContents = fs.readFileSync(absolutePath, 'utf8');
const config = yaml.load(fileContents);
if (!config || !config.evals || !Array.isArray(config.evals)) {
throw new Error('Invalid YAML config: must have an "evals" array');
}
// Validate each eval
for (const evalItem of config.evals) {
if (!evalItem.name || !evalItem.description || !evalItem.prompt) {
throw new Error(`Invalid eval: each eval must have "name", "description", and "prompt" fields`);
}
}
return config;
}
catch (error) {
if (error instanceof Error) {
throw new Error(`Failed to load YAML config: ${error.message}`);
}
throw new Error('Failed to load YAML config: Unknown error');
}
}
/**
* Convert a YAML configuration to an EvalConfig
*/
export function yamlConfigToEvalConfig(yamlConfig, serverPath) {
// Setup model
let model;
if (yamlConfig.model) {
if (yamlConfig.model.provider === 'openai') {
// Set the API key as an environment variable if provided
if (yamlConfig.model.api_key) {
process.env.OPENAI_API_KEY = yamlConfig.model.api_key;
}
model = openai(yamlConfig.model.name);
}
else if (yamlConfig.model.provider === 'anthropic') {
// Set the API key as an environment variable if provided
if (yamlConfig.model.api_key) {
process.env.ANTHROPIC_API_KEY = yamlConfig.model.api_key;
}
model = anthropic(yamlConfig.model.name);
}
else {
throw new Error(`Unsupported model provider: ${yamlConfig.model.provider}`);
}
}
else {
// Default to GPT-4
model = openai("gpt-4o");
}
// Convert YAML evals to EvalFunctions
const evalFunctions = yamlConfig.evals.map((yamlEval) => ({
name: yamlEval.name,
description: yamlEval.description,
run: async (evalModel) => {
try {
const result = await grade(evalModel, yamlEval.prompt, serverPath);
return JSON.parse(result);
}
catch (error) {
// If JSON parsing fails, return a default structure
return {
accuracy: 0,
completeness: 0,
relevance: 0,
clarity: 0,
reasoning: 0,
overall_comments: `Error running evaluation: ${error instanceof Error ? error.message : String(error)}`
};
}
}
}));
return {
model,
evals: evalFunctions
};
}
/**
* Load a YAML config file and convert it to an EvalConfig
*/
export function loadYamlEvalConfig(filePath, serverPath) {
const yamlConfig = loadYamlConfig(filePath);
return yamlConfigToEvalConfig(yamlConfig, serverPath);
}
//# sourceMappingURL=yaml-loader.js.map

1
node_modules/mcp-evals/dist/yaml-loader.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"yaml-loader.js","sourceRoot":"","sources":["../src/yaml-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OA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