llm-testrunner-components 1.0.0 → 1.0.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 (103) hide show
  1. package/README.md +139 -81
  2. package/dist/cjs/{index-CCrH7f-W.js → index-CY2lQip_.js} +190 -33
  3. package/dist/cjs/index-CY2lQip_.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +391 -5
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/llm-test-runner.cjs.entry.js +9 -0
  7. package/dist/cjs/llm-test-runner.entry.cjs.js.map +1 -0
  8. package/dist/cjs/{llm-testrunner-components.cjs.js → llm-testrunner.cjs.js} +5 -7
  9. package/dist/cjs/llm-testrunner.cjs.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +2 -4
  11. package/dist/collection/collection-manifest.json +3 -4
  12. package/dist/collection/components/error-message/error-message.js +8 -0
  13. package/dist/collection/components/error-message/error-message.js.map +1 -0
  14. package/dist/collection/components/llm-test-runner/llm-test-runner.css +671 -0
  15. package/dist/collection/components/llm-test-runner/llm-test-runner.js +310 -0
  16. package/dist/collection/components/llm-test-runner/llm-test-runner.js.map +1 -0
  17. package/dist/collection/index.js +4 -10
  18. package/dist/collection/index.js.map +1 -1
  19. package/dist/collection/lib/evaluation/evaluation-engine.js +61 -0
  20. package/dist/collection/lib/evaluation/evaluation-engine.js.map +1 -0
  21. package/dist/collection/lib/evaluation/index.js +7 -0
  22. package/dist/collection/lib/evaluation/index.js.map +1 -0
  23. package/dist/collection/lib/evaluation/types.js +2 -0
  24. package/dist/collection/lib/evaluation/types.js.map +1 -0
  25. package/dist/components/index.js +1652 -4
  26. package/dist/components/index.js.map +1 -1
  27. package/dist/components/{current-time.d.ts → llm-test-runner.d.ts} +4 -4
  28. package/dist/components/llm-test-runner.js +9 -0
  29. package/dist/components/llm-test-runner.js.map +1 -0
  30. package/dist/esm/{index-0jlGA6MK.js → index-DBp-rMPb.js} +190 -33
  31. package/dist/esm/index-DBp-rMPb.js.map +1 -0
  32. package/dist/esm/index.js +391 -5
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/llm-test-runner.entry.js +3 -0
  35. package/dist/esm/llm-test-runner.entry.js.map +1 -0
  36. package/dist/esm/{llm-testrunner-components.js → llm-testrunner.js} +5 -7
  37. package/dist/esm/llm-testrunner.js.map +1 -0
  38. package/dist/esm/loader.js +3 -5
  39. package/dist/llm-testrunner/index.esm.js +2 -0
  40. package/dist/llm-testrunner/index.esm.js.map +1 -0
  41. package/dist/llm-testrunner/llm-test-runner.entry.esm.js.map +1 -0
  42. package/dist/llm-testrunner/llm-testrunner.esm.js +2 -0
  43. package/dist/llm-testrunner/llm-testrunner.esm.js.map +1 -0
  44. package/dist/llm-testrunner/p-DBp-rMPb.js +3 -0
  45. package/dist/llm-testrunner/p-DBp-rMPb.js.map +1 -0
  46. package/dist/llm-testrunner/p-ed2ea423.entry.js +2 -0
  47. package/dist/llm-testrunner/p-ed2ea423.entry.js.map +1 -0
  48. package/dist/react/components.d.ts +9 -0
  49. package/dist/react/components.d.ts.map +1 -0
  50. package/dist/react/components.js +12 -0
  51. package/dist/react/index.d.ts +2 -0
  52. package/dist/react/index.d.ts.map +1 -0
  53. package/dist/react/index.js +2 -0
  54. package/dist/types/components/error-message/error-message.d.ts +7 -0
  55. package/dist/types/components/llm-test-runner/llm-test-runner.d.ts +42 -0
  56. package/dist/types/components.d.ts +11 -46
  57. package/dist/types/index.d.ts +2 -10
  58. package/dist/types/lib/evaluation/evaluation-engine.d.ts +8 -0
  59. package/dist/types/lib/evaluation/index.d.ts +5 -0
  60. package/dist/types/lib/evaluation/types.d.ts +23 -0
  61. package/dist/types/stencil-public-runtime.d.ts +41 -3
  62. package/package.json +33 -12
  63. package/dist/cjs/current-time.my-component.entry.cjs.js.map +0 -1
  64. package/dist/cjs/current-time_2.cjs.entry.js +0 -67
  65. package/dist/cjs/current-time_2.cjs.entry.js.map +0 -1
  66. package/dist/cjs/index-CCrH7f-W.js.map +0 -1
  67. package/dist/cjs/llm-testrunner-components.cjs.js.map +0 -1
  68. package/dist/collection/components/my-component/current-time.js +0 -35
  69. package/dist/collection/components/my-component/current-time.js.map +0 -1
  70. package/dist/collection/components/my-component/my-component.css +0 -3
  71. package/dist/collection/components/my-component/my-component.js +0 -96
  72. package/dist/collection/components/my-component/my-component.js.map +0 -1
  73. package/dist/collection/utils/utils.js +0 -4
  74. package/dist/collection/utils/utils.js.map +0 -1
  75. package/dist/components/current-time.js +0 -9
  76. package/dist/components/current-time.js.map +0 -1
  77. package/dist/components/my-component.d.ts +0 -11
  78. package/dist/components/my-component.js +0 -63
  79. package/dist/components/my-component.js.map +0 -1
  80. package/dist/components/p-CbvWSaCI.js +0 -53
  81. package/dist/components/p-CbvWSaCI.js.map +0 -1
  82. package/dist/components/p-DnDi6fKi.js +0 -1101
  83. package/dist/components/p-DnDi6fKi.js.map +0 -1
  84. package/dist/esm/current-time.my-component.entry.js.map +0 -1
  85. package/dist/esm/current-time_2.entry.js +0 -64
  86. package/dist/esm/current-time_2.entry.js.map +0 -1
  87. package/dist/esm/index-0jlGA6MK.js.map +0 -1
  88. package/dist/esm/llm-testrunner-components.js.map +0 -1
  89. package/dist/llm-testrunner-components/current-time.my-component.entry.esm.js.map +0 -1
  90. package/dist/llm-testrunner-components/index.esm.js +0 -2
  91. package/dist/llm-testrunner-components/index.esm.js.map +0 -1
  92. package/dist/llm-testrunner-components/llm-testrunner-components.esm.js +0 -2
  93. package/dist/llm-testrunner-components/llm-testrunner-components.esm.js.map +0 -1
  94. package/dist/llm-testrunner-components/p-0jlGA6MK.js +0 -3
  95. package/dist/llm-testrunner-components/p-0jlGA6MK.js.map +0 -1
  96. package/dist/llm-testrunner-components/p-15e5e0fe.entry.js +0 -2
  97. package/dist/llm-testrunner-components/p-15e5e0fe.entry.js.map +0 -1
  98. package/dist/types/components/my-component/current-time.d.ts +0 -7
  99. package/dist/types/components/my-component/my-component.d.ts +0 -16
  100. package/dist/types/utils/utils.d.ts +0 -1
  101. /package/dist/{llm-testrunner-components → llm-testrunner}/loader.esm.js.map +0 -0
  102. /package/dist/{llm-testrunner-components → llm-testrunner}/p-DQuL1Twl.js +0 -0
  103. /package/dist/{llm-testrunner-components → llm-testrunner}/p-DQuL1Twl.js.map +0 -0
@@ -1,10 +1,396 @@
1
1
  'use strict';
2
2
 
