@usine/server 0.4.1-next.264.gfdecd7e → 0.4.1-next.265.g59d6496
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +2 -0
- package/dist/http.js.map +1 -1
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +3 -1
- package/dist/up.js.map +1 -1
- package/dist/web/assets/_agent-_6-dDU4o.js +1 -0
- package/dist/web/assets/_label-B2hIQTiP.js +1 -0
- package/dist/web/assets/_loop-DvEDblaI.js +1 -0
- package/dist/web/assets/_name-CGGRdFfK.js +1 -0
- package/dist/web/assets/_name-DXMuBR5m.js +1 -0
- package/dist/web/assets/_name-Jq31XnPR.js +1 -0
- package/dist/web/assets/_name-z-THY2_h.js +2 -0
- package/dist/web/assets/{_number-CpU9ru_u.js → _number-DPBp5g17.js} +1 -1
- package/dist/web/assets/_number-DdeVk37S.js +1 -0
- package/dist/web/assets/_number-Jq31XnPR.js +1 -0
- package/dist/web/assets/_run-CdbRrREt.js +5 -0
- package/dist/web/assets/_run-Jq31XnPR.js +1 -0
- package/dist/web/assets/_worker-Kb3E2cex.js +1 -0
- package/dist/web/assets/action-BbYQzHVY.js +1 -0
- package/dist/web/assets/agents-aKrqbR-m.js +1 -0
- package/dist/web/assets/agents-ySzr8fy8.js +1 -0
- package/dist/web/assets/code-block-CjNdHwJz.js +4 -0
- package/dist/web/assets/collapsible-iYmFtriP.js +1 -0
- package/dist/web/assets/drawer-jppXFu1P.js +1 -0
- package/dist/web/assets/dropdown-menu-CFZLqcex.js +1 -0
- package/dist/web/assets/edit-and-retry-DE8DjLVA.js +1 -0
- package/dist/web/assets/{error-alert-hABzwCSY.js → error-alert-BVIxPJFU.js} +1 -1
- package/dist/web/assets/{file-error-B5tv6DhJ.js → file-error-DhZlb2_Y.js} +1 -1
- package/dist/web/assets/heading-D62nMA3C.js +1 -0
- package/dist/web/assets/{history-PYEz5wbe.js → history-DkNNnV6Y.js} +1 -1
- package/dist/web/assets/identity-DlGZ_gKf.js +1 -0
- package/dist/web/assets/index-B3ZB08sw.css +2 -0
- package/dist/web/assets/index-BdDPka5v.js +10 -0
- package/dist/web/assets/{label-badge-JdNthOHh.js → label-badge-d6omX3Kx.js} +1 -1
- package/dist/web/assets/labels-B7V9VhjQ.js +1 -0
- package/dist/web/assets/list-CMj9dgxo.js +1 -0
- package/dist/web/assets/loops-w6ia_oEU.js +1 -0
- package/dist/web/assets/mark-B8EExm_5.js +1 -0
- package/dist/web/assets/model-0V8C6gKN.js +1 -0
- package/dist/web/assets/moves-B2I_hBZb.js +1 -0
- package/dist/web/assets/{not-found-D7GT8Sj7.js → not-found-hL2Tp5vW.js} +1 -1
- package/dist/web/assets/outcome-xmjRsDh1.js +5 -0
- package/dist/web/assets/{overview-C73v5kbv.js → overview-BixI1Gdc.js} +1 -1
- package/dist/web/assets/{page-C47YAWAl.js → page-BLxt7Xfg.js} +1 -1
- package/dist/web/assets/pull-request-marks-BIB-F5Bo.js +1 -0
- package/dist/web/assets/repositories-DhkeCOwR.js +1 -0
- package/dist/web/assets/route-D0B3Tsri.js +1 -0
- package/dist/web/assets/route-NFcp08tu.js +1 -0
- package/dist/web/assets/{routes-g6SHTgCO.js → routes-BHwcH9Lh.js} +17 -17
- package/dist/web/assets/routes-Jq31XnPR.js +1 -0
- package/dist/web/assets/run-again-DSDtftlB.js +1 -0
- package/dist/web/assets/{section-BZs0sQLB.js → section-BP8TxDno.js} +1 -1
- package/dist/web/assets/section-D4djNiAN.js +24 -0
- package/dist/web/assets/settings-0NNJ2XzL.js +1 -0
- package/dist/web/assets/{sortable.esm-Lp8AM6j2.js → sortable.esm-JyniDt4R.js} +1 -1
- package/dist/web/assets/strings-BeaABxX0.js +311 -0
- package/dist/web/assets/{strings-Bexnszes.js → strings-Bs2WdZYo.js} +1 -1
- package/dist/web/assets/tasks-Jq31XnPR.js +1 -0
- package/dist/web/assets/tasks-x2oa1Rt3.js +1 -0
- package/dist/web/assets/usage-C27cuo6g.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-DEVFEHhP.js +1 -0
- package/dist/web/assets/usePositioner-BeAdUrxb.js +1 -0
- package/dist/web/assets/useScrollLock-77tiYKUD.js +1 -0
- package/dist/web/assets/workers-jjiTPmGP.js +1 -0
- package/dist/web/index.html +10 -19
- package/package.json +9 -9
- package/dist/web/assets/Match-BsHjCE-9.js +0 -1
- package/dist/web/assets/_agent-CK1JZbEZ.js +0 -1
- package/dist/web/assets/_label-CkDrdgxa.js +0 -1
- package/dist/web/assets/_loop-DLKJmqFq.js +0 -1
- package/dist/web/assets/_name--06G9LKw.js +0 -1
- package/dist/web/assets/_name-BzeOsU08.js +0 -1
- package/dist/web/assets/_name-CCrJHJTI.js +0 -1
- package/dist/web/assets/_name-LWtfT5Eq.js +0 -2
- package/dist/web/assets/_number-BzeOsU08.js +0 -1
- package/dist/web/assets/_number-n4iejSEq.js +0 -1
- package/dist/web/assets/_run-BzeOsU08.js +0 -1
- package/dist/web/assets/_run-CHrGLkXR.js +0 -5
- package/dist/web/assets/_worker-BvlkSKMd.js +0 -1
- package/dist/web/assets/action-DQzkdVHs.js +0 -1
- package/dist/web/assets/actions-CG0hkpe7.js +0 -1
- package/dist/web/assets/agents-CgWsAMoz.js +0 -1
- package/dist/web/assets/agents-D3eAK_60.js +0 -1
- package/dist/web/assets/code-block-Y9Y-8fHK.js +0 -4
- package/dist/web/assets/collapsible-BKcakxvM.js +0 -1
- package/dist/web/assets/drawer-ClcvABkO.js +0 -1
- package/dist/web/assets/dropdown-menu-BHKHYfLs.js +0 -1
- package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +0 -1
- package/dist/web/assets/heading-zIOXe3qT.js +0 -1
- package/dist/web/assets/index-C_S4sA5L.css +0 -2
- package/dist/web/assets/index-Dki55xSv.js +0 -10
- package/dist/web/assets/labels-Dr9t-xYj.js +0 -1
- package/dist/web/assets/lazyRouteComponent-BnRF0Crs.js +0 -1
- package/dist/web/assets/list-NcxSR9Ja.js +0 -1
- package/dist/web/assets/loops-DI4kElkX.js +0 -1
- package/dist/web/assets/mark-uyeJ8aPC.js +0 -1
- package/dist/web/assets/model-87X7P9Uh.js +0 -1
- package/dist/web/assets/moves-DS1ecXd6.js +0 -1
- package/dist/web/assets/outcome-DvqnSso3.js +0 -5
- package/dist/web/assets/preload-helper-BLdHbfdN.js +0 -1
- package/dist/web/assets/pull-request-marks-B4f7z4xa.js +0 -1
- package/dist/web/assets/queries-BZMW2wiD.js +0 -1
- package/dist/web/assets/queries-oea_Y4on.js +0 -1
- package/dist/web/assets/repositories-CZBhubWh.js +0 -1
- package/dist/web/assets/route-BtU2HI1M.js +0 -1
- package/dist/web/assets/route-CD6OvH-7.js +0 -1
- package/dist/web/assets/route-status-DGpeFNCC.js +0 -1
- package/dist/web/assets/routes-BzeOsU08.js +0 -1
- package/dist/web/assets/run-again-DPa5c27z.js +0 -1
- package/dist/web/assets/section-eyIYzZrG.js +0 -24
- package/dist/web/assets/settings-DusVdmgP.js +0 -1
- package/dist/web/assets/skeleton-87E84B2f.js +0 -1
- package/dist/web/assets/strings-DXB6PB2g.js +0 -311
- package/dist/web/assets/tasks-BzeOsU08.js +0 -1
- package/dist/web/assets/tasks-ClShPUFW.js +0 -1
- package/dist/web/assets/usage-BMYuEDo9.js +0 -1
- package/dist/web/assets/use-open-run-B8nD_BT1.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +0 -1
- package/dist/web/assets/useSelector-CRBsgquS.js +0 -1
- package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +0 -1
- package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +0 -1
- package/dist/web/assets/workers-CDWbu1Tb.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./index-BdDPka5v.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{d as t,r as n}from"./overview-BixI1Gdc.js";import{t as r}from"./link-C7GfYrMt.js";import{D as i}from"./button-4rhhIcK8.js";import{Kn as a,Rn as o,a as s,f as c,zn as l}from"./strings-BeaABxX0.js";var u=e(),d=({approval:e,className:n})=>{if(e===null)return null;let r=l(e.source),d=o(r,({approver:e})=>e);return(0,u.jsxs)(`span`,{className:i(`text-muted-foreground`,n),children:[(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:a(d,{onNone:()=>`Approved`,onSome:e=>`Approved by ${e}`})}),` · `,(0,u.jsx)(`time`,{dateTime:e.approvedAt,title:c(e.approvedAt),className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:s(e.approvedAt)}),a(r,{onNone:()=>null,onSome:({channel:e})=>(0,u.jsxs)(u.Fragment,{children:[` · `,(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:t[e]})]})})]})},f=({run:e,source:t,className:o})=>{if(e.runAgain===null)return null;let{from:l,requestedBy:d}=e.runAgain,f=l.slice(0,8);return(0,u.jsxs)(`span`,{className:i(`text-muted-foreground`,o),children:[(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:a(d,{onNone:()=>`Run again`,onSome:e=>`Run again by ${e}`})}),` · `,(0,u.jsx)(`time`,{dateTime:e.openedAt,title:c(e.openedAt),className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:s(e.openedAt)}),` · `,(0,u.jsxs)(`span`,{className:`whitespace-nowrap`,children:[`from run`,` `,t===`link`?(0,u.jsx)(r,{to:`/projects/$owner/$name/runs/$run`,params:{...n(e.repository),run:l},className:`relative z-10 font-mono text-xs text-primary underline-offset-4 hover:underline`,children:f}):(0,u.jsx)(`span`,{className:`font-mono text-xs`,children:f})]})]})};export{d as n,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-BixI1Gdc.js";import{n}from"./useNavigate-AT5VkfZa.js";import{t as r}from"./link-C7GfYrMt.js";import{D as i}from"./button-4rhhIcK8.js";import{o as a}from"./table-hbKjhjeL.js";var o=e(),s=({id:e,title:t,count:n,countTone:r=`muted`,note:a,actions:s,children:c})=>(0,o.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-2`,children:[(0,o.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,o.jsx)(`h2`,{id:e,className:`text-lg font-semibold`,children:t}),n!==void 0&&n>0&&(0,o.jsx)(`span`,{className:i(`text-sm tabular-nums`,r===`needs-you`?`text-needs-you`:`text-muted-foreground`),children:n}),a!==void 0&&(0,o.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:a}),s!==void 0&&(0,o.jsx)(`div`,{className:i(`self-center`,a===void 0&&`ml-auto`),children:s})]}),c]}),c=({children:e})=>(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e}),l=({run:e,children:n})=>(0,o.jsx)(r,{to:`/projects/$owner/$name/runs/$run`,params:{...t(e.repository),run:e.id},onClick:e=>e.stopPropagation(),className:`block min-w-0 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:n}),u=({run:e,className:r,children:s})=>{let c=n();return(0,o.jsx)(a,{className:i(e===null?`hover:bg-transparent`:`cursor-pointer hover:bg-muted/60 has-[a:focus-visible]:bg-muted/60`,r),onClick:e===null?void 0:n=>{n.target instanceof Element&&n.target.closest(`a, button`)!==null||c({to:`/projects/$owner/$name/runs/$run`,params:{...t(e.repository),run:e.id}})},children:s})};export{u as i,c as n,l as r,s as t};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{M as r,c as i,d as a,i as o,o as s,t as c,u as l}from"./page-BLxt7Xfg.js";import{t as u}from"./error-alert-BVIxPJFU.js";import{A as d,B as f,S as p,a as m,h,i as g,j as _,k as v,w as ee}from"./mark-B8EExm_5.js";import{n as te}from"./useNavigate-AT5VkfZa.js";import{t as ne}from"./link-C7GfYrMt.js";import{c as re,l as ie,s as y,t as ae}from"./code-block-CjNdHwJz.js";import{i as b,r as x,t as oe}from"./native-select-BzF8xUnx.js";import{D as se,F as ce,M as le,P as ue,R as de,V as fe,W as pe,h as me,i as he,k as ge,r as _e,t as S}from"./button-4rhhIcK8.js";import{$ as C,$t as w,At as T,B as E,Bt as ve,C as D,Cn as ye,Ct as be,En as O,G as k,Gt as A,H as j,It as M,J as N,Jt as xe,K as Se,Kn as Ce,Mn as we,Mt as Te,Nn as Ee,Nt as De,O as Oe,Pn as ke,Pt as Ae,Q as P,Qt as je,R as Me,S as Ne,Sn as F,St as I,T as Pe,Tt as Fe,Un as Ie,Ut as Le,V as L,Vn as Re,Vt as ze,W as Be,X as Ve,Y as He,Yn as Ue,_n as We,b as Ge,bn as Ke,dt as qe,en as Je,fn as Ye,gn as Xe,jt as Ze,k as Qe,mn as $e,nn as et,pt as tt,q as nt,qn as rt,qt as it,wn as at,x as ot,xt as st,y as ct,yn as lt,z as ut}from"./strings-BeaABxX0.js";import{i as dt,o as ft,r as pt,t as mt}from"./empty-B9bymfss.js";import{C as ht,T as gt,_ as _t,b as vt,bt as yt,ct as bt,dt as xt,ft as St,g as Ct,h as wt,ht as Tt,lt as Et,m as Dt,mt as Ot,pt as kt,st as R,ut as At,v as jt,x as Mt,xt as Nt,y as Pt}from"./index-BdDPka5v.js";import{t as Ft}from"./heading-D62nMA3C.js";import{r as It}from"./status-badge-CLPsMXtK.js";import{t as Lt}from"./useControlled-B5kAMgo-.js";import{t as Rt}from"./markdown-BNebzGGH.js";import{n as zt,o as Bt,r as Vt,t as Ht}from"./table-hbKjhjeL.js";import{t as Ut}from"./fill-cell-CjksmixH.js";import{a as Wt,c as Gt,g as Kt,h as qt,i as Jt,l as Yt,m as Xt,n as Zt,o as Qt,r as $t,t as en,u as tn}from"./sortable.esm-JyniDt4R.js";import{t as nn}from"./label-badge-d6omX3Kx.js";var rn=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:s,isRefetchError:c}=r,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=i&&u===`forward`,p=s&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l(t,n.data),hasPreviousPage:a(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:c&&!d&&!p,isRefetching:o&&!f&&!m}}};function an(e,t){return s(e,rn,t)}var z=n(e(),1),on=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z`}))]]),sn=z.forwardRef((e,t)=>z.createElement(pe,{ref:t,...e,weights:on}));sn.displayName=`DotsSixVerticalIcon`;var{workers:cn,repos:ln,labels:un,...dn}=Se.fields,fn=xe(dn),pn={agent:yt,loop:Nt,worker:N,repository:k,settings:fn},mn=Le(we(pn)),hn=et(mn),gn=(e,t)=>{if(!hn(e.kind))return lt(new P({file:C.make(e.key),stage:`schema`,expression:rt(),message:`Use the text editor for this configuration entity.`}));let n=pn[e.kind];return je(n)(t,{onExcessProperty:`error`,errors:`all`}).pipe(Xe(t),ye(t=>P.fromSchema(C.make(e.key),t)))},_n=(e,t)=>{let n=C.make(e.key);return e.kind===`loop`?ut(C.make(`loops/${e.identifier}.md`),t).pipe(F(Je(Nt)),Ke(e=>je(ze)(e)),We(`SchemaError`,e=>lt(P.fromSchema(n,e)))):e.kind===`agent`?Me(C.make(`agents/${e.identifier}.md`),t).pipe(F(Je(yt)),Ke(e=>je(ze)(e)),We(`SchemaError`,e=>lt(P.fromSchema(n,e)))):L(n,t).pipe(Ke(e=>je(ze)(e.toJS())),We(`SchemaError`,e=>lt(P.fromSchema(n,e))),Ke(t=>gn(e,t)))};function vn(e,t,n,r=!0,i,a){let[o,s]=z.useState(),c=ee(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return ge(()=>{let i=e||t||l||!r?void 0:yn(n.current,c);o!==i&&s(i)}),u}function yn(e,t){let n=bn(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function bn(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var B=t(),xn=z.createContext({disabled:!1});function Sn(){return z.useContext(xn)}var Cn=(e,t)=>new Qe({kind:e,identifier:Oe.make(t)}),wn=({kind:e,identifier:t})=>{switch(e){case`settings`:return`/configuration/settings`;case`repository`:return`/configuration/repositories/${t.split(`/`).map(encodeURIComponent).join(`/`)}`;default:return`/configuration/${e}s/${encodeURIComponent(t)}`}},Tn=(e,t)=>{let n=e.identifier;switch(e.kind){case`agent`:return t.agents.find(({name:e})=>e===n)?.loops.map(e=>`loop ${e}`)??[];case`loop`:return t.loops.find(({name:e})=>e===n)?.repositories.map(e=>`project ${e}`)??[];case`repository`:return t.loops.filter(({repositories:e})=>e.some(e=>e===n)).map(({name:e})=>`loop ${e}`);case`label`:return t.repositories.filter(({declaredLabels:e})=>e.some(({name:e})=>e===n)).map(({name:e})=>`project ${e}`);case`worker`:return t.repositories.map(({name:e})=>`project ${e}`);case`settings`:return t.repositories.map(({name:e})=>`project ${e}`)}},En=(e,t,n)=>{switch(e){case`agent`:return`---
|
|
2
|
+
harness: codex
|
|
3
|
+
model: gpt-6-astra
|
|
4
|
+
effort: medium
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Complete one repository task at a time. Follow the repository instructions, run the required checks, and record any blocker on the issue or pull request.
|
|
8
|
+
`;case`loop`:return`---\ntrigger:\n on: issue\n if: item.state == "OPEN" && item.labels.nodes.exists(label, label.name == "ready-for-agent")\nagent: ${JSON.stringify(n)}\n---\n\nComplete issue #{{ item.number }}: {{ item.title }}.\n`;case`worker`:return`name: ${JSON.stringify(t)}\nkind: local\nmax_concurrent_attempts: 1\n`;case`repository`:return`name: ${JSON.stringify(t)}\n`;case`label`:return`name: ${JSON.stringify(t)}\ncolor: "808080"\n`;case`settings`:return`settings:
|
|
9
|
+
poll_interval: 60
|
|
10
|
+
`}},Dn=(e,t)=>`${e} ${t}${e===1?``:`s`}`,On={claude:`Claude Code`,codex:`Codex`,pi:`Pi`},kn={local:`Local`,"exe.dev":`exe.dev`,ssh:`SSH`,cloudflare:`Cloudflare`},An=`Harness checks run on the first machine, then on the next machine created after the configured interval since the last successful check.`,jn={none:`Not required`,required:`Required`},Mn={write:`Write: push and merge`,read:`Read: review and comment, no push`},Nn={machine:`machine`,toolchain:`toolchain`,memory:`memory`,"harness-login":`harness login`,credentials:`credentials`,gateway:`gateway`,container:`Docker`,provider:`provider`},Pn={cpus:e=>`${e} ${e===1?`CPU`:`CPUs`}`,memoryMib:e=>`${e} MiB`,pids:e=>`${e} processes`},Fn={cpus:`CPUs`,memoryMib:`memory`,pids:`processes`},In=new Intl.ListFormat(`en`,{type:`conjunction`}),Ln=e=>st.map(t=>Pn[t](e[t])).join(`, `),Rn=e=>{let t=st.flatMap(t=>{let n=e[t];return n===null?[]:[Pn[t](n)]}),n=st.filter(t=>e[t]===null);return{configured:t.length===0?null:t.join(`, `),derived:n.length===0?null:In.format(n.map(e=>Fn[e]))}},zn=e=>e.capability===null?`check failed`:Nn[e.capability],Bn=e=>{switch(e.kind){case`local`:return`This machine`;case`exe.dev`:return`exe.dev VM ${e.name}`;case`ssh`:{let{provisioner:t}=e;return t===null?e.destination??``:`${t._tag===`hetzner`?`hetzner ${t.serverType} in ${t.location}`:`boat ${t.size}`}, one machine per attempt`}case`cloudflare`:return`A Cloudflare sandbox per attempt`}},Vn=e=>{let t=[...e.prerequisites===null?[]:[e.prerequisites],...e.harnesses.map(({check:e})=>e)],n=t.filter(({_tag:e})=>e===`Failed`),r=e=>e.reduce((e,{checkedAt:t})=>e===null||t>e?t:e,null);if(n.length>0)return{state:`failed`,checkedAt:r(n)};let i=t.filter(({_tag:e})=>e===`Degraded`);if(i.length>0)return{state:`degraded`,checkedAt:r(i)};let a=t.reduce((e,t)=>e===void 0||t.checkedAt>e.checkedAt?t:e,void 0);return a===void 0?{state:`unchecked`,checkedAt:null}:{state:a._tag===`Deferred`?`deferred`:`passed`,checkedAt:a.checkedAt}},Hn=e=>{let t=e.loops.filter(({paused:e})=>e).length,n=e.quarantinedLoops.length;return[Dn(e.loops.length,`loop`),...t>0?[`${t} paused`]:[],...n>0?[`${n} not loaded`]:[]].join(`, `)},Un=`Server upgrades`,Wn=`Upgrade when idle`,Gn=`Upgrade now`,Kn=`View changes`,qn=`Wait for running attempts to finish. No new attempt starts while waiting.`,Jn=`Restart now. Running attempts reattach after the server restarts.`,Yn=`App upgrades require a global npm install managed by systemd. Use usine status and usine upgrade for this instance.`,Xn=`No newer version is available.`,Zn=`Upgrade checks are off.`,Qn=`Waiting for running attempts to finish. No new attempts will start.`,$n=`Installing and restarting. This page reconnects when the server answers.`,er=(e,t,n)=>`Upgrade to ${t} failed. Restored ${e}. ${n}`,tr=`Running version`,nr=`Channel`,rr=`Mode`,ir=e=>`Version ${e} is available.`,V={noLabels:`No labels`,addLabel:`Choose New to declare a label.`,localOperator:`Local operator`,edit:`Edit`,save:`Save`,saving:`Saving…`,cancel:`Cancel`,delete:`Delete`,confirmDelete:`Confirm delete`,new:`New`,history:`History`,revert:`Revert`,confirmRevert:`Confirm revert`,message:`Message (optional)`,name:`Name`,source:`Configuration text`,draft:`Unsaved draft`,reload:`Reload text`,deletedConflict:`This entity was deleted. Reload text to start a new version; your draft remains available below.`,conflict:`The configuration changed since this editor opened. Review the newer revision before saving. Reloading keeps your unsaved draft below for copying.`,paused:`New loops start paused. Review the loop before resuming it.`,emptyHistory:`No revisions`,more:`Older revisions`,loading:`Loading…`,noDiff:`No text changes`,saved:`Saved`,deleted:`Deleted`,reverted:`Revision reverted`,deleteWarning:e=>`Delete ${e}?`,references:e=>e.length===0?`No loops or projects reference this entity.`:`Referenced by: ${e.join(`, `)}.`,revertWarning:`Revert restores every entity in this revision. Later changes can prevent a revert.`,alreadyExists:`This name already exists. Open the entity to edit it.`,create:e=>`New ${e}`,revision:e=>`Revision ${e}`},ar={add:`Choose New to add an agent.`,parentOverride:`Set on this agent`,parentModelUnset:`Not set on this agent or in settings`},or=`Choose New to add a loop. New loops start paused.`,sr=`Choose New to register a repository.`,cr=`At startup, and when a revision adds workers, slots, or an agent with a new harness, model, or effort`,H={text:`Edit as text`,form:`Edit as form`,choose:`Choose…`,name:`Name`,identity:`The name identifies this entity. Choose a name when creating it.`,harness:`Harness`,effort:`Effort`,model:`Model`,persona:`Persona`,modelHint:`Suggestions use models configured for this harness. Any model ID is accepted.`,preview:`Preview persona`,hidePreview:`Hide preview`,loading:`Loading choices…`,secret:`Enter an environment variable name. The value lives in .env.`,restartWorker:`For an existing worker, changes other than the slot count require a restart. Slot changes apply live.`,restartSettings:`Changes to webhooks or tracing require a restart.`,derived:`Derived at preflight when unset`,lastPreflight:`Last preflight`,repositories:`Repository`,noRepositories:`All installation repositories are registered.`,tags:`Tags (comma-separated)`,lanes:`Lanes`,addLane:`Add lane`,removeLane:`Remove lane`,laneName:`Lane name`,labels:`Labels`,states:`Item states`,noLabels:`No labels on this repository`,moveUp:`Move up`,moveDown:`Move down`,reorder:`Reorder lane`,orderHint:`Drag a lane handle, or focus it and use Space, Arrow Up or Arrow Down, then Space.`,gateway:`Gateway`,provisioner:`Machine provider`,existing:`Existing machine`,container:`Container`,add:`Add`,remove:`Remove`,key:`Key`,value:`Value`,providerKeys:`Provider environment variables`},lr=[{path:`settings.poll_interval`,label:`Poll interval (seconds)`,kind:`number`,description:`Seconds between the starts of two GitHub poll cycles.`},{path:`settings.max_children`,label:`Maximum child sessions`,kind:`number`,description:`Maximum child sessions per attempt. Starting one more fails the attempt.`},{path:`settings.max_attempt_minutes`,label:`Attempt limit (minutes)`,kind:`number`,description:`Minutes an attempt may run before the runaway guard fails it. Leave blank for no ceiling.`},{path:`settings.max_attempt_tokens`,label:`Attempt token limit`,kind:`number`,description:`Tokens per attempt, parent and children combined. Leave blank for no ceiling.`},{path:`settings.parent_model`,label:`Parent model`,description:`Parent model when the agent sets none. Leave blank to let Pi choose.`},{path:`settings.parent_effort`,label:`Parent effort`,description:`Parent effort when the agent sets none. Leave blank to use the agent's effort.`},{path:`settings.upgrade_channel`,label:`Upgrade channel`,options:He.literals,description:`npm channel used to check for upgrades.`},{path:`settings.upgrade_mode`,label:`Upgrade mode`,options:Ve.literals,description:`Disable upgrade checks, propose upgrades, or install automatically when idle.`},{path:`operator`,label:`Operator GitHub login`,description:`The login recorded on approvals and messages, and the only login that can answer an ask on GitHub.`},{path:`webhooks.mode`,label:`Webhooks mode`,options:[`off`,`deliveries`,`endpoint`],description:`Parsed and validated; GitHub changes are read by polling. A change requires a restart.`}],U={publicUrl:`Public webhook URL`,publicUrlHint:`Where GitHub would deliver webhooks.`,tracing:`Export traces`,otlp:`OTLP URL`,otlpHint:`Collector endpoint that receives every span as OTLP/HTTP protobuf.`,service:`Service name`,serviceHint:`The service.name resource attribute of every exported span.`},W={kind:`Worker kind`,slots:`Concurrent attempts`,slotsHint:`Maximum attempts running on this worker at once.`,root:`Working directory`,destination:`SSH destination`,identity:`SSH identity file`,port:`SSH port`,image:`Container image`,cpus:`Container CPUs`,memory:`Container memory (MiB)`,pids:`Container process limit`,url:`Worker URL`,clientId:`Access client ID variable`,clientSecret:`Access client secret variable`,instanceType:`Instance type`,token:`Provider token variable`,serverType:`Server type`,location:`Location`,snapshot:`Snapshot`,network:`Network`,firewall:`Firewall`,sshKey:`SSH key name`,sshUser:`SSH user`,size:`Sandbox size`,domain:`Gateway domain`,gatewayDestination:`Gateway SSH destination`,adminPort:`Gateway admin port`,adminToken:`Gateway token variable`,providers:`Gateway LLM providers (comma-separated)`,tailnet:`Join a tailnet`,gatewayAddress:`Tailnet gateway address`,tailnetId:`Tailnet client ID variable`,tailnetSecret:`Tailnet client secret variable`,anthropic:`Anthropic API key variable`,openai:`OpenAI API key variable`,labels:`Machine labels`,sshWait:`SSH wait (seconds)`,backoffMin:`Minimum creation backoff (seconds)`,backoffMax:`Maximum creation backoff (seconds)`,checkInterval:`Machine check interval (seconds)`},G={stream:`Stream`,condition:`Condition (CEL)`,prompt:`Prompt (Markdown)`,repositories:`Repositories`,tags:`Tags`,allRepositories:`Leave both selectors empty to include every repository.`,approval:`Require approval`,step:`Step name`,agent:`Agent`,cycles:`Cycle limit`,permissions:`Permissions`,cron:`Cron`,timeZone:`Time zone`,checking:`Checking…`,checked:`No problems found`,preview:`Preview`,previewing:`Loading preview…`,completions:`Payload fields`,completionHint:`Choose a field to insert at the cursor. Use Ctrl+Space to show fields.`,count:(e,t)=>`${e} matching ${e===1?`item`:`items`}${e>t?` · showing ${t}`:``}`,sample:`Render prompt`,rendered:`Rendered prompt`,empty:`No stored items match this loop.`,noData:e=>`No stored items for this stream yet: ${e.join(`, `)}.`,schedule:`Schedule loops run on ticks. There are no polled items to preview.`,confirm:`Resume loop`,resume:`Resume`,cancel:`Cancel`,resumeHint:`Resuming allows this loop to open runs for matching items.`,paused:`New loops start paused. Resume the loop after reviewing its preview.`},ur=z.createContext(void 0);function dr(){let e=z.useContext(ur);if(e===void 0)throw Error(le(63));return e}var fr=`data-checked`,pr=`data-unchecked`,mr={...Tt,checked(e){return e?{[fr]:``}:{[pr]:``}}},hr=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:_=!1,disabled:v=!1,render:te,uncheckedValue:ne,value:re,style:ie,...y}=e,{clearErrors:ae}=kt(),{state:b,setTouched:x,setDirty:oe,validityData:se,setFilled:ce,validationMode:le,disabled:pe,name:me,validation:S}=Ot(),{labelId:C}=St(),w=pe||v,T=me??l,E=z.useRef(null),ve=fe(E,c,S.inputRef),D=z.useRef(null),ye=At(w,D),be=ee(),O=xt({id:s}),k=u?void 0:O,[A,j]=Lt({controlled:n,default:!!i,name:`Switch`,state:`checked`});Et(D,be,A,void 0,!w,l),ge(()=>{ce(A)},[A,ce]),bt(A,()=>{ae(T),oe(A!==se.initialValue),S.change(A)});let{getButtonProps:M,buttonRef:N}=_e({disabled:w,native:u}),xe=vn(a,C,E,!u,k,y[`aria-label`]),Se={id:u?O:be,role:`switch`,"aria-checked":A,"aria-readonly":f||void 0,"aria-required":_||void 0,"aria-labelledby":xe,onFocus(){ye(!0)},onBlur(){let e=E.current;e&&!w&&(x(!0),ye(!1),le===`onBlur`&&S.commit(e.checked))},onClick(e){if(f||w)return;e.preventDefault();let t=E.current;t&&he(t,e)}},Ce={...S.getValidationProps(w),checked:A,disabled:w,form:o,id:k,name:T,required:_,style:T?m:g,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ve,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=p(h,e.nativeEvent);d?.(t,n),!n.isCanceled&&j(t)},onClick(e){e.stopPropagation()},onFocus(){D.current?.focus()},...re===void 0?de:{value:re}},we=z.useMemo(()=>({...b,checked:A,disabled:w,readOnly:f,required:_}),[b,A,w,f,_]),Te=ue(`span`,e,{state:we,ref:[t,D,N],props:[Se,y,M,e=>S.getValidationProps(w,e)],stateAttributesMapping:mr});return(0,B.jsxs)(ur.Provider,{value:we,children:[Te,!A&&T&&ne!==void 0&&(0,B.jsx)(`input`,{type:`hidden`,form:o,name:T,value:ne,disabled:w}),(0,B.jsx)(`input`,{...Ce,suppressHydrationWarning:!0})]})}),gr=z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=dr();return ue(`span`,e,{state:o,ref:t,stateAttributesMapping:mr,props:a})});function _r({className:e,size:t=`default`,...n}){return(0,B.jsx)(hr,{"data-slot":`switch`,"data-size":t,className:se(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,B.jsx)(gr,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var vr=/\{\{([\s\S]*?)\}\}/gu,yr=e=>[...e.matchAll(vr)].map(([,e=``])=>e.trim()),br=e=>{let t=e.value??``,n=[],r=0;for(let e of t.matchAll(vr))e.index>r&&n.push({type:`text`,value:t.slice(r,e.index)}),n.push({type:`inlineCode`,value:(e[1]??``).trim(),data:{hName:`mark`}}),r=e.index+e[0].length;return n.length===0?[e]:(r<t.length&&n.push({type:`text`,value:t.slice(r)}),n)},xr=e=>{e.children!==void 0&&(e.children=e.children.flatMap(e=>e.type===`text`?br(e):(xr(e),[e])))},Sr=()=>xr,Cr=({children:e})=>(0,B.jsx)(`mark`,{className:`bg-transparent p-0 text-inherit`,title:`Filled in from the item when a run opens`,children:(0,B.jsxs)(`code`,{className:`bg-transparent [font-variant-ligatures:none] ring-1 ring-input ring-inset [box-decoration-break:clone]`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`{{\xA0`}),e,(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`\xA0}}`})]})}),wr=({template:e})=>(0,B.jsx)(Rt,{className:`max-w-[72ch] text-md`,remarkPlugins:[Sr],components:{mark:Cr},children:e}),K=e=>et(ze)(e)?e:{},Tr=e=>et(M(ve))(e)?e:[],q=e=>et(it)(e)?e:et(A)(e)?String(e):``,J=(e,t)=>t.split(`.`).reduce((e,t)=>K(e)[t],e),Y=(e,t,n)=>{let[r,...i]=t.split(`.`);if(r===void 0)return e;let a={...e};return i.length>0?a[r]=Y(K(e[r]),i.join(`.`),n):n===void 0?delete a[r]:a[r]=n,a},Er=(e,t)=>O(at(_n(e,t))),Dr=(e,t)=>O(at(gn(e,t))),Or=(e,t)=>{if(e.kind===`loop`){let{name:e,body:n,maxCycles:r,selector:i,priority:a,...o}=t,s=K(i),c=K(a),l={...o,max_cycles:r??3};return s._tag===`Some`&&(l={...l,selector:K(s.value)}),c._tag===`Some`&&(l={...l,priority:c.value??1}),`---\n${E(l)}---\n${q(n)}`}if(e.kind!==`agent`)return E(t);let{name:n,persona:r,parentModel:i,parentEffort:a,...o}=t,s=o,c=K(i),l=K(a);return c._tag===`Some`&&c.value!==void 0&&(s={...s,parent_model:c.value}),l._tag===`Some`&&l.value!==void 0&&(s={...s,parent_effort:l.value}),`---\n${E(s)}---\n${q(r)}`},kr=e=>et(mn)(e.kind),Ar=({value:e,onChange:t,problems:n,path:r,label:i,description:a,kind:o,options:s,suggestions:c,readOnly:l,optional:u})=>{let d=(0,z.useId)(),f=n.filter(e=>e.path.join(`.`)===r),p={id:d,value:q(J(e,r)),readOnly:l,"aria-invalid":f.length>0,"aria-describedby":`${d}-help`,onChange:n=>{let i=n.target.value;t(Y(e,r,u&&i===``?void 0:o===`number`?i===``?void 0:Number(i):i))}};return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,B.jsx)(x,{htmlFor:d,children:i}),s===void 0?o===`textarea`?(0,B.jsx)(b,{...p,className:`min-h-36 min-w-0 [field-sizing:fixed]`}):(0,B.jsx)(R,{...p,type:o===`number`?`number`:`text`,step:`any`,list:c===void 0?void 0:`${d}-options`}):(0,B.jsxs)(oe,{...p,className:`w-full`,disabled:l,children:[(0,B.jsx)(`option`,{value:``,children:H.choose}),s.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}),c!==void 0&&(0,B.jsx)(`datalist`,{id:`${d}-options`,children:c.map(e=>(0,B.jsx)(`option`,{value:e},e))}),(0,B.jsxs)(`div`,{id:`${d}-help`,className:`space-y-1 text-xs wrap-anywhere`,children:[a&&(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:a}),f.map((e,t)=>(0,B.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))]})]})},X=({definitions:e,...t})=>(0,B.jsx)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2`,children:e.map(e=>(0,B.jsx)(Ar,{...t,...e},e.path))}),jr=e=>{let t=j(e),n=[],r=(e,i)=>{n.push(e);let a=/^list<(.+)>$/u.exec(i)?.[1];if(a!==void 0)r(`${e}[0]`,a);else for(let n of t.types.find(e=>e.name===i)?.fields??[])r(`${e}.${n.name}`,n.type)};for(let e of t.variables)r(e.name,e.type);return n},Mr=(e,t)=>{let n=/(?:item|repo)[\w.[\]]*$/u.exec(e.slice(0,t))?.[0]??``;return{prefix:n,start:t-n.length}},Nr=({value:e,onChange:t,problems:n,path:r,label:i,stream:a})=>{let o=(0,z.useId)(),s=(0,z.useRef)(null),[c,l]=(0,z.useState)(0),[u,d]=(0,z.useState)(!1),f=q(J(e,r)),p=Mr(f,c),m=jr(a).filter(e=>e.startsWith(p.prefix)),h=n.filter(e=>e.path.join(`.`)===r);return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,B.jsx)(x,{htmlFor:o,children:i}),(0,B.jsx)(b,{id:o,ref:s,value:f,className:`min-h-24 font-mono [field-sizing:fixed]`,"aria-invalid":h.length>0,"aria-describedby":`${o}-help`,onChange:n=>{l(n.target.selectionStart),d(Mr(n.target.value,n.target.selectionStart).prefix.length>0),t(Y(e,r,n.target.value))},onSelect:e=>l(e.currentTarget.selectionStart),onKeyDown:e=>{e.ctrlKey&&e.code===`Space`&&(e.preventDefault(),d(!0)),e.key===`Escape`&&d(!1)}}),(0,B.jsxs)(`div`,{id:`${o}-help`,className:`space-y-1 text-xs`,children:[(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:G.completionHint}),h.map((e,t)=>(0,B.jsx)(`p`,{role:`alert`,className:`text-destructive whitespace-pre-wrap wrap-anywhere`,children:e.message},t))]}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,className:`self-start`,"aria-expanded":u,onClick:()=>d(!u),children:G.completions}),u&&(0,B.jsx)(`div`,{className:`flex max-h-40 flex-wrap gap-1 overflow-auto`,role:`group`,"aria-label":`${i} ${G.completions}`,children:m.map(n=>(0,B.jsx)(S,{type:`button`,variant:`outline`,size:`xs`,className:`font-mono`,onClick:()=>{t(Y(e,r,f.slice(0,p.start)+n+f.slice(c))),d(!1),requestAnimationFrame(()=>{s.current?.focus(),s.current?.setSelectionRange(p.start+n.length,p.start+n.length)})},children:n},n))})]})};function Pr(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var Fr=`data-checked`,Ir=`data-unchecked`;function Lr(e){return{checked(t){return e.indeterminate?{}:t?{[Fr]:``}:{[Ir]:``}},...Tt}}var Rr=z.createContext(void 0);function zr(){return z.useContext(Rr)}var Br=z.createContext(void 0);function Vr(){let e=z.useContext(Br);if(e===void 0)throw Error(le(14));return e}var Hr=`data-parent`,Ur=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:_=!1,readOnly:v=!1,render:te,required:ne=!1,uncheckedValue:re,value:ie,nativeButton:y=!1,style:ae,...b}=e,{clearErrors:x}=kt(),{disabled:oe,name:se,setDirty:le,setFilled:pe,setTouched:S,state:C,validationMode:w,validityData:T,validation:E}=Ot(),ve=Sn(),{labelId:D,registerControlId:ye,getDescriptionProps:be}=St(),O=zr(),k=O?.allValues===void 0?void 0:O.parent,A=k!==void 0,j=oe||ve.disabled||O?.disabled||o,M=se??d,N=ie??M,xe=ee(),Se=O?.registerControlId!==ye,Ce=xt({id:c||void 0,enabled:Se}),we=y?Ce:xe,Te={};A&&(_?Te=k.getParentProps():N!==void 0&&(Te=k.getChildProps(N)));let{checked:Ee=n,indeterminate:De=l,onCheckedChange:Oe,...ke}=Te,Ae=O?.value,P=z.useRef(null),je=At(j,P),{getButtonProps:Me,buttonRef:Ne}=_e({disabled:j,native:y}),F=O?.validation??E,[I,Pe]=Lt({controlled:N!==void 0&&Ae!==void 0&&!_?Ae.includes(N):Ee,default:i,name:`Checkbox`,state:`checked`}),Fe=A?!!Ee:I,Ie=A&&De||l;Et(P,xe,I,void 0,!O&&!j,d);let Le=k?.registerChildId,L=z.useRef(null),Re=F.registerInput,ze=O?N:void 0,Be=z.useCallback(e=>Re(e,{controlRef:P,value:ze}),[Re,ze]),Ve=fe(u,L,_?void 0:Be),He=vn(a,D,L,!y,Ce,b[`aria-label`]);ge(()=>{L.current&&(L.current.indeterminate=Ie),O||pe(I)},[I,Ie,O,pe]),bt(I,()=>{O||(x(M),le(I!==T.initialValue),F.change(I))});let Ue=ce({checked:I,disabled:j,form:s,name:_?void 0:M,id:y?void 0:Ce,required:ne,ref:Ve,style:M?m:g,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(v){e.preventDefault();return}let t=e.currentTarget.checked,n=p(h,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(Oe?.(t,n),!n.isCanceled&&(Pe(t),N!==void 0&&O!==void 0&&!_&&!A))){let e=t?[...O.value,N]:O.value.filter(e=>e!==N);O.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){P.current?.focus()}},ie===void 0?de:{value:(O?I&&ie:ie)||``},be,e=>F.getValidationProps(j,e));z.useEffect(()=>{if(!k||N===void 0)return;let e=k.disabledStatesRef.current;return e.set(N,j),()=>{e.delete(N)}},[k,j,N]);let We=z.useMemo(()=>({...C,checked:Fe,disabled:j,readOnly:v,required:ne,indeterminate:Ie}),[C,Fe,j,v,ne,Ie]),Ge=Lr(We),Ke=ue(`span`,e,{state:We,ref:[Ne,P,t],props:[{id:we,role:`checkbox`,"aria-checked":Ie?`mixed`:Fe,"aria-readonly":v||void 0,"aria-required":ne||void 0,"aria-labelledby":He,[Hr]:_?``:void 0,onFocus(){je(!0)},onBlur(){let e=L.current;e&&(S(!0),je(!1),w===`onBlur`&&F.commit(O?Ae:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=L.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),me(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||Pr(t)?.click()})},onClick(e){if(v||j)return;e.preventDefault();let t=L.current;t&&he(t,e)}},b,ke,Me,be,e=>F.getValidationProps(j,e)],stateAttributesMapping:Ge}),qe=Ke.props.id;return ge(()=>{if(Le&&!_&&N!==void 0&&qe!==void 0)return Le(N,qe)},[Le,_,N,qe]),(0,B.jsxs)(Br.Provider,{value:We,children:[Ke,!I&&!O&&M&&!_&&re!==void 0&&(0,B.jsx)(`input`,{type:`hidden`,form:s,name:M,value:re,disabled:j}),(0,B.jsx)(`input`,{...Ue,suppressHydrationWarning:!0})]})}),Wr=z.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Vr(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:f}=v(c),p=z.useRef(null),m={...s,transitionStatus:u};_({batch:!0,enabled:!c,open:c,ref:p,onComplete(){c||f(!1)}});let h={...Lr(s),...d},g=a||l,ee=ue(`span`,e,{ref:[t,p],state:m,stateAttributesMapping:h,props:o});return g?ee:null});function Z({className:e,...t}){return(0,B.jsx)(Ur,{"data-slot":`checkbox`,className:se(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,B.jsx)(Wr,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,B.jsx)(y,{})})})}var Gr=(e,t)=>e===`repos`?Ce(w(Te)(t),{onNone:()=>t,onSome:De}):t,Kr=({value:e,onChange:t,problems:n,repositories:r,tags:i})=>{let a=K(K(e.selector).value),o=e=>Tr(a[e]).map(q),s=(e,t,n)=>Gr(e,t)===Gr(e,n),c=(n,r,i)=>{let c=o(n).filter(e=>!s(n,e,r)),l=i?[...c,r]:c,u={...a};l.length===0?delete u[n]:u[n]=l,t({...e,selector:Object.keys(u).length===0?{_tag:`None`}:{_tag:`Some`,value:u}})};return(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:G.allRepositories}),(0,B.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[{key:`repos`,label:G.repositories,choices:r},{key:`tags`,label:G.tags,choices:i}].map(({key:e,label:t,choices:n})=>(0,B.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,B.jsx)(`legend`,{className:`mb-2 font-medium`,children:t}),n.map(t=>(0,B.jsxs)(x,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Z,{checked:o(e).some(n=>s(e,n,t)),onCheckedChange:n=>c(e,t,n)}),t]},t))]},e))}),n.filter(e=>e.path[0]===`selector`).map((e,t)=>(0,B.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))]})},qr=({name:e,value:t})=>{let[n,r]=(0,z.useState)(),i={name:e,value:t},a=f(jt(new Pe(n===void 0?i:{...i,itemKey:n})));if(a.isPending)return(0,B.jsx)(`p`,{role:`status`,children:G.previewing});if(a.isError)return(0,B.jsx)(u,{message:a.error.message});let o=a.data;return(0,B.jsxs)(`section`,{className:`min-w-0 space-y-3`,"aria-label":G.preview,children:[(0,B.jsx)(`h3`,{className:`font-semibold`,"aria-live":`polite`,children:G.count(o.total,o.items.length)}),o.stream===`schedule`?(0,B.jsx)(`p`,{children:G.schedule}):o.total===0&&(0,B.jsx)(`p`,{children:G.empty}),o.repositoriesWithoutItems.length>0&&(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:G.noData(o.repositoriesWithoutItems)}),o.items.length>0&&(0,B.jsx)(Ht,{children:(0,B.jsx)(zt,{children:o.items.map(e=>{let t=Ae(e.repository);return(0,B.jsxs)(Bt,{children:[(0,B.jsxs)(Ut,{children:[(0,B.jsx)(ne,{to:`/projects/$owner/$name/tasks/$number`,params:{repository:e.repository,owner:t.owner,name:t.name,number:String(e.number)},className:`text-primary`,children:(0,B.jsx)(Ft,{item:Ue(e),title:e.title,variant:`row`,linked:!1})}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.repository})]}),(0,B.jsx)(Vt,{children:(0,B.jsx)(S,{type:`button`,variant:`outline`,"aria-pressed":o.prompt?.itemKey===e.itemKey,onClick:()=>r(e.itemKey),children:G.sample})})]},e.itemKey)})})}),o.failures.map((e,t)=>(0,B.jsx)(u,{message:e.message},`${e.itemKey}:${t}`)),o.prompt!==null&&(0,B.jsxs)(`div`,{className:`min-w-0 space-y-2 wrap-anywhere`,children:[(0,B.jsx)(`h3`,{className:`font-semibold`,children:G.rendered}),(0,B.jsx)(Rt,{children:o.prompt.text})]})]})},Jr=({name:e,...t})=>{let n=f(gt()),[r,i]=(0,z.useState)(t.value),[a,o]=(0,z.useState)();(0,z.useEffect)(()=>{let e=setTimeout(()=>i(t.value),350);return()=>clearTimeout(e)},[t.value]);let s=f(_t({name:Ze.make(e),value:r})),c=r!==t.value||s.isFetching,l=[...t.problems,...c?[]:s.data?.problems??[]],d={...t,problems:l},p=K(t.value.trigger),m=p.on===`pr`?`pr`:p.on===`schedule`?`schedule`:`issue`;return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[n.isError&&(0,B.jsx)(u,{message:n.error.message}),(0,B.jsx)(X,{...d,onChange:e=>{let n=K(e.trigger);if(n.on!==m){let{cron:r,tz:i,...a}=n;t.onChange({...e,trigger:n.on===`schedule`?{...a,cron:`0 9 * * *`,tz:`UTC`}:a})}else t.onChange(e)},definitions:[{path:`trigger.on`,label:G.stream,options:Be.literals},...m===`schedule`?[{path:`trigger.cron`,label:G.cron},{path:`trigger.tz`,label:G.timeZone}]:[]]}),(0,B.jsx)(Nr,{...d,path:`trigger.if`,label:G.condition,stream:m}),(0,B.jsx)(Kr,{...d,repositories:n.data?.repositories.map(({name:e})=>e)??[],tags:[...new Set(n.data?.repositories.flatMap(({tags:e})=>e)??[])]}),(0,B.jsxs)(x,{className:`flex items-center gap-2`,children:[(0,B.jsx)(_r,{checked:t.value.approval===`required`,onCheckedChange:e=>t.onChange({...t.value,approval:e?`required`:`none`})}),G.approval]}),(0,B.jsx)(X,{...d,definitions:[{path:`step`,label:G.step},{path:`agent`,label:G.agent,options:n.data?.agents.map(({name:e})=>e)??[]},{path:`maxCycles`,label:G.cycles,kind:`number`},{path:`permissions`,label:G.permissions,options:T}]}),(0,B.jsx)(Nr,{...d,path:`body`,label:G.prompt,stream:m}),(0,B.jsx)(`div`,{className:`min-w-0 wrap-anywhere`,children:(0,B.jsx)(wr,{template:q(t.value.body)})}),s.isError&&(0,B.jsx)(u,{message:s.error.message}),(0,B.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:c?G.checking:s.data?.problems.length===0?G.checked:null}),(0,B.jsx)(S,{type:`button`,variant:`outline`,className:`self-start`,disabled:c||s.isError||l.length>0,onClick:()=>o(t.value),children:G.preview}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:G.paused}),a===t.value&&(0,B.jsx)(qr,{name:Ze.make(e),value:a},JSON.stringify(a))]})},Yr=e=>{let t=f(Dt()),n=f(gt()),[r,i]=(0,z.useState)(!1),a=[...new Set(n.data?.agents.filter(t=>t.harness===e.value.harness).map(e=>e.model)??[])];return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[t.isPending&&(0,B.jsx)(`p`,{role:`status`,children:H.loading}),t.isError&&(0,B.jsx)(u,{message:t.error.message}),(0,B.jsx)(X,{...e,definitions:[{path:`name`,label:H.name,readOnly:!0,description:H.identity},{path:`harness`,label:H.harness,options:t.data?.harnesses??[]},{path:`model`,label:H.model,suggestions:a,description:H.modelHint},{path:`effort`,label:H.effort,options:t.data?.efforts??[]}]}),(0,B.jsx)(Ar,{...e,path:`persona`,label:H.persona,kind:`textarea`}),(0,B.jsx)(S,{type:`button`,variant:`outline`,className:`self-start`,onClick:()=>i(!r),"aria-expanded":r,children:r?H.hidePreview:H.preview}),r&&(0,B.jsx)(`div`,{className:`min-w-0 wrap-anywhere`,children:(0,B.jsx)(Rt,{children:q(e.value.persona)})})]})},Xr=({value:e,onChange:t,problems:n,path:r,label:i})=>{let a=(0,z.useId)(),[o,s]=(0,z.useState)(()=>Tr(J(e,r)).map(q).join(`, `)),c=n.filter(e=>e.path.join(`.`).startsWith(r));return(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(x,{htmlFor:a,children:i}),(0,B.jsx)(R,{id:a,value:o,"aria-invalid":c.length>0,"aria-describedby":`${a}-errors`,onChange:n=>{s(n.target.value),t(Y(e,r,n.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)))}}),(0,B.jsx)(`div`,{id:`${a}-errors`,children:c.map((e,t)=>(0,B.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))})]})},Zr=({path:e,label:t,value:n,onChange:r,problems:i})=>{let[a,o]=(0,z.useState)(``),s=K(J(n,e)),c=e.split(`.`),l=i.filter(e=>c.every((t,n)=>e.path[n]===t));return(0,B.jsxs)(`fieldset`,{className:`min-w-0 space-y-3`,children:[(0,B.jsx)(`legend`,{className:`mb-2 font-medium`,children:t}),Object.entries(s).map(([t,i])=>(0,B.jsxs)(`div`,{className:`flex min-w-0 items-end gap-2`,children:[(0,B.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,B.jsx)(Ar,{path:`value`,label:t,value:{value:i},problems:l.filter(e=>e.path[c.length]===t).map(e=>({...e,path:[`value`]})),onChange:i=>r(Y(n,e,{...s,[t]:i.value??``}))})}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,onClick:()=>{let i={...s};delete i[t],r(Y(n,e,i))},children:H.remove})]},t)),l.filter(e=>e.path.length===c.length).map((e,t)=>(0,B.jsx)(`p`,{role:`alert`,className:`text-destructive wrap-anywhere`,children:e.message},t)),(0,B.jsxs)(`div`,{className:`flex min-w-0 items-end gap-2`,children:[(0,B.jsxs)(x,{className:`min-w-0 flex-1 flex-col items-start gap-2`,children:[H.key,(0,B.jsx)(R,{value:a,onChange:e=>o(e.target.value)})]}),(0,B.jsx)(S,{type:`button`,variant:`outline`,disabled:a.trim()===``||a in s,onClick:()=>{r(Y(n,e,{...s,[a]:``})),o(``)},children:H.add})]})]})},Qr=[{path:`provisioner.timings.ssh_wait`,label:W.sshWait,kind:`number`,optional:!0},{path:`provisioner.timings.creation_backoff_min`,label:W.backoffMin,kind:`number`,optional:!0},{path:`provisioner.timings.creation_backoff_max`,label:W.backoffMax,kind:`number`,optional:!0},{path:`provisioner.timings.machine_check_interval`,label:W.checkInterval,kind:`number`,optional:!0}],$r=e=>{let t=J(e.value,`provisioner.provider`);return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(X,{...e,definitions:[{path:`provisioner.token_env`,label:W.token,description:H.secret},...t===`hetzner`?[{path:`provisioner.server_type`,label:W.serverType},{path:`provisioner.location`,label:W.location},{path:`provisioner.image`,label:W.snapshot},{path:`provisioner.network`,label:W.network,optional:!0},{path:`provisioner.firewall`,label:W.firewall,optional:!0},{path:`provisioner.ssh_key`,label:W.sshKey},{path:`provisioner.ssh_user`,label:W.sshUser,optional:!0}]:[{path:`provisioner.size`,label:W.size,optional:!0},{path:`provisioner.snapshot`,label:W.snapshot,optional:!0}],{path:`provisioner.api_keys.anthropic`,label:W.anthropic,optional:!0,description:H.secret},{path:`provisioner.api_keys.openai`,label:W.openai,optional:!0,description:H.secret},...Qr]}),t===`hetzner`&&(0,B.jsx)(Zr,{...e,path:`provisioner.labels`,label:W.labels}),t===`boat`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(x,{children:[(0,B.jsx)(Z,{checked:J(e.value,`provisioner.tailnet`)!==void 0,onCheckedChange:t=>e.onChange(Y(e.value,`provisioner.tailnet`,t?{}:void 0))}),W.tailnet]}),J(e.value,`provisioner.tailnet`)!==void 0&&(0,B.jsx)(X,{...e,definitions:[{path:`provisioner.tailnet.gateway_address`,label:W.gatewayAddress},{path:`provisioner.tailnet.client_id_env`,label:W.tailnetId,description:H.secret},{path:`provisioner.tailnet.client_secret_env`,label:W.tailnetSecret,description:H.secret}]})]})]})},ei=e=>{let t=Tr(e.value.llm_providers).map(K);return(0,B.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:be.literals.map(n=>{let r=t.findIndex(e=>e.provider===n);return(0,B.jsx)(Ar,{path:`api_key_env`,label:n===`anthropic`?W.anthropic:W.openai,description:H.secret,optional:!0,value:r<0?{}:K(t[r]),problems:e.problems.filter(e=>e.path[0]===`llm_providers`&&e.path[1]===r).map(e=>({...e,path:e.path.slice(2)})),onChange:r=>e.onChange({...e.value,llm_providers:[...t.filter(e=>e.provider!==n),...r.api_key_env===void 0?[]:[{provider:n,api_key_env:r.api_key_env}]]})},n)})})},ti=e=>{let t=f(gt()).data?.workers.find(t=>t.name===e.value.name)?.containerLimits,n=q(J(e.value,`provisioner.provider`)),r=e=>e===void 0?H.derived:`${H.lastPreflight}: ${e}. ${H.derived}.`;return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,B.jsx)(X,{...e,onChange:t=>e.onChange(t.kind===e.value.kind?t:{name:t.name??``,kind:t.kind??`local`,max_concurrent_attempts:t.max_concurrent_attempts??1}),definitions:[{path:`name`,label:H.name,readOnly:!0,description:H.identity},{path:`kind`,label:W.kind,options:nt.members.map(e=>e.fields.kind.literal)},{path:`max_concurrent_attempts`,label:W.slots,kind:`number`,description:W.slotsHint}]}),e.value.kind===`ssh`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(x,{className:`flex flex-col items-start gap-2`,children:[H.provisioner,(0,B.jsxs)(oe,{value:n,onChange:t=>{let n=t.target.value,r=Y(e.value,`provisioner`,n===``?void 0:{provider:n});e.onChange(Y(Y(r,`destination`,n===``?``:void 0),`port`,void 0))},children:[(0,B.jsx)(`option`,{value:``,children:H.existing}),(0,B.jsx)(`option`,{value:`hetzner`,children:`Hetzner`}),(0,B.jsx)(`option`,{value:`boat`,children:`Boat`})]})]}),(0,B.jsx)(X,{...e,definitions:[{path:`root`,label:W.root},{path:`identity_file`,label:W.identity,optional:!0},...n===``?[{path:`destination`,label:W.destination},{path:`port`,label:W.port,kind:`number`,optional:!0}]:[]]}),n!==``&&(0,B.jsx)($r,{...e}),(0,B.jsxs)(`fieldset`,{className:`space-y-3`,children:[(0,B.jsx)(`legend`,{className:`mb-3 font-medium`,children:H.container}),(0,B.jsx)(X,{...e,definitions:[{path:`container.image`,label:W.image,optional:!0},{path:`container.cpus`,label:W.cpus,kind:`number`,description:r(t?.cpus)},{path:`container.memory_mib`,label:W.memory,kind:`number`,description:r(t?.memoryMib)},{path:`container.pids`,label:W.pids,kind:`number`,description:r(t?.pids)}]})]}),(0,B.jsxs)(x,{children:[(0,B.jsx)(Z,{checked:e.value.gateway!==void 0,onCheckedChange:t=>e.onChange(Y(e.value,`gateway`,t?{}:void 0))}),H.gateway]}),e.value.gateway!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(X,{...e,definitions:[{path:`gateway.domain`,label:W.domain},{path:`gateway.destination`,label:W.gatewayDestination},{path:`gateway.admin_port`,label:W.adminPort,kind:`number`},{path:`gateway.admin_token_env`,label:W.adminToken,description:H.secret}]}),(0,B.jsx)(Xr,{...e,path:`gateway.llm_providers`,label:W.providers})]})]}),e.value.kind===`cloudflare`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(X,{...e,definitions:[{path:`worker_url`,label:W.url},{path:`access_client_id_env`,label:W.clientId,description:H.secret},{path:`access_client_secret_env`,label:W.clientSecret,description:H.secret},{path:`image`,label:W.image},{path:`instance_type`,label:W.instanceType,options:I.literals}]}),(0,B.jsx)(ei,{...e})]}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:H.restartWorker})]})},ni=e=>(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(X,{...e,onChange:t=>{let n=J(e.value,`webhooks.mode`),r=J(t,`webhooks.mode`);e.onChange(n===r?t:Y(t,`webhooks`,r===`endpoint`?{mode:r,public_url:``}:{mode:r??`off`}))},definitions:lr.map(e=>e.path===`settings.parent_effort`?{...e,options:Fe.literals,optional:!0}:{...e,optional:e.path===`operator`||e.path===`settings.parent_model`})}),J(e.value,`webhooks.mode`)===`endpoint`&&(0,B.jsx)(X,{...e,definitions:[{path:`webhooks.public_url`,label:U.publicUrl,description:U.publicUrlHint}]}),(0,B.jsxs)(x,{children:[(0,B.jsx)(Z,{checked:e.value.tracing!==void 0,onCheckedChange:t=>e.onChange(Y(e.value,`tracing`,t?{otlp_url:``,service_name:`usine`}:void 0))}),U.tracing]}),e.value.tracing!==void 0&&(0,B.jsx)(X,{...e,definitions:[{path:`tracing.otlp_url`,label:U.otlp,description:U.otlpHint},{path:`tracing.service_name`,label:U.service,description:U.serviceHint}]}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:H.restartSettings})]}),ri=({id:e,index:t,count:n,labels:r,remove:i,move:a,...o})=>{let s=Jt({id:e}),c=Tr(o.value.sources).map(K),l=(e,t,n)=>o.onChange({...o.value,sources:n?[...c,{[e]:t}]:c.filter(n=>n[e]!==t)}),u=c.flatMap(e=>`label`in e&&!r.some(t=>t.name===e.label)?[String(e.label)]:[]);return(0,B.jsxs)(`div`,{ref:s.setNodeRef,style:{transform:Kt.Transform.toString(s.transform),transition:s.transition},className:`min-w-0 space-y-4 border-b py-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(S,{ref:s.setActivatorNodeRef,...s.attributes,...s.listeners,type:`button`,variant:`ghost`,className:`touch-none`,"aria-label":`${H.reorder} ${t+1}`,children:(0,B.jsx)(sn,{})}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,"aria-label":`${H.moveUp} ${t+1}`,disabled:t===0,onClick:()=>a(-1),children:(0,B.jsx)(re,{})}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,"aria-label":`${H.moveDown} ${t+1}`,disabled:t===n-1,onClick:()=>a(1),children:(0,B.jsx)(ie,{})}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,className:`ml-auto`,onClick:i,children:H.removeLane})]}),(0,B.jsx)(Ar,{...o,path:`name`,label:H.laneName}),(0,B.jsxs)(`fieldset`,{className:`min-w-0`,children:[(0,B.jsx)(`legend`,{className:`mb-2 font-medium`,children:H.labels}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[r.map(e=>(0,B.jsxs)(x,{className:`min-w-0`,children:[(0,B.jsx)(Z,{checked:c.some(t=>t.label===e.name),onCheckedChange:t=>l(`label`,e.name,t===!0)}),(0,B.jsx)(nn,{name:e.name,label:{name:tt.make(e.name),color:e.color,description:Re(e.description)},className:`max-w-full whitespace-normal wrap-anywhere`})]},e.name)),u.map(e=>(0,B.jsxs)(x,{children:[(0,B.jsx)(Z,{checked:!0,onCheckedChange:()=>l(`label`,e,!1)}),(0,B.jsx)(nn,{name:e,label:void 0})]},e))]}),r.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:H.noLabels})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`mb-2 font-medium`,children:H.states}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:qe.literals.map(e=>(0,B.jsxs)(x,{children:[(0,B.jsx)(Z,{checked:c.some(t=>t.state===e),onCheckedChange:t=>l(`state`,e,t===!0)}),e]},e))})]}),o.problems.filter(e=>e.path[0]===`sources`).map((e,t)=>(0,B.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))]})},ii=({repository:e,...t})=>{let n=f(Pt(e)),r=Tr(t.value.lanes).map(K),[i,a]=(0,z.useState)(()=>r.map((e,t)=>t)),o=qt(Xt(Yt,{activationConstraint:{distance:5}}),Xt(Gt,{coordinateGetter:$t})),s=(e,n)=>{e<0||n<0||e===n||(a(Zt(i,e,n)),t.onChange({...t.value,lanes:Zt(r,e,n)}))};return(0,B.jsxs)(`div`,{className:`min-w-0 space-y-5`,children:[(0,B.jsx)(Ar,{...t,path:`name`,label:H.repositories,readOnly:!0}),(0,B.jsx)(Xr,{...t,path:`tags`,label:H.tags}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-md font-semibold`,children:H.lanes}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:H.orderHint})]}),n.isPending&&(0,B.jsx)(`p`,{role:`status`,children:H.loading}),n.isError&&(0,B.jsx)(u,{message:n.error.message}),(0,B.jsx)(Qt,{sensors:o,collisionDetection:tn,onDragEnd:({active:e,over:t})=>{t!==null&&s(i.findIndex(t=>t===e.id),i.findIndex(e=>e===t.id))},children:(0,B.jsx)(en,{items:i,strategy:Wt,children:r.map((e,o)=>(0,B.jsx)(ri,{id:i[o]??o,index:o,count:r.length,value:e,labels:n.data??[],problems:t.problems.filter(e=>e.path[0]===`lanes`&&e.path[1]===o).map(e=>({...e,path:e.path.slice(2)})),onChange:e=>t.onChange({...t.value,lanes:r.map((t,n)=>n===o?e:t)}),remove:()=>{a(i.filter((e,t)=>t!==o)),t.onChange({...t.value,lanes:r.filter((e,t)=>t!==o)})},move:e=>s(o,o+e)},i[o]))})}),(0,B.jsx)(S,{type:`button`,variant:`outline`,onClick:()=>{a([...i,Math.max(-1,...i)+1]),t.onChange({...t.value,lanes:[...r,{name:``,sources:[]}]})},children:H.addLane})]})},ai=({entity:e,...t})=>{switch(e.kind){case`loop`:return(0,B.jsx)(Jr,{...t,name:e.identifier});case`agent`:return(0,B.jsx)(Yr,{...t});case`worker`:return(0,B.jsx)(ti,{...t});case`settings`:return(0,B.jsx)(ni,{...t});case`repository`:return(0,B.jsx)(ii,{...t,repository:Te.make(e.identifier)});default:return null}},Q=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends Q{};function oi(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function si(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function ci(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function li(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function ui(e,t){return ci(e,t,``)}function di(e,t){return li(e,t,``)}function fi(e,t){return t.slice(0,pi(e,t))}function pi(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function mi(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function hi(e,t){if(t)return _i(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function gi(e,t){if(t)return _i(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function _i(e,t){if(!t)return[gi(e),hi(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=mi(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var vi=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,yi=RegExp(`[${vi}]+|\\s+|[^${vi}]`,`ug`);new class extends Q{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=mi(e,r)}else n=e.match(yi)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&bi(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&bi(n,i,r,null,t.intlSegmenter),e}};function bi(e,t,n,r,i){if(t&&n){let[a,o]=_i(t.value,i),[s,c]=_i(n.value,i);if(e){let r=oi(a,s);e.value=li(e.value,s,r),t.value=ui(t.value,r),n.value=ui(n.value,r)}if(r){let e=si(o,c);r.value=ci(r.value,c,e),t.value=di(t.value,e),n.value=di(n.value,e)}}else if(n){if(e){let e=gi(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=gi(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=gi(r.value,i),[a,o]=_i(t.value,i),s=oi(n,a);t.value=ui(t.value,s);let c=si(ui(n,s),o);t.value=di(t.value,c),r.value=ci(r.value,n,c),e.value=li(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=gi(r.value,i),n=fi(hi(t.value,i),e);t.value=di(t.value,n)}else if(e){let n=fi(hi(e.value,i),gi(t.value,i));t.value=ui(t.value,n)}}new class extends Q{tokenize(e){let t=RegExp(`(\\r?\\n)|[${vi}]+|[^\\S\\n\\r]+|[^${vi}]`,`ug`);return e.match(t)||[]}};var xi=new class extends Q{constructor(){super(...arguments),this.tokenize=Ci}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
11
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
12
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
13
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
14
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Si(e,t,n){return xi.diff(e,t,n)}function Ci(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
15
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function wi(e){return e==`.`||e==`!`||e==`?`}new class extends Q{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(wi(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Q{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Q{constructor(){super(...arguments),this.tokenize=Ci}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Ti(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Ti(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Ti(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Ti(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Q{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Ei(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function $(e){if(!Ei(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var Di={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Oi(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;Si(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(Si(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||ji(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
16
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function ki(e,t){if(t||=Di,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>ki(e,t)).join(`
|
|
17
|
+
`)}let n=[];if(e.isGit){if(t=Di,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+$(r)+` `+$(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+$((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+$((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+$((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+$((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+$(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+$(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
18
|
+
`)+`
|
|
19
|
+
`}function Ai(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;Oi(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?ki(e,o.headerOptions):void 0)}}))}else{let s=Oi(e,t,n,r,i,a,o);return s?ki(s,o?.headerOptions):void 0}}function ji(e){let t=e.endsWith(`
|
|
20
|
+
`),n=e.split(`
|
|
21
|
+
`).map(e=>e+`
|
|
22
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Mi=(e,t,n)=>t===n?``:Ai(t===``?`/dev/null`:`a/${e}`,n===``?`/dev/null`:`b/${e}`,t,n),Ni=({entity:e,before:t,number:n,reload:r})=>{let i=f({...wt(e),staleTime:0,refetchOnMount:`always`}),a=i.error instanceof Ne&&i.error.error===`ConfigurationNotFound`,o=a?``:i.data?.text,s=a?n:i.data?.number;return(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,"aria-label":V.conflict,children:[(0,B.jsx)(`p`,{role:`alert`,className:`text-warning`,children:V.conflict}),i.isPending&&(0,B.jsx)(`p`,{role:`status`,children:V.loading}),i.isError&&!a&&(0,B.jsx)(u,{message:i.error.message}),o!==void 0&&s!==void 0&&!i.isFetching&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:V.revision(s)}),a&&(0,B.jsx)(`p`,{children:V.deletedConflict}),(0,B.jsx)(ae,{code:Mi(e.key,t,o)||V.noDiff,language:`diff`}),(0,B.jsx)(`div`,{children:(0,B.jsx)(S,{variant:`outline`,onClick:()=>{r({text:o,number:s})},children:V.reload})})]})]})},Pi=({error:e})=>(0,B.jsxs)(`div`,{role:`alert`,className:`min-w-0 space-y-2 wrap-anywhere`,children:[(0,B.jsx)(u,{message:ct(e)}),e instanceof Ge&&(0,B.jsx)(`ul`,{className:`space-y-1 text-destructive`,children:e.problems.map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`code`,{children:[e.entity.key,e.path.length>0?`.${e.path.join(`.`)}`:``]}),`: `,e.message]},t))}),e instanceof ot&&(0,B.jsx)(`ul`,{className:`text-destructive`,children:e.entities.map(e=>(0,B.jsx)(`li`,{children:e.key},e.key))})]}),Fi=({value:e,onChange:t,label:n=V.source,disabled:r})=>{let i=(0,z.useId)(),a=(0,z.useRef)(null);return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,B.jsx)(x,{htmlFor:i,children:n}),(0,B.jsxs)(`div`,{className:`flex min-w-0 overflow-hidden rounded-md border bg-card`,children:[(0,B.jsx)(`pre`,{ref:a,"aria-hidden":`true`,className:`m-0 max-h-96 shrink-0 overflow-hidden border-r px-3 py-2 text-right font-mono text-xs leading-5 text-muted-foreground select-none`,children:e.split(`
|
|
23
|
+
`).map((e,t)=>t+1).join(`
|
|
24
|
+
`)}),(0,B.jsx)(b,{id:i,value:e,readOnly:t===void 0,disabled:r,spellCheck:!1,wrap:`off`,className:`h-96 min-w-0 flex-1 rounded-none border-0 font-mono text-xs leading-5 [field-sizing:fixed]`,onScroll:e=>{a.current!==null&&(a.current.scrollTop=e.currentTarget.scrollTop)},onChange:e=>t?.(e.target.value)})]})]})},Ii=(e,t)=>{if(kr(e)){let n=Er(e,t);if(ke(n))return{mode:`form`,value:n.success}}return{mode:`text`,text:t}},Li=({entity:e,initial:t,onSaved:n,cancel:r})=>{let[i,a]=(0,z.useState)(t),[o,s]=(0,z.useState)(()=>Ii(e,t.text)),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)([]),[f,p]=(0,z.useState)(``),m=ht(),h=e=>{s(e),d([]),m.error instanceof Ge&&m.reset()},g=o.mode===`text`?o.text:Or(e,o.value),_=m.error instanceof Ge?m.error.problems.filter(t=>t.entity.key===e.key):[];return(0,B.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,noValidate:!0,onSubmit:t=>{if(t.preventDefault(),m.isPending||m.error instanceof D)return;if(o.mode===`form`){let t=Dr(e,o.value);if(Ee(t)){d(t.failure.details??[{path:[],message:t.failure.message}]);return}}d([]);let r=o.mode===`text`?{text:g,expected:i.number,message:f}:{value:o.value,expected:i.number,message:f};m.mutate({action:`save`,key:e,payload:r},{onSuccess:n})},children:[kr(e)&&(0,B.jsx)(S,{type:`button`,variant:`outline`,className:`self-start`,disabled:m.isPending,onClick:()=>{if(o.mode===`form`){h({mode:`text`,text:g}),d([]);return}let t=Er(e,o.text);Ee(t)?d(t.failure.details??[{path:[],message:t.failure.message}]):(d([]),h({mode:`form`,value:t.success}))},children:o.mode===`form`?H.text:H.form}),(0,B.jsx)(`fieldset`,{disabled:m.isPending,className:`min-w-0`,children:o.mode===`text`?(0,B.jsx)(Fi,{value:o.text,onChange:e=>h({mode:`text`,text:e}),disabled:m.isPending}):(0,B.jsx)(ai,{entity:e,value:o.value,onChange:e=>h({mode:`form`,value:e}),problems:[...u,..._]},i.number)}),u.length>0&&(0,B.jsx)(`ul`,{role:`alert`,className:`space-y-1 text-destructive wrap-anywhere`,children:u.map((e,t)=>(0,B.jsxs)(`li`,{children:[e.path.join(`.`),`: `,e.message]},t))}),m.isError&&(m.error instanceof D?(0,B.jsx)(Ni,{entity:e,before:i.text,number:m.error.current,reload:t=>{l(g),s(Ii(e,t.text)),a(t),d([]),m.reset()}}):(0,B.jsx)(Pi,{error:m.error})),(0,B.jsxs)(x,{className:`flex flex-col items-start gap-2`,children:[V.message,(0,B.jsx)(R,{value:f,onChange:e=>p(e.target.value),disabled:m.isPending})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(S,{type:`submit`,disabled:m.isPending||m.error instanceof D,children:m.isPending?V.saving:V.save}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,onClick:r,disabled:m.isPending,children:V.cancel})]}),c!==null&&(0,B.jsx)(Fi,{label:V.draft,value:c})]})},Ri=({number:e,entity:t})=>{let n=f(vt(e)),r=f(wt(Cn(`settings`,`instance`))),[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(``),c=ht();return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 pb-4`,children:[n.isPending&&(0,B.jsx)(`p`,{role:`status`,children:V.loading}),n.isError&&(0,B.jsx)(u,{message:n.error.message}),n.data?.changes.filter(({key:e})=>t===void 0||e.key===t.key).map(e=>(0,B.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,B.jsx)(`a`,{href:wn(e.key),className:`text-primary hover:underline`,children:e.key.key}),(0,B.jsx)(ae,{code:Mi(e.key.key,e.beforeText,e.afterText)||V.noDiff,language:`diff`})]},e.key.key)),r.isError&&(0,B.jsx)(u,{message:r.error.message}),n.data!==void 0&&(0,B.jsx)(`div`,{children:(0,B.jsx)(S,{variant:`outline`,onClick:()=>a(!i),children:V.revert})}),i&&(0,B.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault(),r.data!==void 0&&c.mutate({action:`revert`,number:e,payload:{expected:r.data.number,message:o}},{onSuccess:()=>a(!1)})},children:[(0,B.jsx)(`p`,{children:V.revertWarning}),(0,B.jsx)(`ul`,{className:`text-muted-foreground`,children:n.data?.entities.map(e=>(0,B.jsx)(`li`,{children:e.key},e.key))}),(0,B.jsxs)(x,{className:`flex flex-col items-start gap-2`,children:[V.message,(0,B.jsx)(R,{value:o,onChange:e=>s(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(S,{type:`submit`,disabled:c.isPending||r.data===void 0,children:c.isPending?V.saving:V.confirmRevert}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,disabled:c.isPending,onClick:()=>a(!1),children:V.cancel})]})]}),c.isError&&(0,B.jsx)(Pi,{error:c.error}),c.isSuccess&&(0,B.jsx)(`p`,{role:`status`,children:V.reverted})]})},zi=({entity:e})=>{let t=an(Mt(e)),[n,r]=(0,z.useState)(null),i=t.data?.pages.flatMap(e=>e.revisions)??[];return(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,"aria-label":V.history,children:[(0,B.jsx)(`h2`,{className:`text-md font-semibold`,children:V.history}),t.isPending&&(0,B.jsx)(`p`,{role:`status`,children:V.loading}),t.isError&&(0,B.jsx)(u,{message:t.error.message}),t.isSuccess&&i.length===0&&(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:V.emptyHistory}),(0,B.jsx)(`ul`,{className:`min-w-0 divide-y border-y`,children:i.map(t=>(0,B.jsxs)(`li`,{className:`min-w-0 py-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,B.jsx)(S,{variant:`ghost`,"aria-expanded":n===t.number,onClick:()=>r(n===t.number?null:t.number),children:V.revision(t.number)}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:t.actor??V.localOperator}),(0,B.jsx)(`time`,{className:`text-xs text-muted-foreground`,dateTime:Ye(t.time),children:$e(t.time).toLocaleString()}),t.message!==null&&(0,B.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:t.message})]}),e===void 0&&(0,B.jsx)(`ul`,{className:`flex flex-wrap gap-x-4 gap-y-1 py-2`,children:t.entities.map(e=>(0,B.jsx)(`li`,{className:`min-w-0 wrap-anywhere`,children:(0,B.jsx)(`a`,{className:`text-primary hover:underline`,href:wn(e),children:e.key})},e.key))}),n===t.number&&(0,B.jsx)(Ri,{number:t.number,entity:e})]},t.number))}),t.hasNextPage&&(0,B.jsx)(`div`,{children:(0,B.jsx)(S,{variant:`outline`,disabled:t.isFetchingNextPage,onClick:()=>void t.fetchNextPage(),children:t.isFetchingNextPage?V.loading:V.more})})]})},Bi=({entity:e,children:t})=>{let n=f(wt(e)),r=f(gt()),[i,a]=(0,z.useState)({_tag:`read`}),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(!1),d=ht();return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(S,{variant:`outline`,disabled:n.data===void 0||n.isError||i._tag!==`read`,onClick:()=>{l(!1),n.data!==void 0&&a({_tag:`edit`,initial:n.data})},children:V.edit}),(0,B.jsx)(S,{variant:`ghost`,disabled:n.data===void 0||n.isError||i._tag!==`read`,onClick:()=>{d.reset(),n.data!==void 0&&a({_tag:`delete`,initial:n.data})},children:V.delete}),n.isPending&&(0,B.jsx)(`span`,{role:`status`,children:V.loading}),c&&(0,B.jsx)(`span`,{role:`status`,children:V.saved}),d.isSuccess&&n.isError&&(0,B.jsx)(`span`,{role:`status`,children:V.deleted})]}),n.isError&&!d.isSuccess&&(0,B.jsx)(u,{message:n.error.message}),i._tag===`edit`&&(0,B.jsx)(Li,{entity:e,initial:i.initial,onSaved:()=>{a({_tag:`read`}),l(!0)},cancel:()=>a({_tag:`read`})}),i._tag===`delete`&&(0,B.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault(),!d.isPending&&d.mutate({action:`delete`,key:e,payload:{expected:i.initial.number,message:o}},{onSuccess:()=>a({_tag:`read`})})},children:[(0,B.jsx)(`h2`,{className:`text-md font-semibold`,children:V.deleteWarning(e.identifier)}),r.data!==void 0&&(0,B.jsx)(`p`,{className:`wrap-anywhere`,children:V.references(Tn(e,r.data))}),(0,B.jsxs)(x,{className:`flex flex-col items-start gap-2`,children:[V.message,(0,B.jsx)(R,{value:o,onChange:e=>s(e.target.value)})]}),d.isError&&(0,B.jsx)(Pi,{error:d.error}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(S,{type:`submit`,variant:`destructive`,disabled:d.isPending||r.data===void 0,children:d.isPending?V.saving:V.confirmDelete}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,disabled:d.isPending,onClick:()=>a({_tag:`read`}),children:V.cancel})]})]}),i._tag===`read`&&t,(0,B.jsx)(zi,{entity:e})]})},Vi=({value:e,onChange:t,disabled:n})=>{let r=f(Ct()),i=f(gt()),a=new Set(i.data?.repositories.map(({name:e})=>e.toLowerCase())),o=r.data?.filter(e=>!a.has(e.toLowerCase()))??[];return(0,B.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,B.jsxs)(x,{className:`flex flex-col items-start gap-2`,children:[H.repositories,(0,B.jsxs)(oe,{className:`w-full`,value:e,disabled:n||r.isPending||i.data===void 0,onChange:e=>t(e.target.value),children:[(0,B.jsx)(`option`,{value:``,children:H.choose}),o.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),r.isPending&&(0,B.jsx)(`p`,{role:`status`,children:H.loading}),r.isError&&(0,B.jsx)(u,{message:r.error.message}),i.isError&&(0,B.jsx)(u,{message:i.error.message}),r.isSuccess&&i.isSuccess&&o.length===0&&(0,B.jsx)(`p`,{children:H.noRepositories})]})},Hi=({kind:e,cancel:t})=>{let[n,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null),[l,d]=(0,z.useState)(!1),p=r(),m=te(),h=f(wt(Cn(`settings`,`instance`))),g=f(gt());return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,B.jsx)(`h2`,{className:`text-md font-semibold`,children:V.create(e)}),e===`loop`&&(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:V.paused}),a===null?(0,B.jsxs)(`form`,{className:`flex flex-col items-start gap-3`,onSubmit:t=>{t.preventDefault();let r=w(Oe)(n.trim());Ie(r)||(d(!0),c(null),p.fetchQuery(wt(Cn(e,r.value))).then(()=>c(V.alreadyExists),e=>{e instanceof Ne&&e.error===`ConfigurationNotFound`?o(r.value):c(ct(e))}).finally(()=>d(!1)))},children:[e===`repository`?(0,B.jsx)(Vi,{value:n,onChange:i,disabled:l}):(0,B.jsxs)(x,{className:`flex w-full flex-col items-start gap-2`,children:[V.name,(0,B.jsx)(R,{required:!0,disabled:l,value:n,onChange:e=>i(e.target.value)})]}),s!==null&&(0,B.jsx)(u,{message:s}),h.isError&&(0,B.jsx)(u,{message:h.error.message}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(S,{type:`submit`,disabled:l||h.data===void 0||n.trim()===``,children:l?V.loading:V.edit}),(0,B.jsx)(S,{type:`button`,variant:`ghost`,onClick:t,children:V.cancel})]})]}):h.data!==void 0&&(0,B.jsx)(Li,{entity:Cn(e,a),initial:{number:h.data.number,text:En(e,a,g.data?.agents[0]?.name??`developer`)},cancel:t,onSaved:()=>{m({to:wn(Cn(e,a))})}})]})},Ui=({kind:e})=>{let[t,n]=(0,z.useState)(!1);return t?(0,B.jsx)(Hi,{kind:e,cancel:()=>n(!1)}):(0,B.jsx)(`div`,{children:(0,B.jsx)(S,{onClick:()=>n(!0),children:V.new})})},Wi=({title:e,entity:t,createKind:n,leading:r,counts:i,marks:a,file:s,actions:l,children:u})=>(0,B.jsxs)(c,{width:`full`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,B.jsx)(o,{title:e,leading:r,counts:i,children:a}),s!==void 0&&(0,B.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:s})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:l})]}),n!==void 0&&(0,B.jsx)(Ui,{kind:n}),t===void 0?u:(0,B.jsx)(Bi,{entity:t,children:u},t.key)]}),Gi=({facts:e,children:t})=>(0,B.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 pt-2 lg:grid-cols-[minmax(0,1fr)_21rem]`,children:[(0,B.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8 max-lg:order-2`,children:t}),(0,B.jsx)(`aside`,{className:`min-w-0 max-lg:order-1 lg:border-l lg:pl-6`,children:e})]}),Ki=({title:e,aside:t,children:n})=>(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,B.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,B.jsx)(`h2`,{className:`text-md font-semibold`,children:e}),t!==void 0&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),n]}),qi=({children:e})=>(0,B.jsx)(`dl`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-3 text-sm`,children:e}),Ji=({label:e,children:t})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,B.jsx)(`dd`,{className:`min-w-0 wrap-anywhere`,children:t})]}),Yi=({children:e})=>(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:e}),Xi=({entries:e,className:t})=>(0,B.jsx)(`dl`,{className:se(`grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-1.5 rounded-lg bg-card px-3 py-2.5 font-mono text-xs [font-variant-ligatures:none] ring-1 ring-border`,t),children:e.map(([e,t])=>(0,B.jsxs)(`div`,{className:`contents`,children:[(0,B.jsxs)(`dt`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,B.jsx)(`dd`,{className:`whitespace-pre-wrap text-foreground wrap-anywhere`,children:t})]},e))}),Zi=({open:e,children:t})=>(0,B.jsx)(Bt,{className:`cursor-pointer hover:bg-muted/60 has-[a:focus-visible]:bg-muted/60`,onClick:e,children:t}),Qi=`rounded-sm font-medium whitespace-nowrap outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,$i=()=>(0,B.jsx)(It,{state:`Failed`,label:`Not loaded`}),ea=({title:e,children:t})=>(0,B.jsx)(mt,{className:`items-start p-0 py-6 text-left`,children:(0,B.jsxs)(dt,{className:`items-start`,children:[(0,B.jsx)(ft,{className:`text-md font-semibold tracking-normal`,children:e}),(0,B.jsx)(pt,{className:`text-sm text-muted-foreground`,children:t})]})});export{An as A,Zn as B,On as C,Dn as D,Mn as E,qn as F,Wn as G,tr as H,$n as I,Bn as J,Un as K,rr as L,Kn as M,nr as N,Vn as O,Xn as P,Gn as R,zn as S,G as T,Yn as U,er as V,Qn as W,Cn as Y,ar as _,qi as a,Ln as b,$i as c,Qi as d,zi as f,sr as g,or as h,Ji as i,ir as j,cr as k,Zi as l,yr as m,Gi as n,Xi as o,wr as p,kn as q,Ki as r,ea as s,Wi as t,Yi as u,jn as v,Hn as w,V as x,Rn as y,Jn as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{M as t}from"./page-BLxt7Xfg.js";import{B as n,H as r,I as i,K as a,L as o,N as s,P as c,U as l,V as u,W as d,Y as f,j as p,t as m}from"./section-D4djNiAN.js";import{u as h}from"./error-alert-BVIxPJFU.js";import{t as g}from"./button-4rhhIcK8.js";import{qn as _,v,w as y,y as b}from"./strings-BeaABxX0.js";import{S as x,T as S,jt as C}from"./index-BdDPka5v.js";var w=e(),T=e=>/-next\.\d+\.g([0-9a-f]{7,40})$/u.exec(e)?.[1]??`@usine/server@${e}`,E=()=>{let{data:e}=C(x()),f=t(),m=h({mutationFn:e=>v(t=>t.requestUpgrade({payload:new y({timing:e,version:_()})})),onSuccess:()=>f.invalidateQueries(x())}),S=e.phase===`waiting`||e.phase===`installing`,E=e.available===null?null:`https://github.com/basaltbytes/usine/compare/${encodeURIComponent(T(e.running))}...${encodeURIComponent(T(e.available))}`;return(0,w.jsxs)(`section`,{className:`flex flex-col gap-3`,"aria-labelledby":`upgrades-title`,children:[(0,w.jsx)(`h2`,{id:`upgrades-title`,className:`text-md font-semibold`,children:a}),(0,w.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2 border-y py-3 sm:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`text-muted-foreground`,children:r}),(0,w.jsx)(`dd`,{className:`font-mono text-xs`,children:e.running}),(0,w.jsx)(`dt`,{className:`text-muted-foreground`,children:s}),(0,w.jsx)(`dd`,{children:e.channel}),(0,w.jsx)(`dt`,{className:`text-muted-foreground`,children:o}),(0,w.jsx)(`dd`,{children:e.mode})]}),e.supported?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`p`,{role:`status`,children:e.phase===`waiting`?d:e.phase===`installing`?i:e.mode===`off`?n:e.available===null?c:p(e.available)}),E!==null&&(0,w.jsx)(`a`,{href:E,target:`_blank`,rel:`noreferrer`,className:`w-fit text-primary underline underline-offset-4`,children:`View changes`}),e.available!==null&&!S&&e.phase!==`failed`&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:gap-8`,children:[(0,w.jsxs)(`div`,{className:`flex max-w-sm flex-col items-start gap-2`,children:[(0,w.jsx)(g,{disabled:m.isPending,onClick:()=>m.mutate(`idle`),children:`Upgrade when idle`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Wait for running attempts to finish. No new attempt starts while waiting.`})]}),(0,w.jsxs)(`div`,{className:`flex max-w-sm flex-col items-start gap-2`,children:[(0,w.jsx)(g,{variant:`outline`,disabled:m.isPending,onClick:()=>m.mutate(`now`),children:`Upgrade now`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Restart now. Running attempts reattach after the server restarts.`})]})]})]}):(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:l}),e.outcome?.status===`rolled-back`&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:u(e.outcome.previous,e.outcome.target,e.outcome.reason)}),e.outcome?.status===`failed`&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.outcome.reason}),e.message!==null&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message}),m.isError&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:b(m.error)})]})},D=e=>(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:e}),O=e=>(0,w.jsx)(`code`,{className:`font-mono text-xs`,children:e}),k=e=>[[`Polling`,[{key:`settings.poll_interval`,value:O(e.pollInterval),effect:`Seconds between the starts of two GitHub poll cycles.`}]],[`Attempts`,[{key:`settings.max_children`,value:O(e.maxChildren),effect:`Maximum child sessions per attempt. Starting one more fails the attempt.`},{key:`settings.max_attempt_minutes`,value:e.maxAttemptMinutes===null?D(`Not set`):O(e.maxAttemptMinutes),effect:e.maxAttemptMinutes===null?`No wall-clock ceiling.`:`Minutes an attempt may run before the runaway guard fails it.`},{key:`settings.max_attempt_tokens`,value:e.maxAttemptTokens===null?D(`Not set`):O(e.maxAttemptTokens),effect:e.maxAttemptTokens===null?`No token ceiling.`:`Tokens an attempt may use, parent and children combined, before the runaway guard fails it.`}]],[`Parent`,[{key:`settings.parent_model`,value:e.parentModel===null?D(`Not set`):O(e.parentModel),effect:e.parentModel===null?`Chosen by Pi unless the agent file sets parent_model.`:`Parent model when the agent file sets no parent_model.`},{key:`settings.parent_effort`,value:e.parentEffort===null?D(`Not set`):O(e.parentEffort),effect:e.parentEffort===null?`parent_effort from the agent file, or effort if it is not set.`:`Parent effort when the agent file sets no parent_effort.`}]],[`Operator`,[{key:`operator`,value:e.operator===null?D(`Not set`):O(e.operator),effect:e.operator===null?`Approvals from the UI record no approver; messages show as local operator.`:`The GitHub login recorded on approvals and messages from the UI, and the only login that can answer an ask on GitHub.`}]],[`Webhooks`,[{key:`webhooks.mode`,value:O(e.webhooks),effect:`Parsed and validated but not used: this version reads GitHub changes by polling only. A change applies after usine up restarts.`},...e.webhooksPublicUrl===null?[]:[{key:`webhooks.public_url`,value:O(e.webhooksPublicUrl),effect:`Where GitHub would deliver webhooks.`}]]],[`Tracing`,e.tracing===null?[{key:`tracing.otlp_url`,value:D(`Not set`),effect:`No span export. A change applies after usine up restarts.`}]:[{key:`tracing.otlp_url`,value:O(e.tracing.otlpUrl),effect:`Collector endpoint that receives every span as OTLP/HTTP protobuf. A change applies after usine up restarts.`},{key:`tracing.service_name`,value:O(e.tracing.serviceName),effect:`The service.name resource attribute of every exported span.`}]]],A=({configuration:e,children:t})=>(0,w.jsx)(m,{entity:f(`settings`,`instance`),title:`Settings`,children:(0,w.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-8 pt-2`,children:[t,k(e.settings).map(([e,t])=>(0,w.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,w.jsx)(`h2`,{className:`text-md font-semibold`,children:e}),(0,w.jsx)(`dl`,{className:`border-t`,children:t.map(({key:e,value:t,effect:n})=>(0,w.jsxs)(`div`,{className:`grid gap-x-6 gap-y-1 border-b py-3 sm:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`font-mono text-xs leading-5 text-muted-foreground`,children:e}),(0,w.jsxs)(`dd`,{className:`flex flex-col gap-0.5 wrap-anywhere`,children:[(0,w.jsx)(`span`,{children:t}),(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n})]})]},e))})]},e))]})}),j=()=>{let{data:e}=C(S());return(0,w.jsx)(A,{configuration:e,children:(0,w.jsx)(E,{})})};export{j as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{z as n}from"./mark-B8EExm_5.js";var r=t(n()),i=t(e());function a(){var e=[...arguments];return(0,i.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var o=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function s(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function c(e){return`nodeType`in e}function l(e){return e?s(e)?e:c(e)?e.ownerDocument?.defaultView??window:window:window}function u(e){let{Document:t}=l(e);return e instanceof t}function d(e){return!s(e)&&e instanceof l(e).HTMLElement}function f(e){return e instanceof l(e).SVGElement}function p(e){return e?s(e)?e.document:c(e)?u(e)?e:d(e)||f(e)?e.ownerDocument:document:document:document}var m=o?i.useLayoutEffect:i.useEffect;function h(e){let t=(0,i.useRef)(e);return m(()=>{t.current=e}),(0,i.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function g(){let e=(0,i.useRef)(null);return[(0,i.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,i.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function _(e,t){t===void 0&&(t=[e]);let n=(0,i.useRef)(e);return m(()=>{n.current!==e&&(n.current=e)},t),n}function v(e,t){let n=(0,i.useRef)();return(0,i.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function y(e){let t=h(e),n=(0,i.useRef)(null);return[n,(0,i.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function b(e){let t=(0,i.useRef)();return(0,i.useEffect)(()=>{t.current=e},[e]),t.current}var x={};function S(e,t){return(0,i.useMemo)(()=>{if(t)return t;let n=x[e]==null?0:x[e]+1;return x[e]=n,e+`-`+n},[e,t])}function C(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var w=C(1),T=C(-1);function E(e){return`clientX`in e&&`clientY`in e}function D(e){if(!e)return!1;let{KeyboardEvent:t}=l(e.target);return t&&e instanceof t}function ee(e){if(!e)return!1;let{TouchEvent:t}=l(e.target);return t&&e instanceof t}function te(e){if(ee(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return E(e)?{x:e.clientX,y:e.clientY}:null}var O=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[O.Translate.toString(e),O.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),k=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function A(e){return e.matches(k)?e:e.querySelector(k)}var ne={display:`none`};function re(e){let{id:t,value:n}=e;return i.createElement(`div`,{id:t,style:ne},n)}function j(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return i.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function ie(){let[e,t]=(0,i.useState)(``);return{announce:(0,i.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ae=(0,i.createContext)(null);function M(e){let t=(0,i.useContext)(ae);(0,i.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function oe(){let[e]=(0,i.useState)(()=>new Set),t=(0,i.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,i.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var se={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|