feat(webui): port the dashboard (Phase 3, first page)

The control room, on the primitives from the previous commit. Being the first
page it also settles the shape of the rest: shadcn components for chrome, one
feature folder per page, Lucide imported at the call site.

Carried across deliberately, because each was a fix rather than a layout:

- Live activity's detail is cut to one line and clamped again in the cell, so a
  long unbroken token (a path, a URL, a hash) cannot widen the column past the
  table. Unclamped, one agent_finish row made the dashboard 7,481px tall.
- Each HEALTH card takes its own content height. Matching them was right while
  both held a checklist; once setup is done that card is a title and a line
  while Gate pulse carries a gauge and four rows, so equalising them left a
  mostly-empty box taking a quarter of the first screen.

The task links are router paths now, not the `#/tasks` hashes the Preact build
used. History routing means a hash is not a route any more, so one that
survived here would navigate nowhere.

Also in this change:

- Button gains an `attention` variant, in the project's own cva. An action that
  exists because something needs a human has to look unlike one that is always
  present, and `destructive` would overstate it: nothing is broken, it is
  waiting.
- The setup panel branches on the state machine rather than on "is setup
  present at all". Guarding on presence showed a 100% checklist with every step
  struck through where the complete state belongs.
This commit is contained in:
sam committed 2026-09-20 19:42:08 +10:00
1 parent c799e3209c
commit 1d054656a9
29 files changed
+968 -10

No files matched your search