3
- function format(first, middle, last) {
4
- return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ var index = require('./index-CY2lQip_.js');
4
+
5
+ class LLMEvaluationEngine {
6
+ constructor() { }
7
+ async evaluateResponse(request, callback) {
8
+ try {
9
+ console.log('🔍 Starting evaluation for test case:', request.testCaseId);
10
+ const result = await this.performEvaluation(request);
11
+ console.log('Evaluation completed for test case:', request.testCaseId);
12
+ console.log('Result:', result);
13
+ callback(result);
14
+ }
15
+ catch (error) {
16
+ console.error('Evaluation failed:', error);
17
+ const errorResult = {
18
+ testCaseId: request.testCaseId,
19
+ passed: false,
20
+ keywordMatches: [],
21
+ sourceLinkMatches: [],
22
+ timestamp: new Date().toISOString()
23
+ };
24
+ callback(errorResult);
25
+ }
26
+ }
27
+ async performEvaluation(request) {
28
+ const { testCaseId, expectedKeywords, expectedSourceLinks, actualResponse } = request;
29
+ const keywordMatches = this.evaluateKeywords(expectedKeywords, actualResponse);
30
+ const sourceLinkMatches = this.evaluateSourceLinks(expectedSourceLinks, actualResponse);
31
+ // Test passes only if ALL expected keywords and source links are found
32
+ const totalItems = keywordMatches.length + sourceLinkMatches.length;
33
+ const foundItems = keywordMatches.filter(m => m.found).length + sourceLinkMatches.filter(m => m.found).length;
34
+ const passed = foundItems === totalItems;
35
+ return {
36
+ testCaseId,
37
+ passed,
38
+ keywordMatches,
39
+ sourceLinkMatches,
40
+ timestamp: new Date().toISOString()
41
+ };
42
+ }
43
+ evaluateKeywords(expectedKeywords, actualResponse) {
44
+ // Case-insensitive keyword matching
45
+ const response = actualResponse.toLowerCase();
46
+ return expectedKeywords.map(keyword => {
47
+ const keywordToMatch = keyword.toLowerCase();
48
+ const found = response.includes(keywordToMatch);
49
+ return {
50
+ keyword,
51
+ found
52
+ };
53
+ });
54
+ }
55
+ evaluateSourceLinks(expectedSourceLinks, actualResponse) {
56
+ return expectedSourceLinks.map(link => {
57
+ const found = actualResponse.includes(link);
58
+ return {
59
+ link,
60
+ found
61
+ };
62
+ });
63
+ }
5
64
  }
6
65
 
7
- exports.format = format;
8
- //# sourceMappingURL=index.cjs.js.map
66
+ /**
67
+ * Convert array of 16 byte values to UUID string format of the form:
68
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
69
+ */
70
+ var byteToHex = [];
71
+ for (var i = 0; i < 256; ++i) {
72
+ byteToHex.push((i + 0x100).toString(16).slice(1));
73
+ }
74
+ function unsafeStringify(arr, offset = 0) {
75
+ // Note: Be careful editing this code! It's been tuned for performance
76
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
77
+ //
78
+ // Note to future-self: No, you can't remove the `toLowerCase()` call.
79
+ // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
80
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
81
+ }
82
+
83
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
84
+ // require the crypto API and do not support built-in fallback to lower quality random number
85
+ // generators (like Math.random()).
86
+
87
+ var getRandomValues;
88
+ var rnds8 = new Uint8Array(16);
89
+ function rng() {
90
+ // lazy load so that environments that need to polyfill have a chance to do so
91
+ if (!getRandomValues) {
92
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
93
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
94
+ if (!getRandomValues) {
95
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
96
+ }
97
+ }
98
+ return getRandomValues(rnds8);
99
+ }
100
+
101
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
102
+ var native = {
103
+ randomUUID
104
+ };
9
105
 
10
- //# sourceMappingURL=index.cjs.js.map
106
+ function v4(options, buf, offset) {
107
+ if (native.randomUUID && true && !options) {
108
+ return native.randomUUID();
109
+ }
110
+ options = options || {};
111
+ var rnds = options.random || (options.rng || rng)();
112
+
113
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
114
+ rnds[6] = rnds[6] & 0x0f | 0x40;
115
+ rnds[8] = rnds[8] & 0x3f | 0x80;
116
+ return unsafeStringify(rnds);
117
+ }
118
+
119
+ const ErrorMessage = ({ message, onClear }) => {
120
+ if (!message) {
121
+ return null;
122
+ }
123
+ return (index.h("div", { class: "error-message" }, index.h("span", null, message), onClear && (index.h("button", { class: "error-close", title: "Close", onClick: onClear }, "\u00D7"))));
124
+ };
125
+
126
+ const llmTestRunnerCss = ":host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n background-color: #f8fafc;\n min-height: 100vh;\n}\n\n.test-runner-container {\n padding: 20px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n margin: 20px 0;\n}\n\n.simple-test {\n margin: 20px 0;\n padding: 20px;\n border: 1px solid #ddd;\n border-radius: 4px;\n}\n\n.test-cases {\n margin: 20px 0;\n}\n\n.test-case {\n margin: 20px 0;\n padding: 20px;\n border: 1px solid #eee;\n border-radius: 4px;\n background: #f9f9f9;\n}\n\n.test-case h3 {\n margin-top: 0;\n color: #333;\n}\n\n.test-case textarea {\n width: 100%;\n padding: 10px;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-family: inherit;\n margin: 10px 0;\n}\n\n.test-case button {\n background: #007bff;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 4px;\n cursor: pointer;\n margin: 10px 5px 10px 0;\n}\n\n.test-case button:disabled {\n background: #ccc;\n cursor: not-allowed;\n}\n\n.output, .error {\n margin: 10px 0;\n padding: 10px;\n border-radius: 4px;\n}\n\n.output {\n background: #d4edda;\n border: 1px solid #c3e6cb;\n color: #155724;\n}\n\n.error {\n background: #f8d7da;\n border: 1px solid #f5c6cb;\n color: #721c24;\n}\n\n.test-runner-container {\n max-width: 1400px;\n margin: 0 auto;\n background: white;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);\n}\n\n/* Header Styles */\n.test-runner-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 20px 24px;\n background: /*linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/ white;\n color: white;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n}\n\n.header-left, .header-right {\n display: flex;\n gap: 12px;\n align-items: center;\n}\n\n.header-center {\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.api-status {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.api-status-text {\n color: #28a745;\n font-weight: 500;\n font-size: 0.9rem;\n}\n\n/* Button Styles */\n.btn {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 10px 16px;\n border: none;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n text-decoration: none;\n position: relative;\n}\n\n.btn:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n transform: none !important;\n}\n\n.btn-primary {\n color: black;\n box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);\n}\n\n.btn-primary:hover:not(:disabled) {\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);\n}\n\n.btn-secondary {\n background: rgba(255, 255, 255, 0.2);\n color: blue;\n border: 1px solid rgba(255, 255, 255, 0.3);\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: rgba(255, 255, 255, 0.3);\n transform: translateY(-1px);\n}\n\n.btn-outline {\n background: transparent;\n color: #6b7280;\n border: 2px solid #e5e7eb;\n}\n\n.btn-outline:hover {\n background: #f9fafb;\n border-color: #d1d5db;\n transform: translateY(-1px);\n}\n\n.btn-icon {\n padding: 8px;\n min-width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n}\n\n.btn-run {\n color: white;\n}\n\n.btn-run:hover:not(:disabled) {\n transform: translateY(-1px);\n}\n\n.btn-delete {\n color: white;\n}\n\n.btn-delete:hover:not(:disabled) {\n transform: translateY(-1px);\n}\n\n.icon {\n font-size: 16px;\n}\n\n/* Main Content */\n.test-runner-content {\n padding: 0;\n}\n\n/* Column Headers */\n.column-headers {\n display: grid;\n grid-template-columns: 1fr 1.5fr 0.5fr 120px;\n gap: 1px;\n background: #e5e7eb;\n border-bottom: 2px solid #d1d5db;\n}\n\n.column-header {\n background: #f8fafc;\n padding: 16px 20px;\n font-weight: 600;\n color: #374151;\n font-size: 14px;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n/* Test Cases */\n.test-cases {\n background: white;\n}\n\n.test-case-row {\n display: grid;\n grid-template-columns: 1fr 1.5fr 0.5fr 120px;\n gap: 1px;\n border-bottom: 1px solid #e5e7eb;\n min-height: 200px;\n}\n\n.test-case-row:hover {\n background: #f9fafb;\n}\n\n/* Input Column */\n.input-column {\n padding: 20px;\n background: white;\n border-right: 1px solid #e5e7eb;\n}\n\n.input-group {\n margin-bottom: 16px;\n}\n\n.input-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #374151;\n font-size: 14px;\n}\n\n.input-group textarea {\n width: 95%;\n padding: 12px;\n border: 2px solid #e5e7eb;\n border-radius: 8px;\n font-size: 14px;\n resize: vertical;\n outline: none;\n transition: border-color 0.2s ease;\n font-family: inherit;\n}\n\n.input-group textarea:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);\n}\n\n/* Keywords and Links */\n.keywords-group, .links-group {\n margin-bottom: 16px;\n}\n\n.keywords-group label, .links-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #374151;\n font-size: 14px;\n}\n\n.tags-container, .links-container {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n align-items: center;\n}\n\n.tag {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: #dbeafe;\n color: #1e40af;\n padding: 4px 8px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n}\n\n.tag-remove {\n background: none;\n border: none;\n color: #1e40af;\n cursor: pointer;\n font-size: 14px;\n padding: 0;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n}\n\n.tag-remove:hover {\n background: rgba(30, 64, 175, 0.1);\n}\n\n.link-item {\n display: flex;\n align-items: center;\n gap: 6px;\n background: #f0f9ff;\n padding: 4px 8px;\n border-radius: 6px;\n font-size: 12px;\n}\n\n.link-item a {\n color: #0369a1;\n text-decoration: none;\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.link-item a:hover {\n text-decoration: underline;\n}\n\n.link-remove {\n background: none;\n border: none;\n color: #0369a1;\n cursor: pointer;\n font-size: 12px;\n padding: 0;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n}\n\n.link-remove:hover {\n background: rgba(3, 105, 161, 0.1);\n}\n\n.tags-container input, .links-container input {\n border: 1px solid #d1d5db;\n border-radius: 6px;\n padding: 6px 8px;\n font-size: 12px;\n outline: none;\n min-width: 120px;\n}\n\n.tags-container input:focus, .links-container input:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);\n}\n\n/* Output Column */\n.output-column {\n padding: 20px;\n background: white;\n border-right: 1px solid #e5e7eb;\n display: flex;\n flex-direction: column;\n}\n\n.output-content {\n background: #f8fafc;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 16px;\n font-size: 14px;\n line-height: 1.6;\n color: #374151;\n white-space: pre-wrap;\n word-wrap: break-word;\n flex: 1;\n overflow-y: auto;\n max-height: 250px;\n overflow-x: scroll;\n}\n\n.output-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9ca3af;\n font-style: italic;\n flex: 1;\n background: #f9fafb;\n border: 2px dashed #d1d5db;\n border-radius: 8px;\n}\n\n/* Evaluation Column */\n.evaluation-column {\n padding: 20px;\n background: white;\n border-right: 1px solid #e5e7eb;\n display: flex;\n flex-direction: column;\n}\n\n.evaluation-content {\n display: flex;\n flex-direction: column;\n gap: 12px;\n flex: 1;\n}\n\n.score-display {\n text-align: center;\n}\n\n.score-number {\n font-size: 24px;\n font-weight: 700;\n color: #111827;\n display: block;\n margin-bottom: 8px;\n}\n\n.score-bar {\n width: 100%;\n height: 8px;\n background: #e5e7eb;\n border-radius: 4px;\n overflow: hidden;\n}\n\n.score-fill {\n height: 100%;\n background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);\n transition: width 0.3s ease;\n}\n\n.evaluation-details {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.detail-item {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 14px;\n}\n\n.status {\n width: 20px;\n height: 20px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: bold;\n}\n\n.status.pass {\n background: #dcfce7;\n color: #166534;\n}\n\n.status.fail {\n background: #fef2f2;\n color: #dc2626;\n}\n\n.evaluation-text {\n font-size: 12px;\n color: #6b7280;\n line-height: 1.4;\n background: #f9fafb;\n padding: 8px;\n border-radius: 6px;\n border: 1px solid #e5e7eb;\n}\n\n.evaluation-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9ca3af;\n font-style: italic;\n flex: 1;\n background: #f9fafb;\n border: 2px dashed #d1d5db;\n border-radius: 8px;\n}\n\n/* New evaluation result styles */\n.evaluation-result {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.evaluation-status {\n font-weight: 600;\n font-size: 14px;\n padding: 8px 12px;\n border-radius: 4px;\n text-align: center;\n}\n\n.evaluation-status.passed {\n background: #d4edda;\n color: #155724;\n border: 1px solid #c3e6cb;\n}\n\n.evaluation-status.failed {\n background: #f8d7da;\n color: #721c24;\n border: 1px solid #f5c6cb;\n}\n\n.evaluation-score {\n font-size: 12px;\n color: #495057;\n text-align: center;\n font-weight: 500;\n}\n\n.evaluation-feedback {\n font-size: 12px;\n color: #6c757d;\n background: #f8f9fa;\n padding: 8px;\n border-radius: 4px;\n border: 1px solid #dee2e6;\n}\n\n/* Actions Column */\n.actions-column {\n padding: 20px;\n background: white;\n display: flex;\n flex-direction: column;\n gap: 12px;\n align-items: center;\n justify-content: flex-start;\n align-self: flex-start;\n}\n\n/* Add Test Case */\n.add-test-case {\n padding: 24px;\n text-align: center;\n background: #f9fafb;\n border-top: 1px solid #e5e7eb;\n}\n\n.hidden {\n display: none;\n}\n\n.error-message {\n background: #ffeaea;\n color: #b71c1c;\n border: 1px solid #f44336;\n padding: 0.75em 2.5em 0.75em 1em;\n border-radius: 4px;\n margin: 1em 0;\n position: relative;\n font-size: 1em;\n display: flex;\n align-items: center;\n gap: 1em;\n}\n\n.error-close {\n background: none;\n border: none;\n color: #b71c1c;\n font-size: 1.25em;\n font-weight: bold;\n cursor: pointer;\n position: absolute;\n right: 0.75em;\n top: 50%;\n transform: translateY(-50%);\n line-height: 1;\n padding: 0;\n}\n\n/* Responsive Design */\n@media (max-width: 1200px) {\n .test-case-row {\n grid-template-columns: 1fr;\n gap: 0;\n }\n \n .column-headers {\n display: none;\n }\n \n .input-column, .output-column, .evaluation-column, .actions-column {\n border-right: none;\n border-bottom: 1px solid #e5e7eb;\n }\n \n .actions-column {\n flex-direction: row;\n justify-content: center;\n }\n}\n\n@media (max-width: 768px) {\n .test-runner-header {\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n }\n \n .header-left, .header-right {\n flex-wrap: wrap;\n justify-content: center;\n }\n \n .btn {\n font-size: 12px;\n padding: 8px 12px;\n }\n \n .input-column, .output-column, .evaluation-column, .actions-column {\n padding: 16px;\n }\n \n .test-case-row {\n min-height: auto;\n }\n}";
127
+
128
+ const LLMTestRunner = class {
129
+ constructor(hostRef) {
130
+ index.registerInstance(this, hostRef);
131
+ }
132
+ apiKey;
133
+ testCases = [
134
+ {
135
+ id: '1',
136
+ question: '',
137
+ expectedKeywords: [],
138
+ expectedSourceLinks: [],
139
+ isRunning: false
140
+ }
141
+ ];
142
+ isRunningAll = false;
143
+ error = '';
144
+ fileInput;
145
+ isExportingTestSuite = false;
146
+ evaluationEngine;
147
+ apiUrl = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent';
148
+ async componentWillLoad() {
149
+ this.evaluationEngine = new LLMEvaluationEngine();
150
+ console.log('🔍 componentWillLoad - apiKey:', this.apiKey ? 'SET' : 'NOT SET');
151
+ console.log('🔍 componentWillLoad - apiKey value:', this.apiKey);
152
+ if (!this.apiKey) {
153
+ throw new Error('API key is required. Please provide the apiKey prop: <llm-test-runner apiKey="your-api-key" />');
154
+ }
155
+ }
156
+ componentDidLoad() {
157
+ }
158
+ disconnectedCallback() {
159
+ }
160
+ addNewTestCase() {
161
+ const newTestCase = {
162
+ id: this.generateId(),
163
+ question: '',
164
+ expectedKeywords: [],
165
+ expectedSourceLinks: [],
166
+ isRunning: false
167
+ };
168
+ this.testCases = [...this.testCases, newTestCase];
169
+ }
170
+ updateTestCase(id, updates) {
171
+ this.testCases = this.testCases.map(tc => tc.id === id ? { ...tc, ...updates } : tc);
172
+ }
173
+ async runSingleTest(testCase) {
174
+ console.log('🚀 Starting test for question:', testCase.question);
175
+ this.updateTestCase(testCase.id, { isRunning: true });
176
+ try {
177
+ const aiResponse = await this.callGeminiAPI(testCase.question);
178
+ console.log('✅ AI call completed for test case:', testCase.id);
179
+ this.updateTestCase(testCase.id, {
180
+ isRunning: false,
181
+ output: aiResponse,
182
+ error: null
183
+ });
184
+ await this.evaluateResponse({
185
+ ...testCase,
186
+ output: aiResponse
187
+ });
188
+ }
189
+ catch (error) {
190
+ console.error('❌ Error in runSingleTest:', error);
191
+ this.updateTestCase(testCase.id, {
192
+ isRunning: false,
193
+ output: null,
194
+ error: error instanceof Error ? error.message : 'Unknown error'
195
+ });
196
+ }
197
+ }
198
+ deleteTestCase(id) {
199
+ this.testCases = this.testCases.filter(tc => tc.id !== id);
200
+ }
201
+ addKeyword(testCaseId, keyword) {
202
+ if (keyword.trim()) {
203
+ const testCase = this.testCases.find(tc => tc.id === testCaseId);
204
+ if (testCase) {
205
+ this.updateTestCase(testCaseId, {
206
+ expectedKeywords: [...testCase.expectedKeywords, keyword.trim()]
207
+ });
208
+ }
209
+ }
210
+ }
211
+ removeKeyword(testCaseId, index) {
212
+ const testCase = this.testCases.find(tc => tc.id === testCaseId);
213
+ if (testCase) {
214
+ const newKeywords = testCase.expectedKeywords.filter((_, i) => i !== index);
215
+ this.updateTestCase(testCaseId, { expectedKeywords: newKeywords });
216
+ }
217
+ }
218
+ addSourceLink(testCaseId, link) {
219
+ if (link.trim()) {
220
+ const testCase = this.testCases.find(tc => tc.id === testCaseId);
221
+ if (testCase) {
222
+ this.updateTestCase(testCaseId, {
223
+ expectedSourceLinks: [...testCase.expectedSourceLinks, link.trim()]
224
+ });
225
+ }
226
+ }
227
+ }
228
+ removeSourceLink(testCaseId, index) {
229
+ const testCase = this.testCases.find(tc => tc.id === testCaseId);
230
+ if (testCase) {
231
+ const newLinks = testCase.expectedSourceLinks.filter((_, i) => i !== index);
232
+ this.updateTestCase(testCaseId, { expectedSourceLinks: newLinks });
233
+ }
234
+ }
235
+ async callGeminiAPI(prompt) {
236
+ console.log('🔍 callGeminiAPI - apiKey:', this.apiKey ? 'SET' : 'NOT SET');
237
+ console.log('🔍 callGeminiAPI - apiKey value:', this.apiKey ? `${this.apiKey.substring(0, 10)}...` : 'undefined');
238
+ if (!this.apiKey) {
239
+ throw new Error('API key is required. Please provide the apiKey prop.');
240
+ }
241
+ const requestBody = {
242
+ contents: [{
243
+ parts: [{
244
+ text: prompt
245
+ }]
246
+ }]
247
+ };
248
+ const response = await fetch(`${this.apiUrl}?key=${this.apiKey}`, {
249
+ method: 'POST',
250
+ headers: {
251
+ 'Content-Type': 'application/json',
252
+ },
253
+ body: JSON.stringify(requestBody)
254
+ });
255
+ if (!response.ok) {
256
+ const errorData = await response.json().catch(() => ({}));
257
+ throw new Error(errorData.error?.message || `HTTP error! status: ${response.status}`);
258
+ }
259
+ const data = await response.json();
260
+ if (data.candidates && data.candidates[0] && data.candidates[0].content) {
261
+ return data.candidates[0].content.parts[0].text;
262
+ }
263
+ else {
264
+ throw new Error('Unexpected response format from Gemini API');
265
+ }
266
+ }
267
+ async evaluateResponse(testCase) {
268
+ if (!testCase.output) {
269
+ console.warn('⚠️ No output to evaluate for test case:', testCase.id);
270
+ return;
271
+ }
272
+ const evaluationRequest = {
273
+ testCaseId: testCase.id,
274
+ question: testCase.question,
275
+ expectedKeywords: testCase.expectedKeywords,
276
+ expectedSourceLinks: testCase.expectedSourceLinks,
277
+ actualResponse: testCase.output
278
+ };
279
+ await this.evaluationEngine.evaluateResponse(evaluationRequest, (result) => {
280
+ console.log('📊 Evaluation result received:', result);
281
+ this.updateTestCase(testCase.id, {
282
+ evaluationResult: result
283
+ });
284
+ });
285
+ }
286
+ async runAllTests() {
287
+ this.isRunningAll = true;
288
+ for (const testCase of this.testCases) {
289
+ if (!testCase.isRunning && testCase.question.trim()) {
290
+ await this.runSingleTest(testCase);
291
+ // Delay between tests to avoid rate limiting
292
+ await new Promise(resolve => setTimeout(resolve, 1000));
293
+ }
294
+ }
295
+ this.isRunningAll = false;
296
+ }
297
+ generateId() {
298
+ return v4();
299
+ }
300
+ handleFileSelect() {
301
+ this.fileInput.click();
302
+ }
303
+ async handleFileChange(event) {
304
+ const target = event.target;
305
+ const file = target.files?.[0];
306
+ // Immediately clear the input value to allow for a new upload.
307
+ target.value = '';
308
+ if (!file) {
309
+ this.error = 'No file selected.';
310
+ return;
311
+ }
312
+ const isJsonType = file.type === 'application/json';
313
+ const isJsonExtension = file.name.toLowerCase().endsWith('.json');
314
+ if (!isJsonType && !isJsonExtension) {
315
+ this.error = 'Invalid file type. Please select a JSON file.';
316
+ return;
317
+ }
318
+ this.error = '';
319
+ try {
320
+ const content = await this.readFileAsync(file);
321
+ const fileContent = JSON.parse(content);
322
+ if (!Array.isArray(fileContent)) {
323
+ throw new Error("Invalid JSON structure. Expected a JSON array.");
324
+ }
325
+ const importedTestCases = fileContent.map((item) => ({
326
+ id: this.generateId(),
327
+ question: item.question || '',
328
+ expectedKeywords: Array.isArray(item.expectedKeywords) ? item.expectedKeywords : [],
329
+ expectedSourceLinks: Array.isArray(item.expectedSourceLinks) ? item.expectedSourceLinks : [],
330
+ isRunning: false
331
+ }));
332
+ this.testCases = importedTestCases;
333
+ }
334
+ catch (err) {
335
+ this.error = err?.message || 'Error processing file. Please ensure it is a valid JSON array.';
336
+ console.error('File Processing Error:', err);
337
+ }
338
+ }
339
+ readFileAsync(file) {
340
+ return new Promise((resolve, reject) => {
341
+ const reader = new FileReader();
342
+ reader.onload = () => resolve(reader.result);
343
+ reader.onerror = () => reject(reader.error);
344
+ reader.readAsText(file);
345
+ });
346
+ }
347
+ downloadFile(content, filename, mimeType) {
348
+ const blob = new Blob([content], { type: mimeType });
349
+ const url = URL.createObjectURL(blob);
350
+ const link = document.createElement('a');
351
+ link.href = url;
352
+ link.download = filename;
353
+ document.body.appendChild(link);
354
+ link.click();
355
+ document.body.removeChild(link);
356
+ URL.revokeObjectURL(url);
357
+ }
358
+ async handleExportTestSuite() {
359
+ this.isExportingTestSuite = true;
360
+ try {
361
+ // Exporting only input data (question, expected keywords, expected source links)
362
+ const exportData = this.testCases.map(testCase => ({
363
+ id: testCase.id,
364
+ question: testCase.question,
365
+ expectedKeywords: testCase.expectedKeywords,
366
+ expectedSourceLinks: testCase.expectedSourceLinks
367
+ }));
368
+ const jsonContent = JSON.stringify(exportData, null, 2);
369
+ // Added a small delay to show the loading state
370
+ await new Promise(resolve => setTimeout(resolve, 500));
371
+ this.downloadFile(jsonContent, 'test-suite.json', 'application/json');
372
+ }
373
+ finally {
374
+ this.isExportingTestSuite = false;
375
+ }
376
+ }
377
+ render() {
378
+ return (index.h("div", { key: 'dc5b661334cb4d4bb9bf51fb25363fe08ad938e3', class: "test-runner-container" }, index.h("header", { key: 'eede0d7f00c0bf5ff794fe2e53bad7a239f2d4d4', class: "test-runner-header" }, index.h("div", { key: '19327ae6f7408843110a10f791e00ffdf3da6d64', class: "header-left" }, index.h("input", { key: 'b24227b27dc0f562318a67ca9c38b8793b55c644', class: "hidden", type: "file", ref: (el) => (this.fileInput = el), onChange: (e) => this.handleFileChange(e), accept: ".json,application/json" }), index.h("button", { key: '65adec40d3787115546c9b59e8691bc89c55c688', class: "btn btn-secondary", onClick: () => this.handleFileSelect() }, index.h("span", { key: '6fd40e85b4c99232330242b41199df1c4f947351', class: "icon" }, "\u2191"), "Import Test Suite"), index.h("button", { key: 'd7c4d6b7e3e9bb6951395a3c2c10b964ef2d2fca', class: "btn btn-secondary", onClick: () => this.handleExportTestSuite(), disabled: this.isExportingTestSuite }, index.h("span", { key: 'bab67984c37b2744f35b4b2c34bfa3a500d196fb', class: "icon" }, this.isExportingTestSuite ? '⏳' : '↓'), this.isExportingTestSuite ? 'Exporting...' : 'Export Test Suite')), index.h("div", { key: '74a7d6e148311151de86a66d7b146bd0d01c215c', class: "header-right" }, index.h("button", { key: '3e9c33ef795755ebdf11fafa68801294b61a03d1', class: "btn btn-secondary" }, index.h("span", { key: '89b3582178782392cbea1309ba32b5edc57f9392', class: "icon" }, "\u2699\uFE0F"), "Prompt Editor"), index.h("button", { key: 'e68e8edd5f532c7a8ec87746fa6d393c4297bc36', class: "btn btn-secondary" }, index.h("span", { key: '7298d968bbc108cf060a0c309c9a8b2bce88aa90', class: "icon" }, "\u2193"), "Export Test Results"), index.h("button", { key: 'fb7d10cf9abda9968a2502bd8b4bf8e4cade11e8', class: "btn btn-primary", onClick: () => this.runAllTests(), disabled: this.isRunningAll }, this.isRunningAll ? 'Running...' : 'Run All'))), index.h(ErrorMessage, { key: '71eb4e561018a176a8c944107d734c32cd74334b', message: this.error, onClear: () => (this.error = '') }), index.h("div", { key: 'c120a8e40c6c6721dacd400266d4cd6270057c66', class: "test-runner-content" }, index.h("div", { key: '7b864c6e0671d8be117b001fd87047fabdc851c0', class: "column-headers" }, index.h("div", { key: 'fcd6ae26d7b98422d800c4e3a4bcec587187be2b', class: "column-header" }, "Input"), index.h("div", { key: '2855a067b11f8f9ddaf489daffb8a9fd2a317a44', class: "column-header" }, "Output"), index.h("div", { key: '8b6d75b16005d19bacd8fa6d2008fa64c268e1ef', class: "column-header" }, "Evaluation"), index.h("div", { key: 'd14ea8cecb426c9692b16044124f3d23ddae671d', class: "column-header" }, "Actions")), index.h("div", { key: '958aaba85391f7aadabd86c0395d0fe18b942ed4', class: "test-cases" }, this.testCases.map((testCase) => (index.h("div", { class: "test-case-row", key: testCase.id }, index.h("div", { class: "input-column" }, index.h("div", { class: "input-group" }, index.h("label", null, "Question"), index.h("textarea", { value: testCase.question, onInput: (e) => this.updateTestCase(testCase.id, {
379
+ question: e.target.value
380
+ }), placeholder: "Enter your question here...", rows: 3 })), index.h("div", { class: "keywords-group" }, index.h("label", null, "Expected keywords"), index.h("div", { class: "tags-container" }, testCase.expectedKeywords.map((keyword, index$1) => (index.h("span", { class: "tag", key: index$1 }, keyword, index.h("button", { class: "tag-remove", onClick: () => this.removeKeyword(testCase.id, index$1) }, "\u00D7")))), index.h("input", { type: "text", placeholder: "New item...", onKeyDown: (e) => {
381
+ if (e.key === 'Enter') {
382
+ this.addKeyword(testCase.id, e.target.value);
383
+ e.target.value = '';
384
+ }
385
+ } }))), index.h("div", { class: "links-group" }, index.h("label", null, "Expected source links"), index.h("div", { class: "links-container" }, testCase.expectedSourceLinks.map((link, index$1) => (index.h("div", { class: "link-item", key: index$1 }, index.h("a", { href: link, target: "_blank", rel: "noopener noreferrer" }, link), index.h("button", { class: "link-remove", onClick: () => this.removeSourceLink(testCase.id, index$1) }, "\u00D7")))), index.h("input", { type: "url", placeholder: "New item...", onKeyDown: (e) => {
386
+ if (e.key === 'Enter') {
387
+ this.addSourceLink(testCase.id, e.target.value);
388
+ e.target.value = '';
389
+ }
390
+ } })))), index.h("div", { class: "output-column" }, testCase.output ? (index.h("div", { class: "output-content" }, testCase.output)) : (index.h("div", { class: "output-placeholder" }, testCase.isRunning ? 'Running...' : ''))), index.h("div", { class: "evaluation-column" }, testCase.evaluationResult ? (index.h("div", { class: "evaluation-result" }, index.h("div", { class: `evaluation-status ${testCase.evaluationResult.passed ? 'passed' : 'failed'}` }, testCase.evaluationResult.passed ? '✅ PASSED' : '❌ FAILED'), index.h("div", { class: "evaluation-details" }, "Keywords: ", testCase.evaluationResult.keywordMatches.filter(m => m.found).length, "/", testCase.evaluationResult.keywordMatches.length, " found"))) : (index.h("div", { class: "evaluation-placeholder" }, testCase.isRunning ? 'Evaluating...' : ''))), index.h("div", { class: "actions-column" }, index.h("button", { class: "btn btn-icon btn-run", onClick: () => this.runSingleTest(testCase), disabled: testCase.isRunning || !testCase.question.trim(), title: !testCase.question.trim() ? "Enter a question first" : "Run this test" }, testCase.isRunning ? '⏳' : '▶️'), index.h("button", { class: "btn btn-icon btn-delete", onClick: () => this.deleteTestCase(testCase.id), title: "Delete this test" }, "\uD83D\uDDD1\uFE0F")))))), index.h("div", { key: '678932d3554c7ef2c86373bc4c972eb0f9894916', class: "add-test-case" }, index.h("button", { key: '7f8447a4681214320647c55e06d1cfc0fc87b3fb', class: "btn btn-outline", onClick: () => this.addNewTestCase() }, "+ Add Question")))));
391
+ }
392
+ };
393
+ LLMTestRunner.style = llmTestRunnerCss;
394
+
395
+ exports.LLMTestRunner = LLMTestRunner;
396
+ //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["src/utils/utils.ts"],"sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"],"names":[],"mappings":";;SAAgB,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa,EAAA;AACnE,IAAA,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,CAAI,CAAA,EAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AAChF;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["src/lib/evaluation/evaluation-engine.ts","../../node_modules/uuid/dist/esm-browser/stringify.js","../../node_modules/uuid/dist/esm-browser/rng.js","../../node_modules/uuid/dist/esm-browser/native.js","../../node_modules/uuid/dist/esm-browser/v4.js","src/components/error-message/error-message.tsx","src/components/llm-test-runner/llm-test-runner.css?tag=llm-test-runner&encapsulation=shadow","src/components/llm-test-runner/llm-test-runner.tsx"],"sourcesContent":["import {\n EvaluationRequest,\n EvaluationResult,\n KeywordMatch,\n SourceLinkMatch,\n EvaluationCallback\n} from './types';\n\nexport class LLMEvaluationEngine {\n constructor() { }\n\n async evaluateResponse(\n request: EvaluationRequest,\n callback: EvaluationCallback\n ): Promise<void> {\n try {\n console.log('🔍 Starting evaluation for test case:', request.testCaseId);\n\n const result = await this.performEvaluation(request);\n\n console.log('Evaluation completed for test case:', request.testCaseId);\n console.log('Result:', result);\n\n callback(result);\n\n } catch (error) {\n console.error('Evaluation failed:', error);\n\n const errorResult: EvaluationResult = {\n testCaseId: request.testCaseId,\n passed: false,\n keywordMatches: [],\n sourceLinkMatches: [],\n timestamp: new Date().toISOString()\n };\n\n callback(errorResult);\n }\n }\n\n private async performEvaluation(request: EvaluationRequest): Promise<EvaluationResult> {\n const { testCaseId, expectedKeywords, expectedSourceLinks, actualResponse } = request;\n\n const keywordMatches = this.evaluateKeywords(expectedKeywords, actualResponse);\n const sourceLinkMatches = this.evaluateSourceLinks(expectedSourceLinks, actualResponse);\n\n // Test passes only if ALL expected keywords and source links are found\n const totalItems = keywordMatches.length + sourceLinkMatches.length;\n const foundItems = keywordMatches.filter(m => m.found).length + sourceLinkMatches.filter(m => m.found).length;\n const passed = foundItems === totalItems;\n\n return {\n testCaseId,\n passed,\n keywordMatches,\n sourceLinkMatches,\n timestamp: new Date().toISOString()\n };\n }\n\n private evaluateKeywords(expectedKeywords: string[], actualResponse: string): KeywordMatch[] {\n // Case-insensitive keyword matching\n const response = actualResponse.toLowerCase();\n\n return expectedKeywords.map(keyword => {\n const keywordToMatch = keyword.toLowerCase();\n const found = response.includes(keywordToMatch);\n\n return {\n keyword,\n found\n };\n });\n }\n\n private evaluateSourceLinks(expectedSourceLinks: string[], actualResponse: string): SourceLinkMatch[] {\n return expectedSourceLinks.map(link => {\n const found = actualResponse.includes(link);\n\n return {\n link,\n found\n };\n });\n }\n\n\n\n}\n\n","import validate from './validate.js';\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n //\n // Note to future-self: No, you can't remove the `toLowerCase()` call.\n // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n var uuid = unsafeStringify(arr, offset);\n // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\n\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n return getRandomValues(rnds8);\n}","var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n offset = offset || 0;\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;","import { FunctionalComponent, h } from '@stencil/core';\n\ninterface ErrorMessageProps {\n message: string;\n onClear?: () => void;\n}\n\nexport const ErrorMessage: FunctionalComponent<ErrorMessageProps> = ({ message, onClear }) => {\n if (!message) {\n return null;\n }\n\n return (\n <div class=\"error-message\">\n <span>{message}</span>\n {onClear && (\n <button\n class=\"error-close\"\n title=\"Close\"\n onClick={onClear}\n >\n &times;\n </button>\n )}\n </div>\n );\n};\n",":host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n background-color: #f8fafc;\n min-height: 100vh;\n}\n\n.test-runner-container {\n padding: 20px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n margin: 20px 0;\n}\n\n.simple-test {\n margin: 20px 0;\n padding: 20px;\n border: 1px solid #ddd;\n border-radius: 4px;\n}\n\n.test-cases {\n margin: 20px 0;\n}\n\n.test-case {\n margin: 20px 0;\n padding: 20px;\n border: 1px solid #eee;\n border-radius: 4px;\n background: #f9f9f9;\n}\n\n.test-case h3 {\n margin-top: 0;\n color: #333;\n}\n\n.test-case textarea {\n width: 100%;\n padding: 10px;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-family: inherit;\n margin: 10px 0;\n}\n\n.test-case button {\n background: #007bff;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 4px;\n cursor: pointer;\n margin: 10px 5px 10px 0;\n}\n\n.test-case button:disabled {\n background: #ccc;\n cursor: not-allowed;\n}\n\n.output, .error {\n margin: 10px 0;\n padding: 10px;\n border-radius: 4px;\n}\n\n.output {\n background: #d4edda;\n border: 1px solid #c3e6cb;\n color: #155724;\n}\n\n.error {\n background: #f8d7da;\n border: 1px solid #f5c6cb;\n color: #721c24;\n}\n\n.test-runner-container {\n max-width: 1400px;\n margin: 0 auto;\n background: white;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);\n}\n\n/* Header Styles */\n.test-runner-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 20px 24px;\n background: /*linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/ white;\n color: white;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n}\n\n.header-left, .header-right {\n display: flex;\n gap: 12px;\n align-items: center;\n}\n\n.header-center {\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.api-status {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.api-status-text {\n color: #28a745;\n font-weight: 500;\n font-size: 0.9rem;\n}\n\n/* Button Styles */\n.btn {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 10px 16px;\n border: none;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n text-decoration: none;\n position: relative;\n}\n\n.btn:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n transform: none !important;\n}\n\n.btn-primary {\n color: black;\n box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);\n}\n\n.btn-primary:hover:not(:disabled) {\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);\n}\n\n.btn-secondary {\n background: rgba(255, 255, 255, 0.2);\n color: blue;\n border: 1px solid rgba(255, 255, 255, 0.3);\n}\n\n.btn-secondary:hover:not(:disabled) {\n background: rgba(255, 255, 255, 0.3);\n transform: translateY(-1px);\n}\n\n.btn-outline {\n background: transparent;\n color: #6b7280;\n border: 2px solid #e5e7eb;\n}\n\n.btn-outline:hover {\n background: #f9fafb;\n border-color: #d1d5db;\n transform: translateY(-1px);\n}\n\n.btn-icon {\n padding: 8px;\n min-width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n}\n\n.btn-run {\n color: white;\n}\n\n.btn-run:hover:not(:disabled) {\n transform: translateY(-1px);\n}\n\n.btn-delete {\n color: white;\n}\n\n.btn-delete:hover:not(:disabled) {\n transform: translateY(-1px);\n}\n\n.icon {\n font-size: 16px;\n}\n\n/* Main Content */\n.test-runner-content {\n padding: 0;\n}\n\n/* Column Headers */\n.column-headers {\n display: grid;\n grid-template-columns: 1fr 1.5fr 0.5fr 120px;\n gap: 1px;\n background: #e5e7eb;\n border-bottom: 2px solid #d1d5db;\n}\n\n.column-header {\n background: #f8fafc;\n padding: 16px 20px;\n font-weight: 600;\n color: #374151;\n font-size: 14px;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n/* Test Cases */\n.test-cases {\n background: white;\n}\n\n.test-case-row {\n display: grid;\n grid-template-columns: 1fr 1.5fr 0.5fr 120px;\n gap: 1px;\n border-bottom: 1px solid #e5e7eb;\n min-height: 200px;\n}\n\n.test-case-row:hover {\n background: #f9fafb;\n}\n\n/* Input Column */\n.input-column {\n padding: 20px;\n background: white;\n border-right: 1px solid #e5e7eb;\n}\n\n.input-group {\n margin-bottom: 16px;\n}\n\n.input-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #374151;\n font-size: 14px;\n}\n\n.input-group textarea {\n width: 95%;\n padding: 12px;\n border: 2px solid #e5e7eb;\n border-radius: 8px;\n font-size: 14px;\n resize: vertical;\n outline: none;\n transition: border-color 0.2s ease;\n font-family: inherit;\n}\n\n.input-group textarea:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);\n}\n\n/* Keywords and Links */\n.keywords-group, .links-group {\n margin-bottom: 16px;\n}\n\n.keywords-group label, .links-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #374151;\n font-size: 14px;\n}\n\n.tags-container, .links-container {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n align-items: center;\n}\n\n.tag {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: #dbeafe;\n color: #1e40af;\n padding: 4px 8px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n}\n\n.tag-remove {\n background: none;\n border: none;\n color: #1e40af;\n cursor: pointer;\n font-size: 14px;\n padding: 0;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n}\n\n.tag-remove:hover {\n background: rgba(30, 64, 175, 0.1);\n}\n\n.link-item {\n display: flex;\n align-items: center;\n gap: 6px;\n background: #f0f9ff;\n padding: 4px 8px;\n border-radius: 6px;\n font-size: 12px;\n}\n\n.link-item a {\n color: #0369a1;\n text-decoration: none;\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.link-item a:hover {\n text-decoration: underline;\n}\n\n.link-remove {\n background: none;\n border: none;\n color: #0369a1;\n cursor: pointer;\n font-size: 12px;\n padding: 0;\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n}\n\n.link-remove:hover {\n background: rgba(3, 105, 161, 0.1);\n}\n\n.tags-container input, .links-container input {\n border: 1px solid #d1d5db;\n border-radius: 6px;\n padding: 6px 8px;\n font-size: 12px;\n outline: none;\n min-width: 120px;\n}\n\n.tags-container input:focus, .links-container input:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);\n}\n\n/* Output Column */\n.output-column {\n padding: 20px;\n background: white;\n border-right: 1px solid #e5e7eb;\n display: flex;\n flex-direction: column;\n}\n\n.output-content {\n background: #f8fafc;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 16px;\n font-size: 14px;\n line-height: 1.6;\n color: #374151;\n white-space: pre-wrap;\n word-wrap: break-word;\n flex: 1;\n overflow-y: auto;\n max-height: 250px;\n overflow-x: scroll;\n}\n\n.output-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9ca3af;\n font-style: italic;\n flex: 1;\n background: #f9fafb;\n border: 2px dashed #d1d5db;\n border-radius: 8px;\n}\n\n/* Evaluation Column */\n.evaluation-column {\n padding: 20px;\n background: white;\n border-right: 1px solid #e5e7eb;\n display: flex;\n flex-direction: column;\n}\n\n.evaluation-content {\n display: flex;\n flex-direction: column;\n gap: 12px;\n flex: 1;\n}\n\n.score-display {\n text-align: center;\n}\n\n.score-number {\n font-size: 24px;\n font-weight: 700;\n color: #111827;\n display: block;\n margin-bottom: 8px;\n}\n\n.score-bar {\n width: 100%;\n height: 8px;\n background: #e5e7eb;\n border-radius: 4px;\n overflow: hidden;\n}\n\n.score-fill {\n height: 100%;\n background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);\n transition: width 0.3s ease;\n}\n\n.evaluation-details {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.detail-item {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 14px;\n}\n\n.status {\n width: 20px;\n height: 20px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: bold;\n}\n\n.status.pass {\n background: #dcfce7;\n color: #166534;\n}\n\n.status.fail {\n background: #fef2f2;\n color: #dc2626;\n}\n\n.evaluation-text {\n font-size: 12px;\n color: #6b7280;\n line-height: 1.4;\n background: #f9fafb;\n padding: 8px;\n border-radius: 6px;\n border: 1px solid #e5e7eb;\n}\n\n.evaluation-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9ca3af;\n font-style: italic;\n flex: 1;\n background: #f9fafb;\n border: 2px dashed #d1d5db;\n border-radius: 8px;\n}\n\n/* New evaluation result styles */\n.evaluation-result {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.evaluation-status {\n font-weight: 600;\n font-size: 14px;\n padding: 8px 12px;\n border-radius: 4px;\n text-align: center;\n}\n\n.evaluation-status.passed {\n background: #d4edda;\n color: #155724;\n border: 1px solid #c3e6cb;\n}\n\n.evaluation-status.failed {\n background: #f8d7da;\n color: #721c24;\n border: 1px solid #f5c6cb;\n}\n\n.evaluation-score {\n font-size: 12px;\n color: #495057;\n text-align: center;\n font-weight: 500;\n}\n\n.evaluation-feedback {\n font-size: 12px;\n color: #6c757d;\n background: #f8f9fa;\n padding: 8px;\n border-radius: 4px;\n border: 1px solid #dee2e6;\n}\n\n/* Actions Column */\n.actions-column {\n padding: 20px;\n background: white;\n display: flex;\n flex-direction: column;\n gap: 12px;\n align-items: center;\n justify-content: flex-start;\n align-self: flex-start;\n}\n\n/* Add Test Case */\n.add-test-case {\n padding: 24px;\n text-align: center;\n background: #f9fafb;\n border-top: 1px solid #e5e7eb;\n}\n\n.hidden {\n display: none;\n}\n\n.error-message {\n background: #ffeaea;\n color: #b71c1c;\n border: 1px solid #f44336;\n padding: 0.75em 2.5em 0.75em 1em;\n border-radius: 4px;\n margin: 1em 0;\n position: relative;\n font-size: 1em;\n display: flex;\n align-items: center;\n gap: 1em;\n}\n\n.error-close {\n background: none;\n border: none;\n color: #b71c1c;\n font-size: 1.25em;\n font-weight: bold;\n cursor: pointer;\n position: absolute;\n right: 0.75em;\n top: 50%;\n transform: translateY(-50%);\n line-height: 1;\n padding: 0;\n}\n\n/* Responsive Design */\n@media (max-width: 1200px) {\n .test-case-row {\n grid-template-columns: 1fr;\n gap: 0;\n }\n \n .column-headers {\n display: none;\n }\n \n .input-column, .output-column, .evaluation-column, .actions-column {\n border-right: none;\n border-bottom: 1px solid #e5e7eb;\n }\n \n .actions-column {\n flex-direction: row;\n justify-content: center;\n }\n}\n\n@media (max-width: 768px) {\n .test-runner-header {\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n }\n \n .header-left, .header-right {\n flex-wrap: wrap;\n justify-content: center;\n }\n \n .btn {\n font-size: 12px;\n padding: 8px 12px;\n }\n \n .input-column, .output-column, .evaluation-column, .actions-column {\n padding: 16px;\n }\n \n .test-case-row {\n min-height: auto;\n }\n}","import { Component, State, Prop, h } from '@stencil/core';\nimport { LLMEvaluationEngine } from '../../lib/evaluation/evaluation-engine';\nimport { EvaluationRequest, EvaluationResult } from '../../lib/evaluation/types';\nimport { v4 as uuidv4 } from 'uuid';\nimport { ErrorMessage } from '../error-message/error-message';\n\nexport interface TestCase {\n id: string;\n question: string;\n expectedKeywords: string[];\n expectedSourceLinks: string[];\n output?: string;\n isRunning?: boolean;\n error?: string;\n evaluationResult?: EvaluationResult;\n}\n\n@Component({\n tag: 'llm-test-runner',\n styleUrl: 'llm-test-runner.css',\n shadow: true,\n})\nexport class LLMTestRunner {\n @Prop() apiKey: string;\n \n @State() testCases: TestCase[] = [\n {\n id: '1',\n question: '',\n expectedKeywords: [],\n expectedSourceLinks: [],\n isRunning: false\n }\n ];\n @State() isRunningAll: boolean = false;\n @State() error: string = '';\n\n private fileInput!: HTMLInputElement;\n @State() isExportingTestSuite: boolean = false;\n\n private evaluationEngine: LLMEvaluationEngine;\n private apiUrl: string = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent';\n\n async componentWillLoad() {\n this.evaluationEngine = new LLMEvaluationEngine();\n \n console.log('🔍 componentWillLoad - apiKey:', this.apiKey ? 'SET' : 'NOT SET');\n console.log('🔍 componentWillLoad - apiKey value:', this.apiKey);\n \n if (!this.apiKey) {\n throw new Error('API key is required. Please provide the apiKey prop: <llm-test-runner apiKey=\"your-api-key\" />');\n }\n }\n\n\n componentDidLoad() {\n }\n\n disconnectedCallback() {\n }\n\n private addNewTestCase() {\n const newTestCase: TestCase = {\n id: this.generateId(),\n question: '',\n expectedKeywords: [],\n expectedSourceLinks: [],\n isRunning: false\n };\n this.testCases = [...this.testCases, newTestCase];\n }\n\n private updateTestCase(id: string, updates: Partial<TestCase>) {\n this.testCases = this.testCases.map(tc => \n tc.id === id ? { ...tc, ...updates } : tc\n );\n }\n\n private async runSingleTest(testCase: TestCase) {\n console.log('🚀 Starting test for question:', testCase.question);\n \n this.updateTestCase(testCase.id, { isRunning: true });\n \n try {\n const aiResponse = await this.callGeminiAPI(testCase.question);\n console.log('✅ AI call completed for test case:', testCase.id);\n \n this.updateTestCase(testCase.id, {\n isRunning: false,\n output: aiResponse,\n error: null\n });\n \n await this.evaluateResponse({\n ...testCase,\n output: aiResponse\n });\n \n } catch (error) {\n console.error('❌ Error in runSingleTest:', error);\n this.updateTestCase(testCase.id, {\n isRunning: false,\n output: null,\n error: error instanceof Error ? error.message : 'Unknown error'\n });\n }\n }\n\n private deleteTestCase(id: string) {\n this.testCases = this.testCases.filter(tc => tc.id !== id);\n }\n\n private addKeyword(testCaseId: string, keyword: string) {\n if (keyword.trim()) {\n const testCase = this.testCases.find(tc => tc.id === testCaseId);\n if (testCase) {\n this.updateTestCase(testCaseId, {\n expectedKeywords: [...testCase.expectedKeywords, keyword.trim()]\n });\n }\n }\n }\n\n private removeKeyword(testCaseId: string, index: number) {\n const testCase = this.testCases.find(tc => tc.id === testCaseId);\n if (testCase) {\n const newKeywords = testCase.expectedKeywords.filter((_, i) => i !== index);\n this.updateTestCase(testCaseId, { expectedKeywords: newKeywords });\n }\n }\n\n private addSourceLink(testCaseId: string, link: string) {\n if (link.trim()) {\n const testCase = this.testCases.find(tc => tc.id === testCaseId);\n if (testCase) {\n this.updateTestCase(testCaseId, {\n expectedSourceLinks: [...testCase.expectedSourceLinks, link.trim()]\n });\n }\n }\n }\n\n private removeSourceLink(testCaseId: string, index: number) {\n const testCase = this.testCases.find(tc => tc.id === testCaseId);\n if (testCase) {\n const newLinks = testCase.expectedSourceLinks.filter((_, i) => i !== index);\n this.updateTestCase(testCaseId, { expectedSourceLinks: newLinks });\n }\n }\n\n private async callGeminiAPI(prompt: string): Promise<string> {\n console.log('🔍 callGeminiAPI - apiKey:', this.apiKey ? 'SET' : 'NOT SET');\n console.log('🔍 callGeminiAPI - apiKey value:', this.apiKey ? `${this.apiKey.substring(0, 10)}...` : 'undefined');\n \n if (!this.apiKey) {\n throw new Error('API key is required. Please provide the apiKey prop.');\n }\n\n const requestBody = {\n contents: [{\n parts: [{\n text: prompt\n }]\n }]\n };\n\n const response = await fetch(`${this.apiUrl}?key=${this.apiKey}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(requestBody)\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new Error(errorData.error?.message || `HTTP error! status: ${response.status}`);\n }\n\n const data = await response.json();\n \n if (data.candidates && data.candidates[0] && data.candidates[0].content) {\n return data.candidates[0].content.parts[0].text;\n } else {\n throw new Error('Unexpected response format from Gemini API');\n }\n }\n\n private async evaluateResponse(testCase: TestCase): Promise<void> {\n if (!testCase.output) {\n console.warn('⚠️ No output to evaluate for test case:', testCase.id);\n return;\n }\n\n const evaluationRequest: EvaluationRequest = {\n testCaseId: testCase.id,\n question: testCase.question,\n expectedKeywords: testCase.expectedKeywords,\n expectedSourceLinks: testCase.expectedSourceLinks,\n actualResponse: testCase.output\n };\n\n await this.evaluationEngine.evaluateResponse(evaluationRequest, (result: EvaluationResult) => {\n console.log('📊 Evaluation result received:', result);\n \n this.updateTestCase(testCase.id, {\n evaluationResult: result\n });\n });\n }\n\n private async runAllTests() {\n this.isRunningAll = true;\n \n for (const testCase of this.testCases) {\n if (!testCase.isRunning && testCase.question.trim()) {\n await this.runSingleTest(testCase);\n // Delay between tests to avoid rate limiting\n await new Promise(resolve => setTimeout(resolve, 1000));\n }\n }\n this.isRunningAll = false;\n }\n\n private generateId(): string {\n return uuidv4();\n }\n\n private handleFileSelect(): void {\n this.fileInput.click();\n }\n\n private async handleFileChange(event: Event): Promise<void> {\n const target = event.target as HTMLInputElement;\n const file = target.files?.[0];\n\n // Immediately clear the input value to allow for a new upload.\n target.value = '';\n\n if (!file) {\n this.error = 'No file selected.';\n return;\n }\n\n const isJsonType = file.type === 'application/json';\n const isJsonExtension = file.name.toLowerCase().endsWith('.json');\n if (!isJsonType && !isJsonExtension) {\n this.error = 'Invalid file type. Please select a JSON file.';\n return;\n }\n\n this.error = '';\n\n try {\n const content = await this.readFileAsync(file);\n const fileContent = JSON.parse(content);\n\n if (!Array.isArray(fileContent)) {\n throw new Error(\"Invalid JSON structure. Expected a JSON array.\");\n } \n const importedTestCases: TestCase[] = fileContent.map((item) => ({\n id: this.generateId(),\n question: item.question || '',\n expectedKeywords: Array.isArray(item.expectedKeywords) ? item.expectedKeywords : [],\n expectedSourceLinks: Array.isArray(item.expectedSourceLinks) ? item.expectedSourceLinks : [],\n isRunning: false\n }));\n this.testCases = importedTestCases; \n } catch (err) {\n this.error = err?.message || 'Error processing file. Please ensure it is a valid JSON array.';\n console.error('File Processing Error:', err);\n }\n }\n\n private readFileAsync(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(reader.error);\n reader.readAsText(file);\n });\n }\n\n private downloadFile(content: string, filename: string, mimeType: string) {\n const blob = new Blob([content], { type: mimeType });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n }\n\n private async handleExportTestSuite() {\n this.isExportingTestSuite = true;\n try {\n // Exporting only input data (question, expected keywords, expected source links)\n const exportData = this.testCases.map(testCase => ({\n id: testCase.id,\n question: testCase.question,\n expectedKeywords: testCase.expectedKeywords,\n expectedSourceLinks: testCase.expectedSourceLinks\n }));\n\n const jsonContent = JSON.stringify(exportData, null, 2);\n\n // Added a small delay to show the loading state\n await new Promise(resolve => setTimeout(resolve, 500));\n\n this.downloadFile(jsonContent, 'test-suite.json', 'application/json');\n } finally {\n this.isExportingTestSuite = false;\n }\n }\n\n render() {\n return (\n <div class=\"test-runner-container\">\n <header class=\"test-runner-header\">\n <div class=\"header-left\">\n <input\n class=\"hidden\"\n type=\"file\"\n ref={(el) => (this.fileInput = el as HTMLInputElement)}\n onChange={(e) => this.handleFileChange(e)}\n accept=\".json,application/json\"\n />\n <button class=\"btn btn-secondary\" onClick={() => this.handleFileSelect()}>\n <span class=\"icon\">↑</span>\n Import Test Suite\n </button>\n <button\n class=\"btn btn-secondary\"\n onClick={() => this.handleExportTestSuite()}\n disabled={this.isExportingTestSuite}\n >\n <span class=\"icon\">\n {this.isExportingTestSuite ? '⏳' : '↓'}\n </span>\n {this.isExportingTestSuite ? 'Exporting...' : 'Export Test Suite'}\n </button>\n </div>\n \n <div class=\"header-right\">\n <button class=\"btn btn-secondary\">\n <span class=\"icon\">⚙️</span>\n Prompt Editor\n </button>\n <button class=\"btn btn-secondary\">\n <span class=\"icon\">↓</span>\n Export Test Results\n </button>\n <button \n class=\"btn btn-primary\" \n onClick={() => this.runAllTests()}\n disabled={this.isRunningAll}\n >\n {this.isRunningAll ? 'Running...' : 'Run All'}\n </button>\n </div>\n </header>\n <ErrorMessage\n message={this.error}\n onClear={() => (this.error = '')}\n />\n <div class=\"test-runner-content\">\n <div class=\"column-headers\">\n <div class=\"column-header\">Input</div>\n <div class=\"column-header\">Output</div>\n <div class=\"column-header\">Evaluation</div>\n <div class=\"column-header\">Actions</div>\n </div>\n\n <div class=\"test-cases\">\n {this.testCases.map((testCase) => (\n <div class=\"test-case-row\" key={testCase.id}>\n <div class=\"input-column\">\n <div class=\"input-group\">\n <label>Question</label>\n <textarea\n value={testCase.question}\n onInput={(e) => this.updateTestCase(testCase.id, { \n question: (e.target as HTMLTextAreaElement).value \n })}\n placeholder=\"Enter your question here...\"\n rows={3}\n ></textarea>\n </div>\n \n <div class=\"keywords-group\">\n <label>Expected keywords</label>\n <div class=\"tags-container\">\n {testCase.expectedKeywords.map((keyword, index) => (\n <span class=\"tag\" key={index}>\n {keyword}\n <button \n class=\"tag-remove\" \n onClick={() => this.removeKeyword(testCase.id, index)}\n >×</button>\n </span>\n ))}\n <input\n type=\"text\"\n placeholder=\"New item...\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n this.addKeyword(testCase.id, (e.target as HTMLInputElement).value);\n (e.target as HTMLInputElement).value = '';\n }\n }}\n />\n </div>\n </div>\n \n <div class=\"links-group\">\n <label>Expected source links</label>\n <div class=\"links-container\">\n {testCase.expectedSourceLinks.map((link, index) => (\n <div class=\"link-item\" key={index}>\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\">{link}</a>\n <button \n class=\"link-remove\" \n onClick={() => this.removeSourceLink(testCase.id, index)}\n >×</button>\n </div>\n ))}\n <input\n type=\"url\"\n placeholder=\"New item...\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n this.addSourceLink(testCase.id, (e.target as HTMLInputElement).value);\n (e.target as HTMLInputElement).value = '';\n }\n }}\n />\n </div>\n </div>\n </div>\n\n <div class=\"output-column\">\n {testCase.output ? (\n <div class=\"output-content\">\n {testCase.output}\n </div>\n ) : (\n <div class=\"output-placeholder\">\n {testCase.isRunning ? 'Running...' : ''}\n </div>\n )}\n </div>\n\n <div class=\"evaluation-column\">\n {testCase.evaluationResult ? (\n <div class=\"evaluation-result\">\n <div class={`evaluation-status ${testCase.evaluationResult.passed ? 'passed' : 'failed'}`}>\n {testCase.evaluationResult.passed ? '✅ PASSED' : '❌ FAILED'}\n </div>\n <div class=\"evaluation-details\">\n Keywords: {testCase.evaluationResult.keywordMatches.filter(m => m.found).length}/{testCase.evaluationResult.keywordMatches.length} found\n </div>\n </div>\n ) : (\n <div class=\"evaluation-placeholder\">\n {testCase.isRunning ? 'Evaluating...' : ''}\n </div>\n )}\n </div>\n\n <div class=\"actions-column\">\n <button \n class=\"btn btn-icon btn-run\"\n onClick={() => this.runSingleTest(testCase)}\n disabled={testCase.isRunning || !testCase.question.trim()}\n title={!testCase.question.trim() ? \"Enter a question first\" : \"Run this test\"}\n >\n {testCase.isRunning ? '⏳' : '▶️'}\n </button>\n <button \n class=\"btn btn-icon btn-delete\"\n onClick={() => this.deleteTestCase(testCase.id)}\n title=\"Delete this test\"\n >\n 🗑️\n </button>\n </div>\n </div>\n ))}\n </div>\n\n <div class=\"add-test-case\">\n <button class=\"btn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E3D,CACL,CACF,CACF;;;;;;;","x_google_ignoreList":[1,2,3,4]}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index.cjs.js');
4
+ require('./index-CY2lQip_.js');
5
+
6
+
7
+
8
+ exports.llm_test_runner = index.LLMTestRunner;
9
+ //# sourceMappingURL=llm-test-runner.entry.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-test-runner.entry.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CCrH7f-W.js');
3
+ var index = require('./index-CY2lQip_.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.36.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.38.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
12
- const importMeta = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('llm-testrunner-components.cjs.js', document.baseURI).href));
12
+ const importMeta = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('llm-testrunner.cjs.js', document.baseURI).href));
13
13
  const opts = {};
