feat(webui): refine system navigation and appearance

This commit is contained in:
sam committed 2026-09-21 00:45:02 +10:00
1 parent 569d01c151
commit fffa6bc528
21 files changed
+433 -169

No files matched your search

+2 -7
View File
@@ -201,18 +201,13 @@ tasks:
- bash tools/uidist.sh check
test:ui:
desc: Type-check the dashboard (no unit tests during the Vue migration)
desc: Test and type-check the dashboard
dir: ui
# The Preact suite was dropped with the Preact app in the shadcn-vue
# migration; tests come back when there is behaviour worth pinning rather
# than a port to re-assert. Until then vue-tsc is the gate that would
# actually catch a broken component, and an empty `npm test` would pass
# vacuously.
#
# ui:deps so a fresh clone fails on a real error rather than on a missing
# node_modules, which is gitignored and installed by nothing else.
deps: [ui:deps]
cmds:
- npm test
- npm run typecheck
dev:
+13 -8
View File
@@ -35,7 +35,7 @@ Five top-level nav items. Dashboard is a link; the rest are dropdowns.
| Work | Tasks, Workflows |
| Agent | Skills, Curators |
| Events | Inspector, Mappings, Bindings |
| System | Status, Logs, Appearance, Task settings, Models & providers, Repositories, Channels, Advanced |
| System | Status, Logs, Appearance; **Settings:** Task settings, Models, Repositories, Channels, Advanced |
Items are renamed because the group now carries the context: "Event inspector"
becomes "Inspector" under Events, and so on. A group renders only if at least
@@ -43,6 +43,12 @@ one of its children survives capability gating, and a group left with one
child still renders as a dropdown -- a bar whose shape changes per deployment
is harder to learn than one with a predictable skeleton.
The System dropdown has two narratives. Status, Logs and Appearance describe
the running dashboard and sit first. A separator and visible **Settings** label
introduce Task settings, Models, Repositories, Channels and Advanced; those are
configuration destinations, not awkward phrases such as "System Models" or
"System Advanced".
### Route map
Configuration dissolves into real routes. Anchors into one long page were
@@ -90,14 +96,13 @@ This section was written against the Preact dashboard; the decisions above
survive the Vue migration unchanged, only the primitive supplying them
changed.
### Explicitly not in scope
### Scope boundaries
- No change to what any page renders, beyond which route renders it. The
Configuration split moves sections between files; it does not redesign them.
- `/system/appearance` ships with the theme control moved out of the topbar
icon and nothing else. The density and motion preferences named above are the
reason the page exists as a page rather than a section, not part of this
change.
- The daemon-backed configuration pages move sections between routes; this
change does not alter their read-only configuration contract.
- Appearance preferences remain browser-local; they do not create a daemon
configuration path. Theme, density, motion and tooltips apply immediately
and persist in local browser storage.
- Mobile keeps the existing scrollable row of top-level items; groups expand
in place rather than opening a floating menu. Nested floating menus on a
phone are a separate problem.
+1 -1
View File
@@ -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;--container-4xl:56rem;--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;--Line truncated
+11 -11
View File
@@ -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 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
`))),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 kp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Ap(e){let t=e instanceof kp?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 jp(e,t){let n=await fetch(e,t);if(!n.ok)throw new kp(await Op(n),n.status);return n}async function Mp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Ep,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 jp(e,s);return a?await c.json():void 0}var J={summary:()=>Mp(`/api/summary`),tasks:()=>Mp(`/api/tasks`),taskMeta:()=>Mp(`/api/task-meta`),task:e=>Mp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Mp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/changes`+Dp(t)),taskDebug:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/debug`+Dp(t)),taskAction:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>Mp(`/api/setup`),capabilities:()=>Mp(`/api/capabilities`),workflows:()=>Mp(`/api/workflows`),workRequest:e=>Mp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Mp(`/api/skills`),channels:()=>Mp(`/api/channels`),curators:()=>Mp(`/api/curators`),channelReload:e=>Mp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Mp(`/api/config`),version:()=>Mp(`/api/version`),configUpdate:e=>Mp(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>Mp(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>Mp(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>Mp(`/api/logs`+Dp(e)),taskLogs:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/logs`+Dp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>Mp(`/api/captures`+Dp({limit:e})),mappings:()=>Mp(`/api/mappings`),mappingCreate:e=>Mp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Mp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Mp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Mp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Mp(`/api/bindings`),bindingCreate:e=>Mp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Mp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Mp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Mp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>Mp(`/api/chat/sessions`),chatMessages:e=>Mp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Mp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Mp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Mp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Tp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Mp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>Mp(`/api/chat/update`),chatUpdateDefer:e=>Mp(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>Mp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>Mp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Mp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Mp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>jp(`/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 Np(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 Pp(e,t){let n=new EventSource(`/api/logs/stream`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(wp(n.readyState)),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}var Fp=`archie.web.chat.channel`;function Ip(){let e=localStorage.getItem(Fp);return e||(e=Tp(),localStorage.setItem(Fp,e)),e}var Lp=/(?:^|\s)\/([^\s]*)$/,Rp=/(?:^|\s)\/[^\s]*$/,zp=8;function Bp(e,t,n){let r=t.slice(0,n).match(Lp);if(!r)return[];let i=r[1].toLowerCase();return e.filter(e=>`${e.command} ${e.description??``}`.toLowerCase().includes(i)).slice(0,zp)}function Vp(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
`);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&&(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
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Yp.value=n.session_id),n.type===`delta`&&(o+=n.text,em.value=em.value?{...em.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],em.value=em.value?{...em.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`);Xp.value=[...Xp.value,{from:`assistant`,text:o,tool_calls:a}],em.value=null,Qp.value=`Ready`,await hm()}catch(e){let t=e;t.name===`AbortError`&&!c?(em.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Qp.value=`Stopped`):(em.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Wp(r):void 0,isRetry:i},Qp.value=`Error — retry available`)}finally{clearTimeout(l),pm=null,$p.value=!1}}function Om(){Qp.value=`Stopping…`,Yp.value&&J.chatCancel(Yp.value).catch(()=>{}),mm()}function km(){ia(()=>{hm().catch(e=>{Qp.value=e.message||`Chat unavailable`})}),ca(()=>{mm()})}var Am=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],jm=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(Kp),onClick:i[0]||=e=>n(`toggle`)},[z(`span`,{"aria-hidden":`true`,class:E(r(!e.open))},[B(k(Nd),{size:22})],2),z(`span`,{"aria-hidden":`true`,class:E(r(e.open))},[B(k(Jd),{size:22})],2)],8,Am))}});function Mm(e){return typeof e==`string`?`'${e}'`:new Im().serialize(e)}var Nm=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Pm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Nm.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Fm(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&&Pm[n]?Pm[n]:n+128,s=a<128&&Pm[a]?Pm[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 Im=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Fm(e,t):n===`number`&&r===`number`?e-t:Fm(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(Fm),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=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
`))}return()=>i.value||r.value||o.value?ac(t.default({present:o.value})[0],{ref:e=>{let t=hh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),xg=M({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=wh(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)}}}),Sg=[`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`&&Sg.includes(r)?()=>ac(r,t):r===`template`?()=>ac(xg,t,{default:n.default}):()=>ac(e.as,t,{default:n.default})}});function Cg(){let e=O();return{primitiveElement:e,currentElement:W(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:hh(e))}}function wg({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 Tg({type:e,defaultValue:t,modelValue:n}){return e||wg({type:e,defaultValue:t,modelValue:n})}function Eg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Dg(e,t){let n=W(()=>Tg(e)),r=Ch(e,`modelValue`,t,{defaultValue:Eg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Lm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Um(t,e)){let n=t.findIndex(t=>Lm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:W(()=>n.value===`single`)}}var[Og,kg]=zm(`DialogRoot`),Ag=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=Ch(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=Dn(n);return kg({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})}}),jg=M({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=Og();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`]))}}),Mg=`dismissableLayer.pointerDownOutside`,Ng=`dismissableLayer.focusOutside`;function Pg(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 Fg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=O(!1),a=O(()=>{});return jr(o=>{if(!qm||!Sn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(Pg(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Vm(Mg,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 Ig(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=O(!1);return jr(a=>{if(!qm||!Sn(n))return;let o=async n=>{if(!t?.value)return;await or(),await or();let r=n.target;t.value&&r&&!Pg(t.value,r)&&n.target&&!i.value&&Vm(Ng,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 Lg=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(()=>Ah.layersRoot),c=W(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=W(()=>Ah.layersWithOutsidePointerEventsDisabled.size>0),u=W(()=>{let e=Array.from(s.value),[t]=[...Ah.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Fg Line truncated
- a positive number
- less than the value passed to \`max\` (or ${Mb} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${wx} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
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-link 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 placLine 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-link`},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),null,{ 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
Defaulting to \`null\`.`),null)}function kx(e){return Dx(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 \`${wx}\`.`),wx)}var Ax=M({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:wx},getValueLabel:{type:Function,required:!1,default:(e,t)=>Dx(e)?`${Math.round(e/t*wx)}%`: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=Ch(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Ch(n,`max`,r,{passive:n.max===void 0});j(()=>i.value,async e=>{let t=Ox(e,n.max);t!==e&&(await or(),i.value=t)},{immediate:!0}),j(()=>n.max,e=>{let t=kx(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=W(()=>Hm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Ex({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":Dx(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`]))}}),jx=M({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Tx();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`]))}}),[Mx,Nx]=zm(`ScrollAreaRoot`),Px=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=zh(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 Nx({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`]))}}),Fx=M({__name:`ScrollAreaCornerImpl`,setup(e){let t=Mx(),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 Sh(t.scrollbarX.value,a),Sh(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)}}),Ix=M({__name:`ScrollAreaCorner`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=Y(),r=Mx(),i=W(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),a=W(()=>r.type.value!==`scroll`&&i.value);return(e,r)=>a.value?(I(),R(Fx,U({key:0},t,{ref:k(n)}),{default:A(()=>[P(e.$slots,`default`)]),_:3},16)):H(`v-if`,!0)}});function Lx(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 Rx(e){let t=zx(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zx(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Bx(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 Vx(e,t,n=`ltr`){let r=Rx(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 Lx([0,o],[0,s])(l)}functLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:ST(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>ST(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=wT(c),u=e+1<n.length?wT(n[e+1]):null;if(l&&u&&TT(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=wT(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>ST(e)),rows:r.map(e=>e.map(e=>ST(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:ST(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:ST(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function wT(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function TT(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var ET={class:`[overflow-wrap:anywhere]`},DT={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},OT={class:`font-mono text-[0.85em]`},kT={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},AT={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},jT={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},MT={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},NT={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},PT={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},FT={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},IT={key:8,class:`mb-2.5 last:mb-0`},LT=M({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=W(()=>CT(t.text));return(e,t)=>(I(),L(`div`,ET,[(I(!0),L(F,null,N(n.value,(e,t)=>(I(),L(F,{key:t},[e.kind===`pre`?(I(),L(`pre`,DT,[z(`code`,OT,D(e.code),1)])):e.kind===`table`?(I(),L(`table`,kT,[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(bT,{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(bT,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(I(),L(`blockquote`,AT,[B(bT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(I(),L(`h1`,jT,[B(bT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(I(),L(`h2`,MT,[B(bT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(I(),L(`h3`,NT,[B(bT,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(I(),L(`ul`,PT,[(I(!0),L(F,null,N(e.items,(e,t)=>(I(),L(`li`,{key:t},[B(bT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(I(),L(`ol`,FT,[(I(!0),L(F,null,N(e.items,(e,t)=>(I(),L(`li`,{key:t},[B(bT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(I(),L(`p`,IT,[B(bT,{inline:e.inline},null,8,[`inline`])])):H(``,!0)],64))),128))]))}}),RT={class:`truncate`},zT=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-link 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(bd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),z(`span`,RT,D(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),BT={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},VT={class:`font-semibold text-foreground`},HT={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},UT=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(zT,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(I(),L(`div`,BT,[B(k(qd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),z(`span`,VT,D(n.value),1),r.value?(I(),L(`code`,HT,D(r.value),1)):H(``,!0),z(`span`,{class:E(k(q)(`text-fg-muted`,i.value&&`text-danger`))},D(a.value),3)]))}}),WT={key:0,class:`mb-2 grid gap-0.5 text-xs`},GT={key:2,class:`whitespace-pre-wrap`},KT=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`,WT,[(I(!0),L(F,null,N(e.tools,(t,n)=>(I(),R(UT,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):H(``,!0),e.assistant?(I(),R(LT,{key:1,text:e.text},null,8,[`text`])):(I(),L(`div`,GT,D(e.text),1)),P(t.$slots,`default`)],2)],2))}}),qT={class:`w-full self-center justify-self-center py-6 text-center`},JT={class:`grid gap-2`},YT=[`onClick`],XT=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`,qT,[t[0]||=z(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 placLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>pj?`${n.slice(0,pj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var hj=[`title`],gj=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=W(()=>LA(n.event)),a=W(()=>mj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=W(()=>n.event.at?kk(n.event.at):`—`);return(e,t)=>(I(),R(k($O),{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,hj)]),_:1}),B(k(Q),null,{default:A(()=>[V(D(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),_j={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},vj=M({__name:`LiveActivityCard`,setup(e){let t=yE();function n(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(I(),R(k(PO),null,{default:A(()=>[B(k(zO),null,{default:A(()=>[B(k(BO),null,{default:A(()=>[...t[0]||=[V(`Live activity`,-1)]]),_:1}),B(k(LO),null,{default:A(()=>[...t[1]||=[V(`Last 50, newest first`,-1)]]),_:1}),B(k(FO),null,{default:A(()=>[B(k(tk),{variant:k(NA)},{default:A(()=>[V(D(k(MA)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),B(k(IO),null,{default:A(()=>[z(`div`,_j,[B(k(ZO),null,{default:A(()=>[B(k(ek),null,{default:A(()=>[B(k($O),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(QO),null,{default:A(()=>[k(jA).length?(I(!0),L(F,{key:1},N(k(jA),(e,t)=>(I(),R(gj,{key:t,event:e,onOpen:n},null,8,[`event`]))),128)):(I(),R(k($O),{key:0},{default:A(()=>[B(k(Q),{colspan:`4`},{default:A(()=>[B(k(VO),null,{default:A(()=>[B(k(WO),null,{default:A(()=>[B(k(qO),null,{default:A(()=>[...t[6]||=[V(`Waiting for activity`,-1)]]),_:1}),B(k(UO),null,{default:A(()=>[...t[7]||=[V(`Events appear here as Archie works.`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})])]),_:1})]),_:1}))}}),yj=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=EC(t,`class`);return(e,r)=>(I(),R(k(Ax),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(jx),{"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`]))}}),bj=`archie.setup-complete.dismissed.v1`;function xj(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?.(bj),{kind:`incomplete`,remaining:n}):t?.getItem?.(`archie.setup-complete.dismissed.v1`)===`1`?{kind:`dismissed`,remaining:[]}:{kind:`complete`,remaining:[]}}function Sj(e=globalThis.localStorage){e?.setItem?.(bj,`1`)}var Cj={class:`text-lg font-semibold text-link`},wj={class:`flex flex-col gap-3`},Tj={key:0,class:`mt-0.5 text-xs text-fg-subtle`},Ej=M({__name:`SetupPanel`,setup(e){let t=O(xj(DA.value));j(DA,()=>{t.value=xj(DA.value)});let n=W(()=>DA.value?.steps??[]),r=W(()=>{let e=n.value.length;return e?Math.round((e-t.value.remaining.length)/e*100):0});function i(){Sj(),t.value=xj(DA.value)}return(e,a)=>t.value.kind===`incomplete`?(I(),R(k(PO),{key:0},{default:A(()=>[B(k(zO),null,{default:A(()=>[B(k(BO),null,{default:A(()=>[...a[0]||=[V(`Finish setting up`,-1)]]),_:1}),B(k(LO),null,{default:A(()=>[...a[1]||=[V(`Archie needs these before it can work on its own.`,-1)]]),_:1}),B(k(FO),null,{default:A(()=>[z(`span`,Cj,D(r.value)+`%`,1)]),_:1})]),_:1}),B(k(IO),null,{default:A(()=>[B(k(yj),{"model-value":r.value,class:`mb-4`},null,8,[`model-value`]),z(`ul`,wj,[(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(xd),{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`,Tj,D(e.detail),1)):H(``,!0)])]))),128))])]),_:1})]),_:1})):t.value.kind===`complete`?(I(),R(k(PO),{key:1},{default:A(()=>[B(k(zO),null,{default:A(()=>[B(k(BO),null,{ Line truncated
`)}return(e,i)=>k(PP)?(I(),R(sP,{key:0,title:`Update status`,description:`Not configured on this deployment.`})):k(NP)?(I(),R(k(PO),{key:1,class:`mb-4`},{default:A(()=>[B(k(IO),null,{default:A(()=>[B(k(VO),null,{default:A(()=>[B(k(WO),null,{default:A(()=>[B(k(qO),null,{default:A(()=>[...i[0]||=[V(`Update status unavailable`,-1)]]),_:1}),B(k(UO),null,{default:A(()=>[V(D(k(NP)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):(I(),R(sP,{key:2,title:`Update status`,description:`Whether what's running matches what's installed.`},{default:A(()=>[k(MP).length?(I(),R(k(ZO),{key:1},{default:A(()=>[B(k(ek),null,{default:A(()=>[B(k($O),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(QO),null,{default:A(()=>[(I(!0),L(F,null,N(k(MP),e=>(I(),R(k($O),{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(tk),{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(VO),{key:0},{default:A(()=>[B(k(WO),null,{default:A(()=>[B(k(qO),null,{default:A(()=>[...i[1]||=[V(`No components reported`,-1)]]),_:1}),B(k(UO),null,{default:A(()=>[...i[2]||=[V(`The configured update-check command returned nothing.`,-1)]]),_:1})]),_:1})]),_:1}))]),_:1}))}}),YF=M({__name:`SystemStatusPage`,setup(e){async function t(){await Promise.all([jP(),FP(),LP()])}return ia(t),(e,n)=>(I(),L(`div`,null,[B(cO,{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(bF),B(JF),B(qF),k(AP)?(I(),R(cF,{key:0})):(I(),L(F,{key:1},[B(UF),B(sF,{ids:k(nF)},null,8,[`ids`]),B(WF)],64))]))}}),XF=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(lP,{key:1},{default:A(()=>[(I(!0),L(F,null,N(t.actions,e=>(I(),R(tF,{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(VO),{key:0},{default:A(()=>[B(k(WO),null,{default:A(()=>[B(k(qO),null,{default:A(()=>[...r[0]||=[V(`No actions reported`,-1)]]),_:1}),B(k(UO),null,{default:A(()=>[...r[1]||=[V(`The server did not return any operator actions.`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),ZF=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(lP,{key:1},{default:A(()=>[(I(!0),L(F,null,N(t.statuses,e=>(I(),R(tF,{key:e.id,label:e.id},{value:A(()=>[z(`span`,null,[B(k(tk),{variant:e.kind??k(Vj)(e.id)},{default:A(()=>[V(D(e.label??k(Bj)(e.id)),1)]),_:2},1032,[`variant`])])]),_:2},1032,[`label`]))),128))]),_:1})):(I(),R(k(VO),{key:0},{default:A(()=>[B(k(WO),null,{default:A(()=>[B(k(qO),null,{default:A(()=>[...n[0]||=[V(`No statuses reported`,-1)]]),_:1}),B(k(UO),null,{default:A(()=>[...n[1]||=[V(`The server did not return any lifecycle statuses.`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),QF=M({__name:`LifecycleCard`,setup(e){let t=W(()=>WP.value?.statuses??[]),n=W(()=>WP.value?.actions??[]);return(e,r)=>k(GP)?(I(),R(sP,{key:0,title:`Work lifecycle`,description:`The task statuses and operator actions archied ships.`},{default:A(()=>[B(k(VO),null,{default:A(()=>[B(k(WO),null,{default:A(()=>[B(k(qO),null,{default:A(()=>[...r[0]||=[V(`Lifecycle unavailable`,-1)]]),_:1}),B(k(UO),null,{default:A(()=>[V(D(k(GP)),1)]),_:1})]),_:1})]),_:1})]),_:1})):(I(),R(sP,{key:1,title:`Work lifecycle`,description:`The task statuses and operator actions archied ships.`},{default:A(()=>[B(ZF,{statuses:t.value},null,8,[`statuses`]),B(XF,{actions:n.value},null,8,[`actions`])]),_:1}))}}),$F=M({__name:`SystemTasksPage`,setup(e){async function t(){await Promise.all([jP(),KP()])}return ia(t),(e,n)=>(I(),L(`div`,null,[B(cO,{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
+14 -3
View File
@@ -7,12 +7,23 @@
<title>archie-ui</title>
<script>
// Set before the first paint so a reload does not flash the wrong
// palette. Kept in sync with src/lib/theme.ts; a blocked localStorage
// falls back to dark, which is the default theme.
// palette or layout. Kept in sync with the appearance Pinia store;
// blocked site data falls back to dark, comfortable spacing and the
// system motion preference.
(function () {
var theme = "dark";
try {
if (localStorage.getItem("archie.theme") === "light") theme = "light";
var storedTheme = localStorage.getItem("archie.theme");
if (storedTheme === "light") theme = "light";
if (storedTheme === "system") {
theme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
}
if (localStorage.getItem("archie.density") === "compact") {
document.documentElement.dataset.density = "compact";
}
if (localStorage.getItem("archie.motion") === "reduced") {
document.documentElement.dataset.motion = "reduced";
}
} catch (e) {
/* default stands */
}
+14 -3
View File
@@ -7,12 +7,23 @@
<title>archie-ui</title>
<script>
// Set before the first paint so a reload does not flash the wrong
// palette. Kept in sync with src/lib/theme.ts; a blocked localStorage
// falls back to dark, which is the default theme.
// palette or layout. Kept in sync with the appearance Pinia store;
// blocked site data falls back to dark, comfortable spacing and the
// system motion preference.
(function () {
var theme = "dark";
try {
if (localStorage.getItem("archie.theme") === "light") theme = "light";
var storedTheme = localStorage.getItem("archie.theme");
if (storedTheme === "light") theme = "light";
if (storedTheme === "system") {
theme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
}
if (localStorage.getItem("archie.density") === "compact") {
document.documentElement.dataset.density = "compact";
}
if (localStorage.getItem("archie.motion") === "reduced") {
document.documentElement.dataset.motion = "reduced";
}
} catch (e) {
/* default stands */
}
+26
View File
@@ -14,6 +14,7 @@
"@vueuse/core": "^15.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"pinia": "^4.0.3",
"reka-ui": "^2.10.4",
"tailwind-merge": "^3.7.0",
"tailwindcss": "^4.3.3",
@@ -5900,6 +5901,31 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/pinia": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/pinia/-/pinia-4.0.3.tgz",
"integrity": "sha512-XMQqpvjgG7LMqVhhFUzKLT4KEbsYbfZZ0CZU9PgdFm1O2VKBmIkykL8+SfNhOaT7sR0wT6BEgKT0YNDYWgmVRA==",
"license": "MIT",
"dependencies": {
"nostics": "^1.1.4"
},
"funding": {
"url": "https://github.com/sponsors/posva"
},
"peerDependencies": {
"@vue/devtools-api": "^8.1.5",
"typescript": ">=5.6.0",
"vue": "^3.5.11"
},
"peerDependenciesMeta": {
"@vue/devtools-api": {
"optional": false
},
"typescript": {
"optional": true
}
}
},
"node_modules/pkce-challenge": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
+2
View File
@@ -7,6 +7,7 @@
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
"test": "node --test --experimental-strip-types test/*.test.ts",
"typecheck": "vue-tsc --build --force"
},
"dependencies": {
@@ -16,6 +17,7 @@
"@vueuse/core": "^15.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"pinia": "^4.0.3",
"reka-ui": "^2.10.4",
"tailwind-merge": "^3.7.0",
"tailwindcss": "^4.3.3",
+12 -2
View File
@@ -1,7 +1,13 @@
<script setup lang="ts">
import { ChevronDown } from "@lucide/vue";
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import type { NavEntry } from "@/lib/nav";
import NavItem from "./NavItem.vue";
import NavTrigger from "./NavTrigger.vue";
@@ -20,7 +26,11 @@ const holds = (path: string) => props.activePath === path;
</NavTrigger>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" class="w-52">
<NavItem v-for="item in items" :key="item.path" :entry="item" :current="holds(item.path)" />
<template v-for="item in items" :key="item.path">
<DropdownMenuSeparator v-if="item.dividerBefore" />
<DropdownMenuLabel v-if="item.dividerBefore">{{ item.dividerBefore }}</DropdownMenuLabel>
<NavItem :entry="item" :current="holds(item.path)" />
</template>
</DropdownMenuContent>
</DropdownMenu>
</template>
+3 -1
View File
@@ -1,12 +1,14 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import type { TooltipRootEmits, TooltipRootProps } from 'reka-ui'
import { TooltipRoot, useForwardPropsEmits } from 'reka-ui'
import { tooltipsEnabled } from '@/lib/preferences'
import { useAppearanceStore } from '@/stores/appearance'
const props = defineProps<TooltipRootProps>()
const emits = defineEmits<TooltipRootEmits>()
const forwarded = useForwardPropsEmits(props, emits)
const { tooltipsEnabled } = storeToRefs(useAppearanceStore())
</script>
<template>
+14 -2
View File
@@ -5,6 +5,7 @@ export interface NavEntry {
label: string;
description: string;
section?: string;
dividerBefore?: string;
soon?: boolean;
}
@@ -34,7 +35,13 @@ const table = routes as Array<{ path: string; meta?: RouteMeta }>;
// The group owns the context, so the items inside it are named for what they
// are rather than what they belong to. Order is the reading order of the menu.
const groups: Array<{ label: string; paths: string[] }> = [
interface GroupSpec {
label: string;
paths: string[];
dividerBefore?: { path: string; label: string };
}
const groups: GroupSpec[] = [
{ label: "Work", paths: ["/tasks", "/workflows"] },
{ label: "Agent", paths: ["/skills", "/curators"] },
{ label: "Events", paths: ["/captures", "/mappings", "/bindings"] },
@@ -50,6 +57,7 @@ const groups: Array<{ label: string; paths: string[] }> = [
"/channels",
"/system/advanced",
],
dividerBefore: { path: "/system/tasks", label: "Settings" },
},
];
@@ -75,7 +83,11 @@ export function navTree(hidden: string[] = []): NavNode[] {
const nodes: NavNode[] = [{ kind: "link", entry: entryFor("/") }];
for (const group of groups) {
const items = group.paths.map(entryFor).filter(visible);
if (items.length > 0) nodes.push({ kind: "group", label: group.label, items });
const divided = items.map((item) => ({
...item,
dividerBefore: item.path === group.dividerBefore?.path ? group.dividerBefore.label : undefined,
}));
if (divided.length > 0) nodes.push({ kind: "group", label: group.label, items: divided });
}
return nodes;
}
-26
View File
@@ -1,26 +0,0 @@
import { ref, type Ref } from "vue";
export const TOOLTIPS_KEY = "archie.tooltips";
export function storedTooltips(): boolean {
try {
return localStorage.getItem(TOOLTIPS_KEY) !== "off";
} catch {
// Private windows and blocked site data throw on access. On is the
// default, so this is not worth surfacing.
return true;
}
}
const current = ref<boolean>(storedTooltips());
/** The live preference, shared app-wide. Change it through `setTooltips`. */
export const tooltipsEnabled: Ref<boolean> = current;
export function setTooltips(enabled: boolean): void {
current.value = enabled;
try {
localStorage.setItem(TOOLTIPS_KEY, enabled ? "on" : "off");
} catch {
// Still applies for this page view; only persistence is lost.
}
}
-50
View File
@@ -1,50 +0,0 @@
import { ref, type Ref } from "vue";
/**
* The theme is an attribute on <html>, not a class, because index.html sets it
* from localStorage before the first paint. Everything downstream reads the CSS
* variables once that attribute is present, so nothing in the app branches on
* the theme itself.
*/
export const THEME_KEY = "archie.theme";
export type Theme = "dark" | "light";
export function isTheme(value: unknown): value is Theme {
return value === "dark" || value === "light";
}
/** Dark is the default: archied is a daemon you check at odd hours. */
export function storedTheme(): Theme {
try {
const stored = localStorage.getItem(THEME_KEY);
return isTheme(stored) ? stored : "dark";
} catch {
// Private windows and blocked site data throw on access. The default is
// correct there, so this is not worth surfacing.
return "dark";
}
}
export function applyTheme(theme: Theme): void {
document.documentElement.dataset.theme = theme;
try {
localStorage.setItem(THEME_KEY, theme);
} catch {
// The theme still applies for this page view; only persistence is lost.
}
}
const current = ref<Theme>(storedTheme());
/** The live theme, shared app-wide. Apply it through `setTheme` or `toggleTheme`. */
export const theme: Ref<Theme> = current;
export function setTheme(next: Theme): void {
current.value = next;
applyTheme(next);
}
export function toggleTheme(): void {
setTheme(current.value === "dark" ? "light" : "dark");
}
+8 -1
View File
@@ -1,12 +1,19 @@
import "./legacy-hash-redirect";
import { createPinia } from "pinia";
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import { useAppearanceStore } from "./stores/appearance";
// One stylesheet: the design tokens, and the element defaults that have no
// component to live in (the canvas, the focus floor, the motion preference).
// Everything else is Tailwind on the component that owns it.
import "./style.css";
createApp(App).use(router).mount("#app");
const app = createApp(App);
const pinia = createPinia();
app.use(pinia).use(router);
useAppearanceStore(pinia).initialize();
app.mount("#app");
+103 -10
View File
@@ -1,22 +1,115 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import PageHeader from "@/base/PageHeader.vue";
import ThemeCard from "./ThemeCard.vue";
import TooltipCard from "./TooltipCard.vue";
import { Switch } from "@/components/ui/switch";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import {
type Density,
type Motion,
type Theme,
useAppearanceStore,
} from "@/stores/appearance";
import ConfigCard from "./ConfigCard.vue";
const appearance = useAppearanceStore();
const { density, motion, theme, tooltipsEnabled } = storeToRefs(appearance);
const { setDensity, setMotion, setTheme, setTooltips } = appearance;
/**
* Appearance: how the dashboard looks, on this browser.
*
* The theme control moved here out of the topbar icon
* (docs/prds/dashboard-navigation-groups.md). These are all browser-local:
* there is no daemon-side appearance, so nothing on this page is submitted.
* The density and motion preferences the design names are still to come.
* These preferences are browser-local and apply immediately. They are grouped
* into one bounded surface so labels and controls can be read together instead
* of making the operator scan opposite edges of several full-width cards.
*/
function chooseTheme(value: unknown): void {
if (value === "system" || value === "light" || value === "dark") setTheme(value as Theme);
}
function chooseDensity(value: unknown): void {
if (value === "comfortable" || value === "compact") setDensity(value as Density);
}
function chooseMotion(value: unknown): void {
if (value === "system" || value === "reduced") setMotion(value as Motion);
}
</script>
<template>
<div>
<PageHeader title="Appearance" />
<ThemeCard />
<TooltipCard />
<div class="max-w-4xl">
<PageHeader title="Appearance" subtitle="How this dashboard looks and responds in this browser." />
<ConfigCard title="Dashboard preferences" description="Saved only in this browser and applied immediately.">
<div class="grid gap-8 min-[700px]:grid-cols-2">
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-theme" class="text-sm font-medium">Theme</h2>
<p class="mt-1 text-sm text-muted-foreground">Follow your device, or keep Archie light or dark.</p>
</div>
<ToggleGroup
type="single"
variant="outline"
:model-value="theme"
class="mt-4"
aria-labelledby="appearance-theme"
@update:model-value="chooseTheme"
>
<ToggleGroupItem value="system">System</ToggleGroupItem>
<ToggleGroupItem value="light">Light</ToggleGroupItem>
<ToggleGroupItem value="dark">Dark</ToggleGroupItem>
</ToggleGroup>
</section>
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-density" class="text-sm font-medium">Density</h2>
<p class="mt-1 text-sm text-muted-foreground">Use relaxed spacing, or fit more work on screen.</p>
</div>
<ToggleGroup
type="single"
variant="outline"
:model-value="density"
class="mt-4"
aria-labelledby="appearance-density"
@update:model-value="chooseDensity"
>
<ToggleGroupItem value="comfortable">Comfortable</ToggleGroupItem>
<ToggleGroupItem value="compact">Compact</ToggleGroupItem>
</ToggleGroup>
</section>
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-motion" class="text-sm font-medium">Motion</h2>
<p class="mt-1 text-sm text-muted-foreground">Follow your device, or reduce interface animation here.</p>
</div>
<ToggleGroup
type="single"
variant="outline"
:model-value="motion"
class="mt-4"
aria-labelledby="appearance-motion"
@update:model-value="chooseMotion"
>
<ToggleGroupItem value="system">System</ToggleGroupItem>
<ToggleGroupItem value="reduced">Reduced</ToggleGroupItem>
</ToggleGroup>
</section>
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-tooltips" class="text-sm font-medium">Tooltips</h2>
<p class="mt-1 text-sm text-muted-foreground">Show extra context when controls are hovered or focused.</p>
</div>
<Switch
:model-value="tooltipsEnabled"
class="mt-4"
aria-labelledby="appearance-tooltips"
@update:model-value="setTooltips"
/>
</section>
</div>
</ConfigCard>
</div>
</template>
-30
View File
@@ -1,30 +0,0 @@
<script setup lang="ts">
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { setTheme, theme, type Theme } from "@/lib/theme";
import ConfigCard from "./ConfigCard.vue";
/**
* The theme control, moved off the topbar icon and onto a page of its own so
* the chrome carries no preference.
*
* It writes through lib/theme, which sets the attribute index.html reads before
* the first paint and stores the choice in this browser: there is no
* server-side appearance to save, and nothing here to submit. The density and
* motion preferences this page exists for are not built yet
* (docs/prds/dashboard-navigation-groups.md).
*/
function apply(value: unknown): void {
if (value === "light" || value === "dark") setTheme(value as Theme);
}
</script>
<template>
<ConfigCard title="Theme">
<div class="flex justify-end">
<ToggleGroup :model-value="theme" aria-label="Theme" @update:model-value="apply">
<ToggleGroupItem value="dark">Dark</ToggleGroupItem>
<ToggleGroupItem value="light">Light</ToggleGroupItem>
</ToggleGroup>
</div>
</ConfigCard>
</template>
-14
View File
@@ -1,14 +0,0 @@
<script setup lang="ts">
import { Switch } from "@/components/ui/switch";
import { setTooltips, tooltipsEnabled } from "@/lib/preferences";
import ConfigCard from "./ConfigCard.vue";
</script>
<template>
<ConfigCard title="Tooltips">
<div class="flex justify-end">
<Switch aria-label="Tooltips" :model-value="tooltipsEnabled" @update:model-value="setTooltips" />
</div>
</ConfigCard>
</template>
+101
View File
@@ -0,0 +1,101 @@
import { defineStore } from "pinia";
import { ref } from "vue";
export const THEME_KEY = "archie.theme";
export const DENSITY_KEY = "archie.density";
export const MOTION_KEY = "archie.motion";
export const TOOLTIPS_KEY = "archie.tooltips";
export type Theme = "system" | "dark" | "light";
export type Density = "comfortable" | "compact";
export type Motion = "system" | "reduced";
type ResolvedTheme = Exclude<Theme, "system">;
function storedChoice<T extends string>(key: string, choices: readonly T[], fallback: T): T {
try {
const value = localStorage.getItem(key);
return choices.includes(value as T) ? (value as T) : fallback;
} catch {
return fallback;
}
}
function persist(key: string, value: string): void {
try {
localStorage.setItem(key, value);
} catch {
// The preference still applies for this page view; only persistence is lost.
}
}
function resolveTheme(preference: Theme): ResolvedTheme {
if (preference !== "system") return preference;
try {
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
} catch {
return "dark";
}
}
export const useAppearanceStore = defineStore("appearance", () => {
const theme = ref<Theme>(storedChoice(THEME_KEY, ["system", "dark", "light"], "dark"));
const density = ref<Density>(storedChoice(DENSITY_KEY, ["comfortable", "compact"], "comfortable"));
const motion = ref<Motion>(storedChoice(MOTION_KEY, ["system", "reduced"], "system"));
const tooltipsEnabled = ref(storedChoice(TOOLTIPS_KEY, ["on", "off"], "on") === "on");
let initialized = false;
function applyTheme(): void {
document.documentElement.dataset.theme = resolveTheme(theme.value);
}
function setTheme(value: Theme): void {
theme.value = value;
applyTheme();
persist(THEME_KEY, value);
}
function setDensity(value: Density): void {
density.value = value;
document.documentElement.dataset.density = value;
persist(DENSITY_KEY, value);
}
function setMotion(value: Motion): void {
motion.value = value;
document.documentElement.dataset.motion = value;
persist(MOTION_KEY, value);
}
function setTooltips(enabled: boolean): void {
tooltipsEnabled.value = enabled;
persist(TOOLTIPS_KEY, enabled ? "on" : "off");
}
function initialize(): void {
if (initialized) return;
initialized = true;
applyTheme();
document.documentElement.dataset.density = density.value;
document.documentElement.dataset.motion = motion.value;
try {
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
if (theme.value === "system") applyTheme();
});
} catch {
// matchMedia is absent in older embedded views. The dark fallback stands.
}
}
return {
theme,
density,
motion,
tooltipsEnabled,
initialize,
setTheme,
setDensity,
setMotion,
setTooltips,
};
});
+14
View File
@@ -17,6 +17,13 @@
wrong palette. */
@custom-variant dark (&:is([data-theme="dark"] *));
/* Compact mode tightens the shared Tailwind spacing scale without shrinking
text or hit targets independently. Components keep their relative rhythm;
the whole workspace simply carries less air. */
[data-density="compact"] {
--spacing: 0.225rem;
}
/*
* Design tokens. Dark is the default because archied is a daemon you check at
* odd hours; light is a toggle, not an afterthought, so both themes define the
@@ -273,4 +280,11 @@
transition-duration: 0.01ms !important;
}
}
[data-motion="reduced"] *,
[data-motion="reduced"] *::before,
[data-motion="reduced"] *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
+79
View File
@@ -0,0 +1,79 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
import { createPinia, setActivePinia } from "pinia";
class MemoryStorage {
readonly values = new Map<string, string>();
getItem(key: string): string | null {
return this.values.get(key) ?? null;
}
setItem(key: string, value: string): void {
this.values.set(key, value);
}
}
function browser(matchesDark = false): MemoryStorage {
const storage = new MemoryStorage();
Object.defineProperty(globalThis, "localStorage", { configurable: true, value: storage });
Object.defineProperty(globalThis, "document", {
configurable: true,
value: { documentElement: { dataset: {} as Record<string, string> } },
});
Object.defineProperty(globalThis, "matchMedia", {
configurable: true,
value: () => ({ matches: matchesDark }),
});
return storage;
}
Object.defineProperty(globalThis, "localStorage", { configurable: true, value: new MemoryStorage() });
const appearance = await import("../src/stores/appearance.ts");
function freshStore(matchesDark = false): { storage: MemoryStorage; store: ReturnType<typeof appearance.useAppearanceStore> } {
const storage = browser(matchesDark);
setActivePinia(createPinia());
return { storage, store: appearance.useAppearanceStore() };
}
test("appearance preferences are owned by Pinia and stay close to their labels", async () => {
const page = await readFile(new URL("../src/settings/SystemAppearancePage.vue", import.meta.url), "utf8");
const tooltip = await readFile(new URL("../src/components/ui/tooltip/Tooltip.vue", import.meta.url), "utf8");
assert.match(page, /useAppearanceStore/);
assert.match(tooltip, /useAppearanceStore/);
assert.match(page, /min-\[700px\]:grid-cols-2/);
});
test("system theme follows the browser preference and remains the stored choice", () => {
const { storage, store } = freshStore(true);
store.setTheme("system");
assert.equal(store.theme, "system");
assert.equal(document.documentElement.dataset.theme, "dark");
assert.equal(storage.getItem(appearance.THEME_KEY), "system");
});
test("density applies immediately and persists", () => {
const { storage, store } = freshStore();
store.setDensity("compact");
assert.equal(store.density, "compact");
assert.equal(document.documentElement.dataset.density, "compact");
assert.equal(storage.getItem(appearance.DENSITY_KEY), "compact");
});
test("reduced motion applies immediately and persists", () => {
const { storage, store } = freshStore();
store.setMotion("reduced");
assert.equal(store.motion, "reduced");
assert.equal(document.documentElement.dataset.motion, "reduced");
assert.equal(storage.getItem(appearance.MOTION_KEY), "reduced");
});
+16
View File
@@ -0,0 +1,16 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
const navModel = await readFile(new URL("../src/lib/nav.ts", import.meta.url), "utf8");
const navGroup = await readFile(new URL("../src/components/topbar/NavGroup.vue", import.meta.url), "utf8");
test("System separates operational pages from settings before Task settings", () => {
assert.match(
navModel,
/label:\s*"System"[\s\S]*dividerBefore:\s*\{\s*path:\s*"\/system\/tasks",\s*label:\s*"Settings"\s*\}/,
);
assert.match(navGroup, /DropdownMenuSeparator/);
assert.match(navGroup, /DropdownMenuLabel/);
assert.match(navGroup, /item\.dividerBefore/);
});