feat(webui): add a command palette, live tasks, and a11y fixes
Ctrl/Cmd+K opens a palette over the capability-gated nav entries; the tasks board refreshes from the shared event stream; config tooltips are keyboard-reachable; live activity announces politely; and missing event timestamps render an em-dash instead of a fabricated now.
This commit is contained in:
1 parent
49af6c75bc
commit
b35b6c0049
8 files changed
+295
-39
No files matched your search
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scrollbar-thumb:#0000;--tw-scrollbar-track:#0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-md:10px;--radius-4xl:2rem;--shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2sLine truncated
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scrollbar-thumb:#0000;--tw-scrollbar-track:#0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-md:10px;--radius-4xl:2rem;--shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2sLine truncated
|
||||
Vendored
+11
-11
@@ -1,20 +1,20 @@
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var n=window.location.hash;if(n.startsWith(`#/`)){let e=n.slice(1);window.history.replaceState(null,``,e+window.location.search)}function r(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var i={},a=[],o=()=>{},s=()=>!1,c=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),l=e=>e.startsWith(`onUpdate:`),u=Object.assign,d=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},f=Object.prototype.hasOwnProperty,p=(e,t)=>f.call(e,t),m=Array.isArray,h=e=>ee(e)===`[object Map]`,g=e=>ee(e)===`[object Set]`,_=e=>ee(e)===`[object Date]`,v=e=>ee(e)===`[object RegExp]`,y=e=>typeof e==`function`,b=e=>typeof e==`string`,x=e=>typeof e==`symbol`,S=e=>typeof e==`object`&&!!e,C=e=>(S(e)||y(e))&&y(e.then)&&y(e.catch),w=Object.prototype.toString,ee=e=>w.call(e),te=e=>ee(e).slice(8,-1),ne=e=>ee(e)===`[object Object]`,re=e=>b(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ie=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ae=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},oe=/-\w/g,se=ae(e=>e.replace(oe,e=>e.slice(1).toUpperCase())),ce=/\B([A-Z])/g,le=ae(e=>e.replace(ce,`-$1`).toLowerCase()),ue=ae(e=>e.charAt(0).toUpperCase()+e.slice(1)),T=ae(e=>e?`on${ue(e)}`:``),de=(e,t)=>!Object.is(e,t),fe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},pe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},me=e=>{let t=parseFloat(e);return isNaN(t)?e:t},he=e=>{let t=b(e)?Number(e):NaN;return isNaN(t)?e:t},ge,_e=()=>ge||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ve=r(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function ye(e){if(m(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=b(r)?Ce(r):ye(r);if(i)for(let e in i)t[e]=i[e]}return t}if(b(e)||S(e))return e}var be=/;(?![^(]*\))/g,xe=/:([^]+)/,Se=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Ce(e){let t={};return e.replace(Se,e=>e.startsWith(`/*`)?``:e).split(be).forEach(e=>{if(e){let n=e.split(xe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function E(e){let t=``;if(b(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){let r=E(e[n]);r&&(t+=r+` `)}else if(S(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function we(e){if(!e)return null;let{class:t,style:n}=e;return t&&!b(t)&&(e.class=E(t)),n&&(e.style=ye(n)),e}var Te=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Ee=r(Te);Te+``;function De(e){return!!e||e===``}function Oe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Me(e[i],t[i],n);return r}function ke(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Me(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ae(e,t,n){let r=h(e),i=h(t);if(r||i||(r=g(e),i=g(t),r||i))return r&&i?ke(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Me(e[r],t[r],n))return!1}return String(e)===String(t)}function je(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Me(e,t,n){if(e===t)return!0;let r=_(e),i=_(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=x(e),i=x(t),r||i?e===t:(r=m(e),i=m(t),r||i?r&&i?je(e,t,n,Oe):!1:(r=S(e),i=S(t),r||i?!r||!i?!1:je(e,t,n,Ae):String(e)===String(t))))}function Ne(e,t){return e.findIndex(e=>Me(e,t))}var Pe=e=>!!(e&&e.__v_isRef===!0),D=e=>b(e)?e:e==null?``:m(e)||S(e)&&(e.toString===w||!y(e.toString))?Pe(e)?D(e.value):JSON.stringify(e,Fe,2):String(e),Fe=(e,t)=>Pe(t)?Fe(e,t.value):h(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ie(t,r)+` =>`]=n,e),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ie(e))}Line truncated
|
||||
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
||||
`)&&(Ai(e,0)||bi(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||c(a)&&!ie(a)||a[0]===`.`||t&&!ie(a)||u&&u.includes(a)){if(Di(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&ln(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Ps(x,n,t),h&&Tr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&us(()=>{x&&Ps(x,n,t),l&&g.enter(e),h&&Tr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=js(d[t]),g=h.type===ps;e?(g&&!u&&t+1<p&&js(d[t+1]).type===ps&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,Ai(r,1)||bi()),n(null,h,r,null,o,s,Ci(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&wi(f)&&f.data===`]`?a(t.anchor=f):(bi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Mi(e,t)||bi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,Ci(d),c),r&&(r.vnode.el=t.el,Co(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&wi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var Ei=new Set([`src`,`srcset`,`href`,`poster`]);function Di(e,t,n){return Ei.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Oi=`data-allow-mismatch`,ki={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Ai(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Oi);)e=e.parentElement;return ji(e&&e.getAttribute(Oi),t)}function ji(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(ki[t])}}function Mi(e,t){return Ai(e.parentElement,1)||Ni(e)||Pi(t)}function Ni(e){return e.nodeType===1&&ji(e.getAttribute(Oi),1)}function Pi({props:e}){let t=e&&e[Oi];return typeof t==`string`&&ji(t,1)}var Fi=_e().requestIdleCallback||(e=>setTimeout(e,1)),Ii=_e().cancelIdleCallback||(e=>clearTimeout(e)),Li=(e=1e4)=>t=>{let n=Fi(t,{timeout:e});return()=>Ii(n)};function Ri(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var zi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ri(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Bi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Vi=(e=[])=>(t,n)=>{b(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Hi(e,t){if(wi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(wi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ui=e=>!!e.type.__asyncLoader;function Wi(e){y(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return M({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Hi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Rs;if(pi(e),u)return()=>Gi(u,e);let t=t=>{l=null,Zn(t,e,13,!r)};if(s&&e.suspense||Gs)return p().then(t=>()=>Gi(t,e)).catch(e=>(t(e),()=>r?B(r,{error:e}):null));let a=O(!1),c=O(),d=O(!!i),f,m;return ca(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ki(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Gi(u,e);if(c.value&&r)return B(r,{error:c.value});if(n&&
Line truncated
|
||||
`))),e[Kl]=Ul(i);let a=r||i.props&&i.props.type===`number`;ul(e,t?`change`:`input`,t=>{t.target.composing||e[Kl](Jl(e.value,n,a))}),(n||a)&&ul(e,`change`,()=>{e.value=Jl(e.value,n,a)}),t||(ul(e,`compositionstart`,Wl),ul(e,`compositionend`,Gl),ul(e,`change`,Gl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ql];delete e[ql],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Kl](Jl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Kl]=Ul(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?me(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Xl={deep:!0,created(e,t,n){e[Kl]=Ul(n),ul(e,`change`,()=>{let t=e._modelValue,n=nu(e),r=e.checked,i=e[Kl];if(m(t)){let e=Ne(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(g(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(ru(e,r))})},mounted:Zl,beforeUpdate(e,t,n){e[Kl]=Ul(n),Zl(e,t,n)}};function Zl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Ne(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=Me(t,ru(e,!0))}e.checked!==i&&(e.checked=i)}var Ql={created(e,{value:t},n){e.checked=Me(t,n.props.value),e[Kl]=Ul(n),ul(e,`change`,()=>{e[Kl](nu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Kl]=Ul(r),t!==n&&(e.checked=Me(t,r.props.value))}},$l={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ul(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?me(nu(e)):nu(e)),r=e.multiple,i=r?g(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?m(i)?t.slice():t:i];try{e[Kl](i)}finally{or(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Kl]=Ul(r)},mounted(e,{value:t}){tu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Kl]=Ul(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!eu(t,n[1],n[0]))&&tu(e,t)}};function eu(e,t,n){if(!n||m(e))return Me(e,t);if(g(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function tu(e,t){let n=e.multiple,r=m(t);if(!n||r||g(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=nu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ne(t,o)>-1}else a.selected=t.has(o)}else if(Me(nu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function nu(e){return`_value`in e?e._value:e.value}function ru(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var iu={created(e,t,n){ou(e,t,n,null,`created`)},mounted(e,t,n){ou(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ou(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ou(e,t,n,r,`updated`)}};function au(e,t){switch(e){case`SELECT`:return $l;case`TEXTAREA`:return Yl;default:switch(t){case`checkbox`:return Xl;case`radio`:return Ql;default:return Yl}}}function ou(e,t,n,r,i){let a=au(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function su(){Yl.getSSRProps=({value:e})=>({value:e}),Ql.getSSRProps=({value:e},t)=>{if(t.props&&Me(t.props.value,e))return{checked:!0}},Xl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Ne(e,t.props.value)>-1)return{checked:!0}}else if(g(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=au(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var cu=[`ctrl`,`shift`,`alt`,`meta`],lu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>cu.some(n=>e[`${n}Key`]&&!t.includes(n))},uu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=lu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},du={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},fu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=le(n.key);if(t.some(e=>e===r||du[e]===r))return e(n)}))},pu=u({patchProp:Sl},Sc),mu,hu=!1;function gu(){return mu||=Uo(pu)}function _u(){return mu=hu?mu:Wo(pu),hu=!0,mu}var vu=((...e)=>{gu().render(...e)}),yu=((...e)=>{_u().hydrate(...e)}),bu=((...e)=>{let t=gu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Cu(e);if(!r)return;let i=t._component;!y(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Su(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),xu=((
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Jf=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Yf(e){let t=e instanceof Jf?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Xf(e,t){let n=await fetch(e,t);if(!n.ok)throw new Jf(await qf(n),n.status);return n}async function Zf(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Gf,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Xf(e,s);return a?await c.json():void 0}var J={summary:()=>Zf(`/api/summary`),tasks:()=>Zf(`/api/tasks`),taskMeta:()=>Zf(`/api/task-meta`),task:e=>Zf(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Zf(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Zf(`/api/tasks/${encodeURIComponent(e)}/changes`+Kf(t)),taskDebug:(e,t)=>Zf(`/api/tasks/${encodeURIComponent(e)}/debug`+Kf(t)),taskAction:(e,t)=>Zf(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>Zf(`/api/setup`),capabilities:()=>Zf(`/api/capabilities`),workflows:()=>Zf(`/api/workflows`),workRequest:e=>Zf(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Zf(`/api/skills`),channels:()=>Zf(`/api/channels`),curators:()=>Zf(`/api/curators`),channelReload:e=>Zf(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Zf(`/api/config`),version:()=>Zf(`/api/version`),configUpdate:e=>Zf(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>Zf(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>Zf(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>Zf(`/api/logs`+Kf(e)),taskLogs:(e,t)=>Zf(`/api/tasks/${encodeURIComponent(e)}/logs`+Kf(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>Zf(`/api/captures`+Kf({limit:e})),mappings:()=>Zf(`/api/mappings`),mappingCreate:e=>Zf(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Zf(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Zf(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Zf(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Zf(`/api/bindings`),bindingCreate:e=>Zf(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Zf(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Zf(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Zf(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>Zf(`/api/chat/sessions`),chatMessages:e=>Zf(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Zf(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Zf(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Zf(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Wf(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Zf(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>Zf(`/api/chat/update`),chatUpdateDefer:e=>Zf(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>Zf(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>Zf(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Zf(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Zf(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Xf(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})};function Qf(e,t){let n=new EventSource(`/events`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(`reconnecting`),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}function $f(e,t){let n=new EventSource(`/api/logs/stream`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(Uf(n.readyState)),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}var ep=`archie.web.chat.channel`;function tp(){let e=localStorage.getItem(ep);return e||(e=Wf(),localStorage.setItem(ep,e)),e}var np=/(?:^|\s)\/([^\s]*)$/,rp=/(?:^|\s)\/[^\s]*$/,ip=8;function ap(e,t,n){let r=t.slice(0,n).match(np);if(!r)return[];let i=r[1].toLowerCase();return e.filter(e=>`${e.command} ${e.description??``}`.toLowerCase().includes(i)).slice(0,ip)}function op(e,t,n){let r=e.slice(0,t),i=e.slice(t),a=r.search(rp),o=a<0?r.length:a+ +(r[a]===` `);return{text:`${r.slice(0,o)}$Line truncated
|
||||
`))),e[Kl]=Ul(i);let a=r||i.props&&i.props.type===`number`;ul(e,t?`change`:`input`,t=>{t.target.composing||e[Kl](Jl(e.value,n,a))}),(n||a)&&ul(e,`change`,()=>{e.value=Jl(e.value,n,a)}),t||(ul(e,`compositionstart`,Wl),ul(e,`compositionend`,Gl),ul(e,`change`,Gl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ql];delete e[ql],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Kl](Jl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Kl]=Ul(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?me(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Xl={deep:!0,created(e,t,n){e[Kl]=Ul(n),ul(e,`change`,()=>{let t=e._modelValue,n=nu(e),r=e.checked,i=e[Kl];if(m(t)){let e=Ne(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(g(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(ru(e,r))})},mounted:Zl,beforeUpdate(e,t,n){e[Kl]=Ul(n),Zl(e,t,n)}};function Zl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Ne(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=Me(t,ru(e,!0))}e.checked!==i&&(e.checked=i)}var Ql={created(e,{value:t},n){e.checked=Me(t,n.props.value),e[Kl]=Ul(n),ul(e,`change`,()=>{e[Kl](nu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Kl]=Ul(r),t!==n&&(e.checked=Me(t,r.props.value))}},$l={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ul(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?me(nu(e)):nu(e)),r=e.multiple,i=r?g(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?m(i)?t.slice():t:i];try{e[Kl](i)}finally{or(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Kl]=Ul(r)},mounted(e,{value:t}){tu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Kl]=Ul(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!eu(t,n[1],n[0]))&&tu(e,t)}};function eu(e,t,n){if(!n||m(e))return Me(e,t);if(g(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function tu(e,t){let n=e.multiple,r=m(t);if(!n||r||g(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=nu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ne(t,o)>-1}else a.selected=t.has(o)}else if(Me(nu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function nu(e){return`_value`in e?e._value:e.value}function ru(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var iu={created(e,t,n){ou(e,t,n,null,`created`)},mounted(e,t,n){ou(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ou(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ou(e,t,n,r,`updated`)}};function au(e,t){switch(e){case`SELECT`:return $l;case`TEXTAREA`:return Yl;default:switch(t){case`checkbox`:return Xl;case`radio`:return Ql;default:return Yl}}}function ou(e,t,n,r,i){let a=au(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function su(){Yl.getSSRProps=({value:e})=>({value:e}),Ql.getSSRProps=({value:e},t)=>{if(t.props&&Me(t.props.value,e))return{checked:!0}},Xl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Ne(e,t.props.value)>-1)return{checked:!0}}else if(g(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=au(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var cu=[`ctrl`,`shift`,`alt`,`meta`],lu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>cu.some(n=>e[`${n}Key`]&&!t.includes(n))},uu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=lu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},du={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},fu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=le(n.key);if(t.some(e=>e===r||du[e]===r))return e(n)}))},pu=u({patchProp:Sl},Sc),mu,hu=!1;function gu(){return mu||=Uo(pu)}function _u(){return mu=hu?mu:Wo(pu),hu=!0,mu}var vu=((...e)=>{gu().render(...e)}),yu=((...e)=>{_u().hydrate(...e)}),bu=((...e)=>{let t=gu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Cu(e);if(!r)return;let i=t._component;!y(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Su(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),xu=((
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Yf=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Xf(e){let t=e instanceof Yf?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Zf(e,t){let n=await fetch(e,t);if(!n.ok)throw new Yf(await Jf(n),n.status);return n}async function Qf(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Kf,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Zf(e,s);return a?await c.json():void 0}var J={summary:()=>Qf(`/api/summary`),tasks:()=>Qf(`/api/tasks`),taskMeta:()=>Qf(`/api/task-meta`),task:e=>Qf(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Qf(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Qf(`/api/tasks/${encodeURIComponent(e)}/changes`+qf(t)),taskDebug:(e,t)=>Qf(`/api/tasks/${encodeURIComponent(e)}/debug`+qf(t)),taskAction:(e,t)=>Qf(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>Qf(`/api/setup`),capabilities:()=>Qf(`/api/capabilities`),workflows:()=>Qf(`/api/workflows`),workRequest:e=>Qf(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Qf(`/api/skills`),channels:()=>Qf(`/api/channels`),curators:()=>Qf(`/api/curators`),channelReload:e=>Qf(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Qf(`/api/config`),version:()=>Qf(`/api/version`),configUpdate:e=>Qf(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>Qf(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>Qf(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>Qf(`/api/logs`+qf(e)),taskLogs:(e,t)=>Qf(`/api/tasks/${encodeURIComponent(e)}/logs`+qf(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>Qf(`/api/captures`+qf({limit:e})),mappings:()=>Qf(`/api/mappings`),mappingCreate:e=>Qf(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Qf(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Qf(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Qf(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Qf(`/api/bindings`),bindingCreate:e=>Qf(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Qf(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Qf(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Qf(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>Qf(`/api/chat/sessions`),chatMessages:e=>Qf(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Qf(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Qf(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Qf(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Gf(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Qf(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>Qf(`/api/chat/update`),chatUpdateDefer:e=>Qf(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>Qf(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>Qf(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Qf(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Qf(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Zf(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})};function $f(e,t){let n=new EventSource(`/events`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(`reconnecting`),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}function ep(e,t){let n=new EventSource(`/api/logs/stream`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(Wf(n.readyState)),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}var tp=`archie.web.chat.channel`;function np(){let e=localStorage.getItem(tp);return e||(e=Gf(),localStorage.setItem(tp,e)),e}var rp=/(?:^|\s)\/([^\s]*)$/,ip=/(?:^|\s)\/[^\s]*$/,ap=8;function op(e,t,n){let r=t.slice(0,n).match(rp);if(!r)return[];let i=r[1].toLowerCase();return e.filter(e=>`${e.command} ${e.description??``}`.toLowerCase().includes(i)).slice(0,ap)}function sp(e,t,n){let r=e.slice(0,t),i=e.slice(t),a=r.search(ip),o=a<0?r.length:a+ +(r[a]===` `);return{text:`${r.slice(0,o)}$Line truncated
|
||||
|
||||
`);u=r.pop()||``;for(let e of r){let t=e.split(`
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(mp.value=n.session_id),n.type===`delta`&&(o+=n.text,yp.value=yp.value?{...yp.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],yp.value=yp.value?{...yp.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);hp.value=[...hp.value,{from:`assistant`,text:o,tool_calls:a}],yp.value=null,_p.value=`Ready`,await Pp()}catch(e){let t=e;t.name===`AbortError`&&!c?(yp.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},_p.value=`Stopped`):(yp.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?lp(r):void 0,isRetry:i},_p.value=`Error — retry available`)}finally{clearTimeout(l),Mp=null,vp.value=!1}}function qp(){_p.value=`Stopping…`,mp.value&&J.chatCancel(mp.value).catch(()=>{}),Np()}function Jp(){ia(()=>{Pp().catch(e=>{_p.value=e.message||`Chat unavailable`})}),ca(()=>{Np()})}var Yp=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Xp=M({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return q(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(I(),L(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full bg-linear-to-br from-primary to-[var(--brand-alt)] text-primary-foreground shadow-[var(--shadow-md)] transition-[transform,box-shadow] duration-[140ms] hover:-translate-y-px hover:shadow-[0_12px_34px_var(--primary-soft)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":k(dp),onClick:i[0]||=e=>n(`toggle`)},[z(`span`,{"aria-hidden":`true`,class:E(r(!e.open))},[B(k(Qu),{size:22})],2),z(`span`,{"aria-hidden":`true`,class:E(r(e.open))},[B(k(pd),{size:22})],2)],8,Yp))}});function Zp(e){return typeof e==`string`?`'${e}'`:new tm().serialize(e)}var Qp=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,$p=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Qp.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function em(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&$p[n]?$p[n]:n+128,s=a<128&&$p[a]?$p[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var tm=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?em(e,t):n===`number`&&r===`number`?e-t:em(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(em),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`InLine truncated
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(hp.value=n.session_id),n.type===`delta`&&(o+=n.text,bp.value=bp.value?{...bp.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],bp.value=bp.value?{...bp.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);gp.value=[...gp.value,{from:`assistant`,text:o,tool_calls:a}],bp.value=null,vp.value=`Ready`,await Fp()}catch(e){let t=e;t.name===`AbortError`&&!c?(bp.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},vp.value=`Stopped`):(bp.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?up(r):void 0,isRetry:i},vp.value=`Error — retry available`)}finally{clearTimeout(l),Np=null,yp.value=!1}}function Jp(){vp.value=`Stopping…`,hp.value&&J.chatCancel(hp.value).catch(()=>{}),Pp()}function Yp(){ia(()=>{Fp().catch(e=>{vp.value=e.message||`Chat unavailable`})}),ca(()=>{Pp()})}var Xp=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Zp=M({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return q(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(I(),L(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full bg-linear-to-br from-primary to-[var(--brand-alt)] text-primary-foreground shadow-[var(--shadow-md)] transition-[transform,box-shadow] duration-[140ms] hover:-translate-y-px hover:shadow-[0_12px_34px_var(--primary-soft)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":k(fp),onClick:i[0]||=e=>n(`toggle`)},[z(`span`,{"aria-hidden":`true`,class:E(r(!e.open))},[B(k($u),{size:22})],2),z(`span`,{"aria-hidden":`true`,class:E(r(e.open))},[B(k(md),{size:22})],2)],8,Xp))}});function Qp(e){return typeof e==`string`?`'${e}'`:new nm().serialize(e)}var $p=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,em=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[$p.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function tm(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&em[n]?em[n]:n+128,s=a<128&&em[a]?em[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var nm=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?tm(e,t):n===`number`&&r===`number`?e-t:tm(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(tm),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`InLine truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||o.value?ac(t.default({present:o.value})[0],{ref:e=>{let t=Pm(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Bh=M({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Um(n.default()),r=e.findIndex(e=>e.type!==ms);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?U(t,i.props):t,o=ks({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Vh=[`area`,`img`,`input`],X=M({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Vh.includes(r)?()=>ac(r,t):r===`template`?()=>ac(Bh,t,{default:n.default}):()=>ac(e.as,t,{default:n.default})}});function Hh(){let e=O();return{primitiveElement:e,currentElement:W(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Pm(e))}}function Uh({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Wh({type:e,defaultValue:t,modelValue:n}){return e||Uh({type:e,defaultValue:t,modelValue:n})}function Gh({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Kh(e,t){let n=W(()=>Wh(e)),r=Hm(e,`modelValue`,t,{defaultValue:Gh(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=nm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(cm(t,e)){let n=t.findIndex(t=>nm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:W(()=>n.value===`single`)}}var[qh,Jh]=im(`DialogRoot`),Yh=M({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Hm(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=Dn(n);return Jh({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>P(e.$slots,`default`,{open:k(r),close:()=>r.value=!1})}}),Xh=M({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=qh();return(e,r)=>(I(),R(k(X),U(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>k(n).onOpenChange(!1)}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16,[`type`]))}}),Zh=`dismissableLayer.pointerDownOutside`,Qh=`dismissableLayer.focusOutside`;function $h(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function eg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=O(!1),a=O(()=>{});return jr(o=>{if(!fm||!Sn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if($h(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){om(Zh,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{Sn(n)&&(i.value=!0)}}}function tg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=O(!1);return jr(a=>{if(!fm||!Sn(n))return;let o=async n=>{if(!t?.value)return;await or(),await or();let r=n.target;t.value&&r&&!$h(t.value,r)&&n.target&&!i.value&&om(Qh,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{Sn(n)&&(i.value=!0)},onBlurCapture:()=>{Sn(n)&&(i.value=!1)}}}var ng=M({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Y(),o=W(()=>a.value?.ownerDocument??globalThis.document),s=W(()=>Ym.layersRoot),c=W(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=W(()=>Ym.layersWithOutsidePointerEventsDisabled.size>0),u=W(()=>{let e=Array.from(s.value),[t]=[...Ym.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=eg
Line truncated
|
||||
`))}return()=>i.value||r.value||o.value?ac(t.default({present:o.value})[0],{ref:e=>{let t=Fm(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Vh=M({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Wm(n.default()),r=e.findIndex(e=>e.type!==ms);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?U(t,i.props):t,o=ks({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Hh=[`area`,`img`,`input`],X=M({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Hh.includes(r)?()=>ac(r,t):r===`template`?()=>ac(Vh,t,{default:n.default}):()=>ac(e.as,t,{default:n.default})}});function Uh(){let e=O();return{primitiveElement:e,currentElement:W(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Fm(e))}}function Wh({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Gh({type:e,defaultValue:t,modelValue:n}){return e||Wh({type:e,defaultValue:t,modelValue:n})}function Kh({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function qh(e,t){let n=W(()=>Gh(e)),r=Um(e,`modelValue`,t,{defaultValue:Kh(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=rm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(lm(t,e)){let n=t.findIndex(t=>rm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:W(()=>n.value===`single`)}}var[Jh,Yh]=am(`DialogRoot`),Xh=M({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Um(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=Dn(n);return Yh({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>P(e.$slots,`default`,{open:k(r),close:()=>r.value=!1})}}),Zh=M({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=Jh();return(e,r)=>(I(),R(k(X),U(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>k(n).onOpenChange(!1)}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16,[`type`]))}}),Qh=`dismissableLayer.pointerDownOutside`,$h=`dismissableLayer.focusOutside`;function eg(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function tg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=O(!1),a=O(()=>{});return jr(o=>{if(!pm||!Sn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(eg(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){sm(Qh,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{Sn(n)&&(i.value=!0)}}}function ng(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=O(!1);return jr(a=>{if(!pm||!Sn(n))return;let o=async n=>{if(!t?.value)return;await or(),await or();let r=n.target;t.value&&r&&!eg(t.value,r)&&n.target&&!i.value&&sm($h,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{Sn(n)&&(i.value=!0)},onBlurCapture:()=>{Sn(n)&&(i.value=!1)}}}var rg=M({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Y(),o=W(()=>a.value?.ownerDocument??globalThis.document),s=W(()=>Xm.layersRoot),c=W(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=W(()=>Xm.layersWithOutsidePointerEventsDisabled.size>0),u=W(()=>{let e=Array.from(s.value),[t]=[...Xm.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=tg
Line truncated
|
||||
- a positive number
|
||||
- less than the value passed to \`max\` (or ${jb} if no \`max\` prop is set)
|
||||
- less than the value passed to \`max\` (or ${Mb} if no \`max\` prop is set)
|
||||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||||
|
||||
Defaulting to \`null\`.`),null)}function Ib(e){return Pb(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 \`${jb}\`.`),jb)}var Lb=M({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:jb},getValueLabel:{type:Function,required:!1,default:(e,t)=>Pb(e)?`${Math.round(e/t*jb)}%`: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;Y();let i=Hm(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Hm(n,`max`,r,{passive:n.max===void 0});j(()=>i.value,async e=>{let t=Fb(e,n.max);t!==e&&(await or(),i.value=t)},{immediate:!0}),j(()=>n.max,e=>{let t=Ib(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=W(()=>sm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Nb({modelValue:i,max:a,progressState:o}),(e,t)=>(I(),R(k(X),{"as-child":e.asChild,as:e.as,"aria-valuemax":k(a),"aria-valuemin":0,"aria-valuenow":Pb(k(i))?k(i):void 0,"aria-valuetext":e.getValueText?.(k(i),k(a)),"aria-label":e.getValueLabel(k(i),k(a)),role:`progressbar`,"data-state":o.value,"data-value":k(i)??void 0,"data-max":k(a)},{default:A(()=>[P(e.$slots,`default`,{modelValue:k(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),Rb=M({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Mb();return Y(),(e,r)=>(I(),R(k(X),U(t,{"data-state":k(n).progressState.value,"data-value":k(n).modelValue?.value??void 0,"data-max":k(n).max.value}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),[zb,Bb]=im(`ScrollAreaRoot`),Vb=M({__name:`ScrollAreaRoot`,props:{type:{type:String,required:!1,default:`hover`},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=O(0),i=O(0),a=O(),o=O(),s=O(),c=O(),l=O(!1),u=O(!1),{type:d,dir:f,scrollHideDelay:p}=Dn(n),m=ih(f);function h(){a.value?.scrollTo({top:0})}function g(){a.value?.scrollTo({top:0,left:0})}t({viewport:a,scrollTop:h,scrollTopLeft:g});let{forwardRef:_,currentElement:v}=Y();return Bb({type:d,dir:m,scrollHideDelay:p,scrollArea:v,viewport:a,onViewportChange:e=>{a.value=e||void 0},content:o,onContentChange:e=>{o.value=e},scrollbarX:s,scrollbarXEnabled:l,scrollbarY:c,scrollbarYEnabled:u,onScrollbarXChange:e=>{s.value=e||void 0},onScrollbarYChange:e=>{c.value=e||void 0},onScrollbarXEnabledChange:e=>{l.value=e},onScrollbarYEnabledChange:e=>{u.value=e},onCornerWidthChange:e=>{r.value=e},onCornerHeightChange:e=>{i.value=e}}),(e,t)=>(I(),R(k(X),{ref:k(_),"as-child":n.asChild,as:e.as,dir:k(m),style:ye({position:`relative`,"--reka-scroll-area-corner-width":`${r.value}px`,"--reka-scroll-area-corner-height":`${i.value}px`})},{default:A(()=>[P(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`dir`,`style`]))}}),Hb=M({__name:`ScrollAreaCornerImpl`,setup(e){let t=zb(),n=O(0),r=O(0),i=W(()=>!!n.value&&!!r.value);function a(){let e=t.scrollbarX.value?.offsetHeight||0;t.onCornerHeightChange(e),r.value=e}function o(){let e=t.scrollbarY.value?.offsetWidth||0;t.onCornerWidthChange(e),n.value=e}return Vm(t.scrollbarX.value,a),Vm(t.scrollbarY.value,o),j(()=>t.scrollbarX.value,a),j(()=>t.scrollbarY.value,o),(e,a)=>i.value?(I(),R(k(X),U({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:`absolute`,right:k(t).dir.value===`ltr`?0:void 0,left:k(t).dir.value===`rtl`?0:void 0,bottom:0}},e.$parent?.$props),{default:A(()=>[P(e.$slots,`default`)]),_:3},16,[`style`])):H(`v-if`,!0)}}),Ub=M({__name:`ScrollAreaCorner`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=Y(),r=zb(),i=W(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),a=W(()=>r.type.value!==`scroll`&&i.value);return(e,r)=>a.value?(I(),R(Hb,U({key:0},t,{ref:k(n)}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16)):H(`v-if`,!0)}});function Wb(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Gb(e){let t=Kb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Kb(e,t){let n=e/t;return Number.isNaN(n)?0:n}function qb(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Jb(e,t,n=`ltr`){let r=Gb(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=rm(e,c[0],c[1]);return Wb([0,o],[0,s])(l)}functLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:kw(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>kw(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=jw(c),u=e+1<n.length?jw(n[e+1]):null;if(l&&u&&Mw(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=jw(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>kw(e)),rows:r.map(e=>e.map(e=>kw(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:kw(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:kw(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function jw(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 Mw(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Nw={class:`[overflow-wrap:anywhere]`},Pw={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Fw={class:`font-mono text-[0.85em]`},Iw={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Lw={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Rw={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},zw={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Bw={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Vw={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Hw={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Uw={key:8,class:`mb-2.5 last:mb-0`},Ww=M({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=W(()=>Aw(t.text));return(e,t)=>(I(),L(`div`,Nw,[(I(!0),L(F,null,N(n.value,(e,t)=>(I(),L(F,{key:t},[e.kind===`pre`?(I(),L(`pre`,Pw,[z(`code`,Fw,D(e.code),1)])):e.kind===`table`?(I(),L(`table`,Iw,[z(`thead`,null,[z(`tr`,null,[(I(!0),L(F,null,N(e.head,(e,t)=>(I(),L(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[B(Dw,{inline:e},null,8,[`inline`])]))),128))])]),z(`tbody`,null,[(I(!0),L(F,null,N(e.rows,(e,t)=>(I(),L(`tr`,{key:t},[(I(!0),L(F,null,N(e,(e,t)=>(I(),L(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[B(Dw,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(I(),L(`blockquote`,Lw,[B(Dw,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(I(),L(`h1`,Rw,[B(Dw,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(I(),L(`h2`,zw,[B(Dw,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(I(),L(`h3`,Bw,[B(Dw,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(I(),L(`ul`,Vw,[(I(!0),L(F,null,N(e.items,(e,t)=>(I(),L(`li`,{key:t},[B(Dw,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(I(),L(`ol`,Hw,[(I(!0),L(F,null,N(e.items,(e,t)=>(I(),L(`li`,{key:t},[B(Dw,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(I(),L(`p`,Uw,[B(Dw,{inline:e.inline},null,8,[`inline`])])):H(``,!0)],64))),128))]))}}),Gw={class:`truncate`},Kw=M({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ha(`RouterLink`);return I(),R(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-primary transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:A(()=>[B(k(Vu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),z(`span`,Gw,D(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),qw={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Jw={class:`font-semibold text-foreground`},Yw={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Xw=M({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=W(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=W(()=>t.tool.parameters||t.tool.Parameters||``),i=W(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=W(()=>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?(I(),R(Kw,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(I(),L(`div`,qw,[B(k(fd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),z(`span`,Jw,D(n.value),1),r.value?(I(),L(`code`,Yw,D(r.value),1)):H(``,!0),z(`span`,{class:E(k(q)(`text-fg-muted`,i.value&&`text-danger`))},D(a.value),3)]))}}),Zw={key:0,class:`mb-2 grid gap-0.5 text-xs`},Qw={key:2,class:`whitespace-pre-wrap`},$w=M({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(I(),L(`div`,{class:E([`flex`,e.assistant?`justify-start`:`justify-end`])},[z(`div`,{class:E(k(q)(`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?(I(),L(`div`,Zw,[(I(!0),L(F,null,N(e.tools,(t,n)=>(I(),R(Xw,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):H(``,!0),e.assistant?(I(),R(Ww,{key:1,text:e.text},null,8,[`text`])):(I(),L(`div`,Qw,D(e.text),1)),P(t.$slots,`default`)],2)],2))}}),eT={class:`w-full self-center justify-self-center py-6 text-center`},tT={class:`grid gap-2`},nT=[`onClick`],rT=M({__name:`ChatEmptyState`,emits:[`prompt`],setup(e,{emit:t}){let n=t,r=[`Summarise active tasks`,`Show running agents`,`Check system status`];return(e,t)=>(I(),L(`div`,eT,[t[0]||=z(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 pLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>LA?`${n.slice(0,LA).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var zA=[`title`],BA=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=W(()=>sA(n.event)),a=W(()=>RA(n.event));function o(){i.value>0&&r(`open`,i.value)}return(e,t)=>(I(),R(k(CO),{class:E(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:[fu(uu(o,[`prevent`]),[`enter`]),fu(uu(o,[`prevent`]),[`space`])]},{default:A(()=>[B(k(Q),{class:`font-medium`},{default:A(()=>[V(D(n.event.kind||n.event.type||`event`),1)]),_:1}),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(i.value>0?`#${i.value}`:`—`),1)]),_:1}),B(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[z(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},D(a.value.text),9,zA)]),_:1}),B(k(Q),null,{default:A(()=>[V(D(k($O)(n.event.at||Date.now())),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),VA=M({__name:`LiveActivityCard`,setup(e){let t=PT();function n(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(I(),R(k(iO),null,{default:A(()=>[B(k(lO),null,{default:A(()=>[B(k(uO),null,{default:A(()=>[...t[0]||=[V(`Live activity`,-1)]]),_:1}),B(k(sO),null,{default:A(()=>[...t[1]||=[V(`Last 50, newest first`,-1)]]),_:1}),B(k(aO),null,{default:A(()=>[B(k(TO),{variant:k(rA)},{default:A(()=>[V(D(k(nA)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),B(k(oO),null,{default:A(()=>[B(k(xO),null,{default:A(()=>[B(k(wO),null,{default:A(()=>[B(k(CO),null,{default:A(()=>[B(k($),null,{default:A(()=>[...t[2]||=[V(`Event`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...t[3]||=[V(`Task`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...t[4]||=[V(`Detail`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...t[5]||=[V(`When`,-1)]]),_:1})]),_:1})]),_:1}),B(k(SO),null,{default:A(()=>[k(tA).length?(I(!0),L(F,{key:1},N(k(tA),(e,t)=>(I(),R(BA,{key:t,event:e,onOpen:n},null,8,[`event`]))),128)):(I(),R(k(CO),{key:0},{default:A(()=>[B(k(Q),{colspan:`4`},{default:A(()=>[B(k(dO),null,{default:A(()=>[B(k(mO),null,{default:A(()=>[B(k(_O),null,{default:A(()=>[...t[6]||=[V(`Waiting for activity`,-1)]]),_:1}),B(k(pO),null,{default:A(()=>[...t[7]||=[V(`Events appear here as Archie works.`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1}))}}),HA=M({__name:`Progress`,props:{modelValue:{default:0},max:{},getValueLabel:{},getValueText:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=NS(t,`class`);return(e,r)=>(I(),R(k(Lb),U({"data-slot":`progress`},k(n),{class:k(q)(`bg-muted h-1 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class)}),{default:A(()=>[B(k(Rb),{"data-slot":`progress-indicator`,class:`bg-primary size-full flex-1 transition-all`,style:ye(`transform: translateX(-${100-(t.modelValue??0)}%);`)},null,8,[`style`])]),_:1},16,[`class`]))}}),UA=`archie.setup-complete.dismissed.v1`;function WA(e,t=globalThis.localStorage){if(!e?.steps?.length)return{kind:`omit`,remaining:[]};let n=e.steps.filter(e=>!e.done);return n.length?(t?.removeItem?.(UA),{kind:`incomplete`,remaining:n}):t?.getItem?.(`archie.setup-complete.dismissed.v1`)===`1`?{kind:`dismissed`,remaining:[]}:{kind:`complete`,remaining:[]}}function GA(e=globalThis.localStorage){e?.setItem?.(UA,`1`)}var KA={class:`text-lg font-semibold text-primary`},qA={class:`flex flex-col gap-3`},JA={key:0,class:`mt-0.5 text-xs text-fg-subtle`},YA=M({__name:`SetupPanel`,setup(e){let t=O(WA(Zk.value));j(Zk,()=>{t.value=WA(Zk.value)});let n=W(()=>Zk.value?.steps??[]),r=W(()=>{let e=n.value.length;return e?Math.round((e-t.value.remaining.length)/e*100):0});function i(){GA(),t.value=WA(Zk.value)}return(e,a)=>t.value.kind===`incomplete`?(I(),R(k(iO),{key:0},{default:A(()=>[B(k(lO),null,{default:A(()=>[B(k(uO),null,{default:A(()=>[...a[0]||=[V(`Finish setting up`,-1)]]),_:1}),B(k(sO),null,{default:A(()=>[...a[1]||=[V(`Archie needs these before it can work on its own.`,-1)]]),_:1}),B(k(aO),null,{default:A(()=>[z(`span`,KA,D(r.value)+`%`,1)]),_:1})]),_:1}),B(k(oO),null,{default:A(()=>[B(k(HA),{"model-value":r.value,class:`mb-4`},null,8,[`model-value`]),z(`ul`,qA,[(I(!0),L(F,null,N(n.value,(e,t)=>(I(),L(`li`,{key:t,class:`flex items-start gap-3`},[z(`span`,{class:E([`mt-px grid size-[18px] flex-none place-items-center rounded-full border-[1.5px] border-border-strong text-xs text-fg-subtle`,e.done?`border-transparent bg-ok-soft text-ok`:``])},[e.done?(I(),R(k(Hu),{key:0,class:`size-3`})):H(``,!0)],2),z(`div`,null,[z(`div`,{class:E([`text-sm`,e.done?`text-fg-muted line-through`:``])},D(e.title),3),e.detail?(I(),L(`div`,JA,D(e.detail),1)):H(``,!0)])]))),128))])]),_:1})]),_:1})):t.value.kind===`complete`?(I(),R(k(iO),{key:1},{default:A(()=>[B(k(lO),null,{default:A(()=>[B(k(uO),null,{default:A(()=>[...a[2]||=[V(`Setup complete`,-1)]]),_:1}),B(k(sO),null,{default:A(()=>[...a[3]||=[V(`ArLine truncated
|
||||
`)}return(e,i)=>k(MN)?(I(),R(_N,{key:0,title:`Update status`,description:`Not configured on this deployment, so there is nothing to check against.`})):k(jN)?(I(),R(k(iO),{key:1,class:`mb-4`},{default:A(()=>[B(k(oO),null,{default:A(()=>[B(k(dO),null,{default:A(()=>[B(k(mO),null,{default:A(()=>[B(k(_O),null,{default:A(()=>[...i[0]||=[V(`Update status unavailable`,-1)]]),_:1}),B(k(pO),null,{default:A(()=>[V(D(k(jN)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):(I(),R(_N,{key:2,title:`Update status`,description:`How each component is deployed, and whether what's running matches what's installed. Hover a row for the exact versions compared.`},{default:A(()=>[k(AN).length?(I(),R(k(xO),{key:1},{default:A(()=>[B(k(wO),null,{default:A(()=>[B(k(CO),null,{default:A(()=>[B(k($),null,{default:A(()=>[...i[3]||=[V(`Component`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[4]||=[V(`Install type`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[5]||=[V(`Running`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[6]||=[V(`Latest available`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[7]||=[V(`Status`,-1)]]),_:1})]),_:1})]),_:1}),B(k(SO),null,{default:A(()=>[(I(!0),L(F,null,N(k(AN),e=>(I(),R(k(CO),{key:e.id||e.label,title:r(e)},{default:A(()=>[B(k(Q),{class:`font-medium`},{default:A(()=>[V(D(e.label||e.id),1)]),_:2},1024),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(e.install_type||`—`),1)]),_:2},1024),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(e.running_version||`—`),1)]),_:2},1024),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(e.latest_available||`—`),1)]),_:2},1024),B(k(Q),null,{default:A(()=>[B(k(TO),{variant:n[e.status||``]||`idle`},{default:A(()=>[V(D(t[e.status||``]||e.status),1)]),_:2},1032,[`variant`])]),_:2},1024)]),_:2},1032,[`title`]))),128))]),_:1})]),_:1})):(I(),R(k(dO),{key:0},{default:A(()=>[B(k(mO),null,{default:A(()=>[B(k(_O),null,{default:A(()=>[...i[1]||=[V(`No components reported`,-1)]]),_:1}),B(k(pO),null,{default:A(()=>[...i[2]||=[V(`The configured update-check command returned nothing.`,-1)]]),_:1})]),_:1})]),_:1}))]),_:1}))}}),QP=M({__name:`SystemStatusPage`,setup(e){async function t(){await Promise.all([kN(),NN(),FN()])}return ia(t),(e,n)=>(I(),L(`div`,null,[B(MD,{title:`Status`,subtitle:`What archied is running with right now.`},{default:A(()=>[B(k(Z),{variant:`outline`,onClick:t},{default:A(()=>[B(k(rd),{"data-icon":`inline-start`}),n[0]||=V(` Refresh `,-1)]),_:1})]),_:1}),B(vP),B(ZP),B(XP),k(ON)?(I(),R(oP,{key:0})):(I(),L(F,{key:1},[B(KP),B(aP,{ids:k(eP)},null,8,[`ids`]),B(qP)],64))]))}}),$P=M({__name:`LifecycleActionList`,props:{actions:{}},setup(e){let t=e;function n(e){return e===`quiet`?`ghost`:e===`danger`?`destructive`:`outline`}return(e,r)=>(I(),L(F,null,[r[2]||=z(`h3`,{class:`mt-5 mb-2 text-sm font-semibold text-fg-muted`},`Actions`,-1),t.actions.length?(I(),R(yN,{key:1},{default:A(()=>[(I(!0),L(F,null,N(t.actions,e=>(I(),R($N,{key:e.id,label:e.id},{value:A(()=>[z(`span`,null,[B(k(Z),{variant:n(e.kind),size:`xs`,disabled:``},{default:A(()=>[V(D(e.label??e.id),1)]),_:2},1032,[`variant`])])]),_:2},1032,[`label`]))),128))]),_:1})):(I(),R(k(dO),{key:0},{default:A(()=>[B(k(mO),null,{default:A(()=>[B(k(_O),null,{default:A(()=>[...r[0]||=[V(`No actions reported`,-1)]]),_:1}),B(k(pO),null,{default:A(()=>[...r[1]||=[V(`The server did not return any operator actions.`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),eF=[{id:`queued`,label:`Queued`,kind:`idle`},{id:`running`,label:`Working`,kind:`info`},{id:`waiting_human`,label:`Waiting for you`,kind:`warn`,needs_you:!0},{id:`pr_open`,label:`In review`,kind:`ok`},{id:`merged`,label:`Merged`,kind:`ok`},{id:`parked`,label:`Parked`,kind:`warn`,needs_you:!0},{id:`dead`,label:`Stopped (too many retries)`,kind:`danger`},{id:`rejected`,label:`Rejected`,kind:`danger`},{id:`closed_wont_do`,label:`Won't do`,kind:`idle`}],tF=[{id:`cancel`,label:`Cancel`,kind:`quiet`,confirm:`Cancel "{title}"? This closes the forge issue.`},{id:`stop`,label:`Stop`,kind:`primary`,confirm:`Stop "{title}"? Recoverable work will remain parked.`},{id:`approve`,label:`Approve`,kind:`primary`},{id:`reject`,label:`Reject`,kind:`quiet`,confirm:`Reject "{title}"? This closes the forge issue.`},{id:`retry`,label:`Retry`,kind:`primary`},{id:`abandon`,label:`Abandon`,kind:`quiet`,confirm:`Abandon "{title}"? This closes the forge issue.`},{id:`archive`,label:`Archive`,kind:`quiet`,confirm:`Archive the local record for "{title}"?`},{id:`open_pr`,label:`Open PR`,kind:`link`},{id:`open_issue`,label:`Open issue`,kind:`link`}],nF=vn([...eF]),rF=vn([...tF]),iF=W(()=>new Map(nF.value.map(e=>[e.id,e]))),aF=W(()=>new Map(rF.value.map(e=>[e.id,e])));async function oF(){try{let e=await J.taskMeta();Array.isArray(e?.statuses)&&(nF.value=e.statuses),Array.isArray(e?.actions)&&(rF.value=e.actions)}catch{}}function sF(e){return iF.value.get(e)?.label||e||`Unknown`}function cF(e){return iF.value.get(e)?.kind||`idle`}function lF(){return nF.value}function uF(){return nF.value.map(e=>e.id)}function dF(){return new
Line truncated
|
||||
Defaulting to \`null\`.`),null)}function Lb(e){return Fb(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 \`${Mb}\`.`),Mb)}var Rb=M({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Mb},getValueLabel:{type:Function,required:!1,default:(e,t)=>Fb(e)?`${Math.round(e/t*Mb)}%`: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;Y();let i=Um(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Um(n,`max`,r,{passive:n.max===void 0});j(()=>i.value,async e=>{let t=Ib(e,n.max);t!==e&&(await or(),i.value=t)},{immediate:!0}),j(()=>n.max,e=>{let t=Lb(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=W(()=>cm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Pb({modelValue:i,max:a,progressState:o}),(e,t)=>(I(),R(k(X),{"as-child":e.asChild,as:e.as,"aria-valuemax":k(a),"aria-valuemin":0,"aria-valuenow":Fb(k(i))?k(i):void 0,"aria-valuetext":e.getValueText?.(k(i),k(a)),"aria-label":e.getValueLabel(k(i),k(a)),role:`progressbar`,"data-state":o.value,"data-value":k(i)??void 0,"data-max":k(a)},{default:A(()=>[P(e.$slots,`default`,{modelValue:k(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),zb=M({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Nb();return Y(),(e,r)=>(I(),R(k(X),U(t,{"data-state":k(n).progressState.value,"data-value":k(n).modelValue?.value??void 0,"data-max":k(n).max.value}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),[Bb,Vb]=am(`ScrollAreaRoot`),Hb=M({__name:`ScrollAreaRoot`,props:{type:{type:String,required:!1,default:`hover`},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=O(0),i=O(0),a=O(),o=O(),s=O(),c=O(),l=O(!1),u=O(!1),{type:d,dir:f,scrollHideDelay:p}=Dn(n),m=ah(f);function h(){a.value?.scrollTo({top:0})}function g(){a.value?.scrollTo({top:0,left:0})}t({viewport:a,scrollTop:h,scrollTopLeft:g});let{forwardRef:_,currentElement:v}=Y();return Vb({type:d,dir:m,scrollHideDelay:p,scrollArea:v,viewport:a,onViewportChange:e=>{a.value=e||void 0},content:o,onContentChange:e=>{o.value=e},scrollbarX:s,scrollbarXEnabled:l,scrollbarY:c,scrollbarYEnabled:u,onScrollbarXChange:e=>{s.value=e||void 0},onScrollbarYChange:e=>{c.value=e||void 0},onScrollbarXEnabledChange:e=>{l.value=e},onScrollbarYEnabledChange:e=>{u.value=e},onCornerWidthChange:e=>{r.value=e},onCornerHeightChange:e=>{i.value=e}}),(e,t)=>(I(),R(k(X),{ref:k(_),"as-child":n.asChild,as:e.as,dir:k(m),style:ye({position:`relative`,"--reka-scroll-area-corner-width":`${r.value}px`,"--reka-scroll-area-corner-height":`${i.value}px`})},{default:A(()=>[P(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`dir`,`style`]))}}),Ub=M({__name:`ScrollAreaCornerImpl`,setup(e){let t=Bb(),n=O(0),r=O(0),i=W(()=>!!n.value&&!!r.value);function a(){let e=t.scrollbarX.value?.offsetHeight||0;t.onCornerHeightChange(e),r.value=e}function o(){let e=t.scrollbarY.value?.offsetWidth||0;t.onCornerWidthChange(e),n.value=e}return Hm(t.scrollbarX.value,a),Hm(t.scrollbarY.value,o),j(()=>t.scrollbarX.value,a),j(()=>t.scrollbarY.value,o),(e,a)=>i.value?(I(),R(k(X),U({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:`absolute`,right:k(t).dir.value===`ltr`?0:void 0,left:k(t).dir.value===`rtl`?0:void 0,bottom:0}},e.$parent?.$props),{default:A(()=>[P(e.$slots,`default`)]),_:3},16,[`style`])):H(`v-if`,!0)}}),Wb=M({__name:`ScrollAreaCorner`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=Y(),r=Bb(),i=W(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),a=W(()=>r.type.value!==`scroll`&&i.value);return(e,r)=>a.value?(I(),R(Ub,U({key:0},t,{ref:k(n)}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16)):H(`v-if`,!0)}});function Gb(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Kb(e){let t=qb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function qb(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Jb(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Yb(e,t,n=`ltr`){let r=Kb(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=im(e,c[0],c[1]);return Gb([0,o],[0,s])(l)}functLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Aw(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Aw(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=Mw(c),u=e+1<n.length?Mw(n[e+1]):null;if(l&&u&&Nw(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Mw(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Aw(e)),rows:r.map(e=>e.map(e=>Aw(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:Aw(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:Aw(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function Mw(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 Nw(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Pw={class:`[overflow-wrap:anywhere]`},Fw={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Iw={class:`font-mono text-[0.85em]`},Lw={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Rw={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},zw={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Bw={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Vw={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Hw={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Uw={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Ww={key:8,class:`mb-2.5 last:mb-0`},Gw=M({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=W(()=>jw(t.text));return(e,t)=>(I(),L(`div`,Pw,[(I(!0),L(F,null,N(n.value,(e,t)=>(I(),L(F,{key:t},[e.kind===`pre`?(I(),L(`pre`,Fw,[z(`code`,Iw,D(e.code),1)])):e.kind===`table`?(I(),L(`table`,Lw,[z(`thead`,null,[z(`tr`,null,[(I(!0),L(F,null,N(e.head,(e,t)=>(I(),L(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[B(Ow,{inline:e},null,8,[`inline`])]))),128))])]),z(`tbody`,null,[(I(!0),L(F,null,N(e.rows,(e,t)=>(I(),L(`tr`,{key:t},[(I(!0),L(F,null,N(e,(e,t)=>(I(),L(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[B(Ow,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(I(),L(`blockquote`,Rw,[B(Ow,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(I(),L(`h1`,zw,[B(Ow,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(I(),L(`h2`,Bw,[B(Ow,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(I(),L(`h3`,Vw,[B(Ow,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(I(),L(`ul`,Hw,[(I(!0),L(F,null,N(e.items,(e,t)=>(I(),L(`li`,{key:t},[B(Ow,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(I(),L(`ol`,Uw,[(I(!0),L(F,null,N(e.items,(e,t)=>(I(),L(`li`,{key:t},[B(Ow,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(I(),L(`p`,Ww,[B(Ow,{inline:e.inline},null,8,[`inline`])])):H(``,!0)],64))),128))]))}}),Kw={class:`truncate`},qw=M({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ha(`RouterLink`);return I(),R(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-primary transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:A(()=>[B(k(Vu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),z(`span`,Kw,D(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Jw={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Yw={class:`font-semibold text-foreground`},Xw={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Zw=M({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=W(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=W(()=>t.tool.parameters||t.tool.Parameters||``),i=W(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=W(()=>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?(I(),R(qw,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(I(),L(`div`,Jw,[B(k(pd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),z(`span`,Yw,D(n.value),1),r.value?(I(),L(`code`,Xw,D(r.value),1)):H(``,!0),z(`span`,{class:E(k(q)(`text-fg-muted`,i.value&&`text-danger`))},D(a.value),3)]))}}),Qw={key:0,class:`mb-2 grid gap-0.5 text-xs`},$w={key:2,class:`whitespace-pre-wrap`},eT=M({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(I(),L(`div`,{class:E([`flex`,e.assistant?`justify-start`:`justify-end`])},[z(`div`,{class:E(k(q)(`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?(I(),L(`div`,Qw,[(I(!0),L(F,null,N(e.tools,(t,n)=>(I(),R(Zw,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):H(``,!0),e.assistant?(I(),R(Gw,{key:1,text:e.text},null,8,[`text`])):(I(),L(`div`,$w,D(e.text),1)),P(t.$slots,`default`)],2)],2))}}),tT={class:`w-full self-center justify-self-center py-6 text-center`},nT={class:`grid gap-2`},rT=[`onClick`],iT=M({__name:`ChatEmptyState`,emits:[`prompt`],setup(e,{emit:t}){let n=t,r=[`Summarise active tasks`,`Show running agents`,`Check system status`];return(e,t)=>(I(),L(`div`,tT,[t[0]||=z(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 pLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>xA?`${n.slice(0,xA).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var CA=[`title`],wA=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=W(()=>Gk(n.event)),a=W(()=>SA(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=W(()=>n.event.at?LO(n.event.at):`—`);return(e,t)=>(I(),R(k(sO),{class:E(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:[fu(uu(o,[`prevent`]),[`enter`]),fu(uu(o,[`prevent`]),[`space`])]},{default:A(()=>[B(k(Q),{class:`font-medium`},{default:A(()=>[V(D(n.event.kind||n.event.type||`event`),1)]),_:1}),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(i.value>0?`#${i.value}`:`—`),1)]),_:1}),B(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[z(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},D(a.value.text),9,CA)]),_:1}),B(k(Q),null,{default:A(()=>[V(D(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),TA={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},EA=M({__name:`LiveActivityCard`,setup(e){let t=DT();function n(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(I(),R(k(HD),null,{default:A(()=>[B(k(qD),null,{default:A(()=>[B(k(JD),null,{default:A(()=>[...t[0]||=[V(`Live activity`,-1)]]),_:1}),B(k(GD),null,{default:A(()=>[...t[1]||=[V(`Last 50, newest first`,-1)]]),_:1}),B(k(UD),null,{default:A(()=>[B(k(lO),{variant:k(Vk)},{default:A(()=>[V(D(k(Bk)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),B(k(WD),null,{default:A(()=>[z(`div`,TA,[B(k(aO),null,{default:A(()=>[B(k(cO),null,{default:A(()=>[B(k(sO),null,{default:A(()=>[B(k($),null,{default:A(()=>[...t[2]||=[V(`Event`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...t[3]||=[V(`Task`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...t[4]||=[V(`Detail`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...t[5]||=[V(`When`,-1)]]),_:1})]),_:1})]),_:1}),B(k(oO),null,{default:A(()=>[k(zk).length?(I(!0),L(F,{key:1},N(k(zk),(e,t)=>(I(),R(wA,{key:t,event:e,onOpen:n},null,8,[`event`]))),128)):(I(),R(k(sO),{key:0},{default:A(()=>[B(k(Q),{colspan:`4`},{default:A(()=>[B(k(YD),null,{default:A(()=>[B(k(QD),null,{default:A(()=>[B(k(tO),null,{default:A(()=>[...t[6]||=[V(`Waiting for activity`,-1)]]),_:1}),B(k(ZD),null,{default:A(()=>[...t[7]||=[V(`Events appear here as Archie works.`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})])]),_:1})]),_:1}))}}),DA=M({__name:`Progress`,props:{modelValue:{default:0},max:{},getValueLabel:{},getValueText:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=PS(t,`class`);return(e,r)=>(I(),R(k(Rb),U({"data-slot":`progress`},k(n),{class:k(q)(`bg-muted h-1 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class)}),{default:A(()=>[B(k(zb),{"data-slot":`progress-indicator`,class:`bg-primary size-full flex-1 transition-all`,style:ye(`transform: translateX(-${100-(t.modelValue??0)}%);`)},null,8,[`style`])]),_:1},16,[`class`]))}}),OA=`archie.setup-complete.dismissed.v1`;function kA(e,t=globalThis.localStorage){if(!e?.steps?.length)return{kind:`omit`,remaining:[]};let n=e.steps.filter(e=>!e.done);return n.length?(t?.removeItem?.(OA),{kind:`incomplete`,remaining:n}):t?.getItem?.(`archie.setup-complete.dismissed.v1`)===`1`?{kind:`dismissed`,remaining:[]}:{kind:`complete`,remaining:[]}}function AA(e=globalThis.localStorage){e?.setItem?.(OA,`1`)}var jA={class:`text-lg font-semibold text-primary`},MA={class:`flex flex-col gap-3`},NA={key:0,class:`mt-0.5 text-xs text-fg-subtle`},PA=M({__name:`SetupPanel`,setup(e){let t=O(kA(Fk.value));j(Fk,()=>{t.value=kA(Fk.value)});let n=W(()=>Fk.value?.steps??[]),r=W(()=>{let e=n.value.length;return e?Math.round((e-t.value.remaining.length)/e*100):0});function i(){AA(),t.value=kA(Fk.value)}return(e,a)=>t.value.kind===`incomplete`?(I(),R(k(HD),{key:0},{default:A(()=>[B(k(qD),null,{default:A(()=>[B(k(JD),null,{default:A(()=>[...a[0]||=[V(`Finish setting up`,-1)]]),_:1}),B(k(GD),null,{default:A(()=>[...a[1]||=[V(`Archie needs these before it can work on its own.`,-1)]]),_:1}),B(k(UD),null,{default:A(()=>[z(`span`,jA,D(r.value)+`%`,1)]),_:1})]),_:1}),B(k(WD),null,{default:A(()=>[B(k(DA),{"model-value":r.value,class:`mb-4`},null,8,[`model-value`]),z(`ul`,MA,[(I(!0),L(F,null,N(n.value,(e,t)=>(I(),L(`li`,{key:t,class:`flex items-start gap-3`},[z(`span`,{class:E([`mt-px grid size-[18px] flex-none place-items-center rounded-full border-[1.5px] border-border-strong text-xs text-fg-subtle`,e.done?`border-transparent bg-ok-soft text-ok`:``])},[e.done?(I(),R(k(Hu),{key:0,class:`size-3`})):H(``,!0)],2),z(`div`,null,[z(`div`,{class:E([`text-sm`,e.done?`text-fg-muted line-through`:``])},D(e.title),3),e.detail?(I(),L(`div`,NA,D(e.detail),1)):H(``,!0)])]))),128))])]),_:1})]),_:1})):t.value.kind===`complete`?(I(),R(k(HD),{key:1},{default:A(()=>[B(k(qD),null,{default:A(()=>[B(k(JD),nul
Line truncated
|
||||
`)}return(e,i)=>k(zN)?(I(),R(hN,{key:0,title:`Update status`,description:`Not configured on this deployment.`})):k(RN)?(I(),R(k(HD),{key:1,class:`mb-4`},{default:A(()=>[B(k(WD),null,{default:A(()=>[B(k(YD),null,{default:A(()=>[B(k(QD),null,{default:A(()=>[B(k(tO),null,{default:A(()=>[...i[0]||=[V(`Update status unavailable`,-1)]]),_:1}),B(k(ZD),null,{default:A(()=>[V(D(k(RN)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):(I(),R(hN,{key:2,title:`Update status`,description:`Whether what's running matches what's installed.`},{default:A(()=>[k(LN).length?(I(),R(k(aO),{key:1},{default:A(()=>[B(k(cO),null,{default:A(()=>[B(k(sO),null,{default:A(()=>[B(k($),null,{default:A(()=>[...i[3]||=[V(`Component`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[4]||=[V(`Install type`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[5]||=[V(`Running`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[6]||=[V(`Latest available`,-1)]]),_:1}),B(k($),null,{default:A(()=>[...i[7]||=[V(`Status`,-1)]]),_:1})]),_:1})]),_:1}),B(k(oO),null,{default:A(()=>[(I(!0),L(F,null,N(k(LN),e=>(I(),R(k(sO),{key:e.id||e.label,title:r(e)},{default:A(()=>[B(k(Q),{class:`font-medium`},{default:A(()=>[V(D(e.label||e.id),1)]),_:2},1024),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(e.install_type||`—`),1)]),_:2},1024),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(e.running_version||`—`),1)]),_:2},1024),B(k(Q),{class:`font-mono`},{default:A(()=>[V(D(e.latest_available||`—`),1)]),_:2},1024),B(k(Q),null,{default:A(()=>[B(k(lO),{variant:n[e.status||``]||`idle`},{default:A(()=>[V(D(t[e.status||``]||e.status),1)]),_:2},1032,[`variant`])]),_:2},1024)]),_:2},1032,[`title`]))),128))]),_:1})]),_:1})):(I(),R(k(YD),{key:0},{default:A(()=>[B(k(QD),null,{default:A(()=>[B(k(tO),null,{default:A(()=>[...i[1]||=[V(`No components reported`,-1)]]),_:1}),B(k(ZD),null,{default:A(()=>[...i[2]||=[V(`The configured update-check command returned nothing.`,-1)]]),_:1})]),_:1})]),_:1}))]),_:1}))}}),aF=M({__name:`SystemStatusPage`,setup(e){async function t(){await Promise.all([IN(),BN(),HN()])}return ia(t),(e,n)=>(I(),L(`div`,null,[B(gD,{title:`Status`,subtitle:`What archied is running with right now.`},{default:A(()=>[B(k(Z),{variant:`outline`,onClick:t},{default:A(()=>[B(k(id),{"data-icon":`inline-start`}),n[0]||=V(` Refresh `,-1)]),_:1})]),_:1}),B(TP),B(iF),B(rF),k(FN)?(I(),R(pP,{key:0})):(I(),L(F,{key:1},[B($P),B(fP,{ids:k(sP)},null,8,[`ids`]),B(eF)],64))]))}}),oF=M({__name:`LifecycleActionList`,props:{actions:{}},setup(e){let t=e;function n(e){return e===`quiet`?`ghost`:e===`danger`?`destructive`:`outline`}return(e,r)=>(I(),L(F,null,[r[2]||=z(`h3`,{class:`mt-5 mb-2 text-sm font-semibold text-fg-muted`},`Actions`,-1),t.actions.length?(I(),R(_N,{key:1},{default:A(()=>[(I(!0),L(F,null,N(t.actions,e=>(I(),R(oP,{key:e.id,label:e.id},{value:A(()=>[z(`span`,null,[B(k(Z),{variant:n(e.kind),size:`xs`,disabled:``},{default:A(()=>[V(D(e.label??e.id),1)]),_:2},1032,[`variant`])])]),_:2},1032,[`label`]))),128))]),_:1})):(I(),R(k(YD),{key:0},{default:A(()=>[B(k(QD),null,{default:A(()=>[B(k(tO),null,{default:A(()=>[...r[0]||=[V(`No actions reported`,-1)]]),_:1}),B(k(ZD),null,{default:A(()=>[...r[1]||=[V(`The server did not return any operator actions.`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),sF=M({__name:`LifecycleStatusList`,props:{statuses:{}},setup(e){let t=e;return(e,n)=>(I(),L(F,null,[n[2]||=z(`h3`,{class:`mt-5 mb-2 text-sm font-semibold text-fg-muted first:mt-0`},`Statuses`,-1),t.statuses.length?(I(),R(_N,{key:1},{default:A(()=>[(I(!0),L(F,null,N(t.statuses,e=>(I(),R(oP,{key:e.id,label:e.id},{value:A(()=>[z(`span`,null,[B(k(lO),{variant:e.kind??k(YA)(e.id)},{default:A(()=>[V(D(e.label??k(JA)(e.id)),1)]),_:2},1032,[`variant`])])]),_:2},1032,[`label`]))),128))]),_:1})):(I(),R(k(YD),{key:0},{default:A(()=>[B(k(QD),null,{default:A(()=>[B(k(tO),null,{default:A(()=>[...n[0]||=[V(`No statuses reported`,-1)]]),_:1}),B(k(ZD),null,{default:A(()=>[...n[1]||=[V(`The server did not return any lifecycle statuses.`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),cF=M({__name:`LifecycleCard`,setup(e){let t=W(()=>YN.value?.statuses??[]),n=W(()=>YN.value?.actions??[]);return(e,r)=>k(XN)?(I(),R(hN,{key:0,title:`Work lifecycle`,description:`The task statuses and operator actions archied ships.`},{default:A(()=>[B(k(YD),null,{default:A(()=>[B(k(QD),null,{default:A(()=>[B(k(tO),null,{default:A(()=>[...r[0]||=[V(`Lifecycle unavailable`,-1)]]),_:1}),B(k(ZD),null,{default:A(()=>[V(D(k(XN)),1)]),_:1})]),_:1})]),_:1})]),_:1})):(I(),R(hN,{key:1,title:`Work lifecycle`,description:`The task statuses and operator actions archied ships.`},{default:A(()=>[B(sF,{statuses:t.value},null,8,[`statuses`]),B(oF,{actions:n.value},null,8,[`actions`])]),_:1}))}}),lF=M({__name:`SystemTasksPage`,setup(e){async function t(){await Promise.all([IN(),ZN()])}return ia(t),(e,n)=>(I(),L(`div`,null,[B(gD,{title:`Task settings`,subtitle:`How work moves through archied, and what it is allowed to spend.`},{default:A(()=>[B(k(Z),{variant:`outline`,onClick
Line truncated
|
||||
@@ -2,6 +2,7 @@
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import ChatLauncher from "@/chat/ChatLauncher.vue";
|
||||
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
|
||||
import Topbar from "@/components/topbar/Topbar.vue";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { hidden, loadCapabilities } from "@/lib/capabilities";
|
||||
@@ -60,5 +61,13 @@ onMounted(() => {
|
||||
ride off the bottom of a long page.
|
||||
-->
|
||||
<ChatLauncher />
|
||||
|
||||
<!--
|
||||
Outside the shell for the same reason as the launcher above: the frame's
|
||||
backdrop-filter would otherwise become the containing block for the
|
||||
palette's fixed overlay. One instance for the whole app -- its global
|
||||
shortcut listener lives and dies with this mount.
|
||||
-->
|
||||
<CommandPalette :hidden="hidden" />
|
||||
</TooltipProvider>
|
||||
</template>
|
||||
@@ -0,0 +1,194 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { Search } from "@lucide/vue";
|
||||
|
||||
import { navEntries, type NavEntry } from "@/lib/nav";
|
||||
|
||||
/**
|
||||
* The command palette: every section the nav can reach, opened with Cmd/Ctrl+K
|
||||
* or '/' from anywhere. It is a jump list, not a data search -- the topbar's
|
||||
* SearchBar owns the same list with prefix matching from a visible field; this
|
||||
* one adds substring matching and arrow-key selection from a shortcut.
|
||||
*
|
||||
* Styling and keyboard handling mirror ChatSlashPalette, the in-app palette
|
||||
* precedent: a bordered popover surface, mousedown prevented on the options so
|
||||
* choosing with the pointer never steals focus from the filter, and the list
|
||||
* scrolled so the highlighted row stays visible. Nothing here animates, so the
|
||||
* shell's prefers-reduced-motion rule has nothing to quiet.
|
||||
*/
|
||||
const props = defineProps<{ hidden: string[] }>();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const open = ref(false);
|
||||
const query = ref("");
|
||||
const selection = ref(0);
|
||||
const field = ref<HTMLInputElement | null>(null);
|
||||
const list = ref<HTMLElement | null>(null);
|
||||
|
||||
// The same list the topbar's SearchBar and Nav read: navEntries flattens the
|
||||
// nav tree and drops what this composition cannot back, so the palette can
|
||||
// never offer a destination the server cannot serve.
|
||||
const allEntries = computed(() => navEntries(props.hidden).filter((entry) => !entry.soon));
|
||||
|
||||
// Substring, not prefix: an operator who remembers "where do channels live"
|
||||
// types a word from the description, not the start of the label.
|
||||
const matches = computed(() => {
|
||||
const needle = query.value.trim().toLowerCase();
|
||||
if (!needle) return allEntries.value;
|
||||
return allEntries.value.filter((entry) =>
|
||||
`${entry.label} ${entry.description} ${entry.path}`.toLowerCase().includes(needle),
|
||||
);
|
||||
});
|
||||
watch(query, () => {
|
||||
selection.value = 0;
|
||||
});
|
||||
// Capabilities can land while the palette is open and shrink the list; the
|
||||
// highlight must not point past the last row.
|
||||
watch(matches, () => {
|
||||
if (selection.value >= matches.value.length) selection.value = 0;
|
||||
});
|
||||
|
||||
function optionId(index: number): string {
|
||||
return `command-palette-option-${index}`;
|
||||
}
|
||||
|
||||
async function show(): Promise<void> {
|
||||
query.value = "";
|
||||
selection.value = 0;
|
||||
open.value = true;
|
||||
await nextTick();
|
||||
field.value?.focus();
|
||||
}
|
||||
|
||||
function close(): void {
|
||||
open.value = false;
|
||||
field.value?.blur();
|
||||
}
|
||||
|
||||
function toggle(): void {
|
||||
if (open.value) close();
|
||||
else void show();
|
||||
}
|
||||
|
||||
// '/' opens only when the keystroke was meant for a field, not for the page:
|
||||
// typing a slash into the composer or the topbar search must stay typing.
|
||||
function isEditableTarget(event: KeyboardEvent): boolean {
|
||||
const el = event.target;
|
||||
return (
|
||||
el instanceof HTMLElement &&
|
||||
(el.isContentEditable || el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT")
|
||||
);
|
||||
}
|
||||
|
||||
// Registered on document in the bubble phase (capture: false): the palette is
|
||||
// the last thing that should see a keystroke, after any focused field has had
|
||||
// its turn.
|
||||
function onGlobalKeydown(event: KeyboardEvent): void {
|
||||
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
||||
event.preventDefault();
|
||||
toggle();
|
||||
return;
|
||||
}
|
||||
if (event.key === "/" && !open.value && !isEditableTarget(event)) {
|
||||
event.preventDefault();
|
||||
void show();
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => document.addEventListener("keydown", onGlobalKeydown));
|
||||
onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
|
||||
|
||||
function onKeydown(event: KeyboardEvent): void {
|
||||
if (event.key === "Escape") {
|
||||
// Consumed here so closing the palette is not also read as a dismissal of
|
||||
// whatever is open behind it (ChatLauncher watches defaultPrevented).
|
||||
event.preventDefault();
|
||||
close();
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowDown") {
|
||||
event.preventDefault();
|
||||
if (matches.value.length) selection.value = Math.min(selection.value + 1, matches.value.length - 1);
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowUp") {
|
||||
event.preventDefault();
|
||||
selection.value = Math.max(selection.value - 1, 0);
|
||||
return;
|
||||
}
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
const entry = matches.value[selection.value];
|
||||
if (entry) choose(entry);
|
||||
}
|
||||
}
|
||||
|
||||
function choose(entry: NavEntry): void {
|
||||
void router.push(entry.path);
|
||||
close();
|
||||
}
|
||||
|
||||
// Keep the highlighted row visible once matches run past the rows that fit.
|
||||
// block: 'nearest' scrolls the minimum distance and never animates, so reduced
|
||||
// motion needs no handling here. Optional call: not every environment
|
||||
// implements scrollIntoView.
|
||||
watch([selection, matches], async () => {
|
||||
if (!open.value) return;
|
||||
await nextTick();
|
||||
list.value?.querySelector('[aria-selected="true"]')?.scrollIntoView?.({ block: "nearest" });
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="open" class="fixed inset-0 isolate z-50" @mousedown.self="close">
|
||||
<div class="bg-black/10 supports-backdrop-filter:backdrop-blur-xs absolute inset-0" aria-hidden="true" />
|
||||
<div
|
||||
role="dialog"
|
||||
aria-label="Command palette"
|
||||
class="bg-popover text-popover-foreground border-border-strong shadow-md mx-auto mt-[15vh] w-[calc(100%-2rem)] max-w-lg overflow-hidden rounded-xl border"
|
||||
>
|
||||
<div class="border-border flex items-center gap-2 border-b px-3">
|
||||
<Search :size="15" class="text-muted-foreground shrink-0" />
|
||||
<input
|
||||
ref="field"
|
||||
v-model="query"
|
||||
type="text"
|
||||
role="combobox"
|
||||
aria-label="Filter sections"
|
||||
aria-expanded="true"
|
||||
aria-controls="command-palette-list"
|
||||
:aria-activedescendant="matches[selection] ? optionId(selection) : undefined"
|
||||
class="h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
||||
placeholder="Jump to a section…"
|
||||
@keydown="onKeydown"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="command-palette-list"
|
||||
ref="list"
|
||||
role="listbox"
|
||||
aria-label="Sections"
|
||||
class="max-h-72 overflow-auto p-1.5"
|
||||
>
|
||||
<button
|
||||
v-for="(entry, index) in matches"
|
||||
:id="optionId(index)"
|
||||
:key="entry.path"
|
||||
type="button"
|
||||
role="option"
|
||||
:aria-selected="index === selection"
|
||||
class="hover:bg-muted aria-selected:bg-muted flex flex-col gap-0.5 rounded-md px-2.5 py-2 text-left outline-none"
|
||||
@mousedown.prevent
|
||||
@mousemove="selection = index"
|
||||
@click="choose(entry)"
|
||||
>
|
||||
<span class="truncate text-sm text-foreground">{{ entry.label }}</span>
|
||||
<span v-if="entry.description" class="text-fg-muted truncate text-xs">{{ entry.description }}</span>
|
||||
</button>
|
||||
<p v-if="!matches.length" class="text-fg-muted px-2.5 py-3 text-sm">No matching section.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -23,6 +23,11 @@ const detail = computed(() => activityDetail(props.event));
|
||||
function open() {
|
||||
if (taskID.value > 0) emit("open", taskID.value);
|
||||
}
|
||||
|
||||
// A missing timestamp gets an em-dash, not a call to ago(): substituting
|
||||
// Date.now() would render "just now" for an event whose time the daemon never
|
||||
// recorded -- a claim the row cannot back.
|
||||
const when = computed(() => (props.event.at ? ago(props.event.at) : "\u2014"));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -40,6 +45,6 @@ function open() {
|
||||
<TableCell class="w-[55%] max-w-0">
|
||||
<span class="block truncate" :title="detail.truncated ? detail.full : undefined">{{ detail.text }}</span>
|
||||
</TableCell>
|
||||
<TableCell>{{ ago(props.event.at || Date.now()) }}</TableCell>
|
||||
<TableCell>{{ when }}</TableCell>
|
||||
</TableRow>
|
||||
</template>
|
||||
@@ -27,29 +27,38 @@ function openTask(taskID: number) {
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Event</TableHead>
|
||||
<TableHead>Task</TableHead>
|
||||
<TableHead>Detail</TableHead>
|
||||
<TableHead>When</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-if="!activity.length">
|
||||
<TableCell colspan="4">
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Waiting for activity</EmptyTitle>
|
||||
<EmptyDescription>Events appear here as Archie works.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<ActivityRow v-for="(event, i) in activity" v-else :key="i" :event="event" @open="openTask" />
|
||||
</TableBody>
|
||||
</Table>
|
||||
<!--
|
||||
role="region" names the table for landmark navigation; aria-live is
|
||||
polite, not assertive, because rows arrive constantly while the stream
|
||||
is live and an assertive region would talk over the operator. The live
|
||||
region is the table's wrapper, so new rows are announced as they
|
||||
appear without a second hidden summary to keep in sync.
|
||||
-->
|
||||
<div role="region" aria-label="Live activity" aria-live="polite">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Event</TableHead>
|
||||
<TableHead>Task</TableHead>
|
||||
<TableHead>Detail</TableHead>
|
||||
<TableHead>When</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-if="!activity.length">
|
||||
<TableCell colspan="4">
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Waiting for activity</EmptyTitle>
|
||||
<EmptyDescription>Events appear here as Archie works.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<ActivityRow v-for="(event, i) in activity" v-else :key="i" :event="event" @open="openTask" />
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</template>
|
||||
@@ -100,7 +100,17 @@ async function reset(): Promise<void> {
|
||||
pushing every row apart. -->
|
||||
<Tooltip v-if="field?.description">
|
||||
<TooltipTrigger as-child>
|
||||
<span class="text-sm text-fg-muted">{{ label }}</span>
|
||||
<!--
|
||||
tabindex="0" is the keyboard path to the description: reka wires the
|
||||
trigger's focus/blur to the tooltip's open state, so Tab reaches the
|
||||
label and holding focus keeps the description on screen. The
|
||||
aria-label carries the label and the description together, because
|
||||
the tooltip content itself is out of the accessibility tree when the
|
||||
trigger is not hovered or focused. No visual change -- the focus
|
||||
floor in style.css draws the only new affordance, and only on
|
||||
keyboard focus.
|
||||
-->
|
||||
<span tabindex="0" :aria-label="`${label}: ${field.description}`" class="text-sm text-fg-muted">{{ label }}</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent :side-offset="8" class="max-w-80">{{ field.description }}</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
@@ -15,12 +15,12 @@ export function revealBehavior(): ScrollBehavior {
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { api } from "@/lib/api";
|
||||
import { api, subscribeEvents } from "@/lib/api";
|
||||
import TaskFilters, { initialTaskFilter, taskMatchesStatus } from "./TaskFilters.vue";
|
||||
import type { Task } from "./TaskRow.vue";
|
||||
import TaskTable from "./TaskTable.vue";
|
||||
@@ -82,8 +82,37 @@ const state = computed<"loading" | "error" | "empty" | "no-match">(() => {
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
unsubscribe = subscribeEvents(handleEvent);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearTimeout(refreshTimer);
|
||||
unsubscribe?.();
|
||||
});
|
||||
|
||||
// The live stream is an invalidation signal, not data (the same rule the
|
||||
// captures page follows): every task-shaped event says the authoritative list
|
||||
// changed, and load() asks for it again. Stage progress fires several events a
|
||||
// minute, so the re-read is debounced -- 500ms trailing, so a burst of events
|
||||
// collapses into one fetch that lands after the last one.
|
||||
const REFRESH_DEBOUNCE_MS = 500;
|
||||
let refreshTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
let unsubscribe: (() => void) | undefined;
|
||||
|
||||
function handleEvent(raw: unknown): void {
|
||||
const ev = raw as { kind?: string; task_id?: number | string } | null;
|
||||
if (!ev) return;
|
||||
// Task-shaped: anything carrying a task id (stage_start, agent_finish,
|
||||
// outcome, parked, human_approved, ...) or a lifecycle kind of its own
|
||||
// (task_queued, task_retried, ...). Chat turns and log lines never re-read
|
||||
// the board.
|
||||
if (!ev.task_id && !(typeof ev.kind === "string" && ev.kind.startsWith("task_"))) return;
|
||||
clearTimeout(refreshTimer);
|
||||
refreshTimer = setTimeout(() => {
|
||||
void load();
|
||||
}, REFRESH_DEBOUNCE_MS);
|
||||
}
|
||||
|
||||
async function load() {
|
||||
error.value = null;
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user