@arizeai/phoenix-client 6.10.1 → 6.11.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.
Files changed (214) hide show
  1. package/README.md +62 -0
  2. package/dist/esm/__generated__/api/v1.d.ts +254 -2
  3. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  4. package/dist/esm/jest/index.d.ts +5 -0
  5. package/dist/esm/jest/index.d.ts.map +1 -0
  6. package/dist/esm/jest/index.js +49 -0
  7. package/dist/esm/jest/index.js.map +1 -0
  8. package/dist/esm/jest/reporter.d.ts +13 -0
  9. package/dist/esm/jest/reporter.d.ts.map +1 -0
  10. package/dist/esm/jest/reporter.js +19 -0
  11. package/dist/esm/jest/reporter.js.map +1 -0
  12. package/dist/esm/prompts/sdks/toAI.d.ts +2 -2
  13. package/dist/esm/prompts/sdks/toAI.d.ts.map +1 -1
  14. package/dist/esm/prompts/sdks/toAI.js.map +1 -1
  15. package/dist/esm/prompts/sdks/toAnthropic.d.ts +2 -2
  16. package/dist/esm/prompts/sdks/toAnthropic.d.ts.map +1 -1
  17. package/dist/esm/prompts/sdks/toAnthropic.js.map +1 -1
  18. package/dist/esm/prompts/sdks/toOpenAI.d.ts +2 -2
  19. package/dist/esm/prompts/sdks/toOpenAI.d.ts.map +1 -1
  20. package/dist/esm/prompts/sdks/toOpenAI.js.map +1 -1
  21. package/dist/esm/prompts/sdks/toSDK.d.ts +8 -8
  22. package/dist/esm/prompts/sdks/toSDK.d.ts.map +1 -1
  23. package/dist/esm/prompts/sdks/toSDK.js.map +1 -1
  24. package/dist/esm/prompts/sdks/types.d.ts +2 -2
  25. package/dist/esm/prompts/sdks/types.d.ts.map +1 -1
  26. package/dist/esm/schemas/llm/anthropic/converters.d.ts +8 -8
  27. package/dist/esm/schemas/llm/anthropic/messagePartSchemas.d.ts +4 -4
  28. package/dist/esm/schemas/llm/anthropic/messageSchemas.d.ts +6 -6
  29. package/dist/esm/schemas/llm/constants.d.ts +3 -3
  30. package/dist/esm/schemas/llm/converters.d.ts +12 -12
  31. package/dist/esm/schemas/llm/openai/converters.d.ts +3 -3
  32. package/dist/esm/schemas/llm/schemas.d.ts +2 -2
  33. package/dist/esm/testing/acceptance.d.ts +20 -0
  34. package/dist/esm/testing/acceptance.d.ts.map +1 -0
  35. package/dist/esm/testing/acceptance.js +129 -0
  36. package/dist/esm/testing/acceptance.js.map +1 -0
  37. package/dist/esm/testing/define-api.d.ts +157 -0
  38. package/dist/esm/testing/define-api.d.ts.map +1 -0
  39. package/dist/esm/testing/define-api.js +78 -0
  40. package/dist/esm/testing/define-api.js.map +1 -0
  41. package/dist/esm/testing/helpers.d.ts +55 -0
  42. package/dist/esm/testing/helpers.d.ts.map +1 -0
  43. package/dist/esm/testing/helpers.js +179 -0
  44. package/dist/esm/testing/helpers.js.map +1 -0
  45. package/dist/esm/testing/phoenix-test-tracking.d.ts +68 -0
  46. package/dist/esm/testing/phoenix-test-tracking.d.ts.map +1 -0
  47. package/dist/esm/testing/phoenix-test-tracking.js +521 -0
  48. package/dist/esm/testing/phoenix-test-tracking.js.map +1 -0
  49. package/dist/esm/testing/report-artifacts.d.ts +45 -0
  50. package/dist/esm/testing/report-artifacts.d.ts.map +1 -0
  51. package/dist/esm/testing/report-artifacts.js +218 -0
  52. package/dist/esm/testing/report-artifacts.js.map +1 -0
  53. package/dist/esm/testing/report-run.d.ts +22 -0
  54. package/dist/esm/testing/report-run.d.ts.map +1 -0
  55. package/dist/esm/testing/report-run.js +41 -0
  56. package/dist/esm/testing/report-run.js.map +1 -0
  57. package/dist/esm/testing/reporter-format.d.ts +83 -0
  58. package/dist/esm/testing/reporter-format.d.ts.map +1 -0
  59. package/dist/esm/testing/reporter-format.js +852 -0
  60. package/dist/esm/testing/reporter-format.js.map +1 -0
  61. package/dist/esm/testing/runner.d.ts +31 -0
  62. package/dist/esm/testing/runner.d.ts.map +1 -0
  63. package/dist/esm/testing/runner.js +238 -0
  64. package/dist/esm/testing/runner.js.map +1 -0
  65. package/dist/esm/testing/state.d.ts +138 -0
  66. package/dist/esm/testing/state.d.ts.map +1 -0
  67. package/dist/esm/testing/state.js +31 -0
  68. package/dist/esm/testing/state.js.map +1 -0
  69. package/dist/esm/testing/types.d.ts +319 -0
  70. package/dist/esm/testing/types.d.ts.map +1 -0
  71. package/dist/esm/testing/types.js +9 -0
  72. package/dist/esm/testing/types.js.map +1 -0
  73. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  74. package/dist/esm/utils/channel.d.ts +7 -7
  75. package/dist/esm/utils/channel.d.ts.map +1 -1
  76. package/dist/esm/utils/channel.js +1 -1
  77. package/dist/esm/utils/channel.js.map +1 -1
  78. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  79. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  80. package/dist/esm/utils/promisifyResult.d.ts +1 -1
  81. package/dist/esm/utils/promisifyResult.d.ts.map +1 -1
  82. package/dist/esm/utils/promisifyResult.js.map +1 -1
  83. package/dist/esm/utils/schemaMatches.d.ts +5 -5
  84. package/dist/esm/utils/schemaMatches.d.ts.map +1 -1
  85. package/dist/esm/utils/schemaMatches.js.map +1 -1
  86. package/dist/esm/vitest/index.d.ts +5 -0
  87. package/dist/esm/vitest/index.d.ts.map +1 -0
  88. package/dist/esm/vitest/index.js +15 -0
  89. package/dist/esm/vitest/index.js.map +1 -0
  90. package/dist/esm/vitest/reporter.d.ts +19 -0
  91. package/dist/esm/vitest/reporter.d.ts.map +1 -0
  92. package/dist/esm/vitest/reporter.js +27 -0
  93. package/dist/esm/vitest/reporter.js.map +1 -0
  94. package/dist/src/__generated__/api/v1.d.ts +254 -2
  95. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  96. package/dist/src/jest/index.d.ts +5 -0
  97. package/dist/src/jest/index.d.ts.map +1 -0
  98. package/dist/src/jest/index.js +58 -0
  99. package/dist/src/jest/index.js.map +1 -0
  100. package/dist/src/jest/reporter.d.ts +13 -0
  101. package/dist/src/jest/reporter.d.ts.map +1 -0
  102. package/dist/src/jest/reporter.js +23 -0
  103. package/dist/src/jest/reporter.js.map +1 -0
  104. package/dist/src/prompts/sdks/toAI.d.ts +2 -2
  105. package/dist/src/prompts/sdks/toAI.d.ts.map +1 -1
  106. package/dist/src/prompts/sdks/toAI.js.map +1 -1
  107. package/dist/src/prompts/sdks/toAnthropic.d.ts +2 -2
  108. package/dist/src/prompts/sdks/toAnthropic.d.ts.map +1 -1
  109. package/dist/src/prompts/sdks/toAnthropic.js.map +1 -1
  110. package/dist/src/prompts/sdks/toOpenAI.d.ts +2 -2
  111. package/dist/src/prompts/sdks/toOpenAI.d.ts.map +1 -1
  112. package/dist/src/prompts/sdks/toOpenAI.js.map +1 -1
  113. package/dist/src/prompts/sdks/toSDK.d.ts +8 -8
  114. package/dist/src/prompts/sdks/toSDK.d.ts.map +1 -1
  115. package/dist/src/prompts/sdks/toSDK.js.map +1 -1
  116. package/dist/src/prompts/sdks/types.d.ts +2 -2
  117. package/dist/src/prompts/sdks/types.d.ts.map +1 -1
  118. package/dist/src/schemas/llm/anthropic/converters.d.ts +8 -8
  119. package/dist/src/schemas/llm/anthropic/messagePartSchemas.d.ts +4 -4
  120. package/dist/src/schemas/llm/anthropic/messageSchemas.d.ts +6 -6
  121. package/dist/src/schemas/llm/constants.d.ts +3 -3
  122. package/dist/src/schemas/llm/converters.d.ts +12 -12
  123. package/dist/src/schemas/llm/openai/converters.d.ts +3 -3
  124. package/dist/src/schemas/llm/schemas.d.ts +2 -2
  125. package/dist/src/testing/acceptance.d.ts +20 -0
  126. package/dist/src/testing/acceptance.d.ts.map +1 -0
  127. package/dist/src/testing/acceptance.js +114 -0
  128. package/dist/src/testing/acceptance.js.map +1 -0
  129. package/dist/src/testing/define-api.d.ts +157 -0
  130. package/dist/src/testing/define-api.d.ts.map +1 -0
  131. package/dist/src/testing/define-api.js +81 -0
  132. package/dist/src/testing/define-api.js.map +1 -0
  133. package/dist/src/testing/helpers.d.ts +55 -0
  134. package/dist/src/testing/helpers.d.ts.map +1 -0
  135. package/dist/src/testing/helpers.js +182 -0
  136. package/dist/src/testing/helpers.js.map +1 -0
  137. package/dist/src/testing/phoenix-test-tracking.d.ts +68 -0
  138. package/dist/src/testing/phoenix-test-tracking.d.ts.map +1 -0
  139. package/dist/src/testing/phoenix-test-tracking.js +530 -0
  140. package/dist/src/testing/phoenix-test-tracking.js.map +1 -0
  141. package/dist/src/testing/report-artifacts.d.ts +45 -0
  142. package/dist/src/testing/report-artifacts.d.ts.map +1 -0
  143. package/dist/src/testing/report-artifacts.js +225 -0
  144. package/dist/src/testing/report-artifacts.js.map +1 -0
  145. package/dist/src/testing/report-run.d.ts +22 -0
  146. package/dist/src/testing/report-run.d.ts.map +1 -0
  147. package/dist/src/testing/report-run.js +47 -0
  148. package/dist/src/testing/report-run.js.map +1 -0
  149. package/dist/src/testing/reporter-format.d.ts +83 -0
  150. package/dist/src/testing/reporter-format.d.ts.map +1 -0
  151. package/dist/src/testing/reporter-format.js +870 -0
  152. package/dist/src/testing/reporter-format.js.map +1 -0
  153. package/dist/src/testing/runner.d.ts +31 -0
  154. package/dist/src/testing/runner.d.ts.map +1 -0
  155. package/dist/src/testing/runner.js +258 -0
  156. package/dist/src/testing/runner.js.map +1 -0
  157. package/dist/src/testing/state.d.ts +138 -0
  158. package/dist/src/testing/state.d.ts.map +1 -0
  159. package/dist/src/testing/state.js +38 -0
  160. package/dist/src/testing/state.js.map +1 -0
  161. package/dist/src/testing/types.d.ts +319 -0
  162. package/dist/src/testing/types.d.ts.map +1 -0
  163. package/dist/src/testing/types.js +13 -0
  164. package/dist/src/testing/types.js.map +1 -0
  165. package/dist/src/utils/channel.d.ts +7 -7
  166. package/dist/src/utils/channel.d.ts.map +1 -1
  167. package/dist/src/utils/channel.js +1 -1
  168. package/dist/src/utils/channel.js.map +1 -1
  169. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  170. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  171. package/dist/src/utils/promisifyResult.d.ts +1 -1
  172. package/dist/src/utils/promisifyResult.d.ts.map +1 -1
  173. package/dist/src/utils/promisifyResult.js.map +1 -1
  174. package/dist/src/utils/schemaMatches.d.ts +5 -5
  175. package/dist/src/utils/schemaMatches.d.ts.map +1 -1
  176. package/dist/src/utils/schemaMatches.js.map +1 -1
  177. package/dist/src/vitest/index.d.ts +5 -0
  178. package/dist/src/vitest/index.d.ts.map +1 -0
  179. package/dist/src/vitest/index.js +23 -0
  180. package/dist/src/vitest/index.js.map +1 -0
  181. package/dist/src/vitest/reporter.d.ts +19 -0
  182. package/dist/src/vitest/reporter.d.ts.map +1 -0
  183. package/dist/src/vitest/reporter.js +34 -0
  184. package/dist/src/vitest/reporter.js.map +1 -0
  185. package/dist/tsconfig.tsbuildinfo +1 -1
  186. package/docs/ci-evals-annotations.mdx +190 -0
  187. package/docs/ci-evals-jest.mdx +78 -0
  188. package/docs/ci-evals-vitest.mdx +240 -0
  189. package/docs/ci-evals.mdx +263 -0
  190. package/docs/overview.mdx +9 -1
  191. package/package.json +49 -17
  192. package/src/__generated__/api/v1.ts +254 -2
  193. package/src/jest/index.ts +124 -0
  194. package/src/jest/reporter.ts +22 -0
  195. package/src/prompts/sdks/toAI.ts +4 -3
  196. package/src/prompts/sdks/toAnthropic.ts +4 -3
  197. package/src/prompts/sdks/toOpenAI.ts +4 -3
  198. package/src/prompts/sdks/toSDK.ts +16 -11
  199. package/src/prompts/sdks/types.ts +2 -2
  200. package/src/testing/acceptance.ts +190 -0
  201. package/src/testing/define-api.ts +279 -0
  202. package/src/testing/helpers.ts +251 -0
  203. package/src/testing/phoenix-test-tracking.ts +637 -0
  204. package/src/testing/report-artifacts.ts +272 -0
  205. package/src/testing/report-run.ts +44 -0
  206. package/src/testing/reporter-format.ts +1072 -0
  207. package/src/testing/runner.ts +350 -0
  208. package/src/testing/state.ts +165 -0
  209. package/src/testing/types.ts +366 -0
  210. package/src/utils/channel.ts +17 -15
  211. package/src/utils/promisifyResult.ts +6 -4
  212. package/src/utils/schemaMatches.ts +12 -10
  213. package/src/vitest/index.ts +57 -0
  214. package/src/vitest/reporter.ts +32 -0
