@gnsx/genesys.agent.eval 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +9 -0
  2. package/dist/src/adapters/anthropic-adapter.d.ts +24 -0
  3. package/dist/src/adapters/anthropic-adapter.d.ts.map +1 -0
  4. package/dist/src/adapters/anthropic-adapter.js +80 -0
  5. package/dist/src/adapters/anthropic-adapter.js.map +1 -0
  6. package/dist/src/adapters/gemini-adapter.d.ts +23 -0
  7. package/dist/src/adapters/gemini-adapter.d.ts.map +1 -0
  8. package/dist/src/adapters/gemini-adapter.js +79 -0
  9. package/dist/src/adapters/gemini-adapter.js.map +1 -0
  10. package/dist/src/adapters/ollama-adapter.d.ts +28 -0
  11. package/dist/src/adapters/ollama-adapter.d.ts.map +1 -0
  12. package/dist/src/adapters/ollama-adapter.js +54 -0
  13. package/dist/src/adapters/ollama-adapter.js.map +1 -0
  14. package/dist/src/adapters/openai-adapter.d.ts +24 -0
  15. package/dist/src/adapters/openai-adapter.d.ts.map +1 -0
  16. package/dist/src/adapters/openai-adapter.js +80 -0
  17. package/dist/src/adapters/openai-adapter.js.map +1 -0
  18. package/dist/src/adapters/pi-adapter.d.ts +27 -0
  19. package/dist/src/adapters/pi-adapter.d.ts.map +1 -0
  20. package/dist/src/adapters/pi-adapter.js +136 -0
  21. package/dist/src/adapters/pi-adapter.js.map +1 -0
  22. package/dist/src/agent-adapter.d.ts +130 -0
  23. package/dist/src/agent-adapter.d.ts.map +1 -0
  24. package/dist/src/agent-adapter.js +134 -0
  25. package/dist/src/agent-adapter.js.map +1 -0
  26. package/dist/src/args.d.ts +22 -0
  27. package/dist/src/args.d.ts.map +1 -0
  28. package/dist/src/args.js +224 -0
  29. package/dist/src/args.js.map +1 -0
  30. package/dist/src/cli-runner.d.ts +39 -0
  31. package/dist/src/cli-runner.d.ts.map +1 -0
  32. package/dist/src/cli-runner.js +105 -0
  33. package/dist/src/cli-runner.js.map +1 -0
  34. package/dist/src/embedding-judge.d.ts +93 -0
  35. package/dist/src/embedding-judge.d.ts.map +1 -0
  36. package/dist/src/embedding-judge.js +160 -0
  37. package/dist/src/embedding-judge.js.map +1 -0
  38. package/dist/src/index.d.ts +15 -0
  39. package/dist/src/index.d.ts.map +1 -0
  40. package/dist/src/index.js +20 -0
  41. package/dist/src/index.js.map +1 -0
  42. package/dist/src/judge.d.ts +95 -0
  43. package/dist/src/judge.d.ts.map +1 -0
  44. package/dist/src/judge.js +189 -0
  45. package/dist/src/judge.js.map +1 -0
  46. package/dist/src/launcher.d.ts +9 -0
  47. package/dist/src/launcher.d.ts.map +1 -0
  48. package/dist/src/launcher.js +129 -0
  49. package/dist/src/launcher.js.map +1 -0
  50. package/dist/src/reporter.d.ts +86 -0
  51. package/dist/src/reporter.d.ts.map +1 -0
  52. package/dist/src/reporter.js +384 -0
  53. package/dist/src/reporter.js.map +1 -0
  54. package/dist/src/runner.d.ts +75 -0
  55. package/dist/src/runner.d.ts.map +1 -0
  56. package/dist/src/runner.js +165 -0
  57. package/dist/src/runner.js.map +1 -0
  58. package/dist/src/test-loader.d.ts +66 -0
  59. package/dist/src/test-loader.d.ts.map +1 -0
  60. package/dist/src/test-loader.js +140 -0
  61. package/dist/src/test-loader.js.map +1 -0
  62. package/dist/src/types.d.ts +161 -0
  63. package/dist/src/types.d.ts.map +1 -0
  64. package/dist/src/types.js +7 -0
  65. package/dist/src/types.js.map +1 -0
  66. package/dist/src/utils/package.d.ts +16 -0
  67. package/dist/src/utils/package.d.ts.map +1 -0
  68. package/dist/src/utils/package.js +30 -0
  69. package/dist/src/utils/package.js.map +1 -0
  70. package/dist/tsconfig.tsbuildinfo +1 -0
  71. package/examples/basic-tests.yaml +22 -0
  72. package/package.json +41 -0
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Genesys Agent Eval CLI launcher.
4
+ *
5
+ * Entry point for the evaluation harness. Spawns pi or genesys CLI
6
+ * processes to run tests and evaluates the results.
7
+ */
8
+ import { resolve } from 'node:path';
9
+ import { parseArgs, printHelp, printVersion } from './args.js';
10
+ import { EmbeddingJudge } from './embedding-judge.js';
11
+ import { Judge } from './judge.js';
12
+ import { Reporter } from './reporter.js';
13
+ import { runEvaluation } from './runner.js';
14
+ /**
15
+ * ANSI color codes for console output.
16
+ */
17
+ const colors = {
18
+ reset: '\x1b[0m',
19
+ bright: '\x1b[1m',
20
+ dim: '\x1b[2m',
21
+ green: '\x1b[32m',
22
+ red: '\x1b[31m',
23
+ yellow: '\x1b[33m',
24
+ blue: '\x1b[34m',
25
+ cyan: '\x1b[36m',
26
+ };
27
+ /**
28
+ * Progress callback implementation for console output.
29
+ */
30
+ function createProgressCallback(verbose) {
31
+ return {
32
+ onTestStart(testId, index, total) {
33
+ if (verbose) {
34
+ console.log(`[${index + 1}/${total}] Running: ${testId}`);
35
+ }
36
+ },
37
+ onTestComplete(result, index, total) {
38
+ const status = result.passed ? 'PASS' : 'FAIL';
39
+ const score = `${(result.judgeScore * 100).toFixed(0)}%`;
40
+ const statusColor = result.passed ? colors.green : colors.red;
41
+ console.log(`${statusColor}${status}${colors.reset}`);
42
+ },
43
+ onTestError(testId, error, index, total) {
44
+ console.error(`[${index + 1}/${total}] ERROR - ${testId}: ${error}`);
45
+ },
46
+ };
47
+ }
48
+ /**
49
+ * Main entry point.
50
+ */
51
+ async function main(argv) {
52
+ const args = parseArgs(argv);
53
+ if (args.version) {
54
+ printVersion();
55
+ process.exit(0);
56
+ }
57
+ if (args.help) {
58
+ printHelp();
59
+ process.exit(0);
60
+ }
61
+ const cwd = resolve(args.cwd);
62
+ // Build configuration
63
+ const config = {
64
+ testsPath: args.tests,
65
+ agent: args.agent,
66
+ cwd,
67
+ timeout: args.timeout * 1000, // Convert to milliseconds
68
+ outputPath: args.output,
69
+ format: args.format,
70
+ parallel: args.parallel,
71
+ judge: {
72
+ provider: args.judgeProvider,
73
+ model: args.judgeModel,
74
+ },
75
+ };
76
+ console.log(`${colors.cyan}Agent:${colors.reset} ${colors.bright}${args.agent}${colors.reset}`);
77
+ console.log(`${colors.cyan}Judge:${colors.reset} ${args.judgeType}`);
78
+ console.log(`${colors.cyan}Working directory:${colors.reset} ${cwd}`);
79
+ console.log(`${colors.cyan}Test file:${colors.reset} ${args.tests}`);
80
+ console.log(`${colors.cyan}Timeout:${colors.reset} ${args.timeout}s per test`);
81
+ console.log(`${colors.cyan}Parallelism:${colors.reset} ${args.parallel}`);
82
+ console.log('');
83
+ // Create judge based on type
84
+ let judgeEvaluator;
85
+ if (args.judgeType === 'embedding') {
86
+ const judge = new EmbeddingJudge({ passThreshold: 0.6 });
87
+ judgeEvaluator = judge.createEvaluator();
88
+ }
89
+ else {
90
+ const judge = new Judge({
91
+ provider: args.judgeProvider,
92
+ model: args.judgeModel,
93
+ passThreshold: 0.7,
94
+ });
95
+ judgeEvaluator = judge.createEvaluator();
96
+ }
97
+ // Run evaluation
98
+ const progress = createProgressCallback(args.parallel > 1 || args.format === 'console');
99
+ try {
100
+ const results = await runEvaluation(config, judgeEvaluator, progress);
101
+ // Report results
102
+ const reporter = new Reporter({
103
+ format: args.format,
104
+ outputPath: args.output,
105
+ });
106
+ await reporter.reportAndSave(results);
107
+ // Exit with appropriate code
108
+ process.exit(results.summary.failed > 0 ? 1 : 0);
109
+ }
110
+ catch (error) {
111
+ console.error(`Evaluation failed: ${error instanceof Error ? error.message : String(error)}`);
112
+ // Provide more context for common errors
113
+ if (error instanceof Error) {
114
+ if (error.message.includes('ENOENT')) {
115
+ console.error(`Make sure the ${args.agent} CLI is installed and in your PATH.`);
116
+ }
117
+ if (error.message.includes('ANTHROPIC_API_KEY') || error.message.includes('OPENAI_API_KEY')) {
118
+ console.error('Set the appropriate API key environment variable for the LLM judge.');
119
+ }
120
+ }
121
+ process.exit(1);
122
+ }
123
+ }
124
+ // Run main
125
+ main(process.argv.slice(2)).catch((err) => {
126
+ console.error(err instanceof Error ? err.message : String(err));
127
+ process.exit(1);
128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E,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,WAAW;AACX,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Reporter for formatting and outputting evaluation results.
3
+ *
4
+ * Supports multiple output formats:
5
+ * - console: Rich text table output to stdout
6
+ * - json: Machine-readable JSON output
7
+ * - html: Rich HTML report with styling
8
+ *
9
+ * @module reporter
10
+ */
11
+ import type { EvalResults } from './types.js';
12
+ /**
13
+ * Output format options.
14
+ */
15
+ export type OutputFormat = 'console' | 'json' | 'html';
16
+ /**
17
+ * Reporter configuration.
18
+ */
19
+ export interface ReporterConfig {
20
+ /** Output format */
21
+ format: OutputFormat;
22
+ /** Output file path (optional, defaults to stdout) */
23
+ outputPath?: string;
24
+ }
25
+ /**
26
+ * Reporter class for formatting evaluation results.
27
+ */
28
+ export declare class Reporter {
29
+ private _config;
30
+ constructor(config: ReporterConfig);
31
+ /**
32
+ * Format results as a console table.
33
+ *
34
+ * @param results - Evaluation results
35
+ * @returns Formatted string for console output
36
+ */
37
+ private formatConsole;
38
+ /**
39
+ * Format results as JSON.
40
+ *
41
+ * @param results - Evaluation results
42
+ * @returns JSON string
43
+ */
44
+ private formatJson;
45
+ /**
46
+ * Format results as HTML.
47
+ *
48
+ * @param results - Evaluation results
49
+ * @returns HTML string
50
+ */
51
+ private formatHtml;
52
+ /**
53
+ * Report evaluation results.
54
+ *
55
+ * @param results - Evaluation results
56
+ * @returns The formatted output string
57
+ */
58
+ report(results: EvalResults): string;
59
+ /**
60
+ * Report results and optionally write to file.
61
+ *
62
+ * @param results - Evaluation results
63
+ */
64
+ reportAndSave(results: EvalResults): Promise<void>;
65
+ /**
66
+ * Get the reporter configuration.
67
+ */
68
+ get config(): ReporterConfig;
69
+ }
70
+ /**
71
+ * Quick report function.
72
+ *
73
+ * @param results - Evaluation results
74
+ * @param format - Output format
75
+ * @returns Formatted string
76
+ */
77
+ export declare function formatResults(results: EvalResults, format: OutputFormat): string;
78
+ /**
79
+ * Report and save results.
80
+ *
81
+ * @param results - Evaluation results
82
+ * @param format - Output format
83
+ * @param outputPath - Optional output file path
84
+ */
85
+ export declare function reportResults(results: EvalResults, format: OutputFormat, outputPath?: string): Promise<void>;
86
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAC;IAErB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAgDD;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,EAAE,cAAc;IAIlC;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IA8ErB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAIlB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAkKlB;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM;IAepC;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAexD;;OAEG;IACH,IAAI,MAAM,IAAI,cAAc,CAE3B;CACF;AAcD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAGhF;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,YAAY,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,384 @@
1
+ /**
2
+ * Reporter for formatting and outputting evaluation results.
3
+ *
4
+ * Supports multiple output formats:
5
+ * - console: Rich text table output to stdout
6
+ * - json: Machine-readable JSON output
7
+ * - html: Rich HTML report with styling
8
+ *
9
+ * @module reporter
10
+ */
11
+ import { writeFile } from 'node:fs/promises';
12
+ /**
13
+ * Format duration in milliseconds to human-readable string.
14
+ */
15
+ function formatDuration(ms) {
16
+ if (ms < 1000) {
17
+ return `${ms}ms`;
18
+ }
19
+ return `${(ms / 1000).toFixed(2)}s`;
20
+ }
21
+ /**
22
+ * Truncate string to max length with ellipsis.
23
+ */
24
+ function truncate(str, maxLength) {
25
+ if (str.length <= maxLength) {
26
+ return str;
27
+ }
28
+ return str.slice(0, maxLength - 3) + '...';
29
+ }
30
+ /**
31
+ * Format test result for console output.
32
+ */
33
+ function formatResultForConsole(result, maxWidth) {
34
+ const status = result.passed ? 'PASS' : 'FAIL';
35
+ const score = `${(result.judgeScore * 100).toFixed(0)}%`;
36
+ const duration = formatDuration(result.durationMs);
37
+ const id = truncate(result.testId, 20);
38
+ return ` ${status.padEnd(4)} | ${id.padEnd(20)} | ${score.padEnd(4)} | ${duration}`;
39
+ }
40
+ /**
41
+ * ANSI color codes for console output.
42
+ */
43
+ const colors = {
44
+ reset: '\x1b[0m',
45
+ bright: '\x1b[1m',
46
+ dim: '\x1b[2m',
47
+ green: '\x1b[32m',
48
+ red: '\x1b[31m',
49
+ yellow: '\x1b[33m',
50
+ blue: '\x1b[34m',
51
+ cyan: '\x1b[36m',
52
+ };
53
+ /**
54
+ * Reporter class for formatting evaluation results.
55
+ */
56
+ export class Reporter {
57
+ _config;
58
+ constructor(config) {
59
+ this._config = config;
60
+ }
61
+ /**
62
+ * Format results as a console table.
63
+ *
64
+ * @param results - Evaluation results
65
+ * @returns Formatted string for console output
66
+ */
67
+ formatConsole(results) {
68
+ const lines = [];
69
+ // Header
70
+ lines.push('');
71
+ lines.push(`${colors.bright}Evaluation Results${colors.reset}`);
72
+ lines.push(`${colors.dim}${'='.repeat(60)}${colors.reset}`);
73
+ lines.push('');
74
+ // Suite info
75
+ lines.push(`${colors.cyan}Suite:${colors.reset} ${results.suite.name}`);
76
+ if (results.suite.description) {
77
+ lines.push(`${colors.cyan}Description:${colors.reset} ${results.suite.description}`);
78
+ }
79
+ lines.push(`${colors.cyan}Agent:${colors.reset} ${results.agent}`);
80
+ lines.push(`${colors.cyan}Timestamp:${colors.reset} ${new Date(results.timestamp).toLocaleString()}`);
81
+ lines.push('');
82
+ // Summary
83
+ const { summary } = results;
84
+ const statusColor = summary.failed === 0 ? colors.green : colors.red;
85
+ lines.push(`${colors.bright}Summary:${colors.reset}`);
86
+ lines.push(` ${colors.cyan}Total:${colors.reset} ${summary.total}`);
87
+ lines.push(` ${colors.green}Passed:${colors.reset} ${summary.passed}`);
88
+ lines.push(` ${colors.red}Failed:${colors.reset} ${summary.failed}`);
89
+ lines.push(` ${colors.yellow}Avg Score:${colors.reset} ${(summary.avgScore * 100).toFixed(1)}%`);
90
+ lines.push(` ${colors.dim}Duration:${colors.reset} ${formatDuration(summary.totalDurationMs)}`);
91
+ lines.push('');
92
+ // Test results table
93
+ lines.push(`${colors.bright}Test Results:${colors.reset}`);
94
+ lines.push(` ${colors.dim}Status | ID | Score | Duration${colors.reset}`);
95
+ lines.push(` ${colors.dim}${'-'.repeat(55)}${colors.reset}`);
96
+ const failedResults = [];
97
+ for (const result of results.results) {
98
+ const color = result.passed ? colors.green : colors.red;
99
+ lines.push(`${color}${formatResultForConsole(result, 80)}${colors.reset}`);
100
+ if (!result.passed) {
101
+ failedResults.push(result);
102
+ }
103
+ }
104
+ lines.push('');
105
+ // Show details for failed tests
106
+ if (failedResults.length > 0) {
107
+ lines.push(`${colors.bright}Failed Test Details:${colors.reset}`);
108
+ lines.push(`${colors.dim}${'='.repeat(60)}${colors.reset}`);
109
+ for (const result of failedResults) {
110
+ lines.push('');
111
+ lines.push(`${colors.red}${colors.bright}Test: ${result.testId}${colors.reset}`);
112
+ lines.push(`${colors.dim}Input:${colors.reset} ${result.input}`);
113
+ lines.push(`${colors.yellow}Expected:${colors.reset} ${result.expectedOutput}`);
114
+ lines.push(`${colors.cyan}Actual:${colors.reset} ${result.actualOutput}`);
115
+ if (result.judgeReasoning) {
116
+ lines.push(`${colors.dim}Reasoning: ${result.judgeReasoning}${colors.reset}`);
117
+ }
118
+ lines.push(`${colors.dim}${'-'.repeat(40)}${colors.reset}`);
119
+ }
120
+ lines.push('');
121
+ }
122
+ // Footer
123
+ if (summary.failed > 0) {
124
+ lines.push(`${colors.yellow}Some tests failed. Review the results above.${colors.reset}`);
125
+ }
126
+ else {
127
+ lines.push(`${colors.green}All tests passed!${colors.reset}`);
128
+ }
129
+ lines.push('');
130
+ return lines.join('\n');
131
+ }
132
+ /**
133
+ * Format results as JSON.
134
+ *
135
+ * @param results - Evaluation results
136
+ * @returns JSON string
137
+ */
138
+ formatJson(results) {
139
+ return JSON.stringify(results, null, 2);
140
+ }
141
+ /**
142
+ * Format results as HTML.
143
+ *
144
+ * @param results - Evaluation results
145
+ * @returns HTML string
146
+ */
147
+ formatHtml(results) {
148
+ const { summary } = results;
149
+ const allPassed = summary.failed === 0;
150
+ const testRows = results.results.map(result => `
151
+ <tr class="${result.passed ? 'passed' : 'failed'}">
152
+ <td class="status">${result.passed ? 'PASS' : 'FAIL'}</td>
153
+ <td class="id">${escapeHtml(result.testId)}</td>
154
+ <td class="score">${(result.judgeScore * 100).toFixed(0)}%</td>
155
+ <td class="duration">${formatDuration(result.durationMs)}</td>
156
+ <td class="reasoning">${escapeHtml(truncate(result.judgeReasoning, 100))}</td>
157
+ </tr>
158
+ `).join('\n');
159
+ return `<!DOCTYPE html>
160
+ <html lang="en">
161
+ <head>
162
+ <meta charset="UTF-8">
163
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
164
+ <title>Eval Results: ${escapeHtml(results.suite.name)}</title>
165
+ <style>
166
+ * { box-sizing: border-box; }
167
+ body {
168
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
169
+ line-height: 1.6;
170
+ max-width: 1200px;
171
+ margin: 0 auto;
172
+ padding: 2rem;
173
+ background: #f5f5f5;
174
+ }
175
+ .container {
176
+ background: white;
177
+ border-radius: 8px;
178
+ padding: 2rem;
179
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
180
+ }
181
+ h1 { margin-top: 0; color: #333; }
182
+ h2 { color: #555; border-bottom: 2px solid #eee; padding-bottom: 0.5rem; }
183
+ .meta {
184
+ display: grid;
185
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
186
+ gap: 1rem;
187
+ margin-bottom: 2rem;
188
+ }
189
+ .meta-item {
190
+ background: #f8f9fa;
191
+ padding: 1rem;
192
+ border-radius: 4px;
193
+ }
194
+ .meta-label { font-weight: 600; color: #666; font-size: 0.875rem; }
195
+ .meta-value { color: #333; }
196
+ .summary {
197
+ display: grid;
198
+ grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
199
+ gap: 1rem;
200
+ margin: 2rem 0;
201
+ }
202
+ .summary-card {
203
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
204
+ color: white;
205
+ padding: 1.5rem;
206
+ border-radius: 8px;
207
+ text-align: center;
208
+ }
209
+ .summary-card.passed { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
210
+ .summary-card.failed { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); }
211
+ .summary-card.warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
212
+ .summary-value { font-size: 2rem; font-weight: bold; }
213
+ .summary-label { font-size: 0.875rem; opacity: 0.9; }
214
+ table {
215
+ width: 100%;
216
+ border-collapse: collapse;
217
+ margin-top: 1rem;
218
+ }
219
+ th, td {
220
+ padding: 0.75rem;
221
+ text-align: left;
222
+ border-bottom: 1px solid #eee;
223
+ }
224
+ th {
225
+ font-weight: 600;
226
+ color: #555;
227
+ background: #f8f9fa;
228
+ }
229
+ tr.passed .status { color: #11998e; font-weight: 600; }
230
+ tr.failed .status { color: #eb3349; font-weight: 600; }
231
+ .footer {
232
+ margin-top: 2rem;
233
+ padding-top: 1rem;
234
+ border-top: 1px solid #eee;
235
+ text-align: center;
236
+ color: #666;
237
+ }
238
+ </style>
239
+ </head>
240
+ <body>
241
+ <div class="container">
242
+ <h1>Evaluation Results</h1>
243
+
244
+ <div class="meta">
245
+ <div class="meta-item">
246
+ <div class="meta-label">Suite</div>
247
+ <div class="meta-value">${escapeHtml(results.suite.name)}</div>
248
+ </div>
249
+ <div class="meta-item">
250
+ <div class="meta-label">Agent</div>
251
+ <div class="meta-value">${escapeHtml(results.agent)}</div>
252
+ </div>
253
+ <div class="meta-item">
254
+ <div class="meta-label">Timestamp</div>
255
+ <div class="meta-value">${new Date(results.timestamp).toLocaleString()}</div>
256
+ </div>
257
+ </div>
258
+
259
+ <h2>Summary</h2>
260
+ <div class="summary">
261
+ <div class="summary-card">
262
+ <div class="summary-value">${summary.total}</div>
263
+ <div class="summary-label">Total Tests</div>
264
+ </div>
265
+ <div class="summary-card ${summary.passed === summary.total ? 'passed' : summary.passed === 0 ? 'failed' : 'warning'}">
266
+ <div class="summary-value">${summary.passed}</div>
267
+ <div class="summary-label">Passed</div>
268
+ </div>
269
+ <div class="summary-card ${summary.failed === 0 ? 'passed' : 'failed'}">
270
+ <div class="summary-value">${summary.failed}</div>
271
+ <div class="summary-label">Failed</div>
272
+ </div>
273
+ <div class="summary-card">
274
+ <div class="summary-value">${(summary.avgScore * 100).toFixed(1)}%</div>
275
+ <div class="summary-label">Avg Score</div>
276
+ </div>
277
+ <div class="summary-card">
278
+ <div class="summary-value">${formatDuration(summary.totalDurationMs)}</div>
279
+ <div class="summary-label">Duration</div>
280
+ </div>
281
+ </div>
282
+
283
+ <h2>Test Results</h2>
284
+ <table>
285
+ <thead>
286
+ <tr>
287
+ <th>Status</th>
288
+ <th>ID</th>
289
+ <th>Score</th>
290
+ <th>Duration</th>
291
+ <th>Reasoning</th>
292
+ </tr>
293
+ </thead>
294
+ <tbody>
295
+ ${testRows}
296
+ </tbody>
297
+ </table>
298
+
299
+ <div class="footer">
300
+ <p>Generated by genesys-eval</p>
301
+ </div>
302
+ </div>
303
+ </body>
304
+ </html>`;
305
+ }
306
+ /**
307
+ * Report evaluation results.
308
+ *
309
+ * @param results - Evaluation results
310
+ * @returns The formatted output string
311
+ */
312
+ report(results) {
313
+ switch (this._config.format) {
314
+ case 'json': {
315
+ return this.formatJson(results);
316
+ }
317
+ case 'html': {
318
+ return this.formatHtml(results);
319
+ }
320
+ case 'console':
321
+ default: {
322
+ return this.formatConsole(results);
323
+ }
324
+ }
325
+ }
326
+ /**
327
+ * Report results and optionally write to file.
328
+ *
329
+ * @param results - Evaluation results
330
+ */
331
+ async reportAndSave(results) {
332
+ const output = this.report(results);
333
+ if (this._config.outputPath) {
334
+ await writeFile(this._config.outputPath, output, 'utf-8');
335
+ }
336
+ // Always print to console if format is console, or if no output file
337
+ if (this._config.format === 'console' || !this._config.outputPath) {
338
+ console.log(output);
339
+ }
340
+ else {
341
+ console.log(`Results written to: ${this._config.outputPath}`);
342
+ }
343
+ }
344
+ /**
345
+ * Get the reporter configuration.
346
+ */
347
+ get config() {
348
+ return this._config;
349
+ }
350
+ }
351
+ /**
352
+ * Escape HTML special characters.
353
+ */
354
+ function escapeHtml(text) {
355
+ return text
356
+ .replace(/&/g, '&amp;')
357
+ .replace(/</g, '&lt;')
358
+ .replace(/>/g, '&gt;')
359
+ .replace(/"/g, '&quot;')
360
+ .replace(/'/g, '&#039;');
361
+ }
362
+ /**
363
+ * Quick report function.
364
+ *
365
+ * @param results - Evaluation results
366
+ * @param format - Output format
367
+ * @returns Formatted string
368
+ */
369
+ export function formatResults(results, format) {
370
+ const reporter = new Reporter({ format });
371
+ return reporter.report(results);
372
+ }
373
+ /**
374
+ * Report and save results.
375
+ *
376
+ * @param results - Evaluation results
377
+ * @param format - Output format
378
+ * @param outputPath - Optional output file path
379
+ */
380
+ export async function reportResults(results, format, outputPath) {
381
+ const reporter = new Reporter({ format, outputPath });
382
+ await reporter.reportAndSave(results);
383
+ }
384
+ //# sourceMappingURL=reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../src/reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAoB7C;;GAEG;AACH,SAAS,cAAc,CAAC,EAAU;IAChC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;QACd,OAAO,GAAG,EAAE,IAAI,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,GAAW,EAAE,SAAiB;IAC9C,IAAI,GAAG,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,MAAkB,EAAE,QAAgB;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CA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