@arizeai/phoenix-client 6.10.0 → 6.11.0

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 (244) hide show
  1. package/README.md +62 -0
  2. package/dist/esm/__generated__/api/v1.d.ts +452 -28
  3. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  4. package/dist/esm/experiments/helpers/getExampleGlobalId.d.ts +8 -0
  5. package/dist/esm/experiments/helpers/getExampleGlobalId.d.ts.map +1 -0
  6. package/dist/esm/experiments/helpers/getExampleGlobalId.js +9 -0
  7. package/dist/esm/experiments/helpers/getExampleGlobalId.js.map +1 -0
  8. package/dist/esm/experiments/resumeEvaluation.d.ts.map +1 -1
  9. package/dist/esm/experiments/resumeEvaluation.js +2 -1
  10. package/dist/esm/experiments/resumeEvaluation.js.map +1 -1
  11. package/dist/esm/experiments/resumeExperiment.d.ts.map +1 -1
  12. package/dist/esm/experiments/resumeExperiment.js +3 -2
  13. package/dist/esm/experiments/resumeExperiment.js.map +1 -1
  14. package/dist/esm/experiments/runExperiment.d.ts.map +1 -1
  15. package/dist/esm/experiments/runExperiment.js +6 -3
  16. package/dist/esm/experiments/runExperiment.js.map +1 -1
  17. package/dist/esm/jest/index.d.ts +5 -0
  18. package/dist/esm/jest/index.d.ts.map +1 -0
  19. package/dist/esm/jest/index.js +49 -0
  20. package/dist/esm/jest/index.js.map +1 -0
  21. package/dist/esm/jest/reporter.d.ts +13 -0
  22. package/dist/esm/jest/reporter.d.ts.map +1 -0
  23. package/dist/esm/jest/reporter.js +19 -0
  24. package/dist/esm/jest/reporter.js.map +1 -0
  25. package/dist/esm/prompts/sdks/toAI.d.ts +2 -2
  26. package/dist/esm/prompts/sdks/toAI.d.ts.map +1 -1
  27. package/dist/esm/prompts/sdks/toAI.js.map +1 -1
  28. package/dist/esm/prompts/sdks/toAnthropic.d.ts +2 -2
  29. package/dist/esm/prompts/sdks/toAnthropic.d.ts.map +1 -1
  30. package/dist/esm/prompts/sdks/toAnthropic.js.map +1 -1
  31. package/dist/esm/prompts/sdks/toOpenAI.d.ts +2 -2
  32. package/dist/esm/prompts/sdks/toOpenAI.d.ts.map +1 -1
  33. package/dist/esm/prompts/sdks/toOpenAI.js.map +1 -1
  34. package/dist/esm/prompts/sdks/toSDK.d.ts +8 -8
  35. package/dist/esm/prompts/sdks/toSDK.d.ts.map +1 -1
  36. package/dist/esm/prompts/sdks/toSDK.js.map +1 -1
  37. package/dist/esm/prompts/sdks/types.d.ts +2 -2
  38. package/dist/esm/prompts/sdks/types.d.ts.map +1 -1
  39. package/dist/esm/schemas/llm/anthropic/converters.d.ts +8 -8
  40. package/dist/esm/schemas/llm/anthropic/messagePartSchemas.d.ts +4 -4
  41. package/dist/esm/schemas/llm/anthropic/messageSchemas.d.ts +6 -6
  42. package/dist/esm/schemas/llm/constants.d.ts +3 -3
  43. package/dist/esm/schemas/llm/converters.d.ts +12 -12
  44. package/dist/esm/schemas/llm/openai/converters.d.ts +3 -3
  45. package/dist/esm/schemas/llm/schemas.d.ts +2 -2
  46. package/dist/esm/testing/acceptance.d.ts +20 -0
  47. package/dist/esm/testing/acceptance.d.ts.map +1 -0
  48. package/dist/esm/testing/acceptance.js +129 -0
  49. package/dist/esm/testing/acceptance.js.map +1 -0
  50. package/dist/esm/testing/define-api.d.ts +157 -0
  51. package/dist/esm/testing/define-api.d.ts.map +1 -0
  52. package/dist/esm/testing/define-api.js +78 -0
  53. package/dist/esm/testing/define-api.js.map +1 -0
  54. package/dist/esm/testing/helpers.d.ts +55 -0
  55. package/dist/esm/testing/helpers.d.ts.map +1 -0
  56. package/dist/esm/testing/helpers.js +179 -0
  57. package/dist/esm/testing/helpers.js.map +1 -0
  58. package/dist/esm/testing/phoenix-test-tracking.d.ts +68 -0
  59. package/dist/esm/testing/phoenix-test-tracking.d.ts.map +1 -0
  60. package/dist/esm/testing/phoenix-test-tracking.js +521 -0
  61. package/dist/esm/testing/phoenix-test-tracking.js.map +1 -0
  62. package/dist/esm/testing/report-artifacts.d.ts +45 -0
  63. package/dist/esm/testing/report-artifacts.d.ts.map +1 -0
  64. package/dist/esm/testing/report-artifacts.js +218 -0
  65. package/dist/esm/testing/report-artifacts.js.map +1 -0
  66. package/dist/esm/testing/report-run.d.ts +22 -0
  67. package/dist/esm/testing/report-run.d.ts.map +1 -0
  68. package/dist/esm/testing/report-run.js +41 -0
  69. package/dist/esm/testing/report-run.js.map +1 -0
  70. package/dist/esm/testing/reporter-format.d.ts +83 -0
  71. package/dist/esm/testing/reporter-format.d.ts.map +1 -0
  72. package/dist/esm/testing/reporter-format.js +852 -0
  73. package/dist/esm/testing/reporter-format.js.map +1 -0
  74. package/dist/esm/testing/runner.d.ts +31 -0
  75. package/dist/esm/testing/runner.d.ts.map +1 -0
  76. package/dist/esm/testing/runner.js +238 -0
  77. package/dist/esm/testing/runner.js.map +1 -0
  78. package/dist/esm/testing/state.d.ts +138 -0
  79. package/dist/esm/testing/state.d.ts.map +1 -0
  80. package/dist/esm/testing/state.js +31 -0
  81. package/dist/esm/testing/state.js.map +1 -0
  82. package/dist/esm/testing/types.d.ts +319 -0
  83. package/dist/esm/testing/types.d.ts.map +1 -0
  84. package/dist/esm/testing/types.js +9 -0
  85. package/dist/esm/testing/types.js.map +1 -0
  86. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  87. package/dist/esm/utils/channel.d.ts +7 -7
  88. package/dist/esm/utils/channel.d.ts.map +1 -1
  89. package/dist/esm/utils/channel.js +1 -1
  90. package/dist/esm/utils/channel.js.map +1 -1
  91. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  92. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  93. package/dist/esm/utils/promisifyResult.d.ts +1 -1
  94. package/dist/esm/utils/promisifyResult.d.ts.map +1 -1
  95. package/dist/esm/utils/promisifyResult.js.map +1 -1
  96. package/dist/esm/utils/schemaMatches.d.ts +5 -5
  97. package/dist/esm/utils/schemaMatches.d.ts.map +1 -1
  98. package/dist/esm/utils/schemaMatches.js.map +1 -1
  99. package/dist/esm/vitest/index.d.ts +5 -0
  100. package/dist/esm/vitest/index.d.ts.map +1 -0
  101. package/dist/esm/vitest/index.js +15 -0
  102. package/dist/esm/vitest/index.js.map +1 -0
  103. package/dist/esm/vitest/reporter.d.ts +19 -0
  104. package/dist/esm/vitest/reporter.d.ts.map +1 -0
  105. package/dist/esm/vitest/reporter.js +27 -0
  106. package/dist/esm/vitest/reporter.js.map +1 -0
  107. package/dist/src/__generated__/api/v1.d.ts +452 -28
  108. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  109. package/dist/src/experiments/helpers/getExampleGlobalId.d.ts +8 -0
  110. package/dist/src/experiments/helpers/getExampleGlobalId.d.ts.map +1 -0
  111. package/dist/src/experiments/helpers/getExampleGlobalId.js +13 -0
  112. package/dist/src/experiments/helpers/getExampleGlobalId.js.map +1 -0
  113. package/dist/src/experiments/resumeEvaluation.d.ts.map +1 -1
  114. package/dist/src/experiments/resumeEvaluation.js +2 -1
  115. package/dist/src/experiments/resumeEvaluation.js.map +1 -1
  116. package/dist/src/experiments/resumeExperiment.d.ts.map +1 -1
  117. package/dist/src/experiments/resumeExperiment.js +3 -2
  118. package/dist/src/experiments/resumeExperiment.js.map +1 -1
  119. package/dist/src/experiments/runExperiment.d.ts.map +1 -1
  120. package/dist/src/experiments/runExperiment.js +6 -3
  121. package/dist/src/experiments/runExperiment.js.map +1 -1
  122. package/dist/src/jest/index.d.ts +5 -0
  123. package/dist/src/jest/index.d.ts.map +1 -0
  124. package/dist/src/jest/index.js +58 -0
  125. package/dist/src/jest/index.js.map +1 -0
  126. package/dist/src/jest/reporter.d.ts +13 -0
  127. package/dist/src/jest/reporter.d.ts.map +1 -0
  128. package/dist/src/jest/reporter.js +23 -0
  129. package/dist/src/jest/reporter.js.map +1 -0
  130. package/dist/src/prompts/sdks/toAI.d.ts +2 -2
  131. package/dist/src/prompts/sdks/toAI.d.ts.map +1 -1
  132. package/dist/src/prompts/sdks/toAI.js.map +1 -1
  133. package/dist/src/prompts/sdks/toAnthropic.d.ts +2 -2
  134. package/dist/src/prompts/sdks/toAnthropic.d.ts.map +1 -1
  135. package/dist/src/prompts/sdks/toAnthropic.js.map +1 -1
  136. package/dist/src/prompts/sdks/toOpenAI.d.ts +2 -2
  137. package/dist/src/prompts/sdks/toOpenAI.d.ts.map +1 -1
  138. package/dist/src/prompts/sdks/toOpenAI.js.map +1 -1
  139. package/dist/src/prompts/sdks/toSDK.d.ts +8 -8
  140. package/dist/src/prompts/sdks/toSDK.d.ts.map +1 -1
  141. package/dist/src/prompts/sdks/toSDK.js.map +1 -1
  142. package/dist/src/prompts/sdks/types.d.ts +2 -2
  143. package/dist/src/prompts/sdks/types.d.ts.map +1 -1
  144. package/dist/src/schemas/llm/anthropic/converters.d.ts +8 -8
  145. package/dist/src/schemas/llm/anthropic/messagePartSchemas.d.ts +4 -4
  146. package/dist/src/schemas/llm/anthropic/messageSchemas.d.ts +6 -6
  147. package/dist/src/schemas/llm/constants.d.ts +3 -3
  148. package/dist/src/schemas/llm/converters.d.ts +12 -12
  149. package/dist/src/schemas/llm/openai/converters.d.ts +3 -3
  150. package/dist/src/schemas/llm/schemas.d.ts +2 -2
  151. package/dist/src/testing/acceptance.d.ts +20 -0
  152. package/dist/src/testing/acceptance.d.ts.map +1 -0
  153. package/dist/src/testing/acceptance.js +114 -0
  154. package/dist/src/testing/acceptance.js.map +1 -0
  155. package/dist/src/testing/define-api.d.ts +157 -0
  156. package/dist/src/testing/define-api.d.ts.map +1 -0
  157. package/dist/src/testing/define-api.js +81 -0
  158. package/dist/src/testing/define-api.js.map +1 -0
  159. package/dist/src/testing/helpers.d.ts +55 -0
  160. package/dist/src/testing/helpers.d.ts.map +1 -0
  161. package/dist/src/testing/helpers.js +182 -0
  162. package/dist/src/testing/helpers.js.map +1 -0
  163. package/dist/src/testing/phoenix-test-tracking.d.ts +68 -0
  164. package/dist/src/testing/phoenix-test-tracking.d.ts.map +1 -0
  165. package/dist/src/testing/phoenix-test-tracking.js +530 -0
  166. package/dist/src/testing/phoenix-test-tracking.js.map +1 -0
  167. package/dist/src/testing/report-artifacts.d.ts +45 -0
  168. package/dist/src/testing/report-artifacts.d.ts.map +1 -0
  169. package/dist/src/testing/report-artifacts.js +225 -0
  170. package/dist/src/testing/report-artifacts.js.map +1 -0
  171. package/dist/src/testing/report-run.d.ts +22 -0
  172. package/dist/src/testing/report-run.d.ts.map +1 -0
  173. package/dist/src/testing/report-run.js +47 -0
  174. package/dist/src/testing/report-run.js.map +1 -0
  175. package/dist/src/testing/reporter-format.d.ts +83 -0
  176. package/dist/src/testing/reporter-format.d.ts.map +1 -0
  177. package/dist/src/testing/reporter-format.js +870 -0
  178. package/dist/src/testing/reporter-format.js.map +1 -0
  179. package/dist/src/testing/runner.d.ts +31 -0
  180. package/dist/src/testing/runner.d.ts.map +1 -0
  181. package/dist/src/testing/runner.js +258 -0
  182. package/dist/src/testing/runner.js.map +1 -0
  183. package/dist/src/testing/state.d.ts +138 -0
  184. package/dist/src/testing/state.d.ts.map +1 -0
  185. package/dist/src/testing/state.js +38 -0
  186. package/dist/src/testing/state.js.map +1 -0
  187. package/dist/src/testing/types.d.ts +319 -0
  188. package/dist/src/testing/types.d.ts.map +1 -0
  189. package/dist/src/testing/types.js +13 -0
  190. package/dist/src/testing/types.js.map +1 -0
  191. package/dist/src/utils/channel.d.ts +7 -7
  192. package/dist/src/utils/channel.d.ts.map +1 -1
  193. package/dist/src/utils/channel.js +1 -1
  194. package/dist/src/utils/channel.js.map +1 -1
  195. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  196. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  197. package/dist/src/utils/promisifyResult.d.ts +1 -1
  198. package/dist/src/utils/promisifyResult.d.ts.map +1 -1
  199. package/dist/src/utils/promisifyResult.js.map +1 -1
  200. package/dist/src/utils/schemaMatches.d.ts +5 -5
  201. package/dist/src/utils/schemaMatches.d.ts.map +1 -1
  202. package/dist/src/utils/schemaMatches.js.map +1 -1
  203. package/dist/src/vitest/index.d.ts +5 -0
  204. package/dist/src/vitest/index.d.ts.map +1 -0
  205. package/dist/src/vitest/index.js +23 -0
  206. package/dist/src/vitest/index.js.map +1 -0
  207. package/dist/src/vitest/reporter.d.ts +19 -0
  208. package/dist/src/vitest/reporter.d.ts.map +1 -0
  209. package/dist/src/vitest/reporter.js +34 -0
  210. package/dist/src/vitest/reporter.js.map +1 -0
  211. package/dist/tsconfig.tsbuildinfo +1 -1
  212. package/docs/ci-evals-annotations.mdx +190 -0
  213. package/docs/ci-evals-jest.mdx +78 -0
  214. package/docs/ci-evals-vitest.mdx +240 -0
  215. package/docs/ci-evals.mdx +263 -0
  216. package/docs/overview.mdx +9 -1
  217. package/package.json +49 -17
  218. package/src/__generated__/api/v1.ts +452 -28
  219. package/src/experiments/helpers/getExampleGlobalId.ts +12 -0
  220. package/src/experiments/resumeEvaluation.ts +2 -1
  221. package/src/experiments/resumeExperiment.ts +3 -2
  222. package/src/experiments/runExperiment.ts +6 -3
  223. package/src/jest/index.ts +124 -0
  224. package/src/jest/reporter.ts +22 -0
  225. package/src/prompts/sdks/toAI.ts +4 -3
  226. package/src/prompts/sdks/toAnthropic.ts +4 -3
  227. package/src/prompts/sdks/toOpenAI.ts +4 -3
  228. package/src/prompts/sdks/toSDK.ts +16 -11
  229. package/src/prompts/sdks/types.ts +2 -2
  230. package/src/testing/acceptance.ts +190 -0
  231. package/src/testing/define-api.ts +279 -0
  232. package/src/testing/helpers.ts +251 -0
  233. package/src/testing/phoenix-test-tracking.ts +637 -0
  234. package/src/testing/report-artifacts.ts +272 -0
  235. package/src/testing/report-run.ts +44 -0
  236. package/src/testing/reporter-format.ts +1072 -0
  237. package/src/testing/runner.ts +350 -0
  238. package/src/testing/state.ts +165 -0
  239. package/src/testing/types.ts +366 -0
  240. package/src/utils/channel.ts +17 -15
  241. package/src/utils/promisifyResult.ts +6 -4
  242. package/src/utils/schemaMatches.ts +12 -10
  243. package/src/vitest/index.ts +57 -0
  244. package/src/vitest/reporter.ts +32 -0