@@ -0,0 +1,319 @@
1
+ import type { PhoenixClient } from "../index";
2
+ import type { AnnotatorKind } from "../types/annotations";
3
+ import type { EvaluatorParams, EvaluationResult as ExperimentEvaluationResult } from "../types/experiments";
4
+ /**
5
+ * Phoenix annotator kind, re-exported from the shared client types so the
6
+ * testing module and the rest of the client agree on a single definition.
7
+ */
8
+ export type { AnnotatorKind };
9
+ /** A JSON-serializable map. */
10
+ export type KVMap = Record<string, unknown>;
11
+ /**
12
+ * Domain language
13
+ * ---------------
14
+ * The unit these tests evaluate over is an **Example**: a single AI example —
15
+ * an `input`, its `expected` output, and optional `metadata` / `splits` — over
16
+ * which the task under test is run and then scored. This is the same notion as
17
+ * the dataset `Example` (`../types/datasets`): each test case _is_ one example.
18
+ * When tracked, a case is recorded to Phoenix as a dataset example and
19
+ * evaluated as one experiment run.
20
+ *
21
+ * These field names form the shared vocabulary across this module:
22
+ * - `input` — the example's input, passed to the task under evaluation.
23
+ * - `expected` — the example's expected (reference / ground-truth) output.
24
+ * - `metadata` — extra fields carried on the example.
25
+ * - `splits` — slice labels for the example.
26
+ * - `id` — stable example id, used to upsert the example across runs.
27
+ */
28
+ /**
29
+ * The expected output of an `Example`, accepted under any one of three
30
+ * interchangeable keys. All three normalize to the same slot: when recorded to
31
+ * Phoenix the value becomes the dataset example's `output`, and it is exposed
32
+ * to evaluators as `expected` on `EvaluatorParams`. At most one key may be set.
33
+ *
34
+ * - `expected` — the canonical name (the ground-truth / reference output).
35
+ * - `reference` — alias preferred by frameworks that name the slot "reference".
36
+ * - `output` — alias for callers who think in terms of the example's `output`.
37
+ *
38
+ * Modeled as a union so supplying more than one key at a time is a type error.
39
+ */
40
+ export type ReferenceOutput<Expected extends KVMap = KVMap> = {
41
+ expected?: Expected;
42
+ reference?: never;
43
+ output?: never;
44
+ } | {
45
+ reference?: Expected;
46
+ expected?: never;
47
+ output?: never;
48
+ } | {
49
+ output?: Expected;
50
+ expected?: never;
51
+ reference?: never;
52
+ };
53
+ /**
54
+ * The `Example` fields that define a single test case, excluding its
55
+ * expected output (which is supplied separately via {@link ReferenceOutput}).
56
+ *
57
+ * `input` is the example's input — the value fed to the task under evaluation.
58
+ * When the case is tracked, this becomes the dataset example's `input`.
59
+ */
60
+ export interface TestParamsBase<Input extends KVMap = KVMap> {
61
+ /** Optional stable example id; used to upsert the example between runs. */
62
+ id?: string;
63
+ /** The example's input — fed to the task under evaluation. Required. */
64
+ input: Input;
65
+ /** Additional metadata stored on the example and its run. */
66
+ metadata?: KVMap;
67
+ /**
68
+ * Split assignment(s) for the example, used to slice the dataset and
69
+ * experiment in the Phoenix UI (e.g. `["factual_accuracy", "correct"]`).
70
+ */
71
+ splits?: string[];
72
+ /** Per-test config (tags + metadata recorded on the run). */
73
+ config?: TestConfig;
74
+ /**
75
+ * Number of times to run this test case. Each repetition becomes a
76
+ * separate experiment run against the same dataset example (carrying a
77
+ * distinct `repetition_number`). Overrides the suite-level `repetitions`.
78
+ * Defaults to the suite value, then `PHOENIX_TEST_REPETITIONS`, then `1`.
79
+ */
80
+ repetitions?: number;
81
+ /**
82
+ * When `true`, this test runs as an ordinary local test only — no dataset
83
+ * example is created and no experiment run or annotations are uploaded to
84
+ * Phoenix. Useful for scaffolding a case before it's ready to track.
85
+ */
86
+ dryRun?: boolean;
87
+ }
88
+ /**
89
+ * The full inline definition of a single `Example` under test.
90
+ *
91
+ * Combines {@link TestParamsBase} with a {@link ReferenceOutput}, so the
92
+ * example's expected output may be given under `expected`, `reference`, or
93
+ * `output` (at most one). All three resolve to the same canonical `expected`
94
+ * slot.
95
+ */
96
+ export type TestParams<Input extends KVMap = KVMap, Expected extends KVMap = KVMap> = TestParamsBase<Input> & ReferenceOutput<Expected>;
97
+ /**
98
+ * Resolve an `Example`'s expected output from a value that may carry it
99
+ * under any of the `expected` / `reference` / `output` aliases (see
100
+ * {@link ReferenceOutput}). Returns the first one set, or `undefined` if none.
101
+ */
102
+ export declare function resolveReference<Expected extends KVMap = KVMap>(params: ReferenceOutput<Expected>): Expected | undefined;
103
+ /** Per-test runtime configuration. */
104
+ export interface TestConfig {
105
+ /** Tags recorded on the experiment run for filtering in the Phoenix UI. */
106
+ tags?: string[];
107
+ /** Extra metadata recorded on the experiment run. */
108
+ metadata?: KVMap;
109
+ }
110
+ /**
111
+ * How a criterion aggregates an annotation's scores to gate the suite:
112
+ *
113
+ * - `"average"` — gate on overall quality: the **mean** score across all runs
114
+ * must clear the criterion's `threshold`. A few weak runs are tolerated as
115
+ * long as the mean holds.
116
+ * - `"passRate"` — gate on consistency: each run **passes** when the
117
+ * criterion's `passFn` predicate returns `true` for its annotation, and the
118
+ * suite passes when the **fraction** of runs that pass is at least
119
+ * `minPassRate` (e.g. `minPassRate: 0.9` ⇒ 90% must pass; `1` ⇒ all).
120
+ */
121
+ export type AcceptanceMetric = "average" | "passRate";
122
+ /**
123
+ * Optimization direction for a criterion's scores: `"maximize"` (higher is
124
+ * better, the default) or `"minimize"` (lower is better). Controls every
125
+ * score comparison the criterion makes.
126
+ */
127
+ export type OptimizationDirection = "maximize" | "minimize";
128
+ /** Fields shared by every {@link AcceptanceCriterion} variant. */
129
+ export interface AcceptanceCriterionBase {
130
+ /** Annotation name to aggregate across completed test runs. */
131
+ annotationName: string;
132
+ }
133
+ /**
134
+ * Gate the suite on the **mean** score: the average across all runs must clear
135
+ * `threshold` (compared in `direction`).
136
+ */
137
+ export interface AverageAcceptanceCriterion extends AcceptanceCriterionBase {
138
+ metric: "average";
139
+ /**
140
+ * The bar the mean score must clear, compared in `direction`. Boolean scores
141
+ * average as `1` (`true`) / `0` (`false`).
142
+ */
143
+ threshold: number;
144
+ /**
145
+ * Optimization direction; defaults to `"maximize"`. `"maximize"` treats a
146
+ * higher mean as better (clears when `>= threshold`); `"minimize"` treats a
147
+ * lower mean as better (clears when `<= threshold`) — use it for cost,
148
+ * latency, or error-rate annotations.
149
+ */
150
+ direction?: OptimizationDirection;
151
+ }
152
+ /**
153
+ * Gate the suite on the **pass rate**: each run passes when `passFn` returns
154
+ * `true` for its annotation, and the suite passes when at least `minPassRate`
155
+ * of runs do. `passFn` decides what "passing" means, so any logic works — a
156
+ * score bar, a score range, a label match, a metadata check, etc.
157
+ */
158
+ export interface PassRateAcceptanceCriterion extends AcceptanceCriterionBase {
159
+ metric: "passRate";
160
+ /**
161
+ * Predicate deciding whether a single run passes, given the run's last
162
+ * {@link Annotation} for `annotationName` (its `score`, `label`,
163
+ * `explanation`, `metadata`, …). Runs whose predicate returns `true` count
164
+ * toward the pass rate.
165
+ */
166
+ passFn: (annotation: Annotation) => boolean;
167
+ /**
168
+ * Minimum fraction of runs (`0`–`1`) that must pass for the suite to pass —
169
+ * e.g. `0.9` requires 90% of runs to satisfy `passFn`, `1` requires all of
170
+ * them. The suite passes when `passRate >= minPassRate`.
171
+ */
172
+ minPassRate: number;
173
+ }
174
+ /**
175
+ * One aggregate acceptance rule, evaluated once after every test in the suite
176
+ * has run. Each criterion aggregates a single annotation's scores with one
177
+ * {@link AcceptanceMetric} and fails the suite when the result misses its bar.
178
+ *
179
+ * Scoring notes shared by every metric:
180
+ * - Boolean scores count as `1` (`true`) / `0` (`false`).
181
+ * - If a run logs the same annotation more than once, the last one counts.
182
+ * - Skipped tests are excluded; dry-run tests are included (they still run).
183
+ * - A criterion whose annotation was never logged on any run fails (rather
184
+ * than passing vacuously) — see {@link AcceptanceResultFields.failureReason}.
185
+ */
186
+ export type AcceptanceCriterion = AverageAcceptanceCriterion | PassRateAcceptanceCriterion;
187
+ /** The computed fields added to an {@link AcceptanceCriterion} once evaluated. */
188
+ export interface AcceptanceResultFields {
189
+ /**
190
+ * The aggregate the criterion gated on, or `null` when there were no runs to
191
+ * aggregate. For `"average"` this is the mean score; for `"passRate"` it is
192
+ * the fraction of runs that passed (so a fully-passing `"passRate"` criterion
193
+ * reports `1`).
194
+ */
195
+ value: number | null;
196
+ /** Number of runs included in the aggregate. */
197
+ sampleCount: number;
198
+ /** Whether the aggregate cleared the criterion. */
199
+ passed: boolean;
200
+ /** Human-readable failure reason for invalid or empty aggregates. */
201
+ failureReason?: string;
202
+ }
203
+ /** Computed result for one aggregate acceptance rule. */
204
+ export type AcceptanceResult = AcceptanceCriterion & AcceptanceResultFields;
205
+ /** Suite-level configuration accepted by `describe()`. */
206
+ export interface SuiteConfig {
207
+ /** Override the dataset / experiment name used for the suite. */
208
+ datasetName?: string;
209
+ /** Description for the dataset and experiment. */
210
+ description?: string;
211
+ /** Suite-level metadata applied to every run in this experiment. */
212
+ metadata?: KVMap;
213
+ /** Override the Phoenix client used for syncing this suite. */
214
+ client?: PhoenixClient;
215
+ /**
216
+ * Number of times to run each test case in this suite. Individual tests
217
+ * may override this via `TestParams.repetitions`. Defaults to the
218
+ * `PHOENIX_TEST_REPETITIONS` env var, then `1`.
219
+ */
220
+ repetitions?: number;
221
+ /**
222
+ * When `true`, the whole suite runs as ordinary local tests — no dataset
223
+ * is uploaded and no experiment, runs, or annotations are created in
224
+ * Phoenix. Equivalent to `PHOENIX_TEST_TRACKING=false` scoped to this
225
+ * suite. The reporter still prints a local summary.
226
+ */
227
+ dryRun?: boolean;
228
+ /**
229
+ * Aggregate annotation criteria that gate the suite after all tests run.
230
+ * Each criterion fails the suite when its scores miss the configured bar
231
+ * (see {@link AcceptanceCriterion}).
232
+ */
233
+ acceptanceCriteria?: AcceptanceCriterion[];
234
+ }
235
+ /**
236
+ * Arguments passed to a `test()` body: the `Example` under test, exposed
237
+ * as its `input`, `expected` output, and `metadata`. Read straight from the
238
+ * test's {@link TestParams} — the runner does not transform them.
239
+ */
240
+ export interface TestArgs<Input extends KVMap = KVMap, Expected extends KVMap = KVMap> {
241
+ /** The example's input under test. */
242
+ input: Input;
243
+ /** The example's expected (reference) output, when one was supplied. */
244
+ expected?: Expected;
245
+ /** Any metadata attached to the example. */
246
+ metadata?: KVMap;
247
+ }
248
+ /**
249
+ * Object form of an evaluator result. Reuses the shared experiment
250
+ * {@link ExperimentEvaluationResult} shape (label / explanation / metadata)
251
+ * but widens `score` to also accept booleans, which the testing API stores as
252
+ * `1` / `0`.
253
+ */
254
+ export interface EvaluationResultObject extends Omit<ExperimentEvaluationResult, "score"> {
255
+ /** Numeric or boolean score; booleans are stored as `1` / `0`. */
256
+ score?: number | boolean | null;
257
+ }
258
+ /**
259
+ * One annotation recorded against a run. Extends the evaluator
260
+ * {@link EvaluationResultObject} with the `name` and `annotatorKind` carried
261
+ * on the evaluation body, plus an optional originating trace id.
262
+ */
263
+ export interface Annotation extends EvaluationResultObject {
264
+ /** Phoenix evaluation name. Required, and unique per run (last write wins). */
265
+ name: string;
266
+ /** Who or what produced the annotation. Defaults to `"CODE"`. */
267
+ annotatorKind?: AnnotatorKind;
268
+ /** Trace id for this evaluation, when the annotation was produced by a traced evaluator. */
269
+ traceId?: string | null;
270
+ }
271
+ /** Result returned by `traceEvaluator` for any evaluator-shaped value. */
272
+ export type EvaluatorResult = Annotation | (KVMap & {
273
+ name: string;
274
+ });
275
+ /** Result shape produced by evaluator objects used in eval tests. */
276
+ export type EvaluationResult = number | boolean | string | null | EvaluationResultObject;
277
+ /**
278
+ * Parameters passed to an evaluator when it runs inside a test. A relaxation of
279
+ * the shared {@link EvaluatorParams}: `input` is always present, while `output`
280
+ * (an evaluator may run before `logOutput()`) and the remaining fields are
281
+ * optional. Deriving from `EvaluatorParams` keeps this aligned with the
282
+ * experiment evaluator contract as that shape evolves.
283
+ */
284
+ export type EvaluationParams = Partial<EvaluatorParams> & {
285
+ /** The example's input under test. */
286
+ input: KVMap;
287
+ };
288
+ /** Structural evaluator interface accepted by `evaluate()`. */
289
+ export interface Evaluator<Params extends KVMap = EvaluationParams & KVMap, Result = EvaluationResult> {
290
+ /** Annotation/evaluation name. */
291
+ name: string;
292
+ /** Who or what produced the result. Defaults to `"CODE"`. */
293
+ kind?: AnnotatorKind;
294
+ /** Compute the evaluation result. */
295
+ evaluate: (params: Params) => Result | Promise<Result>;
296
+ }
297
+ /** Test handler signature. */
298
+ export type TestFn<Input extends KVMap = KVMap, Expected extends KVMap = KVMap> = (args: TestArgs<Input, Expected>) => unknown | Promise<unknown>;
299
+ /**
300
+ * Each-row shape accepted by `test.each(table)(name, fn)`; each row defines one
301
+ * `Example`.
302
+ *
303
+ * Like {@link TestParams}, the example's expected output is supplied via
304
+ * {@link ReferenceOutput} (`expected` / `reference` / `output`, at most one).
305
+ * The trailing index signature still permits arbitrary extra columns on a row
306
+ * (e.g. for `%j` name interpolation) without weakening that constraint.
307
+ */
308
+ export type TestEachRow<Input extends KVMap = KVMap, Expected extends KVMap = KVMap> = {
309
+ id?: string;
310
+ input: Input;
311
+ metadata?: KVMap;
312
+ /** Per-row split assignment(s); see `TestParams.splits`. */
313
+ splits?: string[];
314
+ /** Per-row repetition count; see `TestParams.repetitions`. */
315
+ repetitions?: number;
316
+ /** Per-row dry-run flag; see `TestParams.dryRun`. */
317
+ dryRun?: boolean;
318
+ } & ReferenceOutput<Expected> & Record<string, unknown>;
319
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/testing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,IAAI,0BAA0B,EAC/C,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,+BAA+B;AAC/B,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,KAAK,GAAG,KAAK,IAC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olve an `Example`'s expected output from a value that may carry it
6
+ * under any of the `expected` / `reference` / `output` aliases (see
7
+ * {@link ReferenceOutput}). Returns the first one set, or `undefined` if none.
8
+ */
9
+ function resolveReference(params) {
10
+ var _a, _b;
11
+ return (_b = (_a = params.expected) !== null && _a !== void 0 ? _a : params.reference) !== null && _b !== void 0 ? _b : params.output;
12
+ }
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/testing/types.ts"],"names":[],"mappings":";;AAyGA,4CAIC;AATD;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,MAAiC;;IAEjC,OAAO,MAAA,MAAA,MAAM,CAAC,QAAQ,mCAAI,MAAM,CAAC,SAAS,mCAAI,MAAM,CAAC,MAAM,CAAC;AAC9D,CAAC"}
@@ -74,7 +74,7 @@
74
74
  *
