@promptowl/contextnest-community 1.26.0 → 1.27.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/API.md +34 -1
- package/CONFIGURATION.md +32 -1
- package/dist/{chunk-TRSGPS27.js → chunk-H3W72HN3.js} +28 -0
- package/dist/{chunk-DGPTJXIV.js → chunk-MB52DWWP.js} +4 -4
- package/dist/{chunk-IEAWRHMV.js → chunk-NFFUZF2B.js} +23 -2
- package/dist/{chunk-PICUHQEM.js → chunk-O3JEI33N.js} +2 -2
- package/dist/{chunk-SWA5M5XX.js → chunk-QMQDWRHN.js} +128 -22
- package/dist/{chunk-I5EDEZBQ.js → chunk-RXCVXG34.js} +1 -1
- package/dist/{chunk-2QOJE7A5.js → chunk-SE5U4J4T.js} +4 -4
- package/dist/{chunk-RPGFHESR.js → chunk-VHEMGQ3I.js} +1 -1
- package/dist/{chunk-M6PGYMBD.js → chunk-VRLAP4HB.js} +33 -15
- package/dist/{engine-QNMFDIBV.js → engine-HLYQLP5T.js} +3 -3
- package/dist/{external-edit-service-4MEGPT4D.js → external-edit-service-3DFQ4EZZ.js} +4 -4
- package/dist/{grants-service-24GLUBY4.js → grants-service-WICV4Y2J.js} +2 -2
- package/dist/index.js +804 -304
- package/dist/{invited-user-AM6A3WGO.js → invited-user-XEBX6BM4.js} +3 -3
- package/dist/{review-service-2EWN7WWO.js → review-service-GB43UQVH.js} +7 -7
- package/dist/{stewardship-service-TDZUC2Q6.js → stewardship-service-KDBPWRZI.js} +4 -4
- package/dist/{version-service-C3JTZLJH.js → version-service-JYHFPSYP.js} +8 -4
- package/dist/web3/assets/{ActivityTracePage-DzwWIjjx.js → ActivityTracePage-CkRoyIc-.js} +1 -1
- package/dist/web3/assets/AgentDocsPage-BTRXmliv.js +1 -0
- package/dist/web3/assets/CollaboratorManager-CqJIkvs-.js +1 -0
- package/dist/web3/assets/CollaboratorsTab-JcO1P-qm.js +1 -0
- package/dist/web3/assets/DocumentEditor-D1GLeeEP.js +36 -0
- package/dist/web3/assets/DocumentsTab-BAgSxTX1.js +6 -0
- package/dist/web3/assets/ExternalEditsTab-DuuTXZap.js +1 -0
- package/dist/web3/assets/{MarkdownEditor-CKh4WSn-.js → MarkdownEditor-BELFww9q.js} +116 -126
- package/dist/web3/assets/{NestPageHeader-Cizo8nUi.js → NestPageHeader-Bbje2ncY.js} +1 -1
- package/dist/web3/assets/NestView-D4OMXPQ7.js +73 -0
- package/dist/web3/assets/OverviewTab-FIDGjR3Q.js +6 -0
- package/dist/web3/assets/{PersonCombobox-BKI7dff4.js → PersonCombobox-D52m_jhc.js} +1 -1
- package/dist/web3/assets/{ReviewActions-CS8JXgXF.js → ReviewActions-DYqBcWlv.js} +2 -2
- package/dist/web3/assets/ReviewTab-DoxfygOb.js +1 -0
- package/dist/web3/assets/StewardsTab-CFsYjbEn.js +1 -0
- package/dist/web3/assets/{SubmitForReviewModal-Biq3m79i.js → SubmitForReviewModal-AW2OLNAE.js} +1 -1
- package/dist/web3/assets/{alert-dialog-BvF3NFr7.js → alert-dialog-p-fBLSWx.js} +2 -2
- package/dist/web3/assets/{arrow-left-CWIsv-sG.js → arrow-left-CiErCCTG.js} +1 -1
- package/dist/web3/assets/{backlinks-Cqcn7n1J.js → backlinks-DaVSYvhV.js} +2 -2
- package/dist/web3/assets/{boxes-ClbgQqG2.js → boxes-VWrCCMzW.js} +1 -1
- package/dist/web3/assets/{chevron-left-CK_ZPFm9.js → chevron-left-CsD8gZwL.js} +1 -1
- package/dist/web3/assets/{circle-check-Bw_aTXiH.js → circle-check-BBCXd9LI.js} +1 -1
- package/dist/web3/assets/{circle-x-DkIG68H7.js → circle-x-C9LsnORQ.js} +1 -1
- package/dist/web3/assets/{code-xml-BlR7EN6l.js → code-xml-BaoV7HiQ.js} +1 -1
- package/dist/web3/assets/{corner-down-right-DSVxK3tf.js → corner-down-right-DgiTXrtw.js} +1 -1
- package/dist/web3/assets/{count-skeleton-DToLM74B.js → count-skeleton-CnEE4uF-.js} +1 -1
- package/dist/web3/assets/{earth-BXhVPvCR.js → earth-BmMbVt9k.js} +1 -1
- package/dist/web3/assets/{file-exclamation-point-BevGZgtj.js → file-exclamation-point-qJeca9-A.js} +1 -1
- package/dist/web3/assets/{folder-input-m8UBV4fA.js → folder-input-D7R93LJ6.js} +1 -1
- package/dist/web3/assets/index-DNmWTxN7.css +1 -0
- package/dist/web3/assets/index-DvuUIUP6.js +451 -0
- package/dist/web3/assets/{page-DzKwP5Ds.js → page-BJQuaTRW.js} +2 -2
- package/dist/web3/assets/{page-B6pkc9cd.js → page-Bb8xGOPQ.js} +2 -2
- package/dist/web3/assets/{page-Deq6IKiN.js → page-BtM-qDzr.js} +2 -2
- package/dist/web3/assets/{page-DPY01SOj.js → page-Bxd0EG25.js} +1 -1
- package/dist/web3/assets/page-C3QCO6IR.js +1 -0
- package/dist/web3/assets/{page-CptuAPJc.js → page-CfoR0khy.js} +2 -2
- package/dist/web3/assets/page-D7Zr5tAI.js +1 -0
- package/dist/web3/assets/{page-Dwbp4Seu.js → page-DATSlHCW.js} +2 -2
- package/dist/web3/assets/page-DTjPQizZ.js +45 -0
- package/dist/web3/assets/{page-Bgy9Ng9p.js → page-DspptlWr.js} +1 -1
- package/dist/web3/assets/{page-Dh57L0RG.js → page-I6vAFJOj.js} +4 -4
- package/dist/web3/assets/page-QxI4Ud2s.js +9 -0
- package/dist/web3/assets/{page-BJrFCKXB.js → page-YcNNg-dX.js} +1 -1
- package/dist/web3/assets/page-kM7eO5Kj.js +1 -0
- package/dist/web3/assets/{page-title-DVq4qvMR.js → page-title-Dn5jANiU.js} +1 -1
- package/dist/web3/assets/{play-CXhS6Pgq.js → play-B2k_Ix-L.js} +1 -1
- package/dist/web3/assets/{send-DdfwnIrj.js → send-DPNxv3As.js} +1 -1
- package/dist/web3/assets/{settings-DKX0Q4gO.js → settings-DZjq-OQA.js} +1 -1
- package/dist/web3/assets/{share-2-CxmXRt58.js → share-2-C-OnE2ru.js} +1 -1
- package/dist/web3/assets/{tag-DeYC_mRv.js → tag-CwJl7FdI.js} +1 -1
- package/dist/web3/assets/{trash-2-B0HyPTnI.js → trash-2-aljmIff4.js} +1 -1
- package/dist/web3/assets/{user-plus-Ckm_Isyc.js → user-plus-DPerZexX.js} +1 -1
- package/dist/web3/assets/{zap-D2ifcnYb.js → zap-CHZtiN7P.js} +1 -1
- package/dist/web3/index.html +2 -2
- package/package.json +6 -2
- package/dist/web3/assets/AgentDocsPage-ixP2UdAE.js +0 -1
- package/dist/web3/assets/CollaboratorManager-C9VAXZ0h.js +0 -1
- package/dist/web3/assets/CollaboratorsTab-tq4ZTexH.js +0 -1
- package/dist/web3/assets/DocumentEditor-C2CP2fiE.js +0 -36
- package/dist/web3/assets/DocumentsTab-Mh7KxUoB.js +0 -6
- package/dist/web3/assets/ExternalEditsTab-B_CWKXZ_.js +0 -1
- package/dist/web3/assets/NestView-EW-sraEb.js +0 -73
- package/dist/web3/assets/OverviewTab-CjidsMX_.js +0 -6
- package/dist/web3/assets/ReviewTab-CwVrXzw5.js +0 -1
- package/dist/web3/assets/StewardsTab-C-iP6gnh.js +0 -1
- package/dist/web3/assets/index-BOVYgMvj.js +0 -29
- package/dist/web3/assets/index-DVnaYqj9.css +0 -1
- package/dist/web3/assets/index-WYDmEOfO.js +0 -404
- package/dist/web3/assets/page-C2zoxumw.js +0 -1
- package/dist/web3/assets/page-CJWO06dN.js +0 -1
- package/dist/web3/assets/page-Dea2SblF.js +0 -9
- package/dist/web3/assets/page-Dfjg8p7Z.js +0 -1
- package/dist/web3/assets/page-YxjrE5b5.js +0 -45
- package/dist/web3/assets/x-mNtADYHc.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ue,r as A,
|
|
1
|
+
import{c as ue,r as A,bb as Qe,j as u,U as Oe,B as Pe,L as Ue,bc as Ve,h as Je,C as Ke,aD as qe,aI as et,b8 as tt}from"./index-DvuUIUP6.js";import{N as nt}from"./NestPageHeader-Bbje2ncY.js";import{L as rt,T as st}from"./tag-CwJl7FdI.js";import"./arrow-left-CiErCCTG.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -18,7 +18,7 @@ import{c as ue,r as A,b5 as Qe,j as u,U as Oe,B as Pe,L as Ue,b6 as Ve,h as Je,C
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const ft=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ht=ue("zoom-out",ft);function dt(e,t){var n,s=1;e==null&&(e=0),t==null&&(t=0);function i(){var r,h=n.length,x,v=0,l=0;for(r=0;r<h;++r)x=n[r],v+=x.x,l+=x.y;for(v=(v/h-e)*s,l=(l/h-t)*s,r=0;r<h;++r)x=n[r],x.x-=v,x.y-=l}return i.initialize=function(r){n=r},i.x=function(r){return arguments.length?(e=+r,i):e},i.y=function(r){return arguments.length?(t=+r,i):t},i.strength=function(r){return arguments.length?(s=+r,i):s},i}function xt(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Re(this.cover(t,n),t,n,e)}function Re(e,t,n,s){if(isNaN(t)||isNaN(n))return e;var i,r=e._root,h={data:s},x=e._x0,v=e._y0,l=e._x1,y=e._y1,_,p,c,k,f,o,d,m;if(!r)return e._root=h,e;for(;r.length;)if((f=t>=(_=(x+l)/2))?x=_:l=_,(o=n>=(p=(v+y)/2))?v=p:y=p,i=r,!(r=r[d=o<<1|f]))return i[d]=h,e;if(c=+e._x.call(null,r.data),k=+e._y.call(null,r.data),t===c&&n===k)return h.next=r,i?i[d]=h:e._root=h,e;do i=i?i[d]=new Array(4):e._root=new Array(4),(f=t>=(_=(x+l)/2))?x=_:l=_,(o=n>=(p=(v+y)/2))?v=p:y=p;while((d=o<<1|f)===(m=(k>=p)<<1|c>=_));return i[m]=r,i[d]=h,e}function gt(e){var t,n,s=e.length,i,r,h=new Array(s),x=new Array(s),v=1/0,l=1/0,y=-1/0,_=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(r=+this._y.call(null,t))||(h[n]=i,x[n]=r,i<v&&(v=i),i>y&&(y=i),r<l&&(l=r),r>_&&(_=r));if(v>y||l>_)return this;for(this.cover(v,l).cover(y,_),n=0;n<s;++n)Re(this,h[n],x[n],e[n]);return this}function mt(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,s=this._y0,i=this._x1,r=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,r=(s=Math.floor(t))+1;else{for(var h=i-n||1,x=this._root,v,l;n>e||e>=i||s>t||t>=r;)switch(l=(t<s)<<1|e<n,v=new Array(4),v[l]=x,x=v,h*=2,l){case 0:i=n+h,r=s+h;break;case 1:n=i-h,r=s+h;break;case 2:i=n+h,s=r-h;break;case 3:n=i-h,s=r-h;break}this._root&&this._root.length&&(this._root=x)}return this._x0=n,this._y0=s,this._x1=i,this._y1=r,this}function pt(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function yt(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(e,t,n,s,i){this.node=e,this.x0=t,this.y0=n,this.x1=s,this.y1=i}function vt(e,t,n){var s,i=this._x0,r=this._y0,h,x,v,l,y=this._x1,_=this._y1,p=[],c=this._root,k,f;for(c&&p.push(new L(c,i,r,y,_)),n==null?n=1/0:(i=e-n,r=t-n,y=e+n,_=t+n,n*=n);k=p.pop();)if(!(!(c=k.node)||(h=k.x0)>y||(x=k.y0)>_||(v=k.x1)<i||(l=k.y1)<r))if(c.length){var o=(h+v)/2,d=(x+l)/2;p.push(new L(c[3],o,d,v,l),new L(c[2],h,d,o,l),new L(c[1],o,x,v,d),new L(c[0],h,x,o,d)),(f=(t>=d)<<1|e>=o)&&(k=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=k)}else{var m=e-+this._x.call(null,c.data),b=t-+this._y.call(null,c.data),w=m*m+b*b;if(w<n){var $=Math.sqrt(n=w);i=e-$,r=t-$,y=e+$,_=t+$,s=c.data}}return s}function wt(e){if(isNaN(y=+this._x.call(null,e))||isNaN(_=+this._y.call(null,e)))return this;var t,n=this._root,s,i,r,h=this._x0,x=this._y0,v=this._x1,l=this._y1,y,_,p,c,k,f,o,d;if(!n)return this;if(n.length)for(;;){if((k=y>=(p=(h+v)/2))?h=p:v=p,(f=_>=(c=(x+l)/2))?x=c:l=c,t=n,!(n=n[o=f<<1|k]))return this;if(!n.length)break;(t[o+1&3]||t[o+2&3]||t[o+3&3])&&(s=t,d=o)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(r=n.next)&&delete n.next,i?(r?i.next=r:delete i.next,this):t?(r?t[o]=r:delete t[o],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(s?s[d]=n:this._root=n),this):(this._root=r,this)}function Nt(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function _t(){return this._root}function bt(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function jt(e){var t=[],n,s=this._root,i,r,h,x,v;for(s&&t.push(new L(s,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(s=n.node,r=n.x0,h=n.y0,x=n.x1,v=n.y1)&&s.length){var l=(r+x)/2,y=(h+v)/2;(i=s[3])&&t.push(new L(i,l,y,x,v)),(i=s[2])&&t.push(new L(i,r,y,l,v)),(i=s[1])&&t.push(new L(i,l,h,x,y)),(i=s[0])&&t.push(new L(i,r,h,l,y))}return this}function kt(e){var t=[],n=[],s;for(this._root&&t.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));s=t.pop();){var i=s.node;if(i.length){var r,h=s.x0,x=s.y0,v=s.x1,l=s.y1,y=(h+v)/2,_=(x+l)/2;(r=i[0])&&t.push(new L(r,h,x,y,_)),(r=i[1])&&t.push(new L(r,y,x,v,_)),(r=i[2])&&t.push(new L(r,h,_,y,l)),(r=i[3])&&t.push(new L(r,y,_,v,l))}n.push(s)}for(;s=n.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}function Mt(e){return e[0]}function St(e){return arguments.length?(this._x=e,this):this._x}function $t(e){return e[1]}function Ct(e){return arguments.length?(this._y=e,this):this._y}function ve(e,t,n){var s=new we(t??Mt,n??$t,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function we(e,t,n,s,i,r){this._x=e,this._y=t,this._x0=n,this._y0=s,this._x1=i,this._y1=r,this._root=void 0}function Me(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var T=ve.prototype=we.prototype;T.copy=function(){var e=new we(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,s;if(!t)return e;if(!t.length)return e._root=Me(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(s=t.source[i])&&(s.length?n.push({source:s,target:t.target[i]=new Array(4)}):t.target[i]=Me(s));return e};T.add=xt;T.addAll=gt;T.cover=mt;T.data=pt;T.extent=yt;T.find=vt;T.remove=wt;T.removeAll=Nt;T.root=_t;T.size=bt;T.visit=jt;T.visitAfter=kt;T.x=St;T.y=Ct;function J(e){return function(){return e}}function U(e){return(e()-.5)*1e-6}function At(e){return e.x+e.vx}function zt(e){return e.y+e.vy}function It(e){var t,n,s,i=1,r=1;typeof e!="function"&&(e=J(e==null?1:+e));function h(){for(var l,y=t.length,_,p,c,k,f,o,d=0;d<r;++d)for(_=ve(t,At,zt).visitAfter(x),l=0;l<y;++l)p=t[l],f=n[p.index],o=f*f,c=p.x+p.vx,k=p.y+p.vy,_.visit(m);function m(b,w,$,P,z){var C=b.data,H=b.r,I=f+H;if(C){if(C.index>p.index){var B=c-C.x-C.vx,F=k-C.y-C.vy,X=B*B+F*F;X<I*I&&(B===0&&(B=U(s),X+=B*B),F===0&&(F=U(s),X+=F*F),X=(I-(X=Math.sqrt(X)))/X*i,p.vx+=(B*=X)*(I=(H*=H)/(o+H)),p.vy+=(F*=X)*I,C.vx-=B*(I=1-I),C.vy-=F*I)}return}return w>c+I||P<c-I||$>k+I||z<k-I}}function x(l){if(l.data)return l.r=n[l.data.index];for(var y=l.r=0;y<4;++y)l[y]&&l[y].r>l.r&&(l.r=l[y].r)}function v(){if(t){var l,y=t.length,_;for(n=new Array(y),l=0;l<y;++l)_=t[l],n[_.index]=+e(_,l,t)}}return h.initialize=function(l,y){t=l,s=y,v()},h.iterations=function(l){return arguments.length?(r=+l,h):r},h.strength=function(l){return arguments.length?(i=+l,h):i},h.radius=function(l){return arguments.length?(e=typeof l=="function"?l:J(+l),v(),h):e},h}function Et(e){return e.index}function Se(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Pt(e){var t=Et,n=_,s,i=J(30),r,h,x,v,l,y=1;e==null&&(e=[]);function _(o){return 1/Math.min(x[o.source.index],x[o.target.index])}function p(o){for(var d=0,m=e.length;d<y;++d)for(var b=0,w,$,P,z,C,H,I;b<m;++b)w=e[b],$=w.source,P=w.target,z=P.x+P.vx-$.x-$.vx||U(l),C=P.y+P.vy-$.y-$.vy||U(l),H=Math.sqrt(z*z+C*C),H=(H-r[b])/H*o*s[b],z*=H,C*=H,P.vx-=z*(I=v[b]),P.vy-=C*I,$.vx+=z*(I=1-I),$.vy+=C*I}function c(){if(h){var o,d=h.length,m=e.length,b=new Map(h.map(($,P)=>[t($,P,h),$])),w;for(o=0,x=new Array(d);o<m;++o)w=e[o],w.index=o,typeof w.source!="object"&&(w.source=Se(b,w.source)),typeof w.target!="object"&&(w.target=Se(b,w.target)),x[w.source.index]=(x[w.source.index]||0)+1,x[w.target.index]=(x[w.target.index]||0)+1;for(o=0,v=new Array(m);o<m;++o)w=e[o],v[o]=x[w.source.index]/(x[w.source.index]+x[w.target.index]);s=new Array(m),k(),r=new Array(m),f()}}function k(){if(h)for(var o=0,d=e.length;o<d;++o)s[o]=+n(e[o],o,e)}function f(){if(h)for(var o=0,d=e.length;o<d;++o)r[o]=+i(e[o],o,e)}return p.initialize=function(o,d){h=o,l=d,c()},p.links=function(o){return arguments.length?(e=o,c(),p):e},p.id=function(o){return arguments.length?(t=o,p):t},p.iterations=function(o){return arguments.length?(y=+o,p):y},p.strength=function(o){return arguments.length?(n=typeof o=="function"?o:J(+o),k(),p):n},p.distance=function(o){return arguments.length?(i=typeof o=="function"?o:J(+o),f(),p):i},p}var Rt={value:()=>{}};function Le(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new ae(n)}function ae(e){this._=e}function Lt(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",i=n.indexOf(".");if(i>=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ae.prototype=Le.prototype={constructor:ae,on:function(e,t){var n=this._,s=Lt(e+"",n),i,r=-1,h=s.length;if(arguments.length<2){for(;++r<h;)if((i=(e=s[r]).type)&&(i=Tt(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<h;)if(i=(e=s[r]).type)n[i]=$e(n[i],e.name,t);else if(t==null)for(i in n)n[i]=$e(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ae(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),s=0,i,r;s<i;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],s=0,i=r.length;s<i;++s)r[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)}};function Tt(e,t){for(var n=0,s=e.length,i;n<s;++n)if((i=e[n]).name===t)return i.value}function $e(e,t,n){for(var s=0,i=e.length;s<i;++s)if(e[s].name===t){e[s]=Rt,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var ee=0,re=0,ne=0,Te=1e3,le,se,ce=0,K=0,fe=0,ie=typeof performance=="object"&&performance.now?performance:Date,Be=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fe(){return K||(Be(Bt),K=ie.now()+fe)}function Bt(){K=0}function pe(){this._call=this._time=this._next=null}pe.prototype=He.prototype={constructor:pe,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fe():+n)+(t==null?0:+t),!this._next&&se!==this&&(se?se._next=this:le=this,se=this),this._call=e,this._time=n,ye()},stop:function(){this._call&&(this._call=null,this._time=1/0,ye())}};function He(e,t,n){var s=new pe;return s.restart(e,t,n),s}function Ft(){Fe(),++ee;for(var e=le,t;e;)(t=K-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ee}function Ce(){K=(ce=ie.now())+fe,ee=re=0;try{Ft()}finally{ee=0,Xt(),K=0}}function Ht(){var e=ie.now(),t=e-ce;t>Te&&(fe-=t,ce=e)}function Xt(){for(var e,t=le,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:le=n);se=e,ye(s)}function ye(e){if(!ee){re&&(re=clearTimeout(re));var t=e-K;t>24?(e<1/0&&(re=setTimeout(Ce,e-ie.now()-fe)),ne&&(ne=clearInterval(ne))):(ne||(ce=ie.now(),ne=setInterval(Ht,Te)),ee=1,Be(Ce))}}const Dt=1664525,Yt=1013904223,Ae=4294967296;function Zt(){let e=1;return()=>(e=(Dt*e+Yt)%Ae)/Ae}function Gt(e){return e.x}function Wt(e){return e.y}var Qt=10,Ot=Math.PI*(3-Math.sqrt(5));function Ut(e){var t,n=1,s=.001,i=1-Math.pow(s,1/300),r=0,h=.6,x=new Map,v=He(_),l=Le("tick","end"),y=Zt();e==null&&(e=[]);function _(){p(),l.call("tick",t),n<s&&(v.stop(),l.call("end",t))}function p(f){var o,d=e.length,m;f===void 0&&(f=1);for(var b=0;b<f;++b)for(n+=(r-n)*i,x.forEach(function(w){w(n)}),o=0;o<d;++o)m=e[o],m.fx==null?m.x+=m.vx*=h:(m.x=m.fx,m.vx=0),m.fy==null?m.y+=m.vy*=h:(m.y=m.fy,m.vy=0);return t}function c(){for(var f=0,o=e.length,d;f<o;++f){if(d=e[f],d.index=f,d.fx!=null&&(d.x=d.fx),d.fy!=null&&(d.y=d.fy),isNaN(d.x)||isNaN(d.y)){var m=Qt*Math.sqrt(.5+f),b=f*Ot;d.x=m*Math.cos(b),d.y=m*Math.sin(b)}(isNaN(d.vx)||isNaN(d.vy))&&(d.vx=d.vy=0)}}function k(f){return f.initialize&&f.initialize(e,y),f}return c(),t={tick:p,restart:function(){return v.restart(_),t},stop:function(){return v.stop(),t},nodes:function(f){return arguments.length?(e=f,c(),x.forEach(k),t):e},alpha:function(f){return arguments.length?(n=+f,t):n},alphaMin:function(f){return arguments.length?(s=+f,t):s},alphaDecay:function(f){return arguments.length?(i=+f,t):+i},alphaTarget:function(f){return arguments.length?(r=+f,t):r},velocityDecay:function(f){return arguments.length?(h=1-f,t):1-h},randomSource:function(f){return arguments.length?(y=f,x.forEach(k),t):y},force:function(f,o){return arguments.length>1?(o==null?x.delete(f):x.set(f,k(o)),t):x.get(f)},find:function(f,o,d){var m=0,b=e.length,w,$,P,z,C;for(d==null?d=1/0:d*=d,m=0;m<b;++m)z=e[m],w=f-z.x,$=o-z.y,P=w*w+$*$,P<d&&(C=z,d=P);return C},on:function(f,o){return arguments.length>1?(l.on(f,o),t):l.on(f)}}}function Vt(){var e,t,n,s,i=J(-30),r,h=1,x=1/0,v=.81;function l(c){var k,f=e.length,o=ve(e,Gt,Wt).visitAfter(_);for(s=c,k=0;k<f;++k)t=e[k],o.visit(p)}function y(){if(e){var c,k=e.length,f;for(r=new Array(k),c=0;c<k;++c)f=e[c],r[f.index]=+i(f,c,e)}}function _(c){var k=0,f,o,d=0,m,b,w;if(c.length){for(m=b=w=0;w<4;++w)(f=c[w])&&(o=Math.abs(f.value))&&(k+=f.value,d+=o,m+=o*f.x,b+=o*f.y);c.x=m/d,c.y=b/d}else{f=c,f.x=f.data.x,f.y=f.data.y;do k+=r[f.data.index];while(f=f.next)}c.value=k}function p(c,k,f,o){if(!c.value)return!0;var d=c.x-t.x,m=c.y-t.y,b=o-k,w=d*d+m*m;if(b*b/v<w)return w<x&&(d===0&&(d=U(n),w+=d*d),m===0&&(m=U(n),w+=m*m),w<h&&(w=Math.sqrt(h*w)),t.vx+=d*c.value*s/w,t.vy+=m*c.value*s/w),!0;if(c.length||w>=x)return;(c.data!==t||c.next)&&(d===0&&(d=U(n),w+=d*d),m===0&&(m=U(n),w+=m*m),w<h&&(w=Math.sqrt(h*w)));do c.data!==t&&(b=r[c.data.index]*s/w,t.vx+=d*b,t.vy+=m*b);while(c=c.next)}return l.initialize=function(c,k){e=c,n=k,y()},l.strength=function(c){return arguments.length?(i=typeof c=="function"?c:J(+c),y(),l):i},l.distanceMin=function(c){return arguments.length?(h=c*c,l):Math.sqrt(h)},l.distanceMax=function(c){return arguments.length?(x=c*c,l):Math.sqrt(x)},l.theta=function(c){return arguments.length?(v=c*c,l):Math.sqrt(v)},l}function Jt(e,t){return e>0?"Every category has a steward.":t>0?"No categories yet — tag documents to see steward coverage.":"No categories or stewards yet — tag documents and assign stewards to see coverage."}const W={doc:"#3b82f6",steward:"#16a34a",tag:"#f59e0b",root:"#64748b",folder:"#a855f7"};function Kt(e){return e==="steward"?"#16a34a66":e==="tag"?"#f59e0b66":e==="structure"?"#a855f766":"#94a3b8aa"}const ze=(e,t,n)=>Math.min(n,Math.max(t,e)),Ie=.15,qt=5;function Ee(e){return e.kind==="doc"?e.name.includes("]]")||e.name.includes("|")?null:`[[${e.name}]]`:e.kind==="tag"?`#${e.name.replace(/^#/,"")}`:null}function en(e){return`'${e.replace(/'/g,"'\\''")}'`}function tn({nestId:e,nestName:t,onOpenTag:n,onOpenDocument:s,onBack:i}){const[r,h]=A.useState(null),[x,v]=A.useState(!0),[l,y]=A.useState(null),[_,p]=A.useState({links:!0,stewardship:!0,categories:!0,structure:!0}),[c,k]=A.useState(null),[f,o]=A.useState(1),d=A.useRef(null),m=A.useRef(null),[b,w]=A.useState({w:800,h:560}),[$,P]=A.useState({nodes:[],links:[]}),[z,C]=A.useState({x:0,y:0,k:1}),[H,I]=A.useState(!1),B=A.useRef(null),F=A.useRef(!1),X=A.useRef({w:0,h:0}),Xe=(a,g)=>{const N=m.current.getBoundingClientRect();return{x:(a-N.left-z.x)/z.k,y:(g-N.top-z.y)/z.k}},Ne=(a,g,N)=>{const j=a.filter(Z=>Z.x!=null&&Z.y!=null);if(!j.length)return C({x:g/2,y:N/2,k:1});let M=1/0,S=1/0,R=-1/0,E=-1/0;for(const Z of j)M=Math.min(M,Z.x),S=Math.min(S,Z.y),R=Math.max(R,Z.x),E=Math.max(E,Z.y);const D=48,G=R-M||1,Q=E-S||1,V=ze(Math.min((g-2*D)/G,(N-2*D)/Q),Ie,1.5);C({x:g/2-(M+R)/2*V,y:N/2-(S+E)/2*V,k:V})},he=(a,g=b.w/2,N=b.h/2)=>{F.current=!0,C(j=>{const M=ze(j.k*a,Ie,qt),S=(g-j.x)/j.k,R=(N-j.y)/j.k;return{k:M,x:g-S*M,y:N-R*M}})};A.useEffect(()=>{const a=m.current;if(!a)return;const g=N=>{N.preventDefault();const j=a.getBoundingClientRect();he(N.deltaY<0?1.1:1/1.1,N.clientX-j.left,N.clientY-j.top)};return a.addEventListener("wheel",g,{passive:!1}),()=>a.removeEventListener("wheel",g)},[b.w,b.h,x,l]);const De=a=>{var g,N;(N=(g=m.current)==null?void 0:g.setPointerCapture)==null||N.call(g,a.pointerId),B.current={mode:"pan",px:a.clientX,py:a.clientY},I(!0)},Ye=(a,g)=>{var N,j;a.stopPropagation(),(j=(N=m.current)==null?void 0:N.setPointerCapture)==null||j.call(N,a.pointerId),B.current={mode:"node",node:g,moved:!1}},Ze=a=>{const g=B.current;if(g)if(g.mode==="pan"){const N=a.clientX-g.px,j=a.clientY-g.py;g.px=a.clientX,g.py=a.clientY,F.current=!0,C(M=>({...M,x:M.x+N,y:M.y+j}))}else{g.moved=!0;const N=Xe(a.clientX,a.clientY);g.node.x=N.x,g.node.y=N.y,P(j=>({...j,nodes:j.nodes.slice()}))}},_e=a=>{var N,j;const g=B.current;(j=(N=m.current)==null?void 0:N.releasePointerCapture)==null||j.call(N,a.pointerId),(g==null?void 0:g.mode)==="node"&&!g.moved&&k(M=>(M==null?void 0:M.id)===g.node.id?null:g.node),B.current=null,I(!1)};A.useEffect(()=>{let a=!1;return v(!0),Qe(e).then(g=>{a||(F.current=!1,h(g))}).catch(g=>!a&&y((g==null?void 0:g.message)||"Failed to load graph")).finally(()=>!a&&v(!1)),()=>{a=!0}},[e]),A.useEffect(()=>{if(!d.current)return;const a=d.current,g=()=>w({w:a.clientWidth,h:Math.max(420,a.clientHeight)});g();let N;const j=new ResizeObserver(()=>{clearTimeout(N),N=setTimeout(g,150)});return j.observe(a),()=>{clearTimeout(N),j.disconnect()}},[]);const Y=(r==null?void 0:r.signals)??null,oe=A.useMemo(()=>{if(!r)return{nodes:[],links:[]};const a=[],g=[],N=new Set(((Y==null?void 0:Y.orphans)||[]).map(S=>S.id));for(const S of r.nodes)a.push({id:S.id,name:S.title,kind:"doc",color:N.has(S.id)?"#ef4444":W.doc,val:2});if(_.links)for(const S of r.links)g.push({...S,kind:"link"});const j=()=>{a.some(S=>S.id==="root:nest")||a.push({id:"root:nest",name:t,kind:"root",color:W.root,val:4})};if(_.structure){j();const S=new Set,R=(D,G)=>{const Q=`${D}~>${G}`;S.has(Q)||(S.add(Q),g.push({source:D,target:G,kind:"structure"}))},E=new Set;for(const D of r.nodes){const G=D.id.split("/").filter(Boolean),Q=G[0]==="nodes"?G.slice(1,-1):G.slice(0,-1);let V="root:nest",Z="";for(const de of Q){Z=Z?`${Z}/${de}`:de;const te=`folder:${Z}`;E.has(te)||(E.add(te),a.push({id:te,name:de,kind:"folder",color:W.folder,val:2})),R(V,te),V=te}R(V,D.id)}}if(_.categories){for(const S of r.tags)a.push({id:`tag:${S.name}`,name:`#${S.name}`,kind:"tag",color:W.tag,val:1+Math.min(S.count,4)});for(const S of r.nodes)for(const R of S.tags)g.push({source:S.id,target:`tag:${R}`,kind:"tag"})}if(_.stewardship){const S=new Map(r.stewards.map(E=>[E.id,E.label]));for(const E of r.stewards)a.push({id:`steward:${E.id}`,name:E.label,kind:"steward",color:W.steward,val:3});let R=!1;for(const E of r.stewardEdges){const D=`steward:${E.steward}`;if(S.has(E.steward))if(E.scope==="tag")if(_.categories)g.push({source:D,target:E.target,kind:"steward"});else{const G=E.target.replace(/^tag:/,"");for(const Q of r.nodes)Q.tags.includes(G)&&g.push({source:D,target:Q.id,kind:"steward"})}else E.scope==="document"?g.push({source:D,target:E.target,kind:"steward"}):(R=!0,g.push({source:D,target:"root:nest",kind:"steward"}))}R&&j()}const M=new Set(a.map(S=>S.id));return{nodes:a,links:g.filter(S=>M.has(S.source)&&M.has(S.target))}},[r,_,Y,t]);A.useEffect(()=>{if(!oe.nodes.length){P({nodes:[],links:[]});return}const a=oe.nodes.map(M=>({...M})),g=oe.links.map(M=>({...M})),N=Ut(a).force("link",Pt(g).id(M=>M.id).distance(55).strength(.35)).force("charge",Vt().strength(-170)).force("center",dt(b.w/2,b.h/2)).force("collide",It(14)).stop();for(let M=0;M<300;M++)N.tick();P({nodes:a,links:g});const j=X.current.w!==b.w||X.current.h!==b.h;(!F.current||j)&&(Ne(a,b.w,b.h),X.current={w:b.w,h:b.h})},[oe,b.w,b.h]);const be=a=>3+a.val,O=A.useMemo(()=>{if(!c)return null;const a=new Map;for(const j of $.links){const M=typeof j.source=="string"?j.source:j.source.id,S=typeof j.target=="string"?j.target:j.target.id;(a.get(M)??a.set(M,[]).get(M)).push(S),(a.get(S)??a.set(S,[]).get(S)).push(M)}const g=new Set([c.id]);let N=[c.id];for(let j=0;j<f&&N.length;j++){const M=[];for(const S of N)for(const R of a.get(S)??[])g.has(R)||(g.add(R),M.push(R));N=M}return g},[c,f,$.links]),Ge=A.useMemo(()=>new Map($.nodes.map(a=>[a.id,a])),[$.nodes]),je=((r==null?void 0:r.stewards.length)??0)>0,ke=((r==null?void 0:r.tags.length)??0)>0,We=((r==null?void 0:r.links.length)??0)>0;return u.jsxs("div",{className:"space-y-4",children:[u.jsx(nt,{nestName:t,onBack:i,children:u.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[[["structure","Structure",ot,!0],["links","Links",rt,We],["stewardship","Stewardship",Oe,je],["categories","Categories",st,ke]].filter(([,,,a])=>a).map(([a,g,N])=>u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",checked:_[a],onChange:j=>p(M=>({...M,[a]:j.target.checked}))}),u.jsx(N,{className:"h-3.5 w-3.5"}),g]},a)),u.jsx(Pe,{variant:"ghost",size:"sm",onClick:()=>{F.current=!1,C({x:0,y:0,k:1})},title:"Reset pan & zoom",children:"Reset view"})]})}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-4",children:[u.jsxs("div",{ref:d,className:"border border-border rounded-lg bg-card overflow-hidden h-[560px] relative",children:[x&&u.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground",children:[u.jsx(Ue,{className:"h-5 w-5 animate-spin mr-2"})," Loading ontology…"]}),l&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-red-500 text-sm",children:l}),!x&&!l&&(r==null?void 0:r.truncated)&&u.jsxs("div",{className:"absolute top-2 left-2 z-10 rounded bg-amber-100 text-amber-800 text-xs px-2 py-1 border border-amber-300",children:["Showing ",r.nodes.length," of ",r.totalNodes," nodes (highest-connected). Gaps below cover all ",r.totalNodes,"."]}),!x&&!l&&u.jsxs(u.Fragment,{children:[u.jsx("svg",{ref:m,width:b.w,height:b.h,className:"block touch-none",style:{cursor:H?"grabbing":"grab"},onPointerDown:De,onPointerMove:Ze,onPointerUp:_e,onPointerLeave:_e,children:u.jsxs("g",{transform:`translate(${z.x},${z.y}) scale(${z.k})`,children:[u.jsx("g",{children:$.links.map((a,g)=>{const N=a.source,j=a.target;if((N==null?void 0:N.x)==null||(j==null?void 0:j.x)==null)return null;const M=!O||O.has(N.id)&&O.has(j.id);return u.jsx("line",{x1:N.x,y1:N.y,x2:j.x,y2:j.y,stroke:Kt(a.kind),strokeWidth:(M&&O?1.6:1)/z.k,opacity:M?1:.15},g)})}),u.jsx("g",{children:$.nodes.map(a=>{const g=!O||O.has(a.id);return u.jsxs("g",{transform:`translate(${a.x??0},${a.y??0})`,onPointerDown:N=>Ye(N,a),onDoubleClick:()=>{a.kind==="doc"&&(s==null||s(a.id))},style:{cursor:"grab"},opacity:g?1:.25,children:[a.kind==="doc"&&s&&u.jsx("title",{children:`Double-click to open "${a.name}"`}),u.jsx("circle",{r:be(a),fill:a.color,stroke:(c==null?void 0:c.id)===a.id?"#111827":g&&O?"#111827aa":"#ffffff",strokeWidth:(c==null?void 0:c.id)===a.id?2:1}),u.jsx("text",{x:be(a)+3,y:3,fontSize:9,fill:"#475569",children:a.name.length>24?a.name.slice(0,24)+"…":a.name})]},a.id)})})]})}),u.jsxs("div",{className:"absolute bottom-2 right-2 z-10 flex flex-col gap-1",children:[u.jsx(xe,{label:"Zoom in",onClick:()=>he(1.25),children:u.jsx(ut,{className:"h-4 w-4"})}),u.jsx(xe,{label:"Zoom out",onClick:()=>he(1/1.25),children:u.jsx(ht,{className:"h-4 w-4"})}),u.jsx(xe,{label:"Fit to view",onClick:()=>Ne($.nodes,b.w,b.h),children:u.jsx(lt,{className:"h-4 w-4"})})]})]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"border border-border rounded-lg bg-card p-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-sm mb-2",children:[((r==null?void 0:r.nodes.length)??0)===0?u.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}):u.jsx(Je,{className:"h-4 w-4 text-amber-500"})," ","Coverage gaps"]}),Y?((r==null?void 0:r.nodes.length)??0)===0?u.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.jsx("span",{className:"font-medium text-foreground",children:"No documents yet"})," ","— add content to see governance coverage and connection gaps."]}):u.jsxs("div",{className:"space-y-3 text-sm",children:[u.jsx(me,{label:"Categories with no steward",items:Y.unstewardedTags.map(a=>`#${a.name} (${a.count})`),empty:Jt((r==null?void 0:r.tags.length)??0,(r==null?void 0:r.stewards.length)??0),onSelect:n&&(a=>n(Y.unstewardedTags[a].name)),selectTitle:a=>`Show #${Y.unstewardedTags[a].name} documents`}),u.jsx(me,{label:"Bottleneck stewards (≥50% of nodes)",items:Y.bottlenecks.map(a=>`${a.label} — ${a.share}%`),empty:"No single-owner concentration."}),u.jsx(me,{label:"Orphan nodes (no links)",items:Y.orphans.map(a=>a.title),empty:"No orphans — everything connects.",onSelect:s&&(a=>s(Y.orphans[a].id)),selectTitle:a=>`Open "${Y.orphans[a].title}"`})]}):u.jsx("p",{className:"text-xs text-muted-foreground",children:"—"})]}),c&&u.jsx(nn,{node:c,graph:r,nestId:e,hopDepth:f,onHopDepth:o,neighborhood:O,nodesById:Ge,onOpenTag:n,onOpenDocument:s}),u.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[u.jsx(q,{color:W.root,label:"Nest"}),u.jsx(q,{color:W.folder,label:"Folder"}),u.jsx(q,{color:W.doc,label:"Document"}),u.jsx(q,{color:"#ef4444",label:"Orphan document"}),ke&&u.jsx(q,{color:W.tag,label:"Category / tag"}),je&&u.jsx(q,{color:W.steward,label:"Steward"})]})]})]})]})}function xe({label:e,onClick:t,children:n}){return u.jsx("button",{type:"button","aria-label":e,title:e,onClick:t,className:"flex h-7 w-7 items-center justify-center rounded border border-border bg-card text-foreground shadow-sm hover:bg-accent",children:n})}function nn({node:e,graph:t,nestId:n,hopDepth:s,onHopDepth:i,neighborhood:r,nodesById:h,onOpenTag:x,onOpenDocument:v}){const l=e.kind==="doc"?t==null?void 0:t.nodes.find(o=>o.id===e.id):null,y=l&&t?t.links.filter(o=>o.source===l.id||o.target===l.id).length:0,_=Ee(e),p=r?[...r].map(o=>h.get(o)).filter(o=>!!o).map(Ee).filter(o=>!!o):[],c=p.join(" | "),k=typeof window<"u"?window.location.origin:"",f=_?`curl -X POST ${k}/nests/${n}/context \\
|
|
21
|
+
*/const ft=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ht=ue("zoom-out",ft);function dt(e,t){var n,s=1;e==null&&(e=0),t==null&&(t=0);function i(){var r,h=n.length,x,v=0,l=0;for(r=0;r<h;++r)x=n[r],v+=x.x,l+=x.y;for(v=(v/h-e)*s,l=(l/h-t)*s,r=0;r<h;++r)x=n[r],x.x-=v,x.y-=l}return i.initialize=function(r){n=r},i.x=function(r){return arguments.length?(e=+r,i):e},i.y=function(r){return arguments.length?(t=+r,i):t},i.strength=function(r){return arguments.length?(s=+r,i):s},i}function xt(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Re(this.cover(t,n),t,n,e)}function Re(e,t,n,s){if(isNaN(t)||isNaN(n))return e;var i,r=e._root,h={data:s},x=e._x0,v=e._y0,l=e._x1,y=e._y1,_,p,c,k,f,o,d,m;if(!r)return e._root=h,e;for(;r.length;)if((f=t>=(_=(x+l)/2))?x=_:l=_,(o=n>=(p=(v+y)/2))?v=p:y=p,i=r,!(r=r[d=o<<1|f]))return i[d]=h,e;if(c=+e._x.call(null,r.data),k=+e._y.call(null,r.data),t===c&&n===k)return h.next=r,i?i[d]=h:e._root=h,e;do i=i?i[d]=new Array(4):e._root=new Array(4),(f=t>=(_=(x+l)/2))?x=_:l=_,(o=n>=(p=(v+y)/2))?v=p:y=p;while((d=o<<1|f)===(m=(k>=p)<<1|c>=_));return i[m]=r,i[d]=h,e}function gt(e){var t,n,s=e.length,i,r,h=new Array(s),x=new Array(s),v=1/0,l=1/0,y=-1/0,_=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(r=+this._y.call(null,t))||(h[n]=i,x[n]=r,i<v&&(v=i),i>y&&(y=i),r<l&&(l=r),r>_&&(_=r));if(v>y||l>_)return this;for(this.cover(v,l).cover(y,_),n=0;n<s;++n)Re(this,h[n],x[n],e[n]);return this}function mt(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,s=this._y0,i=this._x1,r=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,r=(s=Math.floor(t))+1;else{for(var h=i-n||1,x=this._root,v,l;n>e||e>=i||s>t||t>=r;)switch(l=(t<s)<<1|e<n,v=new Array(4),v[l]=x,x=v,h*=2,l){case 0:i=n+h,r=s+h;break;case 1:n=i-h,r=s+h;break;case 2:i=n+h,s=r-h;break;case 3:n=i-h,s=r-h;break}this._root&&this._root.length&&(this._root=x)}return this._x0=n,this._y0=s,this._x1=i,this._y1=r,this}function pt(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function yt(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(e,t,n,s,i){this.node=e,this.x0=t,this.y0=n,this.x1=s,this.y1=i}function vt(e,t,n){var s,i=this._x0,r=this._y0,h,x,v,l,y=this._x1,_=this._y1,p=[],c=this._root,k,f;for(c&&p.push(new L(c,i,r,y,_)),n==null?n=1/0:(i=e-n,r=t-n,y=e+n,_=t+n,n*=n);k=p.pop();)if(!(!(c=k.node)||(h=k.x0)>y||(x=k.y0)>_||(v=k.x1)<i||(l=k.y1)<r))if(c.length){var o=(h+v)/2,d=(x+l)/2;p.push(new L(c[3],o,d,v,l),new L(c[2],h,d,o,l),new L(c[1],o,x,v,d),new L(c[0],h,x,o,d)),(f=(t>=d)<<1|e>=o)&&(k=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=k)}else{var m=e-+this._x.call(null,c.data),b=t-+this._y.call(null,c.data),w=m*m+b*b;if(w<n){var $=Math.sqrt(n=w);i=e-$,r=t-$,y=e+$,_=t+$,s=c.data}}return s}function wt(e){if(isNaN(y=+this._x.call(null,e))||isNaN(_=+this._y.call(null,e)))return this;var t,n=this._root,s,i,r,h=this._x0,x=this._y0,v=this._x1,l=this._y1,y,_,p,c,k,f,o,d;if(!n)return this;if(n.length)for(;;){if((k=y>=(p=(h+v)/2))?h=p:v=p,(f=_>=(c=(x+l)/2))?x=c:l=c,t=n,!(n=n[o=f<<1|k]))return this;if(!n.length)break;(t[o+1&3]||t[o+2&3]||t[o+3&3])&&(s=t,d=o)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(r=n.next)&&delete n.next,i?(r?i.next=r:delete i.next,this):t?(r?t[o]=r:delete t[o],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(s?s[d]=n:this._root=n),this):(this._root=r,this)}function Nt(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function _t(){return this._root}function bt(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function jt(e){var t=[],n,s=this._root,i,r,h,x,v;for(s&&t.push(new L(s,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(s=n.node,r=n.x0,h=n.y0,x=n.x1,v=n.y1)&&s.length){var l=(r+x)/2,y=(h+v)/2;(i=s[3])&&t.push(new L(i,l,y,x,v)),(i=s[2])&&t.push(new L(i,r,y,l,v)),(i=s[1])&&t.push(new L(i,l,h,x,y)),(i=s[0])&&t.push(new L(i,r,h,l,y))}return this}function kt(e){var t=[],n=[],s;for(this._root&&t.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));s=t.pop();){var i=s.node;if(i.length){var r,h=s.x0,x=s.y0,v=s.x1,l=s.y1,y=(h+v)/2,_=(x+l)/2;(r=i[0])&&t.push(new L(r,h,x,y,_)),(r=i[1])&&t.push(new L(r,y,x,v,_)),(r=i[2])&&t.push(new L(r,h,_,y,l)),(r=i[3])&&t.push(new L(r,y,_,v,l))}n.push(s)}for(;s=n.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}function Mt(e){return e[0]}function St(e){return arguments.length?(this._x=e,this):this._x}function $t(e){return e[1]}function Ct(e){return arguments.length?(this._y=e,this):this._y}function ve(e,t,n){var s=new we(t??Mt,n??$t,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function we(e,t,n,s,i,r){this._x=e,this._y=t,this._x0=n,this._y0=s,this._x1=i,this._y1=r,this._root=void 0}function Me(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var T=ve.prototype=we.prototype;T.copy=function(){var e=new we(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,s;if(!t)return e;if(!t.length)return e._root=Me(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(s=t.source[i])&&(s.length?n.push({source:s,target:t.target[i]=new Array(4)}):t.target[i]=Me(s));return e};T.add=xt;T.addAll=gt;T.cover=mt;T.data=pt;T.extent=yt;T.find=vt;T.remove=wt;T.removeAll=Nt;T.root=_t;T.size=bt;T.visit=jt;T.visitAfter=kt;T.x=St;T.y=Ct;function J(e){return function(){return e}}function U(e){return(e()-.5)*1e-6}function At(e){return e.x+e.vx}function It(e){return e.y+e.vy}function zt(e){var t,n,s,i=1,r=1;typeof e!="function"&&(e=J(e==null?1:+e));function h(){for(var l,y=t.length,_,p,c,k,f,o,d=0;d<r;++d)for(_=ve(t,At,It).visitAfter(x),l=0;l<y;++l)p=t[l],f=n[p.index],o=f*f,c=p.x+p.vx,k=p.y+p.vy,_.visit(m);function m(b,w,$,P,I){var C=b.data,H=b.r,z=f+H;if(C){if(C.index>p.index){var B=c-C.x-C.vx,F=k-C.y-C.vy,D=B*B+F*F;D<z*z&&(B===0&&(B=U(s),D+=B*B),F===0&&(F=U(s),D+=F*F),D=(z-(D=Math.sqrt(D)))/D*i,p.vx+=(B*=D)*(z=(H*=H)/(o+H)),p.vy+=(F*=D)*z,C.vx-=B*(z=1-z),C.vy-=F*z)}return}return w>c+z||P<c-z||$>k+z||I<k-z}}function x(l){if(l.data)return l.r=n[l.data.index];for(var y=l.r=0;y<4;++y)l[y]&&l[y].r>l.r&&(l.r=l[y].r)}function v(){if(t){var l,y=t.length,_;for(n=new Array(y),l=0;l<y;++l)_=t[l],n[_.index]=+e(_,l,t)}}return h.initialize=function(l,y){t=l,s=y,v()},h.iterations=function(l){return arguments.length?(r=+l,h):r},h.strength=function(l){return arguments.length?(i=+l,h):i},h.radius=function(l){return arguments.length?(e=typeof l=="function"?l:J(+l),v(),h):e},h}function Et(e){return e.index}function Se(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Pt(e){var t=Et,n=_,s,i=J(30),r,h,x,v,l,y=1;e==null&&(e=[]);function _(o){return 1/Math.min(x[o.source.index],x[o.target.index])}function p(o){for(var d=0,m=e.length;d<y;++d)for(var b=0,w,$,P,I,C,H,z;b<m;++b)w=e[b],$=w.source,P=w.target,I=P.x+P.vx-$.x-$.vx||U(l),C=P.y+P.vy-$.y-$.vy||U(l),H=Math.sqrt(I*I+C*C),H=(H-r[b])/H*o*s[b],I*=H,C*=H,P.vx-=I*(z=v[b]),P.vy-=C*z,$.vx+=I*(z=1-z),$.vy+=C*z}function c(){if(h){var o,d=h.length,m=e.length,b=new Map(h.map(($,P)=>[t($,P,h),$])),w;for(o=0,x=new Array(d);o<m;++o)w=e[o],w.index=o,typeof w.source!="object"&&(w.source=Se(b,w.source)),typeof w.target!="object"&&(w.target=Se(b,w.target)),x[w.source.index]=(x[w.source.index]||0)+1,x[w.target.index]=(x[w.target.index]||0)+1;for(o=0,v=new Array(m);o<m;++o)w=e[o],v[o]=x[w.source.index]/(x[w.source.index]+x[w.target.index]);s=new Array(m),k(),r=new Array(m),f()}}function k(){if(h)for(var o=0,d=e.length;o<d;++o)s[o]=+n(e[o],o,e)}function f(){if(h)for(var o=0,d=e.length;o<d;++o)r[o]=+i(e[o],o,e)}return p.initialize=function(o,d){h=o,l=d,c()},p.links=function(o){return arguments.length?(e=o,c(),p):e},p.id=function(o){return arguments.length?(t=o,p):t},p.iterations=function(o){return arguments.length?(y=+o,p):y},p.strength=function(o){return arguments.length?(n=typeof o=="function"?o:J(+o),k(),p):n},p.distance=function(o){return arguments.length?(i=typeof o=="function"?o:J(+o),f(),p):i},p}var Rt={value:()=>{}};function Le(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new ae(n)}function ae(e){this._=e}function Lt(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",i=n.indexOf(".");if(i>=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ae.prototype=Le.prototype={constructor:ae,on:function(e,t){var n=this._,s=Lt(e+"",n),i,r=-1,h=s.length;if(arguments.length<2){for(;++r<h;)if((i=(e=s[r]).type)&&(i=Tt(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<h;)if(i=(e=s[r]).type)n[i]=$e(n[i],e.name,t);else if(t==null)for(i in n)n[i]=$e(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ae(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),s=0,i,r;s<i;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],s=0,i=r.length;s<i;++s)r[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)}};function Tt(e,t){for(var n=0,s=e.length,i;n<s;++n)if((i=e[n]).name===t)return i.value}function $e(e,t,n){for(var s=0,i=e.length;s<i;++s)if(e[s].name===t){e[s]=Rt,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var ee=0,re=0,ne=0,Te=1e3,le,se,ce=0,K=0,fe=0,ie=typeof performance=="object"&&performance.now?performance:Date,Be=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fe(){return K||(Be(Bt),K=ie.now()+fe)}function Bt(){K=0}function pe(){this._call=this._time=this._next=null}pe.prototype=He.prototype={constructor:pe,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fe():+n)+(t==null?0:+t),!this._next&&se!==this&&(se?se._next=this:le=this,se=this),this._call=e,this._time=n,ye()},stop:function(){this._call&&(this._call=null,this._time=1/0,ye())}};function He(e,t,n){var s=new pe;return s.restart(e,t,n),s}function Ft(){Fe(),++ee;for(var e=le,t;e;)(t=K-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ee}function Ce(){K=(ce=ie.now())+fe,ee=re=0;try{Ft()}finally{ee=0,Dt(),K=0}}function Ht(){var e=ie.now(),t=e-ce;t>Te&&(fe-=t,ce=e)}function Dt(){for(var e,t=le,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:le=n);se=e,ye(s)}function ye(e){if(!ee){re&&(re=clearTimeout(re));var t=e-K;t>24?(e<1/0&&(re=setTimeout(Ce,e-ie.now()-fe)),ne&&(ne=clearInterval(ne))):(ne||(ce=ie.now(),ne=setInterval(Ht,Te)),ee=1,Be(Ce))}}const Xt=1664525,Yt=1013904223,Ae=4294967296;function Zt(){let e=1;return()=>(e=(Xt*e+Yt)%Ae)/Ae}function Gt(e){return e.x}function Wt(e){return e.y}var Qt=10,Ot=Math.PI*(3-Math.sqrt(5));function Ut(e){var t,n=1,s=.001,i=1-Math.pow(s,1/300),r=0,h=.6,x=new Map,v=He(_),l=Le("tick","end"),y=Zt();e==null&&(e=[]);function _(){p(),l.call("tick",t),n<s&&(v.stop(),l.call("end",t))}function p(f){var o,d=e.length,m;f===void 0&&(f=1);for(var b=0;b<f;++b)for(n+=(r-n)*i,x.forEach(function(w){w(n)}),o=0;o<d;++o)m=e[o],m.fx==null?m.x+=m.vx*=h:(m.x=m.fx,m.vx=0),m.fy==null?m.y+=m.vy*=h:(m.y=m.fy,m.vy=0);return t}function c(){for(var f=0,o=e.length,d;f<o;++f){if(d=e[f],d.index=f,d.fx!=null&&(d.x=d.fx),d.fy!=null&&(d.y=d.fy),isNaN(d.x)||isNaN(d.y)){var m=Qt*Math.sqrt(.5+f),b=f*Ot;d.x=m*Math.cos(b),d.y=m*Math.sin(b)}(isNaN(d.vx)||isNaN(d.vy))&&(d.vx=d.vy=0)}}function k(f){return f.initialize&&f.initialize(e,y),f}return c(),t={tick:p,restart:function(){return v.restart(_),t},stop:function(){return v.stop(),t},nodes:function(f){return arguments.length?(e=f,c(),x.forEach(k),t):e},alpha:function(f){return arguments.length?(n=+f,t):n},alphaMin:function(f){return arguments.length?(s=+f,t):s},alphaDecay:function(f){return arguments.length?(i=+f,t):+i},alphaTarget:function(f){return arguments.length?(r=+f,t):r},velocityDecay:function(f){return arguments.length?(h=1-f,t):1-h},randomSource:function(f){return arguments.length?(y=f,x.forEach(k),t):y},force:function(f,o){return arguments.length>1?(o==null?x.delete(f):x.set(f,k(o)),t):x.get(f)},find:function(f,o,d){var m=0,b=e.length,w,$,P,I,C;for(d==null?d=1/0:d*=d,m=0;m<b;++m)I=e[m],w=f-I.x,$=o-I.y,P=w*w+$*$,P<d&&(C=I,d=P);return C},on:function(f,o){return arguments.length>1?(l.on(f,o),t):l.on(f)}}}function Vt(){var e,t,n,s,i=J(-30),r,h=1,x=1/0,v=.81;function l(c){var k,f=e.length,o=ve(e,Gt,Wt).visitAfter(_);for(s=c,k=0;k<f;++k)t=e[k],o.visit(p)}function y(){if(e){var c,k=e.length,f;for(r=new Array(k),c=0;c<k;++c)f=e[c],r[f.index]=+i(f,c,e)}}function _(c){var k=0,f,o,d=0,m,b,w;if(c.length){for(m=b=w=0;w<4;++w)(f=c[w])&&(o=Math.abs(f.value))&&(k+=f.value,d+=o,m+=o*f.x,b+=o*f.y);c.x=m/d,c.y=b/d}else{f=c,f.x=f.data.x,f.y=f.data.y;do k+=r[f.data.index];while(f=f.next)}c.value=k}function p(c,k,f,o){if(!c.value)return!0;var d=c.x-t.x,m=c.y-t.y,b=o-k,w=d*d+m*m;if(b*b/v<w)return w<x&&(d===0&&(d=U(n),w+=d*d),m===0&&(m=U(n),w+=m*m),w<h&&(w=Math.sqrt(h*w)),t.vx+=d*c.value*s/w,t.vy+=m*c.value*s/w),!0;if(c.length||w>=x)return;(c.data!==t||c.next)&&(d===0&&(d=U(n),w+=d*d),m===0&&(m=U(n),w+=m*m),w<h&&(w=Math.sqrt(h*w)));do c.data!==t&&(b=r[c.data.index]*s/w,t.vx+=d*b,t.vy+=m*b);while(c=c.next)}return l.initialize=function(c,k){e=c,n=k,y()},l.strength=function(c){return arguments.length?(i=typeof c=="function"?c:J(+c),y(),l):i},l.distanceMin=function(c){return arguments.length?(h=c*c,l):Math.sqrt(h)},l.distanceMax=function(c){return arguments.length?(x=c*c,l):Math.sqrt(x)},l.theta=function(c){return arguments.length?(v=c*c,l):Math.sqrt(v)},l}function Jt(e,t){return e>0?"Every category has a steward.":t>0?"No categories yet — tag documents to see steward coverage.":"No categories or stewards yet — tag documents and assign stewards to see coverage."}const W={doc:"#3b82f6",steward:"#16a34a",tag:"#f59e0b",root:"#64748b",folder:"#a855f7"};function Kt(e){return e==="steward"?"#16a34a66":e==="tag"?"#f59e0b66":e==="structure"?"#a855f766":"#94a3b8aa"}const Ie=(e,t,n)=>Math.min(n,Math.max(t,e)),ze=.15,qt=5;function Ee(e){return e.kind==="doc"?e.name.includes("]]")||e.name.includes("|")?null:`[[${e.name}]]`:e.kind==="tag"?`#${e.name.replace(/^#/,"")}`:null}function en(e){return`'${e.replace(/'/g,"'\\''")}'`}function tn({nestId:e,nestName:t,onOpenTag:n,onOpenDocument:s,onBack:i}){const[r,h]=A.useState(null),[x,v]=A.useState(!0),[l,y]=A.useState(null),[_,p]=A.useState({links:!0,stewardship:!0,categories:!0,structure:!0}),[c,k]=A.useState(null),[f,o]=A.useState(1),d=A.useRef(null),m=A.useRef(null),[b,w]=A.useState({w:800,h:560}),[$,P]=A.useState({nodes:[],links:[]}),[I,C]=A.useState({x:0,y:0,k:1}),[H,z]=A.useState(!1),B=A.useRef(null),F=A.useRef(!1),D=A.useRef({w:0,h:0}),De=(a,g)=>{const N=m.current.getBoundingClientRect();return{x:(a-N.left-I.x)/I.k,y:(g-N.top-I.y)/I.k}},Ne=(a,g,N)=>{const j=a.filter(Z=>Z.x!=null&&Z.y!=null);if(!j.length)return C({x:g/2,y:N/2,k:1});let M=1/0,S=1/0,R=-1/0,E=-1/0;for(const Z of j)M=Math.min(M,Z.x),S=Math.min(S,Z.y),R=Math.max(R,Z.x),E=Math.max(E,Z.y);const X=48,G=R-M||1,Q=E-S||1,V=Ie(Math.min((g-2*X)/G,(N-2*X)/Q),ze,1.5);C({x:g/2-(M+R)/2*V,y:N/2-(S+E)/2*V,k:V})},he=(a,g=b.w/2,N=b.h/2)=>{F.current=!0,C(j=>{const M=Ie(j.k*a,ze,qt),S=(g-j.x)/j.k,R=(N-j.y)/j.k;return{k:M,x:g-S*M,y:N-R*M}})};A.useEffect(()=>{const a=m.current;if(!a)return;const g=N=>{N.preventDefault();const j=a.getBoundingClientRect();he(N.deltaY<0?1.1:1/1.1,N.clientX-j.left,N.clientY-j.top)};return a.addEventListener("wheel",g,{passive:!1}),()=>a.removeEventListener("wheel",g)},[b.w,b.h,x,l]);const Xe=a=>{var g,N;(N=(g=m.current)==null?void 0:g.setPointerCapture)==null||N.call(g,a.pointerId),B.current={mode:"pan",px:a.clientX,py:a.clientY},z(!0)},Ye=(a,g)=>{var N,j;a.stopPropagation(),(j=(N=m.current)==null?void 0:N.setPointerCapture)==null||j.call(N,a.pointerId),B.current={mode:"node",node:g,moved:!1}},Ze=a=>{const g=B.current;if(g)if(g.mode==="pan"){const N=a.clientX-g.px,j=a.clientY-g.py;g.px=a.clientX,g.py=a.clientY,F.current=!0,C(M=>({...M,x:M.x+N,y:M.y+j}))}else{g.moved=!0;const N=De(a.clientX,a.clientY);g.node.x=N.x,g.node.y=N.y,P(j=>({...j,nodes:j.nodes.slice()}))}},_e=a=>{var N,j;const g=B.current;(j=(N=m.current)==null?void 0:N.releasePointerCapture)==null||j.call(N,a.pointerId),(g==null?void 0:g.mode)==="node"&&!g.moved&&k(M=>(M==null?void 0:M.id)===g.node.id?null:g.node),B.current=null,z(!1)};A.useEffect(()=>{let a=!1;return v(!0),Qe(e).then(g=>{a||(F.current=!1,h(g))}).catch(g=>!a&&y((g==null?void 0:g.message)||"Failed to load graph")).finally(()=>!a&&v(!1)),()=>{a=!0}},[e]),A.useEffect(()=>{if(!d.current)return;const a=d.current,g=()=>w({w:a.clientWidth,h:Math.max(420,a.clientHeight)});g();let N;const j=new ResizeObserver(()=>{clearTimeout(N),N=setTimeout(g,150)});return j.observe(a),()=>{clearTimeout(N),j.disconnect()}},[]);const Y=(r==null?void 0:r.signals)??null,oe=A.useMemo(()=>{if(!r)return{nodes:[],links:[]};const a=[],g=[],N=new Set(((Y==null?void 0:Y.orphans)||[]).map(S=>S.id));for(const S of r.nodes)a.push({id:S.id,name:S.title,kind:"doc",color:N.has(S.id)?"#ef4444":W.doc,val:2});if(_.links)for(const S of r.links)g.push({...S,kind:"link"});const j=()=>{a.some(S=>S.id==="root:nest")||a.push({id:"root:nest",name:t,kind:"root",color:W.root,val:4})};if(_.structure){j();const S=new Set,R=(X,G)=>{const Q=`${X}~>${G}`;S.has(Q)||(S.add(Q),g.push({source:X,target:G,kind:"structure"}))},E=new Set;for(const X of r.nodes){const G=X.id.split("/").filter(Boolean),Q=G[0]==="nodes"?G.slice(1,-1):G.slice(0,-1);let V="root:nest",Z="";for(const de of Q){Z=Z?`${Z}/${de}`:de;const te=`folder:${Z}`;E.has(te)||(E.add(te),a.push({id:te,name:de,kind:"folder",color:W.folder,val:2})),R(V,te),V=te}R(V,X.id)}}if(_.categories){for(const S of r.tags)a.push({id:`tag:${S.name}`,name:`#${S.name}`,kind:"tag",color:W.tag,val:1+Math.min(S.count,4)});for(const S of r.nodes)for(const R of S.tags)g.push({source:S.id,target:`tag:${R}`,kind:"tag"})}if(_.stewardship){const S=new Map(r.stewards.map(E=>[E.id,E.label]));for(const E of r.stewards)a.push({id:`steward:${E.id}`,name:E.label,kind:"steward",color:W.steward,val:3});let R=!1;for(const E of r.stewardEdges){const X=`steward:${E.steward}`;if(S.has(E.steward))if(E.scope==="tag")if(_.categories)g.push({source:X,target:E.target,kind:"steward"});else{const G=E.target.replace(/^tag:/,"");for(const Q of r.nodes)Q.tags.includes(G)&&g.push({source:X,target:Q.id,kind:"steward"})}else E.scope==="document"?g.push({source:X,target:E.target,kind:"steward"}):(R=!0,g.push({source:X,target:"root:nest",kind:"steward"}))}R&&j()}const M=new Set(a.map(S=>S.id));return{nodes:a,links:g.filter(S=>M.has(S.source)&&M.has(S.target))}},[r,_,Y,t]);A.useEffect(()=>{if(!oe.nodes.length){P({nodes:[],links:[]});return}const a=oe.nodes.map(M=>({...M})),g=oe.links.map(M=>({...M})),N=Ut(a).force("link",Pt(g).id(M=>M.id).distance(55).strength(.35)).force("charge",Vt().strength(-170)).force("center",dt(b.w/2,b.h/2)).force("collide",zt(14)).stop();for(let M=0;M<300;M++)N.tick();P({nodes:a,links:g});const j=D.current.w!==b.w||D.current.h!==b.h;(!F.current||j)&&(Ne(a,b.w,b.h),D.current={w:b.w,h:b.h})},[oe,b.w,b.h]);const be=a=>3+a.val,O=A.useMemo(()=>{if(!c)return null;const a=new Map;for(const j of $.links){const M=typeof j.source=="string"?j.source:j.source.id,S=typeof j.target=="string"?j.target:j.target.id;(a.get(M)??a.set(M,[]).get(M)).push(S),(a.get(S)??a.set(S,[]).get(S)).push(M)}const g=new Set([c.id]);let N=[c.id];for(let j=0;j<f&&N.length;j++){const M=[];for(const S of N)for(const R of a.get(S)??[])g.has(R)||(g.add(R),M.push(R));N=M}return g},[c,f,$.links]),Ge=A.useMemo(()=>new Map($.nodes.map(a=>[a.id,a])),[$.nodes]),je=((r==null?void 0:r.stewards.length)??0)>0,ke=((r==null?void 0:r.tags.length)??0)>0,We=((r==null?void 0:r.links.length)??0)>0;return u.jsxs("div",{className:"space-y-4",children:[u.jsx(nt,{nestName:t,onBack:i,children:u.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[[["structure","Structure",ot,!0],["links","Links",rt,We],["stewardship","Stewardship",Oe,je],["categories","Categories",st,ke]].filter(([,,,a])=>a).map(([a,g,N])=>u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",checked:_[a],onChange:j=>p(M=>({...M,[a]:j.target.checked}))}),u.jsx(N,{className:"h-3.5 w-3.5"}),g]},a)),u.jsx(Pe,{variant:"ghost",size:"sm",onClick:()=>{F.current=!1,C({x:0,y:0,k:1})},title:"Reset pan & zoom",children:"Reset view"})]})}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-4",children:[u.jsxs("div",{ref:d,className:"border border-border rounded-lg bg-card overflow-hidden h-[560px] relative",children:[x&&u.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground",children:[u.jsx(Ue,{className:"h-5 w-5 animate-spin mr-2"})," Loading ontology…"]}),l&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-red-500 text-sm",children:l}),!x&&!l&&(r==null?void 0:r.truncated)&&u.jsxs("div",{className:"absolute top-2 left-2 z-10 rounded bg-amber-100 text-amber-800 text-xs px-2 py-1 border border-amber-300",children:["Showing ",r.nodes.length," of ",r.totalNodes," nodes (highest-connected). Gaps below cover all ",r.totalNodes,"."]}),!x&&!l&&u.jsxs(u.Fragment,{children:[u.jsx("svg",{ref:m,width:b.w,height:b.h,className:"block touch-none",style:{cursor:H?"grabbing":"grab"},onPointerDown:Xe,onPointerMove:Ze,onPointerUp:_e,onPointerLeave:_e,children:u.jsxs("g",{transform:`translate(${I.x},${I.y}) scale(${I.k})`,children:[u.jsx("g",{children:$.links.map((a,g)=>{const N=a.source,j=a.target;if((N==null?void 0:N.x)==null||(j==null?void 0:j.x)==null)return null;const M=!O||O.has(N.id)&&O.has(j.id);return u.jsx("line",{x1:N.x,y1:N.y,x2:j.x,y2:j.y,stroke:Kt(a.kind),strokeWidth:(M&&O?1.6:1)/I.k,opacity:M?1:.15},g)})}),u.jsx("g",{children:$.nodes.map(a=>{const g=!O||O.has(a.id);return u.jsxs("g",{transform:`translate(${a.x??0},${a.y??0})`,onPointerDown:N=>Ye(N,a),onDoubleClick:()=>{a.kind==="doc"&&(s==null||s(a.id))},style:{cursor:"grab"},opacity:g?1:.25,children:[a.kind==="doc"&&s&&u.jsx("title",{children:`Double-click to open "${a.name}"`}),u.jsx("circle",{r:be(a),fill:a.color,stroke:(c==null?void 0:c.id)===a.id?"#111827":g&&O?"#111827aa":"#ffffff",strokeWidth:(c==null?void 0:c.id)===a.id?2:1}),u.jsx("text",{x:be(a)+3,y:3,fontSize:9,fill:"#475569",children:a.name.length>24?a.name.slice(0,24)+"…":a.name})]},a.id)})})]})}),u.jsxs("div",{className:"absolute bottom-2 right-2 z-10 flex flex-col gap-1",children:[u.jsx(xe,{label:"Zoom in",onClick:()=>he(1.25),children:u.jsx(ut,{className:"h-4 w-4"})}),u.jsx(xe,{label:"Zoom out",onClick:()=>he(1/1.25),children:u.jsx(ht,{className:"h-4 w-4"})}),u.jsx(xe,{label:"Fit to view",onClick:()=>Ne($.nodes,b.w,b.h),children:u.jsx(lt,{className:"h-4 w-4"})})]})]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"border border-border rounded-lg bg-card p-3",children:[u.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-sm mb-2",children:[((r==null?void 0:r.nodes.length)??0)===0?u.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"}):u.jsx(Je,{className:"h-4 w-4 text-amber-500"})," ","Coverage gaps"]}),Y?((r==null?void 0:r.nodes.length)??0)===0?u.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.jsx("span",{className:"font-medium text-foreground",children:"No documents yet"})," ","— add content to see governance coverage and connection gaps."]}):u.jsxs("div",{className:"space-y-3 text-sm",children:[u.jsx(me,{label:"Categories with no steward",items:Y.unstewardedTags.map(a=>`#${a.name} (${a.count})`),empty:Jt((r==null?void 0:r.tags.length)??0,(r==null?void 0:r.stewards.length)??0),onSelect:n&&(a=>n(Y.unstewardedTags[a].name)),selectTitle:a=>`Show #${Y.unstewardedTags[a].name} documents`}),u.jsx(me,{label:"Bottleneck stewards (≥50% of nodes)",items:Y.bottlenecks.map(a=>`${a.label} — ${a.share}%`),empty:"No single-owner concentration."}),u.jsx(me,{label:"Orphan nodes (no links)",items:Y.orphans.map(a=>a.title),empty:"No orphans — everything connects.",onSelect:s&&(a=>s(Y.orphans[a].id)),selectTitle:a=>`Open "${Y.orphans[a].title}"`})]}):u.jsx("p",{className:"text-xs text-muted-foreground",children:"—"})]}),c&&u.jsx(nn,{node:c,graph:r,nestId:e,hopDepth:f,onHopDepth:o,neighborhood:O,nodesById:Ge,onOpenTag:n,onOpenDocument:s}),u.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[u.jsx(q,{color:W.root,label:"Nest"}),u.jsx(q,{color:W.folder,label:"Folder"}),u.jsx(q,{color:W.doc,label:"Document"}),u.jsx(q,{color:"#ef4444",label:"Orphan document"}),ke&&u.jsx(q,{color:W.tag,label:"Category / tag"}),je&&u.jsx(q,{color:W.steward,label:"Steward"})]})]})]})]})}function xe({label:e,onClick:t,children:n}){return u.jsx("button",{type:"button","aria-label":e,title:e,onClick:t,className:"flex h-7 w-7 items-center justify-center rounded border border-border bg-card text-foreground shadow-sm hover:bg-accent",children:n})}function nn({node:e,graph:t,nestId:n,hopDepth:s,onHopDepth:i,neighborhood:r,nodesById:h,onOpenTag:x,onOpenDocument:v}){const l=e.kind==="doc"?t==null?void 0:t.nodes.find(o=>o.id===e.id):null,y=l&&t?t.links.filter(o=>o.source===l.id||o.target===l.id).length:0,_=Ee(e),p=r?[...r].map(o=>h.get(o)).filter(o=>!!o).map(Ee).filter(o=>!!o):[],c=p.join(" | "),k=typeof window<"u"?window.location.origin:"",f=_?`curl -X POST ${k}/nests/${n}/context \\
|
|
22
22
|
-H "Content-Type: application/json" \\
|
|
23
23
|
-H "Authorization: Bearer <api-key>" \\
|
|
24
24
|
-d ${en(JSON.stringify({selector:_,hops:s}))}`:null;return u.jsxs("div",{className:"border border-border rounded-lg bg-card p-3 text-sm space-y-2",children:[u.jsxs("div",{children:[u.jsx("div",{className:"font-medium mb-1 break-all",children:e.name}),u.jsx("div",{className:"text-xs text-muted-foreground capitalize",children:e.kind})]}),l&&v&&u.jsx(Pe,{size:"sm",variant:"outline",className:"w-full h-7 text-xs",onClick:()=>v(l.id),children:"Open document"}),l&&u.jsxs("div",{className:"space-y-1 text-xs",children:[l.tags.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1",children:l.tags.map(o=>u.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(o),disabled:!x,className:"rounded bg-amber-50 text-amber-700 px-1.5 py-0.5 hover:bg-amber-100 disabled:hover:bg-amber-50 disabled:cursor-default",title:x?`Show #${o} documents`:`#${o}`,children:["#",o]},o))}),u.jsx("div",{className:"text-muted-foreground",children:y===0?"No wikilinks":`${y} wikilink${y===1?"":"s"}`})]}),u.jsxs("div",{className:"border-t pt-2 space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-xs font-medium",children:"Query this selection"}),u.jsxs("label",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:["hops",u.jsx("select",{className:"border border-border rounded bg-card px-1 py-0.5 text-xs",value:s,onChange:o=>i(Number(o.target.value)),children:[0,1,2,3].map(o=>u.jsx("option",{value:o,children:o},o))})]})]}),_&&u.jsx(ge,{label:"Selector",value:_}),f&&u.jsx(ge,{label:`API call (this node + ${s} hop${s===1?"":"s"})`,value:f}),p.length>1&&u.jsx(ge,{label:`Highlighted set (${p.length} nodes, exact — use hops: 0)`,value:c}),!_&&p.length===0&&u.jsx("p",{className:"text-xs text-muted-foreground",children:"No selector for this node kind — select a document or tag."})]})]})}function ge({label:e,value:t}){const[n,s]=A.useState(!1),i=async()=>{await et(t)&&(s(!0),setTimeout(()=>s(!1),1500))};return u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[u.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:e}),u.jsx("button",{type:"button","aria-label":`Copy ${e}`,onClick:i,className:"flex h-5 w-5 items-center justify-center rounded hover:bg-accent shrink-0",children:n?u.jsx(Ke,{className:"h-3 w-3 text-green-600"}):u.jsx(qe,{className:"h-3 w-3"})})]}),u.jsx("pre",{className:"bg-muted rounded px-2 py-1.5 text-[10px] font-mono whitespace-pre-wrap break-all max-h-28 overflow-y-auto",children:t})]})}function me({label:e,items:t,empty:n,onSelect:s,selectTitle:i}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-medium text-foreground",children:e}),t.length===0?u.jsx("div",{className:"text-xs text-muted-foreground",children:n}):u.jsxs("ul",{className:"mt-0.5 space-y-0.5",children:[t.slice(0,8).map((r,h)=>u.jsx("li",{className:"text-xs text-amber-700 break-all",children:s?u.jsx("button",{type:"button",onClick:()=>s(h),title:i==null?void 0:i(h),className:"text-left hover:underline",children:r}):r},h)),t.length>8&&u.jsxs("li",{className:"text-xs text-muted-foreground",children:["+",t.length-8," more"]})]})]})}function q({color:e,label:t}){return u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{background:e}}),t]})}function ln(){const e=tt();return u.jsx(tn,{nestId:e.nestId,nestName:e.nestName,onOpenTag:t=>e.openNest({tags:[t]}),onOpenDocument:e.openDocument,onBack:e.leaveNest})}export{ln as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as n,u as G,l as z,i as l,
|
|
2
|
-
`).length+1)),className:`${k} min-h-[2.25rem] resize-y`,"data-testid":"definitions-definition"})}),e.jsx("td",{className:"align-top",children:e.jsx("input",{value:
|
|
1
|
+
import{r as n,u as G,l as z,i as l,aZ as Z,a6 as J,j as e,B as C,L as M,au as W,h as U,b4 as V,b9 as X,ba as Y,b8 as I}from"./index-DvuUIUP6.js";import{N as ee}from"./NestPageHeader-Bbje2ncY.js";import{T as te}from"./trash-2-aljmIff4.js";import"./arrow-left-CiErCCTG.js";function se({nestId:a,nestName:B,isArchived:S,onBack:H}){var K;const[h,Q]=n.useState([]),p=G(),[T,D]=n.useState(!0),[d,E]=n.useState(!1),[g,A]=n.useState(!1),[i,L]=n.useState(null),[o,b]=n.useState(""),[c,j]=n.useState(""),[P,w]=n.useState(""),u=n.useCallback(async()=>{D(!0);try{const{definitions:t}=await p.fetchQuery(z.definitions(a));Q(t)}catch(t){l.error((t==null?void 0:t.message)||"Failed to load definitions")}finally{D(!1)}},[a]);n.useEffect(()=>{let t=!1;return p.fetchQuery(z.nest(a)).then(s=>{if(t)return;const q=Z({roles:(s==null?void 0:s.roles)??[],permission:(s==null?void 0:s.permission)??null,myStewards:(s==null?void 0:s.myStewards)??[],isOwner:(s==null?void 0:s.permission)==="owner",isAdmin:(s==null?void 0:s.permission)==="admin",isArchived:S||J(s==null?void 0:s.nest)});E(q.canManage||q.collabCanWrite)}).catch(()=>{t||E(!1)}),()=>{t=!0}},[a,p,S]),n.useEffect(()=>{u()},[u]);const N=()=>{L(null),b(""),j(""),w("")},y=t=>{var s;L(t.id),b(t.term),j(t.definition),w(((s=t.linked_tag)==null?void 0:s.replace(/^#/,""))??"")},_=o.trim().toLowerCase(),r=_?h.find(t=>t.term.toLowerCase()===_&&t.id!==i)??null:null,F=async()=>{if(!o.trim()||!c.trim())return l.error("Term and definition are both required."),!1;A(!0);try{const t=P.trim();return await X(a,{term:o.trim(),definition:c.trim(),...t||i?{linked_tag:t||null}:{},...i?{editing_id:i}:{}}),l.success(i?"Definition updated":r?`Replaced the definition of "${r.term}"`:"Term defined"),N(),await u(),!0}catch(t){return l.error((t==null?void 0:t.message)||"Save failed"),!1}finally{A(!1)}},O=async t=>{try{await Y(a,t.id),l.success(`Removed "${t.term}"`),await u()}catch(s){l.error((s==null?void 0:s.message)||"Delete failed")}},[x,m]=n.useState(!1),f=i??(x?"new":null),$=()=>{N(),m(!1)},v=t=>{t.key==="Escape"?(t.preventDefault(),$()):t.key==="Enter"&&(t.ctrlKey||t.metaKey||!(t.target instanceof HTMLTextAreaElement))&&(t.preventDefault(),F().then(s=>s&&m(!1)))},k="w-full rounded-md border border-input bg-background px-2 py-1 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",R=e.jsxs(e.Fragment,{children:[e.jsx("td",{className:"align-top",children:e.jsx("input",{autoFocus:!0,value:o,onChange:t=>b(t.target.value),onKeyDown:v,placeholder:"Term","aria-label":"Term",className:k,"data-testid":"definitions-term"})}),e.jsx("td",{className:"align-top",children:e.jsx("textarea",{value:c,onChange:t=>j(t.target.value),onKeyDown:v,placeholder:"What this term means here — formula or source if quantitative. Ctrl+Enter saves.","aria-label":"Definition",rows:Math.min(8,Math.max(2,c.split(`
|
|
2
|
+
`).length+1)),className:`${k} min-h-[2.25rem] resize-y`,"data-testid":"definitions-definition"})}),e.jsx("td",{className:"align-top",children:e.jsx("input",{value:P,onChange:t=>w(t.target.value),onKeyDown:v,placeholder:"tag","aria-label":"Linked tag",className:`${k} w-28`,"data-testid":"definitions-tag"})}),e.jsx("td",{className:"align-top text-xs text-muted-foreground whitespace-nowrap pt-2",children:i?(K=h.find(t=>t.id===i))==null?void 0:K.defined_by:"you"}),e.jsx("td",{className:"align-top whitespace-nowrap text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(C,{variant:"ghost",size:"sm",className:"h-7",onClick:$,disabled:g,children:"Cancel"}),e.jsx(C,{size:"sm",className:"h-7",onClick:()=>void F().then(t=>t&&m(!1)),disabled:g||!o.trim()||!c.trim(),"data-testid":"definitions-save",children:g?e.jsx(M,{className:"h-3.5 w-3.5 animate-spin"}):r&&!i?"Replace":"Save"})]})})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(ee,{nestName:B,onBack:H,title:e.jsx("h1",{className:"min-w-0 truncate text-xl font-semibold",children:"Definitions"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The nest's shared vocabulary — what each term means here, written down once so everyone (and every agent reading this nest) uses it the same way. Click a row to edit it."}),e.jsx("div",{className:"border border-border rounded-lg overflow-x-auto","data-testid":"definitions-table",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 text-muted-foreground text-xs",children:e.jsxs("tr",{className:"[&>th]:px-3 [&>th]:py-2 [&>th]:text-left [&>th]:font-medium",children:[e.jsx("th",{className:"w-[18%]",children:"Term"}),e.jsx("th",{children:"Definition"}),e.jsx("th",{className:"w-28",children:"Tag"}),e.jsx("th",{className:"w-36",children:"Defined by"}),e.jsx("th",{className:"w-28"})]})}),e.jsxs("tbody",{children:[T&&e.jsx("tr",{children:e.jsxs("td",{colSpan:5,className:"px-3 py-8 text-center text-muted-foreground",children:[e.jsx(M,{className:"h-4 w-4 animate-spin inline mr-2"}),"Loading…"]})}),!T&&h.length===0&&!x&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-3 py-8 text-center text-muted-foreground",children:d?"No terms defined yet. Add the first one below.":"No terms defined yet."})}),h.map(t=>f===t.id?e.jsx("tr",{className:"border-t border-border bg-muted/20 [&>td]:px-2 [&>td]:py-1.5","data-testid":"definitions-row-editing",children:R},t.id):e.jsxs("tr",{onClick:d&&f===null?()=>y(t):void 0,className:`group border-t border-border align-top [&>td]:px-3 [&>td]:py-2${d&&f===null?" cursor-text hover:bg-muted/30":""}`,"data-testid":"definitions-row",children:[e.jsx("td",{className:"font-medium whitespace-nowrap",children:t.term}),e.jsx("td",{className:"max-w-[520px]",children:e.jsx("span",{className:"whitespace-pre-wrap",children:t.definition})}),e.jsx("td",{className:"whitespace-nowrap",children:t.linked_tag?e.jsx("span",{className:"rounded bg-amber-50 text-amber-700 px-1.5 py-0.5 text-xs",children:t.linked_tag}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx("td",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.defined_by}),e.jsx("td",{className:"whitespace-nowrap text-right",children:d&&e.jsxs("span",{className:"opacity-0 group-hover:opacity-100 focus-within:opacity-100",children:[e.jsx("button",{type:"button","aria-label":`Edit ${t.term}`,onClick:s=>{s.stopPropagation(),y(t)},className:"p-1 rounded hover:bg-accent mr-1",children:e.jsx(W,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button","aria-label":`Delete ${t.term}`,onClick:s=>{s.stopPropagation(),O(t)},className:"p-1 rounded hover:bg-accent text-red-600",children:e.jsx(te,{className:"h-3.5 w-3.5"})})]})})]},t.id)),f!==null&&r&&e.jsx("tr",{className:"bg-amber-50/60",children:e.jsx("td",{colSpan:5,className:"px-3 py-2 text-xs text-amber-800",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(U,{className:"h-3.5 w-3.5 shrink-0 mt-0.5"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("b",{children:r.term})," ",i?e.jsxs(e.Fragment,{children:["is already defined by another row (",r.defined_by,") — this rename will be rejected."]}):e.jsxs(e.Fragment,{children:["is already defined by ",r.defined_by,". Saving replaces that definition."]})]}),!i&&e.jsxs(C,{variant:"outline",size:"sm",className:"h-7 shrink-0",onClick:()=>{m(!1),y(r)},children:[e.jsx(W,{className:"h-3.5 w-3.5 mr-1"})," Edit it instead"]})]})})}),d&&x&&i===null&&e.jsx("tr",{className:"border-t border-border bg-muted/20 [&>td]:px-2 [&>td]:py-1.5","data-testid":"definitions-row-new",children:R}),d&&!x&&e.jsx("tr",{className:"border-t border-border",children:e.jsx("td",{colSpan:5,className:"p-0",children:e.jsxs("button",{type:"button",onClick:()=>{N(),m(!0)},className:"flex w-full items-center gap-1.5 px-3 py-2 text-left text-sm text-muted-foreground hover:bg-muted/40 hover:text-foreground","data-testid":"definitions-add",children:[e.jsx(V,{className:"h-3.5 w-3.5"})," New term"]})})})]})]})}),e.jsxs("details",{className:"rounded-md border bg-muted/30 px-3 py-2 text-xs",children:[e.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"For developers — fetch a definition over HTTP"}),e.jsxs("div",{className:"mt-2 space-y-1.5 text-muted-foreground",children:[e.jsx("p",{children:"Agents and analysis jobs read these live, so a definition edited here changes what they answer with on the next call."}),e.jsxs("pre",{className:"overflow-x-auto rounded border bg-background p-2 font-mono text-[10.5px] leading-relaxed",children:["GET /nests/",a,"/definitions?term=<term>"]}),e.jsx("p",{children:"Omit the query to get the whole glossary."})]})]})]})}function de(){const a=I();return e.jsx(se,{nestId:a.nestId,nestName:a.nestName,isArchived:a.isArchived,onBack:a.leaveNest})}export{de as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as Ie,S as Ee,r as a,u as _e,j as e,U as he,B as r,A as Y,O as $,a as q,c6 as xe,c7 as ue,c9 as pe,c8 as je,ca as ge,L as v,I as Ne,d7 as ve,d8 as fe,e as B,bK as we,dm as De,e7 as Re,C as Z,aD as be,aI as Ce,D as R,G as L,H as P,J as F,K as O,M as z,e8 as Le,e9 as Pe,ea as Fe,l as X,dk as Oe,N as ke,eb as ze,_ as Ge,ec as Me}from"./index-DvuUIUP6.js";import{P as Ue}from"./page-title-Dn5jANiU.js";import{U as ye}from"./user-plus-DPerZexX.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Ke=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],Qe=Ee("shield-off",Ke);function We(){var de,me;const{adminStatus:h}=Ie(),l=((me=(de=h==null?void 0:h.me)==null?void 0:de.email)==null?void 0:me.toLowerCase())??null,[g,c]=a.useState([]),i=Le(),[x,d]=a.useState(""),[u,f]=a.useState("all"),[w,m]=a.useState([]),[j,A]=a.useState(!0),[E,y]=a.useState(null),[J,t]=a.useState(!1),[N,b]=a.useState(""),[I,ee]=a.useState(null),[p,L]=a.useState(null),[Se,W]=a.useState(!1);a.useEffect(()=>W(!1),[p==null?void 0:p.password]);const[C,G]=a.useState(null),[M,se]=a.useState(!1),[k,U]=a.useState(null),[K,ae]=a.useState(!1),[te,re]=a.useState(null),[S,Q]=a.useState(null),[Y,ne]=a.useState(!1),[ie,le]=a.useState(null),[ce,Te]=a.useState({}),T=async()=>{A(!0);try{const[s,o]=await Promise.all([i.fetchQuery(Z.teammates()),i.fetchQuery(Z.superAdmins())]);c(s.teammates),m(s.pending_stewards||[]),Te(Object.fromEntries(o.super_admins.map(n=>[n.email.toLowerCase(),{source:n.source,self:n.self}]))),y(null)}catch(s){y(s.message)}finally{A(!1)}};a.useEffect(()=>{T()},[]);const X=x.trim().toLowerCase(),oe=g.filter(s=>u==="admin"&&!s.is_admin||u==="normal"&&s.is_admin?!1:X?s.email.toLowerCase().includes(X)||(s.name||"").toLowerCase().includes(X):!0),Ae=s=>{const o=Fe(s);if(!o)return"Never";const n=Date.now()-o.getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:n<6048e5?`${Math.floor(n/864e5)}d ago`:o.toLocaleDateString()};return e.jsxs("div",{children:[e.jsx(Ue,{icon:he,title:"Teammates",description:"Add teammates and manage their access",actions:e.jsxs(r,{onClick:()=>t(!0),children:[e.jsx(ye,{className:"h-4 w-4 mr-2"}),"Invite Teammate"]})}),E&&e.jsxs($,{variant:"destructive",className:"mb-4",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx(q,{children:E})]}),e.jsxs(xe,{children:[e.jsxs(ue,{children:[e.jsxs(pe,{className:"text-lg flex items-center gap-2",children:[e.jsx(he,{className:"h-4 w-4"}),"All Users"]}),e.jsx(je,{children:"Everyone who has access to this community server"})]}),e.jsx(ge,{children:j?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(v,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):g.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:'No teammates yet. Click "Invite Teammate" to add one.'}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[e.jsx(Ne,{value:x,onChange:s=>d(s.target.value),placeholder:"Search by name or email…",className:"h-8 max-w-xs text-sm"}),e.jsx("div",{className:"flex items-center rounded-md border p-0.5 text-xs",children:[["all","All"],["admin","Superadmins"],["normal","Members"]].map(([s,o])=>e.jsx("button",{type:"button",onClick:()=>f(s),className:`px-2.5 py-1 rounded ${u===s?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:o},s))})]}),oe.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No users match your filters."}):e.jsx("div",{className:"space-y-2",children:oe.map(s=>{var o,n;return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[e.jsx(ve,{className:"h-9 w-9",children:e.jsx(fe,{children:(s.email[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium truncate",children:s.name||s.email}),l&&s.email.toLowerCase()===l&&e.jsx(B,{variant:"outline",className:"border-emerald-200 bg-emerald-50 text-emerald-700",children:"You"}),s.is_admin&&e.jsxs(B,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",children:[e.jsx(we,{className:"h-3 w-3"}),"Admin"]}),!!s.is_invited&&e.jsx(B,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700",title:"Added with a temporary password. They can sign in with their email + that password (use Reset password to re-issue one), then change it.",children:"Invited"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-3",children:[e.jsx("span",{children:s.email}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.key_count," key",s.key_count!==1?"s":""]}),s.last_active&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["last active ",Ae(s.last_active)]})]})]})]}),s.is_admin&&((o=ce[s.email.toLowerCase()])==null?void 0:o.source)==="granted"&&!((n=ce[s.email.toLowerCase()])!=null&&n.self)&&e.jsxs(r,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>Q(s),title:"Revoke this user's superadmin access",children:[e.jsx(Qe,{className:"h-4 w-4 mr-2"}),"Revoke superadmin"]}),!s.is_admin&&e.jsxs(e.Fragment,{children:[!s.is_invited&&e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>U(s),title:"Grant this user superadmin access",children:[e.jsx(_e,{className:"h-4 w-4 mr-2"}),"Grant superadmin"]}),e.jsx(r,{variant:"outline",size:"sm",disabled:!!p,onClick:async()=>{L({email:s.email,password:null});try{const _=await Re(s.id);L({email:s.email,password:_.temporary_password||""}),await T()}catch(_){L(null),y(_.message)}},title:"Generate a temporary password to share with this user (no email is sent)",children:"Reset password"}),e.jsx(r,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>G(s),title:"Remove this user and revoke all access",children:"Remove"})]})]},s.id)})})]})})]}),w.length>0&&e.jsxs(xe,{className:"mt-4 border-amber-200 bg-amber-50/40",children:[e.jsxs(ue,{children:[e.jsxs(pe,{className:"text-lg flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-amber-700"}),"Stewards without server access"]}),e.jsx(je,{children:"These emails are assigned as stewards on one or more nests, but haven't registered to this server yet — they can't log in or approve anything until they claim an account."})]}),e.jsx(ge,{children:e.jsx("div",{className:"space-y-2",children:w.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-background",children:[e.jsx(ve,{className:"h-9 w-9",children:e.jsx(fe,{className:"bg-amber-100 text-amber-800",children:(s[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Assigned as steward · not registered yet"})]}),e.jsxs(r,{size:"sm",onClick:()=>{b(s),t(!0)},children:[e.jsx(ye,{className:"h-3.5 w-3.5 mr-1"}),"Invite"]})]},s))})})]}),J&&e.jsx(Ye,{seedEmail:N,onClose:()=>{t(!1),b("")},onCreated:(s,o,n,_)=>{t(!1),b(""),ee({email:s,password:o,promptowl:n,emailed:_}),T()}}),I&&e.jsx($e,{email:I.email,password:I.password,promptowl:I.promptowl,emailed:I.emailed,onClose:()=>ee(null)}),p&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>L(null),children:e.jsxs("div",{className:"w-full max-w-sm rounded-lg border bg-background p-5 shadow-lg",onClick:s=>s.stopPropagation(),children:[e.jsx("h3",{className:"font-semibold mb-1",children:"Temporary password"}),p.password===null?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[e.jsx(v,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Generating a temporary password for",e.jsx("br",{}),e.jsx("strong",{className:"text-foreground",children:p.email})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["Share this with ",e.jsx("strong",{children:p.email})," directly — no email is sent. They sign in with it, then change it from their account. It won't be shown again. Their existing API keys keep working; revoke a key separately if it may be compromised."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 bg-muted border rounded px-2 py-1.5 text-sm font-mono break-all",children:p.password}),e.jsx(r,{variant:"outline",size:"sm",onClick:async()=>{await Ce(p.password,"Temporary password copied")&&(W(!0),setTimeout(()=>W(!1),1500))},children:Se?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-3.5 w-3.5 mr-1 text-green-600"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})})]}),e.jsx("div",{className:"mt-4 text-right",children:e.jsx(r,{variant:"outline",size:"sm",onClick:()=>L(null),children:"Done"})})]})]})}),e.jsx(R,{open:!!C,onOpenChange:s=>!s&&!M&&G(null),children:e.jsxs(D,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsxs(z,{children:["Remove ",C==null?void 0:C.email,"?"]}),e.jsx(F,{children:"This revokes all their access (API keys, sessions, steward + collaborator roles) and deletes the account. This cannot be undone."})]}),e.jsxs(O,{children:[e.jsx(r,{variant:"outline",onClick:()=>G(null),disabled:M,children:"Cancel"}),e.jsx(r,{variant:"destructive",disabled:M,onClick:async()=>{if(C){se(!0);try{await De(C.id),G(null),await T()}catch(s){y(s.message)}finally{se(!1)}}},children:M?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Remove"})]})]})}),e.jsx(R,{open:!!k,onOpenChange:s=>!s&&!K&&U(null),children:e.jsxs(D,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsxs(z,{children:["Grant superadmin to ",k==null?void 0:k.email,"?"]}),e.jsx(F,{children:"They immediately get server-admin access everywhere: every nest, teammate management, and the activity trace. You can revoke this later from this list."})]}),te&&e.jsxs($,{variant:"destructive",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx(q,{children:te})]}),e.jsxs(O,{children:[e.jsx(r,{variant:"outline",onClick:()=>U(null),disabled:K,children:"Cancel"}),e.jsx(r,{disabled:K,onClick:async()=>{if(k){ae(!0),re(null);try{await Pe(k.email),U(null),await T()}catch(s){re(s.message)}finally{ae(!1)}}},children:K?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Grant"})]})]})}),e.jsx(R,{open:!!S,onOpenChange:s=>!s&&!Y&&Q(null),children:e.jsxs(D,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsxs(z,{children:["Revoke superadmin from ",S==null?void 0:S.email,"?"]}),e.jsx(F,{children:"They immediately lose server-admin access. They keep their account and any nest/collaborator roles granted separately. You can grant superadmin again later."})]}),ie&&e.jsxs($,{variant:"destructive",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx(q,{children:ie})]}),e.jsxs(O,{children:[e.jsx(r,{variant:"outline",onClick:()=>Q(null),disabled:Y,children:"Cancel"}),e.jsx(r,{variant:"destructive",disabled:Y,onClick:async()=>{if(S){ne(!0),le(null);try{await ze(S.email),Q(null),await T()}catch(s){le(s.message)}finally{ne(!1)}}},children:Y?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Revoke"})]})]})})]})}function Ye({seedEmail:h,onClose:l,onCreated:g}){const[c,i]=a.useState(h||""),[x,d]=a.useState(!1),[u,f]=a.useState(null),w=async m=>{if(m.preventDefault(),!!c.trim()){d(!0),f(null);try{const j=await Oe(c);g(c,j.temporary_password,!!j.promptowl_sign_in,!!j.emailed)}catch(j){f(j.message),d(!1)}}};return e.jsx(R,{open:!0,onOpenChange:l,children:e.jsxs(D,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsx(z,{children:"Add Teammate"}),e.jsx(F,{children:"Create a login for a teammate. They get a temporary password to sign in with, then can change it and create their own API key."})]}),e.jsxs("form",{onSubmit:w,className:"space-y-3",children:[u&&e.jsxs($,{variant:"destructive",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx(q,{children:u})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ke,{children:"Email"}),e.jsx(Ne,{type:"email",placeholder:"jane@acme.com",value:c,onChange:m=>i(m.target.value),required:!0,autoFocus:!0})]}),e.jsxs(O,{children:[e.jsx(r,{variant:"outline",type:"button",onClick:l,children:"Cancel"}),e.jsx(r,{type:"submit",disabled:x||!c.trim(),children:x?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Add teammate"})]})]})]})})}function $e({email:h,password:l,promptowl:g,emailed:c,onClose:i}){const[x,d]=a.useState(!1),u=async()=>{await Ce(l)&&(d(!0),setTimeout(()=>d(!1),1500))};return e.jsx(R,{open:!0,onOpenChange:i,children:e.jsxs(D,{className:"sm:max-w-[520px]",children:[e.jsxs(P,{children:[e.jsxs(z,{children:["Teammate added: ",h]}),e.jsxs(F,{children:[c?"We've emailed them this temporary password and a sign-in link. ":"Send them this temporary password via Slack, email, or another secure channel. ",e.jsx("strong",{children:"It won't be shown again."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ke,{className:"text-xs text-muted-foreground",children:"Temporary password"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:l}),e.jsx(r,{size:"sm",variant:"outline",onClick:u,children:x?e.jsx(V,{className:"h-3.5 w-3.5 text-green-600"}):e.jsx(be,{className:"h-3.5 w-3.5"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"They sign in at this server with their email + this password, then can change it under their account and create their own API key for Hootie, Claude Desktop, or the CLI."}),g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or they can choose ",e.jsx("strong",{children:"Sign in with PromptOwl"}),", using a PromptOwl account under this same email."]})]}),e.jsx(He,{email:h}),e.jsx(O,{children:e.jsx(r,{onClick:i,children:"Done"})})]})})}function He({email:h}){const{data:l,isLoading:g}=Ge(Z.nestList()),c=((l==null?void 0:l.nests)??[]).filter(t=>["owner","admin","write"].includes(t.permission??"owner")),[i,x]=a.useState(""),[d,u]=a.useState("read"),[f,w]=a.useState(!1),[m,j]=a.useState([]),A=c.filter(t=>!m.some(N=>N.id===t.id)),[E,y]=a.useState(null),J=async()=>{var t;w(!0),y(null);try{await Me(i,{email:h,permission:d});const N=((t=c.find(b=>b.id===i))==null?void 0:t.name)??i;j(b=>[...b,{id:i,name:N,permission:d}]),x("")}catch(N){y(N.message)}finally{w(!1)}};return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50/60 p-3 space-y-2",children:[m.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Shared with them"}),e.jsx("ul",{className:"space-y-1",children:m.map(t=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx(V,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),e.jsx("span",{className:"truncate",children:t.name}),e.jsx(B,{variant:"outline",className:"ml-auto shrink-0",children:t.permission==="write"?"Can edit":"Can view"})]},t.id))})]}),e.jsx("p",{className:"text-sm font-medium",children:m.length?"Share another nest?":"This person has no nests yet. Share one?"}),g?e.jsx(v,{className:"h-4 w-4 animate-spin text-muted-foreground"}):A.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:m.length?"Every nest you can share is shared with them.":"You don't have a nest you can share yet."}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{"aria-label":"Nest to share",value:i,onChange:t=>x(t.target.value),className:"h-8 flex-1 min-w-[10rem] rounded-md border bg-background px-2 text-sm",children:[e.jsx("option",{value:"",children:"Pick a nest…"}),A.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]}),e.jsxs("select",{"aria-label":"Access level",value:d,onChange:t=>u(t.target.value),className:"h-8 rounded-md border bg-background px-2 text-sm",children:[e.jsx("option",{value:"read",children:"Can view"}),e.jsx("option",{value:"write",children:"Can edit"})]}),e.jsxs(r,{size:"sm",disabled:!i||f,onClick:J,children:[f&&e.jsx(v,{className:"h-3.5 w-3.5 mr-1 animate-spin"}),"Share"]})]}),E&&e.jsx("p",{className:"text-xs text-destructive",children:E})]})}export{We as default};
|
|
6
|
+
*/const Ke=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],He=Ie("shield-off",Ke);function We(){var de,me;const{adminStatus:h}=Ee(),l=((me=(de=h==null?void 0:h.me)==null?void 0:de.email)==null?void 0:me.toLowerCase())??null,[g,c]=a.useState([]),i=_e(),[x,d]=a.useState(""),[u,f]=a.useState("all"),[w,m]=a.useState([]),[j,A]=a.useState(!0),[I,y]=a.useState(null),[J,t]=a.useState(!1),[N,b]=a.useState(""),[E,ee]=a.useState(null),[p,_]=a.useState(null),[Se,W]=a.useState(!1);a.useEffect(()=>W(!1),[p==null?void 0:p.password]);const[C,G]=a.useState(null),[M,se]=a.useState(!1),[k,U]=a.useState(null),[K,ae]=a.useState(!1),[te,re]=a.useState(null),[S,H]=a.useState(null),[Q,ne]=a.useState(!1),[ie,le]=a.useState(null),[ce,Te]=a.useState({}),T=async()=>{A(!0);try{const[s,o]=await Promise.all([i.fetchQuery(X.teammates()),i.fetchQuery(X.superAdmins())]);c(s.teammates),m(s.pending_stewards||[]),Te(Object.fromEntries(o.super_admins.map(n=>[n.email.toLowerCase(),{source:n.source,self:n.self}]))),y(null)}catch(s){y(s.message)}finally{A(!1)}};a.useEffect(()=>{T()},[]);const V=x.trim().toLowerCase(),oe=g.filter(s=>u==="admin"&&!s.is_admin||u==="normal"&&s.is_admin?!1:V?s.email.toLowerCase().includes(V)||(s.name||"").toLowerCase().includes(V):!0),Ae=s=>{const o=Oe(s);if(!o)return"Never";const n=Date.now()-o.getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:n<6048e5?`${Math.floor(n/864e5)}d ago`:o.toLocaleDateString()};return e.jsxs("div",{children:[e.jsx(Ue,{icon:he,title:"Teammates",description:"Add teammates and manage their access",actions:e.jsxs(r,{onClick:()=>t(!0),children:[e.jsx(ye,{className:"h-4 w-4 mr-2"}),"Invite Teammate"]})}),I&&e.jsxs(Y,{variant:"destructive",className:"mb-4",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(q,{children:I})]}),e.jsxs(xe,{children:[e.jsxs(ue,{children:[e.jsxs(pe,{className:"text-lg flex items-center gap-2",children:[e.jsx(he,{className:"h-4 w-4"}),"All Users"]}),e.jsx(je,{children:"Everyone who has access to this community server"})]}),e.jsx(ge,{children:j?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(v,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):g.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:'No teammates yet. Click "Invite Teammate" to add one.'}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[e.jsx(Ne,{value:x,onChange:s=>d(s.target.value),placeholder:"Search by name or email…",className:"h-8 max-w-xs text-sm"}),e.jsx("div",{className:"flex items-center rounded-md border p-0.5 text-xs",children:[["all","All"],["admin","Superadmins"],["normal","Members"]].map(([s,o])=>e.jsx("button",{type:"button",onClick:()=>f(s),className:`px-2.5 py-1 rounded ${u===s?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:o},s))})]}),oe.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No users match your filters."}):e.jsx("div",{className:"space-y-2",children:oe.map(s=>{var o,n;return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[e.jsx(ve,{className:"h-9 w-9",children:e.jsx(fe,{children:(s.email[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium truncate",children:s.name||s.email}),l&&s.email.toLowerCase()===l&&e.jsx(B,{variant:"outline",className:"border-emerald-200 bg-emerald-50 text-emerald-700",children:"You"}),s.is_admin&&e.jsxs(B,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700",children:[e.jsx(we,{className:"h-3 w-3"}),"Admin"]}),!!s.is_invited&&e.jsx(B,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700",title:"Added with a temporary password. They can sign in with their email + that password (use Reset password to re-issue one), then change it.",children:"Invited"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-3",children:[e.jsx("span",{children:s.email}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.key_count," key",s.key_count!==1?"s":""]}),s.last_active&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["last active ",Ae(s.last_active)]})]})]})]}),s.is_admin&&((o=ce[s.email.toLowerCase()])==null?void 0:o.source)==="granted"&&!((n=ce[s.email.toLowerCase()])!=null&&n.self)&&e.jsxs(r,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>H(s),title:"Revoke this user's superadmin access",children:[e.jsx(He,{className:"h-4 w-4 mr-2"}),"Revoke superadmin"]}),!s.is_admin&&e.jsxs(e.Fragment,{children:[!s.is_invited&&e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>U(s),title:"Grant this user superadmin access",children:[e.jsx(De,{className:"h-4 w-4 mr-2"}),"Grant superadmin"]}),e.jsx(r,{variant:"outline",size:"sm",disabled:!!p,onClick:async()=>{_({email:s.email,password:null});try{const D=await Re(s.id);_({email:s.email,password:D.temporary_password||""}),await T()}catch(D){_(null),y(D.message)}},title:"Generate a temporary password to share with this user (no email is sent)",children:"Reset password"}),e.jsx(r,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>G(s),title:"Remove this user and revoke all access",children:"Remove"})]})]},s.id)})})]})})]}),w.length>0&&e.jsxs(xe,{className:"mt-4 border-amber-200 bg-amber-50/40",children:[e.jsxs(ue,{children:[e.jsxs(pe,{className:"text-lg flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-amber-700"}),"Stewards without server access"]}),e.jsx(je,{children:"These emails are assigned as stewards on one or more nests, but haven't registered to this server yet — they can't log in or approve anything until they claim an account."})]}),e.jsx(ge,{children:e.jsx("div",{className:"space-y-2",children:w.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-background",children:[e.jsx(ve,{className:"h-9 w-9",children:e.jsx(fe,{className:"bg-amber-100 text-amber-800",children:(s[0]||"?").toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Assigned as steward · not registered yet"})]}),e.jsxs(r,{size:"sm",onClick:()=>{b(s),t(!0)},children:[e.jsx(ye,{className:"h-3.5 w-3.5 mr-1"}),"Invite"]})]},s))})})]}),J&&e.jsx(Qe,{seedEmail:N,onClose:()=>{t(!1),b("")},onCreated:(s,o,n,D)=>{t(!1),b(""),ee({email:s,password:o,promptowl:n,emailed:D}),T()}}),E&&e.jsx(Ye,{email:E.email,password:E.password,promptowl:E.promptowl,emailed:E.emailed,onClose:()=>ee(null)}),p&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>_(null),children:e.jsxs("div",{className:"w-full max-w-sm rounded-lg border bg-background p-5 shadow-lg",onClick:s=>s.stopPropagation(),children:[e.jsx("h3",{className:"font-semibold mb-1",children:"Temporary password"}),p.password===null?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[e.jsx(v,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Generating a temporary password for",e.jsx("br",{}),e.jsx("strong",{className:"text-foreground",children:p.email})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["Share this with ",e.jsx("strong",{children:p.email})," directly — no email is sent. They sign in with it, then change it from their account. It won't be shown again. Their existing API keys keep working; revoke a key separately if it may be compromised."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 bg-muted border rounded px-2 py-1.5 text-sm font-mono break-all",children:p.password}),e.jsx(r,{variant:"outline",size:"sm",onClick:async()=>{await Ce(p.password,"Temporary password copied")&&(W(!0),setTimeout(()=>W(!1),1500))},children:Se?e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"h-3.5 w-3.5 mr-1 text-green-600"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})})]}),e.jsx("div",{className:"mt-4 text-right",children:e.jsx(r,{variant:"outline",size:"sm",onClick:()=>_(null),children:"Done"})})]})]})}),e.jsx(R,{open:!!C,onOpenChange:s=>!s&&!M&&G(null),children:e.jsxs(L,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsxs(F,{children:["Remove ",C==null?void 0:C.email,"?"]}),e.jsx(O,{children:"This revokes all their access (API keys, sessions, steward + collaborator roles) and deletes the account. This cannot be undone."})]}),e.jsxs(z,{children:[e.jsx(r,{variant:"outline",onClick:()=>G(null),disabled:M,children:"Cancel"}),e.jsx(r,{variant:"destructive",disabled:M,onClick:async()=>{if(C){se(!0);try{await Le(C.id),G(null),await T()}catch(s){y(s.message)}finally{se(!1)}}},children:M?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Remove"})]})]})}),e.jsx(R,{open:!!k,onOpenChange:s=>!s&&!K&&U(null),children:e.jsxs(L,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsxs(F,{children:["Grant superadmin to ",k==null?void 0:k.email,"?"]}),e.jsx(O,{children:"They immediately get server-admin access everywhere: every nest, teammate management, and the activity trace. You can revoke this later from this list."})]}),te&&e.jsxs(Y,{variant:"destructive",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(q,{children:te})]}),e.jsxs(z,{children:[e.jsx(r,{variant:"outline",onClick:()=>U(null),disabled:K,children:"Cancel"}),e.jsx(r,{disabled:K,onClick:async()=>{if(k){ae(!0),re(null);try{await Pe(k.email),U(null),await T()}catch(s){re(s.message)}finally{ae(!1)}}},children:K?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Grant"})]})]})}),e.jsx(R,{open:!!S,onOpenChange:s=>!s&&!Q&&H(null),children:e.jsxs(L,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsxs(F,{children:["Revoke superadmin from ",S==null?void 0:S.email,"?"]}),e.jsx(O,{children:"They immediately lose server-admin access. They keep their account and any nest/collaborator roles granted separately. You can grant superadmin again later."})]}),ie&&e.jsxs(Y,{variant:"destructive",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(q,{children:ie})]}),e.jsxs(z,{children:[e.jsx(r,{variant:"outline",onClick:()=>H(null),disabled:Q,children:"Cancel"}),e.jsx(r,{variant:"destructive",disabled:Q,onClick:async()=>{if(S){ne(!0),le(null);try{await Fe(S.email),H(null),await T()}catch(s){le(s.message)}finally{ne(!1)}}},children:Q?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Revoke"})]})]})})]})}function Qe({seedEmail:h,onClose:l,onCreated:g}){const[c,i]=a.useState(h||""),[x,d]=a.useState(!1),[u,f]=a.useState(null),w=async m=>{if(m.preventDefault(),!!c.trim()){d(!0),f(null);try{const j=await ze(c);g(c,j.temporary_password,!!j.promptowl_sign_in,!!j.emailed)}catch(j){f(j.message),d(!1)}}};return e.jsx(R,{open:!0,onOpenChange:l,children:e.jsxs(L,{className:"sm:max-w-[420px]",children:[e.jsxs(P,{children:[e.jsx(F,{children:"Add Teammate"}),e.jsx(O,{children:"Create a login for a teammate. They get a temporary password to sign in with, then can change it and create their own API key."})]}),e.jsxs("form",{onSubmit:w,className:"space-y-3",children:[u&&e.jsxs(Y,{variant:"destructive",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(q,{children:u})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(ke,{children:"Email"}),e.jsx(Ne,{type:"email",placeholder:"jane@acme.com",value:c,onChange:m=>i(m.target.value),required:!0,autoFocus:!0})]}),e.jsxs(z,{children:[e.jsx(r,{variant:"outline",type:"button",onClick:l,children:"Cancel"}),e.jsx(r,{type:"submit",disabled:x||!c.trim(),children:x?e.jsx(v,{className:"h-4 w-4 animate-spin"}):"Add teammate"})]})]})]})})}function Ye({email:h,password:l,promptowl:g,emailed:c,onClose:i}){const[x,d]=a.useState(!1),u=async()=>{await Ce(l)&&(d(!0),setTimeout(()=>d(!1),1500))};return e.jsx(R,{open:!0,onOpenChange:i,children:e.jsxs(L,{className:"sm:max-w-[520px]",children:[e.jsxs(P,{children:[e.jsxs(F,{children:["Teammate added: ",h]}),e.jsxs(O,{children:[c?"We've emailed them this temporary password and a sign-in link. ":"Send them this temporary password via Slack, email, or another secure channel. ",e.jsx("strong",{children:"It won't be shown again."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ke,{className:"text-xs text-muted-foreground",children:"Temporary password"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:l}),e.jsx(r,{size:"sm",variant:"outline",onClick:u,children:x?e.jsx(Z,{className:"h-3.5 w-3.5 text-green-600"}):e.jsx(be,{className:"h-3.5 w-3.5"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"They sign in at this server with their email + this password, then can change it under their account and create their own API key for Hootie, Claude Desktop, or the CLI."}),g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or they can choose ",e.jsx("strong",{children:"Sign in with PromptOwl"}),", using a PromptOwl account under this same email."]})]}),e.jsx($e,{email:h}),e.jsx(z,{children:e.jsx(r,{onClick:i,children:"Done"})})]})})}function $e({email:h}){const{data:l,isLoading:g}=Ge(X.nestList()),c=((l==null?void 0:l.nests)??[]).filter(t=>["owner","admin","write"].includes(t.permission??"owner")),[i,x]=a.useState(""),[d,u]=a.useState("read"),[f,w]=a.useState(!1),[m,j]=a.useState([]),A=c.filter(t=>!m.some(N=>N.id===t.id)),[I,y]=a.useState(null),J=async()=>{var t;w(!0),y(null);try{await Me(i,{email:h,permission:d});const N=((t=c.find(b=>b.id===i))==null?void 0:t.name)??i;j(b=>[...b,{id:i,name:N,permission:d}]),x("")}catch(N){y(N.message)}finally{w(!1)}};return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50/60 p-3 space-y-2",children:[m.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Shared with them"}),e.jsx("ul",{className:"space-y-1",children:m.map(t=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Z,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),e.jsx("span",{className:"truncate",children:t.name}),e.jsx(B,{variant:"outline",className:"ml-auto shrink-0",children:t.permission==="write"?"Can edit":"Can view"})]},t.id))})]}),e.jsx("p",{className:"text-sm font-medium",children:m.length?"Share another nest?":"This person has no nests yet. Share one?"}),g?e.jsx(v,{className:"h-4 w-4 animate-spin text-muted-foreground"}):A.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:m.length?"Every nest you can share is shared with them.":"You don't have a nest you can share yet."}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{"aria-label":"Nest to share",value:i,onChange:t=>x(t.target.value),className:"h-8 flex-1 min-w-[10rem] rounded-md border bg-background px-2 text-sm",children:[e.jsx("option",{value:"",children:"Pick a nest…"}),A.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]}),e.jsxs("select",{"aria-label":"Access level",value:d,onChange:t=>u(t.target.value),className:"h-8 rounded-md border bg-background px-2 text-sm",children:[e.jsx("option",{value:"read",children:"Can view"}),e.jsx("option",{value:"write",children:"Can edit"})]}),e.jsxs(r,{size:"sm",disabled:!i||f,onClick:J,children:[f&&e.jsx(v,{className:"h-3.5 w-3.5 mr-1 animate-spin"}),"Share"]})]}),I&&e.jsx("p",{className:"text-xs text-destructive",children:I})]})}export{We as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dl as K,S as V,r as i,u as G,cN as J,j as e,au as W,I as X,L as R,dq as T,B as h,bU as Y,av as Z,bQ as ee,l as te,aP as se,i as k,ad as ae}from"./index-DvuUIUP6.js";import{P as re}from"./page-title-Dn5jANiU.js";import{S as ie}from"./SubmitForReviewModal-AW2OLNAE.js";import{A as ne,a as oe,b as le,c as de,d as ce,e as me,f as ue,g as fe}from"./alert-dialog-p-fBLSWx.js";import{C as E}from"./circle-check-BBCXd9LI.js";import{T as M}from"./trash-2-aljmIff4.js";import{C as he}from"./chevron-left-CsD8gZwL.js";import"./send-DPNxv3As.js";function Se(){var A;const{openReview:P}=K(),{adminStatus:S}=V(),F=((A=S==null?void 0:S.me)==null?void 0:A.email)??null,[c,D]=i.useState([]),[a,L]=i.useState(null),[N,$]=i.useState(!0),[m,v]=i.useState(null),[C,B]=i.useState(""),[j,Q]=i.useState(""),[b,q]=i.useState("updated"),[l,x]=i.useState(new Set),[w,_]=i.useState(!1),[n,y]=i.useState(null),O=G(),f=async t=>{$(!0);try{const s=await O.fetchQuery(te.myDrafts({offset:t,q:j||void 0,sort:b}));if(s.drafts.length===0&&t>0&&s.pagination.total>0)return void await f(0);D(s.drafts),L(s.pagination)}catch(s){console.error("[Dashboard] goToDraftsPage failed",s),D([])}finally{$(!1)}},I=async(t,s,u)=>{const r=[],d=[];for(const o of t)try{await se(o.nest_id,o.node_id,s,u),r.push(o)}catch(p){d.push(o),console.error("[Dashboard] submitForReview failed",o.node_id,p)}if(D(o=>o.filter(p=>!r.some(H=>g(H)===g(p)))),x(new Set),f((a==null?void 0:a.offset)??0),d.length){v(d);const o=r.length?`${r.length} submitted. `:"";throw new Error(`${o}Couldn't submit ${d.length}: ${d.map(p=>p.title).join(", ")}`)}r.length>1&&k.success(`${r.length} submitted for review`)},g=t=>`${t.nest_id}:${t.node_id}`;i.useEffect(()=>{const t=setTimeout(()=>Q(C.trim()),250);return()=>clearTimeout(t)},[C]),i.useEffect(()=>{f(0)},[F]);const z=J.useRef(!1);i.useEffect(()=>{if(!z.current){z.current=!0;return}x(new Set),f(0)},[j,b]);const U=async t=>{if(t.length===0)return;y(null),_(!0);let s=0,u=0;const r=[];for(const d of t)try{(await ae(d.nest_id,d.node_id)).deleted?u++:s++}catch(o){r.push(d.title),console.error("[Dashboard] discardDraft failed",d.node_id,o)}_(!1),x(new Set),(s||u)&&k.success([s?`${s} restored to the approved version`:"",u?`${u} deleted`:""].filter(Boolean).join(" · ")),r.length&&k.error(`Couldn't discard: ${r.join(", ")}`),f((a==null?void 0:a.offset)??0)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(re,{icon:W,title:"My Drafts",description:"Everything you started and never handed off.",className:"mb-0"}),e.jsx("div",{children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx(X,{value:C,onChange:t=>B(t.target.value),placeholder:"Search drafts by title or nest…",className:"h-8 max-w-xs","aria-label":"Search your drafts","data-testid":"drafts-search"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Sort:"}),e.jsx("div",{className:"inline-flex items-center rounded-md border bg-muted/40 p-0.5",role:"group","aria-label":"Sort drafts",children:[["updated","Recently edited"],["title","Title"]].map(([t,s])=>e.jsx("button",{type:"button","aria-pressed":b===t,onClick:()=>q(t),className:`h-6 rounded px-2 text-xs transition-colors ${b===t?"bg-background font-medium text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"data-testid":`drafts-sort-${t}`,children:s},t))})]})]}),N?e.jsxs("div",{className:"rounded-lg border bg-muted/20 px-4 py-6 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"}),"Loading your drafts…"]}):c.length===0?e.jsx("div",{className:"rounded-lg border bg-muted/20 px-4 py-6 text-center text-sm text-muted-foreground",children:j?`No drafts match "${j}".`:"No unsubmitted drafts — everything you've written is in review or approved."}):e.jsxs("div",{className:"rounded-lg border divide-y overflow-hidden",children:[c.length>1&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-muted/40 px-4 py-2 text-sm",children:[e.jsx(T,{checked:l.size===0?!1:l.size===c.length?!0:"indeterminate",onCheckedChange:t=>x(t===!0?new Set(c.map(g)):new Set),"aria-label":"Select every draft on this page","data-testid":"drafts-select-all"}),e.jsx("span",{className:"text-muted-foreground",children:l.size>0?`${l.size} selected`:`Select all ${c.length} on this page`}),l.size>0&&e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsxs(h,{size:"sm",variant:"outline",disabled:w,onClick:()=>v(c.filter(t=>l.has(g(t)))),"data-testid":"drafts-bulk-submit",children:[e.jsx(E,{className:"h-3.5 w-3.5 mr-1"}),"Submit ",l.size," for review"]}),e.jsxs(h,{size:"sm",variant:"outline",disabled:w,onClick:()=>y(c.filter(t=>l.has(g(t)))),"data-testid":"drafts-bulk-discard",children:[w?e.jsx(R,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5 mr-1"}),"Discard ",l.size]}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>x(new Set),children:"Clear"})]})]}),c.map(t=>{const s=`${t.nest_id}:${t.node_id}`;return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 hover:bg-muted/40 group",children:[c.length>1&&e.jsx(T,{checked:l.has(s),onCheckedChange:()=>x(u=>{const r=new Set(u);return r.has(s)?r.delete(s):r.add(s),r}),"aria-label":`Select ${t.title}`}),e.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide shrink-0 ${t.status==="rejected"?"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300":"bg-muted text-muted-foreground"}`,children:t.status==="rejected"?"Rejected":"Draft"}),e.jsxs("button",{onClick:()=>P(t.nest_id,t.nest_name,t.node_id),className:"flex flex-col min-w-0 flex-1 text-left gap-0.5",children:[e.jsx("span",{className:"font-medium truncate",children:t.title}),e.jsxs("span",{className:"text-xs text-muted-foreground truncate",title:`${t.nest_name} / ${t.node_id}`,children:[e.jsx(Y,{className:"h-3 w-3 inline mr-1 -mt-0.5"}),t.nest_name,t.folder?` / ${t.folder}`:""," · edited"," ",Z(t.updated_at)]})]}),e.jsxs(h,{size:"sm",variant:"outline",className:"shrink-0",onClick:()=>v([t]),children:[e.jsx(E,{className:"h-3.5 w-3.5 mr-1"}),"Submit for review"]}),e.jsx(h,{size:"sm",variant:"ghost",disabled:w,className:"shrink-0 text-muted-foreground hover:text-destructive",title:"Discard this draft — back to the last approved version, or delete it if there isn't one",onClick:()=>y([t]),"data-testid":"draft-discard",children:e.jsx(M,{className:"h-3.5 w-3.5"})})]},s)})]}),a&&a.total>a.limit&&e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-3 text-sm text-muted-foreground",children:[e.jsxs(h,{variant:"outline",size:"sm",disabled:N||a.offset===0,onClick:()=>f(Math.max(0,a.offset-a.limit)),children:[e.jsx(he,{className:"h-3.5 w-3.5 mr-1"}),"Prev"]}),e.jsxs("span",{children:["Page ",Math.floor(a.offset/a.limit)+1," of"," ",Math.max(1,Math.ceil(a.total/a.limit))]}),e.jsxs(h,{variant:"outline",size:"sm",disabled:N||!a.has_more,onClick:()=>f(a.offset+a.limit),children:["Next",e.jsx(ee,{className:"h-3.5 w-3.5 ml-1"})]})]})]})}),m&&m.length>0&&e.jsx(ie,{isOpen:!0,onClose:()=>v(null),documentTitle:m.length===1?m[0].title:`${m.length} drafts`,currentVersion:m.length===1?m[0].version:null,onSubmit:(t,s)=>I(m,t,s)}),e.jsx(ne,{open:!!n,onOpenChange:t=>!t&&y(null),children:e.jsxs(oe,{children:[e.jsxs(le,{children:[e.jsx(de,{children:(n==null?void 0:n.length)===1?`Discard "${n[0].title}"?`:`Discard ${(n==null?void 0:n.length)??0} drafts?`}),e.jsxs(ce,{children:[(n==null?void 0:n.length)===1?"The document goes":"Each document goes"," ","back to its last approved version. A document that was never approved is deleted instead. This can't be undone."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(fe,{onClick:()=>void U(n??[]),"data-testid":"drafts-discard-confirm",children:"Discard"})]})]})})]})}export{Se as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./index-DvuUIUP6.js";import{ActivityTracePage as r}from"./ActivityTracePage-CkRoyIc-.js";import"./page-title-Dn5jANiU.js";import"./client-attribution-BraarYaP.js";import"./arrow-left-CiErCCTG.js";import"./chevron-left-CsD8gZwL.js";function s(){return t.jsx(r,{})}export{s as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as z,u as D,
|
|
1
|
+
import{c as z,u as D,da as G,db as O,r,dc as p,j as e,d3 as W,I as Q,al as U,am as V,an as $,ao as H,ap as A,B as g,L as T,b4 as Y,dd as F,e as J,R as X,de as Z,ak as ee,df as se,i as f,dg as ae,dh as te,di as ne,dj as re,dk as oe,l as le}from"./index-DvuUIUP6.js";import{P as ie}from"./page-title-Dn5jANiU.js";import{B as _}from"./boxes-VWrCCMzW.js";import{T as ce}from"./trash-2-aljmIff4.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const de=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],I=z("layers",de);function P(l){if(!l)return"never";const t=oe(l);return t?t.toLocaleDateString():"never"}function ye(){const l=D(),{data:t,isLoading:q}=G(),d=(t==null?void 0:t.keys)??[],{data:m}=O(),j=(m==null?void 0:m.nests)??[],B=j.filter(s=>!s.discovered&&!s.grant_only).map(s=>({id:s.id,name:s.name??s.id})),[k,v]=r.useState(""),[N,w]=r.useState(p),[o,i]=r.useState(null),[M,b]=r.useState(null),[u,C]=r.useState(null),[h,S]=r.useState(null),x=k.trim(),y=d.some(s=>{var a;return((a=s.label)==null?void 0:a.trim().toLowerCase())===x.toLowerCase()}),K=x.length>0&&!y,L=()=>l.invalidateQueries({queryKey:le.apiKeys().queryKey});async function R(s,a,n){i(s);try{const{api_key:c}=await a();S({apiKey:c,kind:n}),s==="new"&&(v(""),w(p))}catch(c){f.error(c instanceof Error?c.message:"Something went wrong.")}finally{L(),i(null)}}async function E(s){i(s);try{await ae(s),f.success("Key revoked")}catch(a){f.error(a instanceof Error?a.message:"Couldn't revoke.")}finally{L(),i(null)}}return e.jsxs("div",{className:"space-y-4",children:[e.jsx(ie,{icon:W,title:"API keys",description:"Make one key per place you connect from — then rotating the key for one client leaves the others alone.",className:"mb-0"}),e.jsxs("div",{className:"grid gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[e.jsxs("p",{className:"rounded-md border p-2.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-foreground",children:[e.jsx(I,{className:"h-3.5 w-3.5"})," All your nests"]}),"Works on every nest you can see, the server-level MCP endpoint, and your account (including managing keys). Use it for your own tools."]}),e.jsxs("p",{className:"rounded-md border p-2.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-foreground",children:[e.jsx(_,{className:"h-3.5 w-3.5"})," One nest only"]}),"Reaches that one nest and nothing else — every other nest, your account, API keys and admin settings answer 403. Hand this one to an agent or integration."]})]}),e.jsxs("form",{className:"flex flex-col gap-2 sm:flex-row",onSubmit:s=>{s.preventDefault(),K&&R("new",()=>te(ne(x,N)),"generated")},children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Q,{value:k,onChange:s=>v(s.target.value),maxLength:60,placeholder:"What's this key for? e.g. Claude Desktop, laptop CLI","aria-label":"Key name","aria-invalid":y||void 0}),y&&e.jsx("p",{className:"mt-1 text-xs text-destructive",children:"You already have a key with this name."})]}),e.jsxs(U,{value:N,onValueChange:w,children:[e.jsx(V,{className:"w-full sm:w-[200px] shrink-0","aria-label":"What this key can reach",children:e.jsx($,{})}),e.jsxs(H,{children:[e.jsx(A,{value:p,children:"All your nests"}),B.map(s=>e.jsxs(A,{value:s.id,children:["Only ",s.name]},s.id))]})]}),e.jsxs(g,{type:"submit",disabled:o==="new"||!K,className:"shrink-0",children:[o==="new"?e.jsx(T,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(
|
|
6
|
+
*/const de=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],I=z("layers",de);function P(l){if(!l)return"never";const t=oe(l);return t?t.toLocaleDateString():"never"}function ye(){const l=D(),{data:t,isLoading:q}=G(),d=(t==null?void 0:t.keys)??[],{data:m}=O(),j=(m==null?void 0:m.nests)??[],B=j.filter(s=>!s.discovered&&!s.grant_only).map(s=>({id:s.id,name:s.name??s.id})),[k,v]=r.useState(""),[N,w]=r.useState(p),[o,i]=r.useState(null),[M,b]=r.useState(null),[u,C]=r.useState(null),[h,S]=r.useState(null),x=k.trim(),y=d.some(s=>{var a;return((a=s.label)==null?void 0:a.trim().toLowerCase())===x.toLowerCase()}),K=x.length>0&&!y,L=()=>l.invalidateQueries({queryKey:le.apiKeys().queryKey});async function R(s,a,n){i(s);try{const{api_key:c}=await a();S({apiKey:c,kind:n}),s==="new"&&(v(""),w(p))}catch(c){f.error(c instanceof Error?c.message:"Something went wrong.")}finally{L(),i(null)}}async function E(s){i(s);try{await ae(s),f.success("Key revoked")}catch(a){f.error(a instanceof Error?a.message:"Couldn't revoke.")}finally{L(),i(null)}}return e.jsxs("div",{className:"space-y-4",children:[e.jsx(ie,{icon:W,title:"API keys",description:"Make one key per place you connect from — then rotating the key for one client leaves the others alone.",className:"mb-0"}),e.jsxs("div",{className:"grid gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[e.jsxs("p",{className:"rounded-md border p-2.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-foreground",children:[e.jsx(I,{className:"h-3.5 w-3.5"})," All your nests"]}),"Works on every nest you can see, the server-level MCP endpoint, and your account (including managing keys). Use it for your own tools."]}),e.jsxs("p",{className:"rounded-md border p-2.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-medium text-foreground",children:[e.jsx(_,{className:"h-3.5 w-3.5"})," One nest only"]}),"Reaches that one nest and nothing else — every other nest, your account, API keys and admin settings answer 403. Hand this one to an agent or integration."]})]}),e.jsxs("form",{className:"flex flex-col gap-2 sm:flex-row",onSubmit:s=>{s.preventDefault(),K&&R("new",()=>te(ne(x,N)),"generated")},children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Q,{value:k,onChange:s=>v(s.target.value),maxLength:60,placeholder:"What's this key for? e.g. Claude Desktop, laptop CLI","aria-label":"Key name","aria-invalid":y||void 0}),y&&e.jsx("p",{className:"mt-1 text-xs text-destructive",children:"You already have a key with this name."})]}),e.jsxs(U,{value:N,onValueChange:w,children:[e.jsx(V,{className:"w-full sm:w-[200px] shrink-0","aria-label":"What this key can reach",children:e.jsx($,{})}),e.jsxs(H,{children:[e.jsx(A,{value:p,children:"All your nests"}),B.map(s=>e.jsxs(A,{value:s.id,children:["Only ",s.name]},s.id))]})]}),e.jsxs(g,{type:"submit",disabled:o==="new"||!K,className:"shrink-0",children:[o==="new"?e.jsx(T,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(Y,{className:"mr-2 h-4 w-4"}),"Generate key"]})]}),q?e.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"Loading your keys…"}):d.length===0?e.jsx("p",{className:"rounded-md border border-dashed py-6 text-center text-sm text-muted-foreground",children:"No keys yet. Generate one above to connect an AI client."}):e.jsx("ul",{className:"divide-y rounded-md border",children:d.map(s=>{const a=s.label||"Unnamed key",n=F(s,j);return e.jsxs("li",{className:"flex flex-col gap-2 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:a}),e.jsxs(J,{variant:"outline",className:n.kind==="nest"?"shrink-0 gap-1 border-amber-200 bg-amber-50 text-amber-800":"shrink-0 gap-1",title:n.kind==="nest"?"This key reaches this one nest only.":"This key reaches every nest you can see.",children:[n.kind==="nest"?e.jsx(_,{className:"h-3 w-3"}):e.jsx(I,{className:"h-3 w-3"}),e.jsx("span",{className:"max-w-[16rem] truncate",children:n.label})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("code",{className:"font-mono",children:s.key_prefix})," · created ",P(s.created_at)," · last used"," ",P(s.last_used_at)]})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",disabled:o===s.id,onClick:()=>b({id:s.id,name:a}),children:[o===s.id?e.jsx(T,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(X,{className:"mr-1.5 h-3.5 w-3.5"}),"Rotate"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:o===s.id,onClick:()=>C({id:s.id,name:a}),"aria-label":`Revoke ${a}`,children:e.jsx(ce,{className:"h-3.5 w-3.5"})})]})]},s.id)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A key is shown once, when it's created. There's no way to read it back — if you lose one, rotate that key (its client needs the new value) or revoke it and make another."}),e.jsx(Z,{target:M,onConfirm:s=>R(s,()=>re({key_id:s}),"rotated"),onClose:()=>b(null)}),u&&e.jsx(ee,{open:!0,onOpenChange:s=>!s&&C(null),title:`Revoke "${u.name}"?`,description:"Anything still using this key stops working immediately.",confirmLabel:"Revoke key",destructive:!0,onConfirm:()=>E(u.id)}),h&&e.jsx(se,{apiKey:h.apiKey,kind:h.kind,onClose:()=>S(null)})]})}export{ye as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as o,ed as ze,ee as Be,ef as Ge,dS as ue,eg as Ue,eh as Ye,dV as k,ei as xe,ej as he,ek as qe,d_ as Xe,el as Ke,em as We,en as Qe,eo as Je,w as Ze,u as pe,l as fe,ep as oe,A as L,O as J,a as I,L as _,B as C,R as je,c6 as z,ca as B,eq as es,D as G,G as U,H as Y,J as q,h as ss,M as X,C as ge,c7 as ve,e as M,cI as ts,aj as ns,er as as,i as E,S as rs,es as os,U as ls,b4 as is,V as cs,W as ds,Y as le,Z as ie,et as ms,au as us,I as we,X as xs,al as ye,am as Ne,an as Ce,ao as be,eu as se,ap as Te,ev as hs,ew as Pe,bH as ps,ex as fs,ey as js,ez as gs}from"./index-DvuUIUP6.js";import{P as vs}from"./page-title-Dn5jANiU.js";import{P as ws}from"./PersonCombobox-D52m_jhc.js";import{T as Ee}from"./trash-2-aljmIff4.js";import{C as Se}from"./circle-check-BBCXd9LI.js";import{C as Re}from"./circle-x-C9LsnORQ.js";import{U as ys}from"./user-plus-DPerZexX.js";var Ns=Symbol("radix.slottable");function Cs(s){const n=({children:t})=>e.jsx(e.Fragment,{children:t});return n.displayName=`${s}.Slottable`,n.__radixId=Ns,n}var[K]=Xe("Tooltip",[xe]),W=xe(),ke="TooltipProvider",bs=700,Z="tooltip.open",[Ts,te]=K(ke),Oe=s=>{const{__scopeTooltip:n,delayDuration:t=bs,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:m}=s,u=o.useRef(!0),p=o.useRef(!1),d=o.useRef(0);return o.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),e.jsx(Ts,{scope:n,isOpenDelayedRef:u,delayDuration:t,onOpen:o.useCallback(()=>{window.clearTimeout(d.current),u.current=!1},[]),onClose:o.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>u.current=!0,r)},[r]),isPointerInTransitRef:p,onPointerInTransitChange:o.useCallback(f=>{p.current=f},[]),disableHoverableContent:a,children:m})};Oe.displayName=ke;var H="Tooltip",[Ps,V]=K(H),Ae=s=>{const{__scopeTooltip:n,children:t,open:r,defaultOpen:a,onOpenChange:m,disableHoverableContent:u,delayDuration:p}=s,d=te(H,s.__scopeTooltip),f=W(n),[l,h]=o.useState(null),i=ze(),c=o.useRef(0),j=u??d.disableHoverableContent,g=p??d.delayDuration,v=o.useRef(!1),[w,y]=Be({prop:r,defaultProp:a??!1,onChange:b=>{b?(d.onOpen(),document.dispatchEvent(new CustomEvent(Z))):d.onClose(),m==null||m(b)},caller:H}),T=o.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),P=o.useCallback(()=>{window.clearTimeout(c.current),c.current=0,v.current=!1,y(!0)},[y]),x=o.useCallback(()=>{window.clearTimeout(c.current),c.current=0,y(!1)},[y]),S=o.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>{v.current=!0,y(!0),c.current=0},g)},[g,y]);return o.useEffect(()=>()=>{c.current&&(window.clearTimeout(c.current),c.current=0)},[]),e.jsx(Ge,{...f,children:e.jsx(Ps,{scope:n,contentId:i,open:w,stateAttribute:T,trigger:l,onTriggerChange:h,onTriggerEnter:o.useCallback(()=>{d.isOpenDelayedRef.current?S():P()},[d.isOpenDelayedRef,S,P]),onTriggerLeave:o.useCallback(()=>{j?x():(window.clearTimeout(c.current),c.current=0)},[x,j]),onOpen:P,onClose:x,disableHoverableContent:j,children:t})})};Ae.displayName=H;var ee="TooltipTrigger",_e=o.forwardRef((s,n)=>{const{__scopeTooltip:t,...r}=s,a=V(ee,t),m=te(ee,t),u=W(t),p=o.useRef(null),d=ue(n,p,a.onTriggerChange),f=o.useRef(!1),l=o.useRef(!1),h=o.useCallback(()=>f.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),e.jsx(Ue,{asChild:!0,...u,children:e.jsx(Ye.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:k(s.onPointerMove,i=>{i.pointerType!=="touch"&&!l.current&&!m.isPointerInTransitRef.current&&(a.onTriggerEnter(),l.current=!0)}),onPointerLeave:k(s.onPointerLeave,()=>{a.onTriggerLeave(),l.current=!1}),onPointerDown:k(s.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:k(s.onFocus,()=>{f.current||a.onOpen()}),onBlur:k(s.onBlur,a.onClose),onClick:k(s.onClick,a.onClose)})})});_e.displayName=ee;var ne="TooltipPortal",[Es,Ss]=K(ne,{forceMount:void 0}),De=s=>{const{__scopeTooltip:n,forceMount:t,children:r,container:a}=s,m=V(ne,n);return e.jsx(Es,{scope:n,forceMount:t,children:e.jsx(he,{present:t||m.open,children:e.jsx(qe,{asChild:!0,container:a,children:r})})})};De.displayName=ne;var D="TooltipContent",Le=o.forwardRef((s,n)=>{const t=Ss(D,s.__scopeTooltip),{forceMount:r=t.forceMount,side:a="top",...m}=s,u=V(D,s.__scopeTooltip);return e.jsx(he,{present:r||u.open,children:u.disableHoverableContent?e.jsx(Ie,{side:a,...m,ref:n}):e.jsx(Rs,{side:a,...m,ref:n})})}),Rs=o.forwardRef((s,n)=>{const t=V(D,s.__scopeTooltip),r=te(D,s.__scopeTooltip),a=o.useRef(null),m=ue(n,a),[u,p]=o.useState(null),{trigger:d,onClose:f}=t,l=a.current,{onPointerInTransitChange:h}=r,i=o.useCallback(()=>{p(null),h(!1)},[h]),c=o.useCallback((j,g)=>{const v=j.currentTarget,w={x:j.clientX,y:j.clientY},y=Ds(w,v.getBoundingClientRect()),T=Ls(w,y),P=Is(g.getBoundingClientRect()),x=Hs([...T,...P]);p(x),h(!0)},[h]);return o.useEffect(()=>()=>i(),[i]),o.useEffect(()=>{if(d&&l){const j=v=>c(v,l),g=v=>c(v,d);return d.addEventListener("pointerleave",j),l.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",j),l.removeEventListener("pointerleave",g)}}},[d,l,c,i]),o.useEffect(()=>{if(u){const j=g=>{const v=g.target,w={x:g.clientX,y:g.clientY},y=(d==null?void 0:d.contains(v))||(l==null?void 0:l.contains(v)),T=!Ms(w,u);y?i():T&&(i(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,l,u,f,i]),e.jsx(Ie,{...s,ref:m})}),[ks,Os]=K(H,{isInside:!1}),As=Cs("TooltipContent"),Ie=o.forwardRef((s,n)=>{const{__scopeTooltip:t,children:r,"aria-label":a,onEscapeKeyDown:m,onPointerDownOutside:u,...p}=s,d=V(D,t),f=W(t),{onClose:l}=d;return o.useEffect(()=>(document.addEventListener(Z,l),()=>document.removeEventListener(Z,l)),[l]),o.useEffect(()=>{if(d.trigger){const h=i=>{const c=i.target;c!=null&&c.contains(d.trigger)&&l()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,l]),e.jsx(Ke,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:u,onFocusOutside:h=>h.preventDefault(),onDismiss:l,children:e.jsxs(We,{"data-state":d.stateAttribute,...f,...p,ref:n,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(As,{children:r}),e.jsx(ks,{scope:t,isInside:!0,children:e.jsx(Qe,{id:d.contentId,role:"tooltip",children:a||r})})]})})});Le.displayName=D;var Me="TooltipArrow",_s=o.forwardRef((s,n)=>{const{__scopeTooltip:t,...r}=s,a=W(t);return Os(Me,t).isInside?null:e.jsx(Je,{...a,...r,ref:n})});_s.displayName=Me;function Ds(s,n){const t=Math.abs(n.top-s.y),r=Math.abs(n.bottom-s.y),a=Math.abs(n.right-s.x),m=Math.abs(n.left-s.x);switch(Math.min(t,r,a,m)){case m:return"left";case a:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ls(s,n,t=5){const r=[];switch(n){case"top":r.push({x:s.x-t,y:s.y+t},{x:s.x+t,y:s.y+t});break;case"bottom":r.push({x:s.x-t,y:s.y-t},{x:s.x+t,y:s.y-t});break;case"left":r.push({x:s.x+t,y:s.y-t},{x:s.x+t,y:s.y+t});break;case"right":r.push({x:s.x-t,y:s.y-t},{x:s.x-t,y:s.y+t});break}return r}function Is(s){const{top:n,right:t,bottom:r,left:a}=s;return[{x:a,y:n},{x:t,y:n},{x:t,y:r},{x:a,y:r}]}function Ms(s,n){const{x:t,y:r}=s;let a=!1;for(let m=0,u=n.length-1;m<n.length;u=m++){const p=n[m],d=n[u],f=p.x,l=p.y,h=d.x,i=d.y;l>r!=i>r&&t<(h-f)*(r-l)/(i-l)+f&&(a=!a)}return a}function Hs(s){const n=s.slice();return n.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Fs(n)}function Fs(s){if(s.length<=1)return s.slice();const n=[];for(let r=0;r<s.length;r++){const a=s[r];for(;n.length>=2;){const m=n[n.length-1],u=n[n.length-2];if((m.x-u.x)*(a.y-u.y)>=(m.y-u.y)*(a.x-u.x))n.pop();else break}n.push(a)}n.pop();const t=[];for(let r=s.length-1;r>=0;r--){const a=s[r];for(;t.length>=2;){const m=t[t.length-1],u=t[t.length-2];if((m.x-u.x)*(a.y-u.y)>=(m.y-u.y)*(a.x-u.x))t.pop();else break}t.push(a)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var Vs=Oe,$s=Ae,zs=_e,Bs=De,He=Le;const Gs=({children:s,delayDuration:n=0})=>e.jsx(Vs,{delayDuration:n,children:s}),O=$s,A=zs,R=o.forwardRef(({className:s,sideOffset:n=4,...t},r)=>e.jsx(Bs,{children:e.jsx(He,{ref:r,sideOffset:n,className:Ze("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...t})}));R.displayName=He.displayName;const Us={Owner:"Admin",Editor:"Editor",Viewer:"Viewer",User:"Viewer"},ce=s=>Us[s]??"Viewer";function Ys({localTeams:s,onImported:n}){const[t,r]=o.useState([]),a=pe(),[m,u]=o.useState(!0),[p,d]=o.useState(null),[f,l]=o.useState(!1),[h,i]=o.useState(null),[c,j]=o.useState(null),[g,v]=o.useState(null),w=new Map(s.filter(x=>x.source==="promptowl"&&x.external_id).map(x=>[x.external_id,x]));o.useEffect(()=>{y()},[]);const y=async()=>{u(!0),d(null);try{const x=await a.fetchQuery(fe.promptowlTeams());r(x.teams)}catch(x){oe(x)?l(!0):d((x==null?void 0:x.message)||"Could not reach PromptOwl")}finally{u(!1)}},T=async x=>{var S;i(x.id),d(null);try{const b=await as([x.id]);v(b.results[0]??null),n(),E.success((S=b.results[0])!=null&&S.created?`Imported ${x.name}`:`Synced ${x.name}`)}catch(b){oe(b)?l(!0):d((b==null?void 0:b.message)||"Sync failed")}finally{i(null),j(null)}},P=x=>{w.has(x.id)?j(x):T(x)};return f?e.jsxs(L,{children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(I,{children:"Your PromptOwl session has ended. Sign out and sign back in with PromptOwl to import teams."})]}):m?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(_,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-4",children:[p&&e.jsxs(L,{variant:"destructive",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(I,{children:p})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground flex-1",children:"Your PromptOwl teams. Syncing one copies it here with its members — people without an account are invited automatically. Teams you're view-only on can't be imported, since the copy would be yours to control."}),e.jsx(C,{size:"sm",variant:"ghost",onClick:y,"aria-label":"Refresh",children:e.jsx(je,{className:"h-4 w-4"})})]}),g&&e.jsx(Xs,{result:g}),t.length===0?e.jsx(z,{children:e.jsx(B,{className:"py-10 text-center text-sm text-muted-foreground",children:"You're not in any teams in PromptOwl."})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(x=>e.jsx(qs,{team:x,imported:w.has(x.id),syncing:h===x.id,canImport:es(x),onSync:()=>P(x)},x.id))}),e.jsx(G,{open:!!c,onOpenChange:x=>!x&&j(null),children:e.jsxs(U,{className:"sm:max-w-[460px]",children:[e.jsx(Y,{children:e.jsxs(q,{children:['Sync "',c==null?void 0:c.name,'" from PromptOwl?']})}),e.jsxs(L,{children:[e.jsx(ss,{className:"h-4 w-4"}),e.jsx(I,{className:"text-xs",children:"PromptOwl is the source of truth. This team's roster here will be made to match PromptOwl exactly: roles are reset, and anyone you added by hand in ContextNest is removed."})]}),e.jsxs(X,{children:[e.jsx(C,{variant:"outline",onClick:()=>j(null),children:"Cancel"}),e.jsxs(C,{disabled:!!h,onClick:()=>c&&T(c),children:[h&&e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}),"Sync"]})]})]})})]})}function qs({team:s,imported:n,syncing:t,canImport:r,onSync:a}){return e.jsxs(z,{className:`flex flex-col${r?"":" opacity-70"}`,children:[e.jsx(ve,{className:"space-y-1 pb-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold truncate",children:s.name}),e.jsx(M,{variant:"secondary",className:"shrink-0",children:s.members.length}),n&&e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsxs(M,{variant:"outline",className:"shrink-0 gap-1",children:[e.jsx(ge,{className:"h-3 w-3"}),"Synced"]})}),e.jsx(R,{children:"Already imported. Syncing again updates it in place."})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["You're ",s.your_role," in PromptOwl",s.enterprise?` · ${s.enterprise.name}`:""]})]}),r?e.jsxs(C,{size:"sm",variant:n?"outline":"default",className:"shrink-0",disabled:t,onClick:a,children:[t?e.jsx(_,{className:"h-3.5 w-3.5 animate-spin"}):n?e.jsx(je,{className:"h-3.5 w-3.5"}):e.jsx(ts,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1",children:n?"Sync":"Import"})]}):e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 text-xs text-muted-foreground border rounded-md px-2 py-1.5",children:[e.jsx(ns,{className:"h-3 w-3"}),"View-only"]})}),e.jsx(R,{className:"max-w-xs",children:"Importing a team makes you the owner of the copy here, which is more than you can do with this team in PromptOwl. Ask an owner or editor of it to import it."})]})]})}),e.jsx(B,{className:"space-y-1.5",children:s.members.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No members."}):s.members.map(m=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"flex-1 truncate",children:m.email}),e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ce(m.role)})}),e.jsxs(R,{children:[m.role," in PromptOwl → ",ce(m.role)," here"]})]})]},m.email))})]})}function Xs({result:s}){const n=!s.added.length&&!s.updated.length&&!s.removed.length;return e.jsxs(L,{children:[e.jsx(ge,{className:"h-4 w-4"}),e.jsxs(I,{className:"text-xs space-y-0.5",children:[e.jsxs("div",{className:"font-medium",children:[s.name," — ",s.created?"imported":"synced"]}),n?e.jsx("div",{children:"Already up to date."}):e.jsxs(e.Fragment,{children:[s.added.length>0&&e.jsxs("div",{children:["Added: ",s.added.join(", ")]}),s.updated.length>0&&e.jsxs("div",{children:["Role changed: ",s.updated.join(", ")]}),s.removed.length>0&&e.jsxs("div",{children:["Removed: ",s.removed.join(", ")]})]})]})]})}const de=5,Q=s=>{var n;return((n=se.find(t=>t.value===s))==null?void 0:n.label)??s},F={viewer:1,editor:2,admin:3},$=4;function me(s,n,t){if(t||s.owner_email&&s.owner_email.toLowerCase()===n)return $;const r=s.members.find(a=>(a.email||"").toLowerCase()===n);return r?F[r.role]??0:0}function ot(){var ae;const{adminStatus:s,isAdmin:n,promptowlTeamsEnabled:t}=rs(),r=(((ae=s==null?void 0:s.me)==null?void 0:ae.email)||"").toLowerCase(),[a]=o.useState(()=>os()),m=t&&a,[u,p]=o.useState([]),[d,f]=o.useState(!0),l=pe(),[h,i]=o.useState(null),[c,j]=o.useState(!1),[g,v]=o.useState(null),[w,y]=o.useState(null),[T,P]=o.useState(!1),x=async()=>{i(null);try{const N=await l.fetchQuery(fe.teamList());p(N.teams),v(re=>re?N.teams.find($e=>$e.id===re.id)??null:null)}catch(N){i((N==null?void 0:N.message)||"Failed to load teams")}finally{f(!1)}};o.useEffect(()=>{x()},[]);const S=async()=>{if(w){P(!0);try{await ms(w.id),E.success("Team deleted"),y(null),await x()}catch(N){E.error((N==null?void 0:N.message)||"Failed to delete team")}finally{P(!1)}}},b=d?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(_,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):u.length===0?e.jsx(z,{children:e.jsx(B,{className:"py-10 text-center text-sm text-muted-foreground",children:"No teams yet. Create one to share a nest with a whole group at once."})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:u.map(N=>e.jsx(Ws,{team:N,rank:me(N,r,n),onEdit:()=>v(N),onDelete:()=>y(N)},N.id))});return e.jsxs(Gs,{delayDuration:150,children:[e.jsxs("div",{className:"w-full mx-auto space-y-4",children:[e.jsx(vs,{icon:ls,title:"Teams",description:e.jsxs(e.Fragment,{children:["A team is a reusable group. Give each member a role, then share the team with a nest from its ",e.jsx("strong",{children:"Share"})," dialog — every member gets their role on that nest."]}),actions:e.jsxs(C,{size:"sm",onClick:()=>j(!0),children:[e.jsx(is,{className:"h-4 w-4 mr-1"}),"New Team"]})}),h&&e.jsxs(L,{variant:"destructive",children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(I,{children:h})]}),m?e.jsxs(cs,{defaultValue:"cn",children:[e.jsxs(ds,{children:[e.jsx(le,{value:"cn",children:"ContextNest Teams"}),e.jsx(le,{value:"po",children:"PromptOwl Teams"})]}),e.jsx(ie,{value:"cn",className:"mt-4",children:b}),e.jsx(ie,{value:"po",className:"mt-4",children:e.jsx(Ys,{localTeams:u,onImported:x})})]}):b]}),c&&e.jsx(Qs,{onClose:()=>j(!1),onCreated:x}),g&&e.jsx(Js,{team:g,rank:me(g,r,n),onClose:()=>v(null),onChanged:x}),e.jsx(G,{open:!!w,onOpenChange:N=>!N&&y(null),children:e.jsxs(U,{className:"sm:max-w-[420px]",children:[e.jsx(Y,{children:e.jsxs(q,{children:['Delete team "',w==null?void 0:w.name,'"?']})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Members lose access to every nest this team is shared with. This can't be undone."}),e.jsxs(X,{children:[e.jsx(C,{variant:"outline",onClick:()=>y(null),children:"Cancel"}),e.jsxs(C,{variant:"destructive",disabled:T,onClick:S,children:[T&&e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}),"Delete"]})]})]})})]})}function Fe({registered:s}){return e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsx("span",{className:"shrink-0 flex items-center",children:s?e.jsx(Se,{className:"h-3.5 w-3.5 text-green-600"}):e.jsx(Re,{className:"h-3.5 w-3.5 text-red-500"})})}),e.jsx(R,{children:s?"Registered account":"Invited — hasn't signed up yet"})]})}function Ks({member:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Fe,{registered:s.registered}),e.jsx("span",{className:"flex-1 truncate",children:s.email}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:Q(s.role)})]})}function Ws({team:s,rank:n,onEdit:t,onDelete:r}){const a=s.members.slice(0,de),m=s.members.slice(de),u=n>=F.editor,p=n>=$;return e.jsxs(z,{className:"flex flex-col",children:[e.jsx(ve,{className:"space-y-1 pb-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold truncate",children:s.name}),e.jsx(M,{variant:"secondary",className:"shrink-0",children:s.members.length}),s.source==="promptowl"&&e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsx(M,{variant:"outline",className:"shrink-0",children:"PromptOwl"})}),e.jsx(R,{children:"Imported from PromptOwl. Re-syncing makes this roster match PromptOwl exactly."})]})]}),s.owner_email&&e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["Created by ",s.owner_email]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[u&&e.jsx(C,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,"aria-label":"Edit team",children:e.jsx(us,{className:"h-3.5 w-3.5"})}),p&&e.jsx(C,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive",onClick:r,"aria-label":"Delete team",children:e.jsx(Ee,{className:"h-3.5 w-3.5"})})]})]})}),e.jsx(B,{className:"space-y-1.5",children:s.members.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No members yet."}):e.jsxs(e.Fragment,{children:[a.map(d=>e.jsx(Ks,{member:d},d.userId)),m.length>0&&e.jsxs(O,{children:[e.jsx(A,{asChild:!0,children:e.jsxs("button",{className:"text-xs text-muted-foreground hover:text-foreground text-left",children:["+",m.length," more member",m.length===1?"":"s"]})}),e.jsx(R,{className:"max-w-xs",children:e.jsx("div",{className:"space-y-1",children:m.map(d=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[d.registered?e.jsx(Se,{className:"h-3 w-3 text-green-600 shrink-0"}):e.jsx(Re,{className:"h-3 w-3 text-red-500 shrink-0"}),e.jsx("span",{className:"truncate",children:d.email}),e.jsxs("span",{className:"opacity-70",children:["· ",Q(d.role)]})]},d.userId))})})]})]})})]})}function Ve({onAdd:s,busy:n,maxRank:t=$,members:r=[]}){var i;const a=se.filter(c=>F[c.value]<=t),[m,u]=o.useState(""),[p,d]=o.useState(((i=a[0])==null?void 0:i.value)??"viewer"),[f,l]=o.useState(null),h=()=>{const c=m.trim();if(c){if(!ps(c)){l("Enter a valid email address.");return}l(null),Promise.resolve(s(c,p)).then(()=>{var j;u(""),d(((j=a[0])==null?void 0:j.value)??"viewer")})}};return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[e.jsx(ws,{value:m,onChange:c=>{u(c),f&&l(null)},onSubmit:h,placeholder:"person@company.com",exclude:r,className:"flex-1",testId:"team-member-input"}),e.jsxs(ye,{value:p,onValueChange:c=>d(c),children:[e.jsx(Ne,{className:"w-full sm:w-[130px] h-8",children:e.jsx(Ce,{})}),e.jsx(be,{children:a.map(c=>e.jsx(Te,{value:c.value,children:c.label},c.value))})]}),e.jsxs(C,{size:"sm",onClick:h,disabled:n||!m.trim(),children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"Add"]})]}),f&&e.jsx("p",{className:"text-xs text-destructive",children:f})]})}function Qs({onClose:s,onCreated:n}){const[t,r]=o.useState(""),[a,m]=o.useState([]),[u,p]=o.useState(!1),d=(l,h)=>{if(a.some(i=>i.email.toLowerCase()===l.toLowerCase())){E.error("Already added");return}m(i=>[...i,{email:l,role:h}])},f=async()=>{const l=t.trim();if(l){p(!0);try{const{team:h}=await hs(l);for(const i of a)try{await Pe(h.id,{email:i.email,role:i.role})}catch(c){E.error(`${i.email}: ${(c==null?void 0:c.message)||"could not add"}`)}E.success(`Team "${l}" created`),n(),s()}catch(h){E.error((h==null?void 0:h.message)||"Failed to create team")}finally{p(!1)}}};return e.jsx(G,{open:!0,onOpenChange:l=>!l&&s(),children:e.jsxs(U,{className:"sm:max-w-[480px]",children:[e.jsx(Y,{children:e.jsx(q,{children:"New team"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(we,{autoFocus:!0,placeholder:"Team name (e.g. Platform)",value:t,onChange:l=>r(l.target.value)}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Members (optional)"}),a.length>0&&e.jsx("div",{className:"space-y-1.5",children:a.map(l=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"flex-1 truncate",children:l.email}),e.jsx("span",{className:"text-xs text-muted-foreground",children:Q(l.role)}),e.jsx(C,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>m(h=>h.filter(i=>i.email!==l.email)),"aria-label":`Remove ${l.email}`,children:e.jsx(xs,{className:"h-3.5 w-3.5"})})]},l.email))}),e.jsx(Ve,{onAdd:d,members:a.map(l=>l.email)})]})]}),e.jsxs(X,{children:[e.jsx(C,{variant:"outline",onClick:s,children:"Cancel"}),e.jsxs(C,{onClick:f,disabled:u||!t.trim(),children:[u&&e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}),"Create"]})]})]})})}function Js({team:s,rank:n,onClose:t,onChanged:r}){const a=n>=F.admin,m=n>=F.editor,[u,p]=o.useState(s.name),[d,f]=o.useState(!1),l=async(i,c)=>{f(!0);try{await i(),c&&E.success(c),r()}catch(j){E.error((j==null?void 0:j.message)||"Something went wrong")}finally{f(!1)}},h=async()=>{if(!a)return;const i=u.trim();!i||i===s.name||await l(()=>fs(s.id,i),"Team renamed")};return e.jsx(G,{open:!0,onOpenChange:i=>!i&&t(),children:e.jsxs(U,{className:"sm:max-w-[480px]",children:[e.jsx(Y,{children:e.jsx(q,{children:"Edit team"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(we,{value:u,onChange:i=>p(i.target.value),onBlur:h,onKeyDown:i=>i.key==="Enter"&&h(),className:"h-9",disabled:!a})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Members"}),s.members.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No members yet."}):e.jsx("div",{className:"space-y-2",children:s.members.map(i=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fe,{registered:i.registered}),e.jsx("span",{className:"text-sm flex-1 truncate",children:i.email}),a?e.jsxs(ye,{value:i.role,onValueChange:c=>l(()=>js(s.id,i.userId,c),"Role updated"),children:[e.jsx(Ne,{className:"w-[120px] h-8",children:e.jsx(Ce,{})}),e.jsx(be,{children:se.map(c=>e.jsx(Te,{value:c.value,children:c.label},c.value))})]}):e.jsx(M,{variant:"secondary",className:"text-[11px]",children:Q(i.role)}),a&&e.jsx(C,{size:"icon",variant:"ghost",className:"h-8 w-8",disabled:d,onClick:()=>l(()=>gs(s.id,i.userId),"Member removed"),"aria-label":`Remove ${i.email}`,children:e.jsx(Ee,{className:"h-3.5 w-3.5"})})]},i.userId))}),m&&e.jsx("div",{className:"pt-1 border-t",children:e.jsx("div",{className:"pt-2",children:e.jsx(Ve,{busy:d,maxRank:n,members:s.members.map(i=>i.email),onAdd:(i,c)=>l(()=>Pe(s.id,{email:i,role:c}),"Member added")})})})]})]}),e.jsx(X,{children:e.jsx(C,{variant:"outline",onClick:t,children:"Done"})})]})})}export{ot as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c
|
|
1
|
+
import{c as l,dl as c,j as e,aT as h,F as m,dm as u,dn as p,dp as x,U as g,d3 as j}from"./index-DvuUIUP6.js";import{P as y}from"./page-title-Dn5jANiU.js";import{B as w}from"./boxes-VWrCCMzW.js";import{U as b}from"./user-plus-DPerZexX.js";import{S as f}from"./settings-DZjq-OQA.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const v=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],N=c("circle-user",v),k=[{id:"sso",title:"Single sign-on (OIDC)",where:"Admin → Server settings → Single sign-on",summary:"Let people sign in with your identity provider: Microsoft Entra ID, Google, Okta, Keycloak or any OpenID Connect issuer. It is one setup for the whole server, and only a server admin can change it.",steps:["Set Public base URL (Server settings → General) to the https address people use, e.g. https://nest.acme.com. The redirect URI is built from it: <Public base URL>/auth/oidc/callback. The Single sign-on tab shows it with a Copy button.","At your identity provider, register a web app (confidential client) with that exact redirect URI. Copy its client ID and client secret.","On the Single sign-on tab, pick Microsoft Entra ID or Google, or paste your issuer URL. Then paste the client ID and secret.","Optional: list your allowed email domains, and turn Auto-provision off if only invited people should get in.","Turn it on, Save, then test in a private window. The login page shows a Sign in with Microsoft / Google / SSO button."],notes:["People are matched by email. Someone who already has a password account with the same email signs into that account, and their password still works.","API keys (cnst_…) do not go through SSO. Disabling someone at your identity provider does not stop their keys or their open sessions. Remove them under Admin → Teammates to end both.","A failed sign-in comes back with a short error. Each code, what causes it and how to fix it are listed in CONFIGURATION.md → Single sign-on (OIDC) → Troubleshooting."]}];function r({title:t,icon:s,children:n}){return e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s&&e.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-primary/10 text-primary",children:e.jsx(s,{className:"h-4 w-4"})}),e.jsx("h2",{className:"text-base font-semibold tracking-tight",children:t})]}),n]})}function o({steps:t}){return e.jsx("ol",{className:"space-y-3",children:t.map((s,n)=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:n+1}),e.jsx("span",{className:"text-muted-foreground pt-0.5",children:s})]},n))})}function S({term:t,def:s}){return e.jsxs("div",{className:"rounded-lg border bg-card p-3 transition-colors hover:border-primary/40",children:[e.jsx("div",{className:"mb-1 text-sm font-semibold",children:t}),e.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:s})]})}function i({items:t}){return e.jsx("ul",{className:"space-y-2",children:t.map(([s,n])=>e.jsxs("li",{className:"text-muted-foreground",children:[e.jsx("b",{className:"text-foreground",children:s})," — ",n]},s))})}const a=({children:t})=>e.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 text-xs",children:t}),A=[["Just me","Stewardship off. Saving publishes at once. Right for a personal nest."],["Me, with a paper trail","Stewardship on, self-approve allowed. Every change waits for review and you approve your own — a history without ceremony."],["A team","Stewards (viewer / editor / reviewer) per nest, tag or document. You cannot approve your own change; agents queue like everyone else."],["Prime documents","Mark a document or tag as prime and it always needs a second person, even where self-approve is on."]];function D(){const{manageKeys:t}=l();return e.jsxs("div",{className:"w-full",children:[e.jsx(y,{icon:h,title:"How it works",description:"A tour of the app, page by page. Agent setup (API, MCP, CLI) is on the Docs page in the header.",className:"mb-10"}),e.jsxs("div",{className:"space-y-10 text-sm leading-relaxed",children:[e.jsx(r,{title:"What this is",children:e.jsx("div",{className:"rounded-lg border-l-2 border-primary bg-muted/40 p-4",children:e.jsxs("p",{className:"text-muted-foreground",children:["A shared knowledge base for your team ",e.jsx("i",{children:"and"})," your AI agents. Documents live in"," ",e.jsx("b",{className:"text-foreground",children:"nests"}),". Every save is a version you can go back to. In a stewarded nest a change waits for a reviewer before agents can read it. People write here; agents read and write the same documents over the API, MCP or the ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"ctx"})," CLI."]})})}),e.jsx(r,{title:"Nests",icon:w,children:e.jsx(i,{items:[["Create",e.jsxs(e.Fragment,{children:["From the Nests page — server admins only, unless an admin lets everyone create nests in Server settings. Have Markdown already? ",e.jsx("b",{children:"Import folder"})," brings a whole directory in."]})],["Organize",e.jsx(e.Fragment,{children:"Folders and subfolders in the sidebar; move a document from its folder picker. With many nests, the sidebar has a name filter."})],["Share",e.jsx(e.Fragment,{children:"The whole nest with a person or a team (viewer / editor / admin), or just one document or folder — the recipient sees only that slice."})],["Go public",e.jsxs(e.Fragment,{children:["A public nest gets a read-only ",e.jsx("b",{children:"Reader mode"})," with a home document. A single document can also be published to a link."]})],["Housekeeping",e.jsx(e.Fragment,{children:"Rename, pin, archive or delete a nest. Anyone can request a deletion; an owner honours or declines it."})]]})}),e.jsx(r,{title:"Inviting someone",icon:b,children:e.jsx(o,{steps:[e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"Share a nest"})," with their email (the nest's Collaborators tab), or add them under ",e.jsx("b",{children:"Teammates"})," and pick a nest to share right there. Joining the server alone gives no nest access."]}),e.jsxs(e.Fragment,{children:["They get an ",e.jsx("b",{children:"invite email"})," naming the nest and who shared it. Adding a teammate also emails a temporary password."]}),e.jsxs(e.Fragment,{children:["The link opens sign-in with their email filled in. They ",e.jsx("b",{children:"Continue with PromptOwl"})," using that same email — creating a PromptOwl account there if they have none — or use the temporary password."]}),e.jsxs(e.Fragment,{children:["Signed in, they see ",e.jsx("b",{children:"Pending invites"})," on the Nests page. ",e.jsx("b",{children:"Accept"})," opens the nest; ",e.jsx("b",{children:"Decline"})," removes their access."]})]})}),e.jsx(r,{title:"Documents",icon:m,children:e.jsx(i,{items:[["Types",e.jsx(e.Fragment,{children:"Document (Markdown), Artifact (hosted HTML) and Table (CSV facts an agent can query row by row)."})],["Writing",e.jsxs(e.Fragment,{children:["Rich editor or raw Markdown. ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"[[Title]]"})," links another document, ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"@name"})," mentions a person, ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"#"})," starts a heading."]})],["Tags",e.jsx(e.Fragment,{children:"Add them under the title. They stay local until you save."})],["Versions",e.jsx(e.Fragment,{children:"Every save is a version. Compare with an earlier one or revert to it from the history menu."})],["Comments",e.jsxs(e.Fragment,{children:["Switch to ",e.jsx("b",{children:"Comment"})," mode, select text, start a thread. Resolve or reopen it when done."]})],["People",e.jsxs(e.Fragment,{children:["Who created it and who else has edited it sit under the title; mention someone with ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"@"})," to pull them in."]})],["Find anything",e.jsxs(e.Fragment,{children:[e.jsx(a,{children:"Ctrl"})," / ",e.jsx(a,{children:"⌘"})," ",e.jsx(a,{children:"K"})," searches every nest and document. ",e.jsx(a,{children:"?"})," lists all shortcuts."]})]]})}),e.jsxs(r,{title:"Review",icon:u,children:[e.jsx(o,{steps:[e.jsxs(e.Fragment,{children:["Write and save. With stewardship off that is it — the document is published. With it on, the save is a ",e.jsx("b",{children:"draft"}),"."]}),e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"Submit for review"}),". Stewards are notified; you can withdraw until someone acts."]}),e.jsxs(e.Fragment,{children:["A reviewer ",e.jsx("b",{children:"approves"})," (published, visible to agents) or ",e.jsx("b",{children:"rejects"})," with a note (back to draft)."]})]}),e.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:A.map(([s,n])=>e.jsx(S,{term:s,def:n},s))}),e.jsxs("p",{className:"mt-3 text-muted-foreground",children:[e.jsx("b",{className:"text-foreground",children:"My Work"})," is everything waiting on you across all nests."," ",e.jsx("b",{className:"text-foreground",children:"My Drafts"})," is what you wrote and never submitted."]})]}),e.jsx(r,{title:"Views inside a nest",icon:p,children:e.jsx(i,{items:[["Board",e.jsxs(e.Fragment,{children:["Documents as cards in columns — by folder, by status, or by a tag family like ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"stage:*"}),". Drag to move or re-tag."]})],["Graph",e.jsx(e.Fragment,{children:"Documents, links, tags and stewards drawn as a graph."})],["Definitions",e.jsx(e.Fragment,{children:"The nest's glossary — terms stewards define so people and agents mean the same thing."})],["Workflows",e.jsxs(e.Fragment,{children:[e.jsx(x,{})," Agents are documents whose body is instructions. Wire one to a target document, run it by button, schedule or incoming hook; its output arrives as a pending review. Details on the Docs page."]})]]})}),e.jsx(r,{title:"Workspace",icon:g,children:e.jsx(i,{items:[["Teams",e.jsx(e.Fragment,{children:"Group people once, then share nests with the team. Signed in with PromptOwl? Its teams can be synced in."})],["API keys",e.jsxs(e.Fragment,{children:["What agents, the CLI and MCP clients use to sign in. A key sees every nest you can, or just one."," ",e.jsx("button",{type:"button",onClick:t,className:"underline underline-offset-2 text-foreground",children:"Manage keys"}),"."]})],["Connect",e.jsxs(e.Fragment,{children:["Bottom of the nest sidebar: the MCP URL and REST snippets for that nest. ",e.jsx("b",{children:"Add with AI"})," on the nest overview is a prompt that has an agent write context in."]})]]})}),e.jsx(r,{title:"Admin",icon:f,children:e.jsx(i,{items:[["Teammates",e.jsx(e.Fragment,{children:"Invite people, reset passwords, remove accounts, name other admins."})],["Server settings",e.jsx(e.Fragment,{children:"Public URL and logo, single sign-on, who can create nests, the Anthropic key, Slack / Teams / email notifications (email over SMTP or AWS SES), allowed content types, upload limit, telemetry."})],["Activity trace",e.jsx(e.Fragment,{children:"Every governance action on the server. Each nest has its own trace under Activity."})]]})}),k.map(s=>e.jsx(r,{title:s.title,icon:j,children:e.jsxs("div",{id:`help-${s.id}`,className:"space-y-3",children:[e.jsxs("p",{className:"text-muted-foreground",children:[e.jsx("span",{className:"text-xs uppercase tracking-wide",children:"For server admins"})," ","· ",e.jsx("b",{className:"text-foreground",children:s.where})]}),e.jsx("p",{className:"text-muted-foreground",children:s.summary}),e.jsx(o,{steps:s.steps}),e.jsx("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:s.notes.map((n,d)=>e.jsx("li",{children:n},`${s.id}-note-${d}`))})]})},s.id)),e.jsx(r,{title:"Account",icon:N,children:e.jsx("p",{className:"text-muted-foreground",children:"Your name and password, from the menu in the top-right corner."})})]})]})}export{D as default};
|
|
6
|
+
*/const v=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],N=l("circle-user",v),k=[{id:"sso",title:"Single sign-on (OIDC)",where:"Admin → Server settings → Single sign-on",summary:"Let people sign in with your identity provider: Microsoft Entra ID, Google, Okta, Keycloak or any OpenID Connect issuer. It is one setup for the whole server, and only a server admin can change it.",steps:["Set Public base URL (Server settings → General) to the https address people use, e.g. https://nest.acme.com. The redirect URI is built from it: <Public base URL>/auth/oidc/callback. The Single sign-on tab shows it with a Copy button.","At your identity provider, register a web app (confidential client) with that exact redirect URI. Copy its client ID and client secret.","On the Single sign-on tab, pick Microsoft Entra ID or Google, or paste your issuer URL. Then paste the client ID and secret.","Optional: list your allowed email domains, and turn Auto-provision off if only invited people should get in.","Turn it on, Save, then test in a private window. The login page shows a Sign in with Microsoft / Google / SSO button."],notes:["People are matched by email. Someone who already has a password account with the same email signs into that account, and their password still works.","API keys (cnst_…) do not go through SSO. Disabling someone at your identity provider does not stop their keys or their open sessions. Remove them under Admin → Teammates to end both.","A failed sign-in comes back with a short error. Each code, what causes it and how to fix it are listed in CONFIGURATION.md → Single sign-on (OIDC) → Troubleshooting."]}];function r({title:t,icon:s,children:n}){return e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s&&e.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-primary/10 text-primary",children:e.jsx(s,{className:"h-4 w-4"})}),e.jsx("h2",{className:"text-base font-semibold tracking-tight",children:t})]}),n]})}function o({steps:t}){return e.jsx("ol",{className:"space-y-3",children:t.map((s,n)=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:n+1}),e.jsx("span",{className:"text-muted-foreground pt-0.5",children:s})]},n))})}function S({term:t,def:s}){return e.jsxs("div",{className:"rounded-lg border bg-card p-3 transition-colors hover:border-primary/40",children:[e.jsx("div",{className:"mb-1 text-sm font-semibold",children:t}),e.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:s})]})}function i({items:t}){return e.jsx("ul",{className:"space-y-2",children:t.map(([s,n])=>e.jsxs("li",{className:"text-muted-foreground",children:[e.jsx("b",{className:"text-foreground",children:s})," — ",n]},s))})}const a=({children:t})=>e.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 text-xs",children:t}),A=[["Just me","Stewardship off. Saving publishes at once. Right for a personal nest."],["Me, with a paper trail","Stewardship on, self-approve allowed. Every change waits for review and you approve your own — a history without ceremony."],["A team","Stewards (viewer / editor / reviewer) per nest, tag or document. You cannot approve your own change; agents queue like everyone else."],["Prime documents","Mark a document or tag as prime and it always needs a second person, even where self-approve is on."]];function D(){const{manageKeys:t}=c();return e.jsxs("div",{className:"w-full",children:[e.jsx(y,{icon:h,title:"How it works",description:"A tour of the app, page by page. Agent setup (API, MCP, CLI) is on the Docs page in the header.",className:"mb-10"}),e.jsxs("div",{className:"space-y-10 text-sm leading-relaxed",children:[e.jsx(r,{title:"What this is",children:e.jsx("div",{className:"rounded-lg border-l-2 border-primary bg-muted/40 p-4",children:e.jsxs("p",{className:"text-muted-foreground",children:["A shared knowledge base for your team ",e.jsx("i",{children:"and"})," your AI agents. Documents live in"," ",e.jsx("b",{className:"text-foreground",children:"nests"}),". Every save is a version you can go back to. In a stewarded nest a change waits for a reviewer before agents can read it. People write here; agents read and write the same documents over the API, MCP or the ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"ctx"})," CLI."]})})}),e.jsx(r,{title:"Nests",icon:w,children:e.jsx(i,{items:[["Create",e.jsxs(e.Fragment,{children:["From the Nests page — server admins only, unless an admin lets everyone create nests in Server settings. Have Markdown already? ",e.jsx("b",{children:"Import folder"})," brings a whole directory in."]})],["Organize",e.jsx(e.Fragment,{children:"Folders and subfolders in the sidebar; move a document from its folder picker. With many nests, the sidebar has a name filter."})],["Share",e.jsx(e.Fragment,{children:"The whole nest with a person or a team (viewer / editor / admin), or just one document or folder — the recipient sees only that slice."})],["Go public",e.jsxs(e.Fragment,{children:["A public nest gets a read-only ",e.jsx("b",{children:"Reader mode"})," with a home document. A single document can also be published to a link."]})],["Housekeeping",e.jsx(e.Fragment,{children:"Rename, pin, archive or delete a nest. Anyone can request a deletion; an owner honours or declines it."})]]})}),e.jsx(r,{title:"Inviting someone",icon:b,children:e.jsx(o,{steps:[e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"Share a nest"})," with their email (the nest's Collaborators tab), or add them under ",e.jsx("b",{children:"Teammates"})," and pick a nest to share right there. Joining the server alone gives no nest access."]}),e.jsxs(e.Fragment,{children:["They get an ",e.jsx("b",{children:"invite email"})," naming the nest and who shared it. Adding a teammate also emails a temporary password."]}),e.jsxs(e.Fragment,{children:["The link opens sign-in with their email filled in. They ",e.jsx("b",{children:"Continue with PromptOwl"})," using that same email — creating a PromptOwl account there if they have none — or use the temporary password."]}),e.jsxs(e.Fragment,{children:["Signed in, they see ",e.jsx("b",{children:"Pending invites"})," on the Nests page. ",e.jsx("b",{children:"Accept"})," opens the nest; ",e.jsx("b",{children:"Decline"})," removes their access."]})]})}),e.jsx(r,{title:"Documents",icon:m,children:e.jsx(i,{items:[["Types",e.jsx(e.Fragment,{children:"Document (Markdown), Artifact (hosted HTML) and Table (CSV facts an agent can query row by row)."})],["Writing",e.jsxs(e.Fragment,{children:["Rich editor or raw Markdown. ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"[[Title]]"})," links another document, ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"@name"})," mentions a person, ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"#"})," starts a heading."]})],["Tags",e.jsx(e.Fragment,{children:"Add them under the title. They stay local until you save."})],["Versions",e.jsx(e.Fragment,{children:"Every save is a version. Compare with an earlier one or revert to it from the history menu."})],["Comments",e.jsxs(e.Fragment,{children:["Switch to ",e.jsx("b",{children:"Comment"})," mode, select text, start a thread. Resolve or reopen it when done."]})],["People",e.jsxs(e.Fragment,{children:["Who created it and who else has edited it sit under the title; mention someone with ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"@"})," to pull them in."]})],["Find anything",e.jsxs(e.Fragment,{children:[e.jsx(a,{children:"Ctrl"})," / ",e.jsx(a,{children:"⌘"})," ",e.jsx(a,{children:"K"})," searches every nest and document. ",e.jsx(a,{children:"?"})," lists all shortcuts."]})]]})}),e.jsxs(r,{title:"Review",icon:u,children:[e.jsx(o,{steps:[e.jsxs(e.Fragment,{children:["Write and save. With stewardship off that is it — the document is published. With it on, the save is a ",e.jsx("b",{children:"draft"}),"."]}),e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"Submit for review"}),". Stewards are notified; you can withdraw until someone acts."]}),e.jsxs(e.Fragment,{children:["A reviewer ",e.jsx("b",{children:"approves"})," (published, visible to agents) or ",e.jsx("b",{children:"rejects"})," with a note (back to draft)."]})]}),e.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:A.map(([s,n])=>e.jsx(S,{term:s,def:n},s))}),e.jsxs("p",{className:"mt-3 text-muted-foreground",children:[e.jsx("b",{className:"text-foreground",children:"My Work"})," is everything waiting on you across all nests."," ",e.jsx("b",{className:"text-foreground",children:"My Drafts"})," is what you wrote and never submitted."]})]}),e.jsx(r,{title:"Views inside a nest",icon:p,children:e.jsx(i,{items:[["Board",e.jsxs(e.Fragment,{children:["Documents as cards in columns — by folder, by status, or by a tag family like ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"stage:*"}),". Drag to move or re-tag."]})],["Graph",e.jsx(e.Fragment,{children:"Documents, links, tags and stewards drawn as a graph."})],["Definitions",e.jsx(e.Fragment,{children:"The nest's glossary — terms stewards define so people and agents mean the same thing."})],["Workflows",e.jsxs(e.Fragment,{children:[e.jsx(x,{})," Agents are documents whose body is instructions. Wire one to a target document, run it by button, schedule or incoming hook; its output arrives as a pending review. Details on the Docs page."]})]]})}),e.jsx(r,{title:"Workspace",icon:g,children:e.jsx(i,{items:[["Teams",e.jsx(e.Fragment,{children:"Group people once, then share nests with the team. Signed in with PromptOwl? Its teams can be synced in."})],["API keys",e.jsxs(e.Fragment,{children:["What agents, the CLI and MCP clients use to sign in. A key sees every nest you can, or just one."," ",e.jsx("button",{type:"button",onClick:t,className:"underline underline-offset-2 text-foreground",children:"Manage keys"}),"."]})],["Connect",e.jsxs(e.Fragment,{children:["Bottom of the nest sidebar: the MCP URL and REST snippets for that nest. ",e.jsx("b",{children:"Add with AI"})," on the nest overview is a prompt that has an agent write context in."]})]]})}),e.jsx(r,{title:"Admin",icon:f,children:e.jsx(i,{items:[["Teammates",e.jsx(e.Fragment,{children:"Invite people, reset passwords, remove accounts, name other admins."})],["Server settings",e.jsx(e.Fragment,{children:"Public URL and logo, single sign-on, who can create nests, the Anthropic key, Slack / Teams / email notifications (email over SMTP or AWS SES), allowed content types, upload limit, telemetry."})],["Activity trace",e.jsx(e.Fragment,{children:"Every governance action on the server. Each nest has its own trace under Activity."})]]})}),k.map(s=>e.jsx(r,{title:s.title,icon:j,children:e.jsxs("div",{id:`help-${s.id}`,className:"space-y-3",children:[e.jsxs("p",{className:"text-muted-foreground",children:[e.jsx("span",{className:"text-xs uppercase tracking-wide",children:"For server admins"})," ","· ",e.jsx("b",{className:"text-foreground",children:s.where})]}),e.jsx("p",{className:"text-muted-foreground",children:s.summary}),e.jsx(o,{steps:s.steps}),e.jsx("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:s.notes.map((n,d)=>e.jsx("li",{children:n},`${s.id}-note-${d}`))})]})},s.id)),e.jsx(r,{title:"Account",icon:N,children:e.jsx("p",{className:"text-muted-foreground",children:"Your name and password, from the menu in the top-right corner."})})]})]})}export{D as default};
|