@superclawd-ai/pipelines 0.1.86 → 0.1.88
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.
|
@@ -584,7 +584,7 @@ You can add a description to the \`${uu}\` by passing a \`${QM}\` component as a
|
|
|
584
584
|
|
|
585
585
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${uu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
586
586
|
|
|
587
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},sle=VM,ole=WM,nP=qM,rP=YM,aP=JM,iP=tP,sP=XM,oP=ZM;const lle=sle,ule=ole,lP=x.forwardRef(({className:e,...t},n)=>i.jsx(nP,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));lP.displayName=nP.displayName;const iN=x.createContext(null);function uP(e){let t=!1;return x.Children.forEach(e,n=>{var a,s;if(t||!x.isValidElement(n))return;if(((a=n.type)==null?void 0:a.displayName)==="AlertDialogBody"){t=!0;return}const r=(s=n.props)==null?void 0:s.children;r!=null&&uP(r)&&(t=!0)}),t}const cP=x.forwardRef(({className:e,children:t,...n},r)=>{const a=x.useMemo(()=>uP(t),[t]),[s,l]=x.useState(!0),[u,d]=x.useState(!0),p=x.useCallback((h,b)=>{l(h),d(b)},[]),m=x.useMemo(()=>({hasBody:a,atTop:s,atBottom:u,setEdges:p}),[a,s,u,p]);return i.jsxs(ule,{children:[i.jsx(lP,{}),i.jsx(iN.Provider,{value:m,children:i.jsx(rP,{ref:r,tabIndex:-1,onOpenAutoFocus:h=>{var b;h.preventDefault(),(b=h.currentTarget)==null||b.focus()},className:xe("fixed left-[50%] top-[50%] z-50 w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-200 focus:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a?"flex max-h-[90vh] flex-col gap-0 overflow-hidden":"grid gap-4",e),...n,children:t})})]})});cP.displayName=rP.displayName;const dP=({className:e,...t})=>{const n=x.useContext(iN),r=!!(n!=null&&n.hasBody);return i.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",r&&"-mx-6 -mt-6 border-b border-transparent bg-black/20 px-6 pb-4 pt-6 transition-[border-color,box-shadow] dark:bg-black/30",r&&!(n!=null&&n.atTop)&&"border-border shadow-sm",e),...t})};dP.displayName="AlertDialogHeader";const pP=({className:e,...t})=>{const n=x.useContext(iN),r=!!(n!=null&&n.hasBody);return i.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r&&"-mx-6 -mb-6 border-t border-transparent bg-black/20 px-6 pb-6 pt-4 transition-[border-color] dark:bg-black/30",r&&!(n!=null&&n.atBottom)&&"border-border",e),...t})};pP.displayName="AlertDialogFooter";const fP=x.forwardRef(({className:e,...t},n)=>i.jsx(sP,{ref:n,className:xe("text-lg font-semibold",e),...t}));fP.displayName=sP.displayName;const mP=x.forwardRef(({className:e,...t},n)=>i.jsx(oP,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));mP.displayName=oP.displayName;const hP=x.forwardRef(({className:e,...t},n)=>i.jsx(aP,{ref:n,className:xe(fh(),e),...t}));hP.displayName=aP.displayName;const gP=x.forwardRef(({className:e,...t},n)=>i.jsx(iP,{ref:n,className:xe(fh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gP.displayName=iP.displayName;function Ru({open:e,onOpenChange:t,onConfirm:n,title:r,description:a,confirmLabel:s="Confirm",cancelLabel:l="Cancel",destructive:u=!1}){return i.jsx(lle,{open:e,onOpenChange:t,children:i.jsxs(cP,{className:"sm:max-w-md",children:[i.jsxs(dP,{children:[i.jsx(fP,{children:r}),a&&i.jsx(mP,{children:a})]}),i.jsxs(pP,{children:[i.jsx(gP,{children:l}),i.jsx(hP,{onClick:n,className:xe(u&&fh({variant:"destructive"})),children:s})]})]})})}function Mn({className:e,...t}){return i.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}function cle(e){if(!e)return"never";const t=new Date(e).getTime();if(Number.isNaN(t))return"never";const n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const a=Math.round(r/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}const dle=[{provider:"linear",label:"Linear",enabled:!0},{provider:"jira",label:"Jira",enabled:!0},{provider:"asana",label:"Asana",enabled:!0},{provider:"clickup",label:"ClickUp",enabled:!0},{provider:"monday",label:"Monday",enabled:!0}];function ple(){const{data:e,isLoading:t}=oh(),{data:n}=Kx(),r=new Set((n??[]).map(m=>m.id)),[a,s]=x.useState(null),[l,u]=x.useState(null),[d,p]=x.useState(null);return i.jsxs("div",{className:"max-w-5xl",children:[r.size===0&&i.jsxs("div",{className:"mb-4 flex items-center gap-3 rounded-lg border border-amber-500/25 bg-amber-500/10 px-3 py-2.5 text-sm text-amber-200",children:[i.jsx(Su,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:"flex-1",children:"No workspace is connected — you can't add connections, and existing boards and scheduled runs are paused until you connect one."}),i.jsx(Ar,{to:"/settings/workspaces",className:"shrink-0 rounded-md bg-amber-400/20 px-2.5 py-1 text-xs font-medium text-amber-100 hover:bg-amber-400/30",children:"Connect a workspace"})]}),i.jsxs("header",{className:"mb-4 flex items-center justify-between gap-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect your issue trackers. Each connection runs under one SuperClawd workspace."}),r.size>0&&i.jsx(fle,{onPick:u})]}),t?i.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2].map(m=>i.jsx("div",{className:"rounded-lg border bg-card p-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Mn,{className:"h-5 w-14"}),i.jsx(Mn,{className:"h-4 w-48"}),i.jsx(Mn,{className:"ml-auto h-8 w-24"})]})},m))}):((e==null?void 0:e.length)??0)===0?i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed bg-card py-16 text-center",children:[i.jsx(My,{className:"mb-3 h-8 w-8 text-muted-foreground"}),i.jsx("p",{className:"text-sm font-medium",children:"No connections yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect a tool to start syncing tickets."})]}):i.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:e==null?void 0:e.map(m=>i.jsx(mle,{conn:m,wsDisconnected:m.linkStatus==="linked"&&!!m.workspaceId&&!r.has(m.workspaceId),onLink:()=>s(m),onRename:()=>p(m)},m.id))}),a&&i.jsx(J2,{conn:a,onClose:()=>s(null)}),l&&i.jsx(J2,{newProvider:l,onClose:()=>u(null)}),d&&i.jsx(hle,{conn:d,onClose:()=>p(null)})]})}function fle({onPick:e}){return i.jsxs(Bn,{children:[i.jsx(Un,{asChild:!0,children:i.jsxs(te,{size:"sm",children:[i.jsx(Hr,{className:"mr-1 h-4 w-4"})," Connect a tool",i.jsx(Yi,{className:"ml-1 h-4 w-4"})]})}),i.jsxs(Ln,{align:"end",className:"w-52",children:[i.jsx(ed,{children:"Connect a tool"}),i.jsx(dr,{}),dle.map(t=>i.jsxs(ft,{disabled:!t.enabled,onSelect:()=>e(t.provider),children:[t.label,!t.enabled&&i.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"soon"})]},t.provider))]})]})}function mle({conn:e,wsDisconnected:t,onLink:n,onRename:r}){var d,p;const a=Sd(e.provider),s=e.authStatus==="expired"||e.authStatus==="needs_refresh",l=DI(),u=async()=>{const m=await l.mutateAsync(e.id);m.url&&(window.location.href=m.url)};return i.jsx("li",{className:xe("p-3 text-sm transition-colors hover:bg-accent/50",t&&"opacity-55"),children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(wi,{variant:"outline",className:xe("px-1.5 py-0 text-[10px]",a.className),children:a.label}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"font-medium",children:((d=e.displayName)==null?void 0:d.trim())||e.providerAccountName}),((p=e.displayName)==null?void 0:p.trim())&&e.providerAccountName&&e.providerAccountName.toLowerCase()!==e.provider.toLowerCase()&&e.providerAccountName!==e.displayName.trim()&&i.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.providerAccountName})]}),i.jsx("div",{className:"ml-auto flex items-center gap-2",children:t?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-xs text-muted-foreground",children:["ws:"," ",i.jsx("span",{className:"text-foreground/70",children:e.workspaceName})]}),i.jsxs(Ar,{to:"/settings/workspaces",className:"flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground hover:text-foreground",title:"This workspace is disconnected — reconnect it to resume",children:[i.jsx(Go,{className:"h-3 w-3"})," workspace disconnected"]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]}):s?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"rounded-full bg-amber-500/10 px-2 py-0.5 text-xs text-amber-300",children:"🔄 session expired"}),i.jsxs(te,{size:"sm",variant:"secondary",className:"h-7 text-xs",disabled:l.isPending,onClick:u,children:[i.jsx(Ys,{className:"mr-1 h-3 w-3"})," Reconnect"]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]}):e.linkStatus==="unlinked"?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-xs text-amber-300",children:[i.jsx(Su,{className:"h-3 w-3"})," needs a workspace"]}),i.jsxs(te,{size:"sm",variant:"secondary",className:"h-7 text-xs",onClick:n,children:[i.jsx(Go,{className:"mr-1 h-3 w-3"})," Link workspace",i.jsx(Yi,{className:"ml-1 h-3 w-3"})]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]}):i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-xs text-muted-foreground",children:["ws:"," ",i.jsx("span",{className:"text-foreground",children:e.workspaceName}),e.provider!=="local"&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"mx-1.5",children:"·"}),"synced ",cle(e.lastSyncedAt)]})]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]})})]})})}function Qf({conn:e,onRename:t,onEdit:n}){const r=e.provider==="local",a=e.linkStatus==="linked",s=e.displayName||e.providerAccountName,l=Jx(),u=W7(),[d,p]=x.useState(null);return i.jsxs(i.Fragment,{children:[i.jsxs(Bn,{children:[i.jsx(Un,{asChild:!0,children:i.jsxs(te,{size:"icon",variant:"ghost",className:"h-7 w-7",children:[i.jsx(ma,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Connection actions"})]})}),i.jsxs(Ln,{align:"end",className:"w-40",children:[i.jsx(ft,{onSelect:()=>t(),children:"Rename"}),!r&&i.jsxs(i.Fragment,{children:[i.jsx(ft,{onSelect:()=>n(),children:"Edit"}),a&&i.jsx(ft,{onSelect:()=>p("unlink"),children:"Unlink"}),i.jsx(dr,{}),i.jsx(ft,{className:"text-red-400",onSelect:()=>p("disconnect"),children:"Disconnect"})]})]})]}),i.jsx(Ru,{open:d==="unlink",onOpenChange:m=>!m&&p(null),onConfirm:()=>l.mutate({id:e.id,unlink:!0}),title:`Unlink “${s}”?`,description:"It stays connected to its tool but won't run under any workspace until you link it again.",confirmLabel:"Unlink"}),i.jsx(Ru,{open:d==="disconnect",onOpenChange:m=>!m&&p(null),onConfirm:()=>u.mutate(e.id),title:`Disconnect “${s}”?`,description:"This removes the board and its imported tickets. This can't be undone.",confirmLabel:"Disconnect",destructive:!0})]})}function hle({conn:e,onClose:t}){const n=Jx(),[r,a]=x.useState(e.displayName??"");async function s(){await n.mutateAsync({id:e.id,name:r.trim()}),t()}return i.jsx(It,{open:!0,onOpenChange:l=>!l&&t(),children:i.jsxs(Ct,{className:"sm:max-w-md",children:[i.jsxs(At,{children:[i.jsx(_t,{children:"Rename board"}),i.jsx(Gt,{children:"Give this board a friendly name (leave blank to clear it)."})]}),i.jsx(Ot,{children:i.jsx(xn,{autoFocus:!0,value:r,onChange:l=>a(l.target.value),placeholder:e.providerAccountName,onKeyDown:l=>{l.key==="Enter"&&s()}})}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:t,children:"Cancel"}),i.jsxs(te,{onClick:s,disabled:n.isPending,children:[n.isPending&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),"Save"]})]})]})})}function J2({conn:e,newProvider:t,onClose:n}){var B,ae,j;const{data:r}=Kx(),{data:a}=oh(),s=G7(),l=V7(),u=Jx(),[d,p]=x.useState((e==null?void 0:e.displayName)??""),[m,h]=x.useState((e==null?void 0:e.workspaceId)??void 0),[b,g]=x.useState(null),[E,T]=x.useState(((B=e==null?void 0:e.syncFilters)==null?void 0:B.labels)??[]),[w,N]=x.useState(""),[k,A]=x.useState(!!((ae=e==null?void 0:e.syncFilters)!=null&&ae.assignedToMe)),[_,I]=x.useState(((j=e==null?void 0:e.syncFilters)==null?void 0:j.assignee)??""),[O,R]=x.useState(!!(e!=null&&e.autoIngestTickets)),F=3;function z(){const pe=w.trim();!pe||E.length>=F||E.includes(pe)||(T(oe=>[...oe,pe]),N(""))}const M=3,Q=new Map;for(const pe of a??[])pe.provider==="local"||pe.linkStatus!=="linked"||!pe.workspaceId||e&&pe.id===e.id||Q.set(pe.workspaceId,(Q.get(pe.workspaceId)??0)+1);const q=pe=>(Q.get(pe)??0)>=M,re=!!e&&e.linkStatus==="linked",G=t??(e==null?void 0:e.provider),$=G?JV(G):{labels:!1,assignee:!1},ee=G==="linear"?"Linear":G==="jira"?"Jira":G==="asana"?"Asana":G==="clickup"?"ClickUp":G==="monday"?"Monday":"tool",ce=t?`Connect ${ee}`:re?"Edit connection":`Set up “${e.providerAccountName}”`,W=s.isPending||l.isPending||u.isPending;async function X(){if(!m)return;g(null);const pe=G!=="local"?{labels:E,assignedToMe:k,assignee:_}:void 0,oe=G!=="local"?O:void 0;if(t){const fe=await l.mutateAsync({provider:t,name:d.trim()||void 0,workspaceId:m,syncFilters:pe,autoIngestTickets:oe});if(fe.url){window.location.href=fe.url;return}if(fe.message){g(fe.message);return}n()}else try{const fe={id:e.id,workspaceId:m,name:d.trim()||void 0};re?await u.mutateAsync({...fe,syncFilters:pe,autoIngestTickets:oe}):await s.mutateAsync({...fe,syncFilters:pe,autoIngestTickets:oe}),n()}catch{g("Couldn't save — that workspace may already have the maximum connections.")}}const D=pe=>pe.tier==="paid"?"paid":"free · limited";return i.jsx(It,{open:!0,onOpenChange:pe=>!pe&&n(),children:i.jsxs(Ct,{className:"sm:max-w-md",children:[i.jsxs(At,{children:[i.jsx(_t,{children:ce}),i.jsx(Gt,{children:"Name this board and choose the workspace it runs under."})]}),i.jsxs(Ot,{className:"space-y-4",children:[b&&i.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[i.jsx(Su,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:b})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(St,{htmlFor:"board-name",children:"Board name"}),i.jsx(xn,{id:"board-name",value:d,onChange:pe=>p(pe.target.value),placeholder:`${ee} board`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(St,{children:"Workspace"}),i.jsxs(ur,{value:m,onValueChange:h,children:[i.jsx(Qn,{children:i.jsx(cr,{placeholder:"Choose a workspace"})}),i.jsx(Zn,{children:r==null?void 0:r.map(pe=>{const oe=q(pe.id);return i.jsxs(kt,{value:pe.id,disabled:oe,children:[pe.name,i.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",oe?`full · ${M} connections`:D(pe),")"]})]},pe.id)})})]})]}),G!=="local"&&($.labels||$.assignee)&&i.jsxs("div",{className:"space-y-3 border-t pt-4",children:[i.jsxs("div",{children:[i.jsx(St,{children:"Sync filters"}),i.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Optional — only pull matching tickets. Leave empty to sync everything."})]}),$.labels&&i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs(St,{className:"text-xs font-normal text-muted-foreground",children:["Labels (any of, up to ",F,")"]}),E.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5 pb-0.5",children:E.map(pe=>i.jsxs("span",{className:"flex items-center gap-1 rounded-md border bg-muted px-2 py-1 text-xs",children:[i.jsx("span",{className:"max-w-[160px] truncate",children:pe}),i.jsx("button",{type:"button",onClick:()=>T(oe=>oe.filter(fe=>fe!==pe)),className:"text-muted-foreground hover:text-foreground",children:i.jsx(Zi,{className:"h-3 w-3"})})]},pe))}),E.length<F&&i.jsx(xn,{value:w,onChange:pe=>N(pe.target.value),onKeyDown:pe=>{(pe.key==="Enter"||pe.key===",")&&(pe.preventDefault(),z())},onBlur:z,placeholder:"Type a label, press Enter"})]}),$.assignee&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(St,{htmlFor:"assigned-to-me",className:"text-xs font-normal text-muted-foreground",children:"Assigned to me"}),i.jsx(Ia,{id:"assigned-to-me",checked:k,onCheckedChange:A})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(St,{className:"text-xs font-normal text-muted-foreground",children:"Assignee (email or name)"}),i.jsx(xn,{value:_,onChange:pe=>I(pe.target.value),disabled:k,placeholder:k?"Using “me”":"jane@acme.com"})]})]})]}),G!=="local"&&i.jsx("div",{className:"border-t pt-4",children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(St,{htmlFor:"auto-ingest",children:"Auto-ingest tickets"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically pull newly found tickets (matching the filters above) into the backlog. When off, import them manually from the board."})]}),i.jsx(Ia,{id:"auto-ingest",checked:O,onCheckedChange:R})]})})]}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:n,children:"Cancel"}),i.jsxs(te,{onClick:X,disabled:!m||W,children:[W&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),t?"Continue":re?"Save":"Link"]})]})]})})}const gle="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eR=[],tR={allowDangerousHtml:!0},ble=/^(https?|ircs?|mailto|xmpp)$/i,yle=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xle(e){const t=Ele(e),n=vle(e);return wle(t.runSync(t.parse(n),n),e)}function Ele(e){const t=e.rehypePlugins||eR,n=e.remarkPlugins||eR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tR}:tR;return GT().use(z6).use(n).use(W6,r).use(t)}function vle(e){const t=e.children||"",n=new Dd;return typeof t=="string"&&(n.value=t),n}function wle(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,s=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Sle;for(const m of yle)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+gle+m.id,void 0);return yr(e,p),N6(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function p(m,h,b){if(m.type==="raw"&&b&&typeof h=="number")return l?b.children.splice(h,1):b.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let g;for(g in su)if(Object.hasOwn(su,g)&&Object.hasOwn(m.properties,g)){const E=m.properties[g],T=su[g];(T===null||T.includes(m.tagName))&&(m.properties[g]=d(String(E||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(m,h,b)),g&&b&&typeof h=="number")return u&&m.children?b.children.splice(h,1,...m.children):b.children.splice(h,1),h}}}function Sle(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||ble.test(e.slice(0,t))?e:""}const nR="text-primary underline underline-offset-2 hover:opacity-80",Tle={p:({children:e})=>i.jsx("p",{className:"my-2 leading-relaxed",children:e}),h1:({children:e})=>i.jsx("h1",{className:"mb-2 mt-4 text-lg font-semibold",children:e}),h2:({children:e})=>i.jsx("h2",{className:"mb-2 mt-4 text-base font-semibold",children:e}),h3:({children:e})=>i.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold",children:e}),ul:({children:e})=>i.jsx("ul",{className:"my-2 list-disc space-y-1 pl-5",children:e}),ol:({children:e})=>i.jsx("ol",{className:"my-2 list-decimal space-y-1 pl-5",children:e}),li:({children:e})=>i.jsx("li",{className:"leading-relaxed",children:e}),a:({children:e,href:t})=>t!=null&&t.startsWith("/")?i.jsx(Ar,{to:t,className:nR,children:e}):i.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:nR,children:e}),strong:({children:e})=>i.jsx("strong",{className:"font-semibold",children:e}),blockquote:({children:e})=>i.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-muted-foreground",children:e}),hr:()=>i.jsx("hr",{className:"my-4 border-border"}),code:({className:e,children:t,...n})=>/language-/.test(e??"")?i.jsx("code",{className:xe("font-mono text-[13px]",e),...n,children:t}):i.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[13px]",children:t}),pre:({children:e})=>i.jsx("pre",{className:"my-3 overflow-x-auto rounded-lg border bg-muted/50 p-3 text-[13px] leading-relaxed",children:e}),table:({children:e})=>i.jsx("div",{className:"my-3 overflow-x-auto",children:i.jsx("table",{className:"w-full border-collapse text-sm",children:e})}),th:({children:e})=>i.jsx("th",{className:"border border-border px-2 py-1 text-left font-semibold",children:e}),td:({children:e})=>i.jsx("td",{className:"border border-border px-2 py-1",children:e})};function gl({children:e,className:t}){return i.jsx("div",{className:xe("text-sm [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:i.jsx(xle,{remarkPlugins:[gM],components:Tle,children:e})})}function bP({parent:e}){const{data:t,isLoading:n}=CI(e),[r,a]=x.useState(null),[s,l]=x.useState(null);return n?i.jsx(Mn,{className:"h-24 w-full"}):t!=null&&t.length?i.jsxs("div",{className:"space-y-1",children:[t.map(u=>{const d=u.author==="assistant",p=!!u.updatedAt&&u.updatedAt!==u.createdAt;return i.jsxs("div",{className:"group -mx-3 flex items-start gap-3 rounded-lg px-4 py-2.5 transition-colors hover:bg-muted/40",children:[i.jsx("div",{className:xe("mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full",d?"bg-primary/15 text-primary":"bg-muted text-foreground"),children:d?i.jsx(qx,{className:"h-4 w-4"}):i.jsx(i7,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"font-medium text-foreground",children:d?"AI":"Me"}),i.jsx("span",{children:new Date(u.createdAt).toLocaleString()}),p&&i.jsx("span",{title:`Edited ${new Date(u.updatedAt).toLocaleString()}`,children:"(edited)"})]}),i.jsx("div",{className:"mt-0.5",children:i.jsx(gl,{children:u.body})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2.5 self-center pr-1 opacity-0 transition-opacity group-hover:opacity-100",children:[!d&&i.jsx("button",{type:"button",onClick:()=>a(u),className:"text-muted-foreground/60 hover:text-foreground",title:"Edit note",children:i.jsx(_r,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>l(u),className:"text-muted-foreground/60 hover:text-destructive",title:"Delete note",children:i.jsx(Rr,{className:"h-3.5 w-3.5"})})]})]},u.id)}),r&&i.jsx(kle,{parent:e,note:r,onClose:()=>a(null)}),s&&i.jsx(Nle,{parent:e,note:s,onClose:()=>l(null)})]}):i.jsx("div",{className:"rounded-lg border border-dashed bg-muted/20 px-4 py-10 text-center text-sm text-muted-foreground",children:"No notes yet — add one below."})}function Nle({parent:e,note:t,onClose:n}){const r=A7(e);async function a(){await r.mutateAsync(t.id),n()}return i.jsx(It,{open:!0,onOpenChange:s=>!s&&n(),children:i.jsxs(Ct,{className:"sm:max-w-md",children:[i.jsxs(At,{children:[i.jsx(_t,{children:"Delete this note?"}),i.jsx(Gt,{children:"This permanently removes the note — it can't be undone."})]}),i.jsx(Ot,{children:i.jsx("p",{className:"line-clamp-4 whitespace-pre-wrap rounded-md border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:t.body})}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:n,children:"Cancel"}),i.jsxs(te,{variant:"destructive",onClick:a,disabled:r.isPending,children:[r.isPending&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),"Delete"]})]})]})})}function kle({parent:e,note:t,onClose:n}){const r=C7(e),[a,s]=x.useState(t.body),l=!!a.trim()&&a.trim()!==t.body&&!r.isPending;async function u(){l&&(await r.mutateAsync({id:t.id,body:a.trim()}),n())}return i.jsx(It,{open:!0,onOpenChange:d=>!d&&n(),children:i.jsxs(Ct,{className:"sm:max-w-lg",children:[i.jsx(At,{children:i.jsx(_t,{children:"Edit note"})}),i.jsx(Ot,{children:i.jsx("textarea",{autoFocus:!0,value:a,onChange:d=>s(d.target.value),rows:5,className:"w-full resize-y rounded-md border bg-transparent px-3 py-2 text-sm outline-none focus:border-ring"})}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:n,children:"Cancel"}),i.jsxs(te,{onClick:u,disabled:!l,children:[r.isPending&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),"Save"]})]})]})})}function yP({parent:e}){const t=k7(e),[n,r]=x.useState(""),a=x.useRef(null),{supported:s,listening:l,preparing:u,transcribing:d,toggle:p}=vg(()=>n,b=>r(b)),m=!!n.trim()&&!t.isPending;x.useEffect(()=>{const b=a.current;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,200)}px`)},[n]);async function h(){m&&(await t.mutateAsync(n.trim()),r(""))}return i.jsx("div",{className:"border-t border-border pt-4",children:i.jsxs("div",{className:"rounded-xl border bg-card/50 focus-within:border-ring",children:[i.jsx("textarea",{ref:a,value:n,onChange:b=>r(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),h())},rows:1,placeholder:"Add a note…",className:"max-h-[200px] w-full resize-none bg-transparent px-3 py-2.5 text-sm outline-none placeholder:text-muted-foreground"}),i.jsxs("div",{className:"flex items-center justify-end gap-1 px-2 pb-2",children:[s&&(u?i.jsxs("span",{className:"flex h-7 items-center gap-1.5 whitespace-nowrap rounded-md px-2 text-xs text-muted-foreground",title:"Downloading the transcription model — one-time",children:[i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}),"Downloading transcription model…"]}):i.jsxs(te,{size:"icon",variant:"ghost",className:xe("h-7 w-7 text-muted-foreground hover:text-foreground",l&&"bg-red-500/15 text-red-400 hover:text-red-400"),onClick:()=>void p(),disabled:d,title:d?"Transcribing…":l?"Stop dictation":"Dictate",children:[d?i.jsx(Xe,{className:"h-4 w-4 animate-spin"}):i.jsx(rh,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Dictate"})]})),i.jsx(te,{size:"icon",className:"h-7 w-7",disabled:!m,onClick:h,title:"Note",children:t.isPending?i.jsx(Xe,{className:"h-4 w-4 animate-spin"}):i.jsx(th,{className:"h-4 w-4"})})]})]})})}function Cle({parent:e}){return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden",children:i.jsx(bP,{parent:e})}),i.jsx("div",{className:"shrink-0 pt-4",children:i.jsx(yP,{parent:e})})]})}const gp=[{value:"haiku",label:"Haiku"},{value:"sonnet",label:"Sonnet"},{value:"opus",label:"Opus"},{value:"fable",label:"Fable"}],bp=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Very high"},{value:"max",label:"Max"}],qm="opus",Ym="high",sN=e=>{var t;return((t=gp.find(n=>n.value===e))==null?void 0:t.label)??(e||"—")},oN=e=>{var t;return((t=bp.find(n=>n.value===e))==null?void 0:t.label)??(e||"—")};function Tg({model:e,effort:t,className:n}){return!e&&!t?null:i.jsxs("span",{className:n,children:[sN(e)," · ",oN(t)]})}function el({value:e,onChange:t,options:n,id:r,className:a}){return i.jsxs(ur,{value:e,onValueChange:t,children:[i.jsx(Qn,{id:r,className:a,children:i.jsx(cr,{})}),i.jsx(Zn,{children:n.map(s=>i.jsx(kt,{value:s.value,children:s.label},s.value))})]})}const rR=`
|
|
587
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},sle=VM,ole=WM,nP=qM,rP=YM,aP=JM,iP=tP,sP=XM,oP=ZM;const lle=sle,ule=ole,lP=x.forwardRef(({className:e,...t},n)=>i.jsx(nP,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));lP.displayName=nP.displayName;const iN=x.createContext(null);function uP(e){let t=!1;return x.Children.forEach(e,n=>{var a,s;if(t||!x.isValidElement(n))return;if(((a=n.type)==null?void 0:a.displayName)==="AlertDialogBody"){t=!0;return}const r=(s=n.props)==null?void 0:s.children;r!=null&&uP(r)&&(t=!0)}),t}const cP=x.forwardRef(({className:e,children:t,...n},r)=>{const a=x.useMemo(()=>uP(t),[t]),[s,l]=x.useState(!0),[u,d]=x.useState(!0),p=x.useCallback((h,b)=>{l(h),d(b)},[]),m=x.useMemo(()=>({hasBody:a,atTop:s,atBottom:u,setEdges:p}),[a,s,u,p]);return i.jsxs(ule,{children:[i.jsx(lP,{}),i.jsx(iN.Provider,{value:m,children:i.jsx(rP,{ref:r,tabIndex:-1,onOpenAutoFocus:h=>{var b;h.preventDefault(),(b=h.currentTarget)==null||b.focus()},className:xe("fixed left-[50%] top-[50%] z-50 w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-200 focus:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a?"flex max-h-[90vh] flex-col gap-0 overflow-hidden":"grid gap-4",e),...n,children:t})})]})});cP.displayName=rP.displayName;const dP=({className:e,...t})=>{const n=x.useContext(iN),r=!!(n!=null&&n.hasBody);return i.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",r&&"-mx-6 -mt-6 border-b border-transparent bg-black/20 px-6 pb-4 pt-6 transition-[border-color,box-shadow] dark:bg-black/30",r&&!(n!=null&&n.atTop)&&"border-border shadow-sm",e),...t})};dP.displayName="AlertDialogHeader";const pP=({className:e,...t})=>{const n=x.useContext(iN),r=!!(n!=null&&n.hasBody);return i.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r&&"-mx-6 -mb-6 border-t border-transparent bg-black/20 px-6 pb-6 pt-4 transition-[border-color] dark:bg-black/30",r&&!(n!=null&&n.atBottom)&&"border-border",e),...t})};pP.displayName="AlertDialogFooter";const fP=x.forwardRef(({className:e,...t},n)=>i.jsx(sP,{ref:n,className:xe("text-lg font-semibold",e),...t}));fP.displayName=sP.displayName;const mP=x.forwardRef(({className:e,...t},n)=>i.jsx(oP,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));mP.displayName=oP.displayName;const hP=x.forwardRef(({className:e,...t},n)=>i.jsx(aP,{ref:n,className:xe(fh(),e),...t}));hP.displayName=aP.displayName;const gP=x.forwardRef(({className:e,...t},n)=>i.jsx(iP,{ref:n,className:xe(fh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gP.displayName=iP.displayName;function Ru({open:e,onOpenChange:t,onConfirm:n,title:r,description:a,confirmLabel:s="Confirm",cancelLabel:l="Cancel",destructive:u=!1}){return i.jsx(lle,{open:e,onOpenChange:t,children:i.jsxs(cP,{className:"sm:max-w-md",children:[i.jsxs(dP,{children:[i.jsx(fP,{children:r}),a&&i.jsx(mP,{children:a})]}),i.jsxs(pP,{children:[i.jsx(gP,{children:l}),i.jsx(hP,{onClick:n,className:xe(u&&fh({variant:"destructive"})),children:s})]})]})})}function Mn({className:e,...t}){return i.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}function cle(e){if(!e)return"never";const t=new Date(e).getTime();if(Number.isNaN(t))return"never";const n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const a=Math.round(r/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}const dle=[{provider:"linear",label:"Linear",enabled:!0},{provider:"jira",label:"Jira",enabled:!0},{provider:"asana",label:"Asana",enabled:!0},{provider:"clickup",label:"ClickUp",enabled:!0},{provider:"monday",label:"Monday",enabled:!0}];function ple(){const{data:e,isLoading:t}=oh(),{data:n}=Kx(),r=new Set((n??[]).map(m=>m.id)),[a,s]=x.useState(null),[l,u]=x.useState(null),[d,p]=x.useState(null);return i.jsxs("div",{className:"max-w-5xl",children:[r.size===0&&i.jsxs("div",{className:"mb-4 flex items-center gap-3 rounded-lg border border-amber-500/25 bg-amber-500/10 px-3 py-2.5 text-sm text-amber-200",children:[i.jsx(Su,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:"flex-1",children:"No workspace is connected — you can't add connections, and existing boards and scheduled runs are paused until you connect one."}),i.jsx(Ar,{to:"/settings/workspaces",className:"shrink-0 rounded-md bg-amber-400/20 px-2.5 py-1 text-xs font-medium text-amber-100 hover:bg-amber-400/30",children:"Connect a workspace"})]}),i.jsxs("header",{className:"mb-4 flex items-center justify-between gap-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect your issue trackers. Each connection runs under one SuperClawd workspace."}),r.size>0&&i.jsx(fle,{onPick:u})]}),t?i.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2].map(m=>i.jsx("div",{className:"rounded-lg border bg-card p-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Mn,{className:"h-5 w-14"}),i.jsx(Mn,{className:"h-4 w-48"}),i.jsx(Mn,{className:"ml-auto h-8 w-24"})]})},m))}):((e==null?void 0:e.length)??0)===0?i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed bg-card py-16 text-center",children:[i.jsx(My,{className:"mb-3 h-8 w-8 text-muted-foreground"}),i.jsx("p",{className:"text-sm font-medium",children:"No connections yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect a tool to start syncing tickets."})]}):i.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:e==null?void 0:e.map(m=>i.jsx(mle,{conn:m,wsDisconnected:m.linkStatus==="linked"&&!!m.workspaceId&&!r.has(m.workspaceId),onLink:()=>s(m),onRename:()=>p(m)},m.id))}),a&&i.jsx(J2,{conn:a,onClose:()=>s(null)}),l&&i.jsx(J2,{newProvider:l,onClose:()=>u(null)}),d&&i.jsx(hle,{conn:d,onClose:()=>p(null)})]})}function fle({onPick:e}){return i.jsxs(Bn,{children:[i.jsx(Un,{asChild:!0,children:i.jsxs(te,{size:"sm",children:[i.jsx(Hr,{className:"mr-1 h-4 w-4"})," Connect a tool",i.jsx(Yi,{className:"ml-1 h-4 w-4"})]})}),i.jsxs(Ln,{align:"end",className:"w-52",children:[i.jsx(ed,{children:"Connect a tool"}),i.jsx(dr,{}),dle.map(t=>i.jsxs(ft,{disabled:!t.enabled,onSelect:()=>e(t.provider),children:[t.label,!t.enabled&&i.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"soon"})]},t.provider))]})]})}function mle({conn:e,wsDisconnected:t,onLink:n,onRename:r}){var d,p;const a=Sd(e.provider),s=e.authStatus==="expired"||e.authStatus==="needs_refresh",l=DI(),u=async()=>{const m=await l.mutateAsync(e.id);m.url&&(window.location.href=m.url)};return i.jsx("li",{className:xe("p-3 text-sm transition-colors hover:bg-accent/50",t&&"opacity-55"),children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(wi,{variant:"outline",className:xe("px-1.5 py-0 text-[10px]",a.className),children:a.label}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"font-medium",children:((d=e.displayName)==null?void 0:d.trim())||e.providerAccountName}),((p=e.displayName)==null?void 0:p.trim())&&e.providerAccountName&&e.providerAccountName.toLowerCase()!==e.provider.toLowerCase()&&e.providerAccountName!==e.displayName.trim()&&i.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.providerAccountName})]}),i.jsx("div",{className:"ml-auto flex items-center gap-2",children:t?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-xs text-muted-foreground",children:["ws:"," ",i.jsx("span",{className:"text-foreground/70",children:e.workspaceName})]}),i.jsxs(Ar,{to:"/settings/workspaces",className:"flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground hover:text-foreground",title:"This workspace is disconnected — reconnect it to resume",children:[i.jsx(Go,{className:"h-3 w-3"})," workspace disconnected"]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]}):s?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"rounded-full bg-amber-500/10 px-2 py-0.5 text-xs text-amber-300",children:"🔄 session expired"}),i.jsxs(te,{size:"sm",variant:"secondary",className:"h-7 text-xs",disabled:l.isPending,onClick:u,children:[i.jsx(Ys,{className:"mr-1 h-3 w-3"})," Reconnect"]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]}):e.linkStatus==="unlinked"?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-xs text-amber-300",children:[i.jsx(Su,{className:"h-3 w-3"})," needs a workspace"]}),i.jsxs(te,{size:"sm",variant:"secondary",className:"h-7 text-xs",onClick:n,children:[i.jsx(Go,{className:"mr-1 h-3 w-3"})," Link workspace",i.jsx(Yi,{className:"ml-1 h-3 w-3"})]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]}):i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"text-xs text-muted-foreground",children:["ws:"," ",i.jsx("span",{className:"text-foreground",children:e.workspaceName}),e.provider!=="local"&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"mx-1.5",children:"·"}),"synced ",cle(e.lastSyncedAt)]})]}),i.jsx(Qf,{conn:e,onRename:r,onEdit:n})]})})]})})}function Qf({conn:e,onRename:t,onEdit:n}){const r=e.provider==="local",a=e.linkStatus==="linked",s=e.displayName||e.providerAccountName,l=Jx(),u=W7(),[d,p]=x.useState(null);return i.jsxs(i.Fragment,{children:[i.jsxs(Bn,{children:[i.jsx(Un,{asChild:!0,children:i.jsxs(te,{size:"icon",variant:"ghost",className:"h-7 w-7",children:[i.jsx(ma,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Connection actions"})]})}),i.jsxs(Ln,{align:"end",className:"w-40",children:[i.jsx(ft,{onSelect:()=>t(),children:"Rename"}),!r&&i.jsxs(i.Fragment,{children:[i.jsx(ft,{onSelect:()=>n(),children:"Edit"}),a&&i.jsx(ft,{onSelect:()=>p("unlink"),children:"Unlink"}),i.jsx(dr,{}),i.jsx(ft,{className:"text-red-400",onSelect:()=>p("disconnect"),children:"Disconnect"})]})]})]}),i.jsx(Ru,{open:d==="unlink",onOpenChange:m=>!m&&p(null),onConfirm:()=>l.mutate({id:e.id,unlink:!0}),title:`Unlink “${s}”?`,description:"It stays connected to its tool but won't run under any workspace until you link it again.",confirmLabel:"Unlink"}),i.jsx(Ru,{open:d==="disconnect",onOpenChange:m=>!m&&p(null),onConfirm:()=>u.mutate(e.id),title:`Disconnect “${s}”?`,description:"This removes the board and its imported tickets. This can't be undone.",confirmLabel:"Disconnect",destructive:!0})]})}function hle({conn:e,onClose:t}){const n=Jx(),[r,a]=x.useState(e.displayName??"");async function s(){await n.mutateAsync({id:e.id,name:r.trim()}),t()}return i.jsx(It,{open:!0,onOpenChange:l=>!l&&t(),children:i.jsxs(Ct,{className:"sm:max-w-md",children:[i.jsxs(At,{children:[i.jsx(_t,{children:"Rename board"}),i.jsx(Gt,{children:"Give this board a friendly name (leave blank to clear it)."})]}),i.jsx(Ot,{children:i.jsx(xn,{autoFocus:!0,value:r,onChange:l=>a(l.target.value),placeholder:e.providerAccountName,onKeyDown:l=>{l.key==="Enter"&&s()}})}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:t,children:"Cancel"}),i.jsxs(te,{onClick:s,disabled:n.isPending,children:[n.isPending&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),"Save"]})]})]})})}function J2({conn:e,newProvider:t,onClose:n}){var B,ae,j;const{data:r}=Kx(),{data:a}=oh(),s=G7(),l=V7(),u=Jx(),[d,p]=x.useState((e==null?void 0:e.displayName)??""),[m,h]=x.useState((e==null?void 0:e.workspaceId)??void 0),[b,g]=x.useState(null),[E,T]=x.useState(((B=e==null?void 0:e.syncFilters)==null?void 0:B.labels)??[]),[w,N]=x.useState(""),[k,A]=x.useState(!!((ae=e==null?void 0:e.syncFilters)!=null&&ae.assignedToMe)),[_,I]=x.useState(((j=e==null?void 0:e.syncFilters)==null?void 0:j.assignee)??""),[O,R]=x.useState(!!(e!=null&&e.autoIngestTickets)),F=3;function z(){const pe=w.trim();!pe||E.length>=F||E.includes(pe)||(T(oe=>[...oe,pe]),N(""))}const M=3,Q=new Map;for(const pe of a??[])pe.provider==="local"||pe.linkStatus!=="linked"||!pe.workspaceId||e&&pe.id===e.id||Q.set(pe.workspaceId,(Q.get(pe.workspaceId)??0)+1);const q=pe=>(Q.get(pe)??0)>=M,re=!!e&&e.linkStatus==="linked",G=t??(e==null?void 0:e.provider),$=G?JV(G):{labels:!1,assignee:!1},ee=G==="linear"?"Linear":G==="jira"?"Jira":G==="asana"?"Asana":G==="clickup"?"ClickUp":G==="monday"?"Monday":"tool",ce=t?`Connect ${ee}`:re?"Edit connection":`Set up “${e.providerAccountName}”`,W=s.isPending||l.isPending||u.isPending;async function X(){if(!m)return;g(null);const pe=G!=="local"?{labels:E,assignedToMe:k,assignee:_}:void 0,oe=G!=="local"?O:void 0;if(t){const fe=await l.mutateAsync({provider:t,name:d.trim()||void 0,workspaceId:m,syncFilters:pe,autoIngestTickets:oe});if(fe.url){window.location.href=fe.url;return}if(fe.message){g(fe.message);return}n()}else try{const fe={id:e.id,workspaceId:m,name:d.trim()||void 0};re?await u.mutateAsync({...fe,syncFilters:pe,autoIngestTickets:oe}):await s.mutateAsync({...fe,syncFilters:pe,autoIngestTickets:oe}),n()}catch{g("Couldn't save — that workspace may already have the maximum connections.")}}const D=pe=>pe.tier==="paid"?"paid":"free · limited";return i.jsx(It,{open:!0,onOpenChange:pe=>!pe&&n(),children:i.jsxs(Ct,{className:"sm:max-w-md",children:[i.jsxs(At,{children:[i.jsx(_t,{children:ce}),i.jsx(Gt,{children:"Name this board and choose the workspace it runs under."})]}),i.jsxs(Ot,{className:"space-y-4",children:[b&&i.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[i.jsx(Su,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:b})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(St,{htmlFor:"board-name",children:"Board name"}),i.jsx(xn,{id:"board-name",value:d,onChange:pe=>p(pe.target.value),placeholder:`${ee} board`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(St,{children:"Workspace"}),i.jsxs(ur,{value:m,onValueChange:h,children:[i.jsx(Qn,{children:i.jsx(cr,{placeholder:"Choose a workspace"})}),i.jsx(Zn,{children:r==null?void 0:r.map(pe=>{const oe=q(pe.id);return i.jsxs(kt,{value:pe.id,disabled:oe,children:[pe.name,i.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",oe?`full · ${M} connections`:D(pe),")"]})]},pe.id)})})]})]}),G!=="local"&&($.labels||$.assignee)&&i.jsxs("div",{className:"space-y-3 border-t pt-4",children:[i.jsxs("div",{children:[i.jsx(St,{children:"Sync filters"}),i.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Optional — only pull matching tickets. Leave empty to sync everything."})]}),$.labels&&i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs(St,{className:"text-xs font-normal text-muted-foreground",children:["Labels (any of, up to ",F,")"]}),E.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5 pb-0.5",children:E.map(pe=>i.jsxs("span",{className:"flex items-center gap-1 rounded-md border bg-muted px-2 py-1 text-xs",children:[i.jsx("span",{className:"max-w-[160px] truncate",children:pe}),i.jsx("button",{type:"button",onClick:()=>T(oe=>oe.filter(fe=>fe!==pe)),className:"text-muted-foreground hover:text-foreground",children:i.jsx(Zi,{className:"h-3 w-3"})})]},pe))}),E.length<F&&i.jsx(xn,{value:w,onChange:pe=>N(pe.target.value),onKeyDown:pe=>{(pe.key==="Enter"||pe.key===",")&&(pe.preventDefault(),z())},onBlur:z,placeholder:"Type a label, press Enter"})]}),$.assignee&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(St,{htmlFor:"assigned-to-me",className:"text-xs font-normal text-muted-foreground",children:"Assigned to me"}),i.jsx(Ia,{id:"assigned-to-me",checked:k,onCheckedChange:A})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(St,{className:"text-xs font-normal text-muted-foreground",children:"Assignee (email or name)"}),i.jsx(xn,{value:_,onChange:pe=>I(pe.target.value),disabled:k,placeholder:k?"Using “me”":"jane@acme.com"})]})]})]}),G!=="local"&&i.jsx("div",{className:"border-t pt-4",children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(St,{htmlFor:"auto-ingest",children:"Auto-ingest tickets"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically pull newly found tickets (matching the filters above) into the backlog. When off, import them manually from the board."})]}),i.jsx(Ia,{id:"auto-ingest",checked:O,onCheckedChange:R})]})})]}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:n,children:"Cancel"}),i.jsxs(te,{onClick:X,disabled:!m||W,children:[W&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),t?"Continue":re?"Save":"Link"]})]})]})})}const gle="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eR=[],tR={allowDangerousHtml:!0},ble=/^(https?|ircs?|mailto|xmpp)$/i,yle=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xle(e){const t=Ele(e),n=vle(e);return wle(t.runSync(t.parse(n),n),e)}function Ele(e){const t=e.rehypePlugins||eR,n=e.remarkPlugins||eR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tR}:tR;return GT().use(z6).use(n).use(W6,r).use(t)}function vle(e){const t=e.children||"",n=new Dd;return typeof t=="string"&&(n.value=t),n}function wle(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,s=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Sle;for(const m of yle)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+gle+m.id,void 0);return yr(e,p),N6(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function p(m,h,b){if(m.type==="raw"&&b&&typeof h=="number")return l?b.children.splice(h,1):b.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let g;for(g in su)if(Object.hasOwn(su,g)&&Object.hasOwn(m.properties,g)){const E=m.properties[g],T=su[g];(T===null||T.includes(m.tagName))&&(m.properties[g]=d(String(E||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(m,h,b)),g&&b&&typeof h=="number")return u&&m.children?b.children.splice(h,1,...m.children):b.children.splice(h,1),h}}}function Sle(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||ble.test(e.slice(0,t))?e:""}const nR="text-primary underline underline-offset-2 hover:opacity-80",Tle={p:({children:e})=>i.jsx("p",{className:"my-2 leading-relaxed",children:e}),h1:({children:e})=>i.jsx("h1",{className:"mb-2 mt-4 text-lg font-semibold",children:e}),h2:({children:e})=>i.jsx("h2",{className:"mb-2 mt-4 text-base font-semibold",children:e}),h3:({children:e})=>i.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold",children:e}),ul:({children:e})=>i.jsx("ul",{className:"my-2 list-disc space-y-1 pl-5",children:e}),ol:({children:e})=>i.jsx("ol",{className:"my-2 list-decimal space-y-1 pl-5",children:e}),li:({children:e})=>i.jsx("li",{className:"leading-relaxed",children:e}),a:({children:e,href:t})=>t!=null&&t.startsWith("/")?i.jsx(Ar,{to:t,className:nR,children:e}):i.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:nR,children:e}),strong:({children:e})=>i.jsx("strong",{className:"font-semibold",children:e}),blockquote:({children:e})=>i.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-muted-foreground",children:e}),hr:()=>i.jsx("hr",{className:"my-4 border-border"}),code:({className:e,children:t,...n})=>/language-/.test(e??"")?i.jsx("code",{className:xe("font-mono text-[13px]",e),...n,children:t}):i.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[13px]",children:t}),pre:({children:e})=>i.jsx("pre",{className:"my-3 overflow-x-auto rounded-lg border bg-muted/50 p-3 text-[13px] leading-relaxed",children:e}),table:({children:e})=>i.jsx("div",{className:"my-3 overflow-x-auto",children:i.jsx("table",{className:"w-full border-collapse text-sm",children:e})}),th:({children:e})=>i.jsx("th",{className:"border border-border px-2 py-1 text-left font-semibold",children:e}),td:({children:e})=>i.jsx("td",{className:"border border-border px-2 py-1",children:e})};function gl({children:e,className:t}){return i.jsx("div",{className:xe("text-sm [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:i.jsx(xle,{remarkPlugins:[gM],components:Tle,children:e})})}function bP({parent:e}){const{data:t,isLoading:n}=CI(e),[r,a]=x.useState(null),[s,l]=x.useState(null);return n?i.jsx(Mn,{className:"h-24 w-full"}):t!=null&&t.length?i.jsxs("div",{className:"space-y-1",children:[t.map(u=>{const d=u.author==="assistant",p=!!u.updatedAt&&u.updatedAt!==u.createdAt;return i.jsxs("div",{className:"group -mx-3 flex items-start gap-3 rounded-lg px-4 py-2.5 transition-colors hover:bg-muted/40",children:[i.jsx("div",{className:xe("mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full",d?"bg-primary/15 text-primary":"bg-muted text-foreground"),children:d?i.jsx(qx,{className:"h-4 w-4"}):i.jsx(i7,{className:"h-4 w-4"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"font-medium text-foreground",children:d?"AI":"Me"}),i.jsx("span",{children:new Date(u.createdAt).toLocaleString()}),p&&i.jsx("span",{title:`Edited ${new Date(u.updatedAt).toLocaleString()}`,children:"(edited)"})]}),i.jsx("div",{className:"mt-0.5",children:i.jsx(gl,{children:u.body})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2.5 self-center pr-1 opacity-0 transition-opacity group-hover:opacity-100",children:[!d&&i.jsx("button",{type:"button",onClick:()=>a(u),className:"text-muted-foreground/60 hover:text-foreground",title:"Edit note",children:i.jsx(_r,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",onClick:()=>l(u),className:"text-muted-foreground/60 hover:text-destructive",title:"Delete note",children:i.jsx(Rr,{className:"h-3.5 w-3.5"})})]})]},u.id)}),r&&i.jsx(kle,{parent:e,note:r,onClose:()=>a(null)}),s&&i.jsx(Nle,{parent:e,note:s,onClose:()=>l(null)})]}):i.jsx("div",{className:"rounded-lg border border-dashed bg-muted/20 px-4 py-10 text-center text-sm text-muted-foreground",children:"No notes yet — add one below."})}function Nle({parent:e,note:t,onClose:n}){const r=A7(e);async function a(){await r.mutateAsync(t.id),n()}return i.jsx(It,{open:!0,onOpenChange:s=>!s&&n(),children:i.jsxs(Ct,{className:"sm:max-w-md",children:[i.jsxs(At,{children:[i.jsx(_t,{children:"Delete this note?"}),i.jsx(Gt,{children:"This permanently removes the note — it can't be undone."})]}),i.jsx(Ot,{children:i.jsx("p",{className:"line-clamp-4 whitespace-pre-wrap rounded-md border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:t.body})}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:n,children:"Cancel"}),i.jsxs(te,{variant:"destructive",onClick:a,disabled:r.isPending,children:[r.isPending&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),"Delete"]})]})]})})}function kle({parent:e,note:t,onClose:n}){const r=C7(e),[a,s]=x.useState(t.body),l=!!a.trim()&&a.trim()!==t.body&&!r.isPending;async function u(){l&&(await r.mutateAsync({id:t.id,body:a.trim()}),n())}return i.jsx(It,{open:!0,onOpenChange:d=>!d&&n(),children:i.jsxs(Ct,{className:"sm:max-w-lg",children:[i.jsx(At,{children:i.jsx(_t,{children:"Edit note"})}),i.jsx(Ot,{children:i.jsx("textarea",{autoFocus:!0,value:a,onChange:d=>s(d.target.value),rows:5,className:"w-full resize-y rounded-md border bg-transparent px-3 py-2 text-sm outline-none focus:border-ring"})}),i.jsxs(Dt,{children:[i.jsx(te,{variant:"outline",onClick:n,children:"Cancel"}),i.jsxs(te,{onClick:u,disabled:!l,children:[r.isPending&&i.jsx(Xe,{className:"mr-1 h-4 w-4 animate-spin"}),"Save"]})]})]})})}function yP({parent:e}){const t=k7(e),[n,r]=x.useState(""),a=x.useRef(null),{supported:s,listening:l,preparing:u,transcribing:d,toggle:p}=vg(()=>n,b=>r(b)),m=!!n.trim()&&!t.isPending;x.useEffect(()=>{const b=a.current;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,200)}px`)},[n]);async function h(){m&&(await t.mutateAsync(n.trim()),r(""))}return i.jsx("div",{className:"border-t border-border pt-4",children:i.jsxs("div",{className:"rounded-xl border bg-card/50 focus-within:border-ring",children:[i.jsx("textarea",{ref:a,value:n,onChange:b=>r(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),h())},rows:1,placeholder:"Add a note…",className:"max-h-[200px] w-full resize-none bg-transparent px-3 py-2.5 text-sm outline-none placeholder:text-muted-foreground"}),i.jsxs("div",{className:"flex items-center justify-end gap-1 px-2 pb-2",children:[s&&(u?i.jsxs("span",{className:"flex h-7 items-center gap-1.5 whitespace-nowrap rounded-md px-2 text-xs text-muted-foreground",title:"Downloading the transcription model — one-time",children:[i.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin"}),"Downloading transcription model…"]}):i.jsxs(te,{size:"icon",variant:"ghost",className:xe("h-7 w-7 text-muted-foreground hover:text-foreground",l&&"bg-red-500/15 text-red-400 hover:text-red-400"),onClick:()=>void p(),disabled:d,title:d?"Transcribing…":l?"Stop dictation":"Dictate",children:[d?i.jsx(Xe,{className:"h-4 w-4 animate-spin"}):i.jsx(rh,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Dictate"})]})),i.jsx(te,{size:"icon",className:"h-7 w-7",disabled:!m,onClick:h,title:"Note",children:t.isPending?i.jsx(Xe,{className:"h-4 w-4 animate-spin"}):i.jsx(th,{className:"h-4 w-4"})})]})]})})}function Cle({parent:e}){return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden",children:i.jsx(bP,{parent:e})}),i.jsx("div",{className:"shrink-0 pt-4",children:i.jsx(yP,{parent:e})})]})}const gp=[{value:"haiku",label:"Haiku (latest)"},{value:"sonnet",label:"Sonnet (latest)"},{value:"opus",label:"Opus (latest)"},{value:"fable",label:"Fable (latest)"}],bp=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Very high"},{value:"max",label:"Max"}],qm="opus",Ym="high",sN=e=>{var t;return((t=gp.find(n=>n.value===e))==null?void 0:t.label)??(e||"—")},oN=e=>{var t;return((t=bp.find(n=>n.value===e))==null?void 0:t.label)??(e||"—")};function Tg({model:e,effort:t,className:n}){return!e&&!t?null:i.jsxs("span",{className:n,children:[sN(e)," · ",oN(t)]})}function el({value:e,onChange:t,options:n,id:r,className:a}){return i.jsxs(ur,{value:e,onValueChange:t,children:[i.jsx(Qn,{id:r,className:a,children:i.jsx(cr,{})}),i.jsx(Zn,{children:n.map(s=>i.jsx(kt,{value:s.value,children:s.label},s.value))})]})}const rR=`
|
|
588
588
|
|
|
589
589
|
Attached files (read these):
|
|
590
590
|
`,Ale=e=>e.split(/[/\\]/).pop()||e,_le=/^paste-[a-f0-9]+(\.[a-z0-9]+)?$/i,Rle=e=>/\.(png|jpe?g|gif|webp)$/i.test(e);function Ile(e){const t=e.indexOf(rR);if(t===-1)return{text:e,attachments:[]};const n=e.slice(t+rR.length).split(`
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>SuperClawd Pipelines</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Cg1GZF49.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-Dys1VAfv.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist-server/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ Here\u2019s a first pass grouped by Added / Changed / Fixed. Want me to tighten
|
|
|
11
11
|
`)){let o=s.trim();if(!o)continue;let i;try{i=JSON.parse(o)}catch{continue}let c=i,d=c.type,u=c.message?.content;if(typeof u=="string"){let p=u.trim();if(!p)continue;d==="user"?r.push({type:"prompt",text:p}):d==="assistant"&&r.push({type:"text",text:p});continue}if(Array.isArray(u))for(let p of u){if(!p||typeof p!="object")continue;let g=p;if(g.type==="text"&&typeof g.text=="string"&&g.text.trim()){let I=g.text.trim();d==="user"?r.push({type:"prompt",text:I}):d==="assistant"&&r.push({type:"text",text:I})}else if(g.type==="tool_use")r.push({type:"tool",text:ba(g.name,g.input)});else if(g.type==="tool_result"){let I=wa(g.content);I&&r.push({type:"tool_result",text:I,isError:g.is_error===!0})}}}return r}dt();Z();import Ia from"node:fs";import Sa from"node:os";import Ps from"node:path";import{randomUUID as Os}from"node:crypto";var xa=process.env.SUPERCLAWD_HOME||Ps.join(Sa.homedir(),".superclawd"),va=Ps.join(xa,"config.json"),Ds=process.env.SUPERCLAWD_MCP_API_URL||"https://mcp-api.superclawd.com",js=process.env.PIPELINES_BACKEND==="mock"||process.env.SUPERCLAWD_BACKEND==="mock",vn=3,ur="__logged_out__";function E(){return js}var kt={loggedIn:!1,userId:ur,email:null};function he(){return lr()}function lr(){let e=process.env.SUPERCLAWD_MCP_KEY,t=process.env.SUPERCLAWD_MCP_SECRET;if(e&&t)return{keyId:e,secret:t};try{let n=JSON.parse(Ia.readFileSync(va,"utf8")),r=n?.credentials??n;if(typeof r?.keyId=="string"&&typeof r?.secret=="string")return{keyId:r.keyId,secret:r.secret}}catch{}return null}var xn=[];function Yt(){return xn}var Es=new Map,Ra=5*6e4;async function yt(e){let t=Es.get(e);if(t&&Date.now()-t.at<Ra)return{agents:t.agents,teams:t.teams};let n=lr();if(!n)return null;try{let r=await fetch(`${Ds}/api/prompt/agents-teams`,{headers:{"content-type":"application/json","x-mcp-key-id":n.keyId,"x-mcp-secret":n.secret,"x-workspace-slug":e,"x-request-id":Os()}});if(!r.ok)return null;let s=await r.json().catch(()=>null),o=s?.agents??[],i=s?.teams??[];return Es.set(e,{agents:o,teams:i,at:Date.now()}),{agents:o,teams:i}}catch{return null}}function Ta(e){return e.map(t=>({id:t.slug,name:t.name,tier:t.tier==="paid"?"paid":"free"}))}function Cs(e){return e===401?"Your credentials are invalid or expired. Run `superclawd login`.":e===403?"This account isn't permitted to use Pipelines.":e===0||e>=500?"The SuperClawd backend is unreachable. Try again in a moment.":`Authentication failed (HTTP ${e}).`}function Sn(e){return pn(ur),Ie.loggedIn=!1,delete Ie.account,$.length=0,xn=[],kt={loggedIn:!1,userId:ur,email:null,error:e},kt}async function Ms(){if(js)return pn(Kt),Ie.loggedIn=!0,xn=[...$],kt={loggedIn:!0,userId:Kt,email:Ie.account?.email??null},kt;let e=lr();if(!e)return Sn("Not authenticated. Run `superclawd login` to get started.");let t=d=>new Promise(u=>setTimeout(u,d)),n=8,r=2e3,s=0,o=null,i=!1;for(let d=1;d<=n;d++){try{let u=await fetch(`${Ds}/api/prompt/workspaces`,{headers:{"content-type":"application/json","x-mcp-key-id":e.keyId,"x-mcp-secret":e.secret,"x-request-id":Os()}});if(s=u.status,o=await u.json().catch(()=>null),u.ok){i=!0;break}if(s<500)return Sn(Cs(s))}catch{s=0}d===1&&console.log("[pipelines] waiting for the SuperClawd backend to come up\u2026"),d<n&&await t(r)}if(!i)return Sn(Cs(s));let c=o?.userId;return c?(pn(c),Ie.loggedIn=!0,Ie.account={email:o?.email??"",org:"SuperClawd"},xn=Ta(o?.workspaces??[]),$.length=0,kt={loggedIn:!0,userId:c,email:o?.email??null},kt):Sn("The backend didn't return an account id. Update the CLI/backend.")}Z();import{execFile as _a}from"node:child_process";import{existsSync as Tn}from"node:fs";import{rm as Aa}from"node:fs/promises";import{homedir as Na}from"node:os";import{dirname as Ea,join as Rn,resolve as Bs}from"node:path";var pr=Rn(Na(),".superclawd","pipelines-worktrees");function oe(e,t){return new Promise(n=>{_a("git",t,{cwd:e,maxBuffer:10*1024*1024},(r,s,o)=>{n({code:r&&typeof r.code=="number"?r.code:r?1:0,stdout:String(s??"").trim(),stderr:String(o??"").trim()})})})}async function $s(e){if(!e||!Tn(e))return!1;let t=await oe(e,["rev-parse","--is-inside-work-tree"]);return t.code===0&&t.stdout==="true"}async function Ge(e){if(!e||!Tn(e))return[];if(await $s(e))return[{name:".",path:Bs(e)}];let{readdir:t}=await import("node:fs/promises"),n=await t(e,{withFileTypes:!0}).catch(()=>[]),r=[];for(let s of n){if(!s.isDirectory()||s.name.startsWith("."))continue;let o=Rn(e,s.name);await $s(o)&&r.push({name:s.name,path:Bs(o)})}return r}async function Ls(e,t){let n=await Ge(e);if(!n.length)return null;let r=(t??"").trim();return!r||r==="."?n.length===1?n[0]:null:n.find(s=>s.name===r)??null}async function Gs(e){let t=await oe(e,["symbolic-ref","--short","refs/remotes/origin/HEAD"]);if(t.code===0&&t.stdout)return t.stdout.replace(/^origin\//,"");let n=await oe(e,["rev-parse","--abbrev-ref","HEAD"]);return n.code===0&&n.stdout&&n.stdout!=="HEAD"?n.stdout:"main"}async function fr(e,t){await oe(e,["fetch","origin",t]);let n=`origin/${t}`;return(await oe(e,["rev-parse","--verify","--quiet",`refs/remotes/${n}`])).code===0?n:t}async function Us(e,t,n){return(await oe(e,["merge-base","--is-ancestor",t,n])).code===0}async function qs(e){if(Tn(e.worktreePath)){let s=await oe(e.worktreePath,["rev-parse","--is-inside-work-tree"]);if(s.code===0&&s.stdout==="true")return{ok:!0,worktreePath:e.worktreePath}}let n=(await oe(e.repoPath,["rev-parse","--verify","--quiet",`refs/heads/${e.branch}`])).code===0?["worktree","add",e.worktreePath,e.branch]:["worktree","add","-b",e.branch,e.worktreePath,e.startPoint??e.base],r=await oe(e.repoPath,n);return r.code!==0?{ok:!1,error:r.stderr||r.stdout||"git worktree add failed"}:{ok:!0,worktreePath:e.worktreePath}}async function Fs(e,t,n){let r=await fr(e,n),s=await oe(e,["rev-list","--left-right","--count",`${r}...${t}`]);if(s.code!==0)return{behind:0,ahead:0};let[o,i]=s.stdout.split(/\s+/).map(c=>Number(c)||0);return{behind:o??0,ahead:i??0}}async function Ws(e,t){await oe(e,["branch","-D",t])}async function _n(e){let t=Rn(pr,e);if(!Tn(t))return;let{readdir:n}=await import("node:fs/promises"),r=await n(t,{withFileTypes:!0}).catch(()=>[]);for(let s of r){if(!s.isDirectory())continue;let o=Rn(t,s.name),i=await oe(o,["rev-parse","--path-format=absolute","--git-common-dir"]);if(i.code===0&&i.stdout){let c=Ea(i.stdout);await oe(c,["worktree","remove","--force",o])}}await Aa(t,{recursive:!0,force:!0}).catch(()=>{})}function Ca(e){let t=e.trim().replace(/\.git$/,""),n=/^git@([^:]+):(.+)$/.exec(t);return n?`https://${n[1]}/${n[2]}`:(n=/^ssh:\/\/git@([^/]+)\/(.+)$/.exec(t),n?`https://${n[1]}/${n[2]}`:/^https?:\/\//.test(t)?t:null)}async function Ks(e,t,n){let r=await oe(e,["remote","get-url","origin"]);if(r.code!==0||!r.stdout)return null;let s=Ca(r.stdout);return s?`${s}/compare/${t}...${n}?expand=1`:null}import{spawn as $a,spawnSync as La}from"node:child_process";import mr from"node:fs";import gr from"node:os";import wt from"node:path";import{fileURLToPath as Ga}from"node:url";import{execFileSync as Pa}from"node:child_process";import{realpathSync as Oa}from"node:fs";function Da(){if(process.platform!=="darwin")return!1;try{return Pa("which",["sandbox-exec"],{stdio:"ignore"}),!0}catch{return!1}}function ja(e){try{return Oa(e)}catch{return e}}function Ma(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Ba(e){let t=["(version 1)","(allow default)"];for(let n of e)t.push(`(deny file-write* (subpath "${Ma(ja(n))}"))`);return t.push('(allow file-write* (regex #"/\\.git/"))'),t.push('(allow file-write* (regex #"/\\.claude/"))'),t.join(`
|
|
12
12
|
`)}function Hs(e){let{cmd:t,args:n,repoPaths:r,enabled:s}=e;return!s||!r.length||!Da()?{cmd:t,args:n,sandboxed:!1}:{cmd:"sandbox-exec",args:["-p",Ba(r),t,...n],sandboxed:!0}}function Vt(e){if(!e||!e.trim())return process.cwd();let t=e.trim();return t==="~"?t=gr.homedir():(t.startsWith("~/")||t.startsWith("~\\"))&&(t=wt.join(gr.homedir(),t.slice(2))),wt.resolve(t)}function Ua(){return`http://127.0.0.1:${Number(process.env.PIPELINES_PORT||process.env.PIPELINES_MOCK_PORT||63210)}`}function qa(){let e=process.env.SUPERCLAWD_BIN;if(e)return{cmd:e,baseArgs:[]};let t=wt.dirname(Ga(import.meta.url));for(let n=0;n<8;n++){let r=wt.join(t,"apps","cli","dist","index.js");if(mr.existsSync(r))return{cmd:process.execPath,baseArgs:[r]};let s=wt.dirname(t);if(s===t)break;t=s}return{cmd:"superclawd",baseArgs:[]}}function hr(e){let{cmd:t,baseArgs:n}=qa(),r=[...n,"-p",e.prompt,"--pipelines"];e.pipelinesTools&&r.push(`--pipelines-tools=${e.pipelinesToolsMode??"board"}`),e.workspace&&r.push("--workspace",e.workspace),e.model&&r.push("--model",e.model),e.effort&&r.push("--effort",e.effort),e.noCapture&&r.push("--no-capture"),e.resume?r.push("--resume",e.resume):e.sessionId&&r.push("--session-id",e.sessionId);let s={};e.pipelinesTools&&(s.SUPERCLAWD_PIPELINES_URL=Ua(),e.ticketId&&(s.SUPERCLAWD_PIPELINES_TICKET=e.ticketId));let o=Vt(e.workingDir);if(!mr.existsSync(o))return{pid:0,pgid:0,done:Promise.resolve({code:1,stdout:"",stderr:`working directory does not exist: ${o}${e.workingDir&&e.workingDir!==o?` (from "${e.workingDir}")`:""}`})};let i=Hs({cmd:t,args:r,repoPaths:e.sandboxRepos??[],enabled:!!e.sandbox});if(process.env.PIPELINES_DEBUG){let I=`[pipelines] spawn (cwd=${o}${i.sandboxed?", sandboxed":""}): ${i.cmd} ${i.args.join(" ")}`;console.log(I);try{mr.appendFileSync(wt.join(gr.homedir(),".superclawd","pipelines-debug.log"),`${new Date().toISOString()} ${I}
|
|
13
13
|
`)}catch{}}let c=$a(i.cmd,i.args,{cwd:o,detached:!0,stdio:["ignore","pipe","pipe"],env:{...process.env,...s}}),d="",u="";c.stdout?.on("data",I=>d+=String(I)),c.stderr?.on("data",I=>u+=String(I));let p=new Promise(I=>{c.on("error",f=>I({code:127,stdout:d,stderr:`${u}
|
|
14
|
-
${String(f)}`})),c.on("close",f=>I({code:f??137,stdout:d,stderr:u}))}),g=c.pid??0;return{pid:g,pgid:g,done:p}}function Qs(e,t="SIGTERM"){if(e){if(process.platform==="win32"){try{La("taskkill",["/pid",String(e),"/T","/F"],{stdio:"ignore"})}catch{}return}try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}}function Ye(e){return hr(e).done}var Fa=["haiku","sonnet","opus","fable"],Wa=["low","medium","high","xhigh","max"],ke="opus",ye="high",Re=(e,t=ke)=>{let n=String(e??"").trim();return Fa.includes(n)?n:t},Te=(e,t=ye)=>{let n=String(e??"").trim();return Wa.includes(n)?n:t};function Ka(){let e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function Ue(e,t,n){let r={id:`e${e.events.length+1}`,ts:Ka(),kind:t,text:n};return e.events.push(r),r}Z();import{randomUUID as zs}from"node:crypto";var Ha=1e4,Js=3,Qa=1e3,Ja=new Set(["host","content-length","content-type","user-agent","x-superclawd-event","x-superclawd-signature","transfer-encoding","connection"]),za=e=>new Promise(t=>setTimeout(t,e));function Xs(e,t){let n={"content-type":"application/json","user-agent":"SuperClawd-Pipelines-Webhook/1","x-superclawd-event":e};l.webhookSecret&&(n["x-superclawd-signature"]=`sha256=${ps(l.webhookSecret,t)}`);for(let r of l.webhookHeaders??[])r.key&&!Ja.has(r.key.toLowerCase())&&(n[r.key]=r.value);return n}async function Ys(e,t,n){let r=new AbortController,s=setTimeout(()=>r.abort(),Ha);try{return(await fetch(e,{method:"POST",headers:n,body:t,signal:r.signal})).status}catch{return 0}finally{clearTimeout(s)}}function le(e,t,n={}){let r=l;if(!r.webhookEnabled||!r.webhookUrl||!r.webhookEvents||!r.webhookEvents.includes(e))return;let s=r.webhookUrl,o={id:`evt_${zs()}`,event:e,occurredAt:new Date().toISOString(),workspaceId:n.workspaceId,data:t},i=JSON.stringify(o),c=Xs(e,i);(async()=>{for(let d=1;d<=Js;d++){let u=await Ys(s,i,c);if(u>=200&&u<300)return;d<Js&&await za(Qa*d)}})().catch(()=>{})}async function Vs(){let e=l.webhookUrl;if(!e)return{ok:!1,error:"no webhook URL configured"};let t={id:`evt_${zs()}`,event:"webhook.test",occurredAt:new Date().toISOString(),data:{message:"SuperClawd Pipelines test event"}},n=JSON.stringify(t),r=Xs("webhook.test",n),s=await Ys(e,n,r);return s>=200&&s<300?{ok:!0,status:s}:{ok:!1,...s?{status:s}:{error:"could not reach the webhook URL"}}}function fe(e,t,n={}){return e.status=t,n.stopReason!==void 0&&(e.stopReason=n.stopReason===null?void 0:n.stopReason),n.clearBlocker&&(e.blocker=void 0),n.event&&Ue(e,n.event.kind,n.event.text),e.updatedAt=new Date().toISOString(),n.webhookEvent&&le(n.webhookEvent,{runId:e.id,ticketId:e.ticketId,ticketKey:e.ticketKey,title:e.title,status:e.status,stopReason:e.stopReason},{workspaceId:e.workspaceId}),e}import{randomUUID as Xa}from"node:crypto";var Ya=3,Va=1,Za=10,bt=new Map,It=[];function ec(){let e=l.maxConcurrentRuns??Ya;return Math.max(Va,Math.min(Za,e))}function _e(e,t=!1,n){bt.has(e)||It.some(r=>r.runId===e)||(It.push({runId:e,resume:t,prompt:n}),Zs())}function Zs(){for(;bt.size<ec()&&It.length>0;){let e=It.shift();rc(e.runId,e.resume,e.prompt)}}function tc(e,t,n){let r=e?`You are working on SuperClawd Pipelines ticket ${e.externalIdentifier} \u2014 "${e.title}" (ticket id: ${e.id}).`:`You are working on SuperClawd Pipelines run "${t.title}".`,o=!!e&&e.provider!=="local"?"- Start by calling read_ticket to read the full ticket (description, vendor comments, context, plan, open questions, conclusion, notes). On this run you can call it with no arguments \u2014 it defaults to this ticket. Read the vendor comments too \u2014 the real acceptance criteria and decisions often live in the discussion, not the description.":"- Start by calling read_ticket to read the full ticket (description, context, plan, open questions, conclusion, notes). On this run you can call it with no arguments \u2014 it defaults to this ticket.",i=[r,"","Use the SuperClawd Pipelines tools for this task:",o,"- Write your plan with set_plan (use the tool; do not create a plan file unless the ticket explicitly asks for one).",`- If this task changes code: call list_repos to see the git repositories in your working directory. It returns either several repos (the working dir is an umbrella folder) OR a single entry named "." (the working dir is itself one git repo) \u2014 in BOTH cases you must call start_repo_work({repo}) to get an isolated worktree before touching any code (for the single "." repo you can call start_repo_work with no repo). Make ALL changes inside the returned worktreePath and commit there. NEVER edit files in the working directory checkout directly \u2014 not even when it's a single repo and not even if it looks unmanaged; other runs may be working on it, and in-place edits break isolation. Claim each repo you touch. When done, commit and push the branch, then open the pull request following THIS repo's own PR conventions \u2014 if a create-pull-request skill or a PR rule in CLAUDE.md is available, use it to author the PR rather than hand-crafting one. Then record the resulting PR link with add_pr_link (once per repo). If you can't open a PR (e.g. no gh), push the branch and pass the compareUrl to add_pr_link so a human can open it.`,"- If you need something that isn't in the ticket, record it with add_open_question rather than guessing \u2014 and if it blocks progress, also call block_ticket with a reason.","- Keep durable findings or decisions on the ticket with add_note.","- When you've fully completed what the ticket asked, write a short wrap-up of what you did (and any results) with set_conclusion."];if(t.autonomy==="autonomous"&&i.push("","This run is AUTONOMOUS \u2014 no one is available to answer questions while it runs. Do NOT guess on any decision that materially changes the outcome. When you hit a genuine unknown, record it with add_open_question AND call block_ticket with a short reason, then stop \u2014 a human will resolve it and the ticket will be re-run. Only make assumptions for trivial, low-risk gaps, and state them clearly."),t.assignmentKind==="agent"&&t.agentName)i.push("",`DELEGATION \u2014 this ticket is assigned to the "${t.agentName}" agent. Use the Task tool to hand the ENTIRE ticket to the subagent for "${t.agentName}" (available in this session), let it complete the work, then report its result. Do NOT do the work yourself. If you cannot find that subagent, proceed yourself and add_note that the assigned agent was unavailable.`);else if(t.assignmentKind==="team"&&t.teamName){let u=t.teamLeadName;i.push("",u?`DELEGATION \u2014 this ticket is assigned to the "${t.teamName}" team. Use the Task tool to hand the ENTIRE ticket to the team's LEAD subagent, "${u}" (available in this session); it will coordinate its members. Do NOT do the work yourself. If you cannot find it, proceed yourself and add_note that the assigned team was unavailable.`:`DELEGATION \u2014 this ticket is assigned to the "${t.teamName}" team. Use the Task tool to hand the ENTIRE ticket to that team's lead-agent subagent, which coordinates its members. Do NOT do the work yourself. If you cannot find it, proceed yourself and add_note that the assigned team was unavailable.`)}i.push("","Then do the work the ticket asks for.");let c=i.join(`
|
|
14
|
+
${String(f)}`})),c.on("close",f=>I({code:f??137,stdout:d,stderr:u}))}),g=c.pid??0;return{pid:g,pgid:g,done:p}}function Qs(e,t="SIGTERM"){if(e){if(process.platform==="win32"){try{La("taskkill",["/pid",String(e),"/T","/F"],{stdio:"ignore"})}catch{}return}try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}}function Ye(e){return hr(e).done}var Fa=["haiku","sonnet","opus","fable"],Wa=["low","medium","high","xhigh","max"],ke="opus",ye="high",Re=(e,t=ke)=>{let n=String(e??"").trim().toLowerCase().replace(/^claude-(\w+)-latest$/,"$1");return Fa.includes(n)?n:t},Te=(e,t=ye)=>{let n=String(e??"").trim();return Wa.includes(n)?n:t};function Ka(){let e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function Ue(e,t,n){let r={id:`e${e.events.length+1}`,ts:Ka(),kind:t,text:n};return e.events.push(r),r}Z();import{randomUUID as zs}from"node:crypto";var Ha=1e4,Js=3,Qa=1e3,Ja=new Set(["host","content-length","content-type","user-agent","x-superclawd-event","x-superclawd-signature","transfer-encoding","connection"]),za=e=>new Promise(t=>setTimeout(t,e));function Xs(e,t){let n={"content-type":"application/json","user-agent":"SuperClawd-Pipelines-Webhook/1","x-superclawd-event":e};l.webhookSecret&&(n["x-superclawd-signature"]=`sha256=${ps(l.webhookSecret,t)}`);for(let r of l.webhookHeaders??[])r.key&&!Ja.has(r.key.toLowerCase())&&(n[r.key]=r.value);return n}async function Ys(e,t,n){let r=new AbortController,s=setTimeout(()=>r.abort(),Ha);try{return(await fetch(e,{method:"POST",headers:n,body:t,signal:r.signal})).status}catch{return 0}finally{clearTimeout(s)}}function le(e,t,n={}){let r=l;if(!r.webhookEnabled||!r.webhookUrl||!r.webhookEvents||!r.webhookEvents.includes(e))return;let s=r.webhookUrl,o={id:`evt_${zs()}`,event:e,occurredAt:new Date().toISOString(),workspaceId:n.workspaceId,data:t},i=JSON.stringify(o),c=Xs(e,i);(async()=>{for(let d=1;d<=Js;d++){let u=await Ys(s,i,c);if(u>=200&&u<300)return;d<Js&&await za(Qa*d)}})().catch(()=>{})}async function Vs(){let e=l.webhookUrl;if(!e)return{ok:!1,error:"no webhook URL configured"};let t={id:`evt_${zs()}`,event:"webhook.test",occurredAt:new Date().toISOString(),data:{message:"SuperClawd Pipelines test event"}},n=JSON.stringify(t),r=Xs("webhook.test",n),s=await Ys(e,n,r);return s>=200&&s<300?{ok:!0,status:s}:{ok:!1,...s?{status:s}:{error:"could not reach the webhook URL"}}}function fe(e,t,n={}){return e.status=t,n.stopReason!==void 0&&(e.stopReason=n.stopReason===null?void 0:n.stopReason),n.clearBlocker&&(e.blocker=void 0),n.event&&Ue(e,n.event.kind,n.event.text),e.updatedAt=new Date().toISOString(),n.webhookEvent&&le(n.webhookEvent,{runId:e.id,ticketId:e.ticketId,ticketKey:e.ticketKey,title:e.title,status:e.status,stopReason:e.stopReason},{workspaceId:e.workspaceId}),e}import{randomUUID as Xa}from"node:crypto";var Ya=3,Va=1,Za=10,bt=new Map,It=[];function ec(){let e=l.maxConcurrentRuns??Ya;return Math.max(Va,Math.min(Za,e))}function _e(e,t=!1,n){bt.has(e)||It.some(r=>r.runId===e)||(It.push({runId:e,resume:t,prompt:n}),Zs())}function Zs(){for(;bt.size<ec()&&It.length>0;){let e=It.shift();rc(e.runId,e.resume,e.prompt)}}function tc(e,t,n){let r=e?`You are working on SuperClawd Pipelines ticket ${e.externalIdentifier} \u2014 "${e.title}" (ticket id: ${e.id}).`:`You are working on SuperClawd Pipelines run "${t.title}".`,o=!!e&&e.provider!=="local"?"- Start by calling read_ticket to read the full ticket (description, vendor comments, context, plan, open questions, conclusion, notes). On this run you can call it with no arguments \u2014 it defaults to this ticket. Read the vendor comments too \u2014 the real acceptance criteria and decisions often live in the discussion, not the description.":"- Start by calling read_ticket to read the full ticket (description, context, plan, open questions, conclusion, notes). On this run you can call it with no arguments \u2014 it defaults to this ticket.",i=[r,"","Use the SuperClawd Pipelines tools for this task:",o,"- Write your plan with set_plan (use the tool; do not create a plan file unless the ticket explicitly asks for one).",`- If this task changes code: call list_repos to see the git repositories in your working directory. It returns either several repos (the working dir is an umbrella folder) OR a single entry named "." (the working dir is itself one git repo) \u2014 in BOTH cases you must call start_repo_work({repo}) to get an isolated worktree before touching any code (for the single "." repo you can call start_repo_work with no repo). Make ALL changes inside the returned worktreePath and commit there. NEVER edit files in the working directory checkout directly \u2014 not even when it's a single repo and not even if it looks unmanaged; other runs may be working on it, and in-place edits break isolation. Claim each repo you touch. When done, commit and push the branch, then open the pull request following THIS repo's own PR conventions \u2014 if a create-pull-request skill or a PR rule in CLAUDE.md is available, use it to author the PR rather than hand-crafting one. Then record the resulting PR link with add_pr_link (once per repo). If you can't open a PR (e.g. no gh), push the branch and pass the compareUrl to add_pr_link so a human can open it.`,"- If you need something that isn't in the ticket, record it with add_open_question rather than guessing \u2014 and if it blocks progress, also call block_ticket with a reason.","- Keep durable findings or decisions on the ticket with add_note.","- When you've fully completed what the ticket asked, write a short wrap-up of what you did (and any results) with set_conclusion."];if(t.autonomy==="autonomous"&&i.push("","This run is AUTONOMOUS \u2014 no one is available to answer questions while it runs. Do NOT guess on any decision that materially changes the outcome. When you hit a genuine unknown, record it with add_open_question AND call block_ticket with a short reason, then stop \u2014 a human will resolve it and the ticket will be re-run. Only make assumptions for trivial, low-risk gaps, and state them clearly."),t.assignmentKind==="agent"&&t.agentName)i.push("",`DELEGATION \u2014 this ticket is assigned to the "${t.agentName}" agent. Use the Task tool to hand the ENTIRE ticket to the subagent for "${t.agentName}" (available in this session), let it complete the work, then report its result. Do NOT do the work yourself. If you cannot find that subagent, proceed yourself and add_note that the assigned agent was unavailable.`);else if(t.assignmentKind==="team"&&t.teamName){let u=t.teamLeadName;i.push("",u?`DELEGATION \u2014 this ticket is assigned to the "${t.teamName}" team. Use the Task tool to hand the ENTIRE ticket to the team's LEAD subagent, "${u}" (available in this session); it will coordinate its members. Do NOT do the work yourself. If you cannot find it, proceed yourself and add_note that the assigned team was unavailable.`:`DELEGATION \u2014 this ticket is assigned to the "${t.teamName}" team. Use the Task tool to hand the ENTIRE ticket to that team's lead-agent subagent, which coordinates its members. Do NOT do the work yourself. If you cannot find it, proceed yourself and add_note that the assigned team was unavailable.`)}i.push("","Then do the work the ticket asks for.");let c=i.join(`
|
|
15
15
|
`),d=(n??"").trim();return d?`${c}
|
|
16
16
|
|
|
17
17
|
Additional instructions from the human:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superclawd-ai/pipelines",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.88",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Turn your board into an autonomous pipeline — a local, opt-in SuperClawd extension that runs your own Claude on your tickets and opens PRs for review.",
|
|
6
6
|
"author": "SuperClawd <support@superclawd.com>",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"build": "node build.mjs",
|
|
46
46
|
"prepublishOnly": "npm run build",
|
|
47
47
|
"typecheck": "tsc --noEmit",
|
|
48
|
-
"test": "tsx test/runtime.test.ts && tsx test/persist.test.ts && tsx test/board-http.test.ts && tsx test/auto-ingest-assign.test.ts && tsx test/token-refresh.test.ts && tsx test/connection-sync.test.ts && tsx test/git.test.ts && tsx test/git-rebase.test.ts && tsx test/resume-preamble.test.ts && tsx test/pr-monitor.test.ts && tsx test/multi-pr.test.ts && tsx test/dependencies.test.ts && tsx test/batches.test.ts && tsx test/batch-runtime.test.ts && tsx test/batch-stacking.test.ts && tsx test/sandbox.test.ts && tsx test/scheduler.test.ts && tsx test/linear.test.ts && tsx test/jira.test.ts && tsx test/asana.test.ts && tsx test/clickup.test.ts && tsx test/monday.test.ts && tsx test/vendor-util.test.ts && tsx test/public-api.test.ts && tsx test/mcp.test.ts && tsx test/transcript.test.ts",
|
|
48
|
+
"test": "tsx test/runtime.test.ts && tsx test/persist.test.ts && tsx test/board-http.test.ts && tsx test/auto-ingest-assign.test.ts && tsx test/token-refresh.test.ts && tsx test/connection-sync.test.ts && tsx test/git.test.ts && tsx test/git-rebase.test.ts && tsx test/resume-preamble.test.ts && tsx test/pr-monitor.test.ts && tsx test/multi-pr.test.ts && tsx test/dependencies.test.ts && tsx test/batches.test.ts && tsx test/batch-runtime.test.ts && tsx test/batch-stacking.test.ts && tsx test/sandbox.test.ts && tsx test/scheduler.test.ts && tsx test/linear.test.ts && tsx test/jira.test.ts && tsx test/asana.test.ts && tsx test/clickup.test.ts && tsx test/monday.test.ts && tsx test/vendor-util.test.ts && tsx test/public-api.test.ts && tsx test/mcp.test.ts && tsx test/transcript.test.ts && tsx test/run-config.test.ts",
|
|
49
49
|
"preview": "vite preview",
|
|
50
50
|
"lint": "eslint 'src/**/*.{ts,tsx}' 'server/**/*.ts'",
|
|
51
51
|
"format": "prettier --check 'src/**/*.{ts,tsx}' 'server/**/*.ts'",
|