llm-testrunner-components 1.2.4 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +9 -5
  2. package/dist/cjs/app-chips_5.cjs.entry.js +1 -1
  3. package/dist/cjs/app-chips_5.cjs.entry.js.map +1 -1
  4. package/dist/cjs/index.cjs.js +464 -66
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/llm-testrunner.cjs.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/llm-test-runner/llm-test-runner.js +46 -13
  9. package/dist/collection/components/llm-test-runner/llm-test-runner.js.map +1 -1
  10. package/dist/collection/components/llm-test-runner/test-cases/chat-history.css +5 -5
  11. package/dist/collection/components/llm-test-runner/test-cases/expected-outcome-renderer.js +45 -5
  12. package/dist/collection/components/llm-test-runner/test-cases/expected-outcome-renderer.js.map +1 -1
  13. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.css +21 -0
  14. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.js +2 -2
  15. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.js.map +1 -1
  16. package/dist/collection/components/llm-test-runner/test-cases/llm-test-cases.js +2 -2
  17. package/dist/collection/components/llm-test-runner/test-cases/llm-test-cases.js.map +1 -1
  18. package/dist/collection/components/llm-test-runner/test-cases/output/response-output.js +1 -1
  19. package/dist/collection/components/llm-test-runner/test-cases/output/response-output.js.map +1 -1
  20. package/dist/collection/lib/evaluation/actual-value-resolver.js +52 -0
  21. package/dist/collection/lib/evaluation/actual-value-resolver.js.map +1 -0
  22. package/dist/collection/lib/evaluation/evaluation-engine.js +1 -1
  23. package/dist/collection/lib/evaluation/evaluation-engine.js.map +1 -1
  24. package/dist/collection/lib/evaluation/evaluation-service.js +55 -17
  25. package/dist/collection/lib/evaluation/evaluation-service.js.map +1 -1
  26. package/dist/collection/lib/evaluation/types.js.map +1 -1
  27. package/dist/collection/lib/import-export/test-suite-importer.js +7 -1
  28. package/dist/collection/lib/import-export/test-suite-importer.js.map +1 -1
  29. package/dist/collection/lib/test-cases/test-case-factory.js +5 -0
  30. package/dist/collection/lib/test-cases/test-case-factory.js.map +1 -1
  31. package/dist/collection/lib/test-cases/test-case-mutations.js +58 -23
  32. package/dist/collection/lib/test-cases/test-case-mutations.js.map +1 -1
  33. package/dist/collection/schemas/expected-outcome.js +39 -0
  34. package/dist/collection/schemas/expected-outcome.js.map +1 -1
  35. package/dist/collection/schemas/model-response.js +7 -0
  36. package/dist/collection/schemas/model-response.js.map +1 -0
  37. package/dist/collection/schemas/test-case.js +2 -1
  38. package/dist/collection/schemas/test-case.js.map +1 -1
  39. package/dist/collection/types/expected-outcome.js.map +1 -1
  40. package/dist/collection/types/llm-test-runner.js.map +1 -1
  41. package/dist/components/chat-history.js +1 -1
  42. package/dist/components/index.js +1 -1
  43. package/dist/components/llm-test-runner.js +1 -1
  44. package/dist/components/p-kmtfMXcQ.js +2 -0
  45. package/dist/components/p-kmtfMXcQ.js.map +1 -0
  46. package/dist/components/{p-B87Lt3z4.js → p-wzA48RFK.js} +3 -3
  47. package/dist/components/p-wzA48RFK.js.map +1 -0
  48. package/dist/esm/app-chips_5.entry.js +1 -1
  49. package/dist/esm/app-chips_5.entry.js.map +1 -1
  50. package/dist/esm/index.js +464 -66
  51. package/dist/esm/index.js.map +1 -1
  52. package/dist/esm/llm-testrunner.js +1 -1
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/llm-testrunner/index.esm.js +2 -2
  55. package/dist/llm-testrunner/index.esm.js.map +1 -1
  56. package/dist/llm-testrunner/llm-testrunner.esm.js +1 -1
  57. package/dist/llm-testrunner/{p-21202f12.entry.js → p-5bf1fc78.entry.js} +2 -2
  58. package/dist/llm-testrunner/{p-21202f12.entry.js.map → p-5bf1fc78.entry.js.map} +1 -1
  59. package/dist/types/components/llm-test-runner/llm-test-runner.d.ts +3 -4
  60. package/dist/types/components/llm-test-runner/test-cases/expected-outcome-renderer.d.ts +1 -0
  61. package/dist/types/components/llm-test-runner/test-cases/llm-test-case-row.d.ts +1 -0
  62. package/dist/types/components/llm-test-runner/test-cases/llm-test-cases.d.ts +1 -0
  63. package/dist/types/components/llm-test-runner/test-cases/output/response-output.d.ts +2 -1
  64. package/dist/types/components.d.ts +4 -2
  65. package/dist/types/lib/evaluation/actual-value-resolver.d.ts +9 -0
  66. package/dist/types/lib/evaluation/evaluation-service.d.ts +2 -2
  67. package/dist/types/lib/evaluation/types.d.ts +1 -1
  68. package/dist/types/lib/import-export/test-suite-importer.d.ts +1 -1
  69. package/dist/types/lib/test-cases/test-case-mutations.d.ts +10 -1
  70. package/dist/types/schemas/expected-outcome.d.ts +116 -0
  71. package/dist/types/schemas/model-response.d.ts +7 -0
  72. package/dist/types/schemas/test-case.d.ts +76 -1
  73. package/dist/types/types/expected-outcome.d.ts +1 -1
  74. package/dist/types/types/llm-test-runner.d.ts +4 -2
  75. package/package.json +1 -1
  76. package/dist/components/p-B87Lt3z4.js.map +0 -1
  77. package/dist/components/p-Bx2jqguC.js +0 -2
  78. package/dist/components/p-Bx2jqguC.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{p as t,H as e,e as i,h as s,t as r}from"./p-D9BrlHdP.js";const a=()=>`.chat-history{display:flex;flex-direction:column;gap:var(--spacing-3);margin-top:var(--spacing-4)}.chat-history__toggle-row{display:flex;align-items:center}.chat-history__switch{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-3);cursor:pointer;user-select:none}.chat-history__switch-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.chat-history__switch-ui{position:relative;flex-shrink:0;width:2.75rem;height:1.5rem;border-radius:var(--radius-full);background:var(--muted);border:var(--border-width) solid var(--border);transition:background 0.15s ease, border-color 0.15s ease}@media (prefers-reduced-motion: reduce){.chat-history__switch-ui,.chat-history__switch-thumb{transition:none}}.chat-history__switch-thumb{position:absolute;top:2px;left:2px;width:calc(1.5rem - 6px);height:calc(1.5rem - 6px);border-radius:var(--radius-full);background:var(--background);box-shadow:var(--shadow-sm);transition:transform 0.15s ease}.chat-history__switch-input:checked+.chat-history__switch-ui{background:var(--primary);border-color:var(--primary)}.chat-history__switch-input:checked+.chat-history__switch-ui .chat-history__switch-thumb{transform:translateX(calc(2.75rem - (1.5rem - 6px) - 4px))}.chat-history__switch-input:focus-visible+.chat-history__switch-ui{outline:2px solid var(--ring);outline-offset:2px}.chat-history__switch-text{font-size:var(--font-size-sm, 0.875rem);color:var(--foreground)}.chat-history__textarea{width:100%;box-sizing:border-box;padding:var(--spacing-2) var(--spacing-3);border:var(--border-width) solid var(--border);border-radius:var(--radius-md);font:inherit;resize:vertical;min-height:9rem;background:var(--background)}.chat-history__textarea:focus-visible{outline:2px solid var(--ring);outline-offset:2px}`;const o=`[\n {"role": "user", "content": "How do I import a saved suite?"},\n {"role": "model", "content": "Use Import and pick the JSON from Export suite."}\n]`;const c=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.chatHistoryChange=i(this,"chatHistoryChange")}chatHistoryEnabled=false;chatHistoryValue="";chatHistoryChange;emit(t){this.chatHistoryChange.emit(t)}onToggle=t=>{const e=t.target.checked;this.emit({enabled:e,value:this.chatHistoryValue})};onTextInput=t=>{const e=t.target.value;this.emit({enabled:this.chatHistoryEnabled,value:e})};render(){return s("div",{key:"f444a4b5bd9b48df151cad67b54bef54116d11b3",class:"chat-history"},s("div",{key:"7216d764fb905ac5e8e33209d9586525e59fa218",class:"chat-history__toggle-row"},s("label",{key:"d5d092c323b48543c96525d449bcb03dcaf5113b",class:"chat-history__switch"},s("input",{key:"5104ce460686434156454fc1dfd3685ba0e0968c",type:"checkbox",class:"chat-history__switch-input",checked:this.chatHistoryEnabled,onInput:this.onToggle}),s("span",{key:"fa2e51bce0d6ff2d3bf133383e1ce940521097b0",class:"chat-history__switch-ui","aria-hidden":"true"},s("span",{key:"e0d897ca166623ece09834b44b5baa12605cb9f3",class:"chat-history__switch-thumb"})),s("span",{key:"e769678fde5d670e634d7a8e905ef09ce936f440",class:"chat-history__switch-text"},"Chat history"))),this.chatHistoryEnabled?s("textarea",{class:"chat-history__textarea",value:this.chatHistoryValue,rows:8,placeholder:o,"aria-label":"Chat history",onInput:this.onTextInput}):null)}static get style(){return a()}},[513,"chat-history",{chatHistoryEnabled:[4,"chat-history-enabled"],chatHistoryValue:[1,"chat-history-value"]}]);function h(){if(typeof customElements==="undefined"){return}const t=["chat-history"];t.forEach((t=>{switch(t){case"chat-history":if(!customElements.get(r(t))){customElements.define(r(t),c)}break}}))}export{c as C,h as d};