14
14
  if (importMeta !== "") {
15
15
  opts.resourcesUrl = new URL(".", importMeta).href;
@@ -19,10 +19,8 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["current-time_2.cjs",[[257,"my-component",{"first":[1],"middle":[1],"last":[1]}],[256,"current-time",{"currentTime":[32]}]]]], options);
22
+ return index.bootstrapLazy([["llm-test-runner.cjs",[[257,"llm-test-runner",{"apiKey":[1,"api-key"],"testCases":[32],"isRunningAll":[32],"error":[32],"isExportingTestSuite":[32]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
26
- //# sourceMappingURL=llm-testrunner-components.cjs.js.map
27
-
28
- //# sourceMappingURL=llm-testrunner-components.cjs.js.map
26
+ //# sourceMappingURL=llm-testrunner.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-testrunner.cjs.js","sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.38.1 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, H, promiseResolve, win } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? win.document && Array.from(win.document.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"names":["promiseResolve","globalScripts","bootstrapLazy"],"mappings":";;;;;;AAAA;AACA;AACA;;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,uQAAe;AACpC,EAAE,MAAM,IAAI,GAAiE,EAAE;AAC/E,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI;AACrD;AACA,EAAE,OAAOA,oBAAc,CAAC,IAAI,CAAC;AAC7B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAMC,wBAAa,EAAE;AACvB,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D,CAAC,CAAC;;;;","x_google_ignoreList":[0]}