feat(ui): workflow list shows running count and latest run result

This commit is contained in:
sam committed 2026-10-10 11:50:27 +11:00
1 parent de22c721e7
commit b8ec1d7987
2 files changed
+22 -5

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ Defaulting to \`null\`.`),null)}function Ps(e){return Ms(e)&&!Number.isNaN(e)&&e
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=hd(c),u=e+1<n.length?hd(n[e+1]):null;if(l&&u&&gd(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=hd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>pd(e)),rows:r.map(e=>e.map(e=>pd(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:pd(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:pd(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function hd(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function gd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var _d={class:`[overflow-wrap:anywhere]`},vd={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},yd={class:`font-mono text-[0.85em]`},bd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},xd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Sd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Cd={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},wd={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Td={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Ed={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Dd={key:8,class:`mb-2.5 last:mb-0`},Od=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>md(t.text));return(e,t)=>(R(),G(`div`,_d,[(R(!0),G(H,null,K(n.value,(e,t)=>(R(),G(H,{key:t},[e.kind===`pre`?(R(),G(`pre`,vd,[W(`code`,yd,V(e.code),1)])):e.kind===`table`?(R(),G(`table`,bd,[W(`thead`,null,[W(`tr`,null,[(R(!0),G(H,null,K(e.head,(e,t)=>(R(),G(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(dd,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(R(!0),G(H,null,K(e.rows,(e,t)=>(R(),G(`tr`,{key:t},[(R(!0),G(H,null,K(e,(e,t)=>(R(),G(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(dd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),G(`blockquote`,xd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),G(`h1`,Sd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),G(`h2`,Cd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),G(`h3`,wd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),G(`ul`,Td,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(dd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),G(`ol`,Ed,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(dd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),G(`p`,Dd,[M(dd,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),kd={class:`truncate`},Ad=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Re(`RouterLink`);return R(),q(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:j(()=>[M(z(Wt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,kd,V(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),jd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Md={class:`font-semibold text-foreground`},Nd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Pd=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(R(),q(Ad,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),G(`div`,jd,[M(z(qn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Md,V(n.value),1),r.value?(R(),G(`code`,Nd,V(r.value),1)):L(``,!0),W(`span`,{class:N(z(Y)(`text-fg-muted`,i.value&&`text-danger`))},V(a.value),3)]))}}),Fd={key:0,class:`mb-2 grid gap-0.5 text-xs`},Id={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Ld={key:3,class:`whitespace-pre-wrap`},Rd=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),G(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:N(z(Y)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(R(),G(`div`,Fd,[(R(!0),G(H,null,K(e.tools,(t,n)=>(R(),q(Pd,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),G(`div`,Id,[(R(!0),G(H,null,K(e.media,(e,t)=>(R(),q(id,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),q(Od,{key:2,text:e.text},null,8,[`text`])):(R(),G(`div`,Ld,V(e.text),1)),P(t.$slots,`default`)],2)],2))}}),zd={class:`text-sm`},Bd={class:`font-medium`},Vd={key:0,class:`mt-1 text-fg-muted`},Hd={key:1,class:`mt-2 flex flex-wrap gap-2`},Ud=k({__name:`ChatChLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Qg?`${n.slice(0,Qg).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var e_=[`title`],t_=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>Tg(n.event)),a=I(()=>$g(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=I(()=>n.event.at?Dh(n.event.at):`—`);return(e,t)=>(R(),q(z(Yg),{class:N(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Ot(Dt(o,[`prevent`]),[`enter`]),Ot(Dt(o,[`prevent`]),[`space`])]},{default:j(()=>[M(z($),{class:`font-medium`},{default:j(()=>[A(V(n.event.kind||n.event.type||`event`),1)]),_:1}),M(z($),{class:`font-mono`},{default:j(()=>[A(V(i.value>0?`#${i.value}`:`—`),1)]),_:1}),M(z($),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},V(a.value.text),9,e_)]),_:1}),M(z($),null,{default:j(()=>[A(V(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),n_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function r_(e){return(Number(e?.task_id)||0)>0}function i_(e,t){return t===`tasks`?r_(e):t!==`system`||!r_(e)}function a_(e,t){return e.filter(e=>i_(e,t))}function o_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function s_(e,t){return`${e}:${t??0}`}function c_(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=s_($g(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var l_={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},u_={class:`max-h-[28rem] overflow-y-auto`},d_=[`aria-expanded`,`aria-label`,`onClick`],f_=[`title`],p_=k({__name:`LiveActivityCard`,setup(e){let t=Af(),{activity:n,streamKind:r,streamState:i}=Ae(ee()),a=J(`all`),o=I(()=>a_(n.value,a.value)),s=I(()=>o_(o.value.length,a.value)),c=tt(new Set),l=I(()=>c_(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return $g(e.representative)}function p(e){return e.representative.at?Dh(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(R(),q(z(bh),null,{default:j(()=>[M(z(Th),null,{default:j(()=>[M(z(Eh),null,{default:j(()=>[...t[1]||=[A(`Live activity`,-1)]]),_:1}),M(z(xh),{class:`flex items-center gap-2`},{default:j(()=>[M(z(Gg),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:z(n_)},null,8,[`modelValue`,`options`]),M(z(It),{variant:z(r)},{default:j(()=>[A(V(z(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),M(z(Sh),null,{default:j(()=>[W(`div`,l_,[W(`div`,u_,[M(z(qg),null,{default:j(()=>[M(z(Zg),{class:`sticky top-0 z-10 bg-card`},{default:j(()=>[M(z(Yg),null,{default:j(()=>[M(z(Xg),null,{default:j(()=>[...t[2]||=[A(`Event`,-1)]]),_:1}),M(z(Xg),null,{default:j(()=>[...t[3]||=[A(`Task`,-1)]]),_:1}),M(z(Xg),null,{default:j(()=>[...t[4]||=[A(`Detail`,-1)]]),_:1}),M(z(Xg),null,{default:j(()=>[...t[5]||=[A(`When`,-1)]]),_:1})]),_:1})]),_:1}),M(z(Jg),null,{default:j(()=>[o.value.length?L(``,!0):(R(),q(z(Yg),{key:0},{default:j(()=>[M(z($),{colspan:`4`},{default:j(()=>[M(z(dh),null,{default:j(()=>[M(z(mh),null,{default:j(()=>[M(z(_h),null,{default:j(()=>[A(V(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(R(!0),G(H,{key:1},K(l.value,e=>(R(),G(H,{key:e.key},[e.count===1?(R(),q(t_,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(R(),G(H,{key:1},[M(z(Yg),{class:N(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Ot(Dt(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Ot(Dt(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:j(()=>[M(z($),{class:`font-medium`},{default:j(()=>[W(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:Dt(t=>u(e.key),[`stop`])},[d(e)?(R(),q(z(Zt),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(R(),q(z(Qt),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),A(` `+V(e.label)+` `,1),M(z(It),{variant:`idle`},{default:j(()=>[A(`×`+V(e.count),1)]),_:2},1024)],8,d_)]),_:2},1024),M(z($),{class:`font-mono`},{default:j(()=>[A(V(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),M(z($),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},V(f(e).text),9,f_)]),_:2},1024),M(z($),null,{default:j(()=>[A(V(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(R(!0),G(H,{key:0},K(e.events,(t,n)=>(R(),q(t_,{key:`${e.key}:${n}`,event:t,onOpen:m},null Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function Nv(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function Pv(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function Fv(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function Iv(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var Lv=J([]),Rv=J([]),zv=J(!0),Bv=J(null),Vv=J(null),Hv=J(!1),Uv=J(null);async function Wv(){try{let e=await X.eventTypes();zv.value=e.enabled!==!1,Lv.value=e.event_types||[],Rv.value=e.proposals||[],Bv.value=null}catch(e){Bv.value=e.message||String(e)}}function Gv(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Kv(e){Uv.value=null,Vv.value=e}function qv(e){let t=ty.value.find(t=>String(t.id)===e.sample_id);Kv({mode:`proposal`,id:null,source:e.source,name:``,rule:Gv(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Jv(e=``){Kv({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Yv(e){Kv({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Gv(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Xv(){Vv.value=null}async function Zv(){let e=Vv.value;if(e){Hv.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:Iv(e.rule)});else{let t=e.mode===`paste`?Mv(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Iv(e.rule),example:{headers:t,body:e.body}})}Vv.value=null,await Wv()}catch(e){Uv.value=e.message||String(e)}finally{Hv.value=!1}}}var Qv=J(null);async function $v(){let e=Qv.value;if(Qv.value=null,e)try{await X.eventTypeDelete(e.id),await Wv()}catch(e){Bv.value=e.message||String(e)}}var ey=100,ty=J([]),ny=J(!0),ry=J(null),iy=J(!0),ay=J(null);async function oy(){try{let e=await X.captures(ey);ny.value=e.enabled!==!1,ty.value=e.captures||[],ry.value=null}catch(e){ry.value=e.message||String(e)}finally{iy.value=!1}}function sy(e){let t=ty.value.find(t=>t.id===e);return t&&(ay.value=t),!!t}function cy(){ty.value.length&&(ay.value=ty.value[0])}function ly(){ce(`captures`,()=>{oy(),Wv()})}var uy={key:0,class:`text-xs text-fg-muted`},dy={key:1,class:`flex flex-col gap-1 text-xs`},fy={key:1},py={key:2,class:`text-xs text-fg-muted`},my=k({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=J([]),r=J(!1);F(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await X.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Re(`RouterLink`);return r.value?(R(),G(`p`,uy,`Dispatches unavailable.`)):n.value.length?(R(),G(`ul`,dy,[(R(!0),G(H,null,K(n.value,e=>(R(),G(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?L(``,!0):(R(),q(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:j(()=>[A(`binding `+V(e.binding_id.slice(0,8))+` v`+V(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?L(``,!0):(R(),q(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:j(()=>[A(`capture `+V(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?L(``,!0):(R(),G(H,{key:2},[e.task_id?(R(),q(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:j(()=>[A(`task #`+V(e.task_id),1)]),_:2},1032,[`to`])):(R(),G(`span`,fy,V(e.reason||`claimed, no task recorded`),1))],64)),W(`span`,null,V(z(Dh)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?L(``,!0):(R(),G(`p`,py,` No dispatches yet. `))}}}),hy=k({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),q(z(pn),{role:`status`,"aria-label":`Loading`,class:N(z(Y)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function gy(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function _y(e){return(e?.repository??`required`)!==`none`}function vy(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function yy(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var by={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},xy={pending_approval:`warn`,armed:`ok`,paused:`idle`};function Sy(e) Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function Nv(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function Pv(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function Fv(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function Iv(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var Lv=J([]),Rv=J([]),zv=J(!0),Bv=J(null),Vv=J(null),Hv=J(!1),Uv=J(null);async function Wv(){try{let e=await X.eventTypes();zv.value=e.enabled!==!1,Lv.value=e.event_types||[],Rv.value=e.proposals||[],Bv.value=null}catch(e){Bv.value=e.message||String(e)}}function Gv(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Kv(e){Uv.value=null,Vv.value=e}function qv(e){let t=ty.value.find(t=>String(t.id)===e.sample_id);Kv({mode:`proposal`,id:null,source:e.source,name:``,rule:Gv(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Jv(e=``){Kv({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Yv(e){Kv({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Gv(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Xv(){Vv.value=null}async function Zv(){let e=Vv.value;if(e){Hv.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:Iv(e.rule)});else{let t=e.mode===`paste`?Mv(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Iv(e.rule),example:{headers:t,body:e.body}})}Vv.value=null,await Wv()}catch(e){Uv.value=e.message||String(e)}finally{Hv.value=!1}}}var Qv=J(null);async function $v(){let e=Qv.value;if(Qv.value=null,e)try{await X.eventTypeDelete(e.id),await Wv()}catch(e){Bv.value=e.message||String(e)}}var ey=100,ty=J([]),ny=J(!0),ry=J(null),iy=J(!0),ay=J(null);async function oy(){try{let e=await X.captures(ey);ny.value=e.enabled!==!1,ty.value=e.captures||[],ry.value=null}catch(e){ry.value=e.message||String(e)}finally{iy.value=!1}}function sy(e){let t=ty.value.find(t=>t.id===e);return t&&(ay.value=t),!!t}function cy(){ty.value.length&&(ay.value=ty.value[0])}function ly(){ce(`captures`,()=>{oy(),Wv()})}var uy={key:0,class:`text-xs text-fg-muted`},dy={key:1,class:`flex flex-col gap-1 text-xs`},fy={key:1},py={key:2,class:`text-xs text-fg-muted`},my=k({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=J([]),r=J(!1);F(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await X.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Re(`RouterLink`);return r.value?(R(),G(`p`,uy,`Dispatches unavailable.`)):n.value.length?(R(),G(`ul`,dy,[(R(!0),G(H,null,K(n.value,e=>(R(),G(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?L(``,!0):(R(),q(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:j(()=>[A(`binding `+V(e.binding_id.slice(0,8))+` v`+V(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?L(``,!0):(R(),q(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:j(()=>[A(`capture `+V(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?L(``,!0):(R(),G(H,{key:2},[e.task_id?(R(),q(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:j(()=>[A(`task #`+V(e.task_id),1)]),_:2},1032,[`to`])):(R(),G(`span`,fy,V(e.reason||`claimed, no task recorded`),1))],64)),W(`span`,null,V(z(Dh)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?L(``,!0):(R(),G(`p`,py,` No dispatches yet. `))}}}),hy=k({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),q(z(pn),{role:`status`,"aria-label":`Loading`,class:N(z(Y)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function gy(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function _y(e){return(e?.repository??`required`)!==`none`}function vy(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function yy(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var by={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},xy={pending_approval:`warn`,armed:`ok`,paused:`idle`};function Sy(e) Line truncated
`)}};PL.defaultYaml={explicit:!1,version:`1.2`},PL.defaultTags={"!!":`tag:yaml.org,2002:`};function FL(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function IL(e){let t=new Set;return DL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function LL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function RL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=IL(e);let a=LL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(yL(t.node)||xL(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function zL(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=zL(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=zL(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=zL(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=zL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function BL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>BL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!CL(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var VL=class{constructor(e){Object.defineProperty(this,mL,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!gL(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=BL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?zL(i,{"":o},``,o):o}},HL=class extends VL{constructor(e){super(cL),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],DL(e,{Node:(e,t)=>{(hL(t)||CL(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(BL(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=UL(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(FL(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function UL(e,t,n){if(hL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(xL(t)){let r=0;for(let i of t.items){let t=UL(e,i,n);t>r&&(r=t)}return r}if(vL(t)){let r=UL(e,t.key,n),i=UL(e,t.value,n);return Math.max(r,i)}return 1}var WL=e=>!e||typeof e!=`function`&&typeof e!=`object`,GL=class extends VL{constructor(e){super(fL),this.value=e}toJSON(e,t){return t?.keep?this.value:BL(this.value,e,t)}toString(){return String(this.value)}};GL.BLOCK_FOLDED=`BLOCK_FOLDED`,GL.BLOCK_LITERAL=`BLOCK_LITERAL`,GL.PLAIN=`PLAIN`,GL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,GL.QUOTE_SINGLE=`QUOTE_SINGLE`;var KL=`tag:yaml.org,2002:`;function qL(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function JL(e,t,n){if(gL(e)&&(e=e.contents),SL(e))return e;if(vL(e)){let t=n.schema[uL].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new HL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=KL+t.slice(2));let l=qL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new GL(e);return c&&(c.node=t),t Line truncated
`)?$L(n,t):n.includes(`
`)?`
@@ -147,4 +147,4 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},qQ=class extends Error{constructor(e,...t){super(KQ[e]?.call(KQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function JQ(e){return`clientX`in e}function YQ(e){return`sourceEvent`in e}function XQ(e,t){let n=JQ(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var ZQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function QQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function $Q(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var e$=()=>!0;function t$(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function n$(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())UZ(i,HZ(e))>0&&r.push(e);return r}var r$=250;function i$(e,t,n,r){let i=[],a=1/0,o=n$(e,n,t+r$);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=VQ(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function a$(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=e$},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=XQ(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=o$(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===TZ.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=l$(t,e,a,p,n,!0)}return b}function o$(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function s$(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function c$(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function l$(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===TZ.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...VQ(o,c,c.position,!0)}:c}var u$={[SZ.Left]:SZ.Right,[SZ.Right]:SZ.Left,[SZ.Top]:SZ.Bottom,[SZ.Bottom]:SZ.Top},d$=[`production`,`prod`];function f$(e,...t){p$()&&console.warn(`[Vue Flow]: ${e}`,...t)}function p$(){return!d$.includes(`production`)}function m$(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...WZ(t)}}):null}function h$(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ft(()=>{o.blur()})):n([e])}function g$(e){return z(e)!==void 0}function _$(e,t,n,r){if(!e||!e.source||!e.target)return n(new qQ(GQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=JZ(e)?e:{...e,id:iQ(e)},i=eQ(i,void 0,r),!aQ(i,t)&&i}function v$(e,t,n,r,i){if(!t.source||!t.target)return i(new qQ(GQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new qQ(GQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?iQ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function y$(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!YZ(o)){n(new qQ(GQ.NODE_INVALID,o?.id));continue}let s=$Z(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new qQ(GQ.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function b$(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function x$(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;b$(`source`,o,`${r}-${a}--Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},qQ=class extends Error{constructor(e,...t){super(KQ[e]?.call(KQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function JQ(e){return`clientX`in e}function YQ(e){return`sourceEvent`in e}function XQ(e,t){let n=JQ(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var ZQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function QQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function $Q(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var e$=()=>!0;function t$(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function n$(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())UZ(i,HZ(e))>0&&r.push(e);return r}var r$=250;function i$(e,t,n,r){let i=[],a=1/0,o=n$(e,n,t+r$);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=VQ(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function a$(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=e$},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=XQ(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=o$(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===TZ.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=l$(t,e,a,p,n,!0)}return b}function o$(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function s$(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function c$(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function l$(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===TZ.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...VQ(o,c,c.position,!0)}:c}var u$={[SZ.Left]:SZ.Right,[SZ.Right]:SZ.Left,[SZ.Top]:SZ.Bottom,[SZ.Bottom]:SZ.Top},d$=[`production`,`prod`];function f$(e,...t){p$()&&console.warn(`[Vue Flow]: ${e}`,...t)}function p$(){return!d$.includes(`production`)}function m$(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...WZ(t)}}):null}function h$(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ft(()=>{o.blur()})):n([e])}function g$(e){return z(e)!==void 0}function _$(e,t,n,r){if(!e||!e.source||!e.target)return n(new qQ(GQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=JZ(e)?e:{...e,id:iQ(e)},i=eQ(i,void 0,r),!aQ(i,t)&&i}function v$(e,t,n,r,i){if(!t.source||!t.target)return i(new qQ(GQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new qQ(GQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?iQ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function y$(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!YZ(o)){n(new qQ(GQ.NODE_INVALID,o?.id));continue}let s=$Z(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new qQ(GQ.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function b$(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function x$(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;b$(`source`,o,`${r}-${a}--Line truncated
+20 -3
View File
@@ -85,6 +85,19 @@ const rows = computed(() =>
})),
),
);
// What each workflow is doing now, from the live task list: how many runs are
// working, and how the newest run ended up.
const live = computed(() => {
const byWorkflow = new Map<string, { running: number; last?: RunTask }>();
for (const run of runs.value) {
if (!run.workflow) continue;
const entry = byWorkflow.get(run.workflow) ?? { running: 0 };
if (run.status === "running") entry.running++;
if (!entry.last || Number(run.id) > Number(entry.last.id)) entry.last = run;
byWorkflow.set(run.workflow, entry);
}
return byWorkflow;
});
const selected = ref("");
watchEffect(() => {
if (!selected.value && rows.value.length) selected.value = rows.value[0]!.id;
@@ -174,12 +187,16 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
<span class="min-w-0 flex-1 truncate font-mono text-[13px]" :class="row.id === selected && 'font-medium'">{{ row.id }}</span>
<span class="font-mono text-xs text-fg-subtle">{{ row.avg_tokens ? compact(row.avg_tokens) : "–" }}</span>
</span>
<span class="mt-1.5 flex items-center gap-2 text-xs text-fg-subtle">
<span class="w-20 shrink-0">{{ row.runs || 0 }} runs</span>
<span v-if="row.runs" class="mt-1.5 flex items-center gap-2 text-xs text-fg-subtle">
<span v-if="live.get(row.id)?.running" class="flex w-20 shrink-0 items-center gap-1.5 text-info">
<span class="size-1.5 animate-pulse rounded-full bg-current" aria-hidden="true" />{{ live.get(row.id)?.running }} running
</span>
<span v-else-if="live.get(row.id)?.last" class="w-20 shrink-0 truncate" :title="`Latest run: ${statusLabel(live.get(row.id)?.last?.status ?? '')}`">{{ statusLabel(live.get(row.id)?.last?.status ?? "") }}</span>
<span v-else class="w-20 shrink-0">{{ row.runs }} runs</span>
<span class="h-1 flex-1 overflow-hidden rounded-full bg-secondary">
<span class="block h-full rounded-full bg-primary" :style="{ width: `${rate(delivered(row), row.runs) * 100}%` }" />
</span>
<span class="w-16 shrink-0 text-right font-mono">{{ delivered(row) }} of {{ row.runs || 0 }}</span>
<span class="w-16 shrink-0 text-right font-mono">{{ delivered(row) }} of {{ row.runs }}</span>
</span>
</button>
</li>