@snagset/server 0.1.37 → 0.1.38
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/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-CJog0hVD.js → CompositeItem-Yi3wWYM7.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-D2seMnrm.js → ConfirmDialog-D6hyhISD.js} +1 -1
- package/static/dashboard/assets/{CopyButton-Bc4lyikk.js → CopyButton-hyiQh1Zr.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-CzXi3fsx.js → FieldItemContext-Gb3Lo5Ci.js} +1 -1
- package/static/dashboard/assets/{InstallTag-SMFR2B0h.js → InstallTag-BRvgfS91.js} +1 -1
- package/static/dashboard/assets/{McpTokens-BXqxvFAS.js → McpTokens--C1TeZqq.js} +1 -1
- package/static/dashboard/assets/{SaveState-Cmf4iv03.js → SaveState-CmcJ4unZ.js} +1 -1
- package/static/dashboard/assets/{_app-DwywpWfz.js → _app-CBnYJfLp.js} +1 -1
- package/static/dashboard/assets/{_app-bdnugJ8u.js → _app-Dsd1bbNv.js} +1 -1
- package/static/dashboard/assets/{activity-qDQs5Zz8.js → activity-DG1e6z-2.js} +1 -1
- package/static/dashboard/assets/{arrow-left-CDK8KGdH.js → arrow-left-CWiSdgA-.js} +1 -1
- package/static/dashboard/assets/{avatar-BIbCnV-M.js → avatar-nrKPMD7A.js} +1 -1
- package/static/dashboard/assets/{badge-BD0L3Rdr.js → badge-DEvpNOzs.js} +1 -1
- package/static/dashboard/assets/{card-CCRzd-vJ.js → card--8RLEIGP.js} +1 -1
- package/static/dashboard/assets/{check-CvTMcsU6.js → check-XHwuM5zg.js} +1 -1
- package/static/dashboard/assets/{chevron-right-NPSJD-jD.js → chevron-right-CG2rSUns.js} +1 -1
- package/static/dashboard/assets/{copy-CwAe5Q6l.js → copy-eakuUTpI.js} +1 -1
- package/static/dashboard/assets/{dialog-CvU77XfW.js → dialog-D0b9dX2m.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-VHkK2Dt7.js → dropdown-menu-BMIst4Wj.js} +1 -1
- package/static/dashboard/assets/{image-off-wPLko91u.js → image-off-DZOyJVTM.js} +1 -1
- package/static/dashboard/assets/{index-B1JGVSdd.js → index-COORBw3J.js} +4 -4
- package/static/dashboard/assets/{invite-DWNnOuAZ.js → invite-Df7qdHBL.js} +1 -1
- package/static/dashboard/assets/{label-C6rZlF0y.js → label-Ds2CYKth.js} +1 -1
- package/static/dashboard/assets/{labels-DhKmOzOU.js → labels-CUVq_Uf0.js} +1 -1
- package/static/dashboard/assets/{layout-grid-CPYmheoR.js → layout-grid-BXWirugp.js} +1 -1
- package/static/dashboard/assets/{parts-sBoh2K5o.js → parts-B46j7QJi.js} +1 -1
- package/static/dashboard/assets/{plus-B7K-9XU0.js → plus-yZPLf0r6.js} +1 -1
- package/static/dashboard/assets/s._site-BQiiE9w4.js +1 -0
- package/static/dashboard/assets/s._site.comments-CQYkPWo4.js +54 -0
- package/static/dashboard/assets/{s._site.reviewers-yBn4jjwr.js → s._site.reviewers-BCQWB5GA.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-CsiWJZ8D.js → s._site.settings-D9Qix9dj.js} +1 -1
- package/static/dashboard/assets/{setup-DrjzRZp8.js → setup-CefvYWGy.js} +1 -1
- package/static/dashboard/assets/{sign-in-BsM2n_hk.js → sign-in-Q4AWMmvk.js} +1 -1
- package/static/dashboard/assets/{sign-up-BXcvVUC-.js → sign-up-nsUll0Gy.js} +1 -1
- package/static/dashboard/assets/{sites-DRTZAXN_.js → sites-BKsg9Pla.js} +1 -1
- package/static/dashboard/assets/{studio-DdM6OVdO.js → studio-CSGo60dt.js} +1 -1
- package/static/dashboard/assets/studio-ytRb_WCk.js +1 -0
- package/static/dashboard/assets/{studio.index-BOXLD6ah.js → studio.index-Cul4Sj15.js} +1 -1
- package/static/dashboard/assets/{studio.integrations-B7XK6X3K.js → studio.integrations-CC61jGXL.js} +1 -1
- package/static/dashboard/assets/{studio.members-DSJEjb1M.js → studio.members-DEM1MjLy.js} +1 -1
- package/static/dashboard/assets/{sun-DojiLt7X.js → sun-Djjj3CUF.js} +1 -1
- package/static/dashboard/assets/{switch-SJYZN0-3.js → switch-WMRF6OK1.js} +1 -1
- package/static/dashboard/assets/{table-BDQkr8bT.js → table-CgakQRAC.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-BDqDB_Wq.js → useAriaLabelledBy-obWCIEg1.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-DXKWEN1Y.js → useBaseQuery-DG87f6yY.js} +1 -1
- package/static/dashboard/assets/useQuery-DT3w11tR.js +1 -0
- package/static/dashboard/assets/useRender-Bu6Vyu1g.js +1 -0
- package/static/dashboard/assets/{useValueChanged-B9j_H2Sq.js → useValueChanged-CHzVruZ0.js} +1 -1
- package/static/dashboard/assets/{users-jrxD0Qlm.js → users-BvfczmcS.js} +1 -1
- package/static/dashboard/assets/{welcome-BGT16RMO.js → welcome-D5mKF-J3.js} +1 -1
- package/static/dashboard/assets/{widget-signin-A_kxUEvx.js → widget-signin-BmCBYJgF.js} +1 -1
- package/static/dashboard/assets/{you-CdfLrYaC.js → you-Dsp9kUVS.js} +1 -1
- package/static/dashboard/assets/{zod-C7-R6TNW.js → zod-D7wsVto4.js} +1 -1
- package/static/dashboard/index.html +1 -1
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/s._site-DKfVuunu.js +0 -1
- package/static/dashboard/assets/s._site.comments-DqDBqjhy.js +0 -54
- package/static/dashboard/assets/studio-CEwWJLvF.js +0 -1
- package/static/dashboard/assets/useQuery-BCK_zdLj.js +0 -1
- package/static/dashboard/assets/useRender-hAtJO9As.js +0 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,e as L,f as M,a8 as w,j as T,aL as k,ab as _,E as j,aK as S,k as H}from"./index-
|
|
1
|
+
import{r as f,e as L,f as M,a8 as w,j as T,aL as k,ab as _,E as j,aK as S,k as H}from"./index-COORBw3J.js";const Y=f.createContext(void 0);function q(){return f.useContext(Y)?.direction??"ltr"}const y=f.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function B(){return f.useContext(y)}function F(s={}){const{guess:o,label:e,metadata:r,textRef:l,index:t}=s,{register:i,unregister:u,subscribeMapChange:d,nextIndexRef:h}=B(),c=f.useRef(-1),[g,C]=f.useState(t==null&&o?()=>{if(c.current===-1){const x=h.current;h.current+=1,c.current=x}return c.current}:-1),v=t??g,R=f.useRef(null),E=f.useCallback(x=>{const b=R.current;b&&u(b),R.current=x,x&&i(x,{metadata:r??null,index:t??null,label:e,textRef:l})},[t,i,u,r,e,l]);return L(()=>{if(t==null)return d(x=>{const b=R.current?x.get(R.current)?.index:null;b!=null&&C(b)})},[t,d]),{ref:E,index:v}}function Q(s){const{children:o,elementsRef:e,labelsRef:r,onMapChange:l}=s,t=M(l),[,i]=f.useState(!1),u=w(W).current,d=w(U).current,h=f.useRef(0),c=f.useRef(!0),g=f.useRef([]),C=f.useRef(null),v=M(()=>{c.current||(c.current=!0,i(n=>!n))}),R=M((n,p)=>{d.set(n,p),v()}),E=M(n=>{d.delete(n),v()}),x=M(n=>{const p=new Map;return e.current.length=0,r&&(r.current.length=0),n.forEach(a=>{p.set(a.element,{...a.registration.metadata??{},index:a.index}),e.current[a.index]=a.element,r&&(r.current[a.index]=a.registration.label!==void 0?a.registration.label:a.registration.textRef?.current?.textContent??a.element.textContent)}),h.current=e.current.length,p});function b(n){if(C.current?.disconnect(),C.current=null,typeof MutationObserver!="function"||n.length<2)return;const p=new MutationObserver(m=>{if(!J(m))return;let I=null;for(const O of n)if(O.isConnected){if(I&&D(I,O)>0){p.disconnect(),v();return}I=O}});C.current=p;const a=new Set;for(let m=1;m<n.length;m+=1){const I=G(n[m-1],n[m]);I&&a.add(I)}a.forEach(m=>p.observe(m,{childList:!0}))}const N=M(()=>{const[n,p]=z(d),a=x(n);b(p),g.current=n,c.current=!1,u.forEach(m=>m(a)),t(a)});L(()=>(c.current||x(g.current),()=>{e.current=[],r&&(r.current=[])}),[e,r,x]),L(()=>{c.current&&N()}),L(()=>()=>{C.current?.disconnect(),c.current=!0},[]);const P=M(n=>(u.add(n),()=>{u.delete(n)})),A=f.useMemo(()=>({register:R,unregister:E,subscribeMapChange:P,nextIndexRef:h}),[R,E,P,h]);return T.jsx(y.Provider,{value:A,children:o})}function U(){return new Map}function W(){return new Set}function z(s){const o=new Set,e=[],r=[];s.forEach((t,i)=>{if(!i.isConnected)return;const u=t.index,d={index:u??-1,element:i,registration:t};u===null?r.push(d):u>=0&&(o.add(u),e.push(d))});let l=0;return r.sort((t,i)=>D(t.element,i.element)),r.forEach(t=>{for(;o.has(l);)l+=1;t.index=l,e.push(t),l+=1}),o.size>0&&e.sort((t,i)=>t.index-i.index),[e,r.map(t=>t.element)]}function G(s,o){let e=s.parentElement;for(;e&&!e.contains(o);)e=e.parentElement;return e}function J(s){for(const o of s)for(let e=0;e<o.removedNodes.length;e+=1)if(o.removedNodes[e].isConnected)return!0;return!1}function D(s,o){return s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function K(s={}){const{highlightItemOnHover:o,highlightedIndex:e,onHighlightedIndexChange:r}=k(),{ref:l,index:t}=F(s),i=e===t,u=f.useRef(null),d=_(l,u);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(t)},onMouseMove(){const c=u.current;if(!o||!c)return;const g=c.hasAttribute("disabled")||c.ariaDisabled==="true";!i&&!g&&c.focus()}},compositeRef:d,index:t}}function X(s){const{render:o,className:e,style:r,state:l=j,props:t=S,refs:i=S,metadata:u,stateAttributesMapping:d,tag:h="div",...c}=s,{compositeProps:g,compositeRef:C}=K({metadata:u});return H(h,s,{state:l,ref:[C,...i],props:[g,...t,c],stateAttributesMapping:d})}export{Q as C,F as a,X as b,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,B as x}from"./index-
|
|
1
|
+
import{r as i,j as e,B as x}from"./index-COORBw3J.js";import{E as u,G as g,I as C,H as D,J as v,K as b}from"./dialog-D0b9dX2m.js";import{L as E,I}from"./label-Ds2CYKth.js";function T({open:t,onOpenChange:o,title:m,description:r,children:h,confirmLabel:j,confirmWord:l,busy:s=!1,onConfirm:p}){const[n,c]=i.useState(""),d=i.useId();i.useEffect(()=>{t&&c("")},[t]);const f=!l||n.trim()===l;return e.jsx(u,{open:t,onOpenChange:a=>{!a&&s||o(a)},children:e.jsx(g,{showCloseButton:!1,children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),f&&!s&&p()},children:[e.jsxs(C,{children:[e.jsx(D,{children:m}),r&&e.jsx(v,{children:r})]}),h,l&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(E,{htmlFor:d,children:["Type ",e.jsx("b",{className:"font-semibold text-foreground",children:l})," to confirm"]}),e.jsx(I,{id:d,value:n,autoComplete:"off",spellCheck:!1,disabled:s,onChange:a=>c(a.target.value)})]}),e.jsxs(b,{children:[e.jsx(x,{type:"button",variant:"outline",disabled:s,onClick:()=>o(!1),children:"Cancel"}),e.jsx(x,{type:"submit",variant:"destructive",loading:s,disabled:!f,children:s?"Working…":j})]})]})})})}export{T as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as t,B as c}from"./index-
|
|
1
|
+
import{r as n,j as t,B as c}from"./index-COORBw3J.js";import{C}from"./check-XHwuM5zg.js";import{C as m}from"./copy-eakuUTpI.js";function l({text:r,label:e="Copy",withText:s=!1,size:a="icon-sm",className:p}){const[o,i]=n.useState(!1);return t.jsxs(c,{type:"button",variant:"outline",size:s?"sm":a,className:p,"aria-label":o?"Copied":e,onClick:()=>{navigator.clipboard?.writeText(r).catch(()=>{}),i(!0),setTimeout(()=>i(!1),1500)},children:[o?t.jsx(C,{}):t.jsx(m,{}),s&&(o?"Copied":e)]})}export{l as C};
|
package/static/dashboard/assets/{FieldItemContext-CzXi3fsx.js → FieldItemContext-Gb3Lo5Ci.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t}from"./index-
|
|
1
|
+
import{r as t}from"./index-COORBw3J.js";const e=t.createContext({disabled:!1});function r(){return t.useContext(e)}export{r as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e,B as i,aX as n}from"./index-
|
|
1
|
+
import{r as o,j as e,B as i,aX as n}from"./index-COORBw3J.js";import{C as c}from"./check-XHwuM5zg.js";import{C as l}from"./copy-eakuUTpI.js";function p(t){return`<script src="${location.origin}/snag.js" ${n("site")}="${t}" defer><\/script>`}function g({uid:t}){const[r,a]=o.useState(!1),s=p(t);return e.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[e.jsx("code",{className:"whitespace-pre-wrap break-all",children:s}),e.jsx(i,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":"Copy the tag",onClick:()=>{navigator.clipboard?.writeText(s),a(!0),setTimeout(()=>a(!1),1500)},children:r?e.jsx(c,{}):e.jsx(l,{})})]})}export{g as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as L,r as x,_ as R,j as e,W as J,B as N,$ as A,Z as D,z as E,s as T,a1 as K,C as Q}from"./index-B1JGVSdd.js";import{u as z}from"./useQuery-BCK_zdLj.js";import{B as M}from"./badge-BD0L3Rdr.js";import{E as O,G as _,I as F,H as $,J as B,K as I}from"./dialog-CvU77XfW.js";import{L as S,I as G}from"./label-C6rZlF0y.js";import{S as H}from"./switch-SJYZN0-3.js";import{C as W}from"./ConfirmDialog-D2seMnrm.js";import{C}from"./CopyButton-Bc4lyikk.js";import{a as U}from"./parts-sBoh2K5o.js";import{b as Y}from"./labels-DhKmOzOU.js";function ce({owner:n,instanceOwner:l,sites:g,mine:f=!1}){const c=L(),a=z(E.mcpTokens()),[u,d]=x.useState(!1),[j,o]=x.useState(null),[r,m]=x.useState(null),v=R({mutationFn:t=>T.revokeMcpToken(t),onSuccess:()=>{m(null),c.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),y=a.data?.data??[],w=y.filter(t=>!t.revokedAt),i=a.data?.http??null,k=R({mutationFn:t=>T.setMcpHttp(t),onSuccess:(t,p)=>{c.setQueryData(E.instance().queryKey,t),c.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(p?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),b=t=>{const p=new Set(t),s=p.has("comments:write")||p.has("threads:write");return!s&&!p.has("context:read")?"Read-only":s?`Writes: ${[p.has("comments:write")?"reply":"",p.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(U,{title:f?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),i&&e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[i.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:i.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:i.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),i.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":""]})]}),e.jsx(H,{id:"mcp-http-on","aria-label":"Remote transport",checked:i.enabled,disabled:!l||i.source==="env"||k.isPending,onCheckedChange:t=>k.mutate(t)})]}),a.isSuccess&&w.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{variant:"outline",children:"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:f?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),y.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:y.map(t=>e.jsxs("li",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(M,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":b(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${Y(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>m(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(N,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"New token…"})}),e.jsx(V,{open:u,onOpenChange:d,sites:g,http:a.data?.http??null,onDone:t=>{c.invalidateQueries({queryKey:["mcp-tokens"]}),o(t)}}),e.jsx(Z,{state:j,http:a.data?.http??null,onClose:()=>o(null)}),e.jsx(W,{open:r!==null,onOpenChange:t=>!t&&m(null),title:`Revoke “${r?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:v.isPending,onConfirm:async()=>{r&&await v.mutateAsync(r.id)}})]})}function V({open:n,onOpenChange:l,sites:g,http:f,onDone:c}){const[a,u]=x.useState(""),[d,j]=x.useState(""),[o,r]=x.useState(["threads:read","source:map"]),[m,v]=x.useState(""),[y,w]=x.useState(!1),[i,k]=x.useState(""),b=R({mutationFn:()=>T.mintMcpToken({name:a.trim(),...d?{site:d}:{},scopes:o,...m?{expiresInDays:Number(m)}:{},...y?{allowRemoteWrites:!0}:{}})}),t=(s,h)=>r(P=>h?[...new Set([...P,s])]:P.filter(q=>q!==s)),p=async s=>{s.preventDefault(),k("");try{const h=await b.mutateAsync();u(""),j(""),r(["threads:read","source:map"]),v(""),w(!1),l(!1),c(h)}catch(h){k(h instanceof Q?h.message:"Could not reach the server.")}};return e.jsx(O,{open:n,onOpenChange:l,children:e.jsx(_,{children:e.jsxs("form",{onSubmit:s=>void p(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(F,{children:[e.jsx($,{children:"New agent token"}),e.jsx(B,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),i&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:i}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"mcp-name",children:"Name"}),e.jsx(G,{id:"mcp-name",placeholder:"Claude Code",value:a,onChange:s=>u(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"mcp-site",children:"Site"}),e.jsxs("select",{id:"mcp-site",value:d,onChange:s=>j(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"All sites"}),g.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),K.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:o.includes(s.scope),onChange:h=>t(s.scope,h.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),f?.enabled&&(o.includes("comments:write")||o.includes("threads:write"))&&e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:y,onChange:s=>w(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"mcp-expires",children:"Expires"}),e.jsxs("select",{id:"mcp-expires",value:m,onChange:s=>v(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"Never"}),e.jsx("option",{value:"30",children:"In 30 days"}),e.jsx("option",{value:"90",children:"In 90 days"}),e.jsx("option",{value:"365",children:"In a year"})]})]}),e.jsxs(I,{children:[e.jsx(N,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(N,{type:"submit",loading:b.isPending,disabled:!a.trim()||o.length===0,children:b.isPending?"Minting…":"Create token"})]})]})})})}function Z({state:n,http:l,onClose:g}){const f=typeof location<"u"?location.origin:"",c={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:f,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},a=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:c}}},null,2),u=["claude mcp add snagset",...Object.entries(c).map(([r,m])=>`-e ${r}=${m}`),"--","npx -y @snagset/mcp"].join(" "),d=`Bearer ${n?.secret??""}`,j=["claude mcp add","--transport http","snagset",l?.url??"",`--header "Authorization: ${d}"`].join(" "),o=JSON.stringify({mcpServers:{snagset:{type:"http",url:l?.url??"",headers:{Authorization:d}}}},null,2);return e.jsx(O,{open:n!==null,onOpenChange:r=>!r&&g(),children:e.jsxs(_,{className:"sm:max-w-xl",children:[e.jsxs(F,{children:[e.jsxs($,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(B,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(C,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(C,{text:u,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u})]}),l?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(C,{text:o,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:j}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(C,{text:a,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(I,{children:e.jsx(N,{type:"button",onClick:g,children:"Done"})})]})})}export{ce as M};
|
|
1
|
+
import{d as L,r as x,_ as R,j as e,W as J,B as N,$ as A,Z as D,z as E,s as T,a1 as K,C as Q}from"./index-COORBw3J.js";import{u as z}from"./useQuery-DT3w11tR.js";import{B as M}from"./badge-DEvpNOzs.js";import{E as O,G as _,I as F,H as $,J as B,K as I}from"./dialog-D0b9dX2m.js";import{L as S,I as G}from"./label-Ds2CYKth.js";import{S as H}from"./switch-WMRF6OK1.js";import{C as W}from"./ConfirmDialog-D6hyhISD.js";import{C}from"./CopyButton-hyiQh1Zr.js";import{a as U}from"./parts-B46j7QJi.js";import{b as Y}from"./labels-CUVq_Uf0.js";function ce({owner:n,instanceOwner:l,sites:g,mine:f=!1}){const c=L(),a=z(E.mcpTokens()),[u,d]=x.useState(!1),[j,o]=x.useState(null),[r,m]=x.useState(null),v=R({mutationFn:t=>T.revokeMcpToken(t),onSuccess:()=>{m(null),c.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),y=a.data?.data??[],w=y.filter(t=>!t.revokedAt),i=a.data?.http??null,k=R({mutationFn:t=>T.setMcpHttp(t),onSuccess:(t,p)=>{c.setQueryData(E.instance().queryKey,t),c.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(p?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),b=t=>{const p=new Set(t),s=p.has("comments:write")||p.has("threads:write");return!s&&!p.has("context:read")?"Read-only":s?`Writes: ${[p.has("comments:write")?"reply":"",p.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(U,{title:f?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),i&&e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[i.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:i.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:i.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),i.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":""]})]}),e.jsx(H,{id:"mcp-http-on","aria-label":"Remote transport",checked:i.enabled,disabled:!l||i.source==="env"||k.isPending,onCheckedChange:t=>k.mutate(t)})]}),a.isSuccess&&w.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{variant:"outline",children:"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:f?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),y.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:y.map(t=>e.jsxs("li",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(M,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":b(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${Y(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>m(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(N,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"New token…"})}),e.jsx(V,{open:u,onOpenChange:d,sites:g,http:a.data?.http??null,onDone:t=>{c.invalidateQueries({queryKey:["mcp-tokens"]}),o(t)}}),e.jsx(Z,{state:j,http:a.data?.http??null,onClose:()=>o(null)}),e.jsx(W,{open:r!==null,onOpenChange:t=>!t&&m(null),title:`Revoke “${r?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:v.isPending,onConfirm:async()=>{r&&await v.mutateAsync(r.id)}})]})}function V({open:n,onOpenChange:l,sites:g,http:f,onDone:c}){const[a,u]=x.useState(""),[d,j]=x.useState(""),[o,r]=x.useState(["threads:read","source:map"]),[m,v]=x.useState(""),[y,w]=x.useState(!1),[i,k]=x.useState(""),b=R({mutationFn:()=>T.mintMcpToken({name:a.trim(),...d?{site:d}:{},scopes:o,...m?{expiresInDays:Number(m)}:{},...y?{allowRemoteWrites:!0}:{}})}),t=(s,h)=>r(P=>h?[...new Set([...P,s])]:P.filter(q=>q!==s)),p=async s=>{s.preventDefault(),k("");try{const h=await b.mutateAsync();u(""),j(""),r(["threads:read","source:map"]),v(""),w(!1),l(!1),c(h)}catch(h){k(h instanceof Q?h.message:"Could not reach the server.")}};return e.jsx(O,{open:n,onOpenChange:l,children:e.jsx(_,{children:e.jsxs("form",{onSubmit:s=>void p(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(F,{children:[e.jsx($,{children:"New agent token"}),e.jsx(B,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),i&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:i}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"mcp-name",children:"Name"}),e.jsx(G,{id:"mcp-name",placeholder:"Claude Code",value:a,onChange:s=>u(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"mcp-site",children:"Site"}),e.jsxs("select",{id:"mcp-site",value:d,onChange:s=>j(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"All sites"}),g.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),K.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:o.includes(s.scope),onChange:h=>t(s.scope,h.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),f?.enabled&&(o.includes("comments:write")||o.includes("threads:write"))&&e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:y,onChange:s=>w(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"mcp-expires",children:"Expires"}),e.jsxs("select",{id:"mcp-expires",value:m,onChange:s=>v(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:[e.jsx("option",{value:"",children:"Never"}),e.jsx("option",{value:"30",children:"In 30 days"}),e.jsx("option",{value:"90",children:"In 90 days"}),e.jsx("option",{value:"365",children:"In a year"})]})]}),e.jsxs(I,{children:[e.jsx(N,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(N,{type:"submit",loading:b.isPending,disabled:!a.trim()||o.length===0,children:b.isPending?"Minting…":"Create token"})]})]})})})}function Z({state:n,http:l,onClose:g}){const f=typeof location<"u"?location.origin:"",c={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:f,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},a=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:c}}},null,2),u=["claude mcp add snagset",...Object.entries(c).map(([r,m])=>`-e ${r}=${m}`),"--","npx -y @snagset/mcp"].join(" "),d=`Bearer ${n?.secret??""}`,j=["claude mcp add","--transport http","snagset",l?.url??"",`--header "Authorization: ${d}"`].join(" "),o=JSON.stringify({mcpServers:{snagset:{type:"http",url:l?.url??"",headers:{Authorization:d}}}},null,2);return e.jsx(O,{open:n!==null,onOpenChange:r=>!r&&g(),children:e.jsxs(_,{className:"sm:max-w-xl",children:[e.jsxs(F,{children:[e.jsxs($,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(B,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(C,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(C,{text:u,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u})]}),l?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(C,{text:o,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:j}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(C,{text:a,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(I,{children:e.jsx(N,{type:"button",onClick:g,children:"Done"})})]})})}export{ce as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,aW as o}from"./index-
|
|
1
|
+
import{r,j as e,aW as o}from"./index-COORBw3J.js";function l({saving:s,savedAt:t}){const[i,a]=r.useState(!1);return r.useEffect(()=>{if(!t)return;a(!0);const n=setTimeout(()=>a(!1),1800);return()=>clearTimeout(n)},[t]),s?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12.5px] text-muted-foreground","aria-live":"polite",children:[e.jsx(o,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Saving"]}):e.jsx("span",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite",children:i?"Saved":""})}export{l as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as gt,a as ft,b as ht,c as I,d as ve,r as o,e as L,f as de,g as xt,j as e,B as Z,h as w,i as ne,m as je,E as mt,k as ye,l as fe,n as bt,o as vt,p as ae,q as K,S as jt,s as ee,t as yt,L as H,v as St,M as wt,w as Nt,x as Ct,y as kt,z as Tt,O as Pt}from"./index-
|
|
1
|
+
import{u as gt,a as ft,b as ht,c as I,d as ve,r as o,e as L,f as de,g as xt,j as e,B as Z,h as w,i as ne,m as je,E as mt,k as ye,l as fe,n as bt,o as vt,p as ae,q as K,S as jt,s as ee,t as yt,L as H,v as St,M as wt,w as Nt,x as Ct,y as kt,z as Tt,O as Pt}from"./index-COORBw3J.js";import{u as Le}from"./useQuery-DT3w11tR.js";import{T as Rt,i as $e,a as Mt,D as Et,b as Ot,c as Dt,X as It,d as At,e as _t,f as Ht,g as zt,R as Lt,p as $t,h as Bt,j as Ft,k as Ut,P as qt,l as Gt,u as Vt,m as Kt,n as Yt,o as Wt,q as Xt,r as Qt,s as Jt,t as Zt,v as es,w as ts,x as ss,y as ns,z as as,A as rs,F as os,B as is,C as ls,E as Be,G as Fe,H as Ue,I as ds,J as cs,K as us}from"./dialog-D0b9dX2m.js";import{c as B,n as qe,g as ps,a as he,t as gs,d as fs,i as hs,u as xs,b as ce,L as ms,I as bs}from"./label-Ds2CYKth.js";import{g as xe,u as vs,a as js,b as ys,s as Ss,c as ws,d as Ns,e as Cs,f as ks,h as Ts,S as Ge,E as J,D as re,i as oe,j as ie,k as Se,l as te,m as D,n as V,o as Ps,p as ue}from"./dropdown-menu-BMIst4Wj.js";import{u as Ve}from"./useRender-Bu6Vyu1g.js";import{A as Rs,a as Ms}from"./avatar-nrKPMD7A.js";import{u as we,S as Es,i as Os,a as Ds}from"./labels-CUVq_Uf0.js";import{L as se}from"./layout-grid-BXWirugp.js";import{U as me}from"./users-BvfczmcS.js";import{c as Is}from"./update-duXzIzFS.js";import{P as Ke}from"./plus-yZPLf0r6.js";import{M as As,S as _s,a as Hs}from"./sun-Djjj3CUF.js";import"./useBaseQuery-DG87f6yY.js";import"./check-XHwuM5zg.js";import"./CompositeItem-Yi3wWYM7.js";import"./useValueChanged-CHzVruZ0.js";function zs(t){const s=gt({warn:t?.router===void 0}),n=t?.router||s;return ft(n.stores.__store,ht(t,n))}/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as n,G as a,B as r}from"./index-
|
|
1
|
+
import{j as e,u as n,G as a,B as r}from"./index-COORBw3J.js";function i({error:s}){const t=n(),o=s instanceof Error?s.message:"Something went wrong.";return e.jsx(a,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Could not load the dashboard"}),e.jsx("p",{className:"m-0 text-muted-foreground",children:o}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>void t.invalidate(),children:"Try again"})]})})}const m=({error:s})=>e.jsx(i,{error:s});export{m as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as g,U as f,V as p,p as v,j as e,B as m,W as N,L as j,X as P}from"./index-
|
|
1
|
+
import{T as g,U as f,V as p,p as v,j as e,B as m,W as N,L as j,X as P}from"./index-COORBw3J.js";import{Q as y,u as b}from"./useBaseQuery-DG87f6yY.js";import{P as w,S}from"./parts-B46j7QJi.js";import{u as R,b as E,c as k,S as F}from"./labels-CUVq_Uf0.js";import"./card--8RLEIGP.js";var M=class extends y{constructor(s,r){super(s,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,r){const{state:i}=s,l=super.createResult(s,r),{isFetching:o,isRefetching:n,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",h=u&&t==="backward",x=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(r,i.data),hasPreviousPage:g(r,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:h,isFetchingPreviousPage:x,isRefetchError:d&&!c&&!h,isRefetching:n&&!a&&!x}}};function A(s,r){return b(s,M)}const T=[{value:"unresolved",label:"Needs attention"},...k.map(s=>({value:s,label:F[s]})),{value:"all",label:"Everything"}];function C(s,r=new Date){const i=new Date(s),l=n=>new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),o=Math.round((l(r)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function I(){const s=R(),{status:r="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),n=A(P(r,i)),u=n.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=C(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(w,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[T.map(t=>e.jsx(m,{size:"sm",variant:r===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),n.isPending&&e.jsx(N,{rows:4}),n.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),n.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":r==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(j,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(S,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:E(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),n.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:n.isFetchingNextPage,onClick:()=>void n.fetchNextPage(),children:n.isFetchingNextPage?"Reading…":"Show older"})})]})}export{I as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,i as b,k as f,j as d,h as m}from"./index-
|
|
1
|
+
import{r as a,i as b,k as f,j as d,h as m}from"./index-COORBw3J.js";import{w as A}from"./dialog-D0b9dX2m.js";const x=a.createContext(void 0);function k(){const e=a.useContext(x);if(e===void 0)throw new Error(b(13));return e}const g={imageLoadingStatus:()=>null},z=a.forwardRef(function(t,r){const{className:v,render:p,style:s,...c}=t,[n,o]=a.useState("idle"),i={imageLoadingStatus:n},u=a.useMemo(()=>({imageLoadingStatus:n,setImageLoadingStatus:o}),[n,o]),l=f("span",t,{state:i,ref:r,props:c,stateAttributesMapping:g});return d.jsx(x.Provider,{value:u,children:l})}),R=a.forwardRef(function(t,r){const{className:v,render:p,delay:s=0,style:c,...n}=t,{imageLoadingStatus:o}=k(),[i,u]=a.useState(s===0),l=A();return a.useEffect(()=>(s>0?l.start(s,()=>u(!0)):u(!0),l.clear),[l,s]),f("span",t,{state:{imageLoadingStatus:o},ref:r,props:n,stateAttributesMapping:g,enabled:o!=="loaded"&&(s===0||i)})});function h({className:e,size:t="default",...r}){return d.jsx(z,{"data-slot":"avatar","data-size":t,className:m("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...r})}function w({className:e,...t}){return d.jsx(R,{"data-slot":"avatar-fallback",className:m("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{h as A,w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a,h as n,o}from"./index-
|
|
1
|
+
import{m as a,h as n,o}from"./index-COORBw3J.js";import{u as d}from"./useRender-Bu6Vyu1g.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,h as t}from"./index-
|
|
1
|
+
import{j as s,h as t}from"./index-COORBw3J.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as zn,ax as Z,l as Pe,ay as mt,aF as oe,aY as bt,r as l,aK as Jn,a8 as ke,f as K,n as Ze,e as N,i as zt,k as Ae,a9 as Qn,j as I,aa as Jt,E as ve,aZ as Zn,ab as Pt,g as et,aB as ot,aA as er,a_ as tr,a$ as Qt,b0 as nr,aG as rr,B as Zt,h as Fe}from"./index-
|
|
1
|
+
import{c as zn,ax as Z,l as Pe,ay as mt,aF as oe,aY as bt,r as l,aK as Jn,a8 as ke,f as K,n as Ze,e as N,i as zt,k as Ae,a9 as Qn,j as I,aa as Jt,E as ve,aZ as Zn,ab as Pt,g as et,aB as ot,aA as er,a_ as tr,a$ as Qt,b0 as nr,aG as rr,B as Zt,h as Fe}from"./index-COORBw3J.js";import{a as A,o as U,m as ge,c as Se,B as or,u as en,s as tn,y as yt,b as nn,w as rn,g as Ee,t as on,q as sn,n as sr,p as ir,i as ar}from"./label-Ds2CYKth.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as zn,r as u,k as Fe,E as tt,av as qt,l as se,aw as $e,g as Pe,ax as ke,ay as We,az as on,aA as lt,aB as Et,aC as Vo,aD as Un,aE as Wo,aF as rn,aG as Kn,aH as Dt,aI as Gn,aJ as En,n as Ct,aa as Yn,e as de,a8 as Xn,f as pe,aK as qn,i as ze,ac as jo,a9 as Qn,m as it,ab as $o,j as Q,aL as zo,h as ut}from"./index-
|
|
1
|
+
import{c as zn,r as u,k as Fe,E as tt,av as qt,l as se,aw as $e,g as Pe,ax as ke,ay as We,az as on,aA as lt,aB as Et,aC as Vo,aD as Un,aE as Wo,aF as rn,aG as Kn,aH as Dt,aI as Gn,aJ as En,n as Ct,aa as Yn,e as de,a8 as Xn,f as pe,aK as qn,i as ze,ac as jo,a9 as Qn,m as it,ab as $o,j as Q,aL as zo,h as ut}from"./index-COORBw3J.js";import{C as Uo}from"./check-XHwuM5zg.js";import{i as Je,Q as Qt,w as _e,S as Jn,U as Zn,V as Ko,W as ft,Y as Tt,Z as eo,_ as to,a as Te,$ as Go,a0 as Mt,a1 as Yo,a2 as Xo,T as Jt,a3 as Lt,a4 as qo,a5 as Zt,v as Re,a6 as Qo,a7 as Jo,a8 as Zo,a9 as Cn,aa as Ut,ab as Tn,ac as Ne,ad as mt,ae as er,af as Nt,ag as Ht,ah as no,ai as sn,aj as tr,ak as nr,al as or,am as rr,C as sr,O as ir,A as oo,an as cr,B as ar,ao as lr,ap as ur,aq as fr,ar as dr,as as pr,z as gr,at as mr,au as hr,av as xr,N as yr,R as vr,p as Rr,aw as ro,j as br,P as wr,l as Er,ax as so,m as Cr,n as Tr,ay as Mr,az as Or,aA as Sr,q as Pr,aB as Ir,F as Ar,r as kr,o as Fr,aC as Dr,aD as Lr,aE as Nr,aF as Hr,aG as Br,aH as _r,s as Vr,t as Wr,aI as Mn,aJ as On,aK as jr}from"./dialog-D0b9dX2m.js";import{t as cn,g as nt,c as ie,m as ct,o as Se,a as le,p as at,q as io,b as be,r as en,s as Ot,v as an,u as Bt,w as $r,x as st,k as zr,y as Sn,i as Ur,z as Kr}from"./label-Ds2CYKth.js";import{u as co,a as ao,C as Gr,b as Yr}from"./CompositeItem-Yi3wWYM7.js";import{u as Xr}from"./useValueChanged-CHzVruZ0.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|