vieval 0.0.10 → 0.0.12
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 +31 -31
- package/dist/bin/vieval.mjs +1 -1
- package/dist/bin/vieval.mjs.map +1 -1
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/{cli-DTDgaqeI.mjs → cli-uzS81IPd.mjs} +1483 -1483
- package/dist/cli-uzS81IPd.mjs.map +1 -0
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/core/assertions/index.d.mts +156 -156
- package/dist/core/assertions/index.mjs +82 -82
- package/dist/core/assertions/index.mjs.map +1 -1
- package/dist/core/inference-executors/index.d.mts +37 -37
- package/dist/core/inference-executors/index.mjs +54 -53
- package/dist/core/inference-executors/index.mjs.map +1 -1
- package/dist/core/processors/results/index.d.mts +18 -18
- package/dist/core/processors/results/index.mjs.map +1 -1
- package/dist/core/runner/index.d.mts +2 -2
- package/dist/core/runner/index.mjs +259 -259
- package/dist/core/runner/index.mjs.map +1 -1
- package/dist/core/scheduler/index.d.mts +1 -1
- package/dist/core/scheduler/index.mjs +65 -65
- package/dist/core/scheduler/index.mjs.map +1 -1
- package/dist/{env-DfWZy_n4.d.mts → env-Br6jaWGL.d.mts} +9 -9
- package/dist/{env-nV5rVErX.mjs → env-egxaJtNn.mjs} +8 -8
- package/dist/env-egxaJtNn.mjs.map +1 -0
- package/dist/{expect-extensions-DCSqlneN.mjs → expect-extensions-BKdEPt3h.mjs} +46 -46
- package/dist/expect-extensions-BKdEPt3h.mjs.map +1 -0
- package/dist/expect.d.mts +1 -3
- package/dist/expect.mjs +1 -1
- package/dist/expect.mjs.map +1 -1
- package/dist/{index-D_aMeWqO.d.mts → index-BLIlhiWT.d.mts} +565 -565
- package/dist/{index-Bg0atWBF.d.mts → index-CIaJClcC.d.mts} +48 -48
- package/dist/index.d.mts +208 -197
- package/dist/index.mjs +148 -148
- package/dist/index.mjs.map +1 -1
- package/dist/{models-pBSRUZhY.mjs → models-CaCOUPZw.mjs} +1 -1
- package/dist/{models-pBSRUZhY.mjs.map → models-CaCOUPZw.mjs.map} +1 -1
- package/dist/plugins/chat-models/index.d.mts +279 -279
- package/dist/plugins/chat-models/index.mjs +360 -360
- package/dist/plugins/chat-models/index.mjs.map +1 -1
- package/dist/{queue-DsZQkZO_.mjs → queue-BL86z2W_.mjs} +1 -1
- package/dist/{queue-DsZQkZO_.mjs.map → queue-BL86z2W_.mjs.map} +1 -1
- package/dist/{registry-DMnwE_mY.mjs → registry-BK7k6X81.mjs} +294 -294
- package/dist/registry-BK7k6X81.mjs.map +1 -0
- package/dist/testing/expect-extensions.d.mts +27 -27
- package/dist/testing/expect-extensions.mjs +1 -1
- package/package.json +12 -12
- package/dist/cli-DTDgaqeI.mjs.map +0 -1
- package/dist/env-nV5rVErX.mjs.map +0 -1
- package/dist/expect-extensions-DCSqlneN.mjs.map +0 -1
- package/dist/registry-DMnwE_mY.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-nV5rVErX.mjs","names":[],"sources":["../src/core/inference-executors/env.ts"],"sourcesContent":["/**\n * Supported env value coercion types.\n */\nexport type EnvValueType = 'string'\n\n/**\n * Common options for env readers.\n */\nexport interface EnvFromOptions {\n /**\n * Env key to read and use in error messages.\n */\n name: string\n /**\n * Expected env value type.\n */\n type: EnvValueType\n /**\n * Whether an empty or missing value should throw.\n *\n * @default false\n */\n required?: boolean\n}\n\n/**\n * Env options used by the required helper.\n *\n * `required` is intentionally omitted because this helper is always required.\n */\nexport type RequiredEnvFromOptions = Omit<EnvFromOptions, 'required'>\n\ntype EnvSource = Record<string, string | undefined>\n\nfunction assertNonEmptyString(value: string | undefined, options: EnvFromOptions): string | undefined {\n if (value == null || value.trim().length === 0) {\n if (options.required === true) {\n throw new Error(`Missing required ${options.name}.`)\n }\n\n return undefined\n }\n\n return value\n}\n\n/**\n * Parses one env value with optional required behavior.\n *\n * Example:\n * `const apiKey = envFrom(process.env, { type: 'string', required: true, name: 'OPENAI_API_KEY' })`\n */\nexport function envFrom<TEnv extends EnvSource>(\n env: TEnv,\n options: EnvFromOptions & { name: keyof TEnv & string },\n): string | undefined {\n if (options.type === 'string') {\n return assertNonEmptyString(env[options.name], options)\n }\n\n return undefined\n}\n\n/**\n * Parses one required env value.\n *\n * Example:\n * `const apiKey = requiredEnvFrom(process.env, { type: 'string', name: 'OPENAI_API_KEY' })`\n */\nexport function requiredEnvFrom<TEnv extends EnvSource>(\n env: TEnv,\n options: RequiredEnvFromOptions & { name: keyof TEnv & string },\n): string {\n const parsed = envFrom(env, {\n ...options,\n required: true,\n })\n\n if (parsed == null) {\n throw new Error(`Missing required ${options.name}.`)\n }\n\n return parsed\n}\n"],"mappings":";AAkCA,SAAS,qBAAqB,OAA2B,SAA6C;AACpG,KAAI,SAAS,QAAQ,MAAM,MAAM,CAAC,WAAW,GAAG;AAC9C,MAAI,QAAQ,aAAa,KACvB,OAAM,IAAI,MAAM,oBAAoB,QAAQ,KAAK,GAAG;AAGtD;;AAGF,QAAO;;;;;;;;AAST,SAAgB,QACd,KACA,SACoB;AACpB,KAAI,QAAQ,SAAS,SACnB,QAAO,qBAAqB,IAAI,QAAQ,OAAO,QAAQ;;;;;;;;AAY3D,SAAgB,gBACd,KACA,SACQ;CACR,MAAM,SAAS,QAAQ,KAAK;EAC1B,GAAG;EACH,UAAU;EACX,CAAC;AAEF,KAAI,UAAU,KACZ,OAAM,IAAI,MAAM,oBAAoB,QAAQ,KAAK,GAAG;AAGtD,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expect-extensions-DCSqlneN.mjs","names":[],"sources":["../src/testing/runtime-expect.ts","../src/testing/expect-extensions.ts"],"sourcesContent":["import type { ExpectStatic, MatchersObject, MatcherState, Tester } from '@vitest/expect'\n\nimport {\n addCustomEqualityTesters,\n ASYMMETRIC_MATCHERS_OBJECT,\n chai,\n ChaiStyleAssertions,\n customMatchers,\n getState,\n GLOBAL_EXPECT,\n JestAsymmetricMatchers,\n JestChaiExpect,\n JestExtend,\n setState,\n} from '@vitest/expect'\n\nlet isPluginInstalled = false\nlet runtimeExpectInstance: ExpectStatic | undefined\n\n/**\n * Installs Vitest expect plugins once for process-local runtime assertions.\n *\n * Use when:\n * - running eval tasks outside Vitest worker runtime\n * - building an `expect` instance that does not rely on Vitest internal state\n *\n * Expects:\n * - `@vitest/expect` is available in runtime dependencies\n *\n * Returns:\n * - nothing; side-effects are applied to `chai`\n */\nfunction ensureRuntimeExpectPluginsInstalled(): void {\n if (isPluginInstalled) {\n return\n }\n\n chai.use(JestExtend)\n chai.use(JestChaiExpect)\n chai.use(ChaiStyleAssertions)\n chai.use(JestAsymmetricMatchers)\n isPluginInstalled = true\n}\n\n/**\n * Creates a Vitest-compatible `expect` instance without worker-state coupling.\n *\n * Use when:\n * - CLI runtime needs assertion helpers from `vieval/expect`\n * - code is executed outside `vitest run`\n *\n * Expects:\n * - plugins from {@link ensureRuntimeExpectPluginsInstalled} are installed\n * - callers do not depend on Vitest worker-only features (snapshot/poll internals)\n *\n * Returns:\n * - standalone expect instance with core matcher APIs and `extend`\n */\nfunction createRuntimeExpect(): ExpectStatic {\n ensureRuntimeExpectPluginsInstalled()\n\n const runtimeExpect = ((value: unknown, message?: string) => {\n const currentState = getState(runtimeExpect)\n setState({ assertionCalls: currentState.assertionCalls + 1 }, runtimeExpect)\n return chai.expect(value, message)\n }) as unknown as ExpectStatic\n\n Object.assign(runtimeExpect, chai.expect)\n Object.assign(runtimeExpect, (globalThis as Record<PropertyKey, unknown>)[ASYMMETRIC_MATCHERS_OBJECT] as object)\n\n runtimeExpect.getState = () => getState(runtimeExpect)\n runtimeExpect.setState = (state: Partial<MatcherState>) => setState(state, runtimeExpect)\n runtimeExpect.assert = chai.assert\n // NOTICE:\n // Chai's public `ExpectStatic` type does not expose Vitest's plugin-added `extend`.\n // Runtime `chai.expect.extend` exists after `JestExtend` plugin installation.\n // Source/context: `@vitest/expect` plugin pipeline in `dist/index.js`.\n // Removal condition: remove this cast if upstream exposes `extend` on Chai expect types.\n const chaiExpectWithExtend = chai.expect as unknown as {\n extend: (expect: ExpectStatic, matchers: MatchersObject) => void\n }\n runtimeExpect.extend = (matchers: MatchersObject) => chaiExpectWithExtend.extend(runtimeExpect, matchers)\n runtimeExpect.addEqualityTesters = (customTesters: Tester[]) => addCustomEqualityTesters(customTesters)\n runtimeExpect.unreachable = (message?: string) => {\n chai.assert.fail(`expected${message ? ` \"${message}\" ` : ' '}not to be reached`)\n }\n\n runtimeExpect.setState({\n assertionCalls: 0,\n currentTestName: '',\n expectedAssertionsNumber: null,\n expectedAssertionsNumberErrorGen: null,\n isExpectingAssertions: false,\n isExpectingAssertionsError: null,\n })\n\n runtimeExpect.extend(customMatchers)\n\n return runtimeExpect\n}\n\n/**\n * Returns process-local runtime `expect` instance used by Vieval.\n *\n * Use when:\n * - you need matcher assertions in eval files and CLI runtime\n * - importing from `vitest` would crash outside Vitest worker contexts\n *\n * Expects:\n * - single-process usage (instance is memoized per process)\n *\n * Returns:\n * - memoized runtime `expect` instance\n */\nexport function getRuntimeExpect(): ExpectStatic {\n if (runtimeExpectInstance != null) {\n return runtimeExpectInstance\n }\n\n runtimeExpectInstance = createRuntimeExpect()\n Object.defineProperty(globalThis, GLOBAL_EXPECT, {\n configurable: true,\n value: runtimeExpectInstance,\n writable: true,\n })\n\n return runtimeExpectInstance\n}\n","import type { RubricJudgeResult, ToolCall } from '../core/assertions'\n\nimport { normalizeMatchText } from '../core/assertions'\nimport { getRuntimeExpect } from './runtime-expect'\n\n/**\n * Options for keyword-based matcher behavior.\n */\nexport interface KeywordMatcherOptions {\n /**\n * Case-sensitive matching toggle.\n *\n * @default false\n */\n caseSensitive?: boolean\n /**\n * Match mode.\n *\n * @default 'all'\n */\n mode?: 'all' | 'any'\n}\n\n/**\n * Shape used by tool-call matchers.\n */\nexport interface ToolCallContainer {\n /**\n * Tool calls to inspect.\n */\n toolCalls?: readonly ToolCall[]\n}\n\nfunction toKeywordArray(keywords: string | readonly string[]): readonly string[] {\n if (typeof keywords === 'string') {\n return [keywords]\n }\n\n return keywords\n}\n\n/**\n * Registers vieval custom matchers on Vitest `expect`.\n *\n * Call stack:\n *\n * {@link installVievalExpectMatchers}\n * -> `expect.extend(...)`\n * -> `expect(received).toMustInclude(...)`\n * -> `expect(received).toScoreRubricGreaterThan(...)`\n *\n * Use when:\n * - eval suites need domain assertions while preserving native Vitest ergonomics\n * - callers want native `.not` chaining with the same matchers\n */\nexport function installVievalExpectMatchers(): void {\n const expect = getRuntimeExpect()\n\n expect.extend({\n toMustExclude(received: unknown, keywords: string | readonly string[], options: KeywordMatcherOptions = {}) {\n const keywordList = toKeywordArray(keywords)\n\n if (typeof received !== 'string') {\n return {\n message: () => 'Expected received value to be a string.',\n pass: false,\n }\n }\n\n const normalizedText = normalizeMatchText(received, options.caseSensitive ?? false)\n const forbiddenMatches = keywordList.filter((keyword) => {\n return normalizedText.includes(normalizeMatchText(keyword, options.caseSensitive ?? false))\n })\n\n const pass = forbiddenMatches.length === 0\n\n return {\n message: () => {\n if (pass) {\n return `Expected text to include forbidden keywords: ${keywordList.join(', ')}`\n }\n\n return `Expected text not to include forbidden keywords, but matched: ${forbiddenMatches.join(', ')}`\n },\n pass,\n }\n },\n\n toMustInclude(received: unknown, keywords: string | readonly string[], options: KeywordMatcherOptions = {}) {\n const keywordList = toKeywordArray(keywords)\n\n if (typeof received !== 'string') {\n return {\n message: () => 'Expected received value to be a string.',\n pass: false,\n }\n }\n\n const normalizedText = normalizeMatchText(received, options.caseSensitive ?? false)\n const matches = keywordList.filter((keyword) => {\n return normalizedText.includes(normalizeMatchText(keyword, options.caseSensitive ?? false))\n })\n\n const mode = options.mode ?? 'all'\n const pass = mode === 'all' ? matches.length === keywordList.length : matches.length > 0\n\n return {\n message: () => {\n if (pass) {\n return `Expected text not to match required keywords, but matched: ${matches.join(', ')}`\n }\n\n return `Expected text to match required keywords (${mode}), but matched ${matches.length}/${keywordList.length}.`\n },\n pass,\n }\n },\n\n toScoreRubricGreaterThan(received: unknown, threshold: number) {\n const score = typeof received === 'number'\n ? received\n : (received as RubricJudgeResult | null)?.score\n\n if (typeof score !== 'number') {\n return {\n message: () => 'Expected received value to be a number or RubricJudgeResult.',\n pass: false,\n }\n }\n\n const pass = score > threshold\n\n return {\n message: () => {\n if (pass) {\n return `Expected rubric score ${score} to be less than or equal to ${threshold}.`\n }\n\n return `Expected rubric score ${score} to be greater than ${threshold}.`\n },\n pass,\n }\n },\n\n toSatisfyStructuredOutput<T>(received: unknown, validator: (value: unknown) => value is T) {\n const pass = validator(received)\n\n return {\n message: () => pass\n ? 'Expected structured output validator to fail.'\n : 'Expected structured output validator to pass.',\n pass,\n }\n },\n\n toSatisfyToolCallArgs(\n received: unknown,\n toolName: string,\n validator: (args: unknown) => boolean,\n ) {\n const toolCalls = (received as ToolCallContainer | null)?.toolCalls\n\n if (toolCalls == null) {\n return {\n message: () => 'Expected received value to provide toolCalls array.',\n pass: false,\n }\n }\n\n const targetCall = toolCalls.find(call => call.name === toolName)\n if (targetCall == null) {\n return {\n message: () => `Expected tool call ${toolName} to exist.`,\n pass: false,\n }\n }\n\n const pass = validator(targetCall.args)\n\n return {\n message: () => pass\n ? `Expected tool call args for ${toolName} to fail validation.`\n : `Expected tool call args for ${toolName} to pass validation.`,\n pass,\n }\n },\n })\n}\n\ninterface VievalCustomMatchers {\n /**\n * Asserts that text includes required keywords.\n *\n * Example:\n * `expect('calm answer').toMustInclude(['calm'])`\n */\n toMustInclude: (keywords: string | readonly string[], options?: KeywordMatcherOptions) => void\n /**\n * Asserts that text excludes forbidden keywords.\n *\n * Example:\n * `expect('calm answer').toMustExclude(['bestmove'])`\n */\n toMustExclude: (keywords: string | readonly string[], options?: KeywordMatcherOptions) => void\n /**\n * Asserts rubric score is greater than a threshold.\n *\n * Example:\n * `expect({ score: 0.91 }).toScoreRubricGreaterThan(0.8)`\n */\n toScoreRubricGreaterThan: (threshold: number) => void\n /**\n * Asserts structured output satisfies a validator.\n *\n * Example:\n * `expect(value).toSatisfyStructuredOutput(isMyShape)`\n */\n toSatisfyStructuredOutput: <TValue>(validator: (value: unknown) => value is TValue) => void\n /**\n * Asserts selected tool-call args satisfy validator.\n *\n * Example:\n * `expect({ toolCalls }).toSatisfyToolCallArgs('builtIn_sparkCommand', isSparkArgs)`\n */\n toSatisfyToolCallArgs: (toolName: string, validator: (args: unknown) => boolean) => void\n}\n\n/* eslint-disable unused-imports/no-unused-vars */\ndeclare module '@vitest/expect' {\n interface Matchers<T = any> extends VievalCustomMatchers {}\n interface Assertion<T = any> extends VievalCustomMatchers {}\n}\n\ndeclare module 'vitest' {\n interface Assertion extends VievalCustomMatchers {}\n interface Matchers<T = any> extends VievalCustomMatchers {}\n}\n/* eslint-enable unused-imports/no-unused-vars */\n"],"mappings":";;;AAgBA,IAAI,oBAAoB;AACxB,IAAI;;;;;;;;;;;;;;AAeJ,SAAS,sCAA4C;AACnD,KAAI,kBACF;AAGF,MAAK,IAAI,WAAW;AACpB,MAAK,IAAI,eAAe;AACxB,MAAK,IAAI,oBAAoB;AAC7B,MAAK,IAAI,uBAAuB;AAChC,qBAAoB;;;;;;;;;;;;;;;;AAiBtB,SAAS,sBAAoC;AAC3C,sCAAqC;CAErC,MAAM,kBAAkB,OAAgB,YAAqB;AAE3D,WAAS,EAAE,gBADU,SAAS,cAAc,CACJ,iBAAiB,GAAG,EAAE,cAAc;AAC5E,SAAO,KAAK,OAAO,OAAO,QAAQ;;AAGpC,QAAO,OAAO,eAAe,KAAK,OAAO;AACzC,QAAO,OAAO,eAAgB,WAA4C,4BAAsC;AAEhH,eAAc,iBAAiB,SAAS,cAAc;AACtD,eAAc,YAAY,UAAiC,SAAS,OAAO,cAAc;AACzF,eAAc,SAAS,KAAK;CAM5B,MAAM,uBAAuB,KAAK;AAGlC,eAAc,UAAU,aAA6B,qBA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J,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-DMnwE_mY.mjs","names":["loadEnv","loadViteEnv"],"sources":["../src/cli/config.ts","../src/core/telemetry/noop.ts","../src/core/telemetry/otel.ts","../src/dsl/registry.ts"],"sourcesContent":["import type { CliReportingConfig, ConfigHookPlugin, MatrixDefinition, MatrixLayer, TaskRunContext } from '../config'\nimport type { ModelDefinition } from '../config/models'\nimport type { RunResult, TaskExecutionContext } from '../core/runner'\nimport type { InferenceExecutor, ScheduledTask } from '../core/runner/schedule'\nimport type { VievalVitestCompatReporterReference } from './reporters/vitest-compat-reporter'\n\nimport process from 'node:process'\n\nimport { access, readFile } from 'node:fs/promises'\nimport { createRequire } from 'node:module'\nimport { dirname, extname, isAbsolute, join, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\n\nimport { errorMessageFrom } from '@moeru/std'\nimport { createDefineConfig, loadConfig } from 'c12'\nimport { loadEnv as loadViteEnv } from 'vite'\n\nconst matrixLayerKeys = new Set(['disable', 'extend', 'override'])\nconst ambiguousMatrixDefinitionErrorMessage = 'Ambiguous matrix definition: cannot mix reserved layer keys (disable, extend, override) with matrix axis keys.'\nconst require = createRequire(import.meta.url)\n\n/**\n * CLI plugin shape bound to the full CLI config object.\n */\nexport type CliConfigPlugin = ConfigHookPlugin<CliConfig>\n\n/**\n * Concurrency limits that can be declared in CLI-facing config.\n *\n * Use when:\n * - the CLI needs independent caps for workspace, project, task, attempt, or case scheduling scopes\n * - config authors want to define concurrency without wiring runtime execution yet\n *\n * Expects:\n * - each provided value to be a positive integer chosen by the caller\n *\n * Returns:\n * - one partial concurrency descriptor keyed by scheduling scope\n */\nexport interface CliConcurrencyConfig {\n /**\n * Workspace-level concurrency cap.\n */\n workspace?: number\n /**\n * Project-level concurrency cap.\n */\n project?: number\n /**\n * Task-level concurrency cap.\n */\n task?: number\n /**\n * Attempt-level concurrency cap.\n */\n attempt?: number\n /**\n * Case-level concurrency cap.\n */\n case?: number\n}\n\n/**\n * Defines one project block for `vieval run`.\n */\nexport interface CliProjectConfig {\n /**\n * Project label used in summary output.\n */\n name: string\n /**\n * Project root used for include/exclude glob matching.\n *\n * @default process cwd\n */\n root?: string\n /**\n * Glob patterns for eval file discovery.\n *\n * @default Common eval file globs for TypeScript and JavaScript module formats.\n */\n include?: string[]\n /**\n * Glob patterns excluded from discovery.\n *\n * @default Common exclusion globs for dependencies, build output, and VCS directories.\n */\n exclude?: string[]\n /**\n * Providers expanded by scheduler.\n *\n * @default [{ id: 'default' }]\n */\n inferenceExecutors?: InferenceExecutor[]\n /**\n * Model definitions available to project runtime execution.\n *\n * Inference executors control schedule fan-out, while models provide\n * runtime lookup metadata for model plugin helpers during task execution.\n *\n * @default inherited from top-level config models\n */\n models?: ModelDefinition[]\n /**\n * Optional run-time matrix dimensions.\n */\n runMatrix?: MatrixDefinition | MatrixLayer\n /**\n * Optional eval-time matrix dimensions.\n */\n evalMatrix?: MatrixDefinition | MatrixLayer\n /**\n * Optional project-scoped concurrency overrides.\n *\n * @default inherited from top-level or CLI execution settings\n */\n concurrency?: Omit<CliConcurrencyConfig, 'workspace'>\n /**\n * Optional task executor.\n *\n * Use when this project should execute live inferenceExecutor requests.\n * If omitted, `vieval run` performs collection + scheduling only.\n */\n executor?: (task: ScheduledTask, context: CliProjectExecutorContext) => Promise<RunResult>\n /**\n * Optional project-local plugins.\n */\n plugins?: CliConfigPlugin[]\n /**\n * Optional vitest-compatible reporter modules.\n *\n * Use when:\n * - project runs should emit additional reporter callbacks using Vitest-style lifecycle names\n *\n * @default []\n */\n reporters?: VievalVitestCompatReporterReference[]\n}\n\n/**\n * One workspace descriptor for workspace-mode configs.\n */\nexport interface CliWorkspaceConfig {\n /**\n * Workspace identifier.\n */\n id: string\n /**\n * Workspace root path.\n */\n root: string\n}\n\n/**\n * One explicit comparison method descriptor.\n */\nexport interface CliComparisonMethodConfig {\n /**\n * Method identifier shown in compare reports.\n */\n id: string\n /**\n * Workspace path containing this method's `vieval.config.*`.\n */\n workspace: string\n /**\n * Project name to execute inside workspace config.\n */\n project: string\n /**\n * Optional explicit config file path for this workspace.\n */\n configFilePath?: string\n}\n\n/**\n * Benchmark identity and shared cache namespace.\n */\nexport interface CliComparisonBenchmarkConfig {\n /**\n * Benchmark identifier used in report artifacts.\n */\n id: string\n /**\n * Shared cache namespace reused across method runs.\n */\n sharedCaseNamespace: string\n}\n\n/**\n * One comparison entry loaded by `vieval compare`.\n */\nexport interface CliComparisonConfig {\n /**\n * Comparison id selected by `--comparison`.\n */\n id: string\n /**\n * Benchmark metadata for reporting and shared cache coordination.\n */\n benchmark: CliComparisonBenchmarkConfig\n /**\n * Optional explicit method list.\n */\n methods?: CliComparisonMethodConfig[]\n /**\n * Optional workspace glob(s) discovered relative to config directory.\n */\n includesWorkspaces?: string | string[]\n /**\n * Optional workspace exclude glob(s), also relative to config directory.\n */\n excludesWorkspaces?: string | string[]\n}\n\n/**\n * Execution context exposed to project-level `executor` implementations.\n *\n * Use when:\n * - a project executor needs task-scoped models plus case reporter hooks\n * - custom scheduling logic wants the same hook shape as `TaskRunContext`\n *\n * Expects:\n * - `models` exposes configured model registrations for plugin helpers\n * - `reporterHooks` follows `TaskRunContext['reporterHooks']`\n * - `telemetry` follows `TaskRunContext['telemetry']`\n * - `runtimeConcurrency` follows `TaskRunContext['runtimeConcurrency']`\n */\nexport interface CliProjectExecutorContext extends TaskExecutionContext {\n reporterHooks?: TaskRunContext['reporterHooks']\n telemetry?: TaskRunContext['telemetry']\n runtimeConcurrency?: TaskRunContext['runtimeConcurrency']\n}\n\n/**\n * Top-level CLI config loaded from `vieval.config.*`.\n */\ninterface CliConfigBase {\n /**\n * Global model definitions inherited by projects.\n *\n * @default []\n */\n models?: ModelDefinition[]\n /**\n * Global concurrency defaults inherited by projects and tasks.\n *\n * Use when:\n * - config authors want one shared concurrency policy across workspace, project, task, attempt, and case scopes\n * - project-local overrides should start from a top-level baseline\n *\n * Expects:\n * - each provided value to be a positive integer chosen by the caller\n *\n * @default undefined\n */\n concurrency?: CliConcurrencyConfig\n /**\n * Global config plugins.\n *\n * @default []\n */\n plugins?: CliConfigPlugin[]\n /**\n * Global vitest-compatible reporter modules inherited by projects.\n *\n * @default []\n */\n reporters?: VievalVitestCompatReporterReference[]\n /**\n * Environment variables injected into `process.env` during `vieval run`.\n *\n * Use when:\n * - eval tasks depend on runtime env values (for example inferenceExecutor API keys)\n * - config wants deterministic env values without shell-level exports\n *\n * @default {}\n */\n env?: NodeJS.ProcessEnv\n /**\n * Optional reporting integrations shared by CLI run orchestration.\n *\n * @default undefined\n */\n reporting?: CliReportingConfig\n}\n\n/**\n * Project mode config for `vieval run`.\n */\nexport interface CliProjectModeConfig extends CliConfigBase {\n /**\n * Project list expanded by `vieval run`.\n *\n * @default [{ name: 'default' }]\n */\n projects?: CliProjectConfig[]\n comparisons?: never\n workspaces?: never\n}\n\n/**\n * Workspace mode config placeholder for future workspace orchestration.\n */\nexport interface CliWorkspaceModeConfig extends CliConfigBase {\n workspaces: CliWorkspaceConfig[]\n projects?: never\n comparisons?: never\n}\n\n/**\n * Comparison mode config for `vieval compare`.\n */\nexport interface CliComparisonModeConfig extends CliConfigBase {\n comparisons: CliComparisonConfig[]\n projects?: never\n workspaces?: never\n}\n\n/**\n * Top-level CLI config loaded from `vieval.config.*`.\n *\n * Exactly one top-level mode is allowed:\n * - `projects`\n * - `workspaces`\n * - `comparisons`\n */\nexport type CliConfig = CliProjectModeConfig | CliWorkspaceModeConfig | CliComparisonModeConfig\n\nexport type CliConfigMode = 'comparisons' | 'projects' | 'workspaces'\n\nexport interface LoadedRawCliConfig {\n config: CliConfig | null\n configFilePath: string | null\n}\n\n/**\n * Normalized CLI project used by runtime orchestration.\n */\nexport interface NormalizedCliProjectConfig {\n concurrency?: Omit<CliConcurrencyConfig, 'workspace'>\n exclude: string[]\n executor?: (task: ScheduledTask, context: CliProjectExecutorContext) => Promise<RunResult>\n include: string[]\n runMatrix?: MatrixLayer\n evalMatrix?: MatrixLayer\n models: ModelDefinition[]\n name: string\n inferenceExecutors: InferenceExecutor[]\n root: string\n reporters: VievalVitestCompatReporterReference[]\n}\n\n/**\n * Result of loading and normalizing a config file.\n */\nexport interface LoadedCliConfig {\n concurrency?: CliConcurrencyConfig\n configFilePath: string | null\n env: NodeJS.ProcessEnv\n projects: NormalizedCliProjectConfig[]\n reporting?: CliReportingConfig\n}\n\n/**\n * Runtime options for config loading.\n */\nexport interface LoadVievalCliConfigOptions {\n /**\n * Starting directory for config lookup.\n *\n * @default process.cwd()\n */\n cwd?: string\n /**\n * Explicit config file path.\n */\n configFilePath?: string\n}\n\n/**\n * Helper used by `vieval.config.*` for better type inference.\n */\nexport const defineConfig = createDefineConfig<CliConfig>()\n\n/**\n * Loads `.env*` files using Vite's env resolution behavior.\n *\n * Use when:\n * - `vieval.config.*` should mirror Vitest/Vite env loading semantics\n * - config wants to populate top-level `env` via file-based values\n *\n * Expects:\n * - `mode` to match the env file suffix (`.env.<mode>`)\n * - `envDir` to point at the directory containing `.env` files\n *\n * Returns:\n * - Key/value map compatible with `CliConfig['env']`\n */\nexport function loadEnv(mode: string, envDir: string, prefixes: string | string[] = ''): NodeJS.ProcessEnv {\n return loadViteEnv(mode, envDir, prefixes)\n}\n\nasync function applyVievalPlugins(config: CliConfig): Promise<CliConfig> {\n let currentConfig: CliConfig = config\n const plugins = currentConfig.plugins ?? []\n\n for (const plugin of plugins) {\n if (plugin.configVieval == null) {\n continue\n }\n\n const nextConfig = await plugin.configVieval(currentConfig)\n if (nextConfig != null) {\n currentConfig = {\n ...currentConfig,\n ...nextConfig,\n } as CliConfig\n }\n }\n\n for (const plugin of plugins) {\n await plugin.configVievalResolved?.(currentConfig)\n }\n\n return currentConfig\n}\n\nasync function isReadableFile(filePath: string): Promise<boolean> {\n try {\n await access(filePath)\n return true\n }\n catch {\n return false\n }\n}\n\nfunction isConfigFileExtensionUsingRequire(extension: string): boolean {\n return extension === '.cjs' || extension === '.cts'\n}\n\nfunction isConfigFileExtensionUsingJsonParse(extension: string): boolean {\n return extension === '.json'\n}\n\nasync function importVievalConfigModule(filePath: string): Promise<unknown> {\n const extension = extname(filePath)\n\n if (isConfigFileExtensionUsingJsonParse(extension)) {\n const raw = await readFile(filePath, 'utf-8')\n return JSON.parse(raw) as unknown\n }\n\n if (isConfigFileExtensionUsingRequire(extension)) {\n return require(filePath) as unknown\n }\n\n return import(pathToFileURL(filePath).href)\n}\n\nfunction resolveConfigExport(moduleValue: unknown): unknown {\n if (moduleValue == null) {\n return null\n }\n\n if (typeof moduleValue !== 'object') {\n return moduleValue\n }\n\n if ('default' in moduleValue) {\n return (moduleValue as { default: unknown }).default\n }\n\n return moduleValue\n}\n\nasync function findNearestConfigFile(startDirectory: string): Promise<string | null> {\n const supportedFileNames = [\n 'vieval.config.ts',\n 'vieval.config.mts',\n 'vieval.config.cts',\n 'vieval.config.js',\n 'vieval.config.mjs',\n 'vieval.config.cjs',\n 'vieval.config.json',\n ]\n\n let currentDirectory = resolve(startDirectory)\n\n while (true) {\n for (const fileName of supportedFileNames) {\n const candidatePath = join(currentDirectory, fileName)\n if (await isReadableFile(candidatePath)) {\n return candidatePath\n }\n }\n\n const parentDirectory = dirname(currentDirectory)\n if (parentDirectory === currentDirectory) {\n return null\n }\n currentDirectory = parentDirectory\n }\n}\n\nasync function resolveVievalConfig(\n cwd: string,\n explicitConfigFilePath: string | undefined,\n): Promise<{\n config: CliConfig | null\n configFilePath: string | null\n}> {\n const resolvedConfigFilePath = explicitConfigFilePath == null\n ? await findNearestConfigFile(cwd)\n : (isAbsolute(explicitConfigFilePath) ? explicitConfigFilePath : resolve(cwd, explicitConfigFilePath))\n\n if (explicitConfigFilePath != null && resolvedConfigFilePath != null && !await isReadableFile(resolvedConfigFilePath)) {\n throw new Error(`Config file does not exist or is not readable: ${resolvedConfigFilePath}`)\n }\n\n if (resolvedConfigFilePath == null) {\n return {\n config: null,\n configFilePath: null,\n }\n }\n\n const loaded = await loadConfig<CliConfig>({\n configFile: resolvedConfigFilePath,\n cwd,\n dotenv: false,\n envName: false,\n extend: false,\n import: importVievalConfigModule,\n packageJson: false,\n rcFile: false,\n resolveModule: resolveConfigExport,\n })\n return {\n config: loaded.config,\n configFilePath: resolvedConfigFilePath,\n }\n}\n\nfunction isLayerMatrixDefinition(matrix: MatrixDefinition | MatrixLayer): matrix is MatrixLayer {\n const matrixKeys = Object.keys(matrix)\n return (\n matrixKeys.length > 0\n && matrixKeys.every(key => matrixLayerKeys.has(key))\n )\n}\n\nfunction assertNonAmbiguousMatrixDefinition(matrix: MatrixDefinition | MatrixLayer): void {\n const matrixKeys = Object.keys(matrix)\n const hasReservedKeys = matrixKeys.some(key => matrixLayerKeys.has(key))\n const hasAxisKeys = matrixKeys.some(key => !matrixLayerKeys.has(key))\n\n if (hasReservedKeys && hasAxisKeys) {\n throw new TypeError(ambiguousMatrixDefinitionErrorMessage)\n }\n}\n\nfunction normalizeMatrixLayerInput(matrix: MatrixDefinition | MatrixLayer | undefined): MatrixLayer | undefined {\n if (matrix == null) {\n return undefined\n }\n\n assertNonAmbiguousMatrixDefinition(matrix)\n\n if (isLayerMatrixDefinition(matrix)) {\n return matrix\n }\n\n return {\n extend: matrix,\n }\n}\n\nfunction toProjectConcurrencyDefaults(\n concurrency: CliConcurrencyConfig | undefined,\n): Omit<CliConcurrencyConfig, 'workspace'> | undefined {\n if (concurrency == null) {\n return undefined\n }\n\n return {\n attempt: concurrency.attempt,\n case: concurrency.case,\n project: concurrency.project,\n task: concurrency.task,\n }\n}\n\nfunction mergeProjectConcurrency(\n inheritedConcurrency: Omit<CliConcurrencyConfig, 'workspace'> | undefined,\n projectConcurrency: Omit<CliConcurrencyConfig, 'workspace'> | undefined,\n): Omit<CliConcurrencyConfig, 'workspace'> | undefined {\n if (inheritedConcurrency == null && projectConcurrency == null) {\n return undefined\n }\n\n return {\n attempt: projectConcurrency?.attempt ?? inheritedConcurrency?.attempt,\n case: projectConcurrency?.case ?? inheritedConcurrency?.case,\n project: projectConcurrency?.project ?? inheritedConcurrency?.project,\n task: projectConcurrency?.task ?? inheritedConcurrency?.task,\n }\n}\n\nfunction normalizeProjectConfig(\n project: CliProjectConfig,\n cwd: string,\n inheritedConcurrency: Omit<CliConcurrencyConfig, 'workspace'> | undefined,\n inheritedModels: readonly ModelDefinition[],\n inheritedReporterReferences: readonly VievalVitestCompatReporterReference[],\n): NormalizedCliProjectConfig {\n const include = project.include ?? [\n '**/*.eval.ts',\n '**/*.eval.mts',\n '**/*.eval.cts',\n '**/*.eval.js',\n '**/*.eval.mjs',\n '**/*.eval.cjs',\n ]\n const exclude = project.exclude ?? [\n '**/node_modules/**',\n '**/dist/**',\n '**/.git/**',\n ]\n const models = project.models ?? [...inheritedModels]\n const inferenceExecutors = project.inferenceExecutors ?? [{ id: 'default' }]\n const root = project.root == null\n ? cwd\n : (isAbsolute(project.root) ? project.root : resolve(cwd, project.root))\n const reporters = project.reporters ?? [...inheritedReporterReferences]\n const concurrency = mergeProjectConcurrency(inheritedConcurrency, project.concurrency)\n\n return {\n concurrency,\n exclude,\n executor: project.executor,\n include,\n evalMatrix: normalizeMatrixLayerInput(project.evalMatrix),\n models,\n name: project.name,\n inferenceExecutors,\n reporters,\n runMatrix: normalizeMatrixLayerInput(project.runMatrix),\n root,\n }\n}\n\nfunction createProjectScopedConfig(\n config: CliConfig | null | undefined,\n project: CliProjectConfig,\n normalizedProject: NormalizedCliProjectConfig,\n): CliProjectModeConfig {\n const concurrency = config?.concurrency == null && normalizedProject.concurrency == null\n ? undefined\n : {\n ...normalizedProject.concurrency,\n workspace: config?.concurrency?.workspace,\n }\n\n return {\n concurrency,\n env: config?.env,\n models: normalizedProject.models,\n plugins: project.plugins,\n projects: [\n {\n concurrency: normalizedProject.concurrency,\n exclude: normalizedProject.exclude,\n executor: normalizedProject.executor,\n include: normalizedProject.include,\n evalMatrix: normalizedProject.evalMatrix,\n inferenceExecutors: normalizedProject.inferenceExecutors,\n models: normalizedProject.models,\n name: normalizedProject.name,\n plugins: project.plugins,\n reporters: normalizedProject.reporters,\n root: normalizedProject.root,\n runMatrix: normalizedProject.runMatrix,\n },\n ],\n reporters: normalizedProject.reporters,\n reporting: config?.reporting,\n }\n}\n\nasync function applyProjectPlugins(\n config: CliConfig | null | undefined,\n project: CliProjectConfig,\n normalizedProject: NormalizedCliProjectConfig,\n cwd: string,\n): Promise<NormalizedCliProjectConfig> {\n if (project.plugins == null || project.plugins.length === 0) {\n return normalizedProject\n }\n\n const scopedConfig = createProjectScopedConfig(config, project, normalizedProject)\n const resolvedConfig = await applyVievalPlugins(scopedConfig) as CliProjectModeConfig\n const scopedProject = scopedConfig.projects?.[0]\n if (scopedProject == null) {\n throw new Error('Project-local plugin normalization requires one scoped project.')\n }\n const resolvedProject = resolvedConfig.projects?.[0] ?? scopedProject\n\n return normalizeProjectConfig(\n {\n ...resolvedProject,\n concurrency: resolvedProject.concurrency === scopedProject.concurrency\n ? toProjectConcurrencyDefaults(resolvedConfig.concurrency)\n : resolvedProject.concurrency,\n models: resolvedProject.models === scopedProject.models\n ? resolvedConfig.models\n : resolvedProject.models,\n reporters: resolvedProject.reporters === scopedProject.reporters\n ? resolvedConfig.reporters\n : resolvedProject.reporters,\n },\n cwd,\n undefined,\n resolvedConfig.models ?? [],\n resolvedConfig.reporters ?? [],\n )\n}\n\nasync function normalizeConfig(config: CliConfig | null | undefined, cwd: string): Promise<NormalizedCliProjectConfig[]> {\n if (config != null) {\n const mode = detectCliConfigMode(config)\n if (mode === 'comparisons') {\n throw new Error('vieval run requires project-mode config. Received comparison-mode config.')\n }\n }\n\n const projects = config?.workspaces == null\n ? ((config as CliProjectModeConfig | null | undefined)?.projects ?? [{ name: 'default' }])\n : config.workspaces.map(workspace => ({\n name: workspace.id,\n root: workspace.root,\n }))\n const inheritedConcurrency = toProjectConcurrencyDefaults(config?.concurrency)\n const inheritedModels = config?.models ?? []\n const inheritedReporterReferences = config?.reporters ?? []\n\n return Promise.all(projects.map(async (project) => {\n const normalizedProject = normalizeProjectConfig(\n project,\n cwd,\n inheritedConcurrency,\n inheritedModels,\n inheritedReporterReferences,\n )\n\n return applyProjectPlugins(\n config,\n project,\n normalizedProject,\n cwd,\n )\n }))\n}\n\nfunction normalizeReportingConfig(config: CliReportingConfig | undefined): CliReportingConfig | undefined {\n if (config == null) {\n return undefined\n }\n\n return {\n openTelemetry: config.openTelemetry == null\n ? undefined\n : {\n enabled: config.openTelemetry.enabled ?? false,\n onRunEnd: config.openTelemetry.onRunEnd,\n },\n }\n}\n\n/**\n * Detects which top-level config mode is active.\n *\n * Expects:\n * - exactly one of `projects`, `workspaces`, or `comparisons`\n *\n * Returns:\n * - active top-level mode key\n */\nexport function detectCliConfigMode(config: CliConfig): CliConfigMode {\n const declaredModes: CliConfigMode[] = []\n if (config.projects != null) {\n declaredModes.push('projects')\n }\n if (config.workspaces != null) {\n declaredModes.push('workspaces')\n }\n if (config.comparisons != null) {\n declaredModes.push('comparisons')\n }\n\n if (declaredModes.length > 1) {\n throw new Error(`Invalid vieval config: top-level keys are mutually exclusive. Found ${declaredModes.join(', ')}.`)\n }\n\n return declaredModes[0] ?? 'projects'\n}\n\n/**\n * Loads nearest `vieval.config.*` without project normalization.\n */\nexport async function loadRawVievalConfig(options: LoadVievalCliConfigOptions = {}): Promise<LoadedRawCliConfig> {\n const cwd = options.cwd ?? process.cwd()\n\n try {\n const loadedConfig = await resolveVievalConfig(cwd, options.configFilePath)\n if (loadedConfig.configFilePath == null || loadedConfig.config == null) {\n return {\n config: null,\n configFilePath: null,\n }\n }\n\n const config = await applyVievalPlugins(loadedConfig.config)\n detectCliConfigMode(config)\n\n return {\n config,\n configFilePath: loadedConfig.configFilePath,\n }\n }\n catch (error) {\n const errorMessage = errorMessageFrom(error) ?? 'Unknown config loading error.'\n const configFilePath = options.configFilePath == null\n ? 'vieval.config'\n : (isAbsolute(options.configFilePath) ? options.configFilePath : resolve(cwd, options.configFilePath))\n throw new Error(`Failed to load vieval config \"${configFilePath}\": ${errorMessage}`, { cause: error })\n }\n}\n\n/**\n * Loads nearest `vieval.config.*` and returns normalized project definitions.\n *\n * Call stack:\n *\n * {@link loadVievalCliConfig}\n * -> {@link resolveVievalConfig}\n * -> {@link normalizeConfig}\n * -> {@link NormalizedCliProjectConfig}[]\n *\n * Use when:\n * - CLI orchestration needs project includes/excludes similar to Vitest\n * - callers want config auto-discovery without manual imports in eval files\n */\nexport async function loadVievalCliConfig(options: LoadVievalCliConfigOptions = {}): Promise<LoadedCliConfig> {\n const cwd = options.cwd ?? process.cwd()\n try {\n const loadedConfig = await loadRawVievalConfig(options)\n if (loadedConfig.configFilePath == null || loadedConfig.config == null) {\n return {\n concurrency: undefined,\n configFilePath: null,\n env: {},\n projects: await normalizeConfig(null, cwd),\n reporting: undefined,\n }\n }\n\n const config = loadedConfig.config\n\n return {\n concurrency: config.concurrency,\n configFilePath: loadedConfig.configFilePath,\n env: config.env ?? {},\n projects: await normalizeConfig(config, dirname(loadedConfig.configFilePath)),\n reporting: normalizeReportingConfig(config.reporting),\n }\n }\n catch (error) {\n const errorMessage = errorMessageFrom(error) ?? 'Unknown config loading error.'\n const configFilePath = options.configFilePath == null\n ? 'vieval.config'\n : (isAbsolute(options.configFilePath) ? options.configFilePath : resolve(cwd, options.configFilePath))\n throw new Error(`Failed to load vieval config \"${configFilePath}\": ${errorMessage}`, { cause: error })\n }\n}\n","import type { TelemetryRuntime } from './types'\n\n/**\n * Creates the default no-op telemetry runtime.\n *\n * Use when:\n * - OpenTelemetry is not enabled by config\n * - tests need deterministic pass-through execution\n *\n * Expects:\n * - callers still wrap run/task/case boundaries with `withSpan`\n *\n * Returns:\n * - a runtime that never emits external telemetry and never changes control flow\n */\nexport function createNoopTelemetryRuntime(): TelemetryRuntime {\n return {\n async withSpan(_name, _attributes, callback) {\n return await callback()\n },\n addEvent() {},\n setAttributes() {},\n recordException() {},\n }\n}\n","import type { TelemetryAttributes, TelemetryRuntime } from './types'\n\nimport { errorMessageFrom } from '@moeru/std'\n\ntype OpenTelemetryAttributeScalar = boolean | number | string\ntype OpenTelemetryAttributeValue = OpenTelemetryAttributeScalar | readonly boolean[] | readonly number[] | readonly string[]\ntype OpenTelemetryAttributes = Record<string, OpenTelemetryAttributeValue>\n\ninterface OpenTelemetrySpan {\n addEvent: (name: string, attributes?: OpenTelemetryAttributes) => void\n end: () => void\n recordException: (error: unknown) => void\n setAttributes: (attributes: OpenTelemetryAttributes) => void\n setStatus: (status: { code: number, message?: string }) => void\n}\n\ninterface OpenTelemetryTracer {\n startActiveSpan: <T>(\n name: string,\n options: { attributes: OpenTelemetryAttributes },\n callback: (span: OpenTelemetrySpan) => Promise<T>,\n ) => Promise<T>\n}\n\ninterface OpenTelemetryApiModule {\n SpanStatusCode: { ERROR: number }\n trace: {\n getActiveSpan: () => OpenTelemetrySpan | undefined\n getTracer: (name: string) => OpenTelemetryTracer\n }\n}\n\n/**\n * Options used to construct the OpenTelemetry-backed telemetry runtime.\n */\nexport interface CreateOpenTelemetryRuntimeOptions {\n /**\n * Optional import adapter used by tests to avoid requiring a real OpenTelemetry SDK.\n *\n * @default dynamic import of `@opentelemetry/api`\n */\n importApi?: () => Promise<OpenTelemetryApiModule>\n}\n\nasync function importOpenTelemetryApi(): Promise<OpenTelemetryApiModule> {\n const moduleName = '@opentelemetry/api'\n return await import(moduleName) as unknown as OpenTelemetryApiModule\n}\n\nfunction isOpenTelemetryAttributeScalar(value: unknown): value is OpenTelemetryAttributeScalar {\n return typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string'\n}\n\nfunction isHomogeneousOpenTelemetryAttributeArray(value: readonly unknown[]): value is readonly boolean[] | readonly number[] | readonly string[] {\n if (value.length === 0) {\n return true\n }\n\n const firstType = typeof value[0]\n if (firstType !== 'boolean' && firstType !== 'number' && firstType !== 'string') {\n return false\n }\n\n return value.every(item => typeof item === firstType)\n}\n\nfunction stringifyAttributeValue(value: unknown): string | undefined {\n try {\n return JSON.stringify(value)\n }\n catch {\n return String(value)\n }\n}\n\n/**\n * Normalizes JSON-compatible telemetry attributes into OpenTelemetry-safe attributes.\n *\n * Before:\n * - `{ nil: null, nested: ['a', [1, null]], scalarArray: ['a', 1, true] }`\n *\n * After:\n * - `{ nested: '[\"a\",[1,null]]', scalarArray: ['a', 1, true] }`\n */\nfunction normalizeOpenTelemetryAttributes(attributes: TelemetryAttributes | undefined): OpenTelemetryAttributes | undefined {\n if (attributes == null) {\n return undefined\n }\n\n const normalized: OpenTelemetryAttributes = {}\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value == null) {\n continue\n }\n\n if (isOpenTelemetryAttributeScalar(value)) {\n normalized[key] = value\n continue\n }\n\n if (Array.isArray(value)) {\n normalized[key] = isHomogeneousOpenTelemetryAttributeArray(value)\n ? value\n : stringifyAttributeValue(value) ?? ''\n continue\n }\n\n const stringified = stringifyAttributeValue(value)\n\n if (stringified != null) {\n normalized[key] = stringified\n }\n }\n\n return normalized\n}\n\n/**\n * Creates an OpenTelemetry-backed runtime using active spans.\n *\n * Use when:\n * - `reporting.openTelemetry.enabled` is true\n * - the user's config has initialized an OpenTelemetry SDK or intentionally relies on the API no-op provider\n *\n * Expects:\n * - `@opentelemetry/api` is resolvable when enabled\n * - SDK lifecycle is managed by user config and `reporting.openTelemetry.onRunEnd`\n *\n * Returns:\n * - a runtime that starts active spans and forwards events to the current active span\n */\nexport function createOpenTelemetryRuntime(options: CreateOpenTelemetryRuntimeOptions = {}): TelemetryRuntime {\n const importApi = options.importApi ?? importOpenTelemetryApi\n let apiPromise: Promise<OpenTelemetryApiModule> | undefined\n let loadedApi: OpenTelemetryApiModule | undefined\n\n async function getApi(): Promise<OpenTelemetryApiModule> {\n apiPromise ??= importApi().then((api) => {\n loadedApi = api\n return api\n })\n return await apiPromise\n }\n\n return {\n async withSpan(name, attributes, callback) {\n const api = await getApi()\n const tracer = api.trace.getTracer('vieval')\n\n return await tracer.startActiveSpan(name, { attributes: normalizeOpenTelemetryAttributes(attributes) ?? {} }, async (span) => {\n try {\n return await callback()\n }\n catch (error) {\n span.recordException(error)\n span.setStatus({ code: api.SpanStatusCode.ERROR, message: errorMessageFrom(error) ?? 'Unknown error' })\n throw error\n }\n finally {\n span.end()\n }\n })\n },\n addEvent(name, attributes) {\n loadedApi?.trace.getActiveSpan()?.addEvent(name, normalizeOpenTelemetryAttributes(attributes))\n },\n setAttributes(attributes) {\n loadedApi?.trace.getActiveSpan()?.setAttributes(normalizeOpenTelemetryAttributes(attributes) ?? {})\n },\n recordException(error) {\n loadedApi?.trace.getActiveSpan()?.recordException(error)\n },\n }\n}\n","import type { EvalDefinition } from '../config'\n\nimport process from 'node:process'\n\ninterface EvalDefinitionRegistryStore {\n activeModuleHref: string | null\n registeredDefinitionsByModule: Map<string, EvalDefinition[]>\n}\n\nconst registryStoreSymbol = Symbol.for('vieval.dsl.registry.store')\n\nfunction getRegistryStore(): EvalDefinitionRegistryStore {\n const processWithStore = process as NodeJS.Process & {\n [registryStoreSymbol]?: EvalDefinitionRegistryStore\n }\n\n processWithStore[registryStoreSymbol] ??= {\n activeModuleHref: null,\n registeredDefinitionsByModule: new Map<string, EvalDefinition[]>(),\n }\n\n return processWithStore[registryStoreSymbol]\n}\n\n/**\n * Starts module-scoped eval registration collection.\n */\nexport function beginModuleRegistration(moduleHref: string): void {\n const store = getRegistryStore()\n store.activeModuleHref = moduleHref\n}\n\n/**\n * Ends module-scoped eval registration collection.\n */\nexport function endModuleRegistration(): void {\n const store = getRegistryStore()\n store.activeModuleHref = null\n}\n\n/**\n * Registers one eval definition against the currently active module.\n */\nexport function registerEvalDefinition(definition: EvalDefinition): void {\n const store = getRegistryStore()\n\n if (store.activeModuleHref == null) {\n return\n }\n\n const existing = store.registeredDefinitionsByModule.get(store.activeModuleHref) ?? []\n existing.push(definition)\n store.registeredDefinitionsByModule.set(store.activeModuleHref, existing)\n}\n\n/**\n * Consumes registered definitions for one module and clears stored state.\n */\nexport function consumeModuleRegistrations(moduleHref: string): EvalDefinition[] {\n const store = getRegistryStore()\n const definitions = store.registeredDefinition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