skillar 0.0.0 → 0.2.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/LICENSE +22 -0
- package/README.md +193 -1
- package/dist/analysis/finding.js +190 -0
- package/dist/analysis/tree.js +157 -0
- package/dist/analysis/usage.js +394 -0
- package/dist/api/flows.js +285 -0
- package/dist/api/routes.js +192 -0
- package/dist/api/security.js +86 -0
- package/dist/api/sse.js +55 -0
- package/dist/api/static.js +33 -0
- package/dist/catalog/fields.js +159 -0
- package/dist/catalog/index.js +133 -0
- package/dist/catalog/scanner.js +204 -0
- package/dist/catalog/uri.js +43 -0
- package/dist/catalog/watcher.js +59 -0
- package/dist/cli/config-writer.js +255 -0
- package/dist/cli/doctor.js +268 -0
- package/dist/cli/eval.js +64 -0
- package/dist/cli/export-import.js +68 -0
- package/dist/cli/init.js +272 -0
- package/dist/cli/main.js +165 -0
- package/dist/cli/open.js +24 -0
- package/dist/cli/serve.js +147 -0
- package/dist/config.js +92 -0
- package/dist/dashboard/assets/app.js +354 -0
- package/dist/dashboard/assets/chunk-5DFWNJC2.js +1 -0
- package/dist/dashboard/assets/chunk-S6B2HJQA.js +17 -0
- package/dist/dashboard/assets/styles.css +542 -0
- package/dist/dashboard/index.html +15 -0
- package/dist/fs-watchdog.js +35 -0
- package/dist/herdr/client.js +205 -0
- package/dist/herdr/sync.js +342 -0
- package/dist/ingest/attribution.js +80 -0
- package/dist/ingest/hooks.js +168 -0
- package/dist/ingest/identity.js +4 -0
- package/dist/ingest/mcp-recorder.js +41 -0
- package/dist/ingest/otlp-traces.js +106 -0
- package/dist/ingest/otlp.js +314 -0
- package/dist/ingest/pipeline.js +119 -0
- package/dist/ingest/redact.js +36 -0
- package/dist/ingest/runtimes.js +25 -0
- package/dist/mcp/dispatch.js +54 -0
- package/dist/mcp/http.js +112 -0
- package/dist/mcp/legacy.js +61 -0
- package/dist/mcp/pagination.js +17 -0
- package/dist/mcp/protocol.js +121 -0
- package/dist/mcp/skills-extension.js +77 -0
- package/dist/mcp/stdio-proxy.js +108 -0
- package/dist/mcp/tools.js +59 -0
- package/dist/packs/claude-code.js +176 -0
- package/dist/packs/codex.js +207 -0
- package/dist/packs/cursor.js +97 -0
- package/dist/packs/gajae.js +7 -0
- package/dist/packs/gemini.js +90 -0
- package/dist/packs/json-config.js +55 -0
- package/dist/packs/omo.js +154 -0
- package/dist/packs/openclaw.js +132 -0
- package/dist/packs/registry.js +13 -0
- package/dist/search/fts.js +61 -0
- package/dist/search/fusion.js +50 -0
- package/dist/search/guidance.js +7 -0
- package/dist/search/index.js +74 -0
- package/dist/search/lexical.js +69 -0
- package/dist/server.js +267 -0
- package/dist/store/automation.js +18 -0
- package/dist/store/db.js +134 -0
- package/dist/store/execution.js +157 -0
- package/dist/store/export.js +269 -0
- package/dist/store/index.js +14 -0
- package/dist/store/migrations/002_tracing.sql +94 -0
- package/dist/store/migrations/003_tracing_indexes.sql +11 -0
- package/dist/store/migrations/004_load_reconciliation.sql +50 -0
- package/dist/store/migrations/005_execution_boundaries.sql +6 -0
- package/dist/store/migrations/006_recording_order.sql +72 -0
- package/dist/store/queries.js +643 -0
- package/dist/store/schema.sql +96 -0
- package/dist/store/workflow.js +250 -0
- package/dist/store/writes.js +315 -0
- package/dist/types.js +1 -0
- package/dist/version.js +19 -0
- package/dist/workflow/compare.js +68 -0
- package/dist/workflow/routes.js +100 -0
- package/dist/workflow/spec.js +40 -0
- package/docs/execution-ownership.md +98 -0
- package/docs/mcp-conformance.md +156 -0
- package/docs/skill-tracing.md +294 -0
- package/package.json +46 -3
- package/packs/claude-code/README.md +5 -0
- package/packs/claude-code/settings.template.json +34 -0
- package/packs/codex/README.md +8 -0
- package/packs/codex/config.template.toml +12 -0
- package/packs/cursor/hooks.example.json +8 -0
- package/packs/cursor/mcp.example.json +8 -0
- package/packs/gajae/extension/discovery.md +5 -0
- package/packs/gajae/extension/index.js +52 -0
- package/packs/gemini/settings.example.json +16 -0
- package/packs/hook-post.mjs +37 -0
- package/packs/omo/extension/discovery.md +5 -0
- package/packs/omo/extension/index.js +52 -0
- package/packs/openclaw/.codex-plugin/plugin.json +11 -0
- package/packs/openclaw/.mcp.json +12 -0
- package/packs/openclaw/hooks/skillar-discovery/HOOK.md +8 -0
- package/packs/openclaw/hooks/skillar-discovery/handler.js +30 -0
- package/packs/openclaw/index.mjs +55 -0
- package/packs/openclaw/openclaw.plugin.json +22 -0
- package/packs/openclaw/package.json +11 -0
- package/packs/openclaw/skillar.json +1 -0
- package/src/store/migrations/002_tracing.sql +94 -0
- package/src/store/migrations/003_tracing_indexes.sql +11 -0
- package/src/store/migrations/004_load_reconciliation.sql +50 -0
- package/src/store/migrations/005_execution_boundaries.sql +6 -0
- package/src/store/migrations/006_recording_order.sql +72 -0
- package/src/store/schema.sql +96 -0
- package/src/store/task-types.json +15 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
var je,$,on,Zs,oe,nn,ln,cn,_t,Ue,Le,dn,vt,ht,gt,ea,Oe={},We=[],ta=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ve=Array.isArray;function Z(e,t){for(var s in t)e[s]=t[s];return e}function kt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function na(e,t,s){var a,r,o,l={};for(o in t)o=="key"?a=t[o]:o=="ref"?r=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?je.call(arguments,2):s),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return Be(e,l,a,r,null)}function Be(e,t,s,a,r){var o={type:e,props:t,key:s,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++on,__i:-1,__u:0};return r==null&&$.vnode!=null&&$.vnode(o),o}function U(e){return e.children}function He(e,t){this.props=e,this.context=t}function ue(e,t){if(t==null)return e.__?ue(e.__,e.__i+1):null;for(var s;t<e.__k.length;t++)if((s=e.__k[t])!=null&&s.__e!=null)return s.__e;return typeof e.type=="function"?ue(e):null}function sa(e){if(e.__P&&e.__d){var t=e.__v,s=t.__e,a=[],r=[],o=Z({},t);o.__v=t.__v+1,$.vnode&&$.vnode(o),wt(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[s]:null,a,s??ue(t),!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,_n(a,o,r),t.__e=t.__=null,o.__e!=s&&un(o)}}function un(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),un(e)}function sn(e){(!e.__d&&(e.__d=!0)&&oe.push(e)&&!ze.__r++||nn!=$.debounceRendering)&&((nn=$.debounceRendering)||ln)(ze)}function ze(){try{for(var e,t=1;oe.length;)oe.length>t&&oe.sort(cn),e=oe.shift(),t=oe.length,sa(e)}finally{oe.length=ze.__r=0}}function pn(e,t,s,a,r,o,l,i,c,d,u){var m,p,_,v,L,w,h=a&&a.__k||We,b=t.length;for(c=aa(s,t,h,c,b),m=0;m<b;m++)(_=s.__k[m])!=null&&(p=_.__i!=-1&&h[_.__i]||Oe,_.__i=m,w=wt(e,_,p,r,o,l,i,c,d,u),v=_.__e,_.ref&&p.ref!=_.ref&&(p.ref&&bt(p.ref,null,_),u.push(_.ref,_.__c||v,_)),L==null&&v!=null&&(L=v),4&_.__u?(c=fn(_,c,e),p.__e&&(p.__e=null)):typeof _.type=="function"&&w!==void 0?c=w:v&&(c=v.nextSibling),_.__u&=-7);return s.__e=L,c}function aa(e,t,s,a,r){var o,l,i,c,d,u=s.length,m=u,p=0;for(e.__k=new Array(r),o=0;o<r;o++)(l=t[o])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[o]=Be(null,l,null,null,null):Ve(l)?l=e.__k[o]=Be(U,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[o]=Be(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,c=o+p,l.__=e,l.__b=e.__b+1,i=null,(d=l.__i=ra(l,s,c,m))!=-1&&(m--,(i=s[d])&&(i.__u|=2)),i==null||i.__v==null?(d==-1&&(r>u?p--:r<u&&p++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?p--:d==c+1?p++:(d>c?p--:p++,l.__u|=4))):e.__k[o]=null;if(m)for(o=0;o<u;o++)(i=s[o])!=null&&(2&i.__u)==0&&(i.__e==a&&(a=ue(i)),gn(i,i));return a}function fn(e,t,s){var a,r;if(typeof e.type=="function"){for(a=e.__k,r=0;a&&r<a.length;r++)a[r]&&(a[r].__=e,t=fn(a[r],t,s));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=ue(e)),t=s.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ra(e,t,s,a){var r,o,l,i=e.key,c=e.type,d=t[s],u=d!=null&&(2&d.__u)==0;if(d===null&&i==null||u&&i==d.key&&c==d.type)return s;if(a>(u?1:0)){for(r=s-1,o=s+1;r>=0||o<t.length;)if((d=t[l=r>=0?r--:o++])!=null&&(2&d.__u)==0&&i==d.key&&c==d.type)return l}return-1}function an(e,t,s){t[0]=="-"?e.setProperty(t,s??""):e[t]=s==null?"":typeof s!="number"||ta.test(t)?s:s+"px"}function Pe(e,t,s,a,r){var o,l;e:if(t=="style")if(typeof s=="string")e.style.cssText=s;else{if(typeof a=="string"&&(e.style.cssText=a=""),a)for(t in a)s&&t in s||an(e.style,t,"");if(s)for(t in s)a&&s[t]==a[t]||an(e.style,t,s[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(dn,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=s,s?a?s[Le]=a[Le]:(s[Le]=vt,e.addEventListener(t,o?gt:ht,o)):e.removeEventListener(t,o?gt:ht,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=s??"";break e}catch{}typeof s=="function"||(s==null||s===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&s==1?"":s))}}function rn(e){return function(t){if(this.l){var s=this.l[t.type+e];if(t[Ue]==null)t[Ue]=vt++;else if(t[Ue]<s[Le])return;return s($.event?$.event(t):t)}}}function wt(e,t,s,a,r,o,l,i,c,d){var u,m,p,_,v,L,w,h,b,R,I,P,H,g,C,F,A=t.type;if(t.constructor!==void 0)return null;128&s.__u&&(c=!!(32&s.__u),o=[i=t.__e=s.__e]),(u=$.__b)&&u(t);e:if(typeof A=="function"){m=l.length;try{if(b=t.props,R=A.prototype&&A.prototype.render,I=(u=A.contextType)&&a[u.__c],P=u?I?I.props.value:u.__:a,s.__c?h=(p=t.__c=s.__c).__=p.__E:(R?t.__c=p=new A(b,P):(t.__c=p=new He(b,P),p.constructor=A,p.render=ia),I&&I.sub(p),p.state||(p.state={}),p.__n=a,_=p.__d=!0,p.__h=[],p._sb=[]),R&&p.__s==null&&(p.__s=p.state),R&&A.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Z({},p.__s)),Z(p.__s,A.getDerivedStateFromProps(b,p.__s))),v=p.props,L=p.state,p.__v=t,_)R&&A.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),R&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(R&&A.getDerivedStateFromProps==null&&b!==v&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,P),t.__v==s.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,P)===!1){t.__v!=s.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=s.__e,t.__k=s.__k,t.__k.some(function(O){O&&(O.__=t)}),We.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&l.push(p),i=ue(s);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,P),R&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(v,L,w)})}if(p.context=P,p.props=b,p.__P=e,p.__e=!1,H=$.__r,g=0,R)p.state=p.__s,p.__d=!1,H&&H(t),u=p.render(p.props,p.state,p.context),We.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,H&&H(t),u=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++g<25);p.state=p.__s,p.getChildContext!=null&&(a=Z(Z({},a),p.getChildContext())),R&&!_&&p.getSnapshotBeforeUpdate!=null&&(w=p.getSnapshotBeforeUpdate(v,L)),C=u!=null&&u.type===U&&u.key==null?hn(u.props.children):u,i=pn(e,Ve(C)?C:[C],t,s,a,r,o,l,i,c,d),p.base=t.__e,t.__u&=-161,p.__h.length&&l.push(p),h&&(p.__E=p.__=null)}catch(O){if(l.length=m,t.__v=null,c||o!=null){if(O.then){for(t.__u|=c?160:128;i&&i.nodeType==8&&i.nextSibling;)i=i.nextSibling;o!=null&&(o[o.indexOf(i)]=null),t.__e=i}else if(o!=null)for(F=o.length;F--;)kt(o[F])}else t.__e=s.__e;t.__k==null&&(t.__k=s.__k||[]),O.then||mn(t),$.__e(O,t,s)}}else o==null&&t.__v==s.__v?(t.__k=s.__k,t.__e=s.__e):i=t.__e=oa(s.__e,t,s,a,r,o,l,c,d);return(u=$.diffed)&&u(t),128&t.__u?void 0:i}function mn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(mn))}function _n(e,t,s){for(var a=0;a<s.length;a++)bt(s[a],s[++a],s[++a]);$.__c&&$.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){$.__e(o,r.__v)}})}function hn(e){return typeof e!="object"||e==null||e.__b>0?e:Ve(e)?e.map(hn):e.constructor!==void 0?null:Z({},e)}function oa(e,t,s,a,r,o,l,i,c){var d,u,m,p,_,v,L,w=s.props||Oe,h=t.props,b=t.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((_=o[d])&&"setAttribute"in _==!!b&&(b?_.localName==b:_.nodeType==3)){e=_,o[d]=null;break}}if(e==null){if(b==null)return document.createTextNode(h);e=document.createElementNS(r,b,h.is&&h),i&&($.__m&&$.__m(t,o),i=!1),o=null}if(b==null)w===h||i&&e.data==h||(e.data=h);else{if(o=b=="textarea"&&h.defaultValue!=null?null:o&&je.call(e.childNodes),!i&&o!=null)for(w={},d=0;d<e.attributes.length;d++)w[(_=e.attributes[d]).name]=_.value;for(d in w)_=w[d],d=="dangerouslySetInnerHTML"?m=_:d=="children"||d in h||d=="value"&&"defaultValue"in h||d=="checked"&&"defaultChecked"in h||Pe(e,d,null,_,r);for(d in h)_=h[d],d=="children"?p=_:d=="dangerouslySetInnerHTML"?u=_:d=="value"?v=_:d=="checked"?L=_:i&&typeof _!="function"||w[d]===_||Pe(e,d,_,w[d],r);if(u)i||m&&(u.__html==m.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(m&&(e.innerHTML=""),pn(t.type=="template"?e.content:e,Ve(p)?p:[p],t,s,a,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,l,o?o[0]:s.__k&&ue(s,0),i,c),o!=null)for(d=o.length;d--;)kt(o[d]);i&&b!="textarea"||(d="value",b=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[d]||b=="progress"&&!v||b=="option"&&v!=w[d])&&Pe(e,d,v,w[d],r),d="checked",L!=null&&L!=e[d]&&Pe(e,d,L,w[d],r))}return e}function bt(e,t,s){try{if(typeof e=="function"){var a=typeof e.__u=="function";a&&e.__u(),a&&t==null||(e.__u=e(t))}else e.current=t}catch(r){$.__e(r,s)}}function gn(e,t,s){var a,r;if($.unmount&&$.unmount(e),(a=e.ref)&&(a.current&&a.current!=e.__e||bt(a,null,t)),(a=e.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(o){$.__e(o,t)}a.base=a.__P=a.__n=null}if(a=e.__k)for(r=0;r<a.length;r++)a[r]&&gn(a[r],t,s||typeof e.type!="function");s||kt(e.__e),e.__c=e.__=e.__e=void 0}function ia(e,t,s){return this.constructor(e,s)}function vn(e,t,s){var a,r,o,l;t==document&&(t=document.documentElement),$.__&&$.__(e,t),r=(a=typeof s=="function")?null:s&&s.__k||t.__k,o=[],l=[],wt(t,e=(!a&&s||t).__k=na(U,null,[e]),r||Oe,Oe,t.namespaceURI,!a&&s?[s]:r?null:t.firstChild?je.call(t.childNodes):null,o,!a&&s?s:r?r.__e:t.firstChild,a,l),_n(o,e,l),e.props.children=null}je=We.slice,$={__e:function(e,t,s,a){for(var r,o,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),l=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,a||{}),l=r.__d),l)return r.__E=r}catch(i){e=i}throw e}},on=0,Zs=function(e){return e!=null&&e.constructor===void 0},He.prototype.setState=function(e,t){var s;s=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Z({},this.state),typeof e=="function"&&(e=e(Z({},s),this.props)),e&&Z(s,e),e!=null&&this.__v&&(t&&this._sb.push(t),sn(this))},He.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),sn(this))},He.prototype.render=U,oe=[],ln=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cn=function(e,t){return e.__v.__b-t.__v.__b},ze.__r=0,_t=Math.random().toString(8),Ue="__d"+_t,Le="__a"+_t,dn=/(PointerCapture)$|Capture$/i,vt=0,ht=rn(!1),gt=rn(!0),ea=0;var Ee,B,yt,kn,Re=0,En=[],W=$,wn=W.__b,bn=W.__r,yn=W.diffed,xn=W.__c,Sn=W.unmount,Tn=W.__;function St(e,t){W.__h&&W.__h(B,e,Re||t),Re=0;var s=B.__H||(B.__H={__:[],__h:[]});return e>=s.__.length&&s.__.push({}),s.__[e]}function E(e){return Re=1,la(An,e)}function la(e,t,s){var a=St(Ee++,2);if(a.t=e,!a.__c&&(a.__=[s?s(t):An(void 0,t),function(i){var c=a.__N?a.__N[0]:a.__[0],d=a.t(c,i);c!==d&&(a.__N=[d,a.__[1]],a.__c.setState({}))}],a.__c=B,!B.__f)){var r=function(i,c,d){if(!a.__c.__H)return!0;var u=!1,m=a.__c.props!==i;if(a.__c.__H.__.some(function(_){if(_.__N){u=!0;var v=_.__[0];_.__=_.__N,_.__N=void 0,v!==_.__[0]&&(m=!0)}}),o){var p=o.call(this,i,c,d);return u?p||m:p}return!u||m};B.__f=!0;var o=B.shouldComponentUpdate,l=B.componentWillUpdate;B.componentWillUpdate=function(i,c,d){if(this.__e){var u=o;o=void 0,r(i,c,d),o=u}l&&l.call(this,i,c,d)},B.shouldComponentUpdate=r}return a.__N||a.__}function N(e,t){var s=St(Ee++,3);!W.__s&&Fn(s.__H,t)&&(s.__=e,s.u=t,B.__H.__h.push(s))}function Rn(e){return Re=5,q(function(){return{current:e}},[])}function q(e,t){var s=St(Ee++,7);return Fn(s.__H,t)&&(s.__=e(),s.__H=t,s.__h=e),s.__}function Cn(e,t){return Re=8,q(function(){return e},t)}function ca(){for(var e;e=En.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(qe),t.__h.some(xt),t.__h=[]}catch(s){t.__h=[],W.__e(s,e.__v)}}}W.__b=function(e){B=null,wn&&wn(e)},W.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Tn&&Tn(e,t)},W.__r=function(e){bn&&bn(e),Ee=0;var t=(B=e.__c).__H;t&&(yt===B?(t.__h=[],B.__h=[],t.__.some(function(s){s.__N&&(s.__=s.__N),s.u=s.__N=void 0})):(t.__h.some(qe),t.__h.some(xt),t.__h=[],Ee=0)),yt=B},W.diffed=function(e){yn&&yn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(En.push(t)!==1&&kn===W.requestAnimationFrame||((kn=W.requestAnimationFrame)||da)(ca)),t.__H.__.some(function(s){s.u&&(s.__H=s.u,s.u=void 0)})),yt=B=null},W.__c=function(e,t){t.some(function(s){try{s.__h.some(qe),s.__h=s.__h.filter(function(a){return!a.__||xt(a)})}catch(a){t.some(function(r){r.__h&&(r.__h=[])}),t=[],W.__e(a,s.__v)}}),xn&&xn(e,t)},W.unmount=function(e){Sn&&Sn(e);var t,s=e.__c;s&&s.__H&&(s.__H.__.some(function(a){try{qe(a)}catch(r){t=r}}),s.__H=void 0,t&&W.__e(t,s.__v))};var Ln=typeof requestAnimationFrame=="function";function da(e){var t,s=function(){clearTimeout(a),Ln&&cancelAnimationFrame(t),setTimeout(e)},a=setTimeout(s,35);Ln&&(t=requestAnimationFrame(s))}function qe(e){var t=B,s=e.__c;typeof s=="function"&&(e.__c=void 0,s()),B=t}function xt(e){var t=B;e.__c=e.__(),B=t}function Fn(e,t){return!e||e.length!==t.length||t.some(function(s,a){return s!==e[a]})}function An(e,t){return typeof t=="function"?t(e):t}var Fe=["claude-code","codex","gemini","cursor","omo","gajae","openclaw","unknown"],Ae=["loaded","exposed_only","no_match","aborted","not_used"],Ie=["from","to","runtime","skill","state","dow","hour","hourSpan","q","automated"],K={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini CLI",cursor:"Cursor",omo:"OmO",gajae:"Gajae Code",openclaw:"OpenClaw",unknown:"Unknown"},ee={"claude-code":"CC",codex:"CX",gemini:"GM",cursor:"CU",omo:"OM",gajae:"GJ",openclaw:"OC",unknown:"??"},G={loaded:"Loaded",exposed_only:"Exposed",no_match:"No match",aborted:"Aborted",not_used:"Not used"},Ke={loaded:"loaded: a skill was loaded in this session",exposed_only:"exposed_only: candidates were shown but none was loaded",no_match:"no_match: the search returned no candidate",aborted:"aborted: a load started but did not complete",not_used:"not_used: the session never searched for a skill"},Ge={runtime_id:"runtime id",vendor_meta:"vendor meta",trace_handle:"trace handle",window:"window",none:"unattributed"},te=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$n={reported:"reported",span_join:"joined",inferred_time:"inferred"},Mn={reported:"reported: the runtime reported the turn these events belong to",span_join:"joined: an OTel span joined these events to the turn",inferred_time:"inferred: the events fall inside the turn's time window"},Nn={reported:"reported",single:"single",co_active:"co-active",no_skill:"no skill"},Xe={found_top1:"top result used",found_lower:"lower result used",loaded_outside_results:"used outside results",native_without_search:"native, no search",searched_none_used:"searched, none used",no_search:"no search"},Ye={found_top1:"found_top1: the skill the turn used was the first search result",found_lower:"found_lower: the skill the turn used was a lower search result",loaded_outside_results:"loaded_outside_results: the skill the turn used was not among the search results",native_without_search:"native_without_search: the runtime activated a skill of its own without searching skillar",searched_none_used:"searched_none_used: the turn searched but used none of the results",no_search:"no_search: the turn neither searched nor used a skill"},Dn={matched:"matched",partial:"partial",different:"different",no_skill_used:"no skill used",not_run:"not run"},Pn={matched:"matched: the step's panes used what the spec intended",partial:"partial: a step that intends its skills together used some of them",different:"different: skills were used, none of them intended by the step",no_skill_used:"no_skill_used: the step's panes used no skill at all",not_run:"not_run: no pane was mapped to this step"},ua=new Set(Fe),pa=new Set(Ae);function pe(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function In(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%2F/gi,"/")}function fa(e){let t=e.startsWith("?")?e.slice(1):e;return t?t.split("&").filter(Boolean).map(s=>{let a=s.indexOf("=");return a<0?[pe(s),""]:[pe(s.slice(0,a)),s.slice(a+1)]}):[]}function Ce(e,t,s){let a=pe(e).trim();if(!/^-?\d+$/.test(a))return;let r=Number(a);return r>=t&&r<=s?r:void 0}function Tt(e){let t=new Set;for(let s of pe(e).split(",")){let a=s.trim();a&&t.add(a)}return[...t]}function ma(e){let t=typeof e=="string"?e:e.toString(),s={};for(let[a,r]of fa(t))switch(a){case"from":s.from=Ce(r,0,Number.MAX_SAFE_INTEGER);break;case"to":s.to=Ce(r,0,Number.MAX_SAFE_INTEGER);break;case"runtime":{let o=Tt(r).filter(l=>ua.has(l));o.length&&(s.runtime=o);break}case"skill":{let o=Tt(r);o.length&&(s.skill=o);break}case"state":{let o=Tt(r).filter(l=>pa.has(l));o.length&&(s.state=o);break}case"dow":s.dow=Ce(r,0,6);break;case"hour":s.hour=Ce(r,0,23);break;case"hourSpan":s.hourSpan=Ce(r,1,24);break;case"q":{let o=pe(r).trim();o&&(s.q=o);break}case"automated":{let o=pe(r).trim();(o==="include"||o==="only")&&(s.automated=o);break}default:break}for(let a of Ie)s[a]===void 0&&delete s[a];return s}function ne(e){let t=[];for(let s of Ie){let a=e[s];a!=null&&(Array.isArray(a)?a.length&&t.push(`${s}=${a.map(In).join(",")}`):typeof a=="number"?Number.isFinite(a)&&t.push(`${s}=${a}`):a.trim()&&t.push(`${s}=${In(a.trim())}`))}return t.join("&")}function he(e){return Ie.every(t=>e[t]===void 0)}function Un(e,t){let s={...e};return delete s[t],t==="hour"&&delete s.hourSpan,s}function Lt(e){let t=e.startsWith("#")?e.slice(1):e,s=t.indexOf("?"),a=(s>=0?t.slice(0,s):t).replace(/^\/+|\/+$/g,""),r=ma(s>=0?t.slice(s+1):""),o=a?a.split("/").map(pe):[];switch(o[0]){case"flow":return{view:"flow",filter:r};case"heatmap":return{view:"heatmap",filter:r};case"workspaces":return o[1]?{view:"workspace",flowId:o[1],filter:r}:{view:"workspaces",filter:r};case"sessions":return o[1]?{view:"trace",sessionId:o[1],filter:r}:{view:"sessions",filter:r};default:return{view:"sessions",filter:r}}}function z(e){let t=e.view==="trace"?`/sessions/${encodeURIComponent(e.sessionId??"")}`:e.view==="workspace"?`/workspaces/${encodeURIComponent(e.flowId??"")}`:`/${e.view}`,s=ne(e.filter);return`#${t}${s?`?${s}`:""}`}function Q(e){let t=e.replace(/\/SKILL\.md$/i,"").split("/").filter(Boolean);return t[t.length-1]??e}function Bn(e,t){if(e.automated!==void 0&&t.automated===void 0||t.automated==="only"&&e.automated===void 0||t.from!==void 0&&e.startedAt<t.from||t.to!==void 0&&e.startedAt>t.to||t.runtime&&!t.runtime.includes(e.runtime)||t.state&&!t.state.includes(e.state)||t.skill&&!t.skill.some(a=>e.skills.includes(a)))return!1;let s=new Date(e.startedAt);if(t.dow!==void 0&&s.getDay()!==t.dow)return!1;if(t.hour!==void 0){let a=t.hourSpan??1,r=s.getHours();if(r<t.hour||r>=t.hour+a)return!1}if(t.q){let a=t.q.toLowerCase();if(![e.firstPrompt??"",e.id,...e.skills.map(Q)].join(`
|
|
2
|
+
`).toLowerCase().includes(a))return!1}return!0}var _a=20,$e=class extends Error{constructor(s,a,r){super(r);this.status=s;this.code=a;this.name="ApiError"}status;code};function ie(e,t,s={}){let a=[ne(t)];for(let[o,l]of Object.entries(s))l!==void 0&&l!==""&&a.push(`${o}=${encodeURIComponent(String(l))}`);let r=a.filter(Boolean).join("&");return r?`${e}?${r}`:e}async function X(e,t){let s=await fetch(e,{credentials:"same-origin",...t,headers:{Accept:"application/json",...t?.headers??{}}});if(!s.ok){let a=`http_${s.status}`,r=`${t?.method??"GET"} ${e} failed with ${s.status}`;try{let o=await s.json();o.error&&(a=o.error),o.message&&(r=o.message)}catch{}throw s.status===401&&(r="this browser is not signed in to the dashboard. Run `skillar open` in a terminal to open it with a sign-in link."),new $e(s.status,a,r)}if(s.status!==204)return await s.json()}var ha={mode:"http",sessions:e=>X(ie("/api/sessions",e)),trace:e=>X(`/api/sessions/${encodeURIComponent(e)}/trace`),flow:(e,t={})=>X(ie("/api/flow",e,{unit:t.unit,top:t.top})),flows:(e={})=>X(ie("/api/flows",{},{from:e.from,to:e.to,limit:e.limit,automated:e.automated})),flowReport:(e,t={})=>X(ie(`/api/flows/${encodeURIComponent(e)}`,{},{automated:t.automated,from:t.from,to:t.to,limit:t.limit})),workflowVersions:e=>X(`/api/workflows/${encodeURIComponent(e)}/versions`),skillReport:(e,t={})=>X(ie(`/api/sessions/${encodeURIComponent(e)}/skill-report`,{},{automated:t.automated})),heatmap:(e,t={})=>X(ie("/api/heatmap",e,{tz:t.tz,weekStart:t.weekStart,bucket:t.bucket})),skillWeek:e=>X(ie("/api/skill-week",e)),stats:(e={})=>X(ie("/api/stats",e)),skills:()=>X("/api/skills"),addEvalCase:e=>X("/api/eval-cases",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),health:()=>X("/healthz"),events({onSession:e,onState:t}){t?.("connecting");let s=new EventSource("/api/events/stream");return s.addEventListener("session",a=>{try{e?.(JSON.parse(a.data))}catch{}}),s.onopen=()=>t?.("live"),s.onerror=()=>t?.(s.readyState===EventSource.CLOSED?"offline":"connecting"),()=>s.close()}};function ga(e=typeof location>"u"?"":location.search){let t=new URLSearchParams(e).get("fixtures");if(t!==null)return t==="12"?"twelve":t==="0"||t==="empty"||t==="none"?"empty":"full"}function va(e){let t,s=()=>t??=import("./chunk-S6B2HJQA.js").then(i=>i.default),a=async i=>i(await s()),r,o=()=>r??=import("./chunk-5DFWNJC2.js").then(i=>i.default),l=i=>{let c=new Set(i.sessions12);return e==="empty"?[]:e==="twelve"?i.sessions.filter(d=>c.has(d.id)):i.sessions};return{mode:"fixtures",sessions:i=>a(c=>l(c).filter(d=>Bn(d,i))),trace:i=>a(c=>c.traces[i]??[]),flows:(i={})=>Promise.resolve({generatedAt:Date.now(),from:i.from??null,to:i.to??null,limit:i.limit??_a,automated:i.automated??"exclude",flows:[],nextCursor:null}),flowReport:i=>Promise.reject(new $e(404,"flow_not_found",`no flow or herdr workspace ${i}`)),workflowVersions:()=>Promise.resolve([]),skillReport:i=>Promise.reject(new $e(404,"session_not_found",`no session ${i}`)),flow:(i,c={})=>a(d=>{let u=e==="twelve"?d.flow12:d.flow;return e==="empty"?{...u,nodes:[],links:[],sessionCount:0,unit:c.unit??u.unit}:{...u,unit:c.unit??u.unit}}),heatmap:()=>a(i=>{let c=e==="twelve"?i.heatmap12:i.heatmap;return e==="empty"?{...c,cells:[],rowTotals:c.rowTotals.map(()=>0),colTotals:c.colTotals.map(()=>0)}:c}),skillWeek:()=>a(i=>e==="empty"?{...i.skillWeek,rows:[]}:e==="twelve"?i.skillWeek12:i.skillWeek),stats:async()=>{let[i,c]=await Promise.all([s(),o()]);return e==="empty"?{...i.statsEmpty,...c.statsEmpty}:{...i.stats,...c.stats}},skills:()=>a(i=>i.skills),addEvalCase:()=>Promise.resolve(),health:()=>Promise.resolve({ok:!0,version:"fixtures"}),events({onState:i}){return i?.("fixtures"),()=>{}}}}var Hn=ga(),D=Hn?va(Hn):ha;function Me(e,t){let s;if(t===void 0)for(let a of e)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let r of e)(r=t(r,++a,e))!=null&&(s<r||s===void 0&&r>=r)&&(s=r)}return s}function Qe(e,t){let s;if(t===void 0)for(let a of e)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let r of e)(r=t(r,++a,e))!=null&&(s>r||s===void 0&&r>=r)&&(s=r)}return s}function ge(e,t){let s=0;if(t===void 0)for(let a of e)(a=+a)&&(s+=a);else{let a=-1;for(let r of e)(r=+t(r,++a,e))&&(s+=r)}return s}function Et(e,t){return e.sourceLinks.length?e.depth:t-1}function ve(e){return function(){return e}}function On(e,t){return Je(e.source,t.source)||e.index-t.index}function Wn(e,t){return Je(e.target,t.target)||e.index-t.index}function Je(e,t){return e.y0-t.y0}function Rt(e){return e.value}function ka(e){return e.index}function wa(e){return e.nodes}function ba(e){return e.links}function zn(e,t){let s=e.get(t);if(!s)throw new Error("missing: "+t);return s}function jn({nodes:e}){for(let t of e){let s=t.y0,a=s;for(let r of t.sourceLinks)r.y0=s+r.width/2,s+=r.width;for(let r of t.targetLinks)r.y1=a+r.width/2,a+=r.width}}function Ze(){let e=0,t=0,s=1,a=1,r=24,o=8,l,i=ka,c=Et,d,u,m=wa,p=ba,_=6;function v(){let f={nodes:m.apply(null,arguments),links:p.apply(null,arguments)};return L(f),w(f),h(f),b(f),P(f),jn(f),f}v.update=function(f){return jn(f),f},v.nodeId=function(f){return arguments.length?(i=typeof f=="function"?f:ve(f),v):i},v.nodeAlign=function(f){return arguments.length?(c=typeof f=="function"?f:ve(f),v):c},v.nodeSort=function(f){return arguments.length?(d=f,v):d},v.nodeWidth=function(f){return arguments.length?(r=+f,v):r},v.nodePadding=function(f){return arguments.length?(o=l=+f,v):o},v.nodes=function(f){return arguments.length?(m=typeof f=="function"?f:ve(f),v):m},v.links=function(f){return arguments.length?(p=typeof f=="function"?f:ve(f),v):p},v.linkSort=function(f){return arguments.length?(u=f,v):u},v.size=function(f){return arguments.length?(e=t=0,s=+f[0],a=+f[1],v):[s-e,a-t]},v.extent=function(f){return arguments.length?(e=+f[0][0],s=+f[1][0],t=+f[0][1],a=+f[1][1],v):[[e,t],[s,a]]},v.iterations=function(f){return arguments.length?(_=+f,v):_};function L({nodes:f,links:S}){for(let[x,k]of f.entries())k.index=x,k.sourceLinks=[],k.targetLinks=[];let y=new Map(f.map((x,k)=>[i(x,k,f),x]));for(let[x,k]of S.entries()){k.index=x;let{source:T,target:M}=k;typeof T!="object"&&(T=k.source=zn(y,T)),typeof M!="object"&&(M=k.target=zn(y,M)),T.sourceLinks.push(k),M.targetLinks.push(k)}if(u!=null)for(let{sourceLinks:x,targetLinks:k}of f)x.sort(u),k.sort(u)}function w({nodes:f}){for(let S of f)S.value=S.fixedValue===void 0?Math.max(ge(S.sourceLinks,Rt),ge(S.targetLinks,Rt)):S.fixedValue}function h({nodes:f}){let S=f.length,y=new Set(f),x=new Set,k=0;for(;y.size;){for(let T of y){T.depth=k;for(let{target:M}of T.sourceLinks)x.add(M)}if(++k>S)throw new Error("circular link");y=x,x=new Set}}function b({nodes:f}){let S=f.length,y=new Set(f),x=new Set,k=0;for(;y.size;){for(let T of y){T.height=k;for(let{source:M}of T.targetLinks)x.add(M)}if(++k>S)throw new Error("circular link");y=x,x=new Set}}function R({nodes:f}){let S=Me(f,k=>k.depth)+1,y=(s-e-r)/(S-1),x=new Array(S);for(let k of f){let T=Math.max(0,Math.min(S-1,Math.floor(c.call(null,k,S))));k.layer=T,k.x0=e+T*y,k.x1=k.x0+r,x[T]?x[T].push(k):x[T]=[k]}if(d)for(let k of x)k.sort(d);return x}function I(f){let S=Qe(f,y=>(a-t-(y.length-1)*l)/ge(y,Rt));for(let y of f){let x=t;for(let k of y){k.y0=x,k.y1=x+k.value*S,x=k.y1+l;for(let T of k.sourceLinks)T.width=T.value*S}x=(a-x+l)/(y.length+1);for(let k=0;k<y.length;++k){let T=y[k];T.y0+=x*(k+1),T.y1+=x*(k+1)}Y(y)}}function P(f){let S=R(f);l=Math.min(o,(a-t)/(Me(S,y=>y.length)-1)),I(S);for(let y=0;y<_;++y){let x=Math.pow(.99,y),k=Math.max(1-x,(y+1)/_);g(S,x,k),H(S,x,k)}}function H(f,S,y){for(let x=1,k=f.length;x<k;++x){let T=f[x];for(let M of T){let ye=0,de=0;for(let{source:Se,value:mt}of M.targetLinks){let Te=mt*(M.layer-Se.layer);ye+=j(Se,M)*Te,de+=Te}if(!(de>0))continue;let xe=(ye/de-M.y0)*S;M.y0+=xe,M.y1+=xe,O(M)}d===void 0&&T.sort(Je),C(T,y)}}function g(f,S,y){for(let x=f.length,k=x-2;k>=0;--k){let T=f[k];for(let M of T){let ye=0,de=0;for(let{target:Se,value:mt}of M.sourceLinks){let Te=mt*(Se.layer-M.layer);ye+=V(M,Se)*Te,de+=Te}if(!(de>0))continue;let xe=(ye/de-M.y0)*S;M.y0+=xe,M.y1+=xe,O(M)}d===void 0&&T.sort(Je),C(T,y)}}function C(f,S){let y=f.length>>1,x=f[y];A(f,x.y0-l,y-1,S),F(f,x.y1+l,y+1,S),A(f,a,f.length-1,S),F(f,t,0,S)}function F(f,S,y,x){for(;y<f.length;++y){let k=f[y],T=(S-k.y0)*x;T>1e-6&&(k.y0+=T,k.y1+=T),S=k.y1+l}}function A(f,S,y,x){for(;y>=0;--y){let k=f[y],T=(k.y1-S)*x;T>1e-6&&(k.y0-=T,k.y1-=T),S=k.y0-l}}function O({sourceLinks:f,targetLinks:S}){if(u===void 0){for(let{source:{sourceLinks:y}}of S)y.sort(Wn);for(let{target:{targetLinks:y}}of f)y.sort(On)}}function Y(f){if(u===void 0)for(let{sourceLinks:S,targetLinks:y}of f)S.sort(Wn),y.sort(On)}function j(f,S){let y=f.y0-(f.sourceLinks.length-1)*l/2;for(let{target:x,width:k}of f.sourceLinks){if(x===S)break;y+=k+l}for(let{source:x,width:k}of S.targetLinks){if(x===f)break;y-=k}return y}function V(f,S){let y=S.y0-(S.targetLinks.length-1)*l/2;for(let{source:x,width:k}of S.targetLinks){if(x===f)break;y+=k+l}for(let{target:x,width:k}of f.sourceLinks){if(x===S)break;y-=k}return y}return v}var Ct=Math.PI,Ft=2*Ct,fe=1e-6,ya=Ft-fe;function At(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Vn(){return new At}At.prototype=Vn.prototype={constructor:At,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,s,a){this._+="Q"+ +e+","+ +t+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(e,t,s,a,r,o){this._+="C"+ +e+","+ +t+","+ +s+","+ +a+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,s,a,r){e=+e,t=+t,s=+s,a=+a,r=+r;var o=this._x1,l=this._y1,i=s-e,c=a-t,d=o-e,u=l-t,m=d*d+u*u;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(m>fe)if(!(Math.abs(u*i-c*d)>fe)||!r)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var p=s-o,_=a-l,v=i*i+c*c,L=p*p+_*_,w=Math.sqrt(v),h=Math.sqrt(m),b=r*Math.tan((Ct-Math.acos((v+m-L)/(2*w*h)))/2),R=b/h,I=b/w;Math.abs(R-1)>fe&&(this._+="L"+(e+R*d)+","+(t+R*u)),this._+="A"+r+","+r+",0,0,"+ +(u*p>d*_)+","+(this._x1=e+I*i)+","+(this._y1=t+I*c)}},arc:function(e,t,s,a,r,o){e=+e,t=+t,s=+s,o=!!o;var l=s*Math.cos(a),i=s*Math.sin(a),c=e+l,d=t+i,u=1^o,m=o?a-r:r-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+c+","+d:(Math.abs(this._x1-c)>fe||Math.abs(this._y1-d)>fe)&&(this._+="L"+c+","+d),s&&(m<0&&(m=m%Ft+Ft),m>ya?this._+="A"+s+","+s+",0,1,"+u+","+(e-l)+","+(t-i)+"A"+s+","+s+",0,1,"+u+","+(this._x1=c)+","+(this._y1=d):m>fe&&(this._+="A"+s+","+s+",0,"+ +(m>=Ct)+","+u+","+(this._x1=e+s*Math.cos(r))+","+(this._y1=t+s*Math.sin(r))))},rect:function(e,t,s,a){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};var It=Vn;function $t(e){return function(){return e}}function qn(e){return e[0]}function Kn(e){return e[1]}var Gn=Array.prototype.slice;function xa(e){return e.source}function Sa(e){return e.target}function Ta(e){var t=xa,s=Sa,a=qn,r=Kn,o=null;function l(){var i,c=Gn.call(arguments),d=t.apply(this,c),u=s.apply(this,c);if(o||(o=i=It()),e(o,+a.apply(this,(c[0]=d,c)),+r.apply(this,c),+a.apply(this,(c[0]=u,c)),+r.apply(this,c)),i)return o=null,i+""||null}return l.source=function(i){return arguments.length?(t=i,l):t},l.target=function(i){return arguments.length?(s=i,l):s},l.x=function(i){return arguments.length?(a=typeof i=="function"?i:$t(+i),l):a},l.y=function(i){return arguments.length?(r=typeof i=="function"?i:$t(+i),l):r},l.context=function(i){return arguments.length?(o=i??null,l):o},l}function La(e,t,s,a,r){e.moveTo(t,s),e.bezierCurveTo(t=(t+a)/2,s,t,r,a,r)}function Mt(){return Ta(La)}function Ea(e){return[e.source.x1,e.y0]}function Ra(e){return[e.target.x0,e.y1]}function Nt(){return Mt().source(Ea).target(Ra)}var Ca=0;function n(e,t,s,a,r,o){t||(t={});var l,i,c=t;if("ref"in c)for(i in c={},t)i=="ref"?l=t[i]:c[i]=t[i];var d={type:e,props:c,key:s,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ca,__i:-1,__u:0,__source:r,__self:o};if(typeof e=="function"&&(l=e.defaultProps))for(i in l)c[i]===void 0&&(c[i]=l[i]);return $.vnode&&$.vnode(d),d}var Dt={task_type:"Task type",skill:"Skill",state:"Outcome"},nt=new Set(["loaded","exposed_only","no_match","aborted","not_used"]),tt=10,Yn=24,Fa=320,Aa=600,Ia=640,ke=6,et=12,$a=80;function be(e){let t=e.id.indexOf(":");return t<0?e.id:e.id.slice(t+1)}function we(e){let t=be(e);return e.column===2&&nt.has(t)?G[t]:e.label}function Pt(e,t){return t>0?e/t:0}function me(e,t){let s=Pt(e,t)*100;return`${s>0&&s<1?"<1":Math.round(s)}%`}var Xn=new Set;function se(e,t){if(typeof document>"u"||Xn.has(e))return;if(Xn.add(e),"adoptedStyleSheets"in document&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype){let a=new CSSStyleSheet;a.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];return}let s=document.createElement("style");s.dataset.sheet=e,s.textContent=t,document.head.append(s)}function Ma(e,t){let{width:s,height:a,top:r=0,nodeWidth:o=tt,nodePadding:l=14}=t,i=new Set(e.nodes.map(h=>h.id)),c=[];e.links.forEach((h,b)=>{i.has(h.source)&&i.has(h.target)&&h.count>0&&c.push({source:h.source,target:h.target,value:h.count,index:b,count:h.count,state:h.state})});let d=new Set;for(let h of c)d.add(h.source),d.add(h.target);let u=e.nodes.filter(h=>d.has(h.id)).map(h=>({...h}));if(!u.length||s<=o||a<=r)return{nodes:[],links:[]};let p=Ze().nodeId(h=>h.id).nodeAlign(h=>h.column).nodeSort((h,b)=>+!!h.other-+!!b.other||(b.value??0)-(h.value??0)||h.label.localeCompare(b.label)).nodeWidth(o).nodePadding(l).extent([[0,r],[s,a]])({nodes:u,links:c}),_=Nt(),v=p.nodes.map(h=>({id:h.id,column:h.column,label:h.label,count:h.count,...h.other?{other:!0}:{},x0:h.x0??0,x1:h.x1??0,y0:h.y0??0,y1:h.y1??0,value:h.value??0})).sort((h,b)=>h.column-b.column||h.y0-b.y0),L=new Map(v.map(h=>[h.id,h.column])),w=p.links.map(h=>{let b=h.source,R=h.target;return{source:b.id,target:R.id,count:h.count,state:h.state,index:h.index,width:h.width??0,y0:h.y0??0,y1:h.y1??0,path:_(h)??""}}).sort((h,b)=>(L.get(h.source)??0)-(L.get(b.source)??0)||h.y0-b.y0);return{nodes:v,links:w}}function Na(e,t){let s=new Map(e.nodes.map(u=>[u.id,u.column])),a=e.links.map((u,m)=>({...u,index:m})),r=a.filter(u=>s.get(u.source)===0),o=a.filter(u=>s.get(u.source)===1),l=new Set,i=u=>{for(let m of o)m.source===u.target&&m.state===u.state&&l.add(m.index)},c=u=>{for(let m of r)m.target===u.source&&m.state===u.state&&l.add(m.index)};if(t.kind==="link"){let u=a[t.index];u&&(l.add(u.index),s.get(u.source)===0?i(u):c(u))}else{let{id:u,column:m}=t.node;if(m===0)for(let p of r)p.source===u&&(l.add(p.index),i(p));else if(m===1)for(let p of a)(p.source===u||p.target===u)&&l.add(p.index);else for(let p of o)p.target===u&&(l.add(p.index),c(p))}let d=new Set;t.kind==="node"&&d.add(t.node.id);for(let u of l)d.add(a[u].source),d.add(a[u].target);return{links:l,nodes:d}}function Da(e,t){let s=[0,0,0];for(let r of e.nodes)s[r.column]=(s[r.column]??0)+1;let a=Math.max(1,...s);return Math.min(Aa,Math.max(Fa,Yn+8+a*(t?34:44)))}function Pa(e,t){return e.length>t?`${e.slice(0,Math.max(1,t-1))}\u2026`:e}function Ua(e,t){if(t.kind==="node"){let{node:r}=t;return{title:we(r),sub:`${r.count} ${r.count===1?"session":"sessions"} \xB7 ${me(r.count,e.sessionCount)}`}}let s=new Map(e.nodes.map(r=>[r.id,we(r)])),{link:a}=t;return{title:`${s.get(a.source)??a.source} \u2192 ${s.get(a.target)??a.target}`,sub:`${G[a.state]??a.state} \xB7 ${a.count} ${a.count===1?"session":"sessions"} \xB7 ${me(a.count,e.sessionCount)}`}}var Ba=`
|
|
3
|
+
.sankey { position: relative; }
|
|
4
|
+
.sankey__svg { display: block; overflow: visible; font: 500 var(--fs-cap) / 1 var(--font-sans); }
|
|
5
|
+
.sankey__svg.is-narrow { font-size: var(--fs-micro); }
|
|
6
|
+
.sankey__head { fill: var(--ink-3); font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
|
|
7
|
+
.sankey__link { fill: none; stroke: var(--neutral); stroke-opacity: 0.38; transition: stroke-opacity var(--t-micro); }
|
|
8
|
+
.sankey__link.is-loaded { stroke: var(--ok); }
|
|
9
|
+
.sankey__link.is-exposed_only { stroke: var(--warn); }
|
|
10
|
+
.sankey__link.is-no_match { stroke: var(--bad); }
|
|
11
|
+
.sankey__link.is-aborted, .sankey__link.is-not_used { stroke: var(--neutral); }
|
|
12
|
+
.sankey__svg.is-hovering .sankey__link:not(.is-on) { stroke-opacity: 0.1; }
|
|
13
|
+
.sankey__svg.is-hovering .sankey__link.is-on { stroke-opacity: 0.72; }
|
|
14
|
+
.sankey__node { transition: opacity var(--t-micro); }
|
|
15
|
+
.sankey__svg.is-hovering .sankey__node:not(.is-on) { opacity: 0.35; }
|
|
16
|
+
.sankey__rect { fill: var(--ink-2); }
|
|
17
|
+
.sankey__node.is-other .sankey__rect { fill: var(--ink-3); }
|
|
18
|
+
.sankey__node.is-c2.is-loaded .sankey__rect { fill: var(--ok); }
|
|
19
|
+
.sankey__node.is-c2.is-exposed_only .sankey__rect { fill: var(--warn); }
|
|
20
|
+
.sankey__node.is-c2.is-no_match .sankey__rect { fill: var(--bad); }
|
|
21
|
+
.sankey__node.is-c2.is-aborted .sankey__rect, .sankey__node.is-c2.is-not_used .sankey__rect { fill: var(--neutral); }
|
|
22
|
+
.sankey__label { fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; dominant-baseline: central; pointer-events: none; }
|
|
23
|
+
.sankey__label--end, .sankey__head--end { text-anchor: end; }
|
|
24
|
+
.sankey__head--mid { text-anchor: middle; }
|
|
25
|
+
.sankey__count { fill: var(--ink-3); font-variant-numeric: tabular-nums; }
|
|
26
|
+
.sankey a, .sankey [role="button"] { cursor: pointer; outline: none; }
|
|
27
|
+
.sankey a:focus-visible .sankey__rect, .sankey [role="button"]:focus-visible .sankey__rect { stroke: var(--accent); stroke-width: 2px; }
|
|
28
|
+
.sankey a:focus-visible .sankey__link { stroke-opacity: 0.85; }
|
|
29
|
+
.sankey__tip { position: absolute; z-index: 2; max-width: 32ch; padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); background: var(--ink); color: var(--bg); font-size: var(--fs-cap); font-weight: 500; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow-pop); pointer-events: none; }
|
|
30
|
+
.sankey__tip-sub { opacity: 0.75; font-variant-numeric: tabular-nums; }
|
|
31
|
+
`;se("sankey",Ba);function Ha(e){return e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey}function Qn({dto:e,hrefFor:t,onActivate:s,onExpandOther:a}){let r=Rn(null),[o,l]=E(0),[i,c]=E();N(()=>{let g=r.current;if(!g)return;let C=()=>l(Math.floor(g.getBoundingClientRect().width));C();let F=new ResizeObserver(C);return F.observe(g),()=>F.disconnect()},[]);let d=o<Ia,u=Da(e,d),m=d?o-$a:o,p=q(()=>Ma(e,{width:m,height:u,top:Yn,nodeWidth:tt,nodePadding:d?10:14}),[e,m,u,d]),_=q(()=>i?Na(e,i.target):void 0,[e,i?.target]),v=q(()=>new Map(p.nodes.map(g=>[g.id,g])),[p]),L=(m-3*tt)/2,w=Math.max(8,Math.min(24,Math.floor(d?(L*.95-22)/6.2:(L*.5-24)/7))),h=g=>g.column===2&&!d,b=g=>{let C=r.current?.getBoundingClientRect();return{x:g.clientX-(C?.left??0),y:g.clientY-(C?.top??0)}},R=(g,C)=>({onPointerEnter:F=>c({target:g,...b(F)}),onPointerMove:F=>c({target:g,...b(F)}),onPointerLeave:()=>c(void 0),onFocus:()=>c({target:g,...C}),onBlur:()=>c(void 0)}),I=g=>C=>{Ha(C)&&(C.preventDefault(),s(g))},P=i?Ua(e,i.target):void 0,H=i?i.x>o/2:!1;return n("div",{class:"sankey",ref:r,style:{minHeight:`${u}px`},children:[p.nodes.length>0&&n("svg",{class:`sankey__svg${d?" is-narrow":""}${i?" is-hovering":""}`,width:o,height:u,viewBox:`0 0 ${o} ${u}`,role:"group","aria-label":`Flow of ${e.sessionCount} sessions from task type to skill to outcome`,children:[n("g",{"aria-hidden":"true",children:[n("text",{class:"sankey__head",x:0,y:10,children:Dt[e.columns[0]]}),n("text",{class:"sankey__head sankey__head--mid",x:m/2,y:10,children:Dt[e.columns[1]]}),n("text",{class:d?"sankey__head":"sankey__head sankey__head--end",x:d?m-tt:m,y:10,children:Dt[e.columns[2]]})]}),n("g",{children:p.links.map(g=>{let C={kind:"link",link:g,index:g.index},F=t(C),A=v.get(g.source),O=v.get(g.target),Y=!_||_.links.has(g.index),j=n("path",{class:`sankey__link is-${g.state}${Y?" is-on":""}`,d:g.path,"stroke-width":Math.max(1,g.width)}),V=`${A?we(A):g.source} to ${O?we(O):g.target}, ${G[g.state]??g.state}: ${g.count} sessions (${me(g.count,e.sessionCount)})`,f=R(C,{x:((A?.x1??0)+(O?.x0??m))/2,y:(g.y0+g.y1)/2});return F?n("a",{href:F,"aria-label":V,onClick:I(C),...f,children:j},`l${g.index}`):n("g",{...f,children:j},`l${g.index}`)})}),n("g",{children:p.nodes.map(g=>{let C={kind:"node",node:g},F=t(C),A=!!(g.other&&a),O=!_||_.nodes.has(g.id),Y=be(g),j=`sankey__node is-c${g.column}${g.other?" is-other":""}${g.column===2&&nt.has(Y)?` is-${Y}`:""}${O?" is-on":""}`,V=h(g),f=n(U,{children:[n("rect",{class:"sankey__rect",x:g.x0,y:g.y0,width:g.x1-g.x0,height:Math.max(1,g.y1-g.y0),rx:2}),n("text",{class:`sankey__label${V?" sankey__label--end":""}`,x:V?g.x0-ke:g.x1+ke,y:(g.y0+g.y1)/2,children:[V?n("tspan",{class:"sankey__count",children:g.count}):null,n("tspan",{dx:V?ke:0,children:Pa(we(g),w)}),V?null:n("tspan",{class:"sankey__count",dx:ke,children:g.count})]})]}),S=`${we(g)}: ${g.count} sessions (${me(g.count,e.sessionCount)})`,y=R(C,{x:V?g.x0-ke:g.x1+ke,y:(g.y0+g.y1)/2});return F?n("a",{class:j,href:F,"aria-label":S,onClick:I(C),...y,children:f},g.id):A?n("g",{class:j,role:"button",tabindex:0,"aria-label":`${g.label}: show up to 15 per column`,onClick:()=>a?.(),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a?.())},...y,children:f},g.id):n("g",{class:j,...y,children:f},g.id)})})]}),i&&P&&n("div",{class:"sankey__tip",role:"status",style:H?{right:`${o-i.x+et}px`,top:`${i.y+et}px`}:{left:`${i.x+et}px`,top:`${i.y+et}px`},children:[n("div",{children:P.title}),n("div",{class:"sankey__tip-sub",children:P.sub})]})]})}var Oa=30,st=7,Jn=15,Wa={first_load:"First load",all_loads:"All loads"},za=300;function ja(e){return e<Oa?"table":"chart"}function Va(e){return e==="first_load"?"Band width = sessions (unit: first loaded skill)":"Band width = skill loads (unit: all loaded skills)"}function qa(e){let t=new Map;for(let s of e)t.set(s.name,s.uri),t.set(s.dir,s.uri),t.set(Q(s.uri),s.uri);return s=>s.startsWith("skill://")?s:t.get(s)}function at(e,t){if(!(!e||e.column!==1||e.other))return t(be(e))}function Ut(e,t,s){if(e.kind==="node"){let{node:o}=e;if(o.other||o.column===0)return;if(o.column===1){let i=at(o,s);return i?{skill:[i]}:void 0}let l=be(o);return nt.has(l)?{state:[l]}:void 0}let a=new Map(t.map(o=>[o.id,o])),r=at(a.get(e.link.source),s)??at(a.get(e.link.target),s);return{...r?{skill:[r]}:{},state:[e.link.state]}}function Bt(e,t){return{view:"sessions",filter:{...e.filter,...t}}}function Ka(e){let t=new Map(e.nodes.map(a=>[a.id,a])),s=[];return e.links.forEach((a,r)=>{let o=t.get(a.source),l=t.get(a.target);!o||!l||o.column!==0||l.column!==1||s.push({index:r,task:o.label,skill:l.label,skillNode:l,state:a.state,count:a.count,share:Pt(a.count,e.sessionCount)})}),s.sort((a,r)=>r.count-a.count||a.task.localeCompare(r.task)||a.skill.localeCompare(r.skill)||a.state.localeCompare(r.state))}var Ga=`
|
|
32
|
+
.flow__legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-3); color: var(--ink-2); font-size: var(--fs-cap); }
|
|
33
|
+
.flow__key { display: inline-flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
|
|
34
|
+
.flow__swatch { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; }
|
|
35
|
+
.flow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
|
|
36
|
+
.flow__dot.is-loaded { background: var(--ok); }
|
|
37
|
+
.flow__dot.is-exposed_only { background: var(--warn); }
|
|
38
|
+
.flow__dot.is-no_match { background: var(--bad); }
|
|
39
|
+
.flow__chart { padding: var(--s-4); }
|
|
40
|
+
.flow__paths { overflow-x: auto; }
|
|
41
|
+
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
|
|
42
|
+
.seg__btn { height: 30px; padding: 0 var(--s-3); border: 0; background: transparent; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; transition: background-color var(--t-micro), color var(--t-micro); }
|
|
43
|
+
.seg__btn + .seg__btn { border-left: 1px solid var(--line-2); }
|
|
44
|
+
.seg__btn:hover { background: var(--wash); color: var(--ink); }
|
|
45
|
+
.seg__btn[aria-pressed="true"] { background: var(--wash-2); color: var(--ink); }
|
|
46
|
+
.seg__btn:focus-visible { outline-offset: -2px; }
|
|
47
|
+
.paths { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
|
48
|
+
.paths th { text-align: left; padding: var(--s-2) var(--s-3); color: var(--ink-3); font-size: var(--fs-cap); font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
|
|
49
|
+
.paths td { padding: var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
|
|
50
|
+
.paths tbody tr { cursor: pointer; transition: background-color var(--t-micro); }
|
|
51
|
+
.paths tbody tr:hover, .paths tbody tr:has(a:focus-visible) { background: var(--wash); }
|
|
52
|
+
.paths tbody tr:last-child td { border-bottom: 0; }
|
|
53
|
+
.paths__hint { margin-inline-start: var(--s-2); font-weight: 400; }
|
|
54
|
+
.paths__path { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
|
|
55
|
+
.paths__task { color: var(--ink-2); }
|
|
56
|
+
.paths__arrow { color: var(--ink-3); }
|
|
57
|
+
.paths__skill { color: var(--ink); font-weight: 500; text-decoration: none; }
|
|
58
|
+
.paths__skill:hover { color: var(--ink); text-decoration: underline; }
|
|
59
|
+
.paths__skill--dim { color: var(--ink-3); font-weight: 400; }
|
|
60
|
+
.paths .num { width: 1%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
61
|
+
.paths__share { display: inline-block; min-width: 4.5rem; padding: 2px var(--s-2); border-radius: var(--r-sm); background: linear-gradient(to right, var(--wash-2) var(--share, 0%), transparent 0); }
|
|
62
|
+
@media (max-width: 639.98px) {
|
|
63
|
+
.paths__hint { display: none; }
|
|
64
|
+
.paths th:first-child { white-space: normal; }
|
|
65
|
+
.paths__share { display: block; min-width: 0; }
|
|
66
|
+
}
|
|
67
|
+
`;se("flow",Ga);function Zn({label:e,value:t,options:s,onChange:a}){return n("div",{class:"seg",role:"group","aria-label":e,children:s.map(r=>n("button",{type:"button",class:"seg__btn","aria-pressed":r.value===t,onClick:()=>a(r.value),children:r.label},r.value))})}function Xa({unit:e,withKey:t}){return n("p",{class:"flow__legend",children:[n("span",{children:t?Va(e):`Share = sessions on the path / sessions in range (unit: ${e==="first_load"?"first loaded skill":"all loaded skills"})`}),t&&n("span",{class:"flow__key","aria-label":"Band color",children:Ae.map(s=>n("span",{class:"flow__swatch",children:[n("i",{class:`flow__dot is-${s}`,"aria-hidden":"true"}),G[s]]},s))})]})}function Ya(e){return e instanceof Element&&e.closest("a, button")!==null}function Qa({dto:e,route:t,navigate:s,resolve:a}){let r=Ka(e);return n("div",{class:"card flow__paths",children:n("table",{class:"paths",children:[n("thead",{children:n("tr",{children:[n("th",{scope:"col",children:["Path",n("span",{class:"paths__hint",children:["task type ","\u2192"," skill ","\u2192"," outcome"]})]}),n("th",{scope:"col",class:"num",children:"Sessions"}),n("th",{scope:"col",class:"num",children:"Share"})]})}),n("tbody",{children:r.map(o=>{let l=e.links[o.index],i=Bt(t,Ut({kind:"link",link:l,index:o.index},e.nodes,a)??{state:[o.state]}),c=z(i),d=at(o.skillNode,a)!==void 0;return n("tr",{onClick:u=>{Ya(u.target)||s(i)},children:[n("td",{children:n("span",{class:"paths__path",children:[n("span",{class:"paths__task",children:o.task}),n("span",{class:"paths__arrow","aria-hidden":"true",children:"\u2192"}),n("a",{class:d?"paths__skill":"paths__skill paths__skill--dim",href:c,title:d?be(o.skillNode):void 0,children:o.skill}),n("span",{class:"paths__arrow","aria-hidden":"true",children:"\u2192"}),n("span",{class:`badge badge--${o.state}`,children:G[o.state]??o.state})]})}),n("td",{class:"num",children:o.count}),n("td",{class:"num",children:n("span",{class:"paths__share",style:{"--share":me(o.count,e.sessionCount)},children:me(o.count,e.sessionCount)})})]},o.index)})})]})})}function Ja({route:e,navigate:t}){let s=!he(e.filter);return n("section",{class:"empty",children:[n("h2",{children:"No sessions in this range"}),n("p",{children:s?"No session matches these filters, so there is no flow to draw.":"Start a session in a connected runtime and the task-to-skill flow appears here."}),s&&n("button",{type:"button",class:"btn",onClick:()=>t({...e,filter:{}}),children:"Clear filters"})]})}function es({route:e,navigate:t,live:s}){let a=ne(e.filter),[r,o]=E("first_load"),[l,i]=E(st),[c,d]=E("auto"),[u,m]=E(),[p,_]=E([]),[v,L]=E(0),[w,h]=E(),[b,R]=E(0);N(()=>{if(s.seq===0)return;let F=setTimeout(()=>R(A=>A+1),za);return()=>clearTimeout(F)},[s.seq]),N(()=>{let F=!1;return Promise.allSettled([D.flow(e.filter,{unit:r,top:l}),D.skills(),D.stats(e.filter)]).then(([A,O,Y])=>{if(F)return;let j=[A,O,Y].find(V=>V.status==="rejected")?.reason;if(j!==void 0){h(j instanceof Error?j.message:String(j));return}m(A.value),_(O.value),L(Y.value.unattributed?.loads??0),h(void 0)}),()=>{F=!0}},[a,r,l,b]);let I=q(()=>qa(p),[p]),P=c==="auto"?ja(u?.sessionCount??0):c,H=F=>{let A=u&&Ut(F,u.nodes,I);return A?z(Bt(e,A)):void 0},g=F=>{let A=u&&Ut(F,u.nodes,I);A&&t(Bt(e,A))},C;return u===void 0?C=null:u.sessionCount===0?C=n(Ja,{route:e,navigate:t}):C=n(U,{children:[n("div",{class:"toolbar",children:[n(Zn,{label:"View",value:P,options:[{value:"chart",label:"Chart"},{value:"table",label:"Top paths"}],onChange:d}),n(Zn,{label:"Unit",value:r,options:["first_load","all_loads"].map(F=>({value:F,label:Wa[F]})),onChange:o}),l!==st&&n("button",{type:"button",class:"btn",onClick:()=>i(st),children:["Top ",st," per column"]}),n("span",{class:"toolbar__count",children:[u.sessionCount," ",u.sessionCount===1?"session":"sessions",v>0&&n("span",{title:"MCP loads no session could be matched to; they are stored but not drawn in the flow",children:` \xB7 ${v} unattributed ${v===1?"load":"loads"} not shown`})]})]}),n(Xa,{unit:r,withKey:P==="chart"}),P==="chart"?n("div",{class:"card flow__chart",children:n(Qn,{dto:u,hrefFor:H,onActivate:g,onExpandOther:l<Jn?()=>i(Jn):void 0})}):n(Qa,{dto:u,route:e,navigate:t,resolve:I})]}),n("section",{"aria-busy":u===void 0&&!w,"data-mode":u?P:void 0,"data-top":l,"data-unit":r,children:[w&&n("p",{class:"notice",role:"alert",children:["Could not load the flow: ",w]}),C]})}var ss=[1,2,4],ot=50,Za=5,Ot=864e5,er=7*Ot;function tr(e){return e===1||e===2||e===4}function Ne(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:0}function le(e){return e.reduce((t,s)=>t+s,0)}function rt(e,t){return t>0?Math.min(1,e/t):0}function as(e){let t=[...e].map(Ne).filter(i=>i>0).sort((i,c)=>i-c);if(t.length===0)return()=>0;let s=t[t.length-1],a=i=>t[Math.max(0,Math.ceil(i*t.length)-1)],r=a(.25),o=a(.5),l=a(.75);return i=>{let c=Ne(i);return c===0?0:c>=s?4:c<=r?1:c<=o?2:c<=l?3:4}}function zt(e,t){let s=Array.from({length:Za},()=>{});s[0]=[0,0];for(let a=1;a<=Math.max(0,Math.trunc(t));a++){let r=e(a),o=s[r];o?o[1]=a:s[r]=[a,a]}return s.map(a=>a?a[0]===a[1]?String(a[0]):`${a[0]}-${a[1]}`:"-")}function rs(e,t={}){let s=tr(e.bucketHours)?e.bucketHours:1,a=t.bucketHours??s,r=a<s?s:a,o=t.weekStart??(e.weekStart===0?0:1),l=24/r,i=Array.from({length:7},()=>new Array(l).fill(0));for(let w of e.cells??[]){let h=Math.trunc(Number(w.dow)),b=Math.trunc(Number(w.hour)),R=Ne(w.count);!(h>=0&&h<7&&b>=0&&b<24)||R===0||(i[h][Math.floor(b/r)]+=R)}let c=Array.from({length:7},(w,h)=>(o+h)%7),d=Array.from({length:l},(w,h)=>h*r),u=c.map(w=>le(i[w])),m=d.map((w,h)=>le(i.map(b=>b[h]))),p=le(u),_=i.flat(),v=as(_),L=c.map(w=>d.map((h,b)=>{let R=i[w][b];return{dow:w,hour:h,count:R,share:p>0?R/p:0,level:v(R)}}));return{bucketHours:r,weekStart:o,dows:c,hours:d,rows:L,rowTotals:u,colTotals:m,total:p,maxCount:Math.max(0,..._),maxRowTotal:Math.max(0,...u),maxColTotal:Math.max(0,...m),level:v}}function os(e){return le((e.cells??[]).map(t=>Ne(t.count)))}function is(e,t=!1){return t||e<ot?2:1}function ls(e){let t=Array.isArray(e.weeks)?e.weeks.map(String):[],s=(e.rows??[]).map(i=>{let c=t.map((d,u)=>Ne(i.counts?.[u]));return{uri:i.uri,name:i.name||nr(i.uri),counts:c,total:le(c)}}).filter(i=>i.total>0);s.sort((i,c)=>c.total-i.total);let a=s.flatMap(i=>i.counts),r=as(a),o=s.map(i=>({...i,levels:i.counts.map(r)})),l=t.map((i,c)=>le(o.map(d=>d.counts[c])));return{weeks:t,rows:o,colTotals:l,total:le(l),maxCount:Math.max(0,...a),maxRowTotal:Math.max(0,...o.map(i=>i.total)),maxColTotal:Math.max(0,...l),level:r}}function nr(e){let t=e.replace(/\/SKILL\.md$/i,"").split("/").filter(Boolean);return t[t.length-1]??e}function cs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function ds(e=typeof navigator>"u"?void 0:navigator.language){if(!e)return 1;try{return new Intl.Locale(e).getWeekInfo?.()?.firstDay===7?0:1}catch{return 1}}function ts(e){return String(e).padStart(2,"0")}function Wt(e,t){return`${ts(e)}:00-${ts((e+t)%24)}:00`}function jt(e,t){return`${te[e.dow]??String(e.dow)} ${Wt(e.hour,t)}`}function J(e,t){return`${e} ${t}${e===1?"":"s"}`}function it(e,t){if(!(t>0)||!(e>0))return"0%";let s=e/t*100;return`${s>=10||Number.isInteger(s)?String(Math.round(s)):s.toFixed(1)}%`}function sr(e,t,s,a="session"){let r=jt(e,t);return e.count>0?`${r} \xB7 ${J(e.count,a)} \xB7 ${it(e.count,s)}`:`${r} \xB7 no ${a}s`}function ar(e){let t=e===1?3:4;return Array.from({length:24/e},(s,a)=>{let r=a*e;return r%t===0?String(r):""})}function rr(e){let t=/^(\d{4})-W(\d{2})$/.exec(e);if(!t)return;let s=Number(t[1]),a=Number(t[2]);if(a<1||a>53)return;let r=Date.UTC(s,0,4),l=r-(new Date(r).getUTCDay()+6)%7*Ot+(a-1)*er;return{start:new Date(l),end:new Date(l+6*Ot)}}var Ht=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",timeZone:"UTC"});function ns(e){let t=rr(e),s=e.replace(/^\d{4}-/,"");if(!t)return{short:s,range:e};let a=Ht,r=a.formatRange?a.formatRange(t.start,t.end):`${Ht.format(t.start)} - ${Ht.format(t.end)}`;return{short:s,range:r}}function us(e,t,s){if(!e||e.dow!==t.dow)return{dow:t.dow,hour:t.hour,hourSpan:s};let a=Math.min(e.hour,t.hour),r=Math.max(e.hour+e.hourSpan,t.hour+s);return{dow:t.dow,hour:a,hourSpan:Math.min(24-a,r-a)}}function ps(e,t){return e!==void 0&&e.dow===t.dow&&t.hour>=e.hour&&t.hour<e.hour+e.hourSpan}function Vt(e){if(!(e.dow===void 0||e.hour===void 0))return{dow:e.dow,hour:e.hour,hourSpan:e.hourSpan??1}}function qt(e){let{dow:t,hour:s,hourSpan:a,...r}=e;return r}function Kt(e,t){let s={...qt(e),dow:t.dow,hour:t.hour};return t.hourSpan>1&&(s.hourSpan=t.hourSpan),s}function fs(e,t){let s=e.dows.indexOf(t.dow);return s<0?0:le(e.rows[s].filter(a=>ps(t,a)).map(a=>a.count))}function ms({grid:e,selection:t,onCellClick:s,label:a}){let r=e.hours.length,o=ar(e.bucketHours),l=Math.ceil(r/2);return n("div",{class:`hm hm--cols-${r}`,role:"table","aria-label":a,style:`--hm-cols:${r}`,children:[n("div",{class:"hm__row",role:"row",children:[n("div",{class:"hm__corner",role:"columnheader",children:"Day"}),e.hours.map((i,c)=>n("div",{class:"hm__h",role:"columnheader",title:Wt(i,e.bucketHours),children:o[c]},i)),n("div",{class:"hm__h hm__h--total",role:"columnheader",children:"Total"})]}),e.rows.map((i,c)=>{let d=e.dows[c],u=e.rowTotals[c];return n("div",{class:"hm__row",role:"row",children:[n("div",{class:"hm__d",role:"rowheader",children:te[d]}),i.map((m,p)=>{let _=ps(t,m),v=sr(m,e.bucketHours,e.total),L=`hm__cell hm__cell--l${m.level}${_?" hm__cell--selected":""}${p>=l?" hm__cell--end":""}`;return n("div",{class:"hm__c",role:"cell",children:n("button",{type:"button",class:L,"data-tip":v,"data-dow":d,"data-hour":m.hour,"data-count":m.count,"data-selected":_?"true":void 0,"aria-label":_?`${v} (selected)`:v,onClick:w=>s(m,w)})},m.hour)}),n("div",{class:"hm__rt",role:"cell",title:`${te[d]}: ${J(u,"session")}`,children:[n("span",{class:"hm__rbar",style:`--v:${rt(u,e.maxRowTotal)}`,"aria-hidden":"true"}),n("span",{class:"hm__n",children:u})]})]},d)}),n("div",{class:"hm__row hm__row--foot",role:"row",children:[n("div",{class:"hm__d hm__d--total",role:"rowheader",children:"Total"}),e.colTotals.map((i,c)=>n("div",{class:"hm__ct",role:"cell",title:`${Wt(e.hours[c],e.bucketHours)}: ${J(i,"session")}`,children:[n("span",{class:"hm__cbar",style:`--v:${rt(i,e.maxColTotal)}`,"aria-hidden":"true"}),n("span",{class:"hm__n",children:i})]},e.hours[c])),n("div",{class:"hm__grand",role:"cell",children:e.total})]})]})}function _s({grid:e,activeSkills:t,onRowClick:s,label:a}){let r=e.weeks.length,o=Math.ceil(r/2);return n("div",{class:`hm hm--skills hm--cols-${r}`,role:"table","aria-label":a,style:`--hm-cols:${r}`,children:[n("div",{class:"hm__row",role:"row",children:[n("div",{class:"hm__corner",role:"columnheader",children:"Skill"}),e.weeks.map(l=>{let{short:i,range:c}=ns(l);return n("div",{class:"hm__h hm__wk",role:"columnheader",title:`${l} (${c})`,children:[n("span",{children:[n("span",{class:"hm__wk__w",children:i.slice(0,1)}),i.slice(1)]}),n("small",{children:c.split(/\s[-\u2013]\s/)[0]})]},l)}),n("div",{class:"hm__h hm__h--total",role:"columnheader",children:"Total"})]}),e.rows.map(l=>{let i=t.includes(l.uri);return n("div",{class:"hm__row",role:"row",children:[n("div",{class:"hm__d hm__d--skill",role:"rowheader",children:n("button",{type:"button",class:"hm__skill",title:l.uri,"aria-pressed":i,onClick:()=>s(l.uri),children:l.name})}),l.counts.map((c,d)=>{let u=e.weeks[d],{short:m,range:p}=ns(u),_=c>0?`${l.name} \xB7 ${m} (${p}) \xB7 ${J(c,"load")} \xB7 ${it(c,e.total)}`:`${l.name} \xB7 ${m} (${p}) \xB7 no loads`;return n("div",{class:"hm__c",role:"cell",children:n("button",{type:"button",class:`hm__cell hm__cell--l${l.levels[d]}${d>=o?" hm__cell--end":""}`,"data-tip":_,"data-week":u,"data-count":c,"aria-label":_,onClick:()=>s(l.uri)})},u)}),n("div",{class:"hm__rt",role:"cell",title:`${l.name}: ${J(l.total,"load")}`,children:[n("span",{class:"hm__rbar",style:`--v:${rt(l.total,e.maxRowTotal)}`,"aria-hidden":"true"}),n("span",{class:"hm__n",children:l.total})]})]},l.uri)}),n("div",{class:"hm__row hm__row--foot",role:"row",children:[n("div",{class:"hm__d hm__d--total",role:"rowheader",children:"Total"}),e.colTotals.map((l,i)=>n("div",{class:"hm__ct",role:"cell",title:`${e.weeks[i]}: ${J(l,"load")}`,children:[n("span",{class:"hm__cbar",style:`--v:${rt(l,e.maxColTotal)}`,"aria-hidden":"true"}),n("span",{class:"hm__n",children:l})]},e.weeks[i])),n("div",{class:"hm__grand",role:"cell",children:e.total})]})]})}function Gt({ranges:e,unit:t}){let s=a=>a==="-"?"unused at this scale":/^\d+$/.test(a)?J(Number(a),t):`${a} ${t}s`;return n("div",{class:"hm__legend",children:[n("span",{children:"Less"}),e.map((a,r)=>n("span",{class:`hm__sw hm__cell--l${r}`,role:"img",title:s(a),"aria-label":`level ${r}: ${s(a)}`},r)),n("span",{children:"More"})]})}function hs(){return n("style",{children:or})}var or=`
|
|
68
|
+
.hm-stack {
|
|
69
|
+
--hm-l0: var(--wash);
|
|
70
|
+
--hm-l1: color-mix(in srgb, var(--accent) 24%, transparent);
|
|
71
|
+
--hm-l2: color-mix(in srgb, var(--accent) 46%, transparent);
|
|
72
|
+
--hm-l3: color-mix(in srgb, var(--accent) 70%, transparent);
|
|
73
|
+
--hm-l4: var(--accent);
|
|
74
|
+
--hm-bar: color-mix(in srgb, var(--ink) 28%, transparent);
|
|
75
|
+
--hm-r: calc(var(--r-sm) / 2);
|
|
76
|
+
--hm-cell: var(--s-8);
|
|
77
|
+
display: grid;
|
|
78
|
+
gap: var(--s-4);
|
|
79
|
+
}
|
|
80
|
+
.hmc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); overflow: clip; }
|
|
81
|
+
.hmc__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-4); }
|
|
82
|
+
.hmc__title { margin: 0; font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.01em; }
|
|
83
|
+
.hmc__meta { color: var(--ink-3); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
|
|
84
|
+
.hmc__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-top: var(--s-4); color: var(--ink-3); font-size: var(--fs-cap); }
|
|
85
|
+
.hmc__hint { margin: 0; }
|
|
86
|
+
.hmc__empty { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: var(--fs-sm); }
|
|
87
|
+
.hmc__empty .btn { margin-inline-start: var(--s-2); }
|
|
88
|
+
|
|
89
|
+
.seg { display: inline-flex; margin-inline-start: auto; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
|
|
90
|
+
.seg__b { height: 32px; padding: 0 var(--s-3); border: 0; background: transparent; color: var(--ink-2); font-size: var(--fs-cap); font-weight: 500; cursor: pointer; transition: background-color var(--t-micro), color var(--t-micro); }
|
|
91
|
+
.seg__b + .seg__b { border-inline-start: 1px solid var(--line); }
|
|
92
|
+
.seg__b:hover { background: var(--wash); color: var(--ink); }
|
|
93
|
+
.seg__b[aria-pressed="true"] { background: var(--wash-2); color: var(--ink); }
|
|
94
|
+
.seg__b:focus-visible { outline-offset: -2px; }
|
|
95
|
+
|
|
96
|
+
.hm {
|
|
97
|
+
--hm-gap: var(--s-1);
|
|
98
|
+
display: grid;
|
|
99
|
+
grid-template-columns: max-content repeat(var(--hm-cols), minmax(0, 1fr)) max-content;
|
|
100
|
+
gap: var(--hm-gap);
|
|
101
|
+
align-items: center;
|
|
102
|
+
color: var(--ink-3);
|
|
103
|
+
font-size: var(--fs-micro);
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
font-variant-numeric: tabular-nums;
|
|
106
|
+
line-height: 1.2;
|
|
107
|
+
}
|
|
108
|
+
.hm__row { display: contents; }
|
|
109
|
+
.hm__corner { padding-inline-end: var(--s-2); white-space: nowrap; }
|
|
110
|
+
.hm__h { text-align: center; white-space: nowrap; min-height: 1.2em; align-self: end; }
|
|
111
|
+
.hm__h--total { text-align: right; padding-inline-start: var(--s-1); }
|
|
112
|
+
.hm__wk { display: flex; flex-direction: column; align-items: center; }
|
|
113
|
+
.hm__wk small { font-size: inherit; font-weight: 400; }
|
|
114
|
+
.hm__d { padding-inline-end: var(--s-2); color: var(--ink-2); white-space: nowrap; }
|
|
115
|
+
.hm__d--total { color: var(--ink-3); }
|
|
116
|
+
.hm__d--skill { padding-inline-end: var(--s-1); max-width: 18ch; }
|
|
117
|
+
.hm__c { position: relative; height: var(--hm-cell); min-width: 0; }
|
|
118
|
+
.hm__cell { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--hm-r); background: var(--hm-l0); cursor: pointer; transition: box-shadow var(--t-micro); }
|
|
119
|
+
.hm__cell--l1 { background: var(--hm-l1); }
|
|
120
|
+
.hm__cell--l2 { background: var(--hm-l2); }
|
|
121
|
+
.hm__cell--l3 { background: var(--hm-l3); }
|
|
122
|
+
.hm__cell--l4 { background: var(--hm-l4); }
|
|
123
|
+
.hm__cell:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
|
|
124
|
+
.hm__cell--selected, .hm__cell--selected:hover { box-shadow: inset 0 0 0 2px var(--ink); }
|
|
125
|
+
.hm__cell:focus-visible { outline-offset: 1px; z-index: 1; }
|
|
126
|
+
.hm__cell--end[data-tip]::after { left: auto; right: 0; }
|
|
127
|
+
.hm__skill { display: block; max-width: 100%; height: 100%; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: 500 var(--fs-cap) / 1.3 var(--font-sans); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background-color var(--t-micro); }
|
|
128
|
+
.hm__skill:hover { background: var(--wash); }
|
|
129
|
+
.hm__skill[aria-pressed="true"] { background: var(--wash-2); }
|
|
130
|
+
.hm__rt { display: flex; align-items: center; gap: var(--s-2); min-width: calc(var(--s-12) + var(--s-8)); padding-inline-start: var(--s-2); }
|
|
131
|
+
.hm__rbar { display: block; flex: none; width: calc(var(--v) * var(--s-12)); height: var(--s-2); border-radius: var(--r-full); background: var(--hm-bar); }
|
|
132
|
+
.hm__n { color: var(--ink-2); }
|
|
133
|
+
.hm__ct { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: calc(var(--s-1) / 2); height: calc(var(--s-8) + var(--s-3)); min-width: 0; }
|
|
134
|
+
.hm__cbar { display: block; width: 100%; max-width: var(--s-3); height: calc(var(--v) * var(--s-6)); border-radius: var(--r-full); background: var(--hm-bar); }
|
|
135
|
+
.hm__ct .hm__n { max-width: 100%; overflow: hidden; }
|
|
136
|
+
.hm__grand { align-self: end; padding-inline-start: var(--s-2); color: var(--ink); font-size: var(--fs-cap); font-weight: 600; text-align: right; }
|
|
137
|
+
|
|
138
|
+
.hm__legend { display: inline-flex; align-items: center; gap: var(--s-1); }
|
|
139
|
+
.hm__sw { display: inline-block; width: var(--s-3); height: var(--s-3); border-radius: var(--hm-r); box-shadow: inset 0 0 0 1px var(--line-2); }
|
|
140
|
+
.hm__sel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font-size: var(--fs-sm); }
|
|
141
|
+
.hm__sel strong { font-weight: 600; }
|
|
142
|
+
.hm__sel__actions { display: inline-flex; gap: var(--s-2); margin-inline-start: auto; }
|
|
143
|
+
|
|
144
|
+
@media (max-width: 639.98px) {
|
|
145
|
+
.hm-stack { --hm-cell: var(--s-6); }
|
|
146
|
+
.hm { --hm-gap: calc(var(--s-1) / 2); }
|
|
147
|
+
.hm--cols-24 .hm__ct .hm__n, .hm--cols-24 .hm__rbar { display: none; }
|
|
148
|
+
.hm--cols-24 .hm__rt { min-width: 0; padding-inline-start: var(--s-1); }
|
|
149
|
+
.hm__rt { gap: var(--s-1); min-width: calc(var(--s-6) + var(--s-5)); padding-inline-start: var(--s-1); }
|
|
150
|
+
.hm__rbar { width: calc(var(--v) * var(--s-6)); }
|
|
151
|
+
/* Skill x week: the label column goes away; each skill name sits on its own full-width line above its cells, wrapping instead of truncating. */
|
|
152
|
+
.hm--skills { grid-template-columns: repeat(var(--hm-cols), minmax(0, 1fr)) max-content; }
|
|
153
|
+
.hm--skills .hm__corner { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
154
|
+
.hm--skills .hm__d { grid-column: 1 / -1; max-width: none; margin-top: var(--s-2); padding-inline-end: 0; white-space: normal; }
|
|
155
|
+
.hm--skills .hm__d--total { padding-inline-start: var(--s-2); }
|
|
156
|
+
.hm--skills .hm__skill { width: 100%; max-width: none; height: auto; min-height: var(--s-6); padding: var(--s-1) var(--s-2); overflow: visible; text-overflow: clip; white-space: normal; }
|
|
157
|
+
.hm__wk small, .hm__wk__w { display: none; }
|
|
158
|
+
.seg { margin-inline-start: 0; }
|
|
159
|
+
}
|
|
160
|
+
`;var ir=300,lr="(max-width: 639.98px)",cr=["auto",...ss];function dr(e){let[t,s]=E(()=>typeof matchMedia=="function"&&matchMedia(e).matches);return N(()=>{if(typeof matchMedia!="function")return;let a=matchMedia(e),r=o=>s(o.matches);return a.addEventListener("change",r),s(a.matches),()=>a.removeEventListener("change",r)},[e]),t}function ur({choice:e,onChange:t}){return n("div",{class:"seg",role:"group","aria-label":"Hour bucket",children:cr.map(s=>n("button",{type:"button",class:"seg__b","aria-pressed":e===s,onClick:()=>t(s),children:s==="auto"?"Auto":`${s} h`},s))})}function pr({selection:e,count:t,total:s,onShow:a,onClear:r}){return n("div",{class:"hm__sel",role:"status",children:[n("span",{children:[n("strong",{children:jt(e,e.hourSpan)})," \xB7 ",J(t,"session"),s>0&&t>0?` (${it(t,s)})`:""]}),n("span",{class:"hm__sel__actions",children:[n("button",{type:"button",class:"btn",onClick:a,children:"Show sessions"}),n("button",{type:"button",class:"btn",onClick:r,children:"Clear"})]})]})}function gs({route:e,navigate:t,live:s}){let a=q(cs,[]),r=q(()=>ds(),[]),o=dr(lr),l=q(()=>qt(e.filter),[e.filter]),i=ne(l),[c,d]=E("auto"),u=c==="auto"?1:c,[m,p]=E(),[_,v]=E(),[L,w]=E(),[h,b]=E(0),[R,I]=E(()=>Vt(e.filter));N(()=>{I(Vt(e.filter))},[e.filter.dow,e.filter.hour,e.filter.hourSpan]),N(()=>{if(s.seq===0)return;let k=setTimeout(()=>b(T=>T+1),ir);return()=>clearTimeout(k)},[s.seq]),N(()=>{let k=!1;return Promise.all([D.heatmap(l,{tz:a,weekStart:r,bucket:u}),D.skillWeek(l)]).then(([T,M])=>{k||(p(T),v(M),w(void 0))}).catch(T=>{k||w(T instanceof Error?T.message:String(T))}),()=>{k=!0}},[i,a,r,u,h]);let P=m?os(m):0,H=c==="auto"?is(P,o):c,g=q(()=>m?rs(m,{bucketHours:H}):void 0,[m,H]),C=q(()=>_?ls(_):void 0,[_]),F=g&&R?fs(g,R):0,A=e.filter.skill??[],O=(k,T)=>{if(g){if(T.shiftKey){I(M=>us(M,k,g.bucketHours));return}t({view:"sessions",filter:Kt(e.filter,{dow:k.dow,hour:k.hour,hourSpan:g.bucketHours})})}},Y=()=>{R&&t({view:"sessions",filter:Kt(e.filter,R)})},j=()=>{I(void 0),(e.filter.dow!==void 0||e.filter.hour!==void 0)&&t({...e,filter:l})},V=k=>{let T={...e,filter:{...e.filter}};A.includes(k)?delete T.filter.skill:T.filter.skill=[k],t(T)},f=()=>t({...e,filter:{}}),S=g?te[g.weekStart]:te[r],y=g?`${g.bucketHours} h buckets${c==="auto"?" (auto)":""}`:"",x=!he(l);return n("section",{class:"hm-stack","aria-busy":g===void 0,children:[n(hs,{}),L&&n("p",{class:"notice",role:"alert",children:["Could not load the heatmap: ",L]}),g&&n("article",{class:"hmc","aria-labelledby":"hm-dow-title",children:[n("header",{class:"hmc__head",children:[n("h2",{class:"hmc__title",id:"hm-dow-title",children:"Sessions by weekday and hour"}),n("span",{class:"hmc__meta",children:[J(g.total,"session")," ","\xB7"," ",m?.tz??a," ","\xB7"," week starts ",S," ","\xB7"," ",y]}),n(ur,{choice:c,onChange:d})]}),g.total===0&&n("p",{class:"hmc__empty",role:"status",children:[x?"No sessions match these filters.":"No sessions yet.",x&&n("button",{type:"button",class:"btn",onClick:f,children:"Clear filters"})]}),n(ms,{grid:g,selection:R,onCellClick:O,label:"Sessions by weekday and hour"}),R&&n(pr,{selection:R,count:F,total:g.total,onShow:Y,onClear:j}),n("footer",{class:"hmc__foot",children:[n(Gt,{ranges:zt(g.level,g.maxCount),unit:"session"}),n("p",{class:"hmc__hint",children:["Click a cell to list its sessions ","\xB7"," shift-click to select a range of hours",c==="auto"&&g.total<ot&&!o?` \xB7 2 h buckets below ${ot} sessions`:""]})]})]}),C&&n("article",{class:"hmc","aria-labelledby":"hm-skill-title",children:[n("header",{class:"hmc__head",children:[n("h2",{class:"hmc__title",id:"hm-skill-title",children:"Skill loads by week"}),n("span",{class:"hmc__meta",children:[J(C.total,"load")," ","\xB7"," last ",C.weeks.length," ISO weeks"]})]}),C.rows.length===0?n("p",{class:"hmc__empty",role:"status",children:["No skill was loaded in the last ",C.weeks.length," weeks."]}):n(_s,{grid:C,activeSkills:A,onRowClick:V,label:"Skill loads by ISO week"}),n("footer",{class:"hmc__foot",children:[n(Gt,{ranges:zt(C.level,C.maxCount),unit:"load"}),n("p",{class:"hmc__hint",children:"Click a skill row to filter every view to that skill"})]})]})]})}var fr=`
|
|
161
|
+
.usage { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-4); margin: 0 0 var(--s-3); color: var(--ink-2); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
|
|
162
|
+
.usage__item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); }
|
|
163
|
+
.usage__key { color: var(--ink-3); }
|
|
164
|
+
.usage__why { color: var(--ink-3); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
|
|
165
|
+
.usage__why[data-tip]::after { width: min(44ch, calc(100vw - 2 * var(--s-4))); white-space: normal; }
|
|
166
|
+
.usage__rate { white-space: nowrap; }
|
|
167
|
+
.usage__rate--none { color: var(--ink-3); }
|
|
168
|
+
`;se("sessions-usage",fr);var vs="skillar links each MCP search and load to a runtime session by the runtime's session id, vendor metadata, the search trace handle, or a recent-activity window. These matched no session, so they are stored but appear in no session row.",ks=(e,t,s)=>e===1?t:s;function mr(e){return e==null?"-":`${Math.round(e*100)}%`}function _r(e){if(!(!e||e.searches+e.loads===0))return`${e.searches} unattributed ${ks(e.searches,"search","searches")}, ${e.loads} ${ks(e.loads,"load","loads")} (no session could be matched)`}function hr(e){return Fe.filter(t=>(e.attributionRate[t]??null)!==null||e.lastEventByRuntime[t]!==void 0).map(t=>({runtime:t,text:mr(e.attributionRate[t]),known:(e.attributionRate[t]??null)!==null}))}function gr({stats:e}){let t=_r(e.unattributed),s=hr(e);return!t&&s.length===0?null:n("p",{class:"usage",children:[t&&n("span",{class:"usage__item","data-usage":"unattributed",children:[n("span",{children:t}),n("span",{class:"usage__why",tabIndex:0,"data-tip":vs,"aria-label":vs,children:"How attribution works"})]}),s.length>0&&n("span",{class:"usage__item","data-usage":"rates",title:"Share of each runtime's MCP events matched to a session; - means the runtime sent no MCP events",children:[n("span",{class:"usage__key",children:"MCP attribution"}),s.map(a=>n("span",{class:a.known?"usage__rate":"usage__rate usage__rate--none",children:[K[a.runtime]," ",a.text]},a.runtime))]})]})}var vr=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}),kr=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),ws=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1});function wr(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function br(e){let t=Math.round(e/6e4);if(t<1)return"<1m";if(t<60)return`${t}m`;let s=Math.floor(t/60),a=t%60;return a?`${s}h ${a}m`:`${s}h`}function yr({row:e}){let t=new Date(e.startedAt),s=wr(t,new Date)?"Today":kr.format(t);return n("time",{class:"when",dateTime:t.toISOString(),title:t.toLocaleString(),children:[n("span",{class:"when__date",children:s}),n("span",{class:"when__time",children:vr.format(t)}),e.endedAt!==void 0&&n("span",{class:"when__dur",children:br(e.endedAt-e.startedAt)})]})}function xr({runtime:e}){let t=K[e]??K.unknown;return n("span",{class:"rt",children:[n("span",{class:"rt__mark","aria-hidden":"true",children:ee[e]??ee.unknown}),n("span",{children:t})]})}var bs=3;function Sr({skills:e}){if(!e.length)return n("span",{class:"skills__none",children:"none"});let t=e.slice(0,bs),s=e.length-t.length;return n("span",{class:"skills",children:[t.map(a=>n("span",{class:"skill",title:a,children:Q(a)},a)),s>0&&n("span",{class:"skill skill--more",title:e.slice(bs).map(Q).join(", "),children:["+",s]})]})}function Tr({state:e}){return n("span",{class:`badge badge--${e}`,title:Ke[e]??e,children:G[e]??e})}function Lr({row:e}){if(e.attribution!=="none")return n("span",{class:"attr",children:Ge[e.attribution]??e.attribution});let t=`unattributed: ${e.attributionReason??"reason not reported"}`;return n("span",{class:"attr attr--none",tabIndex:0,"data-tip":t,"aria-label":t,children:"unattributed"})}function Er(e){return e instanceof Element&&e.closest("a, button, input, select, [data-tip]")!==null}function Rr({row:e,route:t,navigate:s}){let a={view:"trace",sessionId:e.id,filter:t.filter};return n("tr",{onClick:r=>{Er(r.target)||s(a)},children:[n("td",{class:"c-runtime","data-label":"Runtime",children:n(xr,{runtime:e.runtime})}),n("td",{class:"c-started","data-label":"Started",children:n(yr,{row:e})}),n("td",{class:"c-prompt","data-label":"First prompt",children:n("a",{class:e.firstPrompt?"rowlink":"rowlink rowlink--dim",href:z(a),children:e.firstPrompt??"(no prompt captured)"})}),n("td",{class:"c-skills","data-label":"Skills",children:n(Sr,{skills:e.skills})}),n("td",{class:"c-state","data-label":"State",children:n(Tr,{state:e.state})}),n("td",{class:"c-attr","data-label":"Attribution",children:n(Lr,{row:e})})]})}function Cr({stats:e}){let{ingest:t}=e;return n("section",{class:"empty","aria-live":"polite",children:[n("h2",{children:"Waiting for the first event"}),n("p",{children:["No runtime has sent an event yet. Start a session in a connected runtime, or run"," ",n("code",{class:"cmd",children:"skillar doctor"})," to check each connection."]}),n("dl",{class:"checklist",children:[Fe.filter(s=>s!=="unknown").map(s=>{let a=e.lastEventByRuntime[s];return n(U,{children:[n("dt",{children:K[s]},`${s}-k`),n("dd",{class:a!==void 0?"is-ok":void 0,children:a!==void 0?`last event ${ws.format(a)}`:"no events yet"},`${s}-v`)]})}),n("dt",{children:"Ingest"}),n("dd",{class:t.rejected||t.dropped?"is-bad":void 0,children:[t.accepted," accepted, ",t.rejected," rejected, ",t.dropped," dropped"]}),t.lastError&&n(U,{children:[n("dt",{children:"Last error"}),n("dd",{class:"is-bad",children:[t.lastError.code," at ",ws.format(t.lastError.ts)]})]})]})]})}function Fr({route:e,navigate:t}){return n("section",{class:"empty",children:[n("h2",{children:"No sessions match these filters"}),n("p",{children:"Widen the time range or remove a filter to see more sessions."}),n("button",{type:"button",class:"btn",onClick:()=>t({...e,filter:{}}),children:"Clear filters"})]})}function Ar(){return n("section",{class:"empty",children:[n("h2",{children:"No sessions recorded yet"}),n("p",{children:["Events arrived but none opened a session. Start a prompt in a connected runtime, or run ",n("code",{class:"cmd",children:"skillar doctor"}),"."]})]})}function Ir({route:e,navigate:t,count:s}){let{filter:a}=e,r=o=>{let l={...a,...o};for(let i of Object.keys(l))l[i]===void 0&&delete l[i];t({...e,filter:l})};return n("form",{class:"toolbar",role:"search",onSubmit:o=>{o.preventDefault();let i=o.currentTarget.elements.namedItem("q")?.value.trim()??"";r({q:i||void 0})},children:[n("input",{class:"field field--search",type:"search",name:"q",placeholder:"Search prompts and skills","aria-label":"Search prompts and skills",value:a.q??""}),n("select",{class:"field field--select","aria-label":"Runtime",value:a.runtime?.length===1?a.runtime[0]:"",onChange:o=>{let l=o.currentTarget.value;r({runtime:l?[l]:void 0})},children:[n("option",{value:"",children:"All runtimes"}),Fe.map(o=>n("option",{value:o,children:K[o]},o))]}),n("select",{class:"field field--select","aria-label":"Adoption state",value:a.state?.length===1?a.state[0]:"",onChange:o=>{let l=o.currentTarget.value;r({state:l?[l]:void 0})},children:[n("option",{value:"",children:"All states"}),Ae.map(o=>n("option",{value:o,children:G[o]},o))]}),s!==void 0&&n("span",{class:"toolbar__count",children:[s," ",s===1?"session":"sessions"]})]})}var $r=300;function ys({route:e,navigate:t,live:s}){let a=ne(e.filter),[r,o]=E(),[l,i]=E(),[c,d]=E(),[u,m]=E(0);N(()=>{if(s.seq===0)return;let _=setTimeout(()=>m(v=>v+1),$r);return()=>clearTimeout(_)},[s.seq]),N(()=>{let _=!1;return Promise.all([D.sessions(e.filter),D.stats(e.filter)]).then(([v,L])=>{_||(o(v),i(L),d(void 0))}).catch(v=>{_||d(v instanceof Error?v.message:String(v))}),()=>{_=!0}},[a,u]);let p;return r===void 0?p=null:r.length===0&&l&&l.lastEventTs===void 0?p=n(Cr,{stats:l}):r.length===0&&!he(e.filter)?p=n(Fr,{route:e,navigate:t}):r.length===0?p=n(Ar,{}):p=n("div",{class:"card",children:n("table",{class:"sessions",children:[n("colgroup",{children:[n("col",{style:"width:15%"}),n("col",{style:"width:10%"}),n("col",{}),n("col",{style:"width:20%"}),n("col",{style:"width:13%"}),n("col",{style:"width:12%"})]}),n("thead",{children:n("tr",{children:[n("th",{scope:"col",children:"Runtime"}),n("th",{scope:"col",children:"Started"}),n("th",{scope:"col",children:"First prompt"}),n("th",{scope:"col",children:"Skills"}),n("th",{scope:"col",children:"State"}),n("th",{scope:"col",children:"Attribution"})]})}),n("tbody",{children:r.map(_=>n(Rr,{row:_,route:e,navigate:t},_.id))})]})}),n("section",{"aria-busy":r===void 0,children:[n(Ir,{route:e,navigate:t,count:r?.length}),c&&n("p",{class:"notice",role:"alert",children:["Could not load sessions: ",c]}),r!==void 0&&l&&n(gr,{stats:l}),p]})}function lt(e){return(e.skillarMcp??e.gisoolMcp)===!0}var ce="unknown",xs=12,Mr={inputTokens:"in",outputTokens:"out",cacheReadTokens:"cache read",cacheCreationTokens:"cache created",cacheWriteTokens:"cache written",reasoningTokens:"reasoning",totalTokens:"total"},Yt=Object.entries(Mr);function Xt(e){return typeof e=="string"&&e.length>0?e:void 0}function ae(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Qt(e){let t=ae(e);if(t===void 0||t<0)return ce;if(t<1e3)return`${Math.round(t)} ms`;if(t<6e4)return`${(t/1e3).toFixed(1)} s`;let s=Math.floor(t/6e4),a=Math.round(t%6e4/1e3);return a?`${s}m ${a}s`:`${s}m`}function Jt(e){let t=ae(e);return t===void 0?ce:`$${t.toFixed(4)}`}function Ss(e){let t=new Map;for(let s of e)for(let[a]of Yt){let r=ae(s[a]);r!==void 0&&t.set(a,(t.get(a)??0)+r)}return Yt.flatMap(([s,a])=>{let r=t.get(s);return r===void 0?[]:[{key:s,label:a,value:r}]})}function Nr(e){return Yt.flatMap(([t,s])=>{let a=ae(e[t]);return a===void 0?[]:[{key:t,label:s,value:a}]})}function De(e){return e.kind==="tool_call"||e.kind==="llm_call"}function Dr(e){let t=e.data,s=e.kind==="tool_call";return{id:e.id,kind:s?"tool_call":"llm_call",name:(s?Xt(t.toolName)??Xt(t.name):Xt(t.model))??(s?"unnamed tool":"unnamed model"),duration:Qt(ae(t.durationMs)),success:s&&typeof t.success=="boolean"?t.success:null,tokens:s?[]:Nr(t),cost:s?null:Jt(ae(t.costUsd)),skillarMcp:lt(t)}}function ct(e){return e.filter(De).map(Dr)}function Zt({parts:e}){return e.length===0?n("span",{class:"tok tok--none",children:["tokens ",ce]}):n(U,{children:e.map(t=>n("span",{class:"tok",children:[n("span",{class:"tok__k",children:t.label}),n("span",{class:"tok__v",children:t.value.toLocaleString()})]},t.key))})}function dt({rows:e}){let[t,s]=E(!1);if(e.length===0)return n("p",{class:"calls__none",children:"no tool or model call recorded"});let a=t?e:e.slice(0,xs);return n(U,{children:[n("ul",{class:"calls",children:a.map(r=>n("li",{class:"call","data-kind":r.kind,children:[n("span",{class:"call__name",children:r.name}),r.skillarMcp&&n("span",{class:"tag",title:"a call to skillar's own MCP server",children:"skillar"}),r.kind==="tool_call"&&(r.success===null?n("span",{class:"tag tag--dim",children:["outcome ",ce]}):n("span",{class:r.success?"tag tag--ok":"tag tag--bad",children:r.success?"ok":"failed"})),n("span",{class:"call__meta",children:r.duration}),r.kind==="llm_call"&&n("span",{class:"call__meta",children:["cost ",r.cost]}),r.kind==="llm_call"&&n(Zt,{parts:r.tokens})]},r.id))}),e.length>xs&&n("button",{type:"button",class:"foldbtn","aria-expanded":t,onClick:()=>s(r=>!r),children:t?"Show fewer calls":`Show all ${e.length} calls`})]})}var Pr=`
|
|
169
|
+
.calls { list-style: none; display: grid; gap: var(--s-1); margin: var(--s-1) 0 0; padding: 0; }
|
|
170
|
+
.calls__none { margin: 0; color: var(--ink-3); font-size: var(--fs-cap); }
|
|
171
|
+
.call { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); color: var(--ink-2); font-size: var(--fs-cap); }
|
|
172
|
+
.call__name { color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-cap); font-weight: 500; overflow-wrap: anywhere; }
|
|
173
|
+
.call__meta { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
174
|
+
.tok { display: inline-flex; align-items: baseline; gap: var(--s-1); color: var(--ink-2); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
175
|
+
.tok--none { color: var(--ink-3); }
|
|
176
|
+
.tok__k { color: var(--ink-3); }
|
|
177
|
+
`;se("calls",Pr);function Ts(e,t){let s=new Set(t.map(a=>a.normalize("NFKC").toLowerCase()));return{hit:e.filter(a=>s.has(a)).length,total:e.length}}var Ur=e=>e.normalize("NFKC").toLowerCase().replace(/\s+/g," ").trim(),Ls=new Set("a an the and or to of for in on with from by is are be it this that do please use using when how me my can could would should not only then after before need want help \uD574\uC918 \uD574\uC8FC\uC138\uC694 \uC54C\uB824\uC918 \uC791\uC131\uD574\uC918 \uB9CC\uB4E4\uC5B4\uC918 \uD655\uC778\uD574\uC918 \uAC80\uD1A0\uD574\uC918 \uD544\uC694 \uC5C6\uC5B4 \uC788\uC2B5\uB2C8\uB2E4 \uD569\uB2C8\uB2E4 \uC791\uC5C5 \uC0AC\uC6A9 \uD1B5\uD574 \uB300\uD55C \uC704\uD55C \uAD00\uB828 \uD604\uC7AC \uB2E4\uC74C \uBA3C\uC800 \uC2E4\uC81C \uD558\uB098 \uAC83 \uC218 \uBC0F \uB610\uB294 \uD558\uACE0 \uADF8\uB9AC\uACE0 \uBC29\uBC95 \uC740 \uB294 \uC774 \uAC00 \uC744 \uB97C \uC758 \uB3C4 \uB85C \uC640 \uACFC \uC5D0".split(" "));function Br(e){if(/^[가-힣]+$/.test(e)&&e.length>2){let t=e.replace(/(?:해주세요|해줘|하기|하게|하는|하면서|하려는|으로|에서|에게|에는|까지|부터|처럼|보다|은|는|을|를|이|가|과|와|의|도|로)$/,"");return t.length>=2?t:e}return/^[a-z]{5,}s$/.test(e)&&!e.endsWith("ss")?e.slice(0,-1):e}function Hr(e){return(Ur(e).match(/[\p{L}\p{N}]+/gu)??[]).flatMap(t=>t.split(/(?<=[가-힣])(?=[a-z0-9])|(?<=[a-z0-9])(?=[가-힣])/))}function Es(e){return[...new Set(Hr(e).filter(t=>!Ls.has(t)).map(Br).filter(t=>!Ls.has(t)))]}function Or(e){return[...e].sort((t,s)=>t.rank-s.rank)}function Wr(e,t){let s=e?Es(e):[];if(!s.length)return;let{hit:a,total:r}=Ts(s,t??[]);return`${a}/${r} ${r===1?"term":"terms"}`}function zr(e){let t=/^skill:\/\/local\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):void 0}function jr(e){let t=new Map;for(let a of e)t.set(a.name,(t.get(a.name)??0)+1);let s=new Map;for(let a of e){let r=(t.get(a.name)??0)>1?zr(a.uri):void 0;r&&s.set(a.uri,r)}return s}function Vr(e,t){let s=new Set(t??[]);for(let a of e)a.chosen&&s.add(a.uri);return s}function en(e){return Number.isFinite(e)?e.toFixed(2):"-"}function qr(e){let t=Number.isFinite(e)?Math.min(1,Math.max(0,e)):0;return`${Math.round(t*100)}%`}var Kr={automatic:"auto",explicit:"explicit"},Gr={automatic:"automatic: eligible for automatic routing",explicit:"explicit: only loads when the skill is named"};function Xr(){return n("svg",{class:"cand__check",viewBox:"0 0 24 24",width:"16",height:"16",role:"img","aria-label":"loaded after this search",focusable:"false",children:n("path",{d:"M20 6 9 17l-5-5",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}function Rs({candidates:e,chosen:t,query:s}){if(!e.length)return n("p",{class:"cands__none",children:"No candidates were returned."});let a=Vr(e,t),r=jr(e);return n(U,{children:[n("p",{class:"cands__legend",children:["match = rank score ","\xD7"," share of query terms matched"]}),n("ol",{class:"cands","aria-label":"Search candidates",children:Or(e).map(o=>{let l=a.has(o.uri),i=r.get(o.uri),c=Wr(s,o.matched);return n("li",{class:l?"cand cand--chosen":"cand","data-uri":o.uri,"data-score":en(o.score),"data-chosen":l?"true":"false",children:[n("span",{class:"cand__rank","aria-label":`rank ${o.rank}`,children:o.rank}),n("span",{class:"cand__name",title:o.uri,children:[n("span",{class:"cand__nm",children:o.name}),i?n("span",{class:"cand__root","data-root":i,children:i}):null]}),n("span",{class:"cand__inv",title:Gr[o.invocation]??o.invocation,children:Kr[o.invocation]??o.invocation}),n("span",{class:"cand__bar",role:"img",title:"match","aria-label":`match ${en(o.score)}${c?`, ${c}`:""}`,children:n("span",{class:"cand__fill",style:{width:qr(o.score)}})}),n("span",{class:"cand__score",children:en(o.score)}),n("span",{class:"cand__cov",children:c??""}),n("span",{class:"cand__pick",children:l?n(Xr,{}):null}),n("span",{class:"cand__desc",children:[o.description,o.matched?.length?n("span",{class:"cand__matched",children:[" ","\xB7"," matched ",o.matched.join(", ")]}):null]})]},o.uri)})})]})}var re=(e,t,s)=>`${e} ${e===1?t:s}`;function Yr(e){switch(e.key){case"workspace":return e.value;case"tab":return`tab ${e.value}`;case"panes":return re(e.value,"pane","panes");case"sessions":return re(e.value,"session","sessions");case"inferred":return`${e.value} inferred`;case"unlinked":return`${e.value} unlinked`;case"turns":return re(e.value,"turn","turns");case"found":return`${e.value} found via search`;case"abstained":return`${e.value} abstained`;case"calls":return re(e.value,"call","calls");case"callsAfter":return`${re(e.value,"call","calls")} after activation`;case"commands":return re(e.value,"shell command","shell commands");case"unresolvedExec":return`${re(e.value,"exec wrapper","exec wrappers")}, role unknown`;case"skillarCalls":return`${re(e.value,"call","calls")} to skillar`;case"failed":return`${e.value} failed`;case"reads":return`${re(e.value,"read","reads")} of its resources`;case"spans":return`${e.withCalls}/${e.total} ${e.total===1?"span":"spans"} with calls after activation`;case"cost":return`cost ${e.value===null?ce:Jt(e.value)}`;case"active":return`active ${Qt(e.value)}`;case"finding":return Xe[e.value];default:return String(e)}}function Qr(e){switch(e.key){case"finding":return Ye[e.value];case"spans":return"Spans followed by at least one non-skillar tool call: activity, not proof the skill was applied or helped.";case"unresolvedExec":return"Codex exec runs code that may only dispatch the other calls or also do work of its own, so the exact work count stays unknown.";default:return}}function _e({facts:e,className:t="facts"}){return n("p",{class:t,children:e.map((s,a)=>n("span",{class:"facts__item","data-fact":s.key,title:Qr(s),children:Yr(s)},`${s.key}-${a}`))})}function ut({loads:e}){return e.count===0?null:n("aside",{class:"callout",role:"note","data-load-attribution":"unresolved",children:[n("strong",{children:[n("span",{"data-unattributed-count":e.count,children:e.count})," skill ",e.count===1?"load has":"loads have"," unresolved session attribution"]}),n("span",{children:"These recorded loads may belong to this report. Missing attributed use is not evidence of non-use."}),n("ul",{children:e.uris.map(t=>n("li",{children:n("code",{"data-unattributed-uri":t,children:t})},t))})]})}function Jr(e){let t=document.getElementById(`turn-${e}`);t instanceof HTMLDetailsElement&&(t.open=!0,t.querySelector("summary")?.focus())}function Cs({finding:e}){return n("details",{class:"evidence","data-evidence":"finding",children:[n("summary",{children:["Inspect finding evidence ",n("span",{class:"tag",children:"reported events"})]}),n("div",{class:"evidence__body",children:[n("p",{children:["Search recorded: ",n("strong",{"data-searched":e.searched,children:e.searched?"yes":"no"})]}),n("ol",{"aria-label":"Search queries",children:e.queries.map((t,s)=>n("li",{children:n("q",{children:t||"query not captured"})},s))}),n("h3",{children:"Candidates across searches"}),n("p",{class:"dim",children:"Latest ranks per candidate; rank groups identical copies."}),e.candidates.length===0?n("p",{children:"No candidates recorded."}):n("ul",{"aria-label":"Search candidates",children:e.candidates.map(t=>n("li",{"data-candidate":t.uri,"data-rank":t.rank,"data-raw-rank":t.rawRank,"data-copies":t.copies,children:[n("strong",{children:t.name})," - rank ",t.rank,", raw rank ",t.rawRank,", copies ",t.copies,n("code",{children:t.uri})]},t.uri))}),n("h3",{children:"Loaded and natively used skills"}),e.usedSkills.length===0?n("p",{children:"No skill use recorded."}):n("ul",{"aria-label":"Used skills",children:e.usedSkills.map((t,s)=>n("li",{"data-used-skill":t.name,"data-rank":t.rankInSearch??"not_in_results","data-via":t.via,children:[n("strong",{children:t.name})," - ",t.via==="load"?"loaded":"native use","; ",t.rankInSearch===null?"not in results (or no preceding search)":`rank ${t.rankInSearch} in preceding search`,t.uri&&n("code",{children:t.uri})]},s))}),n("p",{children:["Native use without preceding search: ",n("strong",{"data-native-without-search":e.nativeWithoutSearch,children:e.nativeWithoutSearch?"yes":"no"})]}),n("h3",{children:"Abstentions"}),e.abstentions.length===0?n("p",{children:"No abstention recorded."}):n("ul",{children:e.abstentions.map((t,s)=>n("li",{"data-abstention":t.reason,children:[t.reason,t.hint&&` - ${t.hint}`]},s))}),n("h3",{children:"Used later, absent from these searches"}),e.missedLater.length===0?n("p",{children:"No later missed skill recorded."}):n("ul",{children:e.missedLater.map((t,s)=>n("li",{"data-missed-skill":t.name,children:[n("a",{href:`#turn-${t.turnId}`,onClick:a=>{a.preventDefault(),Jr(t.turnId)},children:[t.name," - open later turn"]}),t.uri&&n("code",{children:t.uri})]},s))})]})]})}var Zr={correction:"looks like a correction",no_correction:"no correction words matched",unknown:"unknown"},eo={no_next_prompt:"no next prompt observed",text_not_captured:"next prompt text not captured"};function Fs({events:e,usage:t}){let s=t.nextPromptCorrection;return n("details",{class:"evidence","data-evidence":"usage",children:[n("summary",{children:["Inspect use evidence ",n("span",{class:"tag",children:"reported / heuristic"})]}),n("div",{class:"evidence__body",children:[n("p",{"data-correction":s.status,"data-basis":s.label,"data-correction-reason":s.reason??"none",children:["Next-prompt correction: ",n("strong",{children:Zr[s.status]})," ",n("span",{class:"tag",children:s.label}),s.reason&&` - ${eo[s.reason]}`,s.matched.length>0&&` - matched: ${s.matched.join(", ")}`]}),n("h3",{children:"Supporting reads"}),t.supportingReads.length===0?n("p",{children:"No supporting read recorded."}):n("ul",{children:t.supportingReads.map(a=>{let r=e.find(l=>l.id===a.eventId),o=typeof r?.data.uri=="string"?r.data.uri:typeof r?.data.path=="string"?r.data.path:null;return n("li",{"data-read":a.eventId,"data-basis":a.label,children:[n("span",{class:"tag",children:a.label})," ",a.kind==="read_file"?"resource read":"tool argument path",n("code",{children:o??r?.text??"file path not captured"}),a.uri&&n("code",{children:["Skill: ",a.uri]}),n("span",{children:["Event: ",n("code",{children:a.eventId})]})]},a.eventId)})})]})]})}var to=600,no=8,As=160,so="cost unknown",ao={session_start:"Session started",prompt:"Prompt",search:"Searched skillar",load:"Loaded skill",read_file:"Read resource",native_skill:"Native skill",llm_call:"Model call",tool_call:"Tool run",session_end:"Session ended",error:"Error"},ro={discovery:"discovery",automatic:"automatic",explicit:"explicit"},oo={empty_query:"empty query",no_overlap:"no overlap",below_threshold:"below threshold",explicit_only:"explicit only"},io="This session never consulted skillar",lo="Skill active";function co(e,t){if(!t)return e.map(c=>({kind:"step",step:c}));let s=new Map(t.finding.turns.map(c=>[c.turnId,c.label])),a=t.tree.turns.flatMap(c=>c.skillSpans.map(d=>({span:d,turnId:c.id,finding:s.get(c.id)}))).sort((c,d)=>c.span.startedAt-d.span.startedAt),r=new Map;for(let{span:c}of a)for(let d of c.events){if(!De(d))continue;let u=`${d.ts}:${d.kind}`;r.set(u,(r.get(u)??0)+1)}let o=[],l=0,i=c=>{for(;l<a.length;){let d=a[l];if(d.span.startedAt>c)return;l+=1,o.push({kind:"span",span:d.span,turnId:d.turnId,...d.finding?{finding:d.finding}:{}})}};for(let c of e){let d=`${c.ts}:${c.kind}`,u=r.get(d)??0;if(u>0){r.set(d,u-1);continue}o.push({kind:"step",step:c}),i(c.ts)}return i(Number.POSITIVE_INFINITY),o}function uo(e,t,s){let a=[{key:"active",value:e.endedAt-e.startedAt},{key:"calls",value:t}];return s&&a.push({key:"finding",value:s}),a}function Ms(e){let t={steps:e.length,searches:0,abstained:0,loads:0,reads:0,natives:0,errors:0};for(let s of e)switch(s.kind){case"search":t.searches+=1,s.detail.abstained&&(t.abstained+=1);break;case"load":t.loads+=1;break;case"read_file":t.reads+=1;break;case"native_skill":t.natives+=1;break;case"error":t.errors+=1;break;default:break}return t}function Ns(e,t){let s=e[0],a=e[e.length-1],r=e.find(o=>o.kind==="session_end");return{startedAt:t?.startedAt??s?.ts,endedAt:t?.endedAt??r?.ts,lastTs:a?.ts}}function pt(e){let t=Math.round(e/6e4);if(t<1)return"<1m";if(t<60)return`${t}m`;let s=Math.floor(t/60),a=t%60;return a?`${s}h ${a}m`:`${s}h`}function po(e){if(!Number.isFinite(e)||e<0)return"";if(e<1e4)return`+${(e/1e3).toFixed(1)}s`;if(e<6e4)return`+${Math.round(e/1e3)}s`;let t=Math.round(e/1e3),s=Math.floor(t/60);return s<60?`+${s}m ${String(t%60).padStart(2,"0")}s`:`+${Math.floor(s/60)}h ${String(s%60).padStart(2,"0")}m`}function Ds(e){return!Number.isFinite(e)||e<0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function fo(e){return e?e.replace(/^sha256[:-]/,"").slice(0,no):""}function tn(e){return!Number.isFinite(e)||e<0?"-":e<1?`${e.toFixed(2)} ms`:e<100?`${e.toFixed(1)} ms`:`${Math.round(e)} ms`}function mo(e,t){let s=e.replace(/\/SKILL\.md$/i,"");return s&&t.startsWith(`${s}/`)?t.slice(s.length+1):t}function _o(e,t=to){let s=Array.from(e);return s.length<=t?{head:e,folded:!1}:{head:s.slice(0,t).join(""),folded:!0}}function Ps(e){let t=e.detail;return{kind:"search",traceId:typeof t.traceId=="string"?t.traceId:"",chosen:Array.isArray(t.chosen)?t.chosen:[],query:typeof t.query=="string"?t.query:"",mode:t.mode??"automatic",candidates:Array.isArray(t.candidates)?t.candidates:[],abstained:t.abstained,elapsedMs:Number(t.elapsedMs??0),total:Number(t.total??(Array.isArray(t.candidates)?t.candidates.length:0))}}function ho(e){return e.traceId?{query:e.query,fromTraceId:e.traceId}:{query:e.query}}function go(e,t){return t?.firstPrompt?t.firstPrompt:e.find(r=>r.kind==="prompt")?.detail?.text||void 0}var vo=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),ko=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function wo({runtime:e}){return n("span",{class:"rt",children:[n("span",{class:"rt__mark","aria-hidden":"true",children:ee[e]??ee.unknown}),n("span",{children:K[e]??K.unknown})]})}function bo({sessionId:e,row:t,steps:s,backHref:a,liveState:r,unresolvedLoads:o}){let l=Ns(s,t),i=Ms(s),c=go(s,t),d=t?.runtime,u;l.startedAt===void 0?u="-":l.endedAt!==void 0?u=pt(l.endedAt-l.startedAt):r==="live"?u=`in progress \xB7 ${pt((l.lastTs??l.startedAt)-l.startedAt)} so far`:u=`${pt((l.lastTs??l.startedAt)-l.startedAt)} (no end recorded)`;let m=t?t.attribution==="none"?`unattributed \xB7 ${t.attributionReason??"reason not reported"}`:Ge[t.attribution]??t.attribution:"-",p=[`${i.steps} ${i.steps===1?"step":"steps"}`,`${i.searches} ${i.searches===1?"search":"searches"}`,`${i.loads} ${i.loads===1?"load":"loads"}`];return i.reads&&p.push(`${i.reads} ${i.reads===1?"file read":"file reads"}`),i.natives&&p.push(`${i.natives} native`),i.errors&&p.push(`${i.errors} ${i.errors===1?"error":"errors"}`),n("header",{class:"trace__head card",children:[n("a",{class:"trace__back",href:a,children:[n("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",focusable:"false",children:n("path",{d:"m15 18-6-6 6-6",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),"Sessions"]}),n("h1",{class:c?"trace__title":"trace__title trace__title--dim",children:c??"(no prompt captured)"}),n("dl",{class:"trace__meta",children:[n("div",{children:[n("dt",{children:"Runtime"}),n("dd",{children:d?n(wo,{runtime:d}):n("span",{class:"trace__dim",children:"unknown"})})]}),n("div",{children:[n("dt",{children:"Started"}),n("dd",{children:l.startedAt!==void 0?n("time",{dateTime:new Date(l.startedAt).toISOString(),children:ko.format(l.startedAt)}):"-"})]}),n("div",{children:[n("dt",{children:"Duration"}),n("dd",{children:u})]}),n("div",{children:[n("dt",{children:"Attribution"}),n("dd",{class:t?.attribution==="none"?"trace__dim":void 0,children:m})]}),t&&n("div",{children:[n("dt",{children:"State"}),n("dd",{children:o?n("span",{class:"tag","data-adoption-status":"uncertain",children:"attribution unresolved"}):n("span",{class:`badge badge--${t.state}`,title:Ke[t.state]??t.state,children:G[t.state]??t.state})})]}),n("div",{children:[n("dt",{children:"Session"}),n("dd",{class:"trace__id",children:e})]})]}),n("p",{class:"trace__counts",children:p.join(" \xB7 ")})]})}function Us({ts:e,startedAt:t}){let s=t!==void 0?po(e-t):"";return n("time",{class:"tl__time",dateTime:new Date(e).toISOString(),title:new Date(e).toLocaleString(),children:[n("b",{children:vo.format(e)}),s&&n("span",{class:"tl__offset",children:s})]})}function yo({detail:e}){let[t,s]=E(!1);if(!e.text)return n("p",{class:"tl__dim",children:["(prompt not captured",e.textLength!==void 0?`, ${e.textLength} chars`:"",")"]});let{head:a,folded:r}=_o(e.text);return n("div",{children:[n("p",{class:"tl__text",children:t||!r?e.text:`${a}\u2026`}),r&&n("button",{type:"button",class:"foldbtn","aria-expanded":t,onClick:()=>s(o=>!o),children:t?"Show less":`Show more (${Array.from(e.text).length} chars)`})]})}function xo({detail:e}){let[t,s]=E({status:"idle"}),a=()=>{s({status:"saving"}),D.addEvalCase(ho(e)).then(()=>s({status:"saved"})).catch(o=>s({status:"error",message:o instanceof Error?o.message:String(o)}))},r=t.status==="saved";return n("div",{class:"tl__save",children:[n("button",{type:"button",class:"btn","data-save-eval":t.status,disabled:t.status==="saving"||r,onClick:a,children:[r&&n("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",focusable:"false",children:n("path",{d:"M20 6 9 17l-5-5",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})}),r?"Saved as eval case":t.status==="saving"?"Saving\u2026":"Save as eval case"]}),t.status==="error"&&n("span",{class:"tl__err",role:"alert",children:["Could not save: ",t.message]})]})}function So({detail:e}){let t=e.candidates.length,s=e.abstained?"abstained":e.total>t?`top ${t} of ${e.total}`:`${t} ${t===1?"candidate":"candidates"}`;return n("div",{children:[n("p",{class:"tl__meta tl__meta--row",children:[n("span",{class:"tl__mode",title:`mode: ${e.mode}`,children:ro[e.mode]??e.mode}),n("span",{children:tn(e.elapsedMs)}),n("span",{children:s}),e.traceId&&n("span",{class:"tl__id",title:"trace id",children:e.traceId})]}),n("blockquote",{class:"tl__query",children:e.query||n("span",{class:"tl__dim",children:"(empty query)"})}),e.abstained?n("div",{class:"tl__abstain","data-abstained":e.abstained.reason,children:[n("div",{class:"tl__abstain-head",children:n("span",{class:"badge badge--no_match",children:["abstained ","\xB7"," ",oo[e.abstained.reason]??e.abstained.reason]})}),n("p",{class:"tl__hint",children:e.abstained.hint}),n(xo,{detail:e})]}):n(Rs,{candidates:e.candidates,chosen:e.chosen,query:e.query})]})}function To({detail:e}){return n("p",{class:"tl__line",children:[n("span",{class:"tl__name",children:Q(e.uri)}),n("span",{class:"tl__uri",children:e.uri}),e.manifestDigest&&n("span",{class:"tl__digest",title:`manifest ${e.manifestDigest}`,children:["@",fo(e.manifestDigest)]})]})}function Lo({detail:e}){return n("p",{class:"tl__line",children:[n("span",{class:"tl__name tl__name--mono",children:mo(e.skillUri,e.uri)}),n("span",{class:"tl__meta",children:Ds(e.bytes)}),e.skillUri&&n("span",{class:"tl__meta",children:["from ",Q(e.skillUri)]})]})}function Eo({detail:e}){return n("p",{class:"tl__line",children:[n("span",{class:"tl__name",children:e.name}),n("span",{class:"tl__meta",children:["via ",e.via]})]})}function Ro(e){return typeof e=="number"&&Number.isFinite(e)?`$${e.toFixed(4)}`:so}function Co(e){if(typeof e.args=="string"){let t=Array.from(e.args),s=t.length>As;return{captured:!0,text:s?`${t.slice(0,As).join("")}\u2026`:e.args,truncated:s}}return typeof e.argsLength=="number"?{captured:!1,length:e.argsLength}:void 0}function Fo({step:e,detail:t}){return n("p",{class:"tl__line",children:[n("span",{class:"tl__name",children:e.summary}),n("span",{class:"tl__meta",children:Ro(t.costUsd)}),t.durationMs!==void 0&&n("span",{class:"tl__meta",children:tn(t.durationMs)}),t.ttftMs!==void 0&&n("span",{class:"tl__meta",children:["first token ",tn(t.ttftMs)]})]})}function Ao({step:e,detail:t}){let s=Co(t);return n("p",{class:"tl__line",children:[n("span",{class:"tl__name",children:e.summary}),s!==void 0&&n("span",{class:"tl__name tl__name--mono",children:s.captured?s.text:`${s.length} chars not captured`}),t.resultBytes!==void 0&&n("span",{class:"tl__meta",children:["result ",Ds(t.resultBytes)]})]})}function Io({detail:e}){return n("p",{class:"tl__line",children:[n("span",{class:"tl__code",children:e.code}),n("span",{class:"tl__errmsg",children:e.message})]})}function $o({step:e,bounds:t}){switch(e.kind){case"prompt":return n(yo,{detail:e.detail});case"search":return n(So,{detail:Ps(e)});case"load":return n(To,{detail:e.detail});case"read_file":return n(Lo,{detail:e.detail});case"native_skill":return n(Eo,{detail:e.detail});case"llm_call":return n(Fo,{step:e,detail:e.detail});case"tool_call":return n(Ao,{step:e,detail:e.detail});case"error":return n(Io,{detail:e.detail});case"session_end":return t.startedAt!==void 0?n("p",{class:"tl__meta",children:["after ",pt(e.ts-t.startedAt)]}):null;case"session_start":return null;default:return n("p",{class:"tl__meta",children:e.summary})}}function Mo({step:e,bounds:t}){let s=e.kind==="search"?Ps(e):void 0,a=e.kind==="tool_call"&&e.detail.success===!1,r=e.kind==="tool_call"&<(e.detail),o=e.kind==="read_file"||e.kind==="native_skill"||e.kind==="llm_call"||e.kind==="tool_call";return n("li",{class:`tl__step tl__step--${e.kind}`,"data-kind":e.kind,children:[n("span",{class:o?"tl__dot tl__dot--hollow":"tl__dot","aria-hidden":"true"}),n("div",{class:"tl__head",children:[n("span",{class:"tl__kind",children:ao[e.kind]??e.kind}),e.kind==="native_skill"&&n("span",{class:"tl__tag",title:"handled by the runtime's own skill mechanism, not skillar",children:"native"}),r&&n("span",{class:"tl__tag",title:"a call to skillar's own MCP server",children:"skillar"}),a&&n("span",{class:"tl__tag tl__tag--bad",children:"failed"}),s?.abstained&&n("span",{class:"tl__tag tl__tag--bad",children:"abstained"}),n(Us,{ts:e.ts,startedAt:t.startedAt})]}),n("div",{class:"tl__body",children:n($o,{step:e,bounds:t})})]})}function No({item:e,bounds:t}){let s=ct(e.span.events);return n("li",{class:"tl__step tl__step--span","data-kind":"skill_span","data-skill":e.span.skill,"data-turn":e.turnId,children:[n("span",{class:"tl__dot tl__dot--hollow","aria-hidden":"true"}),n("div",{class:"tl__head",children:[n("span",{class:"tl__kind",children:lo}),n("span",{class:"tl__name",title:e.span.uri??"no skill uri reported",children:e.span.name}),n(Us,{ts:e.span.startedAt,startedAt:t.startedAt})]}),n("div",{class:"tl__body",children:[n(_e,{facts:uo(e.span,s.length,e.finding)}),n(dt,{rows:s})]})]})}function Do({sessionId:e,backHref:t}){return n("section",{class:"empty empty--trace",children:[n("h2",{children:"Session not found"}),n("p",{children:["No events are recorded for ",n("code",{class:"cmd",children:e}),". It may have been removed by retention, or the link is stale."]}),n("a",{class:"btn",href:t,children:"Back to sessions"})]})}function Po({counts:e}){return n("div",{class:"callout",role:"status","data-empty":"never-consulted",children:[n("strong",{children:io}),n("span",{children:["No skill search was recorded, so no candidates were ranked.",e.natives?` The runtime handled ${e.natives===1?"one skill":`${e.natives} skills`} natively.`:""]})]})}var Is="skillar-trace-style";function Uo(){if(typeof document>"u"||document.getElementById(Is))return;let e=document.createElement("style");e.id=Is,e.textContent=Bo,document.head.append(e)}function Bs({route:e,live:t}){Uo();let s=e.sessionId??"",a=z({view:"sessions",filter:e.filter}),[r,o]=E(),[l,i]=E(),[c,d]=E(),[u,m]=E();if(N(()=>{let L=!1;return o(void 0),i(void 0),d(void 0),Promise.all([D.trace(s),D.sessions({}),$s(s)]).then(([w,h,b])=>{L||(o(w),i(h.find(R=>R.id===s)),d(b),m(void 0))}).catch(w=>{L||m(w instanceof Error?w.message:String(w))}),()=>{L=!0}},[s]),N(()=>{if(t.seq===0||!t.last||t.last.id!==s)return;i(t.last);let L=!1;return Promise.all([D.trace(s),$s(s)]).then(([w,h])=>{L||(o(w),d(h),m(void 0))}).catch(w=>{L||m(w instanceof Error?w.message:String(w))}),()=>{L=!0}},[t.seq,s]),r===void 0)return n("section",{class:"trace","aria-busy":"true",children:u&&n("p",{class:"notice",role:"alert",children:["Could not load the trace: ",u]})});if(r.length===0&&!l)return n(Do,{sessionId:s,backHref:a});let p=Ns(r,l),_=Ms(r),v=co(r,c);return n("section",{class:"trace","aria-busy":"false",children:[u&&n("p",{class:"notice",role:"alert",children:["Live update failed: ",u]}),n(bo,{sessionId:s,row:l,steps:r,backHref:a,liveState:t.state,unresolvedLoads:(c?.unattributedLoads.count??0)>0}),c&&n(ut,{loads:c.unattributedLoads}),_.searches===0&&(c?.unattributedLoads.count??0)===0&&n(Po,{counts:_}),v.length>0&&n("div",{class:"card tl__card",children:n("ol",{class:"tl","aria-label":"Session timeline",children:v.map((L,w)=>L.kind==="step"?n(Mo,{step:L.step,bounds:p},`${L.step.ts}-${w}-${L.step.kind}`):n(No,{item:L,bounds:p},`${L.span.id}-${w}`))})})]})}function $s(e){return D.skillReport(e,{automated:"include"}).catch(()=>{})}var Bo=`
|
|
178
|
+
.trace { display: grid; gap: var(--s-4); }
|
|
179
|
+
.trace__head { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
|
|
180
|
+
.trace__back { display: inline-flex; align-items: center; gap: var(--s-1); justify-self: start; min-height: 32px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
|
|
181
|
+
.trace__back:hover { color: var(--ink); }
|
|
182
|
+
.trace__title { margin: 0; font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; }
|
|
183
|
+
.trace__title--dim { color: var(--ink-3); font-style: italic; font-weight: 400; }
|
|
184
|
+
.trace__meta { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin: 0; }
|
|
185
|
+
.trace__meta > div { display: grid; gap: var(--s-1); align-content: start; }
|
|
186
|
+
.trace__meta dt { color: var(--ink-3); font-size: var(--fs-cap); font-weight: 500; }
|
|
187
|
+
.trace__meta dd { margin: 0; color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
|
|
188
|
+
.trace__dim { color: var(--ink-3); }
|
|
189
|
+
.trace__id { font-family: var(--font-mono); font-size: var(--fs-cap); color: var(--ink-2); }
|
|
190
|
+
.trace__counts { margin: 0; color: var(--ink-3); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
|
|
191
|
+
.empty--trace .btn { text-decoration: none; }
|
|
192
|
+
.tl__card { padding: var(--s-4) var(--s-5); }
|
|
193
|
+
.tl { --dot-top: calc(var(--s-2) + 6px); list-style: none; margin: 0; padding: 0 0 0 var(--s-6); }
|
|
194
|
+
.tl__step { --dot: var(--neutral); position: relative; padding-block: var(--s-2) var(--s-4); }
|
|
195
|
+
.tl__step:last-child { padding-bottom: var(--s-2); }
|
|
196
|
+
.tl__step::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--s-1) - 1px - var(--s-6)); width: 2px; background: var(--line-2); }
|
|
197
|
+
.tl__step:first-child::before { top: var(--dot-top); }
|
|
198
|
+
.tl__step:last-child::before { bottom: auto; height: var(--dot-top); }
|
|
199
|
+
.tl__step:only-child::before { display: none; }
|
|
200
|
+
.tl__step--prompt { --dot: var(--ink); }
|
|
201
|
+
.tl__step--search { --dot: var(--accent); }
|
|
202
|
+
.tl__step--load, .tl__step--read_file { --dot: var(--ok); }
|
|
203
|
+
.tl__step--native_skill { --dot: var(--warn); }
|
|
204
|
+
.tl__step--error { --dot: var(--bad); }
|
|
205
|
+
.tl__step--span { --dot: var(--ok); }
|
|
206
|
+
.tl__step--span .tl__body { display: grid; gap: var(--s-1); }
|
|
207
|
+
.tl__dot { position: absolute; left: calc(-1 * var(--s-6)); top: var(--dot-top); width: var(--s-2); height: var(--s-2); border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--surface); }
|
|
208
|
+
.tl__dot--hollow { background: var(--surface); box-shadow: inset 0 0 0 2px var(--dot), 0 0 0 2px var(--surface); }
|
|
209
|
+
.tl__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); }
|
|
210
|
+
.tl__kind { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
|
|
211
|
+
.tl__tag { display: inline-flex; align-items: center; height: 18px; padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-full); background: var(--surface-2); color: var(--ink-2); font: 600 var(--fs-micro) / 1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; }
|
|
212
|
+
.tl__tag--bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: transparent; }
|
|
213
|
+
.tl__time { display: inline-flex; gap: var(--s-2); margin-inline-start: auto; color: var(--ink-3); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
214
|
+
.tl__time b { color: var(--ink-2); font-weight: 500; }
|
|
215
|
+
.tl__body { margin-top: var(--s-1); color: var(--ink-2); font-size: var(--fs-sm); }
|
|
216
|
+
.tl__body > :first-child { margin-top: 0; }
|
|
217
|
+
.tl__text { margin: 0; color: var(--ink); white-space: pre-wrap; }
|
|
218
|
+
.tl__dim { margin: 0; color: var(--ink-3); font-style: italic; }
|
|
219
|
+
.tl__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); margin: 0; }
|
|
220
|
+
.tl__name { color: var(--ink); font-weight: 500; }
|
|
221
|
+
.tl__name--mono { font-family: var(--font-mono); font-size: var(--fs-cap); }
|
|
222
|
+
.tl__uri, .tl__digest, .tl__id, .tl__code { font-family: var(--font-mono); font-size: var(--fs-cap); color: var(--ink-3); overflow-wrap: anywhere; }
|
|
223
|
+
.tl__code { color: var(--bad); font-weight: 500; }
|
|
224
|
+
.tl__errmsg { color: var(--ink-2); }
|
|
225
|
+
.tl__meta { margin: 0; color: var(--ink-3); font-size: var(--fs-cap); }
|
|
226
|
+
.tl__meta--row { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
|
|
227
|
+
.tl__mode { color: var(--ink-2); font-weight: 500; }
|
|
228
|
+
.tl__query { margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--wash); color: var(--ink); font-size: var(--fs-sm); }
|
|
229
|
+
.tl__abstain { display: grid; gap: var(--s-2); margin-top: var(--s-2); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
|
|
230
|
+
.tl__abstain-head { display: flex; flex-wrap: wrap; gap: var(--s-2); }
|
|
231
|
+
.tl__hint { margin: 0; color: var(--ink-2); }
|
|
232
|
+
.tl__save { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
|
|
233
|
+
.tl__save .btn[disabled] { cursor: default; color: var(--ink-2); }
|
|
234
|
+
.tl__save .btn[data-save-eval="saved"] { color: var(--ok); }
|
|
235
|
+
.tl__err { color: var(--bad); font-size: var(--fs-cap); }
|
|
236
|
+
.cands { display: grid; gap: var(--s-1); list-style: none; margin: var(--s-2) 0 0; padding: 0; }
|
|
237
|
+
.cands__none { margin: var(--s-2) 0 0; color: var(--ink-3); font-size: var(--fs-cap); }
|
|
238
|
+
.cands__legend { margin: var(--s-2) 0 0; color: var(--ink-3); font-size: var(--fs-cap); }
|
|
239
|
+
.cands__legend + .cands { margin-top: var(--s-1); }
|
|
240
|
+
.cand { display: grid; grid-template-columns: var(--s-5) minmax(0, 11rem) auto minmax(4rem, 1fr) 2.6em 4.6em var(--s-5); grid-template-areas: "rank name inv bar score cov pick" "rank desc desc desc desc desc desc"; align-items: center; column-gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-sm); font-size: var(--fs-sm); }
|
|
241
|
+
.cand--chosen { background: var(--wash); }
|
|
242
|
+
.cand__rank { grid-area: rank; align-self: start; color: var(--ink-3); font-size: var(--fs-cap); line-height: 1.6; font-variant-numeric: tabular-nums; text-align: right; }
|
|
243
|
+
.cand__name { grid-area: name; display: flex; align-items: baseline; gap: var(--s-1); min-width: 0; color: var(--ink); font-weight: 500; }
|
|
244
|
+
.cand__nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
245
|
+
.cand__root { flex: none; color: var(--ink-3); font: 500 var(--fs-micro) / 1 var(--font-mono); }
|
|
246
|
+
.cand__cov { grid-area: cov; color: var(--ink-3); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
247
|
+
.cand__inv { grid-area: inv; display: inline-flex; align-items: center; height: 18px; padding: 0 var(--s-1); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); font: 600 var(--fs-micro) / 1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; }
|
|
248
|
+
.cand__bar { grid-area: bar; display: block; height: 6px; border-radius: var(--r-full); background: var(--wash-2); overflow: hidden; }
|
|
249
|
+
.cand__fill { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--ink) 35%, transparent); }
|
|
250
|
+
.cand--chosen .cand__fill { background: var(--ok); }
|
|
251
|
+
.cand__score { grid-area: score; color: var(--ink); font-size: var(--fs-cap); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
|
|
252
|
+
.cand__pick { grid-area: pick; display: grid; place-items: center; width: var(--s-5); height: var(--s-5); color: var(--ok); }
|
|
253
|
+
.cand__desc { grid-area: desc; color: var(--ink-3); font-size: var(--fs-cap); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
254
|
+
.cand__matched { color: var(--ink-2); }
|
|
255
|
+
@media (max-width: 639.98px) {
|
|
256
|
+
.trace__head, .tl__card { padding: var(--s-4); }
|
|
257
|
+
.trace__meta { gap: var(--s-3) var(--s-5); }
|
|
258
|
+
.tl__time { flex-basis: 100%; margin-inline-start: 0; }
|
|
259
|
+
.cand { grid-template-columns: var(--s-5) minmax(0, 1fr) auto 2.6em var(--s-5); grid-template-areas: "rank name inv score pick" "rank bar bar cov cov" "rank desc desc desc desc"; row-gap: var(--s-1); }
|
|
260
|
+
.cand__cov { text-align: right; }
|
|
261
|
+
.cand__desc { white-space: normal; }
|
|
262
|
+
}
|
|
263
|
+
`;var Ho=2,Oo=3,Wo=300,zo=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}),Os=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function jo(e){return e.label??e.workspaceId}function Ws(e){return e?{name:e.name,version:`v${e.version}`}:{name:"unregistered",version:null}}function zs(e){let{name:t,version:s}=Ws(e);return s===null?t:`${t} ${s}`}function ft(e){let t=ae(e);return t===void 0?ce:zo.format(t)}function Vo(e){return[["reported",e.reported,"the runtime credited them to this skill"],["single",e.single,"this skill was the only one active"],["co_active",e.coActive,"another skill was active at the same time"]].flatMap(([s,a,r])=>a>0?[{key:s,label:Nn[s],value:a,title:`${a} ${a===1?"call":"calls"}: ${r}`}]:[])}function js(e){let{labels:t,turns:s,abstainedTurns:a}=e.finding.aggregate,r=e.usage.sessions.flatMap(c=>c.spans),o=new Map((e.tree.sessions??[]).map(c=>[c.id,c]));for(let c of e.tree.tabs)for(let d of c.panes)for(let u of d.sessions)u.session&&o.set(u.session.id,u.session);let l=new Map;for(let c of o.values())for(let d of[...c.turns.flatMap(u=>u.events),...c.unassignedEvents]){if(d.kind!=="llm_call"||e.flow?.registeredMs!==null&&e.flow?.registeredMs!==void 0&&d.ts<e.flow.registeredMs||e.flow?.endedMs!==null&&e.flow?.endedMs!==void 0&&d.ts>e.flow.endedMs)continue;let u=JSON.stringify([c.id,d.callId??d.id]),m=ae(d.data.costUsd);l.set(u,l.has(u)&&l.get(u)===void 0?void 0:m)}let i=[...l.values()].filter(c=>c!==void 0);return{turns:s,foundViaSearch:t.found_top1+t.found_lower,abstainedTurns:a,spans:r.length,spansWithCalls:r.filter(c=>c.followThrough>0).length,costUsd:i.length===l.size&&i.length>0?i.reduce((c,d)=>c+d,0):null}}function Vs(e){let t=[{key:"turns",value:e.turns},{key:"found",value:e.foundViaSearch},{key:"spans",withCalls:e.spansWithCalls,total:e.spans}];return e.abstainedTurns>0&&t.push({key:"abstained",value:e.abstainedTurns}),t.push({key:"cost",value:e.costUsd}),t}function qo(e){if(e.kind==="outside_herdr")return[{key:"sessions",value:e.counts.sessions}];let t=[{key:"workspace",value:e.workspaceId}];return e.tabId!==null&&t.push({key:"tab",value:e.tabId}),t.push({key:"panes",value:e.counts.panes},{key:"sessions",value:e.counts.sessions}),e.attribution.inferred>0&&t.push({key:"inferred",value:e.attribution.inferred}),e.attribution.unlinked>0&&t.push({key:"unlinked",value:e.attribution.unlinked}),t}function qs(e){return{...e.filter.from!==void 0?{from:e.filter.from}:{},...e.filter.to!==void 0?{to:e.filter.to}:{},...e.filter.automated!==void 0?{automated:e.filter.automated}:{}}}function Ko(e){return e<=Oo}function Ks(e,t){let s=t?.registeredMs,a=t?.endedMs;return s==null||[...e.turns.flatMap(r=>r.events),...e.unassignedEvents].some(r=>r.ts>=s&&(a==null||r.ts<=a))}function Go(e){let t=new Map;for(let a of e.finding.sessions)for(let r of a.turns)t.set(r.turnId,r);let s=new Map;for(let a of e.usage.sessions)for(let r of a.spans)s.set(r.spanId,r);return{findings:t,usageBySpan:s}}function Xo(e,t,s){if(!t)return[{key:"active",value:e.endedAt-e.startedAt},{key:"calls",value:s},{key:"cost",value:null}];let a=[{key:"active",value:t.durationMs},{key:"callsAfter",value:t.followThrough}];return t.activity.commands>0&&a.push({key:"commands",value:t.activity.commands}),t.activity.unresolvedExec>0&&a.push({key:"unresolvedExec",value:t.activity.unresolvedExec}),t.skillToolCalls>0&&a.push({key:"skillarCalls",value:t.skillToolCalls}),t.toolFailures>0&&a.push({key:"failed",value:t.toolFailures}),t.supportingReads.length>0&&a.push({key:"reads",value:t.supportingReads.length}),a.push({key:"cost",value:t.costUsd}),a}function Gs(){return n("svg",{class:"chev",viewBox:"0 0 24 24",width:"12",height:"12","aria-hidden":"true",focusable:"false",children:n("path",{d:"m9 18 6-6-6-6",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"})})}function Yo({entry:e}){if(e.kind==="outside_herdr")return n("span",{class:"tag tag--dim",children:"no pane link"});let{name:t,version:s}=Ws(e.spec),a=e.spec?`${zs(e.spec)}: the workflow spec this flow was registered with`:"no workflow spec was registered for this herdr workspace";return n("span",{class:e.spec?"tag":"tag tag--dim",title:a,children:[n("span",{class:"tag__name",children:t}),s!==null&&n("span",{class:"tag__suffix",children:s})]})}function Qo({runtime:e}){return n("span",{class:"rt",children:[n("span",{class:"rt__mark","aria-hidden":"true",children:ee[e]??ee.unknown}),n("span",{children:K[e]??K.unknown})]})}function Jo(e,t){let s=e.join(`
|
|
264
|
+
`),a=JSON.stringify(t),[r,o]=E({});return N(()=>{if(e.length===0){o({});return}let l=!1;o(Object.fromEntries(e.map(d=>[d,{status:"loading"}])));let i=[...e],c=async()=>{for(let d=i.shift();d!==void 0&&!l;d=i.shift()){let u=d;try{let m=await D.flowReport(u,t);l||o(p=>({...p,[u]:{status:"ready",summary:js(m)}}))}catch{l||o(m=>({...m,[u]:{status:"error"}}))}}};return Promise.all(Array.from({length:Math.min(Ho,e.length)},c)),()=>{l=!0}},[s,a]),r}function Zo({entry:e,route:t,summary:s}){let a=z({view:"workspace",flowId:e.id,filter:t.filter});return n("li",{class:"wsrow","data-flow":e.id,children:[n("a",{class:"wsrow__title",href:a,children:jo(e)}),n(Yo,{entry:e}),n("time",{class:"wsrow__when",dateTime:e.startedMs===null?void 0:new Date(e.startedMs).toISOString(),children:ft(e.startedMs)}),n(_e,{facts:qo(e),className:"facts wsrow__meta"}),s===void 0||s.status==="loading"?n("p",{class:"facts wsrow__sum dim","data-summary":"loading",children:["reading skill spans","\u2026"]}):s.status==="error"?n("p",{class:"facts wsrow__sum dim","data-summary":"error",children:"skill span summary unavailable"}):n(_e,{facts:Vs(s.summary),className:"facts wsrow__sum"})]})}function ei({filtered:e,route:t,navigate:s}){return e?n("section",{class:"empty",children:[n("h2",{children:"No workspaces in this range"}),n("p",{children:"Widen the time range or remove a filter to see more workspaces."}),n("button",{type:"button",class:"btn",onClick:()=>s({...t,filter:{}}),children:"Clear filters"})]}):n("section",{class:"empty",children:[n("h2",{children:"No herdr workspaces recorded"}),n("p",{children:["skillar groups sessions by the herdr pane they ran in. Start a herdr workspace and run an agent in one of its panes, or run ",n("code",{class:"cmd",children:"skillar doctor"})," to check the herdr connection."]})]})}function Xs({route:e,navigate:t,live:s}){let a=qs(e),r=JSON.stringify(a),[o,l]=E(),[i,c]=E(),[d,u]=E(0);N(()=>{if(s.seq===0)return;let _=setTimeout(()=>u(v=>v+1),Wo);return()=>clearTimeout(_)},[s.seq]),N(()=>{let _=!1;return D.flows(a).then(v=>{_||(l([...v.flows]),c(void 0))}).catch(v=>{_||c(v instanceof Error?v.message:String(v))}),()=>{_=!0}},[r,d]);let m=Jo(o?.map(_=>_.id)??[],a),p=a.from!==void 0||a.to!==void 0;return n("section",{class:"ws","aria-busy":o===void 0,children:[i&&n("p",{class:"notice",role:"alert",children:["Could not load workspaces: ",i]}),o!==void 0&&o.length===0&&n(ei,{filtered:p,route:e,navigate:t}),o!==void 0&&o.length>0&&n("div",{class:"card",children:n("ul",{class:"wslist","aria-label":"herdr workspaces",children:o.map(_=>n(Zo,{entry:_,route:e,summary:m[_.id]},_.id))})})]})}function ti({step:e,specStep:t,uncertain:s=!1}){let a=new Set(e.usedSkills),r=new Set(e.intendedSkills),o=s&&e.panes.length>0;return n("li",{class:"step","data-step":e.stepId,"data-status":e.status,children:[n("div",{class:"step__head",children:[n("span",{class:"step__id",children:e.stepId}),n("span",{class:"tag","data-skill-mode":t?t.together?"together":"alternatives":"unknown",children:t?t.together?"together (all required)":"alternatives (any one)":"skill matching mode unavailable"}),o&&e.status!=="matched"?n("span",{class:"tag","data-step-attribution":"uncertain",children:"attribution unresolved"}):n("span",{class:`badge badge--${e.status}`,title:Pn[e.status],children:Dn[e.status]}),n("span",{class:"dim",children:e.panes.length===0?"no pane mapped":e.panes.join(", ")})]}),n("div",{class:"step__row",children:[n("span",{class:"step__k",children:"intended"}),n("span",{class:"step__v",children:e.intendedSkills.length===0?n("span",{class:"dim",children:"none"}):e.intendedSkills.map(l=>n("span",{class:a.has(l)?"skill":"skill skill--missing",title:a.has(l)?"used in this step":"no attributed use recorded",children:l},l))})]}),n("div",{class:"step__row",children:[n("span",{class:"step__k",children:o?"attributed use":"used"}),n("span",{class:"step__v",children:e.usedSkills.length===0?n("span",{class:"dim",children:o?"unknown":"none"}):e.usedSkills.map(l=>n("span",{class:"skill",title:r.has(l)?"intended by this step":"not intended by this step",children:[l,!r.has(l)&&n("span",{class:"skill__tag",children:"extra"})]},l))})]}),e.unexpectedTools.length>0&&n("p",{class:"dim step__tools",children:["tools outside the step","\u2019","s list: ",e.unexpectedTools.join(", ")]})]})}function ni({comparison:e,specSteps:t,specError:s,uncertain:a}){return n("section",{class:"card ws__block","aria-labelledby":"ws-steps",children:[n("h2",{class:"ws__h",id:"ws-steps",children:"Steps"}),s&&n("p",{class:"notice",role:"alert",children:["Could not read step matching modes: ",s]}),n("ol",{class:"steps",children:e.steps.map(r=>n(ti,{step:r,specStep:t.find(o=>o.id===r.stepId),uncertain:a},r.stepId))}),e.unplanned.length>0&&n("p",{class:"dim",children:["Panes outside the spec: ",e.unplanned.map(r=>`${r.paneId}${r.usedSkills.length?` (${r.usedSkills.join(", ")})`:""}`).join(", ")]})]})}function si({span:e,usage:t,events:s=e.events}){let a=ct(e.events),r=t?Vo(t.attribution):[];return n("li",{class:"span","data-span":e.id,"data-skill":e.skill,children:[n("div",{class:"span__head",children:[n("span",{class:"span__name",title:e.uri??"no skill uri reported",children:e.name}),r.length===0?n("span",{class:"tag tag--dim",children:"no call attributed"}):r.map(o=>n("span",{class:"tag",title:o.title,children:[o.label," ",o.value]},o.key))]}),n(_e,{facts:Xo(e,t,a.length),className:"facts span__facts"}),t&&t.attribution.coActive>0&&n("p",{class:"dim","data-shared-cost":"true",children:"Shared cost observation - co-active skills see the same calls; not additive billing."}),n("p",{class:"span__tokens",children:n(Zt,{parts:Ss(t?.tokens??[])})}),t&&n(Fs,{events:s,usage:t}),n(dt,{rows:a})]})}function ai({turn:e,index:t,finding:s,usageBySpan:a,open:r}){let o=e.events.filter(De).length;return n("li",{children:n("details",{class:"turn",id:`turn-${e.id}`,open:r,"data-turn":e.id,children:[n("summary",{class:"turn__sum",children:[n(Gs,{}),n("span",{class:"turn__n",children:["Turn ",t+1]}),n("time",{class:"turn__time",dateTime:new Date(e.startedAt).toISOString(),children:Os.format(e.startedAt)}),n("span",{class:"tag",title:Mn[e.basis],children:$n[e.basis]}),s&&n("span",{class:"tag",title:Ye[s.label],"data-finding":s.label,children:Xe[s.label]}),n("span",{class:"turn__meta",children:[e.skillSpans.length," ",e.skillSpans.length===1?"skill span":"skill spans"]})]}),s&&n(Cs,{finding:s}),e.skillSpans.length===0?n("p",{class:"dim turn__none",children:["No skill was active in this turn",o>0?`; ${o} ${o===1?"call":"calls"} ran without one`:"","."]}):n("ul",{class:"spans",children:e.skillSpans.map(l=>n(si,{span:l,usage:a.get(l.id),events:e.events},l.id))})]})})}function Hs({link:e,session:t,route:s,findings:a,usageBySpan:r,flow:o,paneClosed:l=!1,newerSession:i=!1}){let c=Ko(t.turns.length),d=!Ks(t,o??null),u=t.endedAt!==null?"ended":l||i||o?.endedMs!=null?"end_not_observed":"in_progress";return n("article",{class:"sess","data-session":t.id,children:[n("header",{class:"sess__head",children:[n(Qo,{runtime:t.runtime}),n("a",{class:"sess__link",href:z({view:"trace",sessionId:t.id,filter:s.filter}),children:"Open trace"}),n("time",{class:"sess__when",dateTime:new Date(t.startedAt).toISOString(),children:ft(t.startedAt)}),n("span",{class:"tag",title:e?e.basis==="reported"?"herdr reported this pane's agent session":"herdr did not report it; skillar inferred it from cwd and time":"no herdr pane is linked to this session",children:e?.basis??"outside herdr"}),n("span",{class:"sess__meta",children:[t.turns.length," ",t.turns.length===1?"turn":"turns"]}),n("span",{class:"tag","data-session-status":u,children:u==="ended"?"ended":u==="end_not_observed"?"end not observed":"in progress"}),d&&n("span",{class:"tag","data-session-window":"outside",title:"Pane history outside this flow's window, not included in step results",children:"outside flow window"})]}),t.turns.length===0?n("p",{class:"dim",children:"No turn was recorded for this session."}):n("ol",{class:"turns",children:t.turns.map((m,p)=>n(ai,{turn:m,index:p,finding:a.get(m.id),usageBySpan:r,open:c},m.id))})]})}function ri({tree:e,route:t,findings:s,usageBySpan:a,filtered:r,flow:o}){if(e.sessions!==void 0)return n("section",{class:"card ws__block","aria-labelledby":"ws-sessions",children:[n("h2",{class:"ws__h",id:"ws-sessions",children:"Sessions"}),e.sessions.length===0&&n("p",{class:"dim",children:"No sessions outside herdr in this range."}),e.sessions.map(i=>n(Hs,{session:i,route:t,findings:s,usageBySpan:a},i.id))]});let l=e.tabs.reduce((i,c)=>i+c.panes.length,0);return n("section",{class:"card ws__block","aria-labelledby":"ws-panes",children:[n("h2",{class:"ws__h",id:"ws-panes",children:"Panes"}),l===0?n("p",{class:"dim",children:"herdr reported no pane for this workspace yet."}):n("ul",{class:"tabsets",children:e.tabs.map(i=>n("li",{class:"tabset",children:[n("p",{class:"tabset__head",children:[n("span",{class:"tabset__name",children:i.label??i.id}),n("span",{class:"dim",children:[i.panes.length," ",i.panes.length===1?"pane":"panes"]})]}),n("ul",{class:"panes",children:i.panes.map(c=>n("li",{children:n("details",{class:"pane",open:!0,"data-pane":c.id,children:[n("summary",{class:"pane__sum",children:[n(Gs,{}),n("span",{class:"pane__name",children:c.label??c.id}),n("span",{class:"pane__meta",children:[c.sessions.length," ",c.sessions.length===1?"session":"sessions"]})]}),n("div",{class:"pane__body",children:[c.sessions.length===0&&n("p",{class:"dim",children:r?"No agent session is shown for this pane; the automated ones are left out.":"No agent session ran in this pane."}),c.sessions.map(d=>d.session===null?n("p",{class:"dim","data-unlinked":d.agentSessionValue,children:["Agent session ",n("code",{class:"cmd",children:d.agentSessionValue})," is not matched to a skillar session yet."]},d.agentSessionValue):n(Hs,{link:d,session:d.session,route:t,findings:s,usageBySpan:a,flow:o,paneClosed:c.closedMs!==null,newerSession:c.sessions.some(u=>u.session!==null&&u.session.startedAt>(d.session?.startedAt??1/0))},d.session.id))]})]})},c.id))})]},i.id))})]})}function oi({report:e,backHref:t,onRefresh:s,busy:a}){let r=e.tree.tabs.reduce((l,i)=>l+i.panes.length,0),o=e.tree.tabs.some(l=>l.panes.some(i=>i.sessions.some(c=>c.session!==null&&!Ks(c.session,e.flow))));return n("header",{class:"ws__head card",children:[n("a",{class:"ws__back",href:t,children:[n("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",focusable:"false",children:n("path",{d:"m15 18-6-6 6-6",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),"Workspaces"]}),n("h1",{class:"ws__title",children:e.label??e.workspaceId}),n("dl",{class:"ws__meta",children:[e.kind!=="outside_herdr"&&n(U,{children:[n("div",{children:[n("dt",{children:"Workspace"}),n("dd",{class:"ws__id",children:e.workspaceId})]}),n("div",{children:[n("dt",{children:"Spec"}),n("dd",{class:e.spec?void 0:"dim",children:zs(e.spec)})]}),n("div",{children:[n("dt",{children:"Started"}),n("dd",{children:ft(e.flow?.registeredMs??null)})]}),n("div",{children:[n("dt",{children:"Ended"}),n("dd",{class:e.flow?.endedMs?void 0:"dim",children:e.flow?.endedMs?ft(e.flow.endedMs):"open"})]}),n("div",{children:[n("dt",{children:"Panes"}),n("dd",{children:r})]})]}),n("div",{children:[n("dt",{children:"Sessions"}),n("dd",{children:e.usage.sessions.length})]})]}),n(_e,{facts:Vs(js(e)),className:"facts ws__counts"}),o&&n("p",{class:"dim","data-pane-history":"true",children:"Turn and session counts include pane history. Step results and unique-call cost cover only this flow's window; outside sessions are labelled below."}),n("div",{class:"ws__actions",children:[n("span",{class:"dim",children:["as of ",Os.format(e.generatedAt)]}),n("button",{type:"button",class:"btn",onClick:s,disabled:a,children:a?"Reading\u2026":"Refresh"})]}),e.excludedSessions.length>0&&n("p",{class:"dim","data-excluded":e.excludedSessions.length,children:[e.excludedSessions.length," automated ",e.excludedSessions.length===1?"session":"sessions"," left out (",[...new Set(e.excludedSessions.map(l=>l.reason))].join(", "),"). Show automated sessions to include them."]})]})}function Ys({route:e}){let t=e.flowId??"",s=z({view:"workspaces",filter:e.filter}),a=qs(e),r=JSON.stringify(a),[o,l]=E(),[i,c]=E(),[d,u]=E(0),[m,p]=E(!0),[_,v]=E([]),[L,w]=E();if(N(()=>{l(void 0),c(void 0),v([]),w(void 0)},[t,r]),N(()=>{let R=!1;return p(!0),D.flowReport(t,a).then(I=>{if(!R&&(l(I),c(void 0),p(!1),I.spec)){let P=I.spec;D.workflowVersions(P.name).then(H=>{if(R)return;let g=H.find(C=>C.version===P.version);g?(v(g.steps),w(void 0)):w("registered spec version not returned")}).catch(H=>{R||w(H instanceof Error?H.message:String(H))})}}).catch(I=>{R||(c(I instanceof Error?I.message:String(I)),p(!1))}),()=>{R=!0}},[t,r,d]),i!==void 0)return n("section",{class:"ws",children:[n("p",{class:"notice",role:"alert",children:["Could not load this flow: ",i]}),n("a",{class:"btn ws__backbtn",href:s,children:"Back to workspaces"})]});if(o===void 0)return n("section",{class:"ws","aria-busy":"true"});let{findings:h,usageBySpan:b}=Go(o);return n("section",{class:"ws","aria-busy":"false",children:[n(oi,{report:o,backHref:s,onRefresh:()=>u(R=>R+1),busy:m}),o.executionScope&&n("aside",{class:"callout",role:"note","data-execution-boundary":o.executionScope.boundary,children:o.executionScope.label}),n(ut,{loads:o.unattributedLoads}),o.comparison&&n(ni,{comparison:o.comparison,specSteps:_,specError:L,uncertain:o.unattributedLoads.count>0}),n(ri,{tree:o.tree,route:e,findings:h,usageBySpan:b,filtered:o.excludedSessions.length>0,flow:o.flow})]})}var ii=`
|
|
265
|
+
.ws { display: grid; gap: var(--s-4); }
|
|
266
|
+
.ws__head { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
|
|
267
|
+
.ws__back { display: inline-flex; align-items: center; gap: var(--s-1); justify-self: start; min-height: 32px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
|
|
268
|
+
.ws__back:hover { color: var(--ink); }
|
|
269
|
+
.ws__backbtn { justify-self: start; text-decoration: none; }
|
|
270
|
+
.ws__title { margin: 0; font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; overflow-wrap: anywhere; }
|
|
271
|
+
.ws__meta { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin: 0; }
|
|
272
|
+
.ws__meta > div { display: grid; gap: var(--s-1); align-content: start; min-width: 0; }
|
|
273
|
+
.ws__meta dt { color: var(--ink-3); font-size: var(--fs-cap); font-weight: 500; }
|
|
274
|
+
.ws__meta dd { margin: 0; color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
|
|
275
|
+
.ws__id { font-family: var(--font-mono); font-size: var(--fs-cap); color: var(--ink-2); }
|
|
276
|
+
.ws__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
|
|
277
|
+
.ws__block { padding: var(--s-4) var(--s-5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
|
|
278
|
+
.ws__h { margin: 0; color: var(--ink-3); font-size: var(--fs-cap); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
|
|
279
|
+
|
|
280
|
+
.wslist { list-style: none; margin: 0; padding: 0; }
|
|
281
|
+
.wsrow { display: grid; grid-template-columns: minmax(min-content, auto) minmax(0, 1fr) auto; grid-template-areas: "title tag when" "meta meta when" "sum sum sum"; align-items: baseline; gap: var(--s-1) var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); transition: background-color var(--t-micro); }
|
|
282
|
+
.wsrow:last-child { border-bottom: 0; }
|
|
283
|
+
.wsrow:hover, .wsrow:has(.wsrow__title:focus-visible) { background: var(--wash); }
|
|
284
|
+
.wsrow__title { grid-area: title; min-width: 0; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
|
|
285
|
+
.wsrow__title:hover { color: var(--ink); text-decoration: underline; }
|
|
286
|
+
.wsrow .tag { grid-area: tag; align-self: center; justify-self: start; }
|
|
287
|
+
.wsrow__when { grid-area: when; color: var(--ink-2); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
288
|
+
.wsrow__meta { grid-area: meta; }
|
|
289
|
+
.wsrow__sum { grid-area: sum; }
|
|
290
|
+
|
|
291
|
+
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
|
|
292
|
+
.step { display: grid; gap: var(--s-1); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); }
|
|
293
|
+
.step__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
|
|
294
|
+
.step__id { color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; }
|
|
295
|
+
.step__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); }
|
|
296
|
+
.step__k { min-width: 4.5rem; color: var(--ink-3); font-size: var(--fs-cap); }
|
|
297
|
+
.step__v { display: flex; flex-wrap: wrap; gap: var(--s-1); min-width: 0; }
|
|
298
|
+
.step__tools { margin: 0; }
|
|
299
|
+
.skill--missing { color: var(--ink-3); border-style: dashed; }
|
|
300
|
+
.skill__tag { margin-inline-start: var(--s-1); color: var(--ink-3); font-size: var(--fs-micro); font-weight: 500; }
|
|
301
|
+
|
|
302
|
+
.tabsets, .panes, .spans, .turns { list-style: none; margin: 0; padding: 0; }
|
|
303
|
+
.tabsets { display: grid; gap: var(--s-4); }
|
|
304
|
+
.tabset__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); margin: 0 0 var(--s-2); }
|
|
305
|
+
.tabset__name { color: var(--ink-2); font-size: var(--fs-cap); font-weight: 600; }
|
|
306
|
+
.panes { display: grid; gap: var(--s-2); }
|
|
307
|
+
.pane { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
|
|
308
|
+
.pane__sum, .turn__sum { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); cursor: pointer; list-style: none; border-radius: var(--r-sm); }
|
|
309
|
+
.pane__sum::-webkit-details-marker, .turn__sum::-webkit-details-marker { display: none; }
|
|
310
|
+
.pane__sum { padding: var(--s-2) var(--s-3); min-height: 36px; }
|
|
311
|
+
.pane__sum:hover, .turn__sum:hover { background: var(--wash); }
|
|
312
|
+
.pane__name { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
|
|
313
|
+
.pane__meta, .sess__meta, .turn__meta { color: var(--ink-3); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
|
|
314
|
+
.pane__body { display: grid; gap: var(--s-3); padding: 0 var(--s-3) var(--s-3); }
|
|
315
|
+
.chev { color: var(--ink-3); flex: none; transition: transform var(--t-micro); }
|
|
316
|
+
details[open] > summary .chev { transform: rotate(90deg); }
|
|
317
|
+
|
|
318
|
+
.sess { display: grid; gap: var(--s-2); padding-inline-start: var(--s-3); border-inline-start: 1px solid var(--line); }
|
|
319
|
+
.sess__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
|
|
320
|
+
.sess__link { font-size: var(--fs-cap); font-weight: 500; }
|
|
321
|
+
.sess__when { color: var(--ink-2); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
322
|
+
|
|
323
|
+
.turns { display: grid; gap: var(--s-1); }
|
|
324
|
+
.turn__sum { padding: var(--s-1) var(--s-2); min-height: 32px; }
|
|
325
|
+
.turn__n { color: var(--ink); font-size: var(--fs-sm); font-weight: 500; }
|
|
326
|
+
.turn__time { color: var(--ink-3); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
|
|
327
|
+
.turn__none { margin: 0; padding: 0 var(--s-2) var(--s-2) var(--s-5); }
|
|
328
|
+
|
|
329
|
+
.spans { display: grid; gap: var(--s-2); padding: var(--s-1) 0 var(--s-2) var(--s-5); }
|
|
330
|
+
.span { display: grid; gap: var(--s-1); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--wash); }
|
|
331
|
+
.span__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
|
|
332
|
+
.span__name { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
|
|
333
|
+
.span__tokens { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin: 0; }
|
|
334
|
+
.evidence { min-width: 0; margin: var(--s-2) 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
|
|
335
|
+
.evidence > summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-sm); }
|
|
336
|
+
.evidence > summary:hover { background: var(--wash); }
|
|
337
|
+
.evidence__body { display: grid; gap: var(--s-2); padding: var(--s-2); }
|
|
338
|
+
.evidence__body p, .evidence__body h3 { margin: 0; }
|
|
339
|
+
.evidence__body h3 { font-size: var(--fs-sm); font-weight: 600; }
|
|
340
|
+
.evidence__body ul, .evidence__body ol { margin: 0; padding-inline-start: var(--s-5); display: grid; gap: var(--s-2); }
|
|
341
|
+
.evidence__body code { display: block; font-family: var(--font-mono); font-size: var(--fs-cap); white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
342
|
+
.evidence__body a { display: inline-block; padding-block: var(--s-3); }
|
|
343
|
+
.turn { scroll-margin-top: var(--s-12); }
|
|
344
|
+
/* Nested tree tracks must shrink with the card, not with the longest metadata label. */
|
|
345
|
+
.tabsets, .panes, .turns, .spans, .pane__body, .sess, .evidence__body { grid-template-columns: minmax(0, 1fr); }
|
|
346
|
+
|
|
347
|
+
@media (max-width: 639.98px) {
|
|
348
|
+
.ws__head, .ws__block { padding: var(--s-4); }
|
|
349
|
+
.ws__meta { gap: var(--s-3) var(--s-5); }
|
|
350
|
+
/* A spec name can be 64 characters, so the row stacks instead of racing the title against the tag. */
|
|
351
|
+
.wsrow { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "tag" "when" "meta" "sum"; }
|
|
352
|
+
.spans, .turn__none { padding-inline-start: var(--s-3); }
|
|
353
|
+
}
|
|
354
|
+
`;se("workspaces",ii);function li(){let[e,t]=E(()=>Lt(location.hash));N(()=>{let a=()=>t(Lt(location.hash));return addEventListener("hashchange",a),()=>removeEventListener("hashchange",a)},[]);let s=Cn(a=>{location.hash=z(a)},[]);return[e,s]}function ci(){let[e,t]=E({state:"connecting",seq:0});return N(()=>D.events({onState:s=>t(a=>a.state===s?a:{...a,state:s}),onSession:s=>t(a=>({...a,seq:a.seq+1,last:s}))}),[]),e}var di={connecting:"connecting",live:"live",offline:"offline",fixtures:"fixtures"},Qs=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1});function ui(e){let t=[];for(let s of Ie){let a=e[s];if(a!==void 0)switch(s){case"from":t.push({key:s,label:"from",value:Qs.format(a)});break;case"to":t.push({key:s,label:"to",value:Qs.format(a)});break;case"runtime":t.push({key:s,label:"runtime",value:e.runtime.map(r=>K[r]).join(", ")});break;case"skill":t.push({key:s,label:"skill",value:e.skill.map(Q).join(", ")});break;case"state":t.push({key:s,label:"state",value:e.state.map(r=>G[r]).join(", ")});break;case"dow":t.push({key:s,label:"day",value:te[a]??String(a)});break;case"hour":{let r=e.hourSpan??1;t.push({key:s,label:"hour",value:`${String(a).padStart(2,"0")}:00-${String((a+r)%24).padStart(2,"0")}:00`});break}case"hourSpan":break;case"q":t.push({key:s,label:"search",value:String(a)});break;case"automated":t.push({key:s,label:"automated",value:a==="only"?"only":"shown"});break}}return t}function pi({route:e,navigate:t}){let s=ui(e.filter);return s.length?n("div",{class:"filters","aria-label":"Active filters",children:[s.map(a=>n("span",{class:"chip",children:[n("span",{class:"chip__k",children:a.label}),n("span",{class:"chip__v",title:a.value,children:a.value}),n("button",{type:"button",class:"chip__x","aria-label":`Remove ${a.label} filter`,onClick:()=>t({...e,filter:Un(e.filter,a.key)}),children:"\xD7"})]},a.key)),s.length>1&&n("button",{type:"button",class:"btn",onClick:()=>t({...e,filter:{}}),children:"Clear"})]}):null}var fi="Sessions you did not start: Codex thread titles, Herdr pane recaps, scheduled jobs, memory reflection and dreaming runs, and sessions with no prompt or skill activity. Hidden from every view unless shown.";function mi({route:e,navigate:t,live:s}){let[a,r]=E(0),{automated:o,...l}=e.filter,i=z({view:"sessions",filter:l});return N(()=>{let c=!1;return D.stats(l).then(d=>{c||r(d.automatedSessions??0)},()=>{c||r(0)}),()=>{c=!0}},[i,s.seq]),e.filter.automated!==void 0||a===0?null:n("button",{type:"button",class:"btn","data-automated-toggle":!0,title:fi,onClick:()=>t({...e,filter:{...e.filter,automated:"include"}}),children:`${a} automated ${a===1?"session":"sessions"} hidden \xB7 Show`})}var _i=[{view:"sessions",label:"Sessions"},{view:"workspaces",label:"Workspaces"},{view:"flow",label:"Flow"},{view:"heatmap",label:"Heatmap"}],hi={sessions:"sessions",trace:"sessions",workspaces:"workspaces",workspace:"workspaces",flow:"flow",heatmap:"heatmap"};function gi(){let[e,t]=li(),s=ci(),a=hi[e.view],r={route:e,navigate:t,live:s};return n(U,{children:[n("header",{class:"top",children:n("div",{class:"wrap",children:[n("div",{class:"top__row",children:[n("a",{class:"brand",href:z({view:"sessions",filter:e.filter}),children:"skillar"}),n("span",{class:`live live--${s.state}`,role:"status","aria-live":"polite",children:[n("span",{class:"live__dot","aria-hidden":"true"}),di[s.state]]}),n(pi,{route:e,navigate:t}),n(mi,{route:e,navigate:t,live:s})]}),n("nav",{class:"tabs","aria-label":"Views",children:_i.map(o=>n("a",{class:"tab",href:z({view:o.view,filter:e.filter}),"aria-current":a===o.view?"page":void 0,children:o.label},o.view))})]})}),n("main",{class:"page wrap",children:[e.view==="sessions"&&n(ys,{...r}),e.view==="trace"&&n(Bs,{...r}),e.view==="workspaces"&&n(Xs,{...r}),e.view==="workspace"&&n(Ys,{...r}),e.view==="flow"&&n(es,{...r}),e.view==="heatmap"&&n(gs,{...r})]})]})}var Js=document.getElementById("app");Js&&vn(n(gi,{}),Js);export{fi as AUTOMATED_EXPLAINER,hi as TAB_OF};
|