@cogitator-ai/studio 0.1.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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/dist/host/checkpoints.d.ts +11 -0
  4. package/dist/host/checkpoints.d.ts.map +1 -0
  5. package/dist/host/checkpoints.js +43 -0
  6. package/dist/host/checkpoints.js.map +1 -0
  7. package/dist/host/main.d.ts +2 -0
  8. package/dist/host/main.d.ts.map +1 -0
  9. package/dist/host/main.js +49 -0
  10. package/dist/host/main.js.map +1 -0
  11. package/dist/host/project.d.ts +22 -0
  12. package/dist/host/project.d.ts.map +1 -0
  13. package/dist/host/project.js +88 -0
  14. package/dist/host/project.js.map +1 -0
  15. package/dist/host/runner.d.ts +58 -0
  16. package/dist/host/runner.d.ts.map +1 -0
  17. package/dist/host/runner.js +507 -0
  18. package/dist/host/runner.js.map +1 -0
  19. package/dist/index.d.ts +8 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +5 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/protocol.d.ts +398 -0
  24. package/dist/protocol.d.ts.map +1 -0
  25. package/dist/protocol.js +7 -0
  26. package/dist/protocol.js.map +1 -0
  27. package/dist/registry.d.ts +8 -0
  28. package/dist/registry.d.ts.map +1 -0
  29. package/dist/registry.js +119 -0
  30. package/dist/registry.js.map +1 -0
  31. package/dist/server/host-manager.d.ts +52 -0
  32. package/dist/server/host-manager.d.ts.map +1 -0
  33. package/dist/server/host-manager.js +267 -0
  34. package/dist/server/host-manager.js.map +1 -0
  35. package/dist/server/server.d.ts +41 -0
  36. package/dist/server/server.d.ts.map +1 -0
  37. package/dist/server/server.js +437 -0
  38. package/dist/server/server.js.map +1 -0
  39. package/dist/server/store.d.ts +88 -0
  40. package/dist/server/store.d.ts.map +1 -0
  41. package/dist/server/store.js +602 -0
  42. package/dist/server/store.js.map +1 -0
  43. package/dist/ui/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  44. package/dist/ui/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  45. package/dist/ui/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  46. package/dist/ui/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  47. package/dist/ui/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  48. package/dist/ui/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  49. package/dist/ui/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  50. package/dist/ui/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  51. package/dist/ui/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  52. package/dist/ui/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  53. package/dist/ui/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  54. package/dist/ui/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  55. package/dist/ui/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  56. package/dist/ui/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  57. package/dist/ui/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  58. package/dist/ui/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  59. package/dist/ui/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  60. package/dist/ui/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  61. package/dist/ui/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist/ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  63. package/dist/ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  64. package/dist/ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  65. package/dist/ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  66. package/dist/ui/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  67. package/dist/ui/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  68. package/dist/ui/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  69. package/dist/ui/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  70. package/dist/ui/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  71. package/dist/ui/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  72. package/dist/ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  73. package/dist/ui/assets/icons-f6vmKzId.js +1 -0
  74. package/dist/ui/assets/index-C4hZIqRf.js +8 -0
  75. package/dist/ui/assets/index-D3MDAGJQ.css +1 -0
  76. package/dist/ui/assets/markdown-B0lQtlaX.js +39 -0
  77. package/dist/ui/assets/math-D93AjGz5.css +1 -0
  78. package/dist/ui/assets/math-Dyab3dfo.js +257 -0
  79. package/dist/ui/assets/react-Oh0PCTUB.js +9 -0
  80. package/dist/ui/favicon.svg +1 -0
  81. package/dist/ui/index.html +21 -0
  82. package/dist/ui/theme.js +4 -0
  83. package/package.json +90 -0
