llm-testrunner-components 1.1.0 → 1.2.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 (82) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +165 -242
  3. package/dist/cjs/index.cjs.js +305 -237
  4. package/dist/cjs/index.cjs.js.map +1 -1
  5. package/dist/cjs/llm-testrunner.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/llm-test-runner/header/llm-test-runner-header.js +2 -2
  8. package/dist/collection/components/llm-test-runner/header/llm-test-runner-header.js.map +1 -1
  9. package/dist/collection/components/llm-test-runner/llm-test-runner.import-export.test.js +25 -54
  10. package/dist/collection/components/llm-test-runner/llm-test-runner.import-export.test.js.map +1 -1
  11. package/dist/collection/components/llm-test-runner/llm-test-runner.js +27 -49
  12. package/dist/collection/components/llm-test-runner/llm-test-runner.js.map +1 -1
  13. package/dist/collection/components/llm-test-runner/test-cases/evaluation/evaluation-summary.css +60 -21
  14. package/dist/collection/components/llm-test-runner/test-cases/evaluation/evaluation-summary.js +3 -1
  15. package/dist/collection/components/llm-test-runner/test-cases/evaluation/evaluation-summary.js.map +1 -1
  16. package/dist/collection/components/llm-test-runner/test-cases/expected-outcome-renderer.js +31 -11
  17. package/dist/collection/components/llm-test-runner/test-cases/expected-outcome-renderer.js.map +1 -1
  18. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.css +17 -0
  19. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.js +2 -12
  20. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.js.map +1 -1
  21. package/dist/collection/components/llm-test-runner/test-cases/llm-test-cases.js +2 -2
  22. package/dist/collection/components/llm-test-runner/test-cases/llm-test-cases.js.map +1 -1
  23. package/dist/collection/lib/evaluation/evaluation-engine.js +63 -42
  24. package/dist/collection/lib/evaluation/evaluation-engine.js.map +1 -1
  25. package/dist/collection/lib/evaluation/evaluation-service.js +15 -3
  26. package/dist/collection/lib/evaluation/evaluation-service.js.map +1 -1
  27. package/dist/collection/lib/evaluation/{rouge1-evaluator.test.js → evaluators/rouge1-evaluator.test.js} +2 -2
  28. package/dist/collection/lib/evaluation/evaluators/rouge1-evaluator.test.js.map +1 -0
  29. package/dist/collection/lib/evaluation/evaluators/semantic/SemanticEvaluator.js +4 -3
  30. package/dist/collection/lib/evaluation/evaluators/semantic/SemanticEvaluator.js.map +1 -1
  31. package/dist/collection/lib/evaluation/field-evaluation-approach.js +24 -0
  32. package/dist/collection/lib/evaluation/field-evaluation-approach.js.map +1 -0
  33. package/dist/collection/lib/evaluation/index.js +0 -4
  34. package/dist/collection/lib/evaluation/index.js.map +1 -1
  35. package/dist/collection/lib/evaluation/types.js.map +1 -1
  36. package/dist/collection/lib/import-export/test-results-csv.js +47 -33
  37. package/dist/collection/lib/import-export/test-results-csv.js.map +1 -1
  38. package/dist/collection/lib/import-export/test-suite-exporter.js +0 -1
  39. package/dist/collection/lib/import-export/test-suite-exporter.js.map +1 -1
  40. package/dist/collection/lib/test-cases/test-case-factory.js +17 -27
  41. package/dist/collection/lib/test-cases/test-case-factory.js.map +1 -1
  42. package/dist/collection/lib/test-cases/test-case-mutations.js +60 -9
  43. package/dist/collection/lib/test-cases/test-case-mutations.js.map +1 -1
  44. package/dist/collection/schemas/expected-outcome.js +20 -2
  45. package/dist/collection/schemas/expected-outcome.js.map +1 -1
  46. package/dist/collection/schemas/test-case.js +2 -20
  47. package/dist/collection/schemas/test-case.js.map +1 -1
  48. package/dist/collection/types/llm-test-runner.js.map +1 -1
  49. package/dist/collection/types/test-case.js.map +1 -1
  50. package/dist/components/index.js +1 -1
  51. package/dist/components/llm-test-runner.js +1 -1
  52. package/dist/components/p-JPMPoOC8.js +7 -0
  53. package/dist/components/p-JPMPoOC8.js.map +1 -0
  54. package/dist/esm/index.js +305 -237
  55. package/dist/esm/index.js.map +1 -1
  56. package/dist/esm/llm-testrunner.js +1 -1
  57. package/dist/esm/loader.js +1 -1
  58. package/dist/llm-testrunner/index.esm.js +2 -2
  59. package/dist/llm-testrunner/index.esm.js.map +1 -1
  60. package/dist/llm-testrunner/llm-testrunner.esm.js +1 -1
  61. package/dist/types/components/llm-test-runner/header/llm-test-runner-header.d.ts +1 -0
  62. package/dist/types/components/llm-test-runner/llm-test-runner.d.ts +1 -1
  63. package/dist/types/components/llm-test-runner/test-cases/expected-outcome-renderer.d.ts +3 -6
  64. package/dist/types/components/llm-test-runner/test-cases/llm-test-case-row.d.ts +0 -2
  65. package/dist/types/components/llm-test-runner/test-cases/llm-test-cases.d.ts +0 -2
  66. package/dist/types/components.d.ts +9 -0
  67. package/dist/types/lib/evaluation/evaluation-engine.d.ts +4 -2
  68. package/dist/types/lib/evaluation/field-evaluation-approach.d.ts +6 -0
  69. package/dist/types/lib/evaluation/index.d.ts +0 -1
  70. package/dist/types/lib/evaluation/types.d.ts +26 -0
  71. package/dist/types/lib/import-export/test-suite-exporter.d.ts +0 -4
  72. package/dist/types/lib/test-cases/test-case-factory.d.ts +2 -3
  73. package/dist/types/lib/test-cases/test-case-mutations.d.ts +21 -5
  74. package/dist/types/schemas/expected-outcome.d.ts +65 -17
  75. package/dist/types/schemas/test-case.d.ts +51 -95
  76. package/dist/types/types/llm-test-runner.d.ts +1 -1
  77. package/dist/types/types/test-case.d.ts +1 -1
  78. package/package.json +9 -2
  79. package/dist/collection/lib/evaluation/rouge1-evaluator.test.js.map +0 -1
  80. package/dist/components/p-BF90yb1z.js +0 -7
  81. package/dist/components/p-BF90yb1z.js.map +0 -1
  82. /package/dist/types/lib/evaluation/{rouge1-evaluator.test.d.ts → evaluators/rouge1-evaluator.test.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"expected-outcome.js","sourceRoot":"","sources":["../../src/schemas/expected-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE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'zod';\n\nconst nonEmptyString = z.string().trim().min(1);\nconst optionalPositiveInt = z.number().int().positive().optional();\nconst optionalString = z.string().optional();\nconst optionalBoolean = z.boolean().optional();\nconst selectOptionsSchema = z.array(nonEmptyString).min(1);\n\nconst defaultExpectedOutcomeBaseSchema = z.object({\n label: nonEmptyString,\n required: optionalBoolean,\n placeholder: optionalString,\n});\n\nconst createDefaultExpectedOutcomeFieldSchemas = (\n baseSchema: typeof defaultExpectedOutcomeBaseSchema,\n) => ({\n text: baseSchema.extend({\n type: z.literal('text'),\n }),\n textarea: baseSchema.extend({\n type: z.literal('textarea'),\n rows: optionalPositiveInt,\n }),\n chipsInput: baseSchema.extend({\n type: z.literal('chips-input'),\n }),\n select: baseSchema.extend({\n type: z.literal('select'),\n options: selectOptionsSchema,\n }),\n});\n\nfunction hasDuplicateChips(values: string[]): boolean {\n const seen = new Set<string>();\n for (const value of values) {\n const normalized = value.trim().toLowerCase();\n if (seen.has(normalized)) {\n return true;\n }\n seen.add(normalized);\n }\n return false;\n}\n\nconst defaultFieldDefinitions =\n createDefaultExpectedOutcomeFieldSchemas(defaultExpectedOutcomeBaseSchema);\n\nexport const expectedOutcomeSchemaFieldSchema = z.discriminatedUnion('type', [\n defaultFieldDefinitions.text,\n defaultFieldDefinitions.textarea,\n defaultFieldDefinitions.chipsInput,\n defaultFieldDefinitions.select,\n]);\n\nexport const expectedOutcomeSchemaSchema = z\n .array(expectedOutcomeSchemaFieldSchema)\n .min(1);\n\nexport const expectedOutcomeFieldSchema = z.discriminatedUnion('type', [\n defaultFieldDefinitions.text.extend({\n value: z.string(),\n }),\n defaultFieldDefinitions.textarea.extend({\n value: z.string(),\n }),\n defaultFieldDefinitions.chipsInput.extend({\n value: z.array(z.string()).superRefine((values, ctx) => {\n if (hasDuplicateChips(values)) {\n ctx.addIssue({\n code: 'custom',\n message:\n 'chips-input values must be unique (case-insensitive, trimmed).',\n });\n }\n }),\n }),\n defaultFieldDefinitions.select\n .extend({\n value: z.string(),\n })\n .superRefine((field, ctx) => {\n if (!field.options.includes(field.value)) {\n ctx.addIssue({\n code: 'custom',\n path: ['value'],\n message: 'select value must be one of the provided options.',\n });\n }\n }),\n]);\n\nexport const expectedOutcomeArraySchema = z.array(expectedOutcomeFieldSchema).min(1);\n\nexport type ExpectedOutcomeSchemaField = z.infer<\n typeof expectedOutcomeSchemaFieldSchema\n>;\nexport type ExpectedOutcomeSchema = z.infer<typeof expectedOutcomeSchemaSchema>;\nexport type ExpectedOutcomeField = z.infer<typeof expectedOutcomeFieldSchema>;\nexport type ExpectedOutcomeFieldType = ExpectedOutcomeField['type'];\nexport type ExpectedOutcomeBase = z.infer<typeof defaultExpectedOutcomeBaseSchema>;\n\nexport type TextExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'text' }\n>;\nexport type TextareaExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'textarea' }\n>;\nexport type ChipsExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'chips-input' }\n>;\nexport type SelectExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'select' }\n>;\n\nexport type TextExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'text' }\n>;\nexport type TextareaExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'textarea' }\n>;\nexport type ChipsExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'chips-input' }\n>;\nexport type SelectExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'select' }\n>;\n\nexport function validateExpectedOutcomeSchema(\n schema: unknown,\n): asserts schema is ExpectedOutcomeSchema {\n const parsed = expectedOutcomeSchemaSchema.safeParse(schema);\n if (!parsed.success) {\n throw new Error(\n `Invalid expectedOutcomeSchema: ${parsed.error.issues[0].message}`,\n );\n }\n}\n\nexport function validateExpectedOutcomeArray(\n expectedOutcome: unknown,\n): asserts expectedOutcome is ExpectedOutcomeField[] {\n const parsed = expectedOutcomeArraySchema.safeParse(expectedOutcome);\n if (!parsed.success) {\n throw new Error(`Invalid expectedOutcome: ${parsed.error.issues[0].message}`);\n }\n}\n"]}
