agentv 4.15.1 → 4.15.2-next.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.
@@ -40,13 +40,14 @@ import {
40
40
  subscribeToCopilotSdkLogEntries,
41
41
  subscribeToPiLogEntries,
42
42
  syncResultsRepo,
43
- toCamelCaseDeep
44
- } from "./chunk-CA3SJJN7.js";
43
+ toCamelCaseDeep,
44
+ toTranscriptJsonLines
45
+ } from "./chunk-6X2UFVGI.js";
45
46
 
46
47
  // package.json
47
48
  var package_default = {
48
49
  name: "agentv",
49
- version: "4.15.1",
50
+ version: "4.15.2-next.1",
50
51
  description: "CLI entry point for AgentV",
51
52
  type: "module",
52
53
  repository: {
@@ -1447,6 +1448,31 @@ async function writeJsonlFile(filePath, records) {
1447
1448
  `;
1448
1449
  await writeFile(filePath, content, "utf8");
1449
1450
  }
1451
+ function buildTranscriptMessageLines(results) {
1452
+ const lines = [];
1453
+ for (const result of results) {
1454
+ const transcriptLines = toTranscriptJsonLines(
1455
+ {
1456
+ messages: [...result.input ?? [], ...result.output],
1457
+ source: {
1458
+ provider: result.target,
1459
+ sessionId: result.conversationId ?? result.testId,
1460
+ startedAt: result.timestamp
1461
+ },
1462
+ tokenUsage: result.tokenUsage,
1463
+ durationMs: result.durationMs,
1464
+ costUsd: result.costUsd
1465
+ },
1466
+ {
1467
+ testId: result.testId,
1468
+ target: result.target
1469
+ }
1470
+ );
1471
+ lines.push(...transcriptLines.map((line) => JSON.stringify(line)));
1472
+ }
1473
+ return lines.length > 0 ? `${lines.join("\n")}
1474
+ ` : "";
1475
+ }
1450
1476
  async function writeArtifactsFromResults(results, outputDir, options) {
1451
1477
  const testArtifactDir = outputDir;
1452
1478
  const timingPath = path7.join(outputDir, "timing.json");
@@ -1492,36 +1518,7 @@ async function writeArtifactsFromResults(results, outputDir, options) {
1492
1518
  `, "utf8");
1493
1519
  await writeJsonlFile(indexPath, indexRecords);
1494
1520
  const transcriptPath = path7.join(outputDir, "transcript.jsonl");
1495
- const transcriptLines = results.map((result) => {
1496
- let inputText = "";
1497
- if (typeof result.input === "string") {
1498
- inputText = result.input;
1499
- } else if (Array.isArray(result.input)) {
1500
- const firstUserMsg = result.input.find((m) => m.role === "user");
1501
- inputText = typeof firstUserMsg?.content === "string" ? firstUserMsg.content : "";
1502
- }
1503
- return {
1504
- input: inputText,
1505
- output: result.output,
1506
- token_usage: result.tokenUsage ? {
1507
- input: result.tokenUsage.input,
1508
- output: result.tokenUsage.output,
1509
- cached: result.tokenUsage.cached
1510
- } : void 0,
1511
- duration_ms: result.durationMs,
1512
- cost_usd: result.costUsd,
1513
- source: {
1514
- provider: result.target,
1515
- session_id: result.conversationId ?? result.testId,
1516
- timestamp: result.timestamp
1517
- }
1518
- };
1519
- });
1520
- await writeFile(
1521
- transcriptPath,
1522
- transcriptLines.map((line) => JSON.stringify(line)).join("\n") + (transcriptLines.length ? "\n" : ""),
1523
- "utf8"
1524
- );
1521
+ await writeFile(transcriptPath, buildTranscriptMessageLines(results), "utf8");
1525
1522
  return { testArtifactDir, timingPath, benchmarkPath, indexPath };
1526
1523
  }
1527
1524
 
@@ -5351,7 +5348,7 @@ async function runEvalCommand(input) {
5351
5348
  const useFileExport = !!options.otelFile;
5352
5349
  if (options.exportOtel || useFileExport) {
5353
5350
  try {
5354
- const { OtelTraceExporter, OTEL_BACKEND_PRESETS } = await import("./dist-524K2DD2.js");
5351
+ const { OtelTraceExporter, OTEL_BACKEND_PRESETS } = await import("./dist-7ZYP7EBD.js");
5355
5352
  let endpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT;
5356
5353
  let headers = {};
5357
5354
  if (options.otelBackend) {
@@ -5547,7 +5544,7 @@ async function runEvalCommand(input) {
5547
5544
  const activeTestFiles = resolvedTestFiles.filter((f) => fileMetadata.has(f));
5548
5545
  let transcriptProviderFactory;
5549
5546
  if (options.transcript) {
5550
- const { TranscriptProvider } = await import("./dist-524K2DD2.js");
5547
+ const { TranscriptProvider } = await import("./dist-7ZYP7EBD.js");
5551
5548
  const transcriptProvider = await TranscriptProvider.fromFile(options.transcript);
5552
5549
  const totalTests = [...fileMetadata.values()].reduce(
5553
5550
  (sum, meta) => sum + meta.testCases.length,
@@ -5555,7 +5552,7 @@ async function runEvalCommand(input) {
5555
5552
  );
5556
5553
  if (transcriptProvider.lineCount !== totalTests) {
5557
5554
  throw new Error(
5558
- `Transcript has ${transcriptProvider.lineCount} entry(s) but eval defines ${totalTests} test(s). Each transcript line maps positionally to one test case.`
5555
+ `Transcript has ${transcriptProvider.lineCount} entr${transcriptProvider.lineCount === 1 ? "y" : "ies"} but eval defines ${totalTests} test(s). Each transcript entry maps positionally to one test case.`
5559
5556
  );
5560
5557
  }
5561
5558
  transcriptProviderFactory = () => transcriptProvider;
@@ -5869,4 +5866,4 @@ export {
5869
5866
  getCategories,
5870
5867
  filterByCategory
5871
5868
  };
5872
- //# sourceMappingURL=chunk-VFJ3UPNX.js.map
5869
+ //# sourceMappingURL=chunk-O4RLSNIR.js.map