@open-mercato/cezar 0.8.0 → 0.9.0-pr470.649
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 +109 -14
- package/dist/agent-config/catalog.d.ts +64 -0
- package/dist/agent-config/catalog.js +205 -0
- package/dist/agent-config/catalog.js.map +1 -0
- package/dist/agent-config/files.d.ts +46 -0
- package/dist/agent-config/files.js +119 -0
- package/dist/agent-config/files.js.map +1 -0
- package/dist/agent-config/seed.d.ts +7 -0
- package/dist/agent-config/seed.js +90 -0
- package/dist/agent-config/seed.js.map +1 -0
- package/dist/agent-config/service.d.ts +44 -0
- package/dist/agent-config/service.js +71 -0
- package/dist/agent-config/service.js.map +1 -0
- package/dist/agent-config/validate.d.ts +21 -0
- package/dist/agent-config/validate.js +76 -0
- package/dist/agent-config/validate.js.map +1 -0
- package/dist/config.d.ts +34 -4
- package/dist/config.js +97 -2
- package/dist/config.js.map +1 -1
- package/dist/core/agent-env.js +21 -15
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-runner.d.ts +16 -6
- package/dist/core/agent-runner.js +15 -3
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/ask.d.ts +184 -0
- package/dist/core/ask.js +97 -0
- package/dist/core/ask.js.map +1 -0
- package/dist/core/backend-detect.d.ts +5 -5
- package/dist/core/backend-detect.js +37 -5
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +5 -1
- package/dist/core/claude-cli-runner.js +4 -2
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/claude-ui-mapper.d.ts +9 -0
- package/dist/core/claude-ui-mapper.js +34 -3
- package/dist/core/claude-ui-mapper.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +15 -3
- package/dist/core/codex-app-server-runner.js +158 -127
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.d.ts +30 -0
- package/dist/core/codex-app-server-transport.js +136 -0
- package/dist/core/codex-app-server-transport.js.map +1 -0
- package/dist/core/codex-model-catalog.d.ts +10 -0
- package/dist/core/codex-model-catalog.js +110 -0
- package/dist/core/codex-model-catalog.js.map +1 -0
- package/dist/core/codex-ui-mapper.d.ts +47 -2
- package/dist/core/codex-ui-mapper.js +247 -29
- package/dist/core/codex-ui-mapper.js.map +1 -1
- package/dist/core/model-identity.d.ts +113 -0
- package/dist/core/model-identity.js +119 -0
- package/dist/core/model-identity.js.map +1 -0
- package/dist/core/model-presets.d.ts +15 -0
- package/dist/core/model-presets.js +43 -0
- package/dist/core/model-presets.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +1 -1
- package/dist/core/opencode-server-runner.js +7 -12
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/opencode-ui-mapper.d.ts +11 -7
- package/dist/core/opencode-ui-mapper.js +62 -19
- package/dist/core/opencode-ui-mapper.js.map +1 -1
- package/dist/core/pi-runner.d.ts +40 -0
- package/dist/core/pi-runner.js +46 -0
- package/dist/core/pi-runner.js.map +1 -0
- package/dist/core/process-usage.d.ts +3 -0
- package/dist/core/process-usage.js +12 -0
- package/dist/core/process-usage.js.map +1 -1
- package/dist/core/runner-factory.js +3 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-model-catalog.d.ts +28 -0
- package/dist/core/runner-model-catalog.js +62 -0
- package/dist/core/runner-model-catalog.js.map +1 -0
- package/dist/core/secret-redaction.js.map +1 -1
- package/dist/core/tool-display.d.ts +2 -2
- package/dist/core/tool-display.js +24 -6
- package/dist/core/tool-display.js.map +1 -1
- package/dist/core/ui-events.d.ts +29 -2
- package/dist/git-worktree.d.ts +37 -4
- package/dist/git-worktree.js +175 -12
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +2 -0
- package/dist/handoff.js.map +1 -1
- package/dist/index.js +55 -5
- package/dist/index.js.map +1 -1
- package/dist/install-as-command.d.ts +1 -1
- package/dist/install-as-command.js.map +1 -1
- package/dist/paths.d.ts +32 -2
- package/dist/paths.js +47 -2
- package/dist/paths.js.map +1 -1
- package/dist/runs/auto-name.js.map +1 -1
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/review-gate.js.map +1 -1
- package/dist/runs/store.d.ts +154 -60
- package/dist/runs/store.js +103 -19
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/task-markers.d.ts +6 -2
- package/dist/runs/task-markers.js +25 -4
- package/dist/runs/task-markers.js.map +1 -1
- package/dist/runs/ui-event-sink.js.map +1 -1
- package/dist/server/capabilities.d.ts +22 -6
- package/dist/server/capabilities.js +85 -8
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/checkout.d.ts +128 -0
- package/dist/server/checkout.js +296 -0
- package/dist/server/checkout.js.map +1 -0
- package/dist/server/forge/github.d.ts +281 -10
- package/dist/server/forge/github.js +539 -23
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +48 -1
- package/dist/server/fs-browse.d.ts +105 -0
- package/dist/server/fs-browse.js +182 -0
- package/dist/server/fs-browse.js.map +1 -0
- package/dist/server/git-changes.d.ts +12 -3
- package/dist/server/git-changes.js +23 -5
- package/dist/server/git-changes.js.map +1 -1
- package/dist/server/github.d.ts +1 -1
- package/dist/server/open-in-app.d.ts +2 -1
- package/dist/server/open-in-app.js +1 -0
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/project-context.d.ts +103 -0
- package/dist/server/project-context.js +153 -0
- package/dist/server/project-context.js.map +1 -0
- package/dist/server/server.d.ts +110 -0
- package/dist/server/server.js +1557 -215
- package/dist/server/server.js.map +1 -1
- package/dist/server/wsl.js.map +1 -1
- package/dist/server-install/platforms/macosx-ngrok.js.map +1 -1
- package/dist/server-install/platforms/ubuntu-vps.js +7 -0
- package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
- package/dist/server-install/state.js.map +1 -1
- package/dist/server-install/steps.js +6 -2
- package/dist/server-install/steps.js.map +1 -1
- package/dist/server-install/types.d.ts +28 -28
- package/dist/server-install/ui.js.map +1 -1
- package/dist/skills-banner.js.map +1 -1
- package/dist/skills-remote.d.ts +10 -4
- package/dist/skills-remote.js +31 -14
- package/dist/skills-remote.js.map +1 -1
- package/dist/skills.d.ts +29 -0
- package/dist/skills.js +72 -14
- package/dist/skills.js.map +1 -1
- package/dist/todos.d.ts +9 -7
- package/dist/todos.js +38 -19
- package/dist/todos.js.map +1 -1
- package/dist/workflows/run.d.ts +145 -10
- package/dist/workflows/run.js +608 -66
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +42 -42
- package/dist/workflows/types.js +2 -1
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/config.d.ts +251 -0
- package/dist/workspace/config.js +162 -0
- package/dist/workspace/config.js.map +1 -0
- package/dist/workspace/migrations.d.ts +45 -0
- package/dist/workspace/migrations.js +132 -0
- package/dist/workspace/migrations.js.map +1 -0
- package/dist/workspace/projects-cli.d.ts +23 -0
- package/dist/workspace/projects-cli.js +105 -0
- package/dist/workspace/projects-cli.js.map +1 -0
- package/dist/workspace/projects.d.ts +81 -0
- package/dist/workspace/projects.js +214 -0
- package/dist/workspace/projects.js.map +1 -0
- package/dist/workspace/semaphore.d.ts +77 -0
- package/dist/workspace/semaphore.js +57 -0
- package/dist/workspace/semaphore.js.map +1 -0
- package/dist/workspace/ui-state.d.ts +23 -0
- package/dist/workspace/ui-state.js +42 -0
- package/dist/workspace/ui-state.js.map +1 -0
- package/package.json +3 -2
- package/scripts/mock-claude.mjs +136 -2
- package/web/dist/assets/arrow-left-CnSdp92h.js +1 -0
- package/web/dist/assets/centered-state-NF79blq7.js +43 -0
- package/web/dist/assets/{chunk-BO2N2NFS-BN7h-q1E.js → chunk-BO2N2NFS-DtrdTCWa.js} +4 -4
- package/web/dist/assets/commit-list-CL8vSWGw.js +1 -0
- package/web/dist/assets/compare-variants-mI-MnhuR.js +1 -0
- package/web/dist/assets/diff-view-Bhfvnnn9.js +6 -0
- package/web/dist/assets/dist-COA_NSud.js +1 -0
- package/web/dist/assets/ellipsis-vertical-CNnSLn5a.js +1 -0
- package/web/dist/assets/{file-tuE95HNX.js → file-D4GBh1ao.js} +1 -1
- package/web/dist/assets/{git-pull-request-BztcgsRZ.js → git-pull-request-DnR8Xh4_.js} +1 -1
- package/web/dist/assets/git-toolbar-rVtFyL4t.js +1 -0
- package/web/dist/assets/github-_t0ceKcO.js +1 -0
- package/web/dist/assets/{highlighted-body-OFNGDK62-CJIHtxqW.js → highlighted-body-OFNGDK62-BuFJwunK.js} +1 -1
- package/web/dist/assets/{image-preview-Ca0UgThg.js → image-preview-DEhW0TFz.js} +1 -1
- package/web/dist/assets/index-BfXFhAGQ.js +30 -0
- package/web/dist/assets/index-Mov2Rrbw.css +2 -0
- package/web/dist/assets/lib-DPEZDBUN.js +1 -0
- package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +1 -0
- package/web/dist/assets/project-router-CBzGUqvS.js +1 -0
- package/web/dist/assets/{refresh-cw-B4NW5q60.js → refresh-cw-BT8E96Tm.js} +1 -1
- package/web/dist/assets/repo-git-C3dJiX3j.js +1 -0
- package/web/dist/assets/{run-diff-BKpV1kGk.js → run-diff-HEZcHwRr.js} +3 -3
- package/web/dist/assets/run-header-DldbROhB.js +1 -0
- package/web/dist/assets/{search-x-C6xG26dv.js → search-x-BDjaMrzG.js} +1 -1
- package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +1 -0
- package/web/dist/assets/skills-BIg29xLt.js +1 -0
- package/web/dist/assets/{square-terminal-D9l_Xx7B.js → square-terminal-Ckjjn0vb.js} +1 -1
- package/web/dist/assets/tab-link-DTQ9FBZY.js +1 -0
- package/web/dist/assets/task-changes-DRhQVnFN.js +1 -0
- package/web/dist/assets/task-commits-5StODPII.js +1 -0
- package/web/dist/assets/task-files-BuylxobG.js +2 -0
- package/web/dist/assets/task-thread-DnHR0k7k.js +9 -0
- package/web/dist/assets/textarea-Bj_LCreg.js +1 -0
- package/web/dist/assets/toml-CcmNWLt0.js +1 -0
- package/web/dist/assets/{trash-2-De8Z5Y5-.js → trash-2-DAyZ0VSi.js} +1 -1
- package/web/dist/assets/{triangle-alert-DJUyRhTV.js → triangle-alert-Uy8rokUh.js} +1 -1
- package/web/dist/assets/{upload-yxUM9nk5.js → upload-CDdyPPo_.js} +1 -1
- package/web/dist/assets/use-desktop-TyHAXhMR.js +3 -0
- package/web/dist/assets/utils-B8s5qIcK.js +1 -0
- package/web/dist/assets/workflows-CwDYZLvG.js +11 -0
- package/web/dist/assets/zoomable-image-PEDOqyLQ.js +1 -0
- package/web/dist/index.html +10 -19
- package/web/dist/assets/arrow-left-bEsJ-6jp.js +0 -1
- package/web/dist/assets/centered-state-DzJJpXgm.js +0 -43
- package/web/dist/assets/command-eBgVGftz.js +0 -1
- package/web/dist/assets/compare-variants-DhqGJuHF.js +0 -1
- package/web/dist/assets/dialog-Bf1Cpc3n.js +0 -1
- package/web/dist/assets/diff-view-Cqc8LRkj.js +0 -4
- package/web/dist/assets/dist-M2QYGAcm.js +0 -1
- package/web/dist/assets/dist-ZAIqO3UX.js +0 -1
- package/web/dist/assets/folder-20ea3OVM.js +0 -1
- package/web/dist/assets/git-toolbar-DAlBoSP5.js +0 -1
- package/web/dist/assets/github--sfM4X3j.js +0 -1
- package/web/dist/assets/highlighter-ZVyRi_Cx.js +0 -3
- package/web/dist/assets/index-DlKq8gF4.css +0 -2
- package/web/dist/assets/index-h4gyDJyh.js +0 -11
- package/web/dist/assets/loader-circle-Bnw4ga19.js +0 -1
- package/web/dist/assets/markdown-DxmCMr30.js +0 -1
- package/web/dist/assets/mermaid-GHXKKRXX-DghlHZS5.js +0 -1
- package/web/dist/assets/prompt-templates-CsGr-FXH.js +0 -15
- package/web/dist/assets/repo-git-CHF2oip_.js +0 -1
- package/web/dist/assets/run-header-3CGn6FAM.js +0 -1
- package/web/dist/assets/skill-detail-DsD4-dGp.js +0 -1
- package/web/dist/assets/skill-empty-hint-Cl3ESoPu.js +0 -1
- package/web/dist/assets/skills-5kRcjM1J.js +0 -1
- package/web/dist/assets/skills-B13iqWAN.js +0 -1
- package/web/dist/assets/tab-link-DkVxOa-q.js +0 -1
- package/web/dist/assets/task-changes-DtMiVVwO.js +0 -1
- package/web/dist/assets/task-commits-VbSLn_tW.js +0 -1
- package/web/dist/assets/task-files-qYDBG3Mx.js +0 -2
- package/web/dist/assets/task-thread-BfGERKlB.js +0 -7
- package/web/dist/assets/tasks-table-C5fwJmZ7.js +0 -1
- package/web/dist/assets/use-desktop-6PwFeCW3.js +0 -3
- package/web/dist/assets/utils-CzkLr94M.js +0 -1
- package/web/dist/assets/workflows-CnTcKlfV.js +0 -11
- package/web/dist/assets/x-DaR4ZfE-.js +0 -1
- package/web/dist/assets/zoomable-image-B-76XMUw.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./utils-CzkLr94M.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),n=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t as n,n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{r}from"./chunk-BO2N2NFS-BN7h-q1E.js";import{a as i,n as a,r as o,t as s}from"./highlighter-ZVyRi_Cx.js";function c(e,t=Date.now()){if(!e)return``;let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function l(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}var u=n(t(),1),d=e(),f={name:`shiki`,type:`code-highlighter`,getThemes:()=>[s,s],getSupportedLanguages:()=>i(),supportsLanguage:e=>i().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>o(e,String(t))||(a(e,String(t)).then(e=>n?.(e)),null)},p=(0,u.memo)(function({children:e}){return(0,d.jsx)(r,{className:`thread-markdown`,plugins:{code:f},shikiTheme:[s,s],controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{l as n,c as r,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-BO2N2NFS-BN7h-q1E.js";export{e as Mermaid};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{C as r,T as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,s as p,u as m,x as h,y as g}from"./centered-state-DzJJpXgm.js";import{r as _,t as ee}from"./utils-CzkLr94M.js";import{a as v,i as y,n as b,r as x,t as S}from"./dist-ZAIqO3UX.js";var C=_(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),w=n(t(),1),T=e(),E=`Popover`,[D,te]=o(E,[v]),O=v(),[k,A]=D(E),j=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,c=O(t),l=w.useRef(null),[u,f]=w.useState(!1),[p,m]=a({prop:r,defaultProp:i??!1,onChange:o,caller:E});return(0,T.jsx)(y,{...c,children:(0,T.jsx)(k,{scope:t,contentId:d(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:w.useCallback(()=>f(!0),[]),onCustomAnchorRemove:w.useCallback(()=>f(!1),[]),modal:s,children:n})})};j.displayName=E;var M=`PopoverAnchor`,N=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(M,n),a=O(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return w.useEffect(()=>(o(),()=>s()),[o,s]),(0,T.jsx)(S,{...a,...r,ref:t})});N.displayName=M;var P=`PopoverTrigger`,F=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=A(P,n),o=O(n),s=i(t,a.triggerRef),c=(0,T.jsx)(h.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":J(a.open),...r,ref:s,onClick:g(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,T.jsx)(S,{asChild:!0,...o,children:c})});F.displayName=P;var I=`PopoverPortal`,[ne,re]=D(I,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=A(I,t);return(0,T.jsx)(ne,{scope:t,forceMount:n,children:(0,T.jsx)(u,{present:n||a.open,children:(0,T.jsx)(m,{asChild:!0,container:i,children:r})})})};L.displayName=I;var R=`PopoverContent`,z=w.forwardRef((e,t)=>{let n=re(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=A(R,e.__scopePopover);return(0,T.jsx)(u,{present:r||a.open,children:a.modal?(0,T.jsx)(V,{...i,ref:t}):(0,T.jsx)(H,{...i,ref:t})})});z.displayName=R;var B=r(`PopoverContent.RemoveScroll`),V=w.forwardRef((e,t)=>{let n=A(R,e.__scopePopover),r=w.useRef(null),a=i(t,r),o=w.useRef(!1);return w.useEffect(()=>{let e=r.current;if(e)return p(e)},[]),(0,T.jsx)(s,{as:B,allowPinchZoom:!0,children:(0,T.jsx)(U,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),H=w.forwardRef((e,t)=>{let n=A(R,e.__scopePopover),r=w.useRef(!1),i=w.useRef(!1);return(0,T.jsx)(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),U=w.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...m}=e,h=A(R,n),g=O(n);return f(),(0,T.jsx)(c,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,T.jsx)(l,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:p,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,T.jsx)(x,{"data-state":J(h.open),role:`dialog`,id:h.contentId,...g,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),W=`PopoverClose`,G=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(W,n);return(0,T.jsx)(h.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;var K=`PopoverArrow`,q=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(n);return(0,T.jsx)(b,{...i,...r,ref:t})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=j,X=N,ie=F,ae=L,oe=z;function Z(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function se(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Z(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Z(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function ce(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Z(e)}:{top:0,bottom:0}}function le(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function ue(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(ce(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function de(){let[e,t]=(0,w.useState)({top:0,bottom:0});return(0,w.useEffect)(()=>ue(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function fe(e){let t=(0,w.useRef)(e);t.current=e,(0,w.useEffect)(()=>{let e=document.documentElement;return se(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function pe({...e}){return(0,T.jsx)(Y,{"data-slot":`popover`,...e})}function me({...e}){return(0,T.jsx)(ie,{"data-slot":`popover-trigger`,...e})}function he({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=de();return(0,T.jsx)(ae,{children:(0,T.jsx)(oe,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:le(a,r),className:ee(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function ge({...e}){return(0,T.jsx)(X,{"data-slot":`popover-anchor`,...e})}var _e=80,ve=2e3,ye=50,be=200,xe=50,Q=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`}];function Se(e){return!!e&&typeof e==`object`}function Ce(e){if(e===void 0||!Array.isArray(e))return Q.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!Se(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=$(r.skills);if(n.push({id:e,label:i.slice(0,_e),text:a.slice(0,ve),...o.length>0?{skills:o}:{}}),n.length>=ye)break}return n}function $(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,be)),t.size>=xe))break}return[...t]}function we(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function Te(e,t){return we(e,t).map(e=>e.text).join(`
|
|
2
|
-
|
|
3
|
-
`)}function Ee(e,t,n){return e===``||e===t?{text:n,applied:n}:{text:e,applied:t}}function De(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Oe(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
|
|
4
|
-
|
|
5
|
-
`)?``:i.endsWith(`
|
|
6
|
-
`)?`
|
|
7
|
-
`:`
|
|
8
|
-
|
|
9
|
-
`);let s=a.replace(/^[ \t]+/,``),c=``;return s.length>0&&(c=s.startsWith(`
|
|
10
|
-
|
|
11
|
-
`)?``:s.startsWith(`
|
|
12
|
-
`)?`
|
|
13
|
-
`:`
|
|
14
|
-
|
|
15
|
-
`),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}export{Ce as a,ge as c,fe as d,C as f,De as i,he as l,Te as n,Ee as o,Oe as r,pe as s,Q as t,me as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$ as r,Bt as i,Ct as a,D as o,Ht as s,I as c,L as l,M as u,Mt as d,R as f,Wt as p,a as m,at as h,i as g,k as _,t as v}from"./centered-state-DzJJpXgm.js";import{n as y,t as b}from"./utils-CzkLr94M.js";import{t as x}from"./arrow-left-bEsJ-6jp.js";import{n as S}from"./loader-circle-Bnw4ga19.js";import{t as C}from"./tab-link-DkVxOa-q.js";import{a as w,i as T,r as E,t as D}from"./git-toolbar-DAlBoSP5.js";import{a as O,i as k,n as A,r as j,t as M}from"./use-desktop-6PwFeCW3.js";import{t as N}from"./git-pull-request-BztcgsRZ.js";import{t as P}from"./search-x-C6xG26dv.js";import{t as F}from"./triangle-alert-DJUyRhTV.js";import{B as I,I as L,M as R,l as z,u as B}from"./index-h4gyDJyh.js";var V=n(t(),1),H=e();function U({repo:e,info:t}){let n=u(),r=p(),i=e=>g(e.message,{tone:`danger`}),c=s({mutationFn:e=>h({name:e}),onSuccess:e=>{g(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),r.invalidateQueries({queryKey:o.repo}),r.invalidateQueries({queryKey:o.health})},onError:i}),l=s({mutationFn:e=>a({baseBranch:e}),onSuccess:e=>{g(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now branch from the current checkout`),r.invalidateQueries({queryKey:o.repo})},onError:i}),[d,f]=(0,V.useState)(``);return(0,H.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Branches`}),(0,H.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,H.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,H.jsx)(I,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:b(`min-w-0 truncate font-mono text-xs`,n&&`font-semibold`),children:e}),n?(0,H.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,H.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`current`]}):(0,H.jsx)(m,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:c.isPending,onClick:()=>c.mutate(e),children:`Switch`})]},e)})}),(0,H.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=d.trim();t&&c.mutate(t,{onSuccess:()=>f(``)})},children:[(0,H.jsx)(B,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:d,onChange:e=>f(e.target.value)}),(0,H.jsxs)(m,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!d.trim()||c.isPending,children:[(0,H.jsx)(L,{"aria-hidden":`true`}),`Create`]})]})]}),(0,H.jsxs)(`div`,{className:`max-w-md`,children:[(0,H.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Agents’ base branch`}),(0,H.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:l.isPending,onChange:e=>l.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,H.jsx)(`option`,{value:``,children:`current checkout (default)`}),e.branches.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))]}),(0,H.jsx)(`p`,{className:`mt-1 text-[11px] text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n.data?.forge?.available?(0,H.jsx)(W,{}):null]})}function W(){let e=_({limit:20});return(0,H.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,H.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,H.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,H.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,H.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,H.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,H.jsx)(G,{pr:e},e.number))}):(0,H.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 G({pr:e}){let t=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(N,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,H.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,H.jsx)(K,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,H.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:y(e.url)?(0,H.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:b(n,`hover:bg-muted`),children:t}):(0,H.jsx)(`span`,{className:n,children:t})})}function K({checks:e}){return(0,H.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:b(`shrink-0 text-[10px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function q(){let e=l(),t=M(),[n,i]=(0,V.useState)(`unified`),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(null),u=e.isError&&e.error instanceof r&&e.error.status===409,d=e.data?.files??[],f=(0,V.useMemo)(()=>E(d),[d]),p=t?n:`unified`,m=!t||a;return(0,H.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.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,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,H.jsx)(D,{stat:e.data.stat}):null,(0,H.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,H.jsx)(k,{mode:n,wrap:a,onModeChange:i,onWrapChange:o})})]}),e.isPending?(0,H.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,H.jsx)(v,{icon:u?(0,H.jsx)(w,{}):(0,H.jsx)(F,{}),tone:u?`neutral`:`danger`,heading:`h2`,title:u?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):d.length===0?(0,H.jsx)(v,{icon:(0,H.jsx)(w,{}),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,H.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,H.jsx)(`aside`,{className:`sticky top-28 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,H.jsx)(T,{root:f,selected:s,onSelect:e=>{c(e),document.querySelector(`[data-slot="diff-file"][data-path="${CSS.escape(e)}"]`)?.scrollIntoView?.({block:`start`,behavior:`smooth`})}})}),(0,H.jsx)(A,{files:d,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function J({log:e}){let{sha:t}=i();return t?(0,H.jsx)(Y,{sha:t}):e.length===0?(0,H.jsx)(v,{icon:(0,H.jsx)(O,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,H.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,H.jsx)(`li`,{children:(0,H.jsxs)(d,{"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,H.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.hash}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,H.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})},e.hash))})}function Y({sha:e}){let t=f(e),n=M(),[i,a]=(0,V.useState)(`unified`),[o,s]=(0,V.useState)(!1),c=t.isError&&t.error instanceof r&&t.error.status===409,l=n?i:`unified`,u=!n||o;return(0,H.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.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,H.jsx)(m,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,H.jsxs)(d,{to:`/git/commits`,children:[(0,H.jsx)(x,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,H.jsx)(R,{stat:t.data.stat}):null,(0,H.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,H.jsx)(k,{mode:i,wrap:o,onModeChange:a,onWrapChange:s})})]}),t.isPending?(0,H.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,H.jsx)(v,{icon:c?(0,H.jsx)(P,{}):(0,H.jsx)(F,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,H.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,H.jsx)(v,{icon:(0,H.jsx)(O,{}),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,H.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,H.jsx)(A,{files:t.data.files,mode:l,wrap:u,className:`min-w-0`})})]})]})}function X({tab:e}){let t=c();if(t.isPending)return(0,H.jsx)(z,{});if(t.isError)return(0,H.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(v,{icon:(0,H.jsx)(F,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,H.jsx)(Z,{repo:t.data,info:n,tab:e}):(0,H.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(v,{icon:(0,H.jsx)(I,{}),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 Z({repo:e,info:t,tab:n}){return(0,H.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,H.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,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,H.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,H.jsx)(j,{branch:t.branch}),t.remote?(0,H.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-[11px] text-soft-foreground md:inline`,children:t.remote}):null]}),(0,H.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,H.jsx)(C,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,H.jsx)(C,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,H.jsx)(C,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,H.jsx)(q,{}):n===`commits`?(0,H.jsx)(J,{log:e.log}):(0,H.jsx)(U,{repo:e,info:t})]})}export{X as RepoGitRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$ as r,D as i,F as a,G as o,Ht as s,K as c,M as l,P as u,Wt as d,_t as ee,a as f,dt as te,gt as ne,i as p,it as re,lt as ie,nt as ae,tt as oe,zt as se}from"./centered-state-DzJJpXgm.js";import{r as m,t as h}from"./utils-CzkLr94M.js";import{n as g,t as ce}from"./loader-circle-Bnw4ga19.js";import{n as _,t as v}from"./trash-2-De8Z5Y5-.js";import{n as y,t as b}from"./folder-20ea3OVM.js";import{n as x,t as S}from"./tab-link-DkVxOa-q.js";import{t as C}from"./square-terminal-D9l_Xx7B.js";import{_ as le,a as ue,h as w,m as de,u as fe}from"./tasks-table-C5fwJmZ7.js";import{n as pe,t as me}from"./markdown-DxmCMr30.js";import{A as T,D as E,E as D,G as O,L as k,M as he,N as ge,O as A,P as j,R as M,U as N,V as P,_ as F,d as I,f as L,g as _e,h as ve,j as R,k as z,m as ye,n as be,p as xe,r as Se,t as Ce,v as we}from"./index-h4gyDJyh.js";var B=m(`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`}]]),Te=m(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Ee=m(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),De=m(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),V=m(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Oe=m(`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`}]]),ke=m(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ae=m(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),je=m(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),Me=m(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),H=m(`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`}]]),Ne=m(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),U=m(`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`}]]),Pe=m(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),Fe=m(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),Ie=m(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Le=m(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Re=m(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),ze=m(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Be=m(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),W=n(t(),1);function G(e){return e===`running`||e===`queued`||e===`waiting`}function K(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}var Ve=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/;function He(e,t){if(Ve.test(t))switch(e){case`codex`:return`codex resume ${t}`;case`opencode`:return`opencode --session ${t}`;default:return`claude --resume ${t}`}}function Ue(e){if(G(e.status))return;let t=K(e);if(t===void 0)return;let n=He(e.runner,t);if(n!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${n}`:n}function We(e){let t=/^cli:(claude|codex|opencode)$/.exec(e);return t?t[1]:void 0}function Ge(e,t){let n=We(t);return!n||G(e.status)?!1:n===(e.runner??`claude`)&&K(e)!==void 0}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 Ke(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 qe(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 Je({steps:e}){if(e.length===0)return null;let t=qe(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)(Ye,{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 Ye({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,Y.jsx)(De,{"aria-hidden":!0,className:h(t,`text-success`)});case`active`:return(0,Y.jsx)(ce,{role:`status`,"aria-label":`Step running`,className:h(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,Y.jsx)(Oe,{"aria-hidden":!0,className:h(t,`text-danger`)});case`pending`:return(0,Y.jsx)(P,{"aria-hidden":!0,className:h(t,`text-soft-foreground`)})}}function Z(e){let t=d();return s({mutationFn:()=>te(e),onSuccess:()=>t.invalidateQueries({queryKey:i.runs.all}),onError:e=>p(e.message,{tone:`danger`})})}function Q({run:e,planTally:t,tab:n=`session`}){let r=le(e),i=q(e),a=Ue(e),[o,s]=(0,W.useState)(!1),l=$e(e),u=c(),d=e.status===`queued`?de(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)(et,{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)(Ce,{dot:r.tone,pulse:r.pulse,children:[r.label,d===void 0?``:` #${d}`]}),(0,Y.jsx)(rt,{run:e,actions:l,onToggleNotes:()=>s(e=>!e)})]})]}),(0,Y.jsx)(tt,{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)(g,{"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)(Qe,{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":o,onClick:()=>s(e=>!e),children:[(0,Y.jsx)(H,{"aria-hidden":`true`}),`Notes`]}),i.archive?(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,onClick:()=>l.archive.mutate(),children:[e.archived?(0,Y.jsx)(B,{"aria-hidden":`true`}):(0,Y.jsx)(O,{"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)(V,{"aria-hidden":`true`}),`Cancel`]}):null,i.deleteRun?(0,Y.jsxs)(f,{variant:`danger-ghost`,size:`sm`,onClick:()=>l.setConfirming(`delete`),children:[(0,Y.jsx)(v,{"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)(Je,{steps:e.steps})}):null,a?(0,Y.jsx)(at,{hint:a}):null,o?(0,Y.jsx)(ot,{runId:e.id}):null]}),(0,Y.jsx)(it,{run:e,actions:l})]})}var Xe={folder:b,terminal:C,vscode:ke,cursor:Ie,zed:ge,windsurf:Be,sublime:Me,idea:je,pycharm:Fe,webstorm:U,goland:Re,rubymine:Ne,phpstorm:Ee,clion:Ae,rider:Te,"android-studio":ze,xcode:Pe,warp:Le,claude:N,codex:j,opencode:N};function Ze(e){return e.icon&&Xe[e.icon]||x}function Qe({run:e,canResume:t,onResume:n}){let r=u(),i=s({mutationFn:t=>ne(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)(D,{children:[(0,Y.jsx)(R,{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)(x,{"aria-hidden":`true`}),`Open in…`]})}),(0,Y.jsxs)(E,{align:`end`,children:[t?(0,Y.jsxs)(A,{"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)(T,{}):null,a.map(t=>{let n=Ge(e,t.id),r=Ze(t);return(0,Y.jsxs)(A,{"data-target":t.id,title:n?`Resume this run's session`:void 0,onSelect:()=>i.mutate(t.id),children:[(0,Y.jsx)(r,{"aria-hidden":`true`}),t.label,n?` (resume)`:``]},t.id)}),e.worktreePath?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(T,{}),(0,Y.jsxs)(A,{onSelect:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>p(`Worktree path copied`)).catch(()=>p(`Path: ${t}`))},children:[(0,Y.jsx)(_,{"aria-hidden":`true`}),`Copy worktree path`]})]}):null]})]})}function $e(e){let t=d(),n=se(),[a,o]=(0,W.useState)(null),c=()=>t.invalidateQueries({queryKey:i.runs.all}),l=e=>p(e.message,{tone:`danger`});return{finish:Z(e.id),continueRun:s({mutationFn:()=>re(e.id),onSuccess:c,onError:l}),archive:s({mutationFn:()=>oe(e.id,!e.archived),onSuccess:c,onError:l}),cancel:s({mutationFn:()=>ae(e.id),onSuccess:c,onError:l}),delete:s({mutationFn:()=>ie(e.id),onSuccess:()=>{c(),n(`/`)},onError:l}),terminal:s({mutationFn:()=>ee(e.id),onError:e=>{if(e instanceof r&&e.command){$(e.command,`No terminal found — command copied to clipboard.`);return}l(e)}}),confirming:a,setConfirming:o}}async function $(e,t){try{await navigator.clipboard.writeText(e),p(t)}catch{p(`Run manually: ${e}`)}}function et({run:e}){let t=a(e.id),n=w(e),r=Se(n,e=>t.mutate({title:e},{onError:e=>p(e.message,{tone:`danger`})}));return r.editing?(0,Y.jsx)(be,{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)(M,{className:`size-3.5`,"aria-hidden":`true`})})]})}function tt({run:e}){let t=[(0,Y.jsx)(`span`,{children:fe(e)},`workflow`)];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)(he,{stat:e.diffStat},`diff`));let n=[];return e.tokensUsed>0&&n.push((0,Y.jsxs)(`span`,{className:`tabular-nums`,children:[pe(e.tokensUsed),` tokens`]},`tokens`)),e.costUsd&&n.push((0,Y.jsx)(`span`,{className:`tabular-nums`,children:ue(e.costUsd)},`cost`)),(0,Y.jsxs)(`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)),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[n.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)),(0,Y.jsx)(nt,{run:e})]})]})}function nt({run:e}){let t=l(),n=e.runner??t.data?.defaultRunner??`claude`,r=e.model??`auto`;return(0,Y.jsxs)(D,{children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,"data-slot":`agent-badge`,title:`${n} · ${r}`,"aria-label":`Agent: ${n}, model ${r}`,className:`flex shrink-0 items-center justify-center rounded-sm p-1 text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Y.jsx)(N,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,Y.jsxs)(E,{align:`end`,className:`min-w-[9rem]`,children:[(0,Y.jsxs)(z,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`runner: `,n]}),(0,Y.jsxs)(z,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`model: `,r]})]})]})}function rt({run:e,actions:t,onToggleNotes:n}){let r=q(e);return(0,Y.jsxs)(D,{children:[(0,Y.jsx)(R,{asChild:!0,children:(0,Y.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":`Run actions`,className:`md:hidden`,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(E,{align:`end`,"data-slot":`run-actions-menu`,children:[r.finish?(0,Y.jsxs)(A,{onSelect:()=>t.finish.mutate(),children:[(0,Y.jsx)(g,{"aria-hidden":`true`}),` Finish`]}):null,r.continueRun?(0,Y.jsxs)(A,{onSelect:()=>t.continueRun.mutate(),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),` Continue`]}):null,r.terminal?(0,Y.jsxs)(A,{onSelect:()=>t.terminal.mutate(),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),` Terminal`]}):null,(0,Y.jsxs)(A,{onSelect:n,children:[(0,Y.jsx)(H,{"aria-hidden":`true`}),` Notes`]}),r.archive?(0,Y.jsxs)(A,{onSelect:()=>t.archive.mutate(),children:[e.archived?(0,Y.jsx)(B,{"aria-hidden":`true`}):(0,Y.jsx)(O,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,r.cancel||r.deleteRun?(0,Y.jsx)(T,{}):null,r.cancel?(0,Y.jsxs)(A,{variant:`destructive`,onSelect:()=>t.setConfirming(`cancel`),children:[(0,Y.jsx)(V,{"aria-hidden":`true`}),` Cancel`]}):null,r.deleteRun?(0,Y.jsxs)(A,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Y.jsx)(v,{"aria-hidden":`true`}),` Delete`]}):null]})]})}function it({run:e,actions:t}){let n=t.confirming;return(0,Y.jsx)(I,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Y.jsxs)(ye,{children:[(0,Y.jsxs)(F,{children:[(0,Y.jsx)(we,{children:n===`delete`?`Delete this task?`:`Cancel this task?`}),(0,Y.jsx)(ve,{children:n===`delete`?(0,Y.jsxs)(Y.Fragment,{children:[`This removes the run, its transcript, its worktree and its branch. There is no undo.`,(0,Y.jsx)(`span`,{className:`mt-1 block truncate font-medium text-foreground`,title:w(e),children:w(e)})]}):`The agent is stopped and the run completes as cancelled. The worktree stays.`})]}),(0,Y.jsxs)(_e,{children:[(0,Y.jsx)(xe,{children:`Keep it`}),(0,Y.jsx)(L,{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`:`Cancel the run`})]})]})})}function at({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)(_,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[`take over interactively: `,e]})]})}function ot({runId:e}){let t=o(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)(me,{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,H as l,Z as n,Ke as o,J as r,q as s,Q as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./bundle-mjs-BegPhL5c.js";import{Mt as t}from"./centered-state-DzJJpXgm.js";import{r as n,t as r}from"./utils-CzkLr94M.js";import{i,r as a,s as o,t as s}from"./dialog-Bf1Cpc3n.js";import{t as c}from"./markdown-DxmCMr30.js";import{i as l}from"./skills-B13iqWAN.js";var u=n(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),d=n(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),f=e();function p(e){return(0,f.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,f.jsx)(`path`,{d:`M12 1.9a10.1 10.1 0 0 0-3.2 19.7c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.6 2.4 1.1 3 .9.1-.7.4-1.1.6-1.4-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .9-.3 2.8 1a9.6 9.6 0 0 1 5 0c1.9-1.3 2.8-1 2.8-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.9v2.8c0 .3.2.6.7.5A10.1 10.1 0 0 0 12 1.9z`})})}function m({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]`,l({source:e})?`font-semibold text-foreground`:`text-soft-foreground`,t),children:e})}function h({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)(m,{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)(c,{children:e.body})})]})]})}function g({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)(h,{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 a,p as i,g as n,m as r,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./bundle-mjs-BegPhL5c.js";var t=e(),n=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`];function r({children:e}){return(0,t.jsx)(`span`,{className:`font-mono`,children:e})}function i(){return(0,t.jsx)(t.Fragment,{children:n.map((e,i)=>(0,t.jsxs)(`span`,{children:[i>0?i===n.length-1?`, or `:`, `:``,(0,t.jsx)(r,{children:e})]},e))})}function a(){return(0,t.jsxs)(t.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,t.jsx)(i,{}),` (agent mirrors like`,` `,(0,t.jsx)(r,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,t.jsx)(r,{children:`name`}),`,`,` `,(0,t.jsx)(r,{children:`description`}),`. Global (`,(0,t.jsx)(r,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh.`]})}function o(){return(0,t.jsxs)(t.Fragment,{children:[`No skills yet — drop Markdown files into `,(0,t.jsx)(i,{}),` (or a global/team-repo skill source).`]})}export{o as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{D as r,Et as i,Ht as a,J as o,Mt as s,Vt as c,Wt as l,Z as u,i as d,t as f}from"./centered-state-DzJJpXgm.js";import{t as p}from"./utils-CzkLr94M.js";import{t as m}from"./arrow-left-bEsJ-6jp.js";import{r as h,t as g}from"./skill-detail-DsD4-dGp.js";import{t as _}from"./refresh-cw-B4NW5q60.js";import{t as v}from"./triangle-alert-DJUyRhTV.js";import{d as y,i as b,n as x,o as S}from"./skills-B13iqWAN.js";import{N as C,P as w,i as T,u as E}from"./index-h4gyDJyh.js";import{t as D}from"./skill-empty-hint-Cl3ESoPu.js";var O=n(t(),1),k=e(),A=`__bm`;function j(){return(0,k.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,k.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,k.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,k.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,k.jsx)(M,{})]})}function M(){let e=o(),t=u(),[n]=c(),[h,b]=(0,O.useState)(``),j=l(),M=a({mutationFn:()=>i(),onSuccess:e=>{j.setQueryData(r.skills,e),d(`Team skills refreshed.`)},onError:e=>d(e.message,{tone:`danger`})});if(e.isError)return(0,k.jsx)(f,{icon:(0,k.jsx)(v,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let P=S(e.data??[]),F=n.get(`skill`),I=F===A?A:F!==null&&P.some(e=>e.name===F)?F:P[0]?.name??A,L=P.find(e=>e.name===I)??null,R=x(P,h);return(0,k.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,k.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))]`,F===null?`flex`:`hidden md:flex`),children:[(0,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,k.jsx)(E,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:h,onChange:e=>b(e.target.value),className:`h-8 text-[13px]`}),(0,k.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:M.isPending,onClick:()=>M.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,k.jsx)(_,{"aria-hidden":`true`,className:p(`size-3`,M.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,k.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,k.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):R.length>0?R.map(e=>(0,k.jsx)(N,{skill:e,active:I===e.name},e.path)):(0,k.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:P.length>0?`(no skills match)`:(0,k.jsx)(D,{})})}),(0,k.jsx)(`div`,{className:`shrink-0 border-t border-border p-2`,children:(0,k.jsxs)(s,{to:`/skills?skill=${A}`,"data-slot":`bookmarklets-row`,"aria-current":I===A?`page`:void 0,className:p(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,I===A&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(C,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,k.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,k.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,k.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})})]}),(0,k.jsx)(`section`,{"data-slot":`skills-detail`,className:p(`min-w-0 flex-1 flex-col`,F===null?`hidden md:flex`:`flex`),children:(0,k.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,k.jsxs)(s,{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,k.jsx)(m,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),I===A?(0,k.jsx)(T,{skills:P}):L?(0,k.jsx)(g,{skill:L,usedBy:y(t.data?.workflows??[],L.name)}):e.isPending?null:(0,k.jsx)(f,{icon:(0,k.jsx)(w,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})}function N({skill:e,active:t}){let n=b(e);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(s,{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,k.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(w,{"aria-hidden":`true`,className:p(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,k.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,k.jsx)(h,{source:e.source,className:`ml-auto`})]}),e.description?(0,k.jsx)(`span`,{className:`line-clamp-2 pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})})}export{j as SkillsRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=new Set([`ai`,`cezar`,`agents`]);function t(t){return e.has(t.source)}function n(e){return[...e].sort((e,n)=>Number(!t(e))-Number(!t(n)))}function r(e,n){return[...e].sort((e,r)=>Number(!t(e))-Number(!t(r))||i(n,r.name)-i(n,e.name))}function i(e,t){if(!e||!Object.hasOwn(e,t))return 0;let n=e[t];return typeof n==`number`?n:0}function a(e,t){return{...e,[t]:i(e,t)+1}}function o(e,t){if(t===``)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r){if(i=n.indexOf(e,i),i===-1)return!1;i+=1}return!0}function s(e,t){let n=[];for(let r of e)for(let e of r.steps??[])e.skill===t&&n.push(`${r.name} › ${e.name??e.id}`);return n}var c=/[\s\-/_.]/;function l(e,t){let n=0;for(let r=e.indexOf(t);r!==-1;r=e.indexOf(t,r+1)){let i=1,a=e[r-1];if(r===0||a!==void 0&&c.test(a)){let n=e[r+t.length];i=n===void 0||c.test(n)?3:2}if(i>n&&(n=i),n===3)break}return n}function u(e,t,n){let r=t.toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return 1;let i=[e,...n??[]].join(` `).toLowerCase(),a=0;for(let e of r){let t=l(i,e);if(t===0)return 0;a+=t}return a/(r.length*3)}function d(e,t){if(t===``)return 1;let n=e.toLowerCase(),r=t.toLowerCase();if(n===r)return 6;if(n.startsWith(r))return 5;let i=n.indexOf(r);if(i>0){let e=n[i-1];return e!==void 0&&c.test(e)?4:3}return+!!o(n,r)}function f(e,t){let n=e.split(`-`).filter(Boolean);return t?[...n,t]:n}var p=10;function m(e,t,n){let r=n.toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return 1;let i=0;for(let n of r){let r=d(e,n),a=t?d(t,n):0;if(r===0&&a===0)return 0;i+=r>0?r+p:a}return i}function h(e,t){return t.trim()===``?[...e]:e.map((e,n)=>({item:e,index:n,score:m(e.name,e.description,t)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||e.index-t.index).map(e=>e.item)}function g(e,t){return h(e,t)}function _(e,t){return h(e,t)}function v(e,t){return h(n(e),t)}export{u as a,g as c,s as d,t as i,_ as l,v as n,n as o,o as r,r as s,a as t,f as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./bundle-mjs-BegPhL5c.js";import{Mt as t}from"./centered-state-DzJJpXgm.js";import{r as n,t as r}from"./utils-CzkLr94M.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,onClick:i,children:o}){return(0,a.jsx)(t,{to:e,"aria-current":n?`page`:void 0,onClick:i,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:o})}export{i as n,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$ as r,B as i,Bt as a,D as o,Ht as s,M as c,St as l,Wt as u,_t as d,a as f,ht as p,i as m,kt as h,mt as g,rt as _,st as v,t as y,z as b}from"./centered-state-DzJJpXgm.js";import{a as x,i as S,t as C}from"./run-header-3CGn6FAM.js";import{a as w,i as T,n as E,r as D}from"./git-toolbar-DAlBoSP5.js";import{a as O,n as k,t as A}from"./use-desktop-6PwFeCW3.js";import{h as j}from"./tasks-table-C5fwJmZ7.js";import{a as M,i as N,o as P,r as F,s as I,t as L}from"./dialog-Bf1Cpc3n.js";import{S as R,b as z,o as B,s as V}from"./index-h4gyDJyh.js";var H=n(t(),1),U=e=>e===`running`||e===`queued`||e===`waiting`,W=`no worktree — this task ran directly in the repo working tree`;function G(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 — ${W}`)}function K(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 — ${W}`)}function q(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 — ${W}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?U(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 J(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:G(e),n=e.prUrl?[G(e),K(e)]:[K(e),q(e)],r=[];if(e.localHandoff){let t=e.hasSession?U(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 Y=e();function X({run:e,open:t,onOpenChange:n}){let r=u(),[i,a]=(0,H.useState)(``),c=j(e),l=(0,H.useRef)(c);l.current=c,(0,H.useEffect)(()=>{t&&a(l.current)},[t]);let d=s({mutationFn:t=>_(e.id,t),onSuccess:t=>{m(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:o.runs.changes(e.id)}),r.invalidateQueries({queryKey:o.runs.all})},onError:e=>m(e.message,{tone:`danger`})}),p=()=>{let e=i.trim();e.length===0||d.isPending||d.mutate(e)};return(0,Y.jsx)(L,{open:t,onOpenChange:n,children:(0,Y.jsxs)(F,{"data-slot":`commit-dialog`,children:[(0,Y.jsxs)(P,{children:[(0,Y.jsx)(I,{children:`Commit changes`}),(0,Y.jsxs)(N,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,Y.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,Y.jsx)(R,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{z({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,Y.jsxs)(M,{children:[(0,Y.jsx)(f,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Y.jsx)(f,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||d.isPending,onClick:p,children:d.isPending?`Committing…`:`Commit`})]})]})})}function Z(){let{id:e}=a(),t=b(e);return t.isPending?(0,Y.jsx)(V,{tab:`changes`}):t.isError?(0,Y.jsx)(B,{tab:`changes`,error:t.error}):(0,Y.jsx)(Q,{run:t.data})}function Q({run:e}){let t=c(),n=i(e.id,S(e.status)),a=A(),[f,g]=(0,H.useState)(`unified`),[_,b]=(0,H.useState)(!1),[j,M]=(0,H.useState)(null),[N,P]=(0,H.useState)(!1),F=u(),I=()=>F.invalidateQueries({queryKey:o.runs.all}),L=e=>m(e.message,{tone:`danger`}),R=s({mutationFn:()=>l(e.id),onSuccess:e=>m(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:L}),z=s({mutationFn:()=>v(e.id),onSuccess:e=>{m(`Draft PR created — ${e.url}`),I()},onError:L}),B=s({mutationFn:()=>d(e.id),onError:e=>{if(e instanceof r&&e.command){navigator.clipboard.writeText(e.command).then(()=>m(`No terminal found — command copied to clipboard.`)).catch(()=>m(`Run manually: ${e.command}`));return}L(e)}}),V=s({mutationFn:t=>p(e.id,t),onError:L}),U=n.isError&&n.error instanceof r&&n.error.status===409,W=J({status:e.status,hasWorktree:!!e.worktreePath&&!U,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:x(e)!==void 0,prUrl:e.pullRequestUrl}),G=e=>{switch(e){case`commit`:P(!0);break;case`push`:R.mutate();break;case`create-pr`:z.mutate();break;case`open-terminal`:B.mutate();break;case`view-pr`:break}},K=n.data?.files??[],q=(0,H.useMemo)(()=>D(K),[K]),Z=a?f:`unified`,Q=!a||_;return(0,Y.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Y.jsx)(C,{run:e,tab:`changes`}),(0,Y.jsx)(E,{bar:W,branch:e.branch,stat:n.data?.stat,mode:Z,wrap:Q,onModeChange:g,onWrapChange:b,onAction:G}),n.isPending?(0,Y.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,Y.jsx)(y,{icon:U?(0,Y.jsx)(w,{}):(0,Y.jsx)(O,{}),tone:U?`neutral`:`danger`,heading:`h2`,title:U?`No changes to show`:`Could not load the changes`,subtitle:n.error.message}):K.length===0?(0,Y.jsx)(y,{icon:(0,Y.jsx)(w,{}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,Y.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,Y.jsx)(`aside`,{className:`sticky top-40 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,Y.jsx)(T,{root:q,selected:j,onSelect:e=>{M(e),document.querySelector(`[data-slot="diff-file"][data-path="${CSS.escape(e)}"]`)?.scrollIntoView?.({block:`start`,behavior:`smooth`})}})}),(0,Y.jsx)(k,{files:K,mode:Z,wrap:Q,loadFileText:t=>$(e.id,t),imageSrc:t=>h(e.id,t),onOpenInApp:t.data?.capabilities.localHandoff?e=>V.mutate(e):void 0,className:`min-w-0 flex-1`})]}),(0,Y.jsx)(X,{run:e,open:N,onOpenChange:P})]})}async function $(e,t){try{let n=await g(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{Z as TaskChangesRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$ as r,Bt as i,H as a,Mt as o,V as s,a as c,t as l,z as u}from"./centered-state-DzJJpXgm.js";import{i as d,t as f}from"./run-header-3CGn6FAM.js";import{t as p}from"./arrow-left-bEsJ-6jp.js";import{a as m,i as h,n as g,t as _}from"./use-desktop-6PwFeCW3.js";import{t as v}from"./search-x-C6xG26dv.js";import{t as y}from"./triangle-alert-DJUyRhTV.js";import{M as b,o as x,s as S}from"./index-h4gyDJyh.js";var C=n(t(),1),w=e();function T(){let{id:e}=i(),t=u(e);return t.isPending?(0,w.jsx)(S,{tab:`changes`}):t.isError?(0,w.jsx)(x,{tab:`changes`,error:t.error}):(0,w.jsx)(E,{run:t.data})}function E({run:e}){let{sha:t}=i(),n=a(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)(l,{icon:(0,w.jsx)(m,{}),tone:n.error instanceof r&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof r&&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)(l,{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)(o,{"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=s(e,t),i=_(),[a,u]=(0,C.useState)(`unified`),[d,f]=(0,C.useState)(!1),x=n.isError&&n.error instanceof r&&n.error.status===409,S=i?a:`unified`,T=!i||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)(c,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,w.jsxs)(o,{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:a,wrap:d,onModeChange:u,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)(l,{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)(l,{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 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{$ as r,Bt as i,W as a,kt as o,t as s,z as c}from"./centered-state-DzJJpXgm.js";import{r as l,t as u}from"./utils-CzkLr94M.js";import{t as d}from"./run-header-3CGn6FAM.js";import{t as f}from"./folder-20ea3OVM.js";import{t as p}from"./file-tuE95HNX.js";import{t as m}from"./triangle-alert-DJUyRhTV.js";import{i as h,n as g,r as _}from"./highlighter-ZVyRi_Cx.js";import{H as v,o as y,s as b}from"./index-h4gyDJyh.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=n(t(),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 i=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(i.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(i.isError){let e=i.error instanceof r&&i.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:i.error.message})})}return i.data.type===`file`?(0,M.jsx)(P,{runId:e,entry:i.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:o(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
|
-
`).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)(v,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform`,o&&`rotate-90`)}),(0,M.jsx)(f,{"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:p;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}=i(),t=c(e);return t.isPending?(0,M.jsx)(b,{tab:`files`}):t.isError?(0,M.jsx)(y,{tab:`files`,error:t.error}):(0,M.jsx)(W,{run:t.data})}function W({run:e}){let t=a(e.id,``),[n,i]=(0,D.useState)(null),o=t.isError&&t.error instanceof r&&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:o?(0,M.jsx)(w,{}):(0,M.jsx)(m,{}),tone:o?`neutral`:`danger`,heading:`h2`,title:o?`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:i})}),(0,M.jsx)(N,{runId:e.id,path:n,className:`min-w-0 flex-1`})]})]})}export{U as TaskFilesRoute};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{$ as i,Bt as a,D as o,Ht as s,K as c,Lt as l,Mt as u,Wt as d,a as f,i as p,it as m,n as h,q as g,st as _,t as v,z as y}from"./centered-state-DzJJpXgm.js";import{n as b,r as x,t as S}from"./utils-CzkLr94M.js";import{c as C,l as w,n as T,o as E,r as D,s as O,t as ee}from"./run-header-3CGn6FAM.js";import{n as te,t as k}from"./loader-circle-Bnw4ga19.js";import{d as ne,u as re}from"./command-eBgVGftz.js";import{n as ie,t as ae}from"./trash-2-De8Z5Y5-.js";import{n as oe}from"./tab-link-DkVxOa-q.js";import{d as se,f as ce}from"./prompt-templates-CsGr-FXH.js";import{t as le}from"./git-pull-request-BztcgsRZ.js";import{t as ue}from"./search-x-C6xG26dv.js";import{t as de}from"./square-terminal-D9l_Xx7B.js";import{c as fe,y as pe}from"./tasks-table-C5fwJmZ7.js";import{i as A,n as j,r as M,t as me}from"./run-diff-BKpV1kGk.js";import{t as he}from"./markdown-DxmCMr30.js";import{H as N,L as ge,S as _e,U as ve,W as ye,a as be,b as xe,y as Se}from"./index-h4gyDJyh.js";import{t as Ce}from"./zoomable-image-B-76XMUw.js";var we=x(`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`}]]),Te=x(`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`}]]),Ee=x(`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`}]]),De=x(`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`}]]),Oe=x(`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`}]]),ke=x(`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`}]]),Ae=x(`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=r(n(),1),je=[`run-event`,`ui-event`];function Me(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 Ne(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=Date.now(),c,l=e=>{s=Date.now();let t=Me(e.data);!t||!(t.seq>r)||(r=t.seq,n(e=>[...e,t]))},u=()=>{s=Date.now()},d=()=>{o||a!==void 0||(a=setTimeout(()=>{a=void 0,o||f()},1500))},f=()=>{i?.close(),s=Date.now(),i=new t(`/api/runs/${encodeURIComponent(e)}/events`);for(let e of je)i.addEventListener(e,l);i.addEventListener(`ping`,u),i.addEventListener(`error`,()=>{i?.readyState===2&&d()})},p=()=>{document.visibilityState===`visible`&&(!i||i.readyState===2)&&(clearTimeout(a),a=void 0,f())},m=()=>{clearTimeout(a),a=void 0,i?.close()},h=e=>{e.persisted&&f()};return c=setInterval(()=>{o||document.visibilityState!==`visible`||Date.now()-s<=4e4||(clearTimeout(a),a=void 0,f())},1e4),document.addEventListener(`visibilitychange`,p),window.addEventListener(`pagehide`,m),window.addEventListener(`pageshow`,h),f(),()=>{o=!0,clearTimeout(a),clearInterval(c),document.removeEventListener(`visibilitychange`,p),window.removeEventListener(`pagehide`,m),window.removeEventListener(`pageshow`,h),i?.close()}},[e]),t}var F=e=>e.kind===`tool`,Pe=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,Fe=(e,t,n)=>`${e} ${e===1?t:n}`;function Ie(e,t){let n=[];return e>0&&n.push(Fe(e,`file`,`files`)),t>0&&n.push(Fe(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function Le(e){return`${e} earlier tool call${e===1?``:`s`}`}var Re=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function ze(e){for(let t of Re)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 Be(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)),n=new Set(t.filter(F).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:Ie(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)F(e)&&Pe(e)&&!r.has(e.id)?o.push(e):(s(),F(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 I=e(),L=new Map,Ve=(0,P.createContext)(null);function He(){return(0,P.useContext)(Ve)}function Ue({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,I.jsx)(Ve.Provider,{value:n,children:t})}function R(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function We(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var Ge=new Map;function Ke(e,t){Ge.set(e,t)}function qe(e){return Ge.get(e)}var Je=new Map;function Ye(e,t){Je.set(e,t)}function Xe(e,t){let n=Je.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,I.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,I.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:n.map(e=>(0,I.jsx)(Ce,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e))}):null,r>0?(0,I.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[r,` image`,r>1?`s`:``,` attached`]}):null]})}function Ze({text:e}){return(0,I.jsx)(`div`,{"data-slot":`assistant-message`,className:`min-w-0 text-[15px] leading-[1.65]`,children:(0,I.jsx)(he,{children:e})})}function Qe({note:e}){return(0,I.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:S(`px-0.5 text-xs`,e.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:`· `,e.text]})}function $e({text:e}){let t=e.split(`
|
|
2
|
-
`,1)[0]??``,n=t.length<e.length;return(0,I.jsxs)(j,{"data-slot":`reasoning`,className:`min-w-0`,children:[(0,I.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,I.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Thinking — `,(0,I.jsx)(`em`,{className:`text-muted-foreground not-italic`,children:t}),n?`…`:``]})]}),(0,I.jsx)(M,{children:(0,I.jsx)(`div`,{className:`px-6 py-1.5 text-[13px] leading-[1.6] whitespace-pre-wrap text-soft-foreground`,children:e})})]})}var et={read:w,edit:ke,delete:ae,move:Ee,search:re,execute:de,think:we,fetch:C,task:ve,plan:De,other:Ae},tt=e=>e.split(`
|
|
3
|
-
`).length;function nt({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=tt(e),s=!t&&!n&&o>12;return(0,I.jsxs)(`div`,{"data-slot":`tool-output`,"data-clamped":s?`true`:void 0,children:[(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`div`,{ref:i,onScroll:t?e=>{a.current=R(e.currentTarget)}:void 0,className:S(`overflow-x-auto`,t&&`max-h-[216px] overflow-y-auto`,s&&`max-h-[216px] overflow-y-hidden`),children:(0,I.jsx)(`pre`,{className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre text-muted-foreground`,children:e})}),s?(0,I.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,I.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 rt({diffs:e}){return(0,I.jsx)(I.Fragment,{children:e.map((e,t)=>(0,I.jsxs)(`div`,{"data-slot":`diff-preview`,className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`border-b border-border/50 px-4 py-1.5 font-mono text-[11px] text-soft-foreground`,children:e.path}),(0,I.jsx)(`pre`,{className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:e.unified===void 0?[...it(e.oldText).map((e,t)=>(0,I.jsxs)(`span`,{className:`block bg-diff-del px-4 text-muted-foreground`,children:[`- `,e]},`old-${t}`)),...it(e.newText).map((e,t)=>(0,I.jsxs)(`span`,{className:`block bg-diff-add px-4`,children:[`+ `,e]},`new-${t}`))]:e.unified.split(`
|
|
4
|
-
`).map((e,t)=>(0,I.jsx)(at,{text:e},t))})]},`${e.path}:${t}`))})}function it(e){return e==null||e===``?[]:e.replace(/\n$/,``).split(`
|
|
5
|
-
`)}function at({text:e}){return(0,I.jsx)(`span`,{className:S(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del text-muted-foreground`,e.startsWith(`@@`)&&`text-soft-foreground`),children:e})}function ot(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=He(),[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??ot(e)),{verb:u,detail:d}=ze(e.title),f=et[e.toolKind]??Ae;return(0,I.jsxs)(j,{"data-slot":`tool-card`,"data-status":e.status,"data-kind":e.toolKind,open:l,onOpenChange:o,className:S(`min-w-0 overflow-hidden rounded-md border bg-card`,e.status===`failed`?`border-danger/40`:`border-border`),children:[(0,I.jsxs)(A,{disabled:!c,className:`group flex min-h-[28px] w-full items-center gap-1.5 px-2.5 py-0.5 text-left text-[13px] enabled:hover:bg-muted`,children:[(0,I.jsx)(N,{"aria-hidden":!0,className:S(`size-3 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`,!c&&`invisible`)}),(0,I.jsx)(f,{"aria-hidden":!0,className:S(`size-3.5 shrink-0`,e.status===`failed`?`text-danger`:`text-muted-foreground`)}),(0,I.jsx)(`span`,{className:S(`shrink-0 font-semibold`,s&&`shimmer`,e.status===`failed`&&`text-danger`,e.status===`declined`&&`text-muted-foreground`),children:u}),d===void 0?null:(0,I.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:d}),(0,I.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[s?(0,I.jsx)(k,{role:`status`,"aria-label":`Running`,className:`size-3.5 animate-spin text-soft-foreground`}):null,e.status===`failed`?(0,I.jsx)(`span`,{className:`text-xs text-danger`,children:`failed`}):null,e.status===`declined`?(0,I.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`declined`}):null,e.toolKind===`execute`&&typeof e.exitCode==`number`?(0,I.jsx)(`span`,{"data-slot":`tool-exit`,className:S(`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,I.jsx)(M,{children:(0,I.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[e.error!==void 0&&e.error!==``?(0,I.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,I.jsx)(rt,{diffs:e.diffs}):null,e.output!==void 0&&e.output!==``?(0,I.jsx)(nt,{text:e.output,streaming:s}):null,t.length>0?(0,I.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,I.jsx)(st,{entry:e,scope:n},e.id))}):null]})})]})}function st({entry:e,scope:t}){switch(e.kind){case`message`:return(0,I.jsx)(Ze,{text:e.text});case`reasoning`:return(0,I.jsx)($e,{text:e.text});case`tool`:return(0,I.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`});case`note`:return(0,I.jsx)(Qe,{note:e});case`image`:return(0,I.jsx)(ut,{image:e})}}function ct({group:e,scope:t}){return(0,I.jsxs)(j,{"data-slot":`ctx-group`,className:`min-w-0`,children:[(0,I.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,I.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,I.jsx)(M,{children:(0,I.jsx)(`div`,{className:`flex flex-col gap-1.5 pt-1.5 pl-4`,children:e.tools.map(e=>(0,I.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`},e.id))})})]})}function lt({count:e,children:t}){return(0,I.jsxs)(j,{"data-slot":`tool-streak`,className:`min-w-0`,children:[(0,I.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,I.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),Le(e)]}),(0,I.jsx)(M,{children:(0,I.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:t})})]})}function ut({image:e}){return(0,I.jsx)(Ce,{"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 dt=new Map;function ft(){return typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches}function pt(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.filter(e=>e.status!==`cancelled`).length}}function mt(e){return e.find(e=>e.status===`in_progress`)??e.find(e=>e.status===`pending`)}function ht({runId:e,entries:t}){let[n,r]=(0,P.useState)(()=>dt.get(e)??ft());if(t.length===0)return null;let{done:i,total:a}=pt(t),o=mt(t);return(0,I.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,I.jsx)(`div`,{"aria-hidden":!0,"data-slot":`grad-edge`,className:`h-[3px]`,style:{background:`var(--grad)`}}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(t=>(dt.set(e,!t),!t)),"aria-expanded":n,className:S(`flex w-full items-center gap-2 px-3.5 text-left text-[13px]`,n?`pt-2 pb-1.5`:`py-2`),children:[(0,I.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Plan`}),(0,I.jsxs)(`span`,{"data-slot":`plan-count`,className:`shrink-0 text-muted-foreground tabular-nums`,children:[`· `,i,`/`,a]}),!n&&o!==void 0?(0,I.jsxs)(`span`,{"data-slot":`plan-current`,className:`min-w-0 truncate text-muted-foreground`,children:[`— `,o.activeForm??o.content]}):null,(0,I.jsx)(ne,{"aria-hidden":!0,className:S(`ml-auto size-3.5 shrink-0 text-soft-foreground transition-transform`,!n&&`rotate-180`)})]}),n?(0,I.jsx)(`ul`,{"data-slot":`plan-list`,className:`flex flex-col gap-[7px] px-3.5 pb-3`,children:t.map((e,t)=>(0,I.jsx)(gt,{entry:e},`${t}:${e.content}`))}):null]})}function gt({entry:e}){return(0,I.jsxs)(`li`,{"data-slot":`plan-item`,"data-status":e.status,className:S(`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`,e.status===`cancelled`&&`text-soft-foreground/70 line-through`),children:[(0,I.jsx)(_t,{status:e.status}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.content}),e.status===`in_progress`?(0,I.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 _t({status:e}){return e===`cancelled`?(0,I.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground/70`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`,opacity:`.5`}),(0,I.jsx)(`path`,{d:`m8.5 15.5 7-7`})]}):e===`completed`?(0,I.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,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,I.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`in_progress`?(0,I.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,I.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,I.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]}):(0,I.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,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})})}function vt({run:e}){return(0,I.jsxs)(`section`,{"data-slot":`review-panel`,"aria-label":`Review the changes`,className:`flex flex-col gap-3`,children:[(0,I.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,I.jsx)(ce,{className:`size-4 shrink-0 text-violet`,"aria-hidden":`true`}),(0,I.jsxs)(`p`,{className:`min-w-0 text-[13px]`,children:[(0,I.jsx)(`span`,{className:`font-semibold`,children:`Review the changes before anything lands.`}),` `,(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Read the diff, send notes back, draft a PR — or accept. Nothing merges on its own.`})]})]}),(0,I.jsx)(me,{runId:e.id}),(0,I.jsx)(yt,{run:e})]})}function yt({run:e}){let t=d(),n=(0,P.useRef)(null),[r,a]=(0,P.useState)(``),[c,l]=(0,P.useState)(null),u=T(e.id),h=()=>t.invalidateQueries({queryKey:o.runs.all}),g=s({mutationFn:t=>m(e.id,`Review feedback:\n${t}`),onSuccess:()=>{a(``),h()},onError:e=>p(e.message,{tone:`danger`})}),v=s({mutationFn:()=>_(e.id),onSuccess:e=>{p(`Draft PR created — ${e.url}`),h()},onError:e=>{e instanceof i&&e.manual!==void 0&&l(e.manual),p(e.message,{tone:`danger`})}}),y=()=>{let e=r.trim();if(e.length===0){p(`Write what to change first.`),n.current?.focus();return}g.mutate(e)};return(0,I.jsxs)(`div`,{"data-slot":`review-actions`,className:`flex flex-col gap-2`,children:[(0,I.jsx)(_e,{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=>{xe({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(),y())},className:`min-h-[52px] text-[13px]`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(f,{"data-slot":`review-send-back`,variant:`outline`,size:`sm`,title:`Send the notes back into the agent's session`,disabled:g.isPending,onClick:y,children:[(0,I.jsx)(Te,{"aria-hidden":`true`}),`Send back`]}),b(e.pullRequestUrl)?(0,I.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.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,I.jsx)(oe,{"aria-hidden":`true`}),`PR ↗`]})}):(0,I.jsxs)(f,{"data-slot":`review-draft-pr`,variant:`outline`,size:`sm`,title:`Push the branch and open a draft PR`,disabled:v.isPending,onClick:()=>v.mutate(),children:[(0,I.jsx)(le,{"aria-hidden":`true`}),`Draft PR`]}),(0,I.jsxs)(f,{"data-slot":`review-accept`,variant:`contrast`,size:`sm`,className:`ml-auto`,title:D(`review`),disabled:u.isPending,onClick:()=>u.mutate(),children:[(0,I.jsx)(te,{"aria-hidden":`true`}),`Accept`]})]}),c===null?null:(0,I.jsx)(bt,{command:c})]})}function bt({command:e}){return(0,I.jsxs)(`button`,{type:`button`,"data-slot":`review-manual`,title:`Copy the command`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>p(`Command copied to clipboard.`)).catch(()=>p(`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,I.jsx)(ie,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,I.jsxs)(`span`,{className:`truncate`,children:[`manual path: `,e]})]})}function xt(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var St=1500;function Ct({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`||xt())return;r(!0);let i=setTimeout(()=>r(!1),St);return()=>clearTimeout(i)},[e]),n?(0,I.jsxs)(`div`,{"data-slot":`accept-celebration`,"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 isolate z-40`,children:[(0,I.jsx)(h,{}),(0,I.jsx)(`div`,{className:`flex justify-center pt-24`,children:(0,I.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 wt=r(t(),1),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,I.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,I.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,wt.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,I.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=qe(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&&Ke(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,I.jsx)(on,{runId:e,rows:t,controls:r}):(0,I.jsx)(`div`,{ref:r.attachContent,"data-slot":`thread-rows`,"data-virtualized":`false`,children:t.map(e=>(0,I.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-2.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)(()=>Xe(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&&=(Ye(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,I.jsx)(`div`,{ref:e=>{r.current=e,n.attachContent(e)},"data-slot":`thread-rows`,"data-virtualized":`true`,children:(0,I.jsx)(nn,{ref:s,scrollRef:n.scrollElRef,startMargin:c,...i===void 0?{}:{cache:i},children:t.map(e=>(0,I.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-2.5`,children:e.node},e.key))})})}function sn({onJump:e}){return(0,I.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,I.jsx)(ye,{"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`:case`taskcreate`:case`taskupdate`:case`tasklist`: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){let t=e.replace(/\s*CEZ:DONE\s*$/,``).replace(/\s*CEZ:MONITORING\s*$/,``);return t.includes(`CEZ:`)?t.split(`
|
|
6
|
-
`).filter(e=>!/^CEZ:(?:PR=\d+|ISSUE=\d+|TITLE=.+)\s*$/.test(e)).join(`
|
|
7
|
-
`):t}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`,`cancelled`]);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}=a(),t=y(e),n=Ne(e),r=(0,P.useMemo)(()=>Sn(n),[n]);if(t.isPending)return(0,I.jsx)(be,{});if(t.isError){let e=t.error instanceof i&&t.error.status===404;return(0,I.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,I.jsx)(v,{icon:e?(0,I.jsx)(ue,{}):(0,I.jsx)(Oe,{}),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,I.jsx)(f,{asChild:!0,variant:`outline`,children:(0,I.jsx)(u,{to:`/`,children:`Back to tasks`})})})})}return(0,I.jsx)(Tn,{run:t.data,thread:r})}function wn(e,t){let n=[];e.task&&n.push({key:`task`,node:(0,I.jsx)(z,{text:e.task,images:e.taskImages??[]})});for(let e of t.turns){e.userMessage&&n.push({key:`${e.id}:user`,node:(0,I.jsx)(z,{text:e.userMessage.text,imageCount:e.userMessage.imageCount,images:e.userMessage.images})});for(let t of Be(e.items))n.push({key:`${e.id}:${t.id}`,node:(0,I.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?pt(r):void 0,a=e.status===`running`||e.status===`waiting`,o=g(e.id),s=(0,P.useMemo)(()=>wn(e,t),[e,t]),{search:c}=l(),u=We(c,s.length),d=rn(e.id);return se(d.restickIfStuck),(0,I.jsxs)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:[(0,I.jsx)(ee,{run:e,planTally:i}),(0,I.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,I.jsx)(Ue,{runId:e.id,children:(0,I.jsx)(an,{runId:e.id,rows:s,mode:u,controls:d})}),t.turns.length===0?e.status===`queued`?(0,I.jsx)(Dn,{run:e}):(0,I.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,I.jsxs)(`div`,{"data-slot":`thread-footer`,"data-state":n.state,className:S(`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,b(fe(e))?(0,I.jsx)(`a`,{"data-slot":`pr-link`,href:fe(e),target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`PR ↗`}):null]}):null,e.status===`review`?(0,I.jsx)(vt,{run:e}):null]}),(0,I.jsx)(Ct,{status:e.status}),(0,I.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:[d.pillVisible?(0,I.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 -top-12 flex justify-center`,children:(0,I.jsx)(sn,{onJump:d.jumpToLatest})}):null,(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-col gap-2.5`,children:[r!==void 0&&r.length>0?(0,I.jsx)(ht,{runId:e.id,entries:r},e.id):null,e.status===`waiting`?(0,I.jsxs)(`div`,{"data-slot":`paused-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,I.jsx)(pe,{tone:`pending`,pulse:!0}),`The agent is paused, waiting for your reply`]}):null,(0,I.jsx)(Se,{onSubmit:(e,t)=>o.mutateAsync({text:e,images:t}),disabled:!a,disabledReason:`Session closed — Continue to reopen.`,disabledAction:(0,I.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=d(),n=s({mutationFn:()=>m(e.id),onSuccess:()=>t.invalidateQueries({queryKey:o.runs.all}),onError:e=>p(e.message,{tone:`danger`})});return O(e).continueRun?(0,I.jsxs)(f,{type:`button`,variant:`outline`,size:`sm`,disabled:n.isPending,onClick:()=>n.mutate(),children:[(0,I.jsx)(ge,{"aria-hidden":`true`,className:`size-3.5`}),`Continue`]}):null}function Dn({run:e}){let t=E(c().data??[],e.id);return(0,I.jsxs)(`div`,{"data-slot":`queued-state`,className:`flex flex-col items-center gap-1.5 py-10 text-center`,children:[(0,I.jsx)(pe,{tone:`pending`,pulse:!0}),(0,I.jsxs)(`p`,{className:`text-[13px] font-medium`,children:[`Waiting for a free agent slot`,t===void 0?``:` — #${t} in queue`]}),(0,I.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,I.jsx)(kn,{entry:e.entry,scope:t});case`tool-card`:return(0,I.jsx)(B,{item:e.item,nested:e.children,cacheKey:`${t}:${e.id}`});case`context-group`:return(0,I.jsx)(ct,{group:e,scope:t});case`streak`:return(0,I.jsx)(lt,{count:e.count,children:e.blocks.map(e=>(0,I.jsx)(On,{block:e,scope:t},e.id))})}}function kn({entry:e,scope:t}){switch(e.kind){case`message`:return e.role===`assistant`?(0,I.jsx)(Ze,{text:e.text}):(0,I.jsx)(z,{text:e.text});case`reasoning`:return(0,I.jsx)($e,{text:e.text});case`tool`:return(0,I.jsx)(B,{item:e,cacheKey:`${t}:${e.id}`});case`note`:return(0,I.jsx)(Qe,{note:e});case`image`:return(0,I.jsx)(ut,{image:e})}}export{Cn as TaskThreadRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,s as t}from"./bundle-mjs-BegPhL5c.js";import{E as n}from"./centered-state-DzJJpXgm.js";import{t as r}from"./utils-CzkLr94M.js";t();var i=e(),a=n(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,neutral:`bg-soft-foreground`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function o({className:e,tone:t=`neutral`,pulse:n=!1,...o}){return(0,i.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:r(a({tone:t,pulse:n,className:e})),...o})}var s={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function c(e){return!1}function l(e){return!1}function u(e){return c(e)?{bucket:`permission`,tone:`violet`,pulse:!0,label:`needs permission`}:e.status===`failed`?{bucket:`error`,tone:`danger`,pulse:!1,label:`failed`}:e.status===`waiting`?{bucket:`waiting`,tone:`pending`,pulse:!0,label:`needs you`}:e.status===`review`?{bucket:`waiting`,tone:`violet`,pulse:!0,label:`needs review`}:e.status===`running`&&e.activity===`monitoring`?{bucket:`running`,tone:`violet`,pulse:!0,label:`monitoring`}:e.status===`running`?{bucket:`running`,tone:`violet`,pulse:!0,label:`running`}:l(e)?{bucket:`unseen`,tone:`violet`,pulse:!1,label:`unseen`}:e.status===`queued`?{bucket:`none`,tone:`neutral`,pulse:!1,label:`queued`}:e.status===`done`?{bucket:`none`,tone:`success`,pulse:!1,label:`done`}:{bucket:`none`,tone:`neutral`,pulse:!1,label:`cancelled`}}function d(e){return s[u(e).bucket]<=s.waiting}var f=[`Needs you`,`Working`,`Recent`,`Archived`],p={waiting:0,review:1,running:2,queued:3},m=e=>p[e.status]??9;function h(e,t){return t===`archived`?`Archived`:e.status===`waiting`||e.status===`review`?`Needs you`:e.status===`running`||e.status===`queued`?`Working`:`Recent`}function g(e){return e.titleSummary??e.title}function _(e){return e.title.replace(/ \([A-C]\)$/,``)}function v(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function y(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,t)=>{let n=m(e)-m(t);return n===0?t.createdAt.localeCompare(e.createdAt):n})}function b(e,t){let n=v(e),r=y(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(h(e,t),{kind:`group`,groupId:e.groupId,title:_(e),members:n});continue}}a(h(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return f.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function x(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,(i.status===`waiting`||i.status===`review`)&&(r+=1)}return{active:t,archived:n,waiting:r}}var S=new Set([`running`,`waiting`]),C=new Set([`done`,`failed`,`review`,`cancelled`]),w=new Set([`done`,`failed`,`cancelled`]);function T(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function E(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function D(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function O(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[g(e),e.branch??``,e.workflow,D(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function k(e){return e.filter(e=>!e.archived&&w.has(e.status)).length}function A(e){return e.pullRequestUrl??e.referencedPullRequestUrl}function j(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function M(e,t){let n=S.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:T(n.rssBytes),kind:`live`}};let r=T(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function N(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>C.has(e.status))?[]:[{groupId:e,title:_(n),count:t.length}]})}export{u as _,E as a,A as c,b as d,_ as f,y as g,g as h,k as i,M as l,v as m,N as n,T as o,x as p,O as r,j as s,C as t,D as u,d as v,o as y};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-Cqc8LRkj.js","assets/bundle-mjs-BegPhL5c.js","assets/utils-CzkLr94M.js","assets/highlighter-ZVyRi_Cx.js","assets/index-h4gyDJyh.js","assets/centered-state-DzJJpXgm.js","assets/skill-detail-DsD4-dGp.js","assets/dialog-Bf1Cpc3n.js","assets/x-DaR4ZfE-.js","assets/dist-M2QYGAcm.js","assets/markdown-DxmCMr30.js","assets/chunk-BO2N2NFS-BN7h-q1E.js","assets/lib-uHpeUPzK.js","assets/skills-B13iqWAN.js","assets/loader-circle-Bnw4ga19.js","assets/command-eBgVGftz.js","assets/prompt-templates-CsGr-FXH.js","assets/dist-ZAIqO3UX.js","assets/search-x-C6xG26dv.js","assets/triangle-alert-DJUyRhTV.js","assets/tasks-table-C5fwJmZ7.js","assets/index-DlKq8gF4.css","assets/image-preview-Ca0UgThg.js","assets/zoomable-image-B-76XMUw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,i as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{a as i}from"./centered-state-DzJJpXgm.js";import{r as a,t as o}from"./utils-CzkLr94M.js";import{B as s,M as c}from"./index-h4gyDJyh.js";import{n as l,t as u}from"./image-preview-Ca0UgThg.js";var d=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`}]]),f=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`}]]),p=e();function m({mode:e,wrap:t,onModeChange:n,onWrapChange:r}){return(0,p.jsxs)(p.Fragment,{children:[(0,p.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,p.jsx)(h,{current:e,value:`unified`,onModeChange:n}),(0,p.jsx)(h,{current:e,value:`split`,onModeChange:n})]}),(0,p.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,p.jsx)(f,{"aria-hidden":`true`})})]})}function h({current:e,value:t,onModeChange:n}){let r=e===t;return(0,p.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 g({branch:e}){return(0,p.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,p.jsx)(s,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,p.jsx)(`span`,{className:`truncate`,children:e})]})}var _=r(n(),1);function v(e){let[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!1;return t(()=>import(`./diff-view-Cqc8LRkj.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,20,21,22,23])),()=>{e=!0}},[]),e.files.length===0?(0,p.jsx)(`p`,{"data-slot":`diff-empty`,className:o(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,p.jsx)(y,{...e}):n===null?(0,p.jsx)(`p`,{"data-slot":`diff-loading`,className:o(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,p.jsx)(n.View,{...e})}function y({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,className:i}){let a={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length};return(0,p.jsxs)(`div`,{"data-slot":`diff`,"data-fallback":`true`,className:o(`flex min-w-0 flex-col gap-3`,i),children:[(0,p.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,p.jsxs)(`span`,{children:[a.files,` `,a.files===1?`file`:`files`,` changed`]}),(0,p.jsx)(c,{stat:a})]}),e.map(e=>(0,p.jsx)(b,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function b({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){return(0,p.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,p.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,p.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,p.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,p.jsx)(c,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),l(e)?(0,p.jsx)(u,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,p.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,p.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,p.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,p.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 x(){let[e,t]=(0,_.useState)(()=>typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches);return(0,_.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{d as a,m as i,v as n,g as r,x as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,s as t,t as n,u as r}from"./bundle-mjs-BegPhL5c.js";var i=r(t(),1),a=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),o=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),c=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},l={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},u=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},d=(0,i.createContext)({}),f=()=>(0,i.useContext)(d),p=(0,i.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o=``,children:s,iconNode:c,...d},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=f()??{},y=r??g?Number(n??h)*24/Number(t??m):n??h;return(0,i.createElement)(`svg`,{ref:p,...l,width:t??m??l.width,height:t??m??l.height,stroke:e??_,strokeWidth:y,className:a(`lucide`,v,o),...!s&&!u(d)&&{"aria-hidden":`true`},...d},[...c.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),m=(e,t)=>{let n=(0,i.forwardRef)(({className:n,...r},s)=>(0,i.createElement)(p,{ref:s,iconNode:t,className:a(`lucide-${o(c(e))}`,`lucide-${e}`,n),...r}));return n.displayName=c(e),n},h=n({extend:{classGroups:{shadow:[`shadow-modal`]}}});function g(...t){return h(e(t))}function _(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}export{_ as n,m as r,g as t};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{$ as i,Bt as a,D as o,Ht as s,J as c,Wt as l,X as u,Z as d,a as f,ct as p,i as m,t as h,ut as g,vt as _,xt as v}from"./centered-state-DzJJpXgm.js";import{r as y,t as b}from"./utils-CzkLr94M.js";import{n as x}from"./loader-circle-Bnw4ga19.js";import{n as S,t as C}from"./trash-2-De8Z5Y5-.js";import{t as w}from"./square-terminal-D9l_Xx7B.js";import{t as ee}from"./triangle-alert-DJUyRhTV.js";import{t as te}from"./upload-yxUM9nk5.js";import{t as T}from"./x-DaR4ZfE-.js";import{i as ne,s as re}from"./skills-B13iqWAN.js";import{I as ie,P as ae,S as E,W as D,_ as oe,c as se,d as O,f as ce,g as k,h as le,m as A,p as ue,u as j,v as de,z as M}from"./index-h4gyDJyh.js";import{n as fe}from"./skill-empty-hint-Cl3ESoPu.js";var pe=y(`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`}]]),me=y(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),he=r(t()),N=r(n());function ge(){var e=[...arguments];return(0,N.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var P=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function F(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function I(e){return`nodeType`in e}function L(e){return e?F(e)?e:I(e)?e.ownerDocument?.defaultView??window:window:window}function R(e){let{Document:t}=L(e);return e instanceof t}function _e(e){return!F(e)&&e instanceof L(e).HTMLElement}function ve(e){return e instanceof L(e).SVGElement}function z(e){return e?F(e)?e.document:I(e)?R(e)?e:_e(e)||ve(e)?e.ownerDocument:document:document:document}var B=P?N.useLayoutEffect:N.useEffect;function ye(e){let t=(0,N.useRef)(e);return B(()=>{t.current=e}),(0,N.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function be(){let e=(0,N.useRef)(null);return[(0,N.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,N.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function xe(e,t){t===void 0&&(t=[e]);let n=(0,N.useRef)(e);return B(()=>{n.current!==e&&(n.current=e)},t),n}function V(e,t){let n=(0,N.useRef)();return(0,N.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function H(e){let t=ye(e),n=(0,N.useRef)(null);return[n,(0,N.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Se(e){let t=(0,N.useRef)();return(0,N.useEffect)(()=>{t.current=e},[e]),t.current}var U={};function Ce(e,t){return(0,N.useMemo)(()=>{if(t)return t;let n=U[e]==null?0:U[e]+1;return U[e]=n,e+`-`+n},[e,t])}function we(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 Te=we(1),Ee=we(-1);function De(e){return`clientX`in e&&`clientY`in e}function W(e){if(!e)return!1;let{KeyboardEvent:t}=L(e.target);return t&&e instanceof t}function G(e){if(!e)return!1;let{TouchEvent:t}=L(e.target);return t&&e instanceof t}function Oe(e){if(G(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 De(e)?{x:e.clientX,y:e.clientY}:null}var K=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[K.Translate.toString(e),K.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ke=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ae(e){return e.matches(ke)?e:e.querySelector(ke)}var je={display:`none`};function Me(e){let{id:t,value:n}=e;return N.createElement(`div`,{id:t,style:je},n)}function Ne(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return N.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 Pe(){let[e,t]=(0,N.useState)(``);return{announce:(0,N.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Fe=(0,N.createContext)(null);function Ie(e){let t=(0,N.useContext)(Fe);(0,N.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Le(){let[e]=(0,N.useState)(()=>new Set),t=(0,N.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,N.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Re={draggable:`
|
|
2
|
-
To pick up a draggable item, press the space bar.
|
|
3
|
-
While dragging, use the arrow keys to move the item.
|
|
4
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},ze={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Be(e){let{announcements:t=ze,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Re}=e,{announce:a,announcement:o}=Pe(),s=Ce(`DndLiveRegion`),[c,l]=(0,N.useState)(!1);if((0,N.useEffect)(()=>{l(!0)},[]),Ie((0,N.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=N.createElement(N.Fragment,null,N.createElement(Me,{id:r,value:i.draggable}),N.createElement(Ne,{id:s,announcement:o}));return n?(0,he.createPortal)(u,n):u}var q;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(q||={});function Ve(){}function He(e,t){return(0,N.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Ue(){var e=[...arguments];return(0,N.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var J=Object.freeze({x:0,y:0});function We(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Ge(e,t){let n=Oe(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Ke(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function qe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Je(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Ye(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Xe(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var Ze=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Xe(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=We(Xe(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Ke)},Qe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Je(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Je(r),o=i.reduce((e,t,r)=>e+We(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Ke)};function $e(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var et=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=$e(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(qe)};function tt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function nt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:J}function rt(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var it=rt(1);function at(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ot(e,t,n){let r=at(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var st={ignoreTransform:!1};function ct(e,t){t===void 0&&(t=st);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=L(e).getComputedStyle(e);t&&(n=ot(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function lt(e){return ct(e,{ignoreTransform:!0})}function ut(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function dt(e,t){return t===void 0&&(t=L(e).getComputedStyle(e)),t.position===`fixed`}function ft(e,t){t===void 0&&(t=L(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function pt(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(R(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!_e(i)||ve(i)||n.includes(i))return n;let a=L(e).getComputedStyle(i);return i!==e&&ft(i,a)&&n.push(i),dt(i,a)?n:r(i.parentNode)}return e?r(e):n}function mt(e){let[t]=pt(e,1);return t??null}function ht(e){return!P||!e?null:F(e)?e:I(e)?R(e)||e===z(e).scrollingElement?window:_e(e)?e:null:null}function gt(e){return F(e)?e.scrollX:e.scrollLeft}function _t(e){return F(e)?e.scrollY:e.scrollTop}function vt(e){return{x:gt(e),y:_t(e)}}var Y;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Y||={});function yt(e){return!P||!e?!1:e===document.scrollingElement}function bt(e){let t={x:0,y:0},n=yt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var xt={x:.2,y:.2};function St(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=xt);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=bt(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Y.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Y.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Y.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Y.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Ct(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function wt(e){return e.reduce((e,t)=>Te(e,vt(t)),J)}function Tt(e){return e.reduce((e,t)=>e+gt(t),0)}function Et(e){return e.reduce((e,t)=>e+_t(t),0)}function Dt(e,t){if(t===void 0&&(t=ct),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);mt(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Ot=[[`x`,[`left`,`right`],Tt],[`y`,[`top`,`bottom`],Et]],kt=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=pt(t),r=wt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Ot)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},At=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function jt(e){let{EventTarget:t}=L(e);return e instanceof t?e:z(e)}function Mt(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var X;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(X||={});function Nt(e){e.preventDefault()}function Pt(e){e.stopPropagation()}var Z;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Z||={});var Ft={start:[Z.Space,Z.Enter],cancel:[Z.Esc],end:[Z.Space,Z.Enter,Z.Tab]},It=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Z.Right:return{...n,x:n.x+25};case Z.Left:return{...n,x:n.x-25};case Z.Down:return{...n,y:n.y+25};case Z.Up:return{...n,y:n.y-25}}},Lt=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new At(z(t)),this.windowListeners=new At(L(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(X.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Dt(n),t(J)}handleKeyDown(e){if(W(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Ft,coordinateGetter:a=It,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:J;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Ee(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=bt(n),p=Ct(n),m={x:Math.min(i===Z.Right?p.right-p.width/2:p.right,Math.max(i===Z.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Z.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Z.Down?p.top:p.top+p.height/2,u.y))},h=i===Z.Right&&!s||i===Z.Left&&!c,g=i===Z.Down&&!l||i===Z.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Z.Right&&e<=d.x||i===Z.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===Z.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Z.Down&&e<=d.y||i===Z.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===Z.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Te(Ee(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Lt.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Ft,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Rt(e){return!!(e&&`distance`in e)}function zt(e){return!!(e&&`delay`in e)}var Bt=class{constructor(e,t,n){n===void 0&&(n=jt(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=z(i),this.documentListeners=new At(this.document),this.listeners=new At(n),this.windowListeners=new At(L(i)),this.initialCoordinates=Oe(r)??J,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.DragStart,Nt),this.windowListeners.add(X.VisibilityChange,this.handleCancel),this.windowListeners.add(X.ContextMenu,Nt),this.documentListeners.add(X.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zt(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Rt(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(X.Click,Pt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(X.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Oe(e)??J,s=Ee(n,o);if(!t&&a){if(Rt(a)){if(a.tolerance!=null&&Mt(s,a.tolerance))return this.handleCancel();if(Mt(s,a.distance))return this.handleStart()}if(zt(a)&&Mt(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Z.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Vt={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Ht=class extends Bt{constructor(e){let{event:t}=e,n=z(t.target);super(e,Vt,n)}};Ht.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Ut={move:{name:`mousemove`},end:{name:`mouseup`}},Wt;(function(e){e[e.RightClick=2]=`RightClick`})(Wt||={});var Gt=class extends Bt{constructor(e){super(e,Ut,z(e.event.target))}};Gt.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Wt.RightClick?!1:(r?.({event:n}),!0)}}];var Kt={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},qt=class extends Bt{constructor(e){super(e,Kt)}static setup(){return window.addEventListener(Kt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Kt.move.name,e)};function e(){}}};qt.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Jt;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Jt||={});var Yt;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Yt||={});function Xt(e){let{acceleration:t,activator:n=Jt.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Yt.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Qt({delta:d,disabled:!a}),[m,h]=be(),g=(0,N.useRef)({x:0,y:0}),_=(0,N.useRef)({x:0,y:0}),v=(0,N.useMemo)(()=>{switch(n){case Jt.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Jt.DraggableRect:return i}},[n,i,c]),y=(0,N.useRef)(null),b=(0,N.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,N.useMemo)(()=>s===Yt.TreeOrder?[...l].reverse():l,[s,l]);(0,N.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=St(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var Zt={x:{[Y.Backward]:!1,[Y.Forward]:!1},y:{[Y.Backward]:!1,[Y.Forward]:!1}};function Qt(e){let{delta:t,disabled:n}=e,r=Se(t);return V(e=>{if(n||!r||!e)return Zt;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Y.Backward]:e.x[Y.Backward]||i.x===-1,[Y.Forward]:e.x[Y.Forward]||i.x===1},y:{[Y.Backward]:e.y[Y.Backward]||i.y===-1,[Y.Forward]:e.y[Y.Forward]||i.y===1}}},[n,t,r])}function $t(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return V(e=>t==null?null:r??e??null,[r,t])}function en(e,t){return(0,N.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var tn;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(tn||={});var nn;(function(e){e.Optimized=`optimized`})(nn||={});var rn=new Map;function an(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,N.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,N.useRef)(e),d=g(),f=xe(d),p=(0,N.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,N.useRef)(null),h=V(t=>{if(d&&!n)return rn;if(!t||t===rn||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new kt(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,N.useEffect)(()=>{u.current=e},[e]),(0,N.useEffect)(()=>{d||p()},[n,d]),(0,N.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,N.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case tn.Always:return!1;case tn.BeforeDragging:return n;default:return!n}}}function on(e,t){return V(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function sn(e,t){return on(e,t)}function cn(e){let{callback:t,disabled:n}=e,r=ye(t),i=(0,N.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,N.useEffect)(()=>()=>i?.disconnect(),[i]),i}function ln(e){let{callback:t,disabled:n}=e,r=ye(t),i=(0,N.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,N.useEffect)(()=>()=>i?.disconnect(),[i]),i}function un(e){return new kt(ct(e),e)}function dn(e,t,n){t===void 0&&(t=un);let[r,i]=(0,N.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=cn({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=ln({callback:a});return B(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function fn(e){return nt(e,on(e))}var pn=[];function mn(e){let t=(0,N.useRef)(e),n=V(n=>e?n&&n!==pn&&e&&t.current&&e.parentNode===t.current.parentNode?n:pt(e):pn,[e]);return(0,N.useEffect)(()=>{t.current=e},[e]),n}function hn(e){let[t,n]=(0,N.useState)(null),r=(0,N.useRef)(e),i=(0,N.useCallback)(e=>{let t=ht(e.target);t&&n(e=>e?(e.set(t,vt(t)),new Map(e)):null)},[]);return(0,N.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=ht(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,vt(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{ht(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,N.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Te(e,t),J):wt(e):J,[e,t])}function gn(e,t){t===void 0&&(t=[]);let n=(0,N.useRef)(null);return(0,N.useEffect)(()=>{n.current=null},t),(0,N.useEffect)(()=>{let t=e!==J;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ee(e,n.current):J}function _n(e){(0,N.useEffect)(()=>{if(!P)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function vn(e,t){return(0,N.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function yn(e){return(0,N.useMemo)(()=>e?ut(e):null,[e])}var bn=[];function xn(e,t){t===void 0&&(t=ct);let[n]=e,r=yn(n?L(n):null),[i,a]=(0,N.useState)(bn);function o(){a(()=>e.length?e.map(e=>yt(e)?r:new kt(t(e),e)):bn)}let s=ln({callback:o});return B(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Sn(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _e(t)?t:e}function Cn(e){let{measure:t}=e,[n,r]=(0,N.useState)(null),i=ln({callback:(0,N.useCallback)(e=>{for(let{target:n}of e)if(_e(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=H((0,N.useCallback)(e=>{let n=Sn(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,N.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var wn=[{sensor:Ht,options:{}},{sensor:Lt,options:{}}],Tn={current:{}},En={draggable:{measure:lt},droppable:{measure:lt,strategy:tn.WhileDragging,frequency:nn.Optimized},dragOverlay:{measure:ct}},Dn=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},On={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ve},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:En,measureDroppableContainers:Ve,windowRect:null,measuringScheduled:!1},kn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Ve,draggableNodes:new Map,over:null,measureDroppableContainers:Ve},An=(0,N.createContext)(kn),jn=(0,N.createContext)(On);function Mn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dn}}}function Nn(e,t){switch(t.type){case q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case q.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case q.DragEnd:case q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case q.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Dn(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case q.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Dn(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case q.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Dn(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Pn(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,N.useContext)(An),a=Se(r),o=Se(n?.id);return(0,N.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!W(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Ae(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Fn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function In(e){return(0,N.useMemo)(()=>({draggable:{...En.draggable,...e?.draggable},droppable:{...En.droppable,...e?.droppable},dragOverlay:{...En.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ln(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,N.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;B(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=nt(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=mt(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Rn=(0,N.createContext)({...J,scaleX:1,scaleY:1}),zn;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(zn||={});var Bn=(0,N.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=wn,collisionDetection:o=et,measuring:s,modifiers:c,...l}=e,[u,d]=(0,N.useReducer)(Nn,void 0,Mn),[f,p]=Le(),[m,h]=(0,N.useState)(zn.Uninitialized),g=m===zn.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,N.useRef)({initial:null,translated:null}),C=(0,N.useMemo)(()=>_==null?null:{id:_,data:x?.data??Tn,rect:S},[_,x]),w=(0,N.useRef)(null),[ee,te]=(0,N.useState)(null),[T,ne]=(0,N.useState)(null),re=xe(l,Object.values(l)),ie=Ce(`DndDescribedBy`,t),ae=(0,N.useMemo)(()=>b.getEnabled(),[b]),E=In(s),{droppableRects:D,measureDroppableContainers:oe,measuringScheduled:se}=an(ae,{dragging:g,dependencies:[y.x,y.y],config:E.droppable}),O=$t(v,_),ce=(0,N.useMemo)(()=>T?Oe(T):null,[T]),k=Ae(),le=sn(O,E.draggable.measure);Ln({activeNode:_==null?null:v.get(_),config:k.layoutShiftCompensation,initialRect:le,measure:E.draggable.measure});let A=dn(O,E.draggable.measure,le),ue=dn(O?O.parentElement:null),j=(0,N.useRef)({activatorEvent:null,active:null,activeNode:O,collisionRect:null,collisions:null,droppableRects:D,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=b.getNodeFor(j.current.over?.id),M=Cn({measure:E.dragOverlay.measure}),fe=M.nodeRef.current??O,pe=g?M.rect??A:null,me=!!(M.nodeRef.current&&M.rect),ge=fn(me?null:A),P=yn(fe?L(fe):null),F=mn(g?de??O:null),I=xn(F),R=Fn(c,{transform:{x:y.x-ge.x,y:y.y-ge.y,scaleX:1,scaleY:1},activatorEvent:T,active:C,activeNodeRect:A,containerNodeRect:ue,draggingNodeRect:pe,over:j.current.over,overlayNodeRect:M.rect,scrollableAncestors:F,scrollableAncestorRects:I,windowRect:P}),_e=ce?Te(ce,y):null,ve=hn(F),z=gn(ve),ye=gn(ve,[A]),be=Te(R,z),V=pe?it(pe,R):null,H=C&&V?o({active:C,collisionRect:V,droppableRects:D,droppableContainers:ae,pointerCoordinates:_e}):null,Se=Ye(H,`id`),[U,we]=(0,N.useState)(null),Ee=tt(me?R:Te(R,ye),U?.rect??null,A),De=(0,N.useRef)(null),W=(0,N.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:j,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=re.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=re.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=re.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,he.unstable_batchedUpdates)(()=>{r?.(i),h(zn.Initializing),d({type:q.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),te(De.current),ne(a)})},onMove(e){d({type:q.DragMove,coordinates:e})},onEnd:s(q.DragEnd),onCancel:s(q.DragCancel)});De.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=j.current,o=null;if(t&&i){let{cancelDrop:s}=re.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===q.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=q.DragCancel)}w.current=null,(0,he.unstable_batchedUpdates)(()=>{d({type:e}),h(zn.Uninitialized),we(null),te(null),ne(null),De.current=null;let t=e===q.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=re.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),G=en(a,(0,N.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,W(n,t))},[v,W]));_n(a),B(()=>{A&&m===zn.Initializing&&h(zn.Initialized)},[A,m]),(0,N.useEffect)(()=>{let{onDragMove:e}=re.current,{active:t,activatorEvent:n,collisions:r,over:i}=j.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:be.x,y:be.y},over:i};(0,he.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[be.x,be.y]),(0,N.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=j.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=re.current,o=r.get(Se),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,he.unstable_batchedUpdates)(()=>{we(s),a?.(c),f({type:`onDragOver`,event:c})})},[Se]),B(()=>{j.current={activatorEvent:T,active:C,activeNode:O,collisionRect:V,collisions:H,droppableRects:D,draggableNodes:v,draggingNode:fe,draggingNodeRect:pe,droppableContainers:b,over:U,scrollableAncestors:F,scrollAdjustedTranslate:be},S.current={initial:pe,translated:V}},[C,O,H,V,v,fe,pe,D,b,U,F,be]),Xt({...k,delta:y,draggingRect:V,pointerCoordinates:_e,scrollableAncestors:F,scrollableAncestorRects:I});let K=(0,N.useMemo)(()=>({active:C,activeNode:O,activeNodeRect:A,activatorEvent:T,collisions:H,containerNodeRect:ue,dragOverlay:M,draggableNodes:v,droppableContainers:b,droppableRects:D,over:U,measureDroppableContainers:oe,scrollableAncestors:F,scrollableAncestorRects:I,measuringConfiguration:E,measuringScheduled:se,windowRect:P}),[C,O,A,T,H,ue,M,v,b,D,U,oe,F,I,E,se,P]),ke=(0,N.useMemo)(()=>({activatorEvent:T,activators:G,active:C,activeNodeRect:A,ariaDescribedById:{draggable:ie},dispatch:d,draggableNodes:v,over:U,measureDroppableContainers:oe}),[T,G,C,A,d,ie,v,U,oe]);return N.createElement(Fe.Provider,{value:p},N.createElement(An.Provider,{value:ke},N.createElement(jn.Provider,{value:K},N.createElement(Rn.Provider,{value:Ee},i)),N.createElement(Pn,{disabled:n?.restoreFocus===!1})),N.createElement(Be,{...n,hiddenTextDescribedById:ie}));function Ae(){let e=ee?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Vn=(0,N.createContext)(null),Hn=`button`,Un=`Draggable`;function Wn(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Ce(Un),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,N.useContext)(An),{role:p=Hn,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,N.useContext)(g?Rn:Vn),[v,y]=H(),[b,x]=H(),S=vn(o,t),C=xe(n);return B(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,N.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Hn?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Gn(){return(0,N.useContext)(jn)}var Kn=`Droppable`,qn={timeout:25};function Jn(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Ce(Kn),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,N.useContext)(An),u=(0,N.useRef)({disabled:n}),d=(0,N.useRef)(!1),f=(0,N.useRef)(null),p=(0,N.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...qn,...i},_=xe(h??r),v=ln({callback:(0,N.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=H((0,N.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=xe(t);return(0,N.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,N.useEffect)(()=>(s({type:q.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:q.UnregisterDroppable,key:a,id:r})),[r]),(0,N.useEffect)(()=>{n!==u.current.disabled&&(s({type:q.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Yn(e){let{animation:t,children:n}=e,[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(null),s=Se(n);return!n&&!r&&s&&i(s),B(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),N.createElement(N.Fragment,null,n,r?(0,N.cloneElement)(r,{ref:o}):null)}var Xn={x:0,y:0,scaleX:1,scaleY:1};function Zn(e){let{children:t}=e;return N.createElement(An.Provider,{value:kn},N.createElement(Rn.Provider,{value:Xn},t))}var Qn={position:`fixed`,touchAction:`none`},$n=e=>W(e)?`transform 250ms ease`:void 0,er=(0,N.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=$n}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Qn,width:s.width,height:s.height,top:s.top,left:s.left,transform:K.Transform.toString(d),transformOrigin:i&&r?Ge(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return N.createElement(n,{className:o,style:f,ref:t},a)}),tr={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:K.Transform.toString(t)},{transform:K.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function nr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return ye((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=Sn(a);if(!c)return;let{transform:l}=L(a).getComputedStyle(a),u=at(l);if(!u)return;let d=typeof t==`function`?t:rr(t);return Dt(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function rr(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...tr,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var ir=0;function ar(e){return(0,N.useMemo)(()=>{if(e!=null)return ir++,ir},[e])}var or=N.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=Gn(),S=(0,N.useContext)(Rn),C=ar(d?.id),w=Fn(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),ee=on(f),te=nr({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),T=ee?g.setRef:void 0;return N.createElement(Zn,null,N.createElement(Yn,{animation:te},d&&C?N.createElement(er,{key:C,id:d.id,ref:T,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:ee,style:{zIndex:l,...i},transform:w},n):null))});function sr(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function cr(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function lr(e){return e!==null&&e>=0}function ur(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function dr(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var fr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=sr(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},pr={scaleX:1,scaleY:1},mr=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...pr}:null}let s=hr(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...pr}:r<t&&r>=a?{x:0,y:o.height+s,...pr}:{x:0,y:0,...pr}};function hr(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var gr=`Sortable`,_r=N.createContext({activeIndex:-1,containerId:gr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fr,disabled:{draggable:!1,droppable:!1}});function vr(e){let{children:t,id:n,items:r,strategy:i=fr,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Gn(),d=Ce(gr,n),f=s.rect!==null,p=(0,N.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,N.useRef)(p),v=!ur(p,_.current),y=g!==-1&&h===-1||v,b=dr(a);B(()=>{v&&m&&u(p)},[v,p,m,u]),(0,N.useEffect)(()=>{_.current=p},[p]);let x=(0,N.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:cr(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return N.createElement(_r.Provider,{value:x},t)}var yr=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return sr(n,r,i).indexOf(t)},br=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},xr={duration:200,easing:`ease`},Sr=`transform`,Cr=K.Transition.toString({property:Sr,duration:0,easing:`linear`}),wr={roleDescription:`sortable`};function Tr(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,N.useState)(null),s=(0,N.useRef)(n);return B(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ct(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,N.useEffect)(()=>{a&&o(null)},[a]),a}function Er(e){let{animateLayoutChanges:t=br,attributes:n,disabled:r,data:i,getNewIndex:a=yr,id:o,strategy:s,resizeObserverConfig:c,transition:l=xr}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,N.useContext)(_r),y=Dr(r,p),b=u.indexOf(o),x=(0,N.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,N.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:ee,setNodeRef:te}=Jn({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:T,activatorEvent:ne,activeNodeRect:re,attributes:ie,setNodeRef:ae,listeners:E,isDragging:D,over:oe,setActivatorNodeRef:se,transform:O}=Wn({id:o,data:x,attributes:{...wr,...n},disabled:y.draggable}),ce=ge(te,ae),k=!!T,le=k&&!m&&lr(f)&&lr(g),A=!_&&D,ue=le?(A&&le?O:null)??(s??v)({rects:h,activeNodeRect:re,activeIndex:f,overIndex:g,index:b}):null,j=lr(f)&&lr(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,de=T?.id,M=(0,N.useRef)({activeId:de,items:u,newIndex:j,containerId:d}),fe=u!==M.current.items,pe=t({active:T,containerId:d,isDragging:D,isSorting:k,id:o,index:b,items:u,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:l,wasDragging:M.current.activeId!=null}),me=Tr({disabled:!pe,index:b,node:w,rect:C});return(0,N.useEffect)(()=>{k&&M.current.newIndex!==j&&(M.current.newIndex=j),d!==M.current.containerId&&(M.current.containerId=d),u!==M.current.items&&(M.current.items=u)},[k,j,d,u]),(0,N.useEffect)(()=>{if(de===M.current.activeId)return;if(de!=null&&M.current.activeId==null){M.current.activeId=de;return}let e=setTimeout(()=>{M.current.activeId=de},50);return()=>clearTimeout(e)},[de]),{active:T,activeIndex:f,attributes:ie,data:x,rect:C,index:b,newIndex:j,items:u,isOver:ee,isSorting:k,isDragging:D,listeners:E,node:w,overIndex:g,over:oe,setNodeRef:ce,setActivatorNodeRef:se,setDroppableNodeRef:te,setDraggableNodeRef:ae,transform:me??ue,transition:he()};function he(){if(me||fe&&M.current.newIndex===b)return Cr;if(!(A&&!W(ne)||!l)&&(k||pe))return K.Transition.toString({...l,property:Sr})}}function Dr(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function Or(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var kr=[Z.Down,Z.Right,Z.Up,Z.Left],Ar=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(kr.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case Z.Down:r.top<a.top&&t.push(n);break;case Z.Up:r.top>a.top&&t.push(n);break;case Z.Left:r.left>a.left&&t.push(n);break;case Z.Right:r.left<a.left&&t.push(n);break}});let c=Qe({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Ye(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=pt(c).some((e,t)=>s[t]!==e),i=jr(e,t),a=Mr(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:Ee(u,l)}}}};function jr(e,t){return!Or(e)||!Or(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Mr(e,t){return!Or(e)||!Or(t)||!jr(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Nr(e){let t=[];for(let n of e){if(n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.model||n.runner||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Pr(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function Fr(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function Ir(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Lr(e,t){return e.filter((e,n)=>n!==t)}function Q(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function Rr(e,t,n){let r=` `.repeat(n);return t.includes(`
|
|
6
|
-
`)?[`${r}${e}: |`,...t.split(`
|
|
7
|
-
`).map(e=>`${r} ${e}`)]:[`${r}${e}: ${Q(t)}`]}function zr(e,t,n){let r=[`name: ${Q(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...Rr(`description`,t.trim(),0));let i=Nr(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${Q(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(` - id: ${Q(e.id)}`),e.name&&e.name!==e.id&&r.push(` name: ${Q(e.name)}`),e.skill&&r.push(` skill: ${Q(e.skill)}`),e.prompt&&r.push(...Rr(`prompt`,e.prompt,4)),e.model&&r.push(` model: ${Q(e.model)}`),e.runner&&r.push(` runner: ${Q(e.runner)}`),e.allowedTools&&r.push(` allowedTools: [${e.allowedTools.map(Q).join(`, `)}]`),e.bashAllowlist&&r.push(` bashAllowlist: [${e.bashAllowlist.map(Q).join(`, `)}]`),e.command&&r.push(...Rr(`command`,e.command,4)),e.onFail&&r.push(` onFail:`,` retry: ${Q(e.onFail.retry)}`,` max: ${e.onFail.max??2}`)}else r.push(`skills: []`);return`${r.join(`
|
|
8
|
-
`)}\n`}function Br(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function Vr(e){let t=Nr(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Hr(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ur(e,t,n){let r=Nr(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var $=e(),Wr=`wb-canvas`;function Gr(){return{name:`my-workflow`,description:``,steps:[]}}function Kr(e){return{name:e.name,description:e.description??``,steps:structuredClone(e.steps??[])}}function qr(){let{name:e}=a();return(0,$.jsx)(Jr,{routeName:e},e??``)}function Jr({routeName:e}){let t=d(),n=c(),r=u(),a=l(),[y,S]=(0,N.useState)(null),[w,T]=(0,N.useState)(``),[ne,ie]=(0,N.useState)(!1),[D,M]=(0,N.useState)(``),[fe,he]=(0,N.useState)(``),[ge,P]=(0,N.useState)(!1),[F,I]=(0,N.useState)(``),[L,R]=(0,N.useState)(!1),[_e,ve]=(0,N.useState)(!1),[z,B]=(0,N.useState)(null),[ye,be]=(0,N.useState)(null),xe=(0,N.useRef)(null),V=t.data?.workflows??[],H=n.data??[],Se=re(H,r.data?.skillUsage);(0,N.useEffect)(()=>{if(y!==null||t.data===void 0)return;let n=t.data.workflows,r=(e?n.find(t=>t.name===e):void 0)??n.find(e=>e.source===`file`);S(r?Kr(r):Gr())},[y,t.data,e]);let U=e=>S(t=>t===null?t:{...t,steps:e}),Ce=s({mutationFn:e=>_(e),onSuccess:e=>{S({name:e.name,description:e.description??``,steps:e.steps}),ie(!1),M(``),he(``),m(`Imported "${e.name}" — review, then Save.`)},onError:e=>he(e.message)}),we=s({mutationFn:e=>v(e),onSuccess:e=>{S(t=>{let n=t??Gr(),{name:r,steps:i}=Hr(e,n.name);return{...n,name:r,steps:i}}),P(!1),I(``),m(e.fallback?`Planner unavailable — added a single step. Edit, then Save.`:`Built "${e.name??y?.name??`workflow`}" — review, tweak, then Save.`,e.fallback?{tone:`danger`}:void 0)},onError:e=>m(e instanceof Error?e.message:String(e),{tone:`danger`})}),Te=s({mutationFn:e=>p({...Ur(y?.name??``,y?.description??``,y?.steps??[]),...e?{overwrite:!0}:{}}),onSuccess:e=>{R(!1),m(`Saved — ${e.path.split(`/`).pop()??e.path}`),a.invalidateQueries({queryKey:o.workflows})},onError:e=>{e instanceof i&&e.exists===!0?R(!0):m(e instanceof Error?e.message:String(e),{tone:`danger`})}}),Ee=s({mutationFn:e=>g(e),onSuccess:(e,t)=>{ve(!1),m(`Deleted "${t}".`),S(Gr()),a.invalidateQueries({queryKey:o.workflows})},onError:e=>{ve(!1),m(e instanceof Error?e.message:String(e),{tone:`danger`})}}),De=Ue(He(Ht,{activationConstraint:{distance:4}}),He(Lt,{coordinateGetter:Ar}));if(t.isError)return(0,$.jsx)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(h,{icon:(0,$.jsx)(ee,{}),tone:`danger`,title:`Could not load workflows`,subtitle:t.error.message})});if(y===null)return(0,$.jsx)(se,{});let W=y.steps,G=y.name.trim(),Oe=V.find(e=>e.name===G&&e.source===`file`),K=zr(y.name,y.description,W),ke=(e,t=W.length)=>{if(W.length>=8){m(`A workflow holds at most 8 steps.`,{tone:`danger`});return}U(Fr(W,Pr(e,W),t))},Ae=e=>{let t=e.active.data.current;B(t??null)},je=e=>{be(e.over?String(e.over.id):null)},Me=e=>{B(null),be(null);let{active:t,over:n}=e;if(n===null)return;let r=t.data.current;if(r?.type===`palette`){let e=n.id===Wr?W.length:W.findIndex(e=>e.id===n.id);ke(r.skill,e===-1?W.length:e);return}if(n.id===t.id)return;let i=W.findIndex(e=>e.id===t.id),a=W.findIndex(e=>e.id===n.id);i!==-1&&a!==-1&&U(Ir(W,i,a))},Ne=()=>{let e=D.trim();e!==``&&Ce.mutate(e)},Pe=()=>{let e=F.trim();e===``||we.isPending||we.mutate(e)};return(0,$.jsxs)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:[(0,$.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,$.jsx)(`h1`,{className:`text-base font-semibold`,children:`Workflows`}),(0,$.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Portable skill chains — the agent applies them top to bottom.`})]}),(0,$.jsxs)(Bn,{sensors:De,collisionDetection:Ze,onDragStart:Ae,onDragOver:je,onDragEnd:Me,onDragCancel:()=>{B(null),be(null)},children:[(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col gap-6 p-3 pb-[calc(90px+env(safe-area-inset-bottom))] md:flex-row md:p-5 md:pb-5`,children:[(0,$.jsxs)(`section`,{"data-slot":`wb-main`,className:`mx-auto w-full min-w-0 max-w-3xl flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,$.jsx)(j,{ref:xe,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:y.name,onChange:e=>S({...y,name:e.target.value}),className:`h-8 max-w-56 font-mono text-[13px] font-semibold`}),(0,$.jsx)(`span`,{"data-slot":`wb-count`,className:`shrink-0 font-mono text-xs text-soft-foreground`,children:Vr(W)})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[Oe?(0,$.jsxs)(f,{type:`button`,variant:`danger-ghost`,size:`sm`,"data-slot":`wb-delete`,title:`Delete the saved workflow file`,onClick:()=>ve(!0),children:[(0,$.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null,(0,$.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":ge,title:`Describe a chain — the agent builds it`,onClick:()=>{ie(!1),P(e=>!e)},children:[(0,$.jsx)(me,{"aria-hidden":`true`,className:`size-3`}),`Auto`]}),(0,$.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,onClick:()=>{he(``),P(!1),ie(e=>!e)},children:[(0,$.jsx)(te,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,$.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,title:`Download workflow.yaml`,onClick:()=>{let e=new Blob([K],{type:`text/yaml`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${Br(y.name)}.yaml`,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)},children:[(0,$.jsx)(pe,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,$.jsxs)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-save`,disabled:Te.isPending,onClick:()=>{if(G===``){xe.current?.focus();return}if(W.length===0){m(`Add at least one step first.`,{tone:`danger`});return}Te.mutate(!1)},children:[(0,$.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),`Save`]})]})]}),(0,$.jsxs)(`div`,{"data-slot":`wb-load`,className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`mr-0.5 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`edit`}),V.map(e=>(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-load-chip`,"data-name":e.name,title:e.description??``,"aria-pressed":G===e.name,onClick:()=>S(Kr(e)),className:b(`rounded-full border border-border bg-card px-2.5 py-1 font-mono text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,G===e.name&&`border-primary/40 bg-primary/10 text-foreground`),children:e.name},e.name)),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-new`,title:`Start an empty workflow`,onClick:()=>S(Gr()),className:`rounded-full border border-dashed border-border px-2.5 py-1 font-mono text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:`+ new`})]}),ge?(0,$.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`mt-4 rounded-lg border border-border bg-card p-3 shadow-xs`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Build a chain from a prompt`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Describe what the chain should do. An agent proposes a title and an ordered set of skill / check steps — land it on the canvas, then tweak and Save.`}),(0,$.jsx)(E,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),Pe())},className:`mt-2 min-h-20 text-[13px]`}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsxs)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-auto-run`,disabled:we.isPending||F.trim()===``,onClick:Pe,children:[(0,$.jsx)(me,{"aria-hidden":`true`,className:`size-3`}),we.isPending?`Building…`:`Build chain`]}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:()=>{P(!1),I(``)},children:`Cancel`})]})]}):null,ne?(0,$.jsxs)(`div`,{"data-slot":`wb-import-panel`,className:`mt-4 rounded-lg border border-border bg-card p-3 shadow-xs`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Import workflow YAML`}),(0,$.jsx)(E,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:6,spellCheck:!1,placeholder:`name: my-flow
|
|
9
|
-
skills:
|
|
10
|
-
- test-conventions
|
|
11
|
-
- commit-style`,value:D,onChange:e=>M(e.target.value),className:`mt-2 min-h-28 font-mono text-xs`}),fe===``?null:(0,$.jsx)(`p`,{"data-slot":`wb-import-error`,className:`mt-2 text-xs text-danger`,children:fe}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsx)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-import-run`,disabled:Ce.isPending,onClick:Ne,children:`Import`}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:()=>{ie(!1),M(``),he(``)},children:`Cancel`})]})]}):null,(0,$.jsx)(Yr,{steps:W,skills:H,dragging:z!==null,overId:ye,activeStepId:z?.type===`step`?z.step.id:null,onRemove:e=>U(Lr(W,e))})]}),(0,$.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`w-full shrink-0 md:w-[320px]`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Skills`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Drag into the flow. Order is execution order — the agent applies them top to bottom.`}),(0,$.jsx)(j,{"data-slot":`wb-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:w,onChange:e=>T(e.target.value),className:`mt-2.5 h-8 text-[13px]`}),(0,$.jsx)(Qr,{skills:Se,query:w,error:n.isError?n.error.message:null,inFlow:new Set(W.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>ke(e)}),(0,$.jsxs)(`div`,{className:`mt-5 flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`workflow.yaml`}),(0,$.jsx)(`span`,{className:`flex-1`}),(0,$.jsx)(ei,{yaml:K})]}),(0,$.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 overflow-x-auto rounded-lg border border-border bg-card p-3 font-mono text-[11.5px] leading-relaxed whitespace-pre text-muted-foreground shadow-xs`,children:K}),(0,$.jsx)(`p`,{className:`mt-2 text-[11.5px] leading-relaxed text-soft-foreground`,children:`Portable — export this file and import it in any repo running cezar.`})]})]}),(0,$.jsx)(or,{children:z?.type===`palette`?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5 text-primary`}),z.skill]}):z?.type===`step`?(0,$.jsx)(Zr,{step:z.step,index:W.findIndex(e=>e.id===z.step.id),skills:H,overlay:!0}):null})]}),(0,$.jsx)(O,{open:L,onOpenChange:e=>!e&&R(!1),children:(0,$.jsxs)(A,{"data-slot":`wb-overwrite-dialog`,children:[(0,$.jsxs)(oe,{children:[(0,$.jsxs)(de,{children:[`“`,G,`” already exists`]}),(0,$.jsx)(le,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(ue,{children:`Keep the file`}),(0,$.jsx)(ce,{"data-slot":`wb-overwrite-confirm`,onClick:()=>Te.mutate(!0),children:`Overwrite`})]})]})}),(0,$.jsx)(O,{open:_e,onOpenChange:e=>!e&&ve(!1),children:(0,$.jsxs)(A,{"data-slot":`wb-delete-dialog`,children:[(0,$.jsxs)(oe,{children:[(0,$.jsxs)(de,{children:[`Delete workflow “`,G,`”?`]}),(0,$.jsxs)(le,{children:[`Removes `,Oe?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,$.jsx)(`span`,{className:`font-mono`,children:`.ai/cezar/workflows/`}),`. There is no undo.`]})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(ue,{children:`Keep it`}),(0,$.jsx)(ce,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>Ee.mutate(G),children:`Delete`})]})]})})]})}function Yr({steps:e,skills:t,dragging:n,overId:r,activeStepId:i,onRemove:a}){let{setNodeRef:o,isOver:s}=Jn({id:Wr}),c=n&&r===Wr;return(0,$.jsx)(`div`,{ref:o,"data-slot":`wb-steps`,"data-dragging":n||void 0,className:b(`mt-4 rounded-lg border border-dashed p-2 transition-colors`,s?`border-primary/60 bg-primary/5`:`border-muted-foreground/25`),children:e.length===0?(0,$.jsx)(`p`,{className:b(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,s?`text-primary`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,$.jsxs)(vr,{items:e.map(e=>e.id),strategy:mr,children:[(0,$.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((e,o)=>(0,$.jsx)(Xr,{step:e,index:o,skills:t,connector:o>0,dragging:n,insertBefore:n&&r===e.id&&i!==e.id,onRemove:()=>a(o)},e.id))}),(0,$.jsx)(`div`,{"aria-hidden":`true`,className:b(`mx-1 mt-2.5 h-[3px] rounded-full transition-colors`,c?`bg-primary`:`bg-transparent`)}),(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pt-1.5 pb-1 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(D,{"aria-hidden":`true`,className:`size-3`}),`runs top to bottom`]})]})})}function Xr({step:e,index:t,skills:n,connector:r,dragging:i,insertBefore:a,onRemove:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=Er({id:e.id,data:{type:`step`,step:e}});return(0,$.jsxs)(`li`,{ref:l,style:{transform:K.Transform.toString(u),transition:d},className:b(`relative`,f&&`opacity-40`),children:[r&&!i?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute -top-[11px] left-1/2 h-[9px] w-px -translate-x-1/2 bg-muted-foreground/30`}):null,a?(0,$.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-primary`}):null,(0,$.jsx)(Zr,{step:e,index:t,skills:n,onRemove:o,gripProps:{...s,...c}})]})}function Zr({step:e,index:t,skills:n,onRemove:r,gripProps:i,overlay:a=!1}){let o=n.find(t=>t.name===e.skill),s=!!e.command,c=s||!e.skill?e.name??e.id:e.skill,l=s?`$ ${e.command}${e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``}`:e.skill?o?.description??`Not in this repo or the team skills — the step runs on its plain prompt.`:e.prompt??``,u=s?`check`:e.skill?o?null:`unknown`:`prompt`;return(0,$.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:b(`flex items-center gap-2.5 rounded-md border border-muted-foreground/20 bg-card-2 px-2.5 py-2 shadow-xs`,a&&`shadow-md`),children:[(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${t+1}: ${c}`,className:`shrink-0 cursor-grab rounded text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,...i,children:(0,$.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:String(t+1).padStart(2,`0`)}),s?(0,$.jsx)(w,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-mono text-[13px] font-medium`,children:c}),l?(0,$.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:l}):null]}),u?(0,$.jsx)(`span`,{"data-slot":`wb-step-badge`,className:b(`shrink-0 rounded-full border px-2 py-px font-mono text-[10.5px]`,u===`check`&&`border-success/30 text-success`,u===`unknown`&&`border-danger/35 text-danger`,u===`prompt`&&`border-border text-soft-foreground`),children:u}):null,r?(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-remove`,"aria-label":`Remove step ${t+1}: ${c}`,title:`Remove from flow`,onClick:r,className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-danger focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function Qr({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,$.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=t.trim().toLowerCase(),o=e.filter(e=>a===``||e.name.toLowerCase().includes(a)||(e.description??``).toLowerCase().includes(a));return(0,$.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:o.length>0?o.map(e=>(0,$.jsx)($r,{skill:e,inFlow:r.has(e.name),onAdd:i},e.path)):(0,$.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:(0,$.jsx)(fe,{})})})}function $r({skill:e,inFlow:t,onAdd:n}){let{attributes:r,listeners:i,setNodeRef:a,isDragging:o}=Wn({id:`palette:${e.name}`,data:{type:`palette`,skill:e.name}});return(0,$.jsxs)(`div`,{ref:a,"data-slot":`wb-skill`,"data-skill":e.name,title:e.description??``,className:b(`flex cursor-grab items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 shadow-xs transition-colors hover:bg-muted`,o&&`opacity-40`),...r,...i,children:[(0,$.jsx)(ae,{"aria-hidden":`true`,className:b(`size-3.5 shrink-0`,ne(e)?`text-violet`:`text-soft-foreground`)}),(0,$.jsx)(`span`,{className:b(`min-w-0 flex-1 truncate font-mono text-[13px]`,ne(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),t?(0,$.jsx)(x,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.name),className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`})})]})}function ei({yaml:e}){let[t,n]=(0,N.useState)(!1),r=(0,N.useRef)(null);return(0,N.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(x,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}export{qr as WorkflowsRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./utils-CzkLr94M.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|