75
75
  * @see https://en.wikipedia.org/wiki/Communicating_sequential_processes
76
76
  *
77
- * @template T The type of values sent through the channel
77
+ * @template Message The type of values sent through the channel
78
78
  *
79
79
  * @example Safe Producer-Consumer Pattern
80
80
  * ```typescript
@@ -118,7 +118,7 @@
118
118
  export declare class ChannelError extends Error {
119
119
  constructor(message: string, options?: ErrorOptions);
120
120
  }
121
- export declare class Channel<T> {
121
+ export declare class Channel<Message> {
122
122
  #private;
123
123
  /**
124
124
  * Create a new channel with the specified buffer capacity.
@@ -149,14 +149,14 @@ export declare class Channel<T> {
149
149
  * @param value - The value to send
150
150
  * @throws {ChannelError} If channel is closed
151
151
  */
152
- send(value: T): Promise<void>;
152
+ send(value: Message): Promise<void>;
153
153
  /**
154
154
  * Receive a value from the channel
155
155
  * Blocks if no value is available until one arrives
156
156
  *
157
157
  * @returns The received value, or CLOSED symbol if channel is closed and empty
158
158
  */
159
- receive(): Promise<T | typeof CLOSED>;
159
+ receive(): Promise<Message | typeof CLOSED>;
160
160
  /**
161
161
  * Try to receive a value without blocking
162
162
  * Returns immediately with value or undefined if channel is empty
@@ -174,7 +174,7 @@ export declare class Channel<T> {
174
174
  * }
175
175
  * ```