1
+ {"version":3,"file":"expected-outcome.js","sourceRoot":"","sources":["../../src/schemas/expected-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AACnE,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC7C,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3D,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;IACpC,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAC;AAEH,MAAM,gCAAgC,GAAG,0BAA0B,CAAC,WAAW,CAC7E,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;IAClB,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,UAAU,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,EAAE,CAAC,CAAC,MAAM,EAAE;KAClB,CAAC;SACD,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACzC,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,CAAC;gBACf,OAAO,EAAE,mDAAmD;aAC7D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;CACL,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AA4CrF,MAAM,UAAU,6BAA6B,CAC3C,MAAe;IAEf,MAAM,MAAM,GAAG,2BAA2B,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,kCAAkC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CACnE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,eAAwB;IAExB,MAAM,MAAM,GAAG,0BAA0B,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACrE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;AACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { EvaluationApproach } from '../lib/evaluation/constants';\nimport { isApproachAllowedForFieldType } from '../lib/evaluation/field-evaluation-approach';\n\nconst nonEmptyString = z.string().trim().min(1);\nconst optionalPositiveInt = z.number().int().positive().optional();\nconst optionalString = z.string().optional();\nconst selectOptionsSchema = z.array(nonEmptyString).min(1);\nconst optionalNumber = z.number().optional();\n\nconst evaluationParametersSchema = z.object({\n approach: z.enum(EvaluationApproach),\n threshold: optionalNumber,\n});\n\nconst selectEvaluationParametersSchema = evaluationParametersSchema.superRefine(\n (parameters, ctx) => {\n if (!isApproachAllowedForFieldType('select', parameters.approach)) {\n ctx.addIssue({\n code: 'custom',\n path: ['approach'],\n message: `select fields only support \"${EvaluationApproach.EXACT}\" evaluation approach.`,\n });\n }\n },\n);\n\nconst defaultExpectedOutcomeBaseSchema = z.object({\n label: nonEmptyString,\n placeholder: optionalString,\n});\n\nconst createDefaultExpectedOutcomeFieldSchemas = (\n baseSchema: typeof defaultExpectedOutcomeBaseSchema,\n) => ({\n text: baseSchema.extend({\n type: z.literal('text'),\n evaluationParameters: evaluationParametersSchema.optional(),\n }),\n textarea: baseSchema.extend({\n type: z.literal('textarea'),\n rows: optionalPositiveInt,\n evaluationParameters: evaluationParametersSchema.optional(),\n }),\n chipsInput: baseSchema.extend({\n type: z.literal('chips-input'),\n evaluationParameters: evaluationParametersSchema.optional(),\n }),\n select: baseSchema.extend({\n type: z.literal('select'),\n options: selectOptionsSchema,\n evaluationParameters: selectEvaluationParametersSchema.optional(),\n }),\n});\n\nfunction hasDuplicateChips(values: string[]): boolean {\n const seen = new Set<string>();\n for (const value of values) {\n const normalized = value.trim().toLowerCase();\n if (seen.has(normalized)) {\n return true;\n }\n seen.add(normalized);\n }\n return false;\n}\n\nconst defaultFieldDefinitions =\n createDefaultExpectedOutcomeFieldSchemas(defaultExpectedOutcomeBaseSchema);\n\nexport const expectedOutcomeSchemaFieldSchema = z.discriminatedUnion('type', [\n defaultFieldDefinitions.text,\n defaultFieldDefinitions.textarea,\n defaultFieldDefinitions.chipsInput,\n defaultFieldDefinitions.select,\n]);\n\nexport const expectedOutcomeSchemaSchema = z\n .array(expectedOutcomeSchemaFieldSchema)\n .min(1);\n\nexport const expectedOutcomeFieldSchema = z.discriminatedUnion('type', [\n defaultFieldDefinitions.text.extend({\n value: z.string(),\n }),\n defaultFieldDefinitions.textarea.extend({\n value: z.string(),\n }),\n defaultFieldDefinitions.chipsInput.extend({\n value: z.array(z.string()).superRefine((values, ctx) => {\n if (hasDuplicateChips(values)) {\n ctx.addIssue({\n code: 'custom',\n message:\n 'chips-input values must be unique (case-insensitive, trimmed).',\n });\n }\n }),\n }),\n defaultFieldDefinitions.select\n .extend({\n value: z.string(),\n })\n .superRefine((field, ctx) => {\n if (!field.options.includes(field.value)) {\n ctx.addIssue({\n code: 'custom',\n path: ['value'],\n message: 'select value must be one of the provided options.',\n });\n }\n }),\n]);\n\nexport const expectedOutcomeArraySchema = z.array(expectedOutcomeFieldSchema).min(1);\n\nexport type ExpectedOutcomeSchemaField = z.infer<\n typeof expectedOutcomeSchemaFieldSchema\n>;\nexport type ExpectedOutcomeSchema = z.infer<typeof expectedOutcomeSchemaSchema>;\nexport type ExpectedOutcomeField = z.infer<typeof expectedOutcomeFieldSchema>;\nexport type ExpectedOutcomeFieldType = ExpectedOutcomeField['type'];\nexport type ExpectedOutcomeBase = z.infer<typeof defaultExpectedOutcomeBaseSchema>;\n\nexport type TextExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'text' }\n>;\nexport type TextareaExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'textarea' }\n>;\nexport type ChipsExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'chips-input' }\n>;\nexport type SelectExpectedOutcomeSchemaField = Extract<\n ExpectedOutcomeSchemaField,\n { type: 'select' }\n>;\n\nexport type TextExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'text' }\n>;\nexport type TextareaExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'textarea' }\n>;\nexport type ChipsExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'chips-input' }\n>;\nexport type SelectExpectedOutcomeField = Extract<\n ExpectedOutcomeField,\n { type: 'select' }\n>;\n\nexport function validateExpectedOutcomeSchema(\n schema: unknown,\n): asserts schema is ExpectedOutcomeSchema {\n const parsed = expectedOutcomeSchemaSchema.safeParse(schema);\n if (!parsed.success) {\n throw new Error(\n `Invalid expectedOutcomeSchema: ${parsed.error.issues[0].message}`,\n );\n }\n}\n\nexport function validateExpectedOutcomeArray(\n expectedOutcome: unknown,\n): asserts expectedOutcome is ExpectedOutcomeField[] {\n const parsed = expectedOutcomeArraySchema.safeParse(expectedOutcome);\n if (!parsed.success) {\n throw new Error(`Invalid expectedOutcome: ${parsed.error.issues[0].message}`);\n }\n}\n"]}
@@ -1,33 +1,15 @@
1
1
  import { z } from "zod";
