@swestash/agent-lens 0.14.1 → 0.16.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.
@@ -0,0 +1 @@
1
+ import{r as b,B as x,j as s,C as f}from"./index-CMT9aRT7.js";const p='a[href], button:not([disabled]), input, select, textarea, summary, [tabindex]:not([tabindex="-1"])';function v({title:n,labelId:l,onClose:e,children:t}){const d=b.useRef(null),m=b.useRef(null);b.useEffect(()=>{var c;const a=document.activeElement;(c=m.current)==null||c.focus();const r=document.getElementById("root");r==null||r.setAttribute("inert","");const{overflow:o}=document.body.style;return document.body.style.overflow="hidden",()=>{var u;r==null||r.removeAttribute("inert"),document.body.style.overflow=o,(u=a==null?void 0:a.focus)==null||u.call(a)}},[]);const i=a=>{var c;if(a.key==="Escape"){a.stopPropagation(),e();return}if(a.key!=="Tab")return;const r=[...((c=d.current)==null?void 0:c.querySelectorAll(p))??[]];if(!r.length)return;const o=a.shiftKey?r[0]:r[r.length-1];document.activeElement===o&&(a.preventDefault(),(a.shiftKey?r[r.length-1]:r[0]).focus())};return x.createPortal(s.jsx("div",{className:"chart-modal-backdrop",onMouseDown:a=>a.target===a.currentTarget&&e(),children:s.jsxs("div",{className:"chart-modal",role:"dialog","aria-modal":"true","aria-labelledby":l,ref:d,onKeyDown:i,children:[t,s.jsx("button",{type:"button",className:"chart-modal-close",ref:m,onClick:e,"aria-label":`Close "${n}"`,children:"✕"})]})}),document.body)}function g(){const{theme:n}=f();return b.useMemo(()=>{const l=getComputedStyle(document.documentElement),e=h=>l.getPropertyValue(h).trim(),t={bg:e("--bg"),panel:e("--panel"),panel2:e("--panel2"),border:e("--border"),text:e("--text"),muted:e("--muted"),accent:e("--accent"),green:e("--user"),gold:e("--gold"),red:e("--err"),violet:e("--violet"),teal:e("--teal")},d={user:e("--tl-user"),assistant:e("--tl-assistant"),thinking:e("--tl-thinking"),tool:e("--tl-tool"),toolError:t.red},m=[e("--burn-1"),e("--burn-2"),e("--burn-3"),e("--burn-4"),e("--burn-5"),e("--burn-6"),e("--burn-7")],i={critical:e("--sev-c-critical"),high:e("--sev-c-high"),medium:e("--sev-c-medium"),low:e("--sev-c-low"),info:t.muted},a={input:t.green,output:t.accent,cache_creation:t.gold,cache_read:t.muted},r=[t.accent,t.green,t.gold,t.violet,t.teal,t.red,t.muted,"#d98c5f","#5f9ed9"],o={stroke:t.muted,tick:{fill:t.muted,fontSize:11},tickLine:!1},c={stroke:t.border,strokeDasharray:"3 3",vertical:!1},u={contentStyle:{background:t.panel2,border:`1px solid ${t.border}`,borderRadius:6,fontSize:12},labelStyle:{color:t.text},itemStyle:{color:t.text}};return{C:t,TOKEN_COLORS:a,TIMELINE_COLORS:d,SEVERITY_COLORS:i,BURN_RAMP:m,PALETTE:r,axisProps:o,gridProps:c,tooltipStyle:u}},[n])}function j({title:n,hint:l,guide:e,actions:t,bodyHeight:d,hidden:m,children:i}){const[a,r]=b.useState(!1),o=b.useId();if(m)return null;const c=h=>typeof i=="function"?i(h):i,u=h=>s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{id:h?o:void 0,children:n}),e&&s.jsxs("details",{className:"card-guide",children:[s.jsx("summary",{"aria-label":`How to read "${n}"`,title:"How to read this chart",children:"ⓘ"}),s.jsx("div",{className:"card-guide-body",children:e})]}),l&&s.jsx("span",{className:"card-hint",children:l}),s.jsxs("span",{className:"card-actions",children:[t,!h&&s.jsx("button",{type:"button",className:"card-expand",onClick:()=>r(!0),"aria-label":`Expand "${n}"`,title:"Expand this chart",children:"⤢"})]})]});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"card",children:[u(!1),s.jsx("div",{className:"chart-body",style:d!=null?{height:d}:void 0,children:a?s.jsx("div",{className:"chart-moved",children:"Open in the expanded view."}):c(!1)})]}),a&&s.jsx(v,{title:n,labelId:o,onClose:()=>r(!1),children:s.jsxs("div",{className:"card",children:[u(!0),s.jsx("div",{className:"chart-body chart-body-lg",children:c(!0)})]})})]})}function E({label:n,value:l,sub:e,title:t}){return s.jsxs("div",{className:"kpi",title:t,children:[s.jsx("div",{className:"kpi-label",children:n}),s.jsx("div",{className:"kpi-value",children:l}),e!=null&&s.jsx("div",{className:"kpi-sub",children:e})]})}export{j as C,E as K,g as u};
@@ -1 +1 @@
1
- import{j as o,r as a}from"./index-CNg3TICd.js";const i=["critical","high","medium","low","info"];function l({severity:e,count:s}){return o.jsxs("span",{className:"tag sev sev-"+e,children:[e,s!=null?` ${s}`:""]})}function m(e,s){const[r,t]=a.useState(s),[n,u]=a.useState(e);return n!==e&&(u(e),t(s)),[r,t]}export{i as S,l as a,m as u};
1
+ import{j as o,r as a}from"./index-CMT9aRT7.js";const i=["critical","high","medium","low","info"];function l({severity:e,count:s}){return o.jsxs("span",{className:"tag sev sev-"+e,children:[e,s!=null?` ${s}`:""]})}function m(e,s){const[r,t]=a.useState(s),[n,u]=a.useState(e);return n!==e&&(u(e),t(s)),[r,t]}export{i as S,l as a,m as u};
package/web/index.html CHANGED
@@ -16,8 +16,8 @@
16
16
  document.documentElement.dataset.theme = "dark";
17
17
  }
18
18
  </script>
19
- <script type="module" crossorigin src="/assets/index-CNg3TICd.js"></script>
20
- <link rel="stylesheet" crossorigin href="/assets/index-BNr_gy9h.css">
19
+ <script type="module" crossorigin src="/assets/index-CMT9aRT7.js"></script>
20
+ <link rel="stylesheet" crossorigin href="/assets/index-B6dWnwqZ.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>