@grackle-ai/web 0.74.0 → 0.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{a as z,j as w}from"./markdown-gcy1Jmzi.js";import{u as Z,s as q,t as tt,a as et,B as nt,K as rt}from"./index-Lmn8JecQ.js";import{t as it,b as st,z as at,s as D,c as H}from"./dagview-BA5TtMAQ.js";function ot(t,e){var n,c=1;t==null&&(t=0),e==null&&(e=0);function r(){var a,u=n.length,f,_=0,o=0;for(a=0;a<u;++a)f=n[a],_+=f.x,o+=f.y;for(_=(_/u-t)*c,o=(o/u-e)*c,a=0;a<u;++a)f=n[a],f.x-=_,f.y-=o}return r.initialize=function(a){n=a},r.x=function(a){return arguments.length?(t=+a,r):t},r.y=function(a){return arguments.length?(e=+a,r):e},r.strength=function(a){return arguments.length?(c=+a,r):c},r}function ct(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return J(this.cover(e,n),e,n,t)}function J(t,e,n,c){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,u={data:c},f=t._x0,_=t._y0,o=t._x1,g=t._y1,p,v,h,y,s,i,l,d;if(!a)return t._root=u,t;for(;a.length;)if((s=e>=(p=(f+o)/2))?f=p:o=p,(i=n>=(v=(_+g)/2))?_=v:g=v,r=a,!(a=a[l=i<<1|s]))return r[l]=u,t;if(h=+t._x.call(null,a.data),y=+t._y.call(null,a.data),e===h&&n===y)return u.next=a,r?r[l]=u:t._root=u,t;do r=r?r[l]=new Array(4):t._root=new Array(4),(s=e>=(p=(f+o)/2))?f=p:o=p,(i=n>=(v=(_+g)/2))?_=v:g=v;while((l=i<<1|s)===(d=(y>=v)<<1|h>=p));return r[d]=a,r[l]=u,t}function lt(t){var e,n,c=t.length,r,a,u=new Array(c),f=new Array(c),_=1/0,o=1/0,g=-1/0,p=-1/0;for(n=0;n<c;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(u[n]=r,f[n]=a,r<_&&(_=r),r>g&&(g=r),a<o&&(o=a),a>p&&(p=a));if(_>g||o>p)return this;for(this.cover(_,o).cover(g,p),n=0;n<c;++n)J(this,u[n],f[n],t[n]);return this}function ut(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,c=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(c=Math.floor(e))+1;else{for(var u=r-n||1,f=this._root,_,o;n>t||t>=r||c>e||e>=a;)switch(o=(e<c)<<1|t<n,_=new Array(4),_[o]=f,f=_,u*=2,o){case 0:r=n+u,a=c+u;break;case 1:n=r-u,a=c+u;break;case 2:r=n+u,c=a-u;break;case 3:n=r-u,c=a-u;break}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=c,this._x1=r,this._y1=a,this}function ft(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function ht(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(t,e,n,c,r){this.node=t,this.x0=e,this.y0=n,this.x1=c,this.y1=r}function dt(t,e,n){var c,r=this._x0,a=this._y0,u,f,_,o,g=this._x1,p=this._y1,v=[],h=this._root,y,s;for(h&&v.push(new L(h,r,a,g,p)),n==null?n=1/0:(r=t-n,a=e-n,g=t+n,p=e+n,n*=n);y=v.pop();)if(!(!(h=y.node)||(u=y.x0)>g||(f=y.y0)>p||(_=y.x1)<r||(o=y.y1)<a))if(h.length){var i=(u+_)/2,l=(f+o)/2;v.push(new L(h[3],i,l,_,o),new L(h[2],u,l,i,o),new L(h[1],i,f,_,l),new L(h[0],u,f,i,l)),(s=(e>=l)<<1|t>=i)&&(y=v[v.length-1],v[v.length-1]=v[v.length-1-s],v[v.length-1-s]=y)}else{var d=t-+this._x.call(null,h.data),N=e-+this._y.call(null,h.data),x=d*d+N*N;if(x<n){var b=Math.sqrt(n=x);r=t-b,a=e-b,g=t+b,p=e+b,c=h.data}}return c}function gt(t){if(isNaN(g=+this._x.call(null,t))||isNaN(p=+this._y.call(null,t)))return this;var e,n=this._root,c,r,a,u=this._x0,f=this._y0,_=this._x1,o=this._y1,g,p,v,h,y,s,i,l;if(!n)return this;if(n.length)for(;;){if((y=g>=(v=(u+_)/2))?u=v:_=v,(s=p>=(h=(f+o)/2))?f=h:o=h,e=n,!(n=n[i=s<<1|y]))return this;if(!n.length)break;(e[i+1&3]||e[i+2&3]||e[i+3&3])&&(c=e,l=i)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[i]=a:delete e[i],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(c?c[l]=n:this._root=n),this):(this._root=a,this)}function xt(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function _t(){return this._root}function mt(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function vt(t){var e=[],n,c=this._root,r,a,u,f,_;for(c&&e.push(new L(c,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(c=n.node,a=n.x0,u=n.y0,f=n.x1,_=n.y1)&&c.length){var o=(a+f)/2,g=(u+_)/2;(r=c[3])&&e.push(new L(r,o,g,f,_)),(r=c[2])&&e.push(new L(r,a,g,o,_)),(r=c[1])&&e.push(new L(r,o,u,f,g)),(r=c[0])&&e.push(new L(r,a,u,o,g))}return this}function yt(t){var e=[],n=[],c;for(this._root&&e.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));c=e.pop();){var r=c.node;if(r.length){var a,u=c.x0,f=c.y0,_=c.x1,o=c.y1,g=(u+_)/2,p=(f+o)/2;(a=r[0])&&e.push(new L(a,u,f,g,p)),(a=r[1])&&e.push(new L(a,g,f,_,p)),(a=r[2])&&e.push(new L(a,u,p,g,o)),(a=r[3])&&e.push(new L(a,g,p,_,o))}n.push(c)}for(;c=n.pop();)t(c.node,c.x0,c.y0,c.x1,c.y1);return this}function pt(t){return t[0]}function wt(t){return arguments.length?(this._x=t,this):this._x}function Nt(t){return t[1]}function bt(t){return arguments.length?(this._y=t,this):this._y}function U(t,e,n){var c=new P(e??pt,n??Nt,NaN,NaN,NaN,NaN);return t==null?c:c.addAll(t)}function P(t,e,n,c,r,a){this._x=t,this._y=e,this._x0=n,this._y0=c,this._x1=r,this._y1=a,this._root=void 0}function W(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var M=U.prototype=P.prototype;M.copy=function(){var t=new P(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,c;if(!e)return t;if(!e.length)return t._root=W(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(c=e.source[r])&&(c.length?n.push({source:c,target:e.target[r]=new Array(4)}):e.target[r]=W(c));return t};M.add=ct;M.addAll=lt;M.cover=ut;M.data=ft;M.extent=ht;M.find=dt;M.remove=gt;M.removeAll=xt;M.root=_t;M.size=mt;M.visit=vt;M.visitAfter=yt;M.x=wt;M.y=bt;function $(t){return function(){return t}}function S(t){return(t()-.5)*1e-6}function kt(t){return t.x+t.vx}function jt(t){return t.y+t.vy}function zt(t){var e,n,c,r=1,a=1;typeof t!="function"&&(t=$(t==null?1:+t));function u(){for(var o,g=e.length,p,v,h,y,s,i,l=0;l<a;++l)for(p=U(e,kt,jt).visitAfter(f),o=0;o<g;++o)v=e[o],s=n[v.index],i=s*s,h=v.x+v.vx,y=v.y+v.vy,p.visit(d);function d(N,x,b,C,m){var k=N.data,I=N.r,A=s+I;if(k){if(k.index>v.index){var B=h-k.x-k.vx,T=y-k.y-k.vy,R=B*B+T*T;R<A*A&&(B===0&&(B=S(c),R+=B*B),T===0&&(T=S(c),R+=T*T),R=(A-(R=Math.sqrt(R)))/R*r,v.vx+=(B*=R)*(A=(I*=I)/(i+I)),v.vy+=(T*=R)*A,k.vx-=B*(A=1-A),k.vy-=T*A)}return}return x>h+A||C<h-A||b>y+A||m<y-A}}function f(o){if(o.data)return o.r=n[o.data.index];for(var g=o.r=0;g<4;++g)o[g]&&o[g].r>o.r&&(o.r=o[g].r)}function _(){if(e){var o,g=e.length,p;for(n=new Array(g),o=0;o<g;++o)p=e[o],n[p.index]=+t(p,o,e)}}return u.initialize=function(o,g){e=o,c=g,_()},u.iterations=function(o){return arguments.length?(a=+o,u):a},u.strength=function(o){return arguments.length?(r=+o,u):r},u.radius=function(o){return arguments.length?(t=typeof o=="function"?o:$(+o),_(),u):t},u}function At(t){return t.index}function Q(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Ct(t){var e=At,n=p,c,r=$(30),a,u,f,_,o,g=1;t==null&&(t=[]);function p(i){return 1/Math.min(f[i.source.index],f[i.target.index])}function v(i){for(var l=0,d=t.length;l<g;++l)for(var N=0,x,b,C,m,k,I,A;N<d;++N)x=t[N],b=x.source,C=x.target,m=C.x+C.vx-b.x-b.vx||S(o),k=C.y+C.vy-b.y-b.vy||S(o),I=Math.sqrt(m*m+k*k),I=(I-a[N])/I*i*c[N],m*=I,k*=I,C.vx-=m*(A=_[N]),C.vy-=k*A,b.vx+=m*(A=1-A),b.vy+=k*A}function h(){if(u){var i,l=u.length,d=t.length,N=new Map(u.map((b,C)=>[e(b,C,u),b])),x;for(i=0,f=new Array(l);i<d;++i)x=t[i],x.index=i,typeof x.source!="object"&&(x.source=Q(N,x.source)),typeof x.target!="object"&&(x.target=Q(N,x.target)),f[x.source.index]=(f[x.source.index]||0)+1,f[x.target.index]=(f[x.target.index]||0)+1;for(i=0,_=new Array(d);i<d;++i)x=t[i],_[i]=f[x.source.index]/(f[x.source.index]+f[x.target.index]);c=new Array(d),y(),a=new Array(d),s()}}function y(){if(u)for(var i=0,l=t.length;i<l;++i)c[i]=+n(t[i],i,t)}function s(){if(u)for(var i=0,l=t.length;i<l;++i)a[i]=+r(t[i],i,t)}return v.initialize=function(i,l){u=i,o=l,h()},v.links=function(i){return arguments.length?(t=i,h(),v):t},v.id=function(i){return arguments.length?(e=i,v):e},v.iterations=function(i){return arguments.length?(g=+i,v):g},v.strength=function(i){return arguments.length?(n=typeof i=="function"?i:$(+i),y(),v):n},v.distance=function(i){return arguments.length?(r=typeof i=="function"?i:$(+i),s(),v):r},v}const Lt=1664525,Mt=1013904223,V=4294967296;function Et(){let t=1;return()=>(t=(Lt*t+Mt)%V)/V}function It(t){return t.x}function Rt(t){return t.y}var Dt=10,Bt=Math.PI*(3-Math.sqrt(5));function Tt(t){var e,n=1,c=.001,r=1-Math.pow(c,1/300),a=0,u=.6,f=new Map,_=it(p),o=st("tick","end"),g=Et();t==null&&(t=[]);function p(){v(),o.call("tick",e),n<c&&(_.stop(),o.call("end",e))}function v(s){var i,l=t.length,d;s===void 0&&(s=1);for(var N=0;N<s;++N)for(n+=(a-n)*r,f.forEach(function(x){x(n)}),i=0;i<l;++i)d=t[i],d.fx==null?d.x+=d.vx*=u:(d.x=d.fx,d.vx=0),d.fy==null?d.y+=d.vy*=u:(d.y=d.fy,d.vy=0);return e}function h(){for(var s=0,i=t.length,l;s<i;++s){if(l=t[s],l.index=s,l.fx!=null&&(l.x=l.fx),l.fy!=null&&(l.y=l.fy),isNaN(l.x)||isNaN(l.y)){var d=Dt*Math.sqrt(.5+s),N=s*Bt;l.x=d*Math.cos(N),l.y=d*Math.sin(N)}(isNaN(l.vx)||isNaN(l.vy))&&(l.vx=l.vy=0)}}function y(s){return s.initialize&&s.initialize(t,g),s}return h(),e={tick:v,restart:function(){return _.restart(p),e},stop:function(){return _.stop(),e},nodes:function(s){return arguments.length?(t=s,h(),f.forEach(y),e):t},alpha:function(s){return arguments.length?(n=+s,e):n},alphaMin:function(s){return arguments.length?(c=+s,e):c},alphaDecay:function(s){return arguments.length?(r=+s,e):+r},alphaTarget:function(s){return arguments.length?(a=+s,e):a},velocityDecay:function(s){return arguments.length?(u=1-s,e):1-u},randomSource:function(s){return arguments.length?(g=s,f.forEach(y),e):g},force:function(s,i){return arguments.length>1?(i==null?f.delete(s):f.set(s,y(i)),e):f.get(s)},find:function(s,i,l){var d=0,N=t.length,x,b,C,m,k;for(l==null?l=1/0:l*=l,d=0;d<N;++d)m=t[d],x=s-m.x,b=i-m.y,C=x*x+b*b,C<l&&(k=m,l=C);return k},on:function(s,i){return arguments.length>1?(o.on(s,i),e):o.on(s)}}}function St(){var t,e,n,c,r=$(-30),a,u=1,f=1/0,_=.81;function o(h){var y,s=t.length,i=U(t,It,Rt).visitAfter(p);for(c=h,y=0;y<s;++y)e=t[y],i.visit(v)}function g(){if(t){var h,y=t.length,s;for(a=new Array(y),h=0;h<y;++h)s=t[h],a[s.index]=+r(s,h,t)}}function p(h){var y=0,s,i,l=0,d,N,x;if(h.length){for(d=N=x=0;x<4;++x)(s=h[x])&&(i=Math.abs(s.value))&&(y+=s.value,l+=i,d+=i*s.x,N+=i*s.y);h.x=d/l,h.y=N/l}else{s=h,s.x=s.data.x,s.y=s.data.y;do y+=a[s.data.index];while(s=s.next)}h.value=y}function v(h,y,s,i){if(!h.value)return!0;var l=h.x-e.x,d=h.y-e.y,N=i-y,x=l*l+d*d;if(N*N/_<x)return x<f&&(l===0&&(l=S(n),x+=l*l),d===0&&(d=S(n),x+=d*d),x<u&&(x=Math.sqrt(u*x)),e.vx+=l*h.value*c/x,e.vy+=d*h.value*c/x),!0;if(h.length||x>=f)return;(h.data!==e||h.next)&&(l===0&&(l=S(n),x+=l*l),d===0&&(d=S(n),x+=d*d),x<u&&(x=Math.sqrt(u*x)));do h.data!==e&&(N=a[h.data.index]*c/x,e.vx+=l*N,e.vy+=d*N);while(h=h.next)}return o.initialize=function(h,y){t=h,n=y,g()},o.strength=function(h){return arguments.length?(r=typeof h=="function"?h:$(+h),g(),o):r},o.distanceMin=function(h){return arguments.length?(u=h*h,o):Math.sqrt(u)},o.distanceMax=function(h){return arguments.length?(f=h*h,o):Math.sqrt(f)},o.theta=function(h){return arguments.length?(_=h*h,o):Math.sqrt(_)},o}const $t="_graphContainer_zxmzw_1",Ot="_svg_zxmzw_10",Gt="_link_zxmzw_18",Ft="_node_zxmzw_30",Kt="_nodeCard_zxmzw_34",Ut="_nodeLabel_zxmzw_40",Pt="_selected_zxmzw_44",Ht="_dimmed_zxmzw_51",Wt="_dimmedLink_zxmzw_56",Qt="_nodeIndicator_zxmzw_68",Vt="_nodeBadge_zxmzw_82",E={graphContainer:$t,svg:Ot,link:Gt,node:Ft,nodeCard:Kt,nodeLabel:Ut,selected:Pt,dimmed:Ht,dimmedLink:Wt,nodeIndicator:Qt,nodeBadge:Vt},F={reference:"#4A9EFF",decision:"#22C55E",insight:"#EAB308",concept:"#A855F7",snippet:"#6B7280"};function X(t){return t.kind==="reference"?F.reference:F[t.category??"insight"]??F.insight}const O=200,G=52,Y=12;function Xt({graphData:t,selectedNodeId:e,onNodeClick:n,onNodeDoubleClick:c}){const r=z.useRef(null),a=z.useRef(null),u=z.useRef(void 0),f=z.useRef(void 0),_=z.useRef(void 0),o=z.useRef(void 0),[g,p]=z.useState({width:800,height:600});z.useEffect(()=>{var l;const s=((l=r.current)==null?void 0:l.parentElement)??null;if(!s)return;const i=new ResizeObserver(d=>{for(const N of d)p({width:N.contentRect.width,height:N.contentRect.height})});return i.observe(s),p({width:s.clientWidth,height:s.clientHeight}),()=>{i.disconnect()}},[]),z.useEffect(()=>{if(!r.current||!a.current)return;const s=r.current,i=a.current,l=at().scaleExtent([.1,4]).filter(d=>d.type!=="dblclick").on("zoom",d=>{D(i).attr("transform",String(d.transform))});return D(s).call(l),f.current=l,()=>{D(s).on(".zoom",null)}},[]);const v=z.useRef(n);v.current=n;const h=z.useRef(c);h.current=c,z.useEffect(()=>{if(!a.current)return;const s=a.current;if(u.current&&(u.current.stop(),u.current=void 0),t.nodes.length===0){D(s).selectAll("*").remove();return}const i=t.nodes.map(m=>({...m})),l=new Map(i.map(m=>[m.id,m])),d=t.links.filter(m=>l.has(m.source)&&l.has(m.target)).map(m=>({source:m.source,target:m.target,type:m.type}));D(s).selectAll("*").remove();const N=D(s).selectAll("line").data(d).enter().append("line").attr("class",E.link);N.append("title").text(m=>m.type),_.current=N;const x=D(s).selectAll("g.kg-node").data(i).enter().append("g").attr("class",`kg-node ${E.node}`).style("cursor","pointer").on("click",(m,k)=>{v.current(k.id)}).on("dblclick",(m,k)=>{h.current(k.id)});o.current=x,x.append("rect").attr("class",E.nodeCard).attr("width",O).attr("height",G).attr("rx",Y).attr("ry",Y).style("--node-color",m=>X(m)),x.append("rect").attr("class",E.nodeIndicator).attr("width",4).attr("height",G).attr("rx",2).attr("fill",m=>X(m)),x.append("text").attr("class",E.nodeLabel).attr("x",O/2).attr("y",G/2-4).attr("text-anchor","middle").attr("dominant-baseline","central").text(m=>m.label.length>26?m.label.substring(0,24)+"...":m.label),x.append("text").attr("class",E.nodeBadge).attr("x",O/2).attr("y",G-8).attr("text-anchor","middle").text(m=>(m.kind==="reference"?m.sourceType??"ref":m.category??"").toUpperCase());const b=Tt(i).force("link",Ct(d).id(m=>m.id).distance(140)).force("charge",St().strength(-400)).force("center",ot(g.width/2,g.height/2)).force("collide",zt(O/2+16)).on("tick",()=>{N.attr("x1",m=>m.source.x??0).attr("y1",m=>m.source.y??0).attr("x2",m=>m.target.x??0).attr("y2",m=>m.target.y??0),x.attr("transform",m=>`translate(${(m.x??0)-O/2},${(m.y??0)-G/2})`)});u.current=b;const C=setTimeout(()=>{if(r.current&&f.current){const m=f.current,k=H.translate(g.width/2,g.height/2).scale(.8).translate(-g.width/2,-g.height/2);D(r.current).transition().duration(500).call(m.transform,k)}},1200);return()=>{clearTimeout(C),b.stop()}},[t,g]),z.useEffect(()=>{if(!a.current||!o.current||!_.current)return;if(!e){o.current.classed(E.dimmed,!1).classed(E.selected,!1),_.current.classed(E.dimmedLink,!1);return}const s=new Set([e]);_.current.each(i=>{const l=i.source.id,d=i.target.id;(l===e||d===e)&&(s.add(l),s.add(d))}),o.current.classed(E.selected,i=>i.id===e).classed(E.dimmed,i=>!s.has(i.id)),_.current.classed(E.dimmedLink,i=>{const l=i.source.id,d=i.target.id;return!s.has(l)||!s.has(d)})},[e,t]);const y=z.useCallback(()=>{if(!e||!u.current||!r.current||!f.current)return;const s=u.current.nodes().find(i=>i.id===e);if(s&&Number.isFinite(s.x)&&Number.isFinite(s.y)){const i=f.current,l=H.translate(g.width/2,g.height/2).scale(1.2).translate(-(s.x??0),-(s.y??0));D(r.current).transition().duration(500).call(i.transform,l)}},[e,g]);return z.useEffect(()=>{y()},[y]),w.jsx("div",{className:E.graphContainer,"data-testid":"knowledge-graph",children:w.jsxs("svg",{ref:r,width:g.width,height:g.height,className:E.svg,children:[w.jsx("defs",{children:w.jsxs("filter",{id:"glow",children:[w.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),w.jsxs("feMerge",{children:[w.jsx("feMergeNode",{in:"coloredBlur"}),w.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),w.jsx("g",{ref:a})]})})}const Yt="_panel_1ml6r_1",Jt="_header_1ml6r_24",Zt="_title_1ml6r_32",qt="_closeButton_1ml6r_42",te="_body_1ml6r_55",ee="_badge_1ml6r_61",ne="_section_1ml6r_72",re="_sectionLabel_1ml6r_76",ie="_content_1ml6r_84",se="_tags_1ml6r_92",ae="_tag_1ml6r_92",oe="_viewLink_1ml6r_107",ce="_edgeList_1ml6r_121",le="_edgeItem_1ml6r_127",ue="_edgeType_1ml6r_136",fe="_edgeNodeLink_1ml6r_142",he="_timestamps_1ml6r_154",j={panel:Yt,header:Jt,title:Zt,closeButton:qt,body:te,badge:ee,section:ne,sectionLabel:re,content:ie,tags:se,tag:ae,viewLink:oe,edgeList:ce,edgeItem:le,edgeType:ue,edgeNodeLink:fe,timestamps:he};function de({detail:t,onClose:e,onSelectNode:n}){const c=Z(),{node:r,edges:a}=t;function u(){if(!(r.kind!=="reference"||!r.sourceId))switch(r.sourceType){case"task":c(tt(r.sourceId));break;case"session":c(q(r.sourceId));break}}return w.jsxs("div",{className:j.panel,"data-testid":"knowledge-detail-panel",children:[w.jsxs("div",{className:j.header,children:[w.jsx("h3",{className:j.title,children:r.label}),w.jsx("button",{className:j.closeButton,onClick:e,"aria-label":"Close",children:"×"})]}),w.jsxs("div",{className:j.body,children:[w.jsx("div",{className:j.badge,children:r.kind==="reference"?`Reference (${r.sourceType})`:r.category}),r.content&&w.jsxs("div",{className:j.section,children:[w.jsx("div",{className:j.sectionLabel,children:"Content"}),w.jsx("p",{className:j.content,children:r.content})]}),r.tags&&r.tags.length>0&&w.jsxs("div",{className:j.section,children:[w.jsx("div",{className:j.sectionLabel,children:"Tags"}),w.jsx("div",{className:j.tags,children:r.tags.map(f=>w.jsx("span",{className:j.tag,children:f},f))})]}),r.kind==="reference"&&r.sourceId&&w.jsx("div",{className:j.section,children:w.jsx("button",{className:j.viewLink,onClick:u,children:"View in Grackle →"})}),a.length>0&&w.jsxs("div",{className:j.section,children:[w.jsxs("div",{className:j.sectionLabel,children:["Edges (",a.length,")"]}),w.jsx("ul",{className:j.edgeList,children:a.map(f=>{const _=f.fromId===r.id?f.toId:f.fromId,o=`${f.fromId}:${f.toId}:${f.type}`;return w.jsxs("li",{className:j.edgeItem,children:[w.jsx("span",{className:j.edgeType,children:f.type}),w.jsxs("button",{className:j.edgeNodeLink,onClick:()=>{n(_)},children:[_.substring(0,8),"..."]})]},o)})})]}),w.jsxs("div",{className:j.timestamps,children:[r.createdAt&&w.jsxs("div",{children:["Created: ",new Date(r.createdAt).toLocaleDateString()]}),r.updatedAt&&w.jsxs("div",{children:["Updated: ",new Date(r.updatedAt).toLocaleDateString()]})]})]})]})}const ge="_layout_n9vg6_1",xe="_graphArea_n9vg6_8",_e="_empty_n9vg6_15",K={layout:ge,graphArea:xe,empty:_e};function pe(){const{knowledge:t}=et(),e=z.useCallback(()=>{t.loadRecent()},[t.loadRecent]);z.useEffect(()=>{e()},[e]);const n=z.useCallback(u=>{t.selectNode(u)},[t]),c=z.useCallback(u=>{t.expandNode(u)},[t]),r=z.useCallback(()=>{t.clearSelection()},[t]),a=[{label:"Knowledge",url:rt}];return w.jsxs("div",{className:K.layout,"data-testid":"knowledge-page",children:[w.jsx(nt,{segments:a}),w.jsxs("div",{className:K.graphArea,children:[t.graphData.nodes.length===0&&!t.loading?w.jsxs("div",{className:K.empty,children:[w.jsx("p",{children:"No knowledge nodes found."}),w.jsx("p",{children:"Create knowledge via MCP tools or let agents discover it during tasks."})]}):w.jsx(Xt,{graphData:t.graphData,selectedNodeId:t.selectedId,onNodeClick:n,onNodeDoubleClick:c}),t.selectedNode&&t.selectedId&&w.jsx(de,{detail:t.selectedNode,onClose:r,onSelectNode:n})]})]})}export{pe as KnowledgePage};
1
+ import{a as z,j as w}from"./markdown-gcy1Jmzi.js";import{u as Z,s as q,t as tt,a as et,B as nt,K as rt}from"./index-DAUShzMA.js";import{t as it,b as st,z as at,s as D,c as H}from"./dagview-BA5TtMAQ.js";function ot(t,e){var n,c=1;t==null&&(t=0),e==null&&(e=0);function r(){var a,u=n.length,f,_=0,o=0;for(a=0;a<u;++a)f=n[a],_+=f.x,o+=f.y;for(_=(_/u-t)*c,o=(o/u-e)*c,a=0;a<u;++a)f=n[a],f.x-=_,f.y-=o}return r.initialize=function(a){n=a},r.x=function(a){return arguments.length?(t=+a,r):t},r.y=function(a){return arguments.length?(e=+a,r):e},r.strength=function(a){return arguments.length?(c=+a,r):c},r}function ct(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return J(this.cover(e,n),e,n,t)}function J(t,e,n,c){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,u={data:c},f=t._x0,_=t._y0,o=t._x1,g=t._y1,p,v,h,y,s,i,l,d;if(!a)return t._root=u,t;for(;a.length;)if((s=e>=(p=(f+o)/2))?f=p:o=p,(i=n>=(v=(_+g)/2))?_=v:g=v,r=a,!(a=a[l=i<<1|s]))return r[l]=u,t;if(h=+t._x.call(null,a.data),y=+t._y.call(null,a.data),e===h&&n===y)return u.next=a,r?r[l]=u:t._root=u,t;do r=r?r[l]=new Array(4):t._root=new Array(4),(s=e>=(p=(f+o)/2))?f=p:o=p,(i=n>=(v=(_+g)/2))?_=v:g=v;while((l=i<<1|s)===(d=(y>=v)<<1|h>=p));return r[d]=a,r[l]=u,t}function lt(t){var e,n,c=t.length,r,a,u=new Array(c),f=new Array(c),_=1/0,o=1/0,g=-1/0,p=-1/0;for(n=0;n<c;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(u[n]=r,f[n]=a,r<_&&(_=r),r>g&&(g=r),a<o&&(o=a),a>p&&(p=a));if(_>g||o>p)return this;for(this.cover(_,o).cover(g,p),n=0;n<c;++n)J(this,u[n],f[n],t[n]);return this}function ut(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,c=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(c=Math.floor(e))+1;else{for(var u=r-n||1,f=this._root,_,o;n>t||t>=r||c>e||e>=a;)switch(o=(e<c)<<1|t<n,_=new Array(4),_[o]=f,f=_,u*=2,o){case 0:r=n+u,a=c+u;break;case 1:n=r-u,a=c+u;break;case 2:r=n+u,c=a-u;break;case 3:n=r-u,c=a-u;break}this._root&&this._root.length&&(this._root=f)}return this._x0=n,this._y0=c,this._x1=r,this._y1=a,this}function ft(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function ht(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(t,e,n,c,r){this.node=t,this.x0=e,this.y0=n,this.x1=c,this.y1=r}function dt(t,e,n){var c,r=this._x0,a=this._y0,u,f,_,o,g=this._x1,p=this._y1,v=[],h=this._root,y,s;for(h&&v.push(new L(h,r,a,g,p)),n==null?n=1/0:(r=t-n,a=e-n,g=t+n,p=e+n,n*=n);y=v.pop();)if(!(!(h=y.node)||(u=y.x0)>g||(f=y.y0)>p||(_=y.x1)<r||(o=y.y1)<a))if(h.length){var i=(u+_)/2,l=(f+o)/2;v.push(new L(h[3],i,l,_,o),new L(h[2],u,l,i,o),new L(h[1],i,f,_,l),new L(h[0],u,f,i,l)),(s=(e>=l)<<1|t>=i)&&(y=v[v.length-1],v[v.length-1]=v[v.length-1-s],v[v.length-1-s]=y)}else{var d=t-+this._x.call(null,h.data),N=e-+this._y.call(null,h.data),x=d*d+N*N;if(x<n){var b=Math.sqrt(n=x);r=t-b,a=e-b,g=t+b,p=e+b,c=h.data}}return c}function gt(t){if(isNaN(g=+this._x.call(null,t))||isNaN(p=+this._y.call(null,t)))return this;var e,n=this._root,c,r,a,u=this._x0,f=this._y0,_=this._x1,o=this._y1,g,p,v,h,y,s,i,l;if(!n)return this;if(n.length)for(;;){if((y=g>=(v=(u+_)/2))?u=v:_=v,(s=p>=(h=(f+o)/2))?f=h:o=h,e=n,!(n=n[i=s<<1|y]))return this;if(!n.length)break;(e[i+1&3]||e[i+2&3]||e[i+3&3])&&(c=e,l=i)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[i]=a:delete e[i],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(c?c[l]=n:this._root=n),this):(this._root=a,this)}function xt(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function _t(){return this._root}function mt(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function vt(t){var e=[],n,c=this._root,r,a,u,f,_;for(c&&e.push(new L(c,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(c=n.node,a=n.x0,u=n.y0,f=n.x1,_=n.y1)&&c.length){var o=(a+f)/2,g=(u+_)/2;(r=c[3])&&e.push(new L(r,o,g,f,_)),(r=c[2])&&e.push(new L(r,a,g,o,_)),(r=c[1])&&e.push(new L(r,o,u,f,g)),(r=c[0])&&e.push(new L(r,a,u,o,g))}return this}function yt(t){var e=[],n=[],c;for(this._root&&e.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));c=e.pop();){var r=c.node;if(r.length){var a,u=c.x0,f=c.y0,_=c.x1,o=c.y1,g=(u+_)/2,p=(f+o)/2;(a=r[0])&&e.push(new L(a,u,f,g,p)),(a=r[1])&&e.push(new L(a,g,f,_,p)),(a=r[2])&&e.push(new L(a,u,p,g,o)),(a=r[3])&&e.push(new L(a,g,p,_,o))}n.push(c)}for(;c=n.pop();)t(c.node,c.x0,c.y0,c.x1,c.y1);return this}function pt(t){return t[0]}function wt(t){return arguments.length?(this._x=t,this):this._x}function Nt(t){return t[1]}function bt(t){return arguments.length?(this._y=t,this):this._y}function U(t,e,n){var c=new P(e??pt,n??Nt,NaN,NaN,NaN,NaN);return t==null?c:c.addAll(t)}function P(t,e,n,c,r,a){this._x=t,this._y=e,this._x0=n,this._y0=c,this._x1=r,this._y1=a,this._root=void 0}function W(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var M=U.prototype=P.prototype;M.copy=function(){var t=new P(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,c;if(!e)return t;if(!e.length)return t._root=W(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(c=e.source[r])&&(c.length?n.push({source:c,target:e.target[r]=new Array(4)}):e.target[r]=W(c));return t};M.add=ct;M.addAll=lt;M.cover=ut;M.data=ft;M.extent=ht;M.find=dt;M.remove=gt;M.removeAll=xt;M.root=_t;M.size=mt;M.visit=vt;M.visitAfter=yt;M.x=wt;M.y=bt;function $(t){return function(){return t}}function S(t){return(t()-.5)*1e-6}function kt(t){return t.x+t.vx}function jt(t){return t.y+t.vy}function zt(t){var e,n,c,r=1,a=1;typeof t!="function"&&(t=$(t==null?1:+t));function u(){for(var o,g=e.length,p,v,h,y,s,i,l=0;l<a;++l)for(p=U(e,kt,jt).visitAfter(f),o=0;o<g;++o)v=e[o],s=n[v.index],i=s*s,h=v.x+v.vx,y=v.y+v.vy,p.visit(d);function d(N,x,b,C,m){var k=N.data,I=N.r,A=s+I;if(k){if(k.index>v.index){var B=h-k.x-k.vx,T=y-k.y-k.vy,R=B*B+T*T;R<A*A&&(B===0&&(B=S(c),R+=B*B),T===0&&(T=S(c),R+=T*T),R=(A-(R=Math.sqrt(R)))/R*r,v.vx+=(B*=R)*(A=(I*=I)/(i+I)),v.vy+=(T*=R)*A,k.vx-=B*(A=1-A),k.vy-=T*A)}return}return x>h+A||C<h-A||b>y+A||m<y-A}}function f(o){if(o.data)return o.r=n[o.data.index];for(var g=o.r=0;g<4;++g)o[g]&&o[g].r>o.r&&(o.r=o[g].r)}function _(){if(e){var o,g=e.length,p;for(n=new Array(g),o=0;o<g;++o)p=e[o],n[p.index]=+t(p,o,e)}}return u.initialize=function(o,g){e=o,c=g,_()},u.iterations=function(o){return arguments.length?(a=+o,u):a},u.strength=function(o){return arguments.length?(r=+o,u):r},u.radius=function(o){return arguments.length?(t=typeof o=="function"?o:$(+o),_(),u):t},u}function At(t){return t.index}function Q(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Ct(t){var e=At,n=p,c,r=$(30),a,u,f,_,o,g=1;t==null&&(t=[]);function p(i){return 1/Math.min(f[i.source.index],f[i.target.index])}function v(i){for(var l=0,d=t.length;l<g;++l)for(var N=0,x,b,C,m,k,I,A;N<d;++N)x=t[N],b=x.source,C=x.target,m=C.x+C.vx-b.x-b.vx||S(o),k=C.y+C.vy-b.y-b.vy||S(o),I=Math.sqrt(m*m+k*k),I=(I-a[N])/I*i*c[N],m*=I,k*=I,C.vx-=m*(A=_[N]),C.vy-=k*A,b.vx+=m*(A=1-A),b.vy+=k*A}function h(){if(u){var i,l=u.length,d=t.length,N=new Map(u.map((b,C)=>[e(b,C,u),b])),x;for(i=0,f=new Array(l);i<d;++i)x=t[i],x.index=i,typeof x.source!="object"&&(x.source=Q(N,x.source)),typeof x.target!="object"&&(x.target=Q(N,x.target)),f[x.source.index]=(f[x.source.index]||0)+1,f[x.target.index]=(f[x.target.index]||0)+1;for(i=0,_=new Array(d);i<d;++i)x=t[i],_[i]=f[x.source.index]/(f[x.source.index]+f[x.target.index]);c=new Array(d),y(),a=new Array(d),s()}}function y(){if(u)for(var i=0,l=t.length;i<l;++i)c[i]=+n(t[i],i,t)}function s(){if(u)for(var i=0,l=t.length;i<l;++i)a[i]=+r(t[i],i,t)}return v.initialize=function(i,l){u=i,o=l,h()},v.links=function(i){return arguments.length?(t=i,h(),v):t},v.id=function(i){return arguments.length?(e=i,v):e},v.iterations=function(i){return arguments.length?(g=+i,v):g},v.strength=function(i){return arguments.length?(n=typeof i=="function"?i:$(+i),y(),v):n},v.distance=function(i){return arguments.length?(r=typeof i=="function"?i:$(+i),s(),v):r},v}const Lt=1664525,Mt=1013904223,V=4294967296;function Et(){let t=1;return()=>(t=(Lt*t+Mt)%V)/V}function It(t){return t.x}function Rt(t){return t.y}var Dt=10,Bt=Math.PI*(3-Math.sqrt(5));function Tt(t){var e,n=1,c=.001,r=1-Math.pow(c,1/300),a=0,u=.6,f=new Map,_=it(p),o=st("tick","end"),g=Et();t==null&&(t=[]);function p(){v(),o.call("tick",e),n<c&&(_.stop(),o.call("end",e))}function v(s){var i,l=t.length,d;s===void 0&&(s=1);for(var N=0;N<s;++N)for(n+=(a-n)*r,f.forEach(function(x){x(n)}),i=0;i<l;++i)d=t[i],d.fx==null?d.x+=d.vx*=u:(d.x=d.fx,d.vx=0),d.fy==null?d.y+=d.vy*=u:(d.y=d.fy,d.vy=0);return e}function h(){for(var s=0,i=t.length,l;s<i;++s){if(l=t[s],l.index=s,l.fx!=null&&(l.x=l.fx),l.fy!=null&&(l.y=l.fy),isNaN(l.x)||isNaN(l.y)){var d=Dt*Math.sqrt(.5+s),N=s*Bt;l.x=d*Math.cos(N),l.y=d*Math.sin(N)}(isNaN(l.vx)||isNaN(l.vy))&&(l.vx=l.vy=0)}}function y(s){return s.initialize&&s.initialize(t,g),s}return h(),e={tick:v,restart:function(){return _.restart(p),e},stop:function(){return _.stop(),e},nodes:function(s){return arguments.length?(t=s,h(),f.forEach(y),e):t},alpha:function(s){return arguments.length?(n=+s,e):n},alphaMin:function(s){return arguments.length?(c=+s,e):c},alphaDecay:function(s){return arguments.length?(r=+s,e):+r},alphaTarget:function(s){return arguments.length?(a=+s,e):a},velocityDecay:function(s){return arguments.length?(u=1-s,e):1-u},randomSource:function(s){return arguments.length?(g=s,f.forEach(y),e):g},force:function(s,i){return arguments.length>1?(i==null?f.delete(s):f.set(s,y(i)),e):f.get(s)},find:function(s,i,l){var d=0,N=t.length,x,b,C,m,k;for(l==null?l=1/0:l*=l,d=0;d<N;++d)m=t[d],x=s-m.x,b=i-m.y,C=x*x+b*b,C<l&&(k=m,l=C);return k},on:function(s,i){return arguments.length>1?(o.on(s,i),e):o.on(s)}}}function St(){var t,e,n,c,r=$(-30),a,u=1,f=1/0,_=.81;function o(h){var y,s=t.length,i=U(t,It,Rt).visitAfter(p);for(c=h,y=0;y<s;++y)e=t[y],i.visit(v)}function g(){if(t){var h,y=t.length,s;for(a=new Array(y),h=0;h<y;++h)s=t[h],a[s.index]=+r(s,h,t)}}function p(h){var y=0,s,i,l=0,d,N,x;if(h.length){for(d=N=x=0;x<4;++x)(s=h[x])&&(i=Math.abs(s.value))&&(y+=s.value,l+=i,d+=i*s.x,N+=i*s.y);h.x=d/l,h.y=N/l}else{s=h,s.x=s.data.x,s.y=s.data.y;do y+=a[s.data.index];while(s=s.next)}h.value=y}function v(h,y,s,i){if(!h.value)return!0;var l=h.x-e.x,d=h.y-e.y,N=i-y,x=l*l+d*d;if(N*N/_<x)return x<f&&(l===0&&(l=S(n),x+=l*l),d===0&&(d=S(n),x+=d*d),x<u&&(x=Math.sqrt(u*x)),e.vx+=l*h.value*c/x,e.vy+=d*h.value*c/x),!0;if(h.length||x>=f)return;(h.data!==e||h.next)&&(l===0&&(l=S(n),x+=l*l),d===0&&(d=S(n),x+=d*d),x<u&&(x=Math.sqrt(u*x)));do h.data!==e&&(N=a[h.data.index]*c/x,e.vx+=l*N,e.vy+=d*N);while(h=h.next)}return o.initialize=function(h,y){t=h,n=y,g()},o.strength=function(h){return arguments.length?(r=typeof h=="function"?h:$(+h),g(),o):r},o.distanceMin=function(h){return arguments.length?(u=h*h,o):Math.sqrt(u)},o.distanceMax=function(h){return arguments.length?(f=h*h,o):Math.sqrt(f)},o.theta=function(h){return arguments.length?(_=h*h,o):Math.sqrt(_)},o}const $t="_graphContainer_zxmzw_1",Ot="_svg_zxmzw_10",Gt="_link_zxmzw_18",Ft="_node_zxmzw_30",Kt="_nodeCard_zxmzw_34",Ut="_nodeLabel_zxmzw_40",Pt="_selected_zxmzw_44",Ht="_dimmed_zxmzw_51",Wt="_dimmedLink_zxmzw_56",Qt="_nodeIndicator_zxmzw_68",Vt="_nodeBadge_zxmzw_82",E={graphContainer:$t,svg:Ot,link:Gt,node:Ft,nodeCard:Kt,nodeLabel:Ut,selected:Pt,dimmed:Ht,dimmedLink:Wt,nodeIndicator:Qt,nodeBadge:Vt},F={reference:"#4A9EFF",decision:"#22C55E",insight:"#EAB308",concept:"#A855F7",snippet:"#6B7280"};function X(t){return t.kind==="reference"?F.reference:F[t.category??"insight"]??F.insight}const O=200,G=52,Y=12;function Xt({graphData:t,selectedNodeId:e,onNodeClick:n,onNodeDoubleClick:c}){const r=z.useRef(null),a=z.useRef(null),u=z.useRef(void 0),f=z.useRef(void 0),_=z.useRef(void 0),o=z.useRef(void 0),[g,p]=z.useState({width:800,height:600});z.useEffect(()=>{var l;const s=((l=r.current)==null?void 0:l.parentElement)??null;if(!s)return;const i=new ResizeObserver(d=>{for(const N of d)p({width:N.contentRect.width,height:N.contentRect.height})});return i.observe(s),p({width:s.clientWidth,height:s.clientHeight}),()=>{i.disconnect()}},[]),z.useEffect(()=>{if(!r.current||!a.current)return;const s=r.current,i=a.current,l=at().scaleExtent([.1,4]).filter(d=>d.type!=="dblclick").on("zoom",d=>{D(i).attr("transform",String(d.transform))});return D(s).call(l),f.current=l,()=>{D(s).on(".zoom",null)}},[]);const v=z.useRef(n);v.current=n;const h=z.useRef(c);h.current=c,z.useEffect(()=>{if(!a.current)return;const s=a.current;if(u.current&&(u.current.stop(),u.current=void 0),t.nodes.length===0){D(s).selectAll("*").remove();return}const i=t.nodes.map(m=>({...m})),l=new Map(i.map(m=>[m.id,m])),d=t.links.filter(m=>l.has(m.source)&&l.has(m.target)).map(m=>({source:m.source,target:m.target,type:m.type}));D(s).selectAll("*").remove();const N=D(s).selectAll("line").data(d).enter().append("line").attr("class",E.link);N.append("title").text(m=>m.type),_.current=N;const x=D(s).selectAll("g.kg-node").data(i).enter().append("g").attr("class",`kg-node ${E.node}`).style("cursor","pointer").on("click",(m,k)=>{v.current(k.id)}).on("dblclick",(m,k)=>{h.current(k.id)});o.current=x,x.append("rect").attr("class",E.nodeCard).attr("width",O).attr("height",G).attr("rx",Y).attr("ry",Y).style("--node-color",m=>X(m)),x.append("rect").attr("class",E.nodeIndicator).attr("width",4).attr("height",G).attr("rx",2).attr("fill",m=>X(m)),x.append("text").attr("class",E.nodeLabel).attr("x",O/2).attr("y",G/2-4).attr("text-anchor","middle").attr("dominant-baseline","central").text(m=>m.label.length>26?m.label.substring(0,24)+"...":m.label),x.append("text").attr("class",E.nodeBadge).attr("x",O/2).attr("y",G-8).attr("text-anchor","middle").text(m=>(m.kind==="reference"?m.sourceType??"ref":m.category??"").toUpperCase());const b=Tt(i).force("link",Ct(d).id(m=>m.id).distance(140)).force("charge",St().strength(-400)).force("center",ot(g.width/2,g.height/2)).force("collide",zt(O/2+16)).on("tick",()=>{N.attr("x1",m=>m.source.x??0).attr("y1",m=>m.source.y??0).attr("x2",m=>m.target.x??0).attr("y2",m=>m.target.y??0),x.attr("transform",m=>`translate(${(m.x??0)-O/2},${(m.y??0)-G/2})`)});u.current=b;const C=setTimeout(()=>{if(r.current&&f.current){const m=f.current,k=H.translate(g.width/2,g.height/2).scale(.8).translate(-g.width/2,-g.height/2);D(r.current).transition().duration(500).call(m.transform,k)}},1200);return()=>{clearTimeout(C),b.stop()}},[t,g]),z.useEffect(()=>{if(!a.current||!o.current||!_.current)return;if(!e){o.current.classed(E.dimmed,!1).classed(E.selected,!1),_.current.classed(E.dimmedLink,!1);return}const s=new Set([e]);_.current.each(i=>{const l=i.source.id,d=i.target.id;(l===e||d===e)&&(s.add(l),s.add(d))}),o.current.classed(E.selected,i=>i.id===e).classed(E.dimmed,i=>!s.has(i.id)),_.current.classed(E.dimmedLink,i=>{const l=i.source.id,d=i.target.id;return!s.has(l)||!s.has(d)})},[e,t]);const y=z.useCallback(()=>{if(!e||!u.current||!r.current||!f.current)return;const s=u.current.nodes().find(i=>i.id===e);if(s&&Number.isFinite(s.x)&&Number.isFinite(s.y)){const i=f.current,l=H.translate(g.width/2,g.height/2).scale(1.2).translate(-(s.x??0),-(s.y??0));D(r.current).transition().duration(500).call(i.transform,l)}},[e,g]);return z.useEffect(()=>{y()},[y]),w.jsx("div",{className:E.graphContainer,"data-testid":"knowledge-graph",children:w.jsxs("svg",{ref:r,width:g.width,height:g.height,className:E.svg,children:[w.jsx("defs",{children:w.jsxs("filter",{id:"glow",children:[w.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),w.jsxs("feMerge",{children:[w.jsx("feMergeNode",{in:"coloredBlur"}),w.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),w.jsx("g",{ref:a})]})})}const Yt="_panel_1ml6r_1",Jt="_header_1ml6r_24",Zt="_title_1ml6r_32",qt="_closeButton_1ml6r_42",te="_body_1ml6r_55",ee="_badge_1ml6r_61",ne="_section_1ml6r_72",re="_sectionLabel_1ml6r_76",ie="_content_1ml6r_84",se="_tags_1ml6r_92",ae="_tag_1ml6r_92",oe="_viewLink_1ml6r_107",ce="_edgeList_1ml6r_121",le="_edgeItem_1ml6r_127",ue="_edgeType_1ml6r_136",fe="_edgeNodeLink_1ml6r_142",he="_timestamps_1ml6r_154",j={panel:Yt,header:Jt,title:Zt,closeButton:qt,body:te,badge:ee,section:ne,sectionLabel:re,content:ie,tags:se,tag:ae,viewLink:oe,edgeList:ce,edgeItem:le,edgeType:ue,edgeNodeLink:fe,timestamps:he};function de({detail:t,onClose:e,onSelectNode:n}){const c=Z(),{node:r,edges:a}=t;function u(){if(!(r.kind!=="reference"||!r.sourceId))switch(r.sourceType){case"task":c(tt(r.sourceId));break;case"session":c(q(r.sourceId));break}}return w.jsxs("div",{className:j.panel,"data-testid":"knowledge-detail-panel",children:[w.jsxs("div",{className:j.header,children:[w.jsx("h3",{className:j.title,children:r.label}),w.jsx("button",{className:j.closeButton,onClick:e,"aria-label":"Close",children:"×"})]}),w.jsxs("div",{className:j.body,children:[w.jsx("div",{className:j.badge,children:r.kind==="reference"?`Reference (${r.sourceType})`:r.category}),r.content&&w.jsxs("div",{className:j.section,children:[w.jsx("div",{className:j.sectionLabel,children:"Content"}),w.jsx("p",{className:j.content,children:r.content})]}),r.tags&&r.tags.length>0&&w.jsxs("div",{className:j.section,children:[w.jsx("div",{className:j.sectionLabel,children:"Tags"}),w.jsx("div",{className:j.tags,children:r.tags.map(f=>w.jsx("span",{className:j.tag,children:f},f))})]}),r.kind==="reference"&&r.sourceId&&w.jsx("div",{className:j.section,children:w.jsx("button",{className:j.viewLink,onClick:u,children:"View in Grackle →"})}),a.length>0&&w.jsxs("div",{className:j.section,children:[w.jsxs("div",{className:j.sectionLabel,children:["Edges (",a.length,")"]}),w.jsx("ul",{className:j.edgeList,children:a.map(f=>{const _=f.fromId===r.id?f.toId:f.fromId,o=`${f.fromId}:${f.toId}:${f.type}`;return w.jsxs("li",{className:j.edgeItem,children:[w.jsx("span",{className:j.edgeType,children:f.type}),w.jsxs("button",{className:j.edgeNodeLink,onClick:()=>{n(_)},children:[_.substring(0,8),"..."]})]},o)})})]}),w.jsxs("div",{className:j.timestamps,children:[r.createdAt&&w.jsxs("div",{children:["Created: ",new Date(r.createdAt).toLocaleDateString()]}),r.updatedAt&&w.jsxs("div",{children:["Updated: ",new Date(r.updatedAt).toLocaleDateString()]})]})]})]})}const ge="_layout_n9vg6_1",xe="_graphArea_n9vg6_8",_e="_empty_n9vg6_15",K={layout:ge,graphArea:xe,empty:_e};function pe(){const{knowledge:t}=et(),e=z.useCallback(()=>{t.loadRecent()},[t.loadRecent]);z.useEffect(()=>{e()},[e]);const n=z.useCallback(u=>{t.selectNode(u)},[t]),c=z.useCallback(u=>{t.expandNode(u)},[t]),r=z.useCallback(()=>{t.clearSelection()},[t]),a=[{label:"Knowledge",url:rt}];return w.jsxs("div",{className:K.layout,"data-testid":"knowledge-page",children:[w.jsx(nt,{segments:a}),w.jsxs("div",{className:K.graphArea,children:[t.graphData.nodes.length===0&&!t.loading?w.jsxs("div",{className:K.empty,children:[w.jsx("p",{children:"No knowledge nodes found."}),w.jsx("p",{children:"Create knowledge via MCP tools or let agents discover it during tasks."})]}):w.jsx(Xt,{graphData:t.graphData,selectedNodeId:t.selectedId,onNodeClick:n,onNodeDoubleClick:c}),t.selectedNode&&t.selectedId&&w.jsx(de,{detail:t.selectedNode,onClose:r,onSelectNode:n})]})]})}export{pe as KnowledgePage};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-BKJXh1be.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-BUipATbG.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
2
  import{r as ZS,a as b,j as c,v as XS,b as QS,t as Gr,i as WS,f as JS,M as th,c as nh}from"./markdown-gcy1Jmzi.js";import{r as eT,d as Zv,H as Xv,P as Qv,i as tT,B as nT,a as aT,C as sT,M as iT}from"./dagview-BA5TtMAQ.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Yd={exports:{}},Yo={},Zd={exports:{}},Xd={};/**
3
3
  * @license React
4
4
  * scheduler.production.js
@@ -109,4 +109,4 @@ const grackle = await host.mcpServer({
109
109
  url: env.vars.GRACKLE_MCP_URL,
110
110
  });
111
111
 
112
- $\`Summarize the current tasks.\`;`,rows:20,className:$e.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:$e.formActions,children:[c.jsx("button",{type:"submit",className:$e.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:oe,className:$e.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:$e.container,children:[c.jsxs("div",{className:$e.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:te,className:$e.btnPrimary,children:"+ New Persona"})]}),(m||d)&&le(),t.length===0&&!m?c.jsx("p",{className:$e.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:$e.list,children:t.map(F=>{const ye=a===F.id,Te=F.type==="script";return c.jsxs("div",{className:`${$e.card} ${(d==null?void 0:d.id)===F.id?$e.active:""}`,"data-testid":`persona-card-${F.id}`,children:[c.jsxs("div",{className:$e.cardHeader,children:[c.jsxs("span",{className:$e.cardTitle,children:[c.jsx("strong",{children:F.name}),c.jsx("span",{className:$e.typeBadge,"data-testid":`persona-type-badge-${F.id}`,children:Te?"Script":"Agent"}),ye&&c.jsx("span",{className:$e.defaultBadge,"data-testid":`persona-default-badge-${F.id}`,children:"App Default"})]}),c.jsxs("div",{className:$e.cardActions,children:[!ye&&c.jsx("button",{onClick:()=>u(F.id),className:$e.btnSmall,"data-testid":`persona-set-default-${F.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>U(F),className:$e.btnSmall,children:"Edit"}),v===F.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>q(F.id),className:$e.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:$e.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(F.id),className:$e.btnSmall,children:"Delete"})]})]}),F.description&&c.jsx("p",{className:$e.description,children:F.description}),c.jsxs("div",{className:$e.meta,children:[F.runtime&&c.jsxs("span",{children:["Runtime: ",F.runtime]}),F.model&&c.jsxs("span",{children:["Model: ",F.model]}),F.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",F.maxTurns]})]}),Te?c.jsxs("details",{className:$e.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:$e.promptText,children:F.script})]}):c.jsxs("details",{className:$e.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:$e.promptText,children:F.systemPrompt})]})]},F.id)})})]})}function bL(){const{personas:t,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=ut();return c.jsx(yL,{personas:t,appDefaultPersonaId:r,onCreatePersona:a,onUpdatePersona:i,onDeletePersona:o,onSetAppDefaultPersonaId:u})}function xL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=Db();return c.jsxs("section",{className:fe.section,children:[c.jsx("h3",{className:fe.sectionTitle,children:"Appearance"}),c.jsx("p",{className:fe.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:fe.themeOptions,children:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${fe.themeOption} ${p?fe.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:fe.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:fe.themeOptionLabel,children:u.label}),c.jsx("span",{className:fe.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:fe.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&m?fe.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&!m?fe.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:fe.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:fe.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:fe.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:fe.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:fe.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function _L(){return c.jsx(xL,{})}function SL({connected:t,environments:a,sessions:i}){const o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:fe.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:fe.sectionTitle,children:"About"}),c.jsx("p",{className:fe.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:fe.aboutGrid,children:[c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Connection"}),c.jsxs("span",{className:fe.aboutValue,children:[c.jsx("span",{className:`${fe.aboutDot} ${t?fe.aboutDotConnected:fe.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Environments"}),c.jsxs("span",{className:fe.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:fe.aboutValue,children:u})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Version"}),c.jsx("span",{className:fe.aboutValue,children:"0.73.1"})]})]})]})}function TL(){const{connected:t,environments:a,sessions:i}=ut();return c.jsx(SL,{connected:t,environments:a,sessions:i})}const kL="_wizard_1260s_1",CL="_container_1260s_10",EL="_stepContent_1260s_19",NL="_logoArea_1260s_28",jL="_logoImage_1260s_32",wL="_heading_1260s_41",AL="_tagline_1260s_49",DL="_subtitle_1260s_56",RL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",OL="_runtimeCard_1260s_101",BL="_runtimeName_1260s_133",IL="_runtimeDescription_1260s_139",LL="_buttonRow_1260s_144",UL="_primaryButton_1260s_151",zL="_ghostButton_1260s_185",VL="_dots_1260s_213",HL="_dot_1260s_213",at={wizard:kL,container:CL,stepContent:EL,logoArea:NL,logoImage:jL,heading:wL,tagline:AL,subtitle:DL,featureList:RL,runtimeGrid:ML,runtimeCard:OL,runtimeName:BL,runtimeDescription:IL,buttonRow:LL,primaryButton:UL,ghostButton:zL,dots:VL,dot:HL};function PL({onNext:t}){return c.jsxs("div",{className:at.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:at.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:at.logoImage})}),c.jsx("h1",{className:at.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:at.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function GL({onNext:t,onBack:a}){return c.jsxs("div",{className:at.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:at.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:at.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:at.buttonRow,children:[c.jsx("button",{type:"button",className:at.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const $L=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function FL({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=b.useState(t||"claude-code");return b.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:at.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:at.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:at.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:at.runtimeGrid,children:$L.map(d=>c.jsxs("button",{type:"button",className:at.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:at.runtimeName,children:d.name}),c.jsx("span",{className:at.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:at.buttonRow,children:[c.jsx("button",{type:"button",className:at.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const qL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function KL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=ut(),r=Mt(),[u,d]=b.useState(0),p=t.find(g=>g.id==="claude-code"),m=b.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx(Fn,{to:"/",replace:!0}):c.jsx("div",{className:at.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:at.container,children:[c.jsx(Wn,{mode:"wait",children:c.jsxs(Et.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(PL,{onNext:()=>d(1)}),u===1&&c.jsx(GL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(FL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:at.dots,children:Array.from({length:qL},(g,v)=>c.jsx("span",{className:at.dot,"data-active":v===u},v))})]})})}const YL="_root_zndgp_1",ZL="_body_zndgp_7",XL="_main_zndgp_19",QL="_sidebarWrapper_zndgp_26",WL="_overlay_zndgp_51",il={root:YL,body:ZL,main:XL,sidebarWrapper:QL,overlay:WL},JL=b.lazy(()=>hT(()=>import("./KnowledgePage-BKJXh1be.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),e8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function t8(){const{connected:t,environments:a,sessions:i,tasks:o}=ut(),r=At(),d=Ob()!==void 0,[p,m]=b.useState(!1),g=b.useCallback(()=>m(v=>!v),[]);return b.useEffect(()=>{m(!1)},[r.pathname]),b.useEffect(()=>{if(!p)return;const v=y=>{y.key==="Escape"&&m(!1)};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[p]),c.jsxs(c.Fragment,{children:[c.jsx(eE,{connected:t,environments:a,sessions:i,onToggleSidebar:d?g:void 0,sidebarOpen:p}),c.jsx(lE,{}),c.jsxs("div",{className:il.body,children:[d&&c.jsx("div",{className:il.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(mE,{})}),d&&p&&c.jsx("div",{className:il.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:il.main,children:[c.jsx(Hs,{}),c.jsx(WD,{sessions:i,tasks:o,environments:a})]})]}),c.jsx(dR,{})]})}function n8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=ut(),{showToast:r}=Ps();NM(a,r);const u=Mt(),d=At();return b.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(_b(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx(Fn,{to:"/setup",replace:!0}):c.jsx(rE,{children:c.jsx("div",{className:il.root,children:c.jsx(t8,{})})})}function Tf(){const{workspaceId:t}=rs(),{workspaces:a}=ut(),i=At(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx(Fn,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx(Fn,{to:p,replace:!0})}function a8(){return c.jsxs(kk,{children:[c.jsx(Ce,{path:"setup",element:c.jsx(KL,{})}),c.jsxs(Ce,{element:c.jsx(n8,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(eB,{})}),c.jsx(Ce,{path:"chat",element:c.jsx(wB,{})}),c.jsx(Ce,{path:"sessions/new",element:c.jsx(LB,{})}),c.jsx(Ce,{path:"sessions/:sessionId",element:c.jsx(VB,{})}),c.jsx(Ce,{element:c.jsx($D,{}),children:c.jsx(Ce,{path:"knowledge",element:c.jsx(b.Suspense,{fallback:c.jsx(j_,{}),children:c.jsx(JL,{})})})}),c.jsxs(Ce,{element:c.jsx(HD,{}),children:[c.jsx(Ce,{path:"tasks",element:c.jsx(WO,{})}),c.jsx(Ce,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(Ce,{path:"tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(Ce,{element:c.jsx(PD,{}),children:[c.jsx(Ce,{path:"workspaces",element:c.jsx(Fn,{to:"/environments",replace:!0})}),c.jsx(Ce,{path:"workspaces/new",element:c.jsx(HI,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(iI,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(Ce,{path:"environments",element:c.jsx(w4,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(JO,{})}),c.jsx(Ce,{path:"new",element:c.jsx(k4,{})}),c.jsx(Ce,{path:":environmentId",element:c.jsx(a5,{})}),c.jsx(Ce,{path:":environmentId/edit",element:c.jsx(C4,{})})]})]}),c.jsx(Ce,{element:c.jsx(GD,{}),children:c.jsxs(Ce,{path:"settings",element:c.jsx(o5,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(Fn,{to:"credentials",replace:!0})}),c.jsx(Ce,{path:"environments",element:c.jsx(Fn,{to:"/environments",replace:!0})}),c.jsx(Ce,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(Ce,{path:"tokens",element:c.jsx(Fn,{to:"../credentials",replace:!0})}),c.jsx(Ce,{path:"personas",element:c.jsx(bL,{})}),c.jsx(Ce,{path:"appearance",element:c.jsx(_L,{})}),c.jsx(Ce,{path:"about",element:c.jsx(TL,{})})]})}),c.jsx(Ce,{path:"*",element:c.jsx(Fn,{to:"/",replace:!0})})]})]})}const s8=1e4;function i8(){const{onboardingCompleted:t}=ut(),[a,i]=b.useState(!1);b.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),s8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Wn,{mode:"wait",children:o?c.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(j_,{})},"splash"):c.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Zk,{children:c.jsx(a8,{})})},"app")})}function o8(){const t=e8?UC:wC;return c.jsx($C,{children:c.jsx(VC,{children:c.jsx(t,{children:c.jsx(i8,{})})})})}uT.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(o8,{})}));export{$s as B,kb as K,ut as a,_b as s,ka as t,Mt as u};
112
+ $\`Summarize the current tasks.\`;`,rows:20,className:$e.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:$e.formActions,children:[c.jsx("button",{type:"submit",className:$e.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:oe,className:$e.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:$e.container,children:[c.jsxs("div",{className:$e.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:te,className:$e.btnPrimary,children:"+ New Persona"})]}),(m||d)&&le(),t.length===0&&!m?c.jsx("p",{className:$e.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:$e.list,children:t.map(F=>{const ye=a===F.id,Te=F.type==="script";return c.jsxs("div",{className:`${$e.card} ${(d==null?void 0:d.id)===F.id?$e.active:""}`,"data-testid":`persona-card-${F.id}`,children:[c.jsxs("div",{className:$e.cardHeader,children:[c.jsxs("span",{className:$e.cardTitle,children:[c.jsx("strong",{children:F.name}),c.jsx("span",{className:$e.typeBadge,"data-testid":`persona-type-badge-${F.id}`,children:Te?"Script":"Agent"}),ye&&c.jsx("span",{className:$e.defaultBadge,"data-testid":`persona-default-badge-${F.id}`,children:"App Default"})]}),c.jsxs("div",{className:$e.cardActions,children:[!ye&&c.jsx("button",{onClick:()=>u(F.id),className:$e.btnSmall,"data-testid":`persona-set-default-${F.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>U(F),className:$e.btnSmall,children:"Edit"}),v===F.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>q(F.id),className:$e.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:$e.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(F.id),className:$e.btnSmall,children:"Delete"})]})]}),F.description&&c.jsx("p",{className:$e.description,children:F.description}),c.jsxs("div",{className:$e.meta,children:[F.runtime&&c.jsxs("span",{children:["Runtime: ",F.runtime]}),F.model&&c.jsxs("span",{children:["Model: ",F.model]}),F.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",F.maxTurns]})]}),Te?c.jsxs("details",{className:$e.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:$e.promptText,children:F.script})]}):c.jsxs("details",{className:$e.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:$e.promptText,children:F.systemPrompt})]})]},F.id)})})]})}function bL(){const{personas:t,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=ut();return c.jsx(yL,{personas:t,appDefaultPersonaId:r,onCreatePersona:a,onUpdatePersona:i,onDeletePersona:o,onSetAppDefaultPersonaId:u})}function xL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=Db();return c.jsxs("section",{className:fe.section,children:[c.jsx("h3",{className:fe.sectionTitle,children:"Appearance"}),c.jsx("p",{className:fe.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:fe.themeOptions,children:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${fe.themeOption} ${p?fe.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:fe.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:fe.themeOptionLabel,children:u.label}),c.jsx("span",{className:fe.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:fe.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&m?fe.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${fe.variantButton} ${p&&!m?fe.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:fe.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:fe.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:fe.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:fe.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:fe.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function _L(){return c.jsx(xL,{})}function SL({connected:t,environments:a,sessions:i}){const o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:fe.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:fe.sectionTitle,children:"About"}),c.jsx("p",{className:fe.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:fe.aboutGrid,children:[c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Connection"}),c.jsxs("span",{className:fe.aboutValue,children:[c.jsx("span",{className:`${fe.aboutDot} ${t?fe.aboutDotConnected:fe.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Environments"}),c.jsxs("span",{className:fe.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:fe.aboutValue,children:u})]}),c.jsxs("div",{className:fe.aboutItem,children:[c.jsx("span",{className:fe.aboutLabel,children:"Version"}),c.jsx("span",{className:fe.aboutValue,children:"0.74.0"})]})]})]})}function TL(){const{connected:t,environments:a,sessions:i}=ut();return c.jsx(SL,{connected:t,environments:a,sessions:i})}const kL="_wizard_1260s_1",CL="_container_1260s_10",EL="_stepContent_1260s_19",NL="_logoArea_1260s_28",jL="_logoImage_1260s_32",wL="_heading_1260s_41",AL="_tagline_1260s_49",DL="_subtitle_1260s_56",RL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",OL="_runtimeCard_1260s_101",BL="_runtimeName_1260s_133",IL="_runtimeDescription_1260s_139",LL="_buttonRow_1260s_144",UL="_primaryButton_1260s_151",zL="_ghostButton_1260s_185",VL="_dots_1260s_213",HL="_dot_1260s_213",at={wizard:kL,container:CL,stepContent:EL,logoArea:NL,logoImage:jL,heading:wL,tagline:AL,subtitle:DL,featureList:RL,runtimeGrid:ML,runtimeCard:OL,runtimeName:BL,runtimeDescription:IL,buttonRow:LL,primaryButton:UL,ghostButton:zL,dots:VL,dot:HL};function PL({onNext:t}){return c.jsxs("div",{className:at.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:at.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:at.logoImage})}),c.jsx("h1",{className:at.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:at.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function GL({onNext:t,onBack:a}){return c.jsxs("div",{className:at.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:at.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:at.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:at.buttonRow,children:[c.jsx("button",{type:"button",className:at.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const $L=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function FL({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=b.useState(t||"claude-code");return b.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:at.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:at.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:at.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:at.runtimeGrid,children:$L.map(d=>c.jsxs("button",{type:"button",className:at.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:at.runtimeName,children:d.name}),c.jsx("span",{className:at.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:at.buttonRow,children:[c.jsx("button",{type:"button",className:at.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:at.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const qL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function KL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=ut(),r=Mt(),[u,d]=b.useState(0),p=t.find(g=>g.id==="claude-code"),m=b.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx(Fn,{to:"/",replace:!0}):c.jsx("div",{className:at.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:at.container,children:[c.jsx(Wn,{mode:"wait",children:c.jsxs(Et.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(PL,{onNext:()=>d(1)}),u===1&&c.jsx(GL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(FL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:at.dots,children:Array.from({length:qL},(g,v)=>c.jsx("span",{className:at.dot,"data-active":v===u},v))})]})})}const YL="_root_zndgp_1",ZL="_body_zndgp_7",XL="_main_zndgp_19",QL="_sidebarWrapper_zndgp_26",WL="_overlay_zndgp_51",il={root:YL,body:ZL,main:XL,sidebarWrapper:QL,overlay:WL},JL=b.lazy(()=>hT(()=>import("./KnowledgePage-BUipATbG.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),e8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function t8(){const{connected:t,environments:a,sessions:i,tasks:o}=ut(),r=At(),d=Ob()!==void 0,[p,m]=b.useState(!1),g=b.useCallback(()=>m(v=>!v),[]);return b.useEffect(()=>{m(!1)},[r.pathname]),b.useEffect(()=>{if(!p)return;const v=y=>{y.key==="Escape"&&m(!1)};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[p]),c.jsxs(c.Fragment,{children:[c.jsx(eE,{connected:t,environments:a,sessions:i,onToggleSidebar:d?g:void 0,sidebarOpen:p}),c.jsx(lE,{}),c.jsxs("div",{className:il.body,children:[d&&c.jsx("div",{className:il.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(mE,{})}),d&&p&&c.jsx("div",{className:il.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:il.main,children:[c.jsx(Hs,{}),c.jsx(WD,{sessions:i,tasks:o,environments:a})]})]}),c.jsx(dR,{})]})}function n8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=ut(),{showToast:r}=Ps();NM(a,r);const u=Mt(),d=At();return b.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(_b(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx(Fn,{to:"/setup",replace:!0}):c.jsx(rE,{children:c.jsx("div",{className:il.root,children:c.jsx(t8,{})})})}function Tf(){const{workspaceId:t}=rs(),{workspaces:a}=ut(),i=At(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx(Fn,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx(Fn,{to:p,replace:!0})}function a8(){return c.jsxs(kk,{children:[c.jsx(Ce,{path:"setup",element:c.jsx(KL,{})}),c.jsxs(Ce,{element:c.jsx(n8,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(eB,{})}),c.jsx(Ce,{path:"chat",element:c.jsx(wB,{})}),c.jsx(Ce,{path:"sessions/new",element:c.jsx(LB,{})}),c.jsx(Ce,{path:"sessions/:sessionId",element:c.jsx(VB,{})}),c.jsx(Ce,{element:c.jsx($D,{}),children:c.jsx(Ce,{path:"knowledge",element:c.jsx(b.Suspense,{fallback:c.jsx(j_,{}),children:c.jsx(JL,{})})})}),c.jsxs(Ce,{element:c.jsx(HD,{}),children:[c.jsx(Ce,{path:"tasks",element:c.jsx(WO,{})}),c.jsx(Ce,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(Ce,{path:"tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(Ce,{element:c.jsx(PD,{}),children:[c.jsx(Ce,{path:"workspaces",element:c.jsx(Fn,{to:"/environments",replace:!0})}),c.jsx(Ce,{path:"workspaces/new",element:c.jsx(HI,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(iI,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Oi,{})}),c.jsx(Ce,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(Ce,{path:"environments",element:c.jsx(w4,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(JO,{})}),c.jsx(Ce,{path:"new",element:c.jsx(k4,{})}),c.jsx(Ce,{path:":environmentId",element:c.jsx(a5,{})}),c.jsx(Ce,{path:":environmentId/edit",element:c.jsx(C4,{})})]})]}),c.jsx(Ce,{element:c.jsx(GD,{}),children:c.jsxs(Ce,{path:"settings",element:c.jsx(o5,{}),children:[c.jsx(Ce,{index:!0,element:c.jsx(Fn,{to:"credentials",replace:!0})}),c.jsx(Ce,{path:"environments",element:c.jsx(Fn,{to:"/environments",replace:!0})}),c.jsx(Ce,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(Ce,{path:"tokens",element:c.jsx(Fn,{to:"../credentials",replace:!0})}),c.jsx(Ce,{path:"personas",element:c.jsx(bL,{})}),c.jsx(Ce,{path:"appearance",element:c.jsx(_L,{})}),c.jsx(Ce,{path:"about",element:c.jsx(TL,{})})]})}),c.jsx(Ce,{path:"*",element:c.jsx(Fn,{to:"/",replace:!0})})]})]})}const s8=1e4;function i8(){const{onboardingCompleted:t}=ut(),[a,i]=b.useState(!1);b.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),s8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Wn,{mode:"wait",children:o?c.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(j_,{})},"splash"):c.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Zk,{children:c.jsx(a8,{})})},"app")})}function o8(){const t=e8?UC:wC;return c.jsx($C,{children:c.jsx(VC,{children:c.jsx(t,{children:c.jsx(i8,{})})})})}uT.createRoot(document.getElementById("root")).render(c.jsx(b.StrictMode,{children:c.jsx(o8,{})}));export{$s as B,kb as K,ut as a,_b as s,ka as t,Mt as u};
package/dist/index.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />
11
11
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
12
12
  <link rel="manifest" href="/manifest.json" />
13
- <script type="module" crossorigin src="/assets/index-Lmn8JecQ.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-DAUShzMA.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/assets/markdown-gcy1Jmzi.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/dagview-BA5TtMAQ.js">
16
16
  <link rel="stylesheet" crossorigin href="/assets/index-DxQasPLC.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grackle-ai/web",
3
- "version": "0.74.0",
3
+ "version": "0.74.1",
4
4
  "description": "React web UI for the Grackle multi-agent coordination platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "rehype-prism-plus": "^2.0.0",
36
36
  "remark-gfm": "^4.0.0",
37
37
  "react-router": "^7.0.0",
38
- "@grackle-ai/common": "0.74.0"
38
+ "@grackle-ai/common": "0.74.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@rushstack/heft": "1.2.7",