@pat-lewczuk/cezar 0.1.4 → 0.1.5
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/README.md +124 -37
- package/dist/config.d.ts +46 -0
- package/dist/config.js +31 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-runner.d.ts +16 -0
- package/dist/core/agent-runner.js +9 -0
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +6 -0
- package/dist/core/claude-cli-runner.js +27 -43
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.js +42 -5
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/opencode-server-runner.js +42 -5
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/git-worktree.d.ts +21 -0
- package/dist/git-worktree.js +48 -4
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +1 -1
- package/dist/handoff.js +2 -0
- package/dist/handoff.js.map +1 -1
- package/dist/index.js +34 -4
- package/dist/index.js.map +1 -1
- package/dist/runs/store.d.ts +82 -1
- package/dist/runs/store.js +57 -5
- package/dist/runs/store.js.map +1 -1
- package/dist/server/git.js +12 -1
- package/dist/server/git.js.map +1 -1
- package/dist/server/github.d.ts +8 -29
- package/dist/server/github.js +7 -139
- package/dist/server/github.js.map +1 -1
- package/dist/server/pr.d.ts +5 -20
- package/dist/server/pr.js +4 -95
- package/dist/server/pr.js.map +1 -1
- package/dist/server/server.d.ts +30 -1
- package/dist/server/server.js +448 -19
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/run.d.ts +90 -0
- package/dist/workflows/run.js +412 -29
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +16 -16
- package/package.json +44 -6
- package/scripts/check-pack.mjs +46 -0
- package/scripts/dev.mjs +74 -0
- package/scripts/mock-claude.mjs +54 -2
- package/scripts/test-process-usage.mjs +47 -0
- package/web/dist/assets/{toaster-BS2E1bhz.js → centered-state-zgEVNWsj.js} +1 -1
- package/web/dist/assets/compare-variants-ChHCcSQX.js +1 -0
- package/web/dist/assets/dialog-DDRjj-uK.js +1 -0
- package/web/dist/assets/{diff-view-CctnJHWe.js → diff-view-CWRO0GMe.js} +1 -1
- package/web/dist/assets/dist-id2CeyV-.js +1 -0
- package/web/dist/assets/git-toolbar-C4jo602L.js +1 -0
- package/web/dist/assets/github-BOIzQFwE.js +1 -0
- package/web/dist/assets/index-Cv1pQs9U.js +11 -0
- package/web/dist/assets/repo-git-BuyJiqna.js +1 -0
- package/web/dist/assets/{run-diff-C7mfxj7f.js → run-diff-BocG6LVd.js} +1 -1
- package/web/dist/assets/run-header-CDKw22ek.js +1 -0
- package/web/dist/assets/skill-detail-CcFFKmGO.js +1 -0
- package/web/dist/assets/skills-Bc_4U3yq.js +1 -0
- package/web/dist/assets/tab-link-C77EP3i6.js +1 -0
- package/web/dist/assets/task-changes-DsDgN8-x.js +1 -0
- package/web/dist/assets/task-commits-Dve6Fozc.js +1 -0
- package/web/dist/assets/{task-files-FOAAz2FB.js → task-files-BDMc_z0B.js} +1 -1
- package/web/dist/assets/{task-thread-Bncxe8Os.js → task-thread-CmRuPj9H.js} +2 -2
- package/web/dist/assets/use-desktop-CyEWsxSU.js +3 -0
- package/web/dist/assets/{workflows-Dg2wQg6i.js → workflows-J3z3kYic.js} +1 -1
- package/web/dist/index.html +5 -5
- package/web/app/node_modules/.vite/vitest/ca84d1343b96baa8137c943ed1860e522cacb238/results.json +0 -1
- package/web/app/src/components/app-shell-container.tsx +0 -76
- package/web/app.js +0 -3428
- package/web/dist/assets/compare-variants-D6fPL9cS.js +0 -1
- package/web/dist/assets/dialog-BEgEWFDS.js +0 -1
- package/web/dist/assets/dist-CW7M_Jhs.js +0 -1
- package/web/dist/assets/git-toolbar-D8OPPqBP.js +0 -1
- package/web/dist/assets/github-BYIHwIJB.js +0 -1
- package/web/dist/assets/index-9qG98Orw.js +0 -11
- package/web/dist/assets/repo-git-XTqlVOl2.js +0 -1
- package/web/dist/assets/run-header-CfVeY3uM.js +0 -1
- package/web/dist/assets/skill-detail-C9cniyId.js +0 -1
- package/web/dist/assets/skills-DXgY1uXJ.js +0 -1
- package/web/dist/assets/tab-link-phWEqSBy.js +0 -1
- package/web/dist/assets/task-changes-DYwnPnTN.js +0 -1
- package/web/dist/assets/task-commits-DZzxEzbn.js +0 -1
- package/web/dist/assets/use-desktop-eHm2iTXX.js +0 -3
- package/web/index.html +0 -108
- package/web/style.css +0 -1767
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,Dt as i,F as a,Ft as o,I as s,L as c,Lt as l,Z as u,a as d,bt as f,i as p,j as m,k as h,rt as g,t as _,zt as v}from"./centered-state-zgEVNWsj.js";import{t as y}from"./utils-rQGbOrwc.js";import{t as b}from"./arrow-left-BE957rJs.js";import{n as x}from"./loader-circle-BV3DO9mE.js";import{t as S}from"./tab-link-C77EP3i6.js";import{a as C,i as w,r as T,t as E}from"./git-toolbar-C4jo602L.js";import{a as D,i as O,n as k,r as A,t as j}from"./use-desktop-CyEWsxSU.js";import{t as M}from"./git-pull-request-DJkAMT0f.js";import{t as N}from"./search-x-CoCyl7zT.js";import{t as P}from"./triangle-alert-6su4Js5O.js";import{t as F}from"./input-BRsSo4xH.js";import{$ as I,P as L,p as R,rt as z}from"./index-Cv1pQs9U.js";var B=t(n(),1),V=e();function H({repo:e,info:t}){let n=m(),i=v(),a=e=>p(e.message,{tone:`danger`}),o=l({mutationFn:e=>g({name:e}),onSuccess:e=>{p(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),i.invalidateQueries({queryKey:r.repo}),i.invalidateQueries({queryKey:r.health})},onError:a}),s=l({mutationFn:e=>f({baseBranch:e}),onSuccess:e=>{p(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now branch from the current checkout`),i.invalidateQueries({queryKey:r.repo})},onError:a}),[c,u]=(0,B.useState)(``);return(0,V.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Branches`}),(0,V.jsx)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:e.branches.map(e=>{let n=e===t.branch;return(0,V.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,V.jsx)(z,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:y(`min-w-0 truncate font-mono text-xs`,n&&`font-semibold`),children:e}),n?(0,V.jsxs)(`span`,{"data-slot":`branch-current`,className:`flex shrink-0 items-center gap-1 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:[(0,V.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),`current`]}):(0,V.jsx)(d,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:o.isPending,onClick:()=>o.mutate(e),children:`Switch`})]},e)})}),(0,V.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=c.trim();t&&o.mutate(t,{onSuccess:()=>u(``)})},children:[(0,V.jsx)(F,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:c,onChange:e=>u(e.target.value)}),(0,V.jsxs)(d,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!c.trim()||o.isPending,children:[(0,V.jsx)(I,{"aria-hidden":`true`}),`Create`]})]})]}),(0,V.jsxs)(`div`,{className:`max-w-md`,children:[(0,V.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Agents’ base branch`}),(0,V.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:s.isPending,onChange:e=>s.mutate(e.target.value===``?null:e.target.value),className:`mt-1.5 block w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,V.jsx)(`option`,{value:``,children:`current checkout (default)`}),e.branches.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]}),(0,V.jsx)(`p`,{className:`mt-1 text-[11px] text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n.data?.forge?.available?(0,V.jsx)(U,{}):null]})}function U(){let e=h({limit:20});return(0,V.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,V.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,V.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,V.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,V.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,V.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,V.jsx)(W,{pr:e},e.number))}):(0,V.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-2 text-xs text-soft-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function W({pr:e}){return(0,V.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:(0,V.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2 hover:bg-muted`,children:[(0,V.jsx)(M,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,V.jsx)(G,{checks:e.checks}):null]})})}function G({checks:e}){return(0,V.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:y(`shrink-0 text-[10px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function K(){let e=s(),t=j(),[n,r]=(0,B.useState)(`unified`),[i,a]=(0,B.useState)(!1),[o,c]=(0,B.useState)(null),l=e.isError&&e.error instanceof u&&e.error.status===409,d=e.data?.files??[],f=(0,B.useMemo)(()=>T(d),[d]),p=t?n:`unified`,m=!t||i;return(0,V.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,V.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,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,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,V.jsx)(E,{stat:e.data.stat}):null,(0,V.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,V.jsx)(O,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})})]}),e.isPending?(0,V.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):e.isError?(0,V.jsx)(_,{icon:l?(0,V.jsx)(C,{}):(0,V.jsx)(P,{}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):d.length===0?(0,V.jsx)(_,{icon:(0,V.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-start gap-5 px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:[(0,V.jsx)(`aside`,{className:`sticky top-28 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,V.jsx)(w,{root:f,selected:o,onSelect:e=>{c(e),document.querySelector(`[data-slot="diff-file"][data-path="${CSS.escape(e)}"]`)?.scrollIntoView?.({block:`start`,behavior:`smooth`})}})}),(0,V.jsx)(k,{files:d,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function q({log:e}){let{sha:t}=o();return t?(0,V.jsx)(J,{sha:t}):e.length===0?(0,V.jsx)(_,{icon:(0,V.jsx)(D,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,V.jsx)(`ul`,{"data-slot":`repo-commits`,className:`flex flex-col divide-y divide-border px-2 py-1 md:px-4`,children:e.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(i,{"data-slot":`commit-row`,"data-sha":e.hash,to:`/git/commits/${e.hash}`,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.hash}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,V.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})},e.hash))})}function J({sha:e}){let t=c(e),n=j(),[r,a]=(0,B.useState)(`unified`),[o,s]=(0,B.useState)(!1),l=t.isError&&t.error instanceof u&&t.error.status===409,f=n?r:`unified`,p=!n||o;return(0,V.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,V.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,V.jsx)(d,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,V.jsxs)(i,{to:`/git/commits`,children:[(0,V.jsx)(b,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,V.jsx)(L,{stat:t.data.stat}):null,(0,V.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,V.jsx)(O,{mode:r,wrap:o,onModeChange:a,onWrapChange:s})})]}),t.isPending?(0,V.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,V.jsx)(_,{icon:l?(0,V.jsx)(N,{}):(0,V.jsx)(P,{}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,V.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,V.jsx)(_,{icon:(0,V.jsx)(D,{}),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,V.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,V.jsx)(k,{files:t.data.files,mode:f,wrap:p,className:`min-w-0`})})]})]})}function Y({tab:e}){let t=a();if(t.isPending)return(0,V.jsx)(R,{});if(t.isError)return(0,V.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,V.jsx)(_,{icon:(0,V.jsx)(P,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,V.jsx)(X,{repo:t.data,info:n,tab:e}):(0,V.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,V.jsx)(_,{icon:(0,V.jsx)(z,{}),tone:`neutral`,title:`Not a git repository`,subtitle:`cezar is running outside a git repository — start it inside one to browse changes, commits and branches.`})})}function X({repo:e,info:t,tab:n}){return(0,V.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,V.jsxs)(`header`,{"data-slot":`repo-header`,className:`sticky top-0 z-20 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur md:px-6`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,V.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,V.jsx)(A,{branch:t.branch}),t.remote?(0,V.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-[11px] text-soft-foreground md:inline`,children:t.remote}):null]}),(0,V.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,V.jsx)(S,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,V.jsx)(S,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,V.jsx)(S,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,V.jsx)(K,{}):n===`commits`?(0,V.jsx)(q,{log:e.log}):(0,V.jsx)(H,{repo:e,info:t})]})}export{Y as RepoGitRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,H as i,T as a,_ as o,a as s,b as c,g as l,h as u,v as d,x as f,y as p,zt as m}from"./
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,H as i,T as a,_ as o,a as s,b as c,g as l,h as u,v as d,x as f,y as p,zt as m}from"./centered-state-zgEVNWsj.js";import{t as h}from"./utils-rQGbOrwc.js";import{n as g,r as _}from"./highlighter-BKVEsACy.js";import{ot as v}from"./index-Cv1pQs9U.js";var y=t(n(),1),b=e(),x=`Collapsible`,[S,C]=c(x),[w,T]=S(x),E=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,d]=o({prop:r,defaultProp:i??!1,onChange:s,caller:x});return(0,b.jsx)(w,{scope:n,disabled:a,contentId:u(),open:l,onOpenToggle:y.useCallback(()=>d(e=>!e),[d]),children:(0,b.jsx)(f.div,{"data-state":M(l),"data-disabled":a?``:void 0,...c,ref:t})})});E.displayName=x;var D=`CollapsibleTrigger`,O=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=T(D,n);return(0,b.jsx)(f.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":M(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:p(e.onClick,i.onOpenToggle)})});O.displayName=D;var k=`CollapsibleContent`,A=y.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=T(k,e.__scopeCollapsible);return(0,b.jsx)(l,{present:n||i.open,children:({present:e})=>(0,b.jsx)(j,{...r,ref:t,present:e})})});A.displayName=k;var j=y.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...o}=e,s=T(k,n),[c,l]=y.useState(r),u=y.useRef(null),p=a(t,u),m=y.useRef(0),h=m.current,g=y.useRef(0),_=g.current,v=s.open||c,x=y.useRef(v),S=y.useRef(void 0);return y.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),d(()=>{let e=u.current;if(e){S.current=S.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();m.current=t.height,g.current=t.width,x.current||(e.style.transitionDuration=S.current.transitionDuration,e.style.animationName=S.current.animationName),l(r)}},[s.open,r]),(0,b.jsx)(f.div,{"data-state":M(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!v,...o,ref:p,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:v&&i})});function M(e){return e?`open`:`closed`}var N=E;function P({...e}){return(0,b.jsx)(N,{"data-slot":`collapsible`,...e})}function F({...e}){return(0,b.jsx)(O,{"data-slot":`collapsible-trigger`,...e})}function I({...e}){return(0,b.jsx)(A,{"data-slot":`collapsible-content`,...e})}var L=/^diff --git /;function R(e){let t=e.replace(L,``),n=t.lastIndexOf(` b/`);return z(n>=0?t.slice(n+3):t)}function z(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function B(e){let t=z(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function V(e){let t=[],n=null,r=!1;for(let i of e.split(`
|
|
2
2
|
`)){if(L.test(i)){n={path:R(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=z(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=z(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=B(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=B(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function H(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var U=20,W=300;function G({runId:e}){let t=m(),n=i(e);(0,y.useEffect)(()=>{t.invalidateQueries({queryKey:r.runs.diff(e)})},[t,e]);let a=(0,y.useMemo)(()=>V(n.data??``),[n.data]),[o,c]=(0,y.useState)(!1);if(n.isPending)return(0,b.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,b.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(a.length===0)return(0,b.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let l=H(a),u=o?a:a.slice(0,U);return(0,b.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,b.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,b.jsxs)(`span`,{children:[l.files,` `,l.files===1?`file`:`files`,` changed`]}),(0,b.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,b.jsxs)(`span`,{className:`text-success`,children:[`+`,l.additions]}),` `,(0,b.jsxs)(`span`,{className:`text-danger`,children:[`−`,l.deletions]})]})]}),u.map(e=>(0,b.jsx)(q,{file:e},`${e.oldPath??``}→${e.path}`)),a.length>u.length?(0,b.jsxs)(s,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>c(!0),children:[`Show `,a.length-u.length,` more files`]}):null]})}var K={added:`added`,deleted:`deleted`,renamed:`renamed`};function q({file:e}){let[t,n]=(0,y.useState)(!0),r=K[e.status];return(0,b.jsxs)(P,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,b.jsxs)(F,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,b.jsx)(v,{className:h(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,b.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,b.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:r}):null,e.binary?(0,b.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:`binary`}):null,(0,b.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] font-semibold tabular-nums`,children:[(0,b.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,b.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,b.jsx)(I,{children:(0,b.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,b.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,b.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,b.jsx)(J,{lines:e.lines})})})]})}function J({lines:e}){let[t,n]=(0,y.useState)(!1),r=t?e:e.slice(0,W),i=r.join(`
|
|
3
3
|
`),[a,o]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=!1;return g(i,`diff`).then(t=>{e||o({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let s=a?.text===i?a.tokens:_(i,`diff`)?.tokens??null;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,b.jsxs)(`span`,{className:h(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[s?.[t]===void 0?e:s[t].map((e,t)=>(0,b.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>W?(0,b.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{F as i,P as n,I as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{$ as r,D as i,G as a,Lt as o,N as s,P as c,Pt as l,W as u,Z as d,a as f,et as ee,i as p,lt as te,mt as m,nt as ne,pt as h,st as re,zt as g}from"./centered-state-zgEVNWsj.js";import{n as _,t as v}from"./utils-rQGbOrwc.js";import{n as y,t as ie}from"./loader-circle-BV3DO9mE.js";import{n as b,t as x}from"./trash-2-CDtxmmc8.js";import{t as ae}from"./ellipsis-vertical-DJPAfccS.js";import{n as oe,t as S}from"./tab-link-C77EP3i6.js";import{t as C}from"./square-terminal-B6PZX4Qp.js";import{t as se}from"./markdown-CR_HLGTs.js";import{A as w,B as T,I as ce,L as E,M as D,N as O,P as le,R as ue,_ as de,a as fe,at as pe,b as me,et as k,g as A,h as j,i as M,j as N,k as P,m as F,n as I,o as L,r as R,tt as z,ut as B,v as he,x as ge,y as _e}from"./index-Cv1pQs9U.js";var V=_(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),ve=_(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),H=_(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),ye=_(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),U=_(`file-text`,[[`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:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),W=t(n(),1);function G(e){return e===`running`||e===`queued`||e===`waiting`}function K(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}function be(e,t){switch(e){case`codex`:return`codex resume ${t}`;case`opencode`:return`opencode --session ${t}`;default:return`claude --resume ${t}`}}function xe(e){if(G(e.status))return;let t=K(e);if(t===void 0)return;let n=be(e.runner,t);return e.worktreePath?`cd ${e.worktreePath} && ${n}`:n}function q(e){let t=G(e.status),n=K(e)!==void 0;return{finish:e.status===`waiting`||e.status===`review`,continueRun:!t&&n,terminal:!t&&n,notes:!0,archive:!t,cancel:t,deleteRun:!t}}function J(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function Se(e,t){let n=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)).findIndex(e=>e.id===t);return n>=0?n+1:void 0}var Y=e();function X(e){switch(e){case`done`:return`done`;case`running`:case`waiting`:case`review`:return`active`;case`failed`:case`cancelled`:return`failed`;case`pending`:case`skipped`:return`pending`}}function Ce(e){if(e.length===0)return 0;let t=new Set([`done`,`failed`,`cancelled`,`skipped`]),n=new Set([`running`,`waiting`,`review`]),r=0;for(let i of e)t.has(i.status)?r+=1:n.has(i.status)&&(r+=.5);return r/e.length}function Z({steps:e}){if(e.length===0)return null;let t=Ce(e)*100;return(0,Y.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,Y.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":X(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,Y.jsx)(we,{visual:X(t.status)}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,Y.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,Y.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-[11.5px] text-soft-foreground tabular-nums`,children:[t.kind,` · step `,n+1,` of `,e.length]})]},t.id)),(0,Y.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,Y.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function we({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,Y.jsx)(ve,{"aria-hidden":!0,className:v(t,`text-success`)});case`active`:return(0,Y.jsx)(ie,{role:`status`,"aria-label":`Step running`,className:v(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,Y.jsx)(ye,{"aria-hidden":!0,className:v(t,`text-danger`)});case`pending`:return(0,Y.jsx)(pe,{"aria-hidden":!0,className:v(t,`text-soft-foreground`)})}}function Q(e){let t=g();return o({mutationFn:()=>te(e),onSuccess:()=>t.invalidateQueries({queryKey:i.runs.all}),onError:e=>p(e.message,{tone:`danger`})})}function Te({run:e,planTally:t,tab:n=`session`}){let r=T(e),i=q(e),o=xe(e),[s,c]=(0,W.useState)(!1),l=De(e),u=a(),d=e.status===`queued`?ce(u.data??[]).get(e.id):void 0;return(0,Y.jsxs)(`header`,{"data-slot":`run-header`,className:`sticky top-0 z-20 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur md:px-6`,children:[(0,Y.jsxs)(`div`,{className:`mx-auto w-full max-w-[820px]`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(Oe,{run:e}),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2.5`,children:[t?(0,Y.jsxs)(`span`,{"data-slot":`plan-mirror`,className:`text-[11px] text-soft-foreground tabular-nums`,children:[`Plan `,t.done,`/`,t.total]}):null,(0,Y.jsxs)(M,{dot:r.tone,pulse:r.pulse,children:[r.label,d===void 0?``:` #${d}`]}),(0,Y.jsx)(Ae,{run:e,actions:l,onToggleNotes:()=>c(e=>!e)})]})]}),(0,Y.jsx)(ke,{run:e}),(0,Y.jsxs)(`div`,{"data-slot":`run-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,Y.jsx)(S,{to:`/tasks/${e.id}`,active:n===`session`,children:`Session`}),(0,Y.jsx)(S,{to:`/tasks/${e.id}/changes`,active:n===`changes`,children:`Changes`}),(0,Y.jsx)(S,{to:`/tasks/${e.id}/commits`,active:n===`commits`,children:`Commits`}),(0,Y.jsx)(S,{to:`/tasks/${e.id}/files`,active:n===`files`,children:`Files`}),(0,Y.jsxs)(`div`,{"data-slot":`run-actions`,className:`ml-auto hidden items-center gap-1 pb-1 md:flex`,children:[i.finish?(0,Y.jsxs)(f,{variant:`outline`,size:`sm`,title:J(e.status),onClick:()=>l.finish.mutate(),children:[(0,Y.jsx)(y,{"aria-hidden":`true`}),`Finish`]}):null,i.continueRun?(0,Y.jsxs)(f,{variant:`outline`,size:`sm`,title:`Reopen the session`,onClick:()=>l.continueRun.mutate(),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),`Continue`]}):null,(0,Y.jsx)(Ee,{run:e,canResume:i.terminal,onResume:()=>l.terminal.mutate()}),(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,title:`Handoff notes — what the agent did and what's left`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,Y.jsx)(U,{"aria-hidden":`true`}),`Notes`]}),i.archive?(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,onClick:()=>l.archive.mutate(),children:[e.archived?(0,Y.jsx)(V,{"aria-hidden":`true`}):(0,Y.jsx)(B,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,i.cancel?(0,Y.jsxs)(f,{variant:`danger-ghost`,size:`sm`,onClick:()=>l.setConfirming(`cancel`),children:[(0,Y.jsx)(H,{"aria-hidden":`true`}),`Cancel`]}):null,i.deleteRun?(0,Y.jsxs)(f,{variant:`danger-ghost`,size:`sm`,onClick:()=>l.setConfirming(`delete`),children:[(0,Y.jsx)(x,{"aria-hidden":`true`}),`Delete`]}):null]})]}),e.steps.length>0?(0,Y.jsx)(`div`,{className:`border-t border-border pt-2.5 pb-1`,children:(0,Y.jsx)(Z,{steps:e.steps})}):null,o?(0,Y.jsx)(Me,{hint:o}):null,s?(0,Y.jsx)(Ne,{runId:e.id}):null]}),(0,Y.jsx)(je,{run:e,actions:l})]})}function Ee({run:e,canResume:t,onResume:n}){let r=s(),i=o({mutationFn:t=>h(e.id,t),onError:e=>p(e.message,{tone:`danger`})}),a=e.worktreePath?r.data?.targets??[]:[];return!t&&a.length===0?null:(0,Y.jsxs)(P,{children:[(0,Y.jsx)(O,{asChild:!0,children:(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,title:`Resume in a terminal, or open the worktree locally`,children:[(0,Y.jsx)(oe,{"aria-hidden":`true`}),`Open in…`]})}),(0,Y.jsxs)(w,{align:`end`,children:[t?(0,Y.jsxs)(N,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),`Terminal (resume session)`]}):null,t&&a.length>0?(0,Y.jsx)(D,{}):null,a.map(e=>(0,Y.jsx)(N,{"data-target":e.id,onSelect:()=>i.mutate(e.id),children:e.label},e.id)),e.worktreePath?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(D,{}),(0,Y.jsxs)(N,{onSelect:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>p(`Worktree path copied`)).catch(()=>p(`Path: ${t}`))},children:[(0,Y.jsx)(b,{"aria-hidden":`true`}),`Copy worktree path`]})]}):null]})]})}function De(e){let t=g(),n=l(),[a,s]=(0,W.useState)(null),c=()=>t.invalidateQueries({queryKey:i.runs.all}),u=e=>p(e.message,{tone:`danger`});return{finish:Q(e.id),continueRun:o({mutationFn:()=>ne(e.id),onSuccess:c,onError:u}),archive:o({mutationFn:()=>r(e.id,!e.archived),onSuccess:c,onError:u}),cancel:o({mutationFn:()=>ee(e.id),onSuccess:c,onError:u}),delete:o({mutationFn:()=>re(e.id),onSuccess:()=>{c(),n(`/`)},onError:u}),terminal:o({mutationFn:()=>m(e.id),onError:e=>{if(e instanceof d&&e.command){$(e.command,`No terminal found — command copied to clipboard.`);return}u(e)}}),confirming:a,setConfirming:s}}async function $(e,t){try{await navigator.clipboard.writeText(e),p(t)}catch{p(`Run manually: ${e}`)}}function Oe({run:e}){let t=c(e.id),n=E(e),r=L(n,e=>t.mutate({title:e},{onError:e=>p(e.message,{tone:`danger`})}));return r.editing?(0,Y.jsx)(fe,{editor:r,className:`flex-1 text-[15px] font-semibold`}):(0,Y.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,Y.jsx)(`h1`,{className:`min-w-0 truncate text-[15px] font-semibold`,title:e.task,children:n}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:r.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Y.jsx)(z,{className:`size-3.5`,"aria-hidden":`true`})})]})}function ke({run:e}){let t=[(0,Y.jsx)(`span`,{children:R(e)},`workflow`)];return e.runner&&e.runner!==`claude`&&t.push((0,Y.jsx)(`span`,{children:e.runner},`runner`)),e.model&&t.push((0,Y.jsx)(`span`,{children:e.model},`model`)),e.branch&&t.push((0,Y.jsx)(`span`,{"data-slot":`branch-chip`,className:`rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:e.branch},`branch`)),e.diffStat&&t.push((0,Y.jsx)(le,{stat:e.diffStat},`diff`)),e.tokensUsed>0&&t.push((0,Y.jsxs)(`span`,{className:`tabular-nums`,children:[ue(e.tokensUsed),` tokens`]},`tokens`)),e.costUsd&&t.push((0,Y.jsx)(`span`,{className:`tabular-nums`,children:I(e.costUsd)},`cost`)),(0,Y.jsx)(`div`,{"data-slot":`run-meta`,className:`mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:t.map((e,t)=>(0,Y.jsxs)(W.Fragment,{children:[t>0?(0,Y.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t))})}function Ae({run:e,actions:t,onToggleNotes:n}){let r=q(e);return(0,Y.jsxs)(P,{children:[(0,Y.jsx)(O,{asChild:!0,children:(0,Y.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":`Run actions`,className:`md:hidden`,children:(0,Y.jsx)(ae,{"aria-hidden":`true`})})}),(0,Y.jsxs)(w,{align:`end`,"data-slot":`run-actions-menu`,children:[r.finish?(0,Y.jsxs)(N,{onSelect:()=>t.finish.mutate(),children:[(0,Y.jsx)(y,{"aria-hidden":`true`}),` Finish`]}):null,r.continueRun?(0,Y.jsxs)(N,{onSelect:()=>t.continueRun.mutate(),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),` Continue`]}):null,r.terminal?(0,Y.jsxs)(N,{onSelect:()=>t.terminal.mutate(),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),` Terminal`]}):null,(0,Y.jsxs)(N,{onSelect:n,children:[(0,Y.jsx)(U,{"aria-hidden":`true`}),` Notes`]}),r.archive?(0,Y.jsxs)(N,{onSelect:()=>t.archive.mutate(),children:[e.archived?(0,Y.jsx)(V,{"aria-hidden":`true`}):(0,Y.jsx)(B,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,r.cancel||r.deleteRun?(0,Y.jsx)(D,{}):null,r.cancel?(0,Y.jsxs)(N,{variant:`destructive`,onSelect:()=>t.setConfirming(`cancel`),children:[(0,Y.jsx)(H,{"aria-hidden":`true`}),` Cancel`]}):null,r.deleteRun?(0,Y.jsxs)(N,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Y.jsx)(x,{"aria-hidden":`true`}),` Delete`]}):null]})]})}function je({run:e,actions:t}){let n=t.confirming;return(0,Y.jsx)(F,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Y.jsxs)(de,{children:[(0,Y.jsxs)(me,{children:[(0,Y.jsx)(ge,{children:n===`delete`?`Delete this task?`:`Cancel this task?`}),(0,Y.jsx)(he,{children:n===`delete`?`This removes the run, its transcript, its worktree and its branch. There is no undo.`:`The agent is stopped and the run completes as cancelled. The worktree stays.`})]}),(0,Y.jsxs)(_e,{children:[(0,Y.jsx)(A,{children:`Keep it`}),(0,Y.jsx)(j,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{n===`delete`?t.delete.mutate():t.cancel.mutate(),t.setConfirming(null)},children:n===`delete`?`Delete ${E(e).slice(0,40)}`:`Cancel the run`})]})]})})}function Me({hint:e}){return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`resume-hint`,title:`Copy the command`,onClick:()=>void $(e,`Command copied to clipboard.`),className:`mb-2 flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left font-mono text-[11px] text-soft-foreground hover:bg-muted hover:text-foreground`,children:[(0,Y.jsx)(b,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[`take over interactively: `,e]})]})}function Ne({runId:e}){let t=u(e);return(0,Y.jsx)(`div`,{"data-slot":`notes-panel`,className:`mb-3 max-h-72 overflow-y-auto rounded-md border border-border bg-card px-4 py-3`,children:t.isPending?(0,Y.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):t.isError?(0,Y.jsx)(`p`,{className:`text-xs text-danger`,children:t.error.message}):t.data.trim().length>0?(0,Y.jsx)(se,{children:t.data}):(0,Y.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})})}export{K as a,U as c,G as i,Q as n,Se as o,J as r,q as s,Te as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./bundle-mjs-DLPpRFyl.js";import{Dt as t}from"./centered-state-zgEVNWsj.js";import{n,t as r}from"./utils-rQGbOrwc.js";import{i,r as a,s as o,t as s}from"./dialog-DDRjj-uK.js";import{r as c}from"./skills-ynuO5oCr.js";import{t as l}from"./markdown-CR_HLGTs.js";var u=n(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),d=n(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),f=e();function p({source:e,className:t}){return(0,f.jsx)(`span`,{"data-slot":`skill-source`,"data-source":e,className:r(`shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px]`,c({source:e})?`font-semibold text-foreground`:`text-soft-foreground`,t),children:e})}function m({skill:e,usedBy:t,heading:n=`h2`}){return(0,f.jsxs)(`div`,{"data-slot":`skill-detail`,className:`min-w-0`,children:[(0,f.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2.5`,children:[(0,f.jsx)(n,{className:`min-w-0 font-mono text-lg font-semibold break-all`,children:e.name}),(0,f.jsx)(p,{source:e.source})]}),(0,f.jsxs)(`p`,{"data-slot":`skill-path`,className:`mt-1 font-mono text-[10.5px] break-all text-soft-foreground`,children:[e.path,e.team?` · from ${e.team.repo}`:``]}),e.description?(0,f.jsx)(`p`,{"data-slot":`skill-description`,className:`mt-2.5 text-[13px] text-muted-foreground`,children:e.description}):null,t===void 0?null:(0,f.jsxs)(`section`,{"data-slot":`skill-used-by`,className:`mt-5`,children:[(0,f.jsx)(`h3`,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Used by`}),t.length>0?(0,f.jsx)(`ul`,{className:`mt-1.5 flex flex-col gap-1`,children:t.map(e=>(0,f.jsxs)(`li`,{className:`flex items-center gap-1.5 font-mono text-xs text-muted-foreground`,children:[(0,f.jsx)(u,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),e]},e))}):(0,f.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:`Not referenced by any workflow yet — quick-task picks it up when the task mentions it.`})]}),(0,f.jsxs)(`section`,{className:`mt-5`,children:[(0,f.jsx)(`h3`,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Content`}),(0,f.jsx)(`div`,{"data-slot":`skill-body`,className:`mt-2 text-sm`,children:(0,f.jsx)(l,{children:e.body})})]})]})}function h({skill:e,onClose:n}){return(0,f.jsx)(s,{open:e!==null,onOpenChange:e=>e?void 0:n(),children:(0,f.jsx)(a,{"data-slot":`skill-preview`,className:`block max-h-[80dvh] overflow-y-auto sm:max-w-2xl`,children:e?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o,{className:`sr-only`,children:e.name}),(0,f.jsx)(i,{className:`sr-only`,children:`Read-only skill preview`}),(0,f.jsx)(m,{skill:e,heading:`h3`}),(0,f.jsx)(`p`,{className:`mt-5`,children:(0,f.jsx)(t,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-preview-manage`,onClick:n,className:`text-xs font-semibold text-violet hover:underline`,children:`Open in the Skills catalog`})})]}):null})})}export{d as i,h as n,p as r,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,Dt as i,It as a,Lt as o,St as s,X as c,i as l,q as u,t as d,zt as f}from"./centered-state-zgEVNWsj.js";import{t as p}from"./utils-rQGbOrwc.js";import{t as m}from"./arrow-left-BE957rJs.js";import{i as h,r as g,t as _}from"./skill-detail-CcFFKmGO.js";import{t as v}from"./refresh-cw-DCa-Rlwz.js";import{t as y}from"./triangle-alert-6su4Js5O.js";import{i as b,o as x,r as S,t as C}from"./skills-ynuO5oCr.js";import{t as w}from"./input-BRsSo4xH.js";import{X as T,s as E}from"./index-Cv1pQs9U.js";var D=t(n(),1),O=e(),k=`__bm`;function A(){return(0,O.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,O.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,O.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,O.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,O.jsx)(j,{})]})}function j(){let e=u(),t=c(),[n]=a(),[g,S]=(0,D.useState)(``),A=f(),j=o({mutationFn:()=>s(),onSuccess:e=>{A.setQueryData(r.skills,e),l(`Team skills refreshed.`)},onError:e=>l(e.message,{tone:`danger`})});if(e.isError)return(0,O.jsx)(d,{icon:(0,O.jsx)(y,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let N=b(e.data??[]),P=n.get(`skill`),F=P===k?k:P!==null&&N.some(e=>e.name===P)?P:N[0]?.name??k,I=N.find(e=>e.name===F)??null,L=C(N,g);return(0,O.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,O.jsxs)(`section`,{"data-slot":`skills-list`,className:p(`w-full flex-col border-border md:flex md:w-[320px] md:shrink-0 md:border-r`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,P===null?`flex`:`hidden md:flex`),children:[(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,O.jsx)(w,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:g,onChange:e=>S(e.target.value),className:`h-8 text-[13px]`}),(0,O.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:j.isPending,onClick:()=>j.mutate(),className:`flex h-8 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,O.jsx)(v,{"aria-hidden":`true`,className:p(`size-3`,j.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,O.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,O.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):L.length>0?L.map(e=>(0,O.jsx)(M,{skill:e,active:F===e.name},e.path)):(0,O.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:N.length>0?`(no skills match)`:(0,O.jsxs)(O.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,O.jsx)(`span`,{className:`font-mono`,children:`.ai/skills/`}),` or`,` `,(0,O.jsx)(`span`,{className:`font-mono`,children:`.ai/cezar/skills/`}),` — optional frontmatter:`,` `,(0,O.jsx)(`span`,{className:`font-mono`,children:`name`}),`, `,(0,O.jsx)(`span`,{className:`font-mono`,children:`description`}),`. Team skills from your skills repo appear here too — try Refresh.`]})})}),(0,O.jsx)(`div`,{className:`shrink-0 border-t border-border p-2`,children:(0,O.jsxs)(i,{to:`/skills?skill=${k}`,"data-slot":`bookmarklets-row`,"aria-current":F===k?`page`:void 0,className:p(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,F===k&&`bg-muted`),children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(h,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,O.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px] text-soft-foreground`,children:`bookmarklets`})]}),(0,O.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})})]}),(0,O.jsx)(`section`,{"data-slot":`skills-detail`,className:p(`min-w-0 flex-1 flex-col`,P===null?`hidden md:flex`:`flex`),children:(0,O.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,O.jsxs)(i,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,O.jsx)(m,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),F===k?(0,O.jsx)(E,{skills:N}):I?(0,O.jsx)(_,{skill:I,usedBy:x(t.data?.workflows??[],I.name)}):e.isPending?null:(0,O.jsx)(d,{icon:(0,O.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})}function M({skill:e,active:t}){let n=S(e);return(0,O.jsx)(`li`,{children:(0,O.jsxs)(i,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":n?`true`:void 0,"aria-current":t?`page`:void 0,className:p(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,t&&`bg-muted`),children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(T,{"aria-hidden":`true`,className:p(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,O.jsx)(`span`,{className:p(`min-w-0 truncate font-mono text-[13px]`,n?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,O.jsx)(g,{source:e.source,className:`ml-auto`})]}),e.description?(0,O.jsx)(`span`,{className:`line-clamp-2 pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})})}export{A as SkillsRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./bundle-mjs-DLPpRFyl.js";import{Dt as t}from"./centered-state-zgEVNWsj.js";import{n,t as r}from"./utils-rQGbOrwc.js";var i=n(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),a=e();function o({to:e,active:n=!1,children:i}){return(0,a.jsx)(t,{to:e,"aria-current":n?`page`:void 0,className:r(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,n?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:i})}export{i as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,Ft as i,Lt as a,R as o,Z as s,a as c,at as l,ft as u,i as d,j as f,mt as p,t as m,tt as h,yt as g,z as _,zt as v}from"./centered-state-zgEVNWsj.js";import{a as y,i as b,t as x}from"./run-header-CDKw22ek.js";import{a as S,i as C,n as w,r as T}from"./git-toolbar-C4jo602L.js";import{a as E,n as D,t as O}from"./use-desktop-CyEWsxSU.js";import{a as k,i as A,o as j,r as M,s as N,t as P}from"./dialog-DDRjj-uK.js";import{C as F,L as I,c as L,d as R,u as z}from"./index-Cv1pQs9U.js";var B=t(n(),1),V=e=>e===`running`||e===`queued`||e===`waiting`,H=`no worktree — this task ran directly in the repo working tree`;function U(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 — ${H}`)}function W(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 — ${H}`)}function G(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 — ${H}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?V(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 K(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:U(e),n=e.prUrl?[U(e),W(e)]:[W(e),G(e)],r=[];if(e.localHandoff){let t=e.hasSession?V(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 q=e();function J({run:e,open:t,onOpenChange:n}){let i=v(),[o,s]=(0,B.useState)(``),l=I(e),u=(0,B.useRef)(l);u.current=l,(0,B.useEffect)(()=>{t&&s(u.current)},[t]);let f=a({mutationFn:t=>h(e.id,t),onSuccess:t=>{d(`Committed ${t.sha.slice(0,7)}`),n(!1),i.invalidateQueries({queryKey:r.runs.changes(e.id)}),i.invalidateQueries({queryKey:r.runs.all})},onError:e=>d(e.message,{tone:`danger`})}),p=()=>{let e=o.trim();e.length===0||f.isPending||f.mutate(e)};return(0,q.jsx)(P,{open:t,onOpenChange:n,children:(0,q.jsxs)(M,{"data-slot":`commit-dialog`,children:[(0,q.jsxs)(j,{children:[(0,q.jsx)(N,{children:`Commit changes`}),(0,q.jsxs)(A,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,q.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,q.jsx)(L,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{F({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(),p())}}),(0,q.jsxs)(k,{children:[(0,q.jsx)(c,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,q.jsx)(c,{"data-slot":`commit-confirm`,disabled:o.trim().length===0||f.isPending,onClick:p,children:f.isPending?`Committing…`:`Commit`})]})]})})}function Y(){let{id:e}=i(),t=o(e);return t.isPending?(0,q.jsx)(R,{tab:`changes`}):t.isError?(0,q.jsx)(z,{tab:`changes`,error:t.error}):(0,q.jsx)(X,{run:t.data})}function X({run:e}){let t=f(),n=_(e.id,b(e.status)),i=O(),[o,c]=(0,B.useState)(`unified`),[u,h]=(0,B.useState)(!1),[k,A]=(0,B.useState)(null),[j,M]=(0,B.useState)(!1),N=v(),P=()=>N.invalidateQueries({queryKey:r.runs.all}),F=e=>d(e.message,{tone:`danger`}),I=a({mutationFn:()=>g(e.id),onSuccess:e=>d(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:F}),L=a({mutationFn:()=>l(e.id),onSuccess:e=>{d(`Draft PR created — ${e.url}`),P()},onError:F}),R=a({mutationFn:()=>p(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>d(`No terminal found — command copied to clipboard.`)).catch(()=>d(`Run manually: ${e.command}`));return}F(e)}}),z=n.isError&&n.error instanceof s&&n.error.status===409,V=K({status:e.status,hasWorktree:!!e.worktreePath&&!z,branch:e.branch,changedFiles:n.data?.stat.files,remote:t.data?.repo?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:y(e)!==void 0,prUrl:e.pullRequestUrl}),H=e=>{switch(e){case`commit`:M(!0);break;case`push`:I.mutate();break;case`create-pr`:L.mutate();break;case`open-terminal`:R.mutate();break;case`view-pr`:break}},U=n.data?.files??[],W=(0,B.useMemo)(()=>T(U),[U]),G=i?o:`unified`,Y=!i||u;return(0,q.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,q.jsx)(x,{run:e,tab:`changes`}),(0,q.jsx)(w,{bar:V,branch:e.branch,stat:n.data?.stat,mode:G,wrap:Y,onModeChange:c,onWrapChange:h,onAction:H}),n.isPending?(0,q.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):n.isError?(0,q.jsx)(m,{icon:z?(0,q.jsx)(S,{}):(0,q.jsx)(E,{}),tone:z?`neutral`:`danger`,heading:`h2`,title:z?`No changes to show`:`Could not load the changes`,subtitle:n.error.message}):U.length===0?(0,q.jsx)(m,{icon:(0,q.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-start gap-5 px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:[(0,q.jsx)(`aside`,{className:`sticky top-40 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,q.jsx)(C,{root:W,selected:k,onSelect:e=>{A(e),document.querySelector(`[data-slot="diff-file"][data-path="${CSS.escape(e)}"]`)?.scrollIntoView?.({block:`start`,behavior:`smooth`})}})}),(0,q.jsx)(D,{files:U,mode:G,wrap:Y,loadFileText:t=>Z(e.id,t),className:`min-w-0 flex-1`})]}),(0,q.jsx)(J,{run:e,open:j,onOpenChange:M})]})}async function Z(e,t){try{let n=await u(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{Y as TaskChangesRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{B as r,Dt as i,Ft as a,R as o,V as s,Z as c,a as l,t as u}from"./centered-state-zgEVNWsj.js";import{i as d,t as f}from"./run-header-CDKw22ek.js";import{t as p}from"./arrow-left-BE957rJs.js";import{a as m,i as h,n as g,t as _}from"./use-desktop-CyEWsxSU.js";import{t as v}from"./search-x-CoCyl7zT.js";import{t as y}from"./triangle-alert-6su4Js5O.js";import{P as b,d as x,u as S}from"./index-Cv1pQs9U.js";var C=t(n(),1),w=e();function T(){let{id:e}=a(),t=o(e);return t.isPending?(0,w.jsx)(x,{tab:`changes`}):t.isError?(0,w.jsx)(S,{tab:`changes`,error:t.error}):(0,w.jsx)(E,{run:t.data})}function E({run:e}){let{sha:t}=a(),n=s(e.id,d(e.status));return(0,w.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,w.jsx)(f,{run:e,tab:`commits`}),t?(0,w.jsx)(D,{runId:e.id,sha:t}):n.isPending?(0,w.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,w.jsx)(u,{icon:(0,w.jsx)(m,{}),tone:n.error instanceof c&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof c&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,w.jsx)(u,{icon:(0,w.jsx)(m,{}),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,w.jsx)(`ul`,{"data-slot":`task-commits`,className:`mx-auto flex w-full max-w-[820px] flex-col divide-y divide-border px-2 py-1 md:px-4`,children:n.data.commits.map(t=>(0,w.jsx)(`li`,{children:(0,w.jsxs)(i,{"data-slot":`commit-row`,"data-sha":t.sha,to:`/tasks/${e.id}/commits/${t.sha}`,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,w.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:t.sha.slice(0,8)}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:t.subject}),(0,w.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[t.author,` · `,t.when]})]})},t.sha))})]})}function D({runId:e,sha:t}){let n=r(e,t),a=_(),[o,s]=(0,C.useState)(`unified`),[d,f]=(0,C.useState)(!1),x=n.isError&&n.error instanceof c&&n.error.status===409,S=a?o:`unified`,T=!a||d;return(0,w.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[820px] flex-1 flex-col`,children:[(0,w.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,w.jsx)(l,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,w.jsxs)(i,{to:`/tasks/${e}/commits`,children:[(0,w.jsx)(p,{"aria-hidden":`true`}),`All commits`]})}),n.data?(0,w.jsx)(b,{stat:n.data.stat}):null,(0,w.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,w.jsx)(h,{mode:o,wrap:d,onModeChange:s,onWrapChange:f})})]}),n.isPending?(0,w.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,w.jsx)(u,{icon:x?(0,w.jsx)(v,{}):(0,w.jsx)(y,{}),tone:x?`neutral`:`danger`,heading:`h2`,title:x?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,w.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,w.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,w.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,w.jsx)(u,{icon:(0,w.jsx)(m,{}),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,w.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:(0,w.jsx)(g,{files:n.data.files,mode:S,wrap:T,className:`min-w-0`})})]})]})}export{T as TaskCommitsRoute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{Ft as r,R as i,U as a,Z as o,
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{Ft as r,R as i,U as a,Z as o,t as s,wt as c}from"./centered-state-zgEVNWsj.js";import{n as l,t as u}from"./utils-rQGbOrwc.js";import{t as d}from"./run-header-CDKw22ek.js";import{n as f,t as p}from"./folder-RbRLfIX-.js";import{t as m}from"./triangle-alert-6su4Js5O.js";import{i as h,n as g,r as _}from"./highlighter-BKVEsACy.js";import{d as v,ot as y,u as b}from"./index-Cv1pQs9U.js";var x=l(`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`}]]),S=l(`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`}]]),C=l(`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`}]]),w=l(`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`}]]),T=l(`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`}]]),E=l(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),D=t(n(),1),O=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function k(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:O.has(t.slice(n+1).toLowerCase())}function A(e){return e.tooLarge?`too-large`:k(e.path)?`image`:e.binary?`binary`:`text`}function j(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var M=e();function N({runId:e,path:t,className:n}){let r=a(e,t??void 0);if(t===null)return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(s,{icon:(0,M.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from the tree to preview it here.`})});if(r.isPending)return(0,M.jsx)(F,{className:n,children:(0,M.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 o&&r.error.status===409;return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(s,{icon:e?(0,M.jsx)(C,{}):(0,M.jsx)(m,{}),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,M.jsx)(P,{runId:e,entry:r.data,className:n}):null}function P({runId:e,entry:t,className:n}){let r=A(t);return(0,M.jsxs)(F,{className:n,children:[(0,M.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,M.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,M.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:j(t.size)})]}),r===`image`?(0,M.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,M.jsx)(`img`,{"data-slot":`file-preview-image`,src:c(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,M.jsx)(s,{icon:(0,M.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${j(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,M.jsx)(s,{icon:(0,M.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${j(t.size)} of binary data — no text preview.`}):(0,M.jsx)(R,{path:t.path,text:t.content??``})]})}function F({className:e,children:t}){return(0,M.jsx)(`section`,{"data-slot":`file-preview`,className:u(`overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var I=1500;function L(e,t){let n=(0,D.useMemo)(()=>t.split(`
|
|
2
2
|
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>h(e),[e]),i=n.length>I,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return g(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:_(t,r)?.tokens??n}function R({path:e,text:t}){let n=L(e,t);return(0,M.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":h(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex px-4`,children:[(0,M.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,M.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function z({runId:e,selected:t,onSelect:n}){return(0,M.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function B({runId:e,path:t,depth:n,selected:r,onSelect:i}){let o=a(e,t);return o.isPending?(0,M.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${24+n*14}px`},children:`Loading…`}):o.isError?(0,M.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${24+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,M.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${24+n*14}px`},children:`Empty directory`}):(0,M.jsx)(M.Fragment,{children:o.data.entries.map(a=>a.type===`dir`?(0,M.jsx)(V,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,M.jsx)(H,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function V({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let[o,s]=(0,D.useState)(!1);return(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex 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,M.jsx)(y,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform`,o&&`rotate-90`)}),(0,M.jsx)(p,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),o?(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function H({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=k(t)?T:f;return(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:u(`flex 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:`${24+r*14}px`},children:[(0,M.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,M.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:j(n)})]})})}function U(){let{id:e}=r(),t=i(e);return t.isPending?(0,M.jsx)(v,{tab:`files`}):t.isError?(0,M.jsx)(b,{tab:`files`,error:t.error}):(0,M.jsx)(W,{run:t.data})}function W({run:e}){let t=a(e.id,``),[n,r]=(0,D.useState)(null),i=t.isError&&t.error instanceof o&&t.error.status===409;return(0,M.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,M.jsx)(d,{run:e,tab:`files`}),t.isPending?(0,M.jsx)(`p`,{"data-slot":`files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading files…`}):t.isError?(0,M.jsx)(s,{icon:i?(0,M.jsx)(w,{}):(0,M.jsx)(m,{}),tone:i?`neutral`:`danger`,heading:`h2`,title:i?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 px-4 py-4 md:flex-row md:items-start md:px-6`,children:[(0,M.jsx)(`aside`,{className:`w-full shrink-0 md:sticky md:top-28 md:w-60 lg:w-72`,children:(0,M.jsx)(z,{runId:e.id,selected:n,onSelect:r})}),(0,M.jsx)(N,{runId:e.id,path:n,className:`min-w-0 flex-1`})]})]})}export{U as TaskFilesRoute};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{t as r}from"./react-dom-Ddtik4qM.js";import{D as i,Dt as a,Ft as o,G as s,K as c,Lt as l,Mt as u,R as d,Z as f,a as p,at as m,i as h,n as g,nt as _,
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{t as r}from"./react-dom-Ddtik4qM.js";import{D as i,Dt as a,Ft as o,G as s,K as c,Lt as l,Mt as u,R as d,Z as f,a as p,at as m,i as h,n as g,nt as _,t as v,zt as y}from"./centered-state-zgEVNWsj.js";import{n as b,t as x}from"./utils-rQGbOrwc.js";import{c as S,n as C,o as w,r as T,s as E,t as D}from"./run-header-CDKw22ek.js";import{n as O,t as ee}from"./loader-circle-BV3DO9mE.js";import{n as te,t as k}from"./trash-2-CDtxmmc8.js";import{n as ne}from"./tab-link-C77EP3i6.js";import{t as re}from"./git-pull-request-DJkAMT0f.js";import{t as ie}from"./search-x-CoCyl7zT.js";import{t as ae}from"./square-terminal-B6PZX4Qp.js";import{i as A,n as j,r as M,t as oe}from"./run-diff-BocG6LVd.js";import{t as se}from"./markdown-CR_HLGTs.js";import{C as ce,S as le,Z as ue,c as de,ct as fe,et as pe,it as me,l as he,lt as ge,ot as N,q as _e,st as ve}from"./index-Cv1pQs9U.js";var ye=b(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),be=b(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),xe=b(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Se=b(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ce=b(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),we=b(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Te=b(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Ee=b(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),P=t(n(),1),De=[`run-event`,`ui-event`];function Oe(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let{seq:n,type:r}=t;return typeof n!=`number`||typeof r!=`string`||r===``?null:t}function ke(e){let[t,n]=(0,P.useState)([]);return(0,P.useEffect)(()=>{if(n([]),!e)return;let t=globalThis.EventSource;if(typeof t!=`function`)return;let r=0,i=null,a,o=!1,s=e=>{let t=Oe(e.data);!t||!(t.seq>r)||(r=t.seq,n(e=>[...e,t]))},c=()=>{o||a!==void 0||(a=setTimeout(()=>{a=void 0,o||l()},1500))},l=()=>{i?.close(),i=new t(`/api/runs/${encodeURIComponent(e)}/events`);for(let e of De)i.addEventListener(e,s);i.addEventListener(`error`,()=>{i?.readyState===2&&c()})},u=()=>{document.visibilityState===`visible`&&(!i||i.readyState===2)&&(clearTimeout(a),a=void 0,l())},d=()=>{clearTimeout(a),a=void 0,i?.close()},f=e=>{e.persisted&&l()};return document.addEventListener(`visibilitychange`,u),window.addEventListener(`pagehide`,d),window.addEventListener(`pageshow`,f),l(),()=>{o=!0,clearTimeout(a),document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`pagehide`,d),window.removeEventListener(`pageshow`,f),i?.close()}},[e]),t}function Ae(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function je(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Ae(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Ae(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Me(e){let t=(0,P.useRef)(e);t.current=e,(0,P.useEffect)(()=>{let e=document.documentElement;return je(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Ne=t(r(),1),F=e();function Pe({src:e,alt:t=``,className:n,...r}){let[i,a]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&a(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`img`,{...r,src:e,alt:t,loading:`lazy`,onClick:()=>a(!0),className:x(`cursor-zoom-in`,n)}),i?(0,Ne.createPortal)((0,F.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,"data-slot":`image-lightbox`,onClick:()=>a(!1),className:`fixed inset-0 z-[100] flex cursor-zoom-out items-center justify-center bg-black/80 p-4 backdrop-blur-sm`,children:(0,F.jsx)(`img`,{src:e,alt:t,className:`max-h-full max-w-full rounded-md object-contain shadow-2xl`})}),document.body):null]})}var I=e=>e.kind===`tool`,Fe=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,Ie=(e,t,n)=>`${e} ${e===1?t:n}`;function Le(e,t){let n=[];return e>0&&n.push(Ie(e,`file`,`files`)),t>0&&n.push(Ie(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function Re(e){return`${e} earlier tool call${e===1?``:`s`}`}var ze=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function Be(e){for(let t of ze)if(e.startsWith(`${t} `)&&e.length>t.length+1)return{verb:t===`Task:`?`Task`:t,detail:e.slice(t.length+1)};return{verb:e}}function Ve(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)),n=new Set(t.filter(I).map(e=>e.id)),r=new Map,i=[];for(let e of t){let t=(e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`)&&e.parentItemId!==void 0&&e.parentItemId!==e.id&&n.has(e.parentItemId)?e.parentItemId:void 0;if(t===void 0)i.push(e);else{let n=r.get(t);n?n.push(e):r.set(t,[e])}}let a=[],o=[],s=()=>{if(o.length>=2){let e=o.filter(e=>e.toolKind===`read`).length;a.push({kind:`context-group`,id:`group:${o[0].id}`,tools:o,files:e,searches:o.length-e,label:Le(e,o.length-e)})}else for(let e of o)a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]});o=[]};for(let e of i)I(e)&&Fe(e)&&!r.has(e.id)?o.push(e):(s(),I(e)?a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]}):a.push({kind:`entry`,id:e.id,entry:e}));s();let c=e=>e.kind===`context-group`||e.kind===`tool-card`&&e.item.status===`completed`,l=e=>e.kind===`context-group`?e.tools.length:1,u=[],d=[],f=()=>{if(d.length>3){let e=d.slice(0,d.length-3);u.push({kind:`streak`,id:`streak:${e[0].id}`,count:e.reduce((e,t)=>e+l(t),0),blocks:e}),u.push(...d.slice(d.length-3))}else u.push(...d);d=[]};for(let e of a)c(e)?d.push(e):(f(),u.push(e));return f(),u}var L=new Map,He=(0,P.createContext)(null);function Ue(){return(0,P.useContext)(He)}function We({runId:e,children:t}){let n=(0,P.useMemo)(()=>({get:t=>L.get(e)?.get(t),set:(t,n)=>{let r=L.get(e)??new Map;r.set(t,n),L.set(e,r)}}),[e]);return(0,F.jsx)(He.Provider,{value:n,children:t})}function R(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function Ge(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var Ke=new Map;function qe(e,t){Ke.set(e,t)}function Je(e){return Ke.get(e)}var Ye=new Map;function Xe(e,t){Ye.set(e,t)}function Ze(e,t){let n=Ye.get(e);return n!==void 0&&n.rows===t?n.cache:void 0}function z({text:e,imageCount:t=0,images:n=[]}){let r=t-n.length;return(0,F.jsxs)(`div`,{"data-slot":`user-bubble`,className:`max-w-[78%] self-end rounded-2xl rounded-br-md bg-muted px-[15px] py-2.5 text-[13.5px] leading-[1.55] whitespace-pre-wrap md:max-w-[70%]`,children:[e,n.length>0?(0,F.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:n.map(e=>(0,F.jsx)(Pe,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e))}):null,r>0?(0,F.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[r,` image`,r>1?`s`:``,` attached`]}):null]})}function Qe({text:e}){return(0,F.jsx)(`div`,{"data-slot":`assistant-message`,className:`min-w-0 text-[13.5px] leading-[1.6]`,children:(0,F.jsx)(se,{children:e})})}function $e({note:e}){return(0,F.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:x(`px-0.5 text-xs`,e.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:`· `,e.text]})}function et({text:e}){let t=e.split(`
|
|
2
2
|
`,1)[0]??``,n=t.length<e.length;return(0,F.jsxs)(j,{"data-slot":`reasoning`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex w-full items-center gap-1.5 rounded-md p-0.5 text-left text-[13px] text-soft-foreground hover:text-muted-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,F.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Thinking — `,(0,F.jsx)(`em`,{className:`text-muted-foreground not-italic`,children:t}),n?`…`:``]})]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`px-6 py-1.5 text-[13px] leading-[1.6] whitespace-pre-wrap text-soft-foreground`,children:e})})]})}var tt={read:S,edit:Te,delete:k,move:xe,search:ue,execute:ae,think:ye,fetch:Se,task:fe,plan:Ce,other:Ee},nt=e=>e.split(`
|
|
3
3
|
`).length;function rt({text:e,streaming:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null),a=(0,P.useRef)(!0);(0,P.useEffect)(()=>{let e=i.current;t&&e&&a.current&&(e.scrollTop=e.scrollHeight)},[e,t]);let o=nt(e),s=!t&&!n&&o>12;return(0,F.jsxs)(`div`,{"data-slot":`tool-output`,"data-clamped":s?`true`:void 0,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{ref:i,onScroll:t?e=>{a.current=R(e.currentTarget)}:void 0,className:x(`overflow-x-auto`,t&&`max-h-[216px] overflow-y-auto`,s&&`max-h-[216px] overflow-y-hidden`),children:(0,F.jsx)(`pre`,{className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre text-muted-foreground`,children:e})}),s?(0,F.jsx)(`div`,{"data-slot":`tool-output-fade`,"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-b from-transparent to-card-2`}):null]}),!t&&o>12?(0,F.jsx)(`button`,{type:`button`,"data-slot":`tool-output-toggle`,onClick:()=>r(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:n?`Show less`:`Show all ${o} lines`}):null]})}function it({diffs:e}){return(0,F.jsx)(F.Fragment,{children:e.map((e,t)=>(0,F.jsxs)(`div`,{"data-slot":`diff-preview`,className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`border-b border-border/50 px-4 py-1.5 font-mono text-[11px] text-soft-foreground`,children:e.path}),(0,F.jsx)(`pre`,{className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:e.unified===void 0?[...at(e.oldText).map((e,t)=>(0,F.jsxs)(`span`,{className:`block bg-diff-del px-4 text-muted-foreground`,children:[`- `,e]},`old-${t}`)),...at(e.newText).map((e,t)=>(0,F.jsxs)(`span`,{className:`block bg-diff-add px-4`,children:[`+ `,e]},`new-${t}`))]:e.unified.split(`
|
|
4
4
|
`).map((e,t)=>(0,F.jsx)(ot,{text:e},t))})]},`${e.path}:${t}`))})}function at(e){return e==null||e===``?[]:e.replace(/\n$/,``).split(`
|
|
5
|
-
`)}function ot({text:e}){return(0,F.jsx)(`span`,{className:x(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del text-muted-foreground`,e.startsWith(`@@`)&&`text-soft-foreground`),children:e})}function st(e){return e.status===`failed`||e.toolKind===`execute`&&e.status===`running`&&e.output!==void 0}function B({item:e,nested:t=[],cacheKey:n}){let r=Ue(),[i,a]=(0,P.useState)(()=>n===void 0?null:r?.get(n)??null),o=e=>{n!==void 0&&r?.set(n,e),a(e)},s=e.status===`running`||e.status===`pending`,c=e.output!==void 0&&e.output!==``||e.error!==void 0&&e.error!==``||e.diffs!==void 0&&e.diffs.length>0||t.length>0,l=c&&(i??st(e)),{verb:u,detail:d}=Be(e.title),f=tt[e.toolKind]??Ee;return(0,F.jsxs)(j,{"data-slot":`tool-card`,"data-status":e.status,"data-kind":e.toolKind,open:l,onOpenChange:o,className:x(`min-w-0 overflow-hidden rounded-lg border bg-card`,e.status===`failed`?`border-danger/40`:`border-border`),children:[(0,F.jsxs)(A,{disabled:!c,className:`group flex min-h-[42px] w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] enabled:hover:bg-muted`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:x(`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`,!c&&`invisible`)}),(0,F.jsx)(f,{"aria-hidden":!0,className:x(`size-4 shrink-0`,e.status===`failed`?`text-danger`:`text-muted-foreground`)}),(0,F.jsx)(`span`,{className:x(`shrink-0 font-semibold`,s&&`shimmer`,e.status===`failed`&&`text-danger`,e.status===`declined`&&`text-muted-foreground`),children:u}),d===void 0?null:(0,F.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:d}),(0,F.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[s?(0,F.jsx)(ee,{role:`status`,"aria-label":`Running`,className:`size-3.5 animate-spin text-soft-foreground`}):null,e.status===`failed`?(0,F.jsx)(`span`,{className:`text-xs text-danger`,children:`failed`}):null,e.status===`declined`?(0,F.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`declined`}):null,e.toolKind===`execute`&&typeof e.exitCode==`number`?(0,F.jsx)(`span`,{"data-slot":`tool-exit`,className:x(`rounded-full px-2 py-px font-mono text-[10.5px] font-semibold`,e.exitCode===0?`bg-success/10 text-success`:`bg-danger/10 text-danger`),children:e.exitCode}):null]})]}),(0,F.jsx)(M,{children:(0,F.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[e.error!==void 0&&e.error!==``?(0,F.jsx)(`div`,{"data-slot":`tool-error`,className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre-wrap text-danger`,children:e.error}):null,e.diffs!==void 0&&e.diffs.length>0?(0,F.jsx)(it,{diffs:e.diffs}):null,e.output!==void 0&&e.output!==``?(0,F.jsx)(rt,{text:e.output,streaming:s}):null,t.length>0?(0,F.jsx)(`div`,{"data-slot":`tool-nested`,className:`flex flex-col gap-2 border-l-2 border-border py-2.5 pr-3 pl-3 ml-4 my-2`,children:t.map(e=>(0,F.jsx)(ct,{entry:e,scope:n},e.id))}):null]})})]})}function ct({entry:e,scope:t}){switch(e.kind){case`message`:return(0,F.jsx)(Qe,{text:e.text});case`reasoning`:return(0,F.jsx)(et,{text:e.text});case`tool`:return(0,F.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`});case`note`:return(0,F.jsx)($e,{note:e});case`image`:return(0,F.jsx)(dt,{image:e})}}function lt({group:e,scope:t}){return(0,F.jsxs)(j,{"data-slot":`ctx-group`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex h-[34px] w-full items-center gap-2 rounded-md px-2 -mx-2 text-left text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),e.label]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 pt-1.5 pl-4`,children:e.tools.map(e=>(0,F.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`},e.id))})})]})}function ut({count:e,children:t}){return(0,F.jsxs)(j,{"data-slot":`tool-streak`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex items-center gap-1.5 rounded-md p-0.5 text-left text-xs text-soft-foreground hover:text-muted-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),Re(e)]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:t})})]})}function dt({image:e}){return(0,F.jsx)(Pe,{"data-slot":`thread-image`,src:e.url,alt:e.name??`image from the agent session`,className:`max-h-72 max-w-full self-start rounded-lg border border-border`})}var ft=new Map;function pt(){return typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches}function mt(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.length}}function ht(e){return e.find(e=>e.status===`in_progress`)??e.find(e=>e.status===`pending`)}function gt({runId:e,entries:t}){let[n,r]=(0,P.useState)(()=>ft.get(e)??pt());if(t.length===0)return null;let{done:i,total:a}=mt(t),o=ht(t);return(0,F.jsxs)(`section`,{"data-slot":`plan-dock`,"data-state":n?`open`:`collapsed`,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs`,children:[(0,F.jsx)(`div`,{"aria-hidden":!0,"data-slot":`grad-edge`,className:`h-[3px]`,style:{background:`var(--grad)`}}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(t=>(ft.set(e,!t),!t)),"aria-expanded":n,className:x(`flex w-full items-center gap-2 px-3.5 text-left text-[13px]`,n?`pt-2 pb-1.5`:`py-2`),children:[(0,F.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Plan`}),(0,F.jsxs)(`span`,{"data-slot":`plan-count`,className:`shrink-0 text-muted-foreground tabular-nums`,children:[`· `,i,`/`,a]}),!n&&o!==void 0?(0,F.jsxs)(`span`,{"data-slot":`plan-current`,className:`min-w-0 truncate text-muted-foreground`,children:[`— `,o.activeForm??o.content]}):null,(0,F.jsx)(ve,{"aria-hidden":!0,className:x(`ml-auto size-3.5 shrink-0 text-soft-foreground transition-transform`,!n&&`rotate-180`)})]}),n?(0,F.jsx)(`ul`,{"data-slot":`plan-list`,className:`flex flex-col gap-[7px] px-3.5 pb-3`,children:t.map((e,t)=>(0,F.jsx)(_t,{entry:e},`${t}:${e.content}`))}):null]})}function _t({entry:e}){return(0,F.jsxs)(`li`,{"data-slot":`plan-item`,"data-status":e.status,className:x(`flex min-h-5 min-w-0 items-center gap-2.5 text-[13px]`,e.status===`completed`&&`text-soft-foreground line-through`,e.status===`in_progress`&&`font-medium`,e.status===`pending`&&`text-muted-foreground`),children:[(0,F.jsx)(vt,{status:e.status}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e.content}),e.status===`in_progress`?(0,F.jsx)(`span`,{"data-slot":`plan-tag`,className:`ml-auto shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10.5px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:`in progress`}):null]})}function vt({status:e}){return e===`completed`?(0,F.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,F.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`in_progress`?(0,F.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,F.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,F.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]}):(0,F.jsx)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})})}function yt({run:e}){return(0,F.jsxs)(`section`,{"data-slot":`review-panel`,"aria-label":`Review the changes`,className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{"data-slot":`review-banner`,className:`flex items-center gap-2.5 rounded-md border border-violet/30 bg-violet/10 px-3.5 py-2.5`,children:[(0,F.jsx)(me,{className:`size-4 shrink-0 text-violet`,"aria-hidden":`true`}),(0,F.jsxs)(`p`,{className:`min-w-0 text-[13px]`,children:[(0,F.jsx)(`span`,{className:`font-semibold`,children:`Review the changes before anything lands.`}),` `,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Read the diff, send notes back, draft a PR — or accept. Nothing merges on its own.`})]})]}),(0,F.jsx)(oe,{runId:e.id}),(0,F.jsx)(bt,{run:e})]})}function bt({run:e}){let t=y(),n=(0,P.useRef)(null),[r,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),c=C(e.id),u=()=>t.invalidateQueries({queryKey:i.runs.all}),d=l({mutationFn:t=>_(e.id,`Review feedback:\n${t}`),onSuccess:()=>{a(``),u()},onError:e=>g(e.message,{tone:`danger`})}),h=l({mutationFn:()=>m(e.id),onSuccess:e=>{g(`Draft PR created — ${e.url}`),u()},onError:e=>{e instanceof f&&e.manual!==void 0&&s(e.manual),g(e.message,{tone:`danger`})}}),v=()=>{let e=r.trim();if(e.length===0){g(`Write what to change first.`),n.current?.focus();return}d.mutate(e)};return(0,F.jsxs)(`div`,{"data-slot":`review-actions`,className:`flex flex-col gap-2`,children:[(0,F.jsx)(de,{ref:n,"data-slot":`review-notes`,"aria-label":`Notes for the agent`,placeholder:`Notes for the agent — what should change?`,rows:2,value:r,onChange:e=>a(e.target.value),onKeyDown:e=>{ce({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(),v())},className:`min-h-[52px] text-[13px]`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(p,{"data-slot":`review-send-back`,variant:`outline`,size:`sm`,title:`Send the notes back into the agent's session`,disabled:d.isPending,onClick:v,children:[(0,F.jsx)(be,{"aria-hidden":`true`}),`Send back`]}),e.pullRequestUrl===void 0?(0,F.jsxs)(p,{"data-slot":`review-draft-pr`,variant:`outline`,size:`sm`,title:`Push the branch and open a draft PR`,disabled:h.isPending,onClick:()=>h.mutate(),children:[(0,F.jsx)(re,{"aria-hidden":`true`}),`Draft PR`]}):(0,F.jsx)(p,{asChild:!0,variant:`outline`,size:`sm`,children:(0,F.jsxs)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,title:`The PR for this task is already open`,children:[(0,F.jsx)(ne,{"aria-hidden":`true`}),`PR ↗`]})}),(0,F.jsxs)(p,{"data-slot":`review-accept`,variant:`contrast`,size:`sm`,className:`ml-auto`,title:T(`review`),disabled:c.isPending,onClick:()=>c.mutate(),children:[(0,F.jsx)(O,{"aria-hidden":`true`}),`Accept`]})]}),o===null?null:(0,F.jsx)(xt,{command:o})]})}function xt({command:e}){return(0,F.jsxs)(`button`,{type:`button`,"data-slot":`review-manual`,title:`Copy the command`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>g(`Command copied to clipboard.`)).catch(()=>g(`Run manually: ${e}`))},className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left font-mono text-[11px] text-soft-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(te,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,F.jsxs)(`span`,{className:`truncate`,children:[`manual path: `,e]})]})}function St(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Ct=1500;function wt({status:e}){let t=(0,P.useRef)(e),[n,r]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{let n=t.current;if(t.current=e,n!==`review`||e!==`done`||St())return;r(!0);let i=setTimeout(()=>r(!1),Ct);return()=>clearTimeout(i)},[e]),n?(0,F.jsxs)(`div`,{"data-slot":`accept-celebration`,"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 isolate z-40`,children:[(0,F.jsx)(h,{}),(0,F.jsx)(`div`,{className:`flex justify-center pt-24`,children:(0,F.jsx)(`span`,{className:`rounded-full border border-violet/30 bg-violet/15 px-4 py-1.5 text-[13px] font-medium text-violet shadow-modal`,children:`✓ Changes accepted`})})]}):null}var V=null,{min:H,max:U,abs:Tt,floor:Et}=Math,Dt=(e,t,n)=>H(n,U(t,e)),Ot=e=>[...e].sort((e,t)=>e-t),kt=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)},At=()=>{let e;return[new Promise(t=>{e=t}),e]},jt=e=>{let t;return()=>(e&&=(t=e(),void 0),t)},W=(e,t,n)=>{let r=n?`unshift`:`push`;for(let n=0;n<t;n++)e[r](-1);return e},Mt=(e,t)=>{let n=e.t[t];return n===-1?e.o:n},Nt=(e,t,n)=>{let r=e.t[t]===-1;return e.t[t]=n,e.i=H(t,e.i),r},G=(e,t)=>{if(!e.l)return 0;if(e.i>=t)return e.u[t];e.i<0&&(e.u[0]=0,e.i=0);let n=e.i,r=e.u[n];for(;n<t;)r+=Mt(e,n),e.u[++n]=r;return e.i=t,r},K=(e,t,n=0,r=e.l-1)=>{let i=n;for(;n<=r;){let a=Et((n+r)/2);G(e,a)<=t?(i=a,n=a+1):r=a-1}return Dt(i,0,e.l-1)},Pt=(e,t,n)=>{let r=t-e.l;return e.i=n?-1:H(t-1,e.i),e.l=t,r>0?(W(e.u,r),W(e.t,r,n),e.o*r):(e.u.splice(r),(n?e.t.splice(0,-r):e.t.splice(r)).reduce((t,n)=>t-(n===-1?e.o:n),0))},Ft=typeof window<`u`,It=e=>e.documentElement,Lt=e=>e.ownerDocument,Rt=e=>e.defaultView,zt=jt(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>0),Bt=jt(()=>`scrollBehavior`in It(document).style),Vt=e=>U(e.h(),e.p()),Ht=(e,t=40,n=0,r,i=!1)=>{let a=!!n,o=1,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=V,g=[0,a?U(n-1,0):-1],_=0,v=!1,y=((e,t,n)=>({o:t,t:n?W(n.slice(0,H(e,n.length)),U(0,e-n.length)):W([],e),l:e,i:-1,u:W([],e+1)}))(e,r?r[1]:t,r&&r[0]),b=new Set,x=()=>l-c,S=()=>x()+d+u,C=(e,t)=>((e,t,n,r)=>{if(r=H(r,e.l-1),G(e,r)<=t){let i=K(e,n,r);return[K(e,t,r,i),i]}{let i=K(e,t,void 0,r);return[i,K(e,n,i)]}})(y,e,t,g[0]),w=()=>G(y,y.l),T=(e,t)=>{let n=G(y,e)-d;return t?w()-n-E(e):n},E=e=>Mt(y,e),D=(e,t=-1)=>y.t[e]===t,O=e=>{e&&(zt()&&p!==0||h&&m===1?d+=e:u+=e)};return{v:()=>{b.clear()},m:()=>o,_:()=>(e=>[e.t.slice(),e.o])(y),S:(e=200)=>{if(!v||a)return g;let t,n;if(f)[t,n]=g;else{let r=U(0,S()),a=r+s;i||(e=U(0,e),p!==1&&(r-=e),p!==2&&(a+=e)),[t,n]=g=C(U(0,r),U(0,a)),h&&(t=H(t,h[0]),n=U(n,h[1]))}return[U(t,0),H(n,y.l-1)]},$:e=>K(y,e-c),I:D,k:T,R:E,T:()=>y.l,C:()=>l,M:()=>p!==0,p:()=>s,O:()=>c,h:w,H:()=>(f=u,u=0,[f,m===2]),W:(e,t)=>{let n=[e,t];return b.add(n),()=>{b.delete(n)}},B:(e,t)=>{let n,r,g=0;switch(e){case 1:{if(t===l&&m===0)break;let e=f;f=0;let n=t-l,i=Tt(n);e&&i<Tt(e)+1||m!==0||(p=n<0?2:1),a&&=!1,l=t,g=4;let o=x();o>=-s&&o<=w()&&(g+=1,r=i>s);break}case 2:g=8,p!==0&&(n=!0,g+=1),p=0,m=0,h=V;break;case 3:{let e=t.filter(([e,t])=>!D(e,t));if(!e.length)break;O(e.reduce((e,[t,n])=>{let r;if(m===2)r=!0;else if(h&&m===1)r=t<h[0];else{let e=x(),n=T(t),i=E(t);r=p!==1&&m===0?n+i<=e:n<e&&n+i<e+s}return r&&(e+=n-E(t)),e},0));for(let[t,n]of e){let e=E(t),r=Nt(y,t,n);i&&(_+=r?n:n-e)}i&&s&&_>s&&(O(((e,t)=>{let n=0,r=[];e.t.forEach((e,i)=>{e!==-1&&(r.push(e),i<t&&n++)}),e.i=-1;let i=Ot(r),a=i.length,o=a/2|0,s=a%2==0?(i[o-1]+i[o])/2:i[o],c=e.o;return((e.o=s)-c)*U(t-n,0)})(y,K(y,S()))),i=!1),g=3,r=!0;break}case 4:s!==t&&(s||(v=r=!0),s=t,g=3);break;case 5:t[1]?(O(Pt(y,t[0],!0)),m=2,g=1):(Pt(y,t[0]),g=1);break;case 6:c=t;break;case 7:m=1;break;case 8:h=C(t,t+s),g=1}g&&(o=1+(2147483647&o),n&&d&&(u+=d,d=0),b.forEach(([e,t])=>{g&e&&t(r)}))}}},Ut=setTimeout,Wt=(e,t)=>t?-e:e,Gt=(e,t,n,r,i,a)=>{let o=Date.now,s=0,c=!1,l=!1,u=!1,d=!1,f=(()=>{let t,n=()=>{t!=V&&clearTimeout(t)},r=()=>{n(),t=Ut(()=>{t=V,(()=>{if(c||l)return c=!1,void f();u=!1,e.B(2)})()},150)};return r.J=n,r})(),p=()=>{s=o(),u&&(d=!0),a&&e.B(6,a()),e.B(1,r()),f()},m=t=>{if(c||!e.M()||t.ctrlKey)return;let r=o()-s;150>r&&50<r&&(n?t.deltaX:t.deltaY)&&(c=!0)},h=()=>{l=!0,u=d=!1},g=()=>{l=!1,zt()&&(u=!0)};return t.addEventListener(`scroll`,p),t.addEventListener(`wheel`,m,{passive:!0}),t.addEventListener(`touchstart`,h,{passive:!0}),t.addEventListener(`touchend`,g,{passive:!0}),{A:()=>{t.removeEventListener(`scroll`,p),t.removeEventListener(`wheel`,m),t.removeEventListener(`touchstart`,h),t.removeEventListener(`touchend`,g),f.J()},L:()=>{let[t,n]=e.H();t&&(i(t,n,d),d=!1,n&&e.p()>e.h()&&e.B(1,r()))}}},Kt=(e,t,n)=>{let r;return[async(i,a)=>{if(!await t())return;r&&r();let o=()=>{let[t,n]=At();return r=()=>{n(!1)},e.p()&&Ut(r,150),[t,e.W(2,()=>{n(!0)})]};if(a&&Bt())e.B(8,i()),kt(async()=>{for(;;){let t=!0;for(let[n,r]=e.S();n<=r;n++)if(e.I(n)){t=!1;break}if(t)break;let[n,r]=o();try{if(!await n)return}finally{r()}}e.B(7),n(i(),a)});else for(;;){let[t,r]=o();try{if(e.B(7),n(i()),!await t)return}finally{r()}}},()=>{r&&r()}]},qt=(e,t)=>{let n,r,i=At(),a=!1,o=t?`scrollLeft`:`scrollTop`,s=t?`overflowX`:`overflowY`,[c,l]=Kt(e,()=>i[0],(e,r)=>{e=Wt(e,a),r?n.scrollTo({[t?`left`:`top`]:e,behavior:`smooth`}):n[o]=e});return{N(c,u){n=u,t&&(a=getComputedStyle(u).direction===`rtl`),r=Gt(e,u,t,()=>Wt(u[o],a),(t,n,r)=>{if(r){let e=u.style,t=e[s];e[s]=`hidden`,Ut(()=>{e[s]=t})}u[o]=Wt(e.C()+t,a),n&&l()}),i[1](!0)},v(){r&&r.A(),i[1](!1),i=At()},P:()=>a,V(e){c(()=>e)},X(t){t+=e.C(),c(()=>t)},Y(t,{align:n,smooth:r,offset:i=0}={}){if(t=Dt(t,0,e.T()-1),n===`nearest`){let r=e.k(t),i=e.C();if(r<i)n=`start`;else{if(!(r+e.R(t)>i+e.p()))return;n=`end`}}c(()=>i+e.O()+e.k(t)+(n===`end`?e.R(t)-e.p():n===`center`?(e.R(t)-e.p())/2:0),r)},q:()=>{r&&r.L()}}},Jt=e=>{let t;return{j(n){(t||=new(Rt(Lt(n))).ResizeObserver(e)).observe(n)},D(e){t.unobserve(e)},A(){t&&t.disconnect()}}},Yt=(e,t)=>{let n,r=t?`width`:`height`,i=new WeakMap,a=Jt(t=>{let a=[];for(let{target:o,contentRect:s}of t)if(o.offsetParent)if(o===n)e.B(4,s[r]);else{let e=i.get(o);e!=V&&a.push([e,s[r]])}a.length&&e.B(3,a)});return{G(e){a.j(n=e)},U:(e,t)=>(i.set(e,t),a.j(e),()=>{i.delete(e),a.D(e)}),v:a.A}},q=Ft?P.useLayoutEffect:P.useEffect,J=`current`,Xt=(e,t)=>{if(Array.isArray(e))for(let n of e)Xt(n,t);else e==null||typeof e==`boolean`||t.push(e)},Zt=(e,t)=>e.key??`_`+t,Qt=e=>{let t=(0,P.useRef)(null);return t[J]||(t[J]=e())},$t=e=>{let t=(0,P.useRef)(e);return q(()=>{t[J]=e},[e]),t},en=(0,P.memo)(({Z:e,ee:t,te:n,oe:r,ne:i,re:a,se:o,ie:s})=>{let c=(0,P.useRef)(null);q(()=>t(c[J],n),[n]);let l=(0,P.useMemo)(()=>{let e={contain:`layout style`,position:i&&s?void 0:`absolute`,[o?`height`:`width`]:`100%`,[o?`top`:`left`]:0,[o?`left`:`top`]:r,visibility:!i||s?void 0:`hidden`};return o&&(e.display=`inline-flex`),e},[r,i,s,o]);return(0,F.jsx)(a,typeof a==`string`?{ref:c,style:l,children:e}:{ref:c,style:l,index:n,children:e})}),tn=(e,t)=>(0,P.useMemo)(()=>{if(typeof e==`function`)return[n=>e(t[n],n),t.length];let n=(e=>{let t=[];return Xt(e,t),t})(e);return[e=>n[e],n.length]},[e,t]),nn=(0,P.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:a,keepMounted:o,cache:s,startMargin:c=0,ssrCount:l,as:u=`div`,item:d=`div`,scrollRef:f,onScroll:p,onScrollEnd:m},h)=>{let[g,_]=tn(e,t),v=(0,P.useRef)(null),y=(0,P.useRef)(!!l),b=$t(p),x=$t(m),[S,C,w,T]=Qt(()=>{let e=!!a,t=Ht(_,r,l,s,!r);return[t,Yt(t,e),qt(t,e),e]});_!==S.T()&&S.B(5,[_,i]),c!==S.O()&&S.B(6,c);let[E,D]=(0,P.useReducer)(S.m,void 0,S.m),O=S.M(),ee=S.h(),te=w.P(),k=[],ne=e=>{let t=g(e);return(0,F.jsx)(en,{ee:C.U,te:e,oe:S.k(e,te),ne:S.I(e),re:d,Z:t,se:T,ie:y[J]},Zt(t,e))};if(q(()=>{y[J]=!1,S.W(1,e=>{e?(0,Ne.flushSync)(D):D()}),S.W(4,()=>{b[J]&&b[J](S.C())}),S.W(8,()=>{x[J]&&x[J]()});let e=v[J],t=t=>{C.G(t),w.N(e,t)};return f?kt(()=>{f[J]&&t(f[J])}):t(e.parentElement),()=>{S.v(),C.v(),w.v()}},[]),q(()=>{w.q()},[E]),(0,P.useImperativeHandle)(h,()=>({get cache(){return S._()},get scrollOffset(){return S.C()},get scrollSize(){return Vt(S)},get viewportSize(){return S.p()},findItemIndex:S.$,getItemOffset:S.k,getItemSize:S.R,scrollToIndex:w.Y,scrollTo:w.V,scrollBy:w.X}),[]),o){let e=new Set(o);for(let[t,r]=S.S(n);t<=r;t++)e.add(t);Ot([...e]).forEach(e=>{k.push(ne(e))})}else for(let[e,t]=S.S(n);e<=t;e++)k.push(ne(e));return(0,F.jsx)(u,{ref:v,style:{contain:`size style`,overflowAnchor:`none`,flex:`none`,position:`relative`,width:T?ee:`100%`,height:T?`100%`:ee,pointerEvents:O?`none`:void 0},children:k})});function rn(e){let t=(0,P.useRef)(null),[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(!0),s=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useRef)(null),u=(0,P.useCallback)(e=>{r(e),e&&(t.current=e.closest(`[data-slot="main"]`))},[]),d=(0,P.useCallback)(e=>{let n=t.current;if(!n)return;let r=l.current;r?r.scrollTo(e):n.scrollTop=e},[]),f=(0,P.useCallback)(()=>{let e=t.current;e&&d(e.scrollHeight-e.clientHeight)},[d]),p=(0,P.useCallback)(()=>{o.current&&f()},[f]),m=(0,P.useCallback)(()=>{let e=t.current;e&&(s.current=null,o.current=!0,e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:`smooth`}))},[]);return(0,P.useEffect)(()=>{let r=t.current,i=n;if(!r||!i)return;if(c.current!==e){c.current=e;let t=Je(e);t&&!t.atBottom?(o.current=!1,s.current=t.top,r.scrollTop=t.top):(o.current=!0,f())}let l=0,u=null,p=()=>{s.current=null,o.current=!1,l=0},m=()=>{l=Date.now()},h=e=>{e.deltaY<0?p():m()},g=e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)?p():[`ArrowDown`,`PageDown`,`End`].includes(e.key)&&m()},_=()=>{R(r,80)||(p(),m())},v=e=>{u=e.touches[0]?.clientY??null},y=e=>{let t=e.touches[0]?.clientY;t!==void 0&&(u!==null&&t>u+1?p():u!==null&&t<u-1&&m(),u=t)},b=()=>{let t=R(r,80);t&&s.current===null&&(o.current||Date.now()-l<2e3)&&(o.current=!0),a(!t),s.current===null&&qe(e,{top:r.scrollTop,atBottom:t})};r.addEventListener(`scroll`,b,{passive:!0}),r.addEventListener(`wheel`,h,{passive:!0}),r.addEventListener(`touchstart`,v,{passive:!0}),r.addEventListener(`touchmove`,y,{passive:!0}),r.addEventListener(`pointerdown`,_,{passive:!0}),r.addEventListener(`keydown`,g);let x;return typeof ResizeObserver<`u`&&(x=new ResizeObserver(()=>{let e=s.current;if(e!==null){let t=r.scrollHeight-r.clientHeight;d(Math.min(e,t)),t>=e&&(s.current=null)}else o.current&&f()}),x.observe(i)),()=>{r.removeEventListener(`scroll`,b),r.removeEventListener(`wheel`,h),r.removeEventListener(`touchstart`,v),r.removeEventListener(`touchmove`,y),r.removeEventListener(`pointerdown`,_),r.removeEventListener(`keydown`,g),x?.disconnect()}},[e,n,d,f]),{attachContent:u,scrollElRef:t,virtualizerRef:l,pillVisible:i,jumpToLatest:m,restickIfStuck:p}}function an({runId:e,rows:t,mode:n,controls:r}){return n===`virtual`?(0,F.jsx)(on,{runId:e,rows:t,controls:r}):(0,F.jsx)(`div`,{ref:r.attachContent,"data-slot":`thread-rows`,"data-virtualized":`false`,children:t.map(e=>(0,F.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-3.5 [contain-intrinsic-block-size:auto_3rem] [content-visibility:auto]`,children:e.node},e.key))})}function on({runId:e,rows:t,controls:n}){let r=(0,P.useRef)(null),[i]=(0,P.useState)(()=>Ze(e,t.length)),a=(0,P.useRef)(t.length);a.current=t.length;let o=(0,P.useRef)(null),s=(0,P.useCallback)(t=>{n.virtualizerRef.current=t,t?o.current=t:o.current&&=(Xe(e,{rows:a.current,cache:o.current.cache}),null)},[e,n.virtualizerRef]),[c,l]=(0,P.useState)(0);return(0,P.useLayoutEffect)(()=>{let e=()=>{let e=r.current,t=n.scrollElRef.current;!e||!t||l(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n.scrollElRef]),(0,F.jsx)(`div`,{ref:e=>{r.current=e,n.attachContent(e)},"data-slot":`thread-rows`,"data-virtualized":`true`,children:(0,F.jsx)(nn,{ref:s,scrollRef:n.scrollElRef,startMargin:c,...i===void 0?{}:{cache:i},children:t.map(e=>(0,F.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-3.5`,children:e.node},e.key))})})}function sn({onJump:e}){return(0,F.jsxs)(`button`,{type:`button`,"data-slot":`jump-to-latest`,onClick:e,className:`pointer-events-auto inline-flex min-h-8 items-center gap-1.5 rounded-full border border-border bg-background px-3.5 text-xs font-medium text-muted-foreground shadow-modal hover:text-foreground`,children:[(0,F.jsx)(ge,{"aria-hidden":!0,className:`size-3.5`}),`Jump to latest`]})}var cn=120;function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function X(e){let t=e.replace(/\s+/g,` `).trim();return t.length>cn?`${t.slice(0,cn-1)}…`:t}function Z(e,...t){if(Y(e))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim()!==``)return X(t)}}function ln(e){if(!Y(e))return;let t=e.command;if(typeof t==`string`&&t.trim()!==``)return X(t);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return X(e.join(` `))}}function un(e){if(!Y(e)||!Array.isArray(e.changes))return[];let t=[];for(let n of e.changes)Y(n)&&typeof n.path==`string`&&n.path.trim()!==``&&t.push(n.path);return t}function dn(e){return Z(e,`description`,`query`,`url`,`filePath`,`file_path`,`path`,`pattern`,`name`)}function Q(e,t){return t?`${e} ${t}`:e}function fn(e,t){let n=typeof e==`string`?e.toLowerCase():``;switch(n){case`bash`:case`commandexecution`:return{toolKind:`execute`,title:Q(`Ran`,ln(t)),subtitle:Z(t,`description`)};case`edit`:case`multiedit`:return{toolKind:`edit`,title:Q(`Edit`,Z(t,`file_path`,`filePath`,`path`))};case`write`:return{toolKind:`edit`,title:Q(`Write`,Z(t,`file_path`,`filePath`,`path`))};case`notebookedit`:return{toolKind:`edit`,title:Q(`Edit`,Z(t,`notebook_path`,`notebookPath`,`file_path`,`filePath`,`path`))};case`filechange`:{let e=un(t);return{toolKind:`edit`,title:Q(`Edit`,e.length===1?e[0]:e.length>1?`${e.length} files`:void 0)}}case`read`:return{toolKind:`read`,title:Q(`Read`,Z(t,`file_path`,`filePath`,`path`))};case`glob`:case`grep`:return{toolKind:`search`,title:Q(`Search`,Z(t,`pattern`,`query`)),subtitle:Z(t,`path`)};case`webfetch`:return{toolKind:`fetch`,title:Q(`Fetch`,Z(t,`url`))};case`websearch`:return{toolKind:`fetch`,title:Q(`Web search`,Z(t,`query`))};case`task`:{let e=Z(t,`description`,`prompt`);return{toolKind:`task`,title:e?`Task: ${e}`:`Task`,subtitle:Z(t,`subagent_type`,`subagentType`)}}case`todowrite`:case`todolist`:case`plan`:return{toolKind:`plan`,title:`Update plan`};case`mcptoolcall`:{let e=Z(t,`server`),n=Z(t,`tool`);return e&&n?{toolKind:`other`,title:`${e}.${n}`}:{toolKind:`other`,title:`MCP tool`,subtitle:dn(t)}}}if(n.startsWith(`mcp__`)){let t=e.split(`__`).filter(e=>e!==``);if(t.length>=3)return{toolKind:`other`,title:`${t[1]}.${t.slice(2).join(`__`)}`}}return{toolKind:`other`,title:typeof e==`string`&&e.trim()!==``?X(e):`Tool`,subtitle:dn(t)}}function pn(e){for(let t=e.turns.length-1;t>=0;--t){let n=e.turns[t].planEntries;if(n!==void 0)return n}}function mn(e){let t=[];for(let n of e.turns)for(let e of n.items)if(e.kind===`tool`){for(let n of e.locations??[])t.push(n.path);for(let n of e.diffs??[])t.push(n.path)}let n=[];for(let e=t.length-1;e>=0;--e)n.includes(t[e])||n.push(t[e]);return n}function hn(e,t){switch(e){case`waiting`:return{state:`waiting`};case`failed`:return{state:`closed`,tone:`danger`,label:t?`Session failed — ${t}`:`Session failed`};case`review`:return{state:`closed`,tone:`dim`,label:`Session closed — waiting for your review`};case`done`:case`cancelled`:return{state:`closed`,tone:`dim`,label:`Session closed`};default:return null}}function gn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $(e){return typeof e==`string`?e:void 0}function _n(e){return e.replace(/\s*CEZ:DONE\s*$/,``)}function vn(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}var yn=e=>e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`,bn=new Set([`pending`,`in_progress`,`completed`]);function xn(e){if(!gn(e)||!Array.isArray(e.todos))return;let t=[];for(let n of e.todos){if(!gn(n)||typeof n.content!=`string`)return;t.push({content:n.content,status:bn.has(n.status)?n.status:`pending`,...typeof n.activeForm==`string`?{activeForm:n.activeForm}:{}})}return t}function Sn(e){let t=[],n=new Map,r,i=0,a=()=>{i+=1;let e={id:`turn-${i}`,entries:[],v2Items:!1};return t.push(e),e},o=()=>t.at(-1)??a(),s=(e,t)=>{let r={...t};if(!e.v2Items){e.v2Items=!0;for(let t of e.entries)t.origin===`v1`&&yn(t.entry)&&n.delete(t.entry.id);e.entries=e.entries.filter(e=>!(e.origin===`v1`&&yn(e.entry)))}let i=n.get(r.id);if(i&&i.turn===e){i.entry.entry=r,n.set(r.id,i);return}let a={origin:`v2`,entry:r};e.entries.push(a),n.set(r.id,{turn:e,entry:a})};for(let i of e)switch(i.type){case`user-message`:{let e=a();e.userMessage={text:$(i.text)??``,imageCount:typeof i.imageCount==`number`?i.imageCount:0,images:Array.isArray(i.images)?i.images.filter(e=>typeof e==`string`):[]};break}case`turn.started`:{let e=$(i.turnId),n=t.at(-1);n&&n.turnId===void 0&&!n.v2Items?n.turnId=e:a().turnId=e;break}case`turn.completed`:{let e=$(i.turnId),n;for(let r=t.length-1;r>=0&&!n;--r)t[r].turnId===e&&(n=t[r]);let r=n??t.at(-1);r&&(r.completed={stopReason:$(i.stopReason)??`end_turn`,...typeof i.costUsd==`number`?{costUsd:i.costUsd}:{}});break}case`item.started`:case`item.updated`:case`item.completed`:{if(!gn(i.item))break;let e=i.item.kind,t=i.item.id;if(e!==`message`&&e!==`reasoning`&&e!==`tool`||typeof t!=`string`||t===``)break;let r=i.item;s(n.get(r.id)?.turn??o(),r);break}case`item.delta`:{let e=n.get($(i.itemId)??``),t=$(i.delta)??``;if(!e||t===``||!yn(e.entry.entry))break;let r=e.entry.entry;i.field===`output`&&r.kind===`tool`?r.output=(r.output??``)+t:i.field!==`output`&&r.kind!==`tool`&&(r.text+=t);break}case`text`:{let e=o();if(e.v2Items)break;let t=$(i.text)??``;if(t===``)break;e.entries.push({origin:`v1`,entry:{kind:`message`,id:`v1:${i.seq}`,role:`assistant`,text:t}});break}case`tool-call`:{let e=o();if(e.v2Items)break;let t=$(i.tool)??`Tool`,r=fn(t,i.input);if(r.toolKind===`plan`){let t=xn(i.input);t!==void 0&&(e.planEntries=t)}let a={kind:`tool`,id:$(i.id)??`v1:${i.seq}`,name:t,toolKind:r.toolKind,title:r.title,status:`running`,input:i.input},s={origin:`v1`,entry:a};e.entries.push(s),n.set(a.id,{turn:e,entry:s});break}case`tool-result`:{let e=n.get($(i.toolCallId)??``);if(!e||e.turn.v2Items||e.entry.origin!==`v1`)break;let t=e.entry.entry;if(t.kind!==`tool`)break;t.status=`completed`,t.output=vn(i.result);break}case`note`:case`lifecycle`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:e,tone:`dim`}});break}case`error`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:e,tone:`danger`}});break}case`session.error`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v2:${i.seq}`,text:e,tone:`danger`}});break}case`step-end`:{if(i.status!==`failed`)break;let e=$(i.error)?` — ${$(i.error)}`:``;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:`step ${$(i.stepId)??`?`} failed${e}`,tone:`danger`}});break}case`check-output`:{let e=$(i.command)??`check`,t=typeof i.exitCode==`number`?i.exitCode:-1,n={kind:`tool`,id:`v1:${i.seq}`,name:`check`,toolKind:`execute`,title:`Ran ${e}`,status:t===0?`completed`:`failed`,output:$(i.text)??``,exitCode:t};o().entries.push({origin:`meta`,entry:n});break}case`image`:{let e=$(i.url);if(e===void 0)break;let t={kind:`image`,id:`v1:${i.seq}`,url:e},n=$(i.name);n!==void 0&&(t.name=n),o().entries.push({origin:`meta`,entry:t});break}case`plan.updated`:Array.isArray(i.entries)&&(o().planEntries=i.entries);break;case`session.ended`:r={reason:$(i.reason)??`end_turn`,...$(i.message)===void 0?{}:{message:$(i.message)}};break;case`step-start`:case`token-usage`:case`cost`:case`turn-end`:case`done`:case`session`:break;default:break}return{turns:t.map(e=>({id:e.id,...e.turnId===void 0?{}:{turnId:e.turnId},...e.userMessage===void 0?{}:{userMessage:e.userMessage},...e.planEntries===void 0?{}:{planEntries:e.planEntries},...e.completed===void 0?{}:{completed:e.completed},items:e.entries.map(({entry:e})=>e.kind===`message`&&e.role===`assistant`?{...e,text:_n(e.text)}:e)})),...r===void 0?{}:{sessionEnded:r}}}function Cn(){let{id:e}=o(),t=d(e),n=ke(e),r=(0,P.useMemo)(()=>Sn(n),[n]);if(t.isPending)return(0,F.jsx)(he,{});if(t.isError){let e=t.error instanceof f&&t.error.status===404;return(0,F.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,F.jsx)(v,{icon:e?(0,F.jsx)(ie,{}):(0,F.jsx)(we,{}),tone:e?`neutral`:`danger`,title:e?`Task not found`:`Could not load this task`,subtitle:e?`No run has this id. It may have been deleted, or the link is from another machine.`:t.error.message,actions:(0,F.jsx)(p,{asChild:!0,variant:`outline`,children:(0,F.jsx)(a,{to:`/`,children:`Back to tasks`})})})})}return(0,F.jsx)(Tn,{run:t.data,thread:r})}function wn(e,t){let n=[];e.task&&n.push({key:`task`,node:(0,F.jsx)(z,{text:e.task,images:e.taskImages??[]})});for(let e of t.turns){e.userMessage&&n.push({key:`${e.id}:user`,node:(0,F.jsx)(z,{text:e.userMessage.text,imageCount:e.userMessage.imageCount,images:e.userMessage.images})});for(let t of Ve(e.items))n.push({key:`${e.id}:${t.id}`,node:(0,F.jsx)(On,{block:t,scope:e.id})})}return n}function Tn({run:e,thread:t}){let n=hn(e.status,e.error),r=pn(t),i=r!==void 0&&r.length>0?mt(r):void 0,a=e.status===`running`||e.status===`waiting`,o=c(e.id),s=(0,P.useMemo)(()=>wn(e,t),[e,t]),{search:l}=u(),d=Ge(l,s.length),f=rn(e.id);return Me(f.restickIfStuck),(0,F.jsxs)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:[(0,F.jsx)(D,{run:e,planTally:i}),(0,F.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-1 flex-col gap-3.5 px-4 py-5 md:px-6`,children:[(0,F.jsx)(We,{runId:e.id,children:(0,F.jsx)(an,{runId:e.id,rows:s,mode:d,controls:f})}),t.turns.length===0?e.status===`queued`?(0,F.jsx)(Dn,{run:e}):(0,F.jsx)(`p`,{"data-slot":`thread-empty`,className:`py-6 text-center text-xs text-soft-foreground`,children:`No session events yet.`}):null,n&&n.state===`closed`?(0,F.jsxs)(`div`,{"data-slot":`thread-footer`,"data-state":n.state,className:x(`mt-auto flex items-center gap-2 border-t border-border pt-3 text-xs`,n.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[n.label,e.pullRequestUrl?(0,F.jsx)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`PR ↗`}):null]}):null,e.status===`review`?(0,F.jsx)(yt,{run:e}):null]}),(0,F.jsx)(wt,{status:e.status}),(0,F.jsxs)(`div`,{"data-slot":`thread-dock`,className:`sticky bottom-[var(--kb,0px)] z-10 bg-background px-4 pt-1.5 pb-3 max-md:border-t max-md:border-border md:px-6 md:pb-4`,children:[f.pillVisible?(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 -top-12 flex justify-center`,children:(0,F.jsx)(sn,{onJump:f.jumpToLatest})}):null,(0,F.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-col gap-2.5`,children:[r!==void 0&&r.length>0?(0,F.jsx)(gt,{runId:e.id,entries:r},e.id):null,e.status===`waiting`?(0,F.jsxs)(`div`,{"data-slot":`paused-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,F.jsx)(_e,{tone:`pending`,pulse:!0}),`The agent is paused, waiting for your reply`]}):null,(0,F.jsx)(le,{onSubmit:(e,t)=>o.mutateAsync({text:e,images:t}),disabled:!a,disabledReason:`Session closed — Continue to reopen.`,disabledAction:(0,F.jsx)(En,{run:e}),placeholder:e.status===`waiting`?`Reply — / for skills, @ for files…`:`Message the agent — / for skills, @ for files…`,autocompleteSkills:!0,quickReplies:!0,getMentionCandidates:()=>mn(t)})]})]})]})}function En({run:e}){let t=y(),n=l({mutationFn:()=>_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:i.runs.all}),onError:e=>g(e.message,{tone:`danger`})});return E(e).continueRun?(0,F.jsxs)(p,{type:`button`,variant:`outline`,size:`sm`,disabled:n.isPending,onClick:()=>n.mutate(),children:[(0,F.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Continue`]}):null}function Dn({run:e}){let t=w(s().data??[],e.id);return(0,F.jsxs)(`div`,{"data-slot":`queued-state`,className:`flex flex-col items-center gap-1.5 py-10 text-center`,children:[(0,F.jsx)(_e,{tone:`pending`,pulse:!0}),(0,F.jsxs)(`p`,{className:`text-[13px] font-medium`,children:[`Waiting for a free agent slot`,t===void 0?``:` — #${t} in queue`]}),(0,F.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[e.workflow,` · starts automatically when a slot frees up`]})]})}function On({block:e,scope:t}){switch(e.kind){case`entry`:return(0,F.jsx)(kn,{entry:e.entry,scope:t});case`tool-card`:return(0,F.jsx)(B,{item:e.item,nested:e.children,cacheKey:`${t}:${e.id}`});case`context-group`:return(0,F.jsx)(lt,{group:e,scope:t});case`streak`:return(0,F.jsx)(ut,{count:e.count,children:e.blocks.map(e=>(0,F.jsx)(On,{block:e,scope:t},e.id))})}}function kn({entry:e,scope:t}){switch(e.kind){case`message`:return e.role===`assistant`?(0,F.jsx)(Qe,{text:e.text}):(0,F.jsx)(z,{text:e.text});case`reasoning`:return(0,F.jsx)(et,{text:e.text});case`tool`:return(0,F.jsx)(B,{item:e,cacheKey:`${t}:${e.id}`});case`note`:return(0,F.jsx)($e,{note:e});case`image`:return(0,F.jsx)(dt,{image:e})}}export{Cn as TaskThreadRoute};
|
|
5
|
+
`)}function ot({text:e}){return(0,F.jsx)(`span`,{className:x(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del text-muted-foreground`,e.startsWith(`@@`)&&`text-soft-foreground`),children:e})}function st(e){return e.status===`failed`||e.toolKind===`execute`&&e.status===`running`&&e.output!==void 0}function B({item:e,nested:t=[],cacheKey:n}){let r=Ue(),[i,a]=(0,P.useState)(()=>n===void 0?null:r?.get(n)??null),o=e=>{n!==void 0&&r?.set(n,e),a(e)},s=e.status===`running`||e.status===`pending`,c=e.output!==void 0&&e.output!==``||e.error!==void 0&&e.error!==``||e.diffs!==void 0&&e.diffs.length>0||t.length>0,l=c&&(i??st(e)),{verb:u,detail:d}=Be(e.title),f=tt[e.toolKind]??Ee;return(0,F.jsxs)(j,{"data-slot":`tool-card`,"data-status":e.status,"data-kind":e.toolKind,open:l,onOpenChange:o,className:x(`min-w-0 overflow-hidden rounded-lg border bg-card`,e.status===`failed`?`border-danger/40`:`border-border`),children:[(0,F.jsxs)(A,{disabled:!c,className:`group flex min-h-[42px] w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] enabled:hover:bg-muted`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:x(`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`,!c&&`invisible`)}),(0,F.jsx)(f,{"aria-hidden":!0,className:x(`size-4 shrink-0`,e.status===`failed`?`text-danger`:`text-muted-foreground`)}),(0,F.jsx)(`span`,{className:x(`shrink-0 font-semibold`,s&&`shimmer`,e.status===`failed`&&`text-danger`,e.status===`declined`&&`text-muted-foreground`),children:u}),d===void 0?null:(0,F.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:d}),(0,F.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[s?(0,F.jsx)(ee,{role:`status`,"aria-label":`Running`,className:`size-3.5 animate-spin text-soft-foreground`}):null,e.status===`failed`?(0,F.jsx)(`span`,{className:`text-xs text-danger`,children:`failed`}):null,e.status===`declined`?(0,F.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`declined`}):null,e.toolKind===`execute`&&typeof e.exitCode==`number`?(0,F.jsx)(`span`,{"data-slot":`tool-exit`,className:x(`rounded-full px-2 py-px font-mono text-[10.5px] font-semibold`,e.exitCode===0?`bg-success/10 text-success`:`bg-danger/10 text-danger`),children:e.exitCode}):null]})]}),(0,F.jsx)(M,{children:(0,F.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[e.error!==void 0&&e.error!==``?(0,F.jsx)(`div`,{"data-slot":`tool-error`,className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre-wrap text-danger`,children:e.error}):null,e.diffs!==void 0&&e.diffs.length>0?(0,F.jsx)(it,{diffs:e.diffs}):null,e.output!==void 0&&e.output!==``?(0,F.jsx)(rt,{text:e.output,streaming:s}):null,t.length>0?(0,F.jsx)(`div`,{"data-slot":`tool-nested`,className:`flex flex-col gap-2 border-l-2 border-border py-2.5 pr-3 pl-3 ml-4 my-2`,children:t.map(e=>(0,F.jsx)(ct,{entry:e,scope:n},e.id))}):null]})})]})}function ct({entry:e,scope:t}){switch(e.kind){case`message`:return(0,F.jsx)(Qe,{text:e.text});case`reasoning`:return(0,F.jsx)(et,{text:e.text});case`tool`:return(0,F.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`});case`note`:return(0,F.jsx)($e,{note:e});case`image`:return(0,F.jsx)(dt,{image:e})}}function lt({group:e,scope:t}){return(0,F.jsxs)(j,{"data-slot":`ctx-group`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex h-[34px] w-full items-center gap-2 rounded-md px-2 -mx-2 text-left text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),e.label]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 pt-1.5 pl-4`,children:e.tools.map(e=>(0,F.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`},e.id))})})]})}function ut({count:e,children:t}){return(0,F.jsxs)(j,{"data-slot":`tool-streak`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex items-center gap-1.5 rounded-md p-0.5 text-left text-xs text-soft-foreground hover:text-muted-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),Re(e)]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:t})})]})}function dt({image:e}){return(0,F.jsx)(Pe,{"data-slot":`thread-image`,src:e.url,alt:e.name??`image from the agent session`,className:`max-h-72 max-w-full self-start rounded-lg border border-border`})}var ft=new Map;function pt(){return typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches}function mt(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.length}}function ht(e){return e.find(e=>e.status===`in_progress`)??e.find(e=>e.status===`pending`)}function gt({runId:e,entries:t}){let[n,r]=(0,P.useState)(()=>ft.get(e)??pt());if(t.length===0)return null;let{done:i,total:a}=mt(t),o=ht(t);return(0,F.jsxs)(`section`,{"data-slot":`plan-dock`,"data-state":n?`open`:`collapsed`,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs`,children:[(0,F.jsx)(`div`,{"aria-hidden":!0,"data-slot":`grad-edge`,className:`h-[3px]`,style:{background:`var(--grad)`}}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(t=>(ft.set(e,!t),!t)),"aria-expanded":n,className:x(`flex w-full items-center gap-2 px-3.5 text-left text-[13px]`,n?`pt-2 pb-1.5`:`py-2`),children:[(0,F.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Plan`}),(0,F.jsxs)(`span`,{"data-slot":`plan-count`,className:`shrink-0 text-muted-foreground tabular-nums`,children:[`· `,i,`/`,a]}),!n&&o!==void 0?(0,F.jsxs)(`span`,{"data-slot":`plan-current`,className:`min-w-0 truncate text-muted-foreground`,children:[`— `,o.activeForm??o.content]}):null,(0,F.jsx)(ve,{"aria-hidden":!0,className:x(`ml-auto size-3.5 shrink-0 text-soft-foreground transition-transform`,!n&&`rotate-180`)})]}),n?(0,F.jsx)(`ul`,{"data-slot":`plan-list`,className:`flex flex-col gap-[7px] px-3.5 pb-3`,children:t.map((e,t)=>(0,F.jsx)(_t,{entry:e},`${t}:${e.content}`))}):null]})}function _t({entry:e}){return(0,F.jsxs)(`li`,{"data-slot":`plan-item`,"data-status":e.status,className:x(`flex min-h-5 min-w-0 items-center gap-2.5 text-[13px]`,e.status===`completed`&&`text-soft-foreground line-through`,e.status===`in_progress`&&`font-medium`,e.status===`pending`&&`text-muted-foreground`),children:[(0,F.jsx)(vt,{status:e.status}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e.content}),e.status===`in_progress`?(0,F.jsx)(`span`,{"data-slot":`plan-tag`,className:`ml-auto shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10.5px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:`in progress`}):null]})}function vt({status:e}){return e===`completed`?(0,F.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,F.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`in_progress`?(0,F.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,F.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,F.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]}):(0,F.jsx)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})})}function yt({run:e}){return(0,F.jsxs)(`section`,{"data-slot":`review-panel`,"aria-label":`Review the changes`,className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{"data-slot":`review-banner`,className:`flex items-center gap-2.5 rounded-md border border-violet/30 bg-violet/10 px-3.5 py-2.5`,children:[(0,F.jsx)(me,{className:`size-4 shrink-0 text-violet`,"aria-hidden":`true`}),(0,F.jsxs)(`p`,{className:`min-w-0 text-[13px]`,children:[(0,F.jsx)(`span`,{className:`font-semibold`,children:`Review the changes before anything lands.`}),` `,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Read the diff, send notes back, draft a PR — or accept. Nothing merges on its own.`})]})]}),(0,F.jsx)(oe,{runId:e.id}),(0,F.jsx)(bt,{run:e})]})}function bt({run:e}){let t=y(),n=(0,P.useRef)(null),[r,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),c=C(e.id),u=()=>t.invalidateQueries({queryKey:i.runs.all}),d=l({mutationFn:t=>_(e.id,`Review feedback:\n${t}`),onSuccess:()=>{a(``),u()},onError:e=>h(e.message,{tone:`danger`})}),g=l({mutationFn:()=>m(e.id),onSuccess:e=>{h(`Draft PR created — ${e.url}`),u()},onError:e=>{e instanceof f&&e.manual!==void 0&&s(e.manual),h(e.message,{tone:`danger`})}}),v=()=>{let e=r.trim();if(e.length===0){h(`Write what to change first.`),n.current?.focus();return}d.mutate(e)};return(0,F.jsxs)(`div`,{"data-slot":`review-actions`,className:`flex flex-col gap-2`,children:[(0,F.jsx)(de,{ref:n,"data-slot":`review-notes`,"aria-label":`Notes for the agent`,placeholder:`Notes for the agent — what should change?`,rows:2,value:r,onChange:e=>a(e.target.value),onKeyDown:e=>{ce({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(),v())},className:`min-h-[52px] text-[13px]`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(p,{"data-slot":`review-send-back`,variant:`outline`,size:`sm`,title:`Send the notes back into the agent's session`,disabled:d.isPending,onClick:v,children:[(0,F.jsx)(be,{"aria-hidden":`true`}),`Send back`]}),e.pullRequestUrl===void 0?(0,F.jsxs)(p,{"data-slot":`review-draft-pr`,variant:`outline`,size:`sm`,title:`Push the branch and open a draft PR`,disabled:g.isPending,onClick:()=>g.mutate(),children:[(0,F.jsx)(re,{"aria-hidden":`true`}),`Draft PR`]}):(0,F.jsx)(p,{asChild:!0,variant:`outline`,size:`sm`,children:(0,F.jsxs)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,title:`The PR for this task is already open`,children:[(0,F.jsx)(ne,{"aria-hidden":`true`}),`PR ↗`]})}),(0,F.jsxs)(p,{"data-slot":`review-accept`,variant:`contrast`,size:`sm`,className:`ml-auto`,title:T(`review`),disabled:c.isPending,onClick:()=>c.mutate(),children:[(0,F.jsx)(O,{"aria-hidden":`true`}),`Accept`]})]}),o===null?null:(0,F.jsx)(xt,{command:o})]})}function xt({command:e}){return(0,F.jsxs)(`button`,{type:`button`,"data-slot":`review-manual`,title:`Copy the command`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>h(`Command copied to clipboard.`)).catch(()=>h(`Run manually: ${e}`))},className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left font-mono text-[11px] text-soft-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(te,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,F.jsxs)(`span`,{className:`truncate`,children:[`manual path: `,e]})]})}function St(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Ct=1500;function wt({status:e}){let t=(0,P.useRef)(e),[n,r]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{let n=t.current;if(t.current=e,n!==`review`||e!==`done`||St())return;r(!0);let i=setTimeout(()=>r(!1),Ct);return()=>clearTimeout(i)},[e]),n?(0,F.jsxs)(`div`,{"data-slot":`accept-celebration`,"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 isolate z-40`,children:[(0,F.jsx)(g,{}),(0,F.jsx)(`div`,{className:`flex justify-center pt-24`,children:(0,F.jsx)(`span`,{className:`rounded-full border border-violet/30 bg-violet/15 px-4 py-1.5 text-[13px] font-medium text-violet shadow-modal`,children:`✓ Changes accepted`})})]}):null}var V=null,{min:H,max:U,abs:Tt,floor:Et}=Math,Dt=(e,t,n)=>H(n,U(t,e)),Ot=e=>[...e].sort((e,t)=>e-t),kt=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)},At=()=>{let e;return[new Promise(t=>{e=t}),e]},jt=e=>{let t;return()=>(e&&=(t=e(),void 0),t)},W=(e,t,n)=>{let r=n?`unshift`:`push`;for(let n=0;n<t;n++)e[r](-1);return e},Mt=(e,t)=>{let n=e.t[t];return n===-1?e.o:n},Nt=(e,t,n)=>{let r=e.t[t]===-1;return e.t[t]=n,e.i=H(t,e.i),r},G=(e,t)=>{if(!e.l)return 0;if(e.i>=t)return e.u[t];e.i<0&&(e.u[0]=0,e.i=0);let n=e.i,r=e.u[n];for(;n<t;)r+=Mt(e,n),e.u[++n]=r;return e.i=t,r},K=(e,t,n=0,r=e.l-1)=>{let i=n;for(;n<=r;){let a=Et((n+r)/2);G(e,a)<=t?(i=a,n=a+1):r=a-1}return Dt(i,0,e.l-1)},Pt=(e,t,n)=>{let r=t-e.l;return e.i=n?-1:H(t-1,e.i),e.l=t,r>0?(W(e.u,r),W(e.t,r,n),e.o*r):(e.u.splice(r),(n?e.t.splice(0,-r):e.t.splice(r)).reduce((t,n)=>t-(n===-1?e.o:n),0))},Ft=typeof window<`u`,It=e=>e.documentElement,Lt=e=>e.ownerDocument,Rt=e=>e.defaultView,zt=jt(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>0),Bt=jt(()=>`scrollBehavior`in It(document).style),Vt=e=>U(e.h(),e.p()),Ht=(e,t=40,n=0,r,i=!1)=>{let a=!!n,o=1,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=V,g=[0,a?U(n-1,0):-1],_=0,v=!1,y=((e,t,n)=>({o:t,t:n?W(n.slice(0,H(e,n.length)),U(0,e-n.length)):W([],e),l:e,i:-1,u:W([],e+1)}))(e,r?r[1]:t,r&&r[0]),b=new Set,x=()=>l-c,S=()=>x()+d+u,C=(e,t)=>((e,t,n,r)=>{if(r=H(r,e.l-1),G(e,r)<=t){let i=K(e,n,r);return[K(e,t,r,i),i]}{let i=K(e,t,void 0,r);return[i,K(e,n,i)]}})(y,e,t,g[0]),w=()=>G(y,y.l),T=(e,t)=>{let n=G(y,e)-d;return t?w()-n-E(e):n},E=e=>Mt(y,e),D=(e,t=-1)=>y.t[e]===t,O=e=>{e&&(zt()&&p!==0||h&&m===1?d+=e:u+=e)};return{v:()=>{b.clear()},m:()=>o,_:()=>(e=>[e.t.slice(),e.o])(y),S:(e=200)=>{if(!v||a)return g;let t,n;if(f)[t,n]=g;else{let r=U(0,S()),a=r+s;i||(e=U(0,e),p!==1&&(r-=e),p!==2&&(a+=e)),[t,n]=g=C(U(0,r),U(0,a)),h&&(t=H(t,h[0]),n=U(n,h[1]))}return[U(t,0),H(n,y.l-1)]},$:e=>K(y,e-c),I:D,k:T,R:E,T:()=>y.l,C:()=>l,M:()=>p!==0,p:()=>s,O:()=>c,h:w,H:()=>(f=u,u=0,[f,m===2]),W:(e,t)=>{let n=[e,t];return b.add(n),()=>{b.delete(n)}},B:(e,t)=>{let n,r,g=0;switch(e){case 1:{if(t===l&&m===0)break;let e=f;f=0;let n=t-l,i=Tt(n);e&&i<Tt(e)+1||m!==0||(p=n<0?2:1),a&&=!1,l=t,g=4;let o=x();o>=-s&&o<=w()&&(g+=1,r=i>s);break}case 2:g=8,p!==0&&(n=!0,g+=1),p=0,m=0,h=V;break;case 3:{let e=t.filter(([e,t])=>!D(e,t));if(!e.length)break;O(e.reduce((e,[t,n])=>{let r;if(m===2)r=!0;else if(h&&m===1)r=t<h[0];else{let e=x(),n=T(t),i=E(t);r=p!==1&&m===0?n+i<=e:n<e&&n+i<e+s}return r&&(e+=n-E(t)),e},0));for(let[t,n]of e){let e=E(t),r=Nt(y,t,n);i&&(_+=r?n:n-e)}i&&s&&_>s&&(O(((e,t)=>{let n=0,r=[];e.t.forEach((e,i)=>{e!==-1&&(r.push(e),i<t&&n++)}),e.i=-1;let i=Ot(r),a=i.length,o=a/2|0,s=a%2==0?(i[o-1]+i[o])/2:i[o],c=e.o;return((e.o=s)-c)*U(t-n,0)})(y,K(y,S()))),i=!1),g=3,r=!0;break}case 4:s!==t&&(s||(v=r=!0),s=t,g=3);break;case 5:t[1]?(O(Pt(y,t[0],!0)),m=2,g=1):(Pt(y,t[0]),g=1);break;case 6:c=t;break;case 7:m=1;break;case 8:h=C(t,t+s),g=1}g&&(o=1+(2147483647&o),n&&d&&(u+=d,d=0),b.forEach(([e,t])=>{g&e&&t(r)}))}}},Ut=setTimeout,Wt=(e,t)=>t?-e:e,Gt=(e,t,n,r,i,a)=>{let o=Date.now,s=0,c=!1,l=!1,u=!1,d=!1,f=(()=>{let t,n=()=>{t!=V&&clearTimeout(t)},r=()=>{n(),t=Ut(()=>{t=V,(()=>{if(c||l)return c=!1,void f();u=!1,e.B(2)})()},150)};return r.J=n,r})(),p=()=>{s=o(),u&&(d=!0),a&&e.B(6,a()),e.B(1,r()),f()},m=t=>{if(c||!e.M()||t.ctrlKey)return;let r=o()-s;150>r&&50<r&&(n?t.deltaX:t.deltaY)&&(c=!0)},h=()=>{l=!0,u=d=!1},g=()=>{l=!1,zt()&&(u=!0)};return t.addEventListener(`scroll`,p),t.addEventListener(`wheel`,m,{passive:!0}),t.addEventListener(`touchstart`,h,{passive:!0}),t.addEventListener(`touchend`,g,{passive:!0}),{A:()=>{t.removeEventListener(`scroll`,p),t.removeEventListener(`wheel`,m),t.removeEventListener(`touchstart`,h),t.removeEventListener(`touchend`,g),f.J()},L:()=>{let[t,n]=e.H();t&&(i(t,n,d),d=!1,n&&e.p()>e.h()&&e.B(1,r()))}}},Kt=(e,t,n)=>{let r;return[async(i,a)=>{if(!await t())return;r&&r();let o=()=>{let[t,n]=At();return r=()=>{n(!1)},e.p()&&Ut(r,150),[t,e.W(2,()=>{n(!0)})]};if(a&&Bt())e.B(8,i()),kt(async()=>{for(;;){let t=!0;for(let[n,r]=e.S();n<=r;n++)if(e.I(n)){t=!1;break}if(t)break;let[n,r]=o();try{if(!await n)return}finally{r()}}e.B(7),n(i(),a)});else for(;;){let[t,r]=o();try{if(e.B(7),n(i()),!await t)return}finally{r()}}},()=>{r&&r()}]},qt=(e,t)=>{let n,r,i=At(),a=!1,o=t?`scrollLeft`:`scrollTop`,s=t?`overflowX`:`overflowY`,[c,l]=Kt(e,()=>i[0],(e,r)=>{e=Wt(e,a),r?n.scrollTo({[t?`left`:`top`]:e,behavior:`smooth`}):n[o]=e});return{N(c,u){n=u,t&&(a=getComputedStyle(u).direction===`rtl`),r=Gt(e,u,t,()=>Wt(u[o],a),(t,n,r)=>{if(r){let e=u.style,t=e[s];e[s]=`hidden`,Ut(()=>{e[s]=t})}u[o]=Wt(e.C()+t,a),n&&l()}),i[1](!0)},v(){r&&r.A(),i[1](!1),i=At()},P:()=>a,V(e){c(()=>e)},X(t){t+=e.C(),c(()=>t)},Y(t,{align:n,smooth:r,offset:i=0}={}){if(t=Dt(t,0,e.T()-1),n===`nearest`){let r=e.k(t),i=e.C();if(r<i)n=`start`;else{if(!(r+e.R(t)>i+e.p()))return;n=`end`}}c(()=>i+e.O()+e.k(t)+(n===`end`?e.R(t)-e.p():n===`center`?(e.R(t)-e.p())/2:0),r)},q:()=>{r&&r.L()}}},Jt=e=>{let t;return{j(n){(t||=new(Rt(Lt(n))).ResizeObserver(e)).observe(n)},D(e){t.unobserve(e)},A(){t&&t.disconnect()}}},Yt=(e,t)=>{let n,r=t?`width`:`height`,i=new WeakMap,a=Jt(t=>{let a=[];for(let{target:o,contentRect:s}of t)if(o.offsetParent)if(o===n)e.B(4,s[r]);else{let e=i.get(o);e!=V&&a.push([e,s[r]])}a.length&&e.B(3,a)});return{G(e){a.j(n=e)},U:(e,t)=>(i.set(e,t),a.j(e),()=>{i.delete(e),a.D(e)}),v:a.A}},q=Ft?P.useLayoutEffect:P.useEffect,J=`current`,Xt=(e,t)=>{if(Array.isArray(e))for(let n of e)Xt(n,t);else e==null||typeof e==`boolean`||t.push(e)},Zt=(e,t)=>e.key??`_`+t,Qt=e=>{let t=(0,P.useRef)(null);return t[J]||(t[J]=e())},$t=e=>{let t=(0,P.useRef)(e);return q(()=>{t[J]=e},[e]),t},en=(0,P.memo)(({Z:e,ee:t,te:n,oe:r,ne:i,re:a,se:o,ie:s})=>{let c=(0,P.useRef)(null);q(()=>t(c[J],n),[n]);let l=(0,P.useMemo)(()=>{let e={contain:`layout style`,position:i&&s?void 0:`absolute`,[o?`height`:`width`]:`100%`,[o?`top`:`left`]:0,[o?`left`:`top`]:r,visibility:!i||s?void 0:`hidden`};return o&&(e.display=`inline-flex`),e},[r,i,s,o]);return(0,F.jsx)(a,typeof a==`string`?{ref:c,style:l,children:e}:{ref:c,style:l,index:n,children:e})}),tn=(e,t)=>(0,P.useMemo)(()=>{if(typeof e==`function`)return[n=>e(t[n],n),t.length];let n=(e=>{let t=[];return Xt(e,t),t})(e);return[e=>n[e],n.length]},[e,t]),nn=(0,P.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:a,keepMounted:o,cache:s,startMargin:c=0,ssrCount:l,as:u=`div`,item:d=`div`,scrollRef:f,onScroll:p,onScrollEnd:m},h)=>{let[g,_]=tn(e,t),v=(0,P.useRef)(null),y=(0,P.useRef)(!!l),b=$t(p),x=$t(m),[S,C,w,T]=Qt(()=>{let e=!!a,t=Ht(_,r,l,s,!r);return[t,Yt(t,e),qt(t,e),e]});_!==S.T()&&S.B(5,[_,i]),c!==S.O()&&S.B(6,c);let[E,D]=(0,P.useReducer)(S.m,void 0,S.m),O=S.M(),ee=S.h(),te=w.P(),k=[],ne=e=>{let t=g(e);return(0,F.jsx)(en,{ee:C.U,te:e,oe:S.k(e,te),ne:S.I(e),re:d,Z:t,se:T,ie:y[J]},Zt(t,e))};if(q(()=>{y[J]=!1,S.W(1,e=>{e?(0,Ne.flushSync)(D):D()}),S.W(4,()=>{b[J]&&b[J](S.C())}),S.W(8,()=>{x[J]&&x[J]()});let e=v[J],t=t=>{C.G(t),w.N(e,t)};return f?kt(()=>{f[J]&&t(f[J])}):t(e.parentElement),()=>{S.v(),C.v(),w.v()}},[]),q(()=>{w.q()},[E]),(0,P.useImperativeHandle)(h,()=>({get cache(){return S._()},get scrollOffset(){return S.C()},get scrollSize(){return Vt(S)},get viewportSize(){return S.p()},findItemIndex:S.$,getItemOffset:S.k,getItemSize:S.R,scrollToIndex:w.Y,scrollTo:w.V,scrollBy:w.X}),[]),o){let e=new Set(o);for(let[t,r]=S.S(n);t<=r;t++)e.add(t);Ot([...e]).forEach(e=>{k.push(ne(e))})}else for(let[e,t]=S.S(n);e<=t;e++)k.push(ne(e));return(0,F.jsx)(u,{ref:v,style:{contain:`size style`,overflowAnchor:`none`,flex:`none`,position:`relative`,width:T?ee:`100%`,height:T?`100%`:ee,pointerEvents:O?`none`:void 0},children:k})});function rn(e){let t=(0,P.useRef)(null),[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(!0),s=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useRef)(null),u=(0,P.useCallback)(e=>{r(e),e&&(t.current=e.closest(`[data-slot="main"]`))},[]),d=(0,P.useCallback)(e=>{let n=t.current;if(!n)return;let r=l.current;r?r.scrollTo(e):n.scrollTop=e},[]),f=(0,P.useCallback)(()=>{let e=t.current;e&&d(e.scrollHeight-e.clientHeight)},[d]),p=(0,P.useCallback)(()=>{o.current&&f()},[f]),m=(0,P.useCallback)(()=>{let e=t.current;e&&(s.current=null,o.current=!0,e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:`smooth`}))},[]);return(0,P.useEffect)(()=>{let r=t.current,i=n;if(!r||!i)return;if(c.current!==e){c.current=e;let t=Je(e);t&&!t.atBottom?(o.current=!1,s.current=t.top,r.scrollTop=t.top):(o.current=!0,f())}let l=0,u=null,p=()=>{s.current=null,o.current=!1,l=0},m=()=>{l=Date.now()},h=e=>{e.deltaY<0?p():m()},g=e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)?p():[`ArrowDown`,`PageDown`,`End`].includes(e.key)&&m()},_=()=>{R(r,80)||(p(),m())},v=e=>{u=e.touches[0]?.clientY??null},y=e=>{let t=e.touches[0]?.clientY;t!==void 0&&(u!==null&&t>u+1?p():u!==null&&t<u-1&&m(),u=t)},b=()=>{let t=R(r,80);t&&s.current===null&&(o.current||Date.now()-l<2e3)&&(o.current=!0),a(!t),s.current===null&&qe(e,{top:r.scrollTop,atBottom:t})};r.addEventListener(`scroll`,b,{passive:!0}),r.addEventListener(`wheel`,h,{passive:!0}),r.addEventListener(`touchstart`,v,{passive:!0}),r.addEventListener(`touchmove`,y,{passive:!0}),r.addEventListener(`pointerdown`,_,{passive:!0}),r.addEventListener(`keydown`,g);let x;return typeof ResizeObserver<`u`&&(x=new ResizeObserver(()=>{let e=s.current;if(e!==null){let t=r.scrollHeight-r.clientHeight;d(Math.min(e,t)),t>=e&&(s.current=null)}else o.current&&f()}),x.observe(i)),()=>{r.removeEventListener(`scroll`,b),r.removeEventListener(`wheel`,h),r.removeEventListener(`touchstart`,v),r.removeEventListener(`touchmove`,y),r.removeEventListener(`pointerdown`,_),r.removeEventListener(`keydown`,g),x?.disconnect()}},[e,n,d,f]),{attachContent:u,scrollElRef:t,virtualizerRef:l,pillVisible:i,jumpToLatest:m,restickIfStuck:p}}function an({runId:e,rows:t,mode:n,controls:r}){return n===`virtual`?(0,F.jsx)(on,{runId:e,rows:t,controls:r}):(0,F.jsx)(`div`,{ref:r.attachContent,"data-slot":`thread-rows`,"data-virtualized":`false`,children:t.map(e=>(0,F.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-3.5 [contain-intrinsic-block-size:auto_3rem] [content-visibility:auto]`,children:e.node},e.key))})}function on({runId:e,rows:t,controls:n}){let r=(0,P.useRef)(null),[i]=(0,P.useState)(()=>Ze(e,t.length)),a=(0,P.useRef)(t.length);a.current=t.length;let o=(0,P.useRef)(null),s=(0,P.useCallback)(t=>{n.virtualizerRef.current=t,t?o.current=t:o.current&&=(Xe(e,{rows:a.current,cache:o.current.cache}),null)},[e,n.virtualizerRef]),[c,l]=(0,P.useState)(0);return(0,P.useLayoutEffect)(()=>{let e=()=>{let e=r.current,t=n.scrollElRef.current;!e||!t||l(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n.scrollElRef]),(0,F.jsx)(`div`,{ref:e=>{r.current=e,n.attachContent(e)},"data-slot":`thread-rows`,"data-virtualized":`true`,children:(0,F.jsx)(nn,{ref:s,scrollRef:n.scrollElRef,startMargin:c,...i===void 0?{}:{cache:i},children:t.map(e=>(0,F.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-3.5`,children:e.node},e.key))})})}function sn({onJump:e}){return(0,F.jsxs)(`button`,{type:`button`,"data-slot":`jump-to-latest`,onClick:e,className:`pointer-events-auto inline-flex min-h-8 items-center gap-1.5 rounded-full border border-border bg-background px-3.5 text-xs font-medium text-muted-foreground shadow-modal hover:text-foreground`,children:[(0,F.jsx)(ge,{"aria-hidden":!0,className:`size-3.5`}),`Jump to latest`]})}var cn=120;function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function X(e){let t=e.replace(/\s+/g,` `).trim();return t.length>cn?`${t.slice(0,cn-1)}…`:t}function Z(e,...t){if(Y(e))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim()!==``)return X(t)}}function ln(e){if(!Y(e))return;let t=e.command;if(typeof t==`string`&&t.trim()!==``)return X(t);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return X(e.join(` `))}}function un(e){if(!Y(e)||!Array.isArray(e.changes))return[];let t=[];for(let n of e.changes)Y(n)&&typeof n.path==`string`&&n.path.trim()!==``&&t.push(n.path);return t}function dn(e){return Z(e,`description`,`query`,`url`,`filePath`,`file_path`,`path`,`pattern`,`name`)}function Q(e,t){return t?`${e} ${t}`:e}function fn(e,t){let n=typeof e==`string`?e.toLowerCase():``;switch(n){case`bash`:case`commandexecution`:return{toolKind:`execute`,title:Q(`Ran`,ln(t)),subtitle:Z(t,`description`)};case`edit`:case`multiedit`:return{toolKind:`edit`,title:Q(`Edit`,Z(t,`file_path`,`filePath`,`path`))};case`write`:return{toolKind:`edit`,title:Q(`Write`,Z(t,`file_path`,`filePath`,`path`))};case`notebookedit`:return{toolKind:`edit`,title:Q(`Edit`,Z(t,`notebook_path`,`notebookPath`,`file_path`,`filePath`,`path`))};case`filechange`:{let e=un(t);return{toolKind:`edit`,title:Q(`Edit`,e.length===1?e[0]:e.length>1?`${e.length} files`:void 0)}}case`read`:return{toolKind:`read`,title:Q(`Read`,Z(t,`file_path`,`filePath`,`path`))};case`glob`:case`grep`:return{toolKind:`search`,title:Q(`Search`,Z(t,`pattern`,`query`)),subtitle:Z(t,`path`)};case`webfetch`:return{toolKind:`fetch`,title:Q(`Fetch`,Z(t,`url`))};case`websearch`:return{toolKind:`fetch`,title:Q(`Web search`,Z(t,`query`))};case`task`:{let e=Z(t,`description`,`prompt`);return{toolKind:`task`,title:e?`Task: ${e}`:`Task`,subtitle:Z(t,`subagent_type`,`subagentType`)}}case`todowrite`:case`todolist`:case`plan`:return{toolKind:`plan`,title:`Update plan`};case`mcptoolcall`:{let e=Z(t,`server`),n=Z(t,`tool`);return e&&n?{toolKind:`other`,title:`${e}.${n}`}:{toolKind:`other`,title:`MCP tool`,subtitle:dn(t)}}}if(n.startsWith(`mcp__`)){let t=e.split(`__`).filter(e=>e!==``);if(t.length>=3)return{toolKind:`other`,title:`${t[1]}.${t.slice(2).join(`__`)}`}}return{toolKind:`other`,title:typeof e==`string`&&e.trim()!==``?X(e):`Tool`,subtitle:dn(t)}}function pn(e){for(let t=e.turns.length-1;t>=0;--t){let n=e.turns[t].planEntries;if(n!==void 0)return n}}function mn(e){let t=[];for(let n of e.turns)for(let e of n.items)if(e.kind===`tool`){for(let n of e.locations??[])t.push(n.path);for(let n of e.diffs??[])t.push(n.path)}let n=[];for(let e=t.length-1;e>=0;--e)n.includes(t[e])||n.push(t[e]);return n}function hn(e,t){switch(e){case`waiting`:return{state:`waiting`};case`failed`:return{state:`closed`,tone:`danger`,label:t?`Session failed — ${t}`:`Session failed`};case`review`:return{state:`closed`,tone:`dim`,label:`Session closed — waiting for your review`};case`done`:case`cancelled`:return{state:`closed`,tone:`dim`,label:`Session closed`};default:return null}}function gn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $(e){return typeof e==`string`?e:void 0}function _n(e){return e.replace(/\s*CEZ:DONE\s*$/,``)}function vn(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}var yn=e=>e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`,bn=new Set([`pending`,`in_progress`,`completed`]);function xn(e){if(!gn(e)||!Array.isArray(e.todos))return;let t=[];for(let n of e.todos){if(!gn(n)||typeof n.content!=`string`)return;t.push({content:n.content,status:bn.has(n.status)?n.status:`pending`,...typeof n.activeForm==`string`?{activeForm:n.activeForm}:{}})}return t}function Sn(e){let t=[],n=new Map,r,i=0,a=()=>{i+=1;let e={id:`turn-${i}`,entries:[],v2Items:!1};return t.push(e),e},o=()=>t.at(-1)??a(),s=(e,t)=>{let r={...t};if(!e.v2Items){e.v2Items=!0;for(let t of e.entries)t.origin===`v1`&&yn(t.entry)&&n.delete(t.entry.id);e.entries=e.entries.filter(e=>!(e.origin===`v1`&&yn(e.entry)))}let i=n.get(r.id);if(i&&i.turn===e){i.entry.entry=r,n.set(r.id,i);return}let a={origin:`v2`,entry:r};e.entries.push(a),n.set(r.id,{turn:e,entry:a})};for(let i of e)switch(i.type){case`user-message`:{let e=a();e.userMessage={text:$(i.text)??``,imageCount:typeof i.imageCount==`number`?i.imageCount:0,images:Array.isArray(i.images)?i.images.filter(e=>typeof e==`string`):[]};break}case`turn.started`:{let e=$(i.turnId),n=t.at(-1);n&&n.turnId===void 0&&!n.v2Items?n.turnId=e:a().turnId=e;break}case`turn.completed`:{let e=$(i.turnId),n;for(let r=t.length-1;r>=0&&!n;--r)t[r].turnId===e&&(n=t[r]);let r=n??t.at(-1);r&&(r.completed={stopReason:$(i.stopReason)??`end_turn`,...typeof i.costUsd==`number`?{costUsd:i.costUsd}:{}});break}case`item.started`:case`item.updated`:case`item.completed`:{if(!gn(i.item))break;let e=i.item.kind,t=i.item.id;if(e!==`message`&&e!==`reasoning`&&e!==`tool`||typeof t!=`string`||t===``)break;let r=i.item;s(n.get(r.id)?.turn??o(),r);break}case`item.delta`:{let e=n.get($(i.itemId)??``),t=$(i.delta)??``;if(!e||t===``||!yn(e.entry.entry))break;let r=e.entry.entry;i.field===`output`&&r.kind===`tool`?r.output=(r.output??``)+t:i.field!==`output`&&r.kind!==`tool`&&(r.text+=t);break}case`text`:{let e=o();if(e.v2Items)break;let t=$(i.text)??``;if(t===``)break;e.entries.push({origin:`v1`,entry:{kind:`message`,id:`v1:${i.seq}`,role:`assistant`,text:t}});break}case`tool-call`:{let e=o();if(e.v2Items)break;let t=$(i.tool)??`Tool`,r=fn(t,i.input);if(r.toolKind===`plan`){let t=xn(i.input);t!==void 0&&(e.planEntries=t)}let a={kind:`tool`,id:$(i.id)??`v1:${i.seq}`,name:t,toolKind:r.toolKind,title:r.title,status:`running`,input:i.input},s={origin:`v1`,entry:a};e.entries.push(s),n.set(a.id,{turn:e,entry:s});break}case`tool-result`:{let e=n.get($(i.toolCallId)??``);if(!e||e.turn.v2Items||e.entry.origin!==`v1`)break;let t=e.entry.entry;if(t.kind!==`tool`)break;t.status=`completed`,t.output=vn(i.result);break}case`note`:case`lifecycle`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:e,tone:`dim`}});break}case`error`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:e,tone:`danger`}});break}case`session.error`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v2:${i.seq}`,text:e,tone:`danger`}});break}case`step-end`:{if(i.status!==`failed`)break;let e=$(i.error)?` — ${$(i.error)}`:``;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:`step ${$(i.stepId)??`?`} failed${e}`,tone:`danger`}});break}case`check-output`:{let e=$(i.command)??`check`,t=typeof i.exitCode==`number`?i.exitCode:-1,n={kind:`tool`,id:`v1:${i.seq}`,name:`check`,toolKind:`execute`,title:`Ran ${e}`,status:t===0?`completed`:`failed`,output:$(i.text)??``,exitCode:t};o().entries.push({origin:`meta`,entry:n});break}case`image`:{let e=$(i.url);if(e===void 0)break;let t={kind:`image`,id:`v1:${i.seq}`,url:e},n=$(i.name);n!==void 0&&(t.name=n),o().entries.push({origin:`meta`,entry:t});break}case`plan.updated`:Array.isArray(i.entries)&&(o().planEntries=i.entries);break;case`session.ended`:r={reason:$(i.reason)??`end_turn`,...$(i.message)===void 0?{}:{message:$(i.message)}};break;case`step-start`:case`token-usage`:case`cost`:case`turn-end`:case`done`:case`session`:break;default:break}return{turns:t.map(e=>({id:e.id,...e.turnId===void 0?{}:{turnId:e.turnId},...e.userMessage===void 0?{}:{userMessage:e.userMessage},...e.planEntries===void 0?{}:{planEntries:e.planEntries},...e.completed===void 0?{}:{completed:e.completed},items:e.entries.map(({entry:e})=>e.kind===`message`&&e.role===`assistant`?{...e,text:_n(e.text)}:e)})),...r===void 0?{}:{sessionEnded:r}}}function Cn(){let{id:e}=o(),t=d(e),n=ke(e),r=(0,P.useMemo)(()=>Sn(n),[n]);if(t.isPending)return(0,F.jsx)(he,{});if(t.isError){let e=t.error instanceof f&&t.error.status===404;return(0,F.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,F.jsx)(v,{icon:e?(0,F.jsx)(ie,{}):(0,F.jsx)(we,{}),tone:e?`neutral`:`danger`,title:e?`Task not found`:`Could not load this task`,subtitle:e?`No run has this id. It may have been deleted, or the link is from another machine.`:t.error.message,actions:(0,F.jsx)(p,{asChild:!0,variant:`outline`,children:(0,F.jsx)(a,{to:`/`,children:`Back to tasks`})})})})}return(0,F.jsx)(Tn,{run:t.data,thread:r})}function wn(e,t){let n=[];e.task&&n.push({key:`task`,node:(0,F.jsx)(z,{text:e.task,images:e.taskImages??[]})});for(let e of t.turns){e.userMessage&&n.push({key:`${e.id}:user`,node:(0,F.jsx)(z,{text:e.userMessage.text,imageCount:e.userMessage.imageCount,images:e.userMessage.images})});for(let t of Ve(e.items))n.push({key:`${e.id}:${t.id}`,node:(0,F.jsx)(On,{block:t,scope:e.id})})}return n}function Tn({run:e,thread:t}){let n=hn(e.status,e.error),r=pn(t),i=r!==void 0&&r.length>0?mt(r):void 0,a=e.status===`running`||e.status===`waiting`,o=c(e.id),s=(0,P.useMemo)(()=>wn(e,t),[e,t]),{search:l}=u(),d=Ge(l,s.length),f=rn(e.id);return Me(f.restickIfStuck),(0,F.jsxs)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:[(0,F.jsx)(D,{run:e,planTally:i}),(0,F.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-1 flex-col gap-3.5 px-4 py-5 md:px-6`,children:[(0,F.jsx)(We,{runId:e.id,children:(0,F.jsx)(an,{runId:e.id,rows:s,mode:d,controls:f})}),t.turns.length===0?e.status===`queued`?(0,F.jsx)(Dn,{run:e}):(0,F.jsx)(`p`,{"data-slot":`thread-empty`,className:`py-6 text-center text-xs text-soft-foreground`,children:`No session events yet.`}):null,n&&n.state===`closed`?(0,F.jsxs)(`div`,{"data-slot":`thread-footer`,"data-state":n.state,className:x(`mt-auto flex items-center gap-2 border-t border-border pt-3 text-xs`,n.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[n.label,e.pullRequestUrl?(0,F.jsx)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`PR ↗`}):null]}):null,e.status===`review`?(0,F.jsx)(yt,{run:e}):null]}),(0,F.jsx)(wt,{status:e.status}),(0,F.jsxs)(`div`,{"data-slot":`thread-dock`,className:`sticky bottom-[var(--kb,0px)] z-10 bg-background px-4 pt-1.5 pb-3 max-md:border-t max-md:border-border md:px-6 md:pb-4`,children:[f.pillVisible?(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 -top-12 flex justify-center`,children:(0,F.jsx)(sn,{onJump:f.jumpToLatest})}):null,(0,F.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-col gap-2.5`,children:[r!==void 0&&r.length>0?(0,F.jsx)(gt,{runId:e.id,entries:r},e.id):null,e.status===`waiting`?(0,F.jsxs)(`div`,{"data-slot":`paused-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,F.jsx)(_e,{tone:`pending`,pulse:!0}),`The agent is paused, waiting for your reply`]}):null,(0,F.jsx)(le,{onSubmit:(e,t)=>o.mutateAsync({text:e,images:t}),disabled:!a,disabledReason:`Session closed — Continue to reopen.`,disabledAction:(0,F.jsx)(En,{run:e}),placeholder:e.status===`waiting`?`Reply — / for skills, @ for files…`:`Message the agent — / for skills, @ for files…`,autocompleteSkills:!0,quickReplies:!0,getMentionCandidates:()=>mn(t)})]})]})]})}function En({run:e}){let t=y(),n=l({mutationFn:()=>_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:i.runs.all}),onError:e=>h(e.message,{tone:`danger`})});return E(e).continueRun?(0,F.jsxs)(p,{type:`button`,variant:`outline`,size:`sm`,disabled:n.isPending,onClick:()=>n.mutate(),children:[(0,F.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Continue`]}):null}function Dn({run:e}){let t=w(s().data??[],e.id);return(0,F.jsxs)(`div`,{"data-slot":`queued-state`,className:`flex flex-col items-center gap-1.5 py-10 text-center`,children:[(0,F.jsx)(_e,{tone:`pending`,pulse:!0}),(0,F.jsxs)(`p`,{className:`text-[13px] font-medium`,children:[`Waiting for a free agent slot`,t===void 0?``:` — #${t} in queue`]}),(0,F.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[e.workflow,` · starts automatically when a slot frees up`]})]})}function On({block:e,scope:t}){switch(e.kind){case`entry`:return(0,F.jsx)(kn,{entry:e.entry,scope:t});case`tool-card`:return(0,F.jsx)(B,{item:e.item,nested:e.children,cacheKey:`${t}:${e.id}`});case`context-group`:return(0,F.jsx)(lt,{group:e,scope:t});case`streak`:return(0,F.jsx)(ut,{count:e.count,children:e.blocks.map(e=>(0,F.jsx)(On,{block:e,scope:t},e.id))})}}function kn({entry:e,scope:t}){switch(e.kind){case`message`:return e.role===`assistant`?(0,F.jsx)(Qe,{text:e.text}):(0,F.jsx)(z,{text:e.text});case`reasoning`:return(0,F.jsx)(et,{text:e.text});case`tool`:return(0,F.jsx)(B,{item:e,cacheKey:`${t}:${e.id}`});case`note`:return(0,F.jsx)($e,{note:e});case`image`:return(0,F.jsx)(dt,{image:e})}}export{Cn as TaskThreadRoute};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-CWRO0GMe.js","assets/bundle-mjs-DLPpRFyl.js","assets/utils-rQGbOrwc.js","assets/highlighter-BKVEsACy.js","assets/index-Cv1pQs9U.js","assets/react-dom-Ddtik4qM.js","assets/centered-state-zgEVNWsj.js","assets/skill-detail-CcFFKmGO.js","assets/dialog-DDRjj-uK.js","assets/x-Br_jIDBw.js","assets/dist-id2CeyV-.js","assets/skills-ynuO5oCr.js","assets/markdown-CR_HLGTs.js","assets/chunk-BO2N2NFS-f5igTtpB.js","assets/lib-CNGa3Dig.js","assets/loader-circle-BV3DO9mE.js","assets/search-x-CoCyl7zT.js","assets/triangle-alert-6su4Js5O.js","assets/input-BRsSo4xH.js","assets/index-Bz_r8Jt3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,l as n,o as r}from"./bundle-mjs-DLPpRFyl.js";import{a as i}from"./centered-state-zgEVNWsj.js";import{n as a,t as o}from"./utils-rQGbOrwc.js";import{P as s,rt as c}from"./index-Cv1pQs9U.js";var l=a(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),u=a(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),d=e();function f({mode:e,wrap:t,onModeChange:n,onWrapChange:r}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,d.jsx)(p,{current:e,value:`unified`,onModeChange:n}),(0,d.jsx)(p,{current:e,value:`split`,onModeChange:n})]}),(0,d.jsx)(i,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":t,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:o(t&&`bg-muted text-foreground`),onClick:()=>r(!t),children:(0,d.jsx)(u,{"aria-hidden":`true`})})]})}function p({current:e,value:t,onModeChange:n}){let r=e===t;return(0,d.jsx)(`button`,{type:`button`,"data-mode":t,"aria-pressed":r,onClick:()=>n(t),className:o(`rounded-[5px] px-2 py-0.5 text-[11px] font-medium capitalize`,r?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:t})}function m({branch:e}){return(0,d.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,d.jsx)(c,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,d.jsx)(`span`,{className:`truncate`,children:e})]})}var h=n(r(),1);function g(e){let[n,r]=(0,h.useState)(null);return(0,h.useEffect)(()=>{let e=!1;return t(()=>import(`./diff-view-CWRO0GMe.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),()=>{e=!0}},[]),e.files.length===0?(0,d.jsx)(`p`,{"data-slot":`diff-empty`,className:o(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,d.jsx)(_,{...e}):n===null?(0,d.jsx)(`p`,{"data-slot":`diff-loading`,className:o(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,d.jsx)(n.View,{...e})}function _({files:e,wrap:t=!1,className:n}){let r={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length};return(0,d.jsxs)(`div`,{"data-slot":`diff`,"data-fallback":`true`,className:o(`flex min-w-0 flex-col gap-3`,n),children:[(0,d.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,d.jsxs)(`span`,{children:[r.files,` `,r.files===1?`file`:`files`,` changed`]}),(0,d.jsx)(s,{stat:r})]}),e.map(e=>(0,d.jsx)(v,{file:e,wrap:t},`${e.oldPath??``}→${e.path}`))]})}function v({file:e,wrap:t}){return(0,d.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,d.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,d.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,d.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,d.jsx)(s,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),e.binary?(0,d.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,d.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,d.jsx)(`pre`,{className:o(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
|
+
`).map((e,t)=>(0,d.jsxs)(`span`,{className:o(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}function y(){let[e,t]=(0,h.useState)(()=>typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches);return(0,h.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(min-width: 768px)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}export{l as a,f as i,g as n,m as r,y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{t as r}from"./react-dom-Ddtik4qM.js";import{D as i,Ft as a,Lt as o,X as s,Z as c,a as l,ct as u,ht as d,
|
|
1
|
+
import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{t as r}from"./react-dom-Ddtik4qM.js";import{D as i,Ft as a,Lt as o,X as s,Z as c,a as l,ct as u,ht as d,i as f,ot as p,q as m,t as h,zt as g}from"./centered-state-zgEVNWsj.js";import{n as _,t as v}from"./utils-rQGbOrwc.js";import{n as y}from"./loader-circle-BV3DO9mE.js";import{n as b,t as x}from"./trash-2-CDtxmmc8.js";import{t as ee}from"./square-terminal-B6PZX4Qp.js";import{t as S}from"./triangle-alert-6su4Js5O.js";import{t as C}from"./upload-Bp7hQxll.js";import{t as te}from"./x-Br_jIDBw.js";import{i as ne,r as w}from"./skills-ynuO5oCr.js";import{t as re}from"./input-BRsSo4xH.js";import{$ as T,X as ie,_ as ae,b as oe,c as E,f as se,g as ce,h as D,lt as le,m as ue,nt as de,v as O,x as fe,y as k}from"./index-Cv1pQs9U.js";var pe=_(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),A=t(r()),j=t(n());function M(){var e=[...arguments];return(0,j.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var N=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function P(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function F(e){return`nodeType`in e}function I(e){return e?P(e)?e:F(e)?e.ownerDocument?.defaultView??window:window:window}function me(e){let{Document:t}=I(e);return e instanceof t}function L(e){return!P(e)&&e instanceof I(e).HTMLElement}function R(e){return e instanceof I(e).SVGElement}function z(e){return e?P(e)?e.document:F(e)?me(e)?e:L(e)||R(e)?e.ownerDocument:document:document:document}var B=N?j.useLayoutEffect:j.useEffect;function V(e){let t=(0,j.useRef)(e);return B(()=>{t.current=e}),(0,j.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function he(){let e=(0,j.useRef)(null);return[(0,j.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,j.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function ge(e,t){t===void 0&&(t=[e]);let n=(0,j.useRef)(e);return B(()=>{n.current!==e&&(n.current=e)},t),n}function _e(e,t){let n=(0,j.useRef)();return(0,j.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function ve(e){let t=V(e),n=(0,j.useRef)(null);return[n,(0,j.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function H(e){let t=(0,j.useRef)();return(0,j.useEffect)(()=>{t.current=e},[e]),t.current}var U={};function ye(e,t){return(0,j.useMemo)(()=>{if(t)return t;let n=U[e]==null?0:U[e]+1;return U[e]=n,e+`-`+n},[e,t])}function W(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 be=W(1),G=W(-1);function xe(e){return`clientX`in e&&`clientY`in e}function K(e){if(!e)return!1;let{KeyboardEvent:t}=I(e.target);return t&&e instanceof t}function Se(e){if(!e)return!1;let{TouchEvent:t}=I(e.target);return t&&e instanceof t}function Ce(e){if(Se(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 xe(e)?{x:e.clientX,y:e.clientY}:null}var we=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[we.Translate.toString(e),we.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Te=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ee(e){return e.matches(Te)?e:e.querySelector(Te)}var De={display:`none`};function Oe(e){let{id:t,value:n}=e;return j.createElement(`div`,{id:t,style:De},n)}function ke(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return j.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 Ae(){let[e,t]=(0,j.useState)(``);return{announce:(0,j.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var je=(0,j.createContext)(null);function Me(e){let t=(0,j.useContext)(je);(0,j.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ne(){let[e]=(0,j.useState)(()=>new Set),t=(0,j.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,j.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Pe={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.
|
package/web/dist/index.html
CHANGED
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
}
|
|
42
42
|
})()
|
|
43
43
|
</script>
|
|
44
|
-
<script type="module" crossorigin src="/assets/index-
|
|
44
|
+
<script type="module" crossorigin src="/assets/index-Cv1pQs9U.js"></script>
|
|
45
45
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-DLPpRFyl.js">
|
|
46
46
|
<link rel="modulepreload" crossorigin href="/assets/react-dom-Ddtik4qM.js">
|
|
47
47
|
<link rel="modulepreload" crossorigin href="/assets/utils-rQGbOrwc.js">
|
|
48
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/assets/centered-state-zgEVNWsj.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="/assets/x-Br_jIDBw.js">
|
|
50
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
51
|
-
<link rel="modulepreload" crossorigin href="/assets/dialog-
|
|
50
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-id2CeyV-.js">
|
|
51
|
+
<link rel="modulepreload" crossorigin href="/assets/dialog-DDRjj-uK.js">
|
|
52
52
|
<link rel="modulepreload" crossorigin href="/assets/skills-ynuO5oCr.js">
|
|
53
53
|
<link rel="modulepreload" crossorigin href="/assets/lib-CNGa3Dig.js">
|
|
54
54
|
<link rel="modulepreload" crossorigin href="/assets/chunk-BO2N2NFS-f5igTtpB.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="/assets/highlighter-BKVEsACy.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="/assets/markdown-CR_HLGTs.js">
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/assets/skill-detail-
|
|
57
|
+
<link rel="modulepreload" crossorigin href="/assets/skill-detail-CcFFKmGO.js">
|
|
58
58
|
<link rel="modulepreload" crossorigin href="/assets/loader-circle-BV3DO9mE.js">
|
|
59
59
|
<link rel="modulepreload" crossorigin href="/assets/search-x-CoCyl7zT.js">
|
|
60
60
|
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-6su4Js5O.js">
|
package/web/app/node_modules/.vite/vitest/ca84d1343b96baa8137c943ed1860e522cacb238/results.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"4.1.10","results":[["web:src/components/diff/diff.test.tsx",{"duration":284.488375,"failed":false}],["web:src/routes/repo-git/repo-git.test.tsx",{"duration":290.943041,"failed":false}],["web:src/routes/github/github.test.tsx",{"duration":446.789167,"failed":false}]]}
|