2
- //# sourceMappingURL=p-Bx2jqguC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["chatHistoryCss","CHAT_HISTORY_PLACEHOLDER","ChatHistory","__stencil_proxyCustomElement","HTMLElement","chatHistoryEnabled","chatHistoryValue","chatHistoryChange","emit","detail","this","onToggle","e","checked","target","enabled","value","onTextInput","render","h","key","class","type","onInput","rows","placeholder"],"sources":["src/components/llm-test-runner/test-cases/chat-history.css?tag=chat-history&encapsulation=shadow","src/components/llm-test-runner/test-cases/chat-history.tsx"],"sourcesContent":[".chat-history {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-3);\n margin-top: var(--spacing-4);\n}\n\n.chat-history__toggle-row {\n display: flex;\n align-items: center;\n}\n\n.chat-history__switch {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-3);\n cursor: pointer;\n user-select: none;\n}\n\n.chat-history__switch-input {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.chat-history__switch-ui {\n position: relative;\n flex-shrink: 0;\n width: 2.75rem;\n height: 1.5rem;\n border-radius: var(--radius-full);\n background: var(--muted);\n border: var(--border-width) solid var(--border);\n transition:\n background 0.15s ease,\n border-color 0.15s ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .chat-history__switch-ui,\n .chat-history__switch-thumb {\n transition: none;\n }\n}\n\n.chat-history__switch-thumb {\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(1.5rem - 6px);\n height: calc(1.5rem - 6px);\n border-radius: var(--radius-full);\n background: var(--background);\n box-shadow: var(--shadow-sm);\n transition: transform 0.15s ease;\n}\n\n.chat-history__switch-input:checked + .chat-history__switch-ui {\n background: var(--primary);\n border-color: var(--primary);\n}\n\n.chat-history__switch-input:checked + .chat-history__switch-ui .chat-history__switch-thumb {\n /* track width − end padding (2px × 2) − thumb width */\n transform: translateX(calc(2.75rem - (1.5rem - 6px) - 4px));\n}\n\n.chat-history__switch-input:focus-visible + .chat-history__switch-ui {\n outline: 2px solid var(--ring);\n outline-offset: 2px;\n}\n\n.chat-history__switch-text {\n font-size: var(--font-size-sm, 0.875rem);\n color: var(--foreground);\n}\n\n.chat-history__textarea {\n width: 100%;\n box-sizing: border-box;\n padding: var(--spacing-2) var(--spacing-3);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-md);\n font: inherit;\n resize: vertical;\n min-height: 9rem;\n background: var(--background);\n}\n\n.chat-history__textarea:focus-visible {\n outline: 2px solid var(--ring);\n outline-offset: 2px;\n}\n","import { Component, Event, EventEmitter, Prop, h } from '@stencil/core';\n\nconst CHAT_HISTORY_PLACEHOLDER = `[\n {\"role\": \"user\", \"content\": \"How do I import a saved suite?\"},\n {\"role\": \"model\", \"content\": \"Use Import and pick the JSON from Export suite.\"}\n]`;\n\nexport type ChatHistoryChangeDetail = {\n enabled: boolean;\n value: string;\n};\n\n@Component({\n tag: 'chat-history',\n styleUrl: 'chat-history.css',\n shadow: true,\n})\nexport class ChatHistory {\n @Prop() chatHistoryEnabled = false;\n @Prop() chatHistoryValue = '';\n\n @Event({ bubbles: true, composed: true })\n chatHistoryChange: EventEmitter<ChatHistoryChangeDetail>;\n\n private emit(detail: ChatHistoryChangeDetail) {\n this.chatHistoryChange.emit(detail);\n }\n\n private onToggle = (e: Event) => {\n const checked = (e.target as HTMLInputElement).checked;\n this.emit({ enabled: checked, value: this.chatHistoryValue });\n };\n\n private onTextInput = (e: Event) => {\n const value = (e.target as HTMLTextAreaElement).value;\n this.emit({ enabled: this.chatHistoryEnabled, value });\n };\n\n render() {\n return (\n <div class=\"chat-history\">\n <div class=\"chat-history__toggle-row\">\n <label class=\"chat-history__switch\">\n <input\n type=\"checkbox\"\n class=\"chat-history__switch-input\"\n checked={this.chatHistoryEnabled}\n onInput={this.onToggle}\n />\n <span class=\"chat-history__switch-ui\" aria-hidden=\"true\">\n <span class=\"chat-history__switch-thumb\" />\n </span>\n <span class=\"chat-history__switch-text\">Chat history</span>\n </label>\n </div>\n {this.chatHistoryEnabled ? (\n <textarea\n class=\"chat-history__textarea\"\n value={this.chatHistoryValue}\n rows={8}\n placeholder={CHAT_HISTORY_PLACEHOLDER}\n aria-label=\"Chat history\"\n onInput={this.onTextInput}\n />\n ) : null}\n </div>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAiB,IAAM,2zDCE7B,MAAMC,EAA2B,4J,MAepBC,EAAWC,EAAA,MAAAD,UAAAE,E,oIACdC,mBAAqB,MACrBC,iBAAmB,GAG3BC,kBAEQ,IAAAC,CAAKC,GACXC,KAAKH,kBAAkBC,KAAKC,E,CAGtBE,SAAYC,IAClB,MAAMC,EAAWD,EAAEE,OAA4BD,QAC/CH,KAAKF,KAAK,CAAEO,QAASF,EAASG,MAAON,KAAKJ,kBAAmB,EAGvDW,YAAeL,IACrB,MAAMI,EAASJ,EAAEE,OAA+BE,MAChDN,KAAKF,KAAK,CAAEO,QAASL,KAAKL,mBAAoBW,SAAQ,EAGxD,MAAAE,GACE,OACEC,EAAA,OAAAC,IAAA,2CAAKC,MAAM,gBACTF,EAAA,OAAAC,IAAA,2CAAKC,MAAM,4BACTF,EAAA,SAAAC,IAAA,2CAAOC,MAAM,wBACXF,EAAA,SAAAC,IAAA,2CACEE,KAAK,WACLD,MAAM,6BACNR,QAASH,KAAKL,mBACdkB,QAASb,KAAKC,WAEhBQ,EAAA,QAAAC,IAAA,2CAAMC,MAAM,0BAAyB,cAAa,QAChDF,EAAA,QAAAC,IAAA,2CAAMC,MAAM,gCAEdF,EAAA,QAAAC,IAAA,2CAAMC,MAAM,6BAA2B,kBAG1CX,KAAKL,mBACJc,EAAA,YACEE,MAAM,yBACNL,MAAON,KAAKJ,iBACZkB,KAAM,EACNC,YAAaxB,EAAwB,aAC1B,eACXsB,QAASb,KAAKO,cAEd,K","ignoreList":[]}