2
- import { EvaluationApproach } from "../lib/evaluation/constants";
3
2
  import { expectedOutcomeArraySchema } from "./expected-outcome";
4
- export const evaluationParametersSchema = z.object({
5
- approach: z.enum(EvaluationApproach),
6
- threshold: z.number().optional(),
7
- });
8
- const baseTestCaseInputSchema = z.object({
3
+ export const testCaseInputSchema = z.object({
9
4
  id: z.string(),
10
5
  question: z.string(),
11
- evaluationParameters: evaluationParametersSchema.optional(),
12
- });
13
- export const legacyTestCaseInputSchema = baseTestCaseInputSchema.extend({
14
- expectedOutcome: z.string(),
15
- });
16
- export const v2TestCaseInputSchema = baseTestCaseInputSchema.extend({
17
6
  expectedOutcome: expectedOutcomeArraySchema,
18
7
  });
19
- export const testCaseInputSchema = z.union([
20
- legacyTestCaseInputSchema,
21
- v2TestCaseInputSchema,
22
- ]);
23
- export const testCaseInputArraySchema = z.array(testCaseInputSchema).min(1, {
24
- message: 'The test suite is empty. Please provide at least one test case.',
25
- });
8
+ export const testCaseInputArraySchema = z.array(testCaseInputSchema);
26
9
  export const testCaseSchema = z.object({
27
10
  id: z.string(),
28
11
  question: z.string(),
29
12
  expectedOutcome: expectedOutcomeArraySchema,
30
- evaluationParameters: evaluationParametersSchema.optional(),
31
13
  output: z.string().optional(),
32
14
  isRunning: z.boolean().optional(),
33
15
  error: z.string().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"test-case.js","sourceRoot":"","sources":["../../src/schemas/test-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,oBAAoB,EAAE,0BAA0B,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACtE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAClE,eAAe,EAAE,0BAA0B;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,yBAAyB;IACzB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;IAC1E,OAAO,EAAE,iEAAiE;CAC3E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,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sourcesContent":["import { z } from 'zod';\nimport { EvaluationApproach } from '../lib/evaluation/constants';\nimport type { EvaluationResult } from '../lib/evaluation/types';\nimport { expectedOutcomeArraySchema } from './expected-outcome';\n\nexport const evaluationParametersSchema = z.object({\n approach: z.enum(EvaluationApproach),\n threshold: z.number().optional(),\n});\n\nconst baseTestCaseInputSchema = z.object({\n id: z.string(),\n question: z.string(),\n evaluationParameters: evaluationParametersSchema.optional(),\n});\n\nexport const legacyTestCaseInputSchema = baseTestCaseInputSchema.extend({\n expectedOutcome: z.string(),\n});\n\nexport const v2TestCaseInputSchema = baseTestCaseInputSchema.extend({\n expectedOutcome: expectedOutcomeArraySchema,\n});\n\nexport const testCaseInputSchema = z.union([\n legacyTestCaseInputSchema,\n v2TestCaseInputSchema,\n]);\n\nexport const testCaseInputArraySchema = z.array(testCaseInputSchema).min(1, {\n message: 'The test suite is empty. Please provide at least one test case.',\n});\n\nexport const testCaseSchema = z.object({\n id: z.string(),\n question: z.string(),\n expectedOutcome: expectedOutcomeArraySchema,\n evaluationParameters: evaluationParametersSchema.optional(),\n output: z.string().optional(),\n isRunning: z.boolean().optional(),\n error: z.string().optional(),\n evaluationResult: z.custom<EvaluationResult>().optional(),\n responseTime: z.number().optional(),\n});\n\nexport type EvaluationParameters = z.infer<typeof evaluationParametersSchema>;\nexport type TestCaseInput = z.infer<typeof testCaseInputSchema>;\nexport type LegacyTestCaseInput = z.infer<typeof legacyTestCaseInputSchema>;\nexport type V2TestCaseInput = z.infer<typeof v2TestCaseInputSchema>;\nexport type TestCase = z.infer<typeof testCaseSchema>;\n\nexport function validateTestCaseInput(\n data: unknown,\n): asserts data is TestCaseInput {\n const parsed = testCaseInputSchema.safeParse(data);\n if (!parsed.success) {\n throw new Error(`Invalid test case input: ${parsed.error.issues[0].message}`);\n }\n}\n\nexport function validateTestCaseInputArray(\n data: unknown,\n): asserts data is TestCaseInput[] {\n const parsed = testCaseInputArraySchema.safeParse(data);\n if (!parsed.success) {\n const firstIssue = parsed.error.issues[0];\n const message =\n firstIssue.code === 'invalid_type'\n ? 'Invalid JSON structure. Expected a JSON array.'\n : firstIssue.message;\n throw new Error(message);\n }\n}\n"]}
1
+ {"version":3,"file":"test-case.js","sourceRoot":"","sources":["../../src/schemas/test-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,eAAe,EAAE,0BAA0B;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,eAAe,EAAE,0BAA0B;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAoB,CAAC,QAAQ,EAAE;IACzD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAKH,MAAM,UAAU,qBAAqB,CACnC,IAAa;IAEb,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,IAAa;IAEb,MAAM,MAAM,GAAG,wBAAwB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,OAAO,GACX,UAAU,CAAC,IAAI,KAAK,cAAc;YAChC,CAAC,CAAC,gDAAgD;YAClD,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport type { EvaluationResult } from '../lib/evaluation/types';\nimport { expectedOutcomeArraySchema } from './expected-outcome';\n\nexport const testCaseInputSchema = z.object({\n id: z.string(),\n question: z.string(),\n expectedOutcome: expectedOutcomeArraySchema,\n});\n\nexport const testCaseInputArraySchema = z.array(testCaseInputSchema);\n\nexport const testCaseSchema = z.object({\n id: z.string(),\n question: z.string(),\n expectedOutcome: expectedOutcomeArraySchema,\n output: z.string().optional(),\n isRunning: z.boolean().optional(),\n error: z.string().optional(),\n evaluationResult: z.custom<EvaluationResult>().optional(),\n responseTime: z.number().optional(),\n});\n\nexport type TestCaseInput = z.infer<typeof testCaseInputSchema>;\nexport type TestCase = z.infer<typeof testCaseSchema>;\n\nexport function validateTestCaseInput(\n data: unknown,\n): asserts data is TestCaseInput {\n const parsed = testCaseInputSchema.safeParse(data);\n if (!parsed.success) {\n throw new Error(`Invalid test case input: ${parsed.error.issues[0].message}`);\n }\n}\n\nexport function validateTestCaseInputArray(\n data: unknown,\n): asserts data is TestCaseInput[] {\n const parsed = testCaseInputArraySchema.safeParse(data);\n if (!parsed.success) {\n const firstIssue = parsed.error.issues[0];\n const message =\n firstIssue.code === 'invalid_type'\n ? 'Invalid JSON structure. Expected a JSON array.'\n : firstIssue.message;\n throw new Error(message);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"llm-test-runner.js","sourceRoot":"","sources":["../../src/types/llm-test-runner.ts"],"names":[],"mappings":"","sourcesContent":["import type { TestCase } from './test-case';\n\nexport type {\n ExpectedOutcomeFieldType,\n ExpectedOutcomeBase,\n ExpectedOutcomeSchema,\n ExpectedOutcomeSchemaField,\n ExpectedOutcomeField,\n TextExpectedOutcomeSchemaField,\n TextareaExpectedOutcomeSchemaField,\n ChipsExpectedOutcomeSchemaField,\n SelectExpectedOutcomeSchemaField,\n TextExpectedOutcomeField,\n TextareaExpectedOutcomeField,\n ChipsExpectedOutcomeField,\n SelectExpectedOutcomeField,\n} from './expected-outcome';\nexport type {\n TestCase,\n TestCaseInput,\n LegacyTestCaseInput,\n V2TestCaseInput,\n} from './test-case';\n\nexport interface LLMRequestPayload {\n prompt: string;\n resolve: (result: string) => void;\n reject: (err: Error | unknown) => void;\n}\n\nexport interface SavePayload {\n timestamp: string;\n testCases: TestCase[];\n}\n"]}
1
+ {"version":3,"file":"llm-test-runner.js","sourceRoot":"","sources":["../../src/types/llm-test-runner.ts"],"names":[],"mappings":"","sourcesContent":["import type { TestCase } from './test-case';\n\nexport type {\n ExpectedOutcomeFieldType,\n ExpectedOutcomeBase,\n ExpectedOutcomeSchema,\n ExpectedOutcomeSchemaField,\n ExpectedOutcomeField,\n TextExpectedOutcomeSchemaField,\n TextareaExpectedOutcomeSchemaField,\n ChipsExpectedOutcomeSchemaField,\n SelectExpectedOutcomeSchemaField,\n TextExpectedOutcomeField,\n TextareaExpectedOutcomeField,\n ChipsExpectedOutcomeField,\n SelectExpectedOutcomeField,\n} from './expected-outcome';\nexport type {\n TestCase,\n TestCaseInput,\n} from './test-case';\n\nexport interface LLMRequestPayload {\n prompt: string;\n resolve: (result: string) => void;\n reject: (err: Error | unknown) => void;\n}\n\nexport interface SavePayload {\n timestamp: string;\n testCases: TestCase[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"test-case.js","sourceRoot":"","sources":["../../src/types/test-case.ts"],"names":[],"mappings":"","sourcesContent":["export type {\n EvaluationParameters,\n TestCaseInput,\n LegacyTestCaseInput,\n V2TestCaseInput,\n TestCase,\n} from '../schemas/test-case';\n"]}
1
+ {"version":3,"file":"test-case.js","sourceRoot":"","sources":["../../src/types/test-case.ts"],"names":[],"mappings":"","sourcesContent":["export type {\n TestCaseInput,\n TestCase,\n} from '../schemas/test-case';\n"]}
@@ -1,2 +1,2 @@
1
- import{G as t}from"./p-D9BrlHdP.js";export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-D9BrlHdP.js";export{L as LLMTestRunner}from"./p-BF90yb1z.js";class e{sdk;constructor(s){this.sdk=new t({apiKey:s})}async invoke(s){const t=await this.sdk.models.generateContent({model:"gemini-3-flash-preview",contents:s});return t.text}}function n(){window.env={API_KEY:""};window.GeminiAdapter=e}const o=n||(()=>{});const i=o;i();
1
+ import{G as t}from"./p-D9BrlHdP.js";export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-D9BrlHdP.js";export{L as LLMTestRunner}from"./p-JPMPoOC8.js";class e{sdk;constructor(s){this.sdk=new t({apiKey:s})}async invoke(s){const t=await this.sdk.models.generateContent({model:"gemini-3-flash-preview",contents:s});return t.text}}function o(){window.env={API_KEY:""};window.GeminiAdapter=e}const n=o||(()=>{});const i=n;i();
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{L as o,d as s}from"./p-BF90yb1z.js";const t=o;const p=s;export{t as LlmTestRunner,p as defineCustomElement};
1
+ import{L as o,d as s}from"./p-JPMPoOC8.js";const t=o;const p=s;export{t as LlmTestRunner,p as defineCustomElement};
2
2
  //# sourceMappingURL=llm-test-runner.js.map