@usine/server 0.4.1-next.295.g3fa96e0 → 0.4.1-next.297.g24dc884
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/web/assets/DialogRoot-B-w_yh2M.js +1 -0
- package/dist/web/assets/DialogTitle-Dp1dWwGe.js +1 -0
- package/dist/web/assets/X.es-D_GX8LPE.js +1 -0
- package/dist/web/assets/_agent-C7EWtNTG.js +1 -0
- package/dist/web/assets/_label-CUKWo0MS.js +1 -0
- package/dist/web/assets/_loop-CXLM87nD.js +1 -0
- package/dist/web/assets/_name-C58j_6Cr.js +1 -0
- package/dist/web/assets/_name-DLJp41ko.js +1 -0
- package/dist/web/assets/_name-D_6q0i39.js +1 -0
- package/dist/web/assets/_number-CuFa_cu0.js +1 -0
- package/dist/web/assets/_number-DzlrHGHc.js +1 -0
- package/dist/web/assets/_number-wrLl9KpP.js +1 -0
- package/dist/web/assets/_project-BWOVq6Oz.js +2 -0
- package/dist/web/assets/_project-C58j_6Cr.js +1 -0
- package/dist/web/assets/_project-wrLl9KpP.js +1 -0
- package/dist/web/assets/_project-xTXvJAEk.js +1 -0
- package/dist/web/assets/_run-Ctv5G8db.js +5 -0
- package/dist/web/assets/_run-DLJp41ko.js +1 -0
- package/dist/web/assets/_run-wrLl9KpP.js +1 -0
- package/dist/web/assets/_worker-DjSAUqR6.js +1 -0
- package/dist/web/assets/action-DJYOLxhn.js +1 -0
- package/dist/web/assets/actions-DsEnZXEu.js +1 -0
- package/dist/web/assets/agents-BTEdI1so.js +1 -0
- package/dist/web/assets/{agents-DHMF3XEr.js → agents-g1sk70Cp.js} +1 -1
- package/dist/web/assets/api-DsTuvRlt.js +313 -0
- package/dist/web/assets/{boot-screen-BS1pSJCP.js → boot-screen-DrxZFyXl.js} +1 -1
- package/dist/web/assets/button-C-mC9M4I.js +1 -0
- package/dist/web/assets/code-block-Nn1IIrfL.js +4 -0
- package/dist/web/assets/collapsible-TF5NAUgG.js +1 -0
- package/dist/web/assets/context-8jHKzDOY.js +1 -0
- package/dist/web/assets/{core-CWo_TDLh.js → core-CTqx3YLO.js} +1 -1
- package/dist/web/assets/dialog-BCljH9rm.js +1 -0
- package/dist/web/assets/drawer-B6zDeWLW.js +1 -0
- package/dist/web/assets/edit-and-retry-B0OtOtfz.js +1 -0
- package/dist/web/assets/empty-CJ6gwIk9.js +1 -0
- package/dist/web/assets/{error-alert-C3tCznIk.js → error-alert-BOLTerP9.js} +1 -1
- package/dist/web/assets/{file-error-BWxiLF1l.js → file-error-BJK6op1P.js} +1 -1
- package/dist/web/assets/fill-cell-5J3dwnZY.js +1 -0
- package/dist/web/assets/{history-BgN7BMZM.js → history-BndVmB4C.js} +1 -1
- package/dist/web/assets/index-CbRNTyi8.js +50 -0
- package/dist/web/assets/index-wvcLlQ11.css +2 -0
- package/dist/web/assets/{label-B2PrCNtN.js → label-C0j5gN9r.js} +1 -1
- package/dist/web/assets/{label-badge-DlfFeHM2.js → label-badge-QOx_nH-H.js} +1 -1
- package/dist/web/assets/{labels--U1i9KoY.js → labels-BIiPC4kS.js} +1 -1
- package/dist/web/assets/{lazyRouteComponent-Mgik0tws.js → lazyRouteComponent-Dygi5S38.js} +1 -1
- package/dist/web/assets/{link-04lHwIZK.js → link-CXTzqBsX.js} +1 -1
- package/dist/web/assets/list-6u0axepP.js +1 -0
- package/dist/web/assets/loops-CyFWFsxO.js +1 -0
- package/dist/web/assets/mark-Bcl_OnGe.js +1 -0
- package/dist/web/assets/{markdown-BqTCgzdQ.js → markdown-DN2FBI_2.js} +1 -1
- package/dist/web/assets/members-DecnwgrL.js +1 -0
- package/dist/web/assets/model-F1HLQfrf.js +1 -0
- package/dist/web/assets/moves-D9SXmgnd.js +1 -0
- package/dist/web/assets/native-select-B1ICB22h.js +1 -0
- package/dist/web/assets/not-found-CgbvvS9i.js +1 -0
- package/dist/web/assets/outcome-DdTW8YJ8.js +5 -0
- package/dist/web/assets/overview-CTpxkXVa.js +1 -0
- package/dist/web/assets/page-CxChE1f9.js +1 -0
- package/dist/web/assets/{project-not-found-CZLTPMV2.js → project-not-found-DrMlF8K5.js} +1 -1
- package/dist/web/assets/projects-DEct3qvm.js +1 -0
- package/dist/web/assets/{pull-request-marks-B6oHQmCS.js → pull-request-marks-DIYk7AMY.js} +1 -1
- package/dist/web/assets/queries-B4QNhfM4.js +1 -0
- package/dist/web/assets/queries-B8vjCIOC.js +1 -0
- package/dist/web/assets/queries-BNYw2mY-.js +1 -0
- package/dist/web/assets/queries-C46qdn9C.js +1 -0
- package/dist/web/assets/queryOptions-Bavh4JFe.js +1 -0
- package/dist/web/assets/repositories-QuiwvY4J.js +1 -0
- package/dist/web/assets/repository-link-dmlmZuZQ.js +1 -0
- package/dist/web/assets/route-6_pyjeyO.js +1 -0
- package/dist/web/assets/route-D9jsgvh7.js +1 -0
- package/dist/web/assets/route-status-CC7nI7CP.js +1 -0
- package/dist/web/assets/{routes-BU0GYe5f.js → routes-Dsc1R9Cf.js} +18 -18
- package/dist/web/assets/routes-wrLl9KpP.js +1 -0
- package/dist/web/assets/run-again-mx4hRPEd.js +1 -0
- package/dist/web/assets/section-BBmCxyXo.js +1 -0
- package/dist/web/assets/section-BiX8mjQ0.js +1 -0
- package/dist/web/assets/section-C2BsZ62c.js +24 -0
- package/dist/web/assets/settings-C7py9fR6.js +1 -0
- package/dist/web/assets/sign-in-CX6zObk3.js +1 -0
- package/dist/web/assets/skeleton-DzJsW7iY.js +1 -0
- package/dist/web/assets/{slots-BYLP8TNt.js → slots-DdHFLAvn.js} +1 -1
- package/dist/web/assets/{sortable.esm-DCopHyTW.js → sortable.esm-Z2V3kAIY.js} +1 -1
- package/dist/web/assets/{status-badge-CYV7BO8y.js → status-badge-DINlptKX.js} +1 -1
- package/dist/web/assets/{strings-Cgrt38_s.js → strings-BIVdGoBr.js} +1 -1
- package/dist/web/assets/{strings-CD2oxW8w.js → strings-CfIaIMiC.js} +1 -1
- package/dist/web/assets/{table-kSUccuLf.js → table-D3--FtAd.js} +1 -1
- package/dist/web/assets/tasks-Dw7FKak4.js +1 -0
- package/dist/web/assets/tasks-wrLl9KpP.js +1 -0
- package/dist/web/assets/tokens-Cm3gOC7v.js +1 -0
- package/dist/web/assets/{usage-DG8mHuwO.js → usage-DmmcUq-E.js} +1 -1
- package/dist/web/assets/use-project-links-Bdqs6H65.js +1 -0
- package/dist/web/assets/useScrollLock-DvjlEO3V.js +1 -0
- package/dist/web/assets/useSuspenseQuery-ajaZl96Y.js +1 -0
- package/dist/web/assets/useTriggerFocusGuards-Czjr5yfU.js +1 -0
- package/dist/web/assets/useValueChanged-VVPbKYpt.js +1 -0
- package/dist/web/assets/{usine-mark-p0IVPpwW.js → usine-mark-Dk0O5l6k.js} +1 -1
- package/dist/web/assets/workers-rSZGoHvC.js +1 -0
- package/dist/web/index.html +34 -30
- package/package.json +9 -9
- package/dist/web/assets/DialogRoot-I21bkmWT.js +0 -1
- package/dist/web/assets/DialogTitle-CQZ3o0Lj.js +0 -1
- package/dist/web/assets/_agent-BFryjNNb.js +0 -1
- package/dist/web/assets/_label-CtKiaGWz.js +0 -1
- package/dist/web/assets/_loop-DONFu16v.js +0 -1
- package/dist/web/assets/_name-5VNWemKl.js +0 -1
- package/dist/web/assets/_name-BwBQjvjI.js +0 -1
- package/dist/web/assets/_name-C42q_xws.js +0 -2
- package/dist/web/assets/_name-C6VkudVs.js +0 -1
- package/dist/web/assets/_name-Dfqc_Qea.js +0 -1
- package/dist/web/assets/_number-BwBQjvjI.js +0 -1
- package/dist/web/assets/_number-DOYIujsh.js +0 -1
- package/dist/web/assets/_number-Dyt5PXPW.js +0 -1
- package/dist/web/assets/_project-DpvIZdrA.js +0 -1
- package/dist/web/assets/_run-B4DFmBFm.js +0 -5
- package/dist/web/assets/_run-BwBQjvjI.js +0 -1
- package/dist/web/assets/_worker-BtNHlRPT.js +0 -1
- package/dist/web/assets/action-CCOQazIB.js +0 -1
- package/dist/web/assets/actions-DCgAlxnS.js +0 -1
- package/dist/web/assets/agents-BEHsLITF.js +0 -1
- package/dist/web/assets/api-DMBgrk17.js +0 -313
- package/dist/web/assets/button-D4_M-wHl.js +0 -1
- package/dist/web/assets/code-block-DKVMeNpL.js +0 -4
- package/dist/web/assets/collapsible-DJcMz9za.js +0 -1
- package/dist/web/assets/drawer-HmQLxogt.js +0 -1
- package/dist/web/assets/edit-and-retry-B4VIXVuU.js +0 -1
- package/dist/web/assets/empty-C7BJKsCc.js +0 -1
- package/dist/web/assets/fill-cell-C7QNSxol.js +0 -1
- package/dist/web/assets/index-BHydEFMr.css +0 -2
- package/dist/web/assets/index-DSOKl9hZ.js +0 -10
- package/dist/web/assets/list-7qDdKUWr.js +0 -1
- package/dist/web/assets/loops-KEH8Xuo_.js +0 -1
- package/dist/web/assets/mark-TjVTH0zt.js +0 -1
- package/dist/web/assets/members-CBC3IWWZ.js +0 -1
- package/dist/web/assets/model-Ca7RC2YV.js +0 -1
- package/dist/web/assets/moves-CbOc6hX6.js +0 -1
- package/dist/web/assets/native-select-Cc4FV9cz.js +0 -1
- package/dist/web/assets/not-found-TW_8OQxg.js +0 -1
- package/dist/web/assets/outcome-OMgE9R0d.js +0 -5
- package/dist/web/assets/overview-CyrdJxvZ.js +0 -1
- package/dist/web/assets/page-5rCn82pX.js +0 -1
- package/dist/web/assets/queries-CR2-1r-p.js +0 -1
- package/dist/web/assets/queries-TKKPRagF.js +0 -1
- package/dist/web/assets/queries-w5gAm8od.js +0 -1
- package/dist/web/assets/queryOptions-Dfvzj6n2.js +0 -1
- package/dist/web/assets/reason-parts-CztZqjlj.js +0 -1
- package/dist/web/assets/repositories-BAf0wI3v.js +0 -1
- package/dist/web/assets/repositories-D4wYJfa_.js +0 -1
- package/dist/web/assets/route-DkMTJBWm.js +0 -1
- package/dist/web/assets/route-Do86j4UK.js +0 -1
- package/dist/web/assets/route-status-C_1qpdyX.js +0 -1
- package/dist/web/assets/routes-BwBQjvjI.js +0 -1
- package/dist/web/assets/run-again-Y2Cmr2XI.js +0 -1
- package/dist/web/assets/section-B9rSL8Bj.js +0 -24
- package/dist/web/assets/section-CZjeg41d.js +0 -1
- package/dist/web/assets/section-DQ4WUt68.js +0 -1
- package/dist/web/assets/settings-DQhtSVA1.js +0 -1
- package/dist/web/assets/sign-in-DUJybrEP.js +0 -1
- package/dist/web/assets/skeleton-DVnlwI2O.js +0 -1
- package/dist/web/assets/tasks-BuEAwx2n.js +0 -1
- package/dist/web/assets/tasks-BwBQjvjI.js +0 -1
- package/dist/web/assets/tokens-B-7iRBKh.js +0 -1
- package/dist/web/assets/useBaseQuery-Bq9mMy4d.js +0 -1
- package/dist/web/assets/useScrollLock-C-KKJ25P.js +0 -1
- package/dist/web/assets/useSuspenseQuery-BRPaB8Gf.js +0 -1
- package/dist/web/assets/useTriggerFocusGuards-w5WLoQxU.js +0 -1
- package/dist/web/assets/workers-BZ6ZrOma.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./useScrollLock-DvjlEO3V.js";import{n as t}from"./DialogTitle-Dp1dWwGe.js";var n=e(function(e){return t(`dialog`,e)});export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{f as r,i}from"./mark-Bcl_OnGe.js";import{b as a,m as o,s,v as c}from"./button-C-mC9M4I.js";import{C as l,Ct as u,D as d,E as f,N as p,Nt as m,O as h,P as g,Pt as _,St as v,T as y,V as b,b as x,c as S,h as C,k as w,m as T,n as E,p as D,r as O,t as k,v as A,w as j,y as M}from"./useScrollLock-DvjlEO3V.js";import{a as N,l as P,p as F,w as I}from"./useValueChanged-VVPbKYpt.js";var L=e(t(),1),R=L.createContext(void 0);function z(e){let t=L.useContext(R);if(!e&&t===void 0)throw Error(c(27));return t}var B=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,c=z(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`mounted`),f={open:l,transitionStatus:c.useState(`transitionStatus`)};return s(`div`,e,{state:f,ref:[c.context.backdropRef,t],stateAttributesMapping:_,props:[{role:`presentation`,hidden:!d,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!u})}),V=L.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:c=!0,...l}=e,u=z(),d=u.useState(`open`),{getButtonProps:f,buttonRef:p}=o({disabled:a,native:c}),m={disabled:a};function h(e){d&&u.setOpen(!1,I(P,e.nativeEvent))}return s(`button`,e,{state:m,ref:[t,p],props:[{onClick:h},l,f]})}),H=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,c=z(),l=N(a);return c.useSyncedValueWithCleanup(`descriptionElementId`,l),s(`p`,e,{ref:t,props:[{id:l},o]})}),U=L.createContext(void 0);function W(){let e=L.useContext(U);if(e===void 0)throw Error(c(26));return e}var G=`--nested-dialogs`,K=`data-nested-dialog-open`,q={...m,...r,nestedDialogOpen(e){return e?{[K]:``}:null}},J=n(),Y=L.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,initialFocus:c,...u}=e,d=z(),f=d.useState(`descriptionElementId`),p=d.useState(`disablePointerDismissal`),m=d.useState(`floatingRootContext`),h=d.useState(`popupProps`),_=d.useState(`modal`),v=d.useState(`mounted`),y=d.useState(`nested`),b=d.useState(`nestedOpenDialogCount`),x=d.useState(`open`),C=d.useState(`openMethod`),w=d.useState(`titleElementId`),T=d.useState(`transitionStatus`),E=d.useState(`role`),D=m.useState(`floatingId`);W(),i({open:x,ref:d.context.popupRef,onComplete(){x&&d.context.onOpenChangeComplete?.(!0)}});let O=c===void 0?l(d.context.popupRef):c,k=b>0,A=d.useStateSetter(`popupElement`),j=s(`div`,e,{state:{open:x,nested:y,transitionStatus:T,nestedDialogOpen:k},props:[h,{id:D,"aria-labelledby":w,"aria-describedby":f,role:E,...M,hidden:!v,onKeyDown(e){S.has(e.key)&&e.stopPropagation()},style:{[G]:b}},u],ref:[t,d.context.popupRef,A],stateAttributesMapping:q});return(0,J.jsx)(g,{context:m,openInteractionType:C,disabled:!v,closeOnFocusOut:!p,initialFocus:O,returnFocus:o,modal:_!==!1,restoreFocus:`popup`,children:j})}),X=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=z(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,J.jsx)(U.Provider,{value:n,children:(0,J.jsxs)(b,{ref:t,...r,children:[a&&o===!0&&(0,J.jsx)(E,{ref:i.context.internalBackdropRef,inert:O(!s)}),e.children]})}):null});function Z({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[f,m]=L.useState(0),[h,g]=L.useState(0),_=f===0,y=p(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=u(t);if(_&&!o){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||v(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:_});return k(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(m(t),g(n))}),a(()=>{!r&&!i&&(m(0),g(0))},[r,i]),a(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(f+1,h+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,f,h,t]),d(e,{activeTriggerProps:y.reference,inactiveTriggerProps:y.trigger,popupProps:y.floating,nestedOpenDialogCount:f,nestedOpenDrawerCount:h}),null}var Q={...T,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},$=class extends C{constructor(e,t,n){let r=new A,i=ee(e,r,t,n);super(i,te(r),Q)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(j(this.state,e,t.trigger)))}};function ee(e,t,n,r=!1){return{...D(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function te(e){return{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function ne(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:p=null}=t,m=e===`drawer`,g=e===`alert-dialog`,_=g?!0:c,v=g||s,b=g?`alertdialog`:`dialog`,S=z(!0),C={modal:_,disablePointerDismissal:v,nested:S!=null,role:b},T=h((e,t)=>new $({open:i,openProp:r,activeTriggerId:p,triggerIdProp:d,...C},e,t),!0);T.useControlledProp(`openProp`,r),T.useControlledProp(`triggerIdProp`,d),T.useSyncedValues(C),T.useContextCallback(`onOpenChange`,a),T.useContextCallback(`onOpenChangeComplete`,o);let E=T.useState(`open`),D=T.useState(`mounted`),O=T.useState(`payload`);w(T,E),y(T);let{forceUnmount:k}=f(E,T);L.useImperativeHandle(l,()=>({unmount:k,close:()=>T.setOpen(!1,I(F))}),[k,T]);let A=E||D||u!=null;return(0,J.jsxs)(R.Provider,{value:T,children:[u&&(0,J.jsx)(x,{handle:u,store:T}),A&&(0,J.jsx)(Z,{store:T,parentContext:S?.context,isDrawer:m}),typeof n==`function`?n({payload:O}):n]})}var re=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,c=z(),l=N(a);return c.useSyncedValueWithCleanup(`titleElementId`,l),s(`h2`,e,{ref:t,props:[{id:l},o]})});export{H as a,z as c,Y as i,ne as n,V as o,X as r,B as s,re as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t}from"./jsx-runtime-Wy9s6hX0.js";import{W as n}from"./button-C-mC9M4I.js";var r=e(t(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`XIcon`;export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./useSuspenseQuery-ajaZl96Y.js";import{n}from"./queries-B4QNhfM4.js";import{d as r}from"./index-CbRNTyi8.js";import{t as i}from"./agents-g1sk70Cp.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=t(n());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{X as t,t as n}from"./section-C2BsZ62c.js";import{u as r}from"./index-CbRNTyi8.js";var i=e(),a=()=>{let{label:e}=r.useParams();return(0,i.jsx)(n,{title:e,entity:t(`label`,e),children:null})};export{a as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{D as t,E as n,X as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-C2BsZ62c.js";import{t as g}from"./useSuspenseQuery-ajaZl96Y.js";import{t as _}from"./link-CXTzqBsX.js";import{n as v,r as y}from"./list-6u0axepP.js";import{r as b}from"./strings-BIVdGoBr.js";import{t as x}from"./error-alert-BOLTerP9.js";import{n as S}from"./queries-B4QNhfM4.js";import{at as C,l as w,v as T}from"./index-CbRNTyi8.js";import{t as E}from"./file-error-BJK6op1P.js";import{t as D}from"./repository-link-dmlmZuZQ.js";var O=e(),k=({loop:e,configuration:t})=>{let r=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),a=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(i,{children:[r!==void 0&&(0,O.jsx)(o,{label:`Project`,children:(0,O.jsx)(_,{to:`/configuration/projects/$project`,params:{project:r.id},className:`text-primary hover:underline`,children:r.name})}),(0,O.jsxs)(o,{label:`Agent`,children:[(0,O.jsx)(_,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),a!==void 0&&(0,O.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:b(a)})]}),(0,O.jsx)(o,{label:`Repositories`,children:e.repositories.length===0?(0,O.jsx)(m,{children:`No registered repository matches the selector`}):(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsx)(D,{repository:e})},e))})}),(0,O.jsx)(o,{label:`Approval`,children:h[e.approval]}),(0,O.jsxs)(o,{label:`Max cycles`,children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,O.jsx)(m,{children:`runs per item before a reset`})]}),(0,O.jsx)(o,{label:`Permissions`,children:n[e.permissions]}),(0,O.jsx)(o,{label:`Priority`,children:e.priority===null?(0,O.jsx)(m,{children:`None; runs wait in lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(m,{children:`queued ahead of runs in lane order`})]})}),(0,O.jsx)(o,{label:`Step`,children:(0,O.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},A=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],j=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],M=({loop:e,configuration:n,pause:r})=>{let i=s(e.prompt).length;return(0,O.jsxs)(O.Fragment,{children:[r?.isError===!0&&(0,O.jsx)(x,{message:r.error.message}),(0,O.jsxs)(c,{facts:(0,O.jsx)(k,{loop:e,configuration:n}),children:[(0,O.jsxs)(d,{title:`Trigger`,children:[(0,O.jsx)(l,{entries:A(e)}),e.undeclaredLabels.length>0&&(0,O.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,O.jsx)(C,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,O.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels under`,` `,(0,O.jsx)(`code`,{children:`labels`}),` in `,(0,O.jsx)(`code`,{children:`usine.yaml`}),`.`]})]})]}),(0,O.jsx)(d,{title:`Selector`,children:e.selector===null?(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,O.jsx)(l,{entries:j(e.selector)})}),(0,O.jsx)(d,{title:`Prompt`,aside:i===0?`Same text for every run`:`${t(i,`outlined expression`)} filled in from each item`,children:(0,O.jsx)(u,{template:e.prompt})})]})]})},N=({name:e,configuration:t,pause:n})=>{let i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,O.jsx)(p,{entity:r(`loop`,e),title:i.name,marks:(0,O.jsx)(y,{paused:i.paused}),file:i.file,actions:n!==null&&(0,O.jsx)(v,{loop:i,pause:n,variant:`outline`}),children:(0,O.jsx)(M,{loop:i,configuration:t,pause:n})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,O.jsx)(p,{entity:r(`loop`,e),title:e,children:(0,O.jsxs)(f,{title:`Loop not found`,children:[`The configuration has no file `,(0,O.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,O.jsx)(_,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,O.jsx)(p,{entity:r(`loop`,e),title:o.name,marks:(0,O.jsx)(a,{}),file:o.file,children:(0,O.jsx)(E,{error:o.error,consequence:`No runs until the file loads.`})})},P=()=>{let{loop:e}=w.useParams(),{data:t}=g(S());return(0,O.jsx)(N,{name:e,configuration:t,pause:T()})};export{P as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./Match-CV3MCMPf.js";var t=e;export{t as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./project-not-found-DrMlF8K5.js";var t=e;export{t as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,X as n,a as r,i,n as a,r as o,s,t as c,u as l}from"./section-C2BsZ62c.js";import{t as u}from"./useSuspenseQuery-ajaZl96Y.js";import{t as d}from"./link-CXTzqBsX.js";import{n as f}from"./queries-B4QNhfM4.js";import{Y as p,a as m}from"./index-CbRNTyi8.js";import{t as h}from"./label-badge-QOx_nH-H.js";var g=e(),_=({label:e})=>e.failure===null?e.onGitHub===!1?(0,g.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,g.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),v=({repository:e,project:n})=>(0,g.jsxs)(r,{children:[(0,g.jsx)(i,{label:t.project,children:n===void 0?(0,g.jsx)(l,{children:t.unassignedProject}):(0,g.jsx)(d,{to:`/configuration/projects/$project`,params:{project:n.id},className:`text-primary hover:underline`,children:n.name})}),n!==void 0&&(0,g.jsx)(i,{label:`Board`,children:(0,g.jsx)(d,{to:`/projects/$project`,params:{project:n.id},className:`text-primary hover:underline`,children:t.board})}),(0,g.jsx)(i,{label:`Tags`,children:e.tags.length===0?(0,g.jsx)(l,{children:`None`}):e.tags.join(`, `)}),(0,g.jsx)(i,{label:`Loops`,children:e.loops.length===0?(0,g.jsx)(l,{children:`Not selected by any loop`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,g.jsx)(`li`,{children:(0,g.jsx)(d,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),y=({owner:e,name:t,configuration:r})=>{let i=`${e}/${t}`,u=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return u===void 0?(0,g.jsx)(c,{entity:n(`repository`,i),title:i,children:(0,g.jsxs)(s,{title:`Repository not registered`,children:[i,` is not under `,(0,g.jsx)(`code`,{children:`repos`}),` in `,(0,g.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,g.jsx)(d,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,g.jsx)(c,{entity:n(`repository`,u.name),title:u.name,leading:(0,g.jsx)(p,{repository:u.name,size:`title`}),children:(0,g.jsx)(a,{facts:(0,g.jsx)(v,{repository:u,project:r.projects.find(e=>e.includes(u.name))}),children:(0,g.jsx)(o,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:u.declaredLabels.length===0?(0,g.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,g.jsx)(`code`,{children:`labels`}),` in `,(0,g.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.declaredLabels.map(e=>(0,g.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,g.jsx)(h,{name:e.name,label:e}),(0,g.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,g.jsx)(l,{children:`On GitHub`}):(0,g.jsx)(_,{label:e})})]},e.name))})})})})},b=()=>{let{owner:e,name:t}=m.useParams(),{data:n}=u(f());return(0,g.jsx)(y,{owner:e,name:t,configuration:n})};export{b as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-Bdqs6H65.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,c as o,h as s,i as c,l,n as u,o as d,s as f,v as p}from"./actions-DsEnZXEu.js";import{n as m,t as h}from"./useNavigate-I5E4IRt2.js";import{t as g}from"./link-CXTzqBsX.js";import{r as _,t as v}from"./mark-Bcl_OnGe.js";import{c as y,l as b,n as x,s as S,t as ee}from"./moves-D9SXmgnd.js";import{r as te}from"./native-select-B1ICB22h.js";import{r as C,t as w}from"./button-C-mC9M4I.js";import{l as ne,s as T}from"./useTriggerFocusGuards-Czjr5yfU.js";import{i as E}from"./context-8jHKzDOY.js";import{Dn as re,En as ie,Ln as ae,Pn as D,a as oe,wn as se}from"./api-DsTuvRlt.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as le,E as A,F as ue,M as j,N as de,P as fe,i as M,j as N,n as pe,r as me}from"./overview-CTpxkXVa.js";import{a as he,n as ge,r as _e}from"./page-CxChE1f9.js";import{t as P}from"./error-alert-BOLTerP9.js";import{A as F,F as I,I as ve,M as ye,N as be,O as xe,P as Se,R as Ce,j as we,k as Te,lt as Ee,n as De,t as Oe}from"./index-CbRNTyi8.js";import{t as ke}from"./pull-request-marks-DIYk7AMY.js";import{n as L,t as Ae}from"./status-badge-DINlptKX.js";import{n as je,t as Me}from"./edit-and-retry-B0OtOtfz.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-D3--FtAd.js";import{t as U}from"./fill-cell-5J3dwnZY.js";import{t as W}from"./label-badge-QOx_nH-H.js";import{a as Pe,n as Fe,t as Ie}from"./model-F1HLQfrf.js";import{n as Le,t as Re}from"./run-again-mx4hRPEd.js";import{a as ze,i as G,n as K,r as q,t as J}from"./section-BBmCxyXo.js";import{t as Be}from"./not-found-CgbvvS9i.js";var Y=n(),Ve=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${k(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${k(e.postedAt)}`},He=({task:e})=>{let t=r(),n=new Map(e.runs.map(e=>[e.id,e])),i=new Map(e.items.map(e=>[e.itemKey,e]));return(0,Y.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,Y.jsx)(J,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,Y.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=n.get(e.runId),a=r===void 0?void 0:i.get(r.itemKey),o=Ve(e);return(0,Y.jsxs)(B,{className:q,children:[(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${G}`,children:[Fe(e.kind),a!==void 0&&(0,Y.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,Y.jsx)(v,{item:a,linked:!1})]})]})}),(0,Y.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,Y.jsx)(g,{...t.run(r.repository,r.id),className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,Y.jsx)(V,{className:`py-3 text-right`,children:o!==null&&(0,Y.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},Ue=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,c=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),u=c===void 0?void 0:r.moves.find(({itemKey:e})=>e===c.card.itemKey),p=c===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==c.lane.id),m=t.board.lanes.find(({id:e})=>e===u?.toLane)?.name??c?.lane.name??e.lane.name,h=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),g=c===void 0?a.labels:x(c.card,c.lane).filter(e=>u===void 0||!h.has(e)),v=new Map(t.labels.map(e=>[e.name,e])),b=!n&&!r.isPending&&u===void 0&&p.length>0;E(c!==void 0&&b?p.map(e=>({label:y(e.name),run:()=>r.moveItem(c.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(_e,{actionsBeside:`sm`,heading:(0,Y.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ke,{pullRequests:T}),(0,Y.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,Y.jsx)(`span`,{className:`text-foreground`,children:m})}),u!==void 0&&(0,Y.jsx)(`span`,{role:`status`,children:S(u.phase)}),g.length>0&&(0,Y.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:g.map(e=>(0,Y.jsx)(W,{name:e,label:v.get(e)},e))}),e.needsYou&&(0,Y.jsx)(Ae,{})]}),...c!==void 0&&b?{actions:(0,Y.jsxs)(d,{children:[(0,Y.jsxs)(s,{render:(0,Y.jsx)(w,{variant:`outline`}),"aria-label":`Move ${_(a)} to another lane`,children:[`Move to`,(0,Y.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,Y.jsx)(f,{align:`end`,className:`w-auto min-w-40`,children:(0,Y.jsx)(o,{children:p.map(e=>(0,Y.jsx)(l,{onClick:()=>r.moveItem(c.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,Y.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},We=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,Y.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,Y.jsx)(J,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,Y.jsx)(z,{className:`border-t`,children:t.map(e=>(0,Y.jsxs)(B,{className:q,children:[(0,Y.jsx)(V,{className:`w-0 py-3`,children:(0,Y.jsx)(v,{item:e,linked:!1})}),(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${G}`,children:[e.title,(0,Y.jsx)(b,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,Y.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,Y.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},X=e(t(),1),Z=({run:e})=>{let t=he(3e4);return D(Ie(e,t),{onNone:()=>null,onSome:e=>(0,Y.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ge=({run:e})=>D(Pe(e),{onNone:()=>null,onSome:e=>(0,Y.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,Y.jsx)(`span`,{className:`font-medium text-destructive`,children:le(e)}),` `,(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:A(e)})]})}),Q=({run:e})=>(0,Y.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),$=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,Y.jsx)(v,{item:e,className:`relative z-10`})}),Ke=(e,t)=>`${e} ${t}${e===1?``:`s`}`,qe=({run:e,pullRequest:t})=>(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,Y.jsx)(`span`,{children:e.agent}),(0,Y.jsx)(`span`,{children:Ke(e.attempts.length,`attempt`)}),(0,Y.jsx)(Z,{run:e}),(0,Y.jsx)(Q,{run:e}),(0,Y.jsx)($,{pullRequest:t})]}),Je=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=c(),m=a(),[h,g]=(0,X.useState)(!1),_=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,Y.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),v=()=>m.mutate(u(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,Y.jsx)(`span`,{className:`text-needs-you`,children:fe}))},onError:e=>r((0,Y.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),y=e.attempts.at(-1),b=Je(e),x=y?.outcome?._tag===`Failed`&&y.outcome.failure._tag===`QuestionFailure`,S=[];return e.canApprove&&b!==`approve`&&S.push({label:j.approve,select:()=>_({action:`approve`})}),e.canRetry&&b!==`retry`&&S.push({label:j.retry,description:N(e.agentBrain),select:()=>_({action:`retry`})}),e.canRetry&&S.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(S.push({label:j.runAgain,select:v}),S.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&y!==void 0&&S.push({label:x?`Mark answered`:`Mark resolved`,select:()=>_({action:`resolveFailure`,attemptId:y.id})}),e.canCancel&&S.push({label:j.cancel,destructive:!0,select:()=>g(!0)}),E(i.isPending||m.isPending||h?[]:[...b===null?[]:[{label:j[b],select:()=>_({action:b})}],...S].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de[i.variables.request.action]}):m.isPending?(0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:ue}):(0,Y.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[b!==null&&(0,Y.jsx)(w,{variant:`outline`,size:`sm`,title:b===`retry`?N(e.agentBrain):void 0,onClick:()=>_({action:b}),children:j[b]}),S.length>0&&(0,Y.jsxs)(d,{children:[(0,Y.jsx)(s,{render:(0,Y.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${O(e.openedAt)}`,children:(0,Y.jsx)(p,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Y.jsx)(f,{align:`end`,className:`w-auto min-w-44`,children:(0,Y.jsx)(o,{children:S.map(({label:e,description:t,destructive:n,select:r})=>(0,Y.jsx)(l,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,Y.jsx)(Te,{open:h,onOpenChange:g,children:(0,Y.jsxs)(ye,{children:[(0,Y.jsxs)(I,{children:[(0,Y.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,Y.jsx)(be,{children:`The run stops, including any attempt in progress.`})]}),(0,Y.jsxs)(Se,{children:[(0,Y.jsx)(we,{children:j.keepRunning}),(0,Y.jsx)(F,{variant:`destructive`,onClick:()=>{g(!1),_({action:`cancel`})},children:j.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(B,{className:C(q,`[&>td]:align-top`),children:[(0,Y.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,Y.jsx)(L,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(L,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,Y.jsx)(g,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,G),children:e.loop}),t!==null&&(0,Y.jsx)(v,{item:t,className:`relative z-10 shrink-0`})]}),(0,Y.jsx)(Ge,{run:e}),e.runAgain!==null&&(0,Y.jsx)(Re,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,Y.jsx)(Le,{approval:e.approval,className:`text-xs`}),(0,Y.jsx)(qe,{run:e,pullRequest:n}),c!==null&&(0,Y.jsx)(`p`,{role:`status`,className:`text-xs`,children:c})]})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,Y.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,Y.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,Y.jsx)(Z,{run:e})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,Y.jsx)(Q,{run:e})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,Y.jsx)($,{pullRequest:n})}),(0,Y.jsx)(V,{className:`py-2.5`,children:(0,Y.jsx)(Ye,{run:e,onEdit:s,openRun:i,status:l})})]}),o!==null&&je(e,o)&&(0,Y.jsx)(B,{className:`hover:bg-transparent`,children:(0,Y.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,Y.jsx)(Me,{run:e,intent:o,close:()=>s(null),openRun:i,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${o}`)})})]})},Qe=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,Y.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,Y.jsx)(J,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(Ne,{children:(0,Y.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,Y.jsx)(R,{children:`Run`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,Y.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,Y.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,Y.jsx)(R,{children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,Y.jsx)(z,{children:e.runs.map(i=>{let a=ie(re(i.pullRequestUrl),t=>T(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,Y.jsx)(Ze,{run:i,item:o===null||se(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},$e=({children:e})=>(0,Y.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,Y.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),et=({repository:e,number:t})=>{let{data:n}=i(pe()),r=me(n.projects,e),a=m(),o=xe(),s=i(De(e,t));if(s.error instanceof oe&&s.error.error===`BoardItemNotFoundError`)return(0,Y.jsx)(Be,{repository:e,number:String(t)});let c=s.isError&&(0,Y.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number!==t&&r!==void 0?(0,Y.jsx)(h,{to:`/projects/$project/tasks/$number`,params:{project:M(r),number:String(l.number)},search:t=>({...t,repository:e}),replace:!0}):(0,Y.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,Y.jsx)(ze,{repositories:r.repositories,value:e,onChange:e=>void a({to:`/projects/$project/tasks`,params:{project:M(r)},search:{repository:e}})}),c,r!==void 0&&(0,Y.jsx)(Ue,{task:l,project:r,disabled:n._tag===`NeedsSetup`}),(0,Y.jsx)(Qe,{task:l,openRun:o}),(0,Y.jsx)(We,{task:l}),(0,Y.jsx)(He,{task:l})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,Y.jsx)(et,{repository:e,number:t},`${e}#${t}`)};export{tt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./index-CbRNTyi8.js";import{n,t as r}from"./not-found-CgbvvS9i.js";var i=e(),a=()=>{let{repository:e}=t.useSearch(),{number:a}=t.useParams();return e===void 0?(0,i.jsx)(`p`,{children:n}):(0,i.jsx)(r,{repository:e,number:a})};export{a as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-CC7nI7CP.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-Bdqs6H65.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,b as o,c as s,d as c,f as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,s as _,u as v,v as y}from"./actions-DsEnZXEu.js";import{t as b}from"./link-CXTzqBsX.js";import{r as x,t as S}from"./mark-Bcl_OnGe.js";import{a as C,i as w,l as ee,n as T,o as E,r as D,s as te,t as ne}from"./moves-D9SXmgnd.js";import{W as O,r as k,t as A}from"./button-C-mC9M4I.js";import{i as re}from"./context-8jHKzDOY.js";import{X as ie}from"./api-DsTuvRlt.js";import{c as ae,v as j}from"./strings-BIVdGoBr.js";import{F as oe,M,N as se,O as N,a as P,i as F,j as I,n as ce}from"./overview-CTpxkXVa.js";import{a as L,i as le}from"./page-CxChE1f9.js";import{t as R}from"./error-alert-BOLTerP9.js";import{t as ue}from"./queries-C46qdn9C.js";import{A as de,F as fe,I as pe,M as me,N as he,O as ge,P as _e,Y as z,j as ve,k as ye,o as be,w as B}from"./index-CbRNTyi8.js";import{n as V,r as xe,t as Se}from"./status-badge-DINlptKX.js";import{a as Ce,i as H,n as we,o as U,r as W,t as Te}from"./table-D3--FtAd.js";import{a as Ee,c as De,d as G,f as Oe,g as ke,h as Ae,i as je,l as Me,m as K,o as Ne,p as Pe,r as Fe,s as Ie,t as Le}from"./sortable.esm-Z2V3kAIY.js";import{t as q}from"./label-badge-QOx_nH-H.js";import{t as Re}from"./action-DJYOLxhn.js";import{f as ze,o as Be,u as J}from"./model-F1HLQfrf.js";import{n as Ve,t as He}from"./strings-CfIaIMiC.js";import{t as Ue}from"./project-not-found-DrMlF8K5.js";var Y=e(t(),1),We=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ge=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),X=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:We}));X.displayName=`ArrowUpRightIcon`;var Z=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ge}));Z.displayName=`ArrowsInLineHorizontalIcon`;var Ke=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:N(t),qe={above:!1,below:!1},Je=()=>{let[e,t]=(0,Y.useState)(qe),n=(0,Y.useRef)(null);return[(0,Y.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:k(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Ye({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:k(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Xe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:k(`text-lg font-semibold`,e),...t})}function Ze({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-(--card-spacing)`,e),...t})}var $e=3,et=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice($e);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,$e).map(e=>(0,Q.jsx)(q,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(B,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},tt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,nt=({item:e,project:t})=>{let n=r();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(b,{...t===void 0?{...n.task(e.repository,J(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:J(e)},search:{repository:e.repository}},draggable:!1,className:tt,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},rt=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),it=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:I(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:M.retry}):null,at=({run:e})=>{let t=L(3e4),n=w(e);return(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(V,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:Ke(e.state,n),children:ae(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},ot=({stalled:e,named:t,children:n})=>{let r=L(3e4),i=Ve(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},st=e=>[`run-again`,`board-card`,e],ct=(e,t)=>{let n=st(e),r=a({mutationKey:n,onClaimed:t}),i=o({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(m(e))}},lt=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=C(n),d=D(n),f=s?.error?.message??null,p=c?.error?.message??null,m=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,h=a===null||s===null?null:(0,Q.jsx)(Re,{stalled:a,readOnly:o,appearance:`card`}),g=n.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(S,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(z,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(nt,{item:n,project:e}),(0,Q.jsx)(et,{labels:T(n,r),catalog:i}),d!==null&&(0,Q.jsx)(at,{run:d}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(rt,{failure:u,children:m&&a?.reason._tag===`SuppressedForOperator`?h:(0,Q.jsx)(it,{failure:u,action:s})}),a!==null&&!m&&(0,Q.jsx)(ot,{stalled:a,named:(d===null||Be(a)?.id!==d.id)&&!He(a),children:h}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},ut=({runs:e,openRun:t})=>(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Run history`}),(0,Q.jsx)(g,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,Q.jsxs)(f,{onClick:()=>t(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:N(e.openedAt),className:`font-mono tabular-nums`,children:ae(e.openedAt)})]})]},e.id))})]}),dt=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[d,m]=(0,Y.useState)(!1),b=x(e),C=e.runs.filter(({id:e})=>e!==t?.id),w=e.run?.canRunAgain===!0?e.run:null,T=[{key:`links`,content:e.items.map(e=>(0,Q.jsxs)(v,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(S,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ee,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||C.length>0)&&T.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[t!==null&&(0,Q.jsx)(f,{onClick:()=>r(t.id),children:`Open run`}),C.length>0&&(0,Q.jsx)(ut,{runs:C,openRun:r})]})});let E=i.isPending||a.isPending,D=w!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!E&&D&&T.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[t?.canApprove&&(0,Q.jsx)(f,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:M.approve}),t?.canRetry&&(0,Q.jsx)(f,{title:I(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:M.retry}),w!==null&&(0,Q.jsxs)(f,{onClick:()=>a.send(w),children:[M.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:w.loop})]}),t?.canCancel&&(0,Q.jsx)(f,{variant:`destructive`,onClick:()=>m(!0),children:M.cancel})]})}),!n.disabled&&n.targets.length>0&&T.push({key:`move`,content:(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Move to`}),(0,Q.jsx)(g,{className:`min-w-40`,children:n.targets.map(t=>(0,Q.jsx)(f,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(h,{children:[(0,Q.jsx)(u,{render:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:k(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${b}`,children:(0,Q.jsx)(y,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(_,{align:`end`,className:`w-auto min-w-48`,children:T.map(({key:e,content:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&(0,Q.jsx)(c,{}),(0,Q.jsx)(s,{children:t})]},e))})]}),t!==null&&(0,Q.jsx)(ye,{open:d,onOpenChange:m,children:(0,Q.jsxs)(me,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Cancel `,t.loop,`?`]}),(0,Q.jsxs)(he,{children:[`The run on `,b,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ve,{children:M.keepRunning}),(0,Q.jsx)(de,{variant:`destructive`,onClick:()=>{m(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:M.confirmCancel})]})]})})]})},ft=e=>k(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),pt=(e,t,n)=>e.isPending&&e.variables!==void 0?se[e.variables.request.action]:t.isPending?oe:n===void 0?null:te(n),mt=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let f=d(),p=ct(n.itemKey,u),{attributes:m,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=je({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:g,style:{transform:ke.Translate.toString(v),transition:y},className:k(`group/task relative`,b&&`opacity-40`),children:[(0,Q.jsx)($,{ref:_,size:`sm`,className:k(ft(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&m,...a&&h,children:(0,Q.jsx)(lt,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:f,again:p,progress:pt(f,p,o)})}),(0,Q.jsx)(dt,{item:n,run:D(n),moves:s,openRun:u,action:f,again:p,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},ht=new Set([`Waiting`,`Queued`,`Running`]),gt=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>ht.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),_t=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),vt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:k(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${_t(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:k(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},yt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&ie(e.state)),bt=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(q,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(B,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),xt=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),St=({project:e,showRepository:t,lane:n,lanes:r,flow:i,catalog:a,targeted:o,pending:s,readOnly:c,moves:l,stallOf:u,openRun:d,onMove:f})=>{let p=yt(n),[m,h]=(0,Y.useState)(p),g=n._tag===`WritableBoardLane`,{setNodeRef:_}=Pe({id:n.id,disabled:!g||s}),v=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),y=n.items.length,[b,x]=Je();return re(p?[{label:E(n.name,m),run:()=>h(!m)}]:[]),p&&m?(0,Q.jsx)(xt,{lane:n,open:()=>h(!1)}):(0,Q.jsxs)(`section`,{ref:_,"aria-label":`${n.name} lane`,className:k(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,o&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,Q.jsxs)(`header`,{className:k(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:y})]}),i!==void 0&&(0,Q.jsx)(vt,{flow:i}),p&&(0,Q.jsx)(A,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>h(!0),children:(0,Q.jsx)(Z,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(bt,{sources:n.sources,catalog:a})})]}),(0,Q.jsx)(`div`,{ref:b,"aria-label":`${n.name} cards`,tabIndex:x.above||x.below?0:void 0,className:k(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,x.above&&`mask-t-from-[calc(100%-2.5rem)]`,x.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(Le,{items:n.items.map(({itemKey:e})=>e),strategy:Ee,children:[y===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,Q.jsx)(mt,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&v.length>0,phase:i,moves:{targets:v,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},Ct=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:k(ft(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(lt,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),wt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(Ye,{children:[(0,Q.jsx)(Xe,{children:`Runs without a card`}),(0,Q.jsxs)(Ze,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)(Qe,{children:(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ce,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:`Loop`}),(0,Q.jsx)(H,{children:`Agent`}),(0,Q.jsx)(H,{children:`Item`}),(0,Q.jsx)(H,{children:`State`}),(0,Q.jsx)(H,{className:`w-0`})]})}),(0,Q.jsx)(we,{children:e.map(e=>(0,Q.jsxs)(U,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(W,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(W,{children:e.agent}),(0,Q.jsx)(W,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(W,{children:(0,Q.jsx)(xe,{state:e.state})}),(0,Q.jsx)(W,{className:`text-right`,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(X,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Tt=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Et=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Dt=e=>{let t=G(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=G({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return Oe(e)},Ot=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Fe(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},kt=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},At=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},jt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=ne(e),p=At(e),m=l.reduce(kt,Tt(e.board.lanes)),h=Ae(K(Me,{activationConstraint:{distance:6}}),K(De,{coordinateGetter:Ot(m)})),g=gt(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),_=m.reduce((e,t)=>e+t.items.length,0),v=e=>ze(n,e),y=new Map(e.labels.map(e=>[e.name,e])),b=r||d,x=()=>{o(null),c(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(le,{title:P(e),leading:(0,Q.jsx)(z,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${_} item${_===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Se,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,Q.jsx)(R,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
2
|
+
`)}),f!==null&&(0,Q.jsx)(R,{className:`mx-4 max-w-3xl md:mx-5`,message:f.message}),(0,Q.jsxs)(Ne,{sensors:h,collisionDetection:Dt,onDragStart:({active:e})=>{let t=m.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);o(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>c(e===null?null:Et(e.id,m)?.id??null),onDragEnd:({over:e})=>{if(x(),e===null||a===null)return;let t=Et(e.id,m);t!==void 0&&u(a.item,t)},onDragCancel:x,children:[(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${P(e)} project board`,children:(0,Q.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,Q.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:m.map(t=>(0,Q.jsx)(St,{project:F(e),showRepository:e.repositories.length>1,lane:t,lanes:m,flow:g.get(t.id),catalog:y,targeted:a!==null&&s===t.id&&t.id!==a.lane.id&&t._tag===`WritableBoardLane`,pending:b,readOnly:r,moves:l,stallOf:v,openRun:i,onMove:u},t.id))}),p.length>0&&(0,Q.jsx)(wt,{runs:p,openRun:i})]})}),(0,Q.jsx)(Ie,{children:a!==null&&(0,Q.jsx)(Ct,{item:a.item,project:F(e),showRepository:e.repositories.length>1,lane:a.lane,catalog:y,stall:v(a.item)})})]})]})},Mt=()=>{let{project:e}=be.useParams(),{data:t}=i(ce()),n=i(ue()),r=ge(),a=t.projects.find(t=>F(t)===e);return a===void 0?(0,Q.jsx)(Ue,{}):(0,Q.jsx)(jt,{project:a,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:r})};export{Mt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./Match-CV3MCMPf.js";var t=e;export{t as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-CC7nI7CP.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,X as n,r,s as i,t as a}from"./section-C2BsZ62c.js";import{t as o}from"./useSuspenseQuery-ajaZl96Y.js";import{t as s}from"./link-CXTzqBsX.js";import{n as c}from"./queries-B4QNhfM4.js";import{c as l}from"./index-CbRNTyi8.js";import{t as u}from"./repository-link-dmlmZuZQ.js";var d=e(),f=({id:e,configuration:o})=>{let c=o.projects.find(t=>t.id===e);return(0,d.jsx)(a,{title:c?.name??e,entity:n(`project`,e),children:c===void 0?(0,d.jsx)(i,{title:t.missing,children:null}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s,{to:`/projects/$project`,params:{project:e},className:`text-primary hover:underline`,children:t.board}),(0,d.jsx)(r,{title:t.repositories,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:c.repositories.map(e=>(0,d.jsx)(`li`,{children:(0,d.jsx)(u,{repository:e})},e))})}),(0,d.jsx)(r,{title:t.lanes,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:c.lanes.map(e=>(0,d.jsxs)(`li`,{className:`flex flex-wrap gap-2`,children:[(0,d.jsx)(`span`,{children:e.name}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:e.sources.map(e=>`label`in e?e.label:e.state).join(`, `)})]},e.name))})})]})})},p=()=>{let{project:e}=l.useParams(),{data:t}=o(c());return(0,d.jsx)(f,{id:e,configuration:t})};export{p as component};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as e,n as t,r as n,t as r}from"./jsx-runtime-Wy9s6hX0.js";import{I as i,T as a,t as o}from"./queryOptions-Bavh4JFe.js";import{i as s,o as c,r as l,t as u}from"./queries-BNYw2mY-.js";import{n as d,t as f}from"./use-project-links-Bdqs6H65.js";import{t as p}from"./useSuspenseQuery-ajaZl96Y.js";import{y as m}from"./actions-DsEnZXEu.js";import{n as h}from"./useNavigate-I5E4IRt2.js";import{t as g}from"./mark-Bcl_OnGe.js";import{a as _,c as v,i as y,n as b,o as x,r as S,s as C,t as w}from"./code-block-Nn1IIrfL.js";import{r as T}from"./native-select-B1ICB22h.js";import{a as E,c as D,d as O,f as k,g as A,h as j,i as M,l as N,m as P,n as F,o as ee,p as te,r as ne,s as re,t as I,u as L}from"./outcome-DdTW8YJ8.js";import{W as R,r as z,t as B}from"./button-C-mC9M4I.js";import{$ as V,An as H,At as ie,Bt as ae,Cn as oe,Ct as U,Dn as se,Dt as ce,En as le,Fn as ue,Ft as W,Gt as de,Ht as fe,In as pe,It as me,J as he,Jt as ge,K as _e,Kt as ve,Ln as ye,Mn as be,Mt as xe,Nn as Se,Pn as G,Pt as Ce,Q as we,St as Te,Ut as Ee,W as De,Wt as Oe,Yt as ke,_n as Ae,et as je,gn as Me,in as Ne,jn as Pe,jt as Fe,kt as Ie,ln as Le,mn as Re,nt as ze,on as Be,qt as Ve,t as He,tn as Ue,tt as We,wt as Ge}from"./api-DsTuvRlt.js";import{a as Ke,i as qe,l as Je,o as Ye,p as Xe,s as Ze,v as Qe,w as $e}from"./strings-BIVdGoBr.js";import{A as et,R as tt,W as nt,n as rt,w as it,z as at}from"./overview-CTpxkXVa.js";import{t as ot}from"./error-alert-BOLTerP9.js";import{t as st}from"./usine-mark-Dk0O5l6k.js";import{C as ct,D as lt,S as ut,X as dt,ct as ft,i as pt,ot as mt,w as ht,x as gt}from"./index-CbRNTyi8.js";import{n as _t}from"./status-badge-DINlptKX.js";import{t as vt}from"./label-C0j5gN9r.js";import{n as yt,t as bt}from"./edit-and-retry-B0OtOtfz.js";import{t as xt}from"./markdown-DN2FBI_2.js";import{t as St}from"./label-badge-QOx_nH-H.js";import{n as K,r as q,t as J}from"./collapsible-TF5NAUgG.js";import{n as Ct,t as wt}from"./run-again-mx4hRPEd.js";var Y=e(t(),1),Tt=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm104-60a12,12,0,0,1-12,12H140v12a12,12,0,0,1-24,0V164H104a12,12,0,0,1,0-24h12V128a12,12,0,0,1,24,0v12h12A12,12,0,0,1,164,152Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-40-64a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,152Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,160H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16a8,8,0,0,1,0,16Zm0-72V43.31L196.69,88Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-42-66a6,6,0,0,1-6,6H134v18a6,6,0,0,1-12,0V158H104a6,6,0,0,1,0-12h18V128a6,6,0,0,1,12,0v18h18A6,6,0,0,1,158,152Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-40-64a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,152Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-44-68a4,4,0,0,1-4,4H132v20a4,4,0,0,1-8,0V156H104a4,4,0,0,1,0-8h20V128a4,4,0,0,1,8,0v20h20A4,4,0,0,1,156,152Z`}))]]),Et=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z`}))]]),Dt=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),Ot=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),kt=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm40-112v56a12,12,0,0,1-12,12H100a12,12,0,0,1-12-12V100a12,12,0,0,1,12-12h56A12,12,0,0,1,168,100Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32Zm32,128H96V96h64Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM160,88H96a8,8,0,0,0-8,8v64a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V96A8,8,0,0,0,160,88Zm-8,64H104V104h48Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm32,132a4,4,0,0,1-4,4H100a4,4,0,0,1-4-4V100a4,4,0,0,1,4-4h56a4,4,0,0,1,4,4Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM160,90H96a6,6,0,0,0-6,6v64a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V96A6,6,0,0,0,160,90Zm-6,64H102V102h52Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM160,88H96a8,8,0,0,0-8,8v64a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V96A8,8,0,0,0,160,88Zm-8,64H104V104h48Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220ZM160,92H96a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V96A4,4,0,0,0,160,92Zm-4,64H100V100h56Z`}))]]),At=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M120,137,48,201A12,12,0,1,1,32,183l61.91-55L32,73A12,12,0,1,1,48,55l72,64A12,12,0,0,1,120,137Zm96,43H120a12,12,0,0,0,0,24h96a12,12,0,0,0,0-24Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M216,80V192H40V64H200A16,16,0,0,1,216,80Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM77.66,173.66a8,8,0,0,1-11.32-11.32L100.69,128,66.34,93.66A8,8,0,0,1,77.66,82.34l40,40a8,8,0,0,1,0,11.32ZM192,176H128a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M116,132.48l-72,64a6,6,0,0,1-8-9L103,128,36,68.49a6,6,0,0,1,8-9l72,64a6,6,0,0,1,0,9ZM216,186H120a6,6,0,0,0,0,12h96a6,6,0,0,0,0-12Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M116,128a4,4,0,0,1-1.34,3l-72,64a4,4,0,1,1-5.32-6L106,128,37.34,67a4,4,0,0,1,5.32-6l72,64A4,4,0,0,1,116,128Zm100,60H120a4,4,0,0,0,0,8h96a4,4,0,0,0,0-8Z`}))]]),jt=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M72.5,150.63,100.79,128,72.5,105.37a12,12,0,1,1,15-18.74l40,32a12,12,0,0,1,0,18.74l-40,32a12,12,0,0,1-15-18.74ZM144,172h32a12,12,0,0,0,0-24H144a12,12,0,0,0,0,24ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-91,94.25-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32a8,8,0,0,1,0,12.5ZM176,168H136a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M126,128a6,6,0,0,1-2.25,4.69l-40,32a6,6,0,0,1-7.5-9.38L110.4,128,76.25,100.69a6,6,0,1,1,7.5-9.38l40,32A6,6,0,0,1,126,128Zm50,26H136a6,6,0,0,0,0,12h40a6,6,0,0,0,0-12Zm54-98V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M122.5,124.88a4,4,0,0,1,0,6.24l-40,32a4,4,0,0,1-5-6.24L113.6,128,77.5,99.12a4,4,0,0,1,5-6.24ZM176,156H136a4,4,0,0,0,0,8h40a4,4,0,0,0,0-8ZM228,56V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z`}))]]),Mt=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),Nt=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),Pt=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:Tt}));Pt.displayName=`FilePlusIcon`;var Ft=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:Et}));Ft.displayName=`FileTextIcon`;var It=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:Dt}));It.displayName=`GithubLogoIcon`;var Lt=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:Ot}));Lt.displayName=`PencilSimpleIcon`;var Rt=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:kt}));Rt.displayName=`StopCircleIcon`;var zt=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:At}));zt.displayName=`TerminalIcon`;var Bt=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:jt}));Bt.displayName=`TerminalWindowIcon`;var Vt=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:Mt}));Vt.displayName=`WrenchIcon`;var Ht=Y.forwardRef((e,t)=>Y.createElement(R,{ref:t,...e,weights:Nt}));Ht.displayName=`XCircleIcon`;var Ut=e=>{let t=i();return c({mutationFn:t=>He(n=>n.detail({params:{runId:e},query:new _e(t)})),onSuccess:(n,r)=>{t.setQueryData(u(e),e=>e===void 0?e:s(e,n,r))}})},X=r(),Wt=({runId:e,attemptId:t,target:n,paused:r,held:a})=>{let[o,s]=(0,Y.useState)(``),l=(0,Y.useId)(),d=i(),f=n._tag===`Child`,p=f||r||a,m=c({mutationFn:r=>He(i=>i.intervene({params:{runId:e},payload:new De({attemptId:t,target:n,action:r})})),onSuccess:async(t,n)=>{n._tag===`OperatorMessage`&&s(e=>e===n.message?``:e),await d.invalidateQueries({queryKey:u(e)})}}),h=()=>{o.trim().length>0&&!m.isPending&&m.mutate(new je({message:o}))};return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(vt,{htmlFor:l,children:f?`Message this child`:`Message the parent`}),(0,X.jsx)(dt,{id:l,value:o,onChange:e=>s(e.target.value),rows:3,placeholder:r?`Send guidance to resume`:`Add guidance or ask a question`,onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())}}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(lt,{command:r?`Send and resume`:`Send`,size:`sm`,onClick:h,disabled:m.isPending||o.trim().length===0,children:r?`Send and resume`:`Send`}),(0,X.jsx)(lt,{command:`Pause session`,size:`sm`,variant:`outline`,disabled:m.isPending||r,onClick:()=>m.mutate(new V),children:`Pause session`}),p&&(0,X.jsx)(lt,{command:f?`Release child`:`Release parent`,size:`sm`,variant:`secondary`,disabled:m.isPending,onClick:()=>m.mutate(new ze),children:f?`Release child`:`Release parent`})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?`A message places a hold. Release the child to return the result to the parent`:`A message places a hold. Release the parent to continue the task`}),m.isError&&(0,X.jsx)(ot,{message:m.error.message})]})};function Gt({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=Kt(qt(r,i),t);if(!n)return Y.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!Y.isValidElement(n))return null;let o=n.props,s={...Kt(a,o),ref:Xt(a.ref,o.ref)};return Y.cloneElement(n,s)}function Kt(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?Xt(i,r):Yt(n)&&typeof i==`function`&&typeof r==`function`?Jt(r,i):r}}return t}function qt(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function Jt(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Yt(e){return/^on[A-Z]/.test(e)}function Xt(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var Zt=8,Qt=64,$t=0,en=.5,tn=180,nn=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),rn={start:!1,end:!1},an={currentAnchorId:null,visibleMessageIds:[]};function on({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return rn;let i=vn({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function sn({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return an;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of cn(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+en&&(u=e)}return l.length===0&&u===null?an:{currentAnchorId:u,visibleMessageIds:l}}function cn(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function ln(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function un(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function dn(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function fn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function pn({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of cn(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function mn({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=hn(t,i),o=t.getBoundingClientRect().height,s=xn(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function hn(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function gn(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function _n({content:e,scrollTop:t,spacer:n,viewport:r}){let i=vn({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function vn({content:e,spacer:t,viewport:n}){let r=cn(e,t),i=bn(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function yn(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function bn(e){let t=window.getComputedStyle(e);return{end:Cn(t.paddingBlockEnd||t.paddingBottom),start:Cn(t.paddingBlockStart||t.paddingTop)}}function xn(e){let t=e?.parentElement;return t?bn(t):{end:0,start:0}}function Sn(e){if(!e)return 0;let t=window.getComputedStyle(e);return Cn(t.rowGap===`normal`?t.gap:t.rowGap)}function Cn(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function wn(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function Tn(e,t){return wn(e,t)}function En(){return wn(an,On)}function Dn(e,t){return e.start===t.start&&e.end===t.end}function On(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function kn({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=Y.useRef(e),o=Y.useRef(!1),s=Y.useRef(null),c=Y.useRef(!1),l=Y.useRef(n),u=Y.useRef(0),d=Y.useRef(null),f=Y.useRef(0),p=Y.useRef(e?`following-bottom`:`free-scrolling`),m=Y.useRef(new Map),h=Y.useRef(null),g=Y.useRef(null),_=Y.useRef(null),v=Y.useRef(i),y=Y.useRef(!0),b=Y.useRef(null),x=Y.useRef(r),S=Y.useRef(null),C=Y.useRef(0),w=Y.useRef(0),T=Y.useRef(null),E=Y.useRef(null),D=Y.useRef(null),O=Y.useRef(null),k=Y.useRef(null),A=Y.useRef(null),j=Y.useRef(null),M=Y.useRef(null),N=Y.useRef(null),P=Y.useRef(new Set),F=Y.useRef(new WeakSet);return D.current===null&&(D.current=Tn(t===`end`||t===`last-anchor`,(e,t)=>e===t)),O.current===null&&(O.current=Tn(rn,Dn)),N.current===null&&(N.current=En()),a.current=e,l.current=n,x.current=r,v.current=i,{autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:k,streamingTurnRef:_,contentRef:s,defaultScrollPositionAppliedRef:c,firstItemRef:d,itemCountRef:u,lastScrollTopRef:f,messageElementsRef:m,modeRef:p,pendingScrollFrameRef:S,pendingScrollToMessageRef:h,prependRestoreRef:g,preserveScrollOnPrependRef:y,pendingDefaultScrollStore:D.current,rootRef:b,scrollEdgeThresholdRef:l,scrollMarginRef:x,scrollPreviousItemPeekRef:v,spacerGapRef:C,spacerHeightRef:w,spacerRef:T,stateFrameRef:E,stateStore:O.current,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:N.current,visibleMessageIdsRef:P,handledScrollAnchorsRef:F}}function An(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function jn(e){e.defaultScrollPositionAppliedRef.current=!0,An(e)}function Mn({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,itemCountRef:l,messageElementsRef:u,modeRef:d,pendingScrollToMessageRef:f,prependRestoreRef:p,scrollMarginRef:m,scrollPreviousItemPeekRef:h,spacerGapRef:g,spacerHeightRef:_,spacerRef:v,viewportRef:y}=e,b=Y.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},tn))},[t]),x=Y.useCallback(e=>{let t=v.current;if(!t)return;let n=Math.max(0,Math.ceil(e));_.current!==n&&(_.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-g.current}px`:``)},[]),S=Y.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=y.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=en?(a.scrollTop=o,t()):(i&&b(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,b]),C=Y.useCallback(({behavior:e=`auto`}={})=>y.current?(x(0),i.current=null,d.current=`free-scrolling`,S(0,{behavior:e}),r(),!0):!1,[r,S,x]),w=Y.useCallback(({behavior:e=`auto`}={})=>{let t=y.current;return t?(x(0),i.current=null,d.current=a.current?`following-bottom`:`free-scrolling`,S(yn(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,S,x]),T=Y.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=m.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=y.current;if(!s||!l||!s.contains(e))return!1;let u=mn({align:t,element:e,scrollMargin:o?a+h.current:a,spacer:v.current,viewport:l}),f=_n({content:s,scrollTop:u,spacer:v.current,viewport:l});return x(f),p.current={element:e,viewportTop:gn(e,l)},d.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,S(u,{behavior:n}),r(),!0},[r,S,x]),E=Y.useCallback(()=>{let e=i.current;return!e||!e.isConnected||d.current!==`anchored-to-message`?!1:T(e,{align:`start`},{keepPreviousPeek:!0})},[T]),D=Y.useCallback((t,n)=>{let r=u.current.get(t);return r?(jn(e),T(r,n)?(f.current=null,!0):(f.current={messageId:t,options:n},!0)):l.current===0&&(f.current={messageId:t,options:n},jn(e),!0)},[T]);return{flushPendingScrollToMessage:Y.useCallback(()=>{let t=f.current;if(!t)return!1;let n=u.current.get(t.messageId);return!n||!T(n,t.options)?!1:(f.current=null,jn(e),!0)},[T]),reanchorToAnchoredMessage:E,scrollToElement:T,scrollToEnd:w,scrollToMessage:D,scrollToStart:C}}function Nn(e,t){return Y.useCallback(n=>{e.current=n,n&&t()},[e,t])}function Pn({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Zt,scrollPreviousItemPeek:r=Qt,scrollMargin:i=$t}){let a=kn({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:x,rootRef:S,scrollEdgeThresholdRef:C,scrollMarginRef:w,scrollPreviousItemPeekRef:T,spacerGapRef:E,spacerHeightRef:D,spacerRef:O,stateFrameRef:k,stateStore:A,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P,visibleMessageIdsRef:F,handledScrollAnchorsRef:ee}=a,te=Y.useRef(t);te.current!==t&&(te.current=t,d.current=!1);let ne=Y.useCallback(e=>{let t=S.current,n=j.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),re=Y.useCallback(e=>{let t=j.current?.scrollTop??0,n=t<m.current-en;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),I=Y.useCallback(()=>{let e=on({content:u.current,scrollEdgeThreshold:C.current,spacer:O.current,viewport:j.current});re(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;ne(t),A.setSnapshot(t)},[re,A,ne]),L=Y.useCallback(()=>{k.current===null&&(k.current=window.requestAnimationFrame(()=>{k.current=null,I()}))},[I]),R=Y.useCallback(()=>{P.hasListeners()&&M.current===null&&(M.current=window.requestAnimationFrame(()=>{M.current=null,P.hasListeners()&&P.setSnapshot(sn({content:u.current,scrollMargin:w.current,scrollPreviousItemPeek:T.current,spacer:O.current,viewport:j.current,visibleMessageIds:F.current}))}))},[P]),{flushPendingScrollToMessage:z,reanchorToAnchoredMessage:B,scrollToElement:V,scrollToEnd:H,scrollToMessage:ie,scrollToStart:ae}=Mn({refs:a,commitScrollState:I,scheduleStateCommit:L,scheduleVisibilitySync:R}),oe=Y.useCallback(()=>{let e=y.current,t=j.current;if(!e||!t||!e.element.isConnected)return!1;let n=gn(e.element,t)-e.viewportTop;return Math.abs(n)<=en?!1:(t.scrollTop+=n,e.viewportTop=gn(e.element,t),L(),R(),!0)},[L,R]),U=Y.useCallback(()=>{let e=u.current,t=j.current;if(!e||!t){y.current=null;return}let n=pn({content:e,spacer:O.current,viewport:t});y.current=n?{element:n,viewportTop:gn(n,t)}:null},[]),se=Y.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,z()&&U()}))},[U,z]),ce=Y.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=j.current,r=t&&n?fn(cn(t,O.current)):null;if(!t||!n||!r)e=H({behavior:`auto`});else{let i=hn(r,n);e=vn({content:t,spacer:O.current,viewport:n})-i<=n.clientHeight?H({behavior:`auto`}):V(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?H({behavior:`auto`}):ae({behavior:`auto`});return e?(jn(a),!0):!1},[t,V,H,ae]),le=Y.useCallback(()=>{let e=u.current;if(!e)return;let t=cn(e,O.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(z())return;if(n===0){if(ce()||t.length>0&&s.current&&H({behavior:`auto`}))return;I(),R();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0)oe();else{if(t.length>n){let e=ln(t,n);if(e){if(s.current&&g.current===`following-bottom`&&dn(t,n)){H({behavior:`auto`});return}V(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}if(t.length===n){let e=un(t,ee.current);if(e){V(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}g.current===`following-bottom`&&s.current?H({behavior:`auto`}):(I(),R())}})(),U()},[ce,U,I,z,oe,R,V,H]),ue=Y.useCallback(()=>{if(g.current===`following-bottom`&&s.current){H({behavior:`auto`});return}let e=D.current;B()?s.current&&e>0&&D.current===0&&H({behavior:`auto`}):(L(),R())},[B,L,R,H]),W=Y.useCallback(()=>{let e=j.current;if(e&&P.hasListeners()){if(typeof IntersectionObserver>`u`){R();return}N.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?F.current.add(e):F.current.delete(e))}R()},{root:e,rootMargin:`${-(w.current+T.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{N.current?.observe(e)}),R()}},[R,P]),de=Y.useCallback(()=>{M.current!==null&&(window.cancelAnimationFrame(M.current),M.current=null),N.current?.disconnect(),N.current=null,F.current.clear(),P.setSnapshot(an)},[P]),fe=Y.useCallback((e,t,n)=>{t?(h.current.set(e,t),N.current?.observe(t),R(),v.current?.messageId===e&&se()):n&&h.current.get(e)===n&&(h.current.delete(e),F.current.delete(e),N.current?.unobserve(n),R())},[se,R]),pe=Y.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),me=Y.useCallback(()=>ne(A.getSnapshot()),[A,ne]),he=Nn(S,me),ge=Nn(j,me),_e=Y.useCallback(e=>{u.current=e},[]),ve=Y.useCallback(e=>{O.current=e,E.current=Sn(e?.parentElement??null)},[]),ye=Y.useCallback(()=>{I(),R(),U()},[U,I,R]),be=Y.useMemo(()=>({handleContentChange:le,handleResize:ue,observeVisibility:W,pendingDefaultScrollStore:x,preserveScrollOnPrependRef:b,scrollToEnd:H,scrollToMessage:ie,scrollToStart:ae,setContentElement:_e,setRootElement:he,setSpacerElement:ve,setViewportElement:ge,stateStore:A,syncAfterScroll:ye,unobserveVisibility:de,userScrollIntent:pe,viewportRef:j,visibilityStore:P}),[le,ue,W,x,H,ie,ae,_e,he,ve,ge,A,ye,de,pe,P]);return Y.useLayoutEffect(()=>{ce()||p.current===0&&An(a)},[ce]),Y.useEffect(()=>()=>{k.current!==null&&(window.cancelAnimationFrame(k.current),k.current=null),M.current!==null&&(window.cancelAnimationFrame(M.current),M.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),N.current?.disconnect(),N.current=null},[]),Y.useLayoutEffect(()=>{e&&g.current===`following-bottom`&&p.current>0?H({behavior:`auto`}):I()},[e,I,H]),{context:be,registerMessage:fe}}function Fn(e){let t=Y.useRef(e);return t.current=e,t}var In=Y.createContext(null),Ln=Y.createContext(null);function Z(){let e=Y.useContext(In);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function Rn(){let e=Y.useContext(Ln);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function zn(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=Z();return Y.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function Bn(){let{stateStore:e}=Z();return Y.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Vn(){let{observeVisibility:e,unobserveVisibility:t,visibilityStore:n}=Z(),r=Y.useCallback(r=>n.subscribe(r,e,t),[e,t,n]);return Y.useSyncExternalStore(r,n.getSnapshot,n.getSnapshot)}function Hn({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=Pn({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,X.jsx)(In.Provider,{value:o,children:(0,X.jsx)(Ln.Provider,{value:s,children:t})})}function Un(){let{pendingDefaultScrollStore:e}=Z();return Y.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Wn({children:e,...t}){let{setRootElement:n}=Z(),r=Un();return(0,X.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function Gn({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=Z(),_=Un();f.current=o;let v=Y.useCallback(e=>{p(e),Xt(s)?.(e)},[s,p]);function y(e){m(),r?.(e)}function b(e){h(),a?.(e)}function x(e){h(),i?.(e)}function S(e){nn.has(e.key)&&h(),n?.(e)}return Y.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,X.jsx)(`div`,{ref:v,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:S,onScroll:y,onTouchMove:x,onWheel:b,...u,..._?{"data-pending-scroll":``}:null,children:t})}function Kn({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=Z(),u=Y.useRef(null),d=Y.useCallback(e=>{u.current=e,c(e),Xt(n)?.(e)},[n,c]);return Y.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),Y.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,X.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,X.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function qn({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=Rn(),a=Y.useRef(null),o=Y.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Xt(t)?.(n)},[e,t,i]);return(0,X.jsx)(`div`,{ref:o,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function Jn({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=Z(),d=Fn(r),f=Y.useCallback(e=>u.subscribe(e),[u]),p=Y.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=Y.useSyncExternalStore(f,p,p),h=Y.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return Gt({defaultTagName:`button`,props:Kt({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,X.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var Yn={Provider:Hn,Root:Wn,Viewport:Gn,Content:Kn,Item:qn,Button:Jn};function Xn(e){return(0,X.jsx)(Yn.Provider,{...e})}function Zn({className:e,...t}){return(0,X.jsx)(Yn.Root,{"data-slot":`message-scroller`,className:z(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function Qn({className:e,...t}){return(0,X.jsx)(Yn.Viewport,{"data-slot":`message-scroller-viewport`,className:z(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function $n({className:e,...t}){return(0,X.jsx)(Yn.Content,{"data-slot":`message-scroller-content`,className:z(`flex h-max min-h-full flex-col gap-6`,e),...t})}function Q({className:e,scrollAnchor:t=!1,...n}){return(0,X.jsx)(Yn.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:z(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}var er=[`ArrowUp`,`ArrowDown`,`Home`,`End`,`PageUp`,`PageDown`,` `],tr=e=>e.scrollHeight-e.clientHeight-e.scrollTop<=8,nr=(e,t)=>{for(let n=e instanceof Element?e:null;n!==null&&n!==t;n=n.parentElement){let{overflowX:e,overflowY:t}=getComputedStyle(n);if(n.scrollHeight>n.clientHeight&&/^(auto|scroll)$/u.test(t)||n.scrollWidth>n.clientWidth&&/^(auto|scroll)$/u.test(e))return!0}return!1},rr=({viewportRef:e,following:t,onNavigate:n,onInteract:r,children:i})=>{let{scrollToEnd:a}=zn(),o=(0,Y.useRef)(0),s=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let t=e.current;if(t===null)return;let n=()=>{o.current=t.scrollTop};return t.addEventListener(`wheel`,n,{passive:!1}),t.addEventListener(`touchmove`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n),t.removeEventListener(`touchmove`,n)}},[e]),(0,Y.useEffect)(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current.frame),s.current=null},[]),(0,Y.useEffect)(()=>{let n=e.current;t&&n!==null&&tr(n)&&a({behavior:`instant`})},[t,a,e]);let c=e=>{t&&tr(e)&&a({behavior:`instant`})},l=e=>{let t=s.current;t!==null&&(cancelAnimationFrame(t.frame),s.current=null,e.scrollTop===t.top?t.following&&a({behavior:`instant`}):n())},u=(e,n=e.scrollTop)=>{r(),s.current===null&&(s.current={top:n,following:t&&tr(e),frame:requestAnimationFrame(()=>{let t=s.current;t!==null&&(t.frame=requestAnimationFrame(()=>l(e)))})})};return(0,X.jsx)(Qn,{ref:e,"aria-label":`Run conversation`,preserveScrollOnPrepend:!1,onScroll:e=>{e.target===e.currentTarget&&l(e.currentTarget)},onWheel:e=>{e.deltaY===0?c(e.currentTarget):u(e.currentTarget,o.current)},onTouchMove:e=>u(e.currentTarget,o.current),onPointerDown:e=>{e.target===e.currentTarget?n():r()},onKeyDown:e=>{let t=e.key===` `&&e.target instanceof Element&&e.target.closest(`button, [role="button"]`)!==null;e.key===`Enter`||t?r():!e.defaultPrevented&&er.includes(e.key)&&(nr(e.target,e.currentTarget)?(r(),c(e.currentTarget)):u(e.currentTarget))},children:i})},ir=(e,t)=>{let n=new Map(e);if(t._tag===`Item`){let r=e.get(t.key);n.delete(t.key),n.set(t.key,{open:t.open,groupOpen:t.open||r?.groupOpen===!0})}else for(let r of t.keys)n.delete(r),n.set(r,{open:e.get(r)?.open===!0,groupOpen:t.open});return n},ar=(e,t)=>t.some(t=>e.get(t)?.groupOpen===!0),or=(0,Y.createContext)(null),sr=({children:e,initialState:t=new Map,onInspect:n})=>{let[r,i]=(0,Y.useReducer)(ir,t),a=(0,Y.useCallback)(e=>{e.open&&n?.(),i(e)},[n]);return(0,X.jsx)(or.Provider,{value:{state:r,change:a,reveal:i},children:e})},cr=()=>{let e=(0,Y.useContext)(or);if(e===null)throw Error(`TranscriptDisclosureProvider is required`);return e},lr=e=>({messageId:e.key,tool:e.isTool?e.key:null}),ur={errors:{count:(e,t)=>`${e} ${t?`loaded `:``}${e===1?`error`:`errors`}`,name:`error`,group:`Conversation errors`,title:void 0},recovered:{count:(e,t)=>`${e}${t?`+`:``} recovered`,name:`recovered tool failure`,group:`Recovered tool failures`,title:`Failed tool calls followed by more activity in the attempt`}},dr=({errors:e,kind:t=`errors`,selectedKey:n,earlier:r,onSelect:i})=>{let a=e[0],o=e.at(-1);if(a===void 0||o===void 0)return null;let s=ur[t],c=e.findIndex(e=>e.key===n),l=e[c-1]??o,u=e[c+1]??a,d=s.count(e.length,r);return(0,X.jsxs)(`div`,{role:`group`,"aria-label":s.group,className:`flex items-center gap-1`,children:[(0,X.jsx)(`span`,{role:`status`,title:s.title,className:z(`mr-auto text-xs tabular-nums`,t===`errors`?`text-destructive`:`text-muted-foreground`),children:c<0?d:`${c+1} of ${d}`}),(0,X.jsx)(B,{variant:`ghost`,size:`icon-sm`,"aria-label":`Previous ${s.name}`,title:`Previous ${s.name}`,className:t===`recovered`?`text-muted-foreground`:void 0,onClick:()=>i(l),children:(0,X.jsx)(C,{"aria-hidden":`true`})}),(0,X.jsx)(B,{variant:`ghost`,size:`icon-sm`,"aria-label":`Next ${s.name}`,title:`Next ${s.name}`,className:t===`recovered`?`text-muted-foreground`:void 0,onClick:()=>i(u),children:(0,X.jsx)(v,{"aria-hidden":`true`})})]})},fr=({target:e,onRevealed:t})=>{let{state:n,reveal:r}=cr(),{scrollToMessage:i}=zn();return(0,Y.useEffect)(()=>{if(e===null)return;if(e.tool!==null&&(n.get(e.tool)?.open!==!0||n.get(e.tool)?.groupOpen!==!0)){r({_tag:`Item`,key:e.tool,open:!0});return}let a,o,s=requestAnimationFrame(()=>{i(e.messageId,{align:`start`,behavior:`instant`})&&(a=requestAnimationFrame(()=>{i(e.messageId,{align:`start`,behavior:`instant`}),o=requestAnimationFrame(t)}))});return()=>{cancelAnimationFrame(s),a!==void 0&&cancelAnimationFrame(a),o!==void 0&&cancelAnimationFrame(o)}},[e,n,r,i,t]),null},pr=({count:e,active:t,pendingLatest:n,revealing:r,onObserve:i,onLatest:a,onReachedLatest:o})=>{let{end:s}=Bn(),{scrollToEnd:c}=zn();return(0,Y.useEffect)(()=>{i(t&&!s&&!r)},[t,s,r,i]),(0,Y.useLayoutEffect)(()=>{n&&c({behavior:`instant`})&&o()},[n,c,o]),(0,X.jsx)(`div`,{className:`flex h-10 shrink-0 items-center justify-center`,children:e>0?(0,X.jsxs)(B,{variant:`secondary`,size:`sm`,className:`gap-1.5`,onClick:a,children:[(0,X.jsx)(v,{"aria-hidden":`true`}),e,` new `,e===1?`update`:`updates`]}):s&&(0,X.jsxs)(B,{variant:`ghost`,size:`sm`,className:`gap-1.5`,onClick:a,children:[(0,X.jsx)(v,{"aria-hidden":`true`}),`Jump to latest`]})})},mr=(e,t,n)=>{let r;for(let i of e.querySelectorAll(`[data-transcript-id]`)){let e=i.getBoundingClientRect();if(!(e.height===0||e.bottom<=t||e.top>=n)){if(r!==void 0&&!r.contains(i))break;r=i}}return r},hr=e=>{let t=e.getBoundingClientRect().top+e.clientTop,n=t+e.clientHeight;return mr(e,t+24,n)??mr(e,t,n)},gr=class extends Y.Component{pendingPosition=null;getSnapshotBeforeUpdate(e){if(!e.active||e.active===this.props.active&&e.revision===this.props.revision)return null;let t=this.props.viewportRef.current;if(t===null||t.clientHeight===0||t.scrollHeight-t.clientHeight-t.scrollTop<=8)return null;let n=t.getBoundingClientRect().top+t.clientTop,r=hr(t);return r===void 0?null:{viewport:t,element:r,identity:r.getAttribute(`data-transcript-id`),offset:r.getBoundingClientRect().top-n}}componentDidUpdate(e,t,n){if(n!==null&&(this.pendingPosition=n),!this.props.active||this.pendingPosition===null)return;let r=this.props.viewportRef.current;if(r===null||r.clientHeight===0)return;let i=this.pendingPosition;if(this.pendingPosition=null,r!==i.viewport)return;let a=r.contains(i.element)?i.element:Array.from(r.querySelectorAll(`[data-transcript-id]`)).find(e=>e.getAttribute(`data-transcript-id`)===i.identity);if(a===void 0)return;let o=r.getBoundingClientRect().top+r.clientTop,s=a.getBoundingClientRect().top-o;r.scrollTop+=s-i.offset}render(){return this.props.children}},_r=Ce.check(ke(1),ge(1024)),vr=xe.check(ve(),Ve(0)),yr=W({_tag:Ie(`Anchor`),key:_r,surface:ie([`row`,`group`,`result`]),sequence:he,offset:xe.check(de({minimum:-1e6,maximum:1e6}))}),br=me([W({_tag:Ie(`Latest`)}),yr]),xr=W({disclosures:U(W({key:_r,open:Ge,groupOpen:Ge})).check(ge(200)),position:br,readThrough:Fe(he)}),Sr=W({runId:_r,savedAt:vr,bookmark:xr}),Cr=Ee(W({version:Ie(2),runs:U(Sr).check(ge(20))})),wr=ae(Cr,{onExcessProperty:`error`}),Tr=fe(Cr),Er=`usine:conversation-readers:v1`,Dr=2592e6,Or=512e3,kr=e=>{let t=()=>{let t=e().getItem(Er);return t===null||t.length>Or?[]:G(wr(t),{onNone:()=>[],onSome:e=>e.runs})},n=(e,t,n,r)=>Re(Me({try:n,catch:()=>({operation:e,runId:t})}).pipe(Be(e=>Le(`Conversation reader storage unavailable`,e).pipe(Ne(r))),Ae(`ConversationReader.${e}`,{attributes:{runId:t}})));return{read:(e,r)=>n(`read`,e,()=>{let n=t().find(t=>t.runId===e);return n!==void 0&&r>=n.savedAt&&r-n.savedAt<Dr?n.bookmark:null},null),write:(r,i,a)=>{n(`write`,r,()=>{let n=t().filter(e=>e.runId!==r&&a>=e.savedAt&&a-e.savedAt<Dr);n.push({runId:r,savedAt:a,bookmark:i}),n.sort((e,t)=>t.savedAt-e.savedAt),n.splice(20);let o=Tr({version:2,runs:n});for(;o.length>Or&&n.length>1;)n.pop(),o=Tr({version:2,runs:n});e().setItem(Er,o)},void 0)}}},Ar=({runId:e,readThrough:t,rows:n,viewportRef:r,active:i,restoring:a,allowLatest:o,initialPosition:s})=>{let{state:c}=cr(),l=(0,Y.useRef)(null),u=(0,Y.useRef)(s),d=(0,Y.useRef)(void 0),f=(0,Y.useRef)(kr(()=>window.localStorage)),p=(e=r.current)=>{if(!i||a||e===null||e.clientHeight===0)return;let s=hr(e),d=n.find(e=>e.elementId===s?.getAttribute(`data-transcript-id`));o&&e.scrollHeight-e.clientHeight-e.scrollTop<=8?u.current={_tag:`Latest`}:d!==void 0&&s!==void 0&&(u.current={_tag:`Anchor`,key:d.key,surface:d.surface,sequence:d.sequence,offset:s.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop}),l.current={readThrough:t,position:u.current,disclosures:[...c].slice(-200).map(([e,t])=>({key:e,...t}))}},m=(0,Y.useRef)(p);return(0,Y.useLayoutEffect)(()=>{m.current=p,p()}),(0,Y.useLayoutEffect)(()=>{let e=r.current;return()=>m.current(e)},[i,e,r]),(0,Y.useEffect)(()=>{let t=()=>{clearTimeout(d.current),d.current=void 0,l.current!==null&&f.current.write(e,l.current,Date.now())},n=()=>{m.current(),clearTimeout(d.current),d.current=setTimeout(t,500)},i=()=>{m.current(),t()},a=()=>{document.visibilityState===`hidden`&&i()},o=r.current;return o?.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`pagehide`,i),document.addEventListener(`visibilitychange`,a),()=>{o?.removeEventListener(`scroll`,n),window.removeEventListener(`pagehide`,i),document.removeEventListener(`visibilitychange`,a),t()}},[e,r]),(0,Y.useEffect)(()=>{if(!i||a)return;let t=requestAnimationFrame(()=>{m.current(),clearTimeout(d.current),d.current=setTimeout(()=>{l.current!==null&&f.current.write(e,l.current,Date.now())},500)});return()=>cancelAnimationFrame(t)},[e,t,n,c,i,a,o]),null},jr=(e,t)=>{let n={key:e.key,sequence:e.sequence,surface:`row`,elementId:e.key,messageId:e.key,openKeys:[],groupKeys:t};return[n,{...n,surface:`result`,elementId:`${e.key}:result`,openKeys:[e.key]}]},Mr=(e,t)=>({key:e,sequence:t,surface:`row`,elementId:e,messageId:e,openKeys:[],groupKeys:[]}),Nr=e=>e.chapters.flatMap(e=>e.rows.flatMap(e=>{switch(e._tag){case`Message`:case`Note`:return[Mr(e.key,e.sequence)];case`Ending`:return G(e.position,{onNone:()=>[],onSome:({key:e,sequence:t})=>[Mr(e,t)]});case`Delegation`:return jr(e.tool,[]);case`GitHubChange`:case`BoardMove`:return[];case`Burst`:{let t=e.tools.map(e=>e.key);return[{key:e.tools[0].key,sequence:e.tools[0].sequence,surface:`group`,elementId:e.key,messageId:e.key,openKeys:[],groupKeys:t},...e.tools.flatMap(e=>jr(e,t))]}}})),Pr=(e,t,n)=>{let r=t.find(t=>t.surface===e.surface&&(t.key===e.key||t.surface===`group`&&t.groupKeys.includes(e.key)));if(r!==void 0&&r.sequence<=e.sequence)return{_tag:`Row`,row:r,offset:e.offset,fallback:!1};if(n===`available`)return{_tag:`Earlier`};let i=t.find(t=>t.key===e.key&&t.surface===`row`)??t.filter(e=>e.surface!==`result`).reduce((t,n)=>t===void 0||Math.abs(n.sequence-e.sequence)<Math.abs(t.sequence-e.sequence)?n:t,void 0);return i===void 0?{_tag:`Empty`}:{_tag:`Row`,row:i,offset:0,fallback:!0}},Fr=({target:e,rows:t,history:n,viewportRef:r,active:i,onRestored:a})=>{let{scrollToMessage:o,scrollToStart:s}=zn(),{state:c,reveal:l}=cr(),u=(0,Y.useRef)(new Set),[d,f]=(0,Y.useState)(0);(0,Y.useLayoutEffect)(()=>{let t=r.current;if(e===null||t===null)return;let n=new ResizeObserver(()=>f(e=>e+1));return n.observe(t),()=>n.disconnect()},[e,r]);let[p,m]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{if(e===null||!i)return;let d=u.current.size>=20,f=Pr(e,t,n.earlier!==void 0&&n.error===null&&!d?`available`:`exhausted`);if(f._tag===`Earlier`){if(n.loading||n.earlier===void 0)return;let e=JSON.stringify([n.earlier.attemptId,n.earlier.before]);if(u.current.has(e))return;u.current.add(e),n.load();return}if(n.loading&&(f._tag===`Empty`||f._tag===`Row`&&f.fallback))return;if(f._tag===`Row`){let e=f.row.openKeys.filter(e=>c.get(e)?.open!==!0),t=f.row.surface!==`group`&&f.row.groupKeys.length>0&&!ar(c,f.row.groupKeys);if(e.length>0||t){for(let t of e)l({_tag:`Item`,key:t,open:!0});t&&l({_tag:`Group`,keys:f.row.groupKeys,open:!0});return}}let p,h,g=requestAnimationFrame(()=>{let e=r.current;if(e===null||e.clientHeight===0)return;let t=(t,n)=>{let r=Array.from(e.querySelectorAll(`[data-transcript-id]`)).find(e=>e.getAttribute(`data-transcript-id`)===t.elementId);if(r===void 0||r.getBoundingClientRect().height===0)return!1;let i=r.getBoundingClientRect(),a=Math.min(e.clientHeight-24,Math.max(24-i.height,n)),o=i.top-e.getBoundingClientRect().top-e.clientTop-a;return Math.abs(o)>1&&(e.scrollTop+=o),!0};if(f._tag===`Empty`)s({behavior:`instant`});else if(!o(f.row.messageId,{align:`start`,behavior:`instant`})||!t(f.row,f.offset))return;(f._tag===`Empty`||f.fallback)&&m(n.earlier===void 0?`Saved row no longer available, showing the nearest activity`:`Saved place not in the loaded history, showing nearby activity`),p=requestAnimationFrame(()=>{f._tag===`Row`&&t(f.row,f.offset),h=requestAnimationFrame(a)})});return()=>{cancelAnimationFrame(g),p!==void 0&&cancelAnimationFrame(p),h!==void 0&&cancelAnimationFrame(h)}},[e,d,t,n,r,i,c,l,o,s,a]),p===null?null:(0,X.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-xs text-muted-foreground`,children:p})},Ir=({document:e,active:t,onReading:n})=>{let{visibleMessageIds:r}=Vn(),i=(0,Y.useMemo)(()=>M(e),[e]),a=E(i,r),o=a?.attemptId,s=a?.checkpointKey??null;return(0,Y.useEffect)(()=>{t&&o!==void 0&&n({attemptId:o,checkpointKey:s})},[t,o,s,n]),null},Lr=({label:e,value:t})=>(0,X.jsxs)(`span`,{children:[e,t!==void 0&&(0,X.jsxs)(X.Fragment,{children:[` `,t]})]}),Rr=({children:e})=>(0,X.jsx)(`span`,{className:`font-mono text-foreground`,children:e}),zr=({chapter:e,runTask:t})=>{let n=H(e.attempt),r=e.sessions.find(({session:e})=>e._tag===`ParentSession`),i=pe(e.parentModel,()=>se(r?.session.brain.model)),a=[...new Map(e.sessions.filter(({session:e})=>e._tag===`ChildSession`).map(({session:e})=>[JSON.stringify([e.agent,e.brain.harness,e.brain.model,e.brain.effort]),e])).values()];return(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`p`,{className:`flex flex-wrap gap-x-5 gap-y-1 text-xs text-muted-foreground`,children:[n!==void 0&&(0,X.jsx)(Lr,{label:`Worker`,value:(0,X.jsx)(Rr,{children:n.worker})}),G(i,{onNone:()=>null,onSome:e=>(0,X.jsx)(Lr,{label:r===void 0?`Parent model`:`Parent on ${Je(r.session.brain.harness)},`,value:(0,X.jsx)(Rr,{children:e})})}),a.map(e=>(0,X.jsx)(Lr,{label:`Child ${e.agent} on ${Je(e.brain.harness)},`,value:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Rr,{children:e.brain.model}),`, `,e.brain.effort,` effort`]})},e.id)),a.length===0&&n!==void 0&&(0,X.jsx)(Lr,{label:`Agent ${n.agent} on ${Je(n.brain.harness)},`,value:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Rr,{children:n.brain.model}),`, `,n.brain.effort,` effort`]})}),e.meters.map(e=>(0,X.jsx)(Lr,{label:Xe(e.pool),value:e.windows.map(e=>[`${e.usedPercent}%`,G(e.windowDurationMinutes,{onNone:()=>`used`,onSome:e=>`of ${$e(e)} window`}),G(e.resetsAt,{onNone:()=>``,onSome:e=>`, resets ${Ke(Ue(e))}`})].join(` `)).join(`; `).replace(/ ,/gu,`,`)},e.pool)),n?.operatorIntervened===!0&&(0,X.jsx)(Lr,{label:`Operator intervened`})]}),n!==void 0&&n.task!==t&&(0,X.jsxs)(J,{children:[(0,X.jsxs)(q,{render:(0,X.jsx)(B,{variant:`ghost`,size:`sm`,className:`-mx-2 h-7 gap-1 px-2 text-xs font-normal text-muted-foreground data-[panel-open]:[&_svg]:rotate-90`}),children:[(0,X.jsx)(m,{"aria-hidden":`true`}),`Task used by this attempt`]}),(0,X.jsx)(K,{className:`pt-1`,children:(0,X.jsx)(xt,{className:`text-sm`,children:n.task})})]})]})},$=({gutter:e,children:t,className:n})=>(0,X.jsxs)(`div`,{className:z(`grid min-w-0 gap-x-6 gap-y-0.5 sm:grid-cols-[4.5rem_minmax(0,31.5rem)]`,n),children:[e===void 0?(0,X.jsx)(`div`,{className:`max-sm:hidden`}):(0,X.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-2 sm:flex-col sm:items-stretch sm:gap-0`,children:e}),(0,X.jsx)(`div`,{className:`min-w-0`,children:t})]}),Br={Running:(0,X.jsx)(st,{running:!0,className:`text-run-active`}),Error:(0,X.jsx)(Ht,{className:`text-destructive`}),Stopped:(0,X.jsx)(Rt,{className:`text-muted-foreground`})},Vr=({className:e,...t})=>(0,X.jsx)(J,{className:z(`group/tool not-prose w-full min-w-0`,e),...t}),Hr=({title:e,status:t,icon:n,description:r,children:i,className:a,...o})=>(0,X.jsxs)(q,{className:z(`group/tool-trigger -mx-2 flex min-h-11 w-[calc(100%+1rem)] min-w-0 items-center gap-2 rounded-md px-2 py-2 text-left outline-none hover:bg-muted/30 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-[panel-open]:bg-muted/30`,a),...o,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground [&_svg]:size-3.5`,children:n??(0,X.jsx)(Vt,{})}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium wrap-anywhere`,children:e}),t!==`Completed`&&(0,X.jsxs)(ht,{variant:`secondary`,className:`gap-1`,children:[Br[t],t]}),i]}),r&&(0,X.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground group-data-[panel-open]/tool-trigger:whitespace-normal group-data-[panel-open]/tool-trigger:wrap-anywhere`,children:r})]}),(0,X.jsx)(T,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[panel-open]/tool-trigger:rotate-180`})]}),Ur=({className:e,...t})=>(0,X.jsx)(K,{className:z(`min-w-0 space-y-3 pt-2 pb-2 pl-5.5 outline-none`,e),...t}),Wr=({className:e,title:t=`Result`,children:n,...r})=>(0,X.jsxs)(`div`,{className:z(`min-w-0 space-y-2`,e),...r,children:[(0,X.jsx)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:t}),n]}),Gr=n(((e,t)=>{var n=[[{color:`0, 0, 0`,class:`ansi-black`},{color:`187, 0, 0`,class:`ansi-red`},{color:`0, 187, 0`,class:`ansi-green`},{color:`187, 187, 0`,class:`ansi-yellow`},{color:`0, 0, 187`,class:`ansi-blue`},{color:`187, 0, 187`,class:`ansi-magenta`},{color:`0, 187, 187`,class:`ansi-cyan`},{color:`255,255,255`,class:`ansi-white`}],[{color:`85, 85, 85`,class:`ansi-bright-black`},{color:`255, 85, 85`,class:`ansi-bright-red`},{color:`0, 255, 0`,class:`ansi-bright-green`},{color:`255, 255, 85`,class:`ansi-bright-yellow`},{color:`85, 85, 255`,class:`ansi-bright-blue`},{color:`255, 85, 255`,class:`ansi-bright-magenta`},{color:`85, 255, 255`,class:`ansi-bright-cyan`},{color:`255, 255, 255`,class:`ansi-bright-white`}]],r=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&|%[A-Fa-f0-9]{2})+)/gm;t.exports=class e{static escapeForHtml(t){return new e().escapeForHtml(t)}static linkify(t){return new e().linkify(t)}static ansiToHtml(t,n){return new e().ansiToHtml(t,n)}static ansiToJson(t,n){return new e().ansiToJson(t,n)}static ansiToText(t){return new e().ansiToText(t)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let e=0;e<2;++e)for(let t=0;t<8;++t)this.PALETTE_COLORS.push(n[e][t].color);let e=[0,95,135,175,215,255],t=(t,n,r)=>e[t]+`, `+e[n]+`, `+e[r];for(let e=0;e<6;++e)for(let n=0;n<6;++n)for(let r=0;r<6;++r)this.PALETTE_COLORS.push(t(e,n,r));let r=8;for(let e=0;e<24;++e,r+=10)this.PALETTE_COLORS.push(r+`, `+r+`, `+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,e=>e==`&`?`&`:e==`"`?`"`:e==`<`?`<`:e==`>`?`>`:``)}linkify(e){return e.replace(r,e=>`<a href="${e}">${e}</a>`)}ansiToHtml(e,t){return this.process(e,t,!0)}ansiToJson(e,t){return t||={},t.json=!0,t.clearLine=!1,this.process(e,t,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,t,n){let r=this,i=e.split(/\033\[/),a=i.shift();t??={},t.clearLine=/\r/.test(e);let o=i.map(e=>this.processChunk(e,t,n));if(t&&t.json){let e=r.processChunkJson(``);return e.content=a,e.clearLine=t.clearLine,o.unshift(e),t.remove_empty&&(o=o.filter(e=>!e.isEmpty())),o}return o.unshift(a),o.join(``)}processChunkJson(e,t,r){t=t===void 0?{}:t;let i=t.use_classes=t.use_classes!==void 0&&t.use_classes,a=t.key=i?`class`:`color`,o={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:t.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!o.content},s=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!s)return o;o.content=s[4];let c=s[2].split(`;`);if(s[1]!==``||s[3]!==`m`||!r)return o;let l=this;for(;c.length>0;){let e=c.shift(),t=parseInt(e);if(isNaN(t)||t===0)l.fg=l.bg=null,l.decorations=[];else if(t===1)l.decorations.push(`bold`);else if(t===2)l.decorations.push(`dim`);else if(t===3)l.decorations.push(`italic`);else if(t===4)l.decorations.push(`underline`);else if(t===5)l.decorations.push(`blink`);else if(t===7)l.decorations.push(`reverse`);else if(t===8)l.decorations.push(`hidden`);else if(t===9)l.decorations.push(`strikethrough`);else if(t===21)l.removeDecoration(`bold`);else if(t===22)l.removeDecoration(`bold`),l.removeDecoration(`dim`);else if(t===23)l.removeDecoration(`italic`);else if(t===24)l.removeDecoration(`underline`);else if(t===25)l.removeDecoration(`blink`);else if(t===27)l.removeDecoration(`reverse`);else if(t===28)l.removeDecoration(`hidden`);else if(t===29)l.removeDecoration(`strikethrough`);else if(t===39)l.fg=null;else if(t===49)l.bg=null;else if(t>=30&&t<38)l.fg=n[0][t%10][a];else if(t>=90&&t<98)l.fg=n[1][t%10][a];else if(t>=40&&t<48)l.bg=n[0][t%10][a];else if(t>=100&&t<108)l.bg=n[1][t%10][a];else if(t===38||t===48){let e=t===38;if(c.length>=1){let t=c.shift();if(t===`5`&&c.length>=1){let t=parseInt(c.shift());if(t>=0&&t<=255){if(!i)this.PALETTE_COLORS||l.setupPalette(),e?l.fg=this.PALETTE_COLORS[t]:l.bg=this.PALETTE_COLORS[t];else{let r=t>=16?`ansi-palette-`+t:n[+(t>7)][t%8].class;e?l.fg=r:l.bg=r}}}else if(t===`2`&&c.length>=3){let t=parseInt(c.shift()),n=parseInt(c.shift()),r=parseInt(c.shift());if(t>=0&&t<=255&&n>=0&&n<=255&&r>=0&&r<=255){let a=t+`, `+n+`, `+r;i?e?(l.fg=`ansi-truecolor`,l.fg_truecolor=a):(l.bg=`ansi-truecolor`,l.bg_truecolor=a):e?l.fg=a:l.bg=a}}}}}return l.fg===null&&l.bg===null&&l.decorations.length===0||(o.fg=l.fg,o.bg=l.bg,o.fg_truecolor=l.fg_truecolor,o.bg_truecolor=l.bg_truecolor,o.decorations=l.decorations,o.decoration=l.decorations.slice(-1).pop()||null,o.was_processed=!0),o}processChunk(e,t,r){t||={};let i=this.processChunkJson(e,t,r),a=t.use_classes;if(i.decorations=i.decorations.filter(e=>{if(e===`reverse`){i.fg||=n[0][7][a?`class`:`color`],i.bg||=n[0][0][a?`class`:`color`];let e=i.fg;i.fg=i.bg,i.bg=e;let t=i.fg_truecolor;return i.fg_truecolor=i.bg_truecolor,i.bg_truecolor=t,i.isInverted=!0,!1}return!0}),t.json)return i;if(i.isEmpty())return``;if(!i.was_processed)return i.content;let o=[],s=[],c=[],l={},u=e=>{let t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push(`data-`+n+`="`+this.escapeForHtml(e[n])+`"`);return t.length>0?` `+t.join(` `):``};return i.isInverted&&(l[`ansi-is-inverted`]=`true`),i.fg&&(a?(o.push(i.fg+`-fg`),i.fg_truecolor!==null&&(l[`ansi-truecolor-fg`]=i.fg_truecolor,i.fg_truecolor=null)):o.push(`color:rgb(`+i.fg+`)`)),i.bg&&(a?(o.push(i.bg+`-bg`),i.bg_truecolor!==null&&(l[`ansi-truecolor-bg`]=i.bg_truecolor,i.bg_truecolor=null)):o.push(`background-color:rgb(`+i.bg+`)`)),i.decorations.forEach(e=>{a?s.push(`ansi-`+e):e===`bold`?s.push(`font-weight:bold`):e===`dim`?s.push(`opacity:0.5`):e===`italic`?s.push(`font-style:italic`):e===`hidden`?s.push(`visibility:hidden`):e===`strikethrough`?c.push(`line-through`):c.push(e)}),c.length&&s.push(`text-decoration:`+c.join(` `)),a?`<span class="`+o.concat(s).join(` `)+`"`+u(l)+`>`+i.content+`</span>`:`<span style="`+o.concat(s).join(`;`)+`"`+u(l)+`>`+i.content+`</span>`}removeDecoration(e){let t=this.decorations.indexOf(e);t>=0&&this.decorations.splice(t,1)}}})),Kr=n(((e,t)=>{function n(e){if(!e)return``;if(!/\r/.test(e))return e;for(e=e.replace(/\r+\n/gm,`
|
|
2
|
+
`);/\r./.test(e);)e=e.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm,function(e,t,n){return n+t.slice(n.length)});return e}function r(e){for(var t=0,n=0;n<e.length;n++)e[t].length<=e[n].length&&(t=n);return t}function i(e){if(!/\r/.test(e))return e;for(var t=e.split(`\r`),n=[];t.length>0;){var i=r(t);n.push(t[i]),t=t.slice(i+1)}return n.join(`\r`)}function a(e){if(!e)return``;if(!/\r/.test(e))return e;if(!/\n/.test(e))return i(e);e=e.replace(/\r+\n/gm,`
|
|
3
|
+
`);var t=e.lastIndexOf(`
|
|
4
|
+
`);return n(e.slice(0,t))+`
|
|
5
|
+
`+i(e.slice(t+1))}t.exports=n,t.exports.escapeCarriageReturn=n,t.exports.escapeCarriageReturnSafe=a})),qr=n(((e,t)=>{t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/})),Jr=n(((e,t)=>{t.exports=/[\0-\x1F\x7F-\x9F]/})),Yr=n(((e,t)=>{t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/})),Xr=n(((e,t)=>{t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/})),Zr=n(((e,t)=>{t.exports=function(e){var t={};t.src_Any=qr().source,t.src_Cc=Jr().source,t.src_Z=Yr().source,t.src_P=Xr().source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);var n=`[><|]`;return t.src_pseudo_letter=`(?:(?!`+n+`|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|`+n+`|`+t.src_ZPCc+`)(?!-|_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|`+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]).|`+(e&&e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`).|;(?!`+t.src_ZCc+`).|\\!+(?!`+t.src_ZCc+`|[!]).|\\?(?!`+t.src_ZCc+`|[?]).)+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|`+n+`|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}})),Qr=n(((e,t)=>{function n(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function r(e){return Object.prototype.toString.call(e)}function i(e){return r(e)===`[object String]`}function a(e){return r(e)===`[object Object]`}function o(e){return r(e)===`[object RegExp]`}function s(e){return r(e)===`[object Function]`}function c(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var l={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function u(e){return Object.keys(e||{}).reduce(function(e,t){return e||l.hasOwnProperty(t)},!1)}var d={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},f=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,p=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function m(e){e.__index__=-1,e.__text_cache__=``}function h(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function g(){return function(e,t){t.normalize(e)}}function _(e){var t=e.re=Zr()(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(f),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);var l=[];e.__compiled__={};function u(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){var n=e.__schemas__[t];if(n!==null){var r={validate:null,link:null};e.__compiled__[t]=r,a(n)?(o(n.validate)?r.validate=h(n.validate):s(n.validate)?r.validate=n.validate:u(t,n),s(n.normalize)?r.normalize=n.normalize:n.normalize?u(t,n):r.normalize=g()):i(n)?l.push(t):u(t,n)}}),l.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:g()};var d=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(c).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+d+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+d+`)`,`ig`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),m(e)}function v(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function y(e,t){var n=new v(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function b(e,t){if(!(this instanceof b))return new b(e,t);t||u(e)&&(t=e,e={}),this.__opts__=n({},l,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=n({},d,e),this.__compiled__={},this.__tlds__=p,this.__tlds_replaced__=!1,this.re={},_(this)}b.prototype.add=function(e,t){return this.__schemas__[e]=t,_(this),this},b.prototype.set=function(e){return this.__opts__=n(this.__opts__,e),this},b.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},b.prototype.pretest=function(e){return this.re.pretest.test(e)},b.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},b.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(y(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(y(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},b.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),_(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,_(this),this)},b.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},b.prototype.onCompile=function(){},t.exports=b})),$r=n(((e,n,r)=>{var i=r&&r.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),a=r&&r.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),o=r&&r.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),o=0;o<r.length;o++)r[o]!=="default"&&i(n,t,r[o]);return a(n,t),n}})(),s=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=v;var c=s(Gr()),l=Kr(),u=s(Qr()),d=o(t());function f(e,t=!1){return e=(0,l.escapeCarriageReturn)(y(e)),c.default.ansiToJson(e,{json:!0,remove_empty:!0,use_classes:t})}function p(e){let t=``;return e.bg&&(t+=`${e.bg}-bg `),e.fg&&(t+=`${e.fg}-fg `),e.decoration&&(t+=`ansi-${e.decoration} `),t===``?null:(t=t.substring(0,t.length-1),t)}function m(e){let t={};switch(e.bg&&(t.backgroundColor=`rgb(${e.bg})`),e.fg&&(t.color=`rgb(${e.fg})`),e.decoration){case`bold`:t.fontWeight=`bold`;break;case`dim`:t.opacity=`0.5`;break;case`italic`:t.fontStyle=`italic`;break;case`hidden`:t.visibility=`hidden`;break;case`strikethrough`:t.textDecoration=`line-through`;break;case`underline`:t.textDecoration=`underline`;break;case`blink`:t.textDecoration=`blink`}return t}function h(e,t,n,r){let i=t?null:m(n),a=t?p(n):null;return e?e===`fuzzy`?_(n,r,i,a):g(n,r,i,a):d.createElement(`span`,{style:i,key:r,className:a},n.content)}function g(e,t,n,r){let i=[],a=/(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g,o=0,s;for(;(s=a.exec(e.content))!==null;){let[,t,n]=s,r=s.index+t.length;r>o&&i.push(e.content.substring(o,r));let c=n.startsWith(`www.`)?`http://${n}`:n;i.push(d.createElement(`a`,{key:o,href:c,target:`_blank`},`${n}`)),o=a.lastIndex}return o<e.content.length&&i.push(e.content.substring(o)),d.createElement(`span`,{style:n,key:t,className:r},i)}function _(e,t,n,r){let i=(0,u.default)({fuzzyEmail:!1}).tlds([`io`],!0);if(!i.pretest(e.content))return d.createElement(`span`,{style:n,key:t,className:r},e.content);let a=i.match(e.content);if(!a)return d.createElement(`span`,{style:n,key:t,className:r},e.content);let o=[e.content.substring(0,a[0]?.index)];return a.forEach((t,n)=>{o.push(d.createElement(`a`,{href:t.url,target:`_blank`,key:n},e.content.substring(t.index,t.lastIndex))),a[n+1]&&o.push(e.content.substring(a[n].lastIndex,a[n+1]?.index))}),a[a.length-1].lastIndex!==e.content.length&&o.push(e.content.substring(a[a.length-1].lastIndex,e.content.length)),d.createElement(`span`,{style:n,key:t,className:r},o)}function v(e){let{className:t,useClasses:n,children:r,linkify:i}=e;return d.createElement(`code`,{className:t},f(r??``,n??!1).map(h.bind(null,i??!1,n??!1)))}function y(e){let t=e;do e=t,t=e.replace(/[^\n]\x08/gm,``);while(t.length<e.length);return e}})),ei=e(n(((e,t)=>{t.exports=$r().default}))(),1),ti=(0,Y.createContext)(``),ni=({className:e,...t})=>(0,X.jsx)(`div`,{className:z(`flex items-center justify-between gap-2 border-b bg-muted/30 px-3 py-2`,e),...t}),ri=({children:e,className:t,...n})=>(0,X.jsxs)(`div`,{className:z(`flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,t),...n,children:[(0,X.jsx)(zt,{className:`size-3.5 shrink-0`}),e??`Output`]}),ii=({className:e,...t})=>(0,X.jsx)(`div`,{className:z(`flex shrink-0 items-center gap-2`,e),...t}),ai=e=>(0,X.jsx)(x,{value:(0,Y.useContext)(ti),label:`Copy output`,...e}),oi=({className:e,...t})=>(0,X.jsx)(`div`,{className:z(`max-h-96 overflow-auto p-3 font-mono text-xs/relaxed`,e),...t,children:(0,X.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words`,children:(0,X.jsx)(ei.default,{children:(0,Y.useContext)(ti)})})}),si=({output:e,title:t=`Terminal`,children:n,className:r,...i})=>(0,X.jsx)(ti.Provider,{value:e,children:(0,X.jsx)(`div`,{className:z(`not-prose min-w-0 overflow-hidden rounded-md border bg-background text-foreground`,r),...i,children:n??(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(ni,{children:[(0,X.jsx)(ri,{children:t}),(0,X.jsx)(ii,{children:(0,X.jsx)(ai,{})})]}),(0,X.jsx)(oi,{})]})})}),ci=U(ce),li=({value:e})=>{if(e===null)return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`None`});if(Oe(Ce)(e))return(0,X.jsx)(`span`,{className:`block max-h-48 overflow-auto whitespace-pre-wrap wrap-anywhere`,children:e});if(Oe(Ge)(e))return(0,X.jsx)(`span`,{children:e?`Yes`:`No`});if(Oe(xe)(e))return(0,X.jsx)(`span`,{className:`font-mono`,children:e});let t=Oe(ci)(e)?e.map((e,t)=>({label:`Item ${t+1}`,value:e})):Object.entries(e).map(([e,t])=>({label:e,value:t}));return t.length===0?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Empty`}):(0,X.jsxs)(J,{children:[(0,X.jsxs)(q,{render:(0,X.jsx)(B,{variant:`ghost`,size:`sm`,className:`h-auto gap-1 px-0 py-0 text-muted-foreground data-[panel-open]:[&_svg]:rotate-90`}),children:[(0,X.jsx)(m,{"aria-hidden":`true`}),t.length,` `,t.length===1?`entry`:`entries`]}),(0,X.jsx)(K,{className:`mt-2 border-l pl-3`,children:(0,X.jsx)(ui,{fields:t})})]})},ui=({fields:e})=>(0,X.jsx)(`dl`,{className:`space-y-3 text-xs/relaxed`,children:e.map(({label:e,value:t},n)=>(0,X.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(5rem,1fr)_minmax(0,3fr)] gap-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground wrap-anywhere`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0`,children:(0,X.jsx)(li,{value:t})})]},`${e}:${n}`))}),di=({sections:e,category:t})=>e.map((e,n)=>(0,X.jsx)(`div`,{className:`min-w-0`,children:Te(e,{Code:({label:e,text:n,language:r})=>t===`command`&&r===`text`?(0,X.jsx)(si,{output:n,title:e}):(0,X.jsx)(w,{code:n,language:r,showLineNumbers:t!==`read`&&(r===`typescript`||r===`diff`),children:(0,X.jsxs)(y,{children:[(0,X.jsx)(_,{className:`wrap-anywhere`,children:e}),(0,X.jsx)(b,{children:(0,X.jsx)(S,{})})]})}),Text:({label:e,text:t})=>(0,X.jsx)(`section`,{"aria-label":e,children:(0,X.jsx)(xt,{children:t})}),Fields:({label:e,fields:t})=>(0,X.jsx)(`section`,{"aria-label":e,children:(0,X.jsx)(ui,{fields:t})})})},`${e.label}:${n}`)),fi={command:Bt,read:Ft,edit:Lt,write:Pt,search:ft,agent:mt,tool:Vt},pi=({entry:e,view:t})=>{let n=e.state,r=t.category===`edit`&&t.output.some(e=>e._tag===`Code`&&e.language===`diff`),i=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(di,{sections:t.input,category:t.category}),Pe(e.start)&&(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`Load earlier history to see this call’s input.`})]});return(0,X.jsxs)(X.Fragment,{children:[!r&&i,(0,X.jsx)(`div`,{"data-transcript-id":`${e.key}:result`,className:`space-y-3`,children:t.output.length>0?(0,X.jsx)(di,{sections:t.output,category:t.category}):(0,X.jsx)(Wr,{title:n._tag===`Error`?`Error`:`Result`,children:(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:n._tag===`Running`?`Waiting for a result…`:n._tag===`Stopped`?`Session ended before a result`:`No output recorded`})})}),r&&i,(0,X.jsxs)(J,{children:[(0,X.jsxs)(q,{render:(0,X.jsx)(B,{variant:`ghost`,size:`sm`,className:`gap-1 px-0 text-muted-foreground data-[panel-open]:[&_svg]:rotate-90`}),children:[(0,X.jsx)(m,{"aria-hidden":`true`}),`Raw details`]}),(0,X.jsxs)(K,{className:`space-y-3 pt-2`,children:[G(e.start,{onNone:()=>null,onSome:({input:e})=>(0,X.jsx)(di,{category:`tool`,sections:[{_tag:`Code`,label:`Input payload`,text:JSON.stringify(e,null,2),language:`json`}]})}),(n._tag===`Finished`||n._tag===`Error`)&&(0,X.jsx)(di,{category:`tool`,sections:[{_tag:`Code`,label:`Output payload`,text:JSON.stringify(n.output,null,2),language:`json`}]})]})]})]})},mi=e=>{let{scrollToMessage:t}=zn(),n=cr();return{open:n.state.get(e)?.open===!0,onOpenChange:r=>{r&&t(e,{align:`nearest`,behavior:`instant`}),n.change({_tag:`Item`,key:e,open:r})}}},hi=({entry:e})=>{let t=mi(e.key),n=L(e),r=fi[n.category],i=e.state,a=i._tag===`Finished`?`Completed`:i._tag,o=G(e.start,{onNone:()=>``,onSome:({receivedAt:e})=>{if(i._tag!==`Finished`&&i._tag!==`Error`)return``;let t=Date.parse(i.receivedAt)-Date.parse(e);return!Number.isFinite(t)||t<0?``:t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}});return(0,X.jsxs)(Vr,{"data-transcript-id":e.key,...t,children:[(0,X.jsx)(Hr,{title:n.title,status:a,icon:(0,X.jsx)(r,{"aria-hidden":`true`}),description:n.subject,"aria-label":`${n.title}: ${n.subject} · ${a}`,children:o!==``&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:o})}),(0,X.jsx)(Ur,{children:(0,X.jsx)(pi,{entry:e,view:n})})]})},gi=e=>{let t=e?.trim().replace(/[ \t]+/gu,` `)??``,n=/^(?:npm|yarn|bun|pnpm(?: --filter (?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)?)(?: run)? (test|build)$/u.exec(t)?.[1];return n===`test`||/^(?:vitest run|pytest|python3? -m pytest|cargo test|go test(?: \.\/\.\.\.)?|node --test)$/u.test(t)?`tests`:n===`build`?`build`:`command`},_i=e=>{switch(e._tag){case`Files`:return e.operation;case`Command`:return gi(e.command);default:return e._tag}},vi=56,yi=(e,t)=>{let n=e.slice(-57).split(`/`);for(let r=1;r<n.length;r++){let i=n.slice(-r).join(`/`);if(t.every(t=>t===e||t!==i&&!t.endsWith(`/${i}`)))return i}return e.length<=vi?e:void 0},bi=(e,t,n)=>{let r=[...new Set(t.flatMap(e=>e._tag===`Files`?e.paths:[]))],i={read:`read`,edit:`edited`,write:`wrote`,change:`changed`}[e.operation];if(t.some(e=>e._tag===`Files`&&(e.paths.length===0||e.paths.some(e=>e.trim()===``)))){let n=e.operation;return`${t.length} file ${n}${t.length===1?``:`s`}`}let a=`${i} ${r.length} ${r.length===1?`file`:`files`}`;if(r.length>2)return a;let o=[];for(let e of r){let t=yi(e,n);if(t===void 0)return a;o.push(t)}let s=o.join(`, `),c=o.every(e=>e.trim()!==``&&!/[^\p{L}\p{N} ._@()+/-]/u.test(e));return s.length<=vi&&c?`${i} ${s}`:a},xi=(e,t,n)=>{let r=t.length,i=r===1?``:`s`;switch(e._tag){case`Files`:return bi(e,t,n);case`Command`:{let t=gi(e.command);return t===`tests`?`ran tests${r===1?``:` ${r} times`}`:t===`build`?`ran ${r===1?`a build`:`${r} builds`}`:`ran ${r} command${i}`}case`Search`:return r===1?`searched`:`searched ${r} times`;case`Delegation`:return`delegated ${r} task${i}`;case`Tool`:return`${r} tool call${i}`}},Si=e=>{let t=e.tools.map(e=>L(e).activity),n=[...new Set(t.flatMap(e=>e._tag===`Files`?e.paths:[]))],r=new Map;for(let e of t){let t=_i(e),n=r.get(t);n===void 0?r.set(t,[e]):n.push(e)}let i=[...r.values()],a=i.slice(0,2).map(e=>xi(e[0],e,n)),o=i.slice(2).reduce((e,t)=>e+t.length,0);o>0&&a.push(`${o} more ${o===1?`call`:`calls`}`);let s=a.join(` · `);return s.charAt(0).toUpperCase()+s.slice(1)},Ci=e=>{let t=e.flatMap(({state:e})=>e._tag===`Finished`||e._tag===`Error`?[Date.parse(e.receivedAt)]:[]),n=e[0];if(n===void 0||t.length===0)return ue();let r=G(n.start,{onNone:()=>Date.parse(n.receivedAt),onSome:({receivedAt:e})=>Date.parse(e)}),i=Math.max(...t)-r;return Number.isFinite(i)&&i>=1e3?ye(i):ue()},wi=({burst:e})=>{let{state:t,change:n}=cr(),{scrollToMessage:r}=zn(),i=e.tools.map(e=>e.key),a=e.tools.filter(e=>e.state._tag===`Error`).length,o=e.tools.filter(e=>e.state._tag===`Running`).length,s=Ci(e.tools);return(0,X.jsxs)(J,{"data-transcript-id":e.key,open:ar(t,i),onOpenChange:t=>{t&&r(e.key,{align:`nearest`,behavior:`instant`}),n({_tag:`Group`,keys:i,open:t})},className:`min-w-0`,children:[(0,X.jsxs)(q,{render:(0,X.jsx)(B,{variant:`ghost`,size:`sm`,className:`-mx-2 h-auto min-h-7 w-[calc(100%+1rem)] justify-start gap-2 px-2 py-1 text-left text-xs font-normal whitespace-normal text-muted-foreground hover:text-foreground aria-expanded:bg-transparent aria-expanded:hover:bg-muted/70 data-[panel-open]:[&>svg]:rotate-90`}),children:[(0,X.jsx)(m,{"aria-hidden":`true`,className:`shrink-0 transition-transform`}),(0,X.jsxs)(`span`,{className:`min-w-0`,children:[Si(e),a>0&&(0,X.jsxs)(`span`,{className:`text-destructive`,children:[`, `,a,` failed`]}),o>0&&(0,X.jsxs)(`span`,{className:`text-run-active`,children:[`, `,(0,X.jsx)(st,{running:!0,className:`mr-1 inline-block size-3 align-middle`}),o,` running`]}),G(s,{onNone:()=>null,onSome:e=>(0,X.jsxs)(X.Fragment,{children:[` · `,(0,X.jsx)(`span`,{className:`font-mono tabular-nums`,children:Ze(e)})]})}),(0,X.jsxs)(`span`,{className:`sr-only`,children:[` `,`· `,e.tools.length,` `,e.tools.length===1?`tool call`:`tool calls`]})]})]}),(0,X.jsx)(K,{className:`collapsible-motion -mx-2 space-y-1 px-2 pt-1 pb-2`,children:e.tools.map(e=>(0,X.jsx)(Q,{messageId:e.key,className:`-mx-2 px-2 [content-visibility:visible]`,children:(0,X.jsx)(hi,{entry:e})},e.key))})]})},Ti=({receivedAt:e,speaker:t,tone:n=`plain`})=>(0,X.jsxs)(X.Fragment,{children:[e!==void 0&&(0,X.jsx)(`time`,{dateTime:e,title:Qe(e),className:`font-mono text-xs leading-[1.4rem] tabular-nums text-muted-foreground`,children:qe(e)}),t!=null&&(0,X.jsx)(`span`,{className:z(`truncate text-xs font-medium`,n===`failed`?`text-destructive`:`text-foreground`),children:t})]}),Ei=({row:e,speaker:t})=>{let n=mi(e.tool.key),r=L(e.tool),i=r.input.find(e=>e._tag===`Text`&&e.label===`Task`),a=i?._tag===`Text`?i.text:r.subject,o=Ci([e.tool]),s=e.tool.state._tag;return(0,X.jsx)($,{gutter:(0,X.jsx)(Ti,{receivedAt:e.tool.receivedAt,speaker:t}),children:(0,X.jsxs)(Vr,{"data-transcript-id":e.tool.key,...n,children:[(0,X.jsx)(`p`,{className:`line-clamp-2 text-md wrap-anywhere text-muted-foreground`,children:a}),(0,X.jsxs)(q,{"aria-label":`Delegated task: ${r.subject} · ${s===`Finished`?`Completed`:s}`,render:(0,X.jsx)(B,{variant:`ghost`,size:`sm`,className:`-mx-2 h-auto min-h-7 w-[calc(100%+1rem)] justify-start gap-2 px-2 py-1 text-left text-xs font-normal whitespace-normal text-muted-foreground hover:text-foreground aria-expanded:bg-transparent aria-expanded:hover:bg-muted/70 data-[panel-open]:[&>svg]:rotate-90`}),children:[(0,X.jsx)(m,{"aria-hidden":`true`,className:`shrink-0 transition-transform`}),(0,X.jsxs)(`span`,{children:[`Delegated a task`,s===`Running`&&(0,X.jsxs)(`span`,{className:`text-run-active`,children:[`, `,(0,X.jsx)(st,{running:!0,className:`mr-1 inline-block size-3 align-middle`}),`running`]}),s===`Error`&&(0,X.jsx)(`span`,{className:`text-destructive`,children:`, failed`}),G(o,{onNone:()=>null,onSome:e=>(0,X.jsxs)(X.Fragment,{children:[` · `,(0,X.jsx)(`span`,{className:`font-mono tabular-nums`,children:Ze(e)})]})})]})]}),(0,X.jsx)(Ur,{className:`collapsible-motion pl-0`,children:(0,X.jsx)(pi,{entry:e.tool,view:r})})]})})},Di={APPROVED:e=>(0,X.jsxs)(X.Fragment,{children:[`Approved `,e]}),CHANGES_REQUESTED:e=>(0,X.jsxs)(X.Fragment,{children:[`Requested changes on `,e]}),COMMENTED:e=>(0,X.jsxs)(X.Fragment,{children:[`Reviewed `,e]}),DISMISSED:e=>(0,X.jsxs)(X.Fragment,{children:[`Reviewed `,e,`, since dismissed`]})},Oi=({url:e})=>{let t=/\/(issues|pull)\/(\d+)/u.exec(e);return t?.[1]===void 0||t[2]===void 0?(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-primary underline-offset-4 hover:underline`,children:`GitHub`}):(0,X.jsx)(g,{item:{kind:t[1]===`pull`?`pr`:`issue`,number:Number(t[2]),url:e,state:null}})},ki=({labels:e})=>e.map((e,t)=>(0,X.jsxs)(Y.Fragment,{children:[t>0&&` `,(0,X.jsx)(St,{name:e.name,label:e})]},e.name)),Ai=({change:e})=>{let t=e.removed.length>0;return(0,X.jsxs)(X.Fragment,{children:[t&&(0,X.jsxs)(X.Fragment,{children:[`Removed `,(0,X.jsx)(ki,{labels:e.removed})]}),e.added.length>0&&(0,X.jsxs)(X.Fragment,{children:[t?`, added `:`Added `,(0,X.jsx)(ki,{labels:e.added})]})]})},ji=({row:e})=>(0,X.jsxs)(`div`,{title:`GitHub recorded this at ${Qe(e.at)}`,className:`flex min-h-7 min-w-0 items-start gap-2 py-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(It,{"aria-hidden":`true`,className:`mt-0.75 size-3.5 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 leading-5 wrap-anywhere`,children:Te(e.change,{Labels:e=>(0,X.jsx)(Ai,{change:e}),Commented:({url:e})=>(0,X.jsxs)(X.Fragment,{children:[`Commented on `,(0,X.jsx)(Oi,{url:e})]}),Reviewed:({url:e,state:t})=>Di[t]((0,X.jsx)(Oi,{url:e}))})})]}),Mi=({row:e,speaker:t})=>(0,X.jsx)($,{gutter:(0,X.jsx)(Ti,{receivedAt:e.receivedAt,speaker:t,tone:e.blocked||e.undelivered?`failed`:`plain`}),children:(0,X.jsxs)(`div`,{"data-transcript-id":e.key,className:`min-w-0`,children:[e.blocked&&(0,X.jsx)(`span`,{className:`sr-only`,children:`Blocked: `}),e.format===`markdown`?(0,X.jsx)(xt,{className:`text-md wrap-anywhere`,children:e.text}):(0,X.jsx)(`p`,{className:`text-md whitespace-pre-wrap wrap-anywhere`,children:e.text}),e.undelivered&&(0,X.jsx)(`p`,{className:`text-xs text-destructive`,children:`Not delivered`}),e.queued!==null&&(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:et(e.queued)})]})}),Ni=({row:e,speaker:t})=>Te(e,{Message:e=>(0,X.jsx)(Mi,{row:e,speaker:t}),Note:e=>(0,X.jsx)($,{gutter:(0,X.jsx)(Ti,{receivedAt:e.receivedAt,speaker:t}),children:(0,X.jsxs)(`p`,{"data-transcript-id":e.key,className:z(`text-xs leading-[1.4rem] wrap-anywhere`,{plain:`text-muted-foreground`,warning:`text-warning`,failed:`text-destructive`}[e.tone]),children:[e.tone===`warning`&&(0,X.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),e.text]})}),Burst:e=>(0,X.jsx)($,{gutter:(0,X.jsx)(Ti,{speaker:t}),children:(0,X.jsx)(wi,{burst:e})}),Delegation:e=>(0,X.jsx)(Ei,{row:e,speaker:t}),GitHubChange:e=>(0,X.jsx)($,{children:(0,X.jsx)(ji,{row:e})}),BoardMove:({move:e})=>(0,X.jsx)($,{gutter:(0,X.jsx)(Ti,{receivedAt:e.at}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-[1.4rem] wrap-anywhere text-muted-foreground`,children:[`You moved it from `,e.fromLane,` to `,e.toLane,` on the board`]})}),Ending:e=>(0,X.jsx)($,{gutter:(0,X.jsx)(Ti,{receivedAt:H(e.receivedAt),speaker:t,tone:e.end._tag===`Failed`?`failed`:`plain`}),children:(0,X.jsx)(`div`,{"data-transcript-id":be(e.position)?e.key:void 0,children:(0,X.jsx)(I,{end:e.end,outOfMemory:e.outOfMemory})})})}),Pi=e=>Te(e,{Message:({speaker:e})=>e,Note:({speaker:e})=>e,Burst:({speaker:e})=>e,Delegation:({speaker:e})=>e,Ending:({speaker:e})=>e,GitHubChange:()=>null,BoardMove:()=>null}),Fi=(e,t)=>e._tag===`Burst`?`mt-0.5`:e._tag===`GitHubChange`?t?._tag===`Burst`||t?._tag===`GitHubChange`?`mt-0.5`:`mt-2`:e._tag===`Note`||e._tag===`BoardMove`?`mt-2`:`mt-4`,Ii=({chapter:e,first:t,runTask:n,history:r})=>{let i=r.cursors.find(({attemptId:t})=>t===e.attemptId),a=null,o=e.rows.map(e=>{let t=Pi(e),n=t!==null&&(a===null||a.name!==t.name||a.sessionKey!==t.sessionKey);return t!==null&&(a=t),{row:e,speaker:n?t.name:null}});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Q,{messageId:e.key,className:t?void 0:`mt-10`,children:(0,X.jsxs)($,{className:t?void 0:`border-t pt-8`,children:[(0,X.jsx)(`h2`,{className:`text-md font-semibold`,children:tt(e.attempt)}),(0,X.jsx)(zr,{chapter:e,runTask:n})]})}),i!==void 0&&(0,X.jsx)(Q,{messageId:`history:${e.attemptId}`,className:`mt-4`,children:(0,X.jsxs)($,{children:[(0,X.jsx)(B,{variant:`outline`,size:`sm`,disabled:r.loading,onClick:()=>r.load(i),children:r.loading?at.loading:at.loadEarlier}),r.error!==null&&(0,X.jsx)(ot,{className:`mt-2`,message:r.error})]})}),o.length===0&&i===void 0&&!e.live&&(0,X.jsx)(Q,{messageId:`empty:${e.attemptId}`,className:`mt-4`,children:(0,X.jsx)($,{children:(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:at.empty})})}),o.map(({row:e,speaker:t},n)=>(0,X.jsx)(Q,{messageId:e.key,className:Fi(e,o[n-1]?.row),children:(0,X.jsx)(Ni,{row:e,speaker:t})},e.key)),e.live&&(0,X.jsx)(Q,{messageId:`activity:${e.attemptId}`,className:`mt-4 [content-visibility:visible]`,children:(0,X.jsx)($,{children:(0,X.jsx)(D,{chapter:e})})})]})},Li=({document:e,runTask:t,history:n})=>e.chapters.length===0?(0,X.jsx)(Q,{messageId:`empty`,children:(0,X.jsx)($,{children:(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No attempt started`})})}):e.chapters.map((e,r)=>(0,X.jsx)(Ii,{chapter:e,first:r===0,runTask:t,history:n},e.key)),Ri=e=>({key:e.key,sequence:e.sequence,latestSequence:e.latestSequence,isError:e.state._tag===`Error`,isTool:!0}),zi=e=>Te(e,{Message:e=>[{key:e.key,sequence:e.sequence,latestSequence:e.latestSequence,isError:e.undelivered,isTool:!1}],Note:e=>[{key:e.key,sequence:e.sequence,latestSequence:e.latestSequence,isError:e.tone===`failed`,isTool:!1}],Burst:({tools:e})=>e.map(Ri),Delegation:({tool:e})=>[Ri(e)],GitHubChange:()=>[],BoardMove:()=>[],Ending:({position:e,end:t})=>G(e,{onNone:()=>[],onSome:({key:e,sequence:n,latestSequence:r})=>[{key:e,sequence:n,latestSequence:r,isError:t._tag===`Failed`,isTool:!1}]})}),Bi=e=>{let t=new Set(e.connectivity.map(e=>e._tag===`WorkerSilent`?`worker`:`provider:${e.sessionId}`)),n=new Map;for(let t of e.rows)t._tag===`Note`&&t.connectivity!==null&&(t.connectivity._tag===`WorkerSilent`&&n.set(`worker`,t.key),t.connectivity._tag===`ProviderRetrying`&&n.set(`provider:${t.connectivity.sessionId}`,t.key));return new Set([...n].flatMap(([e,n])=>t.has(e)?[n]:[]))},Vi=e=>{let t=Bi(e),n=[],r=[],i=-1,a=e=>{i=Math.max(i,e.sequence),e.state._tag===`Error`&&r.push(e)},o=e=>n.push({key:e,isTool:!1});for(let n of e.rows)switch(n._tag){case`Message`:n.from===`agent`&&(i=Math.max(i,n.sequence)),(n.blocked||n.question||n.undelivered)&&o(n.key);break;case`Note`:(n.tone===`failed`||t.has(n.key))&&o(n.key);break;case`Burst`:n.tools.forEach(a);break;case`Delegation`:a(n.tool);break;case`Ending`:n.end._tag===`Failed`&&o(n.key),n.end._tag===`Succeeded`&&(i=1/0)}return{errors:n,recovered:r.filter(e=>e.sequence<i).map(e=>({key:e.key,isTool:!0}))}},Hi=e=>{let t=e.chapters.map(Vi);return{errors:t.flatMap(({errors:e})=>e),recovered:t.flatMap(({recovered:e})=>e)}},Ui=e=>e.chapters.flatMap(e=>e.rows.flatMap(zi)).sort((e,t)=>e.sequence-t.sequence),Wi=e=>({through:e,readThrough:e,keys:new Set}),Gi=(e,t,n)=>{let r=new Set(e.keys);for(let n of t)(e.readThrough===null||n.latestSequence>e.readThrough)&&r.add(n.key);let i=n!==null&&(e.through===null||n>e.through)?n:e.through;return i===e.through&&r.size===e.keys.size?e:{through:i,readThrough:e.readThrough,keys:r}},Ki=e=>e.keys.size===0&&e.readThrough===e.through?e:Wi(e.through),qi=e=>{let t=e.chapters.at(-1);if(t===void 0||t.live||!window.matchMedia(`(max-width: 1023px)`).matches)return null;let n=[...t.rows].reverse().find(({_tag:e})=>e===`Ending`||e===`Message`);return n===void 0?null:{messageId:n.key,tool:null}},Ji=(0,Y.memo)(({runId:e,document:t,through:n,revision:r,runTask:i,history:a,active:o,request:s,onReading:c})=>{let[l]=(0,Y.useState)(()=>kr(()=>window.localStorage).read(e,Date.now())),[u,d]=(0,Y.useState)(l?.position._tag===`Anchor`?l.position:null),[f,p]=(0,Y.useState)(u===null),[m]=(0,Y.useState)(u===null?`end`:`start`),h=(0,Y.useCallback)(()=>d(null),[]),g=(0,Y.useCallback)(()=>{d(null),p(!1)},[]),_=()=>{d(null),p(!0)},v=(0,Y.useRef)(null),y=(0,Y.useMemo)(()=>Ui(t),[t]),b=(0,Y.useMemo)(()=>Nr(t),[t]),[x,S]=(0,Y.useState)(()=>Wi(l===null?n:l.readThrough)),[C,w]=(0,Y.useState)(()=>l===null?qi(t):null),[T,E]=(0,Y.useState)(!1),[D,O]=(0,Y.useState)(null);s!==null&&s.id!==D&&(O(s.id),g(),w(s.target),E(!1));let k=(0,Y.useCallback)(e=>{S(t=>{let r=Gi(t,y,n);return e&&u===null&&f?Ki(r):r})},[y,n,u,f]),A=()=>{_(),E(!0),w(null)},j=(0,Y.useCallback)(()=>E(!1),[]),M=(0,Y.useCallback)(()=>w(null),[]),N=a.cursors.at(-1),P=o&&u===null&&f;return(0,X.jsx)(sr,{initialState:new Map(l?.disclosures.map(({key:e,...t})=>[e,t])),onInspect:g,children:(0,X.jsx)(Xn,{autoScroll:P,defaultScrollPosition:m,scrollEdgeThreshold:8,children:(0,X.jsxs)(Zn,{className:`min-h-0 flex-1`,children:[(0,X.jsx)(gr,{active:o&&u===null,viewportRef:v,revision:r,children:(0,X.jsx)(rr,{viewportRef:v,following:P,onNavigate:_,onInteract:()=>d(null),children:(0,X.jsx)($n,{className:`mx-auto w-full max-w-[38.5rem] gap-0 px-4 pt-5 pb-8 sm:px-2 [&>*]:-mx-2 [&>*]:px-2`,children:(0,X.jsx)(Li,{document:t,runTask:i,history:a})})})}),(0,X.jsx)(Fr,{target:u,rows:b,viewportRef:v,active:o,history:{earlier:N,loading:a.loading,error:a.error,load:()=>{N!==void 0&&a.load(N)}},onRestored:h}),(0,X.jsx)(Ar,{runId:e,rows:b,viewportRef:v,readThrough:x.readThrough,active:o,restoring:u!==null,allowLatest:f,initialPosition:l?.position??{_tag:`Latest`}}),(0,X.jsx)(fr,{target:C,onRevealed:M}),(0,X.jsx)(Ir,{document:t,active:o,onReading:c}),(0,X.jsx)(pr,{count:x.keys.size,active:o,pendingLatest:T,revealing:C!==null,onObserve:k,onLatest:A,onReachedLatest:j})]})})})}),Yi=1e4,Xi=e=>Date.parse(G(e.start,{onNone:()=>e.receivedAt,onSome:({receivedAt:e})=>e})),Zi=e=>Te(e,{Message:({receivedAt:e})=>Date.parse(e),Note:({receivedAt:e})=>Date.parse(e),Burst:({tools:e})=>Xi(e[0]),Delegation:({tool:e})=>Xi(e),Ending:()=>1/0,GitHubChange:({at:e})=>Date.parse(e),BoardMove:({move:e})=>Date.parse(e.at)}),Qi=(e,t)=>{if(e===null)return!1;let n=t.split(`#`)[1];return e.includes(n===void 0||n===``?t:n)},$i=(e,t,n)=>e!==null&&RegExp(`\\b${t} ${n.name.replace(/[.*+?^${}()|[\]\\]/gu,`\\$&`)}(?![\\w-])`,`iu`).test(e.replaceAll("`",``)),ea=e=>t=>{if(t.change._tag!==`Labels`)return Qi(e,t.change.url)?[]:[t];let n=t.change.removed.filter(t=>!$i(e,`removed`,t)),r=t.change.added.filter(t=>!$i(e,`added`,t));return n.length+r.length===0?[]:[{...t,change:{...t.change,removed:n,added:r}}]},ta=(e,t,n)=>{let r=[];for(let i of t){let t=n(i.at);if(i._tag===`BoardMoved`){r.push({slot:t,row:{_tag:`BoardMove`,key:`board-move:${e}:${i.at}`,move:i}});continue}if(i._tag===`Commented`||i._tag===`Reviewed`){r.push({slot:t,row:{_tag:`GitHubChange`,key:`github:${i.url}`,at:i.at,change:i}});continue}let a=r.at(-1),o=a!==void 0&&a.slot===t&&a.row._tag===`GitHubChange`&&a.row.change._tag===`Labels`&&Date.parse(i.at)-Date.parse(a.row.at)<=Yi?{row:a.row,change:a.row.change}:void 0,s=o?.change??{_tag:`Labels`,removed:[],added:[]},c=i._tag===`LabelAdded`?{...s,added:[...s.added,i.label]}:{...s,removed:[...s.removed,i.label]};o===void 0?r.push({slot:t,row:{_tag:`GitHubChange`,key:`github:${e}:${i.at}`,at:i.at,change:c}}):r[r.length-1]={slot:t,row:{...o.row,change:c}}}return r},na=(e,t,n)=>{let r=e.rows.find(e=>e._tag===`Ending`),i=r?._tag===`Ending`?ee(r.end):null,a=e.rows[0],o=n?a===void 0?1/0:Zi(a):-1/0,s=ta(e.attemptId,t,t=>{let n=e.rows.findIndex(e=>Zi(e)>Date.parse(t));return n===-1?e.rows.length:n}).flatMap(({slot:e,row:t})=>Zi(t)<o?[]:(t._tag===`BoardMove`?[t]:ea(i)(t)).map(t=>({slot:e,kept:t})));if(s.length===0)return e;let c=e=>s.flatMap(t=>t.slot===e?[t.kept]:[]);return{...e,rows:[...e.rows.flatMap((e,t)=>[...c(t),e]),...c(e.rows.length)]}},ra=(e,t,n)=>({chapters:e.chapters.map(e=>na(e,t.get(e.attemptId)??[],n.has(e.attemptId)))}),ia=({label:e,children:t})=>(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,X.jsx)(`article`,{"aria-label":e,className:`mx-auto w-full max-w-[38.5rem] space-y-4 px-4 pt-5 pb-16 sm:px-2`,children:t})}),aa=({task:e})=>(0,X.jsx)(ia,{label:`Task`,children:(0,X.jsxs)($,{children:[(0,X.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Task`}),(0,X.jsx)(xt,{className:`mt-2 text-md wrap-anywhere`,children:e})]})}),oa=({detail:e})=>{let t=P(e.eventPayload);return(0,X.jsxs)(ia,{label:`Event`,children:[(0,X.jsxs)($,{children:[(0,X.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Event`}),G(t,{onNone:()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`mt-2 text-md`,children:[`Opened by `,e.run.loop,` on `,e.run.repository]}),(0,X.jsx)(wt,{run:e.run,source:`link`,className:`mt-2 block text-sm`}),(0,X.jsx)(Ct,{approval:e.run.approval,className:`mt-2 block text-sm`})]}),onSome:t=>(0,X.jsxs)(`div`,{className:`mt-2 space-y-3`,children:[(0,X.jsxs)(`p`,{className:`text-md`,children:[e.run.loop,` matched `,(0,X.jsx)(g,{item:j(t)}),` `,t.title]}),(0,X.jsxs)(`dl`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`State`}),(0,X.jsx)(`dd`,{children:t.state}),t.labels.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Labels`}),(0,X.jsx)(`dd`,{className:`wrap-anywhere`,children:t.labels.join(`, `)})]}),G(t.author,{onNone:()=>null,onSome:e=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Author`}),(0,X.jsx)(`dd`,{children:e})]})})]}),(0,X.jsx)(wt,{run:e.run,source:`link`,className:`block text-sm`}),(0,X.jsx)(Ct,{approval:e.run.approval,className:`block text-sm`}),G(t.body,{onNone:()=>null,onSome:e=>(0,X.jsx)(xt,{className:`border-t pt-3 text-md wrap-anywhere`,children:e})})]})})]}),(0,X.jsx)($,{children:(0,X.jsxs)(J,{children:[(0,X.jsxs)(q,{render:(0,X.jsx)(B,{variant:`ghost`,size:`sm`,className:`-mx-2 gap-1 px-2 text-muted-foreground data-[panel-open]:[&_svg]:rotate-90`}),children:[(0,X.jsx)(m,{"aria-hidden":`true`}),`Raw details`]}),(0,X.jsxs)(K,{className:`space-y-3 pt-2`,children:[(0,X.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground wrap-anywhere`,children:e.eventDedupKey}),(0,X.jsx)(w,{code:JSON.stringify(e.eventPayload,null,2),language:`json`,children:(0,X.jsxs)(y,{children:[(0,X.jsx)(_,{children:`Event payload`}),(0,X.jsx)(b,{children:(0,X.jsx)(S,{})})]})})]})]})})]})},sa=3e4,ca=e=>{let t=e.attempts.filter(({outcome:e})=>e!==null).length,n=t<e.attempts.length;return o({queryKey:[`run-github-changes`,e.id,e.attempts.length,t],queryFn:()=>He(t=>t.githubChanges({params:{runId:e.id}})),placeholderData:a,staleTime:sa,meta:{refreshLabel:`GitHub changes`},refetchInterval:n?sa:!1,retry:1})},la=e=>e.session._tag===`ParentSession`?`Parent`:e.session.agent,ua=`flex h-6.5 w-full min-w-0 items-center gap-1.5 rounded-md pr-1 pl-1.5 text-left outline-none transition-colors duration-(--duration-fast) ease-out-expo hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/70 aria-[current=location]:font-medium`,da=e=>`'${e.replaceAll(`'`,`'\\''`)}'`,fa={claude:ye({command:`claude --resume`,homeVariable:ue()}),codex:ye({command:`codex resume --`,homeVariable:ye(`CODEX_HOME`)}),pi:ue()},pa=(e,t)=>e===null||e._tag!==`Ssh`?t:[`ssh`,`-t`,...e.port===null?[]:[`-p`,String(e.port)],e.destination,da(t)].join(` `),ma=({session:e,attempt:t})=>{let n=oe({resume:fa[e.session.brain.harness],saved:e.harnessSession});if(Pe(n))return(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No saved harness session`});let{resume:r,saved:i}=n.value,{worker:a,workerAccess:o}=t,s=e.session._tag===`ChildSession`&&be(e.session.gatewayCredential);if(o?._tag===`Sandbox`)return(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Session `,(0,X.jsx)(`span`,{className:`font-mono`,children:i.id}),` ran in a Cloudflare sandbox, which accepts no terminal and is destroyed at attempt cleanup`]});let c=G(oe([r.homeVariable,i.home]),{onNone:()=>``,onSome:([e,t])=>`${e}=${da(t)} `}),l=pa(o,`cd -- ${da(i.cwd)} && ${c}${r.command} ${da(i.id)}`);return(0,X.jsxs)(`div`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`p`,{className:`wrap-anywhere`,children:[`Session `,(0,X.jsx)(`span`,{className:`font-mono`,children:i.id})]}),(0,X.jsxs)(`p`,{className:`wrap-anywhere`,children:[`Worktree `,(0,X.jsx)(`span`,{className:`font-mono`,children:i.cwd}),(o?._tag===`Ssh`||o?._tag===`Provisioned`)&&(0,X.jsxs)(X.Fragment,{children:[` on `,(0,X.jsx)(`span`,{className:`font-mono`,children:a})]})]}),o===null&&(0,X.jsxs)(`p`,{className:`wrap-anywhere`,children:[`Worker `,(0,X.jsx)(`span`,{className:`font-mono`,children:a}),` is no longer declared in usine.yaml`]}),(0,X.jsx)(w,{code:l,language:`bash`,wrap:!0,children:(0,X.jsxs)(y,{children:[(0,X.jsx)(_,{children:`Resume this session`}),(0,X.jsx)(x,{value:l,label:`Copy command`})]})}),o?._tag===`Provisioned`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{children:`Run it on the attempt's ${nt[o.provider]} machine, which is deleted with the attempt`}),s&&(0,X.jsx)(`p`,{children:`The gateway credential or API key isn't available from your shell`})]}):s?(0,X.jsx)(`p`,{children:`The gateway credential isn't available from your shell. The worktree is removed at attempt cleanup`}):(0,X.jsx)(`p`,{children:`Same harness login as the attempt. The worktree is removed at attempt cleanup`})]})},ha=({session:e,attempt:t})=>{let n=e.session;return n._tag===`ChildSession`&&n.brain.harness===`codex`&&be(n.gatewayCredential)?null:(0,X.jsxs)(gt,{children:[(0,X.jsx)(ct,{render:(0,X.jsx)(B,{variant:`ghost`,size:`icon-sm`,"aria-label":`Resume details for ${la(e)}`,title:`Resume details`,className:`text-muted-foreground`}),children:(0,X.jsx)(Bt,{"aria-hidden":`true`})}),(0,X.jsx)(ut,{side:`right`,align:`start`,className:`w-[28rem] max-w-[calc(100vw-2rem)] p-3 shadow-raised`,children:(0,X.jsx)(ma,{session:e,attempt:t})})]})},ga=e=>e===`failed`?`text-destructive`:e===`warning`?`text-warning`:`text-muted-foreground aria-[current=location]:text-foreground`,_a=({checkpoint:e,current:t,named:n,onCheckpoint:r})=>(0,X.jsxs)(`button`,{type:`button`,title:e.text,"aria-current":e.key===t?`location`:void 0,onClick:()=>r(e),className:z(ua,ga(e.tone)),children:[n&&e.speaker!==null&&(0,X.jsx)(`span`,{className:`shrink-0 text-sidebar-foreground`,children:e.speaker}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),va=({chapter:e,current:t,onCheckpoint:n})=>{let r=F(e),[i,a]=(0,Y.useState)(new Set),o=r.find(e=>e._tag===`Turns`&&!i.has(e.key)&&e.turns.some(({key:e})=>e===t))?.key??t,s=(0,Y.useRef)(null),[c,l]=(0,Y.useState)(null);if((0,Y.useLayoutEffect)(()=>{let e=s.current;if(e===null)return;let t=()=>{let t=Array.from(e.querySelectorAll(`[data-outline-mark]`)).find(e=>e.dataset.outlineMark===o);l(t===void 0?null:t.getBoundingClientRect().top-e.getBoundingClientRect().top+4)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[o]),r.length===0)return null;let u=e=>a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,X.jsxs)(`ol`,{ref:s,className:`relative mt-1 ml-2 space-y-px border-l pl-0.5`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute top-0 -left-px h-4.5 w-px bg-foreground transition-[transform,opacity] duration-(--duration-base) ease-out-expo`,style:{transform:`translateY(${c??0}px)`,opacity:c===null?0:1}}),r.map(e=>{if(e._tag===`Mark`)return(0,X.jsx)(`li`,{"data-outline-mark":e.checkpoint.key,children:(0,X.jsx)(_a,{checkpoint:e.checkpoint,current:t,named:!0,onCheckpoint:n})},e.checkpoint.key);let r=i.has(e.key),a=e.turns.some(({key:e})=>e===t),o=`${e.turns.length} ${e.turns.length===1?`message`:`messages`}`;return(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-outline-mark":e.key,"aria-expanded":r,"aria-current":!r&&a?`location`:void 0,"aria-label":`${e.speaker}, ${o}`,onClick:()=>u(e.key),className:z(ua,`justify-between text-muted-foreground aria-[current=location]:text-foreground`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(m,{"aria-hidden":`true`,className:z(`size-3 shrink-0 transition-transform duration-(--duration-fast) ease-out-expo`,r&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`truncate text-sidebar-foreground`,children:e.speaker})]}),(0,X.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums`,children:o})]}),(0,X.jsx)(J,{open:r,children:(0,X.jsx)(K,{className:`collapsible-motion`,children:(0,X.jsx)(`ol`,{className:`space-y-px pl-4.5`,children:e.turns.map(e=>(0,X.jsx)(`li`,{"data-outline-mark":e.key,children:(0,X.jsx)(_a,{checkpoint:e,current:t,named:!1,onCheckpoint:n})},e.key))})})})]},e.key)})]})},ya=e=>e.status===`Live`?e.paused?{text:`Paused`,tone:`text-needs-you`}:e.held?e.idle?{text:`Held, waiting for input`,tone:`text-needs-you`}:{text:`Held`,tone:`text-run-active`}:e.idle?{text:`Waiting for input`,tone:`text-needs-you`}:{text:`Working`,tone:`text-run-active`,since:e.receivedAt}:null,ba=({chapter:e,selectedSession:t,current:n,onSession:r,onCheckpoint:i})=>(0,X.jsxs)(`div`,{className:`space-y-0.5 pt-0.5 pb-1.5 pl-4`,children:[e.sessions.map(n=>{let i=ya(n);return(0,X.jsx)(`div`,{children:(0,X.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-current":t===n.key,onClick:()=>r(n.key),className:`flex h-7 min-w-0 flex-1 items-center justify-between gap-2 rounded-md px-2 text-left text-sidebar-foreground outline-none hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/70 aria-[current=true]:font-medium aria-[current=true]:text-foreground`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:la(n)}),i!==null&&(0,X.jsxs)(`span`,{className:z(`flex shrink-0 items-baseline gap-1.5 text-xs`,i.tone),children:[i.text,i.since!==void 0&&(0,X.jsx)(N,{since:i.since,className:`text-muted-foreground`})]})]}),n.session._tag===`ChildSession`&&be(e.attempt)&&(0,X.jsx)(ha,{session:n,attempt:e.attempt.value})]})},n.key)}),(0,X.jsx)(va,{chapter:e,current:n,onCheckpoint:i})]}),xa=({machine:e,attemptNumber:t})=>(0,X.jsxs)(`div`,{className:`relative rounded-md py-1.5 pr-2 pl-6`,children:[(0,X.jsx)(_t,{state:`Queued`,className:`absolute top-3 left-2.5`}),(0,X.jsx)(`span`,{className:`block font-medium`,children:e.state===`creating`?`Creating machine`:`Machine ready`}),(0,X.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[nt[e.provider],e.id!==null&&(0,X.jsxs)(`span`,{className:`font-mono`,children:[` `,e.id]}),`, for attempt`,` `,t]}),(0,X.jsxs)(`span`,{className:`flex justify-between gap-3 font-mono text-xs tabular-nums text-muted-foreground`,children:[(0,X.jsx)(`time`,{dateTime:e.since,title:Qe(e.since),children:Ye(e.since)}),(0,X.jsx)(N,{since:e.since})]})]}),Sa=`relative block w-full rounded-md py-1.5 pr-2 pl-6 text-left outline-none hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/70 aria-[current=true]:bg-muted`,Ca=e=>e.live?`Running`:G(le(e.attempt,({outcome:e})=>se(e)),{onNone:()=>{let t=e.rows.at(-1);return t?._tag===`Ending`?t.end._tag:`Ended`},onSome:({_tag:e})=>e}),wa=e=>le(e.attempt,({startedAt:t})=>Se(e.endedAt,e=>Ze(Date.parse(e)-Date.parse(t)))),Ta=({run:e,eventPreview:t,document:n,selection:r,reading:i,composerSession:a,onSelect:o,onCheckpoint:s,errors:c,machine:l=null,className:u,id:d})=>{let f=(0,Y.useRef)(null),p=e.state===`Queued`&&l!==null&&(l.state===`creating`||l.state===`ready`&&l.attemptId===null)?l:null,h=r._tag===`Attempt`?i?.attemptId??r.attemptId:null,g=r._tag===`Attempt`?i?.checkpointKey??null:null;return(0,Y.useEffect)(()=>{let e=f.current;if(e===null||g===null||e.scrollHeight<=e.clientHeight)return;let t=e.querySelector(`[aria-current="location"]`);if(t===null)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top+8:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom+8)},[g]),(0,X.jsxs)(`nav`,{ref:f,id:d,"aria-label":`Run outline`,className:z(`space-y-0.5 text-sm`,u),children:[(0,X.jsxs)(`button`,{type:`button`,"aria-current":r._tag===`Task`,onClick:()=>o({_tag:`Task`}),className:Sa,children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Task`}),(0,X.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:re(e.task)})]}),(0,X.jsxs)(`button`,{type:`button`,"aria-current":r._tag===`Event`,onClick:()=>o({_tag:`Event`}),className:Sa,children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Event`}),(0,X.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t}),(0,X.jsx)(wt,{run:e,source:`text`,className:`mt-0.5 block text-xs`}),(0,X.jsx)(Ct,{approval:e.approval,className:`mt-0.5 block text-xs`})]}),(0,X.jsx)(`div`,{className:`h-2.5`}),n.chapters.map(e=>{let t=h===e.attemptId,n=Ca(e),i=G(e.attempt,{onNone:()=>`Attempt`,onSome:({number:e})=>`Attempt ${e}`});return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{type:`button`,"aria-current":t,"aria-expanded":t,"aria-label":`${i}, ${n.toLowerCase()}`,onClick:()=>o({_tag:`Attempt`,attemptId:e.attemptId,sessionKey:null}),className:Sa,children:[(0,X.jsx)(_t,{state:n,className:`absolute top-3 left-2.5`}),(0,X.jsxs)(`span`,{className:`flex items-center justify-between font-medium`,children:[i,(0,X.jsx)(m,{"aria-hidden":`true`,className:z(`size-3 text-muted-foreground transition-transform`,t&&`rotate-90`)})]}),G(e.attempt,{onNone:()=>null,onSome:({startedAt:t,start:n,reattachedAt:r})=>(0,X.jsxs)(X.Fragment,{children:[n!==null&&(0,X.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:it(n)}),r!==null&&(0,X.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,title:`Reattached ${Qe(r)}`,children:`Reattached after a restart`}),(0,X.jsxs)(`span`,{className:`flex justify-between gap-3 font-mono text-xs tabular-nums text-muted-foreground`,children:[(0,X.jsx)(`time`,{dateTime:t,children:Ye(t)}),e.live?(0,X.jsx)(N,{since:t}):G(wa(e),{onNone:()=>null,onSome:e=>(0,X.jsx)(`span`,{children:e})})]})]})})]}),(0,X.jsx)(J,{open:t,children:(0,X.jsx)(K,{className:`collapsible-motion`,children:(0,X.jsx)(ba,{chapter:e,selectedSession:a??(r._tag===`Attempt`&&r.attemptId===e.attemptId?r.sessionKey:null),current:g,onSession:t=>o({_tag:`Attempt`,attemptId:e.attemptId,sessionKey:t}),onCheckpoint:t=>s(t,e)})})})]},e.key)}),p!==null&&(0,X.jsx)(xa,{machine:p,attemptNumber:e.attempts.length+1}),c!==null&&(0,X.jsx)(`div`,{className:`mt-3 border-t px-2 pt-3`,children:c})]})},Ea=e=>{switch(e._tag){case`Burst`:return[e.key,...e.tools.map(e=>e.key)];case`Delegation`:return[e.key,e.tool.key];case`Ending`:case`GitHubChange`:case`BoardMove`:return[e.key];case`Message`:case`Note`:return[e.key]}},Da=(e,t)=>e.chapters.find(e=>e.rows.some(e=>Ea(e).includes(t))),Oa=e=>{switch(e._tag){case`Burst`:case`Delegation`:case`Message`:return e.speaker.sessionKey;case`Note`:case`Ending`:return e.speaker?.sessionKey??null;case`GitHubChange`:case`BoardMove`:return null}},ka=({detail:e,history:t})=>{let n=e.run,r=(0,Y.useId)(),i=d(ca(n)),a=(0,Y.useMemo)(()=>ra(ne(O(e.transcript,n.attempts,e.sessionState),n.attempts,e.transcript),new Map(i.data?.attempts.map(({attemptId:e,changes:t})=>[e,t])),new Set(e.earlierTranscript.map(({attemptId:e})=>e))),[e.transcript,e.sessionState,e.earlierTranscript,n.attempts,i.data]),o=(0,Y.useMemo)(()=>Hi(a),[a]),s=e.transcript.reduce((e,t)=>e===null||t.sequence>e?t.sequence:e,null),c=e.transcript.length+n.attempts.filter(({outcome:e})=>e!==null).length+a.chapters.reduce((e,{rows:t})=>e+t.filter(({_tag:e})=>e===`GitHubChange`||e===`BoardMove`).length,0),[l,u]=(0,Y.useState)(null),f=a.chapters.at(-1),p=l??(f===void 0?{_tag:`Task`}:{_tag:`Attempt`,attemptId:f.attemptId,sessionKey:null}),[h,g]=(0,Y.useState)(null),_=(0,Y.useRef)(0),v=e=>{_.current+=1,g({id:_.current,target:e})},[y,b]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(null),T=(0,Y.useCallback)(e=>w(t=>t?.attemptId===e.attemptId&&t.checkpointKey===e.checkpointKey?t:e),[]),E=[...a.chapters].reverse().find(e=>e.live),D=E?.sessions.filter(({status:e})=>e===`Live`)??[],k=(p._tag===`Attempt`&&p.attemptId===E?.attemptId?D.find(({key:e})=>e===p.sessionKey):void 0)??D.find(({session:e})=>e._tag===`ParentSession`),[j,M]=(0,Y.useState)(null),N=e=>{if(u(e),S(!1),e._tag!==`Attempt`){p._tag===`Attempt`&&M(p.attemptId);return}if(p._tag!==`Attempt`&&e.attemptId===j&&e.sessionKey===null)return;let t=a.chapters.find(({attemptId:t})=>t===e.attemptId);if(t===void 0)return;let n=e.sessionKey===null?void 0:t.rows.find(t=>Oa(t)===e.sessionKey);T({attemptId:t.attemptId,checkpointKey:null}),v({messageId:n?.key??t.key,tool:null})},P=e=>{b(e.key);let t=Da(a,e.key);t!==void 0&&(u({_tag:`Attempt`,attemptId:t.attemptId,sessionKey:null}),T({attemptId:t.attemptId,checkpointKey:null})),v(lr(e))},F=p._tag===`Attempt`,ee=p._tag===`Attempt`?C?.attemptId??p.attemptId:null,te=ee===null?p._tag:G(le(se(a.chapters.find(({attemptId:e})=>e===ee)),({attempt:e})=>e),{onNone:()=>`Attempt`,onSome:({number:e})=>`Attempt ${e}`});return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col lg:flex-row`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":x,"aria-controls":r,onClick:()=>S(e=>!e),className:`mx-4 mb-2 flex h-9 items-center justify-between gap-3 rounded-md border px-3 text-left outline-none hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/70 md:mx-5 lg:hidden`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Outline`}),(0,X.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[te,(0,X.jsx)(m,{"aria-hidden":`true`,className:z(`size-3 transition-transform`,x&&`rotate-90`)})]})]}),(0,X.jsx)(Ta,{id:r,run:n,eventPreview:A(n.loop,e.eventPayload),document:a,selection:p,reading:C,composerSession:k?.key??null,machine:e.machine,onSelect:N,onCheckpoint:(e,t)=>{u(e=>e?._tag===`Attempt`&&e.attemptId===t.attemptId?e:{_tag:`Attempt`,attemptId:t.attemptId,sessionKey:null}),S(!1),T({attemptId:t.attemptId,checkpointKey:e.key}),v({messageId:e.key,tool:null})},errors:o.errors.length===0&&o.recovered.length===0?null:(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,X.jsx)(dr,{errors:o.errors,selectedKey:y,earlier:t.cursors.length>0,onSelect:P}),(0,X.jsx)(dr,{errors:o.recovered,kind:`recovered`,selectedKey:y,earlier:t.cursors.length>0,onSelect:P})]}),className:z(`shrink-0 overflow-y-auto px-3 pb-4 lg:block lg:w-72 lg:border-r`,x?`mx-4 mb-3 max-h-[60svh] rounded-md border md:mx-5 lg:mx-0 lg:mb-0 lg:max-h-none lg:rounded-none lg:border-y-0 lg:border-l-0`:`hidden`)}),(0,X.jsxs)(`section`,{"aria-label":`Reader`,className:`relative flex min-h-[28rem] min-w-0 flex-1 flex-col border-t lg:min-h-0 lg:border-t-0`,children:[p._tag===`Task`&&(0,X.jsx)(aa,{task:n.task}),p._tag===`Event`&&(0,X.jsx)(oa,{detail:e}),F&&i.isError&&(0,X.jsxs)(`p`,{className:`mx-auto w-full max-w-[38.5rem] px-4 pt-3 text-xs text-muted-foreground sm:px-2`,children:[`GitHub changes not loaded: `,i.error.message]}),(0,X.jsx)(`div`,{className:z(`flex min-h-0 flex-1 flex-col`,!F&&`hidden`),children:(0,X.jsx)(Ji,{runId:n.id,document:a,through:s,revision:c,runTask:n.task,history:t,active:F,request:h,onReading:T})}),F&&k!==void 0&&(0,X.jsx)(`div`,{className:`shrink-0 border-t`,children:(0,X.jsx)(`div`,{className:`mx-auto w-full max-w-[38.5rem] px-4 py-3 sm:px-2`,children:(0,X.jsx)($,{children:(0,X.jsx)(Wt,{runId:n.id,attemptId:k.attemptId,target:k.session._tag===`ParentSession`?new We:new we({sessionId:k.session.id}),paused:k.paused,held:k.held},k.key)})})})]})]})},Aa=({runId:e})=>{let t=f(),{data:n}=p(rt()),r=i(),a=p(l(r,e)),o=Ut(e),[s,c]=(0,Y.useState)(null),u=h();if(a.isError)return(0,X.jsx)(ot,{className:`m-4 max-w-3xl md:m-5`,message:a.error.message});let d=a.data.run,m=e=>{c(null),u({...t.run(d.repository,e)})};return(0,X.jsxs)(`main`,{className:`flex min-h-[36rem] flex-1 flex-col`,children:[(0,X.jsx)(te,{detail:a.data,overview:n,placement:`page`,shared:!0,className:`px-4 pt-4 pb-4 md:px-5`,actions:(0,X.jsx)(k,{detail:a.data,onEdit:c,openRun:m})}),s!==null&&yt(d,s)&&(0,X.jsx)(bt,{run:d,intent:s,close:()=>c(null),openRun:m,className:`mx-4 mb-4 max-w-2xl rounded-lg border p-4 md:mx-5`},`${d.id}:${s}`),(0,X.jsx)(ka,{detail:a.data,history:{cursors:a.data.earlierTranscript,loading:o.isPending,error:o.isError?o.error.message:null,load:e=>o.mutate(e)}})]})},ja=()=>{let{run:e}=pt.useParams();return(0,X.jsx)(Aa,{runId:e},e)};export{ja as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./project-not-found-DrMlF8K5.js";var t=e;export{t as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-CC7nI7CP.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{C as t,D as n,J as r,S as i,X as a,a as o,b as s,i as c,k as l,n as u,r as d,s as f,t as p,u as m,y as h}from"./section-C2BsZ62c.js";import{t as g}from"./useSuspenseQuery-ajaZl96Y.js";import{t as _}from"./link-CXTzqBsX.js";import{c as v,o as y,v as b}from"./strings-BIVdGoBr.js";import{B as x,U as S,V as C,W as w}from"./overview-CTpxkXVa.js";import{a as T}from"./page-CxChE1f9.js";import{n as E}from"./queries-B4QNhfM4.js";import{s as D}from"./index-CbRNTyi8.js";import{r as O}from"./status-badge-DINlptKX.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-D3--FtAd.js";import{t as F}from"./fill-cell-5J3dwnZY.js";import{t as I}from"./slots-DdHFLAvn.js";var L=e(),R=({check:e})=>{switch(e._tag){case`Passed`:return(0,L.jsx)(O,{state:`Succeeded`,label:`Passed`});case`Degraded`:return(0,L.jsx)(O,{state:`Waiting`,label:`Degraded: no container per attempt`});case`Deferred`:return(0,L.jsx)(O,{state:`Deferred`,label:`Deferred`});case`Failed`:return(0,L.jsx)(O,{state:`Failed`,label:`Failed: ${i(e)}`})}},z=({subject:e,detail:t,check:n})=>{let r=n._tag===`Passed`?null:n.message,i=y(n.checkedAt);return(0,L.jsxs)(M,{className:`hover:bg-transparent`,children:[(0,L.jsxs)(N,{className:`py-3 align-top whitespace-normal @2xl:min-w-56`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:e}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),r!==null&&(0,L.jsx)(`p`,{className:`mt-1 wrap-anywhere @2xl:hidden`,children:r})]}),(0,L.jsxs)(N,{className:`py-3 align-top`,children:[(0,L.jsx)(R,{check:n}),(0,L.jsx)(`p`,{className:`mt-1 font-mono text-xs text-muted-foreground tabular-nums @2xl:hidden`,children:i})]}),(0,L.jsx)(N,{className:`hidden py-3 align-top font-mono text-xs text-muted-foreground tabular-nums @2xl:table-cell`,children:i}),(0,L.jsx)(F,{className:`hidden py-3 align-top whitespace-normal wrap-anywhere @2xl:table-cell`,children:r})]})},B=({pause:e,now:t})=>(0,L.jsxs)(`div`,{className:`rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 text-sm`,children:[(0,L.jsx)(`p`,{className:`font-medium text-destructive`,children:x(e)}),(0,L.jsx)(`p`,{className:`wrap-anywhere`,children:e.message}),(0,L.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground tabular-nums`,children:[C(e,t),`. `,S(e,t)]})]}),V=({machine:e})=>{let{runId:t,attemptId:n}=e;return t===null?n===null?(0,L.jsx)(m,{children:`Found after a restart`}):(0,L.jsxs)(`span`,{children:[`Attempt `,(0,L.jsx)(`span`,{className:`font-mono text-xs`,children:n.slice(0,8)}),(0,L.jsx)(m,{children:`, found after a restart`})]}):(0,L.jsxs)(_,{to:`.`,search:e=>({...e,run:t}),className:`text-primary hover:underline`,children:[`Run `,(0,L.jsx)(`span`,{className:`font-mono text-xs`,children:t.slice(0,8)})]})},H={creating:{state:`Queued`,label:`Creating`},ready:{state:`live`,label:`Ready`},deleting:{state:`Canceled`,label:`Deleting`}},U=({worker:e})=>{let t=T(15e3);return(0,L.jsxs)(d,{title:`Machines`,aside:`Created for each attempt and deleted afterwards`,children:[e.provisioning!==null&&(0,L.jsx)(B,{pause:e.provisioning,now:t}),e.machines.length===0?(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`No machines`}):(0,L.jsx)(`div`,{className:`-mx-2`,children:(0,L.jsxs)(P,{children:[(0,L.jsx)(k,{children:(0,L.jsxs)(M,{className:`hover:bg-transparent`,children:[(0,L.jsx)(A,{className:`max-sm:w-full`,children:`Machine`}),(0,L.jsx)(A,{children:`State`}),(0,L.jsx)(A,{className:`text-right`,children:`Age`}),(0,L.jsx)(A,{className:`max-sm:hidden`,children:`For`})]})}),(0,L.jsx)(j,{children:e.machines.map((e,n)=>(0,L.jsxs)(M,{className:`hover:bg-transparent`,children:[(0,L.jsxs)(N,{className:`whitespace-normal max-sm:w-full max-sm:align-top`,children:[e.id===null?(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`No ID yet`}):(0,L.jsx)(`span`,{className:`font-mono text-xs`,children:e.id}),(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs sm:hidden`,children:(0,L.jsx)(V,{machine:e})})]}),(0,L.jsx)(N,{className:`max-sm:align-top`,children:(0,L.jsx)(O,{...H[e.state]})}),(0,L.jsx)(N,{className:`text-right font-mono text-xs text-muted-foreground tabular-nums max-sm:align-top`,title:`Since ${b(e.since)}`,children:v(e.since,t)}),(0,L.jsx)(F,{className:`whitespace-normal max-sm:hidden`,children:(0,L.jsx)(V,{machine:e})})]},e.id??`${e.since}:${n}`))})]})})]})},W=({container:e,applied:t})=>{let{configured:n,derived:r}=h(e),i=t===null?n:s(t);return(0,L.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[i!==null&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:i}),r!==null&&(0,L.jsx)(m,{children:`${t===null?`Derived from the machine at preflight`:`Derived from the machine at the last preflight`}: ${r}`})]})},G=({name:e})=>e===null?(0,L.jsx)(m,{children:`Not set`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(m,{children:`Read from `}),(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e})]}),K=({provisioner:e})=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-md font-semibold`,children:`Provisioner`}),(0,L.jsxs)(o,{children:[(0,L.jsx)(c,{label:`Provider`,children:w[e._tag]}),e._tag===`hetzner`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(c,{label:`Server type`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.serverType})}),(0,L.jsx)(c,{label:`Location`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.location})}),(0,L.jsx)(c,{label:`Image`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.image})}),(0,L.jsx)(c,{label:`Network`,children:e.network===null?(0,L.jsx)(m,{children:`None; each server has a public address`}):(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.network})}),(0,L.jsx)(c,{label:`Firewall`,children:e.firewall===null?(0,L.jsx)(m,{children:`None`}):(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.firewall})}),(0,L.jsx)(c,{label:`SSH key`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.sshKey})}),(0,L.jsx)(c,{label:`SSH user`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.sshUser})}),Object.keys(e.labels).length>0&&(0,L.jsx)(c,{label:`Labels`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:Object.entries(e.labels).map(([e,t])=>`${e}=${t}`).join(`, `)})})]}):(0,L.jsx)(c,{label:`Size`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.size})}),(0,L.jsx)(c,{label:`API token`,children:(0,L.jsx)(G,{name:e.tokenEnv})}),(0,L.jsx)(c,{label:`Anthropic key`,children:(0,L.jsx)(G,{name:e.anthropicKeyEnv})}),(0,L.jsx)(c,{label:`OpenAI key`,children:(0,L.jsx)(G,{name:e.openaiKeyEnv})})]})]}),q=({worker:e})=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsxs)(o,{children:[(0,L.jsx)(c,{label:`Kind`,children:r[e.kind]}),(0,L.jsxs)(c,{label:`Max attempts`,children:[(0,L.jsx)(`span`,{className:`tabular-nums`,children:e.maxConcurrentAttempts}),` `,(0,L.jsx)(m,{children:e.provisioner===null?`at the same time`:`at the same time, one machine each`})]}),e.destination!==null&&(0,L.jsx)(c,{label:`Destination`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.destination})}),e.kind===`ssh`&&e.provisioner===null&&(0,L.jsx)(c,{label:`Port`,children:e.port===null?(0,L.jsx)(m,{children:`From the SSH configuration`}):(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.port})}),e.kind===`ssh`&&(0,L.jsx)(c,{label:`Identity file`,children:e.identityFile===null?(0,L.jsx)(m,{children:`From the SSH configuration`}):(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.identityFile})}),e.root!==null&&(0,L.jsx)(c,{label:`Root`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.root})})]}),e.provisioner!==null&&(0,L.jsx)(K,{provisioner:e.provisioner}),e.container!==null&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-md font-semibold`,children:`Attempt container`}),(0,L.jsxs)(o,{children:[(0,L.jsx)(c,{label:`Image`,children:e.container.image===null?(0,L.jsx)(m,{children:`Default for this release`}):(0,L.jsx)(`code`,{className:`font-mono text-xs wrap-anywhere`,children:e.container.image})}),(0,L.jsx)(c,{label:`Limits`,children:(0,L.jsx)(W,{container:e.container,applied:e.containerLimits})})]})]}),e.gateway!==null&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-md font-semibold`,children:`Gateway`}),(0,L.jsxs)(o,{children:[(0,L.jsx)(c,{label:`Domain`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.domain})}),(0,L.jsx)(c,{label:`Destination`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.destination})}),(0,L.jsx)(c,{label:`Admin port`,children:(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.adminPort})}),(0,L.jsxs)(c,{label:`Admin token`,children:[(0,L.jsx)(m,{children:`Read from `}),(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.adminTokenEnv})]}),(0,L.jsx)(c,{label:`LLM credentials`,children:e.gateway.llmProviders.length===0?(0,L.jsx)(m,{children:`None; each harness uses the login on the worker`}):e.gateway.llmProviders.join(`, `)})]})]})]}),J=({capacity:e,leased:t})=>`${t} of ${n(e,`slot`)} in use`,Y=({name:e,configuration:n})=>{let i=n.workers.find(t=>t.name===e);if(i===void 0)return(0,L.jsx)(p,{entity:a(`worker`,e),title:e,children:(0,L.jsxs)(f,{title:`Worker not found`,children:[(0,L.jsx)(`code`,{children:`usine.yaml`}),` has no worker `,e,`.`,` `,(0,L.jsx)(_,{to:`/configuration/workers`,className:`text-primary hover:underline`,children:`See all workers`}),`.`]})});let o=[...i.prerequisites===null?[]:[{subject:`Worker`,detail:i.provisioner===null?i.kind===`ssh`?`Machine, Git, memory, gateway, credentials, and Docker`:`Machine, Git, memory, gateway, and credentials`:`Provider, gateway, and credentials`,check:i.prerequisites}],...i.harnesses.map(({harness:e,check:n})=>({subject:t[e],detail:`Harness installed and logged in`,check:n}))];return(0,L.jsx)(p,{entity:a(`worker`,e),title:i.name,marks:(0,L.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[r[i.kind],` worker`]}),children:(0,L.jsxs)(u,{facts:(0,L.jsx)(q,{worker:i}),children:[(0,L.jsx)(d,{title:`Slots`,children:i.slots===null?(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempts run until the GitHub App is set up.`}):(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,L.jsx)(I,{slots:i.slots}),(0,L.jsx)(`p`,{className:`tabular-nums`,children:J(i.slots)})]})}),i.provisioner!==null&&(0,L.jsx)(U,{worker:i}),(0,L.jsxs)(d,{title:`Preflight`,aside:l,children:[i.provisioner!==null&&(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Harness checks run on the first machine, then on the next machine created after the configured interval since the last successful check.`}),o.length===0?(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`No preflight since usine up started.`}):(0,L.jsx)(`div`,{className:`@container -mx-2`,children:(0,L.jsxs)(P,{children:[(0,L.jsx)(k,{children:(0,L.jsxs)(M,{className:`hover:bg-transparent`,children:[(0,L.jsx)(A,{children:`Check`}),(0,L.jsx)(A,{children:`Result`}),(0,L.jsx)(A,{className:`hidden @2xl:table-cell`,children:`Checked`}),(0,L.jsx)(A,{className:`hidden @2xl:table-cell`,children:`Detail`})]})}),(0,L.jsx)(j,{children:o.map(({subject:e,detail:t,check:n})=>(0,L.jsx)(z,{subject:e,detail:t,check:n},e))})]})})]})]})})},X=()=>{let{worker:e}=D.useParams(),{data:t}=g(E());return(0,L.jsx)(Y,{name:e,configuration:t})};export{X as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{I as t}from"./queryOptions-Bavh4JFe.js";import{o as n}from"./queries-BNYw2mY-.js";import{a as r,i,n as a}from"./actions-DsEnZXEu.js";import{r as o,t as s}from"./button-C-mC9M4I.js";import{t as c}from"./api-DsTuvRlt.js";import{M as l,N as u,P as d,j as f,n as p}from"./overview-CTpxkXVa.js";import{t as m}from"./queries-C46qdn9C.js";var h=e(),g=()=>{let e=t();return()=>Promise.all([e.invalidateQueries({queryKey:p().queryKey}),e.invalidateQueries({queryKey:m().queryKey})])},_=({appearance:e,label:t,description:n,disabled:r,error:i,onClick:a})=>(0,h.jsxs)(`span`,{className:o(`inline-flex flex-col gap-1`,e===`row`?`items-end`:`relative z-10 items-start`),children:[(0,h.jsx)(s,{variant:e===`row`?`ghost`:`outline`,size:e===`row`?`default`:`xs`,className:e===`row`?`text-muted-foreground`:void 0,title:n,disabled:r,onClick:e=>{e.stopPropagation(),a()},children:t}),i!==null&&(0,h.jsx)(`span`,{role:`alert`,className:o(`text-xs whitespace-normal text-destructive`,e===`row`&&`max-w-56 text-right`),children:i})]}),v=({appearance:e,run:t,request:n,label:r})=>{let a=i();return(0,h.jsx)(_,{appearance:e,label:a.isPending?u[n.action]:r,...n.action===`retry`?{description:f(t.agentBrain)}:{},disabled:a.isPending,error:a.error?.message??null,onClick:()=>a.mutate({runId:t.id,request:n})})},y=({appearance:e,run:t})=>{let n=r(),i=n.data?._tag===`CycleBlocked`;return(0,h.jsx)(_,{appearance:e,label:n.isPending?`Opening…`:l.runAgain,disabled:n.isPending,error:i?d:n.error?.message??null,onClick:()=>n.mutate(a(t))})},b=({appearance:e,reason:t})=>{let r=g(),i=n({mutationFn:()=>c(e=>e.resetCycleBudget({payload:{askId:t.ask.id}})),onSuccess:r});return(0,h.jsx)(_,{appearance:e,label:i.isPending?`Resetting…`:`Reset cycle budget`,disabled:i.isPending,error:i.error?.message??null,onClick:()=>i.mutate()})},x=({appearance:e,loop:t})=>{let r=g(),i=n({mutationFn:()=>c(e=>e.unpause({params:{loop:t}})),onSuccess:r});return(0,h.jsx)(_,{appearance:e,label:i.isPending?`Resuming…`:`Resume`,disabled:i.isPending,error:i.error?.message??null,onClick:()=>i.mutate()})},S=({stalled:e,readOnly:t,appearance:n})=>{if(t)return null;let r=e.reason;switch(r._tag){case`AwaitingApproval`:return r.run.canApprove?(0,h.jsx)(v,{appearance:n,run:r.run,request:{action:`approve`},label:l.approve}):null;case`SuppressedForOperator`:{let e=r.run.attempts.at(-1);if(!r.run.canResolveFailure||e===void 0)return null;let t=e.outcome?._tag===`Failed`&&e.outcome.failure._tag===`QuestionFailure`;return(0,h.jsx)(v,{appearance:n,run:r.run,request:{action:`resolveFailure`,attemptId:e.id},label:t?`Mark answered`:`Mark resolved`})}case`CycleBudgetUsedUp`:return(0,h.jsx)(b,{appearance:n,reason:r});case`RunFailed`:return r.run.canRetry?(0,h.jsx)(v,{appearance:n,run:r.run,request:{action:`retry`},label:l.retry}):null;case`ClosedUnchanged`:return r.run.canRunAgain?(0,h.jsx)(y,{appearance:n,run:r.run}):null;case`LoopPaused`:return(0,h.jsx)(x,{appearance:n,loop:e.loop});case`WaitingForStop`:case`QueuedForWorker`:case`AwaitingPoll`:return null}};export{S as t};
|