@@ -0,0 +1 @@
1
+ import{r as h}from"./react-Oh0PCTUB.js";const Me=a=>a?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function fe(a,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Me(a),size:24,node:e,...n.length>0?{aliases:n}:{}}}const ve=a=>{let e="",n=!1;for(const o of a){if(o==="-"||o==="_"||o<=" "){n=e.length>0;continue}e.length===0?e+=o.toLowerCase():e+=n?o.toUpperCase():o,n=!1}return e};const be=a=>{const e=ve(a);return e.charAt(0).toUpperCase()+e.slice(1)};const z=(...a)=>a.filter((e,n,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===n).join(" ").trim();const d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function g(a){return a!=null}function De(a,e={}){const n=e.attributeNames??{},o=c=>n[c]??c,r=a.size??a.width??d.width,l=a.size??a.height??d.height,k=a.aliases?.filter(c=>typeof c=="string"&&c.trim()!=="").map(c=>`lucide-${c}`)??[],p=[...a.name?[`lucide-${a.name}`]:[],...k],s=e.className?.split(" ").filter(Boolean)??[],m=e.includeDefaultClasses===!1?z(...s):z("lucide",...p,...s),w=e.absoluteStrokeWidth?Number(e.strokeWidth??d["stroke-width"])*Number(a.size??a.width??d.width)/Number(e.size??e.width??d.width):e.strokeWidth??d["stroke-width"];return["svg",{...Object.entries(d).reduce((c,[i,y])=>(c[o(i)]=y,c),{}),..."color"in e&&e.color&&{[o("stroke")]:e.color},..."size"in e&&g(e.size)&&{[o("width")]:e.size,[o("height")]:e.size},..."width"in e&&g(e.width)&&{[o("width")]:e.width},..."height"in e&&g(e.height)&&{[o("height")]:e.height},[o("stroke-width")]:w,...m&&{[o("class")]:m},[o("viewBox")]:`0 0 ${r} ${l}`,...e.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},a.node.map(c=>{const[i,y,u]=c,x=e.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...y}:y;return u?[i,x,u]:[i,x]})]}function $e(a,e={}){return De(a,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const Ce=a=>{for(const e in a)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},qe=h.createContext({}),Ae=()=>h.useContext(qe),je=h.forwardRef(({color:a,size:e,width:n,height:o,strokeWidth:r,absoluteStrokeWidth:l,nonScalingStroke:k,className:p="",children:s,iconNode:m=[],icon:w={node:m,aliases:[],size:24},..._},c)=>{const{size:i=24,strokeWidth:y=2,absoluteStrokeWidth:u=!1,nonScalingStroke:x=!1,color:pe="currentColor",className:me=""}=Ae()??{},ue=!!s||Ce(_),[xe,we,_e=[]]=$e(w,{color:a??pe,width:n??e??i,height:o??e??i,strokeWidth:r??y,absoluteStrokeWidth:l??u,nonScalingStroke:k??x,className:z(me,p),hasA11yProp:ue,attributes:_});return h.createElement(xe,{ref:c,...we},[..._e.map(([ge,ze])=>h.createElement(ge,ze)),...Array.isArray(s)?s:[s]])});function t(a,e=[],n=[]){const o=typeof a=="string"?fe(a,e,n):a,r=h.forwardRef(({className:l,...k},p)=>h.createElement(je,{ref:p,icon:o,className:l,...k}));return o.name&&(r.displayName=be(o.name)),r}const M={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};M.node;const Le=t(M);const f={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};f.node;const Ne=t(f);const v={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};v.node;const We=t(v);const b={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};b.node;const He=t(b);const D={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};D.node;const Be=t(D);const $={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};$.node;const Ve=t($);const C={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};C.node;const Ee=t(C);const q={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};q.node;const Ie=t(q);const A={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};A.node;const Pe=t(A);const j={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};j.node;const Re=t(j);const S={name:"circle-slash",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]};S.node;const Fe=t(S);const L={name:"circle-stop",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],aliases:["stop-circle"]};L.node;const Ge=t(L);const N={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};N.node;const Ke=t(N);const W={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};W.node;const Te=t(W);const H={name:"coins",size:24,node:[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]]};H.node;const Ue=t(H);const B={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};B.node;const Je=t(B);const V={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};V.node;const Xe=t(V);const E={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};E.node;const Oe=t(E);const I={name:"gauge",size:24,node:[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]};I.node;const Ze=t(I);const P={name:"git-compare-arrows",size:24,node:[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]};P.node;const Qe=t(P);const R={name:"git-fork",size:24,node:[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]};R.node;const Ye=t(R);const F={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};F.node;const e1=t(F);const G={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};G.node;const t1=t(G);const K={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};K.node;const a1=t(K);const T={name:"layout-dashboard",size:24,node:[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]};T.node;const o1=t(T);const U={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};U.node;const n1=t(U);const J={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};J.node;const c1=t(J);const X={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};X.node;const s1=t(X);const O={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};O.node;const i1=t(O);const Z={name:"network",size:24,node:[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]};Z.node;const d1=t(Z);const Q={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};Q.node;const h1=t(Q);const Y={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Y.node;const r1=t(Y);const ee={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};ee.node;const y1=t(ee);const te={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};te.node;const l1=t(te);const ae={name:"rows-3",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],aliases:["panels-top-bottom"]};ae.node;const k1=t(ae);const oe={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};oe.node;const p1=t(oe);const ne={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};ne.node;const m1=t(ne);const ce={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};ce.node;const u1=t(ce);const se={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};se.node;const x1=t(se);const ie={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};ie.node;const w1=t(ie);const de={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};de.node;const _1=t(de);const he={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};he.node;const g1=t(he);const re={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};re.node;const z1=t(re);const ye={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};ye.node;const M1=t(ye);const le={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};le.node;const f1=t(le);const ke={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};ke.node;const v1=t(ke);export{Le as A,He as B,Ve as C,l1 as D,Oe as E,h1 as F,Ye as G,z1 as H,e1 as I,y1 as J,t1 as K,n1 as L,i1 as M,d1 as N,r1 as P,k1 as R,_1 as S,g1 as T,M1 as W,v1 as X,Je as a,Ee as b,Ke as c,Fe as d,Pe as e,Ge as f,Ie as g,Re as h,o1 as i,p1 as j,Xe as k,s1 as l,f1 as m,m1 as n,w1 as o,We as p,x1 as q,a1 as r,Ne as s,u1 as t,Qe as u,c1 as v,Ze as w,Ue as x,Te as y,Be as z};
@@ -0,0 +1,8 @@
1
+ import{r as p,j as e,c as us}from"./react-Oh0PCTUB.js";import{C as hs,a as ps,b as ve,c as De,d as ms,e as xs,f as js,g as fs,h as gs,L as Me,i as Fe,A as P,S as Ne,M as ye,K as Le,B as K,W as D,P as Pe,j as ue,k as vs,G as J,X as We,N as Ns,l as ys,m as se,n as Ke,I as bs,o as _e,p as ks,q as Be,r as ws,s as Ge,t as Ss,E as $s,u as Cs,T as Ue,v as He,w as Ts,x as Es,y as As,R as Rs,z as Os,D as Is,F as he,H as zs,J as Ds}from"./icons-f6vmKzId.js";import"./math-Dyab3dfo.js";import{M as Ms,r as Fs,a as Ls,y as Ps,x as Ws,t as Ks,s as _s,b as Bs,c as Gs,p as Us,m as Hs,j as Js,d as Vs,e as qs,g as Xs,f as Ys,h as Qs,i as Zs,k as et,l as st}from"./markdown-B0lQtlaX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();async function F(s,t){const n=await fetch(s,{method:t?.method??"GET",credentials:"same-origin",headers:t?.body!==void 0?{"content-type":"application/json"}:void 0,body:t?.body!==void 0?JSON.stringify(t.body):void 0}),r=await n.text(),i=r?JSON.parse(r):{};if(!n.ok)throw new Error(i.error??`HTTP ${n.status}`);return i}const E={state:()=>F("/api/state"),stats:()=>F("/api/stats"),runs:s=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(s))r&&t.set(n,r);return F(`/api/runs?${t.toString()}`)},run:s=>F(`/api/runs/${encodeURIComponent(s)}`),thread:s=>F(`/api/threads/${encodeURIComponent(s)}`),chat:(s,t,n)=>F("/api/chat",{method:"POST",body:{agent:s,input:t,...n&&{threadId:n}}}),stop:s=>F(`/api/runs/${encodeURIComponent(s)}/stop`,{method:"POST",body:{}}),approve:(s,t,n)=>F(`/api/approvals/${encodeURIComponent(s)}`,{method:"POST",body:{approved:t,...n&&{reason:n}}}),fork:(s,t)=>F(`/api/runs/${encodeURIComponent(s)}/fork`,{method:"POST",body:t}),runWorkflow:(s,t)=>F(`/api/workflows/${encodeURIComponent(s)}/run`,{method:"POST",body:{input:t}}),rerun:(s,t)=>F(`/api/runs/${encodeURIComponent(s)}/rerun`,{method:"POST",body:{fromNode:t}})};function tt(s,t){let n,r=!1,i;const a=()=>{n=new EventSource("/api/events",{withCredentials:!0}),n.onopen=()=>t(!0),n.onmessage=c=>s(JSON.parse(c.data)),n.onerror=()=>{t(!1),n?.close(),r||(i=setTimeout(a,1e3))}};return a(),()=>{r=!0,clearTimeout(i),n?.close()}}function Y(s,t=!0){return s===void 0||!t&&s===0?"unpriced":s===0?"$0":s<1e-4?"<$0.0001":s<1?`$${s.toFixed(4)}`:`$${s.toFixed(2)}`}function T(s){return s===void 0?"":s<1e3?`${Math.round(s)} ms`:s<6e4?`${(s/1e3).toFixed(s<1e4?2:1)} s`:`${Math.floor(s/6e4)} min ${Math.round(s%6e4/1e3)} s`}function L(s){return s===void 0?"":s>=1e4?`${(s/1e3).toFixed(1)}k`:String(s)}function G(s,t=Date.now()){const n=Math.max(0,Math.round((t-s)/1e3));if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r} min ago`;const i=Math.round(r/60);return i<48?`${i} h ago`:new Date(s).toLocaleDateString()}function M(s){if(typeof s=="string")return s;try{return JSON.stringify(s,null,2)??String(s)}catch{return String(s)}}function ne(s,t=90){const n=(s??"").replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function Z(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e4?`${(s/1e3).toFixed(1)}k`:s.toLocaleString("en-US")}function we(s){return new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function Je(s){return new Date(s).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function be(s,t){return s.model??t.defaultModel??"default model"}function nt(){return window.location.hash.replace(/^#\/?/,"").split("/").filter(Boolean).map(decodeURIComponent)}function at(){return p.useSyncExternalStore(s=>(window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)),()=>window.location.hash),nt()}function S(...s){return`#/${s.map(encodeURIComponent).join("/")}`}function C(...s){window.location.hash=S(...s)}let q={connected:!1,loaded:!1,project:"",host:{state:"starting"},runs:{},threads:{}};const pe=new Set;function X(s){q={...q,...s};for(const t of pe)t()}function ee(s){if(s.length===0)return;const t={...q.runs};for(const n of s)t[n.id]=n;X({runs:t})}let Se;async function Ve(){try{X({stats:await E.stats()})}catch{return}}function rt(){clearTimeout(Se),Se=setTimeout(()=>{Ve()},600)}function it(s){switch(s.type){case"host":X({host:s.status});break;case"run":ee([s.run]),rt();break;case"thread":X({threads:{...q.threads,[s.thread.id]:s.thread}});break;case"token":case"reasoning":{const t=q.runs[s.runId];if(!t)break;const n=s.type==="token"?"output":"reasoning";ee([{...t,[n]:(t[n]??"")+s.text}]);break}}}function lt(){return tt(it,t=>{X({connected:t}),t&&ot()})}async function ot(){const s=await E.state();X({loaded:!0,project:s.project,host:s.host,threads:Object.fromEntries(s.threads.map(t=>[t.id,t]))}),ee(s.runs),await Ve()}async function me(s){const t=await E.run(s);return ee([t.run,...t.descendants,...t.forks]),t}async function ct(s){const t=await E.runs(s);ee(t.runs)}async function dt(s){const{thread:t,runs:n}=await E.thread(s);X({threads:{...q.threads,[t.id]:t}}),ee(n)}function $(s){return p.useSyncExternalStore(t=>(pe.add(t),()=>pe.delete(t)),()=>s(q))}const xe="cogitator-studio-theme",je=new Set;function ut(){try{const s=localStorage.getItem(xe);return s==="light"||s==="dark"?s:"system"}catch{return"system"}}let ce=ut();function qe(s){ce=s;try{s==="system"?localStorage.removeItem(xe):localStorage.setItem(xe,s)}catch{}s==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=s;for(const t of je)t()}function de(){return ce!=="system"?ce:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Xe(){qe(de()==="dark"?"light":"dark")}function ht(){return p.useSyncExternalStore(s=>(je.add(s),()=>je.delete(s)),()=>ce)}const Ye={running:"Running",waiting:"Needs approval",completed:"Completed",failed:"Failed",stopped:"Stopped",pending:"Pending",skipped:"Skipped"},pt={running:Me,waiting:gs,completed:fs,failed:De,stopped:js,pending:xs,skipped:ms};function U({status:s}){return e.jsx("span",{className:"status","data-status":s,children:Ye[s]})}function mt({status:s,size:t=15}){const n=pt[s];return e.jsx("span",{className:"status-icon","data-status":s,"data-tip":Ye[s],children:e.jsx(n,{size:t,strokeWidth:2,style:s==="running"?{animation:"spin 1s linear infinite"}:void 0})})}async function xt(s){if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(s);return}const t=document.createElement("textarea");t.value=s,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select(),document.execCommand("copy"),t.remove()}function ae({value:s,label:t="Copy"}){const[n,r]=p.useState(!1),i=p.useRef(void 0);p.useEffect(()=>()=>clearTimeout(i.current),[]);const a=async()=>{await xt(s),r(!0),clearTimeout(i.current),i.current=setTimeout(()=>r(!1),1400)};return e.jsx("button",{type:"button",className:"btn btn-ghost btn-icon btn-sm",onClick:()=>{a()},"aria-label":t,"data-tip":n?"Copied":t,children:n?e.jsx(hs,{size:13}):e.jsx(ps,{size:13})})}const jt=/("(?:\\.|[^"\\])*")(\s*:)?|\b(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|\b(true|false|null)\b/g;function ft(s){const t=[];let n=0;for(const r of s.matchAll(jt)){const i=r.index;i>n&&t.push(s.slice(n,i));const[a,c,l,o,d]=r;c!==void 0?(t.push(e.jsx("span",{className:l?"j-key":"j-string",children:c},i)),l&&t.push(l)):o!==void 0?t.push(e.jsx("span",{className:"j-number",children:o},i)):d!==void 0&&t.push(e.jsx("span",{className:"j-literal",children:d},i)),n=i+a.length}return n<s.length&&t.push(s.slice(n)),t}function B({value:s,label:t}){const n=M(s),r=typeof s!="string";return e.jsxs("div",{className:"json",children:[e.jsxs("div",{className:"json-head",children:[e.jsx("span",{children:t??"value"}),e.jsx(ae,{value:n,label:`Copy ${t??"value"}`})]}),e.jsx("pre",{children:r?ft(n):n})]})}function W({icon:s,title:t,children:n,action:r}){return e.jsxs("div",{className:"empty",children:[s&&e.jsx("div",{className:"empty-icon",children:e.jsx(s,{size:18})}),t&&e.jsx("div",{className:"empty-title",children:t}),n&&e.jsx("div",{className:"empty-text",children:n}),r]})}function R({keys:s}){return e.jsx("span",{className:"kbds",children:s.map(t=>e.jsx("kbd",{className:"kbd",children:t},t))})}function O({crumbs:s,actions:t}){return e.jsxs("header",{className:"topbar",children:[e.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:s.map((n,r)=>{const i=r===s.length-1;return e.jsxs("span",{style:{display:"contents"},children:[r>0&&e.jsx(ve,{size:14}),n.to&&!i?e.jsx("a",{href:S(...n.to),className:"truncate",children:n.label}):e.jsx("span",{className:`truncate ${i?"crumb-current":""}`,children:n.label})]},r)})}),t&&e.jsx("div",{className:"topbar-actions",children:t})]})}function I({children:s}){return e.jsxs("div",{className:"error-text",role:"alert",children:[e.jsx(De,{size:14}),e.jsx("span",{children:s})]})}function V(s){return s instanceof Error?s.message:String(s)}function gt(s,t){if(!t)return 1;const n=s.label.toLowerCase(),r=`${n} ${s.keywords??""} ${s.group}`.toLowerCase();return n.startsWith(t)?3:n.split(/[\s/:-]+/).some(i=>i.startsWith(t))?2:t.split(/\s+/).every(i=>r.includes(i))?1:0}function $e(s,t){return{id:`run-${s.id}`,group:t,label:ne(s.input,70)||s.id,hint:`${s.target} · ${G(s.startedAt)}`,icon:s.kind==="workflow"?D:s.kind==="fork"?J:P,keywords:`${s.target} ${s.output??""}`,run:()=>C("runs",s.id)}}function vt({onClose:s,onShortcuts:t}){const n=$(m=>m.host),r=$(m=>m.runs),[i,a]=p.useState(""),[c,l]=p.useState(0),[o,d]=p.useState([]),j=p.useRef(null),v=i.trim().toLowerCase();p.useEffect(()=>{if(v.length<2){d([]);return}let m=!0;const g=setTimeout(()=>{E.runs({q:v}).then(w=>m&&d(w.runs.slice(0,8))).catch(()=>m&&d([]))},120);return()=>{m=!1,clearTimeout(g)}},[v]);const h=p.useMemo(()=>{const m=n.state==="ready"?n.registry:void 0,w=[{id:"overview",group:"Go to",label:"Overview",icon:Fe,hint:e.jsx(R,{keys:["G","O"]}),run:()=>C()},{id:"runs",group:"Go to",label:"Runs",icon:P,keywords:"history traces",hint:e.jsx(R,{keys:["G","R"]}),run:()=>C("runs")},...(m?.agents??[]).map(b=>({id:`agent-${b.key}`,group:"Agents",label:b.name,hint:m?be(b,m):b.model,icon:K,keywords:`chat ${b.key} ${b.description??""}`,run:()=>C("agents",b.key)})),...(m?.workflows??[]).map(b=>({id:`workflow-${b.key}`,group:"Workflows",label:b.name,hint:`${b.nodes.length} nodes`,icon:D,keywords:`run ${b.key}`,run:()=>C("workflows",b.key)})),...(m?.agents??[]).map(b=>({id:`new-${b.key}`,group:"Actions",label:`New thread with ${b.name}`,icon:Pe,keywords:"chat message start",run:()=>C("agents",b.key)})),{id:"theme",group:"Actions",label:de()==="dark"?"Switch to light theme":"Switch to dark theme",icon:de()==="dark"?Ne:ye,keywords:"theme appearance dark light mode",run:Xe},{id:"shortcuts",group:"Actions",label:"Keyboard shortcuts",icon:Le,hint:e.jsx(R,{keys:["?"]}),keywords:"keys help hotkeys",run:t}].map(b=>({command:b,score:gt(b,v)})).filter(b=>b.score>0).sort((b,A)=>A.score-b.score).map(b=>b.command),y=v?o.map(b=>$e(b,"Runs")):Object.values(r).filter(b=>!b.parentRunId).sort((b,A)=>A.startedAt-b.startedAt).slice(0,5).map(b=>$e(b,"Recent runs")),k=["Go to","Agents","Workflows","Recent runs","Runs","Actions"];return[...w,...y].sort((b,A)=>k.indexOf(b.group)-k.indexOf(A.group))},[n,r,o,v,t]);p.useEffect(()=>l(0),[v]),p.useEffect(()=>{j.current?.querySelector(`[data-index="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);const u=m=>{m&&(s(),m.run())},x=m=>{m.key==="ArrowDown"||m.ctrlKey&&m.key==="n"?(m.preventDefault(),l(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"||m.ctrlKey&&m.key==="p"?(m.preventDefault(),l(g=>Math.max(g-1,0))):m.key==="Enter"?(m.preventDefault(),u(h[c])):m.key==="Escape"&&(m.preventDefault(),s())};let f="";return e.jsx("div",{className:"overlay",onMouseDown:s,"data-dialog":!0,children:e.jsxs("div",{className:"palette",role:"dialog","aria-modal":"true","aria-label":"Command palette",onMouseDown:m=>m.stopPropagation(),onKeyDown:x,"data-testid":"command-palette",children:[e.jsxs("div",{className:"palette-input",children:[e.jsx(ue,{size:17}),e.jsx("input",{autoFocus:!0,value:i,onChange:m=>a(m.target.value),placeholder:"Search agents, workflows, runs and actions",role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":h[c]?`palette-${h[c].id}`:void 0,"data-testid":"palette-input"}),e.jsx(R,{keys:["Esc"]})]}),e.jsxs("div",{className:"palette-list",id:"palette-list",role:"listbox",ref:j,children:[h.length===0&&e.jsx("div",{className:"palette-empty",children:"Nothing matches."}),h.map((m,g)=>{const w=m.group!==f?m.group:void 0;f=m.group;const y=m.icon;return e.jsxs("div",{children:[w&&e.jsx("div",{className:"palette-group",children:w}),e.jsxs("div",{id:`palette-${m.id}`,className:"palette-item",role:"option","aria-selected":g===c,"data-index":g,onMouseMove:()=>g!==c&&l(g),onClick:()=>u(m),children:[e.jsx(y,{size:15}),e.jsx("span",{className:"palette-label",children:m.label}),m.hint&&e.jsx("span",{className:"palette-hint",children:m.hint})]})]},m.id)})]}),e.jsxs("div",{className:"palette-foot",children:[e.jsxs("span",{children:[e.jsx(R,{keys:["↑","↓"]})," navigate"]}),e.jsxs("span",{children:[e.jsx("kbd",{className:"kbd",children:e.jsx(vs,{size:10})})," ","open"]}),e.jsxs("span",{children:[e.jsx(R,{keys:["Esc"]})," close"]})]})]})})}const ke=/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl";function Qe(s){const t=s.target;return t instanceof HTMLElement?t.isContentEditable||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT":!1}function Ze(){return document.querySelector("[data-dialog]")!==null}function es(s){const t=p.useRef(s);t.current=s,p.useEffect(()=>{const n=r=>t.current(r);return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[])}function ss(s,t){es(n=>{n.metaKey||n.ctrlKey||n.altKey||Qe(n)||Ze()||s.includes(n.key)&&(n.preventDefault(),t(n))})}const Nt=[{title:"Everywhere",keys:[["Command palette",[ke,"K"]],["Keyboard shortcuts",["?"]],["Go to the overview",["G","O"]],["Go to the runs",["G","R"]],["Search the page",["/"]]]},{title:"Chat",keys:[["Send",["Enter"]],["New line",["Shift","Enter"]],["New thread",["N"]],["Focus the message box",["C"]]]},{title:"Runs",keys:[["Next and previous run",["J","K"]],["Open the run",["Enter"]]]}];function yt({onClose:s}){return e.jsx("div",{className:"overlay",onMouseDown:s,onKeyDown:t=>t.key==="Escape"&&s(),"data-dialog":!0,children:e.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"shortcuts-title",onMouseDown:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"dialog-head",children:[e.jsx("h2",{id:"shortcuts-title",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-icon btn-sm",onClick:s,"aria-label":"Close",autoFocus:!0,children:e.jsx(We,{size:15})})]}),e.jsx("div",{className:"dialog-body",children:Nt.map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"shortcut-group",children:t.title}),t.keys.map(([n,r])=>e.jsxs("div",{className:"shortcut",children:[e.jsx("span",{children:n}),e.jsx(R,{keys:r})]},n))]},t.title))})]})})}function bt({className:s}){return e.jsxs("svg",{className:s,viewBox:"0 0 32 32","aria-hidden":"true",children:[e.jsx("rect",{width:"32",height:"32",rx:"8",fill:"currentColor"}),e.jsx("path",{d:"M21 11.2A7 7 0 1 0 21 20.8",fill:"none",stroke:"var(--bg)",strokeWidth:"3",strokeLinecap:"round"}),e.jsx("circle",{cx:"16",cy:"16",r:"2",fill:"var(--bg)"})]})}function le({to:s,icon:t,active:n,children:r,meta:i,testId:a}){return e.jsxs("a",{href:S(...s),className:`sb-link ${n?"active":""}`,"aria-current":n?"page":void 0,"data-testid":a,children:[e.jsx(t,{size:15}),e.jsx("span",{className:"sb-text truncate",children:r}),i!==void 0&&e.jsx("span",{className:"sb-meta",children:i})]})}const kt=[{value:"system",icon:ys,label:"System theme"},{value:"light",icon:Ne,label:"Light theme"},{value:"dark",icon:ye,label:"Dark theme"}];function wt({route:s,onSearch:t,onShortcuts:n}){const r=$(u=>u.host),i=$(u=>u.project),a=$(u=>u.connected),c=$(u=>u.runs),l=ht(),o=r.state==="ready"?r.registry:void 0,d=(...u)=>u.every((x,f)=>s[f]===x),j=new Set(Object.values(c).filter(u=>u.status==="running"||u.status==="waiting").map(u=>u.target)),v=a?r.state:"offline",h={ready:"Project loaded",starting:"Loading the project",restarting:"Reloading the project",failed:"The project does not load",offline:"Reconnecting to cogitator dev"};return e.jsxs("nav",{className:"sidebar","aria-label":"Studio",children:[e.jsxs("div",{className:"sb-top",children:[e.jsxs("a",{className:"sb-brand",href:"#/",children:[e.jsx(bt,{className:"sb-mark"}),e.jsxs("span",{className:"sb-text",style:{minWidth:0},children:[e.jsx("div",{className:"sb-name",children:"Cogitator Studio"}),e.jsxs("div",{className:"sb-project",children:[e.jsx("span",{className:"dot","data-state":v}),e.jsx("span",{className:"truncate",children:i||"project"})]})]})]}),e.jsxs("button",{type:"button",className:"sb-search",onClick:t,"data-testid":"open-palette",children:[e.jsx(ue,{size:14}),e.jsx("span",{children:"Search"}),e.jsx(R,{keys:[ke,"K"]})]})]}),e.jsxs("div",{className:"sb-nav",children:[e.jsx(le,{to:[],icon:Fe,active:s.length===0,children:"Overview"}),e.jsx(le,{to:["runs"],icon:P,active:s[0]==="runs"||s[0]==="compare",testId:"nav-runs",meta:j.size>0?e.jsx("span",{className:"spinner","aria-label":"runs going"}):void 0,children:"Runs"}),e.jsxs("div",{className:"sb-section",children:[e.jsx("div",{className:"sb-section-title",children:"Agents"}),o?.agents.map(u=>e.jsx(le,{to:["agents",u.key],icon:K,active:d("agents",u.key),testId:`agent-${u.key}`,meta:j.has(u.key)?e.jsx("span",{className:"dot","data-state":"starting"}):void 0,children:u.name},u.key)),o?.agents.length===0&&e.jsx("div",{className:"sb-empty",children:"None registered"}),!o&&e.jsx("div",{className:"skeleton",style:{height:22,margin:"4px 8px"}})]}),o&&o.workflows.length>0&&e.jsxs("div",{className:"sb-section",children:[e.jsx("div",{className:"sb-section-title",children:"Workflows"}),o.workflows.map(u=>e.jsx(le,{to:["workflows",u.key],icon:D,active:d("workflows",u.key),meta:j.has(u.key)?e.jsx("span",{className:"dot","data-state":"starting"}):void 0,children:u.name},u.key))]}),o&&o.swarms.length>0&&e.jsxs("div",{className:"sb-section",children:[e.jsx("div",{className:"sb-section-title",children:"Swarms"}),o.swarms.map(u=>e.jsxs("div",{className:"sb-link sb-static","data-tip":`${u.strategy}: ${u.agents.join(", ")}`,children:[e.jsx(Ns,{size:15}),e.jsx("span",{className:"sb-text truncate",children:u.name}),e.jsx("span",{className:"sb-meta",children:u.strategy})]},u.key))]})]}),e.jsxs("div",{className:"sb-footer",children:[e.jsxs("div",{className:"sb-conn","data-tip":h[v],children:[e.jsx("span",{className:"dot","data-state":v}),e.jsx("span",{children:a?"Live":"Offline"})]}),e.jsxs("div",{className:"sb-tools",children:[e.jsx("div",{className:"seg seg-icons sb-themes",role:"group","aria-label":"Theme",children:kt.map(({value:u,icon:x,label:f})=>e.jsx("button",{type:"button","aria-pressed":l===u,"aria-label":f,"data-tip":f,onClick:()=>qe(u),children:e.jsx(x,{size:13})},u))}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-icon btn-sm sb-theme-toggle",onClick:Xe,"aria-label":"Switch theme","data-tip":"Switch theme",children:de()==="dark"?e.jsx(Ne,{size:14}):e.jsx(ye,{size:14})}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-icon btn-sm",onClick:n,"aria-label":"Keyboard shortcuts","data-tip":"Shortcuts",children:e.jsx(Le,{size:14})})]})]})]})}const St=/(```[\s\S]*?(?:```|$)|`[^`\n]*`)/g;function Ce(s,t,n,r){let i="",a=0;for(;;){const c=s.indexOf(t,a);if(c===-1)break;const l=s.indexOf(n,c+t.length);if(l===-1)break;const o=s.slice(c+t.length,l).trim();i+=s.slice(a,c)+(o?r(o):s.slice(c,l+n.length)),a=l+n.length}return i+s.slice(a)}function $t(s){return s.split(St).map((t,n)=>{if(n%2===1)return t;const r=Ce(t,"\\[","\\]",i=>`
2
+
3
+ $$
4
+ ${i}
5
+ $$
6
+
7
+ `);return Ce(r,"\\(","\\)",i=>`$$${i}$$`)}).join("")}const Ct={bash:Zs,css:Qs,diff:Ys,go:Xs,java:qs,javascript:Vs,json:Js,markdown:Hs,python:Us,rust:Gs,shell:Bs,sql:_s,typescript:Ks,xml:Ws,yaml:Ps},Tt={bash:["sh","zsh"],xml:["html","svg"],markdown:["md"]};function fe(s){return typeof s=="string"||typeof s=="number"?String(s):Array.isArray(s)?s.map(fe).join(""):p.isValidElement(s)?fe(s.props.children):""}function Et(s){if(p.isValidElement(s))return/language-([\w+-]+)/.exec(s.props.className??"")?.[1]}const At={pre:({children:s})=>{const t=Array.isArray(s)?s[0]:s,n=Et(t);return e.jsxs("div",{className:"codeblock",children:[e.jsxs("div",{className:"codeblock-head",children:[e.jsx("span",{children:n??"text"}),e.jsx(ae,{value:fe(t).replace(/\n$/,""),label:"Copy code"})]}),e.jsx("pre",{children:s})]})},a:({href:s,children:t})=>e.jsx("a",{href:s,target:"_blank",rel:"noreferrer noopener",children:t})},Rt=[et,[st,{singleDollarTextMath:!1}]],Ot=[[Fs,{throwOnError:!1,strict:"ignore",errorColor:"var(--error)"}],[Ls,{detect:!1,languages:Ct,aliases:Tt,plainText:["math"]}]],te=p.memo(function({text:t}){return e.jsx("div",{className:"md",children:e.jsx(Ms,{remarkPlugins:Rt,rehypePlugins:Ot,components:At,children:$t(t)})})});function It(s){return s&&typeof s=="object"&&!Array.isArray(s)?Object.entries(s).map(([t,n])=>`${t}: ${typeof n=="string"?JSON.stringify(n):M(n)}`).join(", ").replace(/\s+/g," "):ne(M(s),120)}function ts({call:s}){const t=s.approval,n=t?.status==="waiting",[r,i]=p.useState(!!s.error),[a,c]=p.useState(""),[l,o]=p.useState(!1),[d,j]=p.useState(),v=s.result===void 0&&!s.error&&!n&&t?.status!=="rejected",h=async u=>{if(t){o(!0),j(void 0);try{await E.approve(t.id,u,u?void 0:a.trim()||void 0)}catch(x){j(V(x))}finally{o(!1)}}};return e.jsxs("div",{className:"tool","data-state":n?"waiting":s.error?"error":"done","data-open":r,"data-testid":"tool-call","data-tool":s.name,children:[e.jsxs("button",{type:"button",className:"tool-head",onClick:()=>i(!r),"aria-expanded":r,children:[e.jsx(ve,{size:13,className:"tool-chevron"}),e.jsx(se,{size:13}),e.jsx("span",{className:"tool-name",children:s.name}),e.jsx("span",{className:"tool-args",children:It(s.arguments)}),v&&e.jsx("span",{className:"spinner","aria-label":"running"}),n&&e.jsx(U,{status:"waiting"}),t&&t.status!=="waiting"&&e.jsx("span",{className:"status","data-status":t.status,title:t.reason,children:t.status==="approved"?"Approved":"Rejected"}),s.error&&e.jsx("span",{className:"tool-result tool-result-error",children:ne(s.error,60)}),s.error&&e.jsx(U,{status:"failed"}),s.result!==void 0&&!s.error&&e.jsxs("span",{className:"tool-result",children:["→ ",ne(M(s.result),60)]})]}),r&&e.jsxs("div",{className:"tool-body",children:[e.jsx(B,{label:"Arguments",value:s.arguments}),s.result!==void 0&&!(s.error&&s.result===null)&&e.jsx(B,{label:"Result",value:s.result}),t?.reason&&e.jsxs("div",{className:"notice",children:["Rejected because: ",t.reason]}),s.error&&e.jsx(I,{children:s.error})]}),n&&e.jsxs("div",{className:"approval","data-testid":"approval",children:[e.jsxs("div",{className:"approval-text",children:[e.jsx(Ke,{size:15}),s.name," needs your approval before it runs"]}),!r&&e.jsx(B,{label:"Arguments",value:s.arguments}),e.jsxs("div",{className:"approval-row",children:[e.jsx("input",{className:"input",placeholder:"Reason the model sees if you reject it (optional)",value:a,onChange:u=>c(u.target.value),onKeyDown:u=>u.key==="Enter"&&void h(!1)}),e.jsx("button",{type:"button",className:"btn btn-secondary",disabled:l,onClick:()=>{h(!1)},"data-testid":"reject",children:"Reject"}),e.jsx("button",{type:"button",className:"btn btn-primary",disabled:l,onClick:()=>{h(!0)},"data-testid":"approve",children:"Approve"})]}),d&&e.jsx(I,{children:d})]})]})}function zt({text:s,live:t}){const[n,r]=p.useState(t);return p.useEffect(()=>r(t),[t]),e.jsxs("div",{className:"reasoning","data-testid":"reasoning",children:[e.jsxs("button",{type:"button",className:"reasoning-toggle",onClick:()=>r(!n),"aria-expanded":n,children:[e.jsx(ve,{size:12,style:{transform:n?"rotate(90deg)":void 0,transition:"transform 0.15s"}}),t?"Reasoning":"Reasoned",t&&e.jsx("span",{className:"spinner",style:{width:10,height:10}})]}),n&&e.jsx("div",{className:"reasoning-text",children:e.jsx(te,{text:s})})]})}function Dt({run:s}){const t=s.status==="running"||s.status==="waiting",n=s.usage?s.usage.inputTokens+s.usage.outputTokens:void 0;return e.jsxs("div",{className:"turn","data-testid":"turn","data-run":s.id,"data-status":s.status,children:[e.jsx("div",{className:"msg-user",children:s.input}),e.jsxs("div",{className:"msg-assistant",children:[s.reasoning&&e.jsx(zt,{text:s.reasoning,live:s.status==="running"&&!s.output&&s.toolCalls.length===0}),s.toolCalls.map(r=>e.jsx(ts,{call:r},r.id)),s.output?e.jsxs("div",{"data-testid":"answer",children:[e.jsx(te,{text:s.output}),t&&e.jsx("span",{className:"cursor"})]}):t&&s.status==="running"?e.jsxs("div",{className:"msg-thinking",children:[e.jsx("span",{className:"spinner"})," Thinking"]}):null,s.error&&(s.status==="stopped"?e.jsxs("div",{className:"notice","data-testid":"run-error",children:[e.jsx(_e,{size:13}),s.error]}):e.jsx("div",{"data-testid":"run-error",children:e.jsx(I,{children:s.error})})),!(t&&!s.usage)&&e.jsxs("div",{className:"turn-meta",children:[e.jsx(mt,{status:s.status,size:14}),s.usage&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"·"}),e.jsx("span",{children:T(s.usage.duration)}),e.jsx("span",{className:"sep",children:"·"}),e.jsx("span",{children:Y(s.usage.cost,s.usage.priced!==!1)}),n!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"·"}),e.jsxs("span",{children:[L(n)," tokens"]})]})]}),s.children.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"·"}),e.jsxs("span",{children:[s.children.length," nested run",s.children.length===1?"":"s"]})]}),e.jsxs("span",{className:"turn-actions",children:[s.output&&e.jsx(ae,{value:s.output,label:"Copy answer"}),e.jsxs("a",{className:"btn btn-ghost btn-sm",href:S("runs",s.id),"data-testid":"trace-link",children:[e.jsx(Be,{size:13}),"Trace"]})]})]})]})]})}function Mt(s,t=new Date){const n=new Date(t);n.setHours(0,0,0,0);const r=864e5;return s>=n.getTime()?"Today":s>=n.getTime()-r?"Yesterday":s>=n.getTime()-6*r?"Previous 7 days":"Older"}function Ft({agent:s,threads:t,active:n}){const[r,i]=p.useState(""),a=t.filter(l=>l.title.toLowerCase().includes(r.trim().toLowerCase()));let c="";return e.jsxs("aside",{className:"threads","aria-label":"Threads",children:[e.jsxs("div",{className:"threads-head",children:[e.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>C("agents",s),"data-testid":"new-thread",children:[e.jsx(Pe,{size:14}),"New thread",e.jsx("span",{style:{marginLeft:"auto"},children:e.jsx(R,{keys:["N"]})})]}),t.length>4&&e.jsxs("label",{className:"input-icon",children:[e.jsx(ue,{size:13}),e.jsx("input",{className:"input",placeholder:"Filter threads",value:r,onChange:l=>i(l.target.value),style:{minHeight:30,padding:"4px 10px 4px 30px"}})]})]}),e.jsxs("div",{className:"threads-list",children:[a.length===0&&e.jsx("div",{className:"muted",style:{padding:"8px 10px"},children:t.length===0?"No threads yet.":"No thread matches."}),a.map(l=>{const o=Mt(l.updatedAt),d=o!==c;return c=o,e.jsxs("div",{children:[d&&e.jsx("div",{className:"thread-group",children:o}),e.jsxs("a",{href:S("agents",s,l.id),className:`thread ${l.id===n?"active":""}`,"aria-current":l.id===n?"page":void 0,"data-testid":"thread",children:[e.jsx("span",{className:"thread-title",children:l.title}),e.jsxs("span",{className:"thread-meta",children:[l.runs.length," turn",l.runs.length===1?"":"s"," ·"," ",G(l.updatedAt)]})]})]},l.id)})]})]})}function Lt({agent:s}){return e.jsxs("div",{className:"agent-intro",children:[e.jsx("div",{className:"agent-intro-mark",children:e.jsx(K,{size:20})}),e.jsx("h2",{children:s.name}),e.jsx("p",{children:s.description??"An agent of this project. Send a message to start a thread."}),s.tools.length>0&&e.jsx("div",{className:"agent-intro-tools",children:s.tools.map(t=>e.jsxs("span",{className:"chip","data-tip":t.description||t.name,children:[t.requiresApproval?e.jsx(Ke,{size:11}):e.jsx(se,{size:11}),t.name,t.requiresApproval&&e.jsx("span",{className:"chip-flag",children:"approval"})]},t.name))}),s.instructions&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"instructions-label",children:"Instructions"}),e.jsx("div",{className:"instructions",children:s.instructions})]})]})}function Pt({agentKey:s,threadId:t}){const n=$(N=>N.host),r=n.state==="ready"?n.memory:void 0,i=n.state==="ready"?n.registry.agents.find(N=>N.key===s):void 0,a=$(N=>N.threads),c=$(N=>N.runs),l=Object.values(a).filter(N=>N.agent===s).sort((N,H)=>H.updatedAt-N.updatedAt),o=t?a[t]:void 0,d=(o?.runs??[]).map(N=>c[N]).filter(N=>N!==void 0),j=d.find(N=>N.status==="running"||N.status==="waiting"),[v,h]=p.useState(""),[u,x]=p.useState(),[f,m]=p.useState(!1),g=p.useRef(null),w=p.useRef(null),y=p.useRef(!0);p.useEffect(()=>{t&&dt(t).catch(()=>{})},[t]),p.useEffect(()=>{y.current=!0,w.current?.focus()},[t]);const k=d.at(-1),b=`${d.length}:${k?.output?.length??0}:${k?.toolCalls.length??0}:${k?.status??""}`;if(p.useLayoutEffect(()=>{const N=g.current;N&&y.current&&(N.scrollTop=N.scrollHeight)},[b]),p.useLayoutEffect(()=>{const N=w.current;N&&(N.style.height="auto",N.style.height=`${Math.min(N.scrollHeight,240)}px`)},[v]),ss(["n","c"],N=>{N.key==="n"?C("agents",s):w.current?.focus()}),n.state!=="ready")return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[{label:"Agents"},{label:s}]}),e.jsx("div",{className:"scroll",children:e.jsx(W,{icon:K,title:"Waiting for the project"})})]});if(!i)return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[{label:"Agents"},{label:s}]}),e.jsx("div",{className:"scroll",children:e.jsx(W,{icon:K,title:`No agent ${s}`,children:"It is not in the registry of this project anymore."})})]});const A=async N=>{N?.preventDefault();const H=v.trim();if(!(!H||f||j)){m(!0),x(void 0),y.current=!0;try{const ie=await E.chat(s,H,t);h(""),ie.threadId!==t&&C("agents",s,ie.threadId)}catch(ie){x(V(ie))}finally{m(!1)}}},re=N=>{N.key==="Enter"&&!N.shiftKey&&!N.nativeEvent.isComposing?(N.preventDefault(),A()):N.key==="Escape"&&N.currentTarget.blur()};return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[{label:i.name,to:["agents",i.key]},...o?[{label:o.title}]:[{label:"New thread"}]],actions:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"chip","data-tip":i.model?"Model of the agent":"Default model of the runtime",children:be(i,n.registry)}),e.jsxs("span",{className:"chip","data-tip":i.tools.map(N=>N.name).join(", ")||"No tools",children:[e.jsx(se,{size:11}),i.tools.length]})]})}),e.jsxs("div",{className:"agent-layout",children:[e.jsx(Ft,{agent:s,threads:l,active:t}),e.jsxs("section",{className:"chat","aria-label":`Chat with ${i.name}`,children:[e.jsx("div",{className:"chat-scroll",ref:g,onScroll:N=>{const H=N.currentTarget;y.current=H.scrollHeight-H.scrollTop-H.clientHeight<80},children:e.jsxs("div",{className:"chat-inner","data-testid":"messages",children:[r==="studio"&&d.length===0&&e.jsxs("div",{className:"notice chat-notice",children:[e.jsx(bs,{size:14}),e.jsx("span",{children:"The project has no memory configured, so the studio keeps the conversation of each thread for its runs."})]}),d.length===0&&e.jsx(Lt,{agent:i}),d.map(N=>e.jsx(Dt,{run:N},N.id))]})}),e.jsxs("form",{className:"composer-wrap",onSubmit:N=>{A(N)},children:[e.jsxs("div",{className:"composer",onMouseDown:N=>{N.target instanceof HTMLElement&&!N.target.closest("button, textarea")&&(N.preventDefault(),w.current?.focus())},children:[e.jsx("textarea",{ref:w,rows:1,placeholder:`Message ${i.name}`,value:v,onChange:N=>h(N.target.value),onKeyDown:re,"aria-label":`Message ${i.name}`,"data-testid":"chat-input"}),e.jsxs("div",{className:"composer-foot",children:[e.jsxs("div",{className:"composer-hint",children:[e.jsxs("span",{children:[e.jsx(R,{keys:["Enter"]})," send"]}),e.jsxs("span",{children:[e.jsx(R,{keys:["Shift","Enter"]})," new line"]})]}),j?e.jsxs("button",{type:"button",className:"btn btn-danger btn-sm",onClick:()=>{E.stop(j.id)},"data-testid":"stop",children:[e.jsx(_e,{size:11,fill:"currentColor"}),"Stop"]}):e.jsx("button",{type:"submit",className:"btn btn-primary btn-icon btn-sm",disabled:f||!v.trim(),"aria-label":"Send","data-testid":"send",children:e.jsx(ks,{size:15})})]})]}),u&&e.jsx("div",{style:{maxWidth:780,margin:"0 auto"},children:e.jsx(I,{children:u})})]})]})]})]})}const ns={run:K,llm:Ss,tool:se,agent:K,handoff:Ge,other:ws},Wt={run:"Agent run",llm:"Model call",tool:"Tool call",agent:"Agent",handoff:"Handoff",other:"Span"};function ge(s,t,n,r){const i=[],a=s.spans.find(o=>o.kind==="agent");i.push({key:`run-${s.id}`,depth:n,label:s.kind==="workflow"?s.target:s.agentName??s.target,kind:"run",start:a?.startTime??s.startedAt,end:a?.endTime??s.endedAt??r,status:s.status==="running"||s.status==="waiting"?"running":s.status==="completed"?"ok":"error",run:s,...a&&{span:a}});const c=s.children.map(o=>t[o]).filter(o=>o!==void 0),l=new Set;for(const o of s.spans)if(o.kind!=="agent"&&(i.push({key:o.id,depth:n+1,label:o.kind==="llm"?o.model??"model":o.name.replace(/^tool\./,""),kind:o.kind,start:o.startTime,end:o.endTime,status:o.status,span:o,run:s}),o.kind==="tool")){const d=o.attributes["tool.call_id"];for(const j of c)j.parentToolCallId&&j.parentToolCallId===d&&(l.add(j.id),i.push(...ge(j,t,n+2,r)))}for(const o of c)l.has(o.id)||i.push(...ge(o,t,n+1,r));return i}function as(s){return s.kind==="run"?s.run.usage?.priced===!1?void 0:s.run.usage?.cost:s.span?.cost}function Kt(s){if(s.span?.kind==="llm")return(s.span.inputTokens??0)+(s.span.outputTokens??0)}function Te(s){return typeof s=="number"&&Number.isFinite(s)?s:void 0}function _t(s){const t=s.span?.attributes["tool.call_id"];return s.run.toolCalls.find(n=>n.id===t)}const Bt=new Set(["llm.model","llm.input_tokens","llm.output_tokens","llm.cached_input_tokens","llm.reasoning_tokens","llm.iteration","llm.finish_reason","tool.name","tool.call_id","tool.arguments","tool.success","tool.error"]);function Gt({row:s,origin:t,root:n,onClose:r}){const i=s.run.kind==="workflow"&&s.kind==="run"?D:ns[s.kind],a=s.span?.attributes??{},c=Object.fromEntries(Object.entries(a).filter(([h])=>!Bt.has(h))),l=s.kind==="tool"?_t(s):void 0,o=as(s),d=s.span?.kind==="llm"?s.span:void 0,j=Te(a["llm.cached_input_tokens"]),v=Te(a["llm.reasoning_tokens"]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"inspector-backdrop",onMouseDown:r}),e.jsxs("aside",{className:"inspector","aria-label":"Span details","data-testid":"inspector","data-dialog":!0,children:[e.jsxs("div",{className:"inspector-head",children:[e.jsx(i,{size:16,style:{marginTop:2,color:"var(--text-3)",flexShrink:0}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("h3",{children:s.label}),e.jsx("div",{className:"inspector-kind",children:Wt[s.kind]})]}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-icon btn-sm",onClick:r,"aria-label":"Close",children:e.jsx(We,{size:15})})]}),e.jsxs("div",{className:"inspector-body",children:[e.jsxs("dl",{className:"kv",children:[e.jsx("dt",{children:"Duration"}),e.jsx("dd",{children:T(s.end-s.start)}),e.jsx("dt",{children:"Starts at"}),e.jsxs("dd",{children:["+",T(s.start-t)]}),s.kind==="run"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Status"}),e.jsx("dd",{children:e.jsx(U,{status:s.run.status})}),s.run.model&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{className:"mono",children:s.run.model})]}),s.run.usage&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Tokens"}),e.jsxs("dd",{children:[L(s.run.usage.inputTokens)," in,"," ",L(s.run.usage.outputTokens)," out"]})]})]}),d&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{className:"mono",children:d.model??"-"}),e.jsx("dt",{children:"Input tokens"}),e.jsxs("dd",{children:[L(d.inputTokens),j!==void 0&&j>0&&e.jsxs("span",{className:"muted",children:[" (",L(j)," cached)"]})]}),e.jsx("dt",{children:"Output tokens"}),e.jsxs("dd",{children:[L(d.outputTokens),v!==void 0&&v>0&&e.jsxs("span",{className:"muted",children:[" (",L(v)," reasoning)"]})]}),a["llm.iteration"]!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Iteration"}),e.jsx("dd",{children:String(a["llm.iteration"])})]}),a["llm.finish_reason"]!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Finish reason"}),e.jsx("dd",{className:"mono",children:String(a["llm.finish_reason"])})]})]}),(s.kind==="llm"||s.kind==="run")&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Cost"}),e.jsx("dd",{children:Y(o,o!==void 0)})]}),s.kind==="tool"&&a["tool.call_id"]!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Call id"}),e.jsx("dd",{className:"mono",children:String(a["tool.call_id"])})]})]}),s.kind==="run"&&s.run.id!==n.id&&e.jsxs("a",{className:"btn btn-secondary",href:S("runs",s.run.id),children:[e.jsx($s,{size:13}),"Open this run"]}),s.kind==="run"&&e.jsx(B,{label:"Input",value:s.run.input}),s.kind==="run"&&s.run.output&&e.jsxs("div",{children:[e.jsx("div",{className:"io-label",children:"Output"}),e.jsx(te,{text:s.run.output})]}),s.kind==="run"&&s.run.error&&e.jsx(I,{children:s.run.error}),s.kind==="tool"&&e.jsx(B,{label:"Arguments",value:l?.arguments??a["tool.arguments"]??null}),s.kind==="tool"&&l?.result!==void 0&&!(l.error&&l.result===null)&&e.jsx(B,{label:"Result",value:l.result}),s.kind==="tool"&&(l?.error??a["tool.error"])!==void 0&&e.jsx(I,{children:String(l?.error??a["tool.error"])}),Object.keys(c).length>0&&e.jsx(B,{label:"Attributes",value:c})]})]})]})}function rs({run:s,runs:t,compact:n=!1}){const[r,i]=p.useState(),[a,c]=p.useState(Date.now),l=s.status==="running"||s.status==="waiting";p.useEffect(()=>{if(!l)return;const x=setInterval(()=>c(Date.now()),250);return()=>clearInterval(x)},[l]);const o=ge(s,t,0,a),d=Math.min(...o.map(x=>x.start)),v=Math.max(...o.map(x=>x.end),d+1)-d,h=o.findIndex(x=>x.key===r),u=o[h];return p.useEffect(()=>{if(!u)return;const x=f=>{f.key==="Escape"?i(void 0):f.key==="ArrowDown"||f.key==="j"?(f.preventDefault(),i(o[Math.min(h+1,o.length-1)]?.key)):(f.key==="ArrowUp"||f.key==="k")&&(f.preventDefault(),i(o[Math.max(h-1,0)]?.key))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[u,h,o]),e.jsxs("div",{className:"wf","data-testid":"waterfall",children:[e.jsxs("div",{className:"wf-row wf-head",children:[e.jsx("span",{children:"Span"}),e.jsxs("span",{className:"wf-axis",children:[e.jsx("span",{children:"0"}),e.jsx("span",{children:T(v/2)}),e.jsx("span",{children:T(v)})]}),e.jsx("span",{className:"wf-num",children:"Time"}),!n&&e.jsx("span",{className:"wf-num",children:"Tokens"}),!n&&e.jsx("span",{className:"wf-num",children:"Cost"})]}),o.map(x=>{const f=(x.start-d)/v*100,m=Math.max((x.end-x.start)/v*100,.5),g=Kt(x),w=as(x),y=x.kind==="run"&&x.run.kind==="workflow"?D:ns[x.kind];return e.jsxs("button",{type:"button",className:`wf-row ${r===x.key?"selected":""}`,onClick:()=>i(r===x.key?void 0:x.key),"data-testid":"trace-row","data-kind":x.kind,"aria-pressed":r===x.key,children:[e.jsxs("span",{className:"wf-label","data-kind":x.kind,title:x.label,children:[Array.from({length:x.depth},(k,b)=>e.jsx("span",{className:"wf-guide"},b)),e.jsx(y,{size:13}),e.jsx("span",{className:"truncate",children:x.label}),x.status==="error"&&e.jsx("span",{className:"wf-error",children:"failed"})]}),e.jsx("span",{className:"wf-track",children:e.jsx("span",{className:"wf-bar","data-kind":x.kind,"data-status":x.status,style:{left:`${f}%`,width:`${m}%`}})}),e.jsx("span",{className:"wf-num",children:T(x.end-x.start)}),!n&&e.jsx("span",{className:"wf-num",children:g!==void 0?L(g):""}),!n&&e.jsx("span",{className:"wf-num",children:w!==void 0?Y(w):""})]},x.key)}),u&&e.jsx(Gt,{row:u,origin:d,root:s,onClose:()=>i(void 0)})]})}function is(s,t){let n=0,r=0,i=0,a=!1;const c=l=>{if(l.usage)n+=l.usage.inputTokens,r+=l.usage.outputTokens,i+=l.usage.cost,a||=l.usage.priced!==!1;else for(const o of l.spans)o.kind==="llm"&&(n+=o.inputTokens??0,r+=o.outputTokens??0,i+=o.cost??0,a||=o.cost!==void 0);for(const o of l.children){const d=t[o];d&&(l.kind!=="workflow"||!l.usage)&&c(d)}};return c(s),{inputTokens:n,outputTokens:r,cost:i,priced:a}}function Ee({run:s,title:t,runs:n,changed:r}){const i=is(s,n);return e.jsxs("section",{className:"panel","data-testid":`compare-${t.toLowerCase()}`,children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("div",{className:"panel-title",children:[e.jsx("a",{href:S("runs",s.id),children:t}),e.jsx(U,{status:s.status})]}),e.jsxs("span",{className:"muted num",children:[Y(i.cost,i.priced)," ·"," ",T((s.endedAt??Date.now())-s.startedAt)]})]}),e.jsxs("div",{className:"compare-section",children:[e.jsx("h3",{children:"Input"}),e.jsx("div",{className:"io-input",children:s.input})]}),e.jsxs("div",{className:"compare-section",children:[e.jsx("h3",{children:"Tool calls"}),s.toolCalls.length===0&&e.jsx("span",{className:"muted",children:"None"}),s.toolCalls.map((a,c)=>e.jsxs("div",{className:`compare-call ${r.has(c)?"diverged":""}`,children:[e.jsxs("span",{className:"tool-name",children:[r.has(c)&&e.jsx(Ue,{size:12,color:"var(--warn)"}),a.name]}),e.jsx(B,{label:"Result",value:a.result??a.error??null})]},a.id))]}),e.jsxs("div",{className:"compare-section",children:[e.jsx("h3",{children:"Output"}),e.jsx("div",{"data-testid":"compare-output",children:s.output?e.jsx(te,{text:s.output}):e.jsx("span",{className:"muted",children:s.error??"None yet"})})]}),e.jsxs("div",{className:"compare-section",style:{padding:"14px 0 8px"},children:[e.jsx("h3",{style:{padding:"0 16px"},children:"Trace"}),e.jsx(rs,{run:s,runs:n,compact:!0})]})]})}function Ut({originalId:s,forkId:t}){const n=$(j=>j.runs);p.useEffect(()=>{me(s).catch(()=>{}),me(t).catch(()=>{})},[s,t]);const r=n[s],i=n[t],a=[{label:"Runs",to:["runs"]},...r?[{label:r.target,to:["runs",r.id]}]:[],{label:"Compare"}];if(!r||!i)return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:a}),e.jsx("div",{className:"scroll",children:e.jsx(W,{icon:Cs,title:"Loading both runs"})})]});const c=new Set,l=Math.max(r.toolCalls.length,i.toolCalls.length);for(let j=0;j<l;j++){const v=r.toolCalls[j],h=i.toolCalls[j];(v?.name!==h?.name||M(v?.result)!==M(h?.result))&&c.add(j)}const o=i.forkOf,d=[o?.input!==void 0&&"Input",o?.context!==void 0&&"Context",...Object.keys(o?.toolResults??{}).map(j=>`Result of ${j}`)].filter(j=>!!j);return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:a}),e.jsx("div",{className:"scroll",children:e.jsxs("div",{className:"page",style:{maxWidth:1400},"data-testid":"compare-view",children:[e.jsx("div",{className:"page-head",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"page-title",children:["Fork at step ",o?.step??"?"]}),e.jsx("div",{className:"page-sub",children:c.size===0?"Both branches made the same tool calls.":`${c.size} tool call${c.size===1?"":"s"} differ between the branches, highlighted below.`})]})}),e.jsx("div",{className:"diff-chips",children:d.length===0?e.jsxs("span",{className:"chip",children:[e.jsx(J,{size:11}),"Nothing changed, a plain rerun"]}):d.map(j=>e.jsxs("span",{className:"chip",children:[e.jsx(J,{size:11}),j]},j))}),e.jsxs("div",{className:"compare",children:[e.jsx(Ee,{run:r,title:"Original",runs:n,changed:c}),e.jsx(Ee,{run:i,title:"Fork",runs:n,changed:c})]})]})})]})}const Ht={agent:P,workflow:D,fork:J};function ls({runs:s,focused:t}){return e.jsxs("div",{className:"table",role:"table","aria-label":"Runs",children:[e.jsxs("div",{className:"tr thead",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Status"}),e.jsx("span",{role:"columnheader",children:"Target"}),e.jsx("span",{role:"columnheader",children:"Input"}),e.jsx("span",{role:"columnheader",className:"td-right",children:"Tokens"}),e.jsx("span",{role:"columnheader",className:"td-right",children:"Cost"}),e.jsx("span",{role:"columnheader",className:"td-right",children:"Duration"}),e.jsx("span",{role:"columnheader",className:"td-right",children:"Started"})]}),s.map((n,r)=>{const i=Ht[n.kind],a=n.usage?n.usage.inputTokens+n.usage.outputTokens:void 0;return e.jsxs("a",{className:`tr ${t===r?"focused":""}`,href:S("runs",n.id),role:"row","data-testid":"run-row","data-index":r,children:[e.jsx("span",{role:"cell",children:e.jsx(U,{status:n.status})}),e.jsxs("span",{role:"cell",className:"td-target",children:[e.jsx(i,{size:14}),e.jsx("span",{className:"truncate",children:n.kind==="fork"?`fork of ${n.target}`:n.target})]}),e.jsx("span",{role:"cell",className:"truncate subtle",children:ne(n.input,140)}),e.jsx("span",{role:"cell",className:"td-right muted",children:a!==void 0?L(a):""}),e.jsx("span",{role:"cell",className:"td-right muted",children:n.usage?Y(n.usage.cost,n.usage.priced!==!1):""}),e.jsx("span",{role:"cell",className:"td-right muted",children:T((n.endedAt??Date.now())-n.startedAt)}),e.jsx("span",{role:"cell",className:"td-right muted",children:G(n.startedAt)})]},n.id)})]})}function oe({icon:s,label:t,value:n,foot:r}){return e.jsxs("div",{className:"stat",children:[e.jsxs("div",{className:"stat-label",children:[e.jsx(s,{size:13}),t]}),e.jsx("div",{className:"stat-value",children:n}),e.jsx("div",{className:"stat-foot",children:r})]})}function Jt({stats:s}){const t=s.byStatus.completed+s.byStatus.failed,n=t>0?s.byStatus.completed/t*100:void 0,r=s.activity.at(-1)?.runs??0;return e.jsxs("div",{className:"stats","data-testid":"stats",children:[e.jsx(oe,{icon:P,label:"Runs",value:Z(s.runs),foot:`${Z(r)} today`}),e.jsx(oe,{icon:Ts,label:"Success rate",value:n===void 0?"-":`${n>=99.95||n<.05?n.toFixed(0):n.toFixed(1)}%`,foot:`${Z(s.byStatus.failed)} failed`}),e.jsx(oe,{icon:Es,label:"Spend",value:Y(s.cost,s.priced),foot:`${Z(s.inputTokens+s.outputTokens)} tokens`}),e.jsx(oe,{icon:As,label:"Latency p50",value:s.duration?T(s.duration.p50):"-",foot:s.duration?`p95 ${T(s.duration.p95)}`:"no finished runs"})]})}function Vt({stats:s}){const t=Math.max(1,...s.activity.map(i=>i.runs)),n=s.activity[0],r=s.activity.at(-1);return e.jsxs("div",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsx("div",{className:"panel-title",children:"Activity"}),e.jsxs("span",{className:"muted",children:["last ",s.activity.length," days"]})]}),e.jsxs("div",{className:"panel-body",children:[e.jsx("div",{className:"chart",role:"img","aria-label":"Runs per day",children:s.activity.map(i=>e.jsx("div",{className:"chart-col","data-tip":`${we(i.day)}: ${i.runs} run${i.runs===1?"":"s"}${i.failed?`, ${i.failed} failed`:""}`,children:e.jsx("div",{className:"chart-bar",style:{height:`${i.runs/t*100}%`},children:i.failed>0&&e.jsx("div",{className:"chart-bar-failed",style:{height:`${i.failed/Math.max(i.runs,1)*100}%`}})})},i.day))}),e.jsxs("div",{className:"chart-axis",children:[e.jsx("span",{children:n?we(n.day):""}),e.jsx("span",{children:r?"Today":""})]})]})]})}function qt({stats:s}){const t=[{key:"completed",label:"Completed"},{key:"failed",label:"Failed"},{key:"stopped",label:"Stopped"},{key:"running",label:"Running"},{key:"waiting",label:"Needs approval"}];return e.jsxs("div",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("div",{className:"panel-title",children:"Outcomes"})}),e.jsx("div",{className:"panel-body breakdown",children:t.map(({key:n,label:r})=>{const i=s.byStatus[n],a=s.runs>0?i/s.runs*100:0;return e.jsxs("div",{className:"breakdown-row",children:[e.jsxs("div",{className:"breakdown-label",children:[e.jsx("span",{className:"subtle",children:r}),e.jsx("span",{className:"num",children:Z(i)})]}),e.jsx("div",{className:"meter",children:e.jsx("span",{"data-status":n,style:{width:`${a}%`}})})]},n)})})]})}function Ae(s,t){return`${Z(s)} ${t}${s===1?"":"s"}`}function Re(s,t,n){return s?.targets.find(r=>r.kind===t&&r.target===n)}function Xt(){const s=$(l=>l.host),t=$(l=>l.project),n=$(l=>l.stats),r=$(l=>l.runs),i=Object.values(r).filter(l=>!l.parentRunId).sort((l,o)=>o.startedAt-l.startedAt).slice(0,6);if(s.state!=="ready")return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[{label:"Overview"}]}),e.jsx("div",{className:"scroll",children:e.jsx(W,{icon:K,title:"Waiting for the project",children:"The studio shows the project once its registry loads."})})]});const{registry:a,memory:c}=s;return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[{label:"Overview"}]}),e.jsx("div",{className:"scroll",children:e.jsxs("div",{className:"page","data-testid":"overview",children:[e.jsxs("div",{className:"page-head",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:t}),e.jsxs("div",{className:"page-sub",children:[a.agents.length," agent",a.agents.length===1?"":"s",a.workflows.length>0&&`, ${a.workflows.length} workflow${a.workflows.length===1?"":"s"}`,a.swarms.length>0&&`, ${a.swarms.length} swarm${a.swarms.length===1?"":"s"}`,c==="studio"?", threads kept by the studio":", memory of the project"]})]}),a.agents[0]&&e.jsxs("a",{className:"btn btn-primary",href:S("agents",a.agents[0].key),children:[e.jsx(He,{size:14}),"Chat with ",a.agents[0].name]})]}),n?e.jsxs(e.Fragment,{children:[e.jsx(Jt,{stats:n}),e.jsxs("div",{className:"activity",children:[e.jsx(Vt,{stats:n}),e.jsx(qt,{stats:n})]})]}):e.jsx("div",{className:"skeleton",style:{height:96,borderRadius:12}}),e.jsx("h2",{className:"section-title",children:"Agents"}),a.agents.length===0?e.jsx("div",{className:"panel",children:e.jsxs(W,{icon:K,title:"No agents yet",children:["Export them as ",e.jsx("code",{children:"agents"})," from ",e.jsx("code",{children:"src/cogitator.ts"}),"."]})}):e.jsx("div",{className:"entities",children:a.agents.map(l=>{const o=Re(n,"agent",l.key);return e.jsxs("a",{className:"entity",href:S("agents",l.key),children:[e.jsxs("div",{className:"entity-head",children:[e.jsx("span",{className:"entity-icon",children:e.jsx(K,{size:15})}),e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{className:"entity-name truncate",children:l.name}),e.jsx("div",{className:"muted mono truncate",children:be(l,a)})]})]}),e.jsx("div",{className:"entity-desc",children:l.description??l.instructions??"An agent of this project."}),e.jsxs("div",{className:"entity-foot",children:[e.jsxs("span",{children:[e.jsx(se,{size:12}),l.tools.length," tool",l.tools.length===1?"":"s"]}),e.jsxs("span",{children:[e.jsx(P,{size:12}),Ae(o?.runs??0,"run")]}),o&&e.jsx("span",{children:G(o.lastRunAt)})]})]},l.key)})}),a.workflows.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"section-title",children:"Workflows"}),e.jsx("div",{className:"entities",children:a.workflows.map(l=>{const o=Re(n,"workflow",l.key);return e.jsxs("a",{className:"entity",href:S("workflows",l.key),children:[e.jsxs("div",{className:"entity-head",children:[e.jsx("span",{className:"entity-icon",children:e.jsx(D,{size:15})}),e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{className:"entity-name truncate",children:l.name}),e.jsx("div",{className:"muted mono truncate",children:l.nodes.join(" → ")})]})]}),e.jsxs("div",{className:"entity-foot",children:[e.jsxs("span",{children:[l.nodes.length," nodes"]}),e.jsxs("span",{children:[e.jsx(P,{size:12}),Ae(o?.runs??0,"run")]}),o&&e.jsx("span",{children:G(o.lastRunAt)})]})]},l.key)})})]}),e.jsxs("h2",{className:"section-title",children:["Recent runs",i.length>0&&e.jsxs("a",{className:"link",href:S("runs"),children:["All runs ",e.jsx(Ge,{size:12,style:{verticalAlign:-2}})]})]}),i.length===0?e.jsx("div",{className:"panel",children:e.jsx(W,{icon:P,title:"No runs yet",children:"Chat with an agent or run a workflow, every run shows up here with its trace and cost."})}):e.jsx(ls,{runs:i})]})})]})}function Yt(s){return typeof s=="string"&&(s.length>80||s.includes(`
8
+ `))}function os({value:s,label:t}){const[n,r]=p.useState(!1);if(!s||typeof s!="object"||Array.isArray(s))return e.jsx(B,{label:t,value:s});const i=Object.entries(s);return e.jsxs("div",{className:"json state",children:[e.jsxs("div",{className:"json-head",children:[e.jsx("span",{children:t}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:2},children:[e.jsxs("div",{className:"seg seg-icons",role:"group","aria-label":"View",children:[e.jsx("button",{type:"button","aria-pressed":!n,"aria-label":"Fields","data-tip":"Fields",onClick:()=>r(!1),children:e.jsx(Rs,{size:12})}),e.jsx("button",{type:"button","aria-pressed":n,"aria-label":"Raw JSON","data-tip":"Raw JSON",onClick:()=>r(!0),children:e.jsx(Os,{size:12})})]}),e.jsx(ae,{value:M(s),label:`Copy ${t.toLowerCase()}`})]})]}),n?e.jsx("pre",{children:M(s)}):e.jsxs("div",{className:"state-fields",children:[i.length===0&&e.jsx("div",{className:"muted",children:"Empty"}),i.map(([a,c])=>e.jsxs("div",{className:"state-field",children:[e.jsx("div",{className:"state-key",children:a}),Yt(c)?e.jsx("div",{className:"state-prose",children:e.jsx(te,{text:c})}):e.jsx("pre",{className:`state-value ${typeof c=="string"?"state-text":""}`,children:M(c)})]},a))]})]})}const Q=184,_=56,Qt=72,Oe=28,Ie={pending:"pending",running:"running",completed:"done",failed:"failed",skipped:"skipped"};function Zt(s){const t=new Map([[s.entryPoint,0]]);for(const a of s.nodes)for(const c of s.edges){const l=t.get(c.from);if(l!==void 0)for(const o of c.to)o!==c.from&&(t.get(o)??-1)<l+1&&l+1<s.nodes.length&&t.set(o,l+1)}for(const a of s.nodes)t.has(a)||t.set(a,0);const n=new Map;for(const a of s.nodes){const c=t.get(a)??0;n.set(c,[...n.get(c)??[],a])}const r=Math.max(...[...n.values()].map(a=>a.length),1),i=new Map;for(const[a,c]of n){const l=(r-c.length)*(_+Oe)/2;c.forEach((o,d)=>i.set(o,{x:a*(Q+Qt),y:l+d*(_+Oe)}))}return i}function en(s,t){return s.length>t?`${s.slice(0,t-1)}…`:s}function cs({workflow:s,nodes:t,selected:n,onSelect:r}){const i=Zt(s),a=Math.max(...[...i.values()].map(d=>d.x+Q),Q),c=Math.max(...[...i.values()].map(d=>d.y+_),_)+30,l=d=>t?.find(j=>j.name===d),o=d=>l(d)?.status??"pending";return e.jsxs("svg",{className:"workflow-graph",viewBox:`-2 -2 ${a+4} ${c+4}`,width:a+4,height:c+4,role:"group","aria-label":`Graph of ${s.name}`,"data-testid":"workflow-graph",children:[e.jsx("defs",{children:e.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 1 L 9 5 L 0 9 z",className:"edge-head"})})}),s.edges.flatMap(d=>d.to.map(j=>{const v=i.get(d.from),h=i.get(j);if(!v||!h)return null;const u=h.x<=v.x,x=v.x+Q,f=v.y+_/2,m=u?h.x+Q/2:h.x-2,g=u?h.y+_:h.y+_/2,w=(x+m)/2,y=u?`M ${x} ${f} C ${x+48} ${f+70}, ${m} ${g+56}, ${m} ${g+2}`:`M ${x} ${f} C ${w} ${f}, ${w} ${g}, ${m} ${g}`,k=o(d.from),b=o(j),A=k==="completed"&&b==="running"?"edge-live":k==="completed"&&b==="completed"?"edge-done":"";return e.jsx("path",{d:y,className:`edge edge-${d.type} ${A}`,markerEnd:"url(#arrow)"},`${d.from}-${j}`)})),s.nodes.map(d=>{const j=i.get(d);if(!j)return null;const v=l(d),h=v?.status??"pending",u=v?.duration!==void 0?`${Ie[h]} · ${T(v.duration)}`:Ie[h];return e.jsxs("g",{transform:`translate(${j.x}, ${j.y})`,className:`node node-${h} ${n===d?"node-selected":""}`,onClick:()=>r?.(d),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r?.(d))},"data-testid":`node-${d}`,"data-status":h,role:"button",tabIndex:r?0:-1,"aria-pressed":n===d,"aria-label":`${d}, ${u}`,children:[e.jsx("title",{children:d}),e.jsx("rect",{className:"node-card",width:Q,height:_,rx:"10"}),e.jsx("circle",{className:"node-dot",cx:18,cy:_/2,r:4}),e.jsx("text",{className:"node-name",x:32,y:23,children:en(d,20)}),e.jsx("text",{className:"node-sub",x:32,y:40,children:u})]},d)})]})}function z({label:s,children:t}){return e.jsxs("div",{className:"prop",children:[e.jsx("span",{className:"prop-label",children:s}),e.jsx("span",{className:"prop-value",children:t})]})}function sn({run:s,runs:t}){const n=is(s,t),r=n.inputTokens+n.outputTokens,i=s.status==="running"||s.status==="waiting",[a,c]=p.useState(Date.now);return p.useEffect(()=>{if(!i)return;const l=setInterval(()=>c(Date.now()),500);return()=>clearInterval(l)},[i]),e.jsxs("aside",{className:"props","data-testid":"run-summary","aria-label":"Run properties",children:[e.jsx(z,{label:"Status",children:e.jsx(U,{status:s.status})}),e.jsx(z,{label:s.kind==="workflow"?"Workflow":"Agent",children:e.jsx("a",{href:s.kind==="workflow"?S("workflows",s.target):S("agents",s.target),children:s.target})}),s.model&&e.jsx(z,{label:"Model",children:e.jsx("span",{className:"mono truncate",children:s.model})}),e.jsx(z,{label:"Started",children:e.jsx("span",{"data-tip":Je(s.startedAt),children:G(s.startedAt)})}),e.jsx(z,{label:"Duration",children:T((s.endedAt??a)-s.startedAt)}),e.jsx(z,{label:"Cost",children:e.jsx("span",{"data-testid":"run-cost",children:Y(n.cost,n.priced)})}),e.jsxs(z,{label:"Tokens",children:[L(n.inputTokens)," in · ",L(n.outputTokens)," out"]}),r>0&&e.jsxs("div",{className:"token-bar","aria-hidden":"true",children:[e.jsx("span",{style:{width:`${n.inputTokens/r*100}%`}}),e.jsx("span",{style:{width:`${n.outputTokens/r*100}%`}})]}),(s.threadId||s.parentRunId||s.forkOf||s.rerunOf)&&e.jsx("div",{className:"props-sep"}),s.threadId&&s.kind==="agent"&&!s.parentRunId&&e.jsx(z,{label:"Thread",children:e.jsx("a",{href:S("agents",s.target,s.threadId),children:"Open the chat"})}),s.parentRunId&&e.jsx(z,{label:"Started by",children:e.jsx("a",{href:S("runs",s.parentRunId),children:"Parent run"})}),s.forkOf&&e.jsx(z,{label:"Fork of",children:e.jsxs("a",{href:S("compare",s.forkOf.runId,s.id),children:["Step ",s.forkOf.step,", compare"]})}),s.rerunOf&&e.jsx(z,{label:"Rerun of",children:e.jsxs("a",{href:S("runs",s.rerunOf.runId),children:["From ",s.rerunOf.fromNode]})}),e.jsx("div",{className:"props-sep"}),e.jsxs(z,{label:"Run id",children:[e.jsx("span",{className:"mono truncate muted",children:s.id}),e.jsx(ae,{value:s.id,label:"Copy run id"})]})]})}function ds(s){try{return{ok:!0,value:JSON.parse(s)}}catch{return{ok:!1}}}function tn(s){const t=ds(s);return t.ok?t.value:s}function nn({run:s}){const t=s.steps??[],n=y=>Object.fromEntries((y?.toolCalls??[]).map(k=>[k.name,M(k.result)])),[r,i]=p.useState(t.at(-1)?.index??0),a=t.find(y=>y.index===r),[c,l]=p.useState(s.input),[o,d]=p.useState(""),j=[...new Set(s.toolCalls.map(y=>y.name))],[v,h]=p.useState(()=>n(a)),[u,x]=p.useState(),[f,m]=p.useState(!1),g=y=>{i(y.index),h(n(y))};if(t.length===0)return null;const w=async()=>{x(void 0);const y={};for(const[k,b]of Object.entries(v)){if(!b.trim())continue;const A=a?.toolCalls.find(N=>N.name===k);if(A&&M(A.result)===b)continue;const re=ds(b);y[k]=re.ok?re.value:b}m(!0);try{const k=await E.fork(s.id,{step:r,...c!==s.input&&{input:c},...o.trim()&&{context:o.trim()},...Object.keys(y).length>0&&{toolResults:y}});C("compare",s.id,k.runId)}catch(k){x(V(k))}finally{m(!1)}};return e.jsxs("section",{className:"panel",id:"fork","data-testid":"fork-panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("div",{className:"panel-title",children:[e.jsx(J,{size:14}),"Fork from a step"]})}),e.jsxs("div",{className:"panel-body",children:[e.jsx("p",{className:"panel-desc",children:"Go back to a step, change what the agent saw, and run on from there. The original stays as it is, and both are shown side by side."}),e.jsx("div",{className:"steps",role:"radiogroup","aria-label":"Step",children:t.map(y=>e.jsxs("button",{type:"button",className:`step ${y.index===r?"active":""}`,onClick:()=>g(y),role:"radio","aria-checked":y.index===r,"data-testid":`step-${y.index}`,children:[e.jsx("span",{className:"step-index",children:y.index}),y.label]},y.checkpointId))}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Input"}),e.jsx("textarea",{className:"input",rows:2,value:c,onChange:y=>l(y.target.value),"data-testid":"fork-input"})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Extra context for the agent"}),e.jsx("textarea",{className:"input",rows:2,placeholder:"Anything the agent should know from this step on",value:o,onChange:y=>d(y.target.value)})]}),j.map(y=>e.jsxs("label",{className:"field",children:[e.jsxs("span",{children:["Result of ",e.jsx("code",{children:y})," from this step on"]}),e.jsx("textarea",{className:"input mono",rows:3,value:v[y]??"",placeholder:"Leave empty to run the tool",onChange:k=>h({...v,[y]:k.target.value}),"data-testid":`fork-result-${y}`})]},y)),e.jsxs("button",{type:"button",className:"btn btn-primary",disabled:f,onClick:()=>{w()},"data-testid":"fork",children:[f?e.jsx("span",{className:"spinner"}):e.jsx(J,{size:14}),"Fork from step ",r]}),u&&e.jsx(I,{children:u})]})]})}function an({run:s,workflow:t}){const[n,r]=p.useState(),[i,a]=p.useState();if(!t)return e.jsx("section",{className:"panel",children:e.jsx(W,{icon:D,title:`No workflow ${s.target}`,children:"It is no longer in the registry, so its graph cannot be drawn."})});const c=s.nodes?.find(d=>d.name===n),l=s.status==="completed"||s.status==="failed",o=async()=>{if(n){a(void 0);try{const d=await E.rerun(s.id,n);C("runs",d.runId)}catch(d){a(V(d))}}};return e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("div",{className:"panel-title",children:[e.jsx(D,{size:14}),"Nodes"]}),e.jsx("span",{className:"muted",children:n?"":l&&s.workflowRunId?"Pick a node to read it or rerun from it":"Pick a node to read it"})]}),e.jsx("div",{className:"canvas",children:e.jsx(cs,{workflow:t,nodes:s.nodes,selected:n,onSelect:d=>r(n===d?void 0:d)})}),c&&e.jsxs("div",{className:"node-detail",children:[e.jsxs("div",{className:"node-detail-head",children:[e.jsx("strong",{children:c.name}),e.jsx(U,{status:c.status}),c.duration!==void 0&&e.jsx("span",{className:"muted",children:T(c.duration)}),e.jsx("span",{style:{flex:1}}),l&&s.workflowRunId&&e.jsxs("button",{type:"button",className:"btn btn-primary btn-sm",onClick:()=>{o()},"data-testid":"rerun",children:[e.jsx(Is,{size:13}),"Rerun from ",c.name]})]}),c.output!==void 0&&e.jsx(os,{label:"Output",value:c.output}),c.error&&e.jsx(I,{children:c.error}),c.output===void 0&&!c.error&&e.jsx("span",{className:"muted",children:"This node has no output in this run."})]}),i&&e.jsx("div",{style:{padding:"0 16px 16px"},children:e.jsx(I,{children:i})})]})}function rn({runId:s}){const t=$(h=>h.runs),n=$(h=>h.host),[r,i]=p.useState();p.useEffect(()=>{i(void 0),me(s).catch(h=>i(V(h)))},[s]);const a=t[s],c=[{label:"Runs",to:["runs"]}];if(!a)return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[...c,{label:s}]}),e.jsx("div",{className:"scroll",children:r?e.jsx(W,{icon:P,title:"Run not found",children:r}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"skeleton",style:{height:28,width:240,marginBottom:24}}),e.jsx("div",{className:"skeleton",style:{height:320}})]})})]});const l=n.state==="ready"?n.registry.workflows.find(h=>h.key===a.target):void 0,o=a.forks.map(h=>t[h]).filter(h=>h!==void 0),d=a.kind!=="workflow"&&a.status==="completed"&&!a.parentRunId&&(a.steps?.length??0)>0,j=a.status==="running"||a.status==="waiting",v=a.kind==="workflow"?"Workflow run":a.kind==="fork"?"Fork":"Agent run";return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[...c,{label:`${a.target} · ${a.id.slice(-8)}`}],actions:e.jsxs(e.Fragment,{children:[j&&e.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:()=>{E.stop(a.id)},children:"Stop"}),a.threadId&&a.kind==="agent"&&!a.parentRunId&&e.jsxs("a",{className:"btn btn-secondary btn-sm",href:S("agents",a.target,a.threadId),children:[e.jsx(He,{size:13}),"Chat"]}),d&&e.jsxs("a",{className:"btn btn-secondary btn-sm",href:"#fork",onClick:h=>{h.preventDefault(),document.getElementById("fork")?.scrollIntoView({behavior:"smooth",block:"start"})},children:[e.jsx(J,{size:13}),"Fork"]})]})}),e.jsx("div",{className:"scroll",children:e.jsxs("div",{className:"page","data-testid":"run-view","data-status":a.status,children:[e.jsx("div",{className:"page-head",children:e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:v}),e.jsxs("div",{className:"page-sub",children:[a.target," · started ",Je(a.startedAt)]})]})}),e.jsxs("div",{className:"run-layout",children:[e.jsxs("div",{className:"run-main",children:[e.jsx("section",{className:"panel",children:e.jsxs("div",{className:"panel-body io",children:[e.jsxs("div",{children:[e.jsx("div",{className:"io-label",children:"Input"}),e.jsx("div",{className:"io-input",children:a.input})]}),e.jsxs("div",{children:[e.jsx("div",{className:"io-label",children:j?"Output so far":"Output"}),a.output?a.kind==="workflow"?e.jsx(os,{label:"Final state",value:tn(a.output)}):e.jsx(te,{text:a.output}):e.jsx("span",{className:"muted",children:j?"Waiting for the first tokens":"No output"}),a.error&&e.jsx(I,{children:a.error})]})]})}),a.kind==="workflow"&&e.jsx(an,{run:a,workflow:l}),e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("div",{className:"panel-title",children:[e.jsx(Be,{size:14}),"Trace"]}),e.jsxs("div",{className:"wf-legend",children:[e.jsxs("span",{children:[e.jsx("i",{style:{background:"var(--bar-llm)"}}),"Model"]}),e.jsxs("span",{children:[e.jsx("i",{style:{background:"var(--bar-tool)"}}),"Tool"]}),e.jsxs("span",{children:[e.jsx("i",{style:{background:"var(--bar-run)"}}),"Run"]})]})]}),e.jsx("div",{style:{padding:"4px 0 8px"},children:e.jsx(rs,{run:a,runs:t})})]}),a.toolCalls.length>0&&e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("div",{className:"panel-title",children:[e.jsx(se,{size:14}),"Tool calls ",e.jsx("span",{className:"count",children:a.toolCalls.length})]})}),e.jsx("div",{className:"panel-body",style:{display:"grid",gap:8},children:a.toolCalls.map(h=>e.jsx(ts,{call:h},h.id))})]}),o.length>0&&e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("div",{className:"panel-title",children:[e.jsx(J,{size:14}),"Forks ",e.jsx("span",{className:"count",children:o.length})]})}),o.map(h=>e.jsxs("a",{className:"fork-row",href:S("compare",a.id,h.id),"data-testid":"fork-link",children:[e.jsx(U,{status:h.status}),e.jsxs("span",{children:["From step ",h.forkOf?.step]}),e.jsx("span",{className:"muted grow truncate",style:{flex:1},children:h.output?h.output.replace(/\s+/g," "):""}),e.jsx("span",{className:"muted",children:G(h.startedAt)})]},h.id))]}),d&&e.jsx(nn,{run:a})]}),e.jsx(sn,{run:a,runs:t})]})]})})]})}const ln=[{value:"",label:"All"},{value:"agent",label:"Chats"},{value:"workflow",label:"Workflows"},{value:"fork",label:"Forks"}];function on(){const s=$(g=>g.host),t=$(g=>g.runs),[n,r]=p.useState(""),[i,a]=p.useState(""),[c,l]=p.useState(""),[o,d]=p.useState(),[j,v]=p.useState(),[h,u]=p.useState(-1),x=Object.keys(t).length;p.useEffect(()=>{let g=!0;const w=setTimeout(()=>{E.runs({q:n,target:i,kind:c}).then(y=>{g&&(d(y.runs),v(void 0))}).catch(y=>g&&v(V(y)))},150);return()=>{g=!1,clearTimeout(w)}},[n,i,c,x]),p.useEffect(()=>u(-1),[n,i,c]);const f=s.state==="ready"?[...s.registry.agents.map(g=>g.key),...s.registry.workflows.map(g=>g.key)]:[],m=(o??[]).map(g=>t[g.id]??g);return ss(["j","k","ArrowDown","ArrowUp","Enter"],g=>{if(g.key==="Enter"){const k=m[h];k&&C("runs",k.id);return}const w=g.key==="j"||g.key==="ArrowDown"?1:-1,y=Math.min(Math.max(h+w,0),m.length-1);u(y),document.querySelector(`.tr[data-index="${y}"]`)?.scrollIntoView({block:"nearest"})}),e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:[{label:"Runs"}]}),e.jsx("div",{className:"scroll",children:e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"page-head",children:e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:"Runs"}),e.jsx("div",{className:"page-sub",children:"Every chat, workflow run and fork, with its trace and cost."})]})}),e.jsxs("div",{className:"toolbar",children:[e.jsxs("label",{className:"input-icon",children:[e.jsx(ue,{size:14}),e.jsx("input",{className:"input",placeholder:"Search inputs, outputs and errors",value:n,onChange:g=>r(g.target.value),onKeyDown:g=>g.key==="Escape"&&g.currentTarget.blur(),"aria-label":"Search runs","data-testid":"search","data-search":!0}),e.jsx(R,{keys:["/"]})]}),e.jsx("div",{className:"seg",role:"group","aria-label":"Kind",children:ln.map(g=>e.jsx("button",{type:"button","aria-pressed":c===g.value,onClick:()=>l(g.value),children:g.label},g.value))}),e.jsxs("select",{className:"input select",value:i,onChange:g=>a(g.target.value),"aria-label":"Agent or workflow","data-testid":"filter-target",children:[e.jsx("option",{value:"",children:"Every agent and workflow"}),f.map(g=>e.jsx("option",{value:g,children:g},g))]})]}),j&&e.jsx(I,{children:j}),!o&&!j&&e.jsx("div",{className:"skeleton",style:{height:240}}),o&&m.length===0&&e.jsx("div",{className:"panel",children:e.jsx(W,{icon:P,title:n||i||c?"No runs match":"No runs yet",children:n||i||c?"Try other words or clear the filters.":"Chat with an agent or run a workflow to see it here."})}),m.length>0&&e.jsx(ls,{runs:m,focused:h})]})})]})}function cn(s){if(s.trim())try{JSON.parse(s);return}catch(t){return V(t)}}function dn({workflowKey:s}){const t=$(f=>f.host),n=$(f=>f.runs),r=t.state==="ready"?t.registry.workflows.find(f=>f.key===s):void 0,[i,a]=p.useState(""),[c,l]=p.useState(),[o,d]=p.useState(!1);p.useEffect(()=>{r&&a(M(r.initialState??{}))},[r?.key]),p.useEffect(()=>{ct({target:s,kind:"workflow"}).catch(()=>{})},[s]);const j=[{label:r?.name??s}];if(t.state!=="ready")return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:j}),e.jsx("div",{className:"scroll",children:e.jsx(W,{icon:D,title:"Waiting for the project"})})]});if(!r)return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:j}),e.jsx("div",{className:"scroll",children:e.jsx(W,{icon:D,title:`No workflow ${s}`,children:"It is not in the registry of this project anymore."})})]});const v=Object.values(n).filter(f=>f.kind==="workflow"&&f.target===s).sort((f,m)=>m.startedAt-f.startedAt),h=v[0],u=cn(i),x=async()=>{if(!(u||o)){l(void 0),d(!0);try{const f=await E.runWorkflow(s,i.trim()?JSON.parse(i):{});C("runs",f.runId)}catch(f){l(V(f))}finally{d(!1)}}};return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:j,actions:e.jsxs("button",{type:"button",className:"btn btn-primary btn-sm",disabled:!!u||o,onClick:()=>{x()},children:[e.jsx(he,{size:12,fill:"currentColor"}),"Run"]})}),e.jsx("div",{className:"scroll",children:e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"page-head",children:e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:r.name}),e.jsxs("div",{className:"page-sub",children:[r.nodes.length," nodes, starts at ",e.jsx("code",{children:r.entryPoint})]})]})}),e.jsxs("div",{className:"workflow-layout",children:[e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("div",{className:"panel-title",children:[e.jsx(D,{size:14}),"Graph"]}),h&&e.jsxs("a",{className:"link",href:S("runs",h.id),children:["Latest run, ",G(h.startedAt)]})]}),e.jsx("div",{className:"canvas",style:{minHeight:220},children:e.jsx(cs,{workflow:r,nodes:h?.nodes})})]}),e.jsxs("div",{className:"side-stack",children:[e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("div",{className:"panel-title",children:[e.jsx(he,{size:14}),"Run it"]}),e.jsx(R,{keys:[ke,"Enter"]})]}),e.jsxs("div",{className:"panel-body",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Input state (JSON)"}),e.jsx("textarea",{className:"input mono",rows:8,value:i,spellCheck:!1,onChange:f=>a(f.target.value),onKeyDown:f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&(f.preventDefault(),x())},"aria-invalid":!!u,"data-testid":"workflow-input"})]}),u&&e.jsxs(I,{children:["Not JSON yet: ",u]}),e.jsxs("button",{type:"button",className:"btn btn-primary",style:{width:"100%",marginTop:u?12:0},disabled:!!u||o,onClick:()=>{x()},"data-testid":"run-workflow",children:[o?e.jsx("span",{className:"spinner"}):e.jsx(he,{size:12,fill:"currentColor"}),"Run ",r.name]}),c&&e.jsx(I,{children:c})]})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("div",{className:"panel-title",children:[e.jsx(P,{size:14}),"Runs ",e.jsx("span",{className:"count",children:v.length})]})}),v.length===0&&e.jsx("div",{className:"panel-body muted",children:"No runs yet. Run it to see each node work."}),v.slice(0,12).map(f=>e.jsxs("a",{className:"list-row",href:S("runs",f.id),children:[e.jsx(U,{status:f.status}),e.jsx("span",{className:"grow truncate",children:f.rerunOf?`Rerun from ${f.rerunOf.fromNode}`:"Run"}),e.jsx("span",{className:"muted num",children:T((f.endedAt??Date.now())-f.startedAt)}),e.jsx("span",{className:"muted",children:G(f.startedAt)})]},f.id)),v.length>12&&e.jsxs("a",{className:"list-row link",href:S("runs"),children:["All ",v.length," runs"]})]})]})]})]})})]})}function un(){const s=$(r=>r.host),t=$(r=>r.connected),n=$(r=>r.loaded);return!t&&n?e.jsxs("div",{className:"banner banner-warn",role:"status",children:[e.jsx(zs,{size:14}),e.jsx("span",{children:"Lost the connection to cogitator dev, reconnecting."})]}):s.state==="starting"?e.jsxs("div",{className:"banner",role:"status",children:[e.jsx(Me,{size:14,style:{animation:"spin 1s linear infinite"}}),e.jsx("span",{children:"Loading the project"})]}):s.state==="restarting"?e.jsxs("div",{className:"banner",role:"status","data-testid":"reloading",children:[e.jsx(Ds,{size:14,style:{animation:"spin 1s linear infinite"}}),e.jsxs("span",{children:["Reloading: ",s.reason]})]}):s.state==="failed"?e.jsxs("div",{className:"banner banner-error",role:"alert","data-testid":"host-error",children:[e.jsxs("div",{className:"banner-row",children:[e.jsx(Ue,{size:15}),"The project does not load"]}),e.jsx("pre",{children:s.error}),e.jsx("span",{children:"Fix the code and save, the studio reloads it."})]}):null}function hn({route:s}){const[t,n,r]=s;return t==="agents"&&n?e.jsx(Pt,{agentKey:n,threadId:r},n):t==="runs"&&n?e.jsx(rn,{runId:n},n):t==="runs"?e.jsx(on,{}):t==="compare"&&n&&r?e.jsx(Ut,{originalId:n,forkId:r},`${n}-${r}`):t==="workflows"&&n?e.jsx(dn,{workflowKey:n},n):e.jsx(Xt,{})}function pn(){const s=at(),[t,n]=p.useState(!1),[r,i]=p.useState(!1),a=p.useRef(0);p.useEffect(()=>lt(),[]);const c=p.useCallback(()=>{n(!1),i(!0)},[]);return es(l=>{if((l.metaKey||l.ctrlKey)&&l.key.toLowerCase()==="k"){l.preventDefault(),i(!1),n(o=>!o);return}if(!(l.metaKey||l.ctrlKey||l.altKey)&&!(Qe(l)||Ze()))if(l.key==="?")l.preventDefault(),c();else if(l.key==="/"){l.preventDefault();const o=document.querySelector("[data-search]");o?o.focus():n(!0)}else l.key==="g"?a.current=Date.now():Date.now()-a.current<900&&(a.current=0,l.key==="o"&&C(),l.key==="r"&&C("runs"))}),e.jsxs("div",{className:"app",children:[e.jsx(wt,{route:s,onSearch:()=>n(!0),onShortcuts:c}),e.jsxs("main",{className:"main",children:[e.jsx(un,{}),e.jsx(hn,{route:s})]}),t&&e.jsx(vt,{onClose:()=>n(!1),onShortcuts:c}),r&&e.jsx(yt,{onClose:()=>i(!1)})]})}const ze=document.getElementById("root");ze&&us.createRoot(ze).render(e.jsx(p.StrictMode,{children:e.jsx(pn,{})}));
@@ -0,0 +1 @@
1
+ @font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-cyrillic-ext-wght-normal-DjL33-gN.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-cyrillic-wght-normal-BEAKL7Jp.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-vietnamese-wght-normal-6IgcOCM7.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-latin-ext-wght-normal-DC-KSUi6.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-latin-wght-normal-BgDaEnEv.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-symbols2-wght-normal-CO5SzqOn.woff2) format("woff2-variations");unicode-range:U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-vietnamese-wght-normal-DadHysG0.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./geist-mono-latin-wght-normal-XN7g48iV.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--bg: #fbfbfc;--bg-sidebar: #f6f6f8;--surface: #ffffff;--surface-2: #f6f6f8;--surface-3: #efeff2;--hover: rgba(15, 15, 25, .045);--active: rgba(15, 15, 25, .075);--border: rgba(15, 15, 25, .085);--border-strong: rgba(15, 15, 25, .14);--text: #18181b;--text-2: #52525b;--text-3: #85858f;--text-4: #b4b4bc;--accent: #5b5bd6;--accent-text: #4a4ac4;--accent-soft: rgba(91, 91, 214, .1);--accent-ring: rgba(91, 91, 214, .35);--primary-bg: #18181b;--primary-text: #fafafa;--primary-hover: #2e2e33;--ok: #1a9a5f;--ok-soft: rgba(26, 154, 95, .1);--warn: #b26b00;--warn-soft: rgba(214, 140, 20, .12);--error: #d43d4f;--error-soft: rgba(212, 61, 79, .09);--info: #2f6fde;--bar-run: #a1a1aa;--bar-llm: #6e6ee6;--bar-tool: #2fa774;--bar-other: #c08a2d;--grid: rgba(15, 15, 25, .06);--shadow-sm: 0 1px 2px rgba(15, 15, 25, .05);--shadow-md: 0 4px 16px -4px rgba(15, 15, 25, .1), 0 1px 3px rgba(15, 15, 25, .06);--shadow-lg: 0 24px 64px -12px rgba(15, 15, 25, .22), 0 4px 12px rgba(15, 15, 25, .08);--overlay: rgba(250, 250, 252, .6);--code-bg: #f6f6f8;--hl-keyword: #8a3ffc;--hl-string: #0b7a52;--hl-number: #b4560b;--hl-comment: #9a9aa3;--hl-title: #2f5fcf;--hl-attr: #a1366b;--font: "Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--mono: "Geist Mono Variable", ui-monospace, "SF Mono", Menlo, Consolas, monospace;--r-sm: 6px;--r-md: 8px;--r-lg: 12px;--ease: cubic-bezier(.2, .7, .2, 1);color-scheme:light}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #0b0b0d;--bg-sidebar: #0e0e10;--surface: #121214;--surface-2: #17171a;--surface-3: #1e1e22;--hover: rgba(255, 255, 255, .045);--active: rgba(255, 255, 255, .075);--border: rgba(255, 255, 255, .075);--border-strong: rgba(255, 255, 255, .13);--text: #ededef;--text-2: #a5a5ad;--text-3: #75757e;--text-4: #4f4f57;--accent: #8d8df5;--accent-text: #a5a5fa;--accent-soft: rgba(141, 141, 245, .12);--accent-ring: rgba(141, 141, 245, .4);--primary-bg: #ededef;--primary-text: #111113;--primary-hover: #ffffff;--ok: #3fbf86;--ok-soft: rgba(63, 191, 134, .12);--warn: #e4a443;--warn-soft: rgba(228, 164, 67, .12);--error: #f2667a;--error-soft: rgba(242, 102, 122, .12);--info: #6a9cff;--bar-run: #5c5c66;--bar-llm: #8282f0;--bar-tool: #3fbf86;--bar-other: #d9a24a;--grid: rgba(255, 255, 255, .05);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);--shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);--shadow-lg: 0 32px 80px -16px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .06);--overlay: rgba(5, 5, 7, .6);--code-bg: #0f0f11;--hl-keyword: #c4a3ff;--hl-string: #7fd6a9;--hl-number: #f0b072;--hl-comment: #62626b;--hl-title: #8db4ff;--hl-attr: #f29bc4;color-scheme:dark}}:root[data-theme=dark]{--bg: #0b0b0d;--bg-sidebar: #0e0e10;--surface: #121214;--surface-2: #17171a;--surface-3: #1e1e22;--hover: rgba(255, 255, 255, .045);--active: rgba(255, 255, 255, .075);--border: rgba(255, 255, 255, .075);--border-strong: rgba(255, 255, 255, .13);--text: #ededef;--text-2: #a5a5ad;--text-3: #75757e;--text-4: #4f4f57;--accent: #8d8df5;--accent-text: #a5a5fa;--accent-soft: rgba(141, 141, 245, .12);--accent-ring: rgba(141, 141, 245, .4);--primary-bg: #ededef;--primary-text: #111113;--primary-hover: #ffffff;--ok: #3fbf86;--ok-soft: rgba(63, 191, 134, .12);--warn: #e4a443;--warn-soft: rgba(228, 164, 67, .12);--error: #f2667a;--error-soft: rgba(242, 102, 122, .12);--info: #6a9cff;--bar-run: #5c5c66;--bar-llm: #8282f0;--bar-tool: #3fbf86;--bar-other: #d9a24a;--grid: rgba(255, 255, 255, .05);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);--shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);--shadow-lg: 0 32px 80px -16px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .06);--overlay: rgba(5, 5, 7, .6);--code-bg: #0f0f11;--hl-keyword: #c4a3ff;--hl-string: #7fd6a9;--hl-number: #f0b072;--hl-comment: #62626b;--hl-title: #8db4ff;--hl-attr: #f29bc4;color-scheme:dark}*,*:before,*:after{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:13px;line-height:1.5;font-feature-settings:"ss01","cv11";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}::selection{background:var(--accent-soft)}a{color:inherit;text-decoration:none}button{font:inherit;color:inherit}:focus-visible{outline:2px solid var(--accent-ring);outline-offset:2px}code,pre,.mono{font-family:var(--mono);font-size:12px;font-feature-settings:normal}pre{margin:0;white-space:pre-wrap;word-break:break-word}h1,h2,h3{margin:0;font-weight:600;letter-spacing:-.012em}.num{font-variant-numeric:tabular-nums}.muted{color:var(--text-3)}.subtle{color:var(--text-2)}.link{color:var(--accent-text);cursor:pointer;background:none;border:0;padding:0}.link:hover{text-decoration:underline;text-underline-offset:3px}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border-strong);border:3px solid transparent;border-radius:999px;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}.app{display:grid;grid-template-columns:248px minmax(0,1fr);height:100%}.main{position:relative;display:flex;flex-direction:column;min-width:0;height:100%;overflow:hidden}.scroll{flex:1;min-height:0;overflow:auto}.topbar{display:flex;align-items:center;gap:12px;height:48px;padding:0 20px 0 24px;border-bottom:1px solid var(--border);flex-shrink:0;background:var(--bg)}.crumbs{display:flex;align-items:center;gap:6px;min-width:0;flex:1;color:var(--text-3)}.crumbs a:hover{color:var(--text)}.crumbs .crumb-current{color:var(--text);font-weight:500}.crumbs svg{flex-shrink:0;color:var(--text-4)}.topbar-actions{display:flex;align-items:center;gap:8px}.page{max-width:1160px;margin:0 auto;padding:28px 32px 64px}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:24px}.page-title{font-size:22px;line-height:1.25;letter-spacing:-.02em}.page-sub{margin-top:4px;color:var(--text-2)}.section-title{font-size:13px;font-weight:600;margin:32px 0 12px;display:flex;align-items:center;justify-content:space-between}.section-title .link{font-weight:500;font-size:12px}.sidebar{display:flex;flex-direction:column;background:var(--bg-sidebar);border-right:1px solid var(--border);min-height:0}.sb-top{padding:12px 10px 8px}.sb-brand{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:var(--r-md)}.sb-brand:hover{background:var(--hover)}.sb-mark{width:26px;height:26px;flex-shrink:0;color:var(--text)}.sb-name{font-weight:600;letter-spacing:-.01em;line-height:1.2}.sb-project{display:flex;align-items:center;gap:6px;color:var(--text-3);font-size:12px;line-height:1.3}.dot{width:6px;height:6px;border-radius:50%;background:var(--text-4);flex-shrink:0}.dot[data-state=ready]{background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}.dot[data-state=starting],.dot[data-state=restarting]{background:var(--warn);animation:pulse 1.4s ease-in-out infinite}.dot[data-state=failed],.dot[data-state=offline]{background:var(--error)}.sb-search{display:flex;align-items:center;gap:8px;width:100%;margin-top:10px;height:32px;padding:0 8px 0 10px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface);color:var(--text-3);cursor:pointer;box-shadow:var(--shadow-sm);transition:border-color .15s}.sb-search:hover{border-color:var(--border-strong)}.sb-search span:first-of-type{flex:1;text-align:left}.sb-nav{flex:1;min-height:0;overflow-y:auto;padding:4px 10px 12px}.sb-section{margin-top:16px}.sb-section-title{display:flex;align-items:center;justify-content:space-between;padding:0 8px 4px;font-size:11px;font-weight:500;color:var(--text-3);letter-spacing:.01em}.sb-link{display:flex;align-items:center;gap:9px;height:30px;padding:0 8px;border-radius:var(--r-sm);color:var(--text-2);cursor:pointer;transition:background .12s,color .12s}.sb-link svg{flex-shrink:0;color:var(--text-3)}.sb-link:hover{background:var(--hover);color:var(--text)}.sb-link.active{background:var(--active);color:var(--text);font-weight:500}.sb-link.active svg{color:var(--text)}.sb-link .sb-meta{margin-left:auto;font-size:11px;color:var(--text-3)}.sb-static{cursor:default}.sb-static:hover{background:none;color:var(--text-2)}.sb-empty{padding:2px 8px;color:var(--text-3);font-size:12px}.sb-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-top:1px solid var(--border)}.sb-tools{display:flex;align-items:center;gap:4px}.sb-footer .sb-theme-toggle{display:none}.sb-conn{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-3)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--r-md);border:1px solid transparent;font-weight:500;white-space:nowrap;cursor:pointer;user-select:none;transition:background .12s,border-color .12s,color .12s,opacity .12s,transform .06s}.btn:active:not(:disabled){transform:translateY(.5px)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-primary{background:var(--primary-bg);color:var(--primary-text);box-shadow:var(--shadow-sm)}.btn-primary:hover:not(:disabled){background:var(--primary-hover)}.btn-secondary{background:var(--surface);border-color:var(--border-strong);box-shadow:var(--shadow-sm)}.btn-secondary:hover:not(:disabled){background:var(--surface-2)}.btn-ghost{background:transparent;color:var(--text-2)}.btn-ghost:hover:not(:disabled){background:var(--hover);color:var(--text)}.btn-danger{background:var(--error-soft);color:var(--error)}.btn-danger:hover:not(:disabled){background:var(--error);color:#fff}.btn-sm{height:26px;padding:0 8px;font-size:12px;border-radius:var(--r-sm)}.btn-icon{width:32px;padding:0}.btn-icon.btn-sm{width:26px}.input{width:100%;min-height:34px;padding:7px 10px;border:1px solid var(--border-strong);border-radius:var(--r-md);background:var(--surface);color:var(--text);font:inherit;box-shadow:var(--shadow-sm);transition:border-color .12s,box-shadow .12s}.input::placeholder{color:var(--text-3)}.input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}textarea.input{resize:vertical;line-height:1.5}.input.mono{font-family:var(--mono);font-size:12px}.input-icon{position:relative;display:flex;align-items:center}.input-icon>svg{position:absolute;left:10px;color:var(--text-3);pointer-events:none}.input-icon>.input{padding-left:32px}.input-icon>.kbds{position:absolute;right:8px}.select{appearance:none;padding-right:28px;background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);background-position:calc(100% - 14px) 15px,calc(100% - 10px) 15px;background-size:4px 4px;background-repeat:no-repeat;cursor:pointer}.field{display:grid;gap:6px;margin-bottom:14px}.field>span{font-size:12px;font-weight:500;color:var(--text-2)}.kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border:1px solid var(--border-strong);border-bottom-width:2px;border-radius:4px;background:var(--surface);color:var(--text-3);font-family:var(--font);font-size:10.5px;font-weight:500;line-height:1}.kbds{display:inline-flex;gap:3px}.seg{display:inline-flex;padding:2px;gap:2px;border-radius:var(--r-md);background:var(--hover)}.seg button{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border:0;border-radius:var(--r-sm);background:none;color:var(--text-2);cursor:pointer;font-weight:500;font-size:12px}.seg button:hover{color:var(--text)}.seg button[aria-pressed=true]{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm),0 0 0 1px var(--border)}.seg-icons button{width:26px;padding:0;justify-content:center}.status{display:inline-flex;align-items:center;gap:6px;height:20px;padding:0 8px 0 7px;border-radius:999px;font-size:11.5px;font-weight:500;white-space:nowrap;color:var(--text-2);background:var(--hover)}.status:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.status[data-status=completed]{color:var(--ok);background:var(--ok-soft)}.status[data-status=running]{color:var(--info);background:color-mix(in srgb,var(--info) 12%,transparent)}.status[data-status=running]:before{animation:pulse 1.2s ease-in-out infinite}.status[data-status=waiting]{color:var(--warn);background:var(--warn-soft)}.status[data-status=failed]{color:var(--error);background:var(--error-soft)}.status[data-status=approved]{color:var(--ok);background:var(--ok-soft)}.status[data-status=rejected]{color:var(--error);background:var(--error-soft)}.status-icon{display:inline-flex;color:var(--text-3)}.status-icon[data-status=completed]{color:var(--ok)}.status-icon[data-status=failed]{color:var(--error)}.status-icon[data-status=running]{color:var(--info)}.status-icon[data-status=waiting]{color:var(--warn)}.chip{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 8px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface);color:var(--text-2);font-family:var(--mono);font-size:11.5px;white-space:nowrap}.chip svg{color:var(--text-3)}.chip-flag{color:var(--warn);font-family:var(--font);font-size:10.5px;font-weight:600}.panel{border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm)}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:0 16px;border-bottom:1px solid var(--border)}.panel-title{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}.panel-title svg{color:var(--text-3)}.panel-title .count{font-weight:500;color:var(--text-3)}.panel-body{padding:16px}.panel-desc{margin:0 0 14px;color:var(--text-2)}.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:48px 24px;text-align:center;color:var(--text-2)}.empty-icon{display:grid;place-items:center;width:40px;height:40px;margin-bottom:8px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);color:var(--text-3)}.empty-title{color:var(--text);font-weight:600;font-size:14px}.empty-text{max-width:380px;color:var(--text-3)}.empty .btn{margin-top:12px}.banner{display:flex;align-items:flex-start;gap:10px;padding:10px 24px;border-bottom:1px solid var(--border);background:var(--surface-2);color:var(--text-2);flex-shrink:0}.banner svg{margin-top:2px;flex-shrink:0}.banner-warn{background:var(--warn-soft);color:var(--warn)}.banner-error{flex-direction:column;background:var(--error-soft);color:var(--error)}.banner-error .banner-row{display:flex;align-items:center;gap:8px;font-weight:600}.banner-error pre{width:100%;max-height:240px;overflow:auto;padding:12px;border:1px solid color-mix(in srgb,var(--error) 25%,transparent);border-radius:var(--r-md);background:var(--surface);color:var(--text)}.notice{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface-2);color:var(--text-2)}.notice svg{margin-top:2px;flex-shrink:0;color:var(--text-3)}.error-text{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--error) 22%,transparent);border-radius:var(--r-md);background:var(--error-soft);color:var(--error);white-space:pre-wrap;word-break:break-word}.error-text svg{margin-top:2px;flex-shrink:0}.spinner{display:inline-block;width:12px;height:12px;border:1.5px solid var(--border-strong);border-top-color:var(--text-2);border-radius:50%;animation:spin .7s linear infinite;vertical-align:-1px}.skeleton{border-radius:var(--r-sm);background:linear-gradient(90deg,var(--hover),var(--active),var(--hover));background-size:200% 100%;animation:shimmer 1.4s ease-in-out infinite}[data-tip]{position:relative}[data-tip]:hover:after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);z-index:50;padding:4px 8px;border-radius:var(--r-sm);background:var(--primary-bg);color:var(--primary-text);font-family:var(--font);font-size:11.5px;font-weight:500;white-space:nowrap;pointer-events:none;box-shadow:var(--shadow-md);animation:fade-in .12s var(--ease) .25s both}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);overflow:hidden}.stat{padding:16px 18px;min-width:0}.stat+.stat{border-left:1px solid var(--border)}.stat-label{display:flex;align-items:center;gap:6px;color:var(--text-3);font-size:12px;font-weight:500}.stat-value{margin-top:6px;font-size:24px;font-weight:600;letter-spacing:-.025em;line-height:1.15;font-variant-numeric:tabular-nums}.stat-foot{margin-top:4px;color:var(--text-3);font-size:12px;font-variant-numeric:tabular-nums}.activity{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:16px;margin-top:16px}.chart{display:flex;align-items:flex-end;gap:4px;height:120px;padding-top:8px}.chart-col{position:relative;flex:1;display:flex;flex-direction:column;justify-content:flex-end;height:100%;border-radius:3px}.chart-col:hover{background:var(--hover)}.chart-bar{width:100%;min-height:2px;border-radius:3px 3px 1px 1px;background:var(--text-4);transition:height .4s var(--ease)}.chart-col:last-child .chart-bar{background:var(--text-2)}.chart-bar-failed{width:100%;background:var(--error);opacity:.8;border-radius:1px}.chart-axis{display:flex;justify-content:space-between;margin-top:8px;color:var(--text-3);font-size:11px}.breakdown{display:grid;gap:10px}.breakdown-row{display:grid;gap:5px}.breakdown-label{display:flex;justify-content:space-between;font-size:12px}.meter{height:4px;border-radius:999px;background:var(--hover);overflow:hidden}.meter>span{display:block;height:100%;border-radius:999px;background:var(--text-2)}.meter>span[data-status=failed]{background:var(--error)}.meter>span[data-status=completed]{background:var(--ok)}.entities{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}.entity{display:flex;flex-direction:column;gap:10px;padding:14px 16px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);transition:border-color .15s,box-shadow .15s,transform .15s var(--ease)}.entity:hover{border-color:var(--border-strong);box-shadow:var(--shadow-md);transform:translateY(-1px)}.entity-head{display:flex;align-items:center;gap:10px}.entity-icon{display:grid;place-items:center;width:30px;height:30px;flex-shrink:0;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface-2);color:var(--text-2)}.entity-name{font-weight:600}.entity-desc{color:var(--text-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:39px}.entity-foot{display:flex;align-items:center;gap:12px;color:var(--text-3);font-size:12px;padding-top:10px;border-top:1px solid var(--border)}.entity-foot span{display:inline-flex;align-items:center;gap:5px}.table{border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);overflow:hidden}.tr{display:grid;grid-template-columns:112px 180px minmax(0,1fr) 80px 84px 80px 84px;align-items:center;gap:12px;min-height:42px;padding:0 16px;border-top:1px solid var(--border);transition:background .1s}.tr:first-child{border-top:0}.thead{min-height:34px;background:var(--surface-2);color:var(--text-3);font-size:11.5px;font-weight:500}a.tr:hover,a.tr.focused{background:var(--hover)}a.tr.focused{box-shadow:inset 2px 0 0 var(--accent)}.td-right{text-align:right;font-variant-numeric:tabular-nums}.td-target{display:flex;align-items:center;gap:8px;font-weight:500;min-width:0}.td-target svg{flex-shrink:0;color:var(--text-3)}.toolbar{display:flex;align-items:center;gap:8px;margin-bottom:12px}.toolbar .input-icon{flex:1}.toolbar .select{width:auto;min-width:180px}.agent-layout{display:grid;grid-template-columns:260px minmax(0,1fr);flex:1;min-height:0}.threads{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--border)}.threads-head{display:grid;gap:8px;padding:12px}.threads-list{flex:1;min-height:0;overflow-y:auto;padding:0 8px 12px}.thread-group{padding:12px 8px 4px;font-size:11px;font-weight:500;color:var(--text-3)}.thread{display:grid;gap:1px;padding:7px 10px;border-radius:var(--r-md);cursor:pointer}.thread:hover{background:var(--hover)}.thread.active{background:var(--active)}.thread-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thread-meta{font-size:11.5px;color:var(--text-3)}.chat{display:flex;flex-direction:column;min-width:0;min-height:0}.chat-scroll{flex:1;min-height:0;overflow-y:auto}.chat-inner{max-width:780px;margin:0 auto;padding:28px 32px 24px}.chat-notice{margin-bottom:24px}.agent-intro{padding:40px 0 8px}.agent-intro-mark{display:grid;place-items:center;width:44px;height:44px;margin-bottom:16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-md);color:var(--text-2)}.agent-intro h2{font-size:20px;letter-spacing:-.02em}.agent-intro p{margin:6px 0 0;color:var(--text-2);max-width:560px}.agent-intro-tools{display:flex;flex-wrap:wrap;gap:6px;margin-top:18px}.instructions{margin-top:20px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface-2);color:var(--text-2);max-height:180px;overflow:auto;white-space:pre-wrap;font-size:12.5px}.instructions-label{margin-top:20px;font-size:11px;font-weight:500;color:var(--text-3)}.instructions-label+.instructions{margin-top:6px}.turn{display:grid;gap:14px;padding-bottom:28px;animation:rise .25s var(--ease) both}.msg-user{justify-self:end;max-width:82%;padding:9px 14px;border-radius:14px 14px 4px;background:var(--surface-3);white-space:pre-wrap;word-break:break-word}.msg-assistant{display:grid;gap:10px;min-width:0}.msg-thinking{display:flex;align-items:center;gap:8px;color:var(--text-3)}.turn-meta{display:flex;align-items:center;gap:4px;min-height:24px;color:var(--text-3);font-size:12px}.turn-meta .sep{color:var(--text-4)}.turn-meta .turn-actions{display:flex;gap:2px;margin-left:4px;opacity:0;transition:opacity .15s}.turn:hover .turn-actions,.turn:focus-within .turn-actions{opacity:1}.cursor{display:inline-block;width:7px;height:15px;margin-left:2px;border-radius:1px;vertical-align:-2px;background:var(--text);animation:blink 1s steps(2) infinite}.composer-wrap{padding:0 32px 20px;background:linear-gradient(to bottom,transparent,var(--bg) 24px)}.composer{max-width:780px;margin:0 auto;border:1px solid var(--border-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-md);transition:border-color .15s,box-shadow .15s}.composer:focus-within{border-color:color-mix(in srgb,var(--accent) 55%,var(--border-strong));box-shadow:var(--shadow-md),0 0 0 3px var(--accent-soft)}.composer textarea{display:block;width:100%;min-height:48px;max-height:240px;padding:14px 16px 4px;border:0;outline:none;resize:none;background:none;color:var(--text);font:inherit;font-size:13.5px;line-height:1.5}.composer textarea::placeholder{color:var(--text-3)}.composer-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px 8px 16px;color:var(--text-3);font-size:11.5px}.composer-hint{display:flex;align-items:center;gap:10px}.composer-hint span{display:inline-flex;align-items:center;gap:4px}.tool{border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface);overflow:hidden}.tool[data-state=waiting]{border-color:color-mix(in srgb,var(--warn) 45%,transparent);box-shadow:0 0 0 3px var(--warn-soft)}.tool[data-state=error]{border-color:color-mix(in srgb,var(--error) 35%,transparent)}.tool-head{display:flex;align-items:center;gap:8px;width:100%;min-height:36px;padding:0 12px;border:0;background:none;text-align:left;cursor:pointer}.tool-head:hover{background:var(--hover)}.tool-head>svg{flex-shrink:0;color:var(--text-3)}.tool-name{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--text);flex-shrink:0}.tool-args{flex:1;min-width:0;font-family:var(--mono);font-size:12px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool-result{max-width:40%;font-family:var(--mono);font-size:12px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool-result-error{color:var(--error)}.tool-chevron{transition:transform .15s var(--ease)}.tool[data-open=true] .tool-chevron{transform:rotate(90deg)}.tool-body{display:grid;gap:10px;padding:12px;border-top:1px solid var(--border)}.approval{display:grid;gap:10px;padding:12px;border-top:1px solid color-mix(in srgb,var(--warn) 30%,transparent);background:var(--warn-soft)}.approval-text{display:flex;align-items:center;gap:8px;color:var(--warn);font-weight:500}.approval-row{display:flex;gap:8px}.approval-row .input{flex:1;min-height:32px}.reasoning{border-left:2px solid var(--border-strong);padding:2px 0 2px 12px}.reasoning-toggle{display:inline-flex;align-items:center;gap:6px;border:0;background:none;padding:0;color:var(--text-3);cursor:pointer;font-size:12px;font-weight:500}.reasoning-toggle:hover{color:var(--text)}.reasoning-text{margin-top:6px;color:var(--text-3)}.reasoning-text .md{font-size:12.5px;line-height:1.6}.reasoning-text .md strong{color:var(--text-2)}.json{border:1px solid var(--border);border-radius:var(--r-md);background:var(--code-bg);overflow:hidden}.json-head{display:flex;align-items:center;justify-content:space-between;height:28px;padding:0 4px 0 10px;border-bottom:1px solid var(--border);color:var(--text-3);font-size:11px;font-weight:500}.json pre{max-height:320px;overflow:auto;padding:10px 12px;color:var(--text);line-height:1.55}.json .j-key{color:var(--hl-title)}.json .j-string{color:var(--hl-string)}.json .j-number{color:var(--hl-number)}.json .j-literal{color:var(--hl-keyword)}.state .json-head{height:32px}.state .seg{padding:1px}.state .seg button{height:22px;width:24px}.state-fields{display:grid;max-height:520px;overflow:auto}.state-field{display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px;padding:10px 12px;border-top:1px solid var(--border);background:var(--surface)}.state-field:first-child{border-top:0}.state-key{padding-top:1px;font-family:var(--mono);font-size:12px;color:var(--hl-title)}.state .state-value{padding:0;max-height:none;color:var(--text)}.state .state-text{font-family:var(--font);font-size:13px}.state-prose .md{font-size:13px}.md{min-width:0;font-size:13.5px;line-height:1.65;word-wrap:break-word}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p,.md ul,.md ol,.md blockquote,.md table,.md .codeblock{margin:0 0 12px}.md h1,.md h2,.md h3,.md h4{margin:20px 0 8px;line-height:1.3}.md h1{font-size:18px}.md h2{font-size:16px}.md h3,.md h4{font-size:14px}.md ul,.md ol{padding-left:22px}.md li+li{margin-top:3px}.md li::marker{color:var(--text-3)}.md a{color:var(--accent-text);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent) 40%,transparent);text-underline-offset:3px}.md blockquote{padding-left:12px;border-left:2px solid var(--border-strong);color:var(--text-2)}.md hr{border:0;border-top:1px solid var(--border);margin:16px 0}.md :not(pre)>code{padding:1px 5px;border:1px solid var(--border);border-radius:4px;background:var(--surface-2);font-size:.88em}.md table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:12.5px}.md th,.md td{padding:6px 10px;border:1px solid var(--border);text-align:left}.md th{background:var(--surface-2);font-weight:600}.md input[type=checkbox]{margin:0 6px 0 0;vertical-align:-1px}.md .katex{font-size:1.08em}.md .katex-display{margin:0 0 12px;padding:4px 0;overflow-x:auto;overflow-y:hidden}.md .katex-error{font-family:var(--mono);font-size:12px}.codeblock{border:1px solid var(--border);border-radius:var(--r-md);background:var(--code-bg);overflow:hidden}.codeblock-head{display:flex;align-items:center;justify-content:space-between;height:30px;padding:0 4px 0 12px;border-bottom:1px solid var(--border);color:var(--text-3);font-family:var(--mono);font-size:11px}.codeblock pre{padding:12px 14px;overflow-x:auto;white-space:pre;word-break:normal;line-height:1.6;font-size:12.5px}.hljs-keyword,.hljs-built_in,.hljs-selector-tag,.hljs-literal,.hljs-type{color:var(--hl-keyword)}.hljs-string,.hljs-regexp,.hljs-addition,.hljs-symbol{color:var(--hl-string)}.hljs-number,.hljs-bullet{color:var(--hl-number)}.hljs-comment,.hljs-quote,.hljs-meta{color:var(--hl-comment);font-style:italic}.hljs-title,.hljs-section,.hljs-name,.hljs-function .hljs-title{color:var(--hl-title)}.hljs-attr,.hljs-attribute,.hljs-property,.hljs-variable,.hljs-template-variable,.hljs-params{color:var(--hl-attr)}.hljs-deletion{color:var(--error)}.run-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:24px;align-items:start}.run-main{display:grid;gap:16px;min-width:0}.props{position:sticky;top:0;display:grid;gap:2px;padding:6px 0}.prop{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:8px;min-height:30px}.prop-label{color:var(--text-3)}.prop-value{display:flex;align-items:center;gap:6px;min-width:0;font-variant-numeric:tabular-nums}.prop-value a{color:var(--accent-text)}.prop-value a:hover{text-decoration:underline;text-underline-offset:3px}.props-sep{height:1px;margin:8px 0;background:var(--border)}.props-title{margin:4px 0 6px;font-size:11px;font-weight:500;color:var(--text-3)}.token-bar{display:flex;height:6px;margin:4px 0 8px;border-radius:999px;overflow:hidden;background:var(--hover)}.token-bar span:first-child{background:var(--bar-llm)}.token-bar span:last-child{background:color-mix(in srgb,var(--bar-llm) 45%,transparent)}.io{display:grid;gap:16px}.io-label{margin-bottom:6px;font-size:11px;font-weight:500;color:var(--text-3)}.io-input{padding:10px 12px;border-radius:var(--r-md);background:var(--surface-2);white-space:pre-wrap;word-break:break-word}.rerun-note{margin-bottom:16px}.wf{font-size:12.5px}.wf-row{display:grid;grid-template-columns:minmax(180px,32%) minmax(0,1fr) 64px 56px 72px;align-items:center;gap:12px;width:100%;min-height:30px;padding:0 16px;border:0;background:none;text-align:left;cursor:pointer;transition:background .1s}.wf-row:hover{background:var(--hover)}.wf-row.selected{background:var(--accent-soft)}.wf-head{min-height:30px;cursor:default;border-bottom:1px solid var(--border);color:var(--text-3);font-size:11px}.wf-head:hover{background:none}.wf-label{display:flex;align-items:center;gap:7px;min-width:0}.wf-label>svg{flex-shrink:0}.wf-label[data-kind=llm]>svg{color:var(--bar-llm)}.wf-label[data-kind=tool]>svg{color:var(--bar-tool)}.wf-label[data-kind=run]{font-weight:600}.wf-label[data-kind=run]>svg{color:var(--text-2)}.wf-label .wf-error{color:var(--error)}.wf-guide{display:inline-block;width:14px;align-self:stretch;flex-shrink:0;border-left:1px solid var(--border-strong);margin-left:6px}.wf-track{position:relative;height:100%;min-height:30px;background-image:linear-gradient(to right,var(--grid) 1px,transparent 1px);background-size:25% 100%}.wf-bar{position:absolute;top:50%;height:12px;transform:translateY(-50%);min-width:3px;border-radius:3px;background:var(--bar-other);transition:filter .1s}.wf-row:hover .wf-bar{filter:brightness(1.12)}.wf-bar[data-kind=run]{height:6px;background:var(--bar-run)}.wf-bar[data-kind=llm]{background:var(--bar-llm)}.wf-bar[data-kind=tool]{background:var(--bar-tool)}.wf-bar[data-status=error]{background:var(--error)}.wf-bar[data-status=running]{background-image:linear-gradient(90deg,transparent 0,rgba(255,255,255,.35) 50%,transparent 100%);background-size:200% 100%;animation:shimmer 1.2s linear infinite}.wf-num{text-align:right;color:var(--text-3);font-variant-numeric:tabular-nums}.wf-axis{display:flex;justify-content:space-between}.wf-legend{display:flex;align-items:center;gap:14px;font-size:11.5px;color:var(--text-3)}.wf-legend span{display:inline-flex;align-items:center;gap:6px}.wf-legend i{width:8px;height:8px;border-radius:2px}.inspector-backdrop{position:fixed;inset:0;z-index:40}.inspector{position:fixed;top:8px;right:8px;bottom:8px;z-index:41;display:flex;flex-direction:column;width:min(440px,calc(100vw - 32px));border:1px solid var(--border-strong);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-lg);animation:slide-in .22s var(--ease) both}.inspector-head{display:flex;align-items:flex-start;gap:10px;padding:14px 12px 14px 16px;border-bottom:1px solid var(--border)}.inspector-head h3{font-size:14px;word-break:break-word}.inspector-kind{margin-top:2px;color:var(--text-3);font-size:12px}.inspector-body{flex:1;min-height:0;overflow-y:auto;padding:16px;display:grid;gap:16px;align-content:start}.kv{display:grid;grid-template-columns:130px minmax(0,1fr);gap:8px 12px}.kv>dt{color:var(--text-3)}.kv>dd{margin:0;min-width:0;word-break:break-word;font-variant-numeric:tabular-nums}.steps{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px}.step{display:inline-flex;align-items:center;gap:8px;height:30px;padding:0 10px 0 4px;border:1px solid var(--border-strong);border-radius:999px;background:var(--surface);color:var(--text-2);cursor:pointer;transition:border-color .12s,background .12s,color .12s}.step:hover{border-color:var(--text-3);color:var(--text)}.step.active{border-color:var(--text);background:var(--primary-bg);color:var(--primary-text)}.step-index{display:grid;place-items:center;min-width:22px;height:22px;border-radius:999px;background:var(--hover);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.step.active .step-index{background:color-mix(in srgb,var(--primary-text) 18%,transparent)}.fork-row{display:flex;align-items:center;gap:10px;min-height:40px;padding:0 16px;border-top:1px solid var(--border)}.fork-row:first-child{border-top:0}.fork-row:hover{background:var(--hover)}.canvas{position:relative;overflow:auto;padding:28px;background-color:var(--surface-2);background-image:radial-gradient(var(--border-strong) 1px,transparent 1px);background-size:16px 16px;border-radius:0 0 var(--r-lg) var(--r-lg)}.workflow-graph{display:block;margin:0 auto;overflow:visible}.workflow-graph .edge{fill:none;stroke:var(--text-4);stroke-width:1.5}.workflow-graph .edge-conditional{stroke-dasharray:5 4}.workflow-graph .edge.edge-live{stroke:var(--info);stroke-dasharray:6 6;animation:dash .8s linear infinite}.workflow-graph .edge.edge-done{stroke:var(--text-3)}.workflow-graph .edge-head{fill:var(--text-4)}.workflow-graph .node{cursor:pointer}.workflow-graph .node-card{fill:var(--surface);stroke:var(--border-strong);stroke-width:1;filter:drop-shadow(0 1px 2px rgba(0,0,0,.08));transition:stroke .15s}.workflow-graph .node:hover .node-card{stroke:var(--text-3)}.workflow-graph .node-selected .node-card{stroke:var(--text);stroke-width:1.5}.workflow-graph .node-name{fill:var(--text);font-size:12.5px;font-weight:600;font-family:var(--font)}.workflow-graph .node-sub{fill:var(--text-3);font-size:11px;font-family:var(--font);font-variant-numeric:tabular-nums}.workflow-graph .node-dot{fill:var(--text-4)}.workflow-graph .node-completed .node-dot{fill:var(--ok)}.workflow-graph .node-failed .node-dot{fill:var(--error)}.workflow-graph .node-failed .node-card{stroke:color-mix(in srgb,var(--error) 60%,transparent)}.workflow-graph .node-running .node-dot{fill:var(--info);animation:pulse 1s ease-in-out infinite}.workflow-graph .node-running .node-card{stroke:var(--info)}.workflow-graph .node-skipped .node-name{fill:var(--text-3)}.workflow-graph .node-pending .node-card{stroke-dasharray:4 3}.node-detail{display:grid;gap:12px;padding:16px;border-top:1px solid var(--border)}.node-detail-head{display:flex;align-items:center;gap:10px}.node-detail-head strong{font-family:var(--mono);font-size:12.5px}.workflow-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}.side-stack{display:grid;gap:16px}.list-row{display:flex;align-items:center;gap:10px;min-height:40px;padding:0 16px;border-top:1px solid var(--border)}.list-row:first-child{border-top:0}a.list-row:hover{background:var(--hover)}.list-row .grow{flex:1;min-width:0}.compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.compare-section{padding:14px 16px;border-top:1px solid var(--border)}.compare-section:first-of-type{border-top:0}.compare-section h3{margin-bottom:8px;font-size:11px;font-weight:500;color:var(--text-3)}.compare-call{display:grid;gap:6px;padding:8px 10px;margin-bottom:8px;border:1px solid var(--border);border-radius:var(--r-md)}.compare-call.diverged{border-color:color-mix(in srgb,var(--warn) 50%,transparent);background:var(--warn-soft)}.compare-call .tool-name{display:flex;align-items:center;gap:6px}.compare .wf-row{grid-template-columns:minmax(120px,36%) minmax(0,1fr) 60px;padding:0 12px}.compare .wf-row>.wf-num:nth-child(n+4){display:none}.diff-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px}.overlay{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-start;justify-content:center;padding:12vh 16px 16px;background:var(--overlay);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:fade-in .12s ease both}.palette{width:min(620px,100%);border:1px solid var(--border-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-lg);overflow:hidden;animation:pop .16s var(--ease) both}.palette-input{display:flex;align-items:center;gap:10px;padding:0 16px;border-bottom:1px solid var(--border)}.palette-input svg{color:var(--text-3);flex-shrink:0}.palette-input input{flex:1;height:52px;border:0;outline:none;background:none;color:var(--text);font:inherit;font-size:15px}.palette-input input::placeholder{color:var(--text-3)}.palette-list{max-height:min(420px,55vh);overflow-y:auto;padding:6px}.palette-group{padding:10px 10px 4px;font-size:11px;font-weight:500;color:var(--text-3)}.palette-item{display:flex;align-items:center;gap:10px;min-height:38px;padding:0 10px;border-radius:var(--r-md);cursor:pointer;color:var(--text-2)}.palette-item svg{flex-shrink:0;color:var(--text-3)}.palette-item[aria-selected=true]{background:var(--active);color:var(--text)}.palette-item[aria-selected=true] svg{color:var(--text)}.palette-item .palette-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-item .palette-hint{color:var(--text-3);font-size:12px}.palette-empty{padding:32px;text-align:center;color:var(--text-3)}.palette-foot{display:flex;align-items:center;gap:14px;padding:8px 14px;border-top:1px solid var(--border);background:var(--surface-2);color:var(--text-3);font-size:11.5px}.palette-foot span{display:inline-flex;align-items:center;gap:5px}.dialog{width:min(520px,100%);border:1px solid var(--border-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-lg);animation:pop .16s var(--ease) both}.dialog-head{display:flex;align-items:center;justify-content:space-between;padding:14px 12px 14px 18px;border-bottom:1px solid var(--border)}.dialog-head h2{font-size:14px}.dialog-body{padding:8px 18px 18px}.shortcut-group{margin-top:12px;font-size:11px;font-weight:500;color:var(--text-3)}.shortcut{display:flex;align-items:center;justify-content:space-between;min-height:34px;border-bottom:1px solid var(--border);color:var(--text-2)}.shortcut:last-child{border-bottom:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.35}}@keyframes blink{to{visibility:hidden}}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes fade-in{0%{opacity:0}}@keyframes pop{0%{opacity:0;transform:translateY(-6px) scale(.985)}}@keyframes rise{0%{opacity:0;transform:translateY(4px)}}@keyframes slide-in{0%{opacity:0;transform:translate(16px)}}@keyframes dash{to{stroke-dashoffset:-12}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}@media(max-width:1100px){.run-layout,.workflow-layout,.activity{grid-template-columns:minmax(0,1fr)}.props{position:static;order:-1;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));padding:12px 16px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface)}.props-sep,.props-title{display:none}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat:nth-child(3){border-left:0}.stat:nth-child(n+3){border-top:1px solid var(--border)}.tr{grid-template-columns:104px 140px minmax(0,1fr) 72px 80px}.tr>:nth-child(4),.tr>:nth-child(5){display:none}}@media(max-width:860px){.app{grid-template-columns:64px minmax(0,1fr)}.sidebar .sb-text,.sidebar .sb-section-title,.sidebar .sb-meta,.sidebar .sb-search span,.sidebar .sb-search .kbds,.sidebar .sb-conn span{display:none}.sb-link,.sb-brand,.sb-search{justify-content:center;padding:0}.sb-footer{flex-direction:column;padding:10px 0}.sb-tools{flex-direction:column}.sb-themes{display:none}.sb-footer .sb-theme-toggle{display:inline-flex}.toolbar{flex-wrap:wrap}.toolbar .input-icon{flex-basis:100%}.agent-layout{grid-template-columns:minmax(0,1fr)}.threads{display:none}.compare{grid-template-columns:minmax(0,1fr)}.page{padding:20px 16px 48px}.tr{grid-template-columns:96px minmax(0,1fr) 72px}.tr>:nth-child(3),.tr>:nth-child(6){display:none}}