@wjarka/cezarion 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/index.js +2 -1
- package/dist/contract/workspace.d.ts +14 -0
- package/dist/core/opencode-model-catalog.d.ts +5 -5
- package/dist/core/opencode-model-catalog.js +96 -34
- package/dist/core/opencode-model-catalog.js.map +1 -1
- package/dist/core/opencode-server-runner.js +37 -2
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-model-catalog.d.ts +7 -0
- package/dist/core/pi-model-catalog.js +123 -26
- package/dist/core/pi-model-catalog.js.map +1 -1
- package/dist/core/pi-runner.js +12 -10
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/pi-ui-mapper.d.ts +1 -0
- package/dist/core/pi-ui-mapper.js +68 -11
- package/dist/core/pi-ui-mapper.js.map +1 -1
- package/dist/core/runner-model-catalog.d.ts +2 -0
- package/dist/core/runner-model-catalog.js.map +1 -1
- package/dist/server/server.d.ts +1 -0
- package/dist/workflows/run.d.ts +3 -0
- package/dist/workflows/run.js +48 -21
- package/dist/workflows/run.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mock-pi-rpc.mjs +49 -2
- package/web/dist/assets/{alert-dialog-g-GVThSw.js → alert-dialog-Bib2-aHJ.js} +1 -1
- package/web/dist/assets/arrow-down-DF9UfPoy.js +1 -0
- package/web/dist/assets/arrow-left-BVgebuvi.js +1 -0
- package/web/dist/assets/{centered-state-DdbE_pNl.js → centered-state-TyZe3tga.js} +1 -1
- package/web/dist/assets/chevron-right-W2B4c3Bn.js +1 -0
- package/web/dist/assets/{collapsible-R1r7zUOB.js → collapsible-DTRw1YnV.js} +1 -1
- package/web/dist/assets/{commit-list-Bgb1DHBX.js → commit-list-BKtzO28W.js} +1 -1
- package/web/dist/assets/{compare-variants-UA_0n_5a.js → compare-variants--E1SPJzi.js} +1 -1
- package/web/dist/assets/{diff-Cv3z9esx.js → diff-DtXK3tZy.js} +2 -2
- package/web/dist/assets/{diff-stat-ydfu0_5T.js → diff-stat-CJSJmLcb.js} +1 -1
- package/web/dist/assets/{diff-view-DnPdkmk2.js → diff-view-wZScCPoa.js} +1 -1
- package/web/dist/assets/{dropdown-menu-CPP9gEmn.js → dropdown-menu-CQp168wo.js} +1 -1
- package/web/dist/assets/editable-title-BWosq6YG.js +1 -0
- package/web/dist/assets/{ellipsis-vertical-WNkaehnw.js → ellipsis-vertical-BXllsyll.js} +1 -1
- package/web/dist/assets/{file-RvhJlchx.js → file-BgcgwEU-.js} +1 -1
- package/web/dist/assets/{folder-Dz-weqBo.js → folder-DGrkgLg9.js} +1 -1
- package/web/dist/assets/{git-toolbar-BEKuAjHk.js → git-toolbar-D9Wu2J60.js} +1 -1
- package/web/dist/assets/{github-CmFHDNje.js → github-xAF2VFFK.js} +1 -1
- package/web/dist/assets/{image-preview-DYiOSYoY.js → image-preview-Cd7b7Evu.js} +1 -1
- package/web/dist/assets/index-CKWqcYjr.js +7 -0
- package/web/dist/assets/{markdown-DQHRRO9e.js → markdown-Cvzv-jvo.js} +1 -1
- package/web/dist/assets/new-task-form-CZAdHx_5.js +1 -0
- package/web/dist/assets/{pill-FAFXjmY6.js → pill-B9vrSbT6.js} +1 -1
- package/web/dist/assets/{project-router-Dzc0JK2j.js → project-router-CF-1GU39.js} +1 -1
- package/web/dist/assets/{prompt-templates-DmqtzSPL.js → prompt-templates-CSmaXZ5G.js} +1 -1
- package/web/dist/assets/{refresh-cw-BP4TkA4M.js → refresh-cw-D5a-hkgq.js} +1 -1
- package/web/dist/assets/{repo-git-C20pc5tT.js → repo-git-BicCjDSy.js} +1 -1
- package/web/dist/assets/{run-diff-CvcsWwew.js → run-diff-DWzdGMTg.js} +1 -1
- package/web/dist/assets/run-header-Cc7KFOMX.js +1 -0
- package/web/dist/assets/{search-x-Drnmsmd0.js → search-x-DJIOs-nB.js} +1 -1
- package/web/dist/assets/{skill-empty-hint-D2l_OqZ5.js → skill-empty-hint-BcecPZ6K.js} +1 -1
- package/web/dist/assets/skills-BKYATWFF.js +1 -0
- package/web/dist/assets/{sparkles-B9ja4FHw.js → sparkles-C-1JzGqe.js} +1 -1
- package/web/dist/assets/{square-terminal-CB2du-YG.js → square-terminal-CnrkOecA.js} +1 -1
- package/web/dist/assets/{tab-link-C5FWJ66Y.js → tab-link-CQgzNUwP.js} +1 -1
- package/web/dist/assets/{task-changes-CuUmQArS.js → task-changes--AyxNXvn.js} +1 -1
- package/web/dist/assets/{task-commits-DgIWIhW9.js → task-commits-DlBBODPF.js} +1 -1
- package/web/dist/assets/{task-files-BeDXPyz5.js → task-files-DZ49FGVz.js} +1 -1
- package/web/dist/assets/task-thread-D10akRi2.js +9 -0
- package/web/dist/assets/{textarea-Sm6doUPO.js → textarea-BPMIukW0.js} +1 -1
- package/web/dist/assets/{thread-loading-DojNeADh.js → thread-loading-C9cWYGbd.js} +1 -1
- package/web/dist/assets/{trash-2-C_lGBXG2.js → trash-2-CwmIdbv2.js} +1 -1
- package/web/dist/assets/{triangle-alert-Brk_ldFl.js → triangle-alert-BU7Fnc0D.js} +1 -1
- package/web/dist/assets/{upload-Cxs1UROt.js → upload-B54t9i6X.js} +1 -1
- package/web/dist/assets/{use-desktop-Cmrz3npD.js → use-desktop-Co7z3Xov.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-DzeqN3GK.js → use-submit-shortcut-DfJM2Y1U.js} +1 -1
- package/web/dist/assets/{utils-Unt0mZvU.js → utils-BLZyueuK.js} +1 -1
- package/web/dist/assets/{workflows-D_GyBbup.js → workflows-CfC6b8y4.js} +1 -1
- package/web/dist/assets/{zoomable-image-ByySCppM.js → zoomable-image-BQMum6hd.js} +1 -1
- package/web/dist/index.html +22 -22
- package/web/dist/assets/arrow-down-BzmL0uj0.js +0 -1
- package/web/dist/assets/arrow-left-DtUM7GFU.js +0 -1
- package/web/dist/assets/chevron-right-DnLh0uM2.js +0 -1
- package/web/dist/assets/editable-title-D_bWdmY0.js +0 -1
- package/web/dist/assets/index-BQTfjxFm.js +0 -7
- package/web/dist/assets/new-task-form-D2KlpqYC.js +0 -1
- package/web/dist/assets/run-header-xFlbebSJ.js +0 -1
- package/web/dist/assets/skills-Cn2ppPow.js +0 -1
- package/web/dist/assets/task-thread-2nmi0vcz.js +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./alert-dialog-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./alert-dialog-Bib2-aHJ.js";import{i as d,n as f}from"./chunk-BO2N2NFS-DE6qKn3r.js";import{i as p,o as m,r as h,t as g}from"./highlighter-CdHqIwFr.js";function _(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 v(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 y=e(t(),1),b=n();function x({isOpen:e,onClose:t,onConfirm:n,url:d}){return(0,b.jsx)(u,{open:e,onOpenChange:e=>{e||t()},children:(0,b.jsxs)(a,{"data-slot":`link-safety-dialog`,children:[(0,b.jsxs)(l,{children:[(0,b.jsx)(i,{children:`Open this link?`}),(0,b.jsxs)(r,{children:[`It leaves cezar in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,b.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:d})]})]}),(0,b.jsxs)(s,{children:[(0,b.jsx)(c,{children:`Cancel`}),(0,b.jsx)(o,{onClick:n,children:`Open link`})]})]})})}var S={name:`shiki`,type:`code-highlighter`,getThemes:()=>[g,g],getSupportedLanguages:()=>m(),supportsLanguage:e=>m().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>p(e,String(t))||(h(e,String(t)).then(e=>n?.(e)),null)};function C(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
2
2
|
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var w=[...Object.values(f),C],T=[`p`,`strong`,`em`,`del`,`code`,`a`],E={p:`span`,a:`span`},D={enabled:!0,renderModal:e=>(0,b.jsx)(x,{...e})},O=(0,y.memo)(function({children:e,breaks:t=!1,inline:n=!1}){return(0,b.jsx)(d,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:{code:S},shikiTheme:[g,g],remarkPlugins:t?w:void 0,allowedElements:n?T:void 0,unwrapDisallowed:n||void 0,components:n?E:void 0,linkSafety:D,controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{v as n,_ as r,O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,_ as i,b as a,c as o,d as s,f as c,g as l,h as u,l as d,s as f,u as p,w as m,x as h,y as g}from"./centered-state-TyZe3tga.js";import{m as _,r as v,t as ee}from"./utils-BLZyueuK.js";import{f as y,g as b,h as x,m as te,p as S}from"./dropdown-menu-CQp168wo.js";var ne=v(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),re=v(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ie=v(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),ae=v(`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`}]]),C=v(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),w=v(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),T=e(t(),1),E=n(),D=`Popover`,[O,oe]=a(D,[b]),k=b(),[se,A]=O(D),j=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,c=k(t),l=T.useRef(null),[d,f]=T.useState(!1),[p,m]=i({prop:r,defaultProp:a??!1,onChange:o,caller:D});return(0,E.jsx)(x,{...c,children:(0,E.jsx)(se,{scope:t,contentId:u(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:T.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:T.useCallback(()=>f(!0),[]),onCustomAnchorRemove:T.useCallback(()=>f(!1),[]),modal:s,children:n})})};j.displayName=D;var M=`PopoverAnchor`,N=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(M,n),a=k(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return T.useEffect(()=>(o(),()=>s()),[o,s]),(0,E.jsx)(y,{...a,...r,ref:t})});N.displayName=M;var P=`PopoverTrigger`,F=T.forwardRef((e,t)=>{let{__scopePopover:n,...i}=e,a=A(P,n),o=k(n),s=r(t,a.triggerRef),c=(0,E.jsx)(h.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":K(a.open),...i,ref:s,onClick:g(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,E.jsx)(y,{asChild:!0,...o,children:c})});F.displayName=P;var I=`PopoverPortal`,[ce,le]=O(I,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=A(I,t);return(0,E.jsx)(ce,{scope:t,forceMount:n,children:(0,E.jsx)(l,{present:n||a.open,children:(0,E.jsx)(p,{asChild:!0,container:i,children:r})})})};L.displayName=I;var R=`PopoverContent`,z=T.forwardRef((e,t)=>{let n=le(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=A(R,e.__scopePopover);return(0,E.jsx)(l,{present:r||a.open,children:a.modal?(0,E.jsx)(V,{...i,ref:t}):(0,E.jsx)(H,{...i,ref:t})})});z.displayName=R;var B=m(`PopoverContent.RemoveScroll`),V=T.forwardRef((e,t)=>{let n=A(R,e.__scopePopover),i=T.useRef(null),a=r(t,i),s=T.useRef(!1);return T.useEffect(()=>{let e=i.current;if(e)return f(e)},[]),(0,E.jsx)(o,{as:B,allowPinchZoom:!0,children:(0,E.jsx)(U,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),s.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;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),H=T.forwardRef((e,t)=>{let n=A(R,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return(0,E.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=T.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,...m}=e,h=A(R,n),g=k(n);return d(),(0,E.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,E.jsx)(c,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,E.jsx)(te,{"data-state":K(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=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(W,n);return(0,E.jsx)(h.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;var ue=`PopoverArrow`,de=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(n);return(0,E.jsx)(S,{...i,...r,ref:t})});de.displayName=ue;function K(e){return e?`open`:`closed`}var fe=j,pe=N,me=F,he=L,ge=z;function q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function _e(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function ve(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:q(e)}:{top:0,bottom:0}}function ye(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 be(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(ve(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function xe(){let[e,t]=(0,T.useState)({top:0,bottom:0});return(0,T.useEffect)(()=>be(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Se(e){let t=(0,T.useRef)(e);t.current=e,(0,T.useEffect)(()=>{let e=document.documentElement;return _e(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function Ce({...e}){return(0,E.jsx)(fe,{"data-slot":`popover`,...e})}function we({...e}){return(0,E.jsx)(me,{"data-slot":`popover-trigger`,...e})}function Te({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=xe();return(0,E.jsx)(he,{children:(0,E.jsx)(ge,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:ye(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 Ee({...e}){return(0,E.jsx)(pe,{"data-slot":`popover-anchor`,...e})}var De=`quick-task`;function Oe(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var J=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`}],Y={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`},{id:`claude-fable-5`,label:`Fable 5`,desc:`Most capable — the Claude 5 family`},{id:`claude-opus-4-8`,label:`Opus 4.8`,desc:`Pinned version`},{id:`claude-sonnet-5`,label:`Sonnet 5`,desc:`Pinned version`},{id:`claude-haiku-4-5`,label:`Haiku 4.5`,desc:`Pinned version`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`}]},X=[{value:``,label:`auto`,desc:`Harness default`},{value:`low`,label:`low`,desc:`Less reasoning, faster replies`},{value:`medium`,label:`medium`,desc:`Balanced reasoning`},{value:`high`,label:`high`,desc:`More reasoning for hard tasks`},{value:`xhigh`,label:`xhigh`,desc:`Extra-high reasoning`},{value:`max`,label:`max`,desc:`Maximum reasoning`}];function ke(e,t,n){let r=_(e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!r?.length)return X;let i=[X[0]],a=new Set;for(let e of r){if(a.has(e))continue;let t=X.find(t=>t.value===e);t&&(a.add(e),i.push(t))}return i.length>1?i:X}function Ae(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var je=[`opencode`,`pi`];function Me(e,t){return!e||Y[t].some(t=>t.id===e)?!1:Object.entries(Y).some(([n,r])=>n!==t&&!je.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function Z(e,t,n=[]){let r=[...Y[e]??Y.claude],i=new Set(r.map(e=>e.id));if(_(e))for(let e of t?.models??[])!e.id||i.has(e.id)||(i.add(e.id),r.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||i.has(t)||Me(t,e)||(i.add(t),r.push({id:t,label:t,desc:`Custom or legacy model`}));return r}var Ne={codex:`Codex`,opencode:`OpenCode`,pi:`Pi`};function Pe(e,t,n=!1){if(!_(e))return;let r=Ne[e];if(t?.stale)return`Using cached ${r} model list`;if(n||t?.source===`unavailable`)return`Latest ${r} models unavailable`}function Q(e){let t=J.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function Fe(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function $(e,t,n=!1){return!n&&e===t?void 0:e}function Ie(e,t,n,r){let i=Z(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function Le(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function Re(e,t,n){return e&&Le(e,t,n)?e:null}function ze(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,variants:u,images:d,worktree:f,autonomous:p,generateFollowups:m,todoId:h}=e;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:i?void 0:r||void 0,effort:i?void 0:a||void 0,runner:$(o,c,s),agentProfile:l||void 0,variants:u>1?u:void 0,images:d.length>0?[...d]:void 0,worktree:f===!1&&u<=1?!1:void 0,autonomous:p===!0||void 0,generateFollowups:m!==!1&&void 0,todoId:h||void 0}}function Be(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}export{ie as C,ae as S,ne as T,Te as _,ke as a,w as b,Oe as c,Fe as d,Re as f,Ee as g,Ce as h,ze as i,Ae as l,Be as m,J as n,Pe as o,$ as p,Q as r,Z as s,De as t,Ie as u,we as v,re as w,C as x,Se as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{O as n}from"./centered-state-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{O as n}from"./centered-state-TyZe3tga.js";import{t as r}from"./utils-BLZyueuK.js";import{n as i}from"./markdown-Cvzv-jvo.js";e();var a=t(),o=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 s({className:e,tone:t=`neutral`,pulse:n=!1,...i}){return(0,a.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:r(o({tone:t,pulse:n,className:e})),...i})}var c={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function l(e){return!1}function u(e){return!1}function d(e){return l(e)?{bucket:`permission`,tone:`violet`,pulse:!0,label:`needs permission`}:e.status===`failed`&&e.autoResumeAt?{bucket:`none`,tone:`pending`,pulse:!1,label:`scheduled`}: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`}:u(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 f(e){return c[d(e).bucket]<=c.waiting}function p(e){return e===void 0?`unknown`:new Intl.NumberFormat().format(e)}function m(e,t){return`Input tokens: ${p(e)}; output tokens: ${p(t)}`}function h(e,t,n=`compact`){let r=e===void 0?`—`:i(e),a=t===void 0?`—`:i(t);return n===`table`?`${r} / ${a}`:`IN ${r} · OUT ${a}`}function g({inputTokens:e,outputTokens:t,variant:n=`compact`,omitWhenUnknown:i=!0,className:o}){return i&&e===void 0&&t===void 0?null:(0,a.jsx)(`span`,{"data-slot":`directional-usage`,"aria-label":m(e,t),className:r(`font-mono tabular-nums`,o),children:h(e,t,n)})}function _(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}function v({className:e,dot:t,pulse:n=!1,children:i,...o}){return(0,a.jsxs)(`span`,{"data-slot":`pill`,className:r(`inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-[3px] text-xs font-medium whitespace-nowrap text-muted-foreground`,e),...o,children:[t?(0,a.jsx)(s,{tone:t,pulse:n}):null,i]})}export{d as a,h as i,_ as n,f as o,g as r,s,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Lr as r,Mr as i,Nr as a,Rr as o,Sn as s,jr as c,zr as l}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Lr as r,Mr as i,Nr as a,Rr as o,Sn as s,jr as c,zr as l}from"./centered-state-TyZe3tga.js";var u=e(t(),1),d=n(),f=/^\/p\/([^/]+)(?=\/|$)/;function p(e){let t=f.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function m(e){let t=f.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function h(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function g(e,t){return e===null?t:typeof t==`string`?h(e,t):t.pathname===void 0?t:{...t,pathname:h(e,t.pathname)}}function _(){let{projectId:e}=s(),{pathname:t}=o();return e??p(t)}function v(){let e=_();return(0,u.useCallback)(t=>g(e,t),[e])}function y(e){let{pathname:t}=o();return(0,u.useMemo)(()=>r(e,m(t)),[e,t])}function b({to:e,...t}){let n=v();return(0,d.jsx)(c,{...t,to:n(e)})}function x({to:e,...t}){let n=v();return(0,d.jsx)(i,{...t,to:n(e)})}function S({to:e,...t}){let n=v();return(0,d.jsx)(a,{...t,to:n(e)})}function C(){let e=l(),t=v();return(0,u.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{g as a,C as c,p as i,y as l,x as n,m as o,S as r,_ as s,b as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,R as i,bt as a,h as o,x as s}from"./centered-state-DdbE_pNl.js";import{r as c,t as l}from"./utils-Unt0mZvU.js";import{r as u,w as d}from"./new-task-form-D2KlpqYC.js";import{a as f,c as p,n as m,o as h,r as g,t as _}from"./dropdown-menu-CPP9gEmn.js";import{d as v,l as y,m as b,p as ee}from"./alert-dialog-g-GVThSw.js";import{a as x,c as S,l as C,o as w,r as T}from"./use-submit-shortcut-DzeqN3GK.js";var E=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`}]]),D=c(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),O=e(t(),1),k=1,A=.9,j=.8,M=.17,N=.1,P=.999,F=.9999,I=.99,L=/[\\\/_+.#"@\[\(\{&]/,R=/[\\\/_+.#"@\[\(\{&]/g,z=/[\s-]/,te=/[\s-]/g;function ne(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?k:I;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=ne(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=k:L.test(e.charAt(l-1))?(d*=j,p=e.slice(i,l-1).match(R),p&&i>0&&(d*=P**+p.length)):z.test(e.charAt(l-1))?(d*=A,m=e.slice(i,l-1).match(te),m&&i>0&&(d*=P**+m.length)):(d*=M,i>0&&(d*=P**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=F)),(d<N&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ne(e,t,n,r,l+1,a+2,o),f*N>d&&(d=f*N)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function re(e){return e.toLowerCase().replace(te,` `)}function ie(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,ne(e,t,re(e),re(t),0,0,{})}var B=`[cmdk-group=""]`,V=`[cmdk-group-items=""]`,ae=`[cmdk-group-heading=""]`,oe=`[cmdk-item=""]`,se=`${oe}:not([aria-disabled="true"])`,H=`cmdk-item-select`,U=`data-value`,ce=(e,t,n)=>ie(e,t,n),le=O.createContext(void 0),W=()=>O.useContext(le),ue=O.createContext(void 0),G=()=>O.useContext(ue),de=O.createContext(void 0),fe=O.forwardRef((e,t)=>{let n=J(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=J(()=>new Set),i=J(()=>new Map),a=J(()=>new Map),c=J(()=>new Set),l=Ce(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=o(),ee=o(),x=o(),S=O.useRef(null),C=Te();q(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,w.emit()}},[f]),q(()=>{C(6,j)},[]);let w=O.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),D(),C(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=M()?.id,w.emit()}),r||C(5,j),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),T=O.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{A(),D(),n.current.value||k(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();C(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:x,labelId:ee,listInnerRef:S}),[]);function E(e,t){let r=l.current?.filter??ce;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(V);t?t.appendChild(e.parentElement===t?e:e.closest(`${V} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${V} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${B}[${U}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(U);w.setState(`value`,e||void 0)}function A(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(B)?.querySelector(ae))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return S.current?.querySelector(`${oe}[aria-selected="true"]`)}function N(){return Array.from(S.current?.querySelectorAll(se)||[])}function P(e){let t=N()[e];t&&w.setState(`value`,t.getAttribute(U))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(U))}function I(e){let t=M()?.closest(B),n;for(;t&&!n;)t=e>0?xe(t,B):Se(t,B),n=t?.querySelector(se);n?w.setState(`value`,n.getAttribute(U)):F(e)}let L=()=>P(N().length-1),R=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return O.createElement(s.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&R(e);break;case`ArrowDown`:R(e);break;case`p`:case`k`:v&&e.ctrlKey&&z(e);break;case`ArrowUp`:z(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(H);t.dispatchEvent(e)}}}}},O.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:De},u),X(e,e=>O.createElement(ue.Provider,{value:w},O.createElement(le.Provider,{value:T},e))))}),pe=O.forwardRef((e,t)=>{let n=o(),i=O.useRef(null),a=O.useContext(de),c=W(),l=Ce(e),u=l.current?.forceMount??a?.forceMount;q(()=>{if(!u)return c.item(n,a?.id)},[u]);let d=we(n,i,[e.value,e.children,i],e.keywords),f=G(),p=Y(e=>e.value&&e.value===d.current),m=Y(e=>u||c.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);O.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(H,h),()=>t.removeEventListener(H,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:ee,...x}=e;return O.createElement(s.div,{ref:r(i,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),me=O.forwardRef((e,t)=>{let{heading:n,children:i,forceMount:a,...c}=e,l=o(),u=O.useRef(null),d=O.useRef(null),f=o(),p=W(),m=Y(e=>a||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));q(()=>p.group(l),[]),we(l,u,[e.value,e.heading,d]);let h=O.useMemo(()=>({id:l,forceMount:a}),[a]);return O.createElement(s.div,{ref:r(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&O.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),X(e,e=>O.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},O.createElement(de.Provider,{value:h},e))))}),he=O.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,a=O.useRef(null),o=Y(e=>!e.search);return!n&&!o?null:O.createElement(s.div,{ref:r(a,t),...i,"cmdk-separator":``,role:`separator`})}),ge=O.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=G(),o=Y(e=>e.search),c=Y(e=>e.selectedItemId),l=W();return O.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),O.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),_e=O.forwardRef((e,t)=>{let{children:n,label:i=`Suggestions`,...a}=e,o=O.useRef(null),c=O.useRef(null),l=Y(e=>e.selectedItemId),u=W();return O.useEffect(()=>{if(c.current&&o.current){let e=c.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),O.createElement(s.div,{ref:r(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},X(e,e=>O.createElement(`div`,{ref:r(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),ve=O.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return O.createElement(y,{open:n,onOpenChange:r},O.createElement(b,{container:o},O.createElement(ee,{"cmdk-overlay":``,className:i}),O.createElement(v,{"aria-label":e.label,"cmdk-dialog":``,className:a},O.createElement(fe,{ref:t,...s}))))}),ye=O.forwardRef((e,t)=>Y(e=>e.filtered.count===0)?O.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),be=O.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return O.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},X(e,e=>O.createElement(`div`,{"aria-hidden":!0},e)))}),K=Object.assign(fe,{List:_e,Item:pe,Input:ge,Group:me,Separator:he,Dialog:ve,Empty:ye,Loading:be});function xe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Se(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ce(e){let t=O.useRef(e);return q(()=>{t.current=e}),t}var q=typeof window>`u`?O.useEffect:O.useLayoutEffect;function J(e){let t=O.useRef();return t.current===void 0&&(t.current=e()),t}function Y(e){let t=G(),n=()=>e(t.snapshot());return O.useSyncExternalStore(t.subscribe,n,n)}function we(e,t,n,r=[]){let i=O.useRef(),a=W();return q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(U,s),i.current=s}),i}var Te=()=>{let[e,t]=O.useState(),n=J(()=>new Map);return q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ee(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function X({asChild:e,children:t},n){return e&&O.isValidElement(t)?O.cloneElement(Ee(t),{ref:t.ref},n(t.props.children)):n(t)}var De={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Z=n();function Oe({className:e,...t}){return(0,Z.jsx)(K,{"data-slot":`command`,className:l(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ke({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,filter:a,...o}){return(0,Z.jsxs)(T,{...o,children:[(0,Z.jsxs)(S,{className:`sr-only`,children:[(0,Z.jsx)(C,{children:e}),(0,Z.jsx)(w,{children:t})]}),(0,Z.jsx)(x,{className:l(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,Z.jsx)(Oe,{filter:a,className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function Ae({className:e,...t}){return(0,Z.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,Z.jsx)(D,{className:`size-4 shrink-0 opacity-50`}),(0,Z.jsx)(K.Input,{"data-slot":`command-input`,className:l(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function je({className:e,...t}){return(0,Z.jsx)(K.List,{"data-slot":`command-list`,className:l(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function Me({...e}){return(0,Z.jsx)(K.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Ne({className:e,...t}){return(0,Z.jsx)(K.Group,{"data-slot":`command-group`,className:l(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Pe({className:e,...t}){return(0,Z.jsx)(K.Separator,{"data-slot":`command-separator`,className:l(`-mx-1 h-px bg-border`,e),...t})}function Fe({className:e,...t}){return(0,Z.jsx)(K.Item,{"data-slot":`command-item`,className:l(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ie({className:e,...t}){return(0,Z.jsx)(`span`,{"data-slot":`command-shortcut`,className:l(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function Le(){let e=i(),t=a(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function Re(e,t){return e.filter(e=>e.provider===t).length>1}var Q=`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-55`,ze=(0,Z.jsx)(d,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`});function Be({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:o=!1,readOnly:s=!1,hint:c,disabledHint:l,status:u}){if(s)return(0,Z.jsx)(`span`,{"data-slot":e,"aria-label":t,title:l??c,className:`${Q} cursor-default hover:bg-card hover:text-muted-foreground`,children:n});let d=(0,Z.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:o,title:o?l:c,className:Q,children:[n,ze]});return o?(0,Z.jsx)(`span`,{title:l,className:`inline-flex`,children:d}):(0,Z.jsxs)(_,{children:[(0,Z.jsx)(p,{asChild:!0,children:d}),(0,Z.jsxs)(m,{align:`start`,"data-testid":`${e}-menu`,children:[(0,Z.jsx)(f,{value:r,onValueChange:a,children:i.map(e=>(0,Z.jsx)(h,{value:e.value,className:`gap-2.5`,children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:e.label}),e.desc?(0,Z.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),u?(0,Z.jsx)(g,{disabled:!0,className:`border-t border-border text-[11.5px] text-muted-foreground`,children:u}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function Ve({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o}){let s=u.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:$(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:$(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),c=a??o?.[t]??`default`,l=s.some(e=>e.value===$(t,c))?$(t,c):$(t,null);return(0,Z.jsx)(Be,{slot:`runner-pill`,ariaLabel:`Runner`,label:s.find(e=>e.value===l)?.label??t,value:l,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:s})}var He=80,Ue=2e3,We=50,Ge=200,Ke=50,qe=[{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 Je(e){return!!e&&typeof e==`object`}function Ye(e){if(e===void 0||!Array.isArray(e))return qe.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!Je(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=Xe(r.skills);if(n.push({id:e,label:i.slice(0,He),text:a.slice(0,Ue),...o.length>0?{skills:o}:{}}),n.length>=We)break}return n}function Xe(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,Ge)),t.size>=Ke))break}return[...t]}function Ze(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function Qe(e,t){return Ze(e,t).map(e=>e.text).join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,R as i,bt as a,h as o,x as s}from"./centered-state-TyZe3tga.js";import{r as c,t as l}from"./utils-BLZyueuK.js";import{T as u,n as d}from"./new-task-form-CZAdHx_5.js";import{a as f,c as p,n as m,o as h,r as g,t as _}from"./dropdown-menu-CQp168wo.js";import{d as v,l as y,m as b,p as ee}from"./alert-dialog-Bib2-aHJ.js";import{a as x,c as S,l as C,o as w,r as T}from"./use-submit-shortcut-DfJM2Y1U.js";var E=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`}]]),D=c(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),O=e(t(),1),k=1,A=.9,j=.8,M=.17,N=.1,P=.999,F=.9999,I=.99,L=/[\\\/_+.#"@\[\(\{&]/,R=/[\\\/_+.#"@\[\(\{&]/g,z=/[\s-]/,te=/[\s-]/g;function ne(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?k:I;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=ne(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=k:L.test(e.charAt(l-1))?(d*=j,p=e.slice(i,l-1).match(R),p&&i>0&&(d*=P**+p.length)):z.test(e.charAt(l-1))?(d*=A,m=e.slice(i,l-1).match(te),m&&i>0&&(d*=P**+m.length)):(d*=M,i>0&&(d*=P**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=F)),(d<N&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ne(e,t,n,r,l+1,a+2,o),f*N>d&&(d=f*N)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function re(e){return e.toLowerCase().replace(te,` `)}function ie(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,ne(e,t,re(e),re(t),0,0,{})}var B=`[cmdk-group=""]`,V=`[cmdk-group-items=""]`,ae=`[cmdk-group-heading=""]`,oe=`[cmdk-item=""]`,se=`${oe}:not([aria-disabled="true"])`,H=`cmdk-item-select`,U=`data-value`,ce=(e,t,n)=>ie(e,t,n),le=O.createContext(void 0),W=()=>O.useContext(le),ue=O.createContext(void 0),G=()=>O.useContext(ue),de=O.createContext(void 0),fe=O.forwardRef((e,t)=>{let n=J(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=J(()=>new Set),i=J(()=>new Map),a=J(()=>new Map),c=J(()=>new Set),l=Ce(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=o(),ee=o(),x=o(),S=O.useRef(null),C=Te();q(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,w.emit()}},[f]),q(()=>{C(6,j)},[]);let w=O.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),D(),C(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=M()?.id,w.emit()}),r||C(5,j),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),T=O.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{A(),D(),n.current.value||k(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();C(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:x,labelId:ee,listInnerRef:S}),[]);function E(e,t){let r=l.current?.filter??ce;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(V);t?t.appendChild(e.parentElement===t?e:e.closest(`${V} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${V} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${B}[${U}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(U);w.setState(`value`,e||void 0)}function A(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(B)?.querySelector(ae))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return S.current?.querySelector(`${oe}[aria-selected="true"]`)}function N(){return Array.from(S.current?.querySelectorAll(se)||[])}function P(e){let t=N()[e];t&&w.setState(`value`,t.getAttribute(U))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(U))}function I(e){let t=M()?.closest(B),n;for(;t&&!n;)t=e>0?xe(t,B):Se(t,B),n=t?.querySelector(se);n?w.setState(`value`,n.getAttribute(U)):F(e)}let L=()=>P(N().length-1),R=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return O.createElement(s.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&R(e);break;case`ArrowDown`:R(e);break;case`p`:case`k`:v&&e.ctrlKey&&z(e);break;case`ArrowUp`:z(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(H);t.dispatchEvent(e)}}}}},O.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:De},u),X(e,e=>O.createElement(ue.Provider,{value:w},O.createElement(le.Provider,{value:T},e))))}),pe=O.forwardRef((e,t)=>{let n=o(),i=O.useRef(null),a=O.useContext(de),c=W(),l=Ce(e),u=l.current?.forceMount??a?.forceMount;q(()=>{if(!u)return c.item(n,a?.id)},[u]);let d=we(n,i,[e.value,e.children,i],e.keywords),f=G(),p=Y(e=>e.value&&e.value===d.current),m=Y(e=>u||c.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);O.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(H,h),()=>t.removeEventListener(H,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:ee,...x}=e;return O.createElement(s.div,{ref:r(i,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),me=O.forwardRef((e,t)=>{let{heading:n,children:i,forceMount:a,...c}=e,l=o(),u=O.useRef(null),d=O.useRef(null),f=o(),p=W(),m=Y(e=>a||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));q(()=>p.group(l),[]),we(l,u,[e.value,e.heading,d]);let h=O.useMemo(()=>({id:l,forceMount:a}),[a]);return O.createElement(s.div,{ref:r(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&O.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),X(e,e=>O.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},O.createElement(de.Provider,{value:h},e))))}),he=O.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,a=O.useRef(null),o=Y(e=>!e.search);return!n&&!o?null:O.createElement(s.div,{ref:r(a,t),...i,"cmdk-separator":``,role:`separator`})}),ge=O.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=G(),o=Y(e=>e.search),c=Y(e=>e.selectedItemId),l=W();return O.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),O.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),_e=O.forwardRef((e,t)=>{let{children:n,label:i=`Suggestions`,...a}=e,o=O.useRef(null),c=O.useRef(null),l=Y(e=>e.selectedItemId),u=W();return O.useEffect(()=>{if(c.current&&o.current){let e=c.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),O.createElement(s.div,{ref:r(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},X(e,e=>O.createElement(`div`,{ref:r(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),ve=O.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return O.createElement(y,{open:n,onOpenChange:r},O.createElement(b,{container:o},O.createElement(ee,{"cmdk-overlay":``,className:i}),O.createElement(v,{"aria-label":e.label,"cmdk-dialog":``,className:a},O.createElement(fe,{ref:t,...s}))))}),ye=O.forwardRef((e,t)=>Y(e=>e.filtered.count===0)?O.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),be=O.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return O.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},X(e,e=>O.createElement(`div`,{"aria-hidden":!0},e)))}),K=Object.assign(fe,{List:_e,Item:pe,Input:ge,Group:me,Separator:he,Dialog:ve,Empty:ye,Loading:be});function xe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Se(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ce(e){let t=O.useRef(e);return q(()=>{t.current=e}),t}var q=typeof window>`u`?O.useEffect:O.useLayoutEffect;function J(e){let t=O.useRef();return t.current===void 0&&(t.current=e()),t}function Y(e){let t=G(),n=()=>e(t.snapshot());return O.useSyncExternalStore(t.subscribe,n,n)}function we(e,t,n,r=[]){let i=O.useRef(),a=W();return q(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(U,s),i.current=s}),i}var Te=()=>{let[e,t]=O.useState(),n=J(()=>new Map);return q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ee(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function X({asChild:e,children:t},n){return e&&O.isValidElement(t)?O.cloneElement(Ee(t),{ref:t.ref},n(t.props.children)):n(t)}var De={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Z=n();function Oe({className:e,...t}){return(0,Z.jsx)(K,{"data-slot":`command`,className:l(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ke({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,filter:a,...o}){return(0,Z.jsxs)(T,{...o,children:[(0,Z.jsxs)(S,{className:`sr-only`,children:[(0,Z.jsx)(C,{children:e}),(0,Z.jsx)(w,{children:t})]}),(0,Z.jsx)(x,{className:l(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,Z.jsx)(Oe,{filter:a,className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function Ae({className:e,...t}){return(0,Z.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,Z.jsx)(D,{className:`size-4 shrink-0 opacity-50`}),(0,Z.jsx)(K.Input,{"data-slot":`command-input`,className:l(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function je({className:e,...t}){return(0,Z.jsx)(K.List,{"data-slot":`command-list`,className:l(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function Me({...e}){return(0,Z.jsx)(K.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Ne({className:e,...t}){return(0,Z.jsx)(K.Group,{"data-slot":`command-group`,className:l(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Pe({className:e,...t}){return(0,Z.jsx)(K.Separator,{"data-slot":`command-separator`,className:l(`-mx-1 h-px bg-border`,e),...t})}function Fe({className:e,...t}){return(0,Z.jsx)(K.Item,{"data-slot":`command-item`,className:l(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ie({className:e,...t}){return(0,Z.jsx)(`span`,{"data-slot":`command-shortcut`,className:l(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function Le(){let e=i(),t=a(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function Re(e,t){return e.filter(e=>e.provider===t).length>1}var Q=`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-55`,ze=(0,Z.jsx)(u,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`});function Be({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:o=!1,readOnly:s=!1,hint:c,disabledHint:l,status:u}){if(s)return(0,Z.jsx)(`span`,{"data-slot":e,"aria-label":t,title:l??c,className:`${Q} cursor-default hover:bg-card hover:text-muted-foreground`,children:n});let d=(0,Z.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:o,title:o?l:c,className:Q,children:[n,ze]});return o?(0,Z.jsx)(`span`,{title:l,className:`inline-flex`,children:d}):(0,Z.jsxs)(_,{children:[(0,Z.jsx)(p,{asChild:!0,children:d}),(0,Z.jsxs)(m,{align:`start`,"data-testid":`${e}-menu`,children:[(0,Z.jsx)(f,{value:r,onValueChange:a,children:i.map(e=>(0,Z.jsx)(h,{value:e.value,className:`gap-2.5`,children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:e.label}),e.desc?(0,Z.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),u?(0,Z.jsx)(g,{disabled:!0,className:`border-t border-border text-[11.5px] text-muted-foreground`,children:u}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function Ve({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o}){let s=d.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:$(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:$(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),c=a??o?.[t]??`default`,l=s.some(e=>e.value===$(t,c))?$(t,c):$(t,null);return(0,Z.jsx)(Be,{slot:`runner-pill`,ariaLabel:`Runner`,label:s.find(e=>e.value===l)?.label??t,value:l,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:s})}var He=80,Ue=2e3,We=50,Ge=200,Ke=50,qe=[{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 Je(e){return!!e&&typeof e==`object`}function Ye(e){if(e===void 0||!Array.isArray(e))return qe.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!Je(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=Xe(r.skills);if(n.push({id:e,label:i.slice(0,He),text:a.slice(0,Ue),...o.length>0?{skills:o}:{}}),n.length>=We)break}return n}function Xe(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,Ge)),t.size>=Ke))break}return[...t]}function Ze(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function Qe(e,t){return Ze(e,t).map(e=>e.text).join(`
|
|
2
2
|
|
|
3
3
|
`)}function $e(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function et(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function tt(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
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BLZyueuK.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,Br as i,Cn as a,Hr as o,In as s,K as c,Kr as l,M as u,St as d,Z as f,a as p,bt as m,dr as h,i as g,t as _,xt as v}from"./centered-state-DdbE_pNl.js";import{n as y,t as b}from"./utils-Unt0mZvU.js";import{t as x}from"./arrow-left-DtUM7GFU.js";import{y as S}from"./dropdown-menu-CPP9gEmn.js";import{i as C,n as w,r as T,t as E}from"./use-desktop-Cmrz3npD.js";import{t as D}from"./search-x-Drnmsmd0.js";import{t as O}from"./triangle-alert-Brk_ldFl.js";import{t as k}from"./project-router-Dzc0JK2j.js";import{t as A}from"./diff-stat-ydfu0_5T.js";import{S as j,a as M,g as N,x as P,y as F}from"./index-BQTfjxFm.js";import{t as I}from"./diff-Cv3z9esx.js";import{t as L}from"./tab-link-C5FWJ66Y.js";import{i as R,r as z,t as B}from"./git-toolbar-BEKuAjHk.js";import{t as V}from"./commit-list-Bgb1DHBX.js";var H=e(t(),1),U=n();function W({repo:e,info:t}){let n=f(),i=l(),a=e=>g(e.message,{tone:`danger`}),c=o({mutationFn:e=>s({name:e}),onSuccess:async e=>{g(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([i.invalidateQueries({queryKey:u.repo}),i.invalidateQueries({queryKey:u.health})]),i.setQueryData(u.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),i.setQueryData(u.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:a}),d=o({mutationFn:e=>h({baseBranch:e}),onSuccess:e=>{g(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),i.invalidateQueries({queryKey:u.repo})},onError:a}),[m,_]=(0,H.useState)(``),[v,y]=(0,H.useState)(``),x=v.trim().toLowerCase(),S=x?e.branches.filter(e=>e.toLowerCase().includes(x)):e.branches;return(0,U.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Branches`}),(0,U.jsx)(N,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:v,onChange:e=>y(e.target.value),className:`mt-2 max-w-xl`}),(0,U.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:[S.map(e=>{let n=e===t.branch;return(0,U.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,U.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:b(`min-w-0 truncate font-mono text-xs`,n&&`font-semibold`),children:e}),n?(0,U.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,U.jsx)(r,{"aria-hidden":`true`,className:`size-3`}),`current`]}):(0,U.jsx)(p,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:c.isPending,onClick:()=>c.mutate(e),children:`Switch`})]},e)}),S.length===0?(0,U.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,v.trim(),`”.`]}):null]}),(0,U.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=m.trim();t&&c.mutate(t,{onSuccess:()=>_(``)})},children:[(0,U.jsx)(N,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:m,onChange:e=>_(e.target.value)}),(0,U.jsxs)(p,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!m.trim()||c.isPending,children:[(0,U.jsx)(F,{"aria-hidden":`true`}),`Create`]})]})]}),(0,U.jsxs)(`div`,{className:`max-w-md`,children:[(0,U.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Agents’ base branch`}),(0,U.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:d.isPending,onChange:e=>d.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,U.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]}),(0,U.jsx)(`p`,{className:`mt-1 text-[11px] text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n.data?.forge?.available?(0,U.jsx)(G,{}):null]})}function G(){let e=c({limit:20});return(0,U.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,U.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,U.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,U.jsx)(K,{pr:e},e.number))}):(0,U.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 K({pr:e}){let t=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,U.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,U.jsx)(q,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,U.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:y(e.url)?(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:b(n,`hover:bg-muted`),children:t}):(0,U.jsx)(`span`,{className:n,children:t})})}function q({checks:e}){return(0,U.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 J(){let e=v(),t=E(),[n,r]=(0,H.useState)(`unified`),[i,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(null),l=(0,H.useRef)(null),u=e.isError&&e.error instanceof a&&e.error.status===409,d=e.data?.files??[],f=(0,H.useMemo)(()=>z(d),[d]),p=t?n:`unified`,m=!t||i;return(0,U.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.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,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,U.jsx)(B,{stat:e.data.stat}):null,(0,U.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,U.jsx)(T,{mode:n,wrap:i,onModeChange:r,onWrapChange:o})})]}),e.isPending?(0,U.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,U.jsx)(_,{icon:u?(0,U.jsx)(j,{}):(0,U.jsx)(O,{}),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,U.jsx)(_,{icon:(0,U.jsx)(j,{}),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,U.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,U.jsx)(`aside`,{"data-slot":`changes-tree-pane`,className:`sticky top-28 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain md:block lg:w-72`,children:(0,U.jsx)(R,{root:f,selected:s,onSelect:e=>{c(e),l.current?.scrollToPath(e)}})}),(0,U.jsx)(I,{files:d,viewRef:l,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function Y({log:e}){let{sha:t}=i();return t?(0,U.jsx)(X,{sha:t}):e.length===0?(0,U.jsx)(_,{icon:(0,U.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,U.jsx)(V,{slot:`repo-commits`,commits:e.map(e=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`}))})}function X({sha:e}){let t=d(e),n=E(),[r,i]=(0,H.useState)(`unified`),[o,s]=(0,H.useState)(!1),c=t.isError&&t.error instanceof a&&t.error.status===409,l=n?r:`unified`,u=!n||o;return(0,U.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.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,U.jsx)(p,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,U.jsxs)(k,{to:`/git/commits`,children:[(0,U.jsx)(x,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,U.jsx)(A,{stat:t.data.stat}):null,(0,U.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,U.jsx)(T,{mode:r,wrap:o,onModeChange:i,onWrapChange:s})})]}),t.isPending?(0,U.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,U.jsx)(_,{icon:c?(0,U.jsx)(D,{}):(0,U.jsx)(O,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,U.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,U.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,U.jsx)(_,{icon:(0,U.jsx)(C,{}),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,U.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,U.jsx)(I,{files:t.data.files,mode:l,wrap:u,className:`min-w-0`})})]})]})}function Z({tab:e}){let t=m();if(t.isPending)return(0,U.jsx)(M,{});if(t.isError)return(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(_,{icon:(0,U.jsx)(O,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,U.jsx)(Q,{repo:t.data,info:n,tab:e}):(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(_,{icon:(0,U.jsx)(P,{}),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 Q({repo:e,info:t,tab:n}){return(0,U.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,U.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,U.jsx)(w,{branch:t.branch}),t.remote?(0,U.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-[11px] text-soft-foreground md:inline`,children:t.remote}):null]}),(0,U.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,U.jsx)(L,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,U.jsx)(L,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,U.jsx)(L,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,U.jsx)(J,{}):n===`commits`?(0,U.jsx)(Y,{log:e.log}):(0,U.jsx)(W,{repo:e,info:t})]})}export{Z as RepoGitRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,Br as i,Cn as a,Hr as o,In as s,K as c,Kr as l,M as u,St as d,Z as f,a as p,bt as m,dr as h,i as g,t as _,xt as v}from"./centered-state-TyZe3tga.js";import{n as y,t as b}from"./utils-BLZyueuK.js";import{t as x}from"./arrow-left-BVgebuvi.js";import{y as S}from"./dropdown-menu-CQp168wo.js";import{i as C,n as w,r as T,t as E}from"./use-desktop-Co7z3Xov.js";import{t as D}from"./search-x-DJIOs-nB.js";import{t as O}from"./triangle-alert-BU7Fnc0D.js";import{t as k}from"./project-router-CF-1GU39.js";import{t as A}from"./diff-stat-CJSJmLcb.js";import{S as j,a as M,g as N,x as P,y as F}from"./index-CKWqcYjr.js";import{t as I}from"./diff-DtXK3tZy.js";import{t as L}from"./tab-link-CQgzNUwP.js";import{i as R,r as z,t as B}from"./git-toolbar-D9Wu2J60.js";import{t as V}from"./commit-list-BKtzO28W.js";var H=e(t(),1),U=n();function W({repo:e,info:t}){let n=f(),i=l(),a=e=>g(e.message,{tone:`danger`}),c=o({mutationFn:e=>s({name:e}),onSuccess:async e=>{g(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([i.invalidateQueries({queryKey:u.repo}),i.invalidateQueries({queryKey:u.health})]),i.setQueryData(u.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),i.setQueryData(u.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:a}),d=o({mutationFn:e=>h({baseBranch:e}),onSuccess:e=>{g(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),i.invalidateQueries({queryKey:u.repo})},onError:a}),[m,_]=(0,H.useState)(``),[v,y]=(0,H.useState)(``),x=v.trim().toLowerCase(),S=x?e.branches.filter(e=>e.toLowerCase().includes(x)):e.branches;return(0,U.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Branches`}),(0,U.jsx)(N,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:v,onChange:e=>y(e.target.value),className:`mt-2 max-w-xl`}),(0,U.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:[S.map(e=>{let n=e===t.branch;return(0,U.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,U.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:b(`min-w-0 truncate font-mono text-xs`,n&&`font-semibold`),children:e}),n?(0,U.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,U.jsx)(r,{"aria-hidden":`true`,className:`size-3`}),`current`]}):(0,U.jsx)(p,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:c.isPending,onClick:()=>c.mutate(e),children:`Switch`})]},e)}),S.length===0?(0,U.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,v.trim(),`”.`]}):null]}),(0,U.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=m.trim();t&&c.mutate(t,{onSuccess:()=>_(``)})},children:[(0,U.jsx)(N,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:m,onChange:e=>_(e.target.value)}),(0,U.jsxs)(p,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!m.trim()||c.isPending,children:[(0,U.jsx)(F,{"aria-hidden":`true`}),`Create`]})]})]}),(0,U.jsxs)(`div`,{className:`max-w-md`,children:[(0,U.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Agents’ base branch`}),(0,U.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:d.isPending,onChange:e=>d.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,U.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]}),(0,U.jsx)(`p`,{className:`mt-1 text-[11px] text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n.data?.forge?.available?(0,U.jsx)(G,{}):null]})}function G(){let e=c({limit:20});return(0,U.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,U.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,U.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,U.jsx)(K,{pr:e},e.number))}):(0,U.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 K({pr:e}){let t=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,U.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,U.jsx)(q,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,U.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:y(e.url)?(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:b(n,`hover:bg-muted`),children:t}):(0,U.jsx)(`span`,{className:n,children:t})})}function q({checks:e}){return(0,U.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 J(){let e=v(),t=E(),[n,r]=(0,H.useState)(`unified`),[i,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(null),l=(0,H.useRef)(null),u=e.isError&&e.error instanceof a&&e.error.status===409,d=e.data?.files??[],f=(0,H.useMemo)(()=>z(d),[d]),p=t?n:`unified`,m=!t||i;return(0,U.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.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,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,U.jsx)(B,{stat:e.data.stat}):null,(0,U.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,U.jsx)(T,{mode:n,wrap:i,onModeChange:r,onWrapChange:o})})]}),e.isPending?(0,U.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,U.jsx)(_,{icon:u?(0,U.jsx)(j,{}):(0,U.jsx)(O,{}),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,U.jsx)(_,{icon:(0,U.jsx)(j,{}),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,U.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,U.jsx)(`aside`,{"data-slot":`changes-tree-pane`,className:`sticky top-28 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain md:block lg:w-72`,children:(0,U.jsx)(R,{root:f,selected:s,onSelect:e=>{c(e),l.current?.scrollToPath(e)}})}),(0,U.jsx)(I,{files:d,viewRef:l,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function Y({log:e}){let{sha:t}=i();return t?(0,U.jsx)(X,{sha:t}):e.length===0?(0,U.jsx)(_,{icon:(0,U.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,U.jsx)(V,{slot:`repo-commits`,commits:e.map(e=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`}))})}function X({sha:e}){let t=d(e),n=E(),[r,i]=(0,H.useState)(`unified`),[o,s]=(0,H.useState)(!1),c=t.isError&&t.error instanceof a&&t.error.status===409,l=n?r:`unified`,u=!n||o;return(0,U.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.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,U.jsx)(p,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,U.jsxs)(k,{to:`/git/commits`,children:[(0,U.jsx)(x,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,U.jsx)(A,{stat:t.data.stat}):null,(0,U.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,U.jsx)(T,{mode:r,wrap:o,onModeChange:i,onWrapChange:s})})]}),t.isPending?(0,U.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,U.jsx)(_,{icon:c?(0,U.jsx)(D,{}):(0,U.jsx)(O,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,U.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,U.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,U.jsx)(_,{icon:(0,U.jsx)(C,{}),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,U.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,U.jsx)(I,{files:t.data.files,mode:l,wrap:u,className:`min-w-0`})})]})]})}function Z({tab:e}){let t=m();if(t.isPending)return(0,U.jsx)(M,{});if(t.isError)return(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(_,{icon:(0,U.jsx)(O,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,U.jsx)(Q,{repo:t.data,info:n,tab:e}):(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(_,{icon:(0,U.jsx)(P,{}),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 Q({repo:e,info:t,tab:n}){return(0,U.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,U.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,U.jsx)(w,{branch:t.branch}),t.remote?(0,U.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-[11px] text-soft-foreground md:inline`,children:t.remote}):null]}),(0,U.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,U.jsx)(L,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,U.jsx)(L,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,U.jsx)(L,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,U.jsx)(J,{}):n===`commits`?(0,U.jsx)(Y,{log:e.log}):(0,U.jsx)(W,{repo:e,info:t})]})}export{Z as RepoGitRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Kr as r,M as i,Ot as a,a as o}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Kr as r,M as i,Ot as a,a as o}from"./centered-state-TyZe3tga.js";import{t as s}from"./utils-BLZyueuK.js";import{t as c}from"./chevron-right-W2B4c3Bn.js";import{n as l,r as u,t as d}from"./collapsible-DTRw1YnV.js";import{i as f,r as p}from"./highlighter-CdHqIwFr.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
|
|
2
2
|
`)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=r(),n=a(e);(0,m.useEffect)(()=>{t.invalidateQueries({queryKey:i.runs.diff(e)})},[t,e]);let s=(0,m.useMemo)(()=>y(n.data??``),[n.data]),[c,l]=(0,m.useState)(!1);if(n.isPending)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(s.length===0)return(0,x.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let u=b(s),d=c?s:s.slice(0,S);return(0,x.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,x.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,x.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]})]})]}),d.map(e=>(0,x.jsx)(E,{file:e},`${e.oldPath??``}→${e.path}`)),s.length>d.length?(0,x.jsxs)(o,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>l(!0),children:[`Show `,s.length-d.length,` more files`]}):null]})}var T={added:`added`,deleted:`deleted`,renamed:`renamed`};function E({file:e}){let[t,n]=(0,m.useState)(!0),r=T[e.status];return(0,x.jsxs)(d,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,x.jsxs)(u,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,x.jsx)(c,{className:s(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:r}):null,e.binary?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:`binary`}):null,(0,x.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,x.jsx)(l,{children:(0,x.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,x.jsx)(D,{lines:e.lines})})})]})}function D({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,C),i=r.join(`
|
|
3
3
|
`),[a,o]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=!1;return p(i,`diff`).then(t=>{e||o({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:f(i,`diff`)?.tokens??null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,x.jsxs)(`span`,{className:s(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,x.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>C?(0,x.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,At as i,B as a,Bn as o,Cn as s,Dn as c,Hn as l,Hr as u,Kr as d,M as f,Nt as p,Pn as m,R as h,Z as g,a as _,an as v,ar as ee,at as y,en as te,gn as b,i as x,in as ne,ir as re,it as ie,k as ae,kn as oe,kr as S,ln as se,mn as ce,nn as le,nt as ue,ot as de,pt as fe,sn as pe,ut as C}from"./centered-state-TyZe3tga.js";import{n as w,r as T,t as E}from"./utils-BLZyueuK.js";import{A as D,O as me,_ as O,c as he,f as ge,h as _e,k,m as ve,n as ye,p as A,r as be,s as xe,t as Se,v as Ce,w as we}from"./editable-title-BWosq6YG.js";import{S as Te,T as Ee,d as De,w as Oe,x as j}from"./new-task-form-CZAdHx_5.js";import{c as M,i as N,n as P,r as F,s as I,t as L,x as ke}from"./dropdown-menu-CQp168wo.js";import{n as R,t as z}from"./trash-2-CwmIdbv2.js";import{t as Ae}from"./ellipsis-vertical-BXllsyll.js";import{t as B}from"./square-terminal-CnrkOecA.js";import{n as je,r as Me,t as Ne}from"./collapsible-DTRw1YnV.js";import{a as Pe,c as V,i as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be}from"./alert-dialog-Bib2-aHJ.js";import{c as Ve,t as He}from"./project-router-CF-1GU39.js";import{a as Ue,n as We,r as Ge,t as Ke}from"./pill-B9vrSbT6.js";import{t as qe}from"./markdown-Cvzv-jvo.js";import{t as Je}from"./diff-stat-CJSJmLcb.js";import{t as H}from"./tab-link-CQgzNUwP.js";var U=T(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),W=T(`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`}]]),G=T(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),K=e(t(),1);function q(e,t=null){let n=C(),r=S(n.data),i=e.runner??`claude`,a=De(t,r,i),o=r.includes(i),s=n.isSuccess&&r.length>0,c=n.isPending?`Checking agent providers…`:n.isError?`Provider authentication could not be verified.`:s?void 0:`Connect an agent provider to continue.`;return{runners:r,currentRunner:i,runner:a,currentRunnerConnected:o,canContinue:s,providerPending:n.isPending,providerError:n.isError,reason:c,runnerOverride:t!==null||!o?a:void 0}}var J=n();function Y(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 X(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 Ye({steps:e}){if(e.length===0)return null;let t=X(e)*100;return(0,J.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,J.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":Y(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,J.jsx)(Xe,{visual:Y(t.status)}),(0,J.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,J.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,J.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,J.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,J.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function Xe({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,J.jsx)(Oe,{"aria-hidden":!0,className:E(t,`text-success`)});case`active`:return(0,J.jsx)(ae,{role:`status`,"aria-label":`Step running`,className:E(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,J.jsx)(Te,{"aria-hidden":!0,className:E(t,`text-danger`)});case`pending`:return(0,J.jsx)(ke,{"aria-hidden":!0,className:E(t,`text-soft-foreground`)})}}function Ze(e){let t=e.findIndex(e=>Y(e.status)===`active`);if(t>=0)return t;let n=e.findIndex(e=>Y(e.status)===`pending`);return n>=0?n:Math.max(0,e.length-1)}function Qe({visual:e}){return(0,J.jsx)(`span`,{"aria-hidden":!0,"data-slot":`step-dot`,"data-visual":e,className:E(`size-1.5 rounded-full`,e===`done`?`bg-success`:e===`failed`?`bg-danger`:e===`active`?`bg-pending`:`bg-soft-foreground`,e===`active`&&`animate-pulse motion-reduce:animate-none`)})}var Z=new Map;function $e({runId:e,steps:t}){let[n,r]=(0,K.useState)(()=>Z.get(e)??!1);if(t.length===0)return null;let i=t=>{Z.set(e,t),r(t)},a=Ze(t),o=t[a],s=X(t)*100;return(0,J.jsxs)(Ne,{"data-slot":`workflow-steps`,open:n,onOpenChange:i,className:`min-w-0`,children:[(0,J.jsxs)(Me,{"aria-label":`Workflow: ${o.name}, step ${a+1} of ${t.length}`,className:`group flex min-h-[30px] w-full items-center gap-2.5 text-left text-xs text-muted-foreground hover:text-foreground`,children:[(0,J.jsx)(`span`,{"data-slot":`step-dots`,className:`flex shrink-0 items-center gap-1`,children:t.map(e=>(0,J.jsx)(Qe,{visual:Y(e.status)},e.id))}),(0,J.jsx)(`span`,{className:`min-w-0 max-w-[45%] shrink truncate font-semibold text-foreground`,children:o.name}),(0,J.jsxs)(`span`,{className:`shrink-0 text-soft-foreground tabular-nums`,children:[`step `,a+1,` of `,t.length]}),(0,J.jsx)(`span`,{"data-slot":`step-summary-progress`,className:`h-0.5 min-w-[36px] flex-1 overflow-hidden rounded-full bg-muted`,children:(0,J.jsx)(`span`,{className:`block h-full rounded-full bg-pending`,style:{width:`${s}%`}})}),(0,J.jsx)(Ee,{"aria-hidden":!0,className:`size-4 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-180`})]}),(0,J.jsx)(je,{children:(0,J.jsx)(`div`,{className:`pt-2`,children:(0,J.jsx)(Ye,{steps:t})})})]})}function Q(e){let t=d();return u({mutationFn:()=>l(e),onSuccess:()=>t.invalidateQueries({queryKey:f.runs.all}),onError:e=>x(e.message,{tone:`danger`})})}function et({run:e,planTally:t,tab:n=`session`,onMarkedUnread:i}){let a=Ue(e),o=A(e),s=ge(e),[c,l]=(0,K.useState)(!1),u=nt(e,i),d=p(),f=g(),m=We(f.data),h=e.status===`queued`?ce(d.data??[]).get(e.id):void 0;return(0,J.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,J.jsxs)(`div`,{className:`mx-auto w-full max-w-[var(--measure)]`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(rt,{run:e}),(0,J.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2.5`,children:[t?(0,J.jsxs)(`span`,{"data-slot":`plan-mirror`,className:`text-[11px] text-soft-foreground tabular-nums`,children:[`Plan `,t.done,`/`,t.total]}):null,(0,J.jsxs)(Ke,{dot:a.tone,pulse:a.pulse,children:[a.label,h===void 0?``:` #${h}`]}),(0,J.jsx)(st,{run:e,actions:u,onToggleNotes:()=>l(e=>!e)})]})]}),(0,J.jsx)(it,{run:e,showTokens:m.tokens,showCost:m.cost,automationsAvailable:f.data?.capabilities?.automations===!0}),(0,J.jsx)(at,{run:e}),(0,J.jsxs)(`div`,{"data-slot":`run-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,J.jsx)(H,{to:`/tasks/${e.id}`,active:n===`session`,children:`Session`}),(0,J.jsx)(H,{to:`/tasks/${e.id}/changes`,active:n===`changes`,children:`Changes`}),(0,J.jsx)(H,{to:`/tasks/${e.id}/commits`,active:n===`commits`,children:`Commits`}),(0,J.jsx)(H,{to:`/tasks/${e.id}/files`,active:n===`files`,children:`Files`}),(0,J.jsxs)(`div`,{"data-slot":`run-actions`,className:`ml-auto hidden items-center gap-1 pb-1 md:flex`,children:[o.finish?(0,J.jsxs)(_,{variant:`outline`,size:`sm`,title:he(e.status),onClick:()=>u.finish.mutate(),children:[(0,J.jsx)(r,{"aria-hidden":`true`}),`Finish`]}):null,o.continueRun?(0,J.jsxs)(_,{variant:`outline`,size:`sm`,title:u.continuation.reason??`Reopen the session`,disabled:u.continueRun.isPending||!u.continuation.canContinue,onClick:()=>u.continueRun.mutate(),children:[(0,J.jsx)(j,{"aria-hidden":`true`}),`Continue`]}):null,(0,J.jsx)(tt,{run:e,canResume:o.terminal,onResume:()=>u.terminal.mutate()}),(0,J.jsxs)(_,{variant:`ghost`,size:`sm`,title:`Handoff notes — what the agent did and what's left`,"aria-expanded":c,onClick:()=>l(e=>!e),children:[(0,J.jsx)(W,{"aria-hidden":`true`}),`Notes`]}),o.markUnread?(0,J.jsxs)(_,{variant:`ghost`,size:`sm`,title:`Put this task back in the unread list`,disabled:u.markUnread.isPending,onClick:()=>u.markUnread.mutate(),children:[(0,J.jsx)(G,{"aria-hidden":`true`}),`Mark unread`]}):null,o.archive?(0,J.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:()=>u.archive.mutate(),children:[e.archived?(0,J.jsx)(D,{"aria-hidden":`true`}):(0,J.jsx)(k,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,o.cancel?(0,J.jsxs)(_,{variant:`danger-ghost`,size:`sm`,onClick:()=>u.setConfirming(`cancel`),children:[(0,J.jsx)(U,{"aria-hidden":`true`}),`Cancel`]}):null,o.deleteRun?(0,J.jsxs)(_,{variant:`danger-ghost`,size:`sm`,onClick:()=>u.setConfirming(`delete`),children:[(0,J.jsx)(z,{"aria-hidden":`true`}),`Delete`]}):null]})]}),e.steps.length>0?(0,J.jsx)(`div`,{className:`border-t border-border pt-2 pb-1`,children:(0,J.jsx)($e,{runId:e.id,steps:e.steps})}):null,s?(0,J.jsx)(lt,{hint:s}):null,c?(0,J.jsx)(ut,{runId:e.id}):null]}),(0,J.jsx)(ct,{run:e,actions:u})]})}function tt({run:e,canResume:t,onResume:n}){let r=ie(),i=C(),a=u({mutationFn:t=>re(e.id,t),onError:e=>x(e.message,{tone:`danger`})}),o=S(i.data),s=e=>!i.isSuccess||o.includes(e??`claude`),c=t&&s(e.runner),l=e.worktreePath?(r.data?.targets??[]).filter(e=>{let t=_e(e.id);return t===void 0||s(t)}).map(t=>({target:t,...xe(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[];return!c&&l.length===0?null:(0,J.jsx)(ve,{choices:l,onPick:e=>a.mutate(e),title:`Resume in a terminal, or open the worktree locally`,leading:c?(0,J.jsxs)(F,{"data-target":`terminal-resume`,onSelect:n,children:[(0,J.jsx)(B,{"aria-hidden":`true`}),`Terminal (resume session)`]}):null,trailing:e.worktreePath?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(I,{}),(0,J.jsxs)(F,{onSelect:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>x(`Worktree path copied`)).catch(()=>x(`Path: ${t}`))},children:[(0,J.jsx)(R,{"aria-hidden":`true`}),`Copy worktree path`]})]}):null})}function nt(e,t){let n=d(),r=Ve(),[i,a]=(0,K.useState)(null),l=()=>n.invalidateQueries({queryKey:f.runs.all}),p=e=>x(e.message,{tone:`danger`}),h=Q(e.id),g=q(e),_=u({mutationFn:async()=>g.canContinue?m(e.id,{runner:g.runnerOverride}):null,onSuccess:e=>{e!==null&&l()},onError:p}),v=u({mutationFn:()=>c(e.id,!e.archived),onSuccess:l,onError:p}),y=ue();return{finish:h,continuation:g,continueRun:_,archive:v,markUnread:{isPending:y.isPending,mutate:()=>{t?.(),y.mutate(e.id,{onError:p})}},cancel:u({mutationFn:()=>oe(e.id),onSuccess:l,onError:p}),delete:u({mutationFn:()=>o(e.id),onSuccess:()=>{l(),r(`/`)},onError:p}),terminal:u({mutationFn:()=>ee(e.id),onError:e=>{if(e instanceof s&&e.command){$(e.command,`No terminal found — command copied to clipboard.`);return}p(e)}}),confirming:i,setConfirming:a}}async function $(e,t){try{await navigator.clipboard.writeText(e),x(t)}catch{x(`Run manually: ${e}`)}}function rt({run:e}){let t=y(e.id),n=b(e),r=ye(n,e=>t.mutate({title:e},{onError:e=>x(e.message,{tone:`danger`})}));return r.editing?(0,J.jsx)(Se,{editor:r,className:`flex-1 text-[15px] font-semibold`}):(0,J.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,J.jsx)(`h1`,{className:`min-w-0 truncate text-[15px] font-semibold`,title:e.task,children:n}),(0,J.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,J.jsx)(we,{className:`size-3.5`,"aria-hidden":`true`})})]})}function it({run:e,showTokens:t,showCost:n,automationsAvailable:r}){let i=de(),a=fe(),o=(0,K.useMemo)(()=>pe(e,i),[e,i]),s=(0,K.useMemo)(()=>a===void 0?[]:o.map(e=>({projectId:a,kind:e.kind,number:e.number})),[o,a]),c=[(0,J.jsx)(`span`,{children:se(e)},`workflow`)];e.branch&&c.push((0,J.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`));let l=o.filter(e=>e.kind===`PR`);for(let t of l)c.push((0,J.jsx)(O,{reference:t,taskTitle:b(e),className:`h-5`,conflictAction:(0,J.jsx)(be,{run:e,prNumber:t.number})},`pr-${t.number}`));let u=v(e);u&&w(u)&&!l.some(e=>e.url===u)&&c.push((0,J.jsx)(O,{reference:{kind:`PR`,url:u},taskTitle:b(e),className:`h-5`},`pr`));let d=ne(e,i);if(d&&w(d)){let t=le(d);c.push((0,J.jsx)(O,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},taskTitle:b(e),className:`h-5`},`issue`))}e.diffStat&&c.push((0,J.jsx)(Je,{stat:e.diffStat},`diff`)),e.automation&&c.push(r?(0,J.jsx)(He,{to:`/automations/${encodeURIComponent(e.automation.automationId)}/log`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium hover:text-foreground`,children:`Automation`},`automation`):(0,J.jsx)(`span`,{"data-slot":`automation-origin`,title:`Automations are off on this server (CEZ_AUTOMATIONS)`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium`,children:`Automation`},`automation`));let f=[];return t&&(e.inputTokens!==void 0||e.outputTokens!==void 0)&&f.push((0,J.jsx)(Ge,{inputTokens:e.inputTokens,outputTokens:e.outputTokens},`tokens`)),n&&e.costUsd&&f.push((0,J.jsx)(`span`,{className:`tabular-nums`,children:te(e.costUsd)},`cost`)),(0,J.jsx)(Ce,{projectId:a,requests:s,children:(0,J.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:[c.map((e,t)=>(0,J.jsxs)(K.Fragment,{children:[t>0?(0,J.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,J.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[f.map((e,t)=>(0,J.jsxs)(K.Fragment,{children:[t>0?(0,J.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,J.jsx)(ot,{run:e})]})]})})}function at({run:e}){if(e.status!==`running`||e.activity!==`monitoring`)return null;if(e.monitoringWakeCapReached)return(0,J.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Automatic checks paused — 40/40 reached`});let t=e.monitoringWakeAt?new Date(e.monitoringWakeAt):null,n=t&&Number.isFinite(t.getTime())?t:null;if(!n)return(0,J.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Parked — no automatic check scheduled`});let r=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n);return(0,J.jsxs)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:[`Next automatic check`,` `,(0,J.jsx)(`time`,{dateTime:e.monitoringWakeAt,className:`font-medium text-foreground`,children:r})]})}function ot({run:e}){let t=a(),n=h(),r=e.runner??t.data?.defaultRunner??`claude`,i=e.model??`auto`,o=e.effort||void 0,s=[...e.steps].reverse().find(e=>e.profileId)?.profileId,c=s===void 0?void 0:s==="default"?`default`:n.data?.profiles.find(e=>e.id===s)?.label??`${s} (removed)`,l=e.modelIdentity&&e.modelIdentity!==i?e.modelIdentity:void 0,u=[r,c,i,o].filter(Boolean).join(` · `);return(0,J.jsxs)(L,{children:[(0,J.jsx)(M,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,"data-slot":`agent-badge`,title:u,"aria-label":`Agent: ${r}, ${c?`account ${c}, `:``}model ${i}${o?`, effort ${o}`:``}`,className:`flex min-w-0 shrink items-center gap-1.5 rounded-sm px-1 py-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,J.jsx)(me,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{"data-slot":`agent-badge-summary`,className:`truncate font-mono text-[11px]`,children:u})]})}),(0,J.jsxs)(P,{align:`end`,className:`min-w-[9rem]`,children:[(0,J.jsxs)(N,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`runner: `,r]}),c?(0,J.jsxs)(N,{"data-slot":`agent-badge-account`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`account: `,c]}):null,(0,J.jsxs)(N,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`model: `,i]}),o?(0,J.jsxs)(N,{"data-slot":`agent-badge-effort`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`effort: `,o]}):null,l?(0,J.jsxs)(N,{"data-slot":`agent-badge-identity`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`identity: `,l]}):null]})]})}function st({run:e,actions:t,onToggleNotes:n}){let i=A(e);return(0,J.jsxs)(L,{children:[(0,J.jsx)(M,{asChild:!0,children:(0,J.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`Run actions`,className:`md:hidden`,children:(0,J.jsx)(Ae,{"aria-hidden":`true`})})}),(0,J.jsxs)(P,{align:`end`,"data-slot":`run-actions-menu`,children:[i.finish?(0,J.jsxs)(F,{onSelect:()=>t.finish.mutate(),children:[(0,J.jsx)(r,{"aria-hidden":`true`}),` Finish`]}):null,i.continueRun?(0,J.jsxs)(F,{disabled:!t.continuation.canContinue||t.continueRun.isPending,title:t.continuation.reason,onSelect:()=>t.continueRun.mutate(),children:[(0,J.jsx)(j,{"aria-hidden":`true`}),` Continue`]}):null,i.terminal?(0,J.jsxs)(F,{onSelect:()=>t.terminal.mutate(),children:[(0,J.jsx)(B,{"aria-hidden":`true`}),` Terminal`]}):null,(0,J.jsxs)(F,{onSelect:n,children:[(0,J.jsx)(W,{"aria-hidden":`true`}),` Notes`]}),i.markUnread?(0,J.jsxs)(F,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,J.jsx)(G,{"aria-hidden":`true`}),` Mark unread`]}):null,i.archive?(0,J.jsxs)(F,{onSelect:()=>t.archive.mutate(),children:[e.archived?(0,J.jsx)(D,{"aria-hidden":`true`}):(0,J.jsx)(k,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,i.cancel||i.deleteRun?(0,J.jsx)(I,{}):null,i.cancel?(0,J.jsxs)(F,{variant:`destructive`,onSelect:()=>t.setConfirming(`cancel`),children:[(0,J.jsx)(U,{"aria-hidden":`true`}),` Cancel`]}):null,i.deleteRun?(0,J.jsxs)(F,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,J.jsx)(z,{"aria-hidden":`true`}),` Delete`]}):null]})]})}function ct({run:e,actions:t}){let n=t.confirming;return(0,J.jsx)(Be,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,J.jsxs)(Fe,{children:[(0,J.jsxs)(ze,{children:[(0,J.jsx)(V,{children:n===`delete`?`Delete this task?`:`Cancel this task?`}),(0,J.jsx)(Pe,{children:n===`delete`?(0,J.jsxs)(J.Fragment,{children:[`This removes the run, its transcript, its worktree and its branch. There is no undo.`,(0,J.jsx)(`span`,{className:`mt-1 block truncate font-medium text-foreground`,title:b(e),children:b(e)})]}):`The agent is stopped and the run completes as cancelled. The worktree stays.`})]}),(0,J.jsxs)(Le,{children:[(0,J.jsx)(Re,{children:`Keep it`}),(0,J.jsx)(Ie,{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 lt({hint:e}){return(0,J.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,J.jsx)(R,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,J.jsxs)(`span`,{className:`truncate`,children:[`take over interactively: `,e]})]})}function ut({runId:e}){let t=i(e);return(0,J.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,J.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):t.isError?(0,J.jsx)(`p`,{className:`text-xs text-danger`,children:t.error.message}):t.data.trim().length>0?(0,J.jsx)(qe,{children:t.data}):(0,J.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})})}export{W as i,Q as n,q as r,et as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BLZyueuK.js";var t=e(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./utils-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./utils-BLZyueuK.js";var n=t(`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`}]]),r=e(),i=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`];function a({children:e}){return(0,r.jsx)(`span`,{className:`font-mono`,children:e})}function o(){return(0,r.jsx)(r.Fragment,{children:i.map((e,t)=>(0,r.jsxs)(`span`,{children:[t>0?t===i.length-1?`, or `:`, `:``,(0,r.jsx)(a,{children:e})]},e))})}function s(){return(0,r.jsxs)(r.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,r.jsx)(o,{}),` (agent mirrors like`,` `,(0,r.jsx)(a,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,r.jsx)(a,{children:`name`}),`,`,` `,(0,r.jsx)(a,{children:`description`}),`. Global (`,(0,r.jsx)(a,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh.`]})}function c(){return(0,r.jsxs)(r.Fragment,{children:[`No skills yet — drop Markdown files into `,(0,r.jsx)(o,{}),` (or a global/team-repo skill source).`]})}export{c as n,n as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,Gt as i,Hr as a,Kr as o,Ln as s,Lt as c,M as l,Rt as u,Sn as d,Ut as f,Vr as p,a as m,gr as h,i as g,jn as _,lt as v,mr as y,qt as b,t as x,wn as S}from"./centered-state-TyZe3tga.js";import{t as C}from"./utils-BLZyueuK.js";import{t as w}from"./arrow-left-BVgebuvi.js";import{b as T,m as E,w as D}from"./new-task-form-CZAdHx_5.js";import{r as O,t as k}from"./skill-empty-hint-BcecPZ6K.js";import{t as A}from"./refresh-cw-D5a-hkgq.js";import{t as j}from"./sparkles-C-1JzGqe.js";import{t as M}from"./triangle-alert-BU7Fnc0D.js";import{a as N,c as P,l as F,o as I,r as L,s as R}from"./use-submit-shortcut-DfJM2Y1U.js";import{c as z,t as B}from"./project-router-CF-1GU39.js";import{i as V,n as H,o as U,p as W}from"./skills-9oR_oHse.js";import{c as G,g as K,o as q,t as ee}from"./index-CKWqcYjr.js";var J=e(t(),1),Y=n(),te=`https://github.com/open-mercato/skills`;function ne(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function X(e,t){return ne(e)??[...t]}function re({projectId:e}){let t=o(),n=i(),a=r(),[s,c]=(0,J.useState)(``),d=u(e,!!e),f=a.data??[],p=(0,J.useMemo)(()=>f.map(e=>e.name),[f]),m=(0,J.useRef)([]);m.current=p;let h=(0,J.useMemo)(()=>new Set(X(n.data,p)),[n.data,p]),_=(0,J.useRef)(Promise.resolve()),v=(0,J.useRef)(0),S=(0,J.useCallback)(e=>{let n=b.uiState,r=t.getQueryData(n),i=e(X(r,m.current));t.setQueryData(n,{...r,importedSkills:i});let a=++v.current;_.current=_.current.then(async()=>{try{let e=await y({importedSkills:i});a===v.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:l.skills}))}catch(e){g(e instanceof Error?e.message:String(e),{tone:`danger`}),a===v.current&&t.invalidateQueries({queryKey:n})}})},[t]),w=(0,J.useCallback)(e=>{S(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[S]),T=p.length>0&&p.every(e=>h.has(e)),E=(0,J.useCallback)(()=>{if(T){let e=new Set(m.current);S(t=>t.filter(t=>!e.has(t)))}else S(e=>[...new Set([...e,...m.current])])},[T,S]);if(a.isError)return(0,Y.jsx)(x,{icon:(0,Y.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:a.error.message});let D=s.trim().toLowerCase(),O=D?f.filter(e=>e.name.toLowerCase().includes(D)||(e.description??``).toLowerCase().includes(D)):f;return(0,Y.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`mx-auto w-full max-w-2xl`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold`,children:`Manage skills`}),(0,Y.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Reusable, technology-agnostic agent skills from`,` `,(0,Y.jsx)(`a`,{href:te,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2 hover:text-foreground`,children:`open-mercato/skills`}),` `,`— PR creation, code review, CI stabilisation, spec writing and more. They're all in your catalog and the composer picker by default; uncheck any you don't want.`]}),(0,Y.jsx)(ie,{projectId:e,state:d.data,loadError:d.error}),(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`These checkboxes choose what cezar shows; updates refresh installed skill files.`}),(0,Y.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,Y.jsx)(K,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:s,onChange:e=>c(e.target.value),className:`h-8 text-[13px]`}),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`import-all`,disabled:p.length===0||n.isPending,onClick:E,className:`h-8 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:T?`Remove all`:`Enable all`})]}),(0,Y.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:a.isPending?(0,Y.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):O.length>0?O.map(e=>{let t=h.has(e.name);return(0,Y.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:C(`flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-2.5 py-2 transition-colors hover:bg-muted`,t&&`bg-muted`),children:[(0,Y.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>w(e.name),className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-soft-foreground`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[13px] font-medium text-foreground`,children:e.name})]}),e.description?(0,Y.jsx)(`span`,{className:`mt-0.5 block pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,Y.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:f.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ie({projectId:e,state:t,loadError:n}){let r=o(),i=z(),c=(0,J.useRef)(0),[u,d]=(0,J.useState)(!1),f=a({mutationFn:()=>s({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{d(!1),i(E(e))},onError:e=>g(e.message,{tone:`danger`})}),p=(t,n)=>{n.seq===c.current&&(r.setQueryData(b.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:l.skills}),g(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),d(!0)))},h=(e,t)=>{t.seq===c.current&&g(e.message,{tone:`danger`})},v=a({mutationFn:t=>_(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>p(e,t),onError:(e,t)=>h(e,t)}),y=a({mutationFn:t=>S(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>p(e,t),onError:(e,t)=>h(e,t)}),x=e=>{let n=++c.current;e===`apply`?y.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):v.mutate({action:e,seq:n})},w=t?.scopes.some(e=>e.skills.length>0)??!1,T=t?.status===`error`,O=w&&(t?.available||T),k=y.isPending||t?.status===`updating`,j=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],M=t?.scopes.filter(e=>e.updatedAt&&!j.includes(e))??[],B=`Checking installed Open Mercato skills…`;return n?B=`Update status is unavailable right now.`:t?.status===`available`?B=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?B=`Updating installed Open Mercato skills…`:t?.status===`current`?B=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?B=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(B=`The update did not finish for every installation.`),(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-muted/30 p-3`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:B}),t?.checkedAt?(0,Y.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,Y.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,Y.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,j.length>0?(0,Y.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,j.map(e=>Z(e.scope)).join(`, `),M.length?`; updated: ${M.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),O?(0,Y.jsxs)(m,{"data-action":`skills-update-apply`,size:`sm`,disabled:k,onClick:()=>x(`apply`),children:[(0,Y.jsx)(A,{"aria-hidden":`true`,className:C(`size-3.5`,k&&`motion-safe:animate-spin`)}),k?`Updating…`:T?`Retry`:`Update now`]}):t?.status===`current`?(0,Y.jsx)(m,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:v.isPending,onClick:()=>x(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,Y.jsx)(m,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:v.isPending,onClick:()=>x(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,Y.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,Y.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,Y.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-primary/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,Y.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,Y.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,Y.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,Y.jsx)(L,{open:u,onOpenChange:e=>f.isPending?void 0:d(e),children:(0,Y.jsxs)(N,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{children:`Apply the upgrade notes now?`}),(0,Y.jsxs)(I,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,Y.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,Y.jsxs)(R,{children:[(0,Y.jsx)(m,{type:`button`,variant:`outline`,disabled:f.isPending,onClick:()=>d(!1),children:`No`}),(0,Y.jsx)(m,{type:`button`,disabled:f.isPending,onClick:()=>f.mutate(),children:f.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function ae(){return(0,Y.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,Y.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,Y.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,Y.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,Y.jsx)(oe,{})]})}function oe(){let e=c(),t=f(),n=r(),[i]=p(),[s,u]=(0,J.useState)(``),m=o(),_=v(),y=d().projectId??_.data?.bootProject??``,b=a({mutationFn:()=>h(),onSuccess:e=>{m.setQueryData(l.skills,e),g(`Team skills refreshed.`)},onError:e=>g(e.message,{tone:`danger`})});if(e.isError)return(0,Y.jsx)(x,{icon:(0,Y.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let S=U(e.data??[]),E=(n.data?.length??0)>0,D=i.get(`skill`),N=D===Q||D===$||D!==null&&S.some(e=>e.name===D)?D:S[0]?.name??(E?$:Q),P=S.find(e=>e.name===N)??null,F=H(S,s);return(0,Y.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,Y.jsxs)(`section`,{"data-slot":`skills-list`,className:C(`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))]`,D===null?`flex`:`hidden md:flex`),children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,Y.jsx)(K,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:s,onChange:e=>u(e.target.value),className:`h-8 text-[13px]`}),(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:b.isPending,onClick:()=>b.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,Y.jsx)(A,{"aria-hidden":`true`,className:C(`size-3`,b.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,Y.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,Y.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):F.length>0?F.map(e=>(0,Y.jsx)(se,{skill:e,active:N===e.name},e.path)):(0,Y.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:S.length>0?`(no skills match)`:(0,Y.jsx)(k,{})})}),(0,Y.jsxs)(`div`,{className:`shrink-0 border-t border-border p-2`,children:[E?(0,Y.jsxs)(B,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":N===$?`page`:void 0,className:C(`mb-1 flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,N===$&&`bg-muted`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Manage skills`}),(0,Y.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:`open-mercato`})]}),(0,Y.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`Choose which open-mercato skills appear in your catalog.`})]}):null,(0,Y.jsxs)(B,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":N===Q?`page`:void 0,className:C(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,N===Q&&`bg-muted`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,Y.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,Y.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})]})]}),(0,Y.jsx)(`section`,{"data-slot":`skills-detail`,className:C(`min-w-0 flex-1 flex-col`,D===null?`hidden md:flex`:`flex`),children:(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,Y.jsxs)(B,{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,Y.jsx)(w,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),N===$?(0,Y.jsx)(re,{projectId:y}):N===Q?(0,Y.jsx)(ee,{skills:S}):P?(0,Y.jsx)(q,{skill:P,usedBy:W(t.data?.workflows??[],P.name)}):e.isPending?null:(0,Y.jsx)(x,{icon:(0,Y.jsx)(j,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})}function se({skill:e,active:t}){let n=V(e);return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(B,{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:C(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,t&&`bg-muted`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(j,{"aria-hidden":`true`,className:C(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,Y.jsx)(`span`,{className:C(`min-w-0 truncate font-mono text-[13px]`,n?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,Y.jsx)(G,{source:e.source,className:`ml-auto`})]}),e.description?(0,Y.jsx)(`span`,{className:`line-clamp-2 pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})})}export{ae as SkillsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BLZyueuK.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BLZyueuK.js";var t=e(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-BLZyueuK.js";import{t as n}from"./project-router-CF-1GU39.js";var r=e();function i({to:e,active:i=!1,onClick:a,children:o}){return(0,r.jsx)(n,{to:e,"aria-current":i?`page`:void 0,onClick:a,className:t(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,i?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:o})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Cn as i,Hr as a,Kr as o,M as s,Mn as c,Rn as l,Tt as u,Z as d,Zn as f,a as p,ar as m,bt as h,gn as g,i as _,rr as v,t as y,ur as b,wt as x,yr as S}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Cn as i,Hr as a,Kr as o,M as s,Mn as c,Rn as l,Tt as u,Z as d,Zn as f,a as p,ar as m,bt as h,gn as g,i as _,rr as v,t as y,ur as b,wt as x,yr as S}from"./centered-state-TyZe3tga.js";import{l as C,u as w}from"./editable-title-BWosq6YG.js";import{t as ee}from"./run-header-Cc7KFOMX.js";import{i as T,t as E}from"./use-desktop-Co7z3Xov.js";import{t as D}from"./textarea-BPMIukW0.js";import{a as O,c as k,l as A,o as j,r as M,s as N,t as P}from"./use-submit-shortcut-DfJM2Y1U.js";import{S as F,n as I,r as L}from"./index-CKWqcYjr.js";import{t as R}from"./diff-DtXK3tZy.js";import{i as z,n as B,r as V}from"./git-toolbar-D9Wu2J60.js";var H=e(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=n();function te({run:e,open:t,onOpenChange:n}){let r=o(),[i,l]=(0,H.useState)(``),u=g(e),d=(0,H.useRef)(u);d.current=u,(0,H.useEffect)(()=>{t&&l(d.current)},[t]);let f=a({mutationFn:t=>c(e.id,t),onSuccess:t=>{_(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:s.runs.changes(e.id)}),r.invalidateQueries({queryKey:s.runs.all})},onError:e=>_(e.message,{tone:`danger`})}),m=()=>{let e=i.trim();e.length===0||f.isPending||f.mutate(e)};return(0,Y.jsx)(M,{open:t,onOpenChange:n,children:(0,Y.jsxs)(O,{"data-slot":`commit-dialog`,children:[(0,Y.jsxs)(k,{children:[(0,Y.jsx)(A,{children:`Commit changes`}),(0,Y.jsxs)(j,{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)(D,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{P({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(),m())}}),(0,Y.jsxs)(N,{children:[(0,Y.jsx)(p,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Y.jsx)(p,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||f.isPending,onClick:m,children:f.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=r(),t=x(e);return t.isPending?(0,Y.jsx)(L,{tab:`changes`}):t.isError?(0,Y.jsx)(I,{tab:`changes`,error:t.error}):(0,Y.jsx)(Z,{run:t.data})}function Z({run:e}){let t=d(),n=h(),r=u(e.id,C(e.status)),c=E(),[f,p]=(0,H.useState)(`unified`),[g,x]=(0,H.useState)(!1),[D,O]=(0,H.useState)(null),[k,A]=(0,H.useState)(!1),j=(0,H.useRef)(null),M=o(),N=()=>M.invalidateQueries({queryKey:s.runs.all}),P=e=>_(e.message,{tone:`danger`}),I=a({mutationFn:()=>b(e.id),onSuccess:e=>_(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:P}),L=a({mutationFn:()=>l(e.id),onSuccess:e=>{_(`Draft PR created — ${e.url}`),N()},onError:P}),U=a({mutationFn:()=>m(e.id),onError:e=>{if(e instanceof i&&e.command){navigator.clipboard.writeText(e.command).then(()=>_(`No terminal found — command copied to clipboard.`)).catch(()=>_(`Run manually: ${e.command}`));return}P(e)}}),W=a({mutationFn:t=>v(e.id,t),onError:P}),G=r.isError&&r.error instanceof i&&r.error.status===409,K=J({status:e.status,hasWorktree:!!e.worktreePath&&!G,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:w(e)!==void 0,prUrl:e.pullRequestUrl}),q=e=>{switch(e){case`commit`:A(!0);break;case`push`:I.mutate();break;case`create-pr`:L.mutate();break;case`open-terminal`:U.mutate();break;case`view-pr`:break}},X=r.data?.files??[],Z=(0,H.useMemo)(()=>V(X),[X]),Q=c?f:`unified`,$=!c||g;return(0,Y.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Y.jsx)(ee,{run:e,tab:`changes`}),(0,Y.jsx)(B,{bar:K,branch:e.branch,stat:r.data?.stat,mode:Q,wrap:$,onModeChange:p,onWrapChange:x,onAction:q}),r.data?.repointedHead?(0,Y.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-6`,children:[`HEAD is on `,(0,Y.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Y.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,r.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…`}):r.isError?(0,Y.jsx)(y,{icon:G?(0,Y.jsx)(F,{}):(0,Y.jsx)(T,{}),tone:G?`neutral`:`danger`,heading:`h2`,title:G?`No changes to show`:`Could not load the changes`,subtitle:r.error.message}):X.length===0?(0,Y.jsx)(y,{icon:(0,Y.jsx)(F,{}),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`,{"data-slot":`changes-tree-pane`,className:`sticky top-40 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain md:block lg:w-72`,children:(0,Y.jsx)(z,{root:Z,selected:D,onSelect:e=>{O(e),j.current?.scrollToPath(e)}})}),(0,Y.jsx)(R,{files:X,viewRef:j,mode:Q,wrap:$,loadFileText:t=>ne(e.id,t),imageSrc:t=>S(e.id,t),onOpenInApp:t.data?.capabilities.localHandoff?e=>W.mutate(e):void 0,className:`min-w-0 flex-1`})]}),(0,Y.jsx)(te,{run:e,open:k,onOpenChange:A})]})}async function ne(e,t){try{let n=await f(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{X as TaskChangesRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Cn as i,Dt as a,Et as o,a as s,t as c,wt as l}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Cn as i,Dt as a,Et as o,a as s,t as c,wt as l}from"./centered-state-TyZe3tga.js";import{l as u}from"./editable-title-BWosq6YG.js";import{t as d}from"./arrow-left-BVgebuvi.js";import{t as f}from"./run-header-Cc7KFOMX.js";import{i as p,r as m,t as h}from"./use-desktop-Co7z3Xov.js";import{t as g}from"./search-x-DJIOs-nB.js";import{t as _}from"./triangle-alert-BU7Fnc0D.js";import{t as v}from"./project-router-CF-1GU39.js";import{t as y}from"./diff-stat-CJSJmLcb.js";import{n as b,r as x}from"./index-CKWqcYjr.js";import{t as S}from"./diff-DtXK3tZy.js";import{t as C}from"./commit-list-BKtzO28W.js";var w=e(t(),1),T=n();function E(){let{id:e}=r(),t=l(e);return t.isPending?(0,T.jsx)(x,{tab:`changes`}):t.isError?(0,T.jsx)(b,{tab:`changes`,error:t.error}):(0,T.jsx)(D,{run:t.data})}function D({run:e}){let{sha:t}=r(),n=a(e.id,u(e.status));return(0,T.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,T.jsx)(f,{run:e,tab:`commits`}),t?(0,T.jsx)(O,{runId:e.id,sha:t}):n.isPending?(0,T.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,T.jsx)(c,{icon:(0,T.jsx)(p,{}),tone:n.error instanceof i&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof i&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,T.jsx)(c,{icon:(0,T.jsx)(p,{}),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,T.jsx)(C,{slot:`task-commits`,className:`mx-auto w-full max-w-[var(--measure)]`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))})]})}function O({runId:e,sha:t}){let n=o(e,t),r=h(),[a,l]=(0,w.useState)(`unified`),[u,f]=(0,w.useState)(!1),b=n.isError&&n.error instanceof i&&n.error.status===409,x=r?a:`unified`,C=!r||u;return(0,T.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,T.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,T.jsx)(s,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,T.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,T.jsx)(d,{"aria-hidden":`true`}),`All commits`]})}),n.data?(0,T.jsx)(y,{stat:n.data.stat}):null,(0,T.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,T.jsx)(m,{mode:a,wrap:u,onModeChange:l,onWrapChange:f})})]}),n.isPending?(0,T.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,T.jsx)(c,{icon:b?(0,T.jsx)(g,{}):(0,T.jsx)(_,{}),tone:b?`neutral`:`danger`,heading:`h2`,title:b?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,T.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,T.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,T.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,T.jsx)(c,{icon:(0,T.jsx)(p,{}),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,T.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:(0,T.jsx)(S,{files:n.data.files,mode:x,wrap:C,className:`min-w-0`})})]})]})}export{E as TaskCommitsRoute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Cn as i,kt as a,t as o,wt as s,yr as c}from"./centered-state-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Cn as i,kt as a,t as o,wt as s,yr as c}from"./centered-state-TyZe3tga.js";import{r as l,t as u}from"./utils-BLZyueuK.js";import{t as d}from"./chevron-right-W2B4c3Bn.js";import{t as f}from"./run-header-Cc7KFOMX.js";import{t as p}from"./file-BgcgwEU-.js";import{t as m}from"./folder-DGrkgLg9.js";import{t as h}from"./triangle-alert-BU7Fnc0D.js";import{a as g,i as _,r as v}from"./highlighter-CdHqIwFr.js";import{n as y,r as b}from"./index-CKWqcYjr.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=e(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=n();function N({runId:e,path:t,className:n}){let r=a(e,t??void 0);if(t===null)return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(o,{icon:(0,M.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from the tree to preview it here.`})});if(r.isPending)return(0,M.jsx)(F,{className:n,children:(0,M.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof i&&r.error.status===409;return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(o,{icon:e?(0,M.jsx)(C,{}):(0,M.jsx)(h,{}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,M.jsx)(P,{runId:e,entry:r.data,className:n}):null}function P({runId:e,entry:t,className:n}){let r=A(t);return(0,M.jsxs)(F,{className:n,children:[(0,M.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,M.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:j(t.size)})]}),r===`image`?(0,M.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,M.jsx)(`img`,{"data-slot":`file-preview-image`,src:c(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,M.jsx)(o,{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)(o,{icon:(0,M.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${j(t.size)} of binary data — no text preview.`}):(0,M.jsx)(R,{path:t.path,text:t.content??``})]})}function F({className:e,children:t}){return(0,M.jsx)(`section`,{"data-slot":`file-preview`,className:u(`overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var I=1500;function L(e,t){let n=(0,D.useMemo)(()=>t.split(`
|
|
2
2
|
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>g(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 v(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":g(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)(d,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform`,o&&`rotate-90`)}),(0,M.jsx)(m,{"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}=r(),t=s(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,r]=(0,D.useState)(null),s=t.isError&&t.error instanceof i&&t.error.status===409;return(0,M.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,M.jsx)(f,{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)(o,{icon:s?(0,M.jsx)(w,{}):(0,M.jsx)(h,{}),tone:s?`neutral`:`danger`,heading:`h2`,title:s?`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 [--diff-sticky-top:7rem] md:flex-row md:items-start md:px-6`,children:[(0,M.jsx)(`aside`,{"data-slot":`files-tree-pane`,className:`w-full shrink-0 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:(0,M.jsx)(z,{runId:e.id,selected:n,onSelect:r})}),(0,M.jsx)(N,{runId:e.id,path:n,className:`min-w-0 flex-1`})]})]})}export{U as TaskFilesRoute};
|