@recombine-ai/bosun 0.20.0 → 0.20.2

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 (102) hide show
  1. package/build/_app/immutable/assets/0.970vvoDj.css +1 -0
  2. package/build/_app/immutable/assets/0.970vvoDj.css.br +0 -0
  3. package/build/_app/immutable/assets/0.970vvoDj.css.gz +0 -0
  4. package/build/_app/immutable/chunks/{BSnTSnag.js → BOZLjogl.js} +1 -1
  5. package/build/_app/immutable/chunks/BOZLjogl.js.br +2 -0
  6. package/build/_app/immutable/chunks/BOZLjogl.js.gz +0 -0
  7. package/build/_app/immutable/chunks/CCtAgMW8.js +64 -0
  8. package/build/_app/immutable/chunks/CCtAgMW8.js.br +0 -0
  9. package/build/_app/immutable/chunks/CCtAgMW8.js.gz +0 -0
  10. package/build/_app/immutable/chunks/{Dne1wF_T.js → U2g-17s7.js} +1 -1
  11. package/build/_app/immutable/chunks/U2g-17s7.js.br +0 -0
  12. package/build/_app/immutable/chunks/U2g-17s7.js.gz +0 -0
  13. package/build/_app/immutable/chunks/{Xth-LXaZ.js → jbAfpNOj.js} +1 -1
  14. package/build/_app/immutable/chunks/jbAfpNOj.js.br +0 -0
  15. package/build/_app/immutable/chunks/jbAfpNOj.js.gz +0 -0
  16. package/build/_app/immutable/chunks/vxN0p6wG.js +1 -0
  17. package/build/_app/immutable/chunks/vxN0p6wG.js.br +2 -0
  18. package/build/_app/immutable/chunks/vxN0p6wG.js.gz +0 -0
  19. package/build/_app/immutable/entry/{app.B73YVKlJ.js → app.Nx0-kikH.js} +2 -2
  20. package/build/_app/immutable/entry/app.Nx0-kikH.js.br +0 -0
  21. package/build/_app/immutable/entry/app.Nx0-kikH.js.gz +0 -0
  22. package/build/_app/immutable/entry/start.t9PGFpmm.js +1 -0
  23. package/build/_app/immutable/entry/start.t9PGFpmm.js.br +1 -0
  24. package/build/_app/immutable/entry/start.t9PGFpmm.js.gz +0 -0
  25. package/build/_app/immutable/nodes/{0.CRuATwoa.js → 0.B5_ukjYU.js} +1 -1
  26. package/build/_app/immutable/nodes/0.B5_ukjYU.js.br +0 -0
  27. package/build/_app/immutable/nodes/0.B5_ukjYU.js.gz +0 -0
  28. package/build/_app/immutable/nodes/{1.BwTYt1ri.js → 1.BnET9__M.js} +1 -1
  29. package/build/_app/immutable/nodes/1.BnET9__M.js.br +0 -0
  30. package/build/_app/immutable/nodes/1.BnET9__M.js.gz +0 -0
  31. package/build/_app/immutable/nodes/16.C0hAGH9Y.js +3 -0
  32. package/build/_app/immutable/nodes/16.C0hAGH9Y.js.br +0 -0
  33. package/build/_app/immutable/nodes/16.C0hAGH9Y.js.gz +0 -0
  34. package/build/_app/immutable/nodes/{17.BW7FjO0Q.js → 17.DHifdmRv.js} +1 -1
  35. package/build/_app/immutable/nodes/17.DHifdmRv.js.br +0 -0
  36. package/build/_app/immutable/nodes/17.DHifdmRv.js.gz +0 -0
  37. package/build/_app/immutable/nodes/{2.Dzsy2J7Q.js → 2.0cl8Jw4o.js} +1 -1
  38. package/build/_app/immutable/nodes/2.0cl8Jw4o.js.br +0 -0
  39. package/build/_app/immutable/nodes/2.0cl8Jw4o.js.gz +0 -0
  40. package/build/_app/immutable/nodes/3.CxkjPmTD.js +1 -0
  41. package/build/_app/immutable/nodes/3.CxkjPmTD.js.br +0 -0
  42. package/build/_app/immutable/nodes/3.CxkjPmTD.js.gz +0 -0
  43. package/build/_app/immutable/nodes/{4.DfbxAWaw.js → 4.h7GzNdQ-.js} +1 -1
  44. package/build/_app/immutable/nodes/4.h7GzNdQ-.js.br +0 -0
  45. package/build/_app/immutable/nodes/4.h7GzNdQ-.js.gz +0 -0
  46. package/build/_app/immutable/nodes/{6.Bq16_9w3.js → 6.MjSRR3jo.js} +1 -1
  47. package/build/_app/immutable/nodes/6.MjSRR3jo.js.br +0 -0
  48. package/build/_app/immutable/nodes/6.MjSRR3jo.js.gz +0 -0
  49. package/build/_app/immutable/nodes/{9.C2W2D2GW.js → 9.BFI7-HIR.js} +1 -1
  50. package/build/_app/immutable/nodes/9.BFI7-HIR.js.br +0 -0
  51. package/build/_app/immutable/nodes/{9.C2W2D2GW.js.gz → 9.BFI7-HIR.js.gz} +0 -0
  52. package/build/_app/version.json +1 -1
  53. package/build/_app/version.json.br +0 -0
  54. package/build/_app/version.json.gz +0 -0
  55. package/build/index.html +10 -10
  56. package/build/index.html.br +0 -0
  57. package/build/index.html.gz +0 -0
  58. package/dist/index.js +61 -17
  59. package/dist/index.js.map +2 -2
  60. package/dist/types/backend/server.d.ts +1 -1
  61. package/dist/types/backend/telescope/router.d.ts +1 -1
  62. package/dist/types/lib/api-telescope/types.d.ts +29 -0
  63. package/package.json +1 -1
  64. package/build/_app/immutable/assets/0.CDmx-FLf.css +0 -1
  65. package/build/_app/immutable/assets/0.CDmx-FLf.css.br +0 -0
  66. package/build/_app/immutable/assets/0.CDmx-FLf.css.gz +0 -0
  67. package/build/_app/immutable/chunks/BSnTSnag.js.br +0 -0
  68. package/build/_app/immutable/chunks/BSnTSnag.js.gz +0 -0
  69. package/build/_app/immutable/chunks/Dne1wF_T.js.br +0 -0
  70. package/build/_app/immutable/chunks/Dne1wF_T.js.gz +0 -0
  71. package/build/_app/immutable/chunks/DoM_ZOrs.js +0 -1
  72. package/build/_app/immutable/chunks/DoM_ZOrs.js.br +0 -2
  73. package/build/_app/immutable/chunks/DoM_ZOrs.js.gz +0 -0
  74. package/build/_app/immutable/chunks/MIEISUXS.js +0 -64
  75. package/build/_app/immutable/chunks/MIEISUXS.js.br +0 -0
  76. package/build/_app/immutable/chunks/MIEISUXS.js.gz +0 -0
  77. package/build/_app/immutable/chunks/Xth-LXaZ.js.br +0 -0
  78. package/build/_app/immutable/chunks/Xth-LXaZ.js.gz +0 -0
  79. package/build/_app/immutable/entry/app.B73YVKlJ.js.br +0 -0
  80. package/build/_app/immutable/entry/app.B73YVKlJ.js.gz +0 -0
  81. package/build/_app/immutable/entry/start.59SUcW9F.js +0 -1
  82. package/build/_app/immutable/entry/start.59SUcW9F.js.br +0 -0
  83. package/build/_app/immutable/entry/start.59SUcW9F.js.gz +0 -0
  84. package/build/_app/immutable/nodes/0.CRuATwoa.js.br +0 -0
  85. package/build/_app/immutable/nodes/0.CRuATwoa.js.gz +0 -0
  86. package/build/_app/immutable/nodes/1.BwTYt1ri.js.br +0 -1
  87. package/build/_app/immutable/nodes/1.BwTYt1ri.js.gz +0 -0
  88. package/build/_app/immutable/nodes/16.CyAJjPYI.js +0 -3
  89. package/build/_app/immutable/nodes/16.CyAJjPYI.js.br +0 -0
  90. package/build/_app/immutable/nodes/16.CyAJjPYI.js.gz +0 -0
  91. package/build/_app/immutable/nodes/17.BW7FjO0Q.js.br +0 -0
  92. package/build/_app/immutable/nodes/17.BW7FjO0Q.js.gz +0 -0
  93. package/build/_app/immutable/nodes/2.Dzsy2J7Q.js.br +0 -0
  94. package/build/_app/immutable/nodes/2.Dzsy2J7Q.js.gz +0 -0
  95. package/build/_app/immutable/nodes/3.Cu2n_SuU.js +0 -1
  96. package/build/_app/immutable/nodes/3.Cu2n_SuU.js.br +0 -0
  97. package/build/_app/immutable/nodes/3.Cu2n_SuU.js.gz +0 -0
  98. package/build/_app/immutable/nodes/4.DfbxAWaw.js.br +0 -0
  99. package/build/_app/immutable/nodes/4.DfbxAWaw.js.gz +0 -0
  100. package/build/_app/immutable/nodes/6.Bq16_9w3.js.br +0 -0
  101. package/build/_app/immutable/nodes/6.Bq16_9w3.js.gz +0 -0
  102. package/build/_app/immutable/nodes/9.C2W2D2GW.js.br +0 -0
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/CUZn05nQ.js","../chunks/hePW80VL.js","../chunks/HclGiUj8.js","../chunks/C_yvzB4Z.js","../assets/editor.chSTM-fo.css","../assets/editor.BoJhDcRF.css"])))=>i.map(i=>d[i]);
2
- import{A as e,B as t,D as n,Dt as r,F as i,G as a,I as o,L as s,N as c,Nt as l,O as u,Ot as d,Pt as f,R as p,S as m,V as h,_ as g,a as _,at as v,b as ee,d as y,dt as b,et as x,f as S,g as C,gt as w,it as T,j as E,k as D,l as O,m as k,mt as A,n as j,o as M,ot as N,p as te,pt as P,q as F,r as I,st as L,tt as R,u as ne,w as re,x as z,z as B}from"../chunks/CPCsWwEy.js";import{t as V}from"../chunks/HclGiUj8.js";import"../chunks/xihTtKlq.js";import{t as H}from"../chunks/BSnTSnag.js";import{r as U,t as ie}from"../chunks/oarl--hZ.js";import{t as W}from"../chunks/6OCsQ6r7.js";import{t as ae}from"../chunks/Cf3l6QEG.js";import{n as oe,t as se}from"../chunks/BJqZY8o2.js";import{t as ce}from"../chunks/BP0Xadq7.js";import{i as le,t as ue}from"../chunks/BT98u4gR.js";import{t as G}from"../chunks/DWoqp3ac.js";import{a as de,c as fe,o as pe,r as K,s as me,t as he}from"../chunks/12bfCwgn.js";import{t as ge}from"../chunks/B9YnyJ2j.js";import{t as _e}from"../chunks/D3fLfD-Y.js";import{t as ve}from"../chunks/CL717zGu.js";var ye=/^[a-z0-9]+(-[a-z0-9]+)*$/,be=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!xe(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!xe(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!xe(e,n)?null:e}return null},xe=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function Se(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var Ce=Object.freeze({left:0,top:0,width:16,height:16}),we=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Te=Object.freeze({...Ce,...we}),Ee=Object.freeze({...Te,body:``,hidden:!1});function De(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Oe(e,t){let n=De(e,t);for(let r in Ee)r in we?r in e&&!(r in n)&&(n[r]=we[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ke(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Oe(r[e]||i[e],a)}return o(t),n.forEach(o),Oe(e,a)}function q(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=Se(e);for(let i in r){let a=r[i];a&&(t(i,ke(e,i,a)),n.push(i))}return n}var Ae={provider:``,aliases:{},not_found:{},...Ce};function je(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Me(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!je(e,Ae))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!je(t,Ee))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!je(t,Ee))return null}return t}var Ne=Object.create(null);function Pe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Fe(e,t){let n=Ne[e]||(Ne[e]=Object.create(null));return n[t]||(n[t]=Pe(e,t))}function J(e,t){return Me(t)?q(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Ie(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var Le=!1;function Re(e){return typeof e==`boolean`&&(Le=e),Le}function ze(e){let t=typeof e==`string`?be(e,!0,Le):e;if(t){let e=Fe(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function Be(e,t){let n=be(e,!0,Le);if(!n)return!1;let r=Fe(n.provider,n.prefix);return t?Ie(r,n.name,t):(r.missing.add(n.name),!0)}function Ve(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Le&&!t&&!e.prefix){let t=!1;return Me(e)&&(e.prefix=``,q(e,(e,n)=>{Be(e,n)&&(t=!0)})),t}let n=e.prefix;return xe({prefix:n,name:`a`})?!!J(Fe(t,n),e):!1}var He=Object.freeze({width:null,height:null}),Ue=Object.freeze({...He,...we}),Y=/(-?[0-9.]*[0-9]+[0-9.]*)/g,We=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function X(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Y);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=We.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ke(e,t){return e?`<defs>`+e+`</defs>`+t:t}function qe(e,t,n){let r=Ge(e);return Ke(r.defs,t+r.content+n)}var Z=e=>e===`unset`||e===`undefined`||e===`none`;function Je(e,t){let n={...Te,...e},r={...Ue,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=qe(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=X(d,c/l)):(u=o===`auto`?c:o,d=s===null?X(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Z(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Ye=/\sid="(\S+)"/g,Xe=new Map;function Ze(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=Xe.get(e)||0;return Xe.set(e,t+1),t?`${e}${t}`:e}function Qe(e){let t=[],n;for(;n=Ye.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=Ze(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var $e=Object.create(null);function et(e,t){$e[e]=t}function tt(e){return $e[e]||$e[``]}function nt(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var rt=Object.create(null),it=[`https://api.simplesvg.com`,`https://api.unisvg.com`],at=[];it.length>0;)it.length===1||Math.random()>.5?at.push(it.shift()):at.push(it.pop());rt[``]=nt({resources:[`https://api.iconify.design`].concat(at)});function Q(e,t){let n=nt(t);return n!==null&&(rt[e]=n,!0)}function $(e){return rt[e]}var ot=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function st(e,t){let n=$(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function ct(e){return e===404}var lt=(e,t,n)=>{let r=[],i=st(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function ut(e){if(typeof e==`string`){let t=$(e);if(t)return t.path}return`/`}var dt={prepare:lt,send:(e,t,n)=>{if(!ot){n(`abort`,424);return}let r=ut(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;ot(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(ct(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function ft(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function pt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||ft([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var mt=0;function ht(e,t,n){let r=mt++,i=ft.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function gt(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=Fe(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function _t(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?be(e,t,n):e;i&&r.push(i)}),r}var vt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function yt(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function ee(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function y(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?b():v());return}if(m(),ee(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function b(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(ee(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{y(i,e,t)}};f.push(i),l++,d=setTimeout(b,e.rotate),n(r,t,i.callback)}return setTimeout(b),_}function bt(e){let t={...vt,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=yt(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function xt(){}var St=Object.create(null);function Ct(e){if(!St[e]){let t=$(e);if(!t)return;St[e]={config:t,redundancy:bt(t)}}return St[e]}function wt(e,t,n){let r,i;if(typeof e==`string`){let t=tt(e);if(!t)return n(void 0,424),xt;i=t.send;let a=Ct(e);a&&(r=a.redundancy)}else{let t=nt(e);if(t){r=bt(t);let n=tt(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),xt):r.query(t,i,n)().abort}function Tt(){}function Et(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,pt(e)}))}function Dt(e){let t=[],n=[];return e.forEach(e=>{(e.match(ye)?t:n).push(e)}),{valid:t,invalid:n}}function Ot(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!J(e,n).length){r();return}}catch(e){console.error(e)}r(),Et(e)}function kt(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function At(e,t){e.iconsToLoad=e.iconsToLoad?e.iconsToLoad.concat(t).sort():t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){kt(e.loadIcons(r,n,t),t=>{Ot(e,r,t)});return}if(i){r.forEach(r=>{kt(i(r,n,t),t=>{Ot(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Dt(r);if(o.length&&Ot(e,o,null),!a.length)return;let s=n.match(ye)?tt(t):null;if(!s){Ot(e,a,null);return}s.prepare(t,n,a).forEach(n=>{wt(t,n,t=>{Ot(e,n.icons,t)})})}))}var jt=(e,t)=>{let n=gt(_t(e,!0,Re()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Tt)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(Fe(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=Fe(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&At(e,t)}),t?ht(t,n,i):Tt};function Mt(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in He?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Nt=/[\s,]+/;function Pt(e,t){t.split(Nt).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0}})}function Ft(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function It(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Lt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Rt(e){return`data:image/svg+xml,`+Lt(e)}function zt(e){return`url("`+Rt(e)+`")`}var Bt={...Ue,inline:!1},Vt={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Ht={display:`inline-block`},Ut={"background-color":`currentColor`},Wt={"background-color":`transparent`},Gt={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Kt={"-webkit-mask":Ut,mask:Ut,background:Wt};for(let e in Kt){let t=Kt[e];for(let n in Gt)t[e+`-`+n]=Gt[n]}function qt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}function Jt(e,t){let n=Mt(Bt,t),r=t.mode||`svg`,i=r===`svg`?{...Vt}:{};e.body.indexOf(`xlink:`)===-1&&delete i[`xmlns:xlink`];let a=typeof t.style==`string`?t.style:``;for(let e in t){let r=t[e];if(r!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:n[e]=r===!0||r===`true`||r===1;break;case`flip`:typeof r==`string`&&Pt(n,r);break;case`color`:a=a+(a.length>0&&a.trim().slice(-1)!==`;`?`;`:``)+`color: `+r+`; `;break;case`rotate`:typeof r==`string`?n[e]=Ft(r):typeof r==`number`&&(n[e]=r);break;case`ariaHidden`:case`aria-hidden`:r!==!0&&r!==`true`&&delete i[`aria-hidden`];break;default:if(e.slice(0,3)===`on:`)break;Bt[e]===void 0&&(i[e]=r)}}let o=Je(e,n),s=o.attributes;if(n.inline&&(a=`vertical-align: -0.125em; `+a),r===`svg`)return Object.assign(i,s),a!==``&&(i.style=a),{svg:!0,attributes:i,body:Qe(o.body)};let{body:c,width:l,height:u}=e,d=r===`mask`||r!==`bg`&&c.indexOf(`currentColor`)!==-1,f={"--svg":zt(It(c,{...s,width:l+``,height:u+``}))},p=e=>{let t=s[e];t&&(f[e]=qt(t))};p(`width`),p(`height`),Object.assign(f,Ht,d?Ut:Wt);let m=``;for(let e in f)m+=e+`: `+f[e]+`;`;return i.style=m+a,{svg:!1,attributes:i}}if(Re(!0),et(``,dt),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Ve(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Q(e,r)||console.error(n)}catch{console.error(n)}}}}function Yt(){try{return typeof window!=`object`}catch{return!0}}function Xt(e,t,n,r){function i(){t.loading&&=(t.loading.abort(),null)}if(typeof e==`object`&&e&&typeof e.body==`string`)return t.name=``,i(),{data:{...Te,...e}};let a;if(typeof e!=`string`||(a=be(e,!1,!0))===null)return i(),null;let o=ze(a);if(!o)return!Yt()&&(!t.loading||t.loading.name!==e)&&(i(),t.name=``,t.loading={name:e,abort:jt([a],n)}),null;i(),t.name!==e&&(t.name=e,r&&!t.destroyed&&setTimeout(()=>{r(e)}));let s=[`iconify`];return a.prefix!==``&&s.push(`iconify--`+a.prefix),a.provider!==``&&s.push(`iconify--`+a.provider),{data:o,classes:s}}function Zt(e,t){return e?Jt({...Te,...e},t):null}var Qt=new Set([`$$slots`,`$$events`,`$$legacy`]),$t=p(`<svg></svg>`),en=s(`<span></span>`);function tn(e,t){d(t,!0);let s={name:``,loading:null,destroyed:!1},c=M(t,Qt),l=P(0),u=w(()=>(a(l),Xt(t.icon,s,m,t.onload))),p=w(()=>{let e=a(u)?Zt(a(u).data,c):null;return e&&a(u).classes&&c.class===void 0&&(e.attributes.class=(typeof c.class==`string`?c.class+` `:``)+a(u).classes.join(` `)),e});function m(){A(l)}j(()=>{s.destroyed=!0,s.loading&&=(s.loading.abort(),null)});var h=o(),g=v(h),_=e=>{var t=o(),r=v(t),s=e=>{var t=$t();S(t,()=>({...a(p).attributes})),n(t,()=>a(p).body,!0),f(t),i(e,t)},c=e=>{var t=en();S(t,()=>({...a(p).attributes})),i(e,t)};E(r,e=>{a(p).svg?e(s):e(c,-1)}),i(e,t)};E(g,e=>{a(p)&&e(_)}),i(e,h),r()}var nn=s(`<div class="w-full"></div>`);function rn(e,t){d(t,!0);let n=P(null),o=null,s=[],c=null,l=!1,u,f=_(t,`language`,3,`plaintext`),p=_(t,`height`,3,120),m=_(t,`readOnly`,3,!1),h=null,g=P(!1),v=P(!1);function y(e){a(v)||e.stopPropagation()}I(async()=>{if(!u)return;u.addEventListener(`wheel`,y,{capture:!0,passive:!0}),me();let e=await V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);if(l)return;c=e,pe(e);let r=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`;b(n,e.editor.create(u,{...de(`test-history`),value:t.value??``,language:r,readOnly:m(),domReadOnly:m()}),!0);let i=a(n);if(!i)return;o=i.getModel(),h=K(e,i),h.update(t.highlights??[]),b(g,!0),s.push(i.onDidFocusEditorText(()=>{b(v,!0)})),s.push(i.onDidChangeModelContent(()=>{try{let e=i.getValue();if(e===t.value)return;t.onChange?.(e)}catch(e){console.error(`MiniEditor change error`,e)}})),s.push(i.onDidBlurEditorText(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}}));let d=i.onDidFocusEditorWidget?.(()=>{b(v,!0)});d&&s.push(d);let p=i.onDidBlurEditorWidget?.(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}});p&&s.push(p)}),j(()=>{l=!0,b(g,!1);try{u.removeEventListener(`wheel`,y,{capture:!0})}catch{}for(let e of s)try{e.dispose()}catch{}s=[],h?.dispose(),h=null;let e=o;o=null;try{if(a(n)){try{a(n).setModel(null)}catch{}a(n).dispose()}}finally{b(n,null)}try{e?.dispose()}catch{}c=null}),R(()=>{if(!a(n))return;let e=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`,t=a(n).getModel();if(!t||t.getLanguageId()===e)return;let r=!1;return(c?Promise.resolve(c):V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).then(n=>{if(!r)try{n.editor.setModelLanguage(t,e)}catch{}}),()=>{r=!0}}),R(()=>{let e=t.value??``,r=t.highlights??[];!a(n)||!a(g)||(e!==a(n).getValue()&&a(n).setValue(e),h?.update(r))}),R(()=>{a(n)?.updateOptions({readOnly:m(),domReadOnly:m()})});var S=nn();O(S,e=>u=e,()=>u),x(()=>ee(S,`height:${p()}px`)),i(e,S),r()}var an=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Fix</button>`),on=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Analyze</button>`),sn=s(`<div><div class="mb-1 text-xs text-rc-gray-300"> </div> <div class="whitespace-pre-wrap break-words text-rc-gray-100"> </div></div>`),cn=s(`<div class="flex flex-col gap-3"></div>`),ln=s(`<div class="p-2 text-rc-gray-300">Loading…</div>`),un=s(`<div class="p-2 text-red-400"> </div>`),dn=s(`<div class="flex h-full flex-col gap-2"><div class="grid grid-cols-2 gap-2"><div class="flex items-center justify-start"><!></div> <div class="flex items-center justify-end"><!></div></div> <!></div>`),fn=s(`<div class="h-[55vh]"><!></div>`),pn=s(`<!> <!> <!>`,1),mn=s(`<!> <div class="mt-2 h-[55vh]"><!></div>`,1),hn=s(`<div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1"><!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400"> </button> <!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">See variants</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Prompt</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Conversation</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Context</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Debug</button></div> <!> <!> <!>`,1);function gn(e,t){d(t,!0);let n=_(t,`actionsDisabled`,3,!1),o=_(t,`actionsInert`,3,!1),s=_(t,`addTestDisabled`,3,!1),p=_(t,`showAnalyze`,3,!0),m=_(t,`analyzeDisabled`,3,!1),g=_(t,`fixDisabled`,3,!1),ee=P(!1),y=P(!1),S=P(!1),C=P(`errors`),D=P(`prompt`),O=P(null),k=P(null),A=P(null),M=P(null),te=P(null),F=P(null),I=P(null),R=P(L({prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1})),ne=P(L({prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null})),re=0,V=P(null),H=null,U=P(`idle`),ie=null;function ae(e){try{return{raw:e,formatted:JSON.stringify(JSON.parse(e),null,2)}}catch{return{raw:e,formatted:e}}}async function le(e){return ae(await G.tests.resultEntry.query({agent:e.agent,testId:e.id,resultKey:e.key,timestamp:e.timestamp,index:e.run}))}function ue(e){return e===`prompt`?a(k)!==null&&a(O)!==null:e===`conversation`?a(A)!==null:e===`context`?a(M)!==null:e===`errors`?a(te)!==null:e===`traces`?a(F)!==null:a(I)!==null}async function de(e){if(ue(e)||a(R)[e])return;let n=re;b(R,{...a(R),[e]:!0},!0),b(ne,{...a(ne),[e]:null},!0);try{if(e===`prompt`){let[e,r]=await Promise.all([le(t.links.renderedPrompt),le(t.links.receivedPrompt)]);if(n!==re)return;b(O,e,!0),b(k,r,!0)}else{let r=await le(e===`conversation`?t.links.conversation:e===`context`?t.links.context:e===`errors`?t.links.errors:e===`traces`?t.links.traces:t.links.logs);if(n!==re)return;b(e===`conversation`?A:e===`context`?M:e===`errors`?te:e===`traces`?F:I,r,!0)}}catch(t){if(n!==re)return;console.error(t),b(ne,{...a(ne),[e]:`Failed to load content`},!0)}finally{n===re&&b(R,{...a(R),[e]:!1},!0)}}function fe(){b(O,null),b(k,null),b(A,null),b(M,null),b(te,null),b(F,null),b(I,null),b(R,{prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1},!0),b(ne,{prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null},!0)}function pe(){re+=1,b(C,`errors`),fe(),b(ee,!0),de(`errors`)}function K(e){re+=1,b(D,e,!0),fe(),b(y,!0),de(e)}function me(e){return e===`prompt`?`Prompt`:e===`conversation`?`Conversation`:`Context`}function ge(e){b(C,e,!0),de(e)}async function _e(){if(a(U)!==`adding`){b(U,`adding`);try{await t.onAddTest(),b(U,`added`)}catch(e){console.error(`Failed to add test`,e),b(U,`failed`)}ie&&clearTimeout(ie),ie=window.setTimeout(()=>{b(U,`idle`),ie=null},2500)}}async function ye(e){if(!(!a(k)||!a(O)))try{let t=e===`raw`?a(k).raw:a(O).raw;await navigator.clipboard.writeText(t),b(V,e,!0),H&&clearTimeout(H),H=window.setTimeout(()=>{b(V,null),H=null},2e3)}catch(e){console.error(`Failed to copy prompt`,e)}}j(()=>{re+=1,H&&clearTimeout(H),ie&&clearTimeout(ie)});var be=hn(),xe=v(be),Se=T(xe),Ce=e=>{var r=an();x(()=>{r.inert=o(),r.disabled=n()||g()}),h(`click`,r,function(...e){t.onFix?.apply(this,e)}),i(e,r)};E(Se,e=>{t.onFix&&e(Ce)});var we=N(Se,2),Te=T(we,!0);f(we);var Ee=N(we,2),De=e=>{var n=on();x(()=>n.disabled=m()),h(`click`,n,function(...e){t.onAnalyze?.apply(this,e)}),i(e,n)};E(Ee,e=>{p()&&e(De)});var Oe=N(Ee,2),ke=N(Oe,2),q=N(ke,2),Ae=N(q,2),je=N(Ae,2);f(xe);var Me=N(xe,2),Ne=e=>{{let n=e=>{var n=cn();u(n,21,()=>t.variants,e=>e.index,(e,n)=>{var r=sn(),o=T(r),s=T(o);f(o);var l=N(o,2),u=T(l,!0);f(l),f(r),x(()=>{z(r,1,`rounded-lg border p-3 ${a(n).index===t.runIndex?`border-rc-green-450`:`border-rc-gray-650`} ${a(n).success?`bg-rc-green-700/80`:`bg-rc-gray-900/60`}`),c(s,`Run ${a(n).index??``}${a(n).index===t.runIndex?` • selected`:``}`),c(u,a(n).text||a(n).errors||`—`)}),i(e,r)}),f(n),i(e,n)},r=w(()=>`Variants — ${t.scenario||`Test`}`);ce(e,{get title(){return a(r)},class:`!w-[80vw] !max-w-4xl`,get open(){return a(S)},set open(e){b(S,e,!0)},children:n,$$slots:{default:!0}})}};E(Me,e=>{a(S)&&e(Ne)});var Pe=N(Me,2),Fe=e=>{{let n=e=>{var t=fn(),n=T(t),r=e=>{var t=ln();i(e,t)},o=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(D)])),i(e,t)},s=e=>{var t=dn(),n=T(t),r=T(n),o=T(r);{let e=w(()=>!a(k).raw.trim());W(o,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`raw`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`raw`?`Copied raw prompt`:`Copy raw prompt`)),i(e,n)},$$slots:{default:!0}})}f(r);var s=N(r,2),u=T(s);{let e=w(()=>!a(O).raw.trim());W(u,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`rendered`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`rendered`?`Copied rendered prompt`:`Copy rendered prompt`)),i(e,n)},$$slots:{default:!0}})}f(s),f(n);var d=N(n,2);he(d,{variant:`generic`,get original(){return a(k).formatted},get modified(){return a(O).formatted},language:`markdown`,class:`min-h-0 flex-1`}),f(t),i(e,t)},u=e=>{{let t=w(()=>a(A).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},d=e=>{{let t=w(()=>a(M).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}};E(n,e=>{a(R)[a(D)]?e(r):a(ne)[a(D)]?e(o,1):a(D)===`prompt`&&a(k)&&a(O)?e(s,2):a(D)===`conversation`&&a(A)?e(u,3):a(D)===`context`&&a(M)&&e(d,4)}),f(t),i(e,t)},r=w(()=>`${me(a(D))} — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(y)},set open(e){b(y,e,!0)},children:n,$$slots:{default:!0}})}};E(Pe,e=>{a(y)&&e(Fe)});var J=N(Pe,2),Ie=e=>{{let n=e=>{var t=mn(),n=v(t);oe(n,{get value(){return a(C)},ariaLabel:`Test run debug tabs`,onChange:({value:e})=>ge(e),children:(e,t)=>{var n=pn(),r=v(n);se(r,{value:`errors`,class:`px-3`,children:(e,t)=>{l();var n=B(`Errors`);i(e,n)},$$slots:{default:!0}});var a=N(r,2);se(a,{value:`traces`,class:`px-3`,children:(e,t)=>{l();var n=B(`Traces`);i(e,n)},$$slots:{default:!0}});var o=N(a,2);se(o,{value:`logs`,class:`px-3`,children:(e,t)=>{l();var n=B(`Logs`);i(e,n)},$$slots:{default:!0}}),i(e,n)},$$slots:{default:!0}});var r=N(n,2),o=T(r),s=e=>{var t=ln();i(e,t)},u=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(C)])),i(e,t)},d=e=>{{let t=w(()=>a(te).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},p=e=>{{let t=w(()=>a(F).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}},m=e=>{{let t=w(()=>a(I).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}};E(o,e=>{a(R)[a(C)]?e(s):a(ne)[a(C)]?e(u,1):a(C)===`errors`&&a(te)?e(d,2):a(C)===`traces`&&a(F)?e(p,3):a(C)===`logs`&&a(I)&&e(m,4)}),f(r),i(e,t)},r=w(()=>`Debug — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(ee)},set open(e){b(ee,e,!0)},children:n,$$slots:{default:!0}})}};E(J,e=>{a(ee)&&e(Ie)}),x(()=>{we.inert=o(),we.disabled=n()||s()||a(U)===`adding`,c(Te,a(U)===`adding`?`Adding…`:a(U)===`added`?`Added`:a(U)===`failed`?`Failed`:`Add test`)}),h(`click`,we,_e),h(`click`,Oe,()=>b(S,!0)),h(`click`,ke,()=>K(`prompt`)),h(`click`,q,()=>K(`conversation`)),h(`click`,Ae,()=>K(`context`)),h(`click`,je,pe),i(e,be),r()}t([`click`]);var _n=`Update the conversation history so it reflects behaviour that is valid under the current prompt. Preserve the test's intent and expected outcome, and make only the smallest necessary changes. Possible roles: "Agent", "User", "System"`;function vn(e,t){return[e.trim()===`LLM`?``:e.trim(),t.trim()].filter(Boolean).join(` `)}function yn(e){let t=vn(e.assertionLabel,e.assertionValue);return`You will be given the context, the conversation and the desired output and assertion about it. First, find why the prompt is not producing the correct result. It's usually one concrete instruction within the relevant section, or a contradiction. Then, change the prompt minimally so this will work, but keeping the prompt clean and comprehensive is more important. Try to provide as general solution as possible. Try to change just one part of the prompt, not multiple parts. Avoid adding exceptions and overrides. Avoid duplicating information that already exists in the prompt.
2
+ import{A as e,B as t,D as n,Dt as r,F as i,G as a,I as o,L as s,N as c,Nt as l,O as u,Ot as d,Pt as f,R as p,S as m,V as h,_ as g,a as _,at as v,b as ee,d as y,dt as b,et as x,f as S,g as C,gt as w,it as T,j as E,k as D,l as O,m as k,mt as A,n as j,o as M,ot as N,p as te,pt as P,q as F,r as I,st as L,tt as R,u as ne,w as re,x as z,z as B}from"../chunks/CPCsWwEy.js";import{t as V}from"../chunks/HclGiUj8.js";import"../chunks/xihTtKlq.js";import{t as H}from"../chunks/BOZLjogl.js";import{r as U,t as ie}from"../chunks/oarl--hZ.js";import{t as W}from"../chunks/6OCsQ6r7.js";import{t as ae}from"../chunks/Cf3l6QEG.js";import{n as oe,t as se}from"../chunks/BJqZY8o2.js";import{t as ce}from"../chunks/BP0Xadq7.js";import{i as le,t as ue}from"../chunks/BT98u4gR.js";import{t as G}from"../chunks/DWoqp3ac.js";import{a as de,c as fe,o as pe,r as K,s as me,t as he}from"../chunks/12bfCwgn.js";import{t as ge}from"../chunks/B9YnyJ2j.js";import{t as _e}from"../chunks/D3fLfD-Y.js";import{t as ve}from"../chunks/CL717zGu.js";var ye=/^[a-z0-9]+(-[a-z0-9]+)*$/,be=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!xe(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!xe(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!xe(e,n)?null:e}return null},xe=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function Se(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var Ce=Object.freeze({left:0,top:0,width:16,height:16}),we=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Te=Object.freeze({...Ce,...we}),Ee=Object.freeze({...Te,body:``,hidden:!1});function De(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Oe(e,t){let n=De(e,t);for(let r in Ee)r in we?r in e&&!(r in n)&&(n[r]=we[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ke(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Oe(r[e]||i[e],a)}return o(t),n.forEach(o),Oe(e,a)}function q(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=Se(e);for(let i in r){let a=r[i];a&&(t(i,ke(e,i,a)),n.push(i))}return n}var Ae={provider:``,aliases:{},not_found:{},...Ce};function je(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Me(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!je(e,Ae))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!je(t,Ee))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!je(t,Ee))return null}return t}var Ne=Object.create(null);function Pe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Fe(e,t){let n=Ne[e]||(Ne[e]=Object.create(null));return n[t]||(n[t]=Pe(e,t))}function J(e,t){return Me(t)?q(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Ie(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var Le=!1;function Re(e){return typeof e==`boolean`&&(Le=e),Le}function ze(e){let t=typeof e==`string`?be(e,!0,Le):e;if(t){let e=Fe(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function Be(e,t){let n=be(e,!0,Le);if(!n)return!1;let r=Fe(n.provider,n.prefix);return t?Ie(r,n.name,t):(r.missing.add(n.name),!0)}function Ve(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Le&&!t&&!e.prefix){let t=!1;return Me(e)&&(e.prefix=``,q(e,(e,n)=>{Be(e,n)&&(t=!0)})),t}let n=e.prefix;return xe({prefix:n,name:`a`})?!!J(Fe(t,n),e):!1}var He=Object.freeze({width:null,height:null}),Ue=Object.freeze({...He,...we}),Y=/(-?[0-9.]*[0-9]+[0-9.]*)/g,We=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function X(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Y);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=We.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ke(e,t){return e?`<defs>`+e+`</defs>`+t:t}function qe(e,t,n){let r=Ge(e);return Ke(r.defs,t+r.content+n)}var Z=e=>e===`unset`||e===`undefined`||e===`none`;function Je(e,t){let n={...Te,...e},r={...Ue,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=qe(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=X(d,c/l)):(u=o===`auto`?c:o,d=s===null?X(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Z(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Ye=/\sid="(\S+)"/g,Xe=new Map;function Ze(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=Xe.get(e)||0;return Xe.set(e,t+1),t?`${e}${t}`:e}function Qe(e){let t=[],n;for(;n=Ye.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=Ze(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var $e=Object.create(null);function et(e,t){$e[e]=t}function tt(e){return $e[e]||$e[``]}function nt(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var rt=Object.create(null),it=[`https://api.simplesvg.com`,`https://api.unisvg.com`],at=[];it.length>0;)it.length===1||Math.random()>.5?at.push(it.shift()):at.push(it.pop());rt[``]=nt({resources:[`https://api.iconify.design`].concat(at)});function Q(e,t){let n=nt(t);return n!==null&&(rt[e]=n,!0)}function $(e){return rt[e]}var ot=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function st(e,t){let n=$(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function ct(e){return e===404}var lt=(e,t,n)=>{let r=[],i=st(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function ut(e){if(typeof e==`string`){let t=$(e);if(t)return t.path}return`/`}var dt={prepare:lt,send:(e,t,n)=>{if(!ot){n(`abort`,424);return}let r=ut(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;ot(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(ct(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function ft(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function pt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||ft([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var mt=0;function ht(e,t,n){let r=mt++,i=ft.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function gt(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=Fe(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function _t(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?be(e,t,n):e;i&&r.push(i)}),r}var vt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function yt(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function ee(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function y(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?b():v());return}if(m(),ee(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function b(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(ee(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{y(i,e,t)}};f.push(i),l++,d=setTimeout(b,e.rotate),n(r,t,i.callback)}return setTimeout(b),_}function bt(e){let t={...vt,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=yt(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function xt(){}var St=Object.create(null);function Ct(e){if(!St[e]){let t=$(e);if(!t)return;St[e]={config:t,redundancy:bt(t)}}return St[e]}function wt(e,t,n){let r,i;if(typeof e==`string`){let t=tt(e);if(!t)return n(void 0,424),xt;i=t.send;let a=Ct(e);a&&(r=a.redundancy)}else{let t=nt(e);if(t){r=bt(t);let n=tt(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),xt):r.query(t,i,n)().abort}function Tt(){}function Et(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,pt(e)}))}function Dt(e){let t=[],n=[];return e.forEach(e=>{(e.match(ye)?t:n).push(e)}),{valid:t,invalid:n}}function Ot(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!J(e,n).length){r();return}}catch(e){console.error(e)}r(),Et(e)}function kt(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function At(e,t){e.iconsToLoad=e.iconsToLoad?e.iconsToLoad.concat(t).sort():t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){kt(e.loadIcons(r,n,t),t=>{Ot(e,r,t)});return}if(i){r.forEach(r=>{kt(i(r,n,t),t=>{Ot(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Dt(r);if(o.length&&Ot(e,o,null),!a.length)return;let s=n.match(ye)?tt(t):null;if(!s){Ot(e,a,null);return}s.prepare(t,n,a).forEach(n=>{wt(t,n,t=>{Ot(e,n.icons,t)})})}))}var jt=(e,t)=>{let n=gt(_t(e,!0,Re()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Tt)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(Fe(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=Fe(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&At(e,t)}),t?ht(t,n,i):Tt};function Mt(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in He?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Nt=/[\s,]+/;function Pt(e,t){t.split(Nt).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0}})}function Ft(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function It(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Lt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Rt(e){return`data:image/svg+xml,`+Lt(e)}function zt(e){return`url("`+Rt(e)+`")`}var Bt={...Ue,inline:!1},Vt={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Ht={display:`inline-block`},Ut={"background-color":`currentColor`},Wt={"background-color":`transparent`},Gt={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Kt={"-webkit-mask":Ut,mask:Ut,background:Wt};for(let e in Kt){let t=Kt[e];for(let n in Gt)t[e+`-`+n]=Gt[n]}function qt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}function Jt(e,t){let n=Mt(Bt,t),r=t.mode||`svg`,i=r===`svg`?{...Vt}:{};e.body.indexOf(`xlink:`)===-1&&delete i[`xmlns:xlink`];let a=typeof t.style==`string`?t.style:``;for(let e in t){let r=t[e];if(r!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:n[e]=r===!0||r===`true`||r===1;break;case`flip`:typeof r==`string`&&Pt(n,r);break;case`color`:a=a+(a.length>0&&a.trim().slice(-1)!==`;`?`;`:``)+`color: `+r+`; `;break;case`rotate`:typeof r==`string`?n[e]=Ft(r):typeof r==`number`&&(n[e]=r);break;case`ariaHidden`:case`aria-hidden`:r!==!0&&r!==`true`&&delete i[`aria-hidden`];break;default:if(e.slice(0,3)===`on:`)break;Bt[e]===void 0&&(i[e]=r)}}let o=Je(e,n),s=o.attributes;if(n.inline&&(a=`vertical-align: -0.125em; `+a),r===`svg`)return Object.assign(i,s),a!==``&&(i.style=a),{svg:!0,attributes:i,body:Qe(o.body)};let{body:c,width:l,height:u}=e,d=r===`mask`||r!==`bg`&&c.indexOf(`currentColor`)!==-1,f={"--svg":zt(It(c,{...s,width:l+``,height:u+``}))},p=e=>{let t=s[e];t&&(f[e]=qt(t))};p(`width`),p(`height`),Object.assign(f,Ht,d?Ut:Wt);let m=``;for(let e in f)m+=e+`: `+f[e]+`;`;return i.style=m+a,{svg:!1,attributes:i}}if(Re(!0),et(``,dt),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Ve(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Q(e,r)||console.error(n)}catch{console.error(n)}}}}function Yt(){try{return typeof window!=`object`}catch{return!0}}function Xt(e,t,n,r){function i(){t.loading&&=(t.loading.abort(),null)}if(typeof e==`object`&&e&&typeof e.body==`string`)return t.name=``,i(),{data:{...Te,...e}};let a;if(typeof e!=`string`||(a=be(e,!1,!0))===null)return i(),null;let o=ze(a);if(!o)return!Yt()&&(!t.loading||t.loading.name!==e)&&(i(),t.name=``,t.loading={name:e,abort:jt([a],n)}),null;i(),t.name!==e&&(t.name=e,r&&!t.destroyed&&setTimeout(()=>{r(e)}));let s=[`iconify`];return a.prefix!==``&&s.push(`iconify--`+a.prefix),a.provider!==``&&s.push(`iconify--`+a.provider),{data:o,classes:s}}function Zt(e,t){return e?Jt({...Te,...e},t):null}var Qt=new Set([`$$slots`,`$$events`,`$$legacy`]),$t=p(`<svg></svg>`),en=s(`<span></span>`);function tn(e,t){d(t,!0);let s={name:``,loading:null,destroyed:!1},c=M(t,Qt),l=P(0),u=w(()=>(a(l),Xt(t.icon,s,m,t.onload))),p=w(()=>{let e=a(u)?Zt(a(u).data,c):null;return e&&a(u).classes&&c.class===void 0&&(e.attributes.class=(typeof c.class==`string`?c.class+` `:``)+a(u).classes.join(` `)),e});function m(){A(l)}j(()=>{s.destroyed=!0,s.loading&&=(s.loading.abort(),null)});var h=o(),g=v(h),_=e=>{var t=o(),r=v(t),s=e=>{var t=$t();S(t,()=>({...a(p).attributes})),n(t,()=>a(p).body,!0),f(t),i(e,t)},c=e=>{var t=en();S(t,()=>({...a(p).attributes})),i(e,t)};E(r,e=>{a(p).svg?e(s):e(c,-1)}),i(e,t)};E(g,e=>{a(p)&&e(_)}),i(e,h),r()}var nn=s(`<div class="w-full"></div>`);function rn(e,t){d(t,!0);let n=P(null),o=null,s=[],c=null,l=!1,u,f=_(t,`language`,3,`plaintext`),p=_(t,`height`,3,120),m=_(t,`readOnly`,3,!1),h=null,g=P(!1),v=P(!1);function y(e){a(v)||e.stopPropagation()}I(async()=>{if(!u)return;u.addEventListener(`wheel`,y,{capture:!0,passive:!0}),me();let e=await V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);if(l)return;c=e,pe(e);let r=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`;b(n,e.editor.create(u,{...de(`test-history`),value:t.value??``,language:r,readOnly:m(),domReadOnly:m()}),!0);let i=a(n);if(!i)return;o=i.getModel(),h=K(e,i),h.update(t.highlights??[]),b(g,!0),s.push(i.onDidFocusEditorText(()=>{b(v,!0)})),s.push(i.onDidChangeModelContent(()=>{try{let e=i.getValue();if(e===t.value)return;t.onChange?.(e)}catch(e){console.error(`MiniEditor change error`,e)}})),s.push(i.onDidBlurEditorText(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}}));let d=i.onDidFocusEditorWidget?.(()=>{b(v,!0)});d&&s.push(d);let p=i.onDidBlurEditorWidget?.(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}});p&&s.push(p)}),j(()=>{l=!0,b(g,!1);try{u.removeEventListener(`wheel`,y,{capture:!0})}catch{}for(let e of s)try{e.dispose()}catch{}s=[],h?.dispose(),h=null;let e=o;o=null;try{if(a(n)){try{a(n).setModel(null)}catch{}a(n).dispose()}}finally{b(n,null)}try{e?.dispose()}catch{}c=null}),R(()=>{if(!a(n))return;let e=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`,t=a(n).getModel();if(!t||t.getLanguageId()===e)return;let r=!1;return(c?Promise.resolve(c):V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).then(n=>{if(!r)try{n.editor.setModelLanguage(t,e)}catch{}}),()=>{r=!0}}),R(()=>{let e=t.value??``,r=t.highlights??[];!a(n)||!a(g)||(e!==a(n).getValue()&&a(n).setValue(e),h?.update(r))}),R(()=>{a(n)?.updateOptions({readOnly:m(),domReadOnly:m()})});var S=nn();O(S,e=>u=e,()=>u),x(()=>ee(S,`height:${p()}px`)),i(e,S),r()}var an=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Fix</button>`),on=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Analyze</button>`),sn=s(`<div><div class="mb-1 text-xs text-rc-gray-300"> </div> <div class="whitespace-pre-wrap break-words text-rc-gray-100"> </div></div>`),cn=s(`<div class="flex flex-col gap-3"></div>`),ln=s(`<div class="p-2 text-rc-gray-300">Loading…</div>`),un=s(`<div class="p-2 text-red-400"> </div>`),dn=s(`<div class="flex h-full flex-col gap-2"><div class="grid grid-cols-2 gap-2"><div class="flex items-center justify-start"><!></div> <div class="flex items-center justify-end"><!></div></div> <!></div>`),fn=s(`<div class="h-[55vh]"><!></div>`),pn=s(`<!> <!> <!>`,1),mn=s(`<!> <div class="mt-2 h-[55vh]"><!></div>`,1),hn=s(`<div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1"><!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400"> </button> <!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">See variants</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Prompt</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Conversation</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Context</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Debug</button></div> <!> <!> <!>`,1);function gn(e,t){d(t,!0);let n=_(t,`actionsDisabled`,3,!1),o=_(t,`actionsInert`,3,!1),s=_(t,`addTestDisabled`,3,!1),p=_(t,`showAnalyze`,3,!0),m=_(t,`analyzeDisabled`,3,!1),g=_(t,`fixDisabled`,3,!1),ee=P(!1),y=P(!1),S=P(!1),C=P(`errors`),D=P(`prompt`),O=P(null),k=P(null),A=P(null),M=P(null),te=P(null),F=P(null),I=P(null),R=P(L({prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1})),ne=P(L({prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null})),re=0,V=P(null),H=null,U=P(`idle`),ie=null;function ae(e){try{return{raw:e,formatted:JSON.stringify(JSON.parse(e),null,2)}}catch{return{raw:e,formatted:e}}}async function le(e){return ae(await G.tests.resultEntry.query({agent:e.agent,testId:e.id,resultKey:e.key,timestamp:e.timestamp,index:e.run}))}function ue(e){return e===`prompt`?a(k)!==null&&a(O)!==null:e===`conversation`?a(A)!==null:e===`context`?a(M)!==null:e===`errors`?a(te)!==null:e===`traces`?a(F)!==null:a(I)!==null}async function de(e){if(ue(e)||a(R)[e])return;let n=re;b(R,{...a(R),[e]:!0},!0),b(ne,{...a(ne),[e]:null},!0);try{if(e===`prompt`){let[e,r]=await Promise.all([le(t.links.renderedPrompt),le(t.links.receivedPrompt)]);if(n!==re)return;b(O,e,!0),b(k,r,!0)}else{let r=await le(e===`conversation`?t.links.conversation:e===`context`?t.links.context:e===`errors`?t.links.errors:e===`traces`?t.links.traces:t.links.logs);if(n!==re)return;b(e===`conversation`?A:e===`context`?M:e===`errors`?te:e===`traces`?F:I,r,!0)}}catch(t){if(n!==re)return;console.error(t),b(ne,{...a(ne),[e]:`Failed to load content`},!0)}finally{n===re&&b(R,{...a(R),[e]:!1},!0)}}function fe(){b(O,null),b(k,null),b(A,null),b(M,null),b(te,null),b(F,null),b(I,null),b(R,{prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1},!0),b(ne,{prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null},!0)}function pe(){re+=1,b(C,`errors`),fe(),b(ee,!0),de(`errors`)}function K(e){re+=1,b(D,e,!0),fe(),b(y,!0),de(e)}function me(e){return e===`prompt`?`Prompt`:e===`conversation`?`Conversation`:`Context`}function ge(e){b(C,e,!0),de(e)}async function _e(){if(a(U)!==`adding`){b(U,`adding`);try{await t.onAddTest(),b(U,`added`)}catch(e){console.error(`Failed to add test`,e),b(U,`failed`)}ie&&clearTimeout(ie),ie=window.setTimeout(()=>{b(U,`idle`),ie=null},2500)}}async function ye(e){if(!(!a(k)||!a(O)))try{let t=e===`raw`?a(k).raw:a(O).raw;await navigator.clipboard.writeText(t),b(V,e,!0),H&&clearTimeout(H),H=window.setTimeout(()=>{b(V,null),H=null},2e3)}catch(e){console.error(`Failed to copy prompt`,e)}}j(()=>{re+=1,H&&clearTimeout(H),ie&&clearTimeout(ie)});var be=hn(),xe=v(be),Se=T(xe),Ce=e=>{var r=an();x(()=>{r.inert=o(),r.disabled=n()||g()}),h(`click`,r,function(...e){t.onFix?.apply(this,e)}),i(e,r)};E(Se,e=>{t.onFix&&e(Ce)});var we=N(Se,2),Te=T(we,!0);f(we);var Ee=N(we,2),De=e=>{var n=on();x(()=>n.disabled=m()),h(`click`,n,function(...e){t.onAnalyze?.apply(this,e)}),i(e,n)};E(Ee,e=>{p()&&e(De)});var Oe=N(Ee,2),ke=N(Oe,2),q=N(ke,2),Ae=N(q,2),je=N(Ae,2);f(xe);var Me=N(xe,2),Ne=e=>{{let n=e=>{var n=cn();u(n,21,()=>t.variants,e=>e.index,(e,n)=>{var r=sn(),o=T(r),s=T(o);f(o);var l=N(o,2),u=T(l,!0);f(l),f(r),x(()=>{z(r,1,`rounded-lg border p-3 ${a(n).index===t.runIndex?`border-rc-green-450`:`border-rc-gray-650`} ${a(n).success?`bg-rc-green-700/80`:`bg-rc-gray-900/60`}`),c(s,`Run ${a(n).index??``}${a(n).index===t.runIndex?` • selected`:``}`),c(u,a(n).text||a(n).errors||`—`)}),i(e,r)}),f(n),i(e,n)},r=w(()=>`Variants — ${t.scenario||`Test`}`);ce(e,{get title(){return a(r)},class:`!w-[80vw] !max-w-4xl`,get open(){return a(S)},set open(e){b(S,e,!0)},children:n,$$slots:{default:!0}})}};E(Me,e=>{a(S)&&e(Ne)});var Pe=N(Me,2),Fe=e=>{{let n=e=>{var t=fn(),n=T(t),r=e=>{var t=ln();i(e,t)},o=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(D)])),i(e,t)},s=e=>{var t=dn(),n=T(t),r=T(n),o=T(r);{let e=w(()=>!a(k).raw.trim());W(o,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`raw`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`raw`?`Copied raw prompt`:`Copy raw prompt`)),i(e,n)},$$slots:{default:!0}})}f(r);var s=N(r,2),u=T(s);{let e=w(()=>!a(O).raw.trim());W(u,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`rendered`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`rendered`?`Copied rendered prompt`:`Copy rendered prompt`)),i(e,n)},$$slots:{default:!0}})}f(s),f(n);var d=N(n,2);he(d,{variant:`generic`,get original(){return a(k).formatted},get modified(){return a(O).formatted},language:`markdown`,class:`min-h-0 flex-1`}),f(t),i(e,t)},u=e=>{{let t=w(()=>a(A).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},d=e=>{{let t=w(()=>a(M).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}};E(n,e=>{a(R)[a(D)]?e(r):a(ne)[a(D)]?e(o,1):a(D)===`prompt`&&a(k)&&a(O)?e(s,2):a(D)===`conversation`&&a(A)?e(u,3):a(D)===`context`&&a(M)&&e(d,4)}),f(t),i(e,t)},r=w(()=>`${me(a(D))} — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(y)},set open(e){b(y,e,!0)},children:n,$$slots:{default:!0}})}};E(Pe,e=>{a(y)&&e(Fe)});var J=N(Pe,2),Ie=e=>{{let n=e=>{var t=mn(),n=v(t);oe(n,{get value(){return a(C)},ariaLabel:`Test run debug tabs`,onChange:({value:e})=>ge(e),children:(e,t)=>{var n=pn(),r=v(n);se(r,{value:`errors`,class:`px-3`,children:(e,t)=>{l();var n=B(`Errors`);i(e,n)},$$slots:{default:!0}});var a=N(r,2);se(a,{value:`traces`,class:`px-3`,children:(e,t)=>{l();var n=B(`Traces`);i(e,n)},$$slots:{default:!0}});var o=N(a,2);se(o,{value:`logs`,class:`px-3`,children:(e,t)=>{l();var n=B(`Logs`);i(e,n)},$$slots:{default:!0}}),i(e,n)},$$slots:{default:!0}});var r=N(n,2),o=T(r),s=e=>{var t=ln();i(e,t)},u=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(C)])),i(e,t)},d=e=>{{let t=w(()=>a(te).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},p=e=>{{let t=w(()=>a(F).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}},m=e=>{{let t=w(()=>a(I).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}};E(o,e=>{a(R)[a(C)]?e(s):a(ne)[a(C)]?e(u,1):a(C)===`errors`&&a(te)?e(d,2):a(C)===`traces`&&a(F)?e(p,3):a(C)===`logs`&&a(I)&&e(m,4)}),f(r),i(e,t)},r=w(()=>`Debug — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(ee)},set open(e){b(ee,e,!0)},children:n,$$slots:{default:!0}})}};E(J,e=>{a(ee)&&e(Ie)}),x(()=>{we.inert=o(),we.disabled=n()||s()||a(U)===`adding`,c(Te,a(U)===`adding`?`Adding…`:a(U)===`added`?`Added`:a(U)===`failed`?`Failed`:`Add test`)}),h(`click`,we,_e),h(`click`,Oe,()=>b(S,!0)),h(`click`,ke,()=>K(`prompt`)),h(`click`,q,()=>K(`conversation`)),h(`click`,Ae,()=>K(`context`)),h(`click`,je,pe),i(e,be),r()}t([`click`]);var _n=`Update the conversation history so it reflects behaviour that is valid under the current prompt. Preserve the test's intent and expected outcome, and make only the smallest necessary changes. Possible roles: "Agent", "User", "System"`;function vn(e,t){return[e.trim()===`LLM`?``:e.trim(),t.trim()].filter(Boolean).join(` `)}function yn(e){let t=vn(e.assertionLabel,e.assertionValue);return`You will be given the context, the conversation and the desired output and assertion about it. First, find why the prompt is not producing the correct result. It's usually one concrete instruction within the relevant section, or a contradiction. Then, change the prompt minimally so this will work, but keeping the prompt clean and comprehensive is more important. Try to provide as general solution as possible. Try to change just one part of the prompt, not multiple parts. Avoid adding exceptions and overrides. Avoid duplicating information that already exists in the prompt.
3
3
 
4
4
  Context:
5
5
  ${e.context.trim()}
@@ -1 +1 @@
1
- {"version":"1788427265916"}
1
+ {"version":"1789496520453"}
Binary file
Binary file
package/build/index.html CHANGED
@@ -4,35 +4,35 @@
4
4
  <meta charset="utf-8" />
5
5
  <link rel="icon" href="/favicon.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <link href="/_app/immutable/entry/start.59SUcW9F.js" rel="modulepreload">
8
- <link href="/_app/immutable/chunks/Xth-LXaZ.js" rel="modulepreload">
7
+ <link href="/_app/immutable/entry/start.t9PGFpmm.js" rel="modulepreload">
8
+ <link href="/_app/immutable/chunks/jbAfpNOj.js" rel="modulepreload">
9
9
  <link href="/_app/immutable/chunks/CPCsWwEy.js" rel="modulepreload">
10
10
  <link href="/_app/immutable/chunks/hePW80VL.js" rel="modulepreload">
11
11
  <link href="/_app/immutable/chunks/Dt-HX3Vu.js" rel="modulepreload">
12
12
  <link href="/_app/immutable/chunks/AvXp07rr.js" rel="modulepreload">
13
- <link href="/_app/immutable/entry/app.B73YVKlJ.js" rel="modulepreload">
13
+ <link href="/_app/immutable/entry/app.Nx0-kikH.js" rel="modulepreload">
14
14
  <link href="/_app/immutable/chunks/HclGiUj8.js" rel="modulepreload">
15
15
  <link href="/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
16
- <link href="/_app/immutable/nodes/0.CRuATwoa.js" rel="modulepreload">
16
+ <link href="/_app/immutable/nodes/0.B5_ukjYU.js" rel="modulepreload">
17
17
  <link href="/_app/immutable/chunks/DDZ8GqHh.js" rel="modulepreload">
18
- <link href="/_app/immutable/chunks/BSnTSnag.js" rel="modulepreload">
19
- <link href="/_app/immutable/chunks/DoM_ZOrs.js" rel="modulepreload">
18
+ <link href="/_app/immutable/chunks/BOZLjogl.js" rel="modulepreload">
19
+ <link href="/_app/immutable/chunks/vxN0p6wG.js" rel="modulepreload">
20
20
 
21
- <link href="/_app/immutable/assets/0.CDmx-FLf.css" rel="stylesheet">
21
+ <link href="/_app/immutable/assets/0.970vvoDj.css" rel="stylesheet">
22
22
  </head>
23
23
  <body data-sveltekit-preload-data="hover">
24
24
  <div style="display: contents">
25
25
  <script>
26
26
  {
27
- __sveltekit_1gb84e5 = {
27
+ __sveltekit_1t8j96k = {
28
28
  base: ""
29
29
  };
30
30
 
31
31
  const element = document.currentScript.parentElement;
32
32
 
33
33
  Promise.all([
34
- import("/_app/immutable/entry/start.59SUcW9F.js"),
35
- import("/_app/immutable/entry/app.B73YVKlJ.js")
34
+ import("/_app/immutable/entry/start.t9PGFpmm.js"),
35
+ import("/_app/immutable/entry/app.Nx0-kikH.js")
36
36
  ]).then(([kit, app]) => {
37
37
  kit.start(app, element);
38
38
  });
Binary file
Binary file
package/dist/index.js CHANGED
@@ -4521,16 +4521,28 @@ var PaginatedConversationsResponseSchema = z10.object({
4521
4521
  lastConversationId: z10.string().optional()
4522
4522
  });
4523
4523
  var AnalyticsScalarSchema = z10.union([z10.boolean(), z10.number(), z10.string()]);
4524
+ var AnalyticsFieldNameSchema = z10.string().regex(/^[A-Za-z0-9_.:-]{1,128}$/);
4525
+ var AnalyticsFieldValueSchema = z10.object({
4526
+ value: AnalyticsScalarSchema,
4527
+ count: z10.number().int().nonnegative()
4528
+ });
4529
+ var AnalyticsFieldMetadataSchema = z10.object({
4530
+ field: AnalyticsFieldNameSchema,
4531
+ type: z10.enum(["boolean", "number", "string"]),
4532
+ distinctValueCount: z10.number().int().nonnegative()
4533
+ });
4534
+ var AnalyticsFieldMetadataResponseSchema = z10.object({
4535
+ items: z10.array(AnalyticsFieldMetadataSchema)
4536
+ });
4537
+ var AnalyticsFieldValuesResponseSchema = z10.object({
4538
+ items: z10.array(AnalyticsFieldValueSchema),
4539
+ nextCursor: z10.string().nullable()
4540
+ });
4524
4541
  var AnalyticsFieldSchema = z10.object({
4525
4542
  key: z10.string(),
4526
4543
  type: z10.enum(["boolean", "number", "string"]),
4527
4544
  variantCount: z10.number(),
4528
- values: z10.array(
4529
- z10.object({
4530
- value: AnalyticsScalarSchema,
4531
- count: z10.number()
4532
- })
4533
- )
4545
+ values: z10.array(AnalyticsFieldValueSchema)
4534
4546
  });
4535
4547
  var AnalyticsFieldsResponseSchema = z10.object({
4536
4548
  items: z10.array(AnalyticsFieldSchema)
@@ -4618,8 +4630,9 @@ var PaginatedLatencyTracesResponseSchema = z10.object({
4618
4630
  var SourceIdSchema = z11.string().trim().max(128).optional();
4619
4631
  var ConversationIdSchema3 = z11.string().trim().min(1).max(256);
4620
4632
  var LimitSchema = z11.number().int().positive().max(1e3).optional();
4633
+ var ANALYTICS_FIELD_VALUE_LIMIT = 50;
4621
4634
  var AnalyticsFilterSchema = z11.object({
4622
- key: z11.string().trim().min(1).max(256),
4635
+ key: AnalyticsFieldNameSchema,
4623
4636
  type: z11.enum(["boolean", "number", "string"]),
4624
4637
  values: z11.array(AnalyticsScalarSchema).min(1)
4625
4638
  });
@@ -4642,6 +4655,32 @@ function pageSearch(limit, lastTraceId) {
4642
4655
  if (lastTraceId) search.set("lastTraceId", lastTraceId);
4643
4656
  return search;
4644
4657
  }
4658
+ function serializeAnalyticsFilters(filters) {
4659
+ return JSON.stringify(filters.map(({ key, values }) => ({ field: key, operator: "in", values })));
4660
+ }
4661
+ async function loadAnalyticsField(ctx, sourceId, agentId, field) {
4662
+ let variantCount = field.distinctValueCount;
4663
+ let values = [];
4664
+ if (variantCount <= ANALYTICS_FIELD_VALUE_LIMIT) {
4665
+ const response = await get(ctx, {
4666
+ sourceId,
4667
+ path: `analytics/fields/${encodeURIComponent(field.field)}/values`,
4668
+ search: new URLSearchParams({
4669
+ agentId,
4670
+ limit: String(ANALYTICS_FIELD_VALUE_LIMIT)
4671
+ }),
4672
+ schema: AnalyticsFieldValuesResponseSchema
4673
+ });
4674
+ if (response.nextCursor) variantCount = ANALYTICS_FIELD_VALUE_LIMIT + 1;
4675
+ else values = response.items;
4676
+ }
4677
+ return {
4678
+ key: field.field,
4679
+ type: field.type,
4680
+ variantCount,
4681
+ values
4682
+ };
4683
+ }
4645
4684
  function createTelescopeRouter(t2) {
4646
4685
  return t2.router({
4647
4686
  sources: t2.procedure.query(
@@ -4655,6 +4694,9 @@ function createTelescopeRouter(t2) {
4655
4694
  phoneNumber: z11.string().trim().min(1).optional(),
4656
4695
  agentId: z11.string().trim().min(1).optional(),
4657
4696
  analyticsFilters: z11.array(AnalyticsFilterSchema).optional()
4697
+ }).refine((input) => !input.analyticsFilters?.length || input.agentId, {
4698
+ message: "agentId is required when analytics filters are set",
4699
+ path: ["agentId"]
4658
4700
  })
4659
4701
  ).query(async ({ input, ctx }) => {
4660
4702
  const search = new URLSearchParams({ limit: String(input.limit ?? 10) });
@@ -4662,10 +4704,7 @@ function createTelescopeRouter(t2) {
4662
4704
  if (input.phoneNumber) search.set("phoneNumber", input.phoneNumber);
4663
4705
  if (input.agentId) search.set("agentId", input.agentId);
4664
4706
  if (input.analyticsFilters?.length) {
4665
- search.set(
4666
- "filters",
4667
- JSON.stringify(input.analyticsFilters.map((filter) => ({ ...filter, operator: "in" })))
4668
- );
4707
+ search.set("filters", serializeAnalyticsFilters(input.analyticsFilters));
4669
4708
  }
4670
4709
  const page = await get(ctx, {
4671
4710
  sourceId: input.sourceId,
@@ -4682,15 +4721,20 @@ function createTelescopeRouter(t2) {
4682
4721
  }))
4683
4722
  };
4684
4723
  }),
4685
- analyticsFields: t2.procedure.input(z11.object({ sourceId: SourceIdSchema, agentId: z11.string().trim().min(1).optional() })).query(({ input, ctx }) => {
4686
- const search = new URLSearchParams();
4687
- if (input.agentId) search.set("agentId", input.agentId);
4688
- return get(ctx, {
4724
+ analyticsFields: t2.procedure.input(z11.object({ sourceId: SourceIdSchema, agentId: z11.string().trim().min(1) })).query(async ({ input, ctx }) => {
4725
+ const response = await get(ctx, {
4689
4726
  sourceId: input.sourceId,
4690
4727
  path: "analytics/fields",
4691
- search,
4692
- schema: AnalyticsFieldsResponseSchema
4728
+ search: new URLSearchParams({ agentId: input.agentId }),
4729
+ schema: AnalyticsFieldMetadataResponseSchema
4693
4730
  });
4731
+ return {
4732
+ items: await Promise.all(
4733
+ response.items.map(
4734
+ (field) => loadAnalyticsField(ctx, input.sourceId, input.agentId, field)
4735
+ )
4736
+ )
4737
+ };
4694
4738
  }),
4695
4739
  conversation: t2.procedure.input(z11.object({ sourceId: SourceIdSchema, conversationId: ConversationIdSchema3 })).query(
4696
4740
  ({ input, ctx }) => get(ctx, {