@wjarka/cezarion 0.14.7 → 0.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,En as i,Gt as a,It as o,Ln as s,Lt as c,Q as l,Rt as u,Sr as d,Ta as f,U as p,Ut as m,Wt as h,Yi as g,Yt as _,Zi as v,br as y,d as b,fr as x,gi as S,in as C,jt as w,l as T,nn as E,ot as D,pr as O,ri as k,sa as A,ti as j,ui as M,vr as N,wa as P}from"./alert-dialog-B422RI-k.js";import{t as F}from"./utils-PYYcpCFZ.js";import{a as ee,i as te,n as ne,o as re,r as ie,s as ae}from"./textarea-FjaU370i.js";import{T as oe}from"./prompt-templates-BlTGJB5W.js";import{c as I,t as L}from"./project-router-DbLkll25.js";import{i as R,l as z,n as B,o as V,p as H}from"./skills-DFBiAuJG.js";import{c as U,h as W,o as G,t as K}from"./index-D0RwD9-c.js";import{t as se}from"./skill-empty-hint-oOtzR3v0.js";var q=e(t(),1),J=n(),ce=`https://github.com/open-mercato/skills`;function le(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function Y(e,t){return le(e)??[...t]}function X({projectId:e}){let t=r(),n=y(),s=i(),[c,l]=(0,q.useState)(``),f=O(e,!!e),p=s.data??[],m=(0,q.useMemo)(()=>p.map(e=>e.name),[p]),v=(0,q.useRef)([]);v.current=m;let b=(0,q.useMemo)(()=>new Set(Y(n.data,m)),[n.data,m]),x=(0,q.useRef)(Promise.resolve()),S=(0,q.useRef)(0),E=(0,q.useCallback)(e=>{let n=d.uiState,r=t.getQueryData(n),i=e(Y(r,v.current));t.setQueryData(n,{...r,importedSkills:i});let a=++S.current;x.current=x.current.then(async()=>{try{let e=await g({importedSkills:i});a===S.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:C.skills}))}catch(e){A(e instanceof Error?e.message:String(e),{tone:`danger`}),a===S.current&&t.invalidateQueries({queryKey:n})}})},[t]),D=(0,q.useCallback)(e=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[E]),k=m.length>0&&m.every(e=>b.has(e)),j=(0,q.useCallback)(()=>{if(k){let e=new Set(v.current);E(t=>t.filter(t=>!e.has(t)))}else E(e=>[...new Set([...e,...v.current])])},[k,E]);if(s.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:s.error.message});let M=z(p,c);return(0,J.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`w-full min-w-0 [&_button]:min-h-11`,children:[(0,J.jsx)(`p`,{className:`mb-4 text-[10px] font-medium tracking-wide text-link-foreground`,children:`OPEN-MERCATO / SKILLS`}),(0,J.jsx)(`h2`,{className:`text-2xl font-medium`,children:`Manage skills`}),(0,J.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`a`,{href:ce,target:`_blank`,rel:`noreferrer`,children:`open-mercato`}),` skills appear in your catalog and composer picker. All are enabled by default; uncheck any you don’t want.`]}),(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Applies across projects · saved automatically`}),(0,J.jsx)(ue,{projectId:e,state:f.data,loadError:f.error}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Checkboxes control visibility. Updating refreshes installed skill files; it does not change your selection.`}),(0,J.jsxs)(`div`,{className:`sw-import-controls mt-4 flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`sw-search relative min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:c,onChange:e=>l(e.target.value),className:`h-11 min-w-0 pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`import-all`,disabled:m.length===0||n.isPending,onClick:j,className:`h-11 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[k?(0,J.jsx)(w,{"aria-hidden":`true`,className:`size-4`}):(0,J.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),k?`Remove all`:`Enable all`]})]}),(0,J.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:s.isPending?(0,J.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):M.length>0?M.map(e=>{let t=b.has(e.name);return(0,J.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:F(`flex min-h-16 cursor-pointer items-start gap-3 rounded-lg border border-border p-4 transition-colors hover:bg-muted`,t&&`bg-background`),children:[(0,J.jsxs)(`span`,{className:`relative size-5 shrink-0`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>D(e.name),className:`peer absolute inset-0 m-0 size-5 opacity-0`}),t?(0,J.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`}):(0,J.jsx)(a,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`})]}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:`min-w-0 break-words text-[13px] font-medium text-foreground`,children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,J.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:p.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ue({projectId:e,state:t,loadError:n}){let i=r(),a=I(),o=(0,q.useRef)(0),[s,u]=(0,q.useState)(!1),p=f({mutationFn:()=>S({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{u(!1),a(oe(e))},onError:e=>A(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===o.current&&(i.setQueryData(d.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(i.invalidateQueries({queryKey:C.skills}),A(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),u(!0)))},h=(e,t)=>{t.seq===o.current&&A(e.message,{tone:`danger`})},g=f({mutationFn:t=>M(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),_=f({mutationFn:t=>k(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),v=e=>{let n=++o.current;e===`apply`?_.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):g.mutate({action:e,seq:n})},y=t?.scopes.some(e=>e.skills.length>0)??!1,x=t?.status===`error`,w=y&&(t?.available||x),T=_.isPending||t?.status===`updating`,E=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],D=t?.scopes.filter(e=>e.updatedAt&&!E.includes(e))??[],O=`Checking installed Open Mercato skills…`;return n?O=`Update status is unavailable right now.`:t?.status===`available`?O=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?O=`Updating installed Open Mercato skills…`:t?.status===`current`?O=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?O=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(O=`The update did not finish for every installation.`),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-background p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:O}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Project and global installations are checked separately.`}),t?.checkedAt?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,J.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,J.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,E.length>0?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,E.map(e=>Z(e.scope)).join(`, `),D.length?`; updated: ${D.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),w?(0,J.jsxs)(b,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:x?`Retry`:`Update now`]}):t?.status===`current`?(0,J.jsxs)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-4`}),`Check again`]}):t?.status===`unavailable`||n?(0,J.jsx)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,J.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,J.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,J.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-accent-strong/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-link-foreground`}),(0,J.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,J.jsx)(ne,{open:s,onOpenChange:e=>p.isPending?void 0:u(e),children:(0,J.jsxs)(ie,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,J.jsxs)(re,{children:[(0,J.jsx)(ae,{children:`Apply the upgrade notes now?`}),(0,J.jsxs)(te,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,J.jsxs)(ee,{children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,disabled:p.isPending,onClick:()=>u(!1),children:`No`}),(0,J.jsx)(b,{type:`button`,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function de(){return(0,J.jsx)(`div`,{"data-route":`skills`,className:`mx-auto min-h-full w-full px-[18px] py-6 md:p-9`,children:(0,J.jsx)(fe,{})})}function fe(){let e=x(),t=N(),n=i(),[a]=P(),[o,l]=(0,q.useState)(``),d=r(),h=s(),g=j().projectId??h.data?.bootProject??``,y=f({mutationFn:()=>v(),onSuccess:e=>{d.setQueryData(C.skills,e),A(`Team skills refreshed.`)},onError:e=>A(e.message,{tone:`danger`})});if(e.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let b=V(e.data??[]),S=(n.data?.length??0)>0,w=a.get(`skill`),O=w===Q||w===$||w!==null&&b.some(e=>e.name===w)?w:b[0]?.name??(S?$:Q),k=b.find(e=>e.name===O)??null,M=B(b,o);return(0,J.jsxs)(`div`,{"data-slot":`skills-section`,className:`@container flex min-w-0 flex-col gap-[22px]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-4 @min-[700px]:flex-row @min-[700px]:items-center @min-[700px]:justify-between`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-[25px] font-semibold md:text-[30px]`,children:`Skills`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground md:text-[13px]`,children:`Markdown playbooks your agents can follow.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[S?(0,J.jsxs)(L,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":O===$?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Manage skills`]}):null,(0,J.jsxs)(L,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":O===Q?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Run from GitHub`]})]})]}),(0,J.jsxs)(`div`,{className:F(`flex-col items-start gap-2 sm:flex-row sm:items-center md:flex`,w===null?`flex`:`hidden`),children:[(0,J.jsxs)(`div`,{className:`sw-search relative w-full min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:o,onChange:e=>l(e.target.value),className:`h-11 min-w-0 bg-card pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:y.isPending,onClick:()=>y.mutate(),className:`flex h-11 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3`,y.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,J.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] md:grid-cols-[minmax(220px,310px)_minmax(0,1fr)]`,children:[(0,J.jsx)(`section`,{"data-slot":`skills-list`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card p-3 md:flex`,w===null?`flex`:`hidden`),children:(0,J.jsx)(`ul`,{"data-slot":`skill-rows`,className:`flex min-h-0 flex-col gap-1 overflow-y-auto md:max-h-[calc(100dvh-280px)]`,children:e.isPending?(0,J.jsx)(`li`,{role:`status`,"aria-busy":`true`,className:`min-h-72 p-3 text-[13px] text-soft-foreground`,children:`Loading skills…`}):M.length>0?M.map(e=>(0,J.jsx)(pe,{skill:e,active:O===e.name,highlighted:O===$&&e===b[0]},e.path)):(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:b.length>0?`(no skills match)`:(0,J.jsx)(se,{})})})}),(0,J.jsx)(`section`,{"data-slot":`skills-detail`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card md:flex`,w===null?`hidden`:`flex`),children:(0,J.jsxs)(`div`,{className:`min-w-0 p-5`,children:[(0,J.jsxs)(L,{to:`/skills`,"data-slot":`skills-back`,className:`mb-4 inline-flex min-h-11 items-center gap-2 rounded-lg border border-border px-3 text-xs font-medium hover:bg-muted md:hidden`,children:[(0,J.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),O===$?(0,J.jsx)(X,{projectId:g}):O===Q?(0,J.jsx)(K,{skills:b}):k?(0,J.jsx)(G,{skill:k,usedBy:H(t.data?.workflows??[],k.name)}):e.isPending?(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`min-h-72 text-xs text-muted-foreground`,children:`Loading skill…`}):(0,J.jsx)(T,{icon:(0,J.jsx)(m,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})]})}function pe({skill:e,active:t,highlighted:n}){let r=R(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(L,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-highlighted":n||void 0,"data-project":r?`true`:void 0,"aria-current":t?`page`:void 0,className:F(`selection-row flex min-h-24 flex-col gap-2 rounded-lg border-b border-border p-3 transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground`,(t||n)&&`border-transparent bg-accent-strong/10`),children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:F(`min-w-0 break-words text-[13px]`,r?`font-semibold text-foreground`:`font-normal text-muted-foreground`),children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-supporting-foreground`,children:e.description}):null,(0,J.jsx)(U,{source:e.source,className:`self-start border-0 bg-transparent p-0 text-link-foreground`})]})})}export{de as SkillsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,En as i,Gt as a,It as o,Ln as s,Lt as c,Q as l,Rt as u,Sr as d,Ta as f,U as p,Ut as m,Wt as h,Yi as g,Yt as _,Zi as v,br as y,d as b,fr as x,gi as S,in as C,jt as w,l as T,nn as E,ot as D,pr as O,ri as k,sa as A,ti as j,ui as M,vr as N,wa as P}from"./alert-dialog-B422RI-k.js";import{t as F}from"./utils-PYYcpCFZ.js";import{a as ee,i as te,n as ne,o as re,r as ie,s as ae}from"./textarea-FjaU370i.js";import{T as oe}from"./prompt-templates-BlTGJB5W.js";import{c as I,t as L}from"./project-router-DbLkll25.js";import{i as R,l as z,n as B,o as V,p as H}from"./skills-DFBiAuJG.js";import{c as U,h as W,o as G,t as K}from"./index-BszfYvBq.js";import{t as se}from"./skill-empty-hint-oOtzR3v0.js";var q=e(t(),1),J=n(),ce=`https://github.com/open-mercato/skills`;function le(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function Y(e,t){return le(e)??[...t]}function X({projectId:e}){let t=r(),n=y(),s=i(),[c,l]=(0,q.useState)(``),f=O(e,!!e),p=s.data??[],m=(0,q.useMemo)(()=>p.map(e=>e.name),[p]),v=(0,q.useRef)([]);v.current=m;let b=(0,q.useMemo)(()=>new Set(Y(n.data,m)),[n.data,m]),x=(0,q.useRef)(Promise.resolve()),S=(0,q.useRef)(0),E=(0,q.useCallback)(e=>{let n=d.uiState,r=t.getQueryData(n),i=e(Y(r,v.current));t.setQueryData(n,{...r,importedSkills:i});let a=++S.current;x.current=x.current.then(async()=>{try{let e=await g({importedSkills:i});a===S.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:C.skills}))}catch(e){A(e instanceof Error?e.message:String(e),{tone:`danger`}),a===S.current&&t.invalidateQueries({queryKey:n})}})},[t]),D=(0,q.useCallback)(e=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[E]),k=m.length>0&&m.every(e=>b.has(e)),j=(0,q.useCallback)(()=>{if(k){let e=new Set(v.current);E(t=>t.filter(t=>!e.has(t)))}else E(e=>[...new Set([...e,...v.current])])},[k,E]);if(s.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:s.error.message});let M=z(p,c);return(0,J.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`w-full min-w-0 [&_button]:min-h-11`,children:[(0,J.jsx)(`p`,{className:`mb-4 text-[10px] font-medium tracking-wide text-link-foreground`,children:`OPEN-MERCATO / SKILLS`}),(0,J.jsx)(`h2`,{className:`text-2xl font-medium`,children:`Manage skills`}),(0,J.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`a`,{href:ce,target:`_blank`,rel:`noreferrer`,children:`open-mercato`}),` skills appear in your catalog and composer picker. All are enabled by default; uncheck any you don’t want.`]}),(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Applies across projects · saved automatically`}),(0,J.jsx)(ue,{projectId:e,state:f.data,loadError:f.error}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Checkboxes control visibility. Updating refreshes installed skill files; it does not change your selection.`}),(0,J.jsxs)(`div`,{className:`sw-import-controls mt-4 flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`sw-search relative min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:c,onChange:e=>l(e.target.value),className:`h-11 min-w-0 pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`import-all`,disabled:m.length===0||n.isPending,onClick:j,className:`h-11 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[k?(0,J.jsx)(w,{"aria-hidden":`true`,className:`size-4`}):(0,J.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),k?`Remove all`:`Enable all`]})]}),(0,J.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:s.isPending?(0,J.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):M.length>0?M.map(e=>{let t=b.has(e.name);return(0,J.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:F(`flex min-h-16 cursor-pointer items-start gap-3 rounded-lg border border-border p-4 transition-colors hover:bg-muted`,t&&`bg-background`),children:[(0,J.jsxs)(`span`,{className:`relative size-5 shrink-0`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>D(e.name),className:`peer absolute inset-0 m-0 size-5 opacity-0`}),t?(0,J.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`}):(0,J.jsx)(a,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`})]}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:`min-w-0 break-words text-[13px] font-medium text-foreground`,children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,J.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:p.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ue({projectId:e,state:t,loadError:n}){let i=r(),a=I(),o=(0,q.useRef)(0),[s,u]=(0,q.useState)(!1),p=f({mutationFn:()=>S({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{u(!1),a(oe(e))},onError:e=>A(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===o.current&&(i.setQueryData(d.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(i.invalidateQueries({queryKey:C.skills}),A(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),u(!0)))},h=(e,t)=>{t.seq===o.current&&A(e.message,{tone:`danger`})},g=f({mutationFn:t=>M(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),_=f({mutationFn:t=>k(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),v=e=>{let n=++o.current;e===`apply`?_.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):g.mutate({action:e,seq:n})},y=t?.scopes.some(e=>e.skills.length>0)??!1,x=t?.status===`error`,w=y&&(t?.available||x),T=_.isPending||t?.status===`updating`,E=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],D=t?.scopes.filter(e=>e.updatedAt&&!E.includes(e))??[],O=`Checking installed Open Mercato skills…`;return n?O=`Update status is unavailable right now.`:t?.status===`available`?O=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?O=`Updating installed Open Mercato skills…`:t?.status===`current`?O=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?O=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(O=`The update did not finish for every installation.`),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-background p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:O}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Project and global installations are checked separately.`}),t?.checkedAt?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,J.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,J.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,E.length>0?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,E.map(e=>Z(e.scope)).join(`, `),D.length?`; updated: ${D.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),w?(0,J.jsxs)(b,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:x?`Retry`:`Update now`]}):t?.status===`current`?(0,J.jsxs)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-4`}),`Check again`]}):t?.status===`unavailable`||n?(0,J.jsx)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,J.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,J.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,J.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-accent-strong/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-link-foreground`}),(0,J.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,J.jsx)(ne,{open:s,onOpenChange:e=>p.isPending?void 0:u(e),children:(0,J.jsxs)(ie,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,J.jsxs)(re,{children:[(0,J.jsx)(ae,{children:`Apply the upgrade notes now?`}),(0,J.jsxs)(te,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,J.jsxs)(ee,{children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,disabled:p.isPending,onClick:()=>u(!1),children:`No`}),(0,J.jsx)(b,{type:`button`,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function de(){return(0,J.jsx)(`div`,{"data-route":`skills`,className:`mx-auto min-h-full w-full px-[18px] py-6 md:p-9`,children:(0,J.jsx)(fe,{})})}function fe(){let e=x(),t=N(),n=i(),[a]=P(),[o,l]=(0,q.useState)(``),d=r(),h=s(),g=j().projectId??h.data?.bootProject??``,y=f({mutationFn:()=>v(),onSuccess:e=>{d.setQueryData(C.skills,e),A(`Team skills refreshed.`)},onError:e=>A(e.message,{tone:`danger`})});if(e.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let b=V(e.data??[]),S=(n.data?.length??0)>0,w=a.get(`skill`),O=w===Q||w===$||w!==null&&b.some(e=>e.name===w)?w:b[0]?.name??(S?$:Q),k=b.find(e=>e.name===O)??null,M=B(b,o);return(0,J.jsxs)(`div`,{"data-slot":`skills-section`,className:`@container flex min-w-0 flex-col gap-[22px]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-4 @min-[700px]:flex-row @min-[700px]:items-center @min-[700px]:justify-between`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-[25px] font-semibold md:text-[30px]`,children:`Skills`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground md:text-[13px]`,children:`Markdown playbooks your agents can follow.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[S?(0,J.jsxs)(L,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":O===$?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Manage skills`]}):null,(0,J.jsxs)(L,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":O===Q?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Run from GitHub`]})]})]}),(0,J.jsxs)(`div`,{className:F(`flex-col items-start gap-2 sm:flex-row sm:items-center md:flex`,w===null?`flex`:`hidden`),children:[(0,J.jsxs)(`div`,{className:`sw-search relative w-full min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:o,onChange:e=>l(e.target.value),className:`h-11 min-w-0 bg-card pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:y.isPending,onClick:()=>y.mutate(),className:`flex h-11 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3`,y.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,J.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] md:grid-cols-[minmax(220px,310px)_minmax(0,1fr)]`,children:[(0,J.jsx)(`section`,{"data-slot":`skills-list`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card p-3 md:flex`,w===null?`flex`:`hidden`),children:(0,J.jsx)(`ul`,{"data-slot":`skill-rows`,className:`flex min-h-0 flex-col gap-1 overflow-y-auto md:max-h-[calc(100dvh-280px)]`,children:e.isPending?(0,J.jsx)(`li`,{role:`status`,"aria-busy":`true`,className:`min-h-72 p-3 text-[13px] text-soft-foreground`,children:`Loading skills…`}):M.length>0?M.map(e=>(0,J.jsx)(pe,{skill:e,active:O===e.name,highlighted:O===$&&e===b[0]},e.path)):(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:b.length>0?`(no skills match)`:(0,J.jsx)(se,{})})})}),(0,J.jsx)(`section`,{"data-slot":`skills-detail`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card md:flex`,w===null?`hidden`:`flex`),children:(0,J.jsxs)(`div`,{className:`min-w-0 p-5`,children:[(0,J.jsxs)(L,{to:`/skills`,"data-slot":`skills-back`,className:`mb-4 inline-flex min-h-11 items-center gap-2 rounded-lg border border-border px-3 text-xs font-medium hover:bg-muted md:hidden`,children:[(0,J.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),O===$?(0,J.jsx)(X,{projectId:g}):O===Q?(0,J.jsx)(K,{skills:b}):k?(0,J.jsx)(G,{skill:k,usedBy:H(t.data?.workflows??[],k.name)}):e.isPending?(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`min-h-72 text-xs text-muted-foreground`,children:`Loading skill…`}):(0,J.jsx)(T,{icon:(0,J.jsx)(m,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})]})}function pe({skill:e,active:t,highlighted:n}){let r=R(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(L,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-highlighted":n||void 0,"data-project":r?`true`:void 0,"aria-current":t?`page`:void 0,className:F(`selection-row flex min-h-24 flex-col gap-2 rounded-lg border-b border-border p-3 transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground`,(t||n)&&`border-transparent bg-accent-strong/10`),children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:F(`min-w-0 break-words text-[13px]`,r?`font-semibold text-foreground`:`font-normal text-muted-foreground`),children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-supporting-foreground`,children:e.description}):null,(0,J.jsx)(U,{source:e.source,className:`self-start border-0 bg-transparent p-0 text-link-foreground`})]})})}export{de as SkillsRoute};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Aa as i,Ca as a,Gi as o,Jn as s,Kr as c,Li as l,Qn as u,Ta as d,_i as f,_t as p,d as m,di as h,ea as g,in as _,ji as v,l as y,lt as b,ni as x,sa as S,wn as C,zi as w}from"./alert-dialog-B422RI-k.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./textarea-FjaU370i.js";import{p as M,u as ee}from"./pill-BsbO6G7y.js";import{i as N,n as P,r as F}from"./git-toolbar-UiHnGvE0.js";import{t as I}from"./run-header-IFyIGCey.js";import{t as L}from"./use-submit-shortcut-KWJsC906.js";import{n as R,r as z}from"./index-D0RwD9-c.js";import{t as B}from"./diff-tRE59UNb2.js";import{t as te}from"./use-desktop-BaYgO7YW.js";var V=e(t(),1),H=e=>e===`running`||e===`queued`||e===`waiting`,U=`no worktree — this task ran directly in the repo working tree`;function W(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${U}`)}function G(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${U}`)}function K(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${U}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?H(e.status)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function q(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:W(e),n=e.prUrl?[W(e),G(e)]:[G(e),K(e)],r=[];if(e.localHandoff){let t=e.hasSession?H(e.status)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var J=n();function Y({run:e,open:t,onOpenChange:n}){let r=i(),[a,o]=(0,V.useState)(``),s=c(e),l=(0,V.useRef)(s);l.current=s,(0,V.useEffect)(()=>{t&&o(l.current)},[t]);let u=d({mutationFn:t=>h(e.id,t),onSuccess:t=>{S(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:_.runs.changes(e.id)}),r.invalidateQueries({queryKey:_.runs.all})},onError:e=>S(e.message,{tone:`danger`})}),f=()=>{let e=a.trim();e.length===0||u.isPending||u.mutate(e)};return(0,J.jsx)(D,{open:t,onOpenChange:n,children:(0,J.jsxs)(k,{"data-slot":`commit-dialog`,children:[(0,J.jsxs)(O,{children:[(0,J.jsx)(A,{children:`Commit changes`}),(0,J.jsxs)(E,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,J.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,J.jsx)(j,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{L({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f())}}),(0,J.jsxs)(T,{children:[(0,J.jsx)(m,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,J.jsx)(m,{"data-slot":`commit-confirm`,disabled:a.trim().length===0||u.isPending,onClick:f,children:u.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=a(),t=u(e);return t.isPending?(0,J.jsx)(z,{tab:`changes`}):t.isError?(0,J.jsx)(R,{tab:`changes`,error:t.error}):(0,J.jsx)(Z,{run:t.data})}function Z({run:e}){let t=C(),n=s(),a=r(e.id,ee(e.status)),c=te(),[u,m]=(0,V.useState)(`unified`),[h,v]=(0,V.useState)(!1),[T,E]=(0,V.useState)(null),[D,O]=(0,V.useState)(!1),k=(0,V.useRef)(null),A=i(),j=()=>A.invalidateQueries({queryKey:_.runs.all}),L=e=>S(e.message,{tone:`danger`}),R=d({mutationFn:()=>o(e.id),onSuccess:e=>S(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:L}),z=d({mutationFn:()=>f(e.id),onSuccess:e=>{S(`Draft PR created — ${e.url}`),j()},onError:L}),H=d({mutationFn:()=>w(e.id),onError:e=>{if(e instanceof x&&e.command){navigator.clipboard.writeText(e.command).then(()=>S(`No terminal found — command copied to clipboard.`)).catch(()=>S(`Run manually: ${e.command}`));return}L(e)}}),U=d({mutationFn:t=>l(e.id,t),onError:L}),W=a.isError&&a.error instanceof x&&a.error.status===409,G=q({status:e.status,hasWorktree:!!e.worktreePath&&!W,branch:e.branch,changedFiles:a.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:M(e)!==void 0,prUrl:e.pullRequestUrl}),K=e=>{switch(e){case`commit`:O(!0);break;case`push`:R.mutate();break;case`create-pr`:z.mutate();break;case`open-terminal`:H.mutate();break;case`view-pr`:break}},X=a.data?.files??[],Z=(0,V.useMemo)(()=>F(X),[X]),Q=c?u:`unified`,$=!c||h;return(0,J.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,J.jsx)(I,{run:e,tab:`changes`}),(0,J.jsx)(P,{bar:G,branch:e.branch,stat:a.data?.stat,mode:Q,wrap:$,onModeChange:m,onWrapChange:v,onAction:K}),a.data?.repointedHead?(0,J.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,J.jsx)(`code`,{children:a.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,J.jsx)(`code`,{children:a.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,a.isPending?(0,J.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):a.isError?(0,J.jsx)(y,{icon:W?(0,J.jsx)(b,{size:16}):(0,J.jsx)(p,{size:16}),tone:W?`neutral`:`danger`,heading:`h2`,title:W?`No changes to show`:`Could not load the changes`,subtitle:a.error.message}):X.length===0?(0,J.jsx)(y,{icon:(0,J.jsx)(b,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`,children:[(0,J.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:block lg:w-[250px]`,children:[(0,J.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,J.jsx)(N,{root:Z,selected:T,onSelect:e=>{E(e),k.current?.scrollToPath(e)}})]}),(0,J.jsx)(B,{files:X,viewRef:k,mode:Q,wrap:$,loadFileText:t=>ne(e.id,t),imageSrc:t=>g(e.id,t),onOpenInApp:t.data?.capabilities.localHandoff?e=>U.mutate(e):void 0,className:`min-w-0 flex-1`})]}),(0,J.jsx)(Y,{run:e,open:D,onOpenChange:O})]})}async function ne(e,t){try{let n=await v(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{X as TaskChangesRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Aa as i,Ca as a,Gi as o,Jn as s,Kr as c,Li as l,Qn as u,Ta as d,_i as f,_t as p,d as m,di as h,ea as g,in as _,ji as v,l as y,lt as b,ni as x,sa as S,wn as C,zi as w}from"./alert-dialog-B422RI-k.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./textarea-FjaU370i.js";import{p as M,u as ee}from"./pill-BsbO6G7y.js";import{i as N,n as P,r as F}from"./git-toolbar-UiHnGvE0.js";import{t as I}from"./run-header-IFyIGCey.js";import{t as L}from"./use-submit-shortcut-KWJsC906.js";import{n as R,r as z}from"./index-BszfYvBq.js";import{t as B}from"./diff-tRE59UNb2.js";import{t as te}from"./use-desktop-BaYgO7YW.js";var V=e(t(),1),H=e=>e===`running`||e===`queued`||e===`waiting`,U=`no worktree — this task ran directly in the repo working tree`;function W(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${U}`)}function G(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${U}`)}function K(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${U}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?H(e.status)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function q(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:W(e),n=e.prUrl?[W(e),G(e)]:[G(e),K(e)],r=[];if(e.localHandoff){let t=e.hasSession?H(e.status)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var J=n();function Y({run:e,open:t,onOpenChange:n}){let r=i(),[a,o]=(0,V.useState)(``),s=c(e),l=(0,V.useRef)(s);l.current=s,(0,V.useEffect)(()=>{t&&o(l.current)},[t]);let u=d({mutationFn:t=>h(e.id,t),onSuccess:t=>{S(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:_.runs.changes(e.id)}),r.invalidateQueries({queryKey:_.runs.all})},onError:e=>S(e.message,{tone:`danger`})}),f=()=>{let e=a.trim();e.length===0||u.isPending||u.mutate(e)};return(0,J.jsx)(D,{open:t,onOpenChange:n,children:(0,J.jsxs)(k,{"data-slot":`commit-dialog`,children:[(0,J.jsxs)(O,{children:[(0,J.jsx)(A,{children:`Commit changes`}),(0,J.jsxs)(E,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,J.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,J.jsx)(j,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{L({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f())}}),(0,J.jsxs)(T,{children:[(0,J.jsx)(m,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,J.jsx)(m,{"data-slot":`commit-confirm`,disabled:a.trim().length===0||u.isPending,onClick:f,children:u.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=a(),t=u(e);return t.isPending?(0,J.jsx)(z,{tab:`changes`}):t.isError?(0,J.jsx)(R,{tab:`changes`,error:t.error}):(0,J.jsx)(Z,{run:t.data})}function Z({run:e}){let t=C(),n=s(),a=r(e.id,ee(e.status)),c=te(),[u,m]=(0,V.useState)(`unified`),[h,v]=(0,V.useState)(!1),[T,E]=(0,V.useState)(null),[D,O]=(0,V.useState)(!1),k=(0,V.useRef)(null),A=i(),j=()=>A.invalidateQueries({queryKey:_.runs.all}),L=e=>S(e.message,{tone:`danger`}),R=d({mutationFn:()=>o(e.id),onSuccess:e=>S(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:L}),z=d({mutationFn:()=>f(e.id),onSuccess:e=>{S(`Draft PR created — ${e.url}`),j()},onError:L}),H=d({mutationFn:()=>w(e.id),onError:e=>{if(e instanceof x&&e.command){navigator.clipboard.writeText(e.command).then(()=>S(`No terminal found — command copied to clipboard.`)).catch(()=>S(`Run manually: ${e.command}`));return}L(e)}}),U=d({mutationFn:t=>l(e.id,t),onError:L}),W=a.isError&&a.error instanceof x&&a.error.status===409,G=q({status:e.status,hasWorktree:!!e.worktreePath&&!W,branch:e.branch,changedFiles:a.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:M(e)!==void 0,prUrl:e.pullRequestUrl}),K=e=>{switch(e){case`commit`:O(!0);break;case`push`:R.mutate();break;case`create-pr`:z.mutate();break;case`open-terminal`:H.mutate();break;case`view-pr`:break}},X=a.data?.files??[],Z=(0,V.useMemo)(()=>F(X),[X]),Q=c?u:`unified`,$=!c||h;return(0,J.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,J.jsx)(I,{run:e,tab:`changes`}),(0,J.jsx)(P,{bar:G,branch:e.branch,stat:a.data?.stat,mode:Q,wrap:$,onModeChange:m,onWrapChange:v,onAction:K}),a.data?.repointedHead?(0,J.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,J.jsx)(`code`,{children:a.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,J.jsx)(`code`,{children:a.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,a.isPending?(0,J.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):a.isError?(0,J.jsx)(y,{icon:W?(0,J.jsx)(b,{size:16}):(0,J.jsx)(p,{size:16}),tone:W?`neutral`:`danger`,heading:`h2`,title:W?`No changes to show`:`Could not load the changes`,subtitle:a.error.message}):X.length===0?(0,J.jsx)(y,{icon:(0,J.jsx)(b,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`,children:[(0,J.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:block lg:w-[250px]`,children:[(0,J.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,J.jsx)(N,{root:Z,selected:T,onSelect:e=>{E(e),k.current?.scrollToPath(e)}})]}),(0,J.jsx)(B,{files:X,viewRef:k,mode:Q,wrap:$,loadFileText:t=>ne(e.id,t),imageSrc:t=>g(e.id,t),onOpenInApp:t.data?.capabilities.localHandoff?e=>U.mutate(e):void 0,className:`min-w-0 flex-1`})]}),(0,J.jsx)(Y,{run:e,open:D,onOpenChange:O})]})}async function ne(e,t){try{let n=await v(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{X as TaskChangesRoute};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Ca as i,Qn as a,U as o,Yt as s,_t as c,ct as l,d as u,er as d,l as f,ni as p,tr as m}from"./alert-dialog-B422RI-k.js";import{u as h}from"./pill-BsbO6G7y.js";import{n as g}from"./diff-controls-BGrXGi7O.js";import{t as _}from"./run-header-IFyIGCey.js";import{t as v}from"./project-router-DbLkll25.js";import{t as y}from"./search-x-I9Q8pgUa.js";import{t as b}from"./diff-stat-Cgnl_hYF.js";import{n as x,r as S}from"./index-D0RwD9-c.js";import{t as C}from"./diff-tRE59UNb2.js";import{t as w}from"./use-desktop-BaYgO7YW.js";import{t as T}from"./commit-list-CLxXMZvP.js";var E=e(t(),1),D=n();function O(){let{id:e}=i(),t=a(e);return t.isPending?(0,D.jsx)(S,{tab:`changes`}):t.isError?(0,D.jsx)(x,{tab:`changes`,error:t.error}):(0,D.jsx)(k,{run:t.data})}function k({run:e}){let{sha:t}=i(),n=m(e.id,h(e.status));return(0,D.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,D.jsx)(_,{run:e,tab:`commits`}),t?(0,D.jsx)(A,{runId:e.id,sha:t}):n.isPending?(0,D.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,D.jsx)(f,{icon:(0,D.jsx)(c,{size:16}),tone:n.error instanceof p&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof p&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,D.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,D.jsx)(T,{slot:`task-commits`,heading:(0,D.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,D.jsx)(j,{run:e})]})]})}function A({runId:e,sha:t}){let n=d(e,t),r=w(),[i,a]=(0,E.useState)(`unified`),[l,m]=(0,E.useState)(!1),h=n.isError&&n.error instanceof p&&n.error.status===409,_=r?i:`unified`,x=!r||l;return(0,D.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,D.jsx)(u,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,D.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,D.jsx)(o,{size:16,"aria-hidden":`true`}),`All commits`]})}),n.data?(0,D.jsx)(b,{stat:n.data.stat}):null,(0,D.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,D.jsx)(g,{mode:i,wrap:l,onModeChange:a,onWrapChange:m})})]}),n.isPending?(0,D.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,D.jsx)(f,{icon:h?(0,D.jsx)(y,{}):(0,D.jsx)(s,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,D.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,D.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,D.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,D.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`,children:(0,D.jsx)(C,{files:n.data.files,mode:_,wrap:x,className:`min-w-0`})})]})]})}function j({run:e}){let t=r(e.id,h(e.status));return t.isPending?(0,D.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,D.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,D.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,D.jsxs)(`h2`,{className:`mb-4 text-[15px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,D.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(v,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,D.jsx)(l,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,D.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{O as TaskCommitsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Ca as i,Qn as a,U as o,Yt as s,_t as c,ct as l,d as u,er as d,l as f,ni as p,tr as m}from"./alert-dialog-B422RI-k.js";import{u as h}from"./pill-BsbO6G7y.js";import{n as g}from"./diff-controls-BGrXGi7O.js";import{t as _}from"./run-header-IFyIGCey.js";import{t as v}from"./project-router-DbLkll25.js";import{t as y}from"./search-x-I9Q8pgUa.js";import{t as b}from"./diff-stat-Cgnl_hYF.js";import{n as x,r as S}from"./index-BszfYvBq.js";import{t as C}from"./diff-tRE59UNb2.js";import{t as w}from"./use-desktop-BaYgO7YW.js";import{t as T}from"./commit-list-Dcnk7TnI.js";var E=e(t(),1),D=n();function O(){let{id:e}=i(),t=a(e);return t.isPending?(0,D.jsx)(S,{tab:`changes`}):t.isError?(0,D.jsx)(x,{tab:`changes`,error:t.error}):(0,D.jsx)(k,{run:t.data})}function k({run:e}){let{sha:t}=i(),n=m(e.id,h(e.status));return(0,D.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,D.jsx)(_,{run:e,tab:`commits`}),t?(0,D.jsx)(A,{runId:e.id,sha:t}):n.isPending?(0,D.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,D.jsx)(f,{icon:(0,D.jsx)(c,{size:16}),tone:n.error instanceof p&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof p&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,D.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,D.jsx)(T,{slot:`task-commits`,heading:(0,D.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,D.jsx)(j,{run:e})]})]})}function A({runId:e,sha:t}){let n=d(e,t),r=w(),[i,a]=(0,E.useState)(`unified`),[l,m]=(0,E.useState)(!1),h=n.isError&&n.error instanceof p&&n.error.status===409,_=r?i:`unified`,x=!r||l;return(0,D.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,D.jsx)(u,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,D.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,D.jsx)(o,{size:16,"aria-hidden":`true`}),`All commits`]})}),n.data?(0,D.jsx)(b,{stat:n.data.stat}):null,(0,D.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,D.jsx)(g,{mode:i,wrap:l,onModeChange:a,onWrapChange:m})})]}),n.isPending?(0,D.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,D.jsx)(f,{icon:h?(0,D.jsx)(y,{}):(0,D.jsx)(s,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,D.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,D.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,D.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,D.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`,children:(0,D.jsx)(C,{files:n.data.files,mode:_,wrap:x,className:`min-w-0`})})]})]})}function j({run:e}){let t=r(e.id,h(e.status));return t.isPending?(0,D.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,D.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,D.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,D.jsxs)(`h2`,{className:`mb-4 text-[15px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,D.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(v,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,D.jsx)(l,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,D.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{O as TaskCommitsRoute};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ca as r,Qn as i,Rt as a,Yt as o,Z as s,ct as c,d as l,dt as u,ea as d,l as f,ni as p,rr as m,ut as h}from"./alert-dialog-B422RI-k.js";import{t as g}from"./utils-PYYcpCFZ.js";import{t as _}from"./createLucideIcon-BHp8sXmF.js";import{t as v}from"./run-header-IFyIGCey.js";import{a as y,i as b,r as x}from"./highlighter-CdHqIwFr.js";import{h as S,n as C,r as w}from"./index-D0RwD9-c.js";var T=_(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=_(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=_(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=_(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),k=_(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),A=e(t(),1),j=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function M(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:j.has(t.slice(n+1).toLowerCase())}function N(e){return e.tooLarge?`too-large`:M(e.path)?`image`:e.binary?`binary`:`text`}function P(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var F=n();function I({runId:e,path:t,className:n}){let r=m(e,t??void 0);if(t===null)return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(f,{icon:(0,F.jsx)(h,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,F.jsx)(R,{className:n,children:(0,F.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof p&&r.error.status===409;return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(f,{icon:e?(0,F.jsx)(D,{}):(0,F.jsx)(o,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,F.jsx)(L,{runId:e,entry:r.data,className:n}):(0,F.jsx)(R,{className:n,children:(0,F.jsx)(f,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function L({runId:e,entry:t,className:n}){let r=N(t);return(0,F.jsxs)(R,{className:n,children:[(0,F.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:P(t.size)})]}),r===`image`?(0,F.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,F.jsx)(`img`,{"data-slot":`file-preview-image`,src:d(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,F.jsx)(f,{icon:(0,F.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${P(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,F.jsx)(f,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${P(t.size)} of binary data — no text preview.`}):(0,F.jsx)(V,{path:t.path,text:t.content??``})]})}function R({className:e,children:t}){return(0,F.jsx)(`section`,{"data-slot":`file-preview`,className:g(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,A.useMemo)(()=>t.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ca as r,Qn as i,Rt as a,Yt as o,Z as s,ct as c,d as l,dt as u,ea as d,l as f,ni as p,rr as m,ut as h}from"./alert-dialog-B422RI-k.js";import{t as g}from"./utils-PYYcpCFZ.js";import{t as _}from"./createLucideIcon-BHp8sXmF.js";import{t as v}from"./run-header-IFyIGCey.js";import{a as y,i as b,r as x}from"./highlighter-CdHqIwFr.js";import{h as S,n as C,r as w}from"./index-BszfYvBq.js";var T=_(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=_(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=_(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=_(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),k=_(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),A=e(t(),1),j=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function M(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:j.has(t.slice(n+1).toLowerCase())}function N(e){return e.tooLarge?`too-large`:M(e.path)?`image`:e.binary?`binary`:`text`}function P(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var F=n();function I({runId:e,path:t,className:n}){let r=m(e,t??void 0);if(t===null)return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(f,{icon:(0,F.jsx)(h,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,F.jsx)(R,{className:n,children:(0,F.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof p&&r.error.status===409;return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(f,{icon:e?(0,F.jsx)(D,{}):(0,F.jsx)(o,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,F.jsx)(L,{runId:e,entry:r.data,className:n}):(0,F.jsx)(R,{className:n,children:(0,F.jsx)(f,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function L({runId:e,entry:t,className:n}){let r=N(t);return(0,F.jsxs)(R,{className:n,children:[(0,F.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:P(t.size)})]}),r===`image`?(0,F.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,F.jsx)(`img`,{"data-slot":`file-preview-image`,src:d(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,F.jsx)(f,{icon:(0,F.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${P(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,F.jsx)(f,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${P(t.size)} of binary data — no text preview.`}):(0,F.jsx)(V,{path:t.path,text:t.content??``})]})}function R({className:e,children:t}){return(0,F.jsx)(`section`,{"data-slot":`file-preview`,className:g(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,A.useMemo)(()=>t.split(`
2
2
  `).map(e=>[{content:e}]),[t]),r=(0,A.useMemo)(()=>y(e),[e]),i=n.length>z,[a,o]=(0,A.useState)(null);return(0,A.useEffect)(()=>{if(r===null||i)return;let n=!1;return x(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:b(t,r)?.tokens??n}function V({path:e,text:t}){let n=B(e,t);return(0,F.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":y(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex px-4`,children:[(0,F.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,F.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function H({runId:e,selected:t,onSelect:n}){return(0,F.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,F.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,F.jsx)(U,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function U({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=m(e,t);return a.isPending?(0,F.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,F.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,F.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,F.jsx)(F.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,F.jsx)(W,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,F.jsx)(G,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function W({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let[o,c]=(0,A.useState)(!1);return(0,F.jsxs)(`li`,{children:[(0,F.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>c(e=>!e),className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,F.jsx)(s,{size:16,"aria-hidden":`true`,className:g(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,o&&`rotate-90`)}),(0,F.jsx)(u,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),o?(0,F.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,F.jsx)(U,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function G({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=M(t)?k:c;return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:g(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,F.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,F.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:P(n)})]})})}function K(){let{id:e}=r(),t=i(e);return t.isPending?(0,F.jsx)(w,{tab:`files`}):t.isError?(0,F.jsx)(C,{tab:`files`,error:t.error}):(0,F.jsx)(q,{run:t.data})}function q({run:e}){let t=m(e.id,``),[n,r]=(0,A.useState)(null),[i,s]=(0,A.useState)(``),c=t.isError&&t.error instanceof p&&t.error.status===409;return(0,F.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,F.jsx)(v,{run:e,tab:`files`}),t.isSuccess?(0,F.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),i.trim()&&r(i.trim())},children:[(0,F.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,F.jsx)(a,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,F.jsx)(S,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:i,onChange:e=>s(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,F.jsx)(l,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!i.trim(),children:`Open file`})]}):null,t.isPending?(0,F.jsx)(`p`,{"data-slot":`files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading files…`}):t.isError?(0,F.jsx)(f,{icon:c?(0,F.jsx)(O,{}):(0,F.jsx)(o,{size:16}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,F.jsxs)(`aside`,{"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,F.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),(0,F.jsx)(H,{runId:e.id,selected:n,onSelect:r})]}),(0,F.jsx)(I,{runId:e.id,path:n,className:`min-h-[200px] min-w-0 flex-1 bg-card md:min-h-[400px]`})]}),(0,F.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout.`})]})}export{K as TaskFilesRoute};
@@ -0,0 +1 @@
1
+ .session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding:0 12px 10px}.session-engine-controls{grid-template-columns:192px minmax(0,1fr) 176px;gap:8px;min-width:0;display:grid}.session-engine-controls [data-slot$=pill]{width:100%;min-width:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-left:auto}.session-engine-controls [data-slot=session-runner-value]{width:100%;min-width:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:0 12px 12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-width:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;width:44px;height:44px}.session-composer [data-slot=follow-up-model-pill]{min-height:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-left:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}[data-slot=run-actions-menu] [role^=menuitem]{min-height:44px}[data-route=task-thread] [data-slot=thread-dock]{container:thread-dock/inline-size}@media (width>=768px){@container thread-dock (width<=640px){[data-slot=thread-dock]>div{padding-inline:8px}.session-engine-controls{grid-template-columns:112px minmax(0,1fr) 104px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill])>span>span,.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}@container thread-dock (width<=400px){.session-engine-controls [data-slot=follow-up-model-pill]>span>span{display:none}.session-composer [data-slot=archive-action]{width:44px;min-width:44px;padding-inline:0}.session-composer [data-slot=archive-action]>span{display:none}}}@media (width<=767px){[data-slot=run-title-row]>.group{max-width:calc(100% - 52px)}.session-engine-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none}@media (width<=767px){[data-route=task-thread] [data-slot=thread-dock]{overflow-anchor:none}[data-route=task-thread] [data-slot=thread-tail-anchor]{overflow-anchor:auto}}[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-bottom:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-top:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-bottom:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-bottom:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-top:0;margin-top:0;padding-top:0;font-size:10px}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-bottom:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-top:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding:calc(var(--spacing) * 2.5) calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-top:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding:calc(var(--spacing) * 2) calc(var(--spacing) * 3) calc(var(--spacing) * 2.5)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Aa as i,Bi as a,Ca as o,G as s,H as c,It as l,Jt as u,Qt as d,Rt as f,Ta as p,Ui as m,Ut as h,X as g,Xt as _,Y as v,Yt as y,a as b,bi as x,c as ee,ct as S,d as C,fr as te,hr as ne,i as w,in as re,it as T,l as ie,n as ae,ni as oe,o as E,ot as se,r as ce,s as D,sa as O,st as k,t as le,tn as A,vi as ue,vr as j}from"./alert-dialog-B422RI-k.js";import{t as M}from"./utils-PYYcpCFZ.js";import{i as N,l as de,r as P,t as fe}from"./dropdown-menu-dwDGT8MM.js";import{i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./textarea-FjaU370i.js";import{i as ye,l as be,s as xe}from"./skills-DFBiAuJG.js";import{h as Se,i as Ce}from"./index-D0RwD9-c.js";import{n as we}from"./skill-empty-hint-oOtzR3v0.js";var F=e(n()),I=e(t());function Te(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var L=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function R(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function z(e){return e?R(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function B(e){let{Document:t}=z(e);return e instanceof t}function V(e){return!R(e)&&e instanceof z(e).HTMLElement}function De(e){return e instanceof z(e).SVGElement}function Oe(e){return e?R(e)?e.document:Ee(e)?B(e)?e:V(e)||De(e)?e.ownerDocument:document:document:document}var H=L?I.useLayoutEffect:I.useEffect;function ke(e){let t=(0,I.useRef)(e);return H(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ae(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function U(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return H(()=>{n.current!==e&&(n.current=e)},t),n}function je(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Me(e){let t=ke(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ne(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Pe={};function Fe(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Pe[e]==null?0:Pe[e]+1;return Pe[e]=n,e+`-`+n},[e,t])}function Ie(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var W=Ie(1),Le=Ie(-1);function Re(e){return`clientX`in e&&`clientY`in e}function ze(e){if(!e)return!1;let{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Be(e){if(!e)return!1;let{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ve(e){if(Be(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Re(e)?{x:e.clientX,y:e.clientY}:null}var G=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[G.Translate.toString(e),G.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),He=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ue(e){return e.matches(He)?e:e.querySelector(He)}var K={display:`none`};function We(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:K},n)}function Ge(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ke(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var qe=(0,I.createContext)(null);function Je(e){let t=(0,I.useContext)(qe);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ye(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Xe={draggable:`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Aa as i,Bi as a,Ca as o,G as s,H as c,It as l,Jt as u,Qt as d,Rt as f,Ta as p,Ui as m,Ut as h,X as g,Xt as _,Y as v,Yt as y,a as b,bi as x,c as ee,ct as S,d as C,fr as te,hr as ne,i as w,in as re,it as T,l as ie,n as ae,ni as oe,o as E,ot as se,r as ce,s as D,sa as O,st as k,t as le,tn as A,vi as ue,vr as j}from"./alert-dialog-B422RI-k.js";import{t as M}from"./utils-PYYcpCFZ.js";import{i as N,l as de,r as P,t as fe}from"./dropdown-menu-dwDGT8MM.js";import{i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./textarea-FjaU370i.js";import{i as ye,l as be,s as xe}from"./skills-DFBiAuJG.js";import{h as Se,i as Ce}from"./index-BszfYvBq.js";import{n as we}from"./skill-empty-hint-oOtzR3v0.js";var F=e(n()),I=e(t());function Te(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var L=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function R(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function z(e){return e?R(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function B(e){let{Document:t}=z(e);return e instanceof t}function V(e){return!R(e)&&e instanceof z(e).HTMLElement}function De(e){return e instanceof z(e).SVGElement}function Oe(e){return e?R(e)?e.document:Ee(e)?B(e)?e:V(e)||De(e)?e.ownerDocument:document:document:document}var H=L?I.useLayoutEffect:I.useEffect;function ke(e){let t=(0,I.useRef)(e);return H(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ae(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function U(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return H(()=>{n.current!==e&&(n.current=e)},t),n}function je(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Me(e){let t=ke(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ne(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Pe={};function Fe(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Pe[e]==null?0:Pe[e]+1;return Pe[e]=n,e+`-`+n},[e,t])}function Ie(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var W=Ie(1),Le=Ie(-1);function Re(e){return`clientX`in e&&`clientY`in e}function ze(e){if(!e)return!1;let{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Be(e){if(!e)return!1;let{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ve(e){if(Be(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Re(e)?{x:e.clientX,y:e.clientY}:null}var G=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[G.Translate.toString(e),G.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),He=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ue(e){return e.matches(He)?e:e.querySelector(He)}var K={display:`none`};function We(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:K},n)}function Ge(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ke(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var qe=(0,I.createContext)(null);function Je(e){let t=(0,I.useContext)(qe);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ye(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Xe={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -47,7 +47,7 @@
47
47
  }
48
48
  })()
49
49
  </script>
50
- <script type="module" crossorigin src="/assets/index-D0RwD9-c.js"></script>
50
+ <script type="module" crossorigin src="/assets/index-BszfYvBq.js"></script>
51
51
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-BT31bpU6.js">
@@ -73,7 +73,7 @@
73
73
  <link rel="modulepreload" crossorigin href="/assets/thread-loading-77sJ8Yu_.js">
74
74
  <link rel="modulepreload" crossorigin href="/assets/diff-stat-Cgnl_hYF.js">
75
75
  <link rel="modulepreload" crossorigin href="/assets/token-metrics-Clxh03bE.js">
76
- <link rel="stylesheet" crossorigin href="/assets/index-CXZukB1O.css">
76
+ <link rel="stylesheet" crossorigin href="/assets/index-CWh4pKP3.css">
77
77
  </head>
78
78
  <body>
79
79
  <div id="root"></div>