@usine/server 0.4.1-next.263.g21813b5 → 0.4.1-next.264.gfdecd7e
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/configuration/catalog.d.ts +5 -0
- package/dist/configuration/catalog.d.ts.map +1 -0
- package/dist/configuration/catalog.js +38 -0
- package/dist/configuration/catalog.js.map +1 -0
- package/dist/http.d.ts +3 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +7 -0
- package/dist/http.js.map +1 -1
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +4 -2
- package/dist/up.js.map +1 -1
- package/dist/web/assets/_agent-CK1JZbEZ.js +1 -0
- package/dist/web/assets/{_label-CjbmpOS8.js → _label-CkDrdgxa.js} +1 -1
- package/dist/web/assets/_loop-DLKJmqFq.js +1 -0
- package/dist/web/assets/_name-BzeOsU08.js +1 -0
- package/dist/web/assets/_name-CCrJHJTI.js +1 -0
- package/dist/web/assets/_name-LWtfT5Eq.js +2 -0
- package/dist/web/assets/_number-BzeOsU08.js +1 -0
- package/dist/web/assets/{_number-Cak-hr88.js → _number-CpU9ru_u.js} +1 -1
- package/dist/web/assets/_number-n4iejSEq.js +1 -0
- package/dist/web/assets/_run-BzeOsU08.js +1 -0
- package/dist/web/assets/_run-CHrGLkXR.js +5 -0
- package/dist/web/assets/{_worker-Ce5spGKK.js → _worker-BvlkSKMd.js} +1 -1
- package/dist/web/assets/{action-BN5NBgLV.js → action-DQzkdVHs.js} +1 -1
- package/dist/web/assets/actions-CG0hkpe7.js +1 -0
- package/dist/web/assets/agents-CgWsAMoz.js +1 -0
- package/dist/web/assets/{agents-CvLlV1IU.js → agents-D3eAK_60.js} +1 -1
- package/dist/web/assets/code-block-Y9Y-8fHK.js +4 -0
- package/dist/web/assets/collapsible-BKcakxvM.js +1 -0
- package/dist/web/assets/{core-CuokrI3P.js → core-S_rVxu-b.js} +3 -3
- package/dist/web/assets/drawer-ClcvABkO.js +1 -0
- package/dist/web/assets/dropdown-menu-BHKHYfLs.js +1 -0
- package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +1 -0
- package/dist/web/assets/error-alert-hABzwCSY.js +1 -0
- package/dist/web/assets/{file-error-eIMly20p.js → file-error-B5tv6DhJ.js} +1 -1
- package/dist/web/assets/{heading-ss9Xdc-n.js → heading-zIOXe3qT.js} +1 -1
- package/dist/web/assets/{history-DgnatlLO.js → history-PYEz5wbe.js} +1 -1
- package/dist/web/assets/index-C_S4sA5L.css +2 -0
- package/dist/web/assets/index-Dki55xSv.js +10 -0
- package/dist/web/assets/label-badge-JdNthOHh.js +1 -0
- package/dist/web/assets/{labels-Ca7Ov7o0.js → labels-Dr9t-xYj.js} +1 -1
- package/dist/web/assets/{list-6VjnLdz_.js → list-NcxSR9Ja.js} +1 -1
- package/dist/web/assets/loops-DI4kElkX.js +1 -0
- package/dist/web/assets/mark-uyeJ8aPC.js +1 -0
- package/dist/web/assets/markdown-BNebzGGH.js +29 -0
- package/dist/web/assets/model-87X7P9Uh.js +1 -0
- package/dist/web/assets/moves-DS1ecXd6.js +1 -0
- package/dist/web/assets/native-select-BzF8xUnx.js +1 -0
- package/dist/web/assets/{not-found-xvnvMs0s.js → not-found-D7GT8Sj7.js} +1 -1
- package/dist/web/assets/outcome-DvqnSso3.js +5 -0
- package/dist/web/assets/{overview-CF8vBUkv.js → overview-C73v5kbv.js} +1 -1
- package/dist/web/assets/{page-0tuebez8.js → page-C47YAWAl.js} +1 -1
- package/dist/web/assets/{pull-request-marks-Doq7DaVI.js → pull-request-marks-B4f7z4xa.js} +1 -1
- package/dist/web/assets/queries-BZMW2wiD.js +1 -0
- package/dist/web/assets/queries-oea_Y4on.js +1 -0
- package/dist/web/assets/repositories-CZBhubWh.js +1 -0
- package/dist/web/assets/route-BtU2HI1M.js +1 -0
- package/dist/web/assets/route-CD6OvH-7.js +1 -0
- package/dist/web/assets/{route-status-Cg2e753V.js → route-status-DGpeFNCC.js} +1 -1
- package/dist/web/assets/routes-BzeOsU08.js +1 -0
- package/dist/web/assets/{routes-aXaODFL1.js → routes-g6SHTgCO.js} +4 -4
- package/dist/web/assets/run-again-DPa5c27z.js +1 -0
- package/dist/web/assets/{section-Dvf2zdjI.js → section-BZs0sQLB.js} +1 -1
- package/dist/web/assets/section-eyIYzZrG.js +24 -0
- package/dist/web/assets/{settings-C7SrVNWn.js → settings-DusVdmgP.js} +1 -1
- package/dist/web/assets/sortable.esm-Lp8AM6j2.js +5 -0
- package/dist/web/assets/{strings-D8AeU2ul.js → strings-Bexnszes.js} +1 -1
- package/dist/web/assets/{strings-BcIxtDID.js → strings-DXB6PB2g.js} +63 -63
- package/dist/web/assets/tasks-BzeOsU08.js +1 -0
- package/dist/web/assets/tasks-ClShPUFW.js +1 -0
- package/dist/web/assets/usage-BMYuEDo9.js +1 -0
- package/dist/web/assets/use-open-run-B8nD_BT1.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +1 -0
- package/dist/web/assets/useControlled-B5kAMgo-.js +1 -0
- package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +1 -0
- package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +1 -0
- package/dist/web/assets/{workers-BWNVF5aS.js → workers-CDWbu1Tb.js} +1 -1
- package/dist/web/index.html +14 -15
- package/package.json +11 -11
- package/dist/web/assets/_agent-NYU8ZbHV.js +0 -1
- package/dist/web/assets/_loop-BjVObygk.js +0 -1
- package/dist/web/assets/_name-B6oTm1fE.js +0 -6
- package/dist/web/assets/_name-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/_name-D3Tep-4Y.js +0 -1
- package/dist/web/assets/_number-8w6uiYOA.js +0 -1
- package/dist/web/assets/_number-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/_run-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/_run-DbyRF4Hm.js +0 -5
- package/dist/web/assets/actions-BPHDKUD8.js +0 -1
- package/dist/web/assets/agents-BN4G7qse.js +0 -1
- package/dist/web/assets/ccount-8deXbw7O.js +0 -1
- package/dist/web/assets/code-block-B32s6oe9.js +0 -4
- package/dist/web/assets/collapsible-C9-9oo50.js +0 -1
- package/dist/web/assets/drawer-DYJv3cI2.js +0 -1
- package/dist/web/assets/dropdown-menu-BiC7TTLR.js +0 -1
- package/dist/web/assets/edit-and-retry-f_LbEfud.js +0 -1
- package/dist/web/assets/error-alert-B_2zeHFu.js +0 -1
- package/dist/web/assets/index-C-kJ1rRt.js +0 -10
- package/dist/web/assets/index-CdIl44fJ.css +0 -2
- package/dist/web/assets/label-badge-BE80XVOx.js +0 -1
- package/dist/web/assets/label-f_7LisR0.js +0 -1
- package/dist/web/assets/loops-D2E-MWMy.js +0 -1
- package/dist/web/assets/mark-mFortOAt.js +0 -1
- package/dist/web/assets/markdown-3NxaXixH.js +0 -29
- package/dist/web/assets/model-BTe4eohR.js +0 -1
- package/dist/web/assets/moves-Ci10cwSz.js +0 -1
- package/dist/web/assets/outcome-7cxhEvRx.js +0 -5
- package/dist/web/assets/queries-CCEL6uj9.js +0 -1
- package/dist/web/assets/queries-CiGD_2IE.js +0 -1
- package/dist/web/assets/reason-parts-DmsEA117.js +0 -1
- package/dist/web/assets/repositories-DdX53hco.js +0 -1
- package/dist/web/assets/route-BQYtlrWB.js +0 -1
- package/dist/web/assets/route-nKcGNWV5.js +0 -1
- package/dist/web/assets/routes-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/run-again-LTJXpcOt.js +0 -1
- package/dist/web/assets/section-BF7kbQsU.js +0 -24
- package/dist/web/assets/tasks-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/tasks-D8qgj3xb.js +0 -1
- package/dist/web/assets/usage-BmhM4Mev.js +0 -1
- package/dist/web/assets/use-open-run-D4GtXqIL.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-heUDjEK1.js +0 -1
- package/dist/web/assets/useSuspenseQuery-NLdoz0Gs.js +0 -1
- package/dist/web/assets/useTransitionStatus-Dpq86WgF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bn as e,Hn as t,Ot as n,ct as r,g as i,o as a,p as o}from"./strings-DXB6PB2g.js";import{i as s}from"./mark-uyeJ8aPC.js";var c=(n,r)=>{if(n.attempts.length===0)return e();let i=0;for(let t of n.attempts){let n=t.outcome===null?r:t.endedAt===null?NaN:Date.parse(t.endedAt);if(Number.isNaN(n))return e();i+=Math.max(0,n-Date.parse(t.startedAt))}return t(i)},l=n=>{let r=n.attempts.at(-1)?.outcome;return n.state===`Failed`&&r?._tag===`Failed`?t(r.failure):e()},u=e=>{let t=e.attempts.at(-1);return e.closedAt??t?.endedAt??t?.startedAt??e.openedAt},d=(e,t)=>{let n=new Set(t.items.map(({itemKey:e})=>e));return e.filter(({item:e})=>n.has(e.itemKey))},f=(e,t)=>d(e,t)[0]??null,p=({reason:e})=>`run`in e?e.run:null,m=e=>String(s(e).origin.number),h=({reason:e})=>n(e,{AwaitingApproval:()=>!0,WaitingForStop:()=>!0,QueuedForWorker:()=>!0,SuppressedForOperator:()=>!0,CycleBudgetUsedUp:()=>!0,RunFailed:({run:e})=>e.canResolveFailure,ClosedUnchanged:()=>!1,LoopPaused:()=>!1,AwaitingPoll:()=>!1}),g=(e,...t)=>[...e].reverse().find(({state:e})=>t.includes(e)),_=(e,t,n)=>{let i=g(e.runs,`Running`);if(i!==void 0)return{_tag:`Running`,run:i};let a=g(e.runs,`Waiting`);if(a!==void 0)return{_tag:`AwaitingApproval`,run:a};let o=g(e.runs,`Pending`,`Queued`);if(o!==void 0){let e=n.find(e=>p(e)?.id===o.id);return e===void 0?{_tag:`Queued`,run:o}:{_tag:`Stalled`,stall:e,run:o}}if(r(e.state))return{_tag:`Done`};let s=d(n,e),c=s.find(h);if(c!==void 0)return{_tag:`Stalled`,stall:c,run:p(c)??t};let[l]=s;return l===void 0?e.needsYou?{_tag:`NeedsAttention`}:{_tag:`Ended`,run:t}:{_tag:`Idle`,stall:l}},v=({status:e,last:t})=>{switch(e._tag){case`Running`:return[0,Date.parse(e.run.openedAt)];case`AwaitingApproval`:return[1,Date.parse(e.run.openedAt)];case`Queued`:case`Stalled`:return[2,Date.parse(e.run.openedAt)];case`Idle`:case`NeedsAttention`:case`Done`:case`Ended`:return[3,Date.parse(u(t))]}},y=(e,t)=>e.flatMap(({items:e})=>e).flatMap(e=>{let n=e.runs.at(-1);return n===void 0?[]:[{task:e,last:n,status:_(e,n,t)}]}).map(e=>({row:e,place:v(e)})).sort(({row:e,place:[t,n]},{row:r,place:[i,a]})=>t-i||a-n||r.task.number-e.task.number).map(({row:e})=>e),b=[`in flight`,`needs attention`,`done`],x=({task:e,status:t})=>{switch(t._tag){case`Running`:case`AwaitingApproval`:case`Queued`:case`Stalled`:return`in flight`;case`Idle`:return e.needsYou?`needs attention`:null;case`NeedsAttention`:return`needs attention`;case`Done`:return`done`;case`Ended`:return null}},S=e=>{let t=b.flatMap(t=>{let n=e.filter(e=>x(e)===t).length;return n===0?[]:[`${n} ${t}`]});return t.length===0?void 0:t.join(`, `)},C=(e,t)=>e.runningSince.reduce((e,n)=>e+Math.max(0,t-Date.parse(n)),e.durationMillis),w=e=>e.pools.some(({unpriced:e})=>e),T=(e,t)=>{let n=e.flatMap(({task:e})=>e.usage.cost===null?[]:[e.usage.cost]);return{runs:e.reduce((e,{task:t})=>e+t.runs.length,0),durationMillis:e.reduce((e,{task:n})=>e+C(n.usage,t),0),unmeasured:e.reduce((e,{task:t})=>e+t.usage.unmeasured,0),tokens:e.reduce((e,{task:t})=>e+t.usage.tokens,0),unpriced:e.some(({task:e})=>w(e.usage)),usd:n.length===0?null:n.reduce((e,{usd:t})=>e+t,0)}},E=`Some attempts have no recorded timing; the real figure is higher`,D=`Some sessions have no price yet; the real figure is higher`,O=e=>[{figure:String(e.runs),words:e.runs===1?`run`:`runs`,lowerBound:null},{figure:a(e.durationMillis),words:`elapsed`,lowerBound:e.unmeasured>0?E:null},{figure:o(e.tokens),words:`tokens`,lowerBound:null},...e.usd===null?[]:[{figure:i(e.usd),words:`estimated`,lowerBound:e.unpriced?D:null}]],k=e=>{let t=new Map;for(let{loop:n,state:r}of e.runs)t.set(n,r);return[...t].map(([e,t])=>({loop:e,state:t}))},A=e=>{switch(e){case`issue-comment`:return`Comment`;case`review`:return`Review`;case`review-comment`:return`Review comment`}};export{l as a,C as c,y as d,f,E as g,D as h,u as i,k as l,O as m,A as n,p as o,T as p,w as r,S as s,c as t,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{A as n,M as r}from"./page-C47YAWAl.js";import{u as i}from"./error-alert-hABzwCSY.js";import{L as a}from"./visuallyHidden-BUGCJ1D9.js";import{m as o,n as s}from"./overview-C73v5kbv.js";import{W as c}from"./button-4rhhIcK8.js";import{Dt as l,Tt as u,ct as d,v as f}from"./strings-DXB6PB2g.js";var p=t(e(),1),m=new Map([[`bold`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z`}))],[`duotone`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z`,opacity:`0.2`}),p.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`fill`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z`}))],[`light`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z`}))],[`regular`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`thin`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z`}))]]),h=p.forwardRef((e,t)=>p.createElement(c,{ref:t,...e,weights:m}));h.displayName=`ArrowSquareOutIcon`;var g=(e,t)=>t.canResolveFailure&&!e.items.some(({itemKey:e,state:n})=>e===t.itemKey&&d(n)),_=e=>{let t=[...e.runs].reverse().find(t=>g(e,t));if(t===void 0)return null;let n=t.attempts;for(let e=n.length-1;e>=0;--e){let r=n[e]?.outcome;if(r?._tag===`Failed`)return{run:t,message:o(r.failure)}}return null},v=new Set(u),y=e=>{let t=e.run;return t!==null&&(v.has(t.state)||g(e,t))?t:null},b=e=>{let t=e.attempts.at(-1);switch(e.state){case`Pending`:case`Waiting`:case`Queued`:return e.openedAt;case`Running`:return t!==void 0&&t.outcome===null?t.startedAt:null;case`Failed`:return t?.endedAt??null;case`Succeeded`:case`Canceled`:return null}},x=(e,t)=>{let n=new Set(t._tag===`WritableBoardLane`?t.labels:[]);for(let e of t.sources)`label`in e&&n.add(e.label);return e.labels.filter(e=>!n.has(e))},S=e=>e===`saving`?`Moving…`:`Saved on GitHub · syncing…`,C=e=>[`board-moves`,e],w=(e,t)=>{if(e.phase===`saving`)return!0;let n=t.flatMap(({items:e})=>e).find(({itemKey:t})=>t===e.itemKey);if(n===void 0||n.state!==e.source.state)return!1;let r=n.labels.filter(t=>e.laneLabels.includes(t));return r.length===e.source.labels.length&&r.every(t=>e.source.labels.includes(t))},T=e=>{let t=r(),{data:o=[]}=a({queryKey:C(e.repository),queryFn:n,initialData:[],gcTime:1/0}),c=(e,n)=>t.setQueryData(C(e),(e=[])=>n(e)),u=o.filter(t=>w(t,e.board.lanes));a({...s(),enabled:u.length>0,refetchInterval:1e3}),(0,p.useEffect)(()=>{t.setQueryData(C(e.repository),t=>{let n=t?.filter(t=>w(t,e.board.lanes));return n?.length===t?.length?t:n})},[t,e.repository,e.board.lanes,o]);let d=i({mutationFn:({repository:e,item:t,toLane:n})=>{let{owner:r,name:i}=l(e);return f(e=>e.moveBoardItem({params:{owner:r,repository:i,item:t},payload:{toLane:n}}))},onSuccess:(e,{repository:n,itemKey:r})=>(c(n,e=>e.map(e=>e.itemKey===r?{...e,phase:`syncing`}:e)),t.invalidateQueries({queryKey:s().queryKey})),onError:(e,{repository:n,itemKey:r})=>(c(n,e=>e.filter(e=>e.itemKey!==r)),t.invalidateQueries({queryKey:s().queryKey}))}),m=(t,n)=>{let r=e.board.lanes.find(({items:e})=>e.some(({itemKey:e})=>e===t.itemKey)),i=r?.items.find(({itemKey:e})=>e===t.itemKey);if(n._tag!==`WritableBoardLane`||i===void 0||r?.id===n.id||u.some(({itemKey:e})=>e===t.itemKey))return;let a=e.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[]);c(e.repository,e=>[...e,{itemKey:t.itemKey,toLane:n.id,source:{state:i.state,labels:i.labels.filter(e=>a.includes(e))},laneLabels:a,phase:`saving`}]),d.mutate({repository:e.repository,itemKey:t.itemKey,item:t.number,toLane:n.id})},h=d.variables?.repository===e.repository;return{moves:u,moveItem:m,isPending:h&&d.isPending,error:h?d.error:null}};export{b as a,y as i,S as n,_ as o,x as r,h as s,T as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{D as r,W as i}from"./button-4rhhIcK8.js";var a=n(e(),1),o=new Map([[`bold`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),a.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,a.createElement(a.Fragment,null,a.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),s=a.forwardRef((e,t)=>a.createElement(i,{ref:t,...e,weights:o}));s.displayName=`CaretDownIcon`;var c=t();function l({className:e,...t}){return(0,c.jsx)(`textarea`,{"data-slot":`textarea`,className:r(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-card px-2 py-2 text-sm caret-primary transition-[color,border-color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring/70 focus-visible:ring-2 focus-visible:ring-ring/25 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/25`,e),...t})}function u({className:e,...t}){return(0,c.jsx)(`label`,{"data-slot":`label`,className:r(`flex items-center gap-2 text-xs/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function d({className:e,size:t=`default`,...n}){return(0,c.jsxs)(`div`,{className:r(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,c.jsx)(`select`,{"data-slot":`native-select`,"data-size":t,className:`h-7 w-full min-w-0 appearance-none rounded-md border border-input bg-input/20 py-0.5 pr-6 pl-2 text-xs/relaxed transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-[size=sm]:h-6 data-[size=sm]:text-xs dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,...n}),(0,c.jsx)(s,{className:`pointer-events-none absolute top-1/2 right-1.5 size-3.5 -translate-y-1/2 text-muted-foreground select-none group-data-[size=sm]/native-select:size-3 group-data-[size=sm]/native-select:-translate-y-[calc(--spacing(1.25))]`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function f({className:e,...t}){return(0,c.jsx)(`option`,{"data-slot":`native-select-option`,className:r(`bg-[Canvas] text-[CanvasText]`,e),...t})}export{s as a,l as i,f as n,u as r,d 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-C73v5kbv.js";import{t as n}from"./link-C7GfYrMt.js";import{t as r}from"./boot-screen-Su4MyrBh.js";import{t as i}from"./button-4rhhIcK8.js";var a=`Task not found`,o=(e,t)=>`#${t} is not among the newest items on the ${e} board`,s=`Back to the board`,c=e(),l=({repository:e,number:l})=>(0,c.jsx)(r,{title:a,description:o(e,l),tone:`error`,inPanel:!0,children:(0,c.jsx)(i,{variant:`outline`,nativeButton:!1,render:(0,c.jsx)(n,{to:`/projects/$owner/$name`,params:t(e)}),children:s})});export{l as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{n as r,r as i}from"./page-C47YAWAl.js";import{l as a,t as o}from"./error-alert-hABzwCSY.js";import{M as s,N as c,_ as l,b as u,h as d,m as f,p,w as m,y as ee}from"./overview-C73v5kbv.js";import{a as te,i as ne,n as re}from"./actions-CG0hkpe7.js";import{d as ie,i as ae,n as oe,r as se,t as ce,u as le}from"./dropdown-menu-BHKHYfLs.js";import{D as ue,W as h,t as g}from"./button-4rhhIcK8.js";import{An as _,Bn as v,Bt as y,Fn as de,Hn as b,It as fe,Kt as pe,Ln as me,Lt as he,Mn as x,Mt as ge,Nn as S,Nt as _e,Ot as C,P as ve,Pn as ye,Qt as be,Rn as w,Rt as xe,Un as Se,Ut as Ce,Vn as T,Vt as E,Yt as D,an as we,cn as Te,f as O,jn as k,kn as Ee,kt as A,n as De,nn as j,o as M,r as N,zn as P,zt as Oe}from"./strings-DXB6PB2g.js";import{i as ke,o as Ae,s as je}from"./mark-uyeJ8aPC.js";import{at as Me,ot as Ne,rt as Pe}from"./index-Dki55xSv.js";import{t as F}from"./use-now-vNgLntlV.js";import{t as Fe}from"./heading-zIOXe3qT.js";import{t as Ie}from"./pull-request-marks-B4f7z4xa.js";import{n as I}from"./status-badge-CLPsMXtK.js";import{n as Le}from"./usage-BMYuEDo9.js";import{t as Re}from"./markdown-BNebzGGH.js";var L=n(e(),1),ze=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M188,86.11V84c0-14.62-10.83-27.55-30.51-36.4C140.87,40.12,119,36,96,36S51.13,40.12,34.51,47.6C14.83,56.45,4,69.38,4,84v40c0,14.62,10.83,27.55,30.51,36.4A131.67,131.67,0,0,0,68,169.88V172c0,14.62,10.83,27.55,30.51,36.4C115.13,215.88,137,220,160,220s44.87-4.12,61.49-11.6C241.17,199.55,252,186.62,252,172V132C252,109.86,226.71,92.08,188,86.11ZM228,132c0,7.75-21.77,22.48-61.81,23.88C180.33,147.4,188,136.3,188,124V110.44C213.88,115.15,228,125.48,228,132ZM107.37,147.63c-3.63.24-7.42.37-11.37.37-5.08,0-9.89-.22-14.43-.61a10.94,10.94,0,0,0-1.14-.09c-1.51-.14-3-.3-4.43-.48V130.93A187,187,0,0,0,96,132a187,187,0,0,0,20-1.07v15.89c-2.49.3-5.07.56-7.75.75C108,147.58,107.66,147.6,107.37,147.63ZM164,117.14V124c0,4.78-8.28,12.21-24,17.54v-15a115.32,115.32,0,0,0,17.49-6.13Q160.93,118.86,164,117.14ZM96,60c44,0,68,15.85,68,24s-24,24-68,24S28,92.15,28,84,52,60,96,60ZM28,124v-6.86q3.08,1.71,6.51,3.26A115.32,115.32,0,0,0,52,126.53v15C36.28,136.21,28,128.78,28,124Zm64,48v0c1.33,0,2.66,0,4,0q5.44,0,10.77-.32,4.45,1.57,9.23,2.86v15C100.28,184.21,92,176.78,92,172Zm48,22.82V178.94A186.45,186.45,0,0,0,160,180a187,187,0,0,0,20-1.07v15.89a170.08,170.08,0,0,1-40,0Zm64-5.28v-15a115.32,115.32,0,0,0,17.49-6.13q3.44-1.54,6.51-3.26V172C228,176.78,219.72,184.21,204,189.54Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,132c0,19.88-35.82,36-80,36-19.6,0-37.56-3.17-51.47-8.44h0C146.76,156.85,176,142,176,124V96.72h0C212.52,100.06,240,114.58,240,132ZM176,84c0-19.88-35.82-36-80-36S16,64.12,16,84s35.82,36,80,36S176,103.88,176,84Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM232,132c0,13.22-30.79,28-72,28-3.73,0-7.43-.13-11.08-.37C170.49,151.77,184,139,184,124V105.74C213.87,110.19,232,122.27,232,132ZM72,150.25V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54v23.79A163,163,0,0,1,96,152,163,163,0,0,1,72,150.25Zm96-40.32V124c0,8.39-12.41,17.4-32,22.87V123.5C148.91,120.37,159.84,115.71,168,109.93ZM96,56c41.21,0,72,14.78,72,28s-30.79,28-72,28S24,97.22,24,84,54.79,56,96,56ZM24,124V109.93c8.16,5.78,19.09,10.44,32,13.57v23.37C36.41,141.4,24,132.39,24,124Zm64,48v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41v23.46C100.41,189.4,88,180.39,88,172Zm48,26.25V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54v23.79a165.45,165.45,0,0,1-48,0Zm64-3.38V171.5c12.91-3.13,23.84-7.79,32-13.57V172C232,180.39,219.59,189.4,200,194.87Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM56,146.87C36.41,141.4,24,132.39,24,124V109.93c8.16,5.78,19.09,10.44,32,13.57Zm80-23.37c12.91-3.13,23.84-7.79,32-13.57V124c0,8.39-12.41,17.4-32,22.87Zm-16,71.37C100.41,189.4,88,180.39,88,172v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41Zm0-44.62A163,163,0,0,1,96,152a163,163,0,0,1-24-1.75V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54Zm64,48a165.45,165.45,0,0,1-48,0V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54ZM232,172c0,8.39-12.41,17.4-32,22.87V171.5c12.91-3.13,23.84-7.79,32-13.57Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.56,103.81C213.43,97.75,198.47,93.39,182,91.34V84c0-12.12-9.58-23.1-27-30.93C139.16,45.93,118.2,42,96,42S52.84,45.93,37,53.07C19.58,60.9,10,71.88,10,84v40c0,12.12,9.58,23.1,27,30.93,10.49,4.72,23.21,8,37,9.73V172c0,12.12,9.58,23.1,27,30.93C116.84,210.07,137.8,214,160,214s43.16-3.93,59-11.07c17.39-7.83,27-18.81,27-30.93V132C246,121.35,238.39,111.34,224.56,103.81Zm-5.74,10.54C228.61,119.68,234,126,234,132c0,14.19-30.39,30-74,30a166.9,166.9,0,0,1-21.21-1.34A110.79,110.79,0,0,0,155,154.93c17.39-7.83,27-18.81,27-30.93V103.43C196.4,105.36,209.3,109.16,218.82,114.35ZM108.16,153.58c-3.92.27-8,.42-12.16.42-5.3,0-10.4-.24-15.28-.67a2.22,2.22,0,0,0-.37,0c-3.58-.33-7-.77-10.35-1.3V124.12A178,178,0,0,0,96,126a178,178,0,0,0,26-1.88V152c-4.34.69-8.91,1.22-13.69,1.56ZM170,105.89V124c0,9.54-13.75,19.8-36,25.51V121.85a115,115,0,0,0,21-6.92A66.2,66.2,0,0,0,170,105.89ZM96,54c43.61,0,74,15.81,74,30s-30.39,30-74,30S22,98.19,22,84,52.39,54,96,54ZM22,124V105.89a66.2,66.2,0,0,0,15,9,115,115,0,0,0,21,6.92v27.66C35.75,143.8,22,133.54,22,124Zm64,48v-6.28c3.3.18,6.63.28,10,.28q5.91,0,11.66-.37A123.17,123.17,0,0,0,122,169.84v27.67C99.75,191.8,86,181.54,86,172Zm48,28V172.1a177.84,177.84,0,0,0,26,1.9,178,178,0,0,0,26-1.88V200a170,170,0,0,1-52,0Zm64-2.49V169.85a115,115,0,0,0,21-6.92,66.2,66.2,0,0,0,15-9V172C234,181.54,220.25,191.8,198,197.51Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM232,132c0,13.22-30.79,28-72,28-3.73,0-7.43-.13-11.08-.37C170.49,151.77,184,139,184,124V105.74C213.87,110.19,232,122.27,232,132ZM72,150.25V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54v23.79A163,163,0,0,1,96,152,163,163,0,0,1,72,150.25Zm96-40.32V124c0,8.39-12.41,17.4-32,22.87V123.5C148.91,120.37,159.84,115.71,168,109.93ZM96,56c41.21,0,72,14.78,72,28s-30.79,28-72,28S24,97.22,24,84,54.79,56,96,56ZM24,124V109.93c8.16,5.78,19.09,10.44,32,13.57v23.37C36.41,141.4,24,132.39,24,124Zm64,48v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41v23.46C100.41,189.4,88,180.39,88,172Zm48,26.25V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54v23.79a165.45,165.45,0,0,1-48,0Zm64-3.38V171.5c12.91-3.13,23.84-7.79,32-13.57V172C232,180.39,219.59,189.4,200,194.87Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180,93.11V84c0-22.43-36.9-40-84-40S12,61.57,12,84v40c0,19.14,26.86,34.72,64,38.89V172c0,22.43,36.9,40,84,40s84-17.57,84-40V132C244,113.12,217.87,97.37,180,93.11ZM236,132c0,15.45-30.54,32-76,32a165.71,165.71,0,0,1-28-2.34v-1.39c28.61-6.31,48-20,48-36.27V101.17C212.22,105,236,117.93,236,132ZM108.19,155.59Q102.3,156,96,156c-5.47,0-10.72-.25-15.73-.69l-.27,0h0c-4.16-.38-8.16-.9-12-1.56V121.8A174.87,174.87,0,0,0,96,124a174.87,174.87,0,0,0,28-2.2v31.92a155,155,0,0,1-15.52,1.85ZM172,101.32V124c0,10.88-15.16,22.3-40,28.11V120.27C149.63,116.38,163.75,109.69,172,101.32ZM96,52c45.46,0,76,16.55,76,32s-30.54,32-76,32S20,99.45,20,84,50.54,52,96,52ZM20,124V101.32c8.25,8.37,22.37,15.06,40,19v31.84C35.16,146.3,20,134.88,20,124Zm64,48v-8.4c3.91.26,7.92.4,12,.4s8.06-.14,12-.39a123.93,123.93,0,0,0,16,4.63v31.87C99.16,194.3,84,182.88,84,172Zm48,29.72V169.77A174.48,174.48,0,0,0,160,172a174.87,174.87,0,0,0,28-2.2v31.92a173.07,173.07,0,0,1-56,0ZM236,172c0,10.88-15.16,22.3-40,28.11V168.27c17.63-3.89,31.75-10.58,40-19Z`}))]]),Be=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,44a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,44Zm0,168a72,72,0,1,1,72-72A72.08,72.08,0,0,1,128,212ZM164.49,99.51a12,12,0,0,1,0,17l-28,28a12,12,0,0,1-17-17l28-28A12,12,0,0,1,164.49,99.51ZM92,16A12,12,0,0,1,104,4h48a12,12,0,0,1,0,24H104A12,12,0,0,1,92,16Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,136a88,88,0,1,1-88-88A88,88,0,0,1,216,136Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm45.66,61.66-40,40a8,8,0,0,1-11.32-11.32l40-40a8,8,0,0,1,11.32,11.32ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,42a94,94,0,1,0,94,94A94.11,94.11,0,0,0,128,42Zm0,176a82,82,0,1,1,82-82A82.1,82.1,0,0,1,128,218ZM172.24,91.76a6,6,0,0,1,0,8.48l-40,40a6,6,0,1,1-8.48-8.48l40-40A6,6,0,0,1,172.24,91.76ZM98,16a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,16Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,44a92,92,0,1,0,92,92A92.1,92.1,0,0,0,128,44Zm0,176a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,220ZM170.83,93.17a4,4,0,0,1,0,5.66l-40,40a4,4,0,1,1-5.66-5.66l40-40A4,4,0,0,1,170.83,93.17ZM100,16a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,16Z`}))]]),Ve=L.forwardRef((e,t)=>L.createElement(h,{ref:t,...e,weights:ze}));Ve.displayName=`CoinsIcon`;var He=L.forwardRef((e,t)=>L.createElement(h,{ref:t,...e,weights:Be}));He.displayName=`TimerIcon`;var Ue=E({number:xe,title:y,url:y,state:y,body:j(he(y)),author:j(he(E({login:y}))),labels:j(E({nodes:A(E({name:y}))}))}),We=Ce(ve),Ge=pe(Ue),R=e=>w(Ge(e),e=>({kind:e.url.includes(`/pull/`)?`Pull request`:`Issue`,number:e.number,title:e.title,url:e.url,state:e.state.charAt(0)+e.state.slice(1).toLowerCase(),author:x(e.author?.login),labels:e.labels?.nodes.map(({name:e})=>e)??[],body:_(x(e.body),e=>e.trim()!==``)})),Ke=new Map([[`Issue Open`,`issue-open`],[`Issue Closed`,`issue-closed`],[`Pull request Open`,`pr-open`],[`Pull request Closed`,`pr-closed`],[`Pull request Merged`,`pr-merged`]]),qe=({kind:e,number:t,url:n,state:r})=>({kind:e===`Pull request`?`pr`:`issue`,number:t,url:n,state:Ke.get(`${e} ${r}`)??null}),Je=(e,t,n)=>w(We(e.itemKey),([,r,i])=>{let a=de(k(je(t,e.itemKey),({items:t})=>x(t.find(({itemKey:t})=>t===e.itemKey)))),o=de(_(n===void 0?v():R(n),e=>e.number===i));return{number:i,url:a?.url??o?.url??`https://github.com/${r}/issues/${i}`,title:x(a?.title??o?.title),pullRequest:a===void 0?o?.kind===`Pull request`:a.kind===`pr`}}),Ye=(e,t)=>P(R(t),{onNone:()=>`Opened by ${e}`,onSome:({kind:t,number:n,state:r,labels:i})=>`${e} matched ${t.toLowerCase()} #${n}: ${r.toLowerCase()}${i.length===0?``:`, labeled ${i.join(`, `)}`}`}),Xe=(e,t,n,r)=>{let i=w(n,ke),a=P(n,{onNone:()=>[],onSome:({items:e})=>e}),o=k(x(e.pullRequestUrl),e=>Ae(e,a)),s=w(t,({number:e,url:t,pullRequest:n})=>a.find(t=>t.number===e)??{kind:r===null?n||Ee(o,t=>t.number===e)?`pr`:`issue`:r.startsWith(`pr-`)?`pr`:`issue`,number:e,url:t,state:r}),c=P(i,{onNone:()=>s,onSome:({origin:e})=>b(e)});return{heading:c,title:w(i,({origin:e})=>e.title),pullRequest:_(T(o,()=>_(s,({kind:e})=>e===`pr`)),e=>!Ee(c,({number:t})=>t===e.number))}},z=t(),Ze=(e,t)=>S(k(t,({title:e})=>e),()=>`${e.loop} on ${e.repository}`),Qe=({endedMillis:e,since:t})=>{let n=F(1e3);return(0,z.jsx)(z.Fragment,{children:M(e+Math.max(0,n-Date.parse(t)))})},$e=({duration:e})=>(0,z.jsxs)(`span`,{title:e.unmeasured===0?`Total attempt time`:`${e.unmeasured} ${e.unmeasured===1?`attempt`:`attempts`} not counted: no recorded end time`,className:`font-mono text-xs tabular-nums`,children:[e.unmeasured>0&&`at least `,e.runningSince===null?M(e.endedMillis):(0,z.jsx)(Qe,{endedMillis:e.endedMillis,since:e.runningSince})]}),et=({detail:e})=>{let{machine:t,run:n}=e;return t===null||t.state!==`ready`||t.id===null||t.attemptId===null||t.attemptId!==n.attempts.at(-1)?.id?null:(0,z.jsx)(`span`,{className:`font-mono text-xs`,title:`${s[t.provider]} ${c[t.provider]} ${t.id}`,children:t.id})},tt=({detail:e,overview:t,placement:n,shared:a,actions:o,as:s,className:c})=>{let{run:l}=e,u=Je(l,t,e.eventPayload),d=Xe(l,u,je(t,l.itemKey),e.settledItemState);return(0,z.jsx)(i,{actionsBeside:n===`page`?`lg`:`never`,...c===void 0?{}:{className:c},eyebrow:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{icon:Ne,title:`Loop`,children:l.loop}),(0,z.jsx)(r,{icon:Pe,title:`Agent`,children:l.agent})]}),heading:(0,z.jsx)(Fe,{variant:`page`,item:d.heading,title:S(d.title,()=>Ze(l,u)),...s===void 0?{}:{as:s},...a?{style:{viewTransitionName:`run-title`}}:{}}),facts:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2 font-medium text-foreground`,style:a?{viewTransitionName:`run-state`}:void 0,children:[(0,z.jsx)(I,{state:l.state}),m(l,e.unconfirmedStop,e.machine)]}),(0,z.jsx)(Ie,{pullRequests:Se(d.pullRequest)}),e.worker!==null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{icon:He,children:(0,z.jsx)($e,{duration:e.duration})}),n===`page`&&e.usage.sessions.length>0&&(0,z.jsx)(r,{icon:Ve,children:(0,z.jsx)(Le,{usage:e.usage,attempts:l.attempts})}),(0,z.jsxs)(r,{icon:Me,title:`Worker`,children:[e.worker,(0,z.jsx)(et,{detail:e})]})]}),l.loopPaused&&(0,z.jsx)(`span`,{children:`Loop paused`})]}),actions:o})},B=e=>C(e,{Approve:()=>u.approve,Retry:()=>u.retry,EditRetry:()=>`Edit and retry`,RunAgain:()=>u.runAgain,EditRunAgain:()=>`Edit and run again`,Resolve:({question:e})=>e?`Mark answered`:`Mark resolved`,Cancel:()=>u.cancel}),nt=e=>{let t=e.attempts.at(-1),n=t?.outcome?._tag===`Failed`?t.outcome.failure._tag:null,r=[...e.canApprove?[{_tag:`Approve`}]:[],...e.canRetry?[{_tag:`Retry`},{_tag:`EditRetry`}]:[],...e.canRunAgain?[{_tag:`RunAgain`},{_tag:`EditRunAgain`}]:[],...e.canResolveFailure&&t!==void 0?[{_tag:`Resolve`,attemptId:t.id,question:n===`QuestionFailure`}]:[],...e.canCancel?[{_tag:`Cancel`}]:[]],i=e=>e.flatMap(e=>r.filter(t=>t._tag===e)),a=(()=>{if(e.canApprove){let[e=null]=i([`Approve`]);return{primary:e,secondary:null,more:i([`Cancel`])}}if(e.state===`Failed`){let t=e.canResolveFailure&&(n===`QuestionFailure`||n===`BlockedFailure`),[r=null,a=null,...o]=i(t?[`Resolve`,`EditRetry`,`Retry`]:[`Retry`,`EditRetry`,`Resolve`]);return{primary:r,secondary:a,more:o}}let[t=null,...r]=i(e.canRunAgain?[`RunAgain`,`EditRunAgain`]:[`Cancel`]);return{primary:null,secondary:t,more:r}})(),o=new Set([a.primary,a.secondary,...a.more]);return{...a,more:[...a.more,...r.filter(e=>!o.has(e))]}},rt=({detail:e,onEdit:t,openRun:n,className:r})=>{let{run:i,agentDefinitionChanged:a}=e,s=(0,L.useId)(),c=ne(),l=te(),[d,f]=(0,L.useState)(!1),p=c.isPending||l.isPending,m=e=>c.mutate({runId:i.id,request:e},{onSuccess:()=>f(!1)}),h=e=>C(e,{Approve:()=>m({action:`approve`}),Retry:()=>m({action:`retry`}),EditRetry:()=>t(`retry`),RunAgain:()=>l.mutate(re(i),{onSuccess:e=>{e._tag===`Claimed`&&n(e.runId)}}),EditRunAgain:()=>t(`runAgain`),Resolve:({attemptId:e})=>m({action:`resolveFailure`,attemptId:e}),Cancel:()=>f(!0)}),{primary:_,secondary:v,more:y}=nt(i);return _===null&&v===null&&y.length===0?null:(0,z.jsxs)(`div`,{className:ue(`max-w-sm space-y-2`,r),children:[(0,z.jsx)(`div`,{role:`group`,"aria-label":`Run actions`,className:`flex flex-wrap items-center gap-2`,children:d?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(g,{variant:`destructive`,disabled:p,onClick:()=>m({action:`cancel`}),children:u.confirmCancel}),(0,z.jsx)(g,{variant:`ghost`,disabled:p,onClick:()=>f(!1),children:u.keepRunning})]}):(0,z.jsxs)(z.Fragment,{children:[_!==null&&(0,z.jsx)(g,{disabled:p,"aria-describedby":_._tag===`Retry`?s:void 0,onClick:()=>h(_),children:B(_)}),v!==null&&(0,z.jsx)(g,{variant:v._tag===`Cancel`?`ghost`:`outline`,disabled:p,"aria-describedby":v._tag===`Retry`?s:void 0,onClick:()=>h(v),children:B(v)}),y.length>0&&(0,z.jsxs)(ce,{children:[(0,z.jsx)(le,{disabled:p,render:(0,z.jsx)(g,{variant:`ghost`,size:`icon`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`More actions`,children:(0,z.jsx)(ie,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,z.jsx)(oe,{align:`end`,className:`w-auto min-w-44`,children:(0,z.jsx)(se,{children:y.map(e=>(0,z.jsx)(ae,{"aria-describedby":e._tag===`Retry`?s:void 0,variant:e._tag===`Cancel`?`destructive`:`default`,onClick:()=>h(e),children:B(e)},e._tag))})})]})]})}),i.canRetry&&(0,z.jsxs)(`div`,{className:`space-y-1 text-xs wrap-anywhere text-muted-foreground`,children:[(0,z.jsx)(`p`,{id:s,children:ee(i.agentBrain)}),a&&(0,z.jsxs)(`p`,{children:[`The loaded definition of `,i.agent,` has changed. Edit and retry uses the current definition.`]})]}),l.data?._tag===`CycleBlocked`&&(0,z.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),c.isError&&(0,z.jsx)(o,{message:c.error.message}),l.isError&&(0,z.jsx)(o,{message:l.error.message})]})},it=(e,t,n)=>{let r=new Set(e.map(({sequence:e})=>e)),i=[...new Map([...t,...e].map(e=>[e.sequence,e])).values()].sort((e,t)=>e.sequence-t.sequence),a=new Map,o=new Map,s=(e,t)=>JSON.stringify([e,t]);for(let e of i){let t=e.payload;if(t._tag!==`SessionEvent`)continue;let i=t.event;if(i._tag===`PoolRateLimitsUpdated`||i._tag===`SessionTokensUpdated`)continue;let c=s(e.attemptId,i.session.id),l=a.get(c);l===void 0&&(l={attemptId:e.attemptId,session:i.session,first:e,harnessSession:v(),latestSequence:e.sequence,status:n.has(e.attemptId)?`Stopped`:`Live`,held:!1,paused:!1,idle:!1,events:[],interventions:[]},a.set(c,l),i.session._tag===`ParentSession`&&o.set(e.attemptId,l)),l.latestSequence=e.sequence,i._tag===`SessionStarted`&&(l.harnessSession=i.harnessSession),i._tag===`SessionFinished`&&(l.status=`Finished`),i._tag===`SessionIdle`&&(l.idle=!0),i._tag===`SessionResumed`&&(l.idle=!1),r.has(e.sequence)&&l.events.push({sequence:e.sequence,receivedAt:e.receivedAt,event:i})}let c=[],l=(e,t)=>JSON.stringify([e,t.inputSequence]),u=new Map;for(let{attemptId:e,payload:t}of i)(t._tag===`InterventionApplied`||t._tag===`InterventionRejected`)&&u.set(l(e,t),t);let d=new Set;for(let e of i){let t=e.payload;if(t._tag!==`InterventionApplied`&&t._tag!==`InterventionRejected`)continue;let n=l(e.attemptId,t),i={...e,payload:u.get(n)??t},f=t.intervention.target,p=f._tag===`Parent`?o.get(e.attemptId):a.get(s(e.attemptId,f.sessionId)),m=r.has(e.sequence)&&!d.has(n);m&&d.add(n),p===void 0?m&&c.push(i):(e.sequence>p.latestSequence&&(p.latestSequence=e.sequence),t._tag===`InterventionApplied`&&(p.held=t.state.held,p.paused=t.state.paused),m&&p.interventions.push(i))}return{groups:a,unmatched:c}},V=e=>({key:`event:${e.sequence}`,attemptId:e.attemptId,sequence:e.sequence,latestSequence:e.sequence,receivedAt:e.receivedAt}),H=(e,t,n)=>({_tag:`Notice`,...V(e),...t,origin:n,queued:null}),U=e=>`${e} ${e===1?`retry`:`retries`}`,at=(e,t)=>{let n=[],r=new Map;for(let i of e.events){let a=i.event,o={...i,attemptId:e.attemptId};if(a._tag===`ToolStarted`||a._tag===`ToolFinished`){let n=JSON.stringify([e.attemptId,e.session.id,a.callId]),s=r.get(n),c=s?.start??v();r.set(n,{_tag:`Tool`,...V(o),key:n,sequence:s?.sequence??i.sequence,receivedAt:s?.receivedAt??i.receivedAt,name:a.tool,start:a._tag===`ToolStarted`?b({receivedAt:i.receivedAt,input:a.input}):c,state:a._tag===`ToolFinished`?{_tag:a.isError?`Error`:`Finished`,receivedAt:i.receivedAt,output:a.output}:s?.state??{_tag:t===`Live`?`Running`:`Stopped`}});continue}if(a._tag===`ProviderRetrying`||a._tag===`ProviderRecovered`){n.push(H(o,a._tag===`ProviderRetrying`?{kind:`status`,label:`${e.session.agent}: provider unreachable`,detail:a.message,format:`plain`,tone:`warning`}:{kind:`status`,label:`${e.session.agent}: provider reachable again`,detail:`After ${U(a.retries)}`,format:`plain`,tone:`plain`},{_tag:`Provider`,session:e.session,event:a}));continue}let s=C(a,{TextOutput:({text:t})=>({kind:`message`,label:e.session.agent,detail:t,format:`markdown`,tone:`plain`}),SessionStarted:()=>({kind:`status`,label:`${e.session.agent} started`,detail:De(e.session.brain),format:`plain`,tone:`plain`}),SessionIdle:()=>({kind:`status`,label:`${e.session.agent} idle`,detail:`Session open for operator input`,format:`plain`,tone:`plain`}),SessionResumed:()=>({kind:`status`,label:`${e.session.agent} resumed`,detail:``,format:`plain`,tone:`plain`}),SessionFinished:()=>({kind:`status`,label:`${e.session.agent} finished`,detail:``,format:`plain`,tone:`plain`})});n.push(H(o,s,{_tag:`Session`,session:e.session,event:a._tag}))}return[...n,...r.values()].sort((e,t)=>e.sequence-t.sequence)},ot=e=>{let{action:t,operator:n,target:r}=e.payload.intervention,i=e.payload._tag===`InterventionRejected`,a=t._tag===`OperatorMessage`||t._tag===`Steer`,o=e.payload._tag===`InterventionApplied`&&e.payload.state.queued?r._tag===`Parent`?`parent`:`child`:null,s=`${n} released the ${r._tag===`Parent`?`parent`:`child`}`;return{...H(e,{kind:a?`message`:`status`,label:i?`${n} · not delivered`:a?n:t._tag===`Release`?s:`${n} paused the session`,detail:i?`${a?`${t.message}\n\n`:``}${e.payload.message}`:a?t.message:``,format:a?`markdown`:`plain`,tone:i?`failed`:`plain`},{_tag:`Operator`,operator:n}),queued:o}},st=(e,t,n=[])=>{let r=new Set(t.filter(({outcome:e})=>e!==null).map(({id:e})=>e));for(let{attemptId:t,payload:n}of e)(n._tag===`Final`||n._tag===`Failed`||n._tag===`Interrupted`)&&r.add(t);let{groups:i,unmatched:a}=it(e,n,r),o=[];for(let t of[...e].sort((e,t)=>e.sequence-t.sequence)){let e=t.payload;e._tag!==`InterventionApplied`&&e._tag!==`InterventionRejected`&&(t.direction!==`inbound`||t.operator===void 0||e._tag===`Cancel`)&&e._tag!==`SessionEvent`&&o.push(H(t,C(e,{Started:({parentModel:e,conflictingSalvage:t})=>({kind:`status`,label:`Attempt started`,detail:P(t,{onNone:()=>e,onSome:t=>`${e}. ${p(t)}`}),format:`plain`,tone:`plain`}),Final:({result:e})=>({kind:`status`,label:`Attempt finished`,detail:e.message,format:`markdown`,tone:`plain`}),Failed:({failure:e})=>({kind:`status`,label:`Attempt failed`,detail:f(e),format:`plain`,tone:`failed`}),Cancel:()=>({kind:`status`,label:`Cancel requested`,detail:`Attempt stopping`,format:`plain`,tone:`plain`}),Interrupted:()=>({kind:`status`,label:`Interrupted`,detail:`Acknowledged by the parent session`,format:`plain`,tone:`plain`}),Steer:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Interrupt:()=>({kind:`status`,label:`Interrupt requested`,detail:`Sent by the operator`,format:`plain`,tone:`plain`}),OperatorMessage:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Release:()=>({kind:`status`,label:`Released`,detail:`Held child released by the operator`,format:`plain`,tone:`plain`}),WorkerUnresponsive:({worker:e,lastAnsweredAt:t,reason:n})=>({kind:`status`,label:`${e} silent since ${N(we(t))}`,detail:n,format:`plain`,tone:`warning`}),WorkerResponsive:({worker:e,lastAnsweredAt:n,recovered:r})=>({kind:`status`,label:r?`${e} answering again`:`${e} answering`,detail:r?`Silent for ${M(Date.parse(t.receivedAt)-Te(n))}`:``,format:`plain`,tone:`plain`})}),{_tag:`Envelope`,payload:e}))}let s=[];for(let[e,t]of i)s.push({_tag:`Session`,...V(t.first),key:e,latestSequence:t.latestSequence,session:t.session,harnessSession:t.harnessSession,status:t.status,held:t.status===`Live`&&t.held,paused:t.status===`Live`&&t.paused,idle:t.status===`Live`&&t.idle,entries:[...at(t,t.status),...t.interventions.map(e=>ot(e))].sort((e,t)=>e.sequence-t.sequence)});return o.push(...a.map(e=>{let t=ot(e),n=e.payload.intervention.target;return{...t,label:`${t.label} · ${n._tag===`Parent`?`parent`:n.sessionId}`}})),{sessions:s,terminalAttempts:r,items:[...o,...s.flatMap(e=>e.session._tag===`ChildSession`?[e]:e.entries)].sort((e,t)=>e.sequence-t.sequence)}},ct=e=>{if(e.status!==`Live`)return e.status;if(e.paused)return`Paused`;if(e.held)return e.idle?`Held, waiting for input`:`Held, working`;if(e.idle)return`Waiting for input`;let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);return t?._tag===`Tool`?`Running ${t.name}`:`Working`},W=Oe(y,_e),lt=E({type:fe([`text`,`inputText`]),text:y}),G=e=>D(W)(e)?e:{},K=e=>D(y)(e)?e:void 0,ut=e=>{if(e===`cwd`)return`Working directory`;if(e===`durationMs`)return`Duration (ms)`;let t=e.replace(/([a-z])([A-Z])/gu,`$1 $2`).replaceAll(`_`,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},q=(e,t,n=`text`)=>({_tag:`Code`,label:e,text:t,language:n}),J=(e,t,n=[])=>{let r=Object.entries(t).filter(([e])=>!n.includes(e)).map(([e,t])=>({label:ut(e),value:t}));return r.length===0?[]:[{_tag:`Fields`,label:e,fields:r}]},Y=(e,t,n=`text`)=>{if(e==null)return[];if(D(y)(e))return[q(t,e,n)];if(Array.isArray(e))return e.flatMap(e=>D(lt)(e)?[q(t,e.text,n)]:Y(e,t,n));if(!D(W)(e))return[{_tag:`Fields`,label:t,fields:[{label:`Value`,value:e}]}];let r=[],i={};for(let[a,o]of Object.entries(e))a===`content`&&Array.isArray(o)?r.push(...Y(o,t,n)):[`text`,`stdout`,`stderr`,`aggregatedOutput`,`message`].includes(a)?r.push(...Y(o,a===`text`?t:ut(a),n)):a===`error`?r.push(...Y(o,`Error`)):i[a]=o;return[...r,...J(t,i)]},dt=E({oldText:y,newText:y}),ft=E({path:y,diff:y,kind:E({type:y})}),X=pe(A(ft)),pt=ge.check(be(1)),Z=e=>/\.[cm]?tsx?$/iu.test(e)?`typescript`:/\.json$/iu.test(e)?`json`:`text`,mt=e=>Y(e,`Confirmation`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e),ht=(e,t,n)=>{let r=G(e),i=G(t),a=X(i.changes??r.changes),o=K(r.path)??K(r.file_path),s=D(pt)(r.offset)?r.offset:void 0,c=D(pt)(r.limit)?r.limit:void 0,l=s??(r.offset===void 0?1:void 0),u=n===`read`&&(s!==void 0||c!==void 0)?[l===void 0?``:`From line ${l}`,c===void 0?``:`up to ${c} ${c===1?`line`:`lines`}`].filter(e=>e!==``).join(` · `):``,d=[o??`File details unavailable`,u].filter(e=>e!==``).join(` · `),f=K(G(i.details).patch)??K(G(i.details).diff),p=pe(A(dt))(r.edits),m=S(p,()=>D(y)(r.old_string)&&D(y)(r.new_string)?[{oldText:r.old_string,newText:r.new_string}]:[]);return{activity:{_tag:`Files`,operation:i.type===`fileChange`||r.type===`fileChange`?`change`:n,paths:P(a,{onNone:()=>o===void 0?[]:[o],onSome:e=>e.map(({path:e})=>e)})},title:{read:`Read file`,edit:`Edit file`,write:`Write file`}[n],subject:n===`read`?d:o??P(a,{onNone:()=>`File details unavailable`,onSome:e=>e.length===1?e[0]?.path??`File details unavailable`:`${e.length} files`}),input:[...J(`Options`,r,[`path`,`file_path`,`edits`,`old_string`,`new_string`,`content`,`changes`,`type`,`id`,`status`,...n===`read`&&s!==void 0?[`offset`]:[],...n===`read`&&c!==void 0?[`limit`]:[]]),...(f===void 0?m:[]).flatMap(({oldText:e,newText:t},n)=>[q(m.length===1?`Before`:`Before ${n+1}`,e,Z(o??``)),q(m.length===1?`After`:`After ${n+1}`,t,Z(o??``))]),...D(y)(r.content)?[q(`Content`,r.content,Z(o??``))]:[],...t===void 0?P(X(r.changes),{onNone:()=>[],onSome:e=>e.map(({path:e,diff:t})=>q(e,t,`diff`))}):[]],output:P(X(i.changes),{onNone:()=>f===void 0?n===`read`?Y(t,o??`Output`,Z(o??``)):mt(t):[q(o??`Changes`,f,`diff`),...mt(Object.fromEntries(Object.entries(i).filter(([e])=>e!==`details`))),...J(`Metadata`,G(i.details),[`patch`,`diff`])],onSome:e=>e.map(({path:e,diff:t,kind:n})=>q(`${e} · ${n.type}`,t,`diff`))})}},gt=e=>{switch(e.toLowerCase()){case`bash`:case`powershell`:case`shell`:case`command`:return`command`;case`read`:return`read`;case`edit`:case`file_change`:return`edit`;case`write`:return`write`;case`grep`:case`glob`:case`find`:case`ls`:case`web_search`:return`search`;case`subagent`:case`agent`:case`task`:return`agent`;default:return`tool`}},_t=({input:e,output:t})=>{let n=G(e??t),r=G(t),i=K(n.command)??K(r.command);return{activity:{_tag:`Command`,command:i},title:`Command`,subject:i??`Command details unavailable`,input:[...i===void 0?[]:[q(`Command`,i,`bash`)],...J(`Options`,n,[`command`,`type`,`id`,`status`,`aggregatedOutput`,`exitCode`,`durationMs`,`processId`,`source`,`commandActions`])],output:r.type===`commandExecution`?[...Y(r.aggregatedOutput,`Output`),...J(`Execution`,r,[`type`,`id`,`status`,`command`,`cwd`,`aggregatedOutput`,`processId`,`source`,`commandActions`])]:Y(t,`Output`)}},vt=({input:e,output:t,name:n})=>{let r=G(e??t),i=G(t),a=G(r.action);return{activity:{_tag:`Search`},title:n.toLowerCase()===`ls`?`List files`:`Search`,subject:K(r.pattern)??K(r.query)??K(a.query)??K(a.url)??K(r.path)??`Search details unavailable`,input:J(`Search`,r,[`type`,`id`]),output:i.type===`webSearch`?J(`Search`,i,[`type`,`id`]):Y(t,`Results`)}},yt=({input:e,output:t})=>{let n=G(e),r=K(n.task)??K(n.prompt);return{activity:{_tag:`Delegation`},title:`Delegate`,subject:K(n.description)??r??`Delegated task`,input:[...r===void 0?[]:[{_tag:`Text`,label:`Task`,text:r}],...J(`Agent`,n,[`task`,`prompt`])],output:Y(t,`Report`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e)}},bt=({input:e,output:t,name:n})=>{let r=G(e),i=G(t),a=r.type===`mcpToolCall`||r.type===`dynamicToolCall`||i.type===`mcpToolCall`||i.type===`dynamicToolCall`,o=a?r.arguments??i.arguments:e;return{activity:{_tag:`Tool`},title:(a?[K(r.server)??K(i.server)??K(r.namespace)??K(i.namespace),K(r.tool)??K(i.tool)].filter(e=>e!==void 0).join(` · `):n)||n,subject:D(W)(o)?`${Object.keys(o).length} parameters`:D(y)(o)?o:`Tool details`,input:Y(o,`Parameters`),output:a?[...Y(i.result??i.contentItems,`Output`),...Y(i.error,`Error`)]:Y(t,`Output`)}},xt=e=>{let t={name:e.name,input:P(e.start,{onNone:()=>void 0,onSome:({input:e})=>e}),output:C(e.state,{Running:()=>void 0,Stopped:()=>void 0,Finished:({output:e})=>e,Error:({output:e})=>e})},n=gt(e.name);return{category:n,...{command:_t,read:({input:e,output:t})=>ht(e,t,`read`),edit:({input:e,output:t})=>ht(e,t,`edit`),write:({input:e,output:t})=>ht(e,t,`write`),search:vt,agent:yt,tool:bt}[n](t)}},Q=(e,t)=>{let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`},St=({since:e,className:t})=>{let n=F(1e3);return(0,z.jsx)(`time`,{dateTime:e,"aria-live":`off`,className:ue(`font-mono tabular-nums`,t),title:`Since ${O(e)}`,children:Q(e,n)})},Ct=e=>{if(e.status!==`Live`)return{label:e.status,detail:``,since:v()};if(e.paused||e.held||e.idle)return{label:ct(e),detail:``,since:v()};let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);if(t?._tag!==`Tool`)return{label:`Working`,detail:``,since:v()};let n=xt(t);return{label:{command:`Running command`,read:`Reading file`,edit:`Editing file`,write:`Writing file`,search:`Searching`,agent:`Delegating`,tool:`Running ${n.title}`}[n.category],detail:n.subject,since:w(t.start,({receivedAt:e})=>e)}},wt=e=>{let t=e.filter(({status:e})=>e===`Live`);return t.filter(({session:e})=>e._tag===`ChildSession`).sort((e,t)=>t.latestSequence-e.latestSequence)[0]??t.find(({session:e})=>e._tag===`ParentSession`)},Tt=({chapter:e})=>{let t=F(1e3),n=wt(e.sessions),r=n===void 0?{label:`Parent session starting`,detail:``,since:v()}:Ct(n);return(0,z.jsxs)(`div`,{role:`status`,"aria-label":`Current activity`,className:`min-w-0 space-y-0.5 text-xs`,children:[(0,z.jsxs)(`p`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(I,{state:`Running`}),n!==void 0&&(0,z.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:n.session._tag===`ParentSession`?`Parent`:n.session.agent}),(0,z.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:r.label}),P(r.since,{onNone:()=>null,onSome:e=>(0,z.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Started ${O(e)}`,children:Q(e,t)})})]}),r.detail!==``&&(0,z.jsx)(`p`,{className:`truncate pl-3.5 font-mono text-muted-foreground`,title:r.detail,children:r.detail}),P(e.lastActivityAt,{onNone:()=>null,onSome:e=>(0,z.jsxs)(`p`,{"aria-live":`off`,className:`pl-3.5 text-muted-foreground`,children:[`Last activity `,Q(e,t),` ago`]})}),e.connectivity.map(e=>(0,z.jsx)(Et,{warning:e,now:t},e._tag===`WorkerSilent`?e.worker:`${e.agent}:${e.since}`))]})},Et=({warning:e,now:t})=>{let n=C(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>({text:`${e} silent since ${N(t)}`,since:t,detail:null}),ProviderRetrying:({agent:e,retries:t,since:n,message:r})=>({text:`${e}: provider unreachable, ${U(t)} since ${N(n)}`,since:n,detail:r})});return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2 pl-3.5`,children:[(0,z.jsxs)(`span`,{className:`min-w-0 text-warning`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),n.text]}),(0,z.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Since ${O(n.since)}`,children:Q(n.since,t)})]}),n.detail!==null&&(0,z.jsx)(`p`,{className:`truncate pl-3.5 text-muted-foreground`,title:n.detail,children:n.detail})]})},Dt=e=>{let t=null,n=new Map;for(let{payload:r,receivedAt:i}of e)if(r._tag===`WorkerUnresponsive`)t={_tag:`WorkerSilent`,worker:r.worker,lastAnsweredAt:we(r.lastAnsweredAt)};else if(r._tag===`WorkerResponsive`)t=null;else if(r._tag===`SessionEvent`){let e=r.event;e._tag===`ProviderRetrying`?n.set(e.session.id,{_tag:`ProviderRetrying`,sessionId:e.session.id,agent:e.session.agent,message:e.message,retries:e.retries,since:n.get(e.session.id)?.since??i}):(e._tag===`ProviderRecovered`||e._tag===`SessionIdle`||e._tag===`SessionFinished`)&&n.delete(e.session.id)}return[...t===null?[]:[t],...n.values()]},Ot=/^\s*\[usine:(blocked|question|failed)\]/u,kt=e=>{let t=Ot.exec(e)?.[1];return t===`blocked`||t===`question`?t:null},At=e=>e.replace(Ot,``).trimStart(),jt=e=>At(e).replace(/\s+/gu,` `).trim(),Mt=e=>e.replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/u,``).replace(/!?\[([^\]]*)\]\([^)]*\)/gu,`$1`).replace(/`([^`]*)`/gu,`$1`).replace(/(\*\*|__)(.+?)\1/gu,`$2`).replace(/(^|[\s(])\*(\S(?:.*?\S)?)\*(?=[\s).,;:!?]|$)/gu,`$1$2`).trim(),Nt=e=>e.replace(/```[\s\S]*?(?:```|$)/gu,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`).map(Mt).filter(e=>e!==``).join(` `),$=e=>{let t=At(e).replace(/```[\s\S]*?(?:```|$)/gu,`
|
|
4
|
+
`).split(`
|
|
5
|
+
`).map(Mt).filter(e=>e!==``)[0]??``;return/^(.*?[.!?…])(?=\s|$)/u.exec(t)?.[1]??t},Pt=32,Ft=12,It=e=>{if(e.length<=Pt)return e;let t=/^(.+?)(?:[,;:]\s|\s[—–-]\s)/u.exec(e)?.[1];if(t!==void 0&&t.length>=Ft&&t.length<=Pt)return t;let n=e.slice(0,33).lastIndexOf(` `);return`${(n>0?e.slice(0,n):e.split(` `)[0]??e).replace(/[\s,;:.—–-]+$/u,``)}…`},Lt=e=>({name:e.session._tag===`ParentSession`?`Parent`:e.session.agent,sessionKey:e.key}),Rt=e=>e.origin._tag===`Envelope`&&(e.origin.payload._tag===`Final`||e.origin.payload._tag===`Failed`||e.origin.payload._tag===`Interrupted`),zt=e=>C(e,{Succeeded:({message:e})=>ye(e),Failed:({failure:e})=>e._tag===`AgentFailure`||e._tag===`BlockedFailure`||e._tag===`QuestionFailure`?f(e):null,Canceled:()=>null}),Bt=(e,t)=>{let n=t?.salvage??null,r=e?.origin._tag===`Envelope`&&e.origin.payload._tag===`Final`?b(e.origin.payload.result.message):v(),i=t?.outcome;if(i!=null)return C(i,{Succeeded:()=>({_tag:`Succeeded`,message:r}),Failed:({failure:e})=>({_tag:`Failed`,failure:e,salvage:n}),Canceled:()=>({_tag:`Canceled`,salvage:n})});if(e?.origin._tag!==`Envelope`)return null;let a=e.origin.payload;return a._tag===`Final`?{_tag:`Succeeded`,message:r}:a._tag===`Failed`?{_tag:`Failed`,failure:a.failure,salvage:n}:a._tag===`Interrupted`?{_tag:`Canceled`,salvage:n}:null},Vt=({direction:e,payload:t})=>e===`outbound`&&t._tag!==`WorkerUnresponsive`&&t._tag!==`WorkerResponsive`&&(t._tag!==`SessionEvent`||t.event._tag!==`PoolRateLimitsUpdated`&&t.event._tag!==`ProviderRetrying`),Ht=e=>e.detail===``?e.label:`${e.label}. ${e.detail}`,Ut=e=>e._tag===`Envelope`?e.payload._tag===`WorkerUnresponsive`?{_tag:`WorkerSilent`}:e.payload._tag===`WorkerResponsive`&&e.payload.recovered?{_tag:`WorkerAnswers`}:null:null,Wt=(e,t,n,r,i)=>{let a=[],o=t===null?null:zt(t),s=o===null?null:jt(o),c=new Set,l=null,u=[],d=null,f=new Map,m=()=>{let[e,...t]=u;e!==void 0&&d!==null&&a.push({_tag:`Burst`,key:`burst:${e.key}`,speaker:d,tools:[e,...t]}),u=[],d=null};for(let{entry:t,session:n}of e){if(t._tag===`Tool`){let e=n??{name:`Parent`,sessionKey:null};if(xt(t).category===`agent`){m(),a.push({_tag:`Delegation`,key:t.key,speaker:e,tool:t});continue}d!==null&&d.sessionKey!==e.sessionKey&&m(),d=e,u.push(t);continue}if(Rt(t))continue;let e=t.origin,r={key:t.key,sequence:t.sequence,latestSequence:t.latestSequence,receivedAt:t.receivedAt};if(e._tag===`Session`){let i=n??{name:e.session.agent,sessionKey:null};if(e.event===`TextOutput`){let n=jt(t.detail);if(s!==null&&n===s){l??={receivedAt:t.receivedAt,speaker:i};continue}let o=e.session._tag===`ChildSession`;if(!o&&c.has(n))continue;o&&c.add(n),m();let u=kt(t.detail);a.push({_tag:`Message`,...r,speaker:i,from:`agent`,text:At(t.detail),format:t.format,undelivered:!1,queued:null,blocked:u===`blocked`,question:u===`question`});continue}(e.event===`SessionIdle`||e.event===`SessionResumed`)&&(m(),a.push({_tag:`Note`,...r,speaker:i,text:e.event===`SessionIdle`?`Waiting for operator input`:`Resumed`,tone:`plain`,connectivity:null}))}else if(e._tag===`Provider`){let i=n??{name:e.session.agent,sessionKey:null},o=e.event;if(m(),o._tag===`ProviderRecovered`){f.delete(e.session.id),a.push({_tag:`Note`,...r,speaker:i,text:`Provider reachable again after ${U(o.retries)}`,tone:`plain`,connectivity:null});continue}let s=`Provider unreachable, ${U(o.retries)} so far. ${o.message}`,c=f.get(e.session.id),l=c===void 0?void 0:a[c];if(c===a.length-1&&l?._tag===`Note`){a[c]={...l,latestSequence:t.latestSequence,text:s};continue}f.set(e.session.id,a.length),a.push({_tag:`Note`,...r,speaker:i,text:s,tone:`warning`,connectivity:{_tag:`ProviderRetrying`,sessionId:e.session.id}})}else if(e._tag===`Envelope`&&e.payload._tag===`Started`){let t=e.payload.conflictingSalvage;me(t)&&(m(),a.push({_tag:`Note`,...r,speaker:null,text:p(t.value),tone:`plain`,connectivity:null}))}else m(),a.push(t.kind===`message`?{_tag:`Message`,...r,speaker:{name:e._tag===`Operator`?e.operator:t.label,sessionKey:n?.sessionKey??null},from:`operator`,text:t.detail,format:t.format,undelivered:t.tone===`failed`,queued:t.queued,blocked:!1,question:!1}:{_tag:`Note`,...r,speaker:null,text:Ht(t),tone:t.tone,connectivity:Ut(e)})}if(m(),t!==null){let e=n===void 0?v():b({key:n.key,sequence:n.sequence,latestSequence:n.latestSequence,receivedAt:n.receivedAt});a.push({_tag:`Ending`,key:n?.key??`ending:${i}`,position:e,receivedAt:T(x(l?.receivedAt),()=>T(w(e,({receivedAt:e})=>e),()=>x(r?.endedAt))),speaker:l?.speaker??null,end:t,outOfMemory:r?.outOfMemory??null})}return a},Gt=(e,t,n)=>{let r=new Map;for(let t of e.sessions)for(let e of t.entries)r.set(e.key,t);let i=e.items.flatMap(e=>e._tag===`Session`?e.entries:[e]).sort((e,t)=>e.sequence-t.sequence),o=[...[...t].sort((e,t)=>e.number-t.number).map(({id:e})=>e),...i.map(({attemptId:e})=>e)];return{chapters:[...new Set(o)].map(o=>{let s=t.find(({id:e})=>e===o),c=i.filter(e=>e.attemptId===o),l=[...c].reverse().find(e=>e._tag===`Notice`&&Rt(e)),u=c.find(e=>e._tag===`Notice`&&e.origin._tag===`Envelope`&&e.origin.payload._tag===`Started`),d=Bt(l,s),f=n.filter(e=>e.attemptId===o),p=[...f].reverse().find(Vt),m=d===null&&!e.terminalAttempts.has(o);return{key:`attempt:${o}`,attemptId:o,attempt:x(s),live:m,parentModel:u?._tag===`Notice`&&u.origin._tag===`Envelope`&&u.origin.payload._tag===`Started`?b(u.origin.payload.parentModel):v(),sessions:e.sessions.filter(e=>e.attemptId===o).sort((e,t)=>Number(e.session._tag===`ChildSession`)-Number(t.session._tag===`ChildSession`)||e.sequence-t.sequence),rows:Wt(c.map(e=>{let t=r.get(e.key);return{entry:e,session:t===void 0?null:Lt(t)}}),d,l,s,o),meters:a(f),endedAt:T(x(s?.endedAt),()=>x(l?.receivedAt)),lastActivityAt:x(p?.receivedAt),connectivity:m?Dt(f):[]}})}},Kt=e=>e.rows.flatMap(e=>{let t=(t,n)=>[{key:e.key,...t,text:n,label:It(n)}];if(e._tag===`Message`){let{sessionKey:n,name:r}=e.speaker;return e.from===`operator`?t({sessionKey:n,kind:`operator`,speaker:r,tone:e.undelivered?`failed`:`plain`},$(e.text)):t({sessionKey:n,kind:e.blocked?`blocker`:e.question?`question`:`turn`,speaker:r,tone:e.blocked?`failed`:`plain`},$(e.text))}if(e._tag===`Note`)return e.connectivity===null&&e.tone!==`failed`?[]:t({sessionKey:e.speaker?.sessionKey??null,kind:e.connectivity===null?`operator`:`notice`,speaker:e.speaker?.name??null,tone:e.tone},$(e.text));if(e._tag!==`Ending`)return[];let n=(n,r)=>t({sessionKey:e.speaker?.sessionKey??null,kind:`ending`,speaker:null,tone:r},n);return C(e.end,{Succeeded:({message:e})=>n(P(e,{onNone:()=>`Succeeded`,onSome:$}),`plain`),Failed:({failure:e})=>n($(f(e)),`failed`),Canceled:()=>n(`Canceled`,`plain`)})}),qt=e=>{let t=[];for(let n of Kt(e)){let e=t.at(-1);n.kind===`turn`?e?._tag===`Turns`&&e.sessionKey===n.sessionKey?t[t.length-1]={...e,turns:[...e.turns,n]}:t.push({_tag:`Turns`,key:`turns:${n.key}`,speaker:n.speaker??`Parent`,sessionKey:n.sessionKey,turns:[n]}):t.push({_tag:`Mark`,checkpoint:n})}return t},Jt=e=>e.chapters.flatMap(e=>{let t=new Set(Kt(e).map(({key:e})=>e)),n=(t,n=!1)=>({id:t,attemptId:e.attemptId,checkpoint:n});return[n(e.key),n(`history:${e.attemptId}`),n(`empty:${e.attemptId}`),...e.rows.map(e=>n(e.key,t.has(e.key))),n(`activity:${e.attemptId}`)]}),Yt=(e,t)=>{let n=new Set(t),r=e.findIndex(({id:e})=>n.has(e)),i=e[r];if(i===void 0)return null;let a=e.slice(0,r+1).reverse().find(e=>e.attemptId===i.attemptId&&e.checkpoint);return{attemptId:i.attemptId,checkpointKey:a?.id??null}},Xt=({failure:e,className:t})=>(0,z.jsxs)(`div`,{className:ue(`rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 text-sm`,t),children:[(0,z.jsx)(`p`,{className:`font-medium text-destructive`,children:d(e)}),(0,z.jsx)(Re,{className:`wrap-anywhere`,children:f(e)})]}),Zt=({salvage:e})=>(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground wrap-anywhere`,children:e===null?`No salvage branch`:C(e,{Pushed:({ref:e,commit:t})=>(0,z.jsxs)(z.Fragment,{children:[`Unfinished work pushed to `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)})]}),PartlyPushed:({ref:e,commit:t,path:n,message:r})=>(0,z.jsxs)(z.Fragment,{children:[`Unfinished work pushed to `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)}),`, except files kept at`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:n}),`. `,r]}),Retained:({path:e,message:t})=>(0,z.jsxs)(z.Fragment,{children:[`Salvage incomplete: unfinished work at `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),`, retried at each startup while the worker is configured. Last error: `,t]}),Rejected:({path:e,message:t})=>(0,z.jsxs)(z.Fragment,{children:[`Salvage rejected: unfinished work at `,(0,z.jsx)(`span`,{className:`font-mono`,children:e}),`. The remote refused its push, so startup doesn't retry it until its commit changes. Error:`,` `,t]})})}),Qt=({end:e})=>C(e,{Failed:({failure:e,salvage:t})=>(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(Xt,{failure:e}),(0,z.jsx)(Zt,{salvage:t})]}),Succeeded:({message:e})=>(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,z.jsx)(I,{state:`Succeeded`}),`Succeeded`]}),P(e,{onNone:()=>null,onSome:e=>(0,z.jsx)(Re,{className:`text-md wrap-anywhere`,children:e})})]}),Canceled:({salvage:e})=>(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,z.jsx)(I,{state:`Canceled`}),`Canceled`]}),(0,z.jsx)(Zt,{salvage:e})]})}),$t=({kills:e})=>(0,z.jsxs)(`p`,{className:`text-xs text-warning wrap-anywhere`,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),l(e)]}),en=({end:e,outOfMemory:t})=>t===null?(0,z.jsx)(Qt,{end:e}):(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(Qt,{end:e}),(0,z.jsx)($t,{kills:t})]});export{Yt as a,Tt as c,st as d,rt as f,Ye as g,qe as h,Jt as i,St as l,R as m,qt as n,zt as o,tt as p,Gt as r,Nt as s,en as t,xt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Dt as e,Ot as t,a as n,f as r,t as i,v as a,zn as o}from"./strings-DXB6PB2g.js";function s(e){return e}var c={hetzner:`Hetzner`,boat:`Boat`},l={hetzner:`server`,boat:`sandbox`},u=(e,t)=>`Creating a ${c[e.provider]} machine, started ${i(e.since,t)}`,d={capacity:`no capacity`,quota:`quota reached`,refused:`refused by the provider`,provider:`provider error`,unreachable:`unreachable`,timeout:`SSH timeout`},f=({reason:e})=>e===`check`?`Preflight failed on the first machine of the day`:`Machine creation failed: ${d[e]}`,p=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString()?r(e).slice(11):n(e),m=({blocked:e,retryAt:t},n)=>`${e?`Next try`:`Pause ended`} at ${p(t,n)}`,h=({failures:e,failedAt:t},n)=>`${e===1?`Failed once`:`Failed ${e} times in a row`}, last at ${p(t,n)}`,g={approve:`Approve`,retry:`Retry`,runAgain:`Run again`,cancel:`Cancel run`,confirmCancel:`Confirm cancel`,keepRunning:`Keep running`},_=`Opening a run…`,v=`No run opened: cycle budget used up. Reset it in Needs attention`,y=e=>t(e,{Event:()=>`From the event`,OperatorRetry:({operator:e})=>o(e,{onNone:()=>`Retried`,onSome:e=>`Retried by ${e}`}),EditAndRetry:({operator:e})=>o(e,{onNone:()=>`Edited and retried`,onSome:e=>`Edited and retried by ${e}`}),InfraRetry:()=>`Retried after an infrastructure failure`,AfterRestart:()=>`Started again after a restart`}),b=(e,{runId:t,attemptNumber:n,worker:r})=>t===e?`Waiting for attempt ${n} to stop on ${r}`:`Waiting for attempt ${n} of an earlier run to stop on ${r}`,x=(e,t=null,n=null)=>{if(t!==null)return b(e.id,t);if(e.state===`Queued`&&n?.state===`creating`)return`Queued, creating a ${c[n.provider]} machine`;let r=e.attempts.length,i=r===0?``:` after ${r} ${r===1?`attempt`:`attempts`}`;switch(e.state){case`Pending`:return`Pending`;case`Waiting`:return`Waiting for approval`;case`Queued`:return`Queued, no free worker`;case`Running`:return`Running, attempt ${e.attempts.at(-1)?.number??1}`;case`Succeeded`:return r>1?`Succeeded${i}`:`Succeeded`;case`Failed`:return`Failed${i}`;case`Canceled`:return`Canceled${i}`}},S=e=>t(e,{GitHubPushFailure:()=>`GitHub refused push`,InfraFailure:()=>`Infrastructure failure`,DefectFailure:()=>`Executor defect`,AgentFailure:()=>`Agent failure`,BlockedFailure:()=>`Agent blocked`,QuestionFailure:()=>`Question from the agent`,RunawayFailure:()=>`Runaway guard`,ChildSessionBudgetFailure:()=>`Child session budget exhausted`}),C=e=>`Opened ${r(e)}`,w={ui:`from the UI`,"github-ask":`from GitHub`},T={approve:`Approving…`,retry:`Retrying…`,cancel:`Canceling…`,resolveFailure:`Marking resolved…`},E=e=>t(e,{GitHubPushFailure:({message:e})=>e,InfraFailure:({message:e})=>e,DefectFailure:({message:e})=>e,AgentFailure:({message:e})=>e,BlockedFailure:({message:e})=>e,QuestionFailure:({question:e})=>e,RunawayFailure:({ceiling:e})=>e===`wall-clock`?`Time limit reached: settings.max_attempt_minutes`:`Token limit reached: settings.max_attempt_tokens`,ChildSessionBudgetFailure:({attemptedChildren:e,maxChildren:t})=>`Child session budget of ${t} used; child ${e} did not start`}),D=e=>e===`parent`?`Queued until the delegated task ends`:`Queued until the current child step ends`,O=({ref:e,commit:t})=>`Not applied: the previous attempt's work on ${e} at ${t.slice(0,7)} conflicts with the current revision. It is still on ${e}`,k=({kills:e,memoryMib:t})=>`The kernel killed ${e} ${e===1?`process`:`processes`} for memory across containers in this attempt. The last container with recorded kills had a ${t} MiB memory limit`,A=e=>`Retry uses ${e.harness} · ${e.model} from the saved agent definition.`,j={loading:`Loading…`,loadEarlier:`Load earlier`,empty:`No activity recorded`},M=e=>o(e,{onNone:()=>`Attempt`,onSome:({number:e})=>`Attempt ${e}`}),N=e=>`${e.completedCycles} completed rounds. ${e.counts.map(({loop:e,admitted:t})=>`${e}: ${t} ${t===1?`run`:`runs`}`).join(`; `)}`,P=e=>t(e,{CycleBudgetNeed:({ask:e,itemLabel:t})=>({title:`Cycle budget exhausted`,detail:`${t}: ${N(e)}`,repository:e.repository,runId:null}),ApprovalNeed:({loop:e,repository:t,runId:n,item:r})=>({title:`${e}: approval needed`,detail:r===null?`Open the run for the task text`:r.title,repository:t,runId:n}),RunFailureNeed:({failure:e,loop:t,repository:n,runId:r})=>({title:e._tag===`QuestionFailure`?`Question from ${t}`:e._tag===`BlockedFailure`?`${t}: blocked`:`${t}: ${S(e).toLowerCase()}`,detail:E(e),repository:n,runId:r}),BoardProjectionNeed:({failure:e})=>({title:`Item not shown on the board`,detail:e.message,repository:e.repository,runId:null}),PollFailureNeed:({failure:e})=>({title:e.errorTag,detail:e.message,repository:e.repository,runId:null}),PreflightFindingNeed:({finding:e})=>({title:`Label preflight failed`,detail:`${e.label}: ${e.message}`,repository:e.repository,runId:null}),ScheduleFailureNeed:({failure:e})=>({title:t(e,{ScheduleTickFailure:({errorTag:e})=>e,ScheduleAgentFailure:({loop:e})=>`${e}: agent not loaded`,ScheduleCronFailure:({loop:e})=>`${e}: schedule not computed`}),detail:e.message,repository:e._tag===`ScheduleTickFailure`?e.repository:null,runId:null}),ConfigFileNeed:({kind:e,error:t})=>({title:e===`loop`?`Loop file not loaded`:`Agent file not loaded`,detail:`${t.file}: ${t.message.replace(/\.$/u,``)}. Fix the file, then reload the configuration from Configuration > Loops`,repository:null,runId:null}),WorkerPreflightNeed:({worker:e,message:t})=>({title:`${e}: preflight failed`,detail:`${t} This worker takes no new attempts while preflight retries automatically.`,repository:null,runId:null}),UnconfiguredWorkerNeed:({worker:e,attempts:t,running:n})=>({title:`Worker not configured`,detail:n>0?`${e} is not in usine.yaml. ${n} ${n===1?`attempt`:`attempts`} still running on it. Discard the leftovers after they end`:`${e} is not in usine.yaml. Startup does not reconcile the ${t} recorded ${t===1?`attempt`:`attempts`} on it. Add the worker back and restart usine up, or discard the leftovers`,repository:null,runId:null}),UnresponsiveWorkerNeed:({worker:e,lastAnsweredAt:t,attempts:n})=>({title:`${e}: worker not responding`,detail:`Last answered ${t}. ${n.length} ${n.length===1?`attempt is`:`attempts are`} still running. Check the worker or open an affected run.`,repository:null,runId:null}),UnconfirmedStopNeed:({loop:e,repository:t,runId:n,attemptNumber:r,worker:i})=>({title:`${e}: parent task not stopped`,detail:`Attempt ${r} still ending on ${i}, using one slot. No new attempt on this item until it stops. Stop retried every few minutes`,repository:t,runId:n})}),F={dismissNeed:`Dismiss`,undoDismissNeed:`Undo`},I={dismissNeed:`Dismissing…`,undoDismissNeed:`Undoing…`},L=`Dismissed`,R=({repository:e,loop:t,attemptNumber:n})=>`${e} · ${t} · attempt ${n}`,z=`Open worker`,B=t=>({...e(t),repository:t}),V=e=>{let t=new Map;for(let n of e){let e=n._tag===`UnresponsiveWorkerNeed`?n.attempts.map(({repository:e})=>e):[P(n).repository];for(let n of new Set(e))n!==null&&t.set(n,(t.get(n)??0)+1)}return t},H=2e3,U=15e3,W=()=>s({queryKey:[`overview`],queryFn:()=>a(e=>e.overview()),refetchInterval:e=>{let t=e.state.data;return t?._tag===`NeedsSetup`?!1:t?.projects.some(e=>e.runs.some(({canCancel:e})=>e))===!0?H:U}});export{u as A,_ as C,j as D,M as E,c as M,l as N,f as O,s as P,v as S,b as T,k as _,I as a,g as b,P as c,w as d,y as f,C as g,S as h,F as i,m as j,h as k,z as l,E as m,W as n,N as o,O as p,B as r,L as s,V as t,R as u,D as v,x as w,T as x,A as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{P as r}from"./overview-CF8vBUkv.js";import{D as i}from"./button-4rhhIcK8.js";import{v as a}from"./strings-BcIxtDID.js";var o=n(e(),1),s=t(),c=o.createContext(void 0),l=e=>{let t=o.useContext(c);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},u=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(c.Provider,{value:e,children:t})),d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==S(o,t.options))return!1}else if(!w(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function x(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(C(t.options.mutationKey)!==C(a))return!1}else if(!w(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function S(e,t){return(t?.queryKeyHashFn||C)(e)}function C(e){return JSON.stringify(e,(e,t)=>O(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!w(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!w(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function T(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=D(e)&&D(t);if(!r&&!(O(e)&&O(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=T(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function D(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!k(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!k(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function k(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{f.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:T(e,t)}function ne(e){return e}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var j=Symbol();function M(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===j?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function N(e,t){return typeof e==`function`?e(...t):!!e}function ae(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var oe=()=>m,P=()=>oe(),F=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},I=new class extends F{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},se=p;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=ce(),R=new class extends F{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)!==`online`||R.isOnline()}var B=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function V(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(h);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new B(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>I.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),p=()=>z(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(P()?0:3),a=e.retryDelay??le,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),te(o).then(()=>f()?void 0:_(f)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():_(p).then(v),s)}}var H=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(P()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ae(e,()=>t.signal,()=>n=!0)},u=M(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?W:U,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:U(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function U(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function de(e,t){return t?U(e,t)!=null:!1}function fe(e,t){return!t||!e.getPreviousPageParam?!1:W(e,t)!=null}var pe=class extends H{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=q(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=q(this.options);e.data!==void 0&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=A(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=M(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=V({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof B&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof B){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...G(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function G(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function q(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var me=class extends F{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),J(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&X(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return E(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#h(e){return!P()&&y(this.options.enabled,this.#t)!==!1&&_(e)}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#u=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return y(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=f.setInterval(()=>{(this.options.refetchIntervalInBackground||I.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(f.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(f.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&J(e,t),o=i&&X(e,n,t,r);(a||o)&&(l={...l,...G(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=A(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=A(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,b=_&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:Z(e,t),refetch:this.refetch,isEnabled:y(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),E(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();L.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function he(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||y(t.retryOnMount,e)!==!1)}function J(e,t){return he(e,t)||e.state.data!==void 0&&Y(e,t,t.refetchOnMount)}function Y(e,t,n){if(y(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=y(n,e);return r===`always`||r!==!1&&Z(e,t)}return!1}function X(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Z(e,n)}function Z(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}var Q=o.createContext(!1),ge=()=>o.useContext(Q);Q.Provider;function _e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ve=o.createContext(_e()),ye=()=>o.useContext(ve),be=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?N(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},xe=e=>{o.useEffect(()=>{e.clearReset()},[e])},Se=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||N(n,[e.error,r])),Ce=(e,t)=>t.state.data===void 0,we=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Te=(e,t)=>e?.suspense&&t.isPending,Ee=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function De(e,t,n){let r=ge(),i=ye(),a=l(n),s=a.defaultQueryOptions(e),c=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,we(s),be(s,i,c),xe(i);let[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&u;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(L.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),Te(s,f))throw Ee(s,d,i);if(Se({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return s.notifyOnChangeProps?f:d.trackResult(f)}var $=3e3,Oe=15e3,ke=()=>r({queryKey:[`desk`],queryFn:()=>a(e=>e.desk()),refetchInterval:e=>{let t=e.state.data;return t!==void 0&&(t.running.length>0||t.notMoving.some(({reason:e})=>e._tag===`QueuedForWorker`))?$:Oe}}),Ae=({title:e,leading:t,counts:n,children:r,actions:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-wrap items-baseline gap-x-3 gap-y-1`,o),children:[(0,s.jsxs)(`h1`,{className:`flex items-baseline gap-2 text-xl font-semibold wrap-anywhere`,children:[t!==void 0&&(0,s.jsx)(`span`,{className:`flex h-7 shrink-0 items-center self-start`,children:t}),(0,s.jsx)(`span`,{className:`min-w-0`,children:e})]}),n!==void 0&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground tabular-nums`,children:n}),r,a!==void 0&&(0,s.jsx)(`div`,{className:`ml-auto flex items-center gap-2 self-center`,children:a})]}),je=({children:e,width:t=`prose`})=>(0,s.jsx)(`main`,{className:`px-4 pt-5 pb-6 md:px-5`,children:(0,s.jsx)(`div`,{className:i(`flex flex-col gap-4`,t===`prose`&&`max-w-3xl`),children:e})}),Me={lg:`lg:flex-row lg:items-start lg:justify-between lg:gap-6`,sm:`sm:flex-row sm:items-start sm:justify-between sm:gap-6`,never:``},Ne=({eyebrow:e,heading:t,facts:n,actions:r,actionsBeside:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-col gap-3`,Me[a],o),children:[(0,s.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e!==void 0&&(0,s.jsx)(`p`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground`,children:e}),t,n!==void 0&&(0,s.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 pt-0.5 text-sm text-muted-foreground`,children:n})]}),r!==void 0&&(0,s.jsx)(`div`,{className:`shrink-0`,children:r})]}),Pe=({icon:e,title:t,children:n})=>(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:t,children:[(0,s.jsx)(e,{"aria-hidden":`true`,className:`size-[1em] shrink-0 text-faint`}),n]});export{j as A,b as C,y as D,T as E,l as M,E as O,x as S,w as T,F as _,ke as a,S as b,me as c,fe as d,H as f,I as g,L as h,Ae as i,u as j,N as k,pe as l,R as m,Pe as n,De as o,V as p,Ne as r,Ce as s,je as t,de as u,g as v,h as w,ne as x,C as y};
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{P as r}from"./overview-C73v5kbv.js";import{D as i}from"./button-4rhhIcK8.js";import{v as a}from"./strings-DXB6PB2g.js";var o=n(e(),1),s=t(),c=o.createContext(void 0),l=e=>{let t=o.useContext(c);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},u=({client:e,children:t})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(c.Provider,{value:e,children:t})),d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==S(o,t.options))return!1}else if(!w(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function x(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(C(t.options.mutationKey)!==C(a))return!1}else if(!w(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function S(e,t){return(t?.queryKeyHashFn||C)(e)}function C(e){return JSON.stringify(e,(e,t)=>O(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!w(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!w(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function T(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=D(e)&&D(t);if(!r&&!(O(e)&&O(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=T(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function D(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!k(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!k(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function k(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{f.setTimeout(t,e)})}function A(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:T(e,t)}function ne(e){return e}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var j=Symbol();function M(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===j?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function N(e,t){return typeof e==`function`?e(...t):!!e}function ae(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var oe=()=>m,P=()=>oe(),F=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},I=new class extends F{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},se=p;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=ce(),R=new class extends F{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)!==`online`||R.isOnline()}var B=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function V(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(h);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new B(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>I.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),p=()=>z(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(P()?0:3),a=e.retryDelay??le,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),te(o).then(()=>f()?void 0:_(f)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():_(p).then(v),s)}}var H=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(P()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ae(e,()=>t.signal,()=>n=!0)},u=M(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?W:U,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:U(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function U(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function de(e,t){return t?U(e,t)!=null:!1}function fe(e,t){return!t||!e.getPreviousPageParam?!1:W(e,t)!=null}var pe=class extends H{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=q(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=q(this.options);e.data!==void 0&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=A(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=M(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=V({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof B&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof B){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...G(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function G(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function q(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var me=class extends F{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),J(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&X(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return E(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#h(e){return!P()&&y(this.options.enabled,this.#t)!==!1&&_(e)}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#u=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return y(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=f.setInterval(()=>{(this.options.refetchIntervalInBackground||I.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(f.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(f.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&J(e,t),o=i&&X(e,n,t,r);(a||o)&&(l={...l,...G(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=A(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=A(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,b=_&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:Z(e,t),refetch:this.refetch,isEnabled:y(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),E(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();L.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function he(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||y(t.retryOnMount,e)!==!1)}function J(e,t){return he(e,t)||e.state.data!==void 0&&Y(e,t,t.refetchOnMount)}function Y(e,t,n){if(y(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=y(n,e);return r===`always`||r!==!1&&Z(e,t)}return!1}function X(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Z(e,n)}function Z(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}var Q=o.createContext(!1),ge=()=>o.useContext(Q);Q.Provider;function _e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ve=o.createContext(_e()),ye=()=>o.useContext(ve),be=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?N(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},xe=e=>{o.useEffect(()=>{e.clearReset()},[e])},Se=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||N(n,[e.error,r])),Ce=(e,t)=>t.state.data===void 0,we=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Te=(e,t)=>e?.suspense&&t.isPending,Ee=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function De(e,t,n){let r=ge(),i=ye(),a=l(n),s=a.defaultQueryOptions(e),c=a.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,we(s),be(s,i,c),xe(i);let[d]=o.useState(()=>new t(a,s)),f=d.getOptimisticResult(s),p=!r&&u;if(o.useSyncExternalStore(o.useCallback(e=>{let t=p?d.subscribe(L.batchCalls(e)):h;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),o.useEffect(()=>{d.setOptions(s)},[s,d]),Te(s,f))throw Ee(s,d,i);if(Se({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return s.notifyOnChangeProps?f:d.trackResult(f)}var $=3e3,Oe=15e3,ke=()=>r({queryKey:[`desk`],queryFn:()=>a(e=>e.desk()),refetchInterval:e=>{let t=e.state.data;return t!==void 0&&(t.running.length>0||t.notMoving.some(({reason:e})=>e._tag===`QueuedForWorker`))?$:Oe}}),Ae=({title:e,leading:t,counts:n,children:r,actions:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-wrap items-baseline gap-x-3 gap-y-1`,o),children:[(0,s.jsxs)(`h1`,{className:`flex items-baseline gap-2 text-xl font-semibold wrap-anywhere`,children:[t!==void 0&&(0,s.jsx)(`span`,{className:`flex h-7 shrink-0 items-center self-start`,children:t}),(0,s.jsx)(`span`,{className:`min-w-0`,children:e})]}),n!==void 0&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground tabular-nums`,children:n}),r,a!==void 0&&(0,s.jsx)(`div`,{className:`ml-auto flex items-center gap-2 self-center`,children:a})]}),je=({children:e,width:t=`prose`})=>(0,s.jsx)(`main`,{className:`px-4 pt-5 pb-6 md:px-5`,children:(0,s.jsx)(`div`,{className:i(`flex flex-col gap-4`,t===`prose`&&`max-w-3xl`),children:e})}),Me={lg:`lg:flex-row lg:items-start lg:justify-between lg:gap-6`,sm:`sm:flex-row sm:items-start sm:justify-between sm:gap-6`,never:``},Ne=({eyebrow:e,heading:t,facts:n,actions:r,actionsBeside:a,className:o})=>(0,s.jsxs)(`header`,{className:i(`flex flex-col gap-3`,Me[a],o),children:[(0,s.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e!==void 0&&(0,s.jsx)(`p`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground`,children:e}),t,n!==void 0&&(0,s.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 pt-0.5 text-sm text-muted-foreground`,children:n})]}),r!==void 0&&(0,s.jsx)(`div`,{className:`shrink-0`,children:r})]}),Pe=({icon:e,title:t,children:n})=>(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:t,children:[(0,s.jsx)(e,{"aria-hidden":`true`,className:`size-[1em] shrink-0 text-faint`}),n]});export{j as A,b as C,y as D,T as E,l as M,E as O,x as S,w as T,F as _,ke as a,S as b,me as c,fe as d,H as f,I as g,L as h,Ae as i,u as j,N as k,pe as l,R as m,Pe as n,De as o,V as p,Ne as r,Ce as s,je as t,de as u,g as v,h as w,ne as x,C as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t}from"./button-4rhhIcK8.js";import{t as n}from"./mark-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t}from"./button-4rhhIcK8.js";import{t as n}from"./mark-uyeJ8aPC.js";var r=e(),i=({pullRequests:e,linked:i=!0,className:a})=>e.length===0?null:(0,r.jsx)(`span`,{className:t(`inline-flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,a),children:e.map(e=>(0,r.jsx)(n,{item:e,linked:i},e.number))});export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as e}from"./overview-C73v5kbv.js";import{v as t}from"./strings-DXB6PB2g.js";var n=5e3,r=()=>e({queryKey:[`configuration`],queryFn:()=>t(e=>e.configuration()),refetchInterval:n}),i=()=>e({queryKey:[`agents`],queryFn:()=>t(e=>e.agents())});export{r as n,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as e,a as t}from"./page-C47YAWAl.js";import{o as n,u as r}from"./error-alert-hABzwCSY.js";import{P as i,n as a}from"./overview-C73v5kbv.js";import{B as o,Bn as s,E as c,F as l,Gt as u,I as d,J as f,R as p,T as m,Y as h,bn as g,gn as _,hn as v,k as y,q as b,rn as x,v as S,vn as C}from"./strings-DXB6PB2g.js";import{n as w,t as T}from"./queries-BZMW2wiD.js";function E(e){return e}var D=x(b),O=x(o),k=e=>(e.key.kind===`agent`?u(D)(e.value).pipe(v(l)):e.key.kind===`loop`?u(O)(e.value).pipe(v(d)):g(p(e.value))).pipe(_(t=>new y({problems:[new f({file:h.make(e.key.key),stage:`schema`,expression:s(),message:t.message})]}))),A=5e3,j=()=>{let t=e();return r({mutationFn:({loop:e,paused:t})=>S(n=>n[t?`unpause`:`pause`]({params:{loop:e}})),onSuccess:()=>Promise.all([t.invalidateQueries({queryKey:w().queryKey}),t.invalidateQueries({queryKey:a().queryKey})])})},M=()=>i({queryKey:[`upgrade`],queryFn:()=>S(e=>e.upgradeStatus({})),refetchInterval:A,retry:3}),N=[`configuration-editor`],P=e=>i({queryKey:[...N,`entity`,e.kind,e.identifier],queryFn:()=>S(t=>t.configurationEntity({params:e}))}),F=e=>E({queryKey:[...N,`history`,e?.kind,e?.identifier],initialPageParam:void 0,queryFn:({pageParam:t})=>S(n=>n.configurationRevisions({query:t===void 0?{...e,limit:50}:{...e,before:t,limit:50}})),getNextPageParam:e=>e.nextBefore??void 0}),I=e=>i({queryKey:[...N,`revision`,e],queryFn:async()=>{let t=await S(t=>t.configurationRevision({params:{number:e}})),n=await Promise.all(t.changes.map(async e=>({...e,beforeText:e.before===null?``:await C(k(new c({key:e.key,value:e.before}))),afterText:e.after===null?``:await C(k(new c({key:e.key,value:e.after})))})));return{...t,changes:n}}}),L=()=>{let i=e();return r({mutationFn:e=>{switch(e.action){case`save`:return S(t=>t.replaceConfigurationEntity({params:e.key,payload:e.payload}));case`delete`:return S(t=>t.deleteConfigurationEntity({params:e.key,payload:new m(e.payload)}));case`revert`:return S(t=>t.revertConfigurationRevision({params:{number:e.number},payload:new m(e.payload)}))}},onSuccess:()=>Promise.all([N,w().queryKey,a().queryKey,T().queryKey,t().queryKey,n].map(e=>i.invalidateQueries({queryKey:e}))),onError:()=>Promise.all([i.invalidateQueries({queryKey:w().queryKey}),i.invalidateQueries({queryKey:N})])})},R=()=>i({queryKey:[...N,`capabilities`],queryFn:()=>S(e=>e.configurationCapabilities({})),staleTime:1/0}),z=()=>i({queryKey:[...N,`installation-repositories`],queryFn:()=>S(e=>e.configurationRepositories({}))}),B=e=>i({queryKey:[...N,`labels`,e],queryFn:()=>S(t=>t.configurationLabels({params:{repository:e}}))});export{I as a,L as c,B as i,j as l,P as n,F as o,z as r,M as s,R as t,D as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{d as t,l as n,m as r,s as i,t as a}from"./section-eyIYzZrG.js";import{t as o}from"./useSuspenseQuery-DbhQN-t-.js";import{n as s}from"./useNavigate-AT5VkfZa.js";import{t as c}from"./link-C7GfYrMt.js";import{D as l}from"./button-4rhhIcK8.js";import{Dt as u}from"./strings-DXB6PB2g.js";import{n as d}from"./queries-BZMW2wiD.js";import{tt as f}from"./index-Dki55xSv.js";import{a as p,i as m,n as h,o as g,r as _,t as v}from"./table-hbKjhjeL.js";import{t as y}from"./fill-cell-CjksmixH.js";import{t as b}from"./repositories-D4wYJfa_.js";var x=e(),S=e=>{let t=[...e.declaredLabels,...b(e)];if(t.length===0)return{text:`No labels`,problem:!1};if(t.some(({onGitHub:e})=>e===null))return{text:`Not polled yet`,problem:!1};let n=e=>new Set(e.map(({name:e})=>e.toLowerCase())).size,r=n(t.filter(({failure:e})=>e!==null)),i=n(t.filter(({onGitHub:e})=>e===!1)),a=[...r>0?[`${r} failed`]:[],...i>0?[`${i} missing on GitHub`]:[]];return a.length===0?{text:`All on GitHub`,problem:!1}:{text:a.join(`, `),problem:!0}},C=({repository:e})=>{let r=s(),i=u(e.name),a=S(e);return(0,x.jsxs)(n,{open:()=>void r({to:`/configuration/repositories/$owner/$name`,params:i}),children:[(0,x.jsx)(_,{className:`py-3`,children:(0,x.jsxs)(c,{to:`/configuration/repositories/$owner/$name`,params:i,onClick:e=>e.stopPropagation(),className:l(t,`flex w-fit items-center gap-2`),children:[(0,x.jsx)(f,{repository:e.name}),e.name]})}),(0,x.jsx)(_,{className:`hidden @2xl:table-cell`,children:e.tags.length===0?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):e.tags.join(`, `)}),(0,x.jsx)(_,{className:`text-right tabular-nums`,children:e.lanes.length===0?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Proposed`}):e.lanes.length}),(0,x.jsx)(_,{className:l(`max-sm:whitespace-normal`,a.problem?`text-destructive`:`text-muted-foreground`),children:a.text}),(0,x.jsx)(y,{className:`hidden whitespace-normal text-muted-foreground sm:table-cell`,children:e.loops.length===0?`No loop`:e.loops.join(`, `)})]})},w=({configuration:e})=>(0,x.jsx)(a,{title:`Repositories`,createKind:`repository`,counts:`${e.repositories.length} ${e.repositories.length===1?`repository`:`repositories`}`,children:e.repositories.length===0?(0,x.jsx)(i,{title:`No repositories registered`,children:r}):(0,x.jsx)(`div`,{className:`@container -mx-2`,children:(0,x.jsxs)(v,{children:[(0,x.jsx)(p,{children:(0,x.jsxs)(g,{className:`hover:bg-transparent`,children:[(0,x.jsx)(m,{children:`Repository`}),(0,x.jsx)(m,{className:`hidden @2xl:table-cell`,children:`Tags`}),(0,x.jsx)(m,{className:`text-right`,children:`Lanes`}),(0,x.jsx)(m,{children:`Labels`}),(0,x.jsx)(m,{className:`hidden sm:table-cell`,children:`Loops`})]})}),(0,x.jsx)(h,{children:e.repositories.map(e=>(0,x.jsx)(C,{repository:e},e.name))})]})})}),T=()=>{let{data:e}=o(d());return(0,x.jsx)(w,{configuration:e})};export{T as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./index-Dki55xSv.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e}from"./index-Dki55xSv.js";var t=e;export{t as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./useRouter-Hur3RN7j.js";import{t as n}from"./boot-screen-Su4MyrBh.js";import{t as r}from"./button-4rhhIcK8.js";import{h as i,l as a,u as o,y as s}from"./strings-
|
|
1
|
+
import{r as e,t}from"./useRouter-Hur3RN7j.js";import{t as n}from"./boot-screen-Su4MyrBh.js";import{t as r}from"./button-4rhhIcK8.js";import{h as i,l as a,u as o,y as s}from"./strings-DXB6PB2g.js";var c=e(),l=()=>(0,c.jsx)(n,{title:`usine`,description:a,inPanel:!0}),u=({error:e})=>{let a=t();return(0,c.jsx)(n,{title:o,description:s(e),tone:`error`,inPanel:!0,children:(0,c.jsx)(r,{variant:`outline`,onClick:()=>void a.invalidate(),children:i})})};export{l as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-DGpeFNCC.js";var t=e;export{t as errorComponent};
|