@swestash/agent-lens 0.3.0 → 0.4.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.
- package/dist/agent-lens.js +20 -2
- package/dist/agent-lens.js.map +1 -1
- package/package.json +1 -1
- package/web/assets/{CopyButton-DPveQcsm.js → CopyButton-CDLZMZtV.js} +1 -1
- package/web/assets/{Dashboard-D50k35sH.js → Dashboard-BGVInKFn.js} +1 -1
- package/web/assets/SessionView-C9Nz-Buq.js +12 -0
- package/web/assets/{SkillView-ByiQB_SI.js → SkillView-z46KtQoA.js} +1 -1
- package/web/assets/{SkillsView-lOJiFu6e.js → SkillsView-BZ4hNSbk.js} +1 -1
- package/web/assets/{WorkflowView-qgx0vvWs.js → WorkflowView-eiRtGE5c.js} +1 -1
- package/web/assets/{index-eVzr9g61.js → index-5gOslh3o.js} +1 -1
- package/web/assets/index-CXU0GJds.css +1 -0
- package/web/assets/{index-CWdoCK2Q.js → index-Twf3zCly.js} +2 -2
- package/web/index.html +2 -2
- package/web/assets/SessionView-DPm1eauh.js +0 -6
- package/web/assets/index-CU4_1QLm.css +0 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as p}from"./index-
|
|
1
|
+
import{r as u,j as p}from"./index-Twf3zCly.js";function d(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/?9;|'/g,"'").replace(/&/g,"&")}function y(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 m(e){try{return{value:JSON.parse(e),repaired:!1}}catch{}const t=[];let s=!1,a=!1,o=-1,i=[];for(let r=0;r<e.length;r++){const n=e[r];if(s){a?a=!1:n==="\\"?a=!0:n==='"'&&(s=!1);continue}n==='"'?s=!0:n==="{"||n==="["?t.push(n==="{"?"}":"]"):n==="}"||n==="]"?(t.pop(),o=r+1,i=[...t]):n===","&&(o=r,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 l(e){if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return l(JSON.parse(t))}catch{return e}return e}if(Array.isArray(e))return e.map(l);if(e&&typeof e=="object"){const t={};for(const[s,a]of Object.entries(e))t[s]=l(a);return t}return e}function h(e,t=2e4){try{return JSON.stringify(JSON.parse(e),null,2).slice(0,t)}catch{return e.slice(0,t)}}function g({text:e,label:t,title:s="Copy to clipboard",className:a=""}){const[o,i]=u.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(e)}catch{const r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();try{document.execCommand("copy")}catch{}r.remove()}i(!0),window.setTimeout(()=>i(!1),1200)};return p.jsxs("button",{type:"button",className:"ghost small copy-btn "+a,onClick:c,"aria-label":s,title:s,children:[o?"✓ Copied":"⧉",t?" "+t:""]})}export{g as C,l as a,d,m as l,h as p,y as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as yi,g as ce,r as R,R as P,u as kw,j as C,a as Dw,b as Rw,d as mi,s as qh,f as gi,e as Lh,h as Zt}from"./index-CWdoCK2Q.js";function Sb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Sb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ee(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Sb(e))&&(n&&(n+=" "),n+=t);return n}var lo,Bh;function Fe(){if(Bh)return lo;Bh=1;var e=Array.isArray;return lo=e,lo}var fo,Fh;function Ab(){if(Fh)return fo;Fh=1;var e=typeof yi=="object"&&yi&&yi.Object===Object&&yi;return fo=e,fo}var ho,zh;function vt(){if(zh)return ho;zh=1;var e=Ab(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return ho=r,ho}var po,Wh;function ui(){if(Wh)return po;Wh=1;var e=vt(),t=e.Symbol;return po=t,po}var vo,Uh;function Nw(){if(Uh)return vo;Uh=1;var e=ui(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var u=r.call(o,i),s=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(u?o[i]=s:delete o[i]),f}return vo=a,vo}var yo,Kh;function qw(){if(Kh)return yo;Kh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return yo=r,yo}var mo,Hh;function Et(){if(Hh)return mo;Hh=1;var e=ui(),t=Nw(),r=qw(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?t(u):r(u)}return mo=o,mo}var go,Gh;function Mt(){if(Gh)return go;Gh=1;function e(t){return t!=null&&typeof t=="object"}return go=e,go}var bo,Vh;function Qr(){if(Vh)return bo;Vh=1;var e=Et(),t=Mt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return bo=n,bo}var xo,Xh;function Mf(){if(Xh)return xo;Xh=1;var e=Fe(),t=Qr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return xo=i,xo}var wo,Yh;function Ft(){if(Yh)return wo;Yh=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return wo=e,wo}var Oo,Zh;function Cf(){if(Zh)return Oo;Zh=1;var e=Et(),t=Ft(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!t(u))return!1;var s=e(u);return s==n||s==i||s==r||s==a}return Oo=o,Oo}var _o,Jh;function Lw(){if(Jh)return _o;Jh=1;var e=vt(),t=e["__core-js_shared__"];return _o=t,_o}var So,Qh;function Bw(){if(Qh)return So;Qh=1;var e=Lw(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return So=r,So}var Ao,ep;function Pb(){if(ep)return Ao;ep=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ao=r,Ao}var Po,tp;function Fw(){if(tp)return Po;tp=1;var e=Cf(),t=Bw(),r=Ft(),n=Pb(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,s=o.toString,c=u.hasOwnProperty,f=RegExp("^"+s.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(h){if(!r(h)||t(h))return!1;var p=e(h)?f:a;return p.test(n(h))}return Po=l,Po}var To,rp;function zw(){if(rp)return To;rp=1;function e(t,r){return t==null?void 0:t[r]}return To=e,To}var jo,np;function hr(){if(np)return jo;np=1;var e=Fw(),t=zw();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return jo=r,jo}var Eo,ip;function Ia(){if(ip)return Eo;ip=1;var e=hr(),t=e(Object,"create");return Eo=t,Eo}var Mo,ap;function Ww(){if(ap)return Mo;ap=1;var e=Ia();function t(){this.__data__=e?e(null):{},this.size=0}return Mo=t,Mo}var Co,op;function Uw(){if(op)return Co;op=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Co=e,Co}var $o,up;function Kw(){if(up)return $o;up=1;var e=Ia(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var u=o[a];return u===t?void 0:u}return n.call(o,a)?o[a]:void 0}return $o=i,$o}var Io,sp;function Hw(){if(sp)return Io;sp=1;var e=Ia(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Io=n,Io}var ko,cp;function Gw(){if(cp)return ko;cp=1;var e=Ia(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return ko=r,ko}var Do,lp;function Vw(){if(lp)return Do;lp=1;var e=Ww(),t=Uw(),r=Kw(),n=Hw(),i=Gw();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Do=a,Do}var Ro,fp;function Xw(){if(fp)return Ro;fp=1;function e(){this.__data__=[],this.size=0}return Ro=e,Ro}var No,hp;function $f(){if(hp)return No;hp=1;function e(t,r){return t===r||t!==t&&r!==r}return No=e,No}var qo,pp;function ka(){if(pp)return qo;pp=1;var e=$f();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return qo=t,qo}var Lo,dp;function Yw(){if(dp)return Lo;dp=1;var e=ka(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return Lo=n,Lo}var Bo,vp;function Zw(){if(vp)return Bo;vp=1;var e=ka();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Bo=t,Bo}var Fo,yp;function Jw(){if(yp)return Fo;yp=1;var e=ka();function t(r){return e(this.__data__,r)>-1}return Fo=t,Fo}var zo,mp;function Qw(){if(mp)return zo;mp=1;var e=ka();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return zo=t,zo}var Wo,gp;function Da(){if(gp)return Wo;gp=1;var e=Xw(),t=Yw(),r=Zw(),n=Jw(),i=Qw();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Wo=a,Wo}var Uo,bp;function If(){if(bp)return Uo;bp=1;var e=hr(),t=vt(),r=e(t,"Map");return Uo=r,Uo}var Ko,xp;function eO(){if(xp)return Ko;xp=1;var e=Vw(),t=Da(),r=If();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Ko=n,Ko}var Ho,wp;function tO(){if(wp)return Ho;wp=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Ho=e,Ho}var Go,Op;function Ra(){if(Op)return Go;Op=1;var e=tO();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Go=t,Go}var Vo,_p;function rO(){if(_p)return Vo;_p=1;var e=Ra();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Vo=t,Vo}var Xo,Sp;function nO(){if(Sp)return Xo;Sp=1;var e=Ra();function t(r){return e(this,r).get(r)}return Xo=t,Xo}var Yo,Ap;function iO(){if(Ap)return Yo;Ap=1;var e=Ra();function t(r){return e(this,r).has(r)}return Yo=t,Yo}var Zo,Pp;function aO(){if(Pp)return Zo;Pp=1;var e=Ra();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return Zo=t,Zo}var Jo,Tp;function kf(){if(Tp)return Jo;Tp=1;var e=eO(),t=rO(),r=nO(),n=iO(),i=aO();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Jo=a,Jo}var Qo,jp;function Tb(){if(jp)return Qo;jp=1;var e=kf(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],s=a.cache;if(s.has(u))return s.get(u);var c=n.apply(this,o);return a.cache=s.set(u,c)||s,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Qo=r,Qo}var eu,Ep;function oO(){if(Ep)return eu;Ep=1;var e=Tb(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return eu=r,eu}var tu,Mp;function uO(){if(Mp)return tu;Mp=1;var e=oO(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,u,s,c){a.push(s?c.replace(r,"$1"):u||o)}),a});return tu=n,tu}var ru,Cp;function Df(){if(Cp)return ru;Cp=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return ru=e,ru}var nu,$p;function sO(){if($p)return nu;$p=1;var e=ui(),t=Df(),r=Fe(),n=Qr(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return t(u,o)+"";if(n(u))return a?a.call(u):"";var s=u+"";return s=="0"&&1/u==-1/0?"-0":s}return nu=o,nu}var iu,Ip;function jb(){if(Ip)return iu;Ip=1;var e=sO();function t(r){return r==null?"":e(r)}return iu=t,iu}var au,kp;function Eb(){if(kp)return au;kp=1;var e=Fe(),t=Mf(),r=uO(),n=jb();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return au=i,au}var ou,Dp;function Na(){if(Dp)return ou;Dp=1;var e=Qr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return ou=t,ou}var uu,Rp;function Rf(){if(Rp)return uu;Rp=1;var e=Eb(),t=Na();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return uu=r,uu}var su,Np;function Mb(){if(Np)return su;Np=1;var e=Rf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return su=t,su}var cO=Mb();const Ze=ce(cO);var cu,qp;function lO(){if(qp)return cu;qp=1;function e(t){return t==null}return cu=e,cu}var fO=lO();const Q=ce(fO);var lu,Lp;function hO(){if(Lp)return lu;Lp=1;var e=Et(),t=Fe(),r=Mt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return lu=i,lu}var pO=hO();const ur=ce(pO);var dO=Cf();const X=ce(dO);var vO=Ft();const en=ce(vO);var fu={exports:{}},ne={};/**
|
|
1
|
+
import{c as yi,g as ce,r as R,R as P,u as kw,j as C,a as Dw,b as Rw,d as mi,s as qh,f as gi,e as Lh,h as Zt}from"./index-Twf3zCly.js";function Sb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Sb(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ee(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Sb(e))&&(n&&(n+=" "),n+=t);return n}var lo,Bh;function Fe(){if(Bh)return lo;Bh=1;var e=Array.isArray;return lo=e,lo}var fo,Fh;function Ab(){if(Fh)return fo;Fh=1;var e=typeof yi=="object"&&yi&&yi.Object===Object&&yi;return fo=e,fo}var ho,zh;function vt(){if(zh)return ho;zh=1;var e=Ab(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return ho=r,ho}var po,Wh;function ui(){if(Wh)return po;Wh=1;var e=vt(),t=e.Symbol;return po=t,po}var vo,Uh;function Nw(){if(Uh)return vo;Uh=1;var e=ui(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var u=r.call(o,i),s=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(u?o[i]=s:delete o[i]),f}return vo=a,vo}var yo,Kh;function qw(){if(Kh)return yo;Kh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return yo=r,yo}var mo,Hh;function Et(){if(Hh)return mo;Hh=1;var e=ui(),t=Nw(),r=qw(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?t(u):r(u)}return mo=o,mo}var go,Gh;function Mt(){if(Gh)return go;Gh=1;function e(t){return t!=null&&typeof t=="object"}return go=e,go}var bo,Vh;function Qr(){if(Vh)return bo;Vh=1;var e=Et(),t=Mt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return bo=n,bo}var xo,Xh;function Mf(){if(Xh)return xo;Xh=1;var e=Fe(),t=Qr(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return xo=i,xo}var wo,Yh;function Ft(){if(Yh)return wo;Yh=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return wo=e,wo}var Oo,Zh;function Cf(){if(Zh)return Oo;Zh=1;var e=Et(),t=Ft(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!t(u))return!1;var s=e(u);return s==n||s==i||s==r||s==a}return Oo=o,Oo}var _o,Jh;function Lw(){if(Jh)return _o;Jh=1;var e=vt(),t=e["__core-js_shared__"];return _o=t,_o}var So,Qh;function Bw(){if(Qh)return So;Qh=1;var e=Lw(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return So=r,So}var Ao,ep;function Pb(){if(ep)return Ao;ep=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ao=r,Ao}var Po,tp;function Fw(){if(tp)return Po;tp=1;var e=Cf(),t=Bw(),r=Ft(),n=Pb(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,s=o.toString,c=u.hasOwnProperty,f=RegExp("^"+s.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(h){if(!r(h)||t(h))return!1;var p=e(h)?f:a;return p.test(n(h))}return Po=l,Po}var To,rp;function zw(){if(rp)return To;rp=1;function e(t,r){return t==null?void 0:t[r]}return To=e,To}var jo,np;function hr(){if(np)return jo;np=1;var e=Fw(),t=zw();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return jo=r,jo}var Eo,ip;function Ia(){if(ip)return Eo;ip=1;var e=hr(),t=e(Object,"create");return Eo=t,Eo}var Mo,ap;function Ww(){if(ap)return Mo;ap=1;var e=Ia();function t(){this.__data__=e?e(null):{},this.size=0}return Mo=t,Mo}var Co,op;function Uw(){if(op)return Co;op=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Co=e,Co}var $o,up;function Kw(){if(up)return $o;up=1;var e=Ia(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var u=o[a];return u===t?void 0:u}return n.call(o,a)?o[a]:void 0}return $o=i,$o}var Io,sp;function Hw(){if(sp)return Io;sp=1;var e=Ia(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Io=n,Io}var ko,cp;function Gw(){if(cp)return ko;cp=1;var e=Ia(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return ko=r,ko}var Do,lp;function Vw(){if(lp)return Do;lp=1;var e=Ww(),t=Uw(),r=Kw(),n=Hw(),i=Gw();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Do=a,Do}var Ro,fp;function Xw(){if(fp)return Ro;fp=1;function e(){this.__data__=[],this.size=0}return Ro=e,Ro}var No,hp;function $f(){if(hp)return No;hp=1;function e(t,r){return t===r||t!==t&&r!==r}return No=e,No}var qo,pp;function ka(){if(pp)return qo;pp=1;var e=$f();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return qo=t,qo}var Lo,dp;function Yw(){if(dp)return Lo;dp=1;var e=ka(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return Lo=n,Lo}var Bo,vp;function Zw(){if(vp)return Bo;vp=1;var e=ka();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return Bo=t,Bo}var Fo,yp;function Jw(){if(yp)return Fo;yp=1;var e=ka();function t(r){return e(this.__data__,r)>-1}return Fo=t,Fo}var zo,mp;function Qw(){if(mp)return zo;mp=1;var e=ka();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return zo=t,zo}var Wo,gp;function Da(){if(gp)return Wo;gp=1;var e=Xw(),t=Yw(),r=Zw(),n=Jw(),i=Qw();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Wo=a,Wo}var Uo,bp;function If(){if(bp)return Uo;bp=1;var e=hr(),t=vt(),r=e(t,"Map");return Uo=r,Uo}var Ko,xp;function eO(){if(xp)return Ko;xp=1;var e=Vw(),t=Da(),r=If();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Ko=n,Ko}var Ho,wp;function tO(){if(wp)return Ho;wp=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Ho=e,Ho}var Go,Op;function Ra(){if(Op)return Go;Op=1;var e=tO();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Go=t,Go}var Vo,_p;function rO(){if(_p)return Vo;_p=1;var e=Ra();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Vo=t,Vo}var Xo,Sp;function nO(){if(Sp)return Xo;Sp=1;var e=Ra();function t(r){return e(this,r).get(r)}return Xo=t,Xo}var Yo,Ap;function iO(){if(Ap)return Yo;Ap=1;var e=Ra();function t(r){return e(this,r).has(r)}return Yo=t,Yo}var Zo,Pp;function aO(){if(Pp)return Zo;Pp=1;var e=Ra();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return Zo=t,Zo}var Jo,Tp;function kf(){if(Tp)return Jo;Tp=1;var e=eO(),t=rO(),r=nO(),n=iO(),i=aO();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u<s;){var c=o[u];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Jo=a,Jo}var Qo,jp;function Tb(){if(jp)return Qo;jp=1;var e=kf(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],s=a.cache;if(s.has(u))return s.get(u);var c=n.apply(this,o);return a.cache=s.set(u,c)||s,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,Qo=r,Qo}var eu,Ep;function oO(){if(Ep)return eu;Ep=1;var e=Tb(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return eu=r,eu}var tu,Mp;function uO(){if(Mp)return tu;Mp=1;var e=oO(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,u,s,c){a.push(s?c.replace(r,"$1"):u||o)}),a});return tu=n,tu}var ru,Cp;function Df(){if(Cp)return ru;Cp=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return ru=e,ru}var nu,$p;function sO(){if($p)return nu;$p=1;var e=ui(),t=Df(),r=Fe(),n=Qr(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return t(u,o)+"";if(n(u))return a?a.call(u):"";var s=u+"";return s=="0"&&1/u==-1/0?"-0":s}return nu=o,nu}var iu,Ip;function jb(){if(Ip)return iu;Ip=1;var e=sO();function t(r){return r==null?"":e(r)}return iu=t,iu}var au,kp;function Eb(){if(kp)return au;kp=1;var e=Fe(),t=Mf(),r=uO(),n=jb();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return au=i,au}var ou,Dp;function Na(){if(Dp)return ou;Dp=1;var e=Qr();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return ou=t,ou}var uu,Rp;function Rf(){if(Rp)return uu;Rp=1;var e=Eb(),t=Na();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return uu=r,uu}var su,Np;function Mb(){if(Np)return su;Np=1;var e=Rf();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return su=t,su}var cO=Mb();const Ze=ce(cO);var cu,qp;function lO(){if(qp)return cu;qp=1;function e(t){return t==null}return cu=e,cu}var fO=lO();const Q=ce(fO);var lu,Lp;function hO(){if(Lp)return lu;Lp=1;var e=Et(),t=Fe(),r=Mt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return lu=i,lu}var pO=hO();const ur=ce(pO);var dO=Cf();const X=ce(dO);var vO=Ft();const en=ce(vO);var fu={exports:{}},ne={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.min.js
|
|
4
4
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{i as G,r as m,d as X,j as s,L as y,h as F,t as Z,f as A,e as C,k as B,l as ss,s as L}from"./index-Twf3zCly.js";import{C as k,p as _}from"./CopyButton-CDLZMZtV.js";import{M as es,r as ts}from"./index-5gOslh3o.js";const J=m.createContext("markdown"),P=m.createContext(new Map),R=m.createContext(!1),H="agentlens.msgFormat";function ns(){try{return localStorage.getItem(H)==="raw"?"raw":"markdown"}catch{return"markdown"}}const W="agentlens.hideTools";function as(){try{return localStorage.getItem(W)==="1"}catch{return!1}}function ls({c:e}){var o;const[t,n]=m.useState(!1),a=m.useId(),l=(o=e.signals)==null?void 0:o.loc;return s.jsxs("div",{className:"classification",children:[s.jsx("span",{className:"tag cat cat-"+(e.category??"none"),children:e.category??"unclassified"}),e.complexity_band&&s.jsxs("span",{className:"tag complexity",children:[e.complexity_band," · ",e.complexity_score]}),l&&s.jsxs("span",{className:"muted small",children:["+",l.added,"/−",l.removed," LoC · ",l.files," files"]}),s.jsxs("button",{className:"ghost small","aria-expanded":t,"aria-controls":a,onClick:()=>n(i=>!i),children:["why ",t?"▾":"▸"]}),t&&(e.signals?s.jsx(is,{id:a,s:e.signals,category:e.category}):s.jsx("div",{id:a,className:"muted small pad",children:"No signals recorded for this session."}))]})}const rs={loc:"Lines changed",files:"Files touched",turns:"Turns",tokens:"Work tokens",duration:"Duration",subagents:"Subagents"},M=e=>`${Math.max(0,Math.min(1,e))*100}%`;function E({counts:e}){const t=Object.entries(e).sort((n,a)=>a[1]-n[1]);return t.length===0?s.jsx("span",{className:"muted",children:"—"}):s.jsx("span",{className:"sig-chips",children:t.map(([n,a])=>s.jsxs("span",{className:"sig-chip",children:[n," ",s.jsxs("span",{className:"muted",children:["×",a]})]},n))})}function is({id:e,s:t,category:n}){const[a,l]=m.useState(!1),o=m.useId(),i=t.complexity_weights??{},r=t.complexity_subscores??{},d=Object.keys(i).map(c=>({key:c,weight:i[c],subscore:r[c]??0,pts:i[c]*(r[c]??0)*100})).sort((c,N)=>N.pts-c.pts),u=Math.max(...d.map(c=>c.pts),1e-4),x=Object.entries(t.category_scores??{}).map(([c,N])=>({k:c,v:N})).sort((c,N)=>N.v-c.v),f=Math.max(...x.map(c=>c.v),1e-4),h=x.filter(c=>c.v>.02||c.k===n),j=t.skills&&Object.keys(t.skills).length>0;return s.jsxs("div",{id:e,className:"signals-panel",children:[d.length>0&&s.jsxs("section",{className:"sig-section",children:[s.jsxs("h4",{className:"sig-h",children:["Complexity breakdown ",s.jsx("span",{className:"muted",children:"— what built the score"})]}),s.jsx("ul",{className:"sig-bars",children:d.map(c=>s.jsxs("li",{className:"sig-bar-row",children:[s.jsx("span",{className:"sig-bar-label",children:rs[c.key]??c.key}),s.jsx("span",{className:"sig-bar","aria-hidden":"true",children:s.jsx("span",{className:"sig-bar-fill",style:{width:M(c.pts/u)}})}),s.jsxs("span",{className:"sig-bar-val",children:[c.pts.toFixed(1)," pts"]}),s.jsxs("span",{className:"sig-bar-sub muted",children:[Math.round(c.subscore*100),"% intensity · weight ",Math.round(c.weight*100),"%"]})]},c.key))})]}),h.length>0&&s.jsxs("section",{className:"sig-section",children:[s.jsxs("h4",{className:"sig-h",children:["Category scores ",s.jsxs("span",{className:"muted",children:["— why “",n,"” won"]})]}),s.jsx("ul",{className:"sig-bars",children:h.map(c=>s.jsxs("li",{className:"sig-bar-row"+(c.k===n?" is-win":""),children:[s.jsx("span",{className:"sig-bar-label",children:c.k}),s.jsx("span",{className:"sig-bar","aria-hidden":"true",children:s.jsx("span",{className:"sig-bar-fill",style:{width:M(c.v/f)}})}),s.jsx("span",{className:"sig-bar-val",children:c.v.toFixed(2)})]},c.k))})]}),s.jsxs("section",{className:"sig-section",children:[s.jsx("h4",{className:"sig-h",children:"Evidence"}),s.jsxs("dl",{className:"sig-grid",children:[t.tool_counts&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Tools"}),s.jsx("dd",{children:s.jsx(E,{counts:t.tool_counts})})]}),j&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Skills"}),s.jsx("dd",{children:s.jsx(E,{counts:t.skills})})]}),t.subagent_role&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Subagent role"}),s.jsx("dd",{children:t.subagent_role})]}),t.files&&t.files.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("dt",{children:["Files (",t.files.length,")"]}),s.jsx("dd",{className:"sig-files",children:t.files.join(", ")})]})]})]}),s.jsx("button",{className:"ghost small","aria-expanded":a,"aria-controls":o,onClick:()=>l(c=>!c),children:a?"Hide raw JSON ▴":"View raw JSON ▾"}),a&&s.jsx("pre",{id:o,className:"code signals",children:JSON.stringify(t,null,2)})]})}function U({t:e}){const[t,n]=m.useState(!1),[a,l]=m.useState(!1),o=m.useId(),i=e.skill_name?`Skill · ${e.skill_name}`:e.tool_name==="Workflow"&&e.workflow_name?`Workflow · ${e.workflow_name}`:e.agent_type?`${e.tool_name} → ${e.agent_type}`:e.tool_name;return s.jsxs("div",{className:"tool "+(e.status==="error"?"tool-err":""),children:[s.jsxs("button",{className:"tool-head","aria-expanded":t,"aria-controls":o,onClick:()=>n(r=>!r),children:[s.jsxs("span",{className:"tool-name",children:["🔧 ",i]}),e.status&&s.jsx("span",{className:"tool-status",children:e.status}),e.total_duration_ms?s.jsx("span",{className:"muted",children:C(e.total_duration_ms)}):null,s.jsx("span",{className:"chev",children:t?"▾":"▸"})]}),e.spawned_session_id&&s.jsx(y,{className:"subagent-link small",to:`/session/${e.spawned_session_id}`,children:"view subagent transcript →"}),e.workflow_run_id&&s.jsxs(y,{className:"subagent-link small",to:`/workflow/${e.workflow_run_id}`,children:["🔀 launched ",e.workflow_agent_count??0," agent",e.workflow_agent_count===1?"":"s"," · ",s.jsx("code",{children:e.workflow_run_id})," →"]}),e.skill_name&&s.jsxs(y,{className:"subagent-link small",to:`/skill/${encodeURIComponent(e.skill_name)}${e.skill_id?`?v=${e.skill_id}`:""}`,children:["📖 view skill",e.skill_id?" version":""," →"]}),t&&s.jsxs("div",{className:"tool-body",id:o,children:[e.input_json&&e.input_json!=="{}"&&s.jsxs("div",{className:"code-block",children:[s.jsx(k,{text:_(e.input_json),className:"copy-corner",title:"Copy tool input JSON"}),s.jsx("pre",{className:"code",children:_(e.input_json)})]}),e.result_summary&&s.jsx("div",{className:"result",children:e.result_summary}),e.full_result&&s.jsxs("div",{className:"full-result",children:[s.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":a,onClick:()=>l(r=>!r),children:[a?"Hide":"Show"," full result (",(e.full_result.bytes/1024).toFixed(1)," KB)"]}),a&&s.jsxs("div",{className:"code-block",children:[s.jsx(k,{text:e.full_result.text,className:"copy-corner",title:"Copy full tool result"}),s.jsx("pre",{className:"code",children:e.full_result.text})]})]})]})]})}function D(e){if(!e)return null;try{const t=JSON.parse(e).plan;return typeof t=="string"&&t.trim()?t:null}catch{return null}}function os({plan:e}){return s.jsxs("div",{className:"plan-card",children:[s.jsx("div",{className:"plan-card-head",children:"📋 Approved plan"}),s.jsx(K,{text:e})]})}function cs(e){if(!e)return[];try{const t=JSON.parse(e).questions;return Array.isArray(t)?t:[]}catch{return[]}}function ds(e){if(!e)return{answers:{},annotations:{}};try{const t=JSON.parse(e);if(t&&typeof t=="object"&&t.answers)return{answers:t.answers,annotations:t.annotations??{}}}catch{}return{answers:{},annotations:{}}}function us({t:e}){const[t,n]=m.useState(!1),a=m.useId(),l=cs(e.input_json),{answers:o,annotations:i}=ds(e.result_summary);return l.length===0?s.jsx(U,{t:e}):s.jsxs("div",{className:"qa-card",children:[s.jsxs("div",{className:"qa-card-head",children:["🙋 Question",l.length===1?"":"s"," for the user"]}),l.map((r,d)=>{var N;const u=o[r.question],x=Array.isArray(u)?u:u!=null?[u]:[],f=new Set(x),h=new Set(r.options.map(g=>g.label)),j=x.filter(g=>!h.has(g)),c=(N=i[r.question])==null?void 0:N.notes;return s.jsxs("div",{className:"qa-q",children:[s.jsxs("div",{className:"qa-q-head",children:[r.header&&s.jsx("span",{className:"tag",children:r.header}),r.multiSelect&&s.jsx("span",{className:"muted small",children:"multi-select"})]}),s.jsx("div",{className:"qa-question",children:r.question}),s.jsxs("ul",{className:"qa-options",children:[r.options.map((g,b)=>{const S=f.has(g.label);return s.jsxs("li",{className:"qa-opt"+(S?" is-selected":""),children:[s.jsx("span",{className:"qa-mark","aria-hidden":"true",children:S?"☑":"☐"}),s.jsxs("span",{className:"qa-opt-body",children:[s.jsx("span",{className:"qa-opt-label",children:g.label}),g.description&&s.jsx("span",{className:"qa-opt-desc muted",children:g.description})]})]},b)}),j.map((g,b)=>s.jsxs("li",{className:"qa-opt is-selected",children:[s.jsx("span",{className:"qa-mark","aria-hidden":"true",children:"☑"}),s.jsxs("span",{className:"qa-opt-body",children:[s.jsx("span",{className:"qa-opt-label",children:g}),s.jsx("span",{className:"qa-opt-desc muted",children:"custom answer"})]})]},"c"+b))]}),c&&s.jsxs("div",{className:"qa-note",children:["📝 ",c]})]},d)}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{className:"ghost small","aria-expanded":t,"aria-controls":a,onClick:()=>n(r=>!r),children:t?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(k,{text:_(e.input_json??"{}")+(e.result_summary?`
|
|
2
|
+
|
|
3
|
+
`+_(e.result_summary):""),label:"JSON",title:"Copy raw question JSON"})]}),t&&s.jsxs("pre",{id:a,className:"code",children:[_(e.input_json??"{}"),e.result_summary?`
|
|
4
|
+
|
|
5
|
+
`+_(e.result_summary):""]})]})}function ms({t:e}){const t=e.workflow_name?`Workflow · ${e.workflow_name}`:"Workflow";return s.jsxs("div",{className:"tool launch-tool",children:[s.jsxs("div",{className:"launch-tool-head",children:[s.jsxs("span",{className:"tool-name",children:["🔀 ",t]}),e.status&&s.jsx("span",{className:"tool-status",children:e.status})]}),e.workflow_run_id&&s.jsxs(y,{className:"subagent-link small",to:`/workflow/${e.workflow_run_id}`,children:["🔀 launched ",e.workflow_agent_count??0," agent",e.workflow_agent_count===1?"":"s"," · ",s.jsx("code",{children:e.workflow_run_id})," →"]}),e.result_summary&&s.jsx("div",{className:"result",children:e.result_summary})]})}function hs(e){if(!e)return null;try{const t=JSON.parse(e);if(!t||typeof t!="object")return null;const n=typeof t.command=="string"?t.command:"";return n.trim()?{command:n,description:typeof t.description=="string"?t.description:void 0,timeout:typeof t.timeout=="number"?t.timeout:void 0,run_in_background:t.run_in_background===!0,restart:t.restart===!0}:null}catch{return null}}function T(e,t,n){let a=t+2,l=!1;for(e[a]==="-"&&(l=!0,a++);e[a]===" "||e[a]===" ";)a++;let o="";(e[a]==="'"||e[a]==='"')&&(o=e[a],a++);let i="";if(o){for(;a<e.length&&e[a]!==o;)i+=e[a++];e[a]===o&&a++}else for(;a<e.length&&/[A-Za-z0-9_]/.test(e[a]);)i+=e[a++];return i&&n.push({delim:i,strip:l}),a-1}function ps(e){const t=e.split(`
|
|
6
|
+
`),n=[];let a="NORMAL",l=0;const o=[];let i=!1;for(const r of t){if(o.length>0){n.push({text:r,cont:!0});const d=o[0];(d.strip?r.replace(/^\t+/,""):r).trimEnd()===d.delim&&o.shift();continue}n.push({text:r,cont:a!=="NORMAL"||l>0||i}),i=!1;for(let d=0;d<r.length;d++){const u=r[d];if(a==="SQUOTE"){u==="'"&&(a="NORMAL");continue}if(a==="DQUOTE"){u==="\\"?d++:u==='"'?a="NORMAL":u==="$"&&r[d+1]==="("?(l++,d++):u===")"?l>0&&l--:u==="<"&&r[d+1]==="<"&&r[d+2]!=="<"&&(d=T(r,d,o));continue}if(u==="\\")d++;else if(u==="'")a="SQUOTE";else if(u==='"')a="DQUOTE";else{if(u==="#"&&(d===0||/\s/.test(r[d-1])))break;u==="$"&&r[d+1]==="("?(l++,d++):u==="("?l++:u===")"?l>0&&l--:u==="<"&&r[d+1]==="<"&&r[d+2]!=="<"&&(d=T(r,d,o))}}if(a==="NORMAL"&&l===0&&o.length===0){const d=r.replace(/\s+$/,""),u=d.match(/\\+$/);(u&&u[0].length%2===1||/(&&|\|\||\|)$/.test(d))&&(i=!0)}}return n}function xs({t:e,bash:t}){const[n,a]=m.useState(!1),[l,o]=m.useState(!1),[i,r]=m.useState(!1),d=m.useId(),u=m.useId(),x=t.command.split(`
|
|
7
|
+
`)[0],f=ps(t.command);return s.jsxs("div",{className:"tool "+(e.status==="error"?"tool-err":""),children:[s.jsxs("button",{className:"tool-head","aria-expanded":n,"aria-controls":d,onClick:()=>a(h=>!h),children:[s.jsx("span",{className:"tool-name",children:"🖥 Bash"}),t.description?s.jsxs("span",{className:"bash-desc",children:["# ",t.description]}):!n&&s.jsx("span",{className:"bash-preview",children:x}),e.status&&s.jsx("span",{className:"tool-status",children:e.status}),e.total_duration_ms?s.jsx("span",{className:"muted",children:C(e.total_duration_ms)}):null,s.jsx("span",{className:"chev",children:n?"▾":"▸"})]}),n&&s.jsxs("div",{className:"tool-body",id:d,children:[s.jsxs("div",{className:"shell code-block",children:[s.jsx(k,{text:t.command,className:"copy-corner",title:"Copy command"}),s.jsx("pre",{className:"shell-cmd",children:f.map((h,j)=>s.jsxs("span",{children:[s.jsx("span",{className:"shell-gutter"+(h.cont?" cont":""),"aria-hidden":"true",children:h.cont?" ":"$ "}),h.text,j<f.length-1?`
|
|
8
|
+
`:""]},j))})]}),(t.run_in_background||t.restart||t.timeout!=null)&&s.jsxs("div",{className:"bash-badges",children:[t.run_in_background&&s.jsx("span",{className:"bash-badge",children:"background"}),t.restart&&s.jsx("span",{className:"bash-badge",children:"restart"}),t.timeout!=null&&s.jsxs("span",{className:"bash-badge",children:["timeout ",Math.round(t.timeout/1e3),"s"]})]}),e.result_summary&&s.jsx("pre",{className:"shell-out",children:e.result_summary}),e.full_result&&s.jsxs("div",{className:"full-result",children:[s.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":l,onClick:()=>o(h=>!h),children:[l?"Hide":"Show"," full result (",(e.full_result.bytes/1024).toFixed(1)," KB)"]}),l&&s.jsxs("div",{className:"code-block",children:[s.jsx(k,{text:e.full_result.text,className:"copy-corner",title:"Copy full tool result"}),s.jsx("pre",{className:"code",children:e.full_result.text})]})]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{className:"ghost small","aria-expanded":i,"aria-controls":u,onClick:()=>r(h=>!h),children:i?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(k,{text:_(e.input_json??"{}"),label:"JSON",title:"Copy raw tool input JSON"})]}),i&&s.jsx("pre",{id:u,className:"code",children:_(e.input_json??"{}")})]})]})}function $(e,t){const n=e===""?[]:e.split(`
|
|
9
|
+
`),a=t===""?[]:t.split(`
|
|
10
|
+
`),l=n.length,o=a.length;if(l*o>25e4)return[...n.map(x=>({type:"del",text:x})),...a.map(x=>({type:"add",text:x}))];const i=Array.from({length:l+1},()=>new Array(o+1).fill(0));for(let x=l-1;x>=0;x--)for(let f=o-1;f>=0;f--)i[x][f]=n[x]===a[f]?i[x+1][f+1]+1:Math.max(i[x+1][f],i[x][f+1]);const r=[];let d=0,u=0;for(;d<l&&u<o;)n[d]===a[u]?(r.push({type:"ctx",text:n[d]}),d++,u++):i[d+1][u]>=i[d][u+1]?(r.push({type:"del",text:n[d]}),d++):(r.push({type:"add",text:a[u]}),u++);for(;d<l;)r.push({type:"del",text:n[d++]});for(;u<o;)r.push({type:"add",text:a[u++]});return r}function fs(e,t){if(!t)return null;try{const n=JSON.parse(t);if(!n||typeof n!="object"||typeof n.file_path!="string")return null;let a;if(e==="Write"){if(typeof n.content!="string")return null;a=[n.content===""?[]:n.content.split(`
|
|
11
|
+
`).map(i=>({type:"add",text:i}))]}else if(e==="MultiEdit"){if(!Array.isArray(n.edits)||(a=n.edits.filter(i=>{const r=i;return!!r&&typeof r.old_string=="string"&&typeof r.new_string=="string"}).map(i=>$(i.old_string,i.new_string)),a.length===0))return null}else{if(typeof n.old_string!="string"||typeof n.new_string!="string")return null;a=[$(n.old_string,n.new_string)]}let l=0,o=0;for(const i of a)for(const r of i)r.type==="add"?l++:r.type==="del"&&o++;return{file_path:n.file_path,kind:e,hunks:a,adds:l,dels:o}}catch{return null}}function js(e){const t=e.lastIndexOf("/");return t>=0?{dir:e.slice(0,t+1),base:e.slice(t+1)}:{dir:"",base:e}}const Ns={Edit:"✏️",MultiEdit:"✏️",Write:"📄"},I=400;function gs({t:e,edit:t}){const[n,a]=m.useState(!1),[l,o]=m.useState(!1),[i,r]=m.useState(!1),d=m.useId(),u=m.useId(),{dir:x,base:f}=js(t.file_path);return s.jsxs("div",{className:"tool "+(e.status==="error"?"tool-err":""),children:[s.jsxs("button",{className:"tool-head","aria-expanded":n,"aria-controls":d,onClick:()=>a(h=>!h),children:[s.jsxs("span",{className:"tool-name",children:[Ns[t.kind]??"✏️"," ",t.kind]}),s.jsxs("span",{className:"edit-path",children:[s.jsx("span",{className:"base",children:f}),x&&s.jsx("span",{className:"dir",children:x.replace(/\/$/,"")})]}),s.jsxs("span",{className:"diff-stat",children:[t.adds>0&&s.jsxs("span",{className:"add",children:["+",t.adds]}),t.dels>0&&s.jsxs("span",{className:"del",children:["−",t.dels]})]}),e.status&&s.jsx("span",{className:"tool-status",children:e.status}),e.total_duration_ms?s.jsx("span",{className:"muted",children:C(e.total_duration_ms)}):null,s.jsx("span",{className:"chev",children:n?"▾":"▸"})]}),n&&s.jsxs("div",{className:"tool-body",id:d,children:[t.hunks.map((h,j)=>s.jsxs("div",{className:"diff",children:[t.hunks.length>1&&s.jsxs("div",{className:"diff-hunk-sep",children:["edit ",j+1]}),h.slice(0,I).map((c,N)=>s.jsxs("div",{className:"diff-line "+c.type,children:[s.jsx("span",{className:"diff-sign","aria-hidden":"true",children:c.type==="add"?"+":c.type==="del"?"−":" "}),s.jsx("span",{className:"diff-text",children:c.text===""?" ":c.text})]},N)),h.length>I&&s.jsxs("div",{className:"diff-more",children:["… ",h.length-I," more lines — View raw JSON for the rest"]})]},j)),e.result_summary&&s.jsx("pre",{className:"shell-out",children:e.result_summary}),e.full_result&&s.jsxs("div",{className:"full-result",children:[s.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":l,onClick:()=>o(h=>!h),children:[l?"Hide":"Show"," full result (",(e.full_result.bytes/1024).toFixed(1)," KB)"]}),l&&s.jsxs("div",{className:"code-block",children:[s.jsx(k,{text:e.full_result.text,className:"copy-corner",title:"Copy full tool result"}),s.jsx("pre",{className:"code",children:e.full_result.text})]})]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{className:"ghost small","aria-expanded":i,"aria-controls":u,onClick:()=>r(h=>!h),children:i?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(k,{text:_(e.input_json??"{}"),label:"JSON",title:"Copy raw tool input JSON"})]}),i&&s.jsx("pre",{id:u,className:"code",children:_(e.input_json??"{}")})]})]})}function ws({t:e,hideTools:t}){if(e.tool_name==="ExitPlanMode"){const n=D(e.input_json);if(n)return s.jsx(os,{plan:n})}if(e.tool_name==="AskUserQuestion")return s.jsx(us,{t:e});if(e.tool_name==="Workflow")return s.jsx(ms,{t:e});if(e.tool_name==="Bash"){const n=hs(e.input_json);if(n)return t?null:s.jsx(xs,{t:e,bash:n})}if(e.tool_name==="Edit"||e.tool_name==="MultiEdit"||e.tool_name==="Write"){const n=fs(e.tool_name,e.input_json);if(n)return t?null:s.jsx(gs,{t:e,edit:n})}return t?null:s.jsx(U,{t:e})}function _s(e,t){return e.tool_name==="AskUserQuestion"||e.tool_name==="Workflow"||e.tool_name==="ExitPlanMode"&&D(e.input_json)?!0:!t}function Q(e){var a,l,o,i,r;const t=(l=(a=e.match(/<command-name>([^<]*)<\/command-name>/))==null?void 0:a[1])==null?void 0:l.trim();if(t){const d=((i=(o=e.match(/<command-args>([^<]*)<\/command-args>/))==null?void 0:o[1])==null?void 0:i.trim())??"";return{kind:"invocation",name:t.startsWith("/")?t:`/${t}`,args:d}}const n=(r=e.match(/<(?:local-command-stdout|command-output|local-command-stderr)>([\s\S]*?)<\/(?:local-command-stdout|command-output|local-command-stderr)>/))==null?void 0:r[1];return n!=null?{kind:"output",stdout:n.trim()}:/<local-command-caveat>/.test(e)?{kind:"caveat"}:null}function ks({cmd:e}){return e.kind==="invocation"?s.jsxs("div",{className:"cmd",children:[s.jsxs("span",{className:"cmd-chip",title:"Slash command",children:["⌘ ",e.name]}),e.args&&s.jsx("code",{className:"cmd-args",children:e.args})]}):e.kind==="output"?s.jsx("div",{className:"cmd-out",children:e.stdout&&e.stdout!=="(no content)"?e.stdout:s.jsx("span",{className:"muted",children:"no output"})}):s.jsx("div",{className:"cmd-note muted small",children:"⌘ local command context"})}function V(e){if(!/<task-notification>/.test(e))return null;const t=n=>{var a,l;return((l=(a=e.match(new RegExp(`<${n}>([\\s\\S]*?)</${n}>`)))==null?void 0:a[1])==null?void 0:l.trim())??null};return{taskId:t("task-id"),toolUseId:t("tool-use-id"),status:t("status"),summary:t("summary")}}function ys({n:e}){const t=m.useContext(P),n=e.toolUseId?t.get(e.toolUseId):void 0,a=(e.status??"").toLowerCase();return s.jsxs("div",{className:"task-notif",children:[s.jsxs("div",{className:"task-notif-head",children:[s.jsx("span",{className:"task-notif-icon","aria-hidden":"true",children:"🔔"}),e.status&&s.jsx("span",{className:"tag task-status task-status-"+a,children:e.status}),e.taskId&&s.jsxs("code",{className:"task-notif-id",children:["task ",e.taskId]}),n&&s.jsx(y,{className:"subagent-link small",to:`/workflow/${n}`,children:"view workflow →"})]}),e.summary&&s.jsx("div",{className:"task-notif-summary",children:e.summary})]})}function q({text:e,id:t}){return m.useContext(J)==="raw"?s.jsx("div",{className:"text",id:t,children:e}):s.jsx("div",{className:"text md",id:t,children:s.jsx(es,{remarkPlugins:[ts],components:bs,children:e})})}const bs={a:({node:e,...t})=>s.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer"})};function K({text:e}){const t=e.length>1400||e.split(`
|
|
12
|
+
`).length>18,[n,a]=m.useState(!1),l=m.useId();return t?s.jsxs("div",{className:"text-wrap"+(n?"":" is-clamped"),children:[s.jsx(q,{text:e,id:l}),s.jsx("button",{className:"ghost small show-more","aria-expanded":n,"aria-controls":l,onClick:()=>a(o=>!o),children:n?"Show less ▴":"Show more ▾"})]}):s.jsx(q,{text:e})}function vs(e,t){const n=new Map(t.map(l=>[l.id,l])),a=[];for(const l of e){const o=l.turn_id??null,i=a[a.length-1];i&&i.turnId===o?i.events.push(l):a.push({turnId:o,turn:o?n.get(o)??null:null,events:[l]})}return a}function Ss(e){const t=Q(e);if((t==null?void 0:t.kind)==="invocation")return`⌘ ${t.name}${t.args?" "+t.args:""}`;if((t==null?void 0:t.kind)==="output")return"⌘ command output";if((t==null?void 0:t.kind)==="caveat")return"⌘ local command";const n=V(e);return n?`🔔 task ${n.status??"notification"}`:e}function Cs({turn:e,events:t,open:n,onToggle:a}){const l=m.useId();return s.jsxs("section",{className:"turn"+(n?" is-open":""),children:[s.jsxs("button",{className:"turn-head","aria-expanded":n,"aria-controls":l,onClick:a,children:[s.jsx("span",{className:"chev turn-chev","aria-hidden":"true",children:n?"▾":"▸"}),s.jsxs("span",{className:"turn-no",children:["turn ",e.seq+1]}),e.prompt_preview?s.jsx("span",{className:"turn-preview",children:Ss(e.prompt_preview)}):null,s.jsxs("span",{className:"turn-stats muted",children:[t.length," msg",t.length===1?"":"s",e.duration_ms?" · "+C(e.duration_ms):""]})]}),s.jsx("div",{id:l,className:"turn-body",role:"region","aria-label":`turn ${e.seq+1} messages`,children:n&&t.map(o=>s.jsx(Y,{e:o},o.uuid))})]})}function Y({e}){const[t,n]=m.useState(!1),a=m.useId(),l=m.useContext(R),o=e.role||e.type,i=o==="user"?"👤":o==="assistant"?"🤖":"⚙️",r=e.toolCalls.filter(h=>_s(h,l));if(!(e.text||e.thinking||r.length))return null;const u=e.text?Q(e.text):null,x=e.text&&!u?V(e.text):null,f=e.text||e.thinking||"";return s.jsxs("div",{className:"event ev-"+o,children:[s.jsxs("div",{className:"ev-meta",children:[s.jsxs("span",{className:"ev-who",children:[i," ",o]}),e.model&&s.jsx("span",{className:"tag",children:L(e.model)}),e.is_sidechain?s.jsx("span",{className:"tag subagent",children:"subagent"}):null,s.jsx("span",{className:"muted ev-time",children:B(e.timestamp)}),f&&s.jsx(k,{text:f,className:"ev-copy copy-hover",title:"Copy message"})]}),e.thinking&&s.jsxs("div",{className:"thinking",children:[s.jsxs("button",{className:"thinking-toggle","aria-expanded":t,"aria-controls":a,onClick:()=>n(h=>!h),children:["🧠 thinking ",t?"▾":"▸"]}),t&&s.jsxs("div",{className:"code-block",children:[s.jsx(k,{text:e.thinking,className:"copy-corner",title:"Copy thinking"}),s.jsx("pre",{id:a,className:"thinking-body",children:e.thinking})]})]}),e.text&&(u?s.jsx(ks,{cmd:u}):x?s.jsx(ys,{n:x}):s.jsx(K,{text:e.text})),r.map((h,j)=>s.jsx(ws,{t:h,hideTools:l},j))]})}function O({c:e}){const t=e.agent_description||e.title||e.id.slice(0,12);return s.jsxs("li",{children:[s.jsx(y,{to:`/session/${e.id}`,children:t}),e.agent_type&&s.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&s.jsxs("span",{className:"tag meta-depth",title:`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),s.jsxs("span",{className:"muted",children:[" ","· ",(e.models??"").split(",").filter(Boolean).map(L).join(", ")," ·"," ",F(e.tokens)," tok · ",A(e.cost)]})]})}function Is({d:e}){const t=e.workflow_runs??[],n=e.children.filter(l=>!l.workflow_run_id),a=t.length>0;return s.jsxs("div",{className:"subagents",children:[s.jsxs("h2",{children:["Spawned subagents (",e.children.length,")"]}),t.map(l=>{const o=e.children.filter(i=>i.workflow_run_id===l.run_id);return s.jsxs("details",{className:"wf-run",children:[s.jsxs("summary",{children:[s.jsxs(y,{className:"wf-run-name",to:`/workflow/${l.run_id}`,onClick:i=>i.stopPropagation(),children:["🔀 ",l.name||"workflow"," →"]}),l.status&&s.jsx("span",{className:"tag task-status task-status-"+l.status.toLowerCase(),children:l.status}),s.jsxs("span",{className:"muted small",children:[o.length," agent",o.length===1?"":"s",l.turn_seq!=null?` · turn ${l.turn_seq+1}`:""," · ",s.jsx("code",{children:l.run_id})]})]}),s.jsx("ul",{children:o.map(i=>s.jsx(O,{c:i},i.id))})]},l.run_id)}),n.length>0&&(a?s.jsxs("details",{className:"wf-run",open:!0,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"wf-run-name",children:"Task / Agent"}),s.jsxs("span",{className:"muted small",children:[n.length," subagent",n.length===1?"":"s"]})]}),s.jsx("ul",{children:n.map(l=>s.jsx(O,{c:l},l.id))})]}):s.jsx("ul",{children:n.map(l=>s.jsx(O,{c:l},l.id))}))]})}function Ts(){const{id:e}=G(),[t,n]=m.useState(null),[a,l]=m.useState(null),[o,i]=m.useState(new Set),[r,d]=m.useState(ns),[u,x]=m.useState(as),f=p=>{d(p);try{localStorage.setItem(H,p)}catch{}},h=()=>x(p=>{const v=!p;try{localStorage.setItem(W,v?"1":"0")}catch{}return v});m.useEffect(()=>{n(null),l(null),i(new Set),X("/sessions/"+e).then(n).catch(p=>l(String(p)))},[e]);const j=m.useMemo(()=>{const p=new Map;for(const v of(t==null?void 0:t.events)??[])for(const w of v.toolCalls)w.tool_name==="Workflow"&&w.id&&w.workflow_run_id&&p.set(w.id,w.workflow_run_id);return p},[t]);if(a)return s.jsx("div",{className:"error",role:"alert",children:a});if(!t)return s.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"});const c=t.session,N=t.events.filter(p=>p.text||p.thinking||p.toolCalls.length),g=vs(N,t.turns),b=g.filter(p=>p.turn).map(p=>p.turnId),S=b.some(p=>!o.has(p)),z=p=>i(v=>{const w=new Set(v);return w.has(p)?w.delete(p):w.add(p),w});return s.jsxs("div",{className:"detail",children:[s.jsxs("div",{className:"detail-head",children:[s.jsx(y,{to:"/",className:"back",children:"← all sessions"}),s.jsx("h1",{children:c.title||c.id.slice(0,12)}),s.jsxs("div",{className:"detail-meta",children:[s.jsx("span",{children:s.jsx("b",{children:c.source_id})}),s.jsx("span",{className:"path",children:c.project_path}),c.is_sidechain?s.jsx("span",{className:"tag subagent",children:"subagent"}):null,t.parent&&s.jsxs("span",{className:"spawned-by",children:["↖ spawned by"," ",s.jsx(y,{to:`/session/${t.parent.id}`,children:t.parent.title||t.parent.id.slice(0,12)}),t.parent.turn_seq!=null?` · turn ${t.parent.turn_seq+1}`:""]}),s.jsxs("span",{children:[t.turns.length," turns"]}),s.jsxs("span",{children:[c.event_count," events"]}),s.jsxs("span",{title:Z(c.token_split),children:[F(c.tokens)," tok"]}),s.jsx("span",{title:"Estimated at API list prices (cache-aware)",children:A(c.cost)}),s.jsx("span",{children:C(c.duration_ms)}),s.jsx("span",{className:"muted",children:B(c.started_at)}),s.jsx("a",{className:"export",href:ss(c.id),children:"⬇ Export Markdown"})]}),t.classification&&s.jsx(ls,{c:t.classification})]}),t.children&&t.children.length>0&&s.jsx(Is,{d:t}),s.jsxs("div",{className:"transcript-tools",children:[b.length>1&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"muted small",children:[b.length," turns"]}),s.jsx("button",{className:"ghost small",onClick:()=>i(S?new Set(b):new Set),children:S?"Collapse all":"Expand all"})]}),s.jsxs("button",{className:"ghost small"+(u?" is-active":""),"aria-pressed":u,onClick:h,title:"Hide Bash/Edit/Skill and other tool calls — show only assistant answers, plans and questions",children:[u?"☑ ":"☐ ","Hide tool messages"]}),s.jsxs("div",{className:"format-toggle",role:"group","aria-label":"Message format",children:[s.jsx("button",{className:"ghost small"+(r==="markdown"?" is-active":""),"aria-pressed":r==="markdown",onClick:()=>f("markdown"),children:"Markdown"}),s.jsx("button",{className:"ghost small"+(r==="raw"?" is-active":""),"aria-pressed":r==="raw",onClick:()=>f("raw"),children:"Raw"})]})]}),s.jsx(P.Provider,{value:j,children:s.jsx(J.Provider,{value:r,children:s.jsx(R.Provider,{value:u,children:s.jsxs("div",{className:"transcript",children:[N.length===0&&s.jsx("div",{className:"muted pad",role:"status",children:"This session has no rendered messages."}),g.map((p,v)=>p.turn?s.jsx(Cs,{turn:p.turn,events:p.events,open:!o.has(p.turnId),onToggle:()=>z(p.turnId)},p.turnId):s.jsx("div",{className:"unturned",children:p.events.map(w=>s.jsx(Y,{e:w},w.uuid))},"unturned-"+v))]})})})})]})}export{Ts as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as N,a as k,r as a,d as g,j as s,L as j,k as c}from"./index-
|
|
1
|
+
import{i as N,a as k,r as a,d as g,j as s,L as j,k as c}from"./index-Twf3zCly.js";import{M as b,r as y}from"./index-5gOslh3o.js";function S(n){return!n||n<0?"—":n>=1024?(n/1024).toFixed(1)+" KB":n+" B"}function _(n,t){return`${n.slice(0,8)} · ${c(t)}`}function F(){const{name:n=""}=N(),[t,v]=k(),[i,o]=a.useState(null),[f,h]=a.useState(!0),[m,u]=a.useState(null);a.useEffect(()=>{h(!0),u(null),o(null),g("/skills/"+encodeURIComponent(n)).then(o).catch(e=>u(String(e))).finally(()=>h(!1))},[n]);const r=a.useMemo(()=>{if(!(i!=null&&i.versions.length))return null;const e=t.get("v");return i.versions.find(l=>l.id===e)??i.versions[0]},[i,t]),d=a.useMemo(()=>i&&r?i.sessions.filter(e=>e.version_id===r.id):[],[i,r]),x=a.useMemo(()=>i?i.sessions.filter(e=>!e.version_id).length:0,[i]);function p(e){const l=new URLSearchParams(t);l.set("v",e),v(l)}return f?s.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}):m?s.jsx("div",{className:"error",role:"alert",children:m}):i?s.jsxs("div",{className:"skill-view",children:[s.jsx(j,{to:"/skills",className:"back",children:"← all skills"}),s.jsxs("header",{className:"skill-head",children:[s.jsxs("h1",{children:["📖 ",i.name]}),s.jsxs("div",{className:"skill-head-meta muted",children:[i.call_count.toLocaleString()," firing",i.call_count===1?"":"s"," ·"," ",i.versions.length," version",i.versions.length===1?"":"s",r!=null&&r.summary?s.jsxs(s.Fragment,{children:[" · ",r.summary]}):null]})]}),i.versions.length===0?s.jsxs("div",{className:"empty",children:["This skill fired ",i.call_count.toLocaleString()," time(s) but no SKILL.md body was captured in the transcripts, so there is no version content to show."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"skill-version-bar",children:[s.jsxs("label",{className:"ctl",children:["version"," ",s.jsx("select",{"aria-label":"Skill version",value:(r==null?void 0:r.id)??"",onChange:e=>p(e.target.value),children:i.versions.map((e,l)=>s.jsxs("option",{value:e.id,children:[_(e.id,e.last_seen)," · ",e.call_count," fire",e.call_count===1?"":"s",l===0?" (latest)":""]},e.id))})]}),r&&s.jsxs("span",{className:"muted small",children:["first seen ",c(r.first_seen)," · last seen ",c(r.last_seen)," ·"," ",S(r.body_bytes)]})]}),r&&s.jsxs("div",{className:"cards skill-cards",children:[s.jsxs("div",{className:"card skill-body-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Skill body"}),s.jsxs("span",{className:"card-hint",children:["version ",r.id.slice(0,8)]})]}),s.jsx("div",{className:"md skill-body",children:s.jsx(b,{remarkPlugins:[y],children:r.body})})]}),s.jsxs("div",{className:"card skill-sessions-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Sessions that fired this version"}),s.jsx("span",{className:"card-hint",children:d.length})]}),d.length===0?s.jsx("div",{className:"empty",children:"No sessions fired this version."}):s.jsxs("table",{className:"sessions",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Session"}),s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Project"}),s.jsx("th",{className:"num",children:"Fires"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:d.map(e=>{var l;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(j,{to:`/session/${e.id}`,className:"title",children:e.title||s.jsx("span",{className:"muted",children:e.id.slice(0,12)})})}),s.jsx("td",{children:e.source_id}),s.jsx("td",{className:"path",children:((l=e.project_path)==null?void 0:l.replace(/^.*\//,""))??"—"}),s.jsx("td",{className:"num",children:e.fire_count}),s.jsx("td",{children:c(e.fired_at)})]},e.id)})})]}),x>0&&s.jsxs("div",{className:"muted small pad",children:[x," firing(s) had no captured body and aren’t attributed to a version."]})]})]})]})]}):s.jsx("div",{className:"muted pad",children:"Not found."})}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,r,m as I,d as h,n as K,j as e,F as M,S as m,L as D,k as U,P as $}from"./index-
|
|
1
|
+
import{a as C,r,m as I,d as h,n as K,j as e,F as M,S as m,L as D,k as U,P as $}from"./index-Twf3zCly.js";const j=50,V={name:t=>t.name,fired:t=>t.call_count,last_fired:t=>t.last_fired};function G(){const[t,N]=C(),[P,L]=r.useState([]),[_,q]=r.useState([]),[o,E]=r.useState([]),[p,x]=r.useState(!0),[S,g]=r.useState(null),[f,v]=r.useState(t.get("q")??""),{sort:a,toggle:d}=I("fired","desc"),[R,b]=r.useState(1);r.useEffect(()=>{h("/sources").then(L).catch(()=>{}),h("/projects").then(q).catch(()=>{})},[]),r.useEffect(()=>{x(!0),g(null);const s=new URLSearchParams;for(const l of["source","project","q"]){const y=t.get(l);y&&s.set(l,y)}const n=s.toString()?"?"+s.toString():"";h("/skills"+n).then(E).catch(l=>g(String(l))).finally(()=>x(!1))},[t]);function c(s,n){const l=new URLSearchParams(t);n?l.set(s,n):l.delete(s),N(l)}function F(s){s.preventDefault(),c("q",f.trim())}r.useEffect(()=>b(1),[t,a.key,a.dir]);const i=r.useMemo(()=>K(o,V[a.key],a.dir),[o,a.key,a.dir]),k=Math.max(1,Math.ceil(i.length/j)),u=Math.min(R,k),w=i.slice((u-1)*j,u*j);return e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:"Skills"}),e.jsxs("div",{className:"filters",children:[e.jsxs("form",{onSubmit:F,className:"search",role:"search",children:[e.jsx("input",{type:"search","aria-label":"Search skills by name and body",placeholder:"Search skill names & bodies…",value:f,onChange:s=>v(s.target.value)}),e.jsx("button",{type:"submit",children:"Search"}),t.get("q")&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>(v(""),c("q","")),children:"clear"})]}),e.jsxs("select",{"aria-label":"Filter by source",value:t.get("source")??"",onChange:s=>c("source",s.target.value),children:[e.jsx("option",{value:"",children:"all sources"}),P.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(M,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:t.get("project")??"",onChange:s=>c("project",s),options:[{value:"",label:"all projects"},..._.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]})]}),S&&e.jsx("div",{className:"error",role:"alert",children:S}),p?e.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}):o.length===0?e.jsx("div",{className:"muted pad",role:"status",children:"No skills fired match."}):e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(m,{label:"Skill",sortKey:"name",active:a.key,dir:a.dir,onSort:d,defaultDir:"asc"}),e.jsx(m,{label:"Fired",sortKey:"fired",active:a.key,dir:a.dir,onSort:d,className:"num"}),e.jsx("th",{className:"num",children:"Versions"}),e.jsx("th",{children:"Sources"}),e.jsx(m,{label:"Last fired",sortKey:"last_fired",active:a.key,dir:a.dir,onSort:d})]})}),e.jsx("tbody",{children:w.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(D,{to:`/skill/${encodeURIComponent(s.name)}`,className:"title",children:s.name})}),e.jsx("td",{className:"num",children:s.call_count.toLocaleString()}),e.jsx("td",{className:"num",title:`${s.version_count} distinct captured ${s.version_count===1?"version":"versions"}`,children:s.version_count||e.jsx("span",{className:"muted",children:"—"})}),e.jsx("td",{children:e.jsx("span",{className:"sub",children:s.sources.map(n=>e.jsx("span",{className:"tag",children:n},n))})}),e.jsx("td",{children:U(s.last_fired)})]},s.name))})]}),!p&&i.length>0&&e.jsx($,{page:u,pages:k,total:i.length,unit:"skills",onPage:b})]})}export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,r as p,i as z,d as H,L as O,s as $,h as J,f as F,e as I,k as Q}from"./index-CWdoCK2Q.js";import{s as B,d as S,l as D,a as U,C as G,p as L}from"./CopyButton-DPveQcsm.js";import{M as K,r as q}from"./index-eVzr9g61.js";const g=e=>e===null||typeof e!="object",M=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function T({v:e}){if(e==null)return s.jsx("span",{className:"json-null",children:"—"});const t=typeof e;return t==="boolean"?s.jsx("span",{className:e?"rv-true":"rv-false",children:e?"✓ true":"✗ false"}):t==="number"?s.jsx("span",{className:"json-number",children:String(e)}):s.jsx("span",{className:"rv-str",children:String(e)})}function E({v:e}){return g(e)?s.jsx(T,{v:e}):Array.isArray(e)?e.every(g)?s.jsx("span",{className:"rv-str",children:e.map(String).join(", ")||"—"}):s.jsxs("span",{className:"muted",children:["[",e.length,"]"]}):s.jsx("span",{className:"muted",children:`{${Object.keys(e).length}}`})}function W(e){const t=[],l=new Set;for(const r of e)for(const n of Object.keys(r??{}))l.has(n)||(l.add(n),t.push(n));return t}function X({rows:e}){const t=W(e);return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(l=>s.jsx("th",{children:l},l))})}),s.jsx("tbody",{children:e.map((l,r)=>s.jsx("tr",{children:t.map(n=>s.jsx("td",{children:s.jsx(E,{v:l[n]})},n))},r))})]})})}function Z({obj:e}){const t=Object.entries(e),l=W(t.map(([,r])=>r));return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"key"}),l.map(r=>s.jsx("th",{children:r},r))]})}),s.jsx("tbody",{children:t.map(([r,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"rv-rowkey",children:r}),l.map(a=>s.jsx("td",{children:s.jsx(E,{v:n[a]})},a))]},r))})]})})}function ss({name:e,value:t,depth:l}){const[r,n]=p.useState(l<1),a=Array.isArray(t)?`[${t.length}]`:`{${Object.keys(t).length}}`;return s.jsxs("div",{className:"rv-section",children:[s.jsxs("button",{className:"rv-sec-head","aria-expanded":r,onClick:()=>n(c=>!c),children:[s.jsx("span",{className:"json-chev","aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{className:"rv-sec-name",children:e}),s.jsx("span",{className:"muted small",children:a})]}),r&&s.jsx("div",{className:"rv-sec-body",children:s.jsx(Y,{value:t,depth:l+1})})]})}function Y({value:e,depth:t=0}){if(g(e))return s.jsx(T,{v:e});if(Array.isArray(e))return e.length===0?s.jsx("span",{className:"muted",children:"empty"}):e.every(M)?s.jsx(X,{rows:e}):s.jsx("ul",{className:"rv-list",children:e.map((a,c)=>s.jsx("li",{children:s.jsx(E,{v:a})},c))});const l=Object.entries(e);if(l.length===0)return s.jsx("span",{className:"muted",children:"empty"});if(l.every(([,a])=>M(a)))return s.jsx(Z,{obj:e});const r=l.filter(([,a])=>g(a)),n=l.filter(([,a])=>!g(a));return s.jsxs("div",{className:"rv-obj",children:[r.length>0&&s.jsx("div",{className:"rv-metrics",children:r.map(([a,c])=>s.jsxs("div",{className:"rv-metric",children:[s.jsx("span",{className:"rv-mkey",children:a}),s.jsx("span",{className:"rv-mval",children:s.jsx(T,{v:c})})]},a))}),n.map(([a,c])=>s.jsx(ss,{name:a,value:c,depth:t},a))]})}function C({value:e}){return s.jsx("div",{className:"rv-root",children:s.jsx(Y,{value:e,depth:0})})}const N=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),A=e=>e===null||typeof e!="object",es=new Set(["script","scriptPath","description"]),ts=["skill","name","id","title"];function ns({v:e}){return e==null?s.jsx("span",{className:"muted",children:"—"}):typeof e=="string"?s.jsx("span",{className:"launch-text",children:e}):A(e)?s.jsx("span",{className:"json-number",children:String(e)}):Array.isArray(e)?e.every(A)?s.jsx("ol",{className:"launch-list",children:e.map((t,l)=>s.jsx("li",{children:t===null?"—":String(t)},l))}):s.jsx(C,{value:e}):s.jsx(C,{value:e})}function as({rec:e,index:t}){const l=ts.find(a=>typeof e[a]=="string"),r=l?String(e[l]):`task ${t+1}`,n=Object.entries(e).filter(([a])=>a!==l);return s.jsxs("div",{className:"launch-card",children:[s.jsxs("div",{className:"launch-card-head",children:[s.jsx("span",{className:"launch-card-idx",children:t+1}),s.jsx("span",{className:"launch-card-title",children:r})]}),s.jsx("dl",{className:"launch-fields",children:n.map(([a,c])=>s.jsxs("div",{className:"launch-field",children:[s.jsx("dt",{children:a}),s.jsx("dd",{children:s.jsx(ns,{v:c})})]},a))})]})}function V({raw:e}){const[t,l]=p.useState(!1),{body:r,note:n}=B(S(e)),{value:a,repaired:c}=D(r);if(a===void 0)return s.jsx("div",{className:"launch",children:s.jsx("pre",{className:"code",children:e})});const o=U(a),y=N(o)?Object.entries(o):[["",o]],P=y.filter(([i,h])=>A(h)&&i!=="script"),w=y.filter(([,i])=>!A(i)),u=N(o)&&typeof o.script=="string"?o.script:null,m=N(o)&&typeof o.scriptPath=="string"?o.scriptPath:null,j=N(o)&&typeof o.description=="string"?o.description:null,x=P.filter(([i])=>!es.has(i)),b=j||m||u||x.length>0,v=i=>Array.isArray(i)&&i.length>0&&i.every(N);return s.jsxs("div",{className:"launch",children:[b&&s.jsxs("div",{className:"launch-meta",children:[j&&s.jsx("div",{className:"launch-desc",children:j}),m&&s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:"script"})," ",s.jsx("code",{children:m})]}),x.map(([i,h])=>s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:i})," ",s.jsx("code",{children:String(h)})]},i)),u&&s.jsxs("details",{className:"launch-src",children:[s.jsxs("summary",{children:["script source · ",u.length.toLocaleString()," chars"]}),s.jsx("pre",{className:"code",children:u})]})]}),w.map(([i,h])=>v(h)?s.jsxs("div",{className:"launch-tasks",children:[s.jsxs("div",{className:"launch-tasks-head",children:[h.length," ",i||(h.length===1?"task":"tasks")," ",s.jsx("span",{className:"muted",children:"launched"})]}),h.map((_,f)=>s.jsx(as,{rec:_,index:f},f))]},i||"tasks"):s.jsxs("div",{className:"launch-section",children:[i&&s.jsx("div",{className:"launch-tasks-head",children:i}),s.jsx(C,{value:h})]},i||"value")),(n||c)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",n??"Payload was truncated; showing the recoverable portion."]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{type:"button",className:"ghost small","aria-expanded":t,onClick:()=>l(i=>!i),children:t?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(G,{text:L(r),label:"JSON",title:"Copy raw launch JSON"})]}),t&&s.jsx("pre",{className:"code launch-raw",children:L(r)})]})}function ls({raw:e}){const{body:t,note:l}=B(S(e)),r=/^\s*[[{]/.test(t),{value:n,repaired:a}=r?D(t):{value:void 0,repaired:!1},c=n!==void 0;return s.jsxs(s.Fragment,{children:[c?s.jsx("div",{className:"wf-result-body",children:s.jsx(C,{value:n})}):s.jsx("div",{className:"text md wf-result-body",children:s.jsx(K,{remarkPlugins:[q],children:t})}),(l||a)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",l??"Result was truncated; showing the recoverable portion."]}),s.jsx("div",{className:"launch-actions",children:s.jsx(G,{text:c?L(t):t,label:"result",title:"Copy the returned result"})})]})}function rs(e,t){if(e&&e.length){const l=new Map,r=(n,a)=>{let c=l.get(n);return c?a&&(c.title=a):(c={title:a||`Phase ${n}`,agentCount:0,models:[]},l.set(n,c)),c};for(const n of e)n.type==="workflow_phase"&&r(n.index,n.title);for(const n of e)if(n.type==="workflow_agent"&&n.phaseIndex!=null){const a=r(n.phaseIndex,n.phaseTitle);a.agentCount++,n.model&&!a.models.includes(n.model)&&a.models.push(n.model)}if(l.size)return[...l.keys()].sort((n,a)=>n-a).map(n=>l.get(n))}return t.map(l=>({title:l,agentCount:0,models:[]}))}function cs({a:e}){const t=e.agent_description||e.title||e.id.slice(0,12);return s.jsxs("li",{children:[s.jsx(O,{to:`/session/${e.id}`,children:t}),e.agent_type&&s.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&s.jsxs("span",{className:"tag meta-depth",title:`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),s.jsxs("span",{className:"muted",children:[" ","· ",(e.models??"").split(",").filter(Boolean).map($).join(", ")||"—"," ·"," ",J(e.tokens)," tok · ",F(e.cost),e.duration_ms!=null?` · ${I(e.duration_ms)}`:""]})]})}function hs(){var m,j,x,b,v,i,h,_,f,R;const{run_id:e}=z(),[t,l]=p.useState(null),[r,n]=p.useState(null);if(p.useEffect(()=>{l(null),n(null),H("/workflows/"+e).then(l).catch(d=>n(String(d)))},[e]),r)return s.jsx("div",{className:"error",role:"alert",children:r});if(!t)return s.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"});const a=(t.status??"").toLowerCase(),c=((m=t.run)==null?void 0:m.agent_count)??t.stats.agent_count,o=((j=t.run)==null?void 0:j.total_tokens)??t.stats.total_tokens,y=((x=t.run)==null?void 0:x.duration_ms)??t.stats.duration_ms,P=(((b=t.run)==null?void 0:b.phases)??[]).map(d=>d==null?void 0:d.title).filter(d=>!!d),w=rs((v=t.run)==null?void 0:v.progress,P),u=((i=t.run)==null?void 0:i.logs)??[];return s.jsxs("div",{className:"detail",children:[s.jsxs("div",{className:"detail-head",children:[s.jsx(O,{to:"/",className:"back",children:"← all sessions"}),s.jsxs("h1",{children:["🔀 ",t.name||"workflow"]}),s.jsxs("div",{className:"detail-meta",children:[s.jsx("code",{children:t.run_id}),t.status&&s.jsx("span",{className:"tag task-status task-status-"+a,children:t.status}),((h=t.run)==null?void 0:h.default_model)&&s.jsx("span",{className:"tag",children:$(t.run.default_model)}),((_=t.parent)==null?void 0:_.id)&&s.jsxs("span",{className:"spawned-by",children:["↖ launched from"," ",s.jsx(O,{to:`/session/${t.parent.id}`,children:t.parent.title||t.parent.id.slice(0,12)}),t.parent.turn_seq!=null?` · turn ${t.parent.turn_seq+1}`:""]}),s.jsxs("span",{children:[c," agent",c===1?"":"s"]}),s.jsxs("span",{children:[J(o)," tok"]}),((f=t.run)==null?void 0:f.total_tool_calls)!=null&&s.jsxs("span",{children:[t.run.total_tool_calls," tool calls"]}),s.jsx("span",{title:"Estimated from ingested agent transcripts at API list prices (cache-aware)",children:F(t.stats.total_cost)}),s.jsx("span",{children:I(y)}),s.jsx("span",{className:"muted",children:Q(((R=t.run)==null?void 0:R.started_at)??t.stats.started_at)})]}),w.length>0&&s.jsx("div",{className:"wf-phases","aria-label":"workflow phases",children:w.map((d,k)=>s.jsxs(p.Fragment,{children:[k>0&&s.jsx("span",{className:"wf-phase-arrow","aria-hidden":"true",children:"→"}),s.jsxs("div",{className:"wf-phase-chip",children:[s.jsx("span",{className:"wf-phase-title",children:d.title}),d.agentCount>0&&s.jsxs("span",{className:"wf-phase-desc",children:[d.agentCount," agent",d.agentCount===1?"":"s",d.models.length?` · ${d.models.map($).join(", ")}`:""]})]})]},k))})]}),t.completion&&s.jsxs("div",{className:"wf-result",children:[s.jsxs("h2",{children:["Returned result",t.completion.status&&s.jsx("span",{className:"tag task-status task-status-"+t.completion.status.toLowerCase(),children:t.completion.status})]}),t.completion.summary&&s.jsx("p",{className:"wf-result-summary",children:S(t.completion.summary)}),t.completion.result?s.jsx(ls,{raw:t.completion.result}):s.jsx("div",{className:"muted small",children:"Completed with no returned payload."}),t.completion.failures&&s.jsxs("details",{className:"wf-failures",children:[s.jsx("summary",{children:"failures"}),s.jsx("pre",{className:"code wf-result-body",children:S(t.completion.failures)})]})]}),u.length>0&&s.jsxs("details",{className:"wf-logs",open:u.length<=20,children:[s.jsxs("summary",{children:["Run log · ",u.length," line",u.length===1?"":"s"]}),s.jsx("ul",{className:"wf-log-list",children:u.map((d,k)=>s.jsx("li",{children:d},k))})]}),t.input_json?s.jsx("div",{className:"wf-result wf-launch",children:t.completion?s.jsxs("details",{children:[s.jsx("summary",{children:s.jsx("h2",{children:"Launch payload"})}),s.jsx(V,{raw:t.input_json})]}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Launch payload"}),a==="async_launched"&&s.jsx("p",{className:"wf-result-summary muted",children:"Launched asynchronously — results will appear here once the run reports back."}),s.jsx(V,{raw:t.input_json})]})}):!t.completion&&t.result_summary?s.jsxs("div",{className:"wf-result",children:[s.jsx("h2",{children:"Workflow launch"}),s.jsx("div",{className:"text md",children:s.jsx(K,{remarkPlugins:[q],children:t.result_summary})})]}):null,s.jsxs("div",{className:"subagents",children:[s.jsxs("h2",{children:["Agents (",t.agents.length,")"]}),t.agents.length===0?s.jsx("div",{className:"muted pad",role:"status",children:"No agent transcripts ingested for this run yet."}):s.jsx("ul",{children:t.agents.map(d=>s.jsx(cs,{a:d},d.id))})]})]})}export{hs as default};
|
|
1
|
+
import{j as s,r as p,i as z,d as H,L as O,s as $,h as J,f as F,e as I,k as Q}from"./index-Twf3zCly.js";import{s as B,d as S,l as D,a as U,C as G,p as L}from"./CopyButton-CDLZMZtV.js";import{M as K,r as q}from"./index-5gOslh3o.js";const g=e=>e===null||typeof e!="object",M=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function T({v:e}){if(e==null)return s.jsx("span",{className:"json-null",children:"—"});const t=typeof e;return t==="boolean"?s.jsx("span",{className:e?"rv-true":"rv-false",children:e?"✓ true":"✗ false"}):t==="number"?s.jsx("span",{className:"json-number",children:String(e)}):s.jsx("span",{className:"rv-str",children:String(e)})}function E({v:e}){return g(e)?s.jsx(T,{v:e}):Array.isArray(e)?e.every(g)?s.jsx("span",{className:"rv-str",children:e.map(String).join(", ")||"—"}):s.jsxs("span",{className:"muted",children:["[",e.length,"]"]}):s.jsx("span",{className:"muted",children:`{${Object.keys(e).length}}`})}function W(e){const t=[],l=new Set;for(const r of e)for(const n of Object.keys(r??{}))l.has(n)||(l.add(n),t.push(n));return t}function X({rows:e}){const t=W(e);return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(l=>s.jsx("th",{children:l},l))})}),s.jsx("tbody",{children:e.map((l,r)=>s.jsx("tr",{children:t.map(n=>s.jsx("td",{children:s.jsx(E,{v:l[n]})},n))},r))})]})})}function Z({obj:e}){const t=Object.entries(e),l=W(t.map(([,r])=>r));return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"key"}),l.map(r=>s.jsx("th",{children:r},r))]})}),s.jsx("tbody",{children:t.map(([r,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"rv-rowkey",children:r}),l.map(a=>s.jsx("td",{children:s.jsx(E,{v:n[a]})},a))]},r))})]})})}function ss({name:e,value:t,depth:l}){const[r,n]=p.useState(l<1),a=Array.isArray(t)?`[${t.length}]`:`{${Object.keys(t).length}}`;return s.jsxs("div",{className:"rv-section",children:[s.jsxs("button",{className:"rv-sec-head","aria-expanded":r,onClick:()=>n(c=>!c),children:[s.jsx("span",{className:"json-chev","aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{className:"rv-sec-name",children:e}),s.jsx("span",{className:"muted small",children:a})]}),r&&s.jsx("div",{className:"rv-sec-body",children:s.jsx(Y,{value:t,depth:l+1})})]})}function Y({value:e,depth:t=0}){if(g(e))return s.jsx(T,{v:e});if(Array.isArray(e))return e.length===0?s.jsx("span",{className:"muted",children:"empty"}):e.every(M)?s.jsx(X,{rows:e}):s.jsx("ul",{className:"rv-list",children:e.map((a,c)=>s.jsx("li",{children:s.jsx(E,{v:a})},c))});const l=Object.entries(e);if(l.length===0)return s.jsx("span",{className:"muted",children:"empty"});if(l.every(([,a])=>M(a)))return s.jsx(Z,{obj:e});const r=l.filter(([,a])=>g(a)),n=l.filter(([,a])=>!g(a));return s.jsxs("div",{className:"rv-obj",children:[r.length>0&&s.jsx("div",{className:"rv-metrics",children:r.map(([a,c])=>s.jsxs("div",{className:"rv-metric",children:[s.jsx("span",{className:"rv-mkey",children:a}),s.jsx("span",{className:"rv-mval",children:s.jsx(T,{v:c})})]},a))}),n.map(([a,c])=>s.jsx(ss,{name:a,value:c,depth:t},a))]})}function C({value:e}){return s.jsx("div",{className:"rv-root",children:s.jsx(Y,{value:e,depth:0})})}const N=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),A=e=>e===null||typeof e!="object",es=new Set(["script","scriptPath","description"]),ts=["skill","name","id","title"];function ns({v:e}){return e==null?s.jsx("span",{className:"muted",children:"—"}):typeof e=="string"?s.jsx("span",{className:"launch-text",children:e}):A(e)?s.jsx("span",{className:"json-number",children:String(e)}):Array.isArray(e)?e.every(A)?s.jsx("ol",{className:"launch-list",children:e.map((t,l)=>s.jsx("li",{children:t===null?"—":String(t)},l))}):s.jsx(C,{value:e}):s.jsx(C,{value:e})}function as({rec:e,index:t}){const l=ts.find(a=>typeof e[a]=="string"),r=l?String(e[l]):`task ${t+1}`,n=Object.entries(e).filter(([a])=>a!==l);return s.jsxs("div",{className:"launch-card",children:[s.jsxs("div",{className:"launch-card-head",children:[s.jsx("span",{className:"launch-card-idx",children:t+1}),s.jsx("span",{className:"launch-card-title",children:r})]}),s.jsx("dl",{className:"launch-fields",children:n.map(([a,c])=>s.jsxs("div",{className:"launch-field",children:[s.jsx("dt",{children:a}),s.jsx("dd",{children:s.jsx(ns,{v:c})})]},a))})]})}function V({raw:e}){const[t,l]=p.useState(!1),{body:r,note:n}=B(S(e)),{value:a,repaired:c}=D(r);if(a===void 0)return s.jsx("div",{className:"launch",children:s.jsx("pre",{className:"code",children:e})});const o=U(a),y=N(o)?Object.entries(o):[["",o]],P=y.filter(([i,h])=>A(h)&&i!=="script"),w=y.filter(([,i])=>!A(i)),u=N(o)&&typeof o.script=="string"?o.script:null,m=N(o)&&typeof o.scriptPath=="string"?o.scriptPath:null,j=N(o)&&typeof o.description=="string"?o.description:null,x=P.filter(([i])=>!es.has(i)),b=j||m||u||x.length>0,v=i=>Array.isArray(i)&&i.length>0&&i.every(N);return s.jsxs("div",{className:"launch",children:[b&&s.jsxs("div",{className:"launch-meta",children:[j&&s.jsx("div",{className:"launch-desc",children:j}),m&&s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:"script"})," ",s.jsx("code",{children:m})]}),x.map(([i,h])=>s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:i})," ",s.jsx("code",{children:String(h)})]},i)),u&&s.jsxs("details",{className:"launch-src",children:[s.jsxs("summary",{children:["script source · ",u.length.toLocaleString()," chars"]}),s.jsx("pre",{className:"code",children:u})]})]}),w.map(([i,h])=>v(h)?s.jsxs("div",{className:"launch-tasks",children:[s.jsxs("div",{className:"launch-tasks-head",children:[h.length," ",i||(h.length===1?"task":"tasks")," ",s.jsx("span",{className:"muted",children:"launched"})]}),h.map((_,f)=>s.jsx(as,{rec:_,index:f},f))]},i||"tasks"):s.jsxs("div",{className:"launch-section",children:[i&&s.jsx("div",{className:"launch-tasks-head",children:i}),s.jsx(C,{value:h})]},i||"value")),(n||c)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",n??"Payload was truncated; showing the recoverable portion."]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{type:"button",className:"ghost small","aria-expanded":t,onClick:()=>l(i=>!i),children:t?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(G,{text:L(r),label:"JSON",title:"Copy raw launch JSON"})]}),t&&s.jsx("pre",{className:"code launch-raw",children:L(r)})]})}function ls({raw:e}){const{body:t,note:l}=B(S(e)),r=/^\s*[[{]/.test(t),{value:n,repaired:a}=r?D(t):{value:void 0,repaired:!1},c=n!==void 0;return s.jsxs(s.Fragment,{children:[c?s.jsx("div",{className:"wf-result-body",children:s.jsx(C,{value:n})}):s.jsx("div",{className:"text md wf-result-body",children:s.jsx(K,{remarkPlugins:[q],children:t})}),(l||a)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",l??"Result was truncated; showing the recoverable portion."]}),s.jsx("div",{className:"launch-actions",children:s.jsx(G,{text:c?L(t):t,label:"result",title:"Copy the returned result"})})]})}function rs(e,t){if(e&&e.length){const l=new Map,r=(n,a)=>{let c=l.get(n);return c?a&&(c.title=a):(c={title:a||`Phase ${n}`,agentCount:0,models:[]},l.set(n,c)),c};for(const n of e)n.type==="workflow_phase"&&r(n.index,n.title);for(const n of e)if(n.type==="workflow_agent"&&n.phaseIndex!=null){const a=r(n.phaseIndex,n.phaseTitle);a.agentCount++,n.model&&!a.models.includes(n.model)&&a.models.push(n.model)}if(l.size)return[...l.keys()].sort((n,a)=>n-a).map(n=>l.get(n))}return t.map(l=>({title:l,agentCount:0,models:[]}))}function cs({a:e}){const t=e.agent_description||e.title||e.id.slice(0,12);return s.jsxs("li",{children:[s.jsx(O,{to:`/session/${e.id}`,children:t}),e.agent_type&&s.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&s.jsxs("span",{className:"tag meta-depth",title:`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),s.jsxs("span",{className:"muted",children:[" ","· ",(e.models??"").split(",").filter(Boolean).map($).join(", ")||"—"," ·"," ",J(e.tokens)," tok · ",F(e.cost),e.duration_ms!=null?` · ${I(e.duration_ms)}`:""]})]})}function hs(){var m,j,x,b,v,i,h,_,f,R;const{run_id:e}=z(),[t,l]=p.useState(null),[r,n]=p.useState(null);if(p.useEffect(()=>{l(null),n(null),H("/workflows/"+e).then(l).catch(d=>n(String(d)))},[e]),r)return s.jsx("div",{className:"error",role:"alert",children:r});if(!t)return s.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"});const a=(t.status??"").toLowerCase(),c=((m=t.run)==null?void 0:m.agent_count)??t.stats.agent_count,o=((j=t.run)==null?void 0:j.total_tokens)??t.stats.total_tokens,y=((x=t.run)==null?void 0:x.duration_ms)??t.stats.duration_ms,P=(((b=t.run)==null?void 0:b.phases)??[]).map(d=>d==null?void 0:d.title).filter(d=>!!d),w=rs((v=t.run)==null?void 0:v.progress,P),u=((i=t.run)==null?void 0:i.logs)??[];return s.jsxs("div",{className:"detail",children:[s.jsxs("div",{className:"detail-head",children:[s.jsx(O,{to:"/",className:"back",children:"← all sessions"}),s.jsxs("h1",{children:["🔀 ",t.name||"workflow"]}),s.jsxs("div",{className:"detail-meta",children:[s.jsx("code",{children:t.run_id}),t.status&&s.jsx("span",{className:"tag task-status task-status-"+a,children:t.status}),((h=t.run)==null?void 0:h.default_model)&&s.jsx("span",{className:"tag",children:$(t.run.default_model)}),((_=t.parent)==null?void 0:_.id)&&s.jsxs("span",{className:"spawned-by",children:["↖ launched from"," ",s.jsx(O,{to:`/session/${t.parent.id}`,children:t.parent.title||t.parent.id.slice(0,12)}),t.parent.turn_seq!=null?` · turn ${t.parent.turn_seq+1}`:""]}),s.jsxs("span",{children:[c," agent",c===1?"":"s"]}),s.jsxs("span",{children:[J(o)," tok"]}),((f=t.run)==null?void 0:f.total_tool_calls)!=null&&s.jsxs("span",{children:[t.run.total_tool_calls," tool calls"]}),s.jsx("span",{title:"Estimated from ingested agent transcripts at API list prices (cache-aware)",children:F(t.stats.total_cost)}),s.jsx("span",{children:I(y)}),s.jsx("span",{className:"muted",children:Q(((R=t.run)==null?void 0:R.started_at)??t.stats.started_at)})]}),w.length>0&&s.jsx("div",{className:"wf-phases","aria-label":"workflow phases",children:w.map((d,k)=>s.jsxs(p.Fragment,{children:[k>0&&s.jsx("span",{className:"wf-phase-arrow","aria-hidden":"true",children:"→"}),s.jsxs("div",{className:"wf-phase-chip",children:[s.jsx("span",{className:"wf-phase-title",children:d.title}),d.agentCount>0&&s.jsxs("span",{className:"wf-phase-desc",children:[d.agentCount," agent",d.agentCount===1?"":"s",d.models.length?` · ${d.models.map($).join(", ")}`:""]})]})]},k))})]}),t.completion&&s.jsxs("div",{className:"wf-result",children:[s.jsxs("h2",{children:["Returned result",t.completion.status&&s.jsx("span",{className:"tag task-status task-status-"+t.completion.status.toLowerCase(),children:t.completion.status})]}),t.completion.summary&&s.jsx("p",{className:"wf-result-summary",children:S(t.completion.summary)}),t.completion.result?s.jsx(ls,{raw:t.completion.result}):s.jsx("div",{className:"muted small",children:"Completed with no returned payload."}),t.completion.failures&&s.jsxs("details",{className:"wf-failures",children:[s.jsx("summary",{children:"failures"}),s.jsx("pre",{className:"code wf-result-body",children:S(t.completion.failures)})]})]}),u.length>0&&s.jsxs("details",{className:"wf-logs",open:u.length<=20,children:[s.jsxs("summary",{children:["Run log · ",u.length," line",u.length===1?"":"s"]}),s.jsx("ul",{className:"wf-log-list",children:u.map((d,k)=>s.jsx("li",{children:d},k))})]}),t.input_json?s.jsx("div",{className:"wf-result wf-launch",children:t.completion?s.jsxs("details",{children:[s.jsx("summary",{children:s.jsx("h2",{children:"Launch payload"})}),s.jsx(V,{raw:t.input_json})]}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Launch payload"}),a==="async_launched"&&s.jsx("p",{className:"wf-result-summary muted",children:"Launched asynchronously — results will appear here once the run reports back."}),s.jsx(V,{raw:t.input_json})]})}):!t.completion&&t.result_summary?s.jsxs("div",{className:"wf-result",children:[s.jsx("h2",{children:"Workflow launch"}),s.jsx("div",{className:"text md",children:s.jsx(K,{remarkPlugins:[q],children:t.result_summary})})]}):null,s.jsxs("div",{className:"subagents",children:[s.jsxs("h2",{children:["Agents (",t.agents.length,")"]}),t.agents.length===0?s.jsx("div",{className:"muted pad",role:"status",children:"No agent transcripts ingested for this run yet."}):s.jsx("ul",{children:t.agents.map(d=>s.jsx(cs,{a:d},d.id))})]})]})}export{hs as default};
|