agentv 1.2.0 → 1.3.1
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/{chunk-IVIT4U6S.js → chunk-6R2YRXCQ.js} +236 -150
- package/dist/chunk-6R2YRXCQ.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/.claude/skills/agentv-eval-builder/SKILL.md +40 -3
- package/dist/templates/.claude/skills/agentv-eval-builder/references/batch-cli-evaluator.md +288 -0
- package/dist/templates/.claude/skills/agentv-eval-builder/references/example-evals.md +100 -14
- package/package.json +2 -2
- package/dist/chunk-IVIT4U6S.js.map +0 -1
|
@@ -164,7 +164,7 @@ import { access as access6, mkdir as mkdir7 } from "node:fs/promises";
|
|
|
164
164
|
import path19 from "node:path";
|
|
165
165
|
import { pathToFileURL } from "node:url";
|
|
166
166
|
|
|
167
|
-
// ../../packages/core/dist/chunk-
|
|
167
|
+
// ../../packages/core/dist/chunk-4A6L2F6L.js
|
|
168
168
|
import { constants } from "node:fs";
|
|
169
169
|
import { access, readFile } from "node:fs/promises";
|
|
170
170
|
import path from "node:path";
|
|
@@ -4211,7 +4211,7 @@ var coerce = {
|
|
|
4211
4211
|
};
|
|
4212
4212
|
var NEVER = INVALID;
|
|
4213
4213
|
|
|
4214
|
-
// ../../packages/core/dist/chunk-
|
|
4214
|
+
// ../../packages/core/dist/chunk-4A6L2F6L.js
|
|
4215
4215
|
async function fileExists(filePath) {
|
|
4216
4216
|
try {
|
|
4217
4217
|
await access(filePath, constants.F_OK);
|
|
@@ -4612,10 +4612,14 @@ function resolveCliConfig(target, env, evalFilePath) {
|
|
|
4612
4612
|
const filesFormat = resolveOptionalLiteralString(
|
|
4613
4613
|
target.files_format ?? target.filesFormat ?? target.attachments_format ?? target.attachmentsFormat
|
|
4614
4614
|
);
|
|
4615
|
+
const verbose = resolveOptionalBoolean(target.verbose ?? target.cli_verbose ?? target.cliVerbose);
|
|
4615
4616
|
let cwd = resolveOptionalString(target.cwd, env, `${target.name} working directory`, {
|
|
4616
4617
|
allowLiteral: true,
|
|
4617
4618
|
optionalEnv: true
|
|
4618
4619
|
});
|
|
4620
|
+
if (cwd && evalFilePath && !path2.isAbsolute(cwd)) {
|
|
4621
|
+
cwd = path2.resolve(path2.dirname(path2.resolve(evalFilePath)), cwd);
|
|
4622
|
+
}
|
|
4619
4623
|
if (!cwd && evalFilePath) {
|
|
4620
4624
|
cwd = path2.dirname(path2.resolve(evalFilePath));
|
|
4621
4625
|
}
|
|
@@ -4623,7 +4627,7 @@ function resolveCliConfig(target, env, evalFilePath) {
|
|
|
4623
4627
|
target.timeout_seconds ?? target.timeoutSeconds,
|
|
4624
4628
|
`${target.name} timeout`
|
|
4625
4629
|
);
|
|
4626
|
-
const healthcheck = resolveCliHealthcheck(target.healthcheck, env, target.name);
|
|
4630
|
+
const healthcheck = resolveCliHealthcheck(target.healthcheck, env, target.name, evalFilePath);
|
|
4627
4631
|
const commandTemplate = resolveString(
|
|
4628
4632
|
commandTemplateSource,
|
|
4629
4633
|
env,
|
|
@@ -4636,7 +4640,8 @@ function resolveCliConfig(target, env, evalFilePath) {
|
|
|
4636
4640
|
filesFormat,
|
|
4637
4641
|
cwd,
|
|
4638
4642
|
timeoutMs,
|
|
4639
|
-
healthcheck
|
|
4643
|
+
healthcheck,
|
|
4644
|
+
verbose
|
|
4640
4645
|
};
|
|
4641
4646
|
}
|
|
4642
4647
|
function resolveTimeoutMs(source2, description) {
|
|
@@ -4649,7 +4654,7 @@ function resolveTimeoutMs(source2, description) {
|
|
|
4649
4654
|
}
|
|
4650
4655
|
return Math.floor(seconds * 1e3);
|
|
4651
4656
|
}
|
|
4652
|
-
function resolveCliHealthcheck(source2, env, targetName) {
|
|
4657
|
+
function resolveCliHealthcheck(source2, env, targetName, evalFilePath) {
|
|
4653
4658
|
if (source2 === void 0 || source2 === null) {
|
|
4654
4659
|
return void 0;
|
|
4655
4660
|
}
|
|
@@ -4682,11 +4687,12 @@ function resolveCliHealthcheck(source2, env, targetName) {
|
|
|
4682
4687
|
allowLiteral: true,
|
|
4683
4688
|
optionalEnv: true
|
|
4684
4689
|
});
|
|
4690
|
+
const resolvedCwd = cwd && evalFilePath && !path2.isAbsolute(cwd) ? path2.resolve(path2.dirname(path2.resolve(evalFilePath)), cwd) : cwd;
|
|
4685
4691
|
return {
|
|
4686
4692
|
type: "command",
|
|
4687
4693
|
commandTemplate,
|
|
4688
4694
|
timeoutMs,
|
|
4689
|
-
cwd
|
|
4695
|
+
cwd: resolvedCwd
|
|
4690
4696
|
};
|
|
4691
4697
|
}
|
|
4692
4698
|
throw new Error(`${targetName} healthcheck type must be 'http' or 'command'`);
|
|
@@ -35253,6 +35259,17 @@ async function processMessages(options) {
|
|
|
35253
35259
|
}
|
|
35254
35260
|
continue;
|
|
35255
35261
|
}
|
|
35262
|
+
if (isJsonObject(content)) {
|
|
35263
|
+
const rendered = JSON.stringify(content, null, 2);
|
|
35264
|
+
segments.push({ type: "text", value: rendered });
|
|
35265
|
+
if (textParts) {
|
|
35266
|
+
textParts.push(rendered);
|
|
35267
|
+
}
|
|
35268
|
+
continue;
|
|
35269
|
+
}
|
|
35270
|
+
if (!Array.isArray(content)) {
|
|
35271
|
+
continue;
|
|
35272
|
+
}
|
|
35256
35273
|
for (const rawSegment of content) {
|
|
35257
35274
|
if (!isJsonObject(rawSegment)) {
|
|
35258
35275
|
continue;
|
|
@@ -35475,6 +35492,11 @@ async function buildPromptInputs(testCase, mode = "lm") {
|
|
|
35475
35492
|
}
|
|
35476
35493
|
}
|
|
35477
35494
|
}
|
|
35495
|
+
} else if (isJsonObject(message.content)) {
|
|
35496
|
+
const rendered = JSON.stringify(message.content, null, 2);
|
|
35497
|
+
if (rendered.trim().length > 0) {
|
|
35498
|
+
messageSegments.push({ type: "text", value: rendered });
|
|
35499
|
+
}
|
|
35478
35500
|
}
|
|
35479
35501
|
segmentsByMessage.push(messageSegments);
|
|
35480
35502
|
}
|
|
@@ -36193,7 +36215,7 @@ var CliProvider = class {
|
|
|
36193
36215
|
id;
|
|
36194
36216
|
kind = "cli";
|
|
36195
36217
|
targetName;
|
|
36196
|
-
supportsBatch =
|
|
36218
|
+
supportsBatch = true;
|
|
36197
36219
|
config;
|
|
36198
36220
|
runCommand;
|
|
36199
36221
|
verbose;
|
|
@@ -36213,6 +36235,11 @@ var CliProvider = class {
|
|
|
36213
36235
|
const outputFilePath = generateOutputFilePath(request.evalCaseId);
|
|
36214
36236
|
const templateValues = buildTemplateValues(request, this.config, outputFilePath);
|
|
36215
36237
|
const renderedCommand = renderTemplate2(this.config.commandTemplate, templateValues);
|
|
36238
|
+
if (this.verbose) {
|
|
36239
|
+
console.log(
|
|
36240
|
+
`[cli-provider:${this.targetName}] cwd=${this.config.cwd ?? ""} command=${renderedCommand}`
|
|
36241
|
+
);
|
|
36242
|
+
}
|
|
36216
36243
|
const result = await this.runCommand(renderedCommand, {
|
|
36217
36244
|
cwd: this.config.cwd,
|
|
36218
36245
|
env: process.env,
|
|
@@ -36247,6 +36274,114 @@ var CliProvider = class {
|
|
|
36247
36274
|
}
|
|
36248
36275
|
};
|
|
36249
36276
|
}
|
|
36277
|
+
async invokeBatch(requests) {
|
|
36278
|
+
if (requests.length === 0) {
|
|
36279
|
+
return [];
|
|
36280
|
+
}
|
|
36281
|
+
for (const request of requests) {
|
|
36282
|
+
if (request.signal?.aborted) {
|
|
36283
|
+
throw new Error("CLI provider batch request was aborted before execution");
|
|
36284
|
+
}
|
|
36285
|
+
}
|
|
36286
|
+
const controller = new AbortController();
|
|
36287
|
+
for (const request of requests) {
|
|
36288
|
+
request.signal?.addEventListener("abort", () => controller.abort(), { once: true });
|
|
36289
|
+
}
|
|
36290
|
+
await this.ensureHealthy(controller.signal);
|
|
36291
|
+
const outputFilePath = generateOutputFilePath("batch", ".jsonl");
|
|
36292
|
+
const batchInputFiles = [];
|
|
36293
|
+
for (const request of requests) {
|
|
36294
|
+
if (request.inputFiles && request.inputFiles.length > 0) {
|
|
36295
|
+
batchInputFiles.push(...request.inputFiles);
|
|
36296
|
+
}
|
|
36297
|
+
}
|
|
36298
|
+
const templateValues = buildTemplateValues(
|
|
36299
|
+
{
|
|
36300
|
+
question: "",
|
|
36301
|
+
guidelines: "",
|
|
36302
|
+
inputFiles: batchInputFiles,
|
|
36303
|
+
evalCaseId: "batch",
|
|
36304
|
+
attempt: 0
|
|
36305
|
+
},
|
|
36306
|
+
this.config,
|
|
36307
|
+
outputFilePath
|
|
36308
|
+
);
|
|
36309
|
+
const renderedCommand = renderTemplate2(this.config.commandTemplate, templateValues);
|
|
36310
|
+
if (this.verbose) {
|
|
36311
|
+
console.log(
|
|
36312
|
+
`[cli-provider:${this.targetName}] (batch size=${requests.length}) cwd=${this.config.cwd ?? ""} command=${renderedCommand}`
|
|
36313
|
+
);
|
|
36314
|
+
}
|
|
36315
|
+
const result = await this.runCommand(renderedCommand, {
|
|
36316
|
+
cwd: this.config.cwd,
|
|
36317
|
+
env: process.env,
|
|
36318
|
+
timeoutMs: this.config.timeoutMs,
|
|
36319
|
+
signal: controller.signal
|
|
36320
|
+
});
|
|
36321
|
+
if (result.failed || (result.exitCode ?? 0) !== 0) {
|
|
36322
|
+
if (controller.signal.aborted) {
|
|
36323
|
+
throw new Error("CLI provider request was aborted");
|
|
36324
|
+
}
|
|
36325
|
+
if (result.timedOut) {
|
|
36326
|
+
throw new Error(
|
|
36327
|
+
`CLI provider timed out${formatTimeoutSuffix(this.config.timeoutMs ?? void 0)}`
|
|
36328
|
+
);
|
|
36329
|
+
}
|
|
36330
|
+
const codeText = result.exitCode !== null ? result.exitCode : "unknown";
|
|
36331
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
36332
|
+
const message = detail ? `${detail} (exit code ${codeText})` : `CLI exited with code ${codeText}`;
|
|
36333
|
+
throw new Error(message);
|
|
36334
|
+
}
|
|
36335
|
+
const responseContent = await this.readAndCleanupOutputFile(outputFilePath);
|
|
36336
|
+
const recordsById = this.parseJsonlBatchOutput(responseContent);
|
|
36337
|
+
const requestedIds = requests.map((request) => request.evalCaseId).filter((id) => typeof id === "string" && id.trim().length > 0);
|
|
36338
|
+
const missingIds = requestedIds.filter((id) => !recordsById.has(id));
|
|
36339
|
+
if (missingIds.length > 0) {
|
|
36340
|
+
throw new Error(`CLI batch output missing ids: ${missingIds.join(", ")}`);
|
|
36341
|
+
}
|
|
36342
|
+
const responses = requests.map((request) => {
|
|
36343
|
+
const evalCaseId = request.evalCaseId;
|
|
36344
|
+
if (!evalCaseId) {
|
|
36345
|
+
return {
|
|
36346
|
+
text: "",
|
|
36347
|
+
raw: {
|
|
36348
|
+
command: renderedCommand,
|
|
36349
|
+
stderr: result.stderr,
|
|
36350
|
+
exitCode: result.exitCode ?? 0,
|
|
36351
|
+
cwd: this.config.cwd,
|
|
36352
|
+
outputFile: outputFilePath
|
|
36353
|
+
}
|
|
36354
|
+
};
|
|
36355
|
+
}
|
|
36356
|
+
const parsed = recordsById.get(evalCaseId);
|
|
36357
|
+
if (!parsed) {
|
|
36358
|
+
return {
|
|
36359
|
+
text: "",
|
|
36360
|
+
raw: {
|
|
36361
|
+
command: renderedCommand,
|
|
36362
|
+
stderr: result.stderr,
|
|
36363
|
+
exitCode: result.exitCode ?? 0,
|
|
36364
|
+
cwd: this.config.cwd,
|
|
36365
|
+
outputFile: outputFilePath
|
|
36366
|
+
}
|
|
36367
|
+
};
|
|
36368
|
+
}
|
|
36369
|
+
return {
|
|
36370
|
+
text: parsed.text,
|
|
36371
|
+
trace: parsed.trace,
|
|
36372
|
+
traceRef: parsed.traceRef,
|
|
36373
|
+
raw: {
|
|
36374
|
+
command: renderedCommand,
|
|
36375
|
+
stderr: result.stderr,
|
|
36376
|
+
exitCode: result.exitCode ?? 0,
|
|
36377
|
+
cwd: this.config.cwd,
|
|
36378
|
+
outputFile: outputFilePath,
|
|
36379
|
+
recordId: evalCaseId
|
|
36380
|
+
}
|
|
36381
|
+
};
|
|
36382
|
+
});
|
|
36383
|
+
return responses;
|
|
36384
|
+
}
|
|
36250
36385
|
/**
|
|
36251
36386
|
* Parse output content from CLI.
|
|
36252
36387
|
* If the content is valid JSON with a 'text' field, extract text and optional trace.
|
|
@@ -36272,6 +36407,38 @@ var CliProvider = class {
|
|
|
36272
36407
|
const validEvents = trace2.filter(isTraceEvent);
|
|
36273
36408
|
return validEvents.length > 0 ? validEvents : void 0;
|
|
36274
36409
|
}
|
|
36410
|
+
parseJsonlBatchOutput(content) {
|
|
36411
|
+
const records = /* @__PURE__ */ new Map();
|
|
36412
|
+
const lines = content.split(/\r?\n/).map((line2) => line2.trim()).filter((line2) => line2.length > 0);
|
|
36413
|
+
for (const line2 of lines) {
|
|
36414
|
+
let parsed;
|
|
36415
|
+
try {
|
|
36416
|
+
parsed = JSON.parse(line2);
|
|
36417
|
+
} catch (error40) {
|
|
36418
|
+
const reason = error40 instanceof Error ? error40.message : String(error40);
|
|
36419
|
+
throw new Error(`CLI batch output contains invalid JSONL line: ${reason}`);
|
|
36420
|
+
}
|
|
36421
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
36422
|
+
throw new Error("CLI batch output JSONL line must be an object");
|
|
36423
|
+
}
|
|
36424
|
+
const obj = parsed;
|
|
36425
|
+
const id = typeof obj.id === "string" ? obj.id : void 0;
|
|
36426
|
+
if (!id || id.trim().length === 0) {
|
|
36427
|
+
throw new Error("CLI batch output JSONL line missing required string field: id");
|
|
36428
|
+
}
|
|
36429
|
+
if (records.has(id)) {
|
|
36430
|
+
throw new Error(`CLI batch output contains duplicate id: ${id}`);
|
|
36431
|
+
}
|
|
36432
|
+
const text2 = typeof obj.text === "string" ? obj.text : obj.text === void 0 ? "" : JSON.stringify(obj.text);
|
|
36433
|
+
const traceRef = typeof obj.traceRef === "string" ? obj.traceRef : typeof obj.trace_ref === "string" ? obj.trace_ref : void 0;
|
|
36434
|
+
records.set(id, {
|
|
36435
|
+
text: text2,
|
|
36436
|
+
trace: this.parseTrace(obj.trace),
|
|
36437
|
+
traceRef
|
|
36438
|
+
});
|
|
36439
|
+
}
|
|
36440
|
+
return records;
|
|
36441
|
+
}
|
|
36275
36442
|
async readAndCleanupOutputFile(filePath) {
|
|
36276
36443
|
try {
|
|
36277
36444
|
const content = await readTextFile(filePath);
|
|
@@ -36333,7 +36500,7 @@ var CliProvider = class {
|
|
|
36333
36500
|
);
|
|
36334
36501
|
if (this.verbose) {
|
|
36335
36502
|
console.log(
|
|
36336
|
-
`[cli-provider:${this.targetName}] (healthcheck)
|
|
36503
|
+
`[cli-provider:${this.targetName}] (healthcheck) cwd=${healthcheck.cwd ?? this.config.cwd ?? ""} command=${renderedCommand}`
|
|
36337
36504
|
);
|
|
36338
36505
|
}
|
|
36339
36506
|
const result = await this.runCommand(renderedCommand, {
|
|
@@ -36401,11 +36568,11 @@ function shellEscape(value) {
|
|
|
36401
36568
|
}
|
|
36402
36569
|
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
36403
36570
|
}
|
|
36404
|
-
function generateOutputFilePath(evalCaseId) {
|
|
36571
|
+
function generateOutputFilePath(evalCaseId, extension = ".json") {
|
|
36405
36572
|
const safeEvalId = evalCaseId || "unknown";
|
|
36406
36573
|
const timestamp = Date.now();
|
|
36407
36574
|
const random = Math.random().toString(36).substring(2, 9);
|
|
36408
|
-
return path72.join(os2.tmpdir(), `agentv-${safeEvalId}-${timestamp}-${random}
|
|
36575
|
+
return path72.join(os2.tmpdir(), `agentv-${safeEvalId}-${timestamp}-${random}${extension}`);
|
|
36409
36576
|
}
|
|
36410
36577
|
function formatTimeoutSuffix(timeoutMs) {
|
|
36411
36578
|
if (!timeoutMs || timeoutMs <= 0) {
|
|
@@ -37895,6 +38062,7 @@ var CodeEvaluator = class {
|
|
|
37895
38062
|
{
|
|
37896
38063
|
question: context.evalCase.question,
|
|
37897
38064
|
expected_outcome: context.evalCase.expected_outcome,
|
|
38065
|
+
expected_messages: context.evalCase.expected_messages,
|
|
37898
38066
|
reference_answer: context.evalCase.reference_answer,
|
|
37899
38067
|
candidate_answer: context.candidate,
|
|
37900
38068
|
guideline_files: context.evalCase.guideline_paths,
|
|
@@ -39963,61 +40131,56 @@ function getDefaultExtension(format) {
|
|
|
39963
40131
|
}
|
|
39964
40132
|
|
|
39965
40133
|
// src/commands/eval/progress-display.ts
|
|
39966
|
-
import { stripVTControlCharacters } from "node:util";
|
|
39967
|
-
var ESC = "\x1B[";
|
|
39968
|
-
var CLEAR_LINE = `${ESC}K`;
|
|
39969
|
-
var MOVE_CURSOR_UP = `${ESC}1A`;
|
|
39970
40134
|
var ProgressDisplay = class {
|
|
39971
40135
|
workers = /* @__PURE__ */ new Map();
|
|
39972
|
-
maxWorkers;
|
|
39973
40136
|
totalTests = 0;
|
|
39974
40137
|
completedTests = 0;
|
|
39975
|
-
renderTimer;
|
|
39976
|
-
renderScheduled = false;
|
|
39977
|
-
isInteractive;
|
|
39978
40138
|
logPaths = [];
|
|
39979
40139
|
logPathSet = /* @__PURE__ */ new Set();
|
|
39980
40140
|
hasPrintedLogHeader = false;
|
|
39981
|
-
windowHeight = 0;
|
|
39982
40141
|
started = false;
|
|
39983
40142
|
finished = false;
|
|
39984
|
-
|
|
39985
|
-
|
|
39986
|
-
this.
|
|
40143
|
+
verbose;
|
|
40144
|
+
constructor(_maxWorkers, options) {
|
|
40145
|
+
this.verbose = options?.verbose ?? false;
|
|
39987
40146
|
}
|
|
39988
40147
|
isInteractiveMode() {
|
|
39989
|
-
return
|
|
40148
|
+
return false;
|
|
39990
40149
|
}
|
|
39991
40150
|
start() {
|
|
39992
40151
|
this.started = true;
|
|
39993
40152
|
this.finished = false;
|
|
39994
|
-
if (this.isInteractive) {
|
|
39995
|
-
this.write("\n");
|
|
39996
|
-
this.renderTimer = setInterval(() => {
|
|
39997
|
-
this.scheduleRender();
|
|
39998
|
-
}, 1e3);
|
|
39999
|
-
this.renderTimer.unref?.();
|
|
40000
|
-
}
|
|
40001
40153
|
}
|
|
40002
40154
|
setTotalTests(count) {
|
|
40003
40155
|
this.totalTests = count;
|
|
40004
40156
|
}
|
|
40005
40157
|
updateWorker(progress) {
|
|
40158
|
+
const previous = this.workers.get(progress.workerId);
|
|
40006
40159
|
this.workers.set(progress.workerId, progress);
|
|
40007
40160
|
if (progress.status === "completed" || progress.status === "failed") {
|
|
40008
40161
|
this.completedTests++;
|
|
40009
40162
|
}
|
|
40010
|
-
|
|
40011
|
-
|
|
40012
|
-
|
|
40013
|
-
|
|
40014
|
-
|
|
40015
|
-
|
|
40016
|
-
|
|
40163
|
+
const targetSuffix = progress.targetLabel ? ` | ${progress.targetLabel}` : "";
|
|
40164
|
+
const countPrefix = `${this.completedTests}/${this.totalTests}`;
|
|
40165
|
+
switch (progress.status) {
|
|
40166
|
+
case "pending":
|
|
40167
|
+
if (this.verbose && !previous) {
|
|
40168
|
+
console.log(`${countPrefix} \u23F3 ${progress.evalId}${targetSuffix}`);
|
|
40169
|
+
}
|
|
40170
|
+
break;
|
|
40171
|
+
case "running":
|
|
40172
|
+
if (!previous || previous.status === "pending") {
|
|
40173
|
+
console.log(`${countPrefix} \u{1F504} ${progress.evalId}${targetSuffix}`);
|
|
40174
|
+
}
|
|
40175
|
+
break;
|
|
40176
|
+
case "completed":
|
|
40177
|
+
console.log(`${countPrefix} \u2705 ${progress.evalId}${targetSuffix}`);
|
|
40178
|
+
break;
|
|
40179
|
+
case "failed":
|
|
40017
40180
|
console.log(
|
|
40018
|
-
|
|
40181
|
+
`${countPrefix} \u274C ${progress.evalId}${targetSuffix}${progress.error ? `: ${progress.error}` : ""}`
|
|
40019
40182
|
);
|
|
40020
|
-
|
|
40183
|
+
break;
|
|
40021
40184
|
}
|
|
40022
40185
|
}
|
|
40023
40186
|
addLogPaths(paths) {
|
|
@@ -40033,10 +40196,6 @@ var ProgressDisplay = class {
|
|
|
40033
40196
|
return;
|
|
40034
40197
|
}
|
|
40035
40198
|
this.logPaths.push(...newPaths);
|
|
40036
|
-
if (this.isInteractive) {
|
|
40037
|
-
this.scheduleRender();
|
|
40038
|
-
return;
|
|
40039
|
-
}
|
|
40040
40199
|
if (!this.hasPrintedLogHeader) {
|
|
40041
40200
|
console.log("");
|
|
40042
40201
|
console.log("Codex CLI logs:");
|
|
@@ -40047,112 +40206,11 @@ var ProgressDisplay = class {
|
|
|
40047
40206
|
console.log(`${startIndex + offset + 1}. ${path27}`);
|
|
40048
40207
|
});
|
|
40049
40208
|
}
|
|
40050
|
-
scheduleRender() {
|
|
40051
|
-
if (this.renderScheduled || this.finished) {
|
|
40052
|
-
return;
|
|
40053
|
-
}
|
|
40054
|
-
this.renderScheduled = true;
|
|
40055
|
-
setTimeout(() => {
|
|
40056
|
-
this.renderScheduled = false;
|
|
40057
|
-
this.render();
|
|
40058
|
-
}, 100);
|
|
40059
|
-
}
|
|
40060
|
-
write(content) {
|
|
40061
|
-
process.stdout.write(content);
|
|
40062
|
-
}
|
|
40063
|
-
clearWindow() {
|
|
40064
|
-
if (this.windowHeight === 0) {
|
|
40065
|
-
return;
|
|
40066
|
-
}
|
|
40067
|
-
this.write(`\r${CLEAR_LINE}`);
|
|
40068
|
-
for (let i = 1; i < this.windowHeight; i++) {
|
|
40069
|
-
this.write(`${MOVE_CURSOR_UP}\r${CLEAR_LINE}`);
|
|
40070
|
-
}
|
|
40071
|
-
this.windowHeight = 0;
|
|
40072
|
-
}
|
|
40073
|
-
getRenderedRowCount(rows) {
|
|
40074
|
-
const columns = process.stdout.columns || 80;
|
|
40075
|
-
let count = 0;
|
|
40076
|
-
for (const row of rows) {
|
|
40077
|
-
const text2 = stripVTControlCharacters(row);
|
|
40078
|
-
count += Math.max(1, Math.ceil(text2.length / columns));
|
|
40079
|
-
}
|
|
40080
|
-
return count;
|
|
40081
|
-
}
|
|
40082
|
-
render() {
|
|
40083
|
-
if (!this.isInteractive || !this.started || this.finished) {
|
|
40084
|
-
return;
|
|
40085
|
-
}
|
|
40086
|
-
const lines = [];
|
|
40087
|
-
const sortedWorkers = Array.from(this.workers.values()).sort((a, b) => a.workerId - b.workerId);
|
|
40088
|
-
for (const worker of sortedWorkers) {
|
|
40089
|
-
const line2 = this.formatWorkerLine(worker);
|
|
40090
|
-
lines.push(line2);
|
|
40091
|
-
}
|
|
40092
|
-
if (this.logPaths.length > 0) {
|
|
40093
|
-
lines.push("");
|
|
40094
|
-
lines.push("Codex CLI logs:");
|
|
40095
|
-
this.logPaths.forEach((path27, index) => {
|
|
40096
|
-
lines.push(`${index + 1}. ${path27}`);
|
|
40097
|
-
});
|
|
40098
|
-
}
|
|
40099
|
-
const rowCount = this.getRenderedRowCount(lines);
|
|
40100
|
-
this.clearWindow();
|
|
40101
|
-
if (lines.length > 0) {
|
|
40102
|
-
this.write(lines.join("\n"));
|
|
40103
|
-
}
|
|
40104
|
-
this.windowHeight = rowCount;
|
|
40105
|
-
}
|
|
40106
|
-
formatWorkerLine(worker) {
|
|
40107
|
-
const workerLabel = `${worker.workerId}.`.padEnd(4);
|
|
40108
|
-
const statusIcon = this.getStatusIcon(worker.status);
|
|
40109
|
-
const targetLabel = worker.targetLabel ? ` | ${worker.targetLabel}` : "";
|
|
40110
|
-
const columns = process.stdout.columns || 80;
|
|
40111
|
-
const maxLineLength = Math.max(40, columns - 4);
|
|
40112
|
-
const reservedLength = workerLabel.length + statusIcon.length + targetLabel.length + 4;
|
|
40113
|
-
const availableLabelLength = Math.max(15, maxLineLength - reservedLength);
|
|
40114
|
-
let testLabel = worker.evalId;
|
|
40115
|
-
if (testLabel.length > availableLabelLength) {
|
|
40116
|
-
testLabel = `${testLabel.substring(0, Math.max(0, availableLabelLength - 3))}...`;
|
|
40117
|
-
}
|
|
40118
|
-
return `${workerLabel} ${statusIcon} ${testLabel}${targetLabel}`;
|
|
40119
|
-
}
|
|
40120
|
-
getStatusIcon(status) {
|
|
40121
|
-
switch (status) {
|
|
40122
|
-
case "pending":
|
|
40123
|
-
return "\u23F3";
|
|
40124
|
-
case "running":
|
|
40125
|
-
return "\u{1F504}";
|
|
40126
|
-
case "completed":
|
|
40127
|
-
return "\u2705";
|
|
40128
|
-
case "failed":
|
|
40129
|
-
return "\u274C";
|
|
40130
|
-
default:
|
|
40131
|
-
return " ";
|
|
40132
|
-
}
|
|
40133
|
-
}
|
|
40134
40209
|
finish() {
|
|
40135
|
-
if (this.renderTimer) {
|
|
40136
|
-
clearInterval(this.renderTimer);
|
|
40137
|
-
this.renderTimer = void 0;
|
|
40138
|
-
}
|
|
40139
40210
|
this.finished = true;
|
|
40140
|
-
|
|
40141
|
-
this.clearWindow();
|
|
40142
|
-
const sortedWorkers = Array.from(this.workers.values()).sort(
|
|
40143
|
-
(a, b) => a.workerId - b.workerId
|
|
40144
|
-
);
|
|
40145
|
-
for (const worker of sortedWorkers) {
|
|
40146
|
-
this.write(`${this.formatWorkerLine(worker)}
|
|
40147
|
-
`);
|
|
40148
|
-
}
|
|
40149
|
-
this.write("\n");
|
|
40150
|
-
}
|
|
40211
|
+
console.log("");
|
|
40151
40212
|
}
|
|
40152
40213
|
clear() {
|
|
40153
|
-
if (this.isInteractive) {
|
|
40154
|
-
this.clearWindow();
|
|
40155
|
-
}
|
|
40156
40214
|
}
|
|
40157
40215
|
};
|
|
40158
40216
|
|
|
@@ -40656,6 +40714,9 @@ var CLI_SETTINGS = /* @__PURE__ */ new Set([
|
|
|
40656
40714
|
...COMMON_SETTINGS,
|
|
40657
40715
|
"command_template",
|
|
40658
40716
|
"commandTemplate",
|
|
40717
|
+
"verbose",
|
|
40718
|
+
"cli_verbose",
|
|
40719
|
+
"cliVerbose",
|
|
40659
40720
|
"files_format",
|
|
40660
40721
|
"filesFormat",
|
|
40661
40722
|
"attachments_format",
|
|
@@ -40789,6 +40850,15 @@ async function validateTargetsFile(filePath) {
|
|
|
40789
40850
|
if (healthcheck !== void 0) {
|
|
40790
40851
|
validateCliHealthcheck(healthcheck, absolutePath2, `${location}.healthcheck`, errors2);
|
|
40791
40852
|
}
|
|
40853
|
+
const verbose = target.verbose ?? target.cli_verbose ?? target.cliVerbose;
|
|
40854
|
+
if (verbose !== void 0 && typeof verbose !== "boolean") {
|
|
40855
|
+
errors2.push({
|
|
40856
|
+
severity: "error",
|
|
40857
|
+
filePath: absolutePath2,
|
|
40858
|
+
location: `${location}.verbose`,
|
|
40859
|
+
message: "'verbose' must be a boolean when provided"
|
|
40860
|
+
});
|
|
40861
|
+
}
|
|
40792
40862
|
}
|
|
40793
40863
|
function validateCliHealthcheck(healthcheck, absolutePath2, location, errors2) {
|
|
40794
40864
|
if (!isObject22(healthcheck)) {
|
|
@@ -41432,8 +41502,8 @@ function createEvaluationCache() {
|
|
|
41432
41502
|
}
|
|
41433
41503
|
};
|
|
41434
41504
|
}
|
|
41435
|
-
function createProgressReporter(maxWorkers) {
|
|
41436
|
-
const display = new ProgressDisplay(maxWorkers);
|
|
41505
|
+
function createProgressReporter(maxWorkers, options) {
|
|
41506
|
+
const display = new ProgressDisplay(maxWorkers, options);
|
|
41437
41507
|
return {
|
|
41438
41508
|
isInteractive: display.isInteractiveMode(),
|
|
41439
41509
|
start: () => display.start(),
|
|
@@ -41461,6 +41531,22 @@ function createDisplayIdTracker() {
|
|
|
41461
41531
|
}
|
|
41462
41532
|
};
|
|
41463
41533
|
}
|
|
41534
|
+
function applyVerboseOverride(selection, cliVerbose) {
|
|
41535
|
+
const { resolvedTarget } = selection;
|
|
41536
|
+
if (resolvedTarget.kind !== "cli") {
|
|
41537
|
+
return selection;
|
|
41538
|
+
}
|
|
41539
|
+
return {
|
|
41540
|
+
...selection,
|
|
41541
|
+
resolvedTarget: {
|
|
41542
|
+
...resolvedTarget,
|
|
41543
|
+
config: {
|
|
41544
|
+
...resolvedTarget.config,
|
|
41545
|
+
verbose: cliVerbose
|
|
41546
|
+
}
|
|
41547
|
+
}
|
|
41548
|
+
};
|
|
41549
|
+
}
|
|
41464
41550
|
async function prepareFileMetadata(params) {
|
|
41465
41551
|
const { testFilePath, repoRoot, cwd, options } = params;
|
|
41466
41552
|
await ensureFileExists(testFilePath, "Test file");
|
|
@@ -41520,7 +41606,7 @@ async function runSingleEvalFile(params) {
|
|
|
41520
41606
|
evalCases
|
|
41521
41607
|
} = params;
|
|
41522
41608
|
await ensureFileExists(testFilePath, "Test file");
|
|
41523
|
-
const resolvedTargetSelection = selection;
|
|
41609
|
+
const resolvedTargetSelection = applyVerboseOverride(selection, options.verbose);
|
|
41524
41610
|
const providerLabel = options.dryRun ? `${resolvedTargetSelection.resolvedTarget.kind} (dry-run)` : resolvedTargetSelection.resolvedTarget.kind;
|
|
41525
41611
|
const targetMessage = options.verbose ? `Using target (${resolvedTargetSelection.targetSource}): ${resolvedTargetSelection.targetName} [provider=${providerLabel}] via ${resolvedTargetSelection.targetsFilePath}` : `Using target: ${inlineTargetLabel}`;
|
|
41526
41612
|
if (!progressReporter.isInteractive || options.verbose) {
|
|
@@ -41633,7 +41719,7 @@ async function runEvalCommand(input) {
|
|
|
41633
41719
|
if (totalEvalCount === 0) {
|
|
41634
41720
|
throw new Error("No eval cases matched the provided filters.");
|
|
41635
41721
|
}
|
|
41636
|
-
const progressReporter = createProgressReporter(totalWorkers);
|
|
41722
|
+
const progressReporter = createProgressReporter(totalWorkers, { verbose: options.verbose });
|
|
41637
41723
|
progressReporter.start();
|
|
41638
41724
|
progressReporter.setTotal(totalEvalCount);
|
|
41639
41725
|
const seenCodexLogPaths = /* @__PURE__ */ new Set();
|
|
@@ -42504,4 +42590,4 @@ export {
|
|
|
42504
42590
|
app,
|
|
42505
42591
|
runCli
|
|
42506
42592
|
};
|
|
42507
|
-
//# sourceMappingURL=chunk-
|
|
42593
|
+
//# sourceMappingURL=chunk-6R2YRXCQ.js.map
|