linear-grab 0.23.5 → 0.23.6
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/dist/index.global.js +1 -1
- package/dist/linear-grab.js +2 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -268,7 +268,7 @@ of the other sections.`,hD="- FIRST, self-orient in the repo checkout (skip any
|
|
|
268
268
|
`),t.comment?.id??void 0);let s=n.data?.team?.id;if(s){let t=await vO(s),n=t.find(e=>e.type===`started`&&/review/i.test(e.name))??t.filter(e=>e.type===`completed`).sort((e,t)=>e.position-t.position)[0];n&&await yO(e.issueId,n.id)}},onSuccess:()=>{t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t.invalidateQueries({queryKey:[`sessions`,e.issueId]})}})),c=vr(()=>({mutationFn:e=>LO(e.id,e.model),onSuccess:e=>{t.setQueryData([`bridge-tasks`],t=>t?.map(t=>t.id===e.id?e:t))}})),l=vr(()=>({mutationFn:e=>IO(e,`Continue where you left off. If the work is already complete, finish any remaining closeout steps (PR, Linear update, announcement).`),onSuccess:()=>void t.invalidateQueries({queryKey:[`bridge-tasks`]})})),u=vr(()=>({mutationFn:e=>RO(e),onSuccess:()=>void t.invalidateQueries({queryKey:[`bridge-tasks`]})})),[d,f]=T(!1),p=async e=>{try{await navigator.clipboard.writeText(YO(e)),f(!0),setTimeout(()=>f(!1),1800)}catch{}},m=k(()=>{let e=n.data?.identifier;return e?a.data?.find(t=>t.title.startsWith(e)):void 0}),h=e=>e.status===`running`?{word:`Working…`,cls:`text-accent`}:e.status===`done`?{word:`Finished`,cls:`text-success`}:e.status===`stopped`?{word:`Stopped`,cls:`text-warn`}:{word:`Error`,cls:`text-danger`},[g,_]=br(`activity-reply:${e.issueId}`,``),[v,y]=T(null),[b,x]=T(0),S=_r(()=>({queryKey:[`grab`],queryFn:Dr,enabled:cj()===`composer`})),[C,w]=T(!1),E=async()=>{w(!0),y(null);try{let{block:e,failed:t}=await f$();e?_(t=>`${t?`${t}\n`:``}${e}\n`):t.length||y(`Nothing captured yet — pick an element, capture a region, or record first.`),t.length&&y(t.join(` · `))}catch(e){y(e instanceof Error?e.message:`Attach failed.`)}finally{w(!1)}},ee=()=>{if(cj()===`composer`){uj(`capture`);return}x(Date.now()),uj(`composer`),YZ().catch(()=>uj(`capture`))};O(()=>{if(cj()!==`composer`)return;let e=(S.data??[]).filter(e=>e.grabbedAt>b());if(!e.length)return;let t=e.map(e=>{let t=e.source?.filePath?` — \`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:``;return`- \`<${e.componentName??e.tagName??`element`}>\`${t}`}).join(`
|
|
269
269
|
`);_(e=>`${e?`${e}\n`:``}${t}\n`),x(Math.max(...e.map(e=>e.grabbedAt)))});let[te,A]=T(HD());ae(UD(A));let ne=!1;O(()=>{te().phase===`ready`&&ne&&(ne=!1,E())});let re=()=>{te().phase===`recording`?eO():(ne=!0,$D())},ie=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i,oe=k(()=>(n.data?.attachments??[]).map(e=>e.url).filter(e=>ie.test(e))),se=_r(()=>({queryKey:[`pr-status`,oe().sort().join(`|`)],queryFn:()=>HO(oe()),refetchInterval:3e4,retry:0,enabled:oe().length>0})),ce=e=>_e().has(e)?`MERGED`:se.data?.statuses[e],[le,ue]=T(null),de=()=>i.data?.stagingBranch?.trim()||`staging`,[fe,pe]=T(null),[me,he]=T(new Set),ge=async e=>{pe(e);try{await UO(e,de()),he(t=>new Set(t).add(e))}catch{}finally{pe(null)}},[_e,ve]=T(new Set),[ye,be]=T(null),xe=async n=>{be(null),ue(n);try{await qO(n),ve(e=>new Set(e).add(n)),t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t.invalidateQueries({queryKey:[`my-issues`]}),t$()}catch(e){be(e instanceof Error?`${e.message} (bridge must be running; gh needs merge rights)`:`Merge failed.`)}finally{ue(null)}},Se=k(()=>{let e=n.data?TO(n.data.comments):[],t=new Set(e.map(e=>e.id));return[...(r.data??[]).filter(e=>e.comment?.id&&!t.has(e.comment.id)).map(e=>({id:e.comment.id,createdAt:e.updatedAt,body:``,user:{displayName:e.appUser?.displayName??`agent`,app:!0},parent:null})),...e]}),[Ce,we]=T(`comment`),Te=!1,Ee=!1;O(()=>{if(Ee||!n.data||!i.data)return;Ee=!0;let e=Se();e.length?we(`thread:${e[0].id}`):n.data.delegate&&i.data.cursorAgentId&&we(`new`)}),O(()=>{Te||m()&&(Ce()===`comment`||Ce()===`new`)&&we(`local`)}),O(()=>{if(Te)return;let e=Se();e.length&&(Ce()===`comment`||Ce()===`new`)&&we(`thread:${e[0].id}`)});let De=vr(()=>({mutationFn:async()=>{let t=g().trim();if(!t)throw Error(`Message is empty`);let n=i.data??{},r=Ce();if(r===`local`){let n=m();if(!n)throw Error(`Local session not found — is the bridge running?`);await IO(n.id,t),await CO(e.issueId,`🖥️ **→ local agent:** ${t}`).catch(()=>{})}else r.startsWith(`thread:`)?await CO(e.issueId,t,r.slice(7)):r===`new`&&n.cursorAgentId?await wO(e.issueId,t,{name:n.cursorAgentName,displayName:n.cursorAgentName??`Cursor`,url:n.cursorAgentUrl}):await CO(e.issueId,t)},onSuccess:()=>{_(``),y(null),uj(`capture`),t.invalidateQueries({queryKey:[`issue`,e.issueId]}),t$()},onError:e=>{y(e.message??`Failed to send`)}})),Oe=k(()=>n.data),ke=k(()=>r.data??[]);return(()=>{var t=J$(),r=t.firstChild,a=r.firstChild,f=r.nextSibling,y=f.nextSibling,b=y.firstChild;return P(a,j(kj,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Back to issues`,"aria-label":`Back to issues`,"data-tip-pos":`right bottom`,get onClick(){return e.onBack},get children(){return N$()}}),null),P(a,j(M,{get when(){return Oe()},get children(){return[(()=>{var e=P$();return P(e,()=>Oe().identifier),e})(),(()=>{var e=F$();return P(e,()=>Oe().title),e})()]}}),null),P(a,j(M,{get when(){return $e(()=>!!n.isPending)()&&!Oe()},get children(){return I$()}}),null),P(r,j(M,{get when(){return Oe()},get children(){var e=L$(),t=e.firstChild;return P(e,j(Bj,{get color(){return Oe().state.color}}),t),P(t,()=>Oe().state.name),P(e,j(Ij,{get href(){return Oe().url},class:`ml-auto shrink-0`,children:`Open in Linear`}),null),e}}),null),P(f,j(M,{get when(){return m()},children:e=>{let t=()=>h(e());return(()=>{var n=$$(),r=n.firstChild,i=r.firstChild.firstChild,a=i.nextSibling.nextSibling.nextSibling;a.firstChild;var s=r.nextSibling,f=s.firstChild,m=f.firstChild,h=m.nextSibling;return P(i,j(Fj,{size:12})),P(a,()=>Wj(e().startedAt),null),P(r,j(Nj,{class:`h-6 w-auto max-w-[110px] shrink-0 text-[10.5px]`,get value(){return e().pendingModel??e().model??``},onChange:t=>c.mutate({id:e().id,model:t.currentTarget.value}),title:`Model — applies from the next message`,get children(){return[j(We,{each:o,children:t=>(()=>{var n=e1();return P(n,()=>t.label),D(()=>n.selected=(e().pendingModel??e().model??``)===t.id),D(()=>n.value=t.id),n})()}),j(M,{get when(){return!o.some(t=>t.id===(e().pendingModel??e().model??``))},get children(){var t=Y$();return P(t,()=>e().pendingModel??e().model),D(()=>t.value=e().pendingModel??e().model??``),t}})]}}),null),f.$$click=()=>oj(`local`),P(f,j(M,{get when(){return e().status===`running`},get children(){return j(Aj,{size:12})}}),m),P(m,()=>t().word),P(h,(()=>{var t=$e(()=>e().status===`done`);return()=>t()?e().result??e().lastText:e().lastText})()),P(s,j(M,{get when(){return e().status===`running`},get children(){return j(kj,{variant:`danger`,class:`size-6 shrink-0 px-0`,get loading(){return u.isPending},title:`Stop the session — resumable afterwards`,"aria-label":`Stop session`,onClick:()=>u.mutate(e().id),get children(){return X$()}})}}),null),P(s,j(M,{get when(){return $e(()=>e().status!==`running`)()&&e().sessionId},get children(){return j(kj,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get loading(){return l.isPending},get title(){return`Run again — resumes this session${e().pendingModel?` on ${e().pendingModel}`:``}`},"aria-label":`Resume session`,onClick:()=>l.mutate(e().id),get children(){return Z$()}})}}),null),P(s,j(M,{get when(){return e().sessionId},get children(){return j(kj,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return d()?`Copied!`:`Copy terminal resume command (claude --resume …)`},"aria-label":`Copy resume command`,onClick:()=>void p(e()),get children(){return Q$()}})}}),null),D(()=>st(m,`shrink-0 text-[11.5px] font-medium ${t().cls}`)),n})()}}),null),P(f,j(M,{get when(){return ke().length>0},get children(){var e=R$();return P(e,j(We,{get each(){return ke()},children:e=>(()=>{var t=t1();return P(t,j(x1,{session:e}),null),P(t,j(M,{get when(){return $e(()=>!!(/complete/i.test(e.status)&&n.data?.state.type===`started`))()&&!/review/i.test(n.data?.state.name??``)},get children(){return j(kj,{variant:`primary`,class:`self-start`,get loading(){return s.isPending},title:`Post the acceptance comment (fix summary, PR, preview, checklist) in the agent thread and move the issue to review`,onClick:()=>s.mutate(e),children:`Post closeout to Linear`})}}),null),t})()})),e}}),null),P(f,j(M,{get when(){return $e(()=>!!Oe())()&&Oe().attachments.length>0},get children(){var e=z$(),t=e.firstChild.nextSibling;return P(t,j(We,{get each(){return Oe().attachments},children:e=>{let t=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i.test(e.url);return[(()=>{var n=i1(),r=n.firstChild;return P(r,()=>e.title),P(n,j(M,{get when(){return t&&se.data?.previews[e.url]},get children(){return j(Ij,{get href(){return se.data.previews[e.url]},class:`shrink-0`,title:`Vercel deploy preview of this PR's branch`,children:`Preview`})}}),null),P(n,j(M,{get when(){return $e(()=>!!(t&&ce(e.url)))()&&ce(e.url)!==`OPEN`},get children(){return j(zj,{get class(){return`ml-auto shrink-0 ${ce(e.url)===`MERGED`?`text-success`:`text-text-faint`}`},get children(){return ce(e.url)===`MERGED`?`✓ merged`:`closed`}})}}),null),P(n,j(M,{get when(){return t&&(!ce(e.url)||ce(e.url)===`OPEN`)},get children(){return[j(kj,{variant:`ghost`,class:`ml-auto size-6 shrink-0 px-0`,get loading(){return fe()===e.url},get disabled(){return me().has(e.url)},get title(){return $e(()=>!!me().has(e.url))()?`On ${de()} — staging preview deploying`:`Merge into ${de()} — deploys the staging preview domain`},"aria-label":`Merge to staging`,onClick:()=>void ge(e.url),get children(){return j(M,{get when(){return me().has(e.url)},get fallback(){return a1()},get children(){return n1()}})}}),j(kj,{variant:`primary`,class:`h-6 shrink-0 px-2 text-[11px]`,get loading(){return le()===e.url},get title(){return se.isError?`PR state unknown — restart the bridge (npx linear-grab-bridge) for live merge status`:`Squash-merge this PR via the bridge gh — reviewed the demo? Ship it.`},onClick:()=>void xe(e.url),get children(){return r1()}})]}}),null),D(t=>{var n=e.url,i=e.title;return n!==t.e&&it(r,`href`,t.e=n),i!==t.t&&it(r,`title`,t.t=i),t},{e:void 0,t:void 0}),n})(),j(M,{get when(){return me().has(e.url)},get children(){return j(u$,{get url(){return e.url},get base(){return de()}})}})]}}),null),P(t,j(M,{get when(){return ye()},get children(){return j(Hj,{get message(){return ye()}})}}),null),e}}),null),P(f,j(M,{get when(){return $e(()=>!!Oe())()&&Oe().comments.length>0},get children(){var e=B$();return e.firstChild,P(e,j(Ge,{get each(){return Oe().comments},children:e=>{let t=e();return(()=>{var e=o1(),n=e.firstChild,r=n.firstChild,i=r.nextSibling;return P(r,()=>t.user?.displayName??t.user?.name??`Unknown`),P(n,j(M,{get when(){return t.user?.app},get children(){return j(zj,{children:`agent`})}}),i),P(i,()=>Wj(t.createdAt)),P(e,j(g1,{get text(){return t.body}}),null),e})()}}),null),e}}),null),P(f,j(M,{get when(){return $e(()=>!!(Oe()&&Oe().comments.length===0))()&&ke().length===0},get children(){return j(Vj,{title:`No activity yet`,children:`Comments and agent sessions will appear here.`})}}),null),P(f,j(M,{get when(){return $e(()=>!!n.isError)()&&!Oe()},get children(){return j(Vj,{title:`Failed to load issue`,get children(){return n.error?.message??`Unknown error`}})}}),null),P(y,j(M,{get when(){return v()},get children(){return j(Hj,{get message(){return v()}})}}),b),P(y,j(Mj,{rows:2,placeholder:`Reply — steer the agent or add context…`,get value(){return g()},onInput:e=>_(e.target.value),get disabled(){return De.isPending}}),b),P(b,j(Nj,{class:`min-w-0 flex-1`,get value(){return Ce()},onChange:e=>{Te=!0,we(e.currentTarget.value)},get children(){return[j(M,{get when(){return m()},get children(){var e=V$();return D(()=>e.selected=Ce()===`local`),e}}),j(We,{get each(){return Se()},children:(e,t)=>(()=>{var n=s1(),r=n.firstChild.nextSibling;return r.nextSibling,P(n,(()=>{var e=$e(()=>Se().length>1);return()=>e()?` #${t()+1}`:``})(),r),P(n,()=>Wj(e.createdAt),null),D(()=>n.selected=Ce()===`thread:${e.id}`),D(()=>n.value=`thread:${e.id}`),n})()}),j(M,{get when(){return i.data?.cursorAgentId},get children(){var e=H$(),t=e.firstChild.nextSibling;return t.nextSibling,P(e,()=>i.data?.cursorAgentName??`Cursor`,t),D(()=>e.selected=Ce()===`new`),e}}),(()=>{var e=U$();return D(()=>e.selected=Ce()===`comment`),e})()]}}),null),P(b,j(kj,{variant:`ghost`,get class(){return`size-7 shrink-0 px-0 ${cj()===`composer`?`text-accent`:``}`},get title(){return cj()===`composer`?`Pick mode ON — every pick appends here. Click to stop.`:`Pick elements — refs append to this reply (stays on until toggled off or sent)`},"aria-label":`Pick element for reply`,onClick:ee,get children(){return W$()}}),null),P(b,j(kj,{variant:`ghost`,get class(){return`size-7 shrink-0 px-0 ${te().phase===`recording`?`text-danger`:``}`},get title(){return te().phase===`recording`?`Stop recording — the GIF auto-attaches to this reply`:`Record a GIF from this thread (auto-attaches when done)`},"aria-label":`Record GIF`,onClick:re,get children(){return j(M,{get when(){return te().phase===`recording`},get fallback(){return c1()},get children(){return G$()}})}}),null),P(b,j(kj,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return C()},title:`Attach captures — element refs, screenshots, region shots, recording GIF`,"aria-label":`Attach captures`,onClick:()=>void E(),get children(){return K$()}}),null),P(b,j(kj,{class:`min-w-[52px] shrink-0`,variant:`primary`,get loading(){return De.isPending},get disabled(){return g().trim().length===0},onClick:()=>De.mutate(),get children(){return q$()}}),null),t})()}function x1(e){let t=k(()=>{let t=e.session.status;return/complete|done/i.test(t)?`var(--color-success)`:/await|pending|elicit/i.test(t)?`var(--color-warn)`:`var(--color-accent)`}),n=k(()=>{let t=e.session.status;return/active/i.test(t)?`Working…`:/awaitingInput|elicit/i.test(t)?`Needs input`:/complete/i.test(t)?`Complete`:/error/i.test(t)?`Error`:/pending/i.test(t)?`Queued`:t}),r=k(()=>e.session.activities.filter(e=>e.content?.body||e.content?.action).slice(-15)),[i,a]=T(!1),o,s=!0,c=()=>{o&&(s=o.scrollTop+o.clientHeight>=o.scrollHeight-40)};return O(()=>{let e=r().length;!o||!e||!s||requestAnimationFrame(()=>{o&&(o.scrollTop=o.scrollHeight)})}),(()=>{var s=p1(),l=s.firstChild,u=l.firstChild;return P(l,j(M,{get when(){return/active|pending/i.test(e.session.status)},get children(){return j(Aj,{size:12})}}),u),P(l,j(zj,{get color(){return t()},get children(){return n()}}),u),P(l,j(M,{get when(){return e.session.appUser?.displayName},get children(){var t=l1();return P(t,()=>e.session.appUser.displayName),t}}),u),P(u,()=>Wj(e.session.updatedAt)),P(l,j(M,{get when(){return e.session.externalLinks?.[0]},children:e=>j(Ij,{get href(){return e().url},class:`shrink-0`,title:`Open this run on the agent's site`,get children(){return e().label||`Cursor`}})}),null),P(l,j(kj,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return i()?`Collapse to a window`:`Expand — show the whole session feed`},get"aria-label"(){return i()?`Collapse feed`:`Expand feed`},onClick:()=>a(e=>!e),get children(){var e=u1();return D(t=>dt(e,`transform`,i()?`rotate(180deg)`:`none`)),e}}),null),P(s,j(M,{get when(){return e.session.summary},get children(){var t=d1();return P(t,()=>e.session.summary),t}}),null),P(s,j(M,{get when(){return r().length>0},get children(){var e=f1();e.addEventListener(`scroll`,c);var t=o;return typeof t==`function`?pt(t,e):o=e,P(e,j(Ge,{get each(){return r()},children:e=>j(M,{get when(){return e().content.action},get fallback(){return(()=>{var t=h1();return P(t,j(g1,{get text(){return e().content.body??``}})),D(()=>st(t,`lg-md text-[11.5px] leading-relaxed break-words ${e().content.__typename===`AgentActivityErrorContent`?`text-danger`:`text-text`}`)),t})()},get children(){var t=m1(),n=t.firstChild.nextSibling;return n.nextSibling,P(t,()=>e().content.action,n),P(t,()=>e().content.parameter,null),t}})})),D(()=>e.classList.toggle(`max-h-64`,!i())),e}}),null),s})()}rt([`click`]);var S1=N(`<svg aria-hidden width=11 height=11 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M1 4.5A7 7 0 0 1 13.5 3"></path><path d="M15 11.5A7 7 0 0 1 2.5 13"></path><polyline points="1 1 1 5 5 5"></polyline><polyline points="15 11 15 15 11 15">`),C1=N(`<div class="flex flex-col gap-1.5">`),w1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text inline-flex items-center gap-1.5 text-[12px] font-semibold"> Cloud agents</span><span class="text-text-faint text-[10.5px] tabular-nums"> working · updated </span></div><div class="border-border flex shrink-0 items-center gap-1 border-b px-3 py-1.5"></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),T1=N(`<button>`),E1=N(`<div class="grid place-items-center py-10">`),D1=N(`<button class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left"title="View the thread here"><span class="font-mono text-text-dim shrink-0 text-[11px]"></span><span class="text-text hover:text-accent min-w-0 truncate text-[12.5px] font-medium transition-colors">`),O1=N(`<p class="text-text-dim line-clamp-2 cursor-pointer text-[11.5px] leading-snug break-words">`),k1=N(`<span class="text-text-dim text-[11px]">`),A1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),j1=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><div class="flex min-w-0 items-center gap-1.5"><span class=ml-auto>`),M1=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),N1=N(`<span class="text-text-dim text-[12.5px]">Conversation session`);function P1(){let e=_r(()=>({queryKey:[`cloud-sessions`],queryFn:gO,refetchInterval:12e3})),t=[{id:`all`,label:`All`},{id:`working`,label:`Working`},{id:`input`,label:`Needs input`},{id:`done`,label:`Done`}],[n,r]=br(`cloud:filter`,`all`),i=k(()=>(e.data??[]).filter(e=>{switch(n()){case`working`:return/active|pending/i.test(e.status);case`input`:return/awaitingInput|elicit/i.test(e.status);case`done`:return/complete/i.test(e.status);default:return!0}})),a=e=>/active/i.test(e)?{word:`Working…`,color:`var(--color-accent)`}:/awaitingInput|elicit/i.test(e)?{word:`Needs input`,color:`var(--color-warn)`}:/complete/i.test(e)?{word:`Complete`,color:`var(--color-success)`}:/error/i.test(e)?{word:`Error`,color:`var(--color-danger)`}:{word:e,color:`var(--color-text-dim)`},o=e=>{let t=[...e.activities].reverse().find(e=>e.content?.body||e.content?.action);return t?t.content.action?`→ ${t.content.action} ${t.content.parameter??``}`:t.content.body??``:e.summary??``},s=k(()=>(e.data??[]).filter(e=>/active|pending/i.test(e.status)).length),[c,l]=T(null);return j(M,{get when(){return!c()},get fallback(){return j(b1,{get issueId(){return c()},onBack:()=>l(null)})},get children(){var c=w1(),u=c.firstChild,d=u.firstChild,f=d.firstChild,p=d.nextSibling,m=p.firstChild,h=u.nextSibling,g=h.nextSibling;return P(d,j(Pj,{size:13}),f),P(p,s,m),P(p,()=>Wj(e.dataUpdatedAt||Date.now()),null),P(h,j(We,{each:t,children:e=>(()=>{var t=T1();return t.$$click=()=>r(e.id),P(t,()=>e.label),D(()=>st(t,`h-6 shrink-0 cursor-pointer rounded-md px-2 text-[11px] font-medium transition-colors ${n()===e.id?`bg-accent-soft text-accent`:`text-text-dim hover:bg-surface-2`}`)),t})()}),null),P(h,j(kj,{class:`ml-auto size-6 px-0`,get loading(){return e.isFetching},title:`Refresh`,"aria-label":`Refresh sessions`,onClick:()=>void e.refetch(),get children(){return S1()}}),null),P(g,j(M,{get when(){return i().length>0},get fallback(){return j(M,{get when(){return!e.isPending},get fallback(){return(()=>{var e=E1();return P(e,j(Aj,{})),e})()},get children(){return j(Vj,{title:`No cloud agent sessions`,children:`Delegate an issue to Cursor from the Draft tab and its live session appears here.`})}})},get children(){var e=C1();return P(e,j(Ge,{get each(){return i()},children:e=>(()=>{var t=j1(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,s=i.firstChild;return P(n,j(M,{get when(){return/active|pending/i.test(e().status)},get fallback(){return(()=>{var t=M1();return D(n=>dt(t,`background`,a(e().status).color)),t})()},get children(){return j(Aj,{})}}),r),P(n,j(M,{get when(){return e().issue},get fallback(){return N1()},get children(){var t=D1(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>l(e().issue.id),P(n,()=>e().issue.identifier),P(r,()=>e().issue.title),t}}),r),P(r,()=>Wj(e().updatedAt)),P(t,j(M,{get when(){return o(e())},get children(){var t=O1();return t.$$click=()=>e().issue&&l(e().issue.id),P(t,()=>o(e())),t}}),i),P(i,j(zj,{get color(){return a(e().status).color},get children(){return a(e().status).word}}),s),P(i,j(M,{get when(){return e().issue},get children(){return[j(Bj,{get color(){return e().issue.state.color}}),(()=>{var t=k1();return P(t,()=>e().issue.state.name),t})()]}}),s),P(i,j(M,{get when(){return e().issue},get children(){return[j(kj,{variant:`ghost`,class:`size-6 shrink-0 px-0`,title:`Open the thread — steer this agent`,"aria-label":`Open thread`,onClick:()=>l(e().issue.id),get children(){return A1()}}),j(Ij,{get href(){return e().issue.url},class:`shrink-0`,children:`Linear`})]}}),null),t})()})),e}})),c}})}rt([`click`]);var F1=N(`<div class="flex flex-col gap-1.5">`),I1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Running now</span><span class="text-text-faint text-[10.5px] tabular-nums"> agent<!> active</span></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),L1=N(`<span class="font-mono text-text-dim shrink-0 text-[11px]">`),R1=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),z1=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><button class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left"><span class="text-text hover:text-accent min-w-0 truncate text-[12.5px] font-medium transition-colors"></span></button><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><p class="text-text-dim line-clamp-2 text-[11.5px] leading-snug break-words"></p><div class="flex min-w-0 items-center gap-1.5"><span class=ml-auto>`);function B1(){let e=_r(()=>({queryKey:[`cloud-sessions`],queryFn:gO,refetchInterval:12e3})),t=_r(()=>({queryKey:[`bridge-tasks`],queryFn:NO,refetchInterval:5e3,retry:0})),n=_r(()=>({queryKey:[`my-issues`],queryFn:fO,refetchInterval:3e4})),r=k(()=>{let r=(e.data??[]).filter(e=>/active|pending|awaitingInput|elicit/i.test(e.status)).map(e=>({kind:`cloud`,at:Date.parse(e.updatedAt),session:e})),i=(t.data??[]).filter(e=>e.status===`running`).map(e=>({kind:`local`,at:e.startedAt,task:e,issueId:(n.data??[]).find(t=>e.title.startsWith(t.identifier))?.id}));return[...r,...i].sort((e,t)=>t.at-e.at)}),[i,a]=T(null),o=e=>/awaitingInput|elicit/i.test(e)?{word:`Needs input`,color:`var(--color-warn)`}:{word:`Working…`,color:`var(--color-accent)`},s=e=>{let t=[...e.activities].reverse().find(e=>e.content?.body||e.content?.action);return t?t.content.action?`→ ${t.content.action} ${t.content.parameter??``}`:t.content.body??``:e.summary??``};return j(M,{get when(){return!i()},get fallback(){return j(b1,{get issueId(){return i()},onBack:()=>a(null)})},get children(){var e=I1(),t=e.firstChild,n=t.firstChild.nextSibling,i=n.firstChild,c=i.nextSibling;c.nextSibling;var l=t.nextSibling;return P(n,()=>r().length,i),P(n,()=>r().length===1?``:`s`,c),P(l,j(M,{get when(){return r().length>0},get fallback(){return j(Vj,{title:`Nothing running`,children:`Delegate an issue from the Draft tab — cloud (Cursor) and local (Claude Code) agents working right now appear here together.`})},get children(){var e=F1();return P(e,j(Ge,{get each(){return r()},children:e=>(()=>{var t=z1(),n=t.firstChild,r=n.firstChild,i=r.firstChild,c=r.nextSibling,l=n.nextSibling,u=l.nextSibling,d=u.firstChild;return P(n,j(Aj,{size:12}),r),P(n,j(zj,{get title(){return e().kind===`cloud`?`Cursor cloud agent`:`Local Claude Code`},get children(){return[$e(()=>$e(()=>e().kind===`cloud`)()?j(Pj,{}):j(Fj,{})),$e(()=>e().kind===`cloud`?`cloud`:`local`)]}}),r),r.$$click=()=>{let t=e();t.kind===`cloud`&&t.session.issue?a(t.session.issue.id):t.kind===`local`&&oj(`local`)},P(r,j(M,{get when(){return e().kind===`cloud`},get children(){var t=L1();return P(t,()=>e().session.issue?.identifier),t}}),i),P(i,(()=>{var t=$e(()=>e().kind===`cloud`);return()=>t()?e().session.issue?.title??`Conversation session`:e().task.title})()),P(c,()=>Wj(e().at)),P(l,(()=>{var t=$e(()=>e().kind===`cloud`);return()=>t()?s(e().session):e().task.lastText})()),P(u,j(M,{get when(){return e().kind===`cloud`},get fallback(){return j(zj,{color:`var(--color-accent)`,children:`Working…`})},get children(){return j(zj,{get color(){return o(e().session.status).color},get children(){return o(e().session.status).word}})}}),d),P(u,j(kj,{variant:`ghost`,class:`size-6 shrink-0 px-0`,get title(){return e().kind===`cloud`?`Open the thread — steer this agent`:`Open the live session in the Local tab`},"aria-label":`Open thread`,onClick:()=>{let t=e();t.kind===`cloud`&&t.session.issue?a(t.session.issue.id):t.kind===`local`&&oj(`local`)},get children(){return R1()}}),null),D(()=>it(r,`title`,e().kind===`cloud`?`View the thread here`:`Open the Local tab`)),t})()})),e}})),e}})}rt([`click`]),Br();var V1=N(`<div class="border-accent/40 bg-accent-soft self-end rounded-lg border px-2.5 py-1.5"><p class="text-accent mb-0.5 text-[9.5px] font-semibold tracking-wide uppercase">You</p><div class="lg-md text-text text-[11.5px] leading-relaxed break-words">`),H1=N(`<div><p></p><div class="lg-md text-text text-[11.5px] leading-relaxed break-words">`),U1=N(`<p>`),W1=N(`<span class="text-text-faint max-w-[55%] truncate text-[10.5px] tabular-nums"> running<!> · `),G1=N(`<div class="flex flex-col gap-1.5">`),K1=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Local Claude Code</span></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),q1=N(`<span class="bg-surface-2 border-border font-mono mt-2 block rounded-md border px-2 py-1.5 text-[11px] select-all">npx linear-grab-bridge`),J1=N(`<span class="text-text-faint text-[10.5px] tabular-nums">ctx <!> · out `),Y1=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-faint min-w-0 truncate text-[10.5px]">`),X1=N(`<option selected>`),Z1=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.8a.8.8 0 0 1 1.22-.68l8 5.2a.8.8 0 0 1 0 1.36l-8 5.2a.8.8 0 0 1-1.22-.68V2.8Z">`),Q1=N(`<span class="text-success text-[12px] leading-none">✓`),$1=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><path d="M14 10a2 2 0 0 1-2 2H6l-3.5 2.5V4a2 2 0 0 1 2-2H12a2 2 0 0 1 2 2v6Z">`),e0=N(`<svg width=11 height=11 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3 y=3 width=10 height=10 rx=1.5>`),t0=N(`<span class="font-mono text-text-faint min-w-0 truncate text-[10.5px]">`),n0=N(`<div class="border-border bg-bg flex flex-col gap-1 rounded-md border p-2"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text-dim text-[10.5px] font-semibold tracking-wide uppercase">Changes</span><span class="ml-auto shrink-0 text-[10.5px] tabular-nums"><span class=text-success>+</span> <span class=text-danger>−`),r0=N(`<div class="border-border bg-bg flex max-h-80 flex-col gap-1.5 overflow-y-auto rounded-md border py-2 pl-2 pr-3">`),i0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=2.2></circle><path d="M8 1v3M8 12v3M1 8h3M12 8h3">`),a0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M13 7.5 8.2 12.3a3.2 3.2 0 0 1-4.5-4.5L8.9 2.6a2.1 2.1 0 0 1 3 3L7.1 10.4a1 1 0 0 1-1.5-1.5l4.3-4.3">`),o0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M8 2v4M8 10v4M2 8h4M10 8h4M4.5 4.5 6 6M11.5 11.5 10 10M11.5 4.5 10 6M4.5 11.5 6 10">`),s0=N(`<span class="inline-block min-w-[4ch] text-center">Send`),c0=N(`<div class="flex flex-col gap-1.5"><div class="flex items-center gap-1"><span class="text-text-faint min-w-0 flex-1 truncate text-[10.5px]">`),l0=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><div class="flex min-w-0 items-center gap-1.5"><span class="text-text min-w-0 truncate text-[12.5px] font-medium"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><p class="text-text-dim text-[11.5px] leading-snug break-words"></p><div class="flex flex-wrap items-center gap-1.5"></div><div class="flex items-center gap-1">`),u0=N(`<span aria-hidden class="size-2 shrink-0 rounded-full">`),d0=N(`<div class="flex min-w-0 items-center gap-1.5">`),f0=N(`<option>`),p0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),m0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M2.5 3.5 6 7 2.5 10.5M7.5 12.5h6">`),h0=N(`<span class=text-success>+`),g0=N(`<span class=text-danger>−`),_0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim min-w-0 flex-1 truncate text-[10.5px]"></span><span class="shrink-0 text-[10px] tabular-nums">`),v0=N(`<span class=text-text-faint>bin`),y0=N(`<div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim min-w-0 flex-1 truncate text-[10.5px]"></span><span class="text-success shrink-0 text-[10px]">new`),b0=N(`<div class="flex min-w-0 items-center gap-1.5 pt-0.5"><a target=_blank rel=noreferrer class="text-accent min-w-0 truncate text-[11px] hover:underline">`),x0=N(`<p class="text-text-faint text-[11px]">Waiting for output…`),S0=[{id:``,label:`Default model`},{id:`fable`,label:`Fable 5`},{id:`opus`,label:`Opus`},{id:`sonnet`,label:`Sonnet`},{id:`haiku`,label:`Haiku`}];function C0(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)<(r[e]??0);return!1}var w0=e=>e==null?`–`:e>=1e3?`${(e/1e3).toFixed(e>=1e5?0:1)}k`:String(e);function T0(){let e=sr(),t=_r(()=>({queryKey:[`bridge-health`],queryFn:MO,refetchInterval:5e3,retry:0})),n=_r(()=>({queryKey:[`bridge-tasks`],queryFn:NO,refetchInterval:3e3,enabled:!!t.data?.ok})),[r,i]=T(null),a=_r(()=>({queryKey:[`my-issues`],queryFn:fO,staleTime:15e3})),o=e=>{let t=e.title.match(/^([A-Z][A-Z0-9]*-\d+)/)?.[1];return t?a.data?.find(e=>e.identifier===t):void 0},s=_r(()=>({queryKey:[`bridge-task`,r()],queryFn:()=>PO(r()),refetchInterval:1500,enabled:!!r()&&!!t.data?.ok})),c=_r(()=>({queryKey:[`bridge-diff`,r()],queryFn:()=>BO(r()),refetchInterval:6e3,enabled:!!r()&&!!t.data?.ok})),l=()=>{e.invalidateQueries({queryKey:[`bridge-tasks`]}),e.invalidateQueries({queryKey:[`bridge-task`,r()]})},u=vr(()=>({mutationFn:e=>RO(e),onSuccess:l})),[d,f]=br(`local:message`,``),[p,m]=T(!1),[h,g]=T(0),_=_r(()=>({queryKey:[`grab`],queryFn:Dr,enabled:cj()===`local`})),v=()=>{g(Date.now()),uj(`local`),YZ().catch(()=>uj(`capture`))};O(()=>{if(cj()!==`local`)return;let e=(_.data??[]).filter(e=>e.grabbedAt>=h());if(!e.length)return;let t=e.map(e=>{let t=e.source?.filePath?` — \`${e.source.filePath}${e.source.lineNumber==null?``:`:${e.source.lineNumber}`}\``:``;return`- \`<${e.componentName??e.tagName??`element`}>\`${t}`}).join(`
|
|
270
270
|
`);f(e=>`${e?`${e}\n`:``}${t}\n`),uj(`capture`)});let y=async()=>{m(!0);try{let{block:e,failed:t}=await f$();e&&f(t=>`${t?`${t}\n`:``}${e}\n`),t.length&&f(e=>`${e}\n<!-- upload issues: ${t.join(` · `)} -->\n`)}finally{m(!1)}},b=vr(()=>({mutationFn:e=>IO(e.id,e.text),onSuccess:()=>{f(``),l()}})),x=vr(()=>({mutationFn:e=>LO(e.id,e.model),onSuccess:t=>{e.setQueryData([`bridge-tasks`],e=>e?.map(e=>e.id===t.id?t:e)),l()}})),S=vr(()=>({mutationFn:e=>zO(e),onSuccess:l})),C,w=!0,E=()=>{C&&(w=C.scrollTop+C.clientHeight>=C.scrollHeight-48)};O(()=>{let e=s.data?.tail?.length??0;r(),!(!C||!e||!w)&&requestAnimationFrame(()=>{C&&(C.scrollTop=C.scrollHeight)})});let[ee,te]=T(null),A=async e=>{try{await navigator.clipboard.writeText(YO(e)),te(e.id),setTimeout(()=>te(null),1800)}catch{}},ne=e=>e===`running`?`var(--color-accent)`:e===`done`?`var(--color-success)`:e===`stopped`?`var(--color-warn)`:`var(--color-danger)`,re=e=>{let t=e.line.kind,n=k(()=>S$(e.line.text));return t===`user`?(()=>{var e=V1(),t=e.firstChild.nextSibling;return D(()=>t.innerHTML=n()),e})():t===`assistant`||t===`result`?(()=>{var e=H1(),r=e.firstChild,i=r.nextSibling;return st(e,`bg-surface rounded-lg border px-2.5 py-1.5 ${t===`result`?`border-success/40`:`border-border`}`),st(r,`mb-0.5 text-[9.5px] font-semibold tracking-wide uppercase ${t===`result`?`text-success`:`text-text-faint`}`),P(r,t===`result`?`Result`:`Claude`),D(()=>i.innerHTML=n()),e})():(()=>{var n=U1();return st(n,`font-mono px-1 text-[10px] leading-relaxed break-words ${t===`subagent`?`text-warn`:t===`stderr`?`text-danger`:`text-text-faint`}`),P(n,()=>e.line.text),n})()};return(()=>{var e=K1(),a=e.firstChild;a.firstChild;var l=a.nextSibling;return P(a,j(M,{get when(){return t.data?.ok},get fallback(){return j(zj,{class:`text-danger`,children:`bridge offline`})},get children(){return[j(M,{get when(){return C0(t.data.version,`0.15.1`)},get children(){return j(zj,{class:`text-warn`,title:`Ctrl+C the old process, then: npx linear-grab-bridge`,get children(){return[`v`,$e(()=>t.data.version),` outdated — restart`]}})}}),(()=>{var e=W1(),r=e.firstChild,i=r.nextSibling;return i.nextSibling,P(e,()=>t.data.active,r),P(e,()=>{let e=(n.data??[]).reduce((e,t)=>e+(t.usage?.costUsd??0),0);return e>0?` · Σ $${e.toFixed(2)}`:``},i),P(e,()=>t.data.cwd.split(`/`).slice(-2).join(`/`),null),D(()=>it(e,`title`,t.data?.cwd)),e})()]}}),null),P(l,j(M,{get when(){return t.data?.ok},get fallback(){return j(Vj,{title:`Bridge not running`,get children(){return[`Start it in your repo's terminal:`,q1(),`Then delegate from the Draft tab ("Local Claude Code") or watch tasks here. Sessions stay interactive — send follow-ups, switch models, interrupt, resume in your terminal. History persists across restarts.`]}})},get children(){return j(M,{get when(){return(n.data??[]).length>0},get fallback(){return j(Vj,{title:`No local tasks yet`,children:`Create an issue in Draft with "Delegate to → Local Claude Code", and it appears here with live status and a conversation view.`})},get children(){var e=G1();return P(e,j(Ge,{get each(){return n.data},children:e=>(()=>{var t=l0(),n=t.firstChild,a=n.firstChild,l=a.nextSibling,m=n.nextSibling,h=m.nextSibling,g=h.nextSibling;return P(n,j(M,{get when(){return e().status===`running`},get fallback(){return(()=>{var t=u0();return D(n=>dt(t,`background`,ne(e().status))),t})()},get children(){return j(Aj,{})}}),a),P(a,()=>e().title),P(l,()=>Wj(e().startedAt)),P(m,()=>e().lastText),P(h,j(zj,{get color(){return ne(e().status)},get children(){return e().status}}),null),P(h,j(zj,{get children(){return e().model??`default model`}}),null),P(h,j(M,{get when(){return e().pendingModel},get children(){return j(zj,{class:`text-warn`,get children(){return[`→ `,$e(()=>e().pendingModel),` next msg`]}})}}),null),P(h,j(M,{get when(){return e().subagents>0},get children(){return j(zj,{class:`text-warn`,get children(){return[`⛓ `,$e(()=>e().subagents),` subagents`]}})}}),null),P(h,j(M,{get when(){return e().usage},get children(){var t=J1(),n=t.firstChild.nextSibling;return n.nextSibling,P(t,()=>w0(e().usage.contextTokens),n),P(t,()=>w0(e().usage.outputTokens),null),P(t,(()=>{var t=$e(()=>!!e().usage.costUsd);return()=>t()?` · $${e().usage.costUsd.toFixed(2)}`:``})(),null),t}}),null),P(t,j(M,{get when(){return o(e())},children:e=>(()=>{var t=d0();return P(t,j(zj,{get children(){return e().state.name}}),null),P(t,j(Ij,{get href(){return e().url},children:`Open in Linear`}),null),t})()}),g),P(t,j(M,{get when(){return $e(()=>!!e().worktree)()&&!e().worktree.removed},get children(){var t=Y1(),n=t.firstChild;return P(t,j(zj,{class:`text-warn`,children:`⎇ worktree`}),n),P(n,()=>e().worktree.branch),P(t,j(M,{get when(){return e().status!==`running`},get children(){return j(kj,{variant:`ghost`,class:`ml-auto h-6 shrink-0 px-2 text-[11px]`,get loading(){return S.isPending},get title(){return`Remove the worktree at ${e().worktree.path} — the branch (and PR) survive`},onClick:()=>S.mutate(e().id),children:`Remove`})}}),null),D(()=>it(n,`title`,e().worktree.path)),t}}),g),P(g,j(Nj,{class:`h-7 w-auto min-w-0 flex-1 text-[11px]`,get value(){return e().pendingModel??e().model??``},onChange:t=>x.mutate({id:e().id,model:t.currentTarget.value}),title:`Model — applies from the next message`,get children(){return[j(We,{each:S0,children:t=>(()=>{var n=f0();return P(n,()=>t.label),D(()=>n.selected=(e().pendingModel??e().model??``)===t.id),D(()=>n.value=t.id),n})()}),j(M,{get when(){return!S0.some(t=>t.id===(e().pendingModel??e().model??``))},get children(){var t=X1();return P(t,()=>e().pendingModel??e().model),D(()=>t.value=e().pendingModel??e().model??``),t}})]}}),null),P(g,j(M,{get when(){return $e(()=>e().status!==`running`)()&&e().sessionId},get children(){return j(kj,{variant:`ghost`,class:`size-7 px-0`,get loading(){return b.isPending},get title(){return`Resume — continues this session${e().pendingModel?` on ${e().pendingModel}`:``}`},"aria-label":`Resume session`,onClick:()=>b.mutate({id:e().id,text:`Continue where you left off. If the work is already complete, finish any remaining closeout steps (PR, Linear update, announcement).`}),get children(){return Z1()}})}}),null),P(g,j(M,{get when(){return o(e())},children:e=>j(kj,{variant:`ghost`,class:`size-7 px-0`,title:`Open the issue's Activity thread`,onClick:()=>oj(`activity`,e().id),get children(){return p0()}})}),null),P(g,j(kj,{variant:`ghost`,class:`size-7 px-0`,get disabled(){return!e().sessionId},get title(){return $e(()=>!!e().sessionId)()?`Copy resume command · session ${e().sessionId.slice(0,8)}…`:`No session yet`},onClick:()=>void A(e()),get children(){return j(M,{get when(){return ee()===e().id},get fallback(){return m0()},get children(){return Q1()}})}}),null),P(g,j(kj,{variant:`ghost`,class:`size-7 px-0`,get title(){return r()===e().id?`Hide thread`:`Open thread — chat & changes`},onClick:()=>i(r()===e().id?null:e().id),get children(){return $1()}}),null),P(g,j(M,{get when(){return e().status===`running`},get children(){return j(kj,{variant:`danger`,class:`size-7 px-0`,get loading(){return u.isPending},title:`Interrupt — the session stays resumable`,onClick:()=>u.mutate(e().id),get children(){return e0()}})}}),null),P(t,j(M,{get when(){return r()===e().id},get children(){return[j(M,{get when(){return $e(()=>!!c.data)()&&(c.data.files.length||c.data.untracked.length||c.data.prs.length)},get children(){var e=n0(),t=e.firstChild,n=t.firstChild.nextSibling,r=n.firstChild;r.firstChild;var i=r.nextSibling.nextSibling;return i.firstChild,P(t,j(M,{get when(){return c.data.branch},get children(){var e=t0();return P(e,()=>c.data.branch),e}}),n),P(r,()=>c.data.totalAdded,null),P(i,()=>c.data.totalDeleted,null),P(e,j(We,{get each(){return c.data.files},children:e=>(()=>{var t=_0(),n=t.firstChild,r=n.nextSibling;return P(n,()=>e.path),P(r,j(M,{get when(){return!e.binary},get fallback(){return v0()},get children(){return[(()=>{var t=h0();return t.firstChild,P(t,()=>e.added,null),t})(),` `,(()=>{var t=g0();return t.firstChild,P(t,()=>e.deleted,null),t})()]}})),D(()=>it(n,`title`,e.path)),t})()}),null),P(e,j(We,{get each(){return c.data.untracked},children:e=>(()=>{var t=y0(),n=t.firstChild;return it(n,`title`,e),P(n,e),t})()}),null),P(e,j(We,{get each(){return c.data.prs},children:e=>(()=>{var t=b0(),n=t.firstChild;return P(t,j(zj,{class:`text-accent`,get children(){return[`PR · `,$e(()=>e.state.toLowerCase())]}}),n),P(n,()=>e.title),D(t=>{var r=e.url,i=e.title;return r!==t.e&&it(n,`href`,t.e=r),i!==t.t&&it(n,`title`,t.t=i),t},{e:void 0,t:void 0}),t})()}),null),e}}),(()=>{var e=r0();return e.addEventListener(`scroll`,E),pt(e=>{C=e,w=!0},e),P(e,j(M,{get when(){return(s.data?.tail??[]).length>0},get fallback(){return x0()},get children(){return j(Ge,{get each(){return s.data?.tail??[]},children:e=>j(re,{get line(){return e()}})})}})),e})(),(()=>{var t=c0(),n=t.firstChild,r=n.firstChild;return P(t,j(Mj,{rows:2,get placeholder(){return e().status===`running`?`Message the working agent — it queues into the live session…`:`Follow-up — resumes the session…`},get value(){return d()},onInput:e=>f(e.currentTarget.value)}),n),P(r,(()=>{var t=$e(()=>!!e().alive);return()=>t()?`live session`:e().sessionId?`resumes on send`:`no session`})()),P(n,j(kj,{variant:`ghost`,class:`size-7 shrink-0 px-0`,title:`Pick elements on the page — refs drop into this message`,"aria-label":`Pick element`,onClick:v,get children(){return i0()}}),null),P(n,j(kj,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return p()},title:`Attach captures — element refs, screenshots, region shots, recording GIF`,"aria-label":`Attach captures`,onClick:()=>void y(),get children(){return a0()}}),null),P(n,j(kj,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get disabled(){return $e(()=>!e().alive)()&&!e().sessionId},title:`Compact the session — frees context (sends /compact)`,"aria-label":`Compact session`,onClick:()=>b.mutate({id:e().id,text:`/compact`}),get children(){return o0()}}),null),P(n,j(kj,{variant:`primary`,class:`shrink-0`,get loading(){return b.isPending},get disabled(){return!d().trim()||!e().alive&&!e().sessionId},onClick:()=>b.mutate({id:e().id,text:d().trim()}),get children(){return s0()}}),null),t})()]}}),null),t})()})),e}})}})),e})()}Br();var E0=N(`<span class="text-text-faint text-[10.5px] tabular-nums">/<!> from your issues`),D0=N(`<div class="flex flex-col gap-1.5">`),O0=N(`<div class="flex h-full flex-col"><div class="border-border flex shrink-0 items-center justify-between border-b px-3 py-2"><span class="text-text text-[12px] font-semibold">Pull requests</span></div><div class="border-border flex shrink-0 items-center gap-1.5 border-b px-3 py-1.5"><div class="bg-surface-2 border-border flex shrink-0 rounded-md border p-0.5"></div></div><div class="min-h-0 flex-1 overflow-y-auto pt-2 pb-3 pl-2 pr-3">`),k0=N(`<span class="text-warn text-[10.5px]"title="Merge states come from gh via the bridge">states unknown — restart the bridge`),A0=N(`<button>`),j0=N(`<span class="text-success text-[11px]">✓`),M0=N(`<span class="text-[12px] leading-none">✓`),N0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=1.6 fill=currentColor stroke=none>`),P0=N(`<span class="text-success text-[12px] leading-none">✓`),F0=N(`<div class="bg-surface border-border flex flex-col gap-1.5 rounded-lg border p-2.5"><a target=_blank rel=noreferrer class="text-accent truncate text-[12.5px] font-medium hover:underline"></a><div class="flex min-w-0 items-center gap-1.5"><span class="font-mono text-text-dim shrink-0 text-[11px]"></span><span class="text-text-dim truncate text-[11.5px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"></span></div><div class="flex min-w-0 flex-wrap items-center gap-1.5"><div class="ml-auto flex shrink-0 items-center gap-1">`),I0=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 2 14 5.5 8 9 2 5.5 8 2Z"></path><path d="M2 10.5 8 14l6-3.5">`),L0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=4 cy=3.5 r=1.5></circle><circle cx=4 cy=12.5 r=1.5></circle><circle cx=12 cy=8 r=1.5></circle><path d="M4 5v6M4 6.5c0 2 2 3 4.5 3h2">`),R0=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),z0=/github\.com\/[^/]+\/[^/]+\/pull\/\d+/i;function B0(e){let t=_r(()=>({queryKey:[`my-issues`],queryFn:fO,refetchInterval:15e3})),n=k(()=>(t.data??[]).flatMap(e=>(e.attachments??[]).filter(e=>z0.test(e.url)).map(t=>({issue:e,attachment:t})))),r=_r(()=>({queryKey:[`bridge-tasks`],queryFn:NO,refetchInterval:1e4,retry:0})),i=_r(()=>({queryKey:[`pr-status`,n().map(e=>e.attachment.url).sort().join(`|`)],queryFn:()=>HO(n().map(e=>e.attachment.url)),refetchInterval:3e4,retry:0,enabled:n().length>0})),[a,o]=T(new Set),s=e=>a().has(e.attachment.url)?`MERGED`:i.data?.statuses[e.attachment.url],c=e=>!!r.data?.some(t=>t.title.startsWith(e.issue.identifier)),[l,u]=T(`all`),[d,f]=T(``),p=k(()=>{let e=d().trim().toLowerCase();return n().filter(t=>{let n=t.issue.state.type,r=s(t);return!(l()===`review`&&(n!==`started`||r===`MERGED`||r===`CLOSED`)||l()===`open`&&(r===`MERGED`||r===`CLOSED`||!(n===`started`||n===`unstarted`||n===`backlog`))||l()===`done`&&!(n===`completed`||r===`MERGED`||r===`CLOSED`)||e&&![t.attachment.title,t.issue.title,t.issue.identifier].join(` `).toLowerCase().includes(e))})}),m=_r(()=>({queryKey:[`settings`],queryFn:Tr})),h=()=>m.data?.stagingBranch?.trim()||`staging`,[g,_]=T(null),[v,y]=T(new Set),[b,x]=T(null),S=async e=>{_(e),x(null);try{await UO(e,h()),y(t=>new Set(t).add(e))}catch(e){x(e instanceof Error?e.message:String(e))}finally{_(null)}},[C,w]=T(null),[E,O]=T(null),ee=async e=>{O(e);try{await qO(e),o(t=>new Set(t).add(e))}catch{}finally{O(null)}},te=async e=>{try{await navigator.clipboard.writeText(e.attachment.url),w(e.attachment.id),setTimeout(()=>w(null),1500)}catch{}};return(()=>{var r=O0(),o=r.firstChild;o.firstChild;var m=o.nextSibling,_=m.firstChild,y=m.nextSibling;return P(o,j(M,{get when(){return!i.isError},get fallback(){return k0()},get children(){var e=E0(),t=e.firstChild,r=t.nextSibling;return r.nextSibling,P(e,()=>p().length,t),P(e,()=>n().length,r),e}}),null),P(_,j(We,{each:[{id:`all`,label:`All`},{id:`review`,label:`Review`},{id:`open`,label:`Open`},{id:`done`,label:`Done`}],children:e=>(()=>{var t=A0();return t.$$click=()=>u(e.id),P(t,()=>e.label),D(()=>st(t,`rounded-[5px] px-2 py-0.5 text-[11px] font-medium transition-colors ${l()===e.id?`bg-surface-3 text-text`:`text-text-dim hover:text-text cursor-pointer`}`)),t})()})),P(m,j(jj,{class:`h-6 min-w-0 flex-1 text-[11px]`,placeholder:`Search PRs…`,get value(){return d()},onInput:e=>f(e.currentTarget.value)}),null),P(y,j(M,{get when(){return p().length>0},get fallback(){return j(Vj,{title:`No PRs yet`,get children(){return $e(()=>!!t.isError)()?`Connect Linear in Settings.`:n().length>0?`No PRs match the current filter.`:`PRs opened by delegated agents appear here as soon as they link back to your issues.`}})},get children(){var t=D0();return P(t,j(We,{get each(){return p()},children:t=>(()=>{var n=F0(),r=n.firstChild,o=r.nextSibling,l=o.firstChild,u=l.nextSibling,d=u.nextSibling,f=o.nextSibling,p=f.firstChild;return P(r,()=>t.attachment.title||t.attachment.url),P(n,j(M,{get when(){return i.data?.previews[t.attachment.url]},get children(){return j(Ij,{get href(){return i.data.previews[t.attachment.url]},class:`shrink-0 self-start`,title:`Vercel deploy preview of this PR's branch`,children:`Preview`})}}),o),P(o,j(Bj,{get color(){return t.issue.state.color}}),l),P(l,()=>t.issue.identifier),P(u,()=>t.issue.title),P(d,()=>Wj(t.issue.updatedAt)),P(f,j(zj,{get children(){return t.issue.state.name}}),p),P(f,j(M,{get when(){return t.issue.delegate},get children(){return j(zj,{class:`text-accent`,get children(){return[j(Pj,{}),` `,$e(()=>t.issue.delegate.displayName)]}})}}),p),P(f,j(M,{get when(){return c(t)},get children(){return j(zj,{class:`text-warn`,get children(){return[j(Fj,{}),` local`]}})}}),p),P(f,j(Ij,{get href(){return t.issue.url},class:`shrink-0`,title:`Open the issue in Linear`,children:`Linear`}),p),P(p,j(M,{get when(){return $e(()=>!!s(t))()&&s(t)!==`OPEN`},get children(){return j(zj,{get class(){return s(t)===`MERGED`?`text-success`:`text-text-faint`},get children(){return s(t)===`MERGED`?`✓ merged`:`closed`}})}}),null),P(p,j(kj,{variant:`ghost`,class:`size-7 shrink-0 px-0`,get loading(){return g()===t.attachment.url},get disabled(){return v().has(t.attachment.url)},get title(){return $e(()=>!!v().has(t.attachment.url))()?`On ${h()} — staging preview deploying`:`Merge into ${h()} — deploys the staging preview domain`},"aria-label":`Merge to staging`,onClick:()=>void S(t.attachment.url),get children(){return j(M,{get when(){return v().has(t.attachment.url)},get fallback(){return I0()},get children(){return j0()}})}}),null),P(p,j(kj,{variant:`primary`,class:`size-7 px-0`,get classList(){return{hidden:!!s(t)&&s(t)!==`OPEN`}},get loading(){return E()===t.attachment.url},get disabled(){return a().has(t.attachment.url)},get title(){return a().has(t.attachment.url)?`Merged`:`Squash-merge this PR (bridge gh)`},"aria-label":`Merge PR`,onClick:()=>void ee(t.attachment.url),get children(){return j(M,{get when(){return a().has(t.attachment.url)},get fallback(){return L0()},get children(){return M0()}})}}),null),P(p,j(kj,{variant:`ghost`,class:`size-7 px-0`,title:`Open the issue's Activity thread`,"aria-label":`Open issue activity`,onClick:()=>{oj(`activity`,t.issue.id),e.onOpenIssue()},get children(){return N0()}}),null),P(p,j(kj,{variant:`ghost`,class:`size-7 px-0`,title:`Copy PR URL`,"aria-label":`Copy PR URL`,onClick:()=>void te(t),get children(){return j(M,{get when(){return C()===t.attachment.id},get fallback(){return R0()},get children(){return P0()}})}}),null),P(f,j(M,{get when(){return v().has(t.attachment.url)},get children(){return j(u$,{get url(){return t.attachment.url},get base(){return h()}})}}),null),D(e=>{var n=t.attachment.url,i=t.attachment.title;return n!==e.e&&it(r,`href`,e.e=n),i!==e.t&&it(r,`title`,e.t=i),e},{e:void 0,t:void 0}),n})()})),t}})),r})()}rt([`click`]);var V0=[`display`,`align-items`,`justify-content`,`gap`,`padding`,`margin`,`width`,`height`,`font-size`,`font-weight`,`line-height`,`letter-spacing`,`color`,`background-color`,`border-radius`,`border-width`,`border-color`,`box-shadow`,`opacity`,`transform`,`transition-property`,`transition-duration`],H0=new Set([`color`,`background-color`,`border-color`]),U0={margin:new Set([`0px`]),padding:new Set([`0px`]),gap:new Set([`normal`,`0px`]),"box-shadow":new Set([`none`]),transform:new Set([`none`]),"border-width":new Set([`0px`]),"border-radius":new Set([`0px`]),"letter-spacing":new Set([`normal`]),opacity:new Set([`1`]),"transition-property":new Set([`all`,`none`]),"transition-duration":new Set([`0s`]),width:new Set([`auto`]),height:new Set([`auto`])},W0=null;function G0(e){try{return W0||(W0=document.createElement(`span`),W0.style.display=`none`,document.body.appendChild(W0)),W0.style.color=``,W0.style.color=e,W0.style.color?getComputedStyle(W0).color:null}catch{return null}}var K0=null;function q0(){if(K0)return K0;let e=new Map,t=getComputedStyle(document.documentElement),n=new Set;for(let r of Array.from(document.styleSheets)){let i;try{i=r.cssRules}catch{continue}for(let r of Array.from(i)){let i=r.style;if(i)for(let r=0;r<i.length;r++){let a=i.item(r);if(!a.startsWith(`--`)||n.has(a))continue;n.add(a);let o=t.getPropertyValue(a).trim()||i.getPropertyValue(a).trim();if(!o||o.length>80)continue;let s=G0(o);s&&!e.has(s)&&e.set(s,a)}}}return K0=e,e}function J0(e){let t=e.getBoundingClientRect();if(t.width<2&&t.height<2)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.visibility!==`hidden`}function Y0(e){let t=[],n=e.getAttribute(`role`);n&&t.push(n);for(let n of[`data-state`,`data-highlighted`,`aria-expanded`,`aria-selected`,`data-active`]){let r=e.getAttribute(n);r!=null&&t.push(`${n.replace(/^(data|aria)-/,``)}=${r||`true`}`)}return t.join(` `)}async function X0(){try{return(await Promise.resolve().then(()=>(RZ(),AZ))).getGlobalApi()?.getDisplayName??null}catch{return null}}function Z0(e,t){let n=null;try{n=t?.(e)??null}catch{}let r=Y0(e),i=n||e.tagName.toLowerCase();return r?`${i} [${r}]`:i}function Q0(e,t){let n=getComputedStyle(e),r={},i={};for(let e of V0){let a=n.getPropertyValue(e).trim();if(!(!a||U0[e]?.has(a)))if(H0.has(e)){let n=G0(a);if(n===`rgba(0, 0, 0, 0)`)continue;let o=n?t.get(n):void 0;o&&(i[e]=o),r[e]=a}else r[e]=a}return{styles:r,tok:i}}var $0=40;async function e2(e){let t=q0(),n=await X0(),r=[],i=new Map,a=e=>{if(r.length>=$0||!J0(e))return;let o=typeof e.className==`string`?e.className:``,s=`${e.tagName}|${o}`,c=i.get(s);if(c)c.count+=1;else{let{styles:a,tok:c}=Q0(e,t),l={label:Z0(e,n),count:1,classes:o,styles:a,tokens:c};i.set(s,l),r.push(l)}for(let t of Array.from(e.children))a(t)};return a(e),{title:r[0]?.label??e.tagName.toLowerCase(),pageUrl:location.href,extractedAt:Date.now(),nodes:r,states:[]}}var t2={active:!1,msLeft:0,total:0,byTrigger:{}},n2=new Set;function r2(e){t2={...t2,...e};for(let e of n2)e(t2)}function i2(e){return n2.add(e),e(t2),()=>void n2.delete(e)}var a2=null;function o2(){a2?.()}function s2(e){return e===`hover`||e===`focus`?e:`open`}async function c2(e,t,n){let r=q0(),i=await X0(),a=[],o=new Set,s=new Map,c=e=>Q0(e,r).styles,l=e=>{if(!(s.size>=120)){s.set(e,c(e));for(let t of Array.from(e.children))l(t)}};l(e);let u=(e,t)=>{let n=s.get(e);if(!n)return;let r=c(e),l={};for(let e of new Set([...Object.keys(n),...Object.keys(r)])){let t=n[e]??`(unset)`,i=r[e]??`(unset)`;t!==i&&(l[e]={from:t,to:i})}if(Object.keys(l).length===0)return;let u=Z0(e,i),d=`${t}|${u}|${Object.keys(l).join(`,`)}`;if(o.has(d))return;o.add(d),a.push({trigger:t,label:u,changed:l});let f=s2(t);r2({total:t2.total+1,byTrigger:{...t2.byTrigger,[f]:(t2.byTrigger[f]??0)+1}})},d=e=>{let t=e.target;t instanceof Element&&s.has(t)&&setTimeout(()=>u(t,`hover`),50)},f=e=>{let t=e.target;t instanceof Element&&s.has(t)&&setTimeout(()=>u(t,`focus`),50)};e.addEventListener(`pointerover`,d,!0),e.addEventListener(`focusin`,f,!0);let p=new MutationObserver(e=>{for(let t of e){if(t.type!==`attributes`||!(t.target instanceof Element))continue;let e=t.target,n=t.attributeName??``,r=e.getAttribute(n)??``;setTimeout(()=>u(e,`attr:${n}=${r||`true`}`),50)}});p.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`class`,`data-state`,`data-highlighted`,`aria-expanded`,`aria-selected`,`open`]});let m=new MutationObserver(t=>{for(let n of t)for(let t of Array.from(n.addedNodes))!(t instanceof Element)||e.contains(t)||t.id===`linear-grab-root`||t.closest?.(`#linear-grab-root`)||setTimeout(()=>{if(!t.isConnected||!J0(t))return;let{styles:e}=Q0(t,r);if(Object.keys(e).length===0)return;let n=Z0(t,i),s=`appeared|${n}`;if(o.has(s))return;o.add(s);let c={};for(let[t,n]of Object.entries(e))c[t]={from:`(absent)`,to:n};a.push({trigger:`appeared (portal/open)`,label:n,changed:c}),r2({total:t2.total+1,byTrigger:{...t2.byTrigger,open:(t2.byTrigger.open??0)+1}})},50)});m.observe(document.body,{childList:!0,subtree:!1}),r2({active:!0,msLeft:t,total:0,byTrigger:{}});let h=setInterval(()=>{let e=t-(Date.now()-g);n?.(Math.max(0,e)),r2({msLeft:Math.max(0,e)})},250),g=Date.now();return await new Promise(e=>{let n=setTimeout(e,t);a2=()=>{clearTimeout(n),e()}}),a2=null,r2({active:!1,msLeft:0}),clearInterval(h),e.removeEventListener(`pointerover`,d,!0),e.removeEventListener(`focusin`,f,!0),p.disconnect(),m.disconnect(),a}function l2(e){let t=[`# Design genome: ${e.title}`,`Extracted from ${e.pageUrl}`,``,`## Structure`];for(let n of e.nodes){t.push(`### ${n.label}${n.count>1?` ×${n.count}`:``}`),n.classes&&t.push(`classes: \`${n.classes}\``);let e=Object.entries(n.styles).map(([e,t])=>{let r=n.tokens[e];return`${e}: ${t}${r?` ← var(${r})`:``}`});e.length&&t.push("```",...e,"```")}if(e.states.length){t.push(``,`## Interaction states`);for(let n of e.states)t.push(`### ${n.label} — ${n.trigger}`),t.push("```",...Object.entries(n.changed).map(([e,t])=>`${e}: ${t.from} → ${t.to}`),"```")}return t.join(`
|
|
271
|
-
`)}function u2(){return new Promise(e=>{let t=document.createElement(`div`);t.style.cssText=`position:fixed;z-index:2147483647;pointer-events:none;border:1.5px solid #5e6ad2;border-radius:4px;background:rgba(94,106,210,0.08);display:none;`,document.body.appendChild(t);let n=null,r=e=>{let t=document.elementFromPoint(e.clientX,e.clientY);return!t||t.closest(`#linear-grab-root`)?null:t},i=e=>{let i=r(e);if(n=i,!i){t.style.display=`none`;return}let a=i.getBoundingClientRect();t.style.display=`block`,t.style.left=`${a.left-2}px`,t.style.top=`${a.top-2}px`,t.style.width=`${a.width+4}px`,t.style.height=`${a.height+4}px`},a=n=>{t.remove(),window.removeEventListener(`mousemove`,i,!0),window.removeEventListener(`click`,o,!0),window.removeEventListener(`keydown`,s,!0),e(n)},o=e=>{e.preventDefault(),e.stopPropagation(),a(n)},s=e=>{e.key===`Escape`&&(e.stopPropagation(),a(null))};window.addEventListener(`mousemove`,i,!0),window.addEventListener(`click`,o,!0),window.addEventListener(`keydown`,s,!0)})}var d2=200;function f2(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?parseFloat(t)||0:t.endsWith(`s`)?(parseFloat(t)||0)*1e3:0})}function p2(e){let t=e.id?`#${e.id}`:``,n=typeof e.className==`string`&&e.className?`.${e.className.split(/\s+/).filter(Boolean).slice(0,2).join(`.`)}`:``;return`${e.tagName.toLowerCase()}${t}${n}`}function m2(e){if(typeof e.className!=`string`)return;let t=e.className.split(/\s+/).filter(e=>/^(transition|duration-|delay-|ease-)/.test(e));return t.length?t.join(` `):void 0}var h2=new Set(`width.height.min-width.min-height.max-width.max-height.top.left.right.bottom.inset.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font-size.line-height.letter-spacing.box-shadow.filter.background-position.grid-template-columns.grid-template-rows.flex-basis.gap`.split(`.`));function g2(e){return e.includes(`all`)?[`all (includes layout/paint props)`]:e.filter(e=>h2.has(e))}function _2(e){let t=e.split(`,`)[0].trim();if(t===`ease-in`)return`ease-in`;let n=t.match(/cubic-bezier\(\s*([\d.]+)\s*,\s*(-?[\d.]+)/);return n&&parseFloat(n[1])>=.4&&parseFloat(n[2])<=.1?t:null}function v2(e,t,n,r,i,a){let o=[];return n>0&&o.push(`remove the ${Math.round(n)}ms transition-delay`),(r?.includes(`transition-all`)||e.includes(`all`))&&o.push(`scope 'transition-all' to the intended properties (e.g. transition-colors)`),a?.length&&o.push(`JANK: transitions LAYOUT/PAINT props (${a.join(`, `)}) — reflow/repaint every frame; animate transform/opacity instead (box-shadow → animate a pseudo-element's opacity)`),i&&o.push(`easing '${i}' starts slow — never ease-in on UI, use ease-out`),t>500?o.push(`${Math.round(t)}ms is over the 500ms HARD CAP for UI feedback`):t>300?o.push(`${Math.round(t)}ms is over the 300ms UI cap`):t>100&&o.push(`shorten ${Math.round(t)}ms → ≤100ms`),o.push(`make PRESS feedback instant: 'active:transition-none' (and data-[state=…]:transition-none for toggles) — animate only hover in/out`),o.join(`; `)}async function y2(){try{return(await Promise.resolve().then(()=>(RZ(),AZ))).getGlobalApi()??null}catch{return null}}async function b2(e){let t=await y2(),n=null,r=null;try{n=t?.getDisplayName?.(e)??null}catch{}try{let n=await t?.getSource?.(e);n?.filePath&&(r=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}return{component:n,source:r}}var x2=[],S2=null;function C2(e){x2.push(e),S2??=setTimeout(()=>{S2=null;let e=x2.slice(0,50).map(e=>({kind:`css-slowdown`,...e}));x2=[],JO().then(t=>fetch(`${t}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:e}),keepalive:!0})).catch(()=>{})},1500)}var w2=[],T2=new Set;function E2(e){w2=[e,...w2].slice(0,100);for(let e of T2)e(w2);C2(e)}function D2(e){return T2.add(e),e(w2),()=>void T2.delete(e)}function O2(){w2=[];for(let e of T2)e(w2)}var k2=!0;try{k2=localStorage.getItem(`linear-grab:css-watch`)!==`0`}catch{}var A2=new Set;function j2(){return k2}function M2(e){k2=e;try{localStorage.setItem(`linear-grab:css-watch`,e?`1`:`0`)}catch{}for(let t of A2)t(e)}function N2(e){return A2.add(e),e(k2),()=>void A2.delete(e)}var P2=!1;function F2(){if(P2||typeof window>`u`)return;P2=!0;let e=0,t=()=>{e=performance.now()};for(let e of[`pointerdown`,`pointerup`,`keydown`])window.addEventListener(e,t,{capture:!0,passive:!0});let n=new Map,r=new Map;window.addEventListener(`transitionrun`,t=>{if(!k2)return;let i=performance.now()-e;if(i>d2)return;let a=t.target;if(!(a instanceof Element)||a.closest(`#linear-grab-root`)||a===document.documentElement||a===document.body||t.propertyName.startsWith(`--`))return;let o=getComputedStyle(a),s=o.transitionProperty.split(`,`).map(e=>e.trim()),c=f2(o.transitionDuration),l=f2(o.transitionDelay),u=Math.max(0,s.indexOf(t.propertyName)),d=c[u%c.length]??c[0]??0,f=l[u%l.length]??l[0]??0;if(d+f<50)return;let p=r.get(a);if(p){p.props.add(t.propertyName),p.duration=Math.max(p.duration,d),p.delay=Math.max(p.delay,f);return}let m={props:new Set([t.propertyName]),duration:d,delay:f,since:i,timer:setTimeout(()=>{r.delete(a);let e=p2(a),t=Date.now();if(t-(n.get(e)??0)<5e3)return;n.set(e,t);let i=m2(a),o=[...m.props],s=a.isConnected?_2(getComputedStyle(a).transitionTimingFunction):null,c=g2(o);b2(a).then(({component:n,source:r})=>{E2({mode:`live`,page:location.pathname,element:e,component:n,source:r,properties:o,durationMs:Math.round(m.duration),delayMs:Math.round(m.delay),sinceInputMs:Math.round(m.since),count:1,classHint:i,easing:s??void 0,jankProps:c.length?c:void 0,suggestion:v2(o,m.duration,m.delay,i,s,c),at:t})})},300)};r.set(a,m)},{capture:!0,passive:!0})}var I2=`button, a, input, select, textarea, [role], [tabindex], [data-state], [aria-expanded]`;async function L2(){let e=new Map,t=Array.from(document.querySelectorAll(I2)).slice(0,3e3);for(let n of t){if(n.closest(`#linear-grab-root`))continue;let t=n.getBoundingClientRect();if(t.width<2&&t.height<2)continue;let r=getComputedStyle(n);if(r.cursor!==`pointer`&&!n.matches(`button, a, input, select, textarea`))continue;let i=f2(r.transitionDuration),a=f2(r.transitionDelay),o=Math.max(...i,0)+Math.max(...a,0);if(o<50)continue;let s=r.transitionProperty.split(`,`).map(e=>e.trim()),c=m2(n),l=`${n.tagName}|${c??s.join()}|${Math.round(o)}`,u=e.get(l);if(u){u.finding.count+=1;continue}let d=_2(r.transitionTimingFunction),f=g2(s);e.set(l,{example:n,finding:{mode:`audit`,page:location.pathname,element:p2(n),component:null,source:null,properties:s,durationMs:Math.round(Math.max(...i,0)),delayMs:Math.round(Math.max(...a,0)),count:1,classHint:c,easing:d??void 0,jankProps:f.length?f:void 0,suggestion:v2(s,Math.max(...i,0),Math.max(...a,0),c,d,f),at:Date.now()}})}let n=[];for(let{finding:t,example:r}of e.values()){let{component:e,source:i}=await b2(r);t.component=e,t.source=i,n.push(t)}n.sort((e,t)=>t.durationMs+t.delayMs-(e.durationMs+e.delayMs)||t.count-e.count),w2=[...n,...w2.filter(e=>e.mode===`live`)].slice(0,100);for(let e of T2)e(w2);for(let e of n)C2(e);return n}function R2(e){return[`Below is a CSS-slowdown report from my running app (live-captured on real input + full-page audit).`,`Goal: ALL interaction feedback must be instant. Rules:`,``,`1. Most of these come from SHARED design-system variants — fix the VARIANT`,` DEFINITIONS, not the call sites. Grep for the exact class recipes in the`," findings' `classes:` lines (e.g. `transition-all`, `transition-colors duration-150`).","2. Press/toggle state changes get NO transition: add `active:transition-none`"," and `data-[state=on]:transition-none` / `data-[state=open]:transition-none`.",` Hover in/out may keep a transition but shorten it: duration-150 → duration-100`,` (duration-75 for small controls like tabs and icon buttons).`,"3. Replace every `transition-all` with the scoped variant (transition-colors /",` transition-transform / transition-opacity — per what actually changes).`,`3b. Findings marked ⚠ layout/paint: NEVER transition width/height/top/left/`,` margin/padding/box-shadow — they reflow or repaint every frame. Use`,` transform: translate/scale, and animate a pseudo-element's opacity for shadows.`,`3c. Findings marked ⚠ easing: never ease-in on UI — replace with ease-out`,` (house curve: cubic-bezier(.2,0,.1,1)).`,`4. Where a finding's source looks like a generic fallback (one file:line repeated`," for many components), locate the code by the `classes:` line instead.",`5. Do NOT touch entry/exit animations of popovers/menus or icon micro-motion`,` (chevron rotate etc.) — that is intentional; only input FEEDBACK must be instant.`,`6. PROOF REQUIRED: after the change I will re-run the audit — it must show zero`,` interactive elements ≥100ms and clicking must produce no live findings.`,` Do not claim done without stating what you changed per variant.`,``,`---`,``,z2(e)].join(`
|
|
271
|
+
`)}function u2(){return new Promise(e=>{let t=document.createElement(`div`);t.style.cssText=`position:fixed;z-index:2147483647;pointer-events:none;border:1.5px solid #5e6ad2;border-radius:4px;background:rgba(94,106,210,0.08);display:none;`,document.body.appendChild(t);let n=null,r=e=>{let t=document.elementFromPoint(e.clientX,e.clientY);return!t||t.closest(`#linear-grab-root`)?null:t},i=e=>{let i=r(e);if(n=i,!i){t.style.display=`none`;return}let a=i.getBoundingClientRect();t.style.display=`block`,t.style.left=`${a.left-2}px`,t.style.top=`${a.top-2}px`,t.style.width=`${a.width+4}px`,t.style.height=`${a.height+4}px`},a=n=>{t.remove(),window.removeEventListener(`mousemove`,i,!0),window.removeEventListener(`click`,o,!0),window.removeEventListener(`keydown`,s,!0),e(n)},o=e=>{e.preventDefault(),e.stopPropagation(),a(n)},s=e=>{e.key===`Escape`&&(e.stopPropagation(),a(null))};window.addEventListener(`mousemove`,i,!0),window.addEventListener(`click`,o,!0),window.addEventListener(`keydown`,s,!0)})}var d2=200;function f2(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?parseFloat(t)||0:t.endsWith(`s`)?(parseFloat(t)||0)*1e3:0})}function p2(e){let t=e.id?`#${e.id}`:``,n=typeof e.className==`string`&&e.className?`.${e.className.split(/\s+/).filter(Boolean).slice(0,2).join(`.`)}`:``;return`${e.tagName.toLowerCase()}${t}${n}`}function m2(e){if(typeof e.className!=`string`)return;let t=e.className.split(/\s+/).filter(e=>/^(transition|duration-|delay-|ease-)/.test(e));return t.length?t.join(` `):void 0}var h2=new Set(`width.height.min-width.min-height.max-width.max-height.top.left.right.bottom.inset.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font-size.line-height.letter-spacing.box-shadow.filter.background-position.grid-template-columns.grid-template-rows.flex-basis.gap`.split(`.`));function g2(e){return e.includes(`all`)?[`all (includes layout/paint props)`]:e.filter(e=>h2.has(e))}function _2(e){let t=e.split(`,`)[0].trim();if(t===`ease-in`)return`ease-in`;let n=t.match(/cubic-bezier\(\s*([\d.]+)\s*,\s*(-?[\d.]+)/);return n&&parseFloat(n[1])>=.4&&parseFloat(n[2])<=.1?t:null}function v2(e,t,n,r,i,a){let o=[];return n>0&&o.push(`remove the ${Math.round(n)}ms transition-delay`),(r?.includes(`transition-all`)||e.includes(`all`))&&o.push(`scope 'transition-all' to the intended properties (e.g. transition-colors)`),a?.length&&o.push(`JANK: transitions LAYOUT/PAINT props (${a.join(`, `)}) — reflow/repaint every frame; animate transform/opacity instead (box-shadow → animate a pseudo-element's opacity)`),i&&o.push(`easing '${i}' starts slow — never ease-in on UI, use ease-out`),t>500?o.push(`${Math.round(t)}ms is over the 500ms HARD CAP for UI feedback`):t>300?o.push(`${Math.round(t)}ms is over the 300ms UI cap`):t>100&&o.push(`shorten ${Math.round(t)}ms → ≤100ms`),o.push(`make PRESS feedback instant: 'active:transition-none' (and data-[state=…]:transition-none for toggles) — animate only hover in/out`),o.join(`; `)}async function y2(){try{return(await Promise.resolve().then(()=>(RZ(),AZ))).getGlobalApi()??null}catch{return null}}async function b2(e){let t=await y2(),n=null,r=null;try{n=t?.getDisplayName?.(e)??null}catch{}try{let n=await t?.getSource?.(e);n?.filePath&&(r=`${n.filePath}${n.lineNumber==null?``:`:${n.lineNumber}`}`)}catch{}return{component:n,source:r}}var x2=[],S2=null;function C2(e){x2.push(e),S2??=setTimeout(()=>{S2=null;let e=x2.slice(0,50).map(e=>({kind:`css-slowdown`,...e}));x2=[],JO().then(t=>fetch(`${t}/scan/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({events:e}),keepalive:!0})).catch(()=>{})},1500)}var w2=[],T2=new Set;function E2(e){let t=e.mode===`live`?w2.find(t=>t.mode===`live`&&t.element===e.element&&(t.classHint??``)===(e.classHint??``)&&t.properties.join()===e.properties.join()):void 0;t?(t.count+=1,t.at=e.at,t.sinceInputMs=e.sinceInputMs,w2=[...w2]):w2=[e,...w2].slice(0,100);for(let e of T2)e(w2);C2(e)}function D2(e){return T2.add(e),e(w2),()=>void T2.delete(e)}function O2(){w2=[];for(let e of T2)e(w2)}var k2=!0;try{k2=localStorage.getItem(`linear-grab:css-watch`)!==`0`}catch{}var A2=new Set;function j2(){return k2}function M2(e){k2=e;try{localStorage.setItem(`linear-grab:css-watch`,e?`1`:`0`)}catch{}for(let t of A2)t(e)}function N2(e){return A2.add(e),e(k2),()=>void A2.delete(e)}var P2=!1;function F2(){if(P2||typeof window>`u`)return;P2=!0;let e=0,t=()=>{e=performance.now()};for(let e of[`pointerdown`,`pointerup`,`keydown`])window.addEventListener(e,t,{capture:!0,passive:!0});let n=new Map,r=new Map;window.addEventListener(`transitionrun`,t=>{if(!k2)return;let i=performance.now()-e;if(i>d2)return;let a=t.target;if(!(a instanceof Element)||a.closest(`#linear-grab-root`)||a===document.documentElement||a===document.body||t.propertyName.startsWith(`--`))return;let o=getComputedStyle(a),s=o.transitionProperty.split(`,`).map(e=>e.trim()),c=f2(o.transitionDuration),l=f2(o.transitionDelay),u=Math.max(0,s.indexOf(t.propertyName)),d=c[u%c.length]??c[0]??0,f=l[u%l.length]??l[0]??0;if(d+f<50)return;let p=r.get(a);if(p){p.props.add(t.propertyName),p.duration=Math.max(p.duration,d),p.delay=Math.max(p.delay,f);return}let m={props:new Set([t.propertyName]),duration:d,delay:f,since:i,timer:setTimeout(()=>{r.delete(a);let e=p2(a),t=Date.now();if(t-(n.get(e)??0)<5e3)return;n.set(e,t);let i=m2(a),o=[...m.props],s=a.isConnected?_2(getComputedStyle(a).transitionTimingFunction):null,c=g2(o);b2(a).then(({component:n,source:r})=>{E2({mode:`live`,page:location.pathname,element:e,component:n,source:r,properties:o,durationMs:Math.round(m.duration),delayMs:Math.round(m.delay),sinceInputMs:Math.round(m.since),count:1,classHint:i,easing:s??void 0,jankProps:c.length?c:void 0,suggestion:v2(o,m.duration,m.delay,i,s,c),at:t})})},300)};r.set(a,m)},{capture:!0,passive:!0})}var I2=`button, a, input, select, textarea, [role], [tabindex], [data-state], [aria-expanded]`;async function L2(){let e=new Map,t=Array.from(document.querySelectorAll(I2)).slice(0,3e3);for(let n of t){if(n.closest(`#linear-grab-root`))continue;let t=n.getBoundingClientRect();if(t.width<2&&t.height<2)continue;let r=getComputedStyle(n);if(r.cursor!==`pointer`&&!n.matches(`button, a, input, select, textarea`))continue;let i=f2(r.transitionDuration),a=f2(r.transitionDelay),o=Math.max(...i,0)+Math.max(...a,0);if(o<50)continue;let s=r.transitionProperty.split(`,`).map(e=>e.trim()),c=m2(n),l=`${n.tagName}|${c??s.join()}|${Math.round(o)}`,u=e.get(l);if(u){u.finding.count+=1;continue}let d=_2(r.transitionTimingFunction),f=g2(s);e.set(l,{example:n,finding:{mode:`audit`,page:location.pathname,element:p2(n),component:null,source:null,properties:s,durationMs:Math.round(Math.max(...i,0)),delayMs:Math.round(Math.max(...a,0)),count:1,classHint:c,easing:d??void 0,jankProps:f.length?f:void 0,suggestion:v2(s,Math.max(...i,0),Math.max(...a,0),c,d,f),at:Date.now()}})}let n=[];for(let{finding:t,example:r}of e.values()){let{component:e,source:i}=await b2(r);t.component=e,t.source=i,n.push(t)}n.sort((e,t)=>t.durationMs+t.delayMs-(e.durationMs+e.delayMs)||t.count-e.count),w2=[...n,...w2.filter(e=>e.mode===`live`)].slice(0,100);for(let e of T2)e(w2);for(let e of n)C2(e);return n}function R2(e){return[`Below is a CSS-slowdown report from my running app (live-captured on real input + full-page audit).`,`Goal: ALL interaction feedback must be instant. Rules:`,``,`1. Most of these come from SHARED design-system variants — fix the VARIANT`,` DEFINITIONS, not the call sites. Grep for the exact class recipes in the`," findings' `classes:` lines (e.g. `transition-all`, `transition-colors duration-150`).","2. Press/toggle state changes get NO transition: add `active:transition-none`"," and `data-[state=on]:transition-none` / `data-[state=open]:transition-none`.",` Hover in/out may keep a transition but shorten it: duration-150 → duration-100`,` (duration-75 for small controls like tabs and icon buttons).`,"3. Replace every `transition-all` with the scoped variant (transition-colors /",` transition-transform / transition-opacity — per what actually changes).`,`3b. Findings marked ⚠ layout/paint: NEVER transition width/height/top/left/`,` margin/padding/box-shadow — they reflow or repaint every frame. Use`,` transform: translate/scale, and animate a pseudo-element's opacity for shadows.`,`3c. Findings marked ⚠ easing: never ease-in on UI — replace with ease-out`,` (house curve: cubic-bezier(.2,0,.1,1)).`,`4. Where a finding's source looks like a generic fallback (one file:line repeated`," for many components), locate the code by the `classes:` line instead.",`5. Do NOT touch entry/exit animations of popovers/menus or icon micro-motion`,` (chevron rotate etc.) — that is intentional; only input FEEDBACK must be instant.`,`6. PROOF REQUIRED: after the change I will re-run the audit — it must show zero`,` interactive elements ≥100ms and clicking must produce no live findings.`,` Do not claim done without stating what you changed per variant.`,``,`---`,``,z2(e)].join(`
|
|
272
272
|
`)}function z2(e){let t=[`# CSS slowdowns on ${location.host}${location.pathname}`,`Threshold: 50ms (interaction feedback should be instant).`,``];for(let n of e)t.push(`## ${n.component??n.element}${n.count>1?` ×${n.count}`:``} — ${n.durationMs}ms${n.delayMs?` +${n.delayMs}ms delay`:``}`),n.source&&t.push(`- source: ${n.source}`),t.push(`- transitions: ${n.properties.join(`, `)}`),n.classHint&&t.push(`- classes: \`${n.classHint}\``),n.jankProps?.length&&t.push(`- ⚠ layout/paint transition (reflows every frame): ${n.jankProps.join(`, `)}`),n.easing&&t.push(`- ⚠ easing: ${n.easing} (ease-in starts slow — use ease-out)`),n.sinceInputMs!=null&&t.push(`- fired ${n.sinceInputMs}ms after user input (live capture)`),t.push(`- fix: ${n.suggestion}`,``);return t.join(`
|
|
273
273
|
`)}var B2=N(`<span class="inline-block min-w-[7ch] text-center">Extract`),V2=N(`<div class="relative flex flex-col gap-2 pl-4"><div class="bg-border absolute top-1 bottom-1 left-[5px] w-px"aria-hidden>`),H2=N(`<span class="text-success text-[12px] leading-none">✓`),U2=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><path d="M4 4l8 8M12 4l-8 8">`),W2=N(`<div class="flex items-center justify-end gap-1 px-1">`),G2=N(`<span class="relative inline-flex items-center justify-center"><svg width=12 height=12 viewBox="0 0 16 16"fill=currentColor aria-hidden><rect x=3.5 y=3 width=3.2 height=10 rx=1></rect><rect x=9.3 y=3 width=3.2 height=10 rx=1></rect></svg><span class="bg-success absolute -top-0.5 -right-0.5 size-1.5 animate-pulse rounded-full"aria-hidden>`),K2=N(`<span class="inline-block min-w-[5ch] text-center">Audit`),q2=N(`<div class="flex max-h-72 flex-col gap-1.5 overflow-y-auto pr-2">`),J2=N(`<span class="text-[12px] leading-none">✓`),Y2=N(`<div class="flex items-center gap-1 px-1">`),X2=N(`<div class="flex h-full flex-col gap-3 overflow-y-auto pt-3 pb-4 pr-3 pl-2"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">Design genomes</p><p class="text-text-faint text-[10.5px] leading-snug">Point at a component → get its structure, tokens and interaction states as a spec you can hand to an agent.</p></div></div><div class="border-border mt-1 flex flex-col gap-2 border-t pt-3"><div class="flex items-center justify-between gap-2 px-1"><div class=min-w-0><p class="text-text text-[12.5px] font-semibold">CSS slowdowns</p><p class="text-text-faint text-[10.5px] leading-snug">Transitions/delays ≥50ms on interactive elements — feedback that animates instead of being instant. Live hits appear as you use the app; Audit sweeps the whole page.</p></div><div class="flex shrink-0 items-center gap-1">`),Z2=N(`<p class="text-text mt-1 text-[11px] font-semibold">Interaction states`),Q2=N(`<svg width=12 height=12 viewBox="0 0 16 16"aria-hidden><rect x=3.5 y=3.5 width=9 height=9 rx=1.5 fill=currentColor>`),$2=N(`<span class="text-warn text-[10.5px] font-medium tabular-nums">s · <!> states`),e4=N(`<div class="border-border flex flex-col gap-2 border-t px-2.5 py-2"><p class="text-text-faint truncate text-[10px]"></p><div class="flex max-h-64 flex-col gap-2 overflow-y-auto pr-2"></div><div class="flex items-center gap-1">`),t4=N(`<div class=relative><span class="border-border bg-surface absolute top-3 -left-[13.5px] size-[9px] rounded-full border"aria-hidden></span><div class="bg-surface border-border flex flex-col rounded-lg border"><button class="flex w-full cursor-pointer items-center gap-2 px-2.5 py-2 text-left"><span class="text-accent min-w-0 truncate font-mono text-[12px]"></span><span class="text-text-faint ml-auto shrink-0 text-[10.5px] tabular-nums"> roles<!> · </span><svg width=10 height=10 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 class="text-text-faint shrink-0 transition-transform"aria-hidden><path d="m4 6 4 4 4-4">`),n4=N(`<span class=text-text-faint> ×`),r4=N(`<div class="flex flex-col gap-0.5"><p class="text-text text-[11px] font-medium">`),i4=N(`<span class=text-accent> ← var(<!>)`),a4=N(`<p class="text-text-dim font-mono text-[10px] leading-snug break-all">: `),o4=N(`<div class="flex flex-col gap-0.5"><p class="text-warn text-[10.5px] font-medium"> — `),s4=N(`<p class="text-text-dim font-mono text-[10px] leading-snug break-all">: <!> → `),c4=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round aria-hidden><circle cx=8 cy=8 r=6></circle><circle cx=8 cy=8 r=2 fill=currentColor stroke=none>`),l4=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linejoin=round aria-hidden><rect x=5.5 y=5.5 width=9 height=9 rx=1.5></rect><path d="M10.5 5.5v-2a2 2 0 0 0-2-2h-5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2">`),u4=N(`<svg width=12 height=12 viewBox="0 0 16 16"fill=currentColor aria-hidden><path d="M4.5 2.5v11l9-5.5z">`),d4=N(`<p class="text-text-faint px-1 text-[10.5px]">Nothing caught yet — interact with the app, or run Audit.`),f4=N(`<span class="text-text-dim font-mono text-[10px] break-all">`),p4=N(`<span class="text-danger text-[10px] leading-snug">⚠ layout/paint transition: `),m4=N(`<span class="text-danger text-[10px] leading-snug">⚠ ease-in easing: `),h4=N(`<div class="bg-surface border-border flex flex-col gap-0.5 rounded-lg border p-2"><div class="flex items-center gap-2"><span class="text-warn shrink-0 text-[10px] font-semibold tracking-wide uppercase"></span><span class="text-accent min-w-0 truncate font-mono text-[11.5px]"></span><span class="text-text ml-auto shrink-0 text-[11px] font-medium tabular-nums">ms</span></div><span class="text-text-dim text-[10px] leading-snug"></span><span class="text-text-faint text-[10px] leading-snug">`),g4=N(`<svg width=13 height=13 viewBox="0 0 16 16"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden><path d="M8 1.5 9.6 6l4.4 1.6L9.6 9.2 8 13.7 6.4 9.2 2 7.6 6.4 6Z"></path><path d="M13 11.5l.6 1.7 1.7.6-1.7.6-.6 1.7-.6-1.7-1.7-.6 1.7-.6Z">`),_4=`linear-grab:genomes:v1`,v4=30;function y4(){try{return JSON.parse(localStorage.getItem(_4)??`[]`)}catch{return[]}}function b4(e){try{localStorage.setItem(_4,JSON.stringify(e.slice(0,v4)))}catch{}}var x4=new Map;function S4(){let[e,t]=T(y4()),[n,r]=T(null),[i,a]=T(null),[o,s]=T(null),[c,l]=T(null),[u,d]=T(null),[f,p]=T({active:!1,msLeft:0,total:0,byTrigger:{}});ae(i2(p));let[m,h]=T([]);ae(D2(h));let[g,_]=T(j2());ae(N2(_));let[v,y]=T(!1),[b,x]=T(!1),S=async()=>{y(!0);try{await L2()}finally{y(!1)}},C=async()=>{try{await navigator.clipboard.writeText(z2(m())),x(!0),setTimeout(()=>x(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},[w,E]=T(!1),O=async()=>{try{await navigator.clipboard.writeText(R2(m())),E(!0),setTimeout(()=>E(!1),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},k=e=>{t(e),b4(e)},ee=async()=>{l(null),a(`extract`),window.dispatchEvent(new CustomEvent(BZ));try{let t=await u2();if(!t)return;let n=await e2(t),i=Date.now();x4.set(i,new WeakRef(t)),k([{id:i,genome:n},...e()]),r(i)}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(null),oj(`design`),window.dispatchEvent(new CustomEvent(VZ))}},te=async t=>{l(null),a(t.id),window.dispatchEvent(new CustomEvent(BZ));try{let n=x4.get(t.id)?.deref()??null;if(!n||!n.isConnected){if(n=await u2(),!n)return;x4.set(t.id,new WeakRef(n))}let r=await c2(n,8e3,e=>s(Math.ceil(e/1e3)));r.length===0&&l(`No state changes captured — hover/open the component while the 8s window runs.`),k(e().map(e=>e.id===t.id?{...e,genome:{...e.genome,states:[...e.genome.states,...r]}}:e))}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(null),s(null),oj(`design`),window.dispatchEvent(new CustomEvent(VZ))}},A=async e=>{try{await navigator.clipboard.writeText(l2(e.genome)),d(e.id),setTimeout(()=>d(null),1600)}catch{l(`Clipboard was blocked — click Copy again.`)}},ne=t=>{x4.delete(t),k(e().filter(e=>e.id!==t))},[re,ie]=T(!1),oe=async()=>{try{let t=e().map(e=>l2(e.genome)).join(`
|
|
274
274
|
|
package/dist/linear-grab.js
CHANGED
|
@@ -46033,7 +46033,8 @@ function C2(e) {
|
|
|
46033
46033
|
}
|
|
46034
46034
|
var w2 = [], T2 = /* @__PURE__ */ new Set();
|
|
46035
46035
|
function E2(e) {
|
|
46036
|
-
|
|
46036
|
+
let t = e.mode === "live" ? w2.find((t) => t.mode === "live" && t.element === e.element && (t.classHint ?? "") === (e.classHint ?? "") && t.properties.join() === e.properties.join()) : void 0;
|
|
46037
|
+
t ? (t.count += 1, t.at = e.at, t.sinceInputMs = e.sinceInputMs, w2 = [...w2]) : w2 = [e, ...w2].slice(0, 100);
|
|
46037
46038
|
for (let e of T2) e(w2);
|
|
46038
46039
|
C2(e);
|
|
46039
46040
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linear-grab",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Point at any React element in your dev app, draft a Linear issue with AI, delegate it to the Cursor agent, and track it live — in any browser.",
|
|
6
6
|
"exports": {
|