snapeval 2.2.0 → 3.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.
- package/README.md +2 -13
- package/bin/snapeval.ts +7 -44
- package/dist/bin/snapeval.d.ts +1 -1
- package/dist/bin/snapeval.js +6 -42
- package/dist/bin/snapeval.js.map +1 -1
- package/dist/src/adapters/copilot-sdk-client.d.ts +0 -4
- package/dist/src/adapters/copilot-sdk-client.js +2 -23
- package/dist/src/adapters/copilot-sdk-client.js.map +1 -1
- package/dist/src/adapters/harness/copilot-cli.js +1 -0
- package/dist/src/adapters/harness/copilot-cli.js.map +1 -1
- package/dist/src/adapters/harness/copilot-sdk.js +6 -16
- package/dist/src/adapters/harness/copilot-sdk.js.map +1 -1
- package/dist/src/adapters/harness/resolve.js +1 -5
- package/dist/src/adapters/harness/resolve.js.map +1 -1
- package/dist/src/adapters/inference/copilot-sdk.d.ts +1 -1
- package/dist/src/adapters/inference/copilot-sdk.js +4 -2
- package/dist/src/adapters/inference/copilot-sdk.js.map +1 -1
- package/dist/src/adapters/inference/github-models.js +3 -0
- package/dist/src/adapters/inference/github-models.js.map +1 -1
- package/dist/src/adapters/inference/resolve.js +6 -32
- package/dist/src/adapters/inference/resolve.js.map +1 -1
- package/dist/src/commands/eval.d.ts +1 -0
- package/dist/src/commands/eval.js +8 -0
- package/dist/src/commands/eval.js.map +1 -1
- package/dist/src/errors.d.ts +0 -6
- package/dist/src/errors.js +1 -13
- package/dist/src/errors.js.map +1 -1
- package/package.json +8 -11
- package/plugin.json +4 -2
- package/skills/create-evals/SKILL.md +152 -0
- package/skills/run-evals/SKILL.md +132 -0
- package/src/adapters/copilot-sdk-client.ts +2 -22
- package/src/adapters/harness/copilot-cli.ts +1 -0
- package/src/adapters/harness/copilot-sdk.ts +6 -17
- package/src/adapters/harness/resolve.ts +1 -8
- package/src/adapters/inference/copilot-sdk.ts +4 -2
- package/src/adapters/inference/github-models.ts +3 -0
- package/src/adapters/inference/resolve.ts +8 -43
- package/src/commands/eval.ts +14 -1
- package/src/errors.ts +1 -15
- package/assets/ideation-viewer.html +0 -469
- package/dist/src/adapters/inference/copilot.d.ts +0 -5
- package/dist/src/adapters/inference/copilot.js +0 -10
- package/dist/src/adapters/inference/copilot.js.map +0 -1
- package/dist/src/commands/review.d.ts +0 -8
- package/dist/src/commands/review.js +0 -32
- package/dist/src/commands/review.js.map +0 -1
- package/src/adapters/inference/copilot.ts +0 -12
- package/src/commands/review.ts +0 -46
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from 'node:child_process';
|
|
2
|
-
import type { InferenceAdapter, Message, ChatOptions } from '../../types.js';
|
|
3
|
-
|
|
4
|
-
export class CopilotInference implements InferenceAdapter {
|
|
5
|
-
readonly name = 'copilot';
|
|
6
|
-
|
|
7
|
-
async chat(messages: Message[], _options?: ChatOptions): Promise<string> {
|
|
8
|
-
const prompt = messages.map((m) => m.content).join('\n');
|
|
9
|
-
const result = execFileSync('copilot', ['-s', '--no-ask-user', '--model', 'gpt-4.1', '-p', prompt], { encoding: 'utf-8' });
|
|
10
|
-
return result.trim();
|
|
11
|
-
}
|
|
12
|
-
}
|
package/src/commands/review.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import * as fs from 'node:fs';
|
|
3
|
-
import * as path from 'node:path';
|
|
4
|
-
import * as process from 'node:process';
|
|
5
|
-
import type { Harness, InferenceAdapter, FeedbackData } from '../types.js';
|
|
6
|
-
import { evalCommand } from './eval.js';
|
|
7
|
-
import { TerminalReporter } from '../adapters/report/terminal.js';
|
|
8
|
-
|
|
9
|
-
export async function reviewCommand(
|
|
10
|
-
skillPath: string,
|
|
11
|
-
harness: Harness,
|
|
12
|
-
inference: InferenceAdapter,
|
|
13
|
-
options: { workspace?: string; runs?: number; oldSkill?: string; noOpen?: boolean; concurrency?: number }
|
|
14
|
-
): Promise<void> {
|
|
15
|
-
const results = await evalCommand(skillPath, harness, inference, options);
|
|
16
|
-
|
|
17
|
-
const terminal = new TerminalReporter();
|
|
18
|
-
await terminal.report(results);
|
|
19
|
-
|
|
20
|
-
// feedback.json template
|
|
21
|
-
const feedback: FeedbackData = {};
|
|
22
|
-
for (const run of results.evalRuns) {
|
|
23
|
-
feedback[`eval-${run.slug}`] = '';
|
|
24
|
-
}
|
|
25
|
-
fs.writeFileSync(
|
|
26
|
-
path.join(results.iterationDir, 'feedback.json'),
|
|
27
|
-
JSON.stringify(feedback, null, 2)
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
// Open in browser (placeholder - HTML reporter will be wired later)
|
|
31
|
-
if (!options.noOpen) {
|
|
32
|
-
const reportPath = path.join(results.iterationDir, 'benchmark.json');
|
|
33
|
-
openInBrowser(reportPath);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function openInBrowser(filePath: string): void {
|
|
38
|
-
const cmd =
|
|
39
|
-
process.platform === 'darwin' ? 'open' :
|
|
40
|
-
process.platform === 'win32' ? 'cmd' : 'xdg-open';
|
|
41
|
-
const args =
|
|
42
|
-
process.platform === 'win32' ? ['/c', 'start', '', filePath] : [filePath];
|
|
43
|
-
execFile(cmd, args, (err) => {
|
|
44
|
-
if (err) console.warn(`Could not open browser: ${err.message}`);
|
|
45
|
-
});
|
|
46
|
-
}
|