176
176
  */
177
- tryReceive(): T | typeof CLOSED | undefined;
177
+ tryReceive(): Message | typeof CLOSED | undefined;
178
178
  /**
179
179
  * Close the channel
180
180
  * No more sends allowed, but remaining values can be received
@@ -203,7 +203,7 @@ export declare class Channel<T> {
203
203
  /**
204
204
  * Async iterator support for for-await-of loops
205
205
  */
206
- [Symbol.asyncIterator](): AsyncIterableIterator<T>;
206
+ [Symbol.asyncIterator](): AsyncIterableIterator<Message>;
207
207
  }
208
208
  /**
209
209
  * Special symbol to indicate channel is closed
@@ -225,5 +225,5 @@ export declare const CLOSED: unique symbol;
225
225
  * }
226
226
  * ```
227
227
  */
228
- export declare function isClosed<T>(value: T | typeof CLOSED): value is typeof CLOSED;
228
+ export declare function isClosed<Message>(value: Message | typeof CLOSED): value is typeof CLOSED;
229
229
  //# sourceMappingURL=channel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/utils/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AAmBH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD;AAWD,qBAAa,OAAO,CAAC,CAAC;;IAOpB;;;;;;;;;;;;;;;;;;;;OAoBG;gBACS,QAAQ,GAAE,MAAW;IAOjC;;;;;;OAMG;IACG,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBnC;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,OAAO,MAAM,CAAC;IAiC3C;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,IAAI,CAAC,GAA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,GAAG,OAAO,MAAM,GAAG,SAAS;IA+BjD;;;OAGG;IACH,KAAK,IAAI,IAAI;IAkBb;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED;;OAEG;IACI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,OAAO,CAAC;CAOhE;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,eAAmB,CAAC;AAEvC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAC9B,KAAK,EAAE,OAAO,GAAG,OAAO,MAAM,GAC7B,KAAK,IAAI,OAAO,MAAM,CAExB"}
@@ -75,7 +75,7 @@
75
75
  *
76
76
  * @see https://en.wikipedia.org/wiki/Communicating_sequential_processes
77
77
  *
78
- * @template T The type of values sent through the channel
78
+ * @template Message The type of values sent through the channel
79
79
  *
80
80
  * @example Safe Producer-Consumer Pattern
81
81
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../src/utils/channel.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyRH,4BAEC;AAxQD;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CAC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/J,uDAAsB;;;;;;;;;IAlBn5/J"}
1
+ {"version":3,"file":"formatPromptMessages.d.ts","sourceRoot":"","sources":["../../../src/utils/formatPromptMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGhF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,oBAAoB,EAC5B,cAAc,EAAE,iBAAiB,EAAE,EACnC,SAAS,GAAE,SAAc;;;;;;;mBA4DkqqK,uDAAsB;;;;;;;;;IAlBltqK"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPromptBySelector.d.ts","sourceRoot":"","sources":["../../../src/utils/getPromptBySelector.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG;IACjD;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,yBAAyB;;oBAkD+yrI,uDAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAA0P,uDAAsB;qBAAoD,uDAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAD1rsI"}
1
+ {"version":3,"file":"getPromptBySelector.d.ts","sourceRoot":"","sources":["../../../src/utils/getPromptBySelector.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG;IACjD;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,yBAAyB;;oBAkDqxzI,uDAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAA0P,uDAAsB;qBAAoD,uDAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UADhq0I"}
@@ -2,5 +2,5 @@
2
2
  * If the incoming function returns a promise, return the promise.
3
3
  * Otherwise, return a promise that resolves to the incoming function's return value.
4
4
  */
5
- export declare function promisifyResult<T>(result: T): (T extends Promise<infer U> ? Promise<U> : never) | (T extends Promise<unknown> ? never : Promise<T>);
5
+ export declare function promisifyResult<Result>(result: Result): (Result extends Promise<infer ResolvedValue> ? Promise<ResolvedValue> : never) | (Result extends Promise<unknown> ? never : Promise<Result>);
6
6
  //# sourceMappingURL=promisifyResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"promisifyResult.d.ts","sourceRoot":"","sources":["../../../src/utils/promisifyResult.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,4BAEC,CAAC,4EAM7C"}
1
+ {"version":3,"file":"promisifyResult.d.ts","sourceRoot":"","sources":["../../../src/utils/promisifyResult.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,iCAEJ,aAAa,kGAQ9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"promisifyResult.js","sourceRoot":"","sources":["../../../src/utils/promisifyResult.ts"],"names":[],"mappings":";;AAIA,0CAQC;AAZD;;;GAGG;AACH,SAAgB,eAAe,CAAI,MAAS;IAC1C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;QAC9B,OAAO,MAAyD,CAAC;IACnE,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAEf,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"promisifyResult.js","sourceRoot":"","sources":["../../../src/utils/promisifyResult.ts"],"names":[],"mappings":";;AAIA,0CAUC;AAdD;;;GAGG;AACH,SAAgB,eAAe,CAAS,MAAc;IACpD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;QAC9B,OAAO,MAEE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAEV,CAAC;AACtB,CAAC"}
@@ -2,16 +2,16 @@ import type { z } from "zod";
2
2
  /**
3
3
  * Simple utility to check if two types are exactly equivalent
4
4
  */
5
- export type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
5
+ export type AssertEqual<Actual, Expected> = (<Argument>() => Argument extends Actual ? 1 : 2) extends <Argument>() => Argument extends Expected ? 1 : 2 ? true : false;
6
6
  /**
7
7
  * Zod utility to check if a schema is defined correctly against a given type
8
8
  *
9
9
  * @see https://github.com/colinhacks/zod/issues/372#issuecomment-2445439772
10
10
  */
11
- export declare const schemaMatches: <T>() => <S extends z.ZodType<T, unknown>>(schema: AssertEqual<S["_output"], T> extends true ? S : S & {
11
+ export declare const schemaMatches: <Value>() => <Schema extends z.ZodType<Value, unknown>>(schema: AssertEqual<Schema["_output"], Value> extends true ? Schema : Schema & {
12
12
  "types do not match": {
13
- expected: T;
14
- received: S["_output"];
13
+ expected: Value;
14
+ received: Schema["_output"];
15
15
  };
16
- }) => S;
16
+ }) => Schema;
17
17
  //# sourceMappingURL=schemaMatches.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaMatches.d.ts","sourceRoot":"","sources":["../../../src/utils/schemaMatches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,IAC1B,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAC/D,IAAI,GACJ,KAAK,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACvB,CAAC,QACD,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,EAC9B,QAAQ,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,GAC7C,CAAC,GACD,CAAC,GAAG;IACF,oBAAoB,EAAE;QACpB,QAAQ,EAAE,CAAC,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;KACxB,CAAC;CACH,KACJ,CAEF,CAAC"}
1
+ {"version":3,"file":"schemaMatches.d.ts","sourceRoot":"","sources":["../../../src/utils/schemaMatches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,MAAM,EAAE,QAAQ,IACtC,CAAC,CAAC,QAAQ,OAAO,QAAQ,SAAS,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CACxD,QAAQ,OACH,QAAQ,SAAS,QAAQ,GAAG,CAAC,GAAG,CAAC,GACpC,IAAI,GACJ,KAAK,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACvB,KAAK,QACL,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,EACvC,QAAQ,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,IAAI,GACtD,MAAM,GACN,MAAM,GAAG;IACP,oBAAoB,EAAE;QACpB,QAAQ,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;KAC7B,CAAC;CACH,KACJ,MAEF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaMatches.js","sourceRoot":"","sources":["../../../src/utils/schemaMatches.ts"],"names":[],"mappings":";;;AAUA;;;;GAIG;AACI,MAAM,aAAa,GACxB,GAAM,EAAE,CACR,CACE,MAOK,EACF,EAAE;IACL,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAbS,QAAA,aAAa,iBAatB"}
1
+ {"version":3,"file":"schemaMatches.js","sourceRoot":"","sources":["../../../src/utils/schemaMatches.ts"],"names":[],"mappings":";;;AAYA;;;;GAIG;AACI,MAAM,aAAa,GACxB,GAAU,EAAE,CACZ,CACE,MAOK,EACG,EAAE;IACV,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAbS,QAAA,aAAa,iBAatB"}
@@ -0,0 +1,5 @@
1
+ export type { PhoenixDescribe, PhoenixTest, PhoenixTestApi, PhoenixTestEach, } from "../testing/define-api";
2
+ export type { AcceptanceCriterion, AcceptanceMetric, AcceptanceResult, Annotation, AnnotatorKind, EvaluationParams, EvaluationResult, Evaluator, EvaluatorResult, KVMap, ReferenceOutput, SuiteConfig, TestArgs, TestConfig, TestEachRow, TestFn, TestParams, TestParamsBase, } from "../testing/types";
3
+ export { evaluate, logAnnotation, logOutput, traceEvaluator, } from "../testing/helpers";
4
+ export declare const describe: import("../testing/define-api").PhoenixDescribe, test: import("../testing/define-api").PhoenixTest, it: import("../testing/define-api").PhoenixTest;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vitest/index.ts"],"names":[],"mappings":"AAUA,YAAY,EACV,eAAe,EACf,WAAW,EACX,cAAc,EACd,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,KAAK,EACL,eAAe,EACf,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,EACX,MAAM,EACN,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,QAAQ,EACR,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,oBAAoB,CAAC;AAa5B,eAAO,MAAQ,QAAQ,mDAAE,IAAI,+CAAE,EAAE,6CAA+B,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.it = exports.test = exports.describe = exports.traceEvaluator = exports.logOutput = exports.logAnnotation = exports.evaluate = void 0;
5
+ const vitest_1 = require("vitest");
6
+ const define_api_1 = require("../testing/define-api");
7
+ var helpers_1 = require("../testing/helpers");
8
+ Object.defineProperty(exports, "evaluate", { enumerable: true, get: function () { return helpers_1.evaluate; } });
9
+ Object.defineProperty(exports, "logAnnotation", { enumerable: true, get: function () { return helpers_1.logAnnotation; } });
10
+ Object.defineProperty(exports, "logOutput", { enumerable: true, get: function () { return helpers_1.logOutput; } });
11
+ Object.defineProperty(exports, "traceEvaluator", { enumerable: true, get: function () { return helpers_1.traceEvaluator; } });
12
+ const hooks = {
13
+ describe: vitest_1.describe,
14
+ describeOnly: vitest_1.describe.only,
15
+ describeSkip: vitest_1.describe.skip,
16
+ test: vitest_1.test,
17
+ testOnly: vitest_1.test.only,
18
+ testSkip: vitest_1.test.skip,
19
+ beforeAll: vitest_1.beforeAll,
20
+ afterAll: vitest_1.afterAll,
21
+ };
22
+ _a = (0, define_api_1.createTestApi)(() => hooks), exports.describe = _a.describe, exports.test = _a.test, exports.it = _a.it;
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vitest/index.ts"],"names":[],"mappings":";;;;AAAA,mCAKgB;AAEhB,sDAAsD;AA+BtD,8CAK4B;AAJ1B,mGAAA,QAAQ,OAAA;AACR,wGAAA,aAAa,OAAA;AACb,oGAAA,SAAS,OAAA;AACT,yGAAA,cAAc,OAAA;AAGhB,MAAM,KAAK,GAAgB;IACzB,QAAQ,EAAE,iBAAc;IACxB,YAAY,EAAE,iBAAc,CAAC,IAAI;IACjC,YAAY,EAAE,iBAAc,CAAC,IAAI;IACjC,IAAI,EAAE,aAAU;IAChB,QAAQ,EAAE,aAAU,CAAC,IAAI;IACzB,QAAQ,EAAE,aAAU,CAAC,IAAI;IACzB,SAAS,EAAE,kBAAe;IAC1B,QAAQ,EAAE,iBAAc;CACzB,CAAC;AAEW,KAAyB,IAAA,0BAAa,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAjD,gBAAQ,gBAAE,YAAI,YAAE,UAAE,SAAgC"}
@@ -0,0 +1,19 @@
1
+ import { formatSuiteSummary, printSuiteSummaries } from "../testing/reporter-format";
2
+ /**
3
+ * Vitest reporter for `@arizeai/phoenix-client/vitest`.
4
+ *
5
+ * The reporter does not replace Vitest's default test output. Instead it
6
+ * appends a Phoenix-flavored summary at the end of the run that lists
7
+ * outputs, annotations, and dataset/experiment links for each suite.
8
+ *
9
+ * The class implements the Vitest `Reporter` interface structurally rather
10
+ * than nominally so we don't have to import a CJS type from `vitest/reporters`.
11
+ */
12
+ export default class PhoenixVitestReporter {
13
+ private readonly report;
14
+ onTestRunStart(): void;
15
+ onTestRunEnd(): void;
16
+ onFinished(): void;
17
+ }
18
+ export { formatSuiteSummary, printSuiteSummaries };
19
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../src/vitest/reporter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;IAEtD,cAAc,IAAI,IAAI;IAGtB,YAAY,IAAI,IAAI;IAIpB,UAAU,IAAI,IAAI;CAGnB;AAED,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printSuiteSummaries = exports.formatSuiteSummary = void 0;
4
+ const report_run_1 = require("../testing/report-run");
5
+ const reporter_format_1 = require("../testing/reporter-format");
6
+ Object.defineProperty(exports, "formatSuiteSummary", { enumerable: true, get: function () { return reporter_format_1.formatSuiteSummary; } });
7
+ Object.defineProperty(exports, "printSuiteSummaries", { enumerable: true, get: function () { return reporter_format_1.printSuiteSummaries; } });
8
+ /**
9
+ * Vitest reporter for `@arizeai/phoenix-client/vitest`.
10
+ *
11
+ * The reporter does not replace Vitest's default test output. Instead it
12
+ * appends a Phoenix-flavored summary at the end of the run that lists
13
+ * outputs, annotations, and dataset/experiment links for each suite.
14
+ *
15
+ * The class implements the Vitest `Reporter` interface structurally rather
16
+ * than nominally so we don't have to import a CJS type from `vitest/reporters`.
17
+ */
18
+ class PhoenixVitestReporter {
19
+ constructor() {
20
+ this.report = new report_run_1.SuiteSummaryReportRun();
21
+ }
22
+ onTestRunStart() {
23
+ this.report.begin();
24
+ }
25
+ onTestRunEnd() {
26
+ this.report.finish();
27
+ }
28
+ // Vitest also calls `onFinished` on legacy reporters; alias for safety.
29
+ onFinished() {
30
+ this.report.finish();
31
+ }
32
+ }
33
+ exports.default = PhoenixVitestReporter;
34
+ //# sourceMappingURL=reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/vitest/reporter.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAC9D,gEAGoC;AA2B3B,mGA7BP,oCAAkB,OA6BO;AAAE,oGA5B3B,qCAAmB,OA4B2B;AAzBhD;;;;;;;;;GASG;AACH,MAAqB,qBAAqB;IAA1C;QACmB,WAAM,GAAG,IAAI,kCAAqB,EAAE,CAAC;IAYxD,CAAC;IAVC,cAAc;QACZ,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IACD,YAAY;QACV,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IACD,wEAAwE;IACxE,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF;AAbD,wCAaC"}