@swestash/agent-lens 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{s as u,j as l,L as d,f,b as m,c as h,r as y}from"./index-BEJAVOfs.js";function x({a:e}){const t=e.agent_description||e.title||e.id.slice(0,12),n=(e.models??"").split(",").filter(Boolean).map(u).join(", ");return l.jsxs("li",{children:[l.jsx(d,{to:`/session/${e.id}`,children:t}),e.agent_type&&l.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&l.jsxs("span",{className:"tag meta-depth",title:`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),l.jsxs("span",{className:"muted",children:[" ","· ",n||"—"," · ",f(e.tokens)," tok · ",m(e.cost),e.duration_ms!=null?` · ${h(e.duration_ms)}`:""]})]})}function j({text:e,label:t,title:n="Copy to clipboard",className:a=""}){const[o,i]=y.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(e)}catch{const s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();try{document.execCommand("copy")}catch{}s.remove()}i(!0),window.setTimeout(()=>i(!1),1200)};return l.jsxs("button",{type:"button",className:"ghost small copy-btn "+a,onClick:c,"aria-label":n,title:n,children:[o?"✓ Copied":"⧉",t?" "+t:""]})}function k(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#3?9;|&#x27;/g,"'").replace(/&amp;/g,"&")}function b(e){const t=e.match(/\s*\(\s*truncated[^)]*\)\s*$/i);return!t||t.index==null?{body:e,note:null}:{body:e.slice(0,t.index).trimEnd(),note:t[0].trim()}}function w(e){try{return{value:JSON.parse(e),repaired:!1}}catch{}const t=[];let n=!1,a=!1,o=-1,i=[];for(let s=0;s<e.length;s++){const r=e[s];if(n){a?a=!1:r==="\\"?a=!0:r==='"'&&(n=!1);continue}r==='"'?n=!0:r==="{"||r==="["?t.push(r==="{"?"}":"]"):r==="}"||r==="]"?(t.pop(),o=s+1,i=[...t]):r===","&&(o=s,i=[...t])}if(o<0)return{value:void 0,repaired:!1};const c=e.slice(0,o)+i.reverse().join("");try{return{value:JSON.parse(c),repaired:!0}}catch{return{value:void 0,repaired:!1}}}function p(e){if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return p(JSON.parse(t))}catch{return e}return e}if(Array.isArray(e))return e.map(p);if(e&&typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))t[n]=p(a);return t}return e}function C(e,t=2e4){try{return JSON.stringify(JSON.parse(e),null,2).slice(0,t)}catch{return e.slice(0,t)}}export{x as A,j as C,p as a,k as d,w as l,C as p,b as s};
1
+ import{s as u,j as l,L as d,f,b as m,c as h,r as y}from"./index-_eftXBrf.js";function x({a:e}){const t=e.agent_description||e.title||e.id.slice(0,12),n=(e.models??"").split(",").filter(Boolean).map(u).join(", ");return l.jsxs("li",{children:[l.jsx(d,{to:`/session/${e.id}`,children:t}),e.agent_type&&l.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&l.jsxs("span",{className:"tag meta-depth",title:`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),l.jsxs("span",{className:"muted",children:[" ","· ",n||"—"," · ",f(e.tokens)," tok · ",m(e.cost),e.duration_ms!=null?` · ${h(e.duration_ms)}`:""]})]})}function j({text:e,label:t,title:n="Copy to clipboard",className:a=""}){const[o,i]=y.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(e)}catch{const s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();try{document.execCommand("copy")}catch{}s.remove()}i(!0),window.setTimeout(()=>i(!1),1200)};return l.jsxs("button",{type:"button",className:"ghost small copy-btn "+a,onClick:c,"aria-label":n,title:n,children:[o?"✓ Copied":"⧉",t?" "+t:""]})}function k(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#3?9;|&#x27;/g,"'").replace(/&amp;/g,"&")}function b(e){const t=e.match(/\s*\(\s*truncated[^)]*\)\s*$/i);return!t||t.index==null?{body:e,note:null}:{body:e.slice(0,t.index).trimEnd(),note:t[0].trim()}}function w(e){try{return{value:JSON.parse(e),repaired:!1}}catch{}const t=[];let n=!1,a=!1,o=-1,i=[];for(let s=0;s<e.length;s++){const r=e[s];if(n){a?a=!1:r==="\\"?a=!0:r==='"'&&(n=!1);continue}r==='"'?n=!0:r==="{"||r==="["?t.push(r==="{"?"}":"]"):r==="}"||r==="]"?(t.pop(),o=s+1,i=[...t]):r===","&&(o=s,i=[...t])}if(o<0)return{value:void 0,repaired:!1};const c=e.slice(0,o)+i.reverse().join("");try{return{value:JSON.parse(c),repaired:!0}}catch{return{value:void 0,repaired:!1}}}function p(e){if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return p(JSON.parse(t))}catch{return e}return e}if(Array.isArray(e))return e.map(p);if(e&&typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))t[n]=p(a);return t}return e}function C(e,t=2e4){try{return JSON.stringify(JSON.parse(e),null,2).slice(0,t)}catch{return e.slice(0,t)}}export{x as A,j as C,p as a,k as d,w as l,C as p,b as s};
@@ -1 +1 @@
1
- import{j as o,r as a}from"./index-BEJAVOfs.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-_eftXBrf.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,7 +16,7 @@
16
16
  document.documentElement.dataset.theme = "dark";
17
17
  }
18
18
  </script>
19
- <script type="module" crossorigin src="/assets/index-BEJAVOfs.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-_eftXBrf.js"></script>
20
20
  <link rel="stylesheet" crossorigin href="/assets/index-BJ7zMXRA.css">
21
21
  </head>
22
22
  <body>