@grekt/cli 6.43.0-beta.3 → 6.43.0-beta.4
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/dist/index.js +17 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -104498,18 +104498,30 @@ async function runViaCli(mode, config) {
|
|
|
104498
104498
|
const promptfooConfig = assemblePromptfooConfig(config, promptPath);
|
|
104499
104499
|
writeFileSync2(configPath, JSON.stringify(promptfooConfig, null, 2));
|
|
104500
104500
|
const cmd = getCommand(mode);
|
|
104501
|
-
const
|
|
104502
|
-
|
|
104503
|
-
|
|
104501
|
+
const proc2 = Bun.spawn([...cmd, "eval", "--config", configPath, "--output", outputPath, "--no-cache"], { stdout: "pipe", stderr: "pipe" });
|
|
104502
|
+
const exitCode = await proc2.exited;
|
|
104503
|
+
if (exitCode !== 0) {
|
|
104504
|
+
const stderr = await new Response(proc2.stderr).text();
|
|
104504
104505
|
throw new Error(`promptfoo eval failed: ${stderr}`);
|
|
104505
104506
|
}
|
|
104506
104507
|
const output = JSON.parse(readFileSync2(outputPath, "utf-8"));
|
|
104507
|
-
const results = output
|
|
104508
|
+
const results = extractResultsArray(output);
|
|
104508
104509
|
return extractFailures(results);
|
|
104509
104510
|
} finally {
|
|
104510
104511
|
rmSync2(tempDir, { recursive: true, force: true });
|
|
104511
104512
|
}
|
|
104512
104513
|
}
|
|
104514
|
+
function extractResultsArray(output) {
|
|
104515
|
+
if (Array.isArray(output.results))
|
|
104516
|
+
return output.results;
|
|
104517
|
+
const nested = output.results;
|
|
104518
|
+
if (nested && Array.isArray(nested.results))
|
|
104519
|
+
return nested.results;
|
|
104520
|
+
const table = nested?.table;
|
|
104521
|
+
if (table && Array.isArray(table.body))
|
|
104522
|
+
return table.body;
|
|
104523
|
+
return [];
|
|
104524
|
+
}
|
|
104513
104525
|
|
|
104514
104526
|
// src/eval/engine-resolver.ts
|
|
104515
104527
|
var AVAILABLE_ENGINES = [
|
|
@@ -104974,7 +104986,7 @@ var whoamiCommand = new Command("whoami").description("Show current user").actio
|
|
|
104974
104986
|
// package.json
|
|
104975
104987
|
var package_default = {
|
|
104976
104988
|
name: "@grekt/cli",
|
|
104977
|
-
version: "6.43.0-beta.
|
|
104989
|
+
version: "6.43.0-beta.4",
|
|
104978
104990
|
description: "AI tools versioned, synced, and shared across tools and teams",
|
|
104979
104991
|
type: "module",
|
|
104980
104992
|
bin: {
|