fix(ui): load task debug reliably and copy JSON output
This commit is contained in:
3 files changed
+37
-22
No files matched your search
Vendored
+12
-12
@@ -16,9 +16,9 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
||||
Defaulting to \`null\`.`),null)}function TS(e){return CS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${bS}\`.`),bS)}var ES=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:bS},getValueLabel:{type:Function,required:!1,default:(e,t)=>CS(e)?`${Math.round(e/t*bS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Q();let i=wh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=wh(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=wS(e,n.max);t!==e&&(await Kn(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=TS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>Vm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return SS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(kg),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":CS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),DS=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=xS();return Q(),(e,r)=>(V(),U(P(kg),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),OS=`radio.select`;function kS(e,t,n){Bm(OS,n,{originalEvent:e,value:t})}var AS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=wh(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=_n(n),{forwardRef:o,currentElement:s}=Q(),c=Jh(s),l=Zh(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||kS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(kg),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:Bl(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(iv),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[jS,MS]=Rm(`RadioGroupRoot`),NS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Q(),o=wh(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=_n(n),p=Uh(f),m=Jh(a);return MS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P(Bb),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(kg),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(iv),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Iee,PS]=Rm(`RadioGroupItem`),FS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:kE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>kE(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
|
||||
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=jE(c),u=e+1<n.length?jE(n[e+1]):null;if(l&&u&&ME(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=jE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>kE(e)),rows:r.map(e=>e.map(e=>kE(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:kE(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]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:kE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function jE(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 ME(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var NE={class:`[overflow-wrap:anywhere]`},PE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},FE={class:`font-mono text-[0.85em]`},IE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},LE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},RE={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},zE={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},BE={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},VE={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},HE={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},UE={key:8,class:`mb-2.5 last:mb-0`},WE=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>AE(t.text));return(e,t)=>(V(),H(`div`,NE,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,PE,[W(`code`,FE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,IE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(DE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(DE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,LE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,RE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,zE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,BE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,VE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(DE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,HE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(DE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,UE,[G(DE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),Ree={class:`truncate`},zee=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Qi(`RouterLink`);return V(),U(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:F(()=>[G(P(Xu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Ree,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Bee={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Vee={class:`font-semibold text-foreground`},Hee={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Uee=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>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?(V(),U(zee,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,Bee,[G(P(Zd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Vee,M(n.value),1),r.value?(V(),H(`code`,Hee,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),Wee={key:0,class:`mb-2 grid gap-0.5 text-xs`},Gee={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Kee={key:3,class:`whitespace-pre-wrap`},GE=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`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?(V(),H(`div`,Wee,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(Uee,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,Gee,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(bE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(WE,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,Kee,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),qee={class:`w-full self-center justify-self-center py-6 text-center`},Jee={class:`grid gap-2`},Yee=[`onClick`],Xee=L({__name:`ChatELine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Hj?`${n.slice(0,Hj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Wj=[`title`],Gj=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>mj(n.event)),a=Y(()=>Uj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?SA(n.event.at):`—`);return(e,t)=>(V(),U(P(zj),{class:j(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:[Hl(Bl(o,[`prevent`]),[`enter`]),Hl(Bl(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P(Rj),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P(Rj),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P(Rj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,Wj)]),_:1}),G(P(Rj),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Kj=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function qj(e){return(Number(e?.task_id)||0)>0}function Jj(e,t){return t===`tasks`?qj(e):t!==`system`||!qj(e)}function Yj(e,t){return e.filter(e=>Jj(e,t))}function Xj(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Zj(e,t){return`${e}:${t??0}`}function Qj(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Zj(Uj(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var $j={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},eM={class:`max-h-[28rem] overflow-y-auto`},tM=[`aria-expanded`,`aria-label`,`onClick`],nM=[`title`],rM=L({__name:`LiveActivityCard`,setup(e){let t=oD(),{activity:n,streamKind:r,streamState:i}=Fu(Tk()),a=N(`all`),o=Y(()=>Yj(n.value,a.value)),s=Y(()=>Xj(o.value.length,a.value)),c=qt(new Set),l=Y(()=>Qj(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 Uj(e.representative)}function p(e){return e.representative.at?SA(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(hA),null,{default:F(()=>[G(P(bA),null,{default:F(()=>[G(P(xA),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(gA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(Pj),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(Kj)},null,8,[`modelValue`,`options`]),G(P(fA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(_A),null,{default:F(()=>[W(`div`,$j,[W(`div`,eM,[G(P(Ij),null,{default:F(()=>[G(P(Vj),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(zj),null,{default:F(()=>[G(P(Bj),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(Bj),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(Bj),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(Bj),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(Lj),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(zj),{key:0},{default:F(()=>[G(P(Rj),{colspan:`4`},{default:F(()=>[G(P(iA),null,{default:F(()=>[G(P(sA),null,{default:F(()=>[G(P(uA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(Gj,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(zj),{class:j(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:[Hl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Hl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P(Rj),{class:`font-medium`},{default:F(()=>[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:Bl(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(rd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(id),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(fA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,tM)]),_:2},1024),G(P(Rj),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P(Rj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,nM)]),_:2},1024),G(P(Rj),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(Gj,{key:`${e.key}:${n}`,ev
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 wN(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 TN(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 EN(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 DN(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 ON=N([]),kN=N([]),AN=N(!0),jN=N(null),MN=N(null),NN=N(!1),PN=N(null);async function FN(){try{let e=await Z.eventTypes();AN.value=e.enabled!==!1,ON.value=e.event_types||[],kN.value=e.proposals||[],jN.value=null}catch(e){jN.value=e.message||String(e)}}function IN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function LN(e){PN.value=null,MN.value=e}function RN(e){let t=KN.value.find(t=>String(t.id)===e.sample_id);LN({mode:`proposal`,id:null,source:e.source,name:``,rule:IN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function zN(e=``){LN({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function BN(e){LN({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:IN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function VN(){MN.value=null}async function HN(){let e=MN.value;if(e){NN.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:DN(e.rule)});else{let t=e.mode===`paste`?CN(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:DN(e.rule),example:{headers:t,body:e.body}})}MN.value=null,await FN()}catch(e){PN.value=e.message||String(e)}finally{NN.value=!1}}}var UN=N(null);async function WN(){let e=UN.value;if(UN.value=null,e)try{await Z.eventTypeDelete(e.id),await FN()}catch(e){jN.value=e.message||String(e)}}var GN=100,KN=N([]),qN=N(!0),JN=N(null),YN=N(!0),XN=N(null);async function ZN(){try{let e=await Z.captures(GN);qN.value=e.enabled!==!1,KN.value=e.captures||[],JN.value=null}catch(e){JN.value=e.message||String(e)}finally{YN.value=!1}}function QN(e){let t=KN.value.find(t=>t.id===e);return t&&(XN.value=t),!!t}function $N(){KN.value.length&&(XN.value=KN.value[0])}function eP(){Ek(`captures`,()=>{ZN(),FN()})}var tP=`archie.theme`,nP=`archie.density`,rP=`archie.motion`,iP=`archie.tooltips`;function aP(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function oP(e,t){try{localStorage.setItem(e,t)}catch{}}function sP(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var cP=Pu(`appearance`,()=>{let e=N(aP(tP,[`system`,`dark`,`light`],`dark`)),t=N(aP(nP,[`comfortable`,`compact`],`comfortable`)),n=N(aP(rP,[`system`,`reduced`],`system`)),r=N(aP(iP,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=sP(e.value)}function o(t){e.value=t,a(),oP(tP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,oP(nP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,oP(rP,e)}function l(e){r.value=e,oP(iP,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),lP=L({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Xh(n,t),{tooltipsEnabled:i}=Fu(cP());return(e,t)=>(V(),U(P(ZC),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(cs(t)))]),_:3},16,[`disabled`]))}}),uP=L({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Xh(_w(n,`class`),r);return(e,t)=>(V(),U(P(tw),null,{default:F(
Line truncated
|
||||
`)}),t}function jE(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 ME(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var NE={class:`[overflow-wrap:anywhere]`},PE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},FE={class:`font-mono text-[0.85em]`},IE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},LE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},RE={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},zE={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},BE={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},VE={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},HE={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Ree={key:8,class:`mb-2.5 last:mb-0`},zee=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>AE(t.text));return(e,t)=>(V(),H(`div`,NE,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,PE,[W(`code`,FE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,IE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(DE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(DE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,LE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,RE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,zE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,BE,[G(DE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,VE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(DE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,HE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(DE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,Ree,[G(DE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),Bee={class:`truncate`},Vee=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Qi(`RouterLink`);return V(),U(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:F(()=>[G(P(Xu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Bee,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Hee={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Uee={class:`font-semibold text-foreground`},Wee={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Gee=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>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?(V(),U(Vee,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,Hee,[G(P(Zd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Uee,M(n.value),1),r.value?(V(),H(`code`,Wee,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),Kee={key:0,class:`mb-2 grid gap-0.5 text-xs`},qee={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Jee={key:3,class:`whitespace-pre-wrap`},UE=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`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?(V(),H(`div`,Kee,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(Gee,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,qee,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(bE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(zee,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,Jee,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),Yee={class:`w-full self-center justify-self-center py-6 text-center`},Xee={class:`grid gap-2`},Zee=[`onClick`],Qee=L({__name:`CLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Bj?`${n.slice(0,Bj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Hj=[`title`],Uj=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>fj(n.event)),a=Y(()=>Vj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?bA(n.event.at):`—`);return(e,t)=>(V(),U(P(Lj),{class:j(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:[Hl(Bl(o,[`prevent`]),[`enter`]),Hl(Bl(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P(Ij),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P(Ij),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P(Ij),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,Hj)]),_:1}),G(P(Ij),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Wj=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Gj(e){return(Number(e?.task_id)||0)>0}function Kj(e,t){return t===`tasks`?Gj(e):t!==`system`||!Gj(e)}function qj(e,t){return e.filter(e=>Kj(e,t))}function Jj(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Yj(e,t){return`${e}:${t??0}`}function Xj(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Yj(Vj(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Zj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},Qj={class:`max-h-[28rem] overflow-y-auto`},$j=[`aria-expanded`,`aria-label`,`onClick`],eM=[`title`],tM=L({__name:`LiveActivityCard`,setup(e){let t=iD(),{activity:n,streamKind:r,streamState:i}=Fu(Ck()),a=N(`all`),o=Y(()=>qj(n.value,a.value)),s=Y(()=>Jj(o.value.length,a.value)),c=qt(new Set),l=Y(()=>Xj(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 Vj(e.representative)}function p(e){return e.representative.at?bA(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(pA),null,{default:F(()=>[G(P(vA),null,{default:F(()=>[G(P(yA),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(mA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(Mj),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(Wj)},null,8,[`modelValue`,`options`]),G(P(uA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(hA),null,{default:F(()=>[W(`div`,Zj,[W(`div`,Qj,[G(P(Pj),null,{default:F(()=>[G(P(zj),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(Lj),null,{default:F(()=>[G(P(Rj),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(Rj),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(Rj),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(Rj),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(Fj),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(Lj),{key:0},{default:F(()=>[G(P(Ij),{colspan:`4`},{default:F(()=>[G(P(nA),null,{default:F(()=>[G(P(aA),null,{default:F(()=>[G(P(cA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(Uj,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(Lj),{class:j(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:[Hl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Hl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P(Ij),{class:`font-medium`},{default:F(()=>[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:Bl(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(rd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(id),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(uA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,$j)]),_:2},1024),G(P(Ij),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P(Ij),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,eM)]),_:2},1024),G(P(Ij),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(Uj,{key:`${e.key}:${n}`,ev
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 SN(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 CN(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 wN(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 TN(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 EN=N([]),DN=N([]),ON=N(!0),kN=N(null),AN=N(null),jN=N(!1),MN=N(null);async function NN(){try{let e=await Z.eventTypes();ON.value=e.enabled!==!1,EN.value=e.event_types||[],DN.value=e.proposals||[],kN.value=null}catch(e){kN.value=e.message||String(e)}}function PN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function FN(e){MN.value=null,AN.value=e}function IN(e){let t=WN.value.find(t=>String(t.id)===e.sample_id);FN({mode:`proposal`,id:null,source:e.source,name:``,rule:PN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function LN(e=``){FN({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function RN(e){FN({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:PN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function zN(){AN.value=null}async function BN(){let e=AN.value;if(e){jN.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:TN(e.rule)});else{let t=e.mode===`paste`?xN(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:TN(e.rule),example:{headers:t,body:e.body}})}AN.value=null,await NN()}catch(e){MN.value=e.message||String(e)}finally{jN.value=!1}}}var VN=N(null);async function HN(){let e=VN.value;if(VN.value=null,e)try{await Z.eventTypeDelete(e.id),await NN()}catch(e){kN.value=e.message||String(e)}}var UN=100,WN=N([]),GN=N(!0),KN=N(null),qN=N(!0),JN=N(null);async function YN(){try{let e=await Z.captures(UN);GN.value=e.enabled!==!1,WN.value=e.captures||[],KN.value=null}catch(e){KN.value=e.message||String(e)}finally{qN.value=!1}}function XN(e){let t=WN.value.find(t=>t.id===e);return t&&(JN.value=t),!!t}function ZN(){WN.value.length&&(JN.value=WN.value[0])}function QN(){wk(`captures`,()=>{YN(),NN()})}var $N=`archie.theme`,eP=`archie.density`,tP=`archie.motion`,nP=`archie.tooltips`;function rP(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function iP(e,t){try{localStorage.setItem(e,t)}catch{}}function aP(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var oP=Pu(`appearance`,()=>{let e=N(rP($N,[`system`,`dark`,`light`],`dark`)),t=N(rP(eP,[`comfortable`,`compact`],`comfortable`)),n=N(rP(tP,[`system`,`reduced`],`system`)),r=N(rP(nP,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=aP(e.value)}function o(t){e.value=t,a(),iP($N,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,iP(eP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,iP(tP,e)}function l(e){r.value=e,iP(nP,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),sP=L({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Xh(n,t),{tooltipsEnabled:i}=Fu(oP());return(e,t)=>(V(),U(P(ZC),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(cs(t)))]),_:3},16,[`disabled`]))}}),cP=L({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Xh(_w(n,`class`),r);return(e,t)=>(V(),U(P(tw),null,{default:F(
Line truncated
|
||||
`)}};rJ.defaultYaml={explicit:!1,version:`1.2`},rJ.defaultTags={"!!":`tag:yaml.org,2002:`};function iJ(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 aJ(e){let t=new Set;return Xq(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function oJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function sJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=aJ(e);let a=oJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Hq(t.node)||Wq(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 cJ(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=cJ(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=cJ(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=cJ(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=cJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function lJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>lJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Kq(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 uJ=class{constructor(e){Object.defineProperty(this,Lq,{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(!zq(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=lJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?cJ(i,{"":o},``,o):o}},dJ=class extends uJ{constructor(e){super(jq),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=[],Xq(e,{Node:(e,t)=>{(Rq(t)||Kq(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||=(lJ(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=fJ(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(iJ(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 fJ(e,t,n){if(Rq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Wq(t)){let r=0;for(let i of t.items){let t=fJ(e,i,n);t>r&&(r=t)}return r}if(Vq(t)){let r=fJ(e,t.key,n),i=fJ(e,t.value,n);return Math.max(r,i)}return 1}var pJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,mJ=class extends uJ{constructor(e){super(Fq),this.value=e}toJSON(e,t){return t?.keep?this.value:lJ(this.value,e,t)}toString(){return String(this.value)}};mJ.BLOCK_FOLDED=`BLOCK_FOLDED`,mJ.BLOCK_LITERAL=`BLOCK_LITERAL`,mJ.PLAIN=`PLAIN`,mJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,mJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var hJ=`tag:yaml.org,2002:`;function gJ(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 _J(e,t,n){if(zq(e)&&(e=e.contents),Gq(e))return e;if(Vq(e)){let t=n.schema[Nq].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 dJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=hJ+t.slice(2));let l=gJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new mJ(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?SJ(n,t):n.includes(`
|
||||
`)?`
|
||||
@@ -100,8 +100,8 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
||||
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var XX=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=JX(e);r?this.warnings.push(new pX(i,t,n)):this.errors.push(new fX(i,t,n))},this.directives=new rJ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=YX(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Wq(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Vq(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:YX(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=JX(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=qX(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new fX(JX(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new fX(JX(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=SX(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new fX(JX(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new lX(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},ZX=Symbol(`break visit`),QX=Symbol(`skip children`),$X=Symbol(`remove item`);function eZ(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),tZ(Object.freeze([]),e,t)}eZ.BREAK=ZX,eZ.SKIP=QX,eZ.REMOVE=$X,eZ.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},eZ.parentCollection=(e,t)=>{let n=eZ.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function tZ(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=tZ(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===ZX)return ZX;else r===$X&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function nZ(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
||||
`:case`\r
|
||||
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function rZ(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var iZ=new Set(`0123456789ABCDEFabcdef`),aZ=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),oZ=new Set(`,[]{}`),Tte=new Set(` ,[]{}
|
||||
\r `),sZ=e=>!e||Tte.has(e),cZ=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var iZ=new Set(`0123456789ABCDEFabcdef`),Dte=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),aZ=new Set(`,[]{}`),oZ=new Set(` ,[]{}
|
||||
\r `),sZ=e=>!e||oZ.has(e),cZ=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
||||
`||t===`\r`&&this.buffer[e+1]===`
|
||||
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
||||
`||!t&&!this.atEnd)return e+n+1}return t===`
|
||||
@@ -113,10 +113,10 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
||||
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
||||
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
||||
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
||||
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(rZ(r)||e&&oZ.has(r))break;t=n}else if(rZ(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(rZ(r)||e&&aZ.has(r))break;t=n}else if(rZ(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`?(n+=1,r=`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&oZ.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&oZ.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(sZ),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(rZ(n)||t&&oZ.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!rZ(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(aZ.has(t))t=this.buffer[++e];else if(t===`%`&&iZ.has(this.buffer[e+1])&&iZ.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&aZ.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&aZ.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(sZ),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(rZ(n)||t&&aZ.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!rZ(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Dte.has(t))t=this.buffer[++e];else if(t===`%`&&iZ.has(this.buffer[e+1])&&iZ.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
||||
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
||||
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},lZ=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function uZ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function dZ(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function fZ(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function pZ(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function mZ(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function hZ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function gZ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!uZ(t.start,`explicit-key-ind`)&&!uZ(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,fZ(t.value)?t.value.end?hZ(t.value.end,t.sep):t.value.end=t.sep:hZ(t.start,t.sep),delete t.sep)}var _Z=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new cZ,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=nZ(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&gZ(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&dZ(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i
Line truncated
|
||||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||||
@@ -126,14 +126,14 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
||||
`).find(e=>e.trim())?.trim()}}function MZ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(OZ)].map(e=>e[1]))]}function NZ(e){let t=yZ(e).toJS(),n=kZ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=kZ(e)?e:{},f=typeof u.type==`string`?u.type:``,p=kZ(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||DZ(f),type:f,detail:AZ(f,p),summary:jZ(p),when:typeof u.when==`string`?u.when:void 0,retry:kZ(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,...c??{stage:m||f,occurrence:d(m||f)}}}),m&&a.set(m,h);for(let e of MZ(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(kZ(t)&&kZ(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i={stage:r,occurrence:d(r)},a=[],o=0;n.forEach(([t,r],s)=>{let u=(s-(n.length-1)/2)*TZ,d=c,m=c;(Array.isArray(r)?r:[]).forEach((r,a)=>{let c=f(r,`${e+1}-${t}-${a+1}`,u,(l+a)*wZ,t,i,[`steps`,e,`parallel`,t,a]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],o=Math.max(o,a+1)}),a.push(...d)}),c=a,l+=Math.max(o,1);continue}let n=f(t,String(e+1),0,l*wZ,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*wZ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var PZ={agent:$u,command:Bd,repo:hd,gate:Ld,forge:Cd,human:qd,review:pd,workflow:Xd},FZ={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function IZ(e){return PZ[e.split(`.`)[0]]??Xd}function LZ(e){return Object.keys(FZ).map(t=>({title:FZ[t],icon:PZ[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function RZ(e,t){let n=yZ(e).getIn(t,!0);if(Bq(n))return n.toJSON()}function zZ(e,t,n){let r=yZ(e);return r.setIn(t,r.createNode(GZ(n))),r.toString()}function BZ(e,t,n){let r=yZ(e),i=r.get(`steps`,!0);if(Uq(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Uq(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function VZ(e,t){let n=yZ(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Uq(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return Bq(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function HZ(e,t){let n=yZ(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Uq(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function UZ(e,t,n){let r=yZ(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Uq(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function WZ(e,t){let n=yZ(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function GZ(e){if(Array.isArray(e))return e.map(GZ);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=GZ(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function KZ(e,t){let n=yZ(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():yZ(e).get(t)}function qZ(e,t,n){let r=yZ(e),i=GZ({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function JZ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function YZ(e,t=[]){let n=yZ(e),r=n.errors[0];if(r)return{ok:!1,message:lQ(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!uQ(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};let
Line truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:aQ(e)}))}var rQ=/^(\s*)(-\s+)?/,iQ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function aQ(e){let{code:t,comment:n}=oQ(e),r=sQ(t);return n&&r.push({text:n,kind:`comment`}),r}function oQ(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function sQ(e){if(!e)return[];let t=[],n=rQ.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=iQ.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...cQ(i[4]??``)]):[...t,...cQ(r)]}function cQ(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function lQ(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function uQ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function dQ(e){return typeof e==`string`&&e.trim()!==``}var fQ={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},pQ={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},mQ={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},hQ={class:`min-w-0 flex-1`},gQ=[`value`,`placeholder`],_Q={class:`truncate font-mono text-[11px] text-fg-subtle`},vQ={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},yQ={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},bQ={key:1,class:`space-y-1.5`},xQ=[`title`],SQ=[`value`],CQ=[`value`],wQ={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},TQ=[`onClick`],EQ=[`onClick`],DQ={key:2,class:`divide-y divide-border rounded-md border border-border`},OQ=[`title`],kQ=[`value`,`onChange`],AQ=[`value`],jQ=[`value`,`onInput`],MQ=[`value`,`onFocus`,`onInput`],NQ=[`title`],PQ={key:0,class:`text-xs text-danger`},FQ={class:`space-y-2`},IQ={class:`divide-y divide-border rounded-md border border-border`},LQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},RQ=[`value`],zQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},BQ=[`value`],VQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},HQ=[`value`],UQ={class:`flex items-center border-t border-border px-4 py-2.5`},WQ=L({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>RZ(n.yaml,n.path)??{}),a=Y(()=>typeof i.value.type==`string`?i.value.type:``),o=Y(()=>n.vocabulary.find(e=>e.name===a.value)),s=Y(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=Y(()=>WZ(n.yaml,n.path)),l=Y(()=>o.value?.settings&&i.value.settings?eQ(i.value.settings,o.value.settings,`settings`):``),u=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],d=/mission|body|detail|plan|rules/;function f(e,t){return t.type===`string`?t.enum?`select`:d.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let p=Y(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:f(e,t)})),t=e.filter(e=>u.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>u.indexOf(e.key)-u.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function m(e){let{id:t,type:i,...a}=e;r(`update:yaml`,zZ(n.yaml,n.path,{id:t,type:i,...a}))}function h(e,t){m({...i.value,[e]:t})}function g(e,t){m({...i.value,settings:{...s.value,[e]:t}})}let _=N(null);function v(e,t){let n=_.value??p.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;g(n,r?`${r.trimEnd()} ${i}`:i)}let y=N({});function b(e,t){try{g(e,t.trim()?bZ(t):void 0),y.value={...y.value,[e]:``}}catch(t){y.value={...y.value,[e]:String(t.message).split(`
|
||||
`)[0]}}}let x=e=>e===void 0?``:xZ(e).trimEnd(),S=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),C=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(V(),H(`aside`,fQ,[W(`header`,pQ,[W(`span`,mQ,[(V(),U(ea(P(IZ)(a.value)),{class:`size-4`}))]),W(`div`,hQ,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:P(DZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,gQ),W(`div`,_Q,M(a.value),1)]),G(P($),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:F(()=>[G(P(Qd))]),_:1})]),W(`div`,vQ,[l.value?(V(),H(`p`,yQ,M(l.value),1)):q(``,!0),p.value.lead?(V(),H(`section`,bQ,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[K(M(S(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,xQ),p.value.lead.kind===`select`?(V(),H(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:C(p.value.lead.key),onChange:t[2]||=e=>g(p.value.lead.key,e.target.value||void 0)},[t[12]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(p.value.lead.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,CQ))),128))],40,SQ)):p.value.lead.kind===`text`?(V(),U(P(uT),{key:1,"model-value":C(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])):(V(),U(P(NO),{key:2,"model-value":C(p.value.lead.key),onFocus:t[5]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(V(),H(`div`,wQ,[t[13]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(V(!0),H(B,null,R(c.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`summary`)},M(e),9,TQ),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`result`)},M(e)+`.result`,9,EQ)],64))),128))])):q(``,!0)])):q(``,!0),p.value.compact.length?(V(),H(`section`,DQ,[(V(!0),H(B,null,R(p.value.compact,e=>(V(),H(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,OQ),e.kind===`boolean`?(V(),U(P(ik),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>g(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(V(),H(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:C(e.key),onChange:t=>g(e.key,t.target.value||void 0)},[t[14]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(e.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,AQ))),128))],40,kQ)):e.kind===`number`?(V(),H(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>g(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,jQ)):(V(),H(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:C(e.key),onFocus:t=>_.value=e.key,onInput:t=>g(e.key,t.target.value)},null,40,MQ))]))),128))])):q(``,!0),(V(!0),H(B,null,R(p.value.long,e=>(V(),H(`section`,{key:e.key,class:`space-y-1.5`},[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,NQ),e.kind===`text`?(V(),U(P(uT),{key:0,"model-value":C(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>_.value=e.key,"onUpdate:modelValue":t=>g(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(V(),U(P(uT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
|
||||
`)[0]}}}let x=e=>e===void 0?``:xZ(e).trimEnd(),S=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),C=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(V(),H(`aside`,fQ,[W(`header`,pQ,[W(`span`,mQ,[(V(),U(ea(P(IZ)(a.value)),{class:`size-4`}))]),W(`div`,hQ,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:P(DZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,gQ),W(`div`,_Q,M(a.value),1)]),G(P($),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:F(()=>[G(P(Qd))]),_:1})]),W(`div`,vQ,[l.value?(V(),H(`p`,yQ,M(l.value),1)):q(``,!0),p.value.lead?(V(),H(`section`,bQ,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[K(M(S(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,xQ),p.value.lead.kind===`select`?(V(),H(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:C(p.value.lead.key),onChange:t[2]||=e=>g(p.value.lead.key,e.target.value||void 0)},[t[12]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(p.value.lead.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,CQ))),128))],40,SQ)):p.value.lead.kind===`text`?(V(),U(P(uT),{key:1,"model-value":C(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])):(V(),U(P(jO),{key:2,"model-value":C(p.value.lead.key),onFocus:t[5]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(V(),H(`div`,wQ,[t[13]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(V(!0),H(B,null,R(c.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`summary`)},M(e),9,TQ),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`result`)},M(e)+`.result`,9,EQ)],64))),128))])):q(``,!0)])):q(``,!0),p.value.compact.length?(V(),H(`section`,DQ,[(V(!0),H(B,null,R(p.value.compact,e=>(V(),H(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,OQ),e.kind===`boolean`?(V(),U(P(nk),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>g(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(V(),H(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:C(e.key),onChange:t=>g(e.key,t.target.value||void 0)},[t[14]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(e.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,AQ))),128))],40,kQ)):e.kind===`number`?(V(),H(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>g(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,jQ)):(V(),H(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:C(e.key),onFocus:t=>_.value=e.key,onInput:t=>g(e.key,t.target.value)},null,40,MQ))]))),128))])):q(``,!0),(V(!0),H(B,null,R(p.value.long,e=>(V(),H(`section`,{key:e.key,class:`space-y-1.5`},[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,NQ),e.kind===`text`?(V(),U(P(uT),{key:0,"model-value":C(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>_.value=e.key,"onUpdate:modelValue":t=>g(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(V(),U(P(uT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>g(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:2},[G(P(uT),{"model-value":x(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>b(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),y.value[e.key]?(V(),H(`span`,PQ,M(y.value[e.key]),1)):q(``,!0)],64))]))),128)),W(`section`,FQ,[t[19]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,IQ,[W(`label`,LQ,[t[15]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,RQ)]),W(`label`,zQ,[t[17]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[16]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,BQ)]),W(`label`,VQ,[t[18]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>h(`retry`,e.target.value===``?void 0:{...i.value.retry,attempts:Number(e.target.value)})},null,40,HQ)])])])]),W(`footer`,UQ,[G(P($),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[10]||=e=>r(`remove`)},{default:F(()=>[G(P(Hd)),t[20]||=K(` Delete step`,-1)]),_:1}),G(P($),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[11]||=e=>r(`close`)},{default:F(()=>[...t[21]||=[K(`Done`,-1)]]),_:1})])]))}}),GQ=`repository_path`;function KQ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:GQ,path:n.trim(),type:`string`,required:!0}),r}function qQ(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function JQ(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=qQ(jP(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function YQ(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:jP(e.value,i.type??`string`)})}return n}function XQ(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function ZQ(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...ZQ(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...ZQ(n,r)]}):[]}function QQ(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function $Q(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function e$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var t$={class:`flex h-full flex-col`},n$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},r$={class:`min-w-0 flex-1 truncate text-sm font-medium`},i$={key:0,class:`flex flex-1 items-center justify-center`},a$={class:`space-y-1.5`},o$=[`disabled`],s$=[`value`],c$={key:1,class:`space-y-1.5`},l$=[`value`],u$=[`title`],d$={class:`space-y-1.5`},f$={id:`bind-paths`},p$=[`value`],m$={class:`divide-y divide-border rounded-md border border-border`},h$={class:`flex items-center gap-1.5 text-xs`},g$={class:`font-mono`},_$={class:`text-fg-subtle`},v$={key:0,class:`text-danger`,title:`Required`},y$=[`title`,`aria-label`,`onClick`],b$=[`onUpdate:modelValue`,`aria-label`],x$=[`onUpdate:modelValue`,`aria-label`],S$={key:2,class:`text-xs text-danger`},C$=[`title`],w$={key:0,class:`space-y-1 px-3 py-2`},T$={key:0,class:`text-xs text-danger`},E$={key:1,class:`truncate font-mono text-xs text-success`},D$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},O$={class:`space-y-2`},k$={key:0,role:`alert`,class:`text-xs text-danger`},A$={key:1,class:`text-xs text-fg-subtle`},j$={class:`flex gap-2`},M$=`__new__`,N$=L({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>String(KZ(n.yaml,`id`)??``)),a=Y(()=
Line truncated
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:2},[G(P(uT),{"model-value":x(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>b(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),y.value[e.key]?(V(),H(`span`,PQ,M(y.value[e.key]),1)):q(``,!0)],64))]))),128)),W(`section`,FQ,[t[19]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,IQ,[W(`label`,LQ,[t[15]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,RQ)]),W(`label`,zQ,[t[17]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[16]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,BQ)]),W(`label`,VQ,[t[18]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>h(`retry`,e.target.value===``?void 0:{...i.value.retry,attempts:Number(e.target.value)})},null,40,HQ)])])])]),W(`footer`,UQ,[G(P($),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[10]||=e=>r(`remove`)},{default:F(()=>[G(P(Hd)),t[20]||=K(` Delete step`,-1)]),_:1}),G(P($),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[11]||=e=>r(`close`)},{default:F(()=>[...t[21]||=[K(`Done`,-1)]]),_:1})])]))}}),GQ=`repository_path`;function KQ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:GQ,path:n.trim(),type:`string`,required:!0}),r}function qQ(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function JQ(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=qQ(kP(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function YQ(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:kP(e.value,i.type??`string`)})}return n}function XQ(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function ZQ(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...ZQ(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...ZQ(n,r)]}):[]}function QQ(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function $Q(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function e$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var t$={class:`flex h-full flex-col`},n$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},r$={class:`min-w-0 flex-1 truncate text-sm font-medium`},i$={key:0,class:`flex flex-1 items-center justify-center`},a$={class:`space-y-1.5`},o$=[`disabled`],s$=[`value`],c$={key:1,class:`space-y-1.5`},l$=[`value`],u$=[`title`],d$={class:`space-y-1.5`},f$={id:`bind-paths`},p$=[`value`],m$={class:`divide-y divide-border rounded-md border border-border`},h$={class:`flex items-center gap-1.5 text-xs`},g$={class:`font-mono`},_$={class:`text-fg-subtle`},v$={key:0,class:`text-danger`,title:`Required`},y$=[`title`,`aria-label`,`onClick`],b$=[`onUpdate:modelValue`,`aria-label`],x$=[`onUpdate:modelValue`,`aria-label`],S$={key:2,class:`text-xs text-danger`},C$=[`title`],w$={key:0,class:`space-y-1 px-3 py-2`},T$={key:0,class:`text-xs text-danger`},E$={key:1,class:`truncate font-mono text-xs text-success`},D$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},O$={class:`space-y-2`},k$={key:0,role:`alert`,class:`text-xs text-danger`},A$={key:1,class:`text-xs text-fg-subtle`},j$={class:`flex gap-2`},M$=`__new__`,N$=L({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>String(KZ(n.yaml,`id`)??``)),a=Y(()=
Line truncated
|
||||
`).replace(`
|
||||
|
||||
`,`
|
||||
+`).split(`
|
||||
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function _5(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=v5(n.code,e);return Array.isArray(e)?e.some(e=>g5(n[r],e,t,n.type===`keyup`)):g5(n[r],e,t,n.type===`keyup`)}}function v5(e,t){return t.includes(e)?`code`:`key`}function y5(e,t){let n=Y(()=>fn(t?.target)??p5),r=cn(fn(e)===!0),i=!1,a=new Set,o=c(fn(e));I(()=>fn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),d0([`blur`,`contextmenu`],s),p0((...e)=>o(...e),e=>{let n=fn(t?.actInsideInputWithModifier)??!0,a=fn(t?.preventDefault)??!1;if(i=h5(e),(!i||i&&!n)&&m5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),p0((...e)=>o(...e),e=>{let n=fn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&m5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=fn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?_5(e,a):e}return r}var b5=`vue-flow__node-desc`,x5=`vue-flow__edge-desc`,S5=`vue-flow__aria-live`,C5=[`Enter`,` `,`Escape`],w5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function T5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function E5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function D5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function O5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function k5(e,t){return{x:O5(e.x,t[0][0],t[1][0]),y:O5(e.y,t[0][1],t[1][1])}}function A5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function j5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function M5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!j5(e)}function N5(e){return M5(e)&&`computedPosition`in e}function P5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function F5(e){return P5(e.width)&&P5(e.height)&&P5(e.x)&&P5(e.y)}function I5(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:rn({width:0,height:0}),computedPosition:rn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G7(e.data)?e.data:{},events:rn(G7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function L5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G7(e.data)?e.data:{},events:rn(G7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function R5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function z5(...e){if(e.length===3){let[t,n,r]=e;return R5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>j5(e)&&e.source===r).map(e=>n.find(t=>M5(t)&&t.id===e.target))}function B5(...e){if(e.length===3){let[t,n,r]=e;return R5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>j5(e)&&e.target===r).map(e=>n.find(t=>M5(t)&&t.id===e.source))}function V5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function H5(e,t){return t.some(t=>j5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function U5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function W5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?F7(s,o):s}function G5(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function K5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function q5({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function J5(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=G5(t,K5({...r.computedPosition,...r.dimensions}))}return q5(t)}function Y5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...W5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=
Line truncated
|
||||
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function _5(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=v5(n.code,e);return Array.isArray(e)?e.some(e=>g5(n[r],e,t,n.type===`keyup`)):g5(n[r],e,t,n.type===`keyup`)}}function v5(e,t){return t.includes(e)?`code`:`key`}function y5(e,t){let n=Y(()=>fn(t?.target)??p5),r=cn(fn(e)===!0),i=!1,a=new Set,o=c(fn(e));I(()=>fn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),d0([`blur`,`contextmenu`],s),p0((...e)=>o(...e),e=>{let n=fn(t?.actInsideInputWithModifier)??!0,a=fn(t?.preventDefault)??!1;if(i=h5(e),(!i||i&&!n)&&m5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),p0((...e)=>o(...e),e=>{let n=fn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&m5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=fn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?_5(e,a):e}return r}var b5=`vue-flow__node-desc`,x5=`vue-flow__edge-desc`,S5=`vue-flow__aria-live`,C5=[`Enter`,` `,`Escape`],w5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function T5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function E5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function D5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function O5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function k5(e,t){return{x:O5(e.x,t[0][0],t[1][0]),y:O5(e.y,t[0][1],t[1][1])}}function A5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function j5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function M5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!j5(e)}function N5(e){return M5(e)&&`computedPosition`in e}function P5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function F5(e){return P5(e.width)&&P5(e.height)&&P5(e.x)&&P5(e.y)}function I5(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:rn({width:0,height:0}),computedPosition:rn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G7(e.data)?e.data:{},events:rn(G7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function L5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G7(e.data)?e.data:{},events:rn(G7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function R5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function z5(...e){if(e.length===3){let[t,n,r]=e;return R5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>j5(e)&&e.source===r).map(e=>n.find(t=>M5(t)&&t.id===e.target))}function B5(...e){if(e.length===3){let[t,n,r]=e;return R5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>j5(e)&&e.target===r).map(e=>n.find(t=>M5(t)&&t.id===e.source))}function V5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function H5(e,t){return t.some(t=>j5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function U5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function W5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?F7(s,o):s}function G5(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function K5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function q5({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function J5(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=G5(t,K5({...r.computedPosition,...r.dimensions}))}return q5(t)}function Y5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...W5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=
Line truncated
|
||||
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
||||
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
||||
Node: ${e}
|
||||
@@ -153,4 +153,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`},A7=class extends Error{constructor(e,...t){super(k7[e]?.call(k7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function j7(e){return`clientX`in e}function M7(e){return`sourceEvent`in e}function N7(e,t){let n=j7(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 P7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Ete(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function F7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Dte=()=>!0;function I7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Ote(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())E5(i,T5(e))>0&&r.push(e);return r}var kte=250;function Ate(e,t,n,r){let i=[],a=1/0,o=Ote(e,n,t+kte);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}=w7(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 L7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Dte},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:_}=N7(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=R7(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===c5.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=z7(t,e,a,p,n,!0)}return b}function R7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function jte(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Mte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function z7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===c5.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,...w7(o,c,c.position,!0)}:c}var B7={[a5.Left]:a5.Right,[a5.Right]:a5.Left,[a5.Top]:a5.Bottom,[a5.Bottom]:a5.Top},Nte=[`production`,`prod`];function V7(e,...t){H7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H7(){return!Nte.includes(`production`)}function U7(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,...D5(t)}}):null}function W7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Kn(()=>{o.blur()})):n([e])}function G7(e){return P(e)!==void 0}function Pte(e,t,n,r){if(!e||!e.source||!e.target)return n(new A7(O7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=j5(e)?e:{...e,id:V5(e)},i=L5(i,void 0,r),!H5(i,t)&&i}function Fte(e,t,n,r,i){if(!t.source||!t.target)return i(new A7(O7.EDGE_INVALID,e.id)),!1;if(!n)return i(new A7(O7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?V5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function K7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!M5(o)){n(new A7(O7.NODE_INVALID,o?.id));continue}let s=I5(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 A7(O7.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 q7(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 J7(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}`;q7(`source`,
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`},A7=class extends Error{constructor(e,...t){super(k7[e]?.call(k7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function j7(e){return`clientX`in e}function M7(e){return`sourceEvent`in e}function N7(e,t){let n=j7(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 P7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Ote(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function F7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var kte=()=>!0;function I7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Ate(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())E5(i,T5(e))>0&&r.push(e);return r}var jte=250;function Mte(e,t,n,r){let i=[],a=1/0,o=Ate(e,n,t+jte);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}=w7(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 L7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=kte},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:_}=N7(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=R7(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===c5.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=z7(t,e,a,p,n,!0)}return b}function R7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Nte(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Pte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function z7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===c5.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,...w7(o,c,c.position,!0)}:c}var B7={[a5.Left]:a5.Right,[a5.Right]:a5.Left,[a5.Top]:a5.Bottom,[a5.Bottom]:a5.Top},Fte=[`production`,`prod`];function V7(e,...t){H7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H7(){return!Fte.includes(`production`)}function U7(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,...D5(t)}}):null}function W7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Kn(()=>{o.blur()})):n([e])}function G7(e){return P(e)!==void 0}function Ite(e,t,n,r){if(!e||!e.source||!e.target)return n(new A7(O7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=j5(e)?e:{...e,id:V5(e)},i=L5(i,void 0,r),!H5(i,t)&&i}function Lte(e,t,n,r,i){if(!t.source||!t.target)return i(new A7(O7.EDGE_INVALID,e.id)),!1;if(!n)return i(new A7(O7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?V5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function K7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!M5(o)){n(new A7(O7.NODE_INVALID,o?.id));continue}let s=I5(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 A7(O7.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 q7(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 J7(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}`;q7(`source`,
Line truncated
|
||||
@@ -4,17 +4,38 @@
|
||||
* and the debug view), and both must show exactly what the daemon stored --
|
||||
* no projection, no prettifying beyond indentation.
|
||||
*/
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { Check, Copy } from "@lucide/vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import HighlightedJson from "@/base/HighlightedJson.vue";
|
||||
|
||||
defineProps<{ value: unknown }>();
|
||||
const props = defineProps<{ value: unknown }>();
|
||||
const text = computed(() => JSON.stringify(props.value ?? {}, null, 2));
|
||||
const copied = ref(false);
|
||||
const copyError = ref(false);
|
||||
watch(text, () => { copied.value = false; copyError.value = false; });
|
||||
async function copy(): Promise<void> {
|
||||
copyError.value = false;
|
||||
try {
|
||||
await navigator.clipboard.writeText(text.value);
|
||||
copied.value = true;
|
||||
} catch {
|
||||
copied.value = false;
|
||||
copyError.value = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mb-2 flex items-center justify-end gap-2">
|
||||
<p v-if="copyError" role="alert" class="text-xs text-danger">Could not copy output.</p>
|
||||
<Button type="button" variant="outline" size="sm" @click="copy"><Check v-if="copied" /><Copy v-else />{{ copied ? "Copied" : "Copy output" }}</Button>
|
||||
</div>
|
||||
<!--
|
||||
pre-wrap keeps the indentation the JSON is printed with while letting a
|
||||
long value wrap instead of forcing the panel to scroll sideways.
|
||||
-->
|
||||
<pre
|
||||
class="max-h-[60vh] overflow-auto rounded-sm border border-border bg-muted p-3 font-mono text-xs leading-normal whitespace-pre-wrap break-words"
|
||||
><HighlightedJson :text="JSON.stringify(value ?? {}, null, 2)" /></pre>
|
||||
><HighlightedJson :text="text" /></pre>
|
||||
</template>
|
||||
@@ -110,7 +110,6 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
|
||||
const retryBusy = ref(false);
|
||||
const retryError = ref<RetryError | null>(null);
|
||||
const refreshToken = ref(0);
|
||||
const started = new Set<string>();
|
||||
|
||||
const task = computed<TaskRecord | null>(() =>
|
||||
Array.isArray(taskList.value)
|
||||
@@ -171,16 +170,13 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
|
||||
cache: Ref<Cache<T>>,
|
||||
{ force = false }: { force?: boolean } = {},
|
||||
): void {
|
||||
if (started.has(cacheKey) && !force) return;
|
||||
started.add(cacheKey);
|
||||
if (cache.value.has(cacheKey) && cache.value.get(cacheKey) !== null && !force) return;
|
||||
cache.value = new Map(cache.value).set(cacheKey, undefined);
|
||||
// A read that never settles would pin the panel's loading line forever:
|
||||
// after a quiet minute the read is declared broken so the retry button
|
||||
// can appear. A late response after the timeout is discarded by the race.
|
||||
let timedOut = false;
|
||||
const timeout = new Promise<never>((_, reject) => {
|
||||
setTimeout(() => {
|
||||
timedOut = true;
|
||||
reject(new Error("read timed out"));
|
||||
}, 30_000);
|
||||
});
|
||||
@@ -189,7 +185,6 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
|
||||
cache.value = new Map(cache.value).set(cacheKey, res);
|
||||
})
|
||||
.catch(() => {
|
||||
if (!timedOut) started.delete(cacheKey);
|
||||
cache.value = new Map(cache.value).set(cacheKey, null);
|
||||
});
|
||||
}
|
||||
@@ -275,7 +270,6 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
|
||||
/** Drop every cache so a manual refresh cannot show a stale capture or log
|
||||
* beside fresh attempt history. */
|
||||
function dropCaches(): void {
|
||||
started.clear();
|
||||
logs.value = new Map();
|
||||
changes.value = new Map();
|
||||
debug.value = new Map();
|
||||
@@ -342,7 +336,7 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
|
||||
if (tab.value === "log") loadLogs(attempt);
|
||||
else if (tab.value === "changes") loadChanges(attempt);
|
||||
else if (tab.value === "debug") loadDebug(attempt);
|
||||
});
|
||||
}, { immediate: true });
|
||||
|
||||
watch([tab, attemptNumber], () => {
|
||||
if (id.value == null) return;
|
||||
|
||||
Reference in new issue
Block a user