@alis-build/harness-eval 0.1.1 → 0.1.3
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 +104 -10
- package/dist/adapters/claude-code/index.d.ts +2 -2
- package/dist/adapters/claude-code/index.js +2 -1
- package/dist/adapters/codex/index.d.ts +68 -0
- package/dist/adapters/codex/index.js +3 -0
- package/dist/{claude-code-ycT0JQZF.js → claude-code-C_7hxC8z.js} +37 -250
- package/dist/claude-code-C_7hxC8z.js.map +1 -0
- package/dist/cli/bin.js +204 -127
- package/dist/cli/bin.js.map +1 -1
- package/dist/codex-0cHO2te9.js +496 -0
- package/dist/codex-0cHO2te9.js.map +1 -0
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +2 -2
- package/dist/{index-6Z17eKZx.d.ts → index-DnvP1UBl.d.ts} +3 -2
- package/dist/index.d.ts +397 -153
- package/dist/index.js +125 -5
- package/dist/index.js.map +1 -0
- package/dist/loader-B1WmGGzf.d.ts +107 -0
- package/dist/{loader-BCnFJ8rm.js → loader-DnQ6Jt0i.js} +707 -157
- package/dist/loader-DnQ6Jt0i.js.map +1 -0
- package/dist/reporter-Biy-5-9M.js +2216 -0
- package/dist/reporter-Biy-5-9M.js.map +1 -0
- package/dist/runner/suite.d.ts +1 -1
- package/dist/runner/suite.js +1 -1
- package/dist/{suite-BoOvK_lq.d.ts → suite-BEShV0by.d.ts} +7 -2
- package/dist/{suite-chj0j22j.js → suite-BcP64nlb.js} +72 -4
- package/dist/suite-BcP64nlb.js.map +1 -0
- package/dist/{types-BQol062t.d.ts → types-0QkNVyp9.d.ts} +152 -11
- package/dist/types-Bac8_Ixb.js +246 -0
- package/dist/types-Bac8_Ixb.js.map +1 -0
- package/dist/types-Bu8uOZZN.d.ts +77 -0
- package/dist/{types-B9H4IZtA.d.ts → types-C0gBkl0-.d.ts} +3 -2
- package/package.json +7 -2
- package/schemas/eval-interchange-instances.schema.json +196 -0
- package/schemas/eval-interchange.schema.json +65 -52
- package/schemas/eval-run-envelope.schema.json +182 -425
- package/dist/build-DsVJ_UeU.js +0 -1396
- package/dist/build-DsVJ_UeU.js.map +0 -1
- package/dist/claude-code-ycT0JQZF.js.map +0 -1
- package/dist/loader-BCnFJ8rm.js.map +0 -1
- package/dist/loader-DTvoVfN0.d.ts +0 -33
- package/dist/suite-chj0j22j.js.map +0 -1
- package/schemas/eval-interchange-agent-trace.schema.json +0 -322
- package/schemas/eval-interchange-proto-instance.schema.json +0 -106
package/dist/index.js
CHANGED
|
@@ -1,5 +1,125 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as TRAJECTORY_SCHEMA_VERSION, C as
|
|
3
|
-
import { a as
|
|
4
|
-
import { o as
|
|
5
|
-
|
|
1
|
+
import { a as isAssistantMessage, c as isSystemRetry, d as isToolUseBlock, f as isUserMessage, i as namespaceOf, l as isTextBlock, n as TrajectoryBuilder, o as isResult, r as buildTrajectory, s as isSystemInit, t as AdapterError, u as isToolResultBlock } from "./types-Bac8_Ixb.js";
|
|
2
|
+
import { A as serializeToolInput, B as TRAJECTORY_SCHEMA_VERSION, C as trajectoryExactMatch, D as trajectorySingleToolUse, E as trajectoryRecall, I as trajectoryToTranscript, L as createCodexGrader, M as gradingReportPassed, N as resolveGradeOptions, O as toEvaluationInstance, P as gradeReport, R as createClaudeGrader, S as trajectoryAnyOrderMatch, T as trajectoryPrecision, _ as buildEvalRunEnvelopeFromFiles, b as computeTrajectoryMetrics, d as resolveGradingArtifactFromSuite, f as resolvePipelineInputs, g as buildEvalRunEnvelope, h as toTrajectory, i as runPipeline, j as formatGradingConsole, k as toTrajectoryInstances, m as toInstancesJsonl, n as emitOtel, r as trajectoryToOtlp, t as formatReport, v as enrichRepetitionWithProtojson, w as trajectoryInOrderMatch, x as parseToolInput, y as toHarnessMetrics, z as EVAL_RUN_SCHEMA_VERSION } from "./reporter-Biy-5-9M.js";
|
|
3
|
+
import { a as parseStreamJson, n as claude_code_exports } from "./claude-code-C_7hxC8z.js";
|
|
4
|
+
import { a as aggregateCell, c as runRepetition, d as getDefaultAdapter, f as listAdapters, h as evaluateAll, i as DEFAULT_THRESHOLD, l as DEFAULT_ADAPTER_ID, m as evaluate, n as createLimit, o as getRepetitions, p as registerAdapter, r as DEFAULT_REPETITIONS, s as mergeConfig, t as runSuite, u as getAdapter } from "./suite-BcP64nlb.js";
|
|
5
|
+
import { l as ConfigError, n as parseSuite, o as loadSuiteDocument, t as loadSuite } from "./loader-DnQ6Jt0i.js";
|
|
6
|
+
//#region src/metrics/tool-calls.ts
|
|
7
|
+
/**
|
|
8
|
+
* Tool-call-level metrics operating on prediction/reference tool-call pairs.
|
|
9
|
+
*
|
|
10
|
+
* Implements Vertex-aligned per-call checks: validity, name match, parameter
|
|
11
|
+
* key match, and full key-value match. Used by trajectory metrics and
|
|
12
|
+
* available for custom eval pipelines.
|
|
13
|
+
*
|
|
14
|
+
* Scores are 0 or 1 per call; {@link computeToolCallMetrics} averages across
|
|
15
|
+
* aligned index pairs (max length of predicted vs reference).
|
|
16
|
+
*/
|
|
17
|
+
/** Normalize harness or wire tool call to canonical wire shape for comparison. */
|
|
18
|
+
function normalizeToolCall(toolCall) {
|
|
19
|
+
if (typeof toolCall.tool_input === "string") return {
|
|
20
|
+
tool_name: toolCall.tool_name,
|
|
21
|
+
tool_input: toolCall.tool_input
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
tool_name: toolCall.tool_name,
|
|
25
|
+
tool_input: serializeToolInput(toolCall.tool_input)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** Parse tool_input JSON to an object map, or null when not a plain object. */
|
|
29
|
+
function parsedArgs(toolCall) {
|
|
30
|
+
const parsed = parseToolInput(toolCall.tool_input);
|
|
31
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether a predicted tool call is well-formed (non-empty name, parseable JSON input).
|
|
36
|
+
*
|
|
37
|
+
* @returns 1 when valid, 0 otherwise.
|
|
38
|
+
*/
|
|
39
|
+
function toolCallValid(toolCall) {
|
|
40
|
+
const normalized = normalizeToolCall(toolCall);
|
|
41
|
+
if (!normalized.tool_name.trim()) return 0;
|
|
42
|
+
try {
|
|
43
|
+
JSON.parse(normalized.tool_input);
|
|
44
|
+
return 1;
|
|
45
|
+
} catch {
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether predicted and reference tool names match exactly.
|
|
51
|
+
*
|
|
52
|
+
* @returns 1 on match, 0 otherwise.
|
|
53
|
+
*/
|
|
54
|
+
function toolNameMatch(predicted, reference) {
|
|
55
|
+
const predictedNorm = normalizeToolCall(predicted);
|
|
56
|
+
const referenceNorm = normalizeToolCall(reference);
|
|
57
|
+
return predictedNorm.tool_name === referenceNorm.tool_name ? 1 : 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether parameter key sets match (same keys, same order after sort).
|
|
61
|
+
*
|
|
62
|
+
* Requires matching tool names first. Returns 0 when args are not objects.
|
|
63
|
+
*/
|
|
64
|
+
function toolParameterKeyMatch(predicted, reference) {
|
|
65
|
+
if (toolNameMatch(predicted, reference) === 0) return 0;
|
|
66
|
+
const predictedArgs = parsedArgs(normalizeToolCall(predicted));
|
|
67
|
+
const referenceArgs = parsedArgs(normalizeToolCall(reference));
|
|
68
|
+
if (predictedArgs === null || referenceArgs === null) return 0;
|
|
69
|
+
const predictedKeys = Object.keys(predictedArgs).sort();
|
|
70
|
+
const referenceKeys = Object.keys(referenceArgs).sort();
|
|
71
|
+
if (predictedKeys.length !== referenceKeys.length) return 0;
|
|
72
|
+
return predictedKeys.every((key, index) => key === referenceKeys[index]) ? 1 : 0;
|
|
73
|
+
}
|
|
74
|
+
/** Deep equality via JSON serialization (handles nested objects in args). */
|
|
75
|
+
function valuesEqual(left, right, useStrictStringMatch) {
|
|
76
|
+
if (useStrictStringMatch) return JSON.stringify(left) === JSON.stringify(right);
|
|
77
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether all reference parameter key-value pairs match in the predicted call.
|
|
81
|
+
*
|
|
82
|
+
* Requires {@link toolParameterKeyMatch} first. Only keys present in reference
|
|
83
|
+
* are checked (predicted may have extra keys).
|
|
84
|
+
*/
|
|
85
|
+
function toolParameterKvMatch(predicted, reference, options = {}) {
|
|
86
|
+
if (toolParameterKeyMatch(predicted, reference) === 0) return 0;
|
|
87
|
+
const predictedArgs = parsedArgs(normalizeToolCall(predicted));
|
|
88
|
+
const referenceArgs = parsedArgs(normalizeToolCall(reference));
|
|
89
|
+
for (const key of Object.keys(referenceArgs)) if (!valuesEqual(predictedArgs[key], referenceArgs[key], options.useStrictStringMatch ?? false)) return 0;
|
|
90
|
+
return 1;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Average tool-call metrics across index-aligned predicted/reference pairs.
|
|
94
|
+
*
|
|
95
|
+
* Denominator is `max(predicted.length, reference.length, 1)`. Missing
|
|
96
|
+
* predicted calls at an index are skipped for pair metrics; validity still
|
|
97
|
+
* counts when a predicted call exists.
|
|
98
|
+
*/
|
|
99
|
+
function computeToolCallMetrics(predicted, reference, options = {}) {
|
|
100
|
+
const pairCount = Math.max(predicted.length, reference.length, 1);
|
|
101
|
+
let valid = 0;
|
|
102
|
+
let nameMatch = 0;
|
|
103
|
+
let keyMatch = 0;
|
|
104
|
+
let kvMatch = 0;
|
|
105
|
+
for (let index = 0; index < pairCount; index += 1) {
|
|
106
|
+
const predictedCall = predicted[index];
|
|
107
|
+
const referenceCall = reference[index];
|
|
108
|
+
if (!predictedCall) continue;
|
|
109
|
+
valid += toolCallValid(predictedCall);
|
|
110
|
+
if (!referenceCall) continue;
|
|
111
|
+
nameMatch += toolNameMatch(predictedCall, referenceCall);
|
|
112
|
+
keyMatch += toolParameterKeyMatch(predictedCall, referenceCall);
|
|
113
|
+
kvMatch += toolParameterKvMatch(predictedCall, referenceCall, options);
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
tool_call_valid: valid / pairCount,
|
|
117
|
+
tool_name_match: nameMatch / pairCount,
|
|
118
|
+
tool_parameter_key_match: keyMatch / pairCount,
|
|
119
|
+
tool_parameter_kv_match: kvMatch / pairCount
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { AdapterError, ConfigError, DEFAULT_ADAPTER_ID, DEFAULT_REPETITIONS, DEFAULT_THRESHOLD, EVAL_RUN_SCHEMA_VERSION, TRAJECTORY_SCHEMA_VERSION, TrajectoryBuilder, aggregateCell, buildEvalRunEnvelope, buildEvalRunEnvelopeFromFiles, buildTrajectory, claude_code_exports as claudeCode, computeToolCallMetrics, computeTrajectoryMetrics, createClaudeGrader, createCodexGrader, createLimit, emitOtel, enrichRepetitionWithProtojson, evaluate, evaluateAll, formatGradingConsole, formatReport, getAdapter, getDefaultAdapter, getRepetitions, gradeReport, gradingReportPassed, isAssistantMessage, isResult, isSystemInit, isSystemRetry, isTextBlock, isToolResultBlock, isToolUseBlock, isUserMessage, listAdapters, loadSuite, loadSuiteDocument, mergeConfig, namespaceOf, parseStreamJson, parseSuite, registerAdapter, resolveGradeOptions, resolveGradingArtifactFromSuite, resolvePipelineInputs, runPipeline, runRepetition, runSuite, toEvaluationInstance, toHarnessMetrics, toInstancesJsonl, toTrajectory, toTrajectoryInstances, toolCallValid, toolNameMatch, toolParameterKeyMatch, toolParameterKvMatch, trajectoryAnyOrderMatch, trajectoryExactMatch, trajectoryInOrderMatch, trajectoryPrecision, trajectoryRecall, trajectorySingleToolUse, trajectoryToOtlp, trajectoryToTranscript };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/metrics/tool-calls.ts"],"sourcesContent":["/**\n * Tool-call-level metrics operating on prediction/reference tool-call pairs.\n *\n * Implements Vertex-aligned per-call checks: validity, name match, parameter\n * key match, and full key-value match. Used by trajectory metrics and\n * available for custom eval pipelines.\n *\n * Scores are 0 or 1 per call; {@link computeToolCallMetrics} averages across\n * aligned index pairs (max length of predicted vs reference).\n */\n\nimport { parseToolInput, type TrajectoryInput, type WireToolCall } from \"./trajectory\";\nimport { serializeToolInput } from \"../eval-interchange/normalize\";\n\n/** Options for parameter value comparison. */\nexport interface ToolCallMetricOptions {\n /** When true, compare serialized JSON strictly (reserved for future semantics). */\n useStrictStringMatch?: boolean;\n}\n\n/** Aggregated tool-call metric scores (each 0..1). */\nexport interface ToolCallMetrics {\n tool_call_valid: number;\n tool_name_match: number;\n tool_parameter_key_match: number;\n tool_parameter_kv_match: number;\n}\n\ntype ToolCallInput = TrajectoryInput[number];\n\n/** Normalize harness or wire tool call to canonical wire shape for comparison. */\nfunction normalizeToolCall(toolCall: ToolCallInput): WireToolCall {\n if (typeof toolCall.tool_input === \"string\") {\n return {\n tool_name: toolCall.tool_name,\n tool_input: toolCall.tool_input,\n };\n }\n\n return {\n tool_name: toolCall.tool_name,\n tool_input: serializeToolInput(toolCall.tool_input),\n };\n}\n\n/** Parse tool_input JSON to an object map, or null when not a plain object. */\nfunction parsedArgs(toolCall: WireToolCall): Record<string, unknown> | null {\n const parsed = parseToolInput(toolCall.tool_input);\n if (parsed === null || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return null;\n }\n return parsed as Record<string, unknown>;\n}\n\n/**\n * Whether a predicted tool call is well-formed (non-empty name, parseable JSON input).\n *\n * @returns 1 when valid, 0 otherwise.\n */\nexport function toolCallValid(toolCall: ToolCallInput): number {\n const normalized = normalizeToolCall(toolCall);\n if (!normalized.tool_name.trim()) return 0;\n\n try {\n JSON.parse(normalized.tool_input);\n return 1;\n } catch {\n return 0;\n }\n}\n\n/**\n * Whether predicted and reference tool names match exactly.\n *\n * @returns 1 on match, 0 otherwise.\n */\nexport function toolNameMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n): number {\n const predictedNorm = normalizeToolCall(predicted);\n const referenceNorm = normalizeToolCall(reference);\n return predictedNorm.tool_name === referenceNorm.tool_name ? 1 : 0;\n}\n\n/**\n * Whether parameter key sets match (same keys, same order after sort).\n *\n * Requires matching tool names first. Returns 0 when args are not objects.\n */\nexport function toolParameterKeyMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n): number {\n if (toolNameMatch(predicted, reference) === 0) return 0;\n\n const predictedArgs = parsedArgs(normalizeToolCall(predicted));\n const referenceArgs = parsedArgs(normalizeToolCall(reference));\n if (predictedArgs === null || referenceArgs === null) return 0;\n\n const predictedKeys = Object.keys(predictedArgs).sort();\n const referenceKeys = Object.keys(referenceArgs).sort();\n if (predictedKeys.length !== referenceKeys.length) return 0;\n\n return predictedKeys.every((key, index) => key === referenceKeys[index])\n ? 1\n : 0;\n}\n\n/** Deep equality via JSON serialization (handles nested objects in args). */\nfunction valuesEqual(\n left: unknown,\n right: unknown,\n useStrictStringMatch: boolean,\n): boolean {\n if (useStrictStringMatch) {\n return JSON.stringify(left) === JSON.stringify(right);\n }\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\n/**\n * Whether all reference parameter key-value pairs match in the predicted call.\n *\n * Requires {@link toolParameterKeyMatch} first. Only keys present in reference\n * are checked (predicted may have extra keys).\n */\nexport function toolParameterKvMatch(\n predicted: ToolCallInput,\n reference: ToolCallInput,\n options: ToolCallMetricOptions = {},\n): number {\n if (toolParameterKeyMatch(predicted, reference) === 0) return 0;\n\n const predictedArgs = parsedArgs(normalizeToolCall(predicted))!;\n const referenceArgs = parsedArgs(normalizeToolCall(reference))!;\n\n for (const key of Object.keys(referenceArgs)) {\n if (\n !valuesEqual(\n predictedArgs[key],\n referenceArgs[key],\n options.useStrictStringMatch ?? false,\n )\n ) {\n return 0;\n }\n }\n\n return 1;\n}\n\n/**\n * Average tool-call metrics across index-aligned predicted/reference pairs.\n *\n * Denominator is `max(predicted.length, reference.length, 1)`. Missing\n * predicted calls at an index are skipped for pair metrics; validity still\n * counts when a predicted call exists.\n */\nexport function computeToolCallMetrics(\n predicted: ToolCallInput[],\n reference: ToolCallInput[],\n options: ToolCallMetricOptions = {},\n): ToolCallMetrics {\n const pairCount = Math.max(predicted.length, reference.length, 1);\n let valid = 0;\n let nameMatch = 0;\n let keyMatch = 0;\n let kvMatch = 0;\n\n for (let index = 0; index < pairCount; index += 1) {\n const predictedCall = predicted[index];\n const referenceCall = reference[index];\n if (!predictedCall) continue;\n\n valid += toolCallValid(predictedCall);\n if (!referenceCall) continue;\n\n nameMatch += toolNameMatch(predictedCall, referenceCall);\n keyMatch += toolParameterKeyMatch(predictedCall, referenceCall);\n kvMatch += toolParameterKvMatch(predictedCall, referenceCall, options);\n }\n\n return {\n tool_call_valid: valid / pairCount,\n tool_name_match: nameMatch / pairCount,\n tool_parameter_key_match: keyMatch / pairCount,\n tool_parameter_kv_match: kvMatch / pairCount,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAS,kBAAkB,UAAuC;CAChE,IAAI,OAAO,SAAS,eAAe,UACjC,OAAO;EACL,WAAW,SAAS;EACpB,YAAY,SAAS;CACvB;CAGF,OAAO;EACL,WAAW,SAAS;EACpB,YAAY,mBAAmB,SAAS,UAAU;CACpD;AACF;;AAGA,SAAS,WAAW,UAAwD;CAC1E,MAAM,SAAS,eAAe,SAAS,UAAU;CACjD,IAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GACvE,OAAO;CAET,OAAO;AACT;;;;;;AAOA,SAAgB,cAAc,UAAiC;CAC7D,MAAM,aAAa,kBAAkB,QAAQ;CAC7C,IAAI,CAAC,WAAW,UAAU,KAAK,GAAG,OAAO;CAEzC,IAAI;EACF,KAAK,MAAM,WAAW,UAAU;EAChC,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;;AAOA,SAAgB,cACd,WACA,WACQ;CACR,MAAM,gBAAgB,kBAAkB,SAAS;CACjD,MAAM,gBAAgB,kBAAkB,SAAS;CACjD,OAAO,cAAc,cAAc,cAAc,YAAY,IAAI;AACnE;;;;;;AAOA,SAAgB,sBACd,WACA,WACQ;CACR,IAAI,cAAc,WAAW,SAAS,MAAM,GAAG,OAAO;CAEtD,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAC7D,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAC7D,IAAI,kBAAkB,QAAQ,kBAAkB,MAAM,OAAO;CAE7D,MAAM,gBAAgB,OAAO,KAAK,aAAa,CAAC,CAAC,KAAK;CACtD,MAAM,gBAAgB,OAAO,KAAK,aAAa,CAAC,CAAC,KAAK;CACtD,IAAI,cAAc,WAAW,cAAc,QAAQ,OAAO;CAE1D,OAAO,cAAc,OAAO,KAAK,UAAU,QAAQ,cAAc,MAAM,IACnE,IACA;AACN;;AAGA,SAAS,YACP,MACA,OACA,sBACS;CACT,IAAI,sBACF,OAAO,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,KAAK;CAEtD,OAAO,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,KAAK;AACtD;;;;;;;AAQA,SAAgB,qBACd,WACA,WACA,UAAiC,CAAC,GAC1B;CACR,IAAI,sBAAsB,WAAW,SAAS,MAAM,GAAG,OAAO;CAE9D,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAC7D,MAAM,gBAAgB,WAAW,kBAAkB,SAAS,CAAC;CAE7D,KAAK,MAAM,OAAO,OAAO,KAAK,aAAa,GACzC,IACE,CAAC,YACC,cAAc,MACd,cAAc,MACd,QAAQ,wBAAwB,KAClC,GAEA,OAAO;CAIX,OAAO;AACT;;;;;;;;AASA,SAAgB,uBACd,WACA,WACA,UAAiC,CAAC,GACjB;CACjB,MAAM,YAAY,KAAK,IAAI,UAAU,QAAQ,UAAU,QAAQ,CAAC;CAChE,IAAI,QAAQ;CACZ,IAAI,YAAY;CAChB,IAAI,WAAW;CACf,IAAI,UAAU;CAEd,KAAK,IAAI,QAAQ,GAAG,QAAQ,WAAW,SAAS,GAAG;EACjD,MAAM,gBAAgB,UAAU;EAChC,MAAM,gBAAgB,UAAU;EAChC,IAAI,CAAC,eAAe;EAEpB,SAAS,cAAc,aAAa;EACpC,IAAI,CAAC,eAAe;EAEpB,aAAa,cAAc,eAAe,aAAa;EACvD,YAAY,sBAAsB,eAAe,aAAa;EAC9D,WAAW,qBAAqB,eAAe,eAAe,OAAO;CACvE;CAEA,OAAO;EACL,iBAAiB,QAAQ;EACzB,iBAAiB,YAAY;EAC7B,0BAA0B,WAAW;EACrC,yBAAyB,UAAU;CACrC;AACF"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { s as SuiteConfig } from "./types-C0gBkl0-.js";
|
|
2
|
+
import { d as TestSuite, u as TestCase } from "./types-0QkNVyp9.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/config/transform.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Thrown when a YAML suite fails to validate or transform. Carries a JSON-path-
|
|
8
|
+
* like trail so users can find the offending node in their config quickly.
|
|
9
|
+
*/
|
|
10
|
+
declare class ConfigError extends Error {
|
|
11
|
+
readonly path?: string | undefined;
|
|
12
|
+
constructor(message: string, path?: string | undefined);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/config/grading-loader.d.ts
|
|
16
|
+
/** Runtime shape of a parsed grading config file. */
|
|
17
|
+
interface GradingConfig {
|
|
18
|
+
judge: SuiteConfig & {
|
|
19
|
+
adapter?: string;
|
|
20
|
+
maxConcurrent?: number;
|
|
21
|
+
system_instruction?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Load grading YAML from disk and resolve relative paths. */
|
|
25
|
+
declare function loadGradingConfig(filePath: string): Promise<GradingConfig>;
|
|
26
|
+
/**
|
|
27
|
+
* Parse grading YAML from a string.
|
|
28
|
+
*
|
|
29
|
+
* @param sourcePath Optional path for error messages and path resolution.
|
|
30
|
+
*/
|
|
31
|
+
declare function parseGradingConfig(yamlContent: string, sourcePath?: string): GradingConfig;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/config/pipeline-schema.d.ts
|
|
34
|
+
/** Runtime pipeline config with resolved absolute paths. */
|
|
35
|
+
interface PipelineConfig {
|
|
36
|
+
run?: PipelineRunStep;
|
|
37
|
+
grade?: PipelineGradeStep;
|
|
38
|
+
envelope?: PipelineEnvelopeStep;
|
|
39
|
+
}
|
|
40
|
+
/** Resolved `pipeline.run` step — harness eval run output path. */
|
|
41
|
+
interface PipelineRunStep {
|
|
42
|
+
output: string;
|
|
43
|
+
maxConcurrent?: number;
|
|
44
|
+
}
|
|
45
|
+
/** Resolved `pipeline.grade` step — LLM outcome grading inputs and output. */
|
|
46
|
+
interface PipelineGradeStep {
|
|
47
|
+
input?: string;
|
|
48
|
+
output: string;
|
|
49
|
+
maxConcurrent?: number;
|
|
50
|
+
}
|
|
51
|
+
/** Resolved `pipeline.envelope` step — EvalRunEnvelope export options. */
|
|
52
|
+
interface PipelineEnvelopeStep {
|
|
53
|
+
report?: string;
|
|
54
|
+
grading?: string;
|
|
55
|
+
output: string;
|
|
56
|
+
projection: "envelope" | "trajectory" | "instances";
|
|
57
|
+
includeRawStreamEvents?: boolean;
|
|
58
|
+
noTranscript?: boolean;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/config/suite-document.d.ts
|
|
62
|
+
/** Parsed suite.yaml including optional orchestration blocks. */
|
|
63
|
+
interface SuiteDocument {
|
|
64
|
+
/** Absolute path to the suite.yaml file. */
|
|
65
|
+
suitePath: string;
|
|
66
|
+
suite: TestSuite;
|
|
67
|
+
judge?: GradingConfig["judge"];
|
|
68
|
+
pipeline?: PipelineConfig;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/config/suite-document-loader.d.ts
|
|
72
|
+
interface LoadSuiteDocumentOptions {
|
|
73
|
+
/**
|
|
74
|
+
* When true (default), `judge:` and `pipeline:` blocks are validated against
|
|
75
|
+
* their Zod schemas and returned in the result. When false, they are silently
|
|
76
|
+
* stripped — used by {@link loadSuite} so callers that only need the
|
|
77
|
+
* `TestSuite` are not broken by malformed orchestration blocks.
|
|
78
|
+
*/
|
|
79
|
+
validateOrchestration?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Load suite.yaml (or directory) including optional judge and pipeline blocks. */
|
|
82
|
+
declare function loadSuiteDocument(filePath: string, options?: LoadSuiteDocumentOptions): Promise<SuiteDocument>;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/config/loader-internals.d.ts
|
|
85
|
+
/** Parse one case file: single case, array, or `{ cases: [...] }`. */
|
|
86
|
+
declare function parseCasesFile(yamlContent: string, sourcePath?: string): TestCase[];
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/config/loader.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* Load a suite from a file path or directory path (suite portion only).
|
|
91
|
+
*
|
|
92
|
+
* Orchestration blocks (`judge:`, `pipeline:`) are silently stripped — callers
|
|
93
|
+
* that only need the `TestSuite` are not broken by malformed orchestration YAML.
|
|
94
|
+
* Use {@link loadSuiteDocument} when you need validated orchestration metadata.
|
|
95
|
+
*/
|
|
96
|
+
declare function loadSuite(filePath: string): Promise<TestSuite>;
|
|
97
|
+
/**
|
|
98
|
+
* Parse suite YAML from a string (single-file layout with inline cases).
|
|
99
|
+
*
|
|
100
|
+
* Unknown top-level keys such as `judge` and `pipeline` are stripped.
|
|
101
|
+
*/
|
|
102
|
+
declare function parseSuite(yamlContent: string, sourcePath?: string): TestSuite;
|
|
103
|
+
/** Parse `suite.yaml` for directory layout (cases may be omitted). @internal */
|
|
104
|
+
declare function parseSuiteDirectory(yamlContent: string, sourcePath: string): TestSuite;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { loadSuiteDocument as a, GradingConfig as c, ConfigError as d, parseCasesFile as i, loadGradingConfig as l, parseSuite as n, SuiteDocument as o, parseSuiteDirectory as r, PipelineConfig as s, loadSuite as t, parseGradingConfig as u };
|
|
107
|
+
//# sourceMappingURL=loader-B1WmGGzf.d.ts.map
|