+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-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-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;--spacing:.25rem;--container-xs:20rem;--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-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;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-snug:1.375;--radius-xs:.125rem;--radius-md:10px;--radius-4xl:2rem;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", sans-serif;--default-mono-font-family:ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-featureLine 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-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-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;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--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-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;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-md:10px;--radius-4xl:2rem;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", sans-serif;--default-mono-font-family:ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");fonLine truncated
+11 -5
View File
@@ -1,7 +1,13 @@
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=>T(e)===`[object Map]`,g=e=>T(e)===`[object Set]`,_=e=>T(e)===`[object Date]`,v=e=>T(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,T=e=>w.call(e),E=e=>T(e).slice(8,-1),D=e=>T(e)===`[object Object]`,ee=e=>b(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,O=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,ae=ne(e=>e.replace(ie,`-$1`).toLowerCase()),k=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),A=ne(e=>e?`on${k(e)}`:``),j=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},M=e=>{let t=b(e)?Number(e):NaN;return isNaN(t)?e:t},le,ue=()=>le||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},de=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 N(e){if(m(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=b(r)?he(r):N(r);if(i)for(let e in i)t[e]=i[e]}return t}if(b(e)||S(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(b(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(S(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!b(t)&&(e.class=ge(t)),n&&(e.style=N(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=r(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(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]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=h(e),i=h(t);if(r||i||(r=g(e),i=g(t),r||i))return r&&i?Se(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||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(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 Te(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?we(e,t,n,xe):!1:(r=S(e),i=S(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>b(e)?e:e==null?``:m(e)||S(e)&&(e.toString===w||!y(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):h(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:x(t)?Ae(t):Line truncated
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=>T(e)===`[object Map]`,g=e=>T(e)===`[object Set]`,_=e=>T(e)===`[object Date]`,v=e=>T(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,T=e=>w.call(e),E=e=>T(e).slice(8,-1),D=e=>T(e)===`[object Object]`,ee=e=>b(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,O=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,ae=ne(e=>e.replace(ie,`-$1`).toLowerCase()),oe=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),k=ne(e=>e?`on${oe(e)}`:``),se=(e,t)=>!Object.is(e,t),ce=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},le=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ue=e=>{let t=parseFloat(e);return isNaN(t)?e:t},de=e=>{let t=b(e)?Number(e):NaN;return isNaN(t)?e:t},fe,pe=()=>fe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},me=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 A(e){if(m(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=b(r)?ve(r):A(r);if(i)for(let e in i)t[e]=i[e]}return t}if(b(e)||S(e))return e}var he=/;(?![^(]*\))/g,ge=/:([^]+)/,_e=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function ve(e){let t={};return e.replace(_e,e=>e.startsWith(`/*`)?``:e).split(he).forEach(e=>{if(e){let n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(b(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(S(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ye(e){if(!e)return null;let{class:t,style:n}=e;return t&&!b(t)&&(e.class=j(t)),n&&(e.style=A(n)),e}var be=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,xe=r(be);be+``;function Se(e){return!!e||e===``}function Ce(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=De(e[i],t[i],n);return r}function we(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]&&De(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Te(e,t,n){let r=h(e),i=h(t);if(r||i||(r=g(e),i=g(t),r||i))return r&&i?we(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||!De(e[r],t[r],n))return!1}return String(e)===String(t)}function Ee(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 De(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?Ee(e,t,n,Ce):!1:(r=S(e),i=S(t),r||i?!r||!i?!1:Ee(e,t,n,Te):String(e)===String(t))))}function Oe(e,t){return e.findIndex(e=>De(e,t))}var ke=e=>!!(e&&e.__v_isRef===!0),M=e=>b(e)?e:e==null?``:m(e)||S(e)&&(e.toString===w||!y(e.toString))?ke(e)?M(e.value):JSON.stringify(e,Ae,2):String(e),Ae=(e,t)=>ke(t)?Ae(e,t.value):h(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[je(t,r)+` =>`]=n,e),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>je(e))}:x(t)?je(t):SLine truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(xi(e,0)||di(),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)&&!te(a)||a[0]===`.`||t&&!te(a)||u&&u.includes(a)){if(vi(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&&tn(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&js(x,n,t),h&&gr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ns(()=>{x&&js(x,n,t),l&&g.enter(e),h&&gr(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]=Os(d[t]),g=h.type===os;e?(g&&!u&&t+1<p&&Os(d[t+1]).type===os&&(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,xi(r,1)||di()),n(null,h,r,null,o,s,mi(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&&hi(f)&&f.data===`]`?a(t.anchor=f):(di(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Ci(e,t)||di(),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,mi(d),c),r&&(r.vnode.el=t.el,ho(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&hi(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 _i=new Set([`src`,`srcset`,`href`,`poster`]);function vi(e,t,n){return _i.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var yi=`data-allow-mismatch`,bi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function xi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(yi);)e=e.parentElement;return Si(e&&e.getAttribute(yi),t)}function Si(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(bi[t])}}function Ci(e,t){return xi(e.parentElement,1)||wi(e)||Ti(t)}function wi(e){return e.nodeType===1&&Si(e.getAttribute(yi),1)}function Ti({props:e}){let t=e&&e[yi];return typeof t==`string`&&Si(t,1)}var Ei=ue().requestIdleCallback||(e=>setTimeout(e,1)),Di=ue().cancelIdleCallback||(e=>clearTimeout(e)),Oi=(e=1e4)=>t=>{let n=Ei(t,{timeout:e});return()=>Di(n)};function ki(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 Ai=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(ki(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},ji=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Mi=(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 Ni(e,t){if(hi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(hi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Pi=e=>!!e.type.__asyncLoader;function Fi(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 V({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=>Ni(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Fs;if(ii(e),u)return()=>Ii(u,e);let t=t=>{l=null,Hn(t,e,13,!r)};if(s&&e.suspense||Hs)return p().then(t=>()=>Ii(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=L(!1),c=L(),d=L(!!i),f,m;return $i(()=>{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&&Li(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Ii(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&& Line truncated
`))),e[Ul]=Bl(i);let a=r||i.props&&i.props.type===`number`;sl(e,t?`change`:`input`,t=>{t.target.composing||e[Ul](Gl(e.value,n,a))}),(n||a)&&sl(e,`change`,()=>{e.value=Gl(e.value,n,a)}),t||(sl(e,`compositionstart`,Vl),sl(e,`compositionend`,Hl),sl(e,`change`,Hl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Wl];delete e[Wl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Ul](Gl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Ul]=Bl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(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)}},ql={deep:!0,created(e,t,n){e[Ul]=Bl(n),sl(e,`change`,()=>{let t=e._modelValue,n=$l(e),r=e.checked,i=e[Ul];if(m(t)){let e=Ee(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(eu(e,r))})},mounted:Jl,beforeUpdate(e,t,n){e[Ul]=Bl(n),Jl(e,t,n)}};function Jl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Ee(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=Te(t,eu(e,!0))}e.checked!==i&&(e.checked=i)}var Yl={created(e,{value:t},n){e.checked=Te(t,n.props.value),e[Ul]=Bl(n),sl(e,`change`,()=>{e[Ul]($l(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Ul]=Bl(r),t!==n&&(e.checked=Te(t,r.props.value))}},Xl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,sl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce($l(e)):$l(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[Ul](i)}finally{Zn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Ul]=Bl(r)},mounted(e,{value:t}){Ql(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ul]=Bl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Zl(t,n[1],n[0]))&&Ql(e,t)}};function Zl(e,t,n){if(!n||m(e))return Te(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 Ql(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=$l(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ee(t,o)>-1}else a.selected=t.has(o)}else if(Te($l(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $l(e){return`_value`in e?e._value:e.value}function eu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var tu={created(e,t,n){ru(e,t,n,null,`created`)},mounted(e,t,n){ru(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ru(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ru(e,t,n,r,`updated`)}};function nu(e,t){switch(e){case`SELECT`:return Xl;case`TEXTAREA`:return Kl;default:switch(t){case`checkbox`:return ql;case`radio`:return Yl;default:return Kl}}}function ru(e,t,n,r,i){let a=nu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function iu(){Kl.getSSRProps=({value:e})=>({value:e}),Yl.getSSRProps=({value:e},t)=>{if(t.props&&Te(t.props.value,e))return{checked:!0}},ql.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Ee(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}},tu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=nu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var au=[`ctrl`,`shift`,`alt`,`meta`],ou={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)=>au.some(n=>e[`${n}Key`]&&!t.includes(n))},su=(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=ou[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},cu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},lu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ae(n.key);if(t.some(e=>e===r||cu[e]===r))return e(n)}))},uu=u({patchProp:yl},yc),du,fu=!1;function pu(){return du||=Fo(uu)}function mu(){return du=fu?du:Io(uu),fu=!0,du}var hu=((...e)=>{pu().render(...e)}),gu=((...e)=>{mu().hydrate(...e)}),_u=((...e)=>{let t=pu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=bu(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,yu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),vu=(( Line truncated
`)&&(wi(e,0)||mi(),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)&&!te(a)||a[0]===`.`||t&&!te(a)||u&&u.includes(a)){if(xi(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&&rn(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&As(x,n,t),h&&yr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&as(()=>{x&&As(x,n,t),l&&g.enter(e),h&&yr(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]=Ds(d[t]),g=h.type===cs;e?(g&&!u&&t+1<p&&Ds(d[t+1]).type===cs&&(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,wi(r,1)||mi()),n(null,h,r,null,o,s,_i(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&&vi(f)&&f.data===`]`?a(t.anchor=f):(mi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Ei(e,t)||mi(),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,_i(d),c),r&&(r.vnode.el=t.el,vo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&vi(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 bi=new Set([`src`,`srcset`,`href`,`poster`]);function xi(e,t,n){return bi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Si=`data-allow-mismatch`,Ci={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function wi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Si);)e=e.parentElement;return Ti(e&&e.getAttribute(Si),t)}function Ti(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Ci[t])}}function Ei(e,t){return wi(e.parentElement,1)||Di(e)||Oi(t)}function Di(e){return e.nodeType===1&&Ti(e.getAttribute(Si),1)}function Oi({props:e}){let t=e&&e[Si];return typeof t==`string`&&Ti(t,1)}var ki=pe().requestIdleCallback||(e=>setTimeout(e,1)),Ai=pe().cancelIdleCallback||(e=>clearTimeout(e)),ji=(e=1e4)=>t=>{let n=ki(t,{timeout:e});return()=>Ai(n)};function Mi(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 Ni=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(Mi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Pi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Fi=(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 Ii(e,t){if(vi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(vi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Li=e=>!!e.type.__asyncLoader;function Ri(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 R({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=>Ii(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ps;if(si(e),u)return()=>zi(u,e);let t=t=>{l=null,Gn(t,e,13,!r)};if(s&&e.suspense||Vs)return p().then(t=>()=>zi(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=P(!1),c=P(),d=P(!!i),f,m;return na(()=>{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&&Bi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return zi(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&& Line truncated
`))),e[Hl]=zl(i);let a=r||i.props&&i.props.type===`number`;ol(e,t?`change`:`input`,t=>{t.target.composing||e[Hl](Wl(e.value,n,a))}),(n||a)&&ol(e,`change`,()=>{e.value=Wl(e.value,n,a)}),t||(ol(e,`compositionstart`,Bl),ol(e,`compositionend`,Vl),ol(e,`change`,Vl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ul];delete e[Ul],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Hl](Wl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Hl]=zl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ue(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)}},Kl={deep:!0,created(e,t,n){e[Hl]=zl(n),ol(e,`change`,()=>{let t=e._modelValue,n=Ql(e),r=e.checked,i=e[Hl];if(m(t)){let e=Oe(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($l(e,r))})},mounted:ql,beforeUpdate(e,t,n){e[Hl]=zl(n),ql(e,t,n)}};function ql(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Oe(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=De(t,$l(e,!0))}e.checked!==i&&(e.checked=i)}var Jl={created(e,{value:t},n){e.checked=De(t,n.props.value),e[Hl]=zl(n),ol(e,`change`,()=>{e[Hl](Ql(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Hl]=zl(r),t!==n&&(e.checked=De(t,r.props.value))}},Yl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ol(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ue(Ql(e)):Ql(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[Hl](i)}finally{er(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Hl]=zl(r)},mounted(e,{value:t}){Zl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Hl]=zl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Xl(t,n[1],n[0]))&&Zl(e,t)}};function Xl(e,t,n){if(!n||m(e))return De(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 Zl(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=Ql(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Oe(t,o)>-1}else a.selected=t.has(o)}else if(De(Ql(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ql(e){return`_value`in e?e._value:e.value}function $l(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var eu={created(e,t,n){nu(e,t,n,null,`created`)},mounted(e,t,n){nu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){nu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){nu(e,t,n,r,`updated`)}};function tu(e,t){switch(e){case`SELECT`:return Yl;case`TEXTAREA`:return Gl;default:switch(t){case`checkbox`:return Kl;case`radio`:return Jl;default:return Gl}}}function nu(e,t,n,r,i){let a=tu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function ru(){Gl.getSSRProps=({value:e})=>({value:e}),Jl.getSSRProps=({value:e},t)=>{if(t.props&&De(t.props.value,e))return{checked:!0}},Kl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Oe(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}},eu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=tu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var iu=[`ctrl`,`shift`,`alt`,`meta`],au={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)=>iu.some(n=>e[`${n}Key`]&&!t.includes(n))},ou=(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=au[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},su={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},cu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ae(n.key);if(t.some(e=>e===r||su[e]===r))return e(n)}))},lu=u({patchProp:vl},vc),uu,du=!1;function fu(){return uu||=Ro(lu)}function pu(){return uu=du?uu:zo(lu),du=!0,uu}var mu=((...e)=>{fu().render(...e)}),hu=((...e)=>{pu().hydrate(...e)}),gu=((...e)=>{let t=fu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=yu(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,vu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),_u=(( Line truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?nc(t.default({present:o.value})[0],{ref:e=>{let t=tp(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),rm=V({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=cp(n.default()),r=e.findIndex(e=>e.type!==ss);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?K(t,i.props):t,o=ws({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),im=[`area`,`img`,`input`],am=V({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`&&im.includes(r)?()=>nc(r,t):r===`template`?()=>nc(rm,t,{default:n.default}):()=>nc(e.as,t,{default:n.default})}});function om(){let e=L();return{primitiveElement:e,currentElement:q(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:tp(e))}}var sm=`dismissableLayer.pointerDownOutside`,cm=`dismissableLayer.focusOutside`;function lm(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 um(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=L(!1),a=L(()=>{});return Sr(o=>{if(!Vf||!pn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(lm(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){If(sm,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:()=>{pn(n)&&(i.value=!0)}}}function dm(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=L(!1);return Sr(a=>{if(!Vf||!pn(n))return;let o=async n=>{if(!t?.value)return;await Zn(),await Zn();let r=n.target;t.value&&r&&!lm(t.value,r)&&n.target&&!i.value&&If(cm,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{pn(n)&&(i.value=!0)},onBlurCapture:()=>{pn(n)&&(i.value=!1)}}}var fm=V({__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=q(()=>a.value?.ownerDocument??globalThis.document),s=q(()=>mp.layersRoot),c=q(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=q(()=>mp.layersWithOutsidePointerEventsDisabled.size>0),u=q(()=>{let e=Array.from(s.value),[t]=[...mp.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=um(async e=>{let t=[...mp.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Zn(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=dm(e=>{let t=[...mp.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ap(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),B([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{e&&n&&t&&(mp.layersWithOutsidePointerEventsDisabled.size===0&&(mp.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),mp.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{mp.layersWithOutsidePointerEventsDisabled.delete(e),mp.layersWithOutsidePointerEventsDisabled.size===0&&!Lf(mp.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=mp.originalBodyPointerEvents)}))},{immediate:!0}),B([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Sr(e=>{e(()=>{a.value&&(s.value.delete(a.value),mp.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(U(),W(R(am),{ref:R(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:N({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:R(f).onFocusCapture,onBlurCapture:R(f).onBlurCapture,onPointerdownCapture:R(d).onPointerDownCapture},{default:z(()=>[H(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),pm=Bf(()=>L([]));function mm(){let e=pm();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=hm(e.value,t),e.value.unshift(t)},remove(t){e.value=hm( Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var cx=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};async function lx(e,t){let n=await fetch(e,t);if(!n.ok)throw new cx(await sx(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=ax,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 lx(e,s);return a?await c.json():void 0}var ux={summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+ox(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+ox(t)),taskAction:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),version:()=>$(`/api/version`),configUpdate:e=>$(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>$(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>$(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>$(`/api/logs`+ox(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+ox(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>$(`/api/captures`+ox({limit:e})),mappings:()=>$(`/api/mappings`),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>$(`/api/bindings`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>$(`/api/chat/sessions`),chatMessages:e=>$(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>$(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>$(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>$(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:ix(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>$(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>$(`/api/chat/update`),chatUpdateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>$(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>$(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>$(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>lx(`/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})},dx=L([]);function fx(e,t){return e?t.filter(t=>typeof t.meta?.section==`string`&&e[t.meta.section]===!1).map(e=>e.path):[]}async function px(){try{dx.value=fx((await ux.capabilities())?.sections,Yy)}catch{}}var mx=[{id:`queued`,label:`Queued`,kind:`idle`},{id:`running`,label:`Working`,kind:`info`},{id:`waiting_human`,label:`Waiting for you`,kind:`warn`,needs_you:!0},{id:`pr_open`,label:`In review`,kind:`ok`},{id:`merged`,label:`Merged`,kind:`ok`},{id:`parked`,label:`Parked`,kind:`warn`,needs_you:!0},{id:`dead`,label:`Stopped (too many retries)`,kind:`danger`},{id:`rejected`,label:`Rejected`,kind:`danger`},{id:`closed_wont_do`,label:`Won't do`,kind:`idle`}],hx=[{id:`cancel`,label:`Cancel`,kind:`quiet`,confirm:`Cancel "{title}"? This closes the forge issue.`},{id:`stop`,label:`Stop`,kind:`primary`,confirm:`Stop "{title}"? Recoverable work will remain parked.`},{id:`approve`,label:`Approve`,kind:`primary`},{id:`reject`,label:`Reject`,kind:`quiet`,confirm:`Reject "{title}"? This closes the forge issue.`},{id:`retry`,label:`Retry`,kind:`primary`},{id:`abandon`,label:`Abandon`,kind:`quiet`,confirm:`Abandon "{title}"? This closes the forge Line truncated
`))}return()=>i.value||r.value||o.value?tc(t.default({present:o.value})[0],{ref:e=>{let t=ep(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),rm=R({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=sp(n.default()),r=e.findIndex(e=>e.type!==ls);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?q(t,i.props):t,o=ws({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),im=[`area`,`img`,`input`],am=R({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`&&im.includes(r)?()=>tc(r,t):r===`template`?()=>tc(rm,t,{default:n.default}):()=>tc(e.as,t,{default:n.default})}});function om(){let e=P();return{primitiveElement:e,currentElement:J(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ep(e))}}var sm=`dismissableLayer.pointerDownOutside`,cm=`dismissableLayer.focusOutside`;function lm(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 um(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=P(!1),a=P(()=>{});return Tr(o=>{if(!Bf||!gn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(lm(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Ff(sm,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:()=>{gn(n)&&(i.value=!0)}}}function dm(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=P(!1);return Tr(a=>{if(!Bf||!gn(n))return;let o=async n=>{if(!t?.value)return;await er(),await er();let r=n.target;t.value&&r&&!lm(t.value,r)&&n.target&&!i.value&&Ff(cm,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{gn(n)&&(i.value=!0)},onBlurCapture:()=>{gn(n)&&(i.value=!1)}}}var fm=R({__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}=Dp(),o=J(()=>a.value?.ownerDocument??globalThis.document),s=J(()=>pp.layersRoot),c=J(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=J(()=>pp.layersWithOutsidePointerEventsDisabled.size>0),u=J(()=>{let e=Array.from(s.value),[t]=[...pp.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=um(async e=>{let t=[...pp.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await er(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=dm(e=>{let t=[...pp.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ip(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),L([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{e&&n&&t&&(pp.layersWithOutsidePointerEventsDisabled.size===0&&(pp.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),pp.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{pp.layersWithOutsidePointerEventsDisabled.delete(e),pp.layersWithOutsidePointerEventsDisabled.size===0&&!If(pp.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=pp.originalBodyPointerEvents)}))},{immediate:!0}),L([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Tr(e=>{e(()=>{a.value&&(s.value.delete(a.value),pp.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(V(),U(F(am),{ref:F(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:A({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:F(f).onFocusCapture,onBlurCapture:F(f).onBlurCapture,onPointerdownCapture:F(d).onPointerDownCapture},{default:I(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),pm=zf(()=>P([]));function mm(){let e=pm();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=hm(e.value,t),e.value.unshift(t)},remove(t){e.value=hm Line truncated
- a positive number
- less than the value passed to \`max\` (or ${J_} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function $_(e){return Z_(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 \`${J_}\`.`),J_)}var ev=R({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:J_},getValueLabel:{type:Function,required:!1,default:(e,t)=>Z_(e)?`${Math.round(e/t*J_)}%`: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;Dp();let i=op(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=op(n,`max`,r,{passive:n.max===void 0});L(()=>i.value,async e=>{let t=Q_(e,n.max);t!==e&&(await er(),i.value=t)},{immediate:!0}),L(()=>n.max,e=>{let t=$_(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=J(()=>If(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return X_({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(F(am),{"as-child":e.asChild,as:e.as,"aria-valuemax":F(a),"aria-valuemin":0,"aria-valuenow":Z_(F(i))?F(i):void 0,"aria-valuetext":e.getValueText?.(F(i),F(a)),"aria-label":e.getValueLabel(F(i),F(a)),role:`progressbar`,"data-state":o.value,"data-value":F(i)??void 0,"data-max":F(a)},{default:I(()=>[z(e.$slots,`default`,{modelValue:F(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),tv=R({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Y_();return Dp(),(e,r)=>(V(),U(F(am),q(t,{"data-state":F(n).progressState.value,"data-value":F(n).modelValue?.value??void 0,"data-max":F(n).max.value}),{default:I(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),nv=R({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return Dp(),(e,n)=>(V(),U(F(u_),ye(Cs(t)),{default:I(()=>[z(e.$slots,`default`)]),_:3},16))}}),[rv,iv]=Nf(`TooltipProvider`),av=R({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=xn(e);Dp();let c=P(!0),l=P(!1),{start:u,stop:d}=Zf(()=>{c.value=!0},n,{immediate:!1});return iv({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>z(e.$slots,`default`)}}),ov=`tooltip.open`,[sv,cv]=Nf(`TooltipRoot`),lv=R({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Dp();let i=rv(),a=J(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=J(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=J(()=>n.disabled??i.disabled.value),c=J(()=>n.delayDuration??i.delayDuration.value),l=J(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=op(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});L(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(ov))):i.onClose())});let d=P(!1),f=P(),p=J(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:m,stop:h}=Zf(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function g(){h(),d.value=!1,u.value=!0}function _(){h(),u.value=!1}function v(){m()}return cv({contentId:``,open:u,stateAttribute:p,trigger:f,onTriggerChange(e){f.value=e},onTriggerEnter(){i.isOpenDelayed.value?v():g()},onTriggerLeave(){a.value?_():h()},onOpen:g,onClose:_,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(V(),U(F(Km),null,{default:I(()=>[z(e.$slots,`default`,{open:F(u)})]),_:3}))}}),uv=R({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:BoolLine truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Sx=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};async function Cx(e,t){let n=await fetch(e,t);if(!n.ok)throw new Sx(await xx(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=yx,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 Cx(e,s);return a?await c.json():void 0}var wx={summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+bx(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+bx(t)),taskAction:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),version:()=>$(`/api/version`),configUpdate:e=>$(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>$(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>$(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>$(`/api/logs`+bx(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+bx(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>$(`/api/captures`+bx({limit:e})),mappings:()=>$(`/api/mappings`),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>$(`/api/bindings`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>$(`/api/chat/sessions`),chatMessages:e=>$(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>$(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>$(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>$(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:vx(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>$(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>$(`/api/chat/update`),chatUpdateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>$(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>$(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>$(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Cx(`/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 Tx(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 Ex(e){if(!e)return`—`;let t=e instanceof Date?e:new Date(e),n=Math.floor((Date.now()-t.getTime())/1e3);if(!Number.isFinite(n))return`—`;if(n<45)return`just now`;let r=[[`min`,60],[`hr`,3600],[`day`,86400],[`wk`,604800]],i=`min`,a=60;for(let[e,t]of r)n>=t&&([i,a]=[e,t]);let o=Math.floor(n/a);return`${o} ${i}${o===1?``:`s`} ago`}function Dx(e){return e==null||Number.isNaN(e)?`—`:new Intl.NumberFormat(void 0,{notation:`compact`,maximumFractionDigits:1}).format(e)}var Ox=160;function kx(e){let t=String(e?.detail||e?.message||``);if(!t)return{text:``,full:``,truncated:!1};let n=t.split(`
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Ox?`${n.slice(0,Ox).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Ax=`archie.setup-complete.dismissed.v1`;function jx(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?.(Ax),{kind:`incomplete`,remaining:n}):t?.getItem?.(`archie.setup-complete.dismissed.v1`)===`1`?{kind:`dismissed`,remaining:[]}:{kind:`complete`,remaining:[]}}function Mx(e=globalThis.localStorage){e?.setItem?.(Ax,`1`)}var Nx=new Set([`waiting_human`,`parked`]);function Px(e=[]){let t=e.filter(e=>Nx.has(e.status??``)),n=e.filter(e=>e.status===`running`);return{attention:{count:t.length,href:t.length===1?`/tasks?task=${encodeURIComponent(t[0].id)}`:`/tasks?status=needs_you`},running:{count:n.length,href:`/tasks?status=running`}}}var Fx={class:`mb-5 flex flex-wrap items-start justify-between gap-5`},Ix={class:`text-3xl font-semibold tracking-[-0.03em]`},Lx={class:`flex flex-wrap items-center gap-2`},Rx={class:`mb-5`},zx={class:`text-lg font-semibold text-primary`},Bx={class:`flex flex-col gap-3`},Vx={key:0,class:`mt-0.5 text-xs text-fg-subtle`},Hx={class:`mt-4 flex flex-col gap-2`},Ux={class:`truncate text-fg-muted`},Wx={key:0,class:`flex items-center justify-between gap-3 rounded-sm bg-muted px-3 py-2 text-sm`},Gx={key:0,class:`mb-5`},Kx={class:`grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] gap-4`},qx={key:1,class:`mb-5`},Jx={class:`grid grid-cols-1 gap-4 min-[1080px]:grid-cols-[minmax(0,1fr)_minmax(0,1.5fr)]`},Yx={class:`mb-1 text-3xl font-semibold tracking-[-0.03em]`},Xx={class:`mb-4 text-xs text-fg-subtle`},Zx=[`title`],Qx=R({__name:`DashboardPage`,setup(e){let t=P([]),n=P(`connecting`),r=P(`idle`),i=P(new Map),a=P(null),o=P(null),s=P(null),c=P(null),l=P(null),u=qu(),d=P(0);Qi(async()=>{await p(),f=Tx(e=>{let n=[e,...t.value];n.splice(50),t.value=n},e=>{n.value=e,r.value=e===`live`?`ok`:`warn`})});let f;na(()=>f?.());async function p(){l.value=null;try{let[e,t,n,r]=await Promise.all([wx.summary(),wx.setup().catch(()=>null),wx.workflows().catch(()=>null),wx.tasks().catch(()=>[])]),l=new Map;for(let e of r)e.owner&&e.repo&&e.issue_number&&l.set(`${e.owner}/${e.repo}#${e.issue_number}`,Number(e.id));i.value=l,a.value=e,o.value=t,s.value=n,c.value=r}catch(e){l.value=String(e.message||e)}}function m(e,t){return Number(e.task_id)>0?Number(e.task_id):!e.repo||!e.issue?0:Number(t.get(`${e.repo}#${e.issue}`))||0}let h=e=>m(e,i.value);function g(){let e=new Date().getHours();return e<5?`Still up?`:e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`}function _(e){if(e.length<4)return null;let t=Math.floor(e.length/2),n=e.slice(0,t).reduce((e,t)=>e+t,0),r=e.slice(t).reduce((e,t)=>e+t,0);return n?(r-n)/n*100:null}function v(e){u.push(`/tasks?task=${encodeURIComponent(e)}`)}function y(){Mx(),d.value+=1}let b=J(()=>o.value?.operator?`${g()}, ${o.value.operator}`:g()),x=J(()=>Px(c.value??[])),S=J(()=>jx(o.value)),C=J(()=>o.value?.steps??[]),w=J(()=>S.value.kind===`omit`||S.value.kind===`dismissed`),T=J(()=>{let e=o.value?.steps??[];return e.length?Math.round((e.length-S.value.remaining.length)/e.length*100):0}),E=J(()=>a.value?.statuses??{}),D=J(()=>a.value?.tokens_by_day??[]),ee=J(()=>D.value.map(e=>e.tokens||0)),te=J(()=>s.value?.workflows??[]),ne=J(()=>({runs:te.value.reduce((e,t)=>e+(t.runs||0),0),merged:te.value.reduce((e,t)=>e+(t.merged||0)+(t.pr_open||0),0),parked:te.value.reduce((e,t)=>e+(t.parked||0),0)})),re=J(()=>{let e=ee.value.reduce((e,t)=>e+t,0),t=ee.value.slice(-7).reduce((e,t)=>e+t,0),n=D.value.length?e/D.value.length:0;return{used:e,recent:t,perDay:n,projected:Math.round(n*30)}});return(e,i)=>(V(),H(`div`,null,[W(`div`,Fx,[W(`div`,null,[W(`h1`,Ix,M(b.value),1),i[0]||=W(`p`,{class:`mt-2 text-sm text-fg-muted`},` Your agent's control room — what it is working on, what needs you, and what it is spending. `,-1)]),W(`div`,Lx,[l.value?(V(),U(F(ix),{key:0,onClick:p},{default:I(()=>[G(F(gb),{"data-icon":`inline-start`}),i[1]||=K(` Retry `,-1)]),_:1})):c.value===null?Es(``,!0):(V(),H(B,{key:1},[x.value.attention.count>0?(V(),U(F(ix),{key:0,variant:`attention`,"as-child":``},{default:I(()=>[G(F(wf),{to:x.value.attention.href},{default:I(()=>[G(F(mb),{"data-icon":`inline-start`}),K(` `+M(x.value.attention.count)+` need`+M(x.value.attention.count===1?`s`:``)+` you `,1)]),_:1},8,[`to`])]),_:1})):Es(``,!0),x.value.running.count>0?(V(),U(F(ix),{key:1,variant:`outline`,"as-child":``},{default:I(()=>[G(F(wf),{to:x.value.running.href},{default:I(()=>[G(F(_b),{"data-icon":`inline-start`}),K(` `+M(x.value.running.count)+` running `,1)]),_:1},8,[`to`])]),_:1})):Es(``,!0),G(F(ix),{variant:`outline`,"as-child":``},{default:I(()=>[G(F(wf),{to:`/logs`},{default:I(()=>[G(F(bb),{"data-icon":`inline-start`}),i[2]||=K(` Logs `,-1)]),_:1})]),_:1}),G(F(ix),{onClick:p},{default:I(()=>[G(F(gb),{"data-icon":`inline-start`}),i[3]||=K(` Refresh `,-1)]),_:1})],64))])]),W(`section`,Rx,[i[13]||=W(`div`,{cla Line truncated
+4
View File
@@ -14,6 +14,10 @@ export const buttonVariants = cva(
ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
destructive: 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',
link: 'text-primary underline-offset-4 hover:underline',
// An action that exists because something needs a human has to look
// unlike one that is always present. `destructive` would overstate it:
// nothing is broken, it is waiting.
attention: 'border-warn bg-warn-soft font-medium text-warn hover:bg-warn-soft/80',
},
size: {
'default': 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
+20
View File
@@ -0,0 +1,20 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<div
data-slot="empty"
:class="cn(
'gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance',
props.class,
)"
>
<slot />
</div>
</template>
@@ -0,0 +1,20 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<div
data-slot="empty-content"
:class="cn(
'gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance',
props.class,
)"
>
<slot />
</div>
</template>
@@ -0,0 +1,20 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<p
data-slot="empty-description"
:class="cn(
'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
$attrs.class ?? '',
)"
>
<slot />
</p>
</template>
@@ -0,0 +1,20 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<div
data-slot="empty-header"
:class="cn(
'gap-2 flex max-w-sm flex-col items-center',
props.class,
)"
>
<slot />
</div>
</template>
+23
View File
@@ -0,0 +1,23 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import type { EmptyMediaVariants } from '.'
import { cn } from '@/lib/utils'
import { emptyMediaVariants } from '.'
const props = withDefaults(defineProps<{
class?: HTMLAttributes['class']
variant?: EmptyMediaVariants['variant']
}>(), {
variant: 'default',
})
</script>
<template>
<div
data-slot="empty-icon"
:data-variant="variant"
:class="cn(emptyMediaVariants({ variant }), props.class)"
>
<slot />
</div>
</template>
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<div
data-slot="empty-title"
:class="cn('text-sm font-medium tracking-tight cn-font-heading', props.class)"
>
<slot />
</div>
</template>
+26
View File
@@ -0,0 +1,26 @@
import type { VariantProps } from 'class-variance-authority'
import { cva } from 'class-variance-authority'
export { default as Empty } from './Empty.vue'
export { default as EmptyContent } from './EmptyContent.vue'
export { default as EmptyDescription } from './EmptyDescription.vue'
export { default as EmptyHeader } from './EmptyHeader.vue'
export { default as EmptyMedia } from './EmptyMedia.vue'
export { default as EmptyTitle } from './EmptyTitle.vue'
export const emptyMediaVariants = cva(
'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
{
variants: {
variant: {
default: 'bg-transparent',
icon: 'bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*=size-])]:size-4',
},
},
defaultVariants: {
variant: 'default',
},
},
)
export type EmptyMediaVariants = VariantProps<typeof emptyMediaVariants>
@@ -0,0 +1,38 @@
<script setup lang="ts">
import type { ProgressRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import {
ProgressIndicator,
ProgressRoot,
} from 'reka-ui'
import { cn } from '@/lib/utils'
const props = withDefaults(
defineProps<ProgressRootProps & { class?: HTMLAttributes['class'] }>(),
{
modelValue: 0,
},
)
const delegatedProps = reactiveOmit(props, 'class')
</script>
<template>
<ProgressRoot
data-slot="progress"
v-bind="delegatedProps"
:class="
cn(
'bg-muted h-1 rounded-full relative flex w-full items-center overflow-x-hidden',
props.class,
)
"
>
<ProgressIndicator
data-slot="progress-indicator"
class="bg-primary size-full flex-1 transition-all"
:style="`transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
/>
</ProgressRoot>
</template>
+1
View File
@@ -0,0 +1 @@
export { default as Progress } from './Progress.vue'
@@ -0,0 +1,29 @@
<script setup lang="ts">
import type { SeparatorProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { Separator } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = withDefaults(defineProps<
SeparatorProps & { class?: HTMLAttributes['class'] }
>(), {
orientation: 'horizontal',
decorative: true,
})
const delegatedProps = reactiveOmit(props, 'class')
</script>
<template>
<Separator
data-slot="separator"
v-bind="delegatedProps"
:class="
cn(
'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch',
props.class,
)
"
/>
</template>
+1
View File
@@ -0,0 +1 @@
export { default as Separator } from './Separator.vue'
+16
View File
@@ -0,0 +1,16 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<div data-slot="table-container" class="relative w-full overflow-x-auto">
<table data-slot="table" :class="cn('w-full caption-bottom text-sm', props.class)">
<slot />
</table>
</div>
</template>
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<tbody
data-slot="table-body"
:class="cn('[&_tr:last-child]:border-0', props.class)"
>
<slot />
</tbody>
</template>
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<caption
data-slot="table-caption"
:class="cn('text-muted-foreground mt-4 text-sm', props.class)"
>
<slot />
</caption>
</template>
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<td
data-slot="table-cell"
:class="cn('p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0', props.class)"
>
<slot />
</td>
</template>
+34
View File
@@ -0,0 +1,34 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { cn } from '@/lib/utils'
import TableCell from './TableCell.vue'
import TableRow from './TableRow.vue'
const props = withDefaults(defineProps<{
class?: HTMLAttributes['class']
colspan?: number
}>(), {
colspan: 1,
})
const delegatedProps = reactiveOmit(props, 'class')
</script>
<template>
<TableRow>
<TableCell
:class="
cn(
'p-4 whitespace-nowrap align-middle text-sm text-foreground',
props.class,
)
"
v-bind="delegatedProps"
>
<div class="flex items-center justify-center py-10">
<slot />
</div>
</TableCell>
</TableRow>
</template>
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<tfoot
data-slot="table-footer"
:class="cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', props.class)"
>
<slot />
</tfoot>
</template>
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<th
data-slot="table-head"
:class="cn('text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0', props.class)"
>
<slot />
</th>
</template>
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<thead
data-slot="table-header"
:class="cn('[&_tr]:border-b', props.class)"
>
<slot />
</thead>
</template>
+17
View File
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<tr
data-slot="table-row"
:class="cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors has-aria-expanded:bg-muted/50', props.class)"
>
<slot />
</tr>
</template>
+9
View File
@@ -0,0 +1,9 @@
export { default as Table } from './Table.vue'
export { default as TableBody } from './TableBody.vue'
export { default as TableCaption } from './TableCaption.vue'
export { default as TableCell } from './TableCell.vue'
export { default as TableEmpty } from './TableEmpty.vue'
export { default as TableFooter } from './TableFooter.vue'
export { default as TableHead } from './TableHead.vue'
export { default as TableHeader } from './TableHeader.vue'
export { default as TableRow } from './TableRow.vue'
+471
View File
@@ -0,0 +1,471 @@
<script setup lang="ts">
import { AlignLeft, Check, ListChecks, RefreshCw, Route, X } from "@lucide/vue";
import { computed, onMounted, onUnmounted, ref } from "vue";
import { RouterLink, useRouter } from "vue-router";
import Gauge from "@/base/Gauge.vue";
import SegmentBar from "@/base/SegmentBar.vue";
import StatTile from "@/base/StatTile.vue";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Progress } from "@/components/ui/progress";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { api, subscribeEvents } from "@/lib/api";
import { ago, compact } from "@/lib/format";
import type { StatusKind } from "@/lib/status";
import { activityDetail, type ActivityDetailInput } from "./activity-detail";
import { dismissSetupComplete, setupPanelState, type Setup } from "./setup-preference";
import { dashboardTaskTargets, type TaskTarget } from "./task-targets";
interface Summary {
statuses?: Record<string, number>;
tokens_by_day?: Array<{ tokens?: number }>;
}
interface WorkflowStat {
workflow?: string;
runs?: number;
merged?: number;
pr_open?: number;
parked?: number;
}
/** An event off the live stream: the payload the detail column reads, plus
* enough to point the row at the task it belongs to. */
interface ActivityEvent extends ActivityDetailInput {
kind?: string;
type?: string;
task_id?: number | string;
repo?: string;
issue?: number | string;
at?: string | number;
}
/**
* The control room: what Archie is working on, what needs you, and what it is
* spending.
*/
const activity = ref<ActivityEvent[]>([]);
const streamStateText = ref("connecting");
const streamStateKind = ref<StatusKind>("idle");
const taskIDsBySource = ref(new Map<string, number>());
const summary = ref<Summary | null>(null);
const setup = ref<Setup | null>(null);
const workflows = ref<{ workflows?: WorkflowStat[] } | null>(null);
// null means loading, [] means loaded.
const tasks = ref<TaskTarget[] | null>(null);
const error = ref<string | null>(null);
const router = useRouter();
// Bumped when the operator dismisses the setup card, so the panel state is
// re-evaluated; the preference itself lives in storage, not in the component.
const dismissals = ref(0);
onMounted(async () => {
await load();
unsubscribe = subscribeEvents(
(event) => {
const next = [event as ActivityEvent, ...activity.value];
next.splice(50);
activity.value = next;
},
(state) => {
streamStateText.value = state;
streamStateKind.value = state === "live" ? "ok" : "warn";
},
);
});
let unsubscribe: (() => void) | undefined;
onUnmounted(() => unsubscribe?.());
async function load() {
error.value = null;
try {
const [nextSummary, nextSetup, nextWorkflows, nextTasks] = await Promise.all([
api.summary<Summary>(),
api.setup<Setup>().catch(() => null),
api.workflows<{ workflows?: WorkflowStat[] }>().catch(() => null),
api.tasks<TaskTarget[]>().catch(() => []),
]);
const map = new Map<string, number>();
for (const task of nextTasks as Array<TaskTarget & { owner?: string; repo?: string; issue_number?: number }>) {
if (task.owner && task.repo && task.issue_number) {
map.set(`${task.owner}/${task.repo}#${task.issue_number}`, Number(task.id));
}
}
taskIDsBySource.value = map;
summary.value = nextSummary;
setup.value = nextSetup;
workflows.value = nextWorkflows;
tasks.value = nextTasks;
} catch (err) {
error.value = String((err as Error).message || err);
}
}
function taskIDForEvent(event: ActivityEvent, bySource: Map<string, number>): number {
if (Number(event.task_id) > 0) return Number(event.task_id);
if (!event.repo || !event.issue) return 0;
return Number(bySource.get(`${event.repo}#${event.issue}`)) || 0;
}
/** The task an activity row opens, or 0. An event carries the id, or a
* repo/issue pair the task list resolves. */
const taskIDFor = (event: ActivityEvent): number => taskIDForEvent(event, taskIDsBySource.value);
function greeting(): string {
const h = new Date().getHours();
if (h < 5) return "Still up?";
if (h < 12) return "Good morning";
if (h < 18) return "Good afternoon";
return "Good evening";
}
function trendPct(series: number[]): number | null {
if (series.length < 4) return null;
const mid = Math.floor(series.length / 2);
const older = series.slice(0, mid).reduce((a, b) => a + b, 0);
const newer = series.slice(mid).reduce((a, b) => a + b, 0);
if (!older) return null;
return ((newer - older) / older) * 100;
}
function openTask(taskID: number) {
void router.push(`/tasks?task=${encodeURIComponent(taskID)}`);
}
function handleDismissSetup() {
dismissSetupComplete();
dismissals.value += 1;
}
const currentGreeting = computed(() => (setup.value?.operator ? `${greeting()}, ${setup.value.operator}` : greeting()));
const targets = computed(() => dashboardTaskTargets(tasks.value ?? []));
const setupPanel = computed(() => setupPanelState(setup.value));
const setupSteps = computed(() => setup.value?.steps ?? []);
const omitSetup = computed(() => setupPanel.value.kind === "omit" || setupPanel.value.kind === "dismissed");
const setupPct = computed(() => {
const steps = setup.value?.steps ?? [];
if (!steps.length) return 0;
return Math.round(((steps.length - setupPanel.value.remaining.length) / steps.length) * 100);
});
const counts = computed(() => summary.value?.statuses ?? {});
const tokensByDay = computed(() => summary.value?.tokens_by_day ?? []);
const tokenSeries = computed(() => tokensByDay.value.map((d) => d.tokens || 0));
const workflowStats = computed(() => workflows.value?.workflows ?? []);
const runTotals = computed(() => {
const runs = workflowStats.value.reduce((a, w) => a + (w.runs || 0), 0);
const merged = workflowStats.value.reduce((a, w) => a + (w.merged || 0) + (w.pr_open || 0), 0);
const parked = workflowStats.value.reduce((a, w) => a + (w.parked || 0), 0);
return { runs, merged, parked };
});
const tokenTotals = computed(() => {
const used = tokenSeries.value.reduce((a, b) => a + b, 0);
const recent = tokenSeries.value.slice(-7).reduce((a, b) => a + b, 0);
const perDay = tokensByDay.value.length ? used / tokensByDay.value.length : 0;
return { used, recent, perDay, projected: Math.round(perDay * 30) };
});
</script>
<template>
<div>
<div class="mb-5 flex flex-wrap items-start justify-between gap-5">
<div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">{{ currentGreeting }}</h1>
<p class="mt-2 text-sm text-fg-muted">
Your agent's control room — what it is working on, what needs you, and what it is spending.
</p>
</div>
<div class="flex flex-wrap items-center gap-2">
<Button v-if="error" @click="load">
<RefreshCw data-icon="inline-start" />
Retry
</Button>
<template v-else-if="tasks !== null">
<Button v-if="targets.attention.count > 0" variant="attention" as-child>
<RouterLink :to="targets.attention.href">
<ListChecks data-icon="inline-start" />
{{ targets.attention.count }} need{{ targets.attention.count === 1 ? "s" : "" }} you
</RouterLink>
</Button>
<Button v-if="targets.running.count > 0" variant="outline" as-child>
<RouterLink :to="targets.running.href">
<Route data-icon="inline-start" />
{{ targets.running.count }} running
</RouterLink>
</Button>
<Button variant="outline" as-child>
<RouterLink to="/logs">
<AlignLeft data-icon="inline-start" />
Logs
</RouterLink>
</Button>
<Button @click="load">
<RefreshCw data-icon="inline-start" />
Refresh
</Button>
</template>
</div>
</div>
<!--
Health. Each card takes its own content height rather than the row's:
matching them was right while both held a checklist, but once setup is
done that card is a title and a line while Gate pulse carries a gauge and
four rows, so equalising left a mostly-empty box taking a quarter of the
first screen.
-->
<section class="mb-5">
<div class="mb-3 flex items-baseline gap-3 pl-1">
<h2 class="text-xs font-semibold tracking-[0.08em] text-fg-subtle uppercase">Health</h2>
</div>
<div
class="grid items-start gap-4"
:class="omitSetup ? 'grid-cols-1' : 'grid-cols-1 min-[1080px]:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]'"
>
<Card v-if="setupPanel.kind === 'incomplete'">
<CardHeader>
<CardTitle>Finish setting up</CardTitle>
<CardDescription>Archie needs these before it can work on its own.</CardDescription>
<CardAction>
<span class="text-lg font-semibold text-primary">{{ setupPct }}%</span>
</CardAction>
</CardHeader>
<CardContent>
<Progress :model-value="setupPct" class="mb-4" />
<ul class="flex flex-col gap-3">
<li v-for="(step, i) in setupSteps" :key="i" class="flex items-start gap-3">
<span
class="mt-px grid size-[18px] flex-none place-items-center rounded-full border-[1.5px] border-border-strong text-xs text-fg-subtle"
:class="step.done ? 'border-transparent bg-ok-soft text-ok' : ''"
>
<Check v-if="step.done" class="size-3" />
</span>
<div>
<div class="text-sm" :class="step.done ? 'text-fg-muted line-through' : ''">{{ step.title }}</div>
<div v-if="step.detail" class="mt-0.5 text-xs text-fg-subtle">{{ step.detail }}</div>
</div>
</li>
</ul>
</CardContent>
</Card>
<Card v-else-if="setupPanel.kind === 'complete'">
<CardHeader>
<CardTitle>Setup complete</CardTitle>
<CardDescription>Archie is configured and ready to work.</CardDescription>
<CardAction class="flex items-center gap-2">
<Check class="size-4 text-ok" />
<Button
variant="ghost"
size="icon-sm"
aria-label="Dismiss setup complete"
@click="handleDismissSetup"
>
<X />
</Button>
</CardAction>
</CardHeader>
</Card>
<Card v-if="summary">
<CardHeader>
<CardTitle>Gate pulse</CardTitle>
<CardDescription v-if="runTotals.runs">Work that passed its quality gates</CardDescription>
</CardHeader>
<CardContent>
<Empty v-if="!runTotals.runs">
<EmptyHeader>
<EmptyTitle>No completed runs yet</EmptyTitle>
<EmptyDescription>Once Archie finishes a task, its gate pass rate appears here.</EmptyDescription>
</EmptyHeader>
</Empty>
<template v-else>
<Gauge :value="(runTotals.merged / runTotals.runs) * 100" label="pass rate" />
<ul class="mt-4 flex flex-col gap-2">
<li
v-for="(w, i) in workflowStats.slice(0, 3)"
:key="i"
class="flex items-center justify-between gap-3 rounded-sm bg-muted px-3 py-2 text-sm"
>
<span class="truncate text-fg-muted">{{ w.workflow || "workflow" }}</span>
<Badge
:variant="
(w.merged || 0) === (w.runs || 0) ? 'ok' : (w.parked || 0) > 0 ? 'warn' : 'info'
"
>
{{ w.merged || 0 }}/{{ w.runs || 0 }}
</Badge>
</li>
<li
v-if="runTotals.parked > 0"
class="flex items-center justify-between gap-3 rounded-sm bg-muted px-3 py-2 text-sm"
>
<span class="truncate text-fg-muted">Parked, awaiting you</span>
<Badge variant="warn">{{ runTotals.parked }}</Badge>
</li>
</ul>
</template>
</CardContent>
</Card>
</div>
</section>
<section v-if="summary" class="mb-5">
<div class="mb-3 flex items-baseline gap-3 pl-1">
<h2 class="text-xs font-semibold tracking-[0.08em] text-fg-subtle uppercase">Throughput</h2>
<span class="text-xs text-fg-subtle">Across all repositories</span>
</div>
<div class="grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] gap-4">
<StatTile
label="Working now"
:value="counts.running || 0"
:compare="`${counts.queued || 0} waiting to start`"
:series="tokenSeries"
/>
<StatTile
label="Needs you"
:value="(counts.parked || 0) + (counts.waiting_human || 0)"
:compare="counts.parked || counts.waiting_human ? 'Parked or awaiting a reply' : 'Nothing is blocked'"
good-direction="down"
/>
<StatTile
label="Delivered"
:value="(counts.merged || 0) + (counts.pr_open || 0)"
:compare="
Object.values(counts).reduce((a, b) => a + b, 0)
? `${Math.round((((counts.merged || 0) + (counts.pr_open || 0)) / Object.values(counts).reduce((a, b) => a + b, 0)) * 100)}% of all tasks`
: 'No tasks yet'
"
/>
<StatTile
label="Tokens used"
:value="compact(tokenTotals.used)"
:compare="`Across ${tokensByDay.length || 0} days`"
:trend="trendPct(tokenSeries)"
good-direction="down"
:series="tokenSeries"
/>
</div>
</section>
<section v-if="summary" class="mb-5">
<div class="mb-3 flex items-baseline gap-3 pl-1">
<h2 class="text-xs font-semibold tracking-[0.08em] text-fg-subtle uppercase">Right now</h2>
</div>
<div class="grid grid-cols-1 gap-4 min-[1080px]:grid-cols-[minmax(0,1fr)_minmax(0,1.5fr)]">
<Card>
<CardHeader>
<CardTitle>Token outlook</CardTitle>
<CardDescription v-if="tokensByDay.length">Next 30 days at the current rate</CardDescription>
</CardHeader>
<CardContent>
<Empty v-if="!tokensByDay.length">
<EmptyHeader>
<EmptyTitle>Nothing spent yet</EmptyTitle>
<EmptyDescription>Usage appears here once Archie runs its first task.</EmptyDescription>
</EmptyHeader>
</Empty>
<template v-else>
<div class="mb-1 text-3xl font-semibold tracking-[-0.03em]">{{ compact(tokenTotals.projected) }}</div>
<div class="mb-4 text-xs text-fg-subtle">
Based on {{ compact(Math.round(tokenTotals.perDay)) }} per day over {{ tokensByDay.length }} days
</div>
<SegmentBar
:segments="[
{ label: `Last 7 days (${compact(tokenTotals.recent)})`, value: tokenTotals.recent, kind: 'info' },
{
label: `Earlier (${compact(tokenTotals.used - tokenTotals.recent)})`,
value: Math.max(tokenTotals.used - tokenTotals.recent, 0),
kind: 'idle',
},
]"
/>
</template>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Live activity</CardTitle>
<CardDescription>Last 50, newest first</CardDescription>
<CardAction>
<Badge :variant="streamStateKind">{{ streamStateText }}</Badge>
</CardAction>
</CardHeader>
<CardContent>
<Table>
<TableHeader>
<TableRow>
<TableHead>Event</TableHead>
<TableHead>Task</TableHead>
<TableHead>Detail</TableHead>
<TableHead>When</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-if="!activity.length">
<TableCell colspan="4">
<Empty>
<EmptyHeader>
<EmptyTitle>Waiting for activity</EmptyTitle>
<EmptyDescription>Events appear here as Archie works.</EmptyDescription>
</EmptyHeader>
</Empty>
</TableCell>
</TableRow>
<TableRow
v-for="(event, i) in activity"
v-else
:key="i"
:class="taskIDFor(event) > 0 ? 'cursor-pointer' : ''"
:role="taskIDFor(event) > 0 ? 'link' : undefined"
:tabindex="taskIDFor(event) > 0 ? 0 : undefined"
:title="taskIDFor(event) > 0 ? 'Open task details' : undefined"
@click="taskIDFor(event) > 0 && openTask(taskIDFor(event))"
@keydown.enter.prevent="
taskIDFor(event) > 0 && openTask(taskIDFor(event))
"
@keydown.space.prevent="
taskIDFor(event) > 0 && openTask(taskIDFor(event))
"
>
<TableCell class="font-medium">{{ event.kind || event.type || "event" }}</TableCell>
<TableCell class="font-mono">
{{ taskIDFor(event) > 0 ? `#${taskIDFor(event)}` : "—" }}
</TableCell>
<!--
The detail is cut to one line by activityDetail and clamped
again here so a long unbroken token (a path, a URL, a hash)
cannot widen the column past the table. Unclamped, this made
the dashboard 7,481px tall.
-->
<TableCell class="w-[55%] max-w-0">
<span
class="block truncate"
:title="activityDetail(event).truncated ? activityDetail(event).full : undefined"
>
{{ activityDetail(event).text }}
</span>
</TableCell>
<TableCell>{{ ago(event.at || Date.now()) }}</TableCell>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</div>
</section>
</div>
</template>
+5 -3
View File
@@ -13,8 +13,10 @@
// same height at the widths the table is used at.
const CELL_LIMIT = 160;
/** An activity event, as far as this column reads it. */
export interface ActivityEvent {
/** An activity event, as far as this column reads it. Deliberately narrower
* than the event the dashboard holds: this is the whole of what the cell
* renders, so a caller can pass anything carrying either field. */
export interface ActivityDetailInput {
detail?: unknown;
message?: unknown;
}
@@ -31,7 +33,7 @@ export interface ActivityDetail {
* `text` is the single line the cell renders, `full` the untouched payload,
* and `truncated` whether the two differ.
*/
export function activityDetail(event: ActivityEvent | undefined): ActivityDetail {
export function activityDetail(event: ActivityDetailInput | undefined): ActivityDetail {
const full = String(event?.detail || event?.message || "");
if (!full) return { text: "", full: "", truncated: false };
+44
View File
@@ -0,0 +1,44 @@
export const SETUP_DISMISSAL_KEY = "archie.setup-complete.dismissed.v1";
/** One setup step as the daemon reports it. */
export interface SetupStep {
title: string;
detail?: string;
done: boolean;
}
export interface Setup {
steps: SetupStep[];
operator?: string;
}
/** The storage surface this needs, so it is testable without a browser. */
export type SetupStorage = Pick<Storage, "getItem" | "removeItem" | "setItem">;
export interface SetupPanelState {
kind: "omit" | "incomplete" | "complete" | "dismissed";
remaining: SetupStep[];
}
// setupPanelState reconciles persisted presentation state with current setup
// truth. If setup later becomes incomplete, an old dismissal is cleared so the
// operator cannot miss the new work.
export function setupPanelState(
setup: Setup | null | undefined,
storage: SetupStorage | undefined = globalThis.localStorage,
): SetupPanelState {
if (!setup?.steps?.length) return { kind: "omit", remaining: [] };
const remaining = setup.steps.filter((step) => !step.done);
if (remaining.length) {
storage?.removeItem?.(SETUP_DISMISSAL_KEY);
return { kind: "incomplete", remaining };
}
if (storage?.getItem?.(SETUP_DISMISSAL_KEY) === "1") {
return { kind: "dismissed", remaining: [] };
}
return { kind: "complete", remaining: [] };
}
export function dismissSetupComplete(storage: SetupStorage | undefined = globalThis.localStorage): void {
storage?.setItem?.(SETUP_DISMISSAL_KEY, "1");
}
+37
View File
@@ -0,0 +1,37 @@
const ATTENTION_STATUSES = new Set(["waiting_human", "parked"]);
/** The task fields these links are derived from. */
export interface TaskTarget {
id: number | string;
status?: string;
}
export interface TaskTargets {
attention: { count: number; href: string };
running: { count: number; href: string };
}
// Dashboard task links are derived from the actual task list, not just count
// aggregates, so a single item can open directly while a group opens a useful
// filtered board.
//
// The hrefs are router paths, not the `#/tasks` hashes the Preact build used.
// History routing means a hash is not a route any more, so one that survived
// here would navigate nowhere.
export function dashboardTaskTargets(tasks: TaskTarget[] = []): TaskTargets {
const attention = tasks.filter((task) => ATTENTION_STATUSES.has(task.status ?? ""));
const running = tasks.filter((task) => task.status === "running");
return {
attention: {
count: attention.length,
href:
attention.length === 1
? `/tasks?task=${encodeURIComponent(attention[0].id)}`
: "/tasks?status=needs_you",
},
running: {
count: running.length,
href: "/tasks?status=running",
},
};
}
+2 -1
View File
@@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from "vue-router";
import DashboardPage from "@/dashboard/DashboardPage.vue";
import Placeholder from "@/views/Placeholder.vue";
// internal/gateway/dashboard_tools.go mirrors this table; its test parses this
@@ -14,7 +15,7 @@ import Placeholder from "@/views/Placeholder.vue";
// navPath the navigation entry this route keeps current
// soon visible, greyed and non-navigable
const routes = [
{ path: "/", name: "dashboard", component: Placeholder, meta: { label: "Dashboard", description: "What Archie is working on, what needs you, and token spend." } },
{ path: "/", name: "dashboard", component: DashboardPage, meta: { label: "Dashboard", description: "What Archie is working on, what needs you, and token spend." } },
{ path: "/tasks", name: "tasks", component: Placeholder, meta: { label: "Tasks", description: "Issues Archie has picked up, and where each one stands." } },
{ path: "/tasks/:id", name: "task-detail", component: Placeholder, meta: { label: "Task run", nav: false, navPath: "/tasks" } },
{ path: "/workflows", name: "workflows", component: Placeholder, meta: { label: "Workflows", description: "The routed workflows and their run history.", section: "workflows" } },