Compare commits

..
2 Commits
Author SHA1 Message Date
sam 69a1ee677d chore(release): v1.47.3
deploy / gate (push) Failing after 3m29s
deploy / build-and-push (push) Skipped
deploy / dist-zip (push) Skipped
2026-10-07 00:33:23 +11:00
sam b3cf2c59a8 fix(webui): extension Accept and Remove dialogs act on the selected extension 2026-10-07 00:32:44 +11:00
5 changed files with 22 additions and 7 deletions

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ release's per-component sections are labelled beneath its heading.
## [Unreleased]
## [1.47.3] - 2026-10-07
### archied
- **Settings → Extensions**: **Accept** in the authority review now accepts the extension, and **Remove** removes it. Both previously closed the dialog without doing anything.
## [1.47.2] - 2026-10-06
### archied
+2
View File
@@ -64,6 +64,7 @@
"/news/archie/1.47.0/": "/news/1.47.0/",
"/news/archie/1.47.1/": "/news/1.47.1/",
"/news/archie/1.47.2/": "/news/1.47.2/",
"/news/archie/1.47.3/": "/news/1.47.3/",
"/news/archie/1.5.0/": "/news/1.5.0/",
"/news/archie/1.6.0/": "/news/1.6.0/",
"/news/archie/1.7.0/": "/news/1.7.0/",
@@ -145,6 +146,7 @@
"/news/archied/1.47.0/": "/news/1.47.0/",
"/news/archied/1.47.1/": "/news/1.47.1/",
"/news/archied/1.47.2/": "/news/1.47.2/",
"/news/archied/1.47.3/": "/news/1.47.3/",
"/news/archied/1.5.0/": "/news/1.5.0/",
"/news/archied/1.6.0/": "/news/1.6.0/",
"/news/archied/1.7.0/": "/news/1.7.0/",
+5
View File
@@ -1,4 +1,9 @@
[
{
"version": "1.47.3",
"date": "2026-10-07",
"body": "### archied\n\n- **Settings → Extensions**: **Accept** in the authority review now accepts the extension, and **Remove** removes it. Both previously closed the dialog without doing anything."
},
{
"version": "1.47.2",
"date": "2026-10-06",
+1 -1
View File
@@ -18,7 +18,7 @@ Defaulting to \`null\`.`),null)}function mS(e){return fS(e)&&!Number.isNaN(e)&&e
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=WT(c),u=e+1<n.length?WT(n[e+1]):null;if(l&&u&&Ete(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=WT(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>UT(e)),rows:r.map(e=>e.map(e=>UT(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:UT(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:UT(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function WT(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 Ete(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Dte={class:`[overflow-wrap:anywhere]`},Ote={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},kte={class:`font-mono text-[0.85em]`},Ate={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},jte={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Mte={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Nte={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Pte={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Fte={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Ite={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Lte={key:8,class:`mb-2.5 last:mb-0`},Rte=I({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=J(()=>Tte(t.text));return(e,t)=>(B(),V(`div`,Dte,[(B(!0),V(z,null,L(n.value,(e,t)=>(B(),V(z,{key:t},[e.kind===`pre`?(B(),V(`pre`,Ote,[U(`code`,kte,j(e.code),1)])):e.kind===`table`?(B(),V(`table`,Ate,[U(`thead`,null,[U(`tr`,null,[(B(!0),V(z,null,L(e.head,(e,t)=>(B(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[W(HT,{inline:e},null,8,[`inline`])]))),128))])]),U(`tbody`,null,[(B(!0),V(z,null,L(e.rows,(e,t)=>(B(),V(`tr`,{key:t},[(B(!0),V(z,null,L(e,(e,t)=>(B(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[W(HT,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(B(),V(`blockquote`,jte,[W(HT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(B(),V(`h1`,Mte,[W(HT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(B(),V(`h2`,Nte,[W(HT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(B(),V(`h3`,Pte,[W(HT,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(B(),V(`ul`,Fte,[(B(!0),V(z,null,L(e.items,(e,t)=>(B(),V(`li`,{key:t},[W(HT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(B(),V(`ol`,Ite,[(B(!0),V(z,null,L(e.items,(e,t)=>(B(),V(`li`,{key:t},[W(HT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(B(),V(`p`,Lte,[W(HT,{inline:e.inline},null,8,[`inline`])])):K(``,!0)],64))),128))]))}}),zte={class:`truncate`},Bte=I({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Qi(`RouterLink`);return B(),H(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:P(()=>[W(N(Gu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),U(`span`,zte,j(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Vte={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Hte={class:`font-semibold text-foreground`},Ute={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Wte=I({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=J(()=>t.tool.parameters||t.tool.Parameters||``),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>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?(B(),H(Bte,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(B(),V(`div`,Vte,[W(N(Kd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),U(`span`,Hte,j(n.value),1),r.value?(B(),V(`code`,Ute,j(r.value),1)):K(``,!0),U(`span`,{class:A(N(Y)(`text-fg-muted`,i.value&&`text-danger`))},j(a.value),3)]))}}),Gte={key:0,class:`mb-2 grid gap-0.5 text-xs`},Kte={key:1,class:`mb-2 flex flex-wrap gap-1.5`},qte={key:3,class:`whitespace-pre-wrap`},GT=I({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(B(),V(`div`,{class:A([`flex`,e.assistant?`justify-start`:`justify-end`])},[U(`div`,{class:A(N(Y)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(B(),V(`div`,Gte,[(B(!0),V(z,null,L(e.tools,(t,n)=>(B(),H(Wte,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):K(``,!0),e.media.length?(B(),V(`div`,Kte,[(B(!0),V(z,null,L(e.media,(e,t)=>(B(),H(_te,{key:t,attachment:e},null,8,[`attachment`]))),128))])):K(``,!0),e.assistant?(B(),H(Rte,{key:2,text:e.text},null,8,[`text`])):(B(),V(`div`,qte,j(e.text),1)),R(t.$slots,`default`)],2)],2))}}),Jte={class:`w-full self-center justify-self-center py-6 text-center`},Yte={class:`grid gap-2`},Xte=[`onCLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>NA?`${n.slice(0,NA).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var FA=[`title`],IA=I({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>oA(n.event)),a=J(()=>PA(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=J(()=>n.event.at?mk(n.event.at):`—`);return(e,t)=>(B(),H(N(AA),{class:A(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:[Ll(Il(o,[`prevent`]),[`enter`]),Ll(Il(o,[`prevent`]),[`space`])]},{default:P(()=>[W(N($),{class:`font-medium`},{default:P(()=>[G(j(n.event.kind||n.event.type||`event`),1)]),_:1}),W(N($),{class:`font-mono`},{default:P(()=>[G(j(i.value>0?`#${i.value}`:`—`),1)]),_:1}),W(N($),{class:`w-[55%] max-w-0`},{default:P(()=>[U(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},j(a.value.text),9,FA)]),_:1}),W(N($),null,{default:P(()=>[G(j(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),LA=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function RA(e){return(Number(e?.task_id)||0)>0}function zA(e,t){return t===`tasks`?RA(e):t!==`system`||!RA(e)}function BA(e,t){return e.filter(e=>zA(e,t))}function VA(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function HA(e,t){return`${e}:${t??0}`}function UA(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=HA(PA(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 WA={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},GA={class:`max-h-[28rem] overflow-y-auto`},KA=[`aria-expanded`,`aria-label`,`onClick`],qA=[`title`],JA=I({__name:`LiveActivityCard`,setup(e){let t=oE(),{activity:n,streamKind:r,streamState:i}=Au(gO()),a=M(`all`),o=J(()=>BA(n.value,a.value)),s=J(()=>VA(o.value.length,a.value)),c=Jt(new Set),l=J(()=>UA(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 PA(e.representative)}function p(e){return e.representative.at?mk(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(B(),H(N(sk),null,{default:P(()=>[W(N(fk),null,{default:P(()=>[W(N(pk),null,{default:P(()=>[...t[1]||=[G(`Live activity`,-1)]]),_:1}),W(N(ck),{class:`flex items-center gap-2`},{default:P(()=>[W(N(EA),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:N(LA)},null,8,[`modelValue`,`options`]),W(N(ik),{variant:N(r)},{default:P(()=>[G(j(N(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),W(N(lk),null,{default:P(()=>[U(`div`,WA,[U(`div`,GA,[W(N(OA),null,{default:P(()=>[W(N(MA),{class:`sticky top-0 z-10 bg-card`},{default:P(()=>[W(N(AA),null,{default:P(()=>[W(N(jA),null,{default:P(()=>[...t[2]||=[G(`Event`,-1)]]),_:1}),W(N(jA),null,{default:P(()=>[...t[3]||=[G(`Task`,-1)]]),_:1}),W(N(jA),null,{default:P(()=>[...t[4]||=[G(`Detail`,-1)]]),_:1}),W(N(jA),null,{default:P(()=>[...t[5]||=[G(`When`,-1)]]),_:1})]),_:1})]),_:1}),W(N(kA),null,{default:P(()=>[o.value.length?K(``,!0):(B(),H(N(AA),{key:0},{default:P(()=>[W(N($),{colspan:`4`},{default:P(()=>[W(N(XO),null,{default:P(()=>[W(N($O),null,{default:P(()=>[W(N(nk),null,{default:P(()=>[G(j(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(B(!0),V(z,{key:1},L(l.value,e=>(B(),V(z,{key:e.key},[e.count===1?(B(),H(IA,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(B(),V(z,{key:1},[W(N(AA),{class:A(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:[Ll(Il(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Ll(Il(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:P(()=>[W(N($),{class:`font-medium`},{default:P(()=>[U(`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:Il(t=>u(e.key),[`stop`])},[d(e)?(B(),H(N(Qu),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(B(),H(N($u),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),G(` `+j(e.label)+` `,1),W(N(ik),{variant:`idle`},{default:P(()=>[G(`×`+j(e.count),1)]),_:2},1024)],8,KA)]),_:2},1024),W(N($),{class:`font-mono`},{default:P(()=>[G(j(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),W(N($),{class:`w-[55%] max-w-0`},{default:P(()=>[U(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},j(f(e).text),9,qA)]),_:2},1024),W(N($),null,{default:P(()=>[G(j(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(B(!0),V(z,{key:0},L(e.events,(t,n)=>(B(),H(IA,{key:`${e.key}:${n}`,event:t,onO 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 hM(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 gM(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 _M(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 vM(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 yM=M([]),bM=M([]),xM=M(!0),SM=M(null),CM=M(null),wM=M(!1),TM=M(null);async function EM(){try{let e=await X.eventTypes();xM.value=e.enabled!==!1,yM.value=e.event_types||[],bM.value=e.proposals||[],SM.value=null}catch(e){SM.value=e.message||String(e)}}function DM(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function OM(e){TM.value=null,CM.value=e}function kM(e){let t=LM.value.find(t=>String(t.id)===e.sample_id);OM({mode:`proposal`,id:null,source:e.source,name:``,rule:DM(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function AM(e=``){OM({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function jM(e){OM({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:DM(e.rule),headersText:``,body:``,exampleHeaders:{}})}function MM(){CM.value=null}async function NM(){let e=CM.value;if(e){wM.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:vM(e.rule)});else{let t=e.mode===`paste`?mM(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:vM(e.rule),example:{headers:t,body:e.body}})}CM.value=null,await EM()}catch(e){TM.value=e.message||String(e)}finally{wM.value=!1}}}var PM=M(null);async function FM(){let e=PM.value;if(PM.value=null,e)try{await X.eventTypeDelete(e.id),await EM()}catch(e){SM.value=e.message||String(e)}}var IM=100,LM=M([]),RM=M(!0),zM=M(null),BM=M(!0),VM=M(null);async function HM(){try{let e=await X.captures(IM);RM.value=e.enabled!==!1,LM.value=e.captures||[],zM.value=null}catch(e){zM.value=e.message||String(e)}finally{BM.value=!1}}function UM(e){let t=LM.value.find(t=>t.id===e);return t&&(VM.value=t),!!t}function WM(){LM.value.length&&(VM.value=LM.value[0])}function GM(){_O(`captures`,()=>{HM(),EM()})}var KM={key:0,class:`text-xs text-fg-muted`},qM={key:1,class:`flex flex-col gap-1 text-xs`},JM={key:1},YM={key:2,class:`text-xs text-fg-muted`},XM=I({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=M([]),r=M(!1);F(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await X.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Qi(`RouterLink`);return r.value?(B(),V(`p`,KM,`Dispatches unavailable.`)):n.value.length?(B(),V(`ul`,qM,[(B(!0),V(z,null,L(n.value,e=>(B(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?K(``,!0):(B(),H(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:P(()=>[G(`binding `+j(e.binding_id.slice(0,8))+` v`+j(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?K(``,!0):(B(),H(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:P(()=>[G(`capture `+j(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?K(``,!0):(B(),V(z,{key:2},[e.task_id?(B(),H(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:P(()=>[G(`task #`+j(e.task_id),1)]),_:2},1032,[`to`])):(B(),V(`span`,JM,j(e.reason||`claimed, no task recorded`),1))],64)),U(`span`,null,j(N(mk)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?K(``,!0):(B(),V(`p`,YM,` No dispatches yet. `))}}}),ZM=I({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),H(N(pd),{role:`status`,"aria-label":`Loading`,class:A(N(Y)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function QM(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function $M(e){return(e?.repository??`required`)!==`none`}function eN(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function tN(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var nN={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},rN={pending_approval:`warn`,armed:`ok`,paused:`idle`};function iN(e) Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function hM(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 gM(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 _M(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 vM(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 yM=M([]),bM=M([]),xM=M(!0),SM=M(null),CM=M(null),wM=M(!1),TM=M(null);async function EM(){try{let e=await X.eventTypes();xM.value=e.enabled!==!1,yM.value=e.event_types||[],bM.value=e.proposals||[],SM.value=null}catch(e){SM.value=e.message||String(e)}}function DM(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function OM(e){TM.value=null,CM.value=e}function kM(e){let t=LM.value.find(t=>String(t.id)===e.sample_id);OM({mode:`proposal`,id:null,source:e.source,name:``,rule:DM(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function AM(e=``){OM({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function jM(e){OM({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:DM(e.rule),headersText:``,body:``,exampleHeaders:{}})}function MM(){CM.value=null}async function NM(){let e=CM.value;if(e){wM.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:vM(e.rule)});else{let t=e.mode===`paste`?mM(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:vM(e.rule),example:{headers:t,body:e.body}})}CM.value=null,await EM()}catch(e){TM.value=e.message||String(e)}finally{wM.value=!1}}}var PM=M(null);async function FM(){let e=PM.value;if(PM.value=null,e)try{await X.eventTypeDelete(e.id),await EM()}catch(e){SM.value=e.message||String(e)}}var IM=100,LM=M([]),RM=M(!0),zM=M(null),BM=M(!0),VM=M(null);async function HM(){try{let e=await X.captures(IM);RM.value=e.enabled!==!1,LM.value=e.captures||[],zM.value=null}catch(e){zM.value=e.message||String(e)}finally{BM.value=!1}}function UM(e){let t=LM.value.find(t=>t.id===e);return t&&(VM.value=t),!!t}function WM(){LM.value.length&&(VM.value=LM.value[0])}function GM(){_O(`captures`,()=>{HM(),EM()})}var KM={key:0,class:`text-xs text-fg-muted`},qM={key:1,class:`flex flex-col gap-1 text-xs`},JM={key:1},YM={key:2,class:`text-xs text-fg-muted`},XM=I({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=M([]),r=M(!1);F(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await X.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Qi(`RouterLink`);return r.value?(B(),V(`p`,KM,`Dispatches unavailable.`)):n.value.length?(B(),V(`ul`,qM,[(B(!0),V(z,null,L(n.value,e=>(B(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?K(``,!0):(B(),H(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:P(()=>[G(`binding `+j(e.binding_id.slice(0,8))+` v`+j(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?K(``,!0):(B(),H(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:P(()=>[G(`capture `+j(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?K(``,!0):(B(),V(z,{key:2},[e.task_id?(B(),H(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:P(()=>[G(`task #`+j(e.task_id),1)]),_:2},1032,[`to`])):(B(),V(`span`,JM,j(e.reason||`claimed, no task recorded`),1))],64)),U(`span`,null,j(N(mk)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?K(``,!0):(B(),V(`p`,YM,` No dispatches yet. `))}}}),ZM=I({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),H(N(pd),{role:`status`,"aria-label":`Loading`,class:A(N(Y)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function QM(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function $M(e){return(e?.repository??`required`)!==`none`}function eN(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function tN(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var nN={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},rN={pending_approval:`warn`,armed:`ok`,paused:`idle`};function iN(e) Line truncated
`)}};SJ.defaultYaml={explicit:!1,version:`1.2`},SJ.defaultTags={"!!":`tag:yaml.org,2002:`};function CJ(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 wJ(e){let t=new Set;return hJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function TJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function EJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=wJ(e);let a=TJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(sJ(t.node)||lJ(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 DJ(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=DJ(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=DJ(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=DJ(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=DJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function OJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>OJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!dJ(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 kJ=class{constructor(e){Object.defineProperty(this,nJ,{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(!iJ(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=OJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?DJ(i,{"":o},``,o):o}},AJ=class extends kJ{constructor(e){super(Xq),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=[],hJ(e,{Node:(e,t)=>{(rJ(t)||dJ(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||=(OJ(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=jJ(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(CJ(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 jJ(e,t,n){if(rJ(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(lJ(t)){let r=0;for(let i of t.items){let t=jJ(e,i,n);t>r&&(r=t)}return r}if(oJ(t)){let r=jJ(e,t.key,n),i=jJ(e,t.value,n);return Math.max(r,i)}return 1}var MJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,NJ=class extends kJ{constructor(e){super(eJ),this.value=e}toJSON(e,t){return t?.keep?this.value:OJ(this.value,e,t)}toString(){return String(this.value)}};NJ.BLOCK_FOLDED=`BLOCK_FOLDED`,NJ.BLOCK_LITERAL=`BLOCK_LITERAL`,NJ.PLAIN=`PLAIN`,NJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,NJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var PJ=`tag:yaml.org,2002:`;function FJ(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 IJ(e,t,n){if(iJ(e)&&(e=e.contents),uJ(e))return e;if(oJ(e)){let t=n.schema[Qq].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 AJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=PJ+t.slice(2));let l=FJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new NJ(e);return c&&(c.node=t),t Line truncated
`)?VJ(n,t):n.includes(`
`)?`
+8 -6
View File
@@ -36,15 +36,17 @@ async function install(): Promise<void> {
}
}
// The dialog's action closes it before its click handler runs, so the
// target outlives the open flag rather than being cleared on close.
const accepting = ref<Extension | null>(null);
const acceptOpen = ref(false);
async function accept(): Promise<void> {
if (accepting.value) await store.accept(accepting.value.name);
accepting.value = null;
}
const removing = ref<Extension | null>(null);
const removeOpen = ref(false);
async function remove(): Promise<void> {
if (removing.value) await store.remove(removing.value.name);
removing.value = null;
}
const tones = {
@@ -108,7 +110,7 @@ const tones = {
variant="ghost"
size="sm"
:disabled="!!store.busy"
@click="accepting = extension"
@click="(accepting = extension), (acceptOpen = true)"
>Review authority</Button
>
<Switch
@@ -118,7 +120,7 @@ const tones = {
:aria-label="`Enable ${extension.name}`"
@update:model-value="(value: boolean) => store.setEnabled(extension.name, value)"
/>
<Button variant="ghost" size="sm" class="text-danger" :disabled="!!store.busy" @click="removing = extension">Remove</Button>
<Button variant="ghost" size="sm" class="text-danger" :disabled="!!store.busy" @click="(removing = extension), (removeOpen = true)">Remove</Button>
</li>
<li v-if="!store.extensions.length">
<Empty class="py-6">
@@ -131,7 +133,7 @@ const tones = {
<ApplyStatusRows :kind="KIND" class="mt-6 border-t border-border py-4" />
<AlertDialog :open="!!accepting" @update:open="(open) => !open && (accepting = null)">
<AlertDialog v-model:open="acceptOpen">
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Accept what {{ accepting?.name }} may use?</AlertDialogTitle>
@@ -150,7 +152,7 @@ const tones = {
</AlertDialogContent>
</AlertDialog>
<AlertDialog :open="!!removing" @update:open="(open) => !open && (removing = null)">
<AlertDialog v-model:open="removeOpen">
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Remove {{ removing?.name }}?</AlertDialogTitle>