@@ -8,29 +8,29 @@ import type { SupportedSDK, toSDKParamsBase, Variables } from "./types.js";
8
8
  * toOpenAI(params)
9
9
  * ```
10
10
  */
11
- export type SDKParams<T extends SupportedSDK> = Parameters<(typeof PROVIDER_TO_SDK)[T]>[number] extends toSDKParamsBase ? Parameters<(typeof PROVIDER_TO_SDK)[T]>[number] : never;
11
+ export type SDKParams<SDK extends SupportedSDK> = Parameters<(typeof PROVIDER_TO_SDK)[SDK]>[number] extends toSDKParamsBase ? Parameters<(typeof PROVIDER_TO_SDK)[SDK]>[number] : never;
12
12
  /**
13
13
  * Map of SDK names to their corresponding conversion functions
14
14
  */
15
15
  export declare const PROVIDER_TO_SDK: {
16
- openai: <V extends Variables = Variables>({ prompt, variables, }: import("./toOpenAI.js").ToOpenAIParams<V>) => import("openai/resources").ChatCompletionCreateParams | null;
17
- anthropic: <V extends Variables = Variables>({ prompt, variables, }: import("./toAnthropic.js").ToAnthropicParams<V>) => import("@anthropic-ai/sdk/resources/messages/messages.mjs").MessageCreateParams | null;
18
- ai: <V extends Variables>({ prompt, variables, }: import("./toAI.js").ToAIParams<V>) => import("./toAI.js").PartialAIParams | null;
16
+ openai: <PromptVariables extends Variables = Variables>({ prompt, variables, }: import("./toOpenAI.js").ToOpenAIParams<PromptVariables>) => import("openai/resources").ChatCompletionCreateParams | null;
17
+ anthropic: <PromptVariables extends Variables = Variables>({ prompt, variables, }: import("./toAnthropic.js").ToAnthropicParams<PromptVariables>) => import("@anthropic-ai/sdk/resources").MessageCreateParams | null;
18
+ ai: <PromptVariables extends Variables>({ prompt, variables, }: import("./toAI.js").ToAIParams<PromptVariables>) => import("./toAI.js").PartialAIParams | null;
19
19
  };
20
20
  /**
21
21
  * Parameters specific to the toSDK function
22
22
  */
23
- export type ToSDKParams<T extends SupportedSDK, V extends Variables = Variables> = {
23
+ export type ToSDKParams<SDK extends SupportedSDK, PromptVariables extends Variables = Variables> = {
24
24
  /**
25
25
  * String representing the SDK to convert to
26
26
  */
27
- sdk: T;
27
+ sdk: SDK;
28
28
  /**
29
29
  * Optional variables to format the prompt with
30
30
  * Keys are the variable names, values are the variable values
31
31
  * The variable format is determined via prompt.template_format
32
32
  */
33
- variables?: V;
33
+ variables?: PromptVariables;
34
34
  };
35
35
  /**
36
36
  * Convert a Phoenix prompt to a specific SDK's parameters
@@ -53,5 +53,5 @@ export type ToSDKParams<T extends SupportedSDK, V extends Variables = Variables>
53
53
  * @param params - The parameters to convert a prompt to an SDK's parameters
54
54
  * @returns The SDK's parameters
55
55
  */
56
- export declare const toSDK: <T extends SupportedSDK, V extends Variables = Variables>({ sdk: _sdk, ...rest }: ToSDKParams<T, V> & SDKParams<T>) => ReturnType<(typeof PROVIDER_TO_SDK)[T]>;
56
+ export declare const toSDK: <SDK extends SupportedSDK, PromptVariables extends Variables = Variables>({ sdk: _sdk, ...rest }: ToSDKParams<SDK, PromptVariables> & SDKParams<SDK>) => ReturnType<(typeof PROVIDER_TO_SDK)[SDK]>;
57
57
  //# sourceMappingURL=toSDK.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toSDK.d.ts","sourceRoot":"","sources":["../../../../src/prompts/sdks/toSDK.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,YAAY,IAAI,UAAU,CACxD,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAC5B,CAAC,MAAM,CAAC,SAAS,eAAe,GAC7B,UAAU,CAAC,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAC/C,KAAK,CAAC;AAEV;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AAkBF;;GAEG;AACH,MAAM,MAAM,WAAW,CACrB,CAAC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AAG,CAAI,IAAI,CAA4C,CAAC;AACjE,CAAC,CAAC"}
1
+ {"version":3,"file":"toSDK.js","sourceRoot":"","sources":["../../../../src/prompts/sdks/toSDK.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkBtC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,EAAE,EAAE,IAAI;CACT,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY,GAAG,CAA2B,GAAQ,EAAE,EAAE;IAC1D,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,QAAQ;YACX,OAAO,eAAe,CAAC,MAAM,CAAC;QAChC,KAAK,WAAW;YACd,OAAO,eAAe,CAAC,SAAS,CAAC;QACnC,KAAK,IAAI;YACP,OAAO,eAAe,CAAC,EAAE,CAAC;QAC5B;YACE,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC;AAqBF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAGnB,EACA,GAAG,EAAE,IAAI,EACT,GAAG,IAAI,EAC4C,EAAE,EAAE;IACvD,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/B,SAAS,CAAC,GAAG,EAAE,6BAA6B,IAAI,EAAE,CAAC,CAAC;IACpD,OAAO,GAAG,CAAkB,IAAI,CAE/B,CAAC;AACJ,CAAC,CAAC"}
@@ -11,7 +11,7 @@ export type Variables = Record<string, string | {
11
11
  /**
12
12
  * Base parameters for an SDK conversion function
13
13
  */
14
- export type toSDKParamsBase<V extends Variables = Variables> = {
14
+ export type toSDKParamsBase<PromptVariables extends Variables = Variables> = {
15
15
  /**
16
16
  * The Phoenix prompt to convert
17
17
  */
@@ -19,7 +19,7 @@ export type toSDKParamsBase<V extends Variables = Variables> = {
19
19
  /**
20
20
  * The variables to use in the prompt
21
21
  */
22
- variables?: V;
22
+ variables?: PromptVariables;
23
23
  };
24
24
  /**
25
25
  * Supported SDK conversion targets for prompt conversion
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/prompts/sdks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI;IAC7D;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/prompts/sdks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,eAAe,SAAS,SAAS,GAAG,SAAS,IAAI;IAC3E;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -6,9 +6,9 @@ export declare const anthropicMessagePartToOpenAI: import("zod").ZodPipe<import(
6
6
  source: import("zod").ZodObject<{
7
7
  data: import("zod").ZodString;
8
8
  media_type: import("zod").ZodEnum<{
9
+ "image/gif": "image/gif";
9
10
  "image/jpeg": "image/jpeg";
10
11
  "image/png": "image/png";
11
- "image/gif": "image/gif";
12
12
  "image/webp": "image/webp";
13
13
  }>;
14
14
  type: import("zod").ZodLiteral<"base64">;
@@ -29,9 +29,9 @@ export declare const anthropicMessagePartToOpenAI: import("zod").ZodPipe<import(
29
29
  source: import("zod").ZodObject<{
30
30
  data: import("zod").ZodString;
31
31
  media_type: import("zod").ZodEnum<{
32
+ "image/gif": "image/gif";
32
33
  "image/jpeg": "image/jpeg";
33
34
  "image/png": "image/png";
34
- "image/gif": "image/gif";
35
35
  "image/webp": "image/webp";
36
36
  }>;
37
37
  type: import("zod").ZodLiteral<"base64">;
@@ -58,7 +58,7 @@ export declare const anthropicMessagePartToOpenAI: import("zod").ZodPipe<import(
58
58
  type: "image";
59
59
  source: {
60
60
  data: string;
61
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
61
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
62
62
  type: "base64";
63
63
  };
64
64
  } | {
@@ -71,7 +71,7 @@ export declare const anthropicMessagePartToOpenAI: import("zod").ZodPipe<import(
71
71
  type: "image";
72
72
  source: {
73
73
  data: string;
74
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
74
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
75
75
  type: "base64";
76
76
  };
77
77
  })[];
@@ -93,9 +93,9 @@ export declare const anthropicMessageToOpenAI: import("zod").ZodPipe<import("zod
93
93
  source: import("zod").ZodObject<{
94
94
  data: import("zod").ZodString;
95
95
  media_type: import("zod").ZodEnum<{
96
+ "image/gif": "image/gif";
96
97
  "image/jpeg": "image/jpeg";
97
98
  "image/png": "image/png";
98
- "image/gif": "image/gif";
99
99
  "image/webp": "image/webp";
100
100
  }>;
101
101
  type: import("zod").ZodLiteral<"base64">;
@@ -116,9 +116,9 @@ export declare const anthropicMessageToOpenAI: import("zod").ZodPipe<import("zod
116
116
  source: import("zod").ZodObject<{
117
117
  data: import("zod").ZodString;
118
118
  media_type: import("zod").ZodEnum<{
119
+ "image/gif": "image/gif";
119
120
  "image/jpeg": "image/jpeg";
120
121
  "image/png": "image/png";
121
- "image/gif": "image/gif";
122
122
  "image/webp": "image/webp";
123
123
  }>;
124
124
  type: import("zod").ZodLiteral<"base64">;
@@ -201,7 +201,7 @@ export declare const anthropicMessageToOpenAI: import("zod").ZodPipe<import("zod
201
201
  type: "image";
202
202
  source: {
203
203
  data: string;
204
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
204
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
205
205
  type: "base64";
206
206
  };
207
207
  } | {
@@ -214,7 +214,7 @@ export declare const anthropicMessageToOpenAI: import("zod").ZodPipe<import("zod
214
214
  type: "image";
215
215
  source: {
216
216
  data: string;
217
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
217
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
218
218
  type: "base64";
219
219
  };
220
220
  })[];
@@ -9,9 +9,9 @@ export declare const anthropicImageBlockSchema: z.ZodObject<{
9
9
  source: z.ZodObject<{
10
10
  data: z.ZodString;
11
11
  media_type: z.ZodEnum<{
12
+ "image/gif": "image/gif";
12
13
  "image/jpeg": "image/jpeg";
13
14
  "image/png": "image/png";
14
- "image/gif": "image/gif";
15
15
  "image/webp": "image/webp";
16
16
  }>;
17
17
  type: z.ZodLiteral<"base64">;
@@ -36,9 +36,9 @@ export declare const anthropicToolResultBlockSchema: z.ZodObject<{
36
36
  source: z.ZodObject<{
37
37
  data: z.ZodString;
38
38
  media_type: z.ZodEnum<{
39
+ "image/gif": "image/gif";
39
40
  "image/jpeg": "image/jpeg";
40
41
  "image/png": "image/png";
41
- "image/gif": "image/gif";
42
42
  "image/webp": "image/webp";
43
43
  }>;
44
44
  type: z.ZodLiteral<"base64">;
@@ -55,9 +55,9 @@ export declare const anthropicMessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodO
55
55
  source: z.ZodObject<{
56
56
  data: z.ZodString;
57
57
  media_type: z.ZodEnum<{
58
+ "image/gif": "image/gif";
58
59
  "image/jpeg": "image/jpeg";
59
60
  "image/png": "image/png";
60
- "image/gif": "image/gif";
61
61
  "image/webp": "image/webp";
62
62
  }>;
63
63
  type: z.ZodLiteral<"base64">;
@@ -78,9 +78,9 @@ export declare const anthropicMessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodO
78
78
  source: z.ZodObject<{
79
79
  data: z.ZodString;
80
80
  media_type: z.ZodEnum<{
81
+ "image/gif": "image/gif";
81
82
  "image/jpeg": "image/jpeg";
82
83
  "image/png": "image/png";
83
- "image/gif": "image/gif";
84
84
  "image/webp": "image/webp";
85
85
  }>;
86
86
  type: z.ZodLiteral<"base64">;
@@ -25,9 +25,9 @@ export declare const anthropicMessageSchema: z.ZodObject<{
25
25
  source: z.ZodObject<{
26
26
  data: z.ZodString;
27
27
  media_type: z.ZodEnum<{
28
+ "image/gif": "image/gif";
28
29
  "image/jpeg": "image/jpeg";
29
30
  "image/png": "image/png";
30
- "image/gif": "image/gif";
31
31
  "image/webp": "image/webp";
32
32
  }>;
33
33
  type: z.ZodLiteral<"base64">;
@@ -48,9 +48,9 @@ export declare const anthropicMessageSchema: z.ZodObject<{
48
48
  source: z.ZodObject<{
49
49
  data: z.ZodString;
50
50
  media_type: z.ZodEnum<{
51
+ "image/gif": "image/gif";
51
52
  "image/jpeg": "image/jpeg";
52
53
  "image/png": "image/png";
53
- "image/gif": "image/gif";
54
54
  "image/webp": "image/webp";
55
55
  }>;
56
56
  type: z.ZodLiteral<"base64">;
@@ -73,9 +73,9 @@ export declare const anthropicMessagesSchema: z.ZodArray<z.ZodObject<{
73
73
  source: z.ZodObject<{
74
74
  data: z.ZodString;
75
75
  media_type: z.ZodEnum<{
76
+ "image/gif": "image/gif";
76
77
  "image/jpeg": "image/jpeg";
77
78
  "image/png": "image/png";
78
- "image/gif": "image/gif";
79
79
  "image/webp": "image/webp";
80
80
  }>;
81
81
  type: z.ZodLiteral<"base64">;
@@ -96,9 +96,9 @@ export declare const anthropicMessagesSchema: z.ZodArray<z.ZodObject<{
96
96
  source: z.ZodObject<{
97
97
  data: z.ZodString;
98
98
  media_type: z.ZodEnum<{
99
+ "image/gif": "image/gif";
99
100
  "image/jpeg": "image/jpeg";
100
101
  "image/png": "image/png";
101
- "image/gif": "image/gif";
102
102
  "image/webp": "image/webp";
103
103
  }>;
104
104
  type: z.ZodLiteral<"base64">;
@@ -120,9 +120,9 @@ export declare const anthropicMessagesJSONSchema: z.core.ZodStandardJSONSchemaPa
120
120
  source: z.ZodObject<{
121
121
  data: z.ZodString;
122
122
  media_type: z.ZodEnum<{
123
+ "image/gif": "image/gif";
123
124
  "image/jpeg": "image/jpeg";
124
125
  "image/png": "image/png";
125
- "image/gif": "image/gif";
126
126
  "image/webp": "image/webp";
127
127
  }>;
128
128
  type: z.ZodLiteral<"base64">;
@@ -143,9 +143,9 @@ export declare const anthropicMessagesJSONSchema: z.core.ZodStandardJSONSchemaPa
143
143
  source: z.ZodObject<{
144
144
  data: z.ZodString;
145
145
  media_type: z.ZodEnum<{
146
+ "image/gif": "image/gif";
146
147
  "image/jpeg": "image/jpeg";
147
148
  "image/png": "image/png";
148
- "image/gif": "image/gif";
149
149
  "image/webp": "image/webp";
150
150
  }>;
151
151
  type: z.ZodLiteral<"base64">;
@@ -380,7 +380,7 @@ export declare const SDKProviderConverterMap: {
380
380
  type: "image";
381
381
  source: {
382
382
  data: string;
383
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
383
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
384
384
  type: "base64";
385
385
  };
386
386
  } | {
@@ -393,7 +393,7 @@ export declare const SDKProviderConverterMap: {
393
393
  type: "image";
394
394
  source: {
395
395
  data: string;
396
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
396
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
397
397
  type: "base64";
398
398
  };
399
399
  })[];
@@ -475,7 +475,7 @@ export declare const SDKProviderConverterMap: {
475
475
  type: "image";
476
476
  source: {
477
477
  data: string;
478
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
478
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
479
479
  type: "base64";
480
480
  };
481
481
  text?: undefined;
@@ -381,7 +381,7 @@ export declare const safelyConvertMessageToProvider: <TargetProviderSDK extends
381
381
  type: "image";
382
382
  source: {
383
383
  data: string;
384
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
384
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
385
385
  type: "base64";
386
386
  };
387
387
  } | {
@@ -394,7 +394,7 @@ export declare const safelyConvertMessageToProvider: <TargetProviderSDK extends
394
394
  type: "image";
395
395
  source: {
396
396
  data: string;
397
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
397
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
398
398
  type: "base64";
399
399
  };
400
400
  })[];
@@ -476,7 +476,7 @@ export declare const safelyConvertMessageToProvider: <TargetProviderSDK extends
476
476
  type: "image";
477
477
  source: {
478
478
  data: string;
479
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
479
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
480
480
  type: "base64";
481
481
  };
482
482
  text?: undefined;
@@ -1384,7 +1384,7 @@ export declare const safelyConvertToolCallToProvider: <TargetProviderSDK extends
1384
1384
  type: "image";
1385
1385
  source: {
1386
1386
  data: string;
1387
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
1387
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
1388
1388
  type: "base64";
1389
1389
  };
1390
1390
  } | {
@@ -1397,7 +1397,7 @@ export declare const safelyConvertToolCallToProvider: <TargetProviderSDK extends
1397
1397
  type: "image";
1398
1398
  source: {
1399
1399
  data: string;
1400
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
1400
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
1401
1401
  type: "base64";
1402
1402
  };
1403
1403
  })[];
@@ -1479,7 +1479,7 @@ export declare const safelyConvertToolCallToProvider: <TargetProviderSDK extends
1479
1479
  type: "image";
1480
1480
  source: {
1481
1481
  data: string;
1482
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
1482
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
1483
1483
  type: "base64";
1484
1484
  };
1485
1485
  text?: undefined;
@@ -2387,7 +2387,7 @@ export declare const safelyConvertToolDefinitionToProvider: <TargetProviderSDK e
2387
2387
  type: "image";
2388
2388
  source: {
2389
2389
  data: string;
2390
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
2390
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
2391
2391
  type: "base64";
2392
2392
  };
2393
2393
  } | {
@@ -2400,7 +2400,7 @@ export declare const safelyConvertToolDefinitionToProvider: <TargetProviderSDK e
2400
2400
  type: "image";
2401
2401
  source: {
2402
2402
  data: string;
2403
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
2403
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
2404
2404
  type: "base64";
2405
2405
  };
2406
2406
  })[];
@@ -2482,7 +2482,7 @@ export declare const safelyConvertToolDefinitionToProvider: <TargetProviderSDK e
2482
2482
  type: "image";
2483
2483
  source: {
2484
2484
  data: string;
2485
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
2485
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
2486
2486
  type: "base64";
2487
2487
  };
2488
2488
  text?: undefined;
@@ -3390,7 +3390,7 @@ export declare const safelyConvertToolChoiceToProvider: <TargetProviderSDK exten
3390
3390
  type: "image";
3391
3391
  source: {
3392
3392
  data: string;
3393
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
3393
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
3394
3394
  type: "base64";
3395
3395
  };
3396
3396
  } | {
@@ -3403,7 +3403,7 @@ export declare const safelyConvertToolChoiceToProvider: <TargetProviderSDK exten
3403
3403
  type: "image";
3404
3404
  source: {
3405
3405
  data: string;
3406
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
3406
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
3407
3407
  type: "base64";
3408
3408
  };
3409
3409
  })[];
@@ -3485,7 +3485,7 @@ export declare const safelyConvertToolChoiceToProvider: <TargetProviderSDK exten
3485
3485
  type: "image";
3486
3486
  source: {
3487
3487
  data: string;
3488
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
3488
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
3489
3489
  type: "base64";
3490
3490
  };
3491
3491
  text?: undefined;
@@ -14,7 +14,7 @@ export declare const openAIChatPartToAnthropic: import("zod").ZodPipe<import("zo
14
14
  type: "image";
15
15
  source: {
16
16
  data: string;
17
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
17
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
18
18
  type: "base64";
19
19
  };
20
20
  text?: undefined;
@@ -98,7 +98,7 @@ export declare const openAIMessageToAnthropic: import("zod").ZodPipe<import("zod
98
98
  type: "image";
99
99
  source: {
100
100
  data: string;
101
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
101
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
102
102
  type: "base64";
103
103
  };
104
104
  } | {
@@ -111,7 +111,7 @@ export declare const openAIMessageToAnthropic: import("zod").ZodPipe<import("zod
111
111
  type: "image";
112
112
  source: {
113
113
  data: string;
114
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
114
+ media_type: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
115
115
  type: "base64";
116
116
  };
117
117
  })[];
@@ -68,9 +68,9 @@ export declare const llmProviderMessageSchema: z.ZodUnion<readonly [z.ZodDiscrim
68
68
  source: z.ZodObject<{
69
69
  data: z.ZodString;
70
70
  media_type: z.ZodEnum<{
71
+ "image/gif": "image/gif";
71
72
  "image/jpeg": "image/jpeg";
72
73
  "image/png": "image/png";
73
- "image/gif": "image/gif";
74
74
  "image/webp": "image/webp";
75
75
  }>;
76
76
  type: z.ZodLiteral<"base64">;
@@ -91,9 +91,9 @@ export declare const llmProviderMessageSchema: z.ZodUnion<readonly [z.ZodDiscrim
91
91
  source: z.ZodObject<{
92
92
  data: z.ZodString;
93
93
  media_type: z.ZodEnum<{
94
+ "image/gif": "image/gif";
94
95
  "image/jpeg": "image/jpeg";
95
96
  "image/png": "image/png";
96
- "image/gif": "image/gif";
97
97
  "image/webp": "image/webp";
98
98
  }>;
99
99
  type: z.ZodLiteral<"base64">;
@@ -0,0 +1,20 @@
1
+ import type { TestResult } from "./state.js";
2
+ import type { AcceptanceCriterion, AcceptanceResult } from "./types.js";
3
+ /**
4
+ * Evaluate all configured aggregate acceptance rules against completed runs.
5
+ * @param params - Evaluation parameters.
6
+ * @param params.criteria - Aggregate rules configured on the suite.
7
+ * @param params.results - Completed test results in the suite.
8
+ */
9
+ export declare function evaluateAcceptanceCriteria({ criteria, results, }: {
10
+ criteria: readonly AcceptanceCriterion[] | undefined;
11
+ results: readonly TestResult[];
12
+ }): AcceptanceResult[];
13
+ /**
14
+ * Build one error containing every failed aggregate criterion.
15
+ * @param results - Computed acceptance results.
16
+ */
17
+ export declare function createAcceptanceFailureError(results: readonly AcceptanceResult[]): Error | undefined;
18
+ /** Format an acceptance result for reporters and thrown errors. */
19
+ export declare function formatAcceptanceResult(result: AcceptanceResult): string;
20
+ //# sourceMappingURL=acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../../src/testing/acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,SAAS,mBAAmB,EAAE,GAAG,SAAS,CAAC;IACrD,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CAChC,GAAG,gBAAgB,EAAE,CAOrB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,SAAS,gBAAgB,EAAE,GACnC,KAAK,GAAG,SAAS,CAWnB;AAED,mEAAmE;AACnE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAavE"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Evaluate all configured aggregate acceptance rules against completed runs.
3
+ * @param params - Evaluation parameters.
4
+ * @param params.criteria - Aggregate rules configured on the suite.
5
+ * @param params.results - Completed test results in the suite.
6
+ */
7
+ export function evaluateAcceptanceCriteria({ criteria, results, }) {
8
+ if (!criteria || criteria.length === 0) {
9
+ return [];
10
+ }
11
+ return criteria.map((criterion) => evaluateAcceptanceCriterion({ criterion, results }));
12
+ }
13
+ /**
14
+ * Build one error containing every failed aggregate criterion.
15
+ * @param results - Computed acceptance results.
16
+ */
17
+ export function createAcceptanceFailureError(results) {
18
+ const failedResults = results.filter((result) => !result.passed);
19
+ if (failedResults.length === 0) {
20
+ return undefined;
21
+ }
22
+ return new Error([
23
+ "Acceptance criteria failed:",
24
+ ...failedResults.map((result) => ` ${formatAcceptanceResult(result)}`),
25
+ ].join("\n"));
26
+ }
27
+ /** Format an acceptance result for reporters and thrown errors. */
28
+ export function formatAcceptanceResult(result) {
29
+ const status = result.passed ? "PASS" : "FAIL";
30
+ const value = result.value === null ? "n/a" : result.value.toFixed(3);
31
+ const sampleLabel = result.sampleCount === 1 ? "sample" : "samples";
32
+ let requirement;
33
+ if (result.metric === "average") {
34
+ const cmp = (result.direction ?? "maximize") === "minimize" ? "<=" : ">=";
35
+ requirement = `mean ${cmp} ${result.threshold.toFixed(3)}`;
36
+ }
37
+ else {
38
+ requirement = `pass rate >= ${result.minPassRate.toFixed(3)}`;
39
+ }
40
+ const reason = result.failureReason ? ` - ${result.failureReason}` : "";
41
+ return `${status} ${result.annotationName} ${result.metric} ${value} (need ${requirement}; ${result.sampleCount} ${sampleLabel})${reason}`;
42
+ }
43
+ function evaluateAcceptanceCriterion({ criterion, results, }) {
44
+ const annotations = collectAnnotations({ criterion, results });
45
+ if (criterion.metric === "average") {
46
+ // Only numeric / boolean scores can be averaged.
47
+ const scores = annotations
48
+ .map((annotation) => annotation.score)
49
+ .filter(isValidScore);
50
+ if (scores.length === 0) {
51
+ return {
52
+ ...criterion,
53
+ value: null,
54
+ sampleCount: 0,
55
+ passed: false,
56
+ failureReason: "no numeric or boolean scores found",
57
+ };
58
+ }
59
+ const direction = criterion.direction ?? "maximize";
60
+ const value = calculateAverage(scores);
61
+ return {
62
+ ...criterion,
63
+ value,
64
+ sampleCount: scores.length,
65
+ passed: meetsBar(value, criterion.threshold, direction),
66
+ };
67
+ }
68
+ // passRate: each run passes when `passFn` returns true for its annotation;
69
+ // the suite passes when the fraction of passing runs is at least
70
+ // `minPassRate`. The reported value is that fraction.
71
+ if (annotations.length === 0) {
72
+ return {
73
+ ...criterion,
74
+ value: null,
75
+ sampleCount: 0,
76
+ passed: false,
77
+ failureReason: "no matching annotations found",
78
+ };
79
+ }
80
+ const passed = annotations.filter((annotation) => criterion.passFn(annotation)).length;
81
+ const value = passed / annotations.length;
82
+ return {
83
+ ...criterion,
84
+ value,
85
+ sampleCount: annotations.length,
86
+ passed: value >= criterion.minPassRate,
87
+ };
88
+ }
89
+ /** Whether `value` clears `bar` in the given optimization direction. */
90
+ function meetsBar(value, bar, direction) {
91
+ return direction === "minimize" ? value <= bar : value >= bar;
92
+ }
93
+ /**
94
+ * The last annotation matching `annotationName` from each non-skipped run that
95
+ * logged it. One entry per run; runs that never logged the annotation are
96
+ * omitted.
97
+ */
98
+ function collectAnnotations({ criterion, results, }) {
99
+ return results
100
+ .filter((result) => result.status !== "skipped")
101
+ .map((result) => findLastAnnotation({
102
+ annotations: result.annotations,
103
+ annotationName: criterion.annotationName,
104
+ }))
105
+ .filter((annotation) => annotation !== undefined);
106
+ }
107
+ function findLastAnnotation({ annotations, annotationName, }) {
108
+ for (let annotationIndex = annotations.length - 1; annotationIndex >= 0; annotationIndex--) {
109
+ const annotation = annotations[annotationIndex];
110
+ if (annotation?.name === annotationName) {
111
+ return annotation;
112
+ }
113
+ }
114
+ return undefined;
115
+ }
116
+ function isValidScore(score) {
117
+ return (typeof score === "boolean" ||
118
+ (typeof score === "number" && Number.isFinite(score)));
119
+ }
120
+ function calculateAverage(scores) {
121
+ const total = scores
122
+ .map(scoreToNumber)
123
+ .reduce((sum, score) => sum + score, 0);
124
+ return total / scores.length;
125
+ }
126
+ function scoreToNumber(score) {
127
+ return typeof score === "boolean" ? (score ? 1 : 0) : score;
128
+ }
129
+ //# sourceMappingURL=acceptance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.js","sourceRoot":"","sources":["../../../src/testing/acceptance.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,C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