feat(tools): a capture-intake sender for exercising the Events surfaces

Posts to /webhooks/capture/{source} with a realistic GitHub, Sentry, form or
large payload (or an exact body), reads the capture back so a silent drop is
visible immediately, and names the intake's rate and size limits when it
hits them. Wired as task webhook:send.
This commit is contained in:
sam committed 2026-09-21 01:10:30 +10:00
1 parent 34ede03b4d
commit 7f1da81d52
44 files changed
+438 -645

No files matched your search

+7
View File
@@ -210,6 +210,13 @@ tasks:
- npm test
- npm run typecheck
# A test event for the capture intake, so the Events surfaces can be driven by
# hand without a real webhook source. See tools/webhook-send.sh --list.
webhook:send:
desc: Send a test event to the dashboard's capture intake (--help for kinds)
cmds:
- bash tools/webhook-send.sh {{.CLI_ARGS}}
dev:
desc: "Develop: archied live-reload + archie-gateway + archie-state-store + archie-ui + Vite HMR together. Open http://localhost:5173"
summary: |
+52
View File
@@ -0,0 +1,52 @@
# Dashboard live state
**Status:** approved for implementation (2026-09-20)
## Decision
The dashboard must not require passive **Refresh** buttons. One app-wide Pinia
store owns the existing `/events` EventSource and translates backend events
into resource revision counters. Pages load their authoritative HTTP projection
on entry and re-read it when the relevant revision changes. Event payloads are
invalidation signals, not substitute read models.
SSE remains the transport. Dashboard updates are server-to-client only, and the
existing stream already provides replay, reconnect, and persisted ordering; a
WebSocket would add a second transport without adding a capability.
The first slice covers resources for which the backend already emits a truthful
signal:
- task events invalidate the dashboard, task board, workflow statistics, and
the matching task-run page;
- capture events invalidate the capture list;
- curator events invalidate curator status, and curator actions also invalidate
the skill catalogue;
- update reports invalidate System status;
- opening a page always loads its resource, and reopening the SSE stream
invalidates mounted projections after a connection loss.
Logs retain their dedicated SSE tail. Local mutations continue to re-read their
own resource after success. Configuration, channels, and catalogues that have no
backend change event load on route entry; future write contracts must emit an
owner-specific event rather than introduce polling or restore a button.
## Boundaries
The Pinia store owns browser connection state and invalidation only. It does not
become an alternate backend cache or copy domain state into a generic global
object. Existing feature modules continue to own their DTOs and API reads.
Operational commands are not refresh controls. Channel **Reload** remains an
explicit adapter lifecycle action. Authentication recovery is also not a data
refresh: a 401 moves the application into shared authentication state; reloading
the same URL cannot restore Archie's missing or rotated token and must not be
offered as a fix.
## Verification
- No passive page action renders the label **Refresh** or **Retry** for a read.
- Only one shared `/events` EventSource is opened by the application.
- Resource classification tests distinguish task, capture, curator, skill, and
update invalidations.
- UI tests, type checking, generated asset freshness, and `task check` pass.
+151
View File
@@ -0,0 +1,151 @@
#!/usr/bin/env bash
# Send a test event to the daemon's capture intake and report what landed.
#
# The intake is POST /webhooks/capture/{source} (see
# docs/prds/event-capture-storage.md): it bypasses the dashboard token, redacts
# the headers and body it stores, and the Event inspector reads it back. A
# payload whose shape a field mapping knows is what makes the rest of the
# Events chain (mapping -> binding -> dispatched task) testable by hand.
#
# Usage:
# tools/webhook-send.sh # one generic JSON event
# tools/webhook-send.sh --kind github-issue # realistic GitHub issues delivery
# tools/webhook-send.sh --kind sentry --source sentry-prod
# tools/webhook-send.sh --body '{"a":1}' # an exact payload
# tools/webhook-send.sh --file /tmp/event.json
# tools/webhook-send.sh --count 5 --delay 0.5
# tools/webhook-send.sh --list # what each kind sends, and exit
#
# Environment:
# ARCHIE_URL dashboard base URL (default http://127.0.0.1:8484)
#
# Limits the intake enforces (defaults from [capture] in config.example.toml):
# rate 1/s per remote address, burst 5 -> a fast --count > 5 needs --delay
# bodies over 256 KiB are rejected with 413
# Both are per-daemon-configurable, so a 429/413 here is the daemon's policy,
# not a broken sender.
set -euo pipefail
BASE_URL="${ARCHIE_URL:-http://127.0.0.1:8484}"
SOURCE="manual-test"
KIND="generic"
COUNT=1
DELAY=0
BODY=""
FILE=""
QUIET=0
usage() {
sed -n '2,20p' "$0" | sed 's/^# \{0,1\}//'
}
list_kinds() {
cat <<'KINDS'
Kinds (what each one posts):
generic {"hello":"world","n":1} small JSON
github-issue GitHub "issues" delivery (action/issue/repository/sender)
github-push GitHub "push" delivery (ref/repository/commits/pusher)
sentry Sentry "issue created" delivery
form application/x-www-form-urlencoded body
large ~64 KB JSON, to exercise the intake's body bound
empty no body at all
KINDS
}
while [ $# -gt 0 ]; do
case "$1" in
--source) SOURCE="${2:?--source needs a value}"; shift 2 ;;
--kind) KIND="${2:?--kind needs a value}"; shift 2 ;;
--count) COUNT="${2:?--count needs a value}"; shift 2 ;;
--delay) DELAY="${2:?--delay needs a value}"; shift 2 ;;
--body) BODY="${2:?--body needs a value}"; shift 2 ;;
--file) FILE="${2:?--file needs a value}"; shift 2 ;;
--url) BASE_URL="${2:?--url needs a value}"; shift 2 ;;
--quiet) QUIET=1; shift ;;
--list) list_kinds; exit 0 ;;
-h|--help) usage; exit 0 ;;
*) echo "unknown argument: $1" >&2; echo >&2; usage >&2; exit 2 ;;
esac
done
# A body from --body or --file wins over --kind: the caller is testing an exact
# payload, not a shape.
CONTENT_TYPE="application/json"
if [ -n "$BODY" ]; then
PAYLOAD="$BODY"
elif [ -n "$FILE" ]; then
PAYLOAD="$(cat "$FILE")"
else
case "$KIND" in
generic) PAYLOAD='{"hello":"world","n":1}' ;;
github-issue)
PAYLOAD='{"action":"opened","issue":{"number":42,"title":"Test issue from webhook-send.sh","body":"Filed by tools/webhook-send.sh.","html_url":"https://github.com/samcharles93/archie-core/issues/42"},"repository":{"full_name":"samcharles93/archie-core","html_url":"https://github.com/samcharles93/archie-core"},"sender":{"login":"webhook-send"}}'
;;
github-push)
PAYLOAD='{"ref":"refs/heads/main","repository":{"full_name":"samcharles93/archie-core","html_url":"https://github.com/samcharles93/archie-core"},"commits":[{"id":"c0ffee1","message":"Test commit from webhook-send.sh"}],"pusher":{"name":"webhook-send"}}'
;;
sentry)
PAYLOAD='{"action":"created","data":{"issue":{"title":"Test error from webhook-send.sh","culprit":"app/main.go"}},"project":"archie"}'
;;
form)
CONTENT_TYPE="application/x-www-form-urlencoded"
PAYLOAD='event=test&source=webhook-send.sh&detail=nothing-to-see'
;;
large)
# ~64 KB of filler inside a valid JSON string.
PAYLOAD="$(printf '{"filler":"'; head -c 65536 /dev/zero | tr '\0' 'x'; printf '"}')"
;;
empty) PAYLOAD="" ;;
*) echo "unknown kind: $KIND" >&2; echo >&2; list_kinds >&2; exit 2 ;;
esac
fi
send_one() {
local url="${BASE_URL%/}/webhooks/capture/${SOURCE}"
local code
if [ -n "$PAYLOAD" ]; then
code="$(curl -sS -o /tmp/webhook-send.out -w '%{http_code}' \
-X POST "$url" -H "Content-Type: ${CONTENT_TYPE}" --data-binary "$PAYLOAD")" || {
echo "cannot reach ${BASE_URL} — is the daemon running? (task dev, or archied)" >&2
return 1
}
else
code="$(curl -sS -o /tmp/webhook-send.out -w '%{http_code}' \
-X POST "$url" -H "Content-Type: ${CONTENT_TYPE}")" || {
echo "cannot reach ${BASE_URL} — is the daemon running? (task dev, or archied)" >&2
return 1
}
fi
if [ "$code" -eq 429 ]; then
echo "POST ${url} -> 429: the intake's rate limit (default 1/s, burst 5 per address)." >&2
echo "Space sends out with --delay 1, or raise [capture] rate_per_second / rate_burst." >&2
return 1
fi
if [ "$code" -eq 413 ]; then
echo "POST ${url} -> 413: body over [capture] max_body_bytes (default 256 KiB)." >&2
return 1
fi
if [ "$code" -lt 200 ] || [ "$code" -ge 300 ]; then
echo "POST ${url} -> ${code}: $(cat /tmp/webhook-send.out)" >&2
return 1
fi
[ "$QUIET" -eq 1 ] || echo "POST ${url} -> ${code} (source: ${SOURCE}, kind: ${KIND})"
}
i=0
while [ "$i" -lt "$COUNT" ]; do
send_one
i=$((i + 1))
[ "$i" -lt "$COUNT" ] && [ "$DELAY" != "0" ] && sleep "$DELAY"
done
# Read it back, so a silent drop is visible here rather than only in the UI.
if [ "$QUIET" -eq 0 ]; then
sleep 0.3
echo
echo "Latest captures:"
curl -sS "${BASE_URL%/}/api/captures?limit=${COUNT}" \
| tr ',' '\n' | grep -E '"id"|"source"|"received_at"|"content_type"' | sed 's/^ *//' | head -20
echo
echo "Open ${BASE_URL%/}/captures to inspect them."
fi
+1 -1
View File
@@ -1,2 +1,2 @@
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scrollbar-thumb:#0000;--tw-scrollbar-track:#0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-md:10px;--radius-4xl:2rem;--shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2sLine truncated
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scrollbar-thumb:#0000;--tw-scrollbar-track:#0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-md:10px;--radius-4xl:2rem;--shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2sLine truncated
+10 -11
View File
@@ -1,20 +1,19 @@
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),ee=e=>T(e).slice(8,-1),te=e=>T(e)===`[object Object]`,ne=e=>b(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,re=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ie=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ae=/-\w/g,oe=ie(e=>e.replace(ae,e=>e.slice(1).toUpperCase())),se=/\B([A-Z])/g,ce=ie(e=>e.replace(se,`-$1`).toLowerCase()),le=ie(e=>e.charAt(0).toUpperCase()+e.slice(1)),E=ie(e=>e?`on${le(e)}`:``),ue=(e,t)=>!Object.is(e,t),de=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},fe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},pe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},me=e=>{let t=b(e)?Number(e):NaN;return isNaN(t)?e:t},he,ge=()=>he||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},_e=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 ve(e){if(m(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=b(r)?Se(r):ve(r);if(i)for(let e in i)t[e]=i[e]}return t}if(b(e)||S(e))return e}var ye=/;(?![^(]*\))/g,be=/:([^]+)/,xe=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Se(e){let t={};return e.replace(xe,e=>e.startsWith(`/*`)?``:e).split(ye).forEach(e=>{if(e){let n=e.split(be);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function D(e){let t=``;if(b(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){let r=D(e[n]);r&&(t+=r+` `)}else if(S(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function Ce(e){if(!e)return null;let{class:t,style:n}=e;return t&&!b(t)&&(e.class=D(t)),n&&(e.style=ve(n)),e}var we=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Te=r(we);we+``;function Ee(e){return!!e||e===``}function De(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=je(e[i],t[i],n);return r}function Oe(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]&&je(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function ke(e,t,n){let r=h(e),i=h(t);if(r||i||(r=g(e),i=g(t),r||i))return r&&i?Oe(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||!je(e[r],t[r],n))return!1}return String(e)===String(t)}function Ae(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 je(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?Ae(e,t,n,De):!1:(r=S(e),i=S(t),r||i?!r||!i?!1:Ae(e,t,n,ke):String(e)===String(t))))}function Me(e,t){return e.findIndex(e=>je(e,t))}var Ne=e=>!!(e&&e.__v_isRef===!0),O=e=>b(e)?e:e==null?``:m(e)||S(e)&&(e.toString===w||!y(e.toString))?Ne(e)?O(e.value):JSON.stringify(e,Pe,2):String(e),Pe=(e,t)=>Ne(t)?Pe(e,t.value):h(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Fe(t,r)+` =>`]=n,e),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Fe(e))}:x(t)?FLine truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(ki(e,0)||yi(),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)&&!re(a)||a[0]===`.`||t&&!re(a)||u&&u.includes(a)){if(Ei(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&&cn(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Ns(x,n,t),h&&wr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ls(()=>{x&&Ns(x,n,t),l&&g.enter(e),h&&wr(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]=As(d[t]),g=h.type===fs;e?(g&&!u&&t+1<p&&As(d[t+1]).type===fs&&(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,ki(r,1)||yi()),n(null,h,r,null,o,s,Si(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&&Ci(f)&&f.data===`]`?a(t.anchor=f):(yi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(ji(e,t)||yi(),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,Si(d),c),r&&(r.vnode.el=t.el,So(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&Ci(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 Ti=new Set([`src`,`srcset`,`href`,`poster`]);function Ei(e,t,n){return Ti.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Di=`data-allow-mismatch`,Oi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function ki(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Di);)e=e.parentElement;return Ai(e&&e.getAttribute(Di),t)}function Ai(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Oi[t])}}function ji(e,t){return ki(e.parentElement,1)||Mi(e)||Ni(t)}function Mi(e){return e.nodeType===1&&Ai(e.getAttribute(Di),1)}function Ni({props:e}){let t=e&&e[Di];return typeof t==`string`&&Ai(t,1)}var Pi=ge().requestIdleCallback||(e=>setTimeout(e,1)),Fi=ge().cancelIdleCallback||(e=>clearTimeout(e)),Ii=(e=1e4)=>t=>{let n=Pi(t,{timeout:e});return()=>Fi(n)};function Li(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 Ri=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(Li(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},zi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Bi=(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 Vi(e,t){if(Ci(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Ci(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Hi=e=>!!e.type.__asyncLoader;function Ui(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 N({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=>Vi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ls;if(fi(e),u)return()=>Wi(u,e);let t=t=>{l=null,Xn(t,e,13,!r)};if(s&&e.suspense||Ws)return p().then(t=>()=>Wi(t,e)).catch(e=>(t(e),()=>r?V(r,{error:e}):null));let a=k(!1),c=k(),d=k(!!i),f,m;return sa(()=>{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&&Gi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Wi(u,e);if(c.value&&r)return V(r,{error:c.value});if(n&& Line truncated
`))),e[Gl]=Hl(i);let a=r||i.props&&i.props.type===`number`;ll(e,t?`change`:`input`,t=>{t.target.composing||e[Gl](ql(e.value,n,a))}),(n||a)&&ll(e,`change`,()=>{e.value=ql(e.value,n,a)}),t||(ll(e,`compositionstart`,Ul),ll(e,`compositionend`,Wl),ll(e,`change`,Wl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Kl];delete e[Kl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Gl](ql(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Gl]=Hl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?pe(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)}},Yl={deep:!0,created(e,t,n){e[Gl]=Hl(n),ll(e,`change`,()=>{let t=e._modelValue,n=tu(e),r=e.checked,i=e[Gl];if(m(t)){let e=Me(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(nu(e,r))})},mounted:Xl,beforeUpdate(e,t,n){e[Gl]=Hl(n),Xl(e,t,n)}};function Xl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Me(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=je(t,nu(e,!0))}e.checked!==i&&(e.checked=i)}var Zl={created(e,{value:t},n){e.checked=je(t,n.props.value),e[Gl]=Hl(n),ll(e,`change`,()=>{e[Gl](tu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Gl]=Hl(r),t!==n&&(e.checked=je(t,r.props.value))}},Ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ll(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?pe(tu(e)):tu(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[Gl](i)}finally{ar(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Gl]=Hl(r)},mounted(e,{value:t}){eu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Gl]=Hl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!$l(t,n[1],n[0]))&&eu(e,t)}};function $l(e,t,n){if(!n||m(e))return je(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 eu(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=tu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Me(t,o)>-1}else a.selected=t.has(o)}else if(je(tu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function tu(e){return`_value`in e?e._value:e.value}function nu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ru={created(e,t,n){au(e,t,n,null,`created`)},mounted(e,t,n){au(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){au(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){au(e,t,n,r,`updated`)}};function iu(e,t){switch(e){case`SELECT`:return Ql;case`TEXTAREA`:return Jl;default:switch(t){case`checkbox`:return Yl;case`radio`:return Zl;default:return Jl}}}function au(e,t,n,r,i){let a=iu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function ou(){Jl.getSSRProps=({value:e})=>({value:e}),Zl.getSSRProps=({value:e},t)=>{if(t.props&&je(t.props.value,e))return{checked:!0}},Yl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Me(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}},ru.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=iu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var su=[`ctrl`,`shift`,`alt`,`meta`],cu={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)=>su.some(n=>e[`${n}Key`]&&!t.includes(n))},lu=(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=cu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},uu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},du=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ce(n.key);if(t.some(e=>e===r||uu[e]===r))return e(n)}))},fu=u({patchProp:xl},xc),pu,mu=!1;function hu(){return pu||=Ho(fu)}function gu(){return pu=mu?pu:Uo(fu),mu=!0,pu}var _u=((...e)=>{hu().render(...e)}),vu=((...e)=>{gu().hydrate(...e)}),yu=((...e)=>{let t=hu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Su(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,xu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),bu=(( Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Op;function kp(e){Op=e}var Ap=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function jp(e){let t=e instanceof Ap?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Mp(e,t){let n=await fetch(e,t);if(Op?.(n.status===401),!n.ok)throw new Ap(await Dp(n),n.status);return n}async function Np(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Tp,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 Mp(e,s);return a?await c.json():void 0}var Y={summary:()=>Np(`/api/summary`),tasks:()=>Np(`/api/tasks`),taskMeta:()=>Np(`/api/task-meta`),task:e=>Np(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Np(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Np(`/api/tasks/${encodeURIComponent(e)}/changes`+Ep(t)),taskDebug:(e,t)=>Np(`/api/tasks/${encodeURIComponent(e)}/debug`+Ep(t)),taskAction:(e,t)=>Np(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>Np(`/api/setup`),capabilities:()=>Np(`/api/capabilities`),workflows:()=>Np(`/api/workflows`),workRequest:e=>Np(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Np(`/api/skills`),channels:()=>Np(`/api/channels`),curators:()=>Np(`/api/curators`),channelReload:e=>Np(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Np(`/api/config`),version:()=>Np(`/api/version`),configUpdate:e=>Np(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>Np(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>Np(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>Np(`/api/logs`+Ep(e)),taskLogs:(e,t)=>Np(`/api/tasks/${encodeURIComponent(e)}/logs`+Ep(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>Np(`/api/captures`+Ep({limit:e})),mappings:()=>Np(`/api/mappings`),mappingCreate:e=>Np(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Np(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Np(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Np(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Np(`/api/bindings`),bindingCreate:e=>Np(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Np(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Np(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Np(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>Np(`/api/chat/sessions`),chatMessages:e=>Np(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Np(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Np(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Np(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:wp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Np(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatUpdate:()=>Np(`/api/chat/update`),chatUpdateDefer:e=>Np(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),chatUpdateInstall:e=>Np(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:12e4}),chatDangerous:()=>Np(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Np(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Np(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Mp(`/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 Pp(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 Fp(e,t){let n=new EventSource(`/api/logs/stream`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(Cp(n.readyState)),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}var Ip=`archie.web.chat.channel`;function Lp(){let e=localStorage.getItem(Ip);return e||(e=wp(),localStorage.setItem(Ip,e)),e}var Rp=/(?:^|\s)\/([^\s]*)$/,zp=/(?:^|\s)\/[^\s]*$/,Bp=8;function Vp(e,t,n){let r=t.slice(0,n).match(Rp);if(!r)return[];let i=r[1].toLowerCase();return e.filter(e=>`${e.command} ${e.description??``}`.toLowerCase().includes(i)).slice(0,Bp)}function Hp(e,t,n){let r=e.slice(0,t),i=e.slice(t),a=r.search(zp),o=a<0?r.lengt Line truncated
`))),e[Gl]=Hl(i);let a=r||i.props&&i.props.type===`number`;ll(e,t?`change`:`input`,t=>{t.target.composing||e[Gl](ql(e.value,n,a))}),(n||a)&&ll(e,`change`,()=>{e.value=ql(e.value,n,a)}),t||(ll(e,`compositionstart`,Ul),ll(e,`compositionend`,Wl),ll(e,`change`,Wl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Kl];delete e[Kl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Gl](ql(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Gl]=Hl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?pe(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)}},Yl={deep:!0,created(e,t,n){e[Gl]=Hl(n),ll(e,`change`,()=>{let t=e._modelValue,n=tu(e),r=e.checked,i=e[Gl];if(m(t)){let e=Me(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(nu(e,r))})},mounted:Xl,beforeUpdate(e,t,n){e[Gl]=Hl(n),Xl(e,t,n)}};function Xl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(m(t))i=Me(t,r.props.value)>-1;else if(g(t))i=t.has(r.props.value);else{if(t===n)return;i=je(t,nu(e,!0))}e.checked!==i&&(e.checked=i)}var Zl={created(e,{value:t},n){e.checked=je(t,n.props.value),e[Gl]=Hl(n),ll(e,`change`,()=>{e[Gl](tu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Gl]=Hl(r),t!==n&&(e.checked=je(t,r.props.value))}},Ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ll(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?pe(tu(e)):tu(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[Gl](i)}finally{ar(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Gl]=Hl(r)},mounted(e,{value:t}){eu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Gl]=Hl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!$l(t,n[1],n[0]))&&eu(e,t)}};function $l(e,t,n){if(!n||m(e))return je(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 eu(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=tu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Me(t,o)>-1}else a.selected=t.has(o)}else if(je(tu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function tu(e){return`_value`in e?e._value:e.value}function nu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ru={created(e,t,n){au(e,t,n,null,`created`)},mounted(e,t,n){au(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){au(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){au(e,t,n,r,`updated`)}};function iu(e,t){switch(e){case`SELECT`:return Ql;case`TEXTAREA`:return Jl;default:switch(t){case`checkbox`:return Yl;case`radio`:return Zl;default:return Jl}}}function au(e,t,n,r,i){let a=iu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function ou(){Jl.getSSRProps=({value:e})=>({value:e}),Zl.getSSRProps=({value:e},t)=>{if(t.props&&je(t.props.value,e))return{checked:!0}},Yl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&Me(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}},ru.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=iu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var su=[`ctrl`,`shift`,`alt`,`meta`],cu={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)=>su.some(n=>e[`${n}Key`]&&!t.includes(n))},lu=(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=cu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},uu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},du=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ce(n.key);if(t.some(e=>e===r||uu[e]===r))return e(n)}))},fu=u({patchProp:xl},xc),pu,mu=!1;function hu(){return pu||=Ho(fu)}function gu(){return pu=mu?pu:Uo(fu),mu=!0,pu}var _u=((...e)=>{hu().render(...e)}),vu=((...e)=>{gu().hydrate(...e)}),yu=((...e)=>{let t=hu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Su(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,xu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),bu=(( Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Dp;function Op(e){Dp=e}var kp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Ap(e){let t=e instanceof kp?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function jp(e,t){let n=await fetch(e,t);if(Dp?.(n.status===401),!n.ok)throw new kp(await Ep(n),n.status);return n}async function Mp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=wp,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await jp(e,s);return a?await c.json():void 0}var Y={health:()=>Mp(`/health/detailed`),summary:()=>Mp(`/api/summary`),tasks:()=>Mp(`/api/tasks`),taskMeta:()=>Mp(`/api/task-meta`),task:e=>Mp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Mp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/changes`+Tp(t)),taskDebug:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/debug`+Tp(t)),taskAction:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>Mp(`/api/setup`),capabilities:()=>Mp(`/api/capabilities`),workflows:()=>Mp(`/api/workflows`),workRequest:e=>Mp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Mp(`/api/skills`),channels:()=>Mp(`/api/channels`),curators:()=>Mp(`/api/curators`),channelReload:e=>Mp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Mp(`/api/config`),configUpdate:e=>Mp(`/api/config`,{method:`PATCH`,body:{updates:e}}),configRepoUpdate:(e,t,n,r)=>Mp(`/api/config/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:{field:n,value:r}}),configReset:e=>Mp(`/api/config/reset`,{method:`POST`,body:{key:e}}),logs:e=>Mp(`/api/logs`+Tp(e)),taskLogs:(e,t)=>Mp(`/api/tasks/${encodeURIComponent(e)}/logs`+Tp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),captures:e=>Mp(`/api/captures`+Tp({limit:e})),mappings:()=>Mp(`/api/mappings`),mappingCreate:e=>Mp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Mp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Mp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Mp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Mp(`/api/bindings`),bindingCreate:e=>Mp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Mp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Mp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Mp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),chatSessions:()=>Mp(`/api/chat/sessions`),chatMessages:e=>Mp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Mp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Mp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Mp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Cp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Mp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>Mp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Mp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Mp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>jp(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})};function Np(e,t){let n=new EventSource(`/events`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(`reconnecting`),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}function Pp(e,t){let n=new EventSource(`/api/logs/stream`);return n.onopen=()=>t?.(`live`),n.onerror=()=>t?.(Sp(n.readyState)),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()}var Fp=`archie.web.chat.channel`;function Ip(){let e=localStorage.getItem(Fp);return e||(e=Cp(),localStorage.setItem(Fp,e)),e}var Lp=/(?:^|\s)\/([^\s]*)$/,Rp=/(?:^|\s)\/[^\s]*$/,zp=8;function Bp(e,t,n){let r=t.slice(0,n).match(Lp);if(!r)return[];let i=r[1].toLowerCase();return e.filter(e=>`${e.command} ${e.description??``}`.toLowerCase().includes(i)).slice(0,zp)}function Vp(e,t,n){let r=e.slice(0,t),i=e.slice(t),a=r.search(Rp),o=a<0?r.length:a+ +(r[a]===` `);return{text:`${r.slice(0,o)}${n} ${i}`,cursor:o+n.length+1}}function Hp(e,t){let n=t.trim();return e.some(e=>e.command===n)}function Up(e){return{text:e,sourceID:Cp()}}function Wp(e){return{...e}}fun Line truncated
`);u=r.pop()||``;for(let e of r){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Xp.value=n.session_id),n.type===`delta`&&(o+=n.text,tm.value=tm.value?{...tm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],tm.value=tm.value?{...tm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);Zp.value=[...Zp.value,{from:`assistant`,text:o,tool_calls:a}],tm.value=null,$p.value=`Ready`,await gm()}catch(e){let t=e;t.name===`AbortError`&&!c?(tm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},$p.value=`Stopped`):(tm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Gp(r):void 0,isRetry:i},$p.value=`Error — retry available`)}finally{clearTimeout(l),mm=null,em.value=!1}}function km(){$p.value=`Stopping…`,Xp.value&&Y.chatCancel(Xp.value).catch(()=>{}),hm()}function Am(){ra(()=>{gm().catch(e=>{$p.value=e.message||`Chat unavailable`})}),sa(()=>{hm()})}var jm=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Mm=N({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return J(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(L(),R(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full bg-linear-to-br from-primary to-[var(--brand-alt)] text-primary-foreground shadow-[var(--shadow-md)] transition-[transform,box-shadow] duration-[140ms] hover:-translate-y-px hover:shadow-[0_12px_34px_var(--primary-soft)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":A(qp),onClick:i[0]||=e=>n(`toggle`)},[B(`span`,{"aria-hidden":`true`,class:D(r(!e.open))},[V(A(Md),{size:22})],2),B(`span`,{"aria-hidden":`true`,class:D(r(e.open))},[V(A(qd),{size:22})],2)],8,jm))}});function Nm(e){return typeof e==`string`?`'${e}'`:new Lm().serialize(e)}var Pm=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Fm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Pm.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Im(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Fm[n]?Fm[n]:n+128,s=a<128&&Fm[a]?Fm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Lm=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Im(e,t):n===`number`&&r===`number`?e-t:Im(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Im),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`InLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Yp.value=n.session_id),n.type===`delta`&&(o+=n.text,em.value=em.value?{...em.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],em.value=em.value?{...em.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);Xp.value=[...Xp.value,{from:`assistant`,text:o,tool_calls:a}],em.value=null,Qp.value=`Ready`,await hm()}catch(e){let t=e;t.name===`AbortError`&&!c?(em.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Qp.value=`Stopped`):(em.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Wp(r):void 0,isRetry:i},Qp.value=`Error — retry available`)}finally{clearTimeout(l),pm=null,$p.value=!1}}function Om(){Qp.value=`Stopping…`,Yp.value&&Y.chatCancel(Yp.value).catch(()=>{}),mm()}function km(){ra(()=>{hm().catch(e=>{Qp.value=e.message||`Chat unavailable`})}),sa(()=>{mm()})}var Am=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],jm=N({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return J(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(L(),R(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full bg-linear-to-br from-primary to-[var(--brand-alt)] text-primary-foreground shadow-[var(--shadow-md)] transition-[transform,box-shadow] duration-[140ms] hover:-translate-y-px hover:shadow-[0_12px_34px_var(--primary-soft)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":A(Kp),onClick:i[0]||=e=>n(`toggle`)},[B(`span`,{"aria-hidden":`true`,class:D(r(!e.open))},[V(A(jd),{size:22})],2),B(`span`,{"aria-hidden":`true`,class:D(r(e.open))},[V(A(Kd),{size:22})],2)],8,Am))}});function Mm(e){return typeof e==`string`?`'${e}'`:new Im().serialize(e)}var Nm=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Pm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Nm.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Fm(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Pm[n]?Pm[n]:n+128,s=a<128&&Pm[a]?Pm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Im=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Fm(e,t):n===`number`&&r===`number`?e-t:Fm(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Fm),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`InLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?ic(t.default({present:o.value})[0],{ref:e=>{let t=gh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Sg=N({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Th(n.default()),r=e.findIndex(e=>e.type!==ps);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?W(t,i.props):t,o=Os({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Cg=[`area`,`img`,`input`],Z=N({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`&&Cg.includes(r)?()=>ic(r,t):r===`template`?()=>ic(Sg,t,{default:n.default}):()=>ic(e.as,t,{default:n.default})}});function wg(){let e=k();return{primitiveElement:e,currentElement:G(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:gh(e))}}function Tg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Eg({type:e,defaultValue:t,modelValue:n}){return e||Tg({type:e,defaultValue:t,modelValue:n})}function Dg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Og(e,t){let n=G(()=>Eg(e)),r=wh(e,`modelValue`,t,{defaultValue:Dg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Rm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Wm(t,e)){let n=t.findIndex(t=>Rm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:G(()=>n.value===`single`)}}var[kg,Ag]=Bm(`DialogRoot`),jg=N({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=wh(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=k(),a=k(),{modal:o,unmountOnHide:s}=En(n);return Ag({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>F(e.$slots,`default`,{open:A(r),close:()=>r.value=!1})}}),Mg=N({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;X();let n=kg();return(e,r)=>(L(),z(A(Z),W(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>A(n).onOpenChange(!1)}),{default:j(()=>[F(e.$slots,`default`)]),_:3},16,[`type`]))}}),Ng=`dismissableLayer.pointerDownOutside`,Pg=`dismissableLayer.focusOutside`;function Fg(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 Ig(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=k(!1),a=k(()=>{});return Ar(o=>{if(!Jm||!xn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(Fg(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Hm(Ng,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:()=>{xn(n)&&(i.value=!0)}}}function Lg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=k(!1);return Ar(a=>{if(!Jm||!xn(n))return;let o=async n=>{if(!t?.value)return;await ar(),await ar();let r=n.target;t.value&&r&&!Fg(t.value,r)&&n.target&&!i.value&&Hm(Pg,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{xn(n)&&(i.value=!0)},onBlurCapture:()=>{xn(n)&&(i.value=!1)}}}var Rg=N({__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}=X(),o=G(()=>a.value?.ownerDocument??globalThis.document),s=G(()=>jh.layersRoot),c=G(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=G(()=>jh.layersWithOutsidePointerEventsDisabled.size>0),u=G(()=>{let e=Array.from(s.value),[t]=[...jh.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Ig Line truncated
`))}return()=>i.value||r.value||o.value?ic(t.default({present:o.value})[0],{ref:e=>{let t=hh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),xg=N({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=wh(n.default()),r=e.findIndex(e=>e.type!==ps);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?W(t,i.props):t,o=Os({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Sg=[`area`,`img`,`input`],Z=N({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Sg.includes(r)?()=>ic(r,t):r===`template`?()=>ic(xg,t,{default:n.default}):()=>ic(e.as,t,{default:n.default})}});function Cg(){let e=k();return{primitiveElement:e,currentElement:G(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:hh(e))}}function wg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Tg({type:e,defaultValue:t,modelValue:n}){return e||wg({type:e,defaultValue:t,modelValue:n})}function Eg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Dg(e,t){let n=G(()=>Tg(e)),r=Ch(e,`modelValue`,t,{defaultValue:Eg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Lm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Um(t,e)){let n=t.findIndex(t=>Lm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:G(()=>n.value===`single`)}}var[Og,kg]=zm(`DialogRoot`),Ag=N({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Ch(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=k(),a=k(),{modal:o,unmountOnHide:s}=En(n);return kg({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>F(e.$slots,`default`,{open:A(r),close:()=>r.value=!1})}}),jg=N({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;X();let n=Og();return(e,r)=>(L(),z(A(Z),W(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>A(n).onOpenChange(!1)}),{default:j(()=>[F(e.$slots,`default`)]),_:3},16,[`type`]))}}),Mg=`dismissableLayer.pointerDownOutside`,Ng=`dismissableLayer.focusOutside`;function Pg(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function Fg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=k(!1),a=k(()=>{});return Ar(o=>{if(!qm||!xn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(Pg(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Vm(Mg,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{xn(n)&&(i.value=!0)}}}function Ig(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=k(!1);return Ar(a=>{if(!qm||!xn(n))return;let o=async n=>{if(!t?.value)return;await ar(),await ar();let r=n.target;t.value&&r&&!Pg(t.value,r)&&n.target&&!i.value&&Vm(Ng,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{xn(n)&&(i.value=!0)},onBlurCapture:()=>{xn(n)&&(i.value=!1)}}}var Lg=N({__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}=X(),o=G(()=>a.value?.ownerDocument??globalThis.document),s=G(()=>Ah.layersRoot),c=G(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=G(()=>Ah.layersWithOutsidePointerEventsDisabled.size>0),u=G(()=>{let e=Array.from(s.value),[t]=[...Ah.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Fg Line truncated
- a positive number
- less than the value passed to \`max\` (or ${Tx} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${wx} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function Ax(e){return Ox(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 \`${Tx}\`.`),Tx)}var jx=N({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Tx},getValueLabel:{type:Function,required:!1,default:(e,t)=>Ox(e)?`${Math.round(e/t*Tx)}%`: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;X();let i=wh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=wh(n,`max`,r,{passive:n.max===void 0});M(()=>i.value,async e=>{let t=kx(e,n.max);t!==e&&(await ar(),i.value=t)},{immediate:!0}),M(()=>n.max,e=>{let t=Ax(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=G(()=>Um(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Dx({modelValue:i,max:a,progressState:o}),(e,t)=>(L(),z(A(Z),{"as-child":e.asChild,as:e.as,"aria-valuemax":A(a),"aria-valuemin":0,"aria-valuenow":Ox(A(i))?A(i):void 0,"aria-valuetext":e.getValueText?.(A(i),A(a)),"aria-label":e.getValueLabel(A(i),A(a)),role:`progressbar`,"data-state":o.value,"data-value":A(i)??void 0,"data-max":A(a)},{default:j(()=>[F(e.$slots,`default`,{modelValue:A(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),Mx=N({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Ex();return X(),(e,r)=>(L(),z(A(Z),W(t,{"data-state":A(n).progressState.value,"data-value":A(n).modelValue?.value??void 0,"data-max":A(n).max.value}),{default:j(()=>[F(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),[Nx,Px]=Bm(`ScrollAreaRoot`),Fx=N({__name:`ScrollAreaRoot`,props:{type:{type:String,required:!1,default:`hover`},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=k(0),i=k(0),a=k(),o=k(),s=k(),c=k(),l=k(!1),u=k(!1),{type:d,dir:f,scrollHideDelay:p}=En(n),m=Bh(f);function h(){a.value?.scrollTo({top:0})}function g(){a.value?.scrollTo({top:0,left:0})}t({viewport:a,scrollTop:h,scrollTopLeft:g});let{forwardRef:_,currentElement:v}=X();return Px({type:d,dir:m,scrollHideDelay:p,scrollArea:v,viewport:a,onViewportChange:e=>{a.value=e||void 0},content:o,onContentChange:e=>{o.value=e},scrollbarX:s,scrollbarXEnabled:l,scrollbarY:c,scrollbarYEnabled:u,onScrollbarXChange:e=>{s.value=e||void 0},onScrollbarYChange:e=>{c.value=e||void 0},onScrollbarXEnabledChange:e=>{l.value=e},onScrollbarYEnabledChange:e=>{u.value=e},onCornerWidthChange:e=>{r.value=e},onCornerHeightChange:e=>{i.value=e}}),(e,t)=>(L(),z(A(Z),{ref:A(_),"as-child":n.asChild,as:e.as,dir:A(m),style:ve({position:`relative`,"--reka-scroll-area-corner-width":`${r.value}px`,"--reka-scroll-area-corner-height":`${i.value}px`})},{default:j(()=>[F(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`dir`,`style`]))}}),Ix=N({__name:`ScrollAreaCornerImpl`,setup(e){let t=Nx(),n=k(0),r=k(0),i=G(()=>!!n.value&&!!r.value);function a(){let e=t.scrollbarX.value?.offsetHeight||0;t.onCornerHeightChange(e),r.value=e}function o(){let e=t.scrollbarY.value?.offsetWidth||0;t.onCornerWidthChange(e),n.value=e}return Ch(t.scrollbarX.value,a),Ch(t.scrollbarY.value,o),M(()=>t.scrollbarX.value,a),M(()=>t.scrollbarY.value,o),(e,a)=>i.value?(L(),z(A(Z),W({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:`absolute`,right:A(t).dir.value===`ltr`?0:void 0,left:A(t).dir.value===`rtl`?0:void 0,bottom:0}},e.$parent?.$props),{default:j(()=>[F(e.$slots,`default`)]),_:3},16,[`style`])):U(`v-if`,!0)}}),Lx=N({__name:`ScrollAreaCorner`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=X(),r=Nx(),i=G(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),a=G(()=>r.type.value!==`scroll`&&i.value);return(e,r)=>a.value?(L(),z(Ix,W({key:0},t,{ref:A(n)}),{default:j(()=>[F(e.$slots,`default`)]),_:3},16)):U(`v-if`,!0)}});function Rx(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function zx(e){let t=Bx(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Bx(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Vx(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Hx(e,t,n=`ltr`){let r=zx(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=zm(e,c[0],c[1]);return Rx([0,o],[0,s])(l)}functLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:wT(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>wT(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=ET(c),u=e+1<n.length?ET(n[e+1]):null;if(l&&u&&DT(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=ET(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>wT(e)),rows:r.map(e=>e.map(e=>wT(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:wT(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:wT(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function ET(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function DT(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var OT={class:`[overflow-wrap:anywhere]`},kT={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},AT={class:`font-mono text-[0.85em]`},jT={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},MT={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},NT={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},PT={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},FT={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},IT={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},LT={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},RT={key:8,class:`mb-2.5 last:mb-0`},zT=N({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=G(()=>TT(t.text));return(e,t)=>(L(),R(`div`,OT,[(L(!0),R(I,null,P(n.value,(e,t)=>(L(),R(I,{key:t},[e.kind===`pre`?(L(),R(`pre`,kT,[B(`code`,AT,O(e.code),1)])):e.kind===`table`?(L(),R(`table`,jT,[B(`thead`,null,[B(`tr`,null,[(L(!0),R(I,null,P(e.head,(e,t)=>(L(),R(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[V(ST,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(L(!0),R(I,null,P(e.rows,(e,t)=>(L(),R(`tr`,{key:t},[(L(!0),R(I,null,P(e,(e,t)=>(L(),R(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[V(ST,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),R(`blockquote`,MT,[V(ST,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),R(`h1`,NT,[V(ST,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),R(`h2`,PT,[V(ST,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),R(`h3`,FT,[V(ST,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),R(`ul`,IT,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(ST,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),R(`ol`,LT,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(ST,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),R(`p`,RT,[V(ST,{inline:e.inline},null,8,[`inline`])])):U(``,!0)],64))),128))]))}}),BT={class:`truncate`},VT=N({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ma(`RouterLink`);return L(),z(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:j(()=>[V(A(yd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,BT,O(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),HT={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},UT={class:`font-semibold text-foreground`},WT={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},GT=N({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=G(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=G(()=>t.tool.parameters||t.tool.Parameters||``),i=G(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=G(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(L(),z(VT,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(L(),R(`div`,HT,[V(A(Kd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,UT,O(n.value),1),r.value?(L(),R(`code`,WT,O(r.value),1)):U(``,!0),B(`span`,{class:D(A(J)(`text-fg-muted`,i.value&&`text-danger`))},O(a.value),3)]))}}),KT={key:0,class:`mb-2 grid gap-0.5 text-xs`},qT={key:2,class:`whitespace-pre-wrap`},JT=N({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(L(),R(`div`,{class:D([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:D(A(J)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(L(),R(`div`,KT,[(L(!0),R(I,null,P(e.tools,(t,n)=>(L(),z(GT,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):U(``,!0),e.assistant?(L(),z(zT,{key:1,text:e.text},null,8,[`text`])):(L(),R(`div`,qT,O(e.text),1)),F(t.$slots,`default`)],2)],2))}}),YT={class:`w-full self-center justify-self-center py-6 text-center`},XT={class:`grid gap-2`},ZT=[`onClick`],QT=N({__name:`ChatEmptyState`,emits:[`prompt`],setup(e,{emit:t}){let n=t,r=[`Summarise active tasks`,`Show running agents`,`Check system status`];return(e,t)=>(L(),R(`div`,YT,[t[0]||=B(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 placLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>lj?`${n.slice(0,lj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var dj=[`title`],fj=N({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>PA(n.event)),a=G(()=>uj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=G(()=>n.event.at?Pk(n.event.at):`—`);return(e,t)=>(L(),z(A(ik),{class:D(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[du(lu(o,[`prevent`]),[`enter`]),du(lu(o,[`prevent`]),[`space`])]},{default:j(()=>[V(A(Q),{class:`font-medium`},{default:j(()=>[H(O(n.event.kind||n.event.type||`event`),1)]),_:1}),V(A(Q),{class:`font-mono`},{default:j(()=>[H(O(i.value>0?`#${i.value}`:`—`),1)]),_:1}),V(A(Q),{class:`w-[55%] max-w-0`},{default:j(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},O(a.value.text),9,dj)]),_:1}),V(A(Q),null,{default:j(()=>[H(O(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),pj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},mj=N({__name:`LiveActivityCard`,setup(e){let t=xE(),{activity:n,streamKind:r,streamState:i}=ad(gO());function a(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(L(),z(A(zO),null,{default:j(()=>[V(A(WO),null,{default:j(()=>[V(A(GO),null,{default:j(()=>[...t[0]||=[H(`Live activity`,-1)]]),_:1}),V(A(HO),null,{default:j(()=>[...t[1]||=[H(`Last 50, newest first`,-1)]]),_:1}),V(A(BO),null,{default:j(()=>[V(A(ok),{variant:A(r)},{default:j(()=>[H(O(A(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),V(A(VO),null,{default:j(()=>[B(`div`,pj,[V(A(nk),null,{default:j(()=>[V(A(ak),null,{default:j(()=>[V(A(ik),null,{default:j(()=>[V(A($),null,{default:j(()=>[...t[2]||=[H(`Event`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...t[3]||=[H(`Task`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...t[4]||=[H(`Detail`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...t[5]||=[H(`When`,-1)]]),_:1})]),_:1})]),_:1}),V(A(rk),null,{default:j(()=>[A(n).length?(L(!0),R(I,{key:1},P(A(n),(e,t)=>(L(),z(fj,{key:t,event:e,onOpen:a},null,8,[`event`]))),128)):(L(),z(A(ik),{key:0},{default:j(()=>[V(A(Q),{colspan:`4`},{default:j(()=>[V(A(KO),null,{default:j(()=>[V(A(YO),null,{default:j(()=>[V(A(QO),null,{default:j(()=>[...t[6]||=[H(`Waiting for activity`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})])]),_:1})]),_:1}))}}),hj=N({__name:`Progress`,props:{modelValue:{default:0},max:{},getValueLabel:{},getValueText:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=DC(t,`class`);return(e,r)=>(L(),z(A(jx),W({"data-slot":`progress`},A(n),{class:A(J)(`bg-muted h-1 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class)}),{default:j(()=>[V(A(Mx),{"data-slot":`progress-indicator`,class:`bg-primary size-full flex-1 transition-all`,style:ve(`transform: translateX(-${100-(t.modelValue??0)}%);`)},null,8,[`style`])]),_:1},16,[`class`]))}}),gj=`archie.setup-complete.dismissed.v1`;function _j(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?.(gj),{kind:`incomplete`,remaining:n}):t?.getItem?.(`archie.setup-complete.dismissed.v1`)===`1`?{kind:`dismissed`,remaining:[]}:{kind:`complete`,remaining:[]}}function vj(e=globalThis.localStorage){e?.setItem?.(gj,`1`)}var yj={class:`text-lg font-semibold text-link`},bj={class:`flex flex-col gap-3`},xj={key:0,class:`mt-0.5 text-xs text-fg-subtle`},Sj=N({__name:`SetupPanel`,setup(e){let t=k(_j(DA.value));M(DA,()=>{t.value=_j(DA.value)});let n=G(()=>DA.value?.steps??[]),r=G(()=>{let e=n.value.length;return e?Math.round((e-t.value.remaining.length)/e*100):0});function i(){vj(),t.value=_j(DA.value)}return(e,a)=>t.value.kind===`incomplete`?(L(),z(A(zO),{key:0},{default:j(()=>[V(A(WO),null,{default:j(()=>[V(A(GO),null,{default:j(()=>[...a[0]||=[H(`Finish setting up`,-1)]]),_:1}),V(A(HO),null,{default:j(()=>[...a[1]||=[H(`Archie needs these before it can work on its own.`,-1)]]),_:1}),V(A(BO),null,{default:j(()=>[B(`span`,yj,O(r.value)+`%`,1)]),_:1})]),_:1}),V(A(VO),null,{default:j(()=>[V(A(hj),{"model-value":r.value,class:`mb-4`},null,8,[`model-value`]),B(`ul`,bj,[(L(!0),R(I,null,P(n.value,(e,t)=>(L(),R(`li`,{key:t,class:`flex items-start gap-3`},[B(`span`,{class:D([`mt-px grid size-[18px] flex-none place-items-center rounded-full border-[1.5px] border-border-strong text-xs text-fg-subtle`,e.done?`border-transparent bg-ok-soft text-ok`:``])},[e.done?(L(),z(A(bd),{key:0,class:`size-3`})):U(``,!0)],2),B(`div`,null,[B(`div`,{class:D([`text-sm`,e.done?`text-fg-muted line-through`:``])},O(e.title),3),e.detail?(L(),R(`div`,xj,O(e.detail),1)):U(``,!0)])]))),128))])]),_:1})]),_:1})):t.value.kind===`complete`?(L(),z(A(zO),{key:1},{default:j(()=>[V(A(WO),null,{default:j(()=>[V(A(GO),null,{default:j(()=>[...a[2]||=[H(`Setup complete`,-1) Line truncated
`)}return(e,i)=>A(AP)?(L(),z(rP,{key:0,title:`Update status`,description:`Not configured on this deployment.`})):A(kP)?(L(),z(A(zO),{key:1,class:`mb-4`},{default:j(()=>[V(A(VO),null,{default:j(()=>[V(A(KO),null,{default:j(()=>[V(A(YO),null,{default:j(()=>[V(A(QO),null,{default:j(()=>[...i[0]||=[H(`Update status unavailable`,-1)]]),_:1}),V(A(JO),null,{default:j(()=>[H(O(A(kP)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):(L(),z(rP,{key:2,title:`Update status`,description:`Whether what's running matches what's installed.`},{default:j(()=>[A(OP).length?(L(),z(A(nk),{key:1},{default:j(()=>[V(A(ak),null,{default:j(()=>[V(A(ik),null,{default:j(()=>[V(A($),null,{default:j(()=>[...i[3]||=[H(`Component`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...i[4]||=[H(`Install type`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...i[5]||=[H(`Running`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...i[6]||=[H(`Latest available`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...i[7]||=[H(`Status`,-1)]]),_:1})]),_:1})]),_:1}),V(A(rk),null,{default:j(()=>[(L(!0),R(I,null,P(A(OP),e=>(L(),z(A(ik),{key:e.id||e.label,title:r(e)},{default:j(()=>[V(A(Q),{class:`font-medium`},{default:j(()=>[H(O(e.label||e.id),1)]),_:2},1024),V(A(Q),{class:`font-mono`},{default:j(()=>[H(O(e.install_type||`—`),1)]),_:2},1024),V(A(Q),{class:`font-mono`},{default:j(()=>[H(O(e.running_version||`—`),1)]),_:2},1024),V(A(Q),{class:`font-mono`},{default:j(()=>[H(O(e.latest_available||`—`),1)]),_:2},1024),V(A(Q),null,{default:j(()=>[V(A(ok),{variant:n[e.status||``]||`idle`},{default:j(()=>[H(O(t[e.status||``]||e.status),1)]),_:2},1032,[`variant`])]),_:2},1024)]),_:2},1032,[`title`]))),128))]),_:1})]),_:1})):(L(),z(A(KO),{key:0},{default:j(()=>[V(A(YO),null,{default:j(()=>[V(A(QO),null,{default:j(()=>[...i[1]||=[H(`No components reported`,-1)]]),_:1}),V(A(JO),null,{default:j(()=>[...i[2]||=[H(`The configured update-check command returned nothing.`,-1)]]),_:1})]),_:1})]),_:1}))]),_:1}))}}),WF=N({__name:`SystemStatusPage`,setup(e){async function t(){await Promise.all([DP(),jP(),NP()])}return _O(`updates`,()=>void t()),ra(t),(e,t)=>(L(),R(`div`,null,[V(lO,{title:`Status`}),V(gF),V(UF),V(HF),A(EP)?(L(),z(iF,{key:0})):(L(),R(I,{key:1},[V(RF),V(rF,{ids:A(QP)},null,8,[`ids`]),V(zF)],64))]))}}),GF=N({__name:`LifecycleActionList`,props:{actions:{}},setup(e){let t=e;function n(e){return e===`quiet`?`ghost`:e===`danger`?`destructive`:`outline`}return(e,r)=>(L(),R(I,null,[r[1]||=B(`h3`,{class:`mt-5 mb-2 text-sm font-semibold text-fg-muted`},`Actions`,-1),t.actions.length?(L(),z(aP,{key:1},{default:j(()=>[(L(!0),R(I,null,P(t.actions,e=>(L(),z(ZP,{key:e.id,label:e.id},{value:j(()=>[B(`span`,null,[V(A(GC),{variant:n(e.kind),size:`xs`,disabled:``},{default:j(()=>[H(O(e.label??e.id),1)]),_:2},1032,[`variant`])])]),_:2},1032,[`label`]))),128))]),_:1})):(L(),z(A(KO),{key:0},{default:j(()=>[V(A(YO),null,{default:j(()=>[V(A(QO),null,{default:j(()=>[...r[0]||=[H(`No actions reported`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),KF=N({__name:`LifecycleStatusList`,props:{statuses:{}},setup(e){let t=e;return(e,n)=>(L(),R(I,null,[n[1]||=B(`h3`,{class:`mt-5 mb-2 text-sm font-semibold text-fg-muted first:mt-0`},`Statuses`,-1),t.statuses.length?(L(),z(aP,{key:1},{default:j(()=>[(L(!0),R(I,null,P(t.statuses,e=>(L(),z(ZP,{key:e.id,label:e.id},{value:j(()=>[B(`span`,null,[V(A(ok),{variant:e.kind??A(Lj)(e.id)},{default:j(()=>[H(O(e.label??A(Ij)(e.id)),1)]),_:2},1032,[`variant`])])]),_:2},1032,[`label`]))),128))]),_:1})):(L(),z(A(KO),{key:0},{default:j(()=>[V(A(YO),null,{default:j(()=>[V(A(QO),null,{default:j(()=>[...n[0]||=[H(`No statuses reported`,-1)]]),_:1})]),_:1})]),_:1}))],64))}}),qF=N({__name:`LifecycleCard`,setup(e){let t=G(()=>BP.value?.statuses??[]),n=G(()=>BP.value?.actions??[]);return(e,r)=>A(VP)?(L(),z(rP,{key:0,title:`Work lifecycle`,description:`The task statuses and operator actions archied ships.`},{default:j(()=>[V(A(KO),null,{default:j(()=>[V(A(YO),null,{default:j(()=>[V(A(QO),null,{default:j(()=>[...r[0]||=[H(`Lifecycle unavailable`,-1)]]),_:1}),V(A(JO),null,{default:j(()=>[H(O(A(VP)),1)]),_:1})]),_:1})]),_:1})]),_:1})):(L(),z(rP,{key:1,title:`Work lifecycle`,description:`The task statuses and operator actions archied ships.`},{default:j(()=>[V(KF,{statuses:t.value},null,8,[`statuses`]),V(GF,{actions:n.value},null,8,[`actions`])]),_:1}))}}),JF=N({__name:`SystemTasksPage`,setup(e){async function t(){await Promise.all([DP(),HP()])}return _O(null,()=>void t()),ra(t),(e,t)=>(L(),R(`div`,null,[V(lO,{title:`Task settings`}),V(gF),V(qF),A(EP)?(L(),z(iF,{key:0})):(L(),z(rF,{key:1,ids:A($P)},null,8,[`ids`]))]))}}),YF={class:`flex items-center justify-between gap-2`},XF={class:`text-xs text-fg-subtle`},ZF=N({__name:`SkillCard`,props:{skill:{}},setup(e){let t=e;return(e,n)=>(L(),z(A(zO),null,{default:j(()=>[V(A(WO),null,{default:j(()=>[V(A(GO),null,{default:j(()=>[H(O(t.skill.name||`Untitled skill`),1)]),_:1}),V(A(HO),null,{default:j(()=>[H(O(t.skill.description||`No description provided.`),1)]),_:1})]), Line truncated
Defaulting to \`null\`.`),null)}function kx(e){return Dx(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${wx}\`.`),wx)}var Ax=N({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:wx},getValueLabel:{type:Function,required:!1,default:(e,t)=>Dx(e)?`${Math.round(e/t*wx)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;X();let i=Ch(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Ch(n,`max`,r,{passive:n.max===void 0});M(()=>i.value,async e=>{let t=Ox(e,n.max);t!==e&&(await ar(),i.value=t)},{immediate:!0}),M(()=>n.max,e=>{let t=kx(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=G(()=>Hm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Ex({modelValue:i,max:a,progressState:o}),(e,t)=>(L(),z(A(Z),{"as-child":e.asChild,as:e.as,"aria-valuemax":A(a),"aria-valuemin":0,"aria-valuenow":Dx(A(i))?A(i):void 0,"aria-valuetext":e.getValueText?.(A(i),A(a)),"aria-label":e.getValueLabel(A(i),A(a)),role:`progressbar`,"data-state":o.value,"data-value":A(i)??void 0,"data-max":A(a)},{default:j(()=>[F(e.$slots,`default`,{modelValue:A(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),jx=N({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Tx();return X(),(e,r)=>(L(),z(A(Z),W(t,{"data-state":A(n).progressState.value,"data-value":A(n).modelValue?.value??void 0,"data-max":A(n).max.value}),{default:j(()=>[F(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),[Mx,Nx]=zm(`ScrollAreaRoot`),Px=N({__name:`ScrollAreaRoot`,props:{type:{type:String,required:!1,default:`hover`},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=k(0),i=k(0),a=k(),o=k(),s=k(),c=k(),l=k(!1),u=k(!1),{type:d,dir:f,scrollHideDelay:p}=En(n),m=zh(f);function h(){a.value?.scrollTo({top:0})}function g(){a.value?.scrollTo({top:0,left:0})}t({viewport:a,scrollTop:h,scrollTopLeft:g});let{forwardRef:_,currentElement:v}=X();return Nx({type:d,dir:m,scrollHideDelay:p,scrollArea:v,viewport:a,onViewportChange:e=>{a.value=e||void 0},content:o,onContentChange:e=>{o.value=e},scrollbarX:s,scrollbarXEnabled:l,scrollbarY:c,scrollbarYEnabled:u,onScrollbarXChange:e=>{s.value=e||void 0},onScrollbarYChange:e=>{c.value=e||void 0},onScrollbarXEnabledChange:e=>{l.value=e},onScrollbarYEnabledChange:e=>{u.value=e},onCornerWidthChange:e=>{r.value=e},onCornerHeightChange:e=>{i.value=e}}),(e,t)=>(L(),z(A(Z),{ref:A(_),"as-child":n.asChild,as:e.as,dir:A(m),style:ve({position:`relative`,"--reka-scroll-area-corner-width":`${r.value}px`,"--reka-scroll-area-corner-height":`${i.value}px`})},{default:j(()=>[F(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`dir`,`style`]))}}),Fx=N({__name:`ScrollAreaCornerImpl`,setup(e){let t=Mx(),n=k(0),r=k(0),i=G(()=>!!n.value&&!!r.value);function a(){let e=t.scrollbarX.value?.offsetHeight||0;t.onCornerHeightChange(e),r.value=e}function o(){let e=t.scrollbarY.value?.offsetWidth||0;t.onCornerWidthChange(e),n.value=e}return Sh(t.scrollbarX.value,a),Sh(t.scrollbarY.value,o),M(()=>t.scrollbarX.value,a),M(()=>t.scrollbarY.value,o),(e,a)=>i.value?(L(),z(A(Z),W({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:`absolute`,right:A(t).dir.value===`ltr`?0:void 0,left:A(t).dir.value===`rtl`?0:void 0,bottom:0}},e.$parent?.$props),{default:j(()=>[F(e.$slots,`default`)]),_:3},16,[`style`])):U(`v-if`,!0)}}),Ix=N({__name:`ScrollAreaCorner`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=X(),r=Mx(),i=G(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),a=G(()=>r.type.value!==`scroll`&&i.value);return(e,r)=>a.value?(L(),z(Fx,W({key:0},t,{ref:A(n)}),{default:j(()=>[F(e.$slots,`default`)]),_:3},16)):U(`v-if`,!0)}});function Lx(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rx(e){let t=zx(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zx(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Bx(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Vx(e,t,n=`ltr`){let r=Rx(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Rm(e,c[0],c[1]);return Lx([0,o],[0,s])(l)}functLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:CT(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>CT(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=TT(c),u=e+1<n.length?TT(n[e+1]):null;if(l&&u&&ET(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=TT(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>CT(e)),rows:r.map(e=>e.map(e=>CT(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:CT(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:CT(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function TT(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function ET(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var DT={class:`[overflow-wrap:anywhere]`},OT={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},kT={class:`font-mono text-[0.85em]`},AT={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},jT={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},MT={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},NT={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},PT={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},FT={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},IT={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},LT={key:8,class:`mb-2.5 last:mb-0`},RT=N({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=G(()=>wT(t.text));return(e,t)=>(L(),R(`div`,DT,[(L(!0),R(I,null,P(n.value,(e,t)=>(L(),R(I,{key:t},[e.kind===`pre`?(L(),R(`pre`,OT,[B(`code`,kT,O(e.code),1)])):e.kind===`table`?(L(),R(`table`,AT,[B(`thead`,null,[B(`tr`,null,[(L(!0),R(I,null,P(e.head,(e,t)=>(L(),R(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[V(xT,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(L(!0),R(I,null,P(e.rows,(e,t)=>(L(),R(`tr`,{key:t},[(L(!0),R(I,null,P(e,(e,t)=>(L(),R(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[V(xT,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),R(`blockquote`,jT,[V(xT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),R(`h1`,MT,[V(xT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),R(`h2`,NT,[V(xT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),R(`h3`,PT,[V(xT,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),R(`ul`,FT,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(xT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),R(`ol`,IT,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(xT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),R(`p`,LT,[V(xT,{inline:e.inline},null,8,[`inline`])])):U(``,!0)],64))),128))]))}}),zT={class:`truncate`},BT=N({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ma(`RouterLink`);return L(),z(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:j(()=>[V(A(yd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,zT,O(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),VT={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},HT={class:`font-semibold text-foreground`},UT={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},WT=N({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=G(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=G(()=>t.tool.parameters||t.tool.Parameters||``),i=G(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=G(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(L(),z(BT,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(L(),R(`div`,VT,[V(A(Gd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,HT,O(n.value),1),r.value?(L(),R(`code`,UT,O(r.value),1)):U(``,!0),B(`span`,{class:D(A(J)(`text-fg-muted`,i.value&&`text-danger`))},O(a.value),3)]))}}),GT={key:0,class:`mb-2 grid gap-0.5 text-xs`},KT={key:2,class:`whitespace-pre-wrap`},qT=N({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(L(),R(`div`,{class:D([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:D(A(J)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(L(),R(`div`,GT,[(L(!0),R(I,null,P(e.tools,(t,n)=>(L(),z(WT,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):U(``,!0),e.assistant?(L(),z(RT,{key:1,text:e.text},null,8,[`text`])):(L(),R(`div`,KT,O(e.text),1)),F(t.$slots,`default`)],2)],2))}}),JT={class:`w-full self-center justify-self-center py-6 text-center`},YT={class:`grid gap-2`},XT=[`onClick`],ZT=N({__name:`ChatEmptyState`,emits:[`prompt`],setup(e,{emit:t}){let n=t,r=[`Summarise active tasks`,`Show running agents`,`Check system status`];return(e,t)=>(L(),R(`div`,JT,[t[0]||=B(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 placLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>cj?`${n.slice(0,cj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var uj=[`title`],dj=N({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>NA(n.event)),a=G(()=>lj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=G(()=>n.event.at?Nk(n.event.at):`—`);return(e,t)=>(L(),z(A(rk),{class:D(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[du(lu(o,[`prevent`]),[`enter`]),du(lu(o,[`prevent`]),[`space`])]},{default:j(()=>[V(A(Q),{class:`font-medium`},{default:j(()=>[H(O(n.event.kind||n.event.type||`event`),1)]),_:1}),V(A(Q),{class:`font-mono`},{default:j(()=>[H(O(i.value>0?`#${i.value}`:`—`),1)]),_:1}),V(A(Q),{class:`w-[55%] max-w-0`},{default:j(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},O(a.value.text),9,uj)]),_:1}),V(A(Q),null,{default:j(()=>[H(O(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),fj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},pj=N({__name:`LiveActivityCard`,setup(e){let t=bE(),{activity:n,streamKind:r,streamState:i}=ad(hO());function a(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(L(),z(A(RO),null,{default:j(()=>[V(A(UO),null,{default:j(()=>[V(A(WO),null,{default:j(()=>[...t[0]||=[H(`Live activity`,-1)]]),_:1}),V(A(VO),null,{default:j(()=>[...t[1]||=[H(`Last 50, newest first`,-1)]]),_:1}),V(A(zO),null,{default:j(()=>[V(A(ak),{variant:A(r)},{default:j(()=>[H(O(A(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),V(A(BO),null,{default:j(()=>[B(`div`,fj,[V(A(tk),null,{default:j(()=>[V(A(ik),null,{default:j(()=>[V(A(rk),null,{default:j(()=>[V(A($),null,{default:j(()=>[...t[2]||=[H(`Event`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...t[3]||=[H(`Task`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...t[4]||=[H(`Detail`,-1)]]),_:1}),V(A($),null,{default:j(()=>[...t[5]||=[H(`When`,-1)]]),_:1})]),_:1})]),_:1}),V(A(nk),null,{default:j(()=>[A(n).length?(L(!0),R(I,{key:1},P(A(n),(e,t)=>(L(),z(dj,{key:t,event:e,onOpen:a},null,8,[`event`]))),128)):(L(),z(A(rk),{key:0},{default:j(()=>[V(A(Q),{colspan:`4`},{default:j(()=>[V(A(GO),null,{default:j(()=>[V(A(JO),null,{default:j(()=>[V(A(ZO),null,{default:j(()=>[...t[6]||=[H(`Waiting for activity`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})])]),_:1})]),_:1}))}}),mj=N({__name:`Progress`,props:{modelValue:{default:0},max:{},getValueLabel:{},getValueText:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=EC(t,`class`);return(e,r)=>(L(),z(A(Ax),W({"data-slot":`progress`},A(n),{class:A(J)(`bg-muted h-1 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class)}),{default:j(()=>[V(A(jx),{"data-slot":`progress-indicator`,class:`bg-primary size-full flex-1 transition-all`,style:ve(`transform: translateX(-${100-(t.modelValue??0)}%);`)},null,8,[`style`])]),_:1},16,[`class`]))}}),hj=`archie.setup-complete.dismissed.v1`;function gj(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?.(hj),{kind:`incomplete`,remaining:n}):t?.getItem?.(`archie.setup-complete.dismissed.v1`)===`1`?{kind:`dismissed`,remaining:[]}:{kind:`complete`,remaining:[]}}function _j(e=globalThis.localStorage){e?.setItem?.(hj,`1`)}var vj={class:`text-lg font-semibold text-link`},yj={class:`flex flex-col gap-3`},bj={key:0,class:`mt-0.5 text-xs text-fg-subtle`},xj=N({__name:`SetupPanel`,setup(e){let t=k(gj(EA.value));M(EA,()=>{t.value=gj(EA.value)});let n=G(()=>EA.value?.steps??[]),r=G(()=>{let e=n.value.length;return e?Math.round((e-t.value.remaining.length)/e*100):0});function i(){_j(),t.value=gj(EA.value)}return(e,a)=>t.value.kind===`incomplete`?(L(),z(A(RO),{key:0},{default:j(()=>[V(A(UO),null,{default:j(()=>[V(A(WO),null,{default:j(()=>[...a[0]||=[H(`Finish setting up`,-1)]]),_:1}),V(A(VO),null,{default:j(()=>[...a[1]||=[H(`Archie needs these before it can work on its own.`,-1)]]),_:1}),V(A(zO),null,{default:j(()=>[B(`span`,vj,O(r.value)+`%`,1)]),_:1})]),_:1}),V(A(BO),null,{default:j(()=>[V(A(mj),{"model-value":r.value,class:`mb-4`},null,8,[`model-value`]),B(`ul`,yj,[(L(!0),R(I,null,P(n.value,(e,t)=>(L(),R(`li`,{key:t,class:`flex items-start gap-3`},[B(`span`,{class:D([`mt-px grid size-[18px] flex-none place-items-center rounded-full border-[1.5px] border-border-strong text-xs text-fg-subtle`,e.done?`border-transparent bg-ok-soft text-ok`:``])},[e.done?(L(),z(A(bd),{key:0,class:`size-3`})):U(``,!0)],2),B(`div`,null,[B(`div`,{class:D([`text-sm`,e.done?`text-fg-muted line-through`:``])},O(e.title),3),e.detail?(L(),R(`div`,bj,O(e.detail),1)):U(``,!0)])]))),128))])]),_:1})]),_:1})):t.value.kind===`complete`?(L(),z(A(RO),{key:1},{default:j(()=>[V(A(UO),null,{default:j(()=>[V(A(WO),null,{default:j(()=>[...a[2]||=[H(`Setup complete`,-1) Line truncated
+4 -8
View File
@@ -1,18 +1,14 @@
<script setup lang="ts">
/**
* The head every page opens with: what the page is, in a line, and the actions
* that belong to it. A component rather than per-page markup because every page
* has one, and hand-built copies drift.
* The shared page title and its actions. A component rather than per-page
* markup because hand-built copies drift.
*/
defineProps<{ title: string; subtitle?: string }>();
defineProps<{ title: string }>();
</script>
<template>
<div class="mb-6 flex flex-wrap items-start justify-between gap-5">
<div>
<h1 class="text-2xl font-semibold tracking-[-0.02em]">{{ title }}</h1>
<p v-if="subtitle" class="mt-1 text-sm text-fg-muted">{{ subtitle }}</p>
</div>
<h1 class="text-2xl font-semibold tracking-[-0.02em]">{{ title }}</h1>
<div class="flex flex-wrap items-center gap-2">
<slot />
</div>
+1 -4
View File
@@ -70,10 +70,7 @@ async function handleDelete(binding: Binding): Promise<void> {
<template>
<div>
<PageHeader
title="Playbook bindings"
subtitle="Tie a matcher, a field mapping, and a workflow together. New and edited bindings need explicit approval before they can fire."
>
<PageHeader title="Playbook bindings">
<Button v-if="!failure" @click="startCreate">
<Plus data-icon="inline-start" />
New binding
+2 -6
View File
@@ -1,16 +1,12 @@
<script setup lang="ts">
import CaptureStatus from "./CaptureStatus.vue";
/** The page's title, and what belongs beside it: where the stream has got to,
* and a way to ask for the list again. */
/** The page title and stream status. */
</script>
<template>
<div class="mb-5 flex flex-wrap items-start justify-between gap-5">
<div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Event inspector</h1>
<p class="mt-2 text-sm text-fg-muted">Inbound payloads, most recent first.</p>
</div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Event inspector</h1>
<div class="flex flex-wrap items-center gap-2">
<CaptureStatus />
</div>
+1 -4
View File
@@ -39,10 +39,7 @@ onMounted(load);
<template>
<div>
<PageHeader
title="Channels"
subtitle="The conversational front-ends Archie can be reached through."
/>
<PageHeader title="Channels" />
<div class="grid grid-cols-1 gap-4 min-[1080px]:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]">
<Empty v-if="error">
+3 -9
View File
@@ -2,7 +2,6 @@
import { computed } from "vue";
import { useRoute } from "vue-router";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { activeNavPath, navTree } from "@/lib/nav";
import NavGroup from "./NavGroup.vue";
import NavTrigger from "./NavTrigger.vue";
@@ -17,14 +16,9 @@ const activePath = computed(() => activeNavPath(route.path));
<template>
<nav aria-label="Sections" class="flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto">
<template v-for="node in tree" :key="node.kind === 'link' ? node.entry.path : node.label">
<Tooltip v-if="node.kind === 'link'">
<TooltipTrigger as-child>
<NavTrigger :to="node.entry.path" :current="activePath === node.entry.path">
{{ node.entry.label }}
</NavTrigger>
</TooltipTrigger>
<TooltipContent :side-offset="8" class="max-w-64">{{ node.entry.description }}</TooltipContent>
</Tooltip>
<NavTrigger v-if="node.kind === 'link'" :to="node.entry.path" :current="activePath === node.entry.path">
{{ node.entry.label }}
</NavTrigger>
<NavGroup v-else :label="node.label" :items="node.items" :active-path="activePath" />
</template>
</nav>
+11 -19
View File
@@ -1,28 +1,20 @@
<script setup lang="ts">
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import type { NavEntry } from "@/lib/nav";
defineProps<{ entry: NavEntry; current: boolean }>();
</script>
<template>
<Tooltip>
<TooltipTrigger as-child>
<DropdownMenuItem
as-child
:data-current="current ? '' : undefined"
:disabled="entry.soon"
class="data-current:text-foreground data-current:bg-accent/60 px-2 py-1.5"
>
<RouterLink :to="entry.path" class="w-full cursor-pointer">
<span class="flex-1">{{ entry.label }}</span>
<span v-if="entry.soon" class="text-muted-foreground text-[11px] tracking-wide uppercase">soon</span>
</RouterLink>
</DropdownMenuItem>
</TooltipTrigger>
<TooltipContent side="right" :side-offset="10" class="max-w-64">
{{ entry.soon ? "Coming soon. " + entry.description : entry.description }}
</TooltipContent>
</Tooltip>
<DropdownMenuItem
as-child
:data-current="current ? '' : undefined"
:disabled="entry.soon"
class="data-current:text-foreground data-current:bg-accent/60 px-2 py-1.5"
>
<RouterLink :to="entry.path" class="w-full cursor-pointer">
<span class="flex-1">{{ entry.label }}</span>
<span v-if="entry.soon" class="text-muted-foreground text-[11px] tracking-wide uppercase">soon</span>
</RouterLink>
</DropdownMenuItem>
</template>
+1 -4
View File
@@ -33,10 +33,7 @@ onMounted(load);
<template>
<div>
<PageHeader
title="Curators"
subtitle="Background agents that maintain memory and skills: what ran, and why."
/>
<PageHeader title="Curators" />
<div class="grid grid-cols-1 gap-4 min-[1080px]:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]">
<Empty v-if="loadError">
+1 -6
View File
@@ -17,12 +17,7 @@ const currentGreeting = computed(() => (setup.value?.operator ? `${greeting()},
<template>
<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>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">{{ currentGreeting }}</h1>
<div class="flex flex-wrap items-center gap-2">
<DashboardActions />
</div>
+1 -7
View File
@@ -118,6 +118,7 @@ async function request<T = unknown>(path: string, opts: RequestOptions = {}): Pr
}
export const api = {
health: <T = unknown>() => request<T>("/health/detailed"),
summary: <T = unknown>() => request<T>("/api/summary"),
tasks: <T = unknown>() => request<T>("/api/tasks"),
taskMeta: <T = unknown>() => request<T>("/api/task-meta"),
@@ -139,7 +140,6 @@ export const api = {
channelReload: <T = unknown>(id: string) =>
request<T>(`/api/channels/${encodeURIComponent(id)}/reload`, { method: "POST", body: {} }),
config: <T = unknown>() => request<T>("/api/config"),
version: <T = unknown>() => request<T>("/api/version"),
configUpdate: <T = unknown>(updates: Payload) => request<T>("/api/config", { method: "PATCH", body: { updates } }),
configRepoUpdate: <T = unknown>(owner: string, name: string, field: string, value: unknown) =>
request<T>(`/api/config/repos/${encodeURIComponent(owner)}/${encodeURIComponent(name)}`, {
@@ -191,12 +191,6 @@ export const api = {
}),
chatPersona: <T = unknown>(sessionID: string, name: string) =>
request<T>("/api/chat/persona", { method: "POST", body: { session_id: sessionID, name } }),
chatUpdate: <T = unknown>() => request<T>("/api/chat/update"),
chatUpdateDefer: <T = unknown>(snapshot: unknown) => request<T>("/api/chat/update/defer", { method: "POST", body: { snapshot } }),
// Installing restarts archied, so it is allowed far longer than a normal
// request before the UI gives up.
chatUpdateInstall: <T = unknown>(snapshot: unknown) =>
request<T>("/api/chat/update/install", { method: "POST", body: { snapshot }, timeoutMs: 120000 }),
chatDangerous: <T = unknown>() => request<T>("/api/chat/dangerous"),
chatDangerousRequest: <T = unknown>(kind: string, spec: unknown) =>
request<T>(`/api/chat/dangerous/${encodeURIComponent(kind)}`, { method: "POST", body: { spec } }),
+1 -4
View File
@@ -6,10 +6,7 @@ import LogActions from "./LogActions.vue";
<template>
<div class="mb-5 flex flex-wrap items-start justify-between gap-5">
<div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Logs</h1>
<p class="mt-2 text-sm text-fg-muted">What Archie has been doing, newest last.</p>
</div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Logs</h1>
<LogActions />
</div>
</template>
+1 -6
View File
@@ -24,12 +24,7 @@ onMounted(loadMappings);
<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]">Field mappings</h1>
<p class="mt-2 text-sm text-fg-muted">
Bind named fields to JSON paths from a real captured event, ready for a playbook binding.
</p>
</div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Field mappings</h1>
<div class="flex flex-wrap items-center gap-2">
<Button @click="startCreate">
<Plus data-icon="inline-start" />
+1 -1
View File
@@ -24,7 +24,7 @@ import WorkflowsPage from "@/workflows/WorkflowsPage.vue";
//
// meta:
// label the navigation label, short because its group carries the context
// description one line, shown as the item's tooltip and mirrored in the registry
// description one line mirrored in the messaging page registry
// section the capability from GET /api/capabilities this route needs; a
// route with no section is served in every composition
// navPath the navigation entry this route keeps current
+5 -5
View File
@@ -3,19 +3,19 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
/**
* One titled card of the System surface. Every card on the six pages opens the
* same way -- a title, and the line that says what it covers -- so it is a
* component rather than six copies of the same CardHeader markup.
* same way, so it is a component rather than six copies of the same CardHeader
* markup. A description is reserved for context the card cannot show itself.
*
* The card owns its own bottom margin: the pages stack cards directly, with
* nothing between them.
*/
defineProps<{ title: string; description?: string }>();
defineProps<{ title?: string; description?: string }>();
</script>
<template>
<Card class="mb-4">
<CardHeader>
<CardTitle>{{ title }}</CardTitle>
<CardHeader v-if="title || description">
<CardTitle v-if="title">{{ title }}</CardTitle>
<CardDescription v-if="description">{{ description }}</CardDescription>
</CardHeader>
<CardContent>
+1 -1
View File
@@ -19,7 +19,7 @@ const sections = computed(() => sectionsFor(config.value?.schema, props.ids));
</script>
<template>
<ConfigCard v-for="section in sections" :key="section.id" :title="section.label" :description="section.description">
<ConfigCard v-for="section in sections" :key="section.id" :title="section.label">
<ConfigList>
<ConfigRow
v-for="field in sectionRows(section)"
+86
View File
@@ -0,0 +1,86 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed, onMounted, ref } from "vue";
import { Badge } from "@/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import { api } from "@/lib/api";
import { useLiveResource, useLiveUpdatesStore } from "@/stores/live-updates";
interface HealthComponent {
name: string;
status: "ok" | "degraded";
ready: boolean;
detail?: string;
}
interface HealthReport {
status: "ok" | "degraded";
components: HealthComponent[];
}
const report = ref<HealthReport | null>(null);
const error = ref<string | null>(null);
const { streamState } = storeToRefs(useLiveUpdatesStore());
const liveState = computed(() => {
if (streamState.value === "live") return { label: "Connected", kind: "ok" as const };
if (streamState.value === "unavailable") return { label: "Unavailable", kind: "danger" as const };
return { label: "Connecting", kind: "warn" as const };
});
const names: Record<string, string> = {
state_db: "State store",
gateway: "Gateway",
active_model: "Active model",
};
function componentName(name: string): string {
return names[name] ?? name.replaceAll("_", " ").replace(/^./, (letter) => letter.toUpperCase());
}
async function load(): Promise<void> {
try {
report.value = await api.health<HealthReport>();
error.value = null;
} catch (err) {
error.value = String((err as Error).message || err);
}
}
useLiveResource(null, () => void load());
onMounted(load);
</script>
<template>
<Card class="mb-4">
<CardHeader>
<CardTitle>Runtime</CardTitle>
</CardHeader>
<CardContent>
<p v-if="error" class="text-sm text-destructive">{{ error }}</p>
<Table v-else>
<TableBody>
<TableRow>
<TableCell class="font-medium">Live updates</TableCell>
<TableCell class="w-px text-right">
<Badge :variant="liveState.kind">{{ liveState.label }}</Badge>
</TableCell>
</TableRow>
<TableRow v-for="component in report?.components ?? []" :key="component.name">
<TableCell>
<span class="font-medium">{{ componentName(component.name) }}</span>
<span v-if="component.detail" class="ml-2 text-sm text-fg-muted">{{ component.detail }}</span>
</TableCell>
<TableCell class="w-px text-right">
<Badge :variant="component.ready ? 'ok' : 'danger'">
{{ component.ready ? "Ready" : "Degraded" }}
</Badge>
</TableCell>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</template>
-40
View File
@@ -1,40 +0,0 @@
<script setup lang="ts">
import { Button, type ButtonVariants } from "@/components/ui/button";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import ConfigList from "./ConfigList.vue";
import ConfigRow from "./ConfigRow.vue";
import type { LifecycleEntry } from "./types";
/**
* The operator actions archied offers, shown as the control each one renders
* as. They are disabled here: this is the vocabulary, not a task to act on,
* and every one of them needs a task to mean anything.
*/
const props = defineProps<{ actions: LifecycleEntry[] }>();
/** A quiet action reads as a plain control, a dangerous one as a destructive
* one, so the list shows the weight each action carries. */
function actionVariant(kind?: string): ButtonVariants["variant"] {
if (kind === "quiet") return "ghost";
if (kind === "danger") return "destructive";
return "outline";
}
</script>
<template>
<h3 class="mt-5 mb-2 text-sm font-semibold text-fg-muted">Actions</h3>
<Empty v-if="!props.actions.length">
<EmptyHeader>
<EmptyTitle>No actions reported</EmptyTitle>
</EmptyHeader>
</Empty>
<ConfigList v-else>
<ConfigRow v-for="action in props.actions" :key="action.id" :label="action.id">
<template #value>
<span>
<Button :variant="actionVariant(action.kind)" size="xs" disabled>{{ action.label ?? action.id }}</Button>
</span>
</template>
</ConfigRow>
</ConfigList>
</template>
-40
View File
@@ -1,40 +0,0 @@
<script setup lang="ts">
import { computed } from "vue";
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import ConfigCard from "./ConfigCard.vue";
import LifecycleActionList from "./LifecycleActionList.vue";
import LifecycleStatusList from "./LifecycleStatusList.vue";
import { lifecycle, lifecycleError } from "./state";
/**
* The work lifecycle archied ships: its task statuses and the operator actions
* that act on them. Both lists come from the server (GET /api/task-meta), so a
* status or action added on the backend appears here without a frontend change.
*/
const statuses = computed(() => lifecycle.value?.statuses ?? []);
const actions = computed(() => lifecycle.value?.actions ?? []);
</script>
<template>
<ConfigCard
v-if="lifecycleError"
title="Work lifecycle"
description="The task statuses and operator actions archied ships."
>
<Empty>
<EmptyHeader>
<EmptyTitle>Lifecycle unavailable</EmptyTitle>
<EmptyDescription>{{ lifecycleError }}</EmptyDescription>
</EmptyHeader>
</Empty>
</ConfigCard>
<ConfigCard
v-else
title="Work lifecycle"
description="The task statuses and operator actions archied ships."
>
<LifecycleStatusList :statuses="statuses" />
<LifecycleActionList :actions="actions" />
</ConfigCard>
</template>
-37
View File
@@ -1,37 +0,0 @@
<script setup lang="ts">
import { Badge } from "@/components/ui/badge";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import type { StatusKind } from "@/lib/status";
import { statusKind, statusLabel } from "@/lib/task-meta";
import ConfigList from "./ConfigList.vue";
import ConfigRow from "./ConfigRow.vue";
import type { LifecycleEntry } from "./types";
/**
* The statuses a task can be in, each with the severity it carries. The
* server's own label and kind win; a status it did not describe falls back to
* the shared lifecycle vocabulary (lib/task-meta), which is what every other
* surface names statuses by.
*/
const props = defineProps<{ statuses: LifecycleEntry[] }>();
</script>
<template>
<h3 class="mt-5 mb-2 text-sm font-semibold text-fg-muted first:mt-0">Statuses</h3>
<Empty v-if="!props.statuses.length">
<EmptyHeader>
<EmptyTitle>No statuses reported</EmptyTitle>
</EmptyHeader>
</Empty>
<ConfigList v-else>
<ConfigRow v-for="status in props.statuses" :key="status.id" :label="status.id">
<template #value>
<span>
<Badge :variant="(status.kind ?? statusKind(status.id)) as StatusKind">
{{ status.label ?? statusLabel(status.id) }}
</Badge>
</span>
</template>
</ConfigRow>
</ConfigList>
</template>
-1
View File
@@ -13,7 +13,6 @@ import ProviderTable from "./ProviderTable.vue";
<template>
<ConfigCard
title="Models & providers"
description="Which model handles each stage of work."
>
<ModelRoleList />
<ProviderTable />
-43
View File
@@ -1,43 +0,0 @@
<script setup lang="ts">
import { computed } from "vue";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import ConfigCard from "./ConfigCard.vue";
import ConfigList from "./ConfigList.vue";
import ConfigRow from "./ConfigRow.vue";
import { config } from "./state";
/**
* The files that supplied the running configuration. The order is the
* precedence order: applied from top to bottom, later entries override earlier
* ones, which is the one thing a reader of this list needs to know.
*/
const origins = computed(() => config.value?.provenance ?? []);
const rows = computed(() =>
origins.value.map((origin) => ({
label: `${origin.layer} ${origin.role}${origin.feature ? ` (${origin.feature})` : ""}`,
value: origin.path,
})),
);
</script>
<template>
<ConfigCard
title="Configuration sources"
:description="
origins.length
? 'Later entries take precedence.'
: 'The files that supplied the running configuration.'
"
>
<Empty v-if="!origins.length">
<EmptyHeader>
<EmptyTitle>Source provenance is unavailable.</EmptyTitle>
</EmptyHeader>
</Empty>
<ConfigList v-else>
<ConfigRow v-for="(row, index) in rows" :key="index" :label="row.label" :value="row.value" />
</ConfigList>
</ConfigCard>
</template>
-23
View File
@@ -1,23 +0,0 @@
<script setup lang="ts">
import { LockKeyhole } from "@lucide/vue";
import { Alert, AlertTitle } from "@/components/ui/alert";
import { configEditable } from "./state";
/**
* Says so when this process cannot write configuration.
*
* A process that only renders a published snapshot has no update path, so
* every editable row on the page is a value and the PATCH routes answer 503.
* A page that simply showed no controls would leave the reader guessing
* whether a setting is immutable, read-only here, or broken -- so it states
* which (archie-core-ymut).
*/
</script>
<template>
<Alert v-if="!configEditable" class="mb-4">
<LockKeyhole />
<AlertTitle>Read-only settings</AlertTitle>
</Alert>
</template>
+2 -6
View File
@@ -29,7 +29,7 @@ function gateSummary(gate?: string[][]): string {
</script>
<template>
<ConfigCard v-if="!repos.length" title="Repositories" description="The repositories Archie polls for work.">
<ConfigCard v-if="!repos.length">
<Empty>
<EmptyHeader>
<EmptyTitle>No repositories configured</EmptyTitle>
@@ -37,11 +37,7 @@ function gateSummary(gate?: string[][]): string {
</EmptyHeader>
</Empty>
</ConfigCard>
<ConfigCard
v-else
title="Repositories"
description="Each repository Archie polls, and the quality gate a change must pass before it opens a pull request. Concurrent tasks, retries, and self-review are per-repository overrides -- PATCH /api/config/repos/{owner}/{name}, not the file config.toml directly."
>
<ConfigCard v-else>
<Table>
<TableHeader>
<TableRow>
+1 -3
View File
@@ -6,7 +6,6 @@ import { useLiveResource } from "@/stores/live-updates";
import ConfigSections from "./ConfigSections.vue";
import ConfigUnavailable from "./ConfigUnavailable.vue";
import DangerousActionsCard from "./DangerousActionsCard.vue";
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
import { ADVANCED_SECTIONS } from "./sections";
import { configUnavailable, loadConfig, loadDangerous } from "./state";
@@ -28,9 +27,8 @@ onMounted(load);
<template>
<div>
<PageHeader title="Advanced" subtitle="Identity, storage and sandboxing, and dangerous actions." />
<PageHeader title="Advanced" />
<ReadOnlyNotice />
<ConfigUnavailable v-if="configUnavailable" />
<ConfigSections v-else :ids="ADVANCED_SECTIONS" />
<!-- Dangerous actions come from the daemon's own endpoint, not the config
+1 -1
View File
@@ -38,7 +38,7 @@ function chooseMotion(value: unknown): void {
<template>
<div>
<PageHeader title="Appearance" subtitle="How this dashboard looks and responds in this browser." />
<PageHeader title="Appearance" />
<ConfigCard title="Dashboard preferences" description="Saved only in this browser and applied immediately.">
<div class="grid gap-8 min-[700px]:grid-cols-2 min-[1100px]:grid-cols-4">
+1 -1
View File
@@ -18,7 +18,7 @@ onMounted(loadConfig);
<template>
<div>
<PageHeader title="Models" subtitle="Model roles, and the providers backing them." />
<PageHeader title="Models" />
<ConfigUnavailable v-if="configUnavailable" />
<ModelsCard v-else />
+1 -3
View File
@@ -4,7 +4,6 @@ import { onMounted } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { useLiveResource } from "@/stores/live-updates";
import ConfigUnavailable from "./ConfigUnavailable.vue";
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
import RepositoriesCard from "./RepositoriesCard.vue";
import { configUnavailable, loadConfig } from "./state";
@@ -17,9 +16,8 @@ onMounted(loadConfig);
<template>
<div>
<PageHeader title="Repositories" subtitle="The repositories Archie polls, and their per-repo gate overrides." />
<PageHeader title="Repositories" />
<ReadOnlyNotice />
<ConfigUnavailable v-if="configUnavailable" />
<RepositoriesCard v-else />
</div>
+3 -41
View File
@@ -1,50 +1,12 @@
<script setup lang="ts">
import { onMounted } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { useLiveResource } from "@/stores/live-updates";
import ConfigNotices from "./ConfigNotices.vue";
import ConfigSections from "./ConfigSections.vue";
import ConfigUnavailable from "./ConfigUnavailable.vue";
import ProvenanceCard from "./ProvenanceCard.vue";
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
import { STATUS_SECTIONS } from "./sections";
import { configUnavailable, loadConfig, loadUpdate, loadVersion } from "./state";
import UpdateActionsCard from "./UpdateActionsCard.vue";
import UpdateStatusCard from "./UpdateStatusCard.vue";
/**
* What archied is running with right now: whether each component matches what
* is installed, what is available to update, the files that supplied the
* running configuration, and the dashboard's own listen address.
*
* The address arrives through the generic schema rows rather than a card of
* its own: it is one field, and a section that grows another should not need a
* new component here.
*/
async function load(): Promise<void> {
await Promise.all([loadConfig(), loadVersion(), loadUpdate()]);
}
useLiveResource("updates", () => void load());
onMounted(load);
import HealthStatusCard from "./HealthStatusCard.vue";
</script>
<template>
<div>
<PageHeader title="Status" subtitle="Runtime health, versions, updates, and configuration." />
<PageHeader title="Status" />
<!-- Only the configuration projection is gated on the config read: update
checking and the reload notices come from other endpoints, so a config
that failed to load says so without hiding them. -->
<ReadOnlyNotice />
<UpdateStatusCard />
<UpdateActionsCard />
<ConfigUnavailable v-if="configUnavailable" />
<template v-else>
<ConfigNotices />
<ConfigSections :ids="STATUS_SECTIONS" />
<ProvenanceCard />
</template>
<HealthStatusCard />
</div>
</template>
+4 -16
View File
@@ -5,29 +5,17 @@ import PageHeader from "@/base/PageHeader.vue";
import { useLiveResource } from "@/stores/live-updates";
import ConfigSections from "./ConfigSections.vue";
import ConfigUnavailable from "./ConfigUnavailable.vue";
import LifecycleCard from "./LifecycleCard.vue";
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
import { TASKS_SECTIONS } from "./sections";
import { configUnavailable, loadConfig, loadLifecycle } from "./state";
import { configUnavailable, loadConfig } from "./state";
/**
* The work lifecycle: the statuses and operator actions archied ships, and the
* budgets every autonomous stage runs under.
*/
async function load(): Promise<void> {
await Promise.all([loadConfig(), loadLifecycle()]);
}
useLiveResource(null, () => void load());
onMounted(load);
useLiveResource(null, () => void loadConfig());
onMounted(loadConfig);
</script>
<template>
<div>
<PageHeader title="Task settings" subtitle="How work moves through archied, and what it is allowed to spend." />
<PageHeader title="Task settings" />
<ReadOnlyNotice />
<LifecycleCard />
<ConfigUnavailable v-if="configUnavailable" />
<ConfigSections v-else :ids="TASKS_SECTIONS" />
</div>
-86
View File
@@ -1,86 +0,0 @@
<script setup lang="ts">
import { computed, ref } from "vue";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import ConfigCard from "./ConfigCard.vue";
import { deferUpdate, installUpdate, update } from "./state";
/**
* The actionable half of update checking: what is available, and the two
* decisions you can make about it. The read-only comparison of components and
* versions is UpdateStatusCard.
*
* A deployment that did not wire update checking answers 501, which leaves
* `update` null and this card absent rather than in an error state
* (archie-core-tf20).
*/
const available = computed(() => update.value?.available ?? []);
const summary = computed(() => {
const data = update.value;
if (data?.error) return data.error;
if (data?.snapshot?.deferred) return "Update deferred.";
return "Archie is up to date.";
});
// Installing restarts archied, so it is confirmed first: the operator needs
// to know that this dashboard, and any tasks archied is running, go down with
// it before the install call fires.
const confirmingInstall = ref(false);
function defer(): void {
void deferUpdate(update.value?.snapshot);
}
function onInstallOpen(open: boolean): void {
if (!open) confirmingInstall.value = false;
}
function install(): void {
confirmingInstall.value = false;
void installUpdate(update.value?.snapshot);
}
</script>
<template>
<ConfigCard v-if="update" title="Updates" description="Whether a newer release is available, and what to do about it.">
<p class="text-sm text-fg-muted">
<template v-if="available.length">
{{ available.map((c) => `${c.Label || c.label}: ${c.Available || c.available}`).join(" · ") }}
</template>
<template v-else>{{ summary }}</template>
</p>
<div v-if="available.length" class="mt-3 flex flex-wrap gap-2">
<Button variant="outline" @click="defer">Defer</Button>
<!-- Installing restarts archied, so it is offered only when the server
says it can perform one, and confirmed before it runs. -->
<Button v-if="update.can_install" variant="destructive" @click="confirmingInstall = true">Install update</Button>
</div>
<AlertDialog :open="confirmingInstall" @update:open="onInstallOpen">
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Install update</AlertDialogTitle>
<AlertDialogDescription>
Installing restarts archied. This dashboard will be unavailable until it comes back, and
any tasks archied is running are interrupted.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction variant="destructive" @click="install">Install update</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</ConfigCard>
</template>
-96
View File
@@ -1,96 +0,0 @@
<script setup lang="ts">
import ConfigCard from "./ConfigCard.vue";
import { Card, CardContent } from "@/components/ui/card";
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Badge } from "@/components/ui/badge";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import type { StatusKind } from "@/lib/status";
import { versionComponents, versionError, versionMissing } from "./state";
/**
* How each component is deployed, and whether what is running matches what is
* installed. The comparison is read-only; what to do about an available update
* is UpdateActionsCard's job.
*/
const STATUS_LABELS: Record<string, string> = {
ok: "OK",
update_available: "Update available",
drift: "Drift",
unknown: "Unknown",
};
const STATUS_KINDS: Record<string, StatusKind> = {
ok: "ok",
update_available: "info",
drift: "danger",
unknown: "idle",
};
/** The exact versions compared, shown on the row that compares them. */
function basis(component: (typeof versionComponents.value)[number]): string {
return [
`Installed claim: ${component.installed_claim || "unknown"}`,
`Running: ${component.running_version || "not observed"}`,
component.reference ? `Reference: ${component.reference}` : null,
]
.filter(Boolean)
.join("\n");
}
</script>
<template>
<!-- A 501 is a deployment that did not wire update checking, which is a
legitimate state and a different thing from a broken one. Saying so once
here covers the absent UpdateActionsCard too. -->
<ConfigCard
v-if="versionMissing"
title="Update status"
description="Not configured on this deployment."
/>
<Card v-else-if="versionError" class="mb-4">
<CardContent>
<Empty>
<EmptyHeader>
<EmptyTitle>Update status unavailable</EmptyTitle>
<EmptyDescription>{{ versionError }}</EmptyDescription>
</EmptyHeader>
</Empty>
</CardContent>
</Card>
<ConfigCard
v-else
title="Update status"
description="Whether what's running matches what's installed."
>
<Empty v-if="!versionComponents.length">
<EmptyHeader>
<EmptyTitle>No components reported</EmptyTitle>
<EmptyDescription>The configured update-check command returned nothing.</EmptyDescription>
</EmptyHeader>
</Empty>
<Table v-else>
<TableHeader>
<TableRow>
<TableHead>Component</TableHead>
<TableHead>Install type</TableHead>
<TableHead>Running</TableHead>
<TableHead>Latest available</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="component in versionComponents" :key="component.id || component.label" :title="basis(component)">
<TableCell class="font-medium">{{ component.label || component.id }}</TableCell>
<TableCell class="font-mono">{{ component.install_type || "—" }}</TableCell>
<TableCell class="font-mono">{{ component.running_version || "—" }}</TableCell>
<TableCell class="font-mono">{{ component.latest_available || "—" }}</TableCell>
<TableCell>
<Badge :variant="STATUS_KINDS[component.status || ''] || 'idle'">
{{ STATUS_LABELS[component.status || ""] || component.status }}
</Badge>
</TableCell>
</TableRow>
</TableBody>
</Table>
</ConfigCard>
</template>
-1
View File
@@ -10,7 +10,6 @@ import type { ConfigField, ConfigSection } from "./types";
* those, not the generic row renderer.
*/
export const STATUS_SECTIONS = ["web"];
export const TASKS_SECTIONS = ["budgets"];
export const ADVANCED_SECTIONS = ["identity", "storage"];
-58
View File
@@ -4,9 +4,6 @@ import { ApiError, api } from "@/lib/api";
import type {
ConfigView,
DangerousActions,
Lifecycle,
UpdateStatus,
VersionComponent,
} from "./types";
/**
@@ -56,47 +53,6 @@ export async function loadConfig(): Promise<void> {
}
}
// ── Updates ─────────────────────────────────────────────────────────────────
export const versionComponents = ref<VersionComponent[]>([]);
export const versionError = ref<string | null>(null);
/** Update checking is not wired on this deployment. */
export const versionMissing = ref(false);
export async function loadVersion(): Promise<void> {
try {
const data = await api.version<{ components?: VersionComponent[] }>();
versionComponents.value = data?.components || [];
versionError.value = null;
versionMissing.value = false;
} catch (err) {
versionMissing.value = isMissing(err);
if (!versionMissing.value) versionError.value = errorText(err);
}
}
export const update = ref<UpdateStatus | null>(null);
export async function loadUpdate(): Promise<void> {
try {
update.value = await api.chatUpdate<UpdateStatus>();
} catch (err) {
// Absent rather than failed on a deployment that did not wire it: nothing
// to show, not an error banner (archie-core-tf20).
update.value = isMissing(err) ? null : { error: errorText(err) };
}
}
export async function deferUpdate(snapshot: unknown): Promise<void> {
await api.chatUpdateDefer(snapshot);
await loadUpdate();
}
export async function installUpdate(snapshot: unknown): Promise<void> {
await api.chatUpdateInstall(snapshot);
await loadUpdate();
}
// ── Dangerous actions ───────────────────────────────────────────────────────
export const dangerous = ref<DangerousActions | null>(null);
@@ -118,17 +74,3 @@ export async function decideDangerous(id: string, decision: string): Promise<voi
await api.chatDangerousDecision(id, decision);
await loadDangerous();
}
// ── Work lifecycle ──────────────────────────────────────────────────────────
export const lifecycle = ref<Lifecycle | null>(null);
export const lifecycleError = ref<string | null>(null);
export async function loadLifecycle(): Promise<void> {
try {
lifecycle.value = await api.taskMeta<Lifecycle>();
lifecycleError.value = null;
} catch (err) {
lifecycleError.value = errorText(err);
}
}
-45
View File
@@ -86,37 +86,6 @@ export interface ConfigView {
schema?: ConfigSection[];
}
/** One component as GET /api/version reports it. */
export interface VersionComponent {
id?: string;
label?: string;
install_type?: string;
running_version?: string;
latest_available?: string;
status?: string;
installed_claim?: string;
reference?: string;
}
/** What one available update carries. The server serves both spellings of
* each key, so both are read -- see UpdateActionsCard. */
export interface AvailableUpdate {
Label?: string;
label?: string;
Available?: string;
available?: string;
}
export interface UpdateStatus {
available?: AvailableUpdate[];
can_install?: boolean;
/** The version snapshot a defer or install decision is made against. The
* server owns its shape; deferred is the one field the UI reads. */
snapshot?: { deferred?: boolean };
/** Set when the read failed rather than being unwired. */
error?: string;
}
/** A rollback point a dangerous action can target. Number and Label arrive in
* either case depending on the source, so both are carried. */
export interface DangerCheckpoint {
@@ -137,17 +106,3 @@ export interface DangerousActions {
/** Set when the read failed rather than being unwired. */
error?: string;
}
/** One lifecycle status or operator action, as GET /api/task-meta reports it.
* A deployment that adds one on the backend shows it here without a frontend
* change. */
export interface LifecycleEntry {
id: string;
label?: string;
kind?: string;
}
export interface Lifecycle {
statuses?: LifecycleEntry[];
actions?: LifecycleEntry[];
}
+2 -4
View File
@@ -9,8 +9,6 @@ import { api } from "@/lib/api";
import { useLiveResource } from "@/stores/live-updates";
import SkillCard, { type Skill } from "./SkillCard.vue";
/** What Archie can do, in plain language. */
const skills = ref<Skill[]>([]);
const search = ref("");
const loadError = ref<string | null>(null);
@@ -38,7 +36,7 @@ const filtered = computed(() => {
<template>
<div>
<PageHeader title="Skills" subtitle="What Archie can do, in plain language." />
<PageHeader title="Skills" />
<Card>
<CardHeader>
@@ -59,7 +57,7 @@ const filtered = computed(() => {
<EmptyTitle>No skills discovered yet</EmptyTitle>
<EmptyDescription>
Skills live as SKILL.md files under project, shared, or user-global .agents/skills/&lt;name&gt;/
directories. Newly discovered skills appear here automatically.
directories.
</EmptyDescription>
</EmptyHeader>
</Empty>
-1
View File
@@ -140,7 +140,6 @@ async function reveal(id: number) {
<div class="mb-5">
<div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Tasks</h1>
<p class="text-fg-muted mt-2 text-sm">Every issue archied has picked up, and where it stands.</p>
</div>
</div>
+1 -3
View File
@@ -12,8 +12,6 @@ import StagesSection from "./StagesSection.vue";
import WorkflowTable from "./WorkflowTable.vue";
import type { WorkflowDefinition, WorkflowStats } from "./workflow-rows";
/** Run outcomes and spend per workflow, and where stages get stuck. */
interface WorkflowsResponse {
definitions?: WorkflowDefinition[];
workflows?: WorkflowStats[];
@@ -43,7 +41,7 @@ onMounted(load);
<template>
<div>
<PageHeader title="Workflows" subtitle="Run outcomes and spend per workflow, and where stages get stuck." />
<PageHeader title="Workflows" />
<!-- Starting work needs a definition to start: with none served, the form
could only be submitted to fail. -->
+51
View File
@@ -0,0 +1,51 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
const { resourcesForEvent } = await import("../src/stores/live-events.ts");
const passiveRefreshSurfaces = [
"../src/dashboard/DashboardActions.vue",
"../src/tasks/TasksPage.vue",
"../src/tasks/TaskHeader.vue",
"../src/tasks/TasksState.vue",
"../src/workflows/WorkflowsPage.vue",
"../src/skills/SkillsPage.vue",
"../src/curators/CuratorsPage.vue",
"../src/channels/ChannelsPage.vue",
"../src/bindings/BindingsPage.vue",
"../src/logs/LogActions.vue",
"../src/settings/SystemStatusPage.vue",
"../src/settings/SystemTasksPage.vue",
"../src/settings/SystemModelsPage.vue",
"../src/settings/SystemReposPage.vue",
"../src/settings/SystemAdvancedPage.vue",
"../src/tasks/PanelError.vue",
"../src/tasks/TaskLogs.vue",
];
test("pages do not expose passive refresh controls", async () => {
for (const path of passiveRefreshSurfaces) {
const source = await readFile(new URL(path, import.meta.url), "utf8");
assert.doesNotMatch(source, />\s*(Refresh|Retry)\s*</, path);
}
});
test("a 401 does not offer a reload that cannot restore authentication", async () => {
const source = await readFile(new URL("../src/tasks/TaskRowActions.vue", import.meta.url), "utf8");
assert.doesNotMatch(source, /Reload to sign in|window\.location\.reload/);
});
test("the application starts one Pinia-owned live update stream", async () => {
const main = await readFile(new URL("../src/main.ts", import.meta.url), "utf8");
assert.match(main, /useLiveUpdatesStore\(pinia\)\.initialize\(\)/);
});
test("backend events invalidate only their owning projections", () => {
assert.deepEqual(resourcesForEvent({ kind: "stage_finish", task_id: 42 }), ["tasks"]);
assert.deepEqual(resourcesForEvent({ kind: "task_queued" }), ["tasks"]);
assert.deepEqual(resourcesForEvent({ kind: "capture" }), ["captures"]);
assert.deepEqual(resourcesForEvent({ kind: "curator_action" }), ["curators", "skills"]);
assert.deepEqual(resourcesForEvent({ kind: "update_report" }), ["updates"]);
assert.deepEqual(resourcesForEvent({ kind: "log" }), []);
});
+29
View File
@@ -0,0 +1,29 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
test("page headings do not narrate their own labels", async () => {
const header = await readFile(new URL("../src/base/PageHeader.vue", import.meta.url), "utf8");
assert.doesNotMatch(header, /subtitle/);
});
test("labeled navigation does not repeat itself in tooltips", async () => {
for (const path of ["../src/components/topbar/Nav.vue", "../src/components/topbar/NavItem.vue"]) {
const source = await readFile(new URL(path, import.meta.url), "utf8");
assert.doesNotMatch(source, /Tooltip(Content|Trigger)?/u, path);
}
});
test("Status shows runtime state instead of configuration summaries", async () => {
const page = await readFile(new URL("../src/settings/SystemStatusPage.vue", import.meta.url), "utf8");
assert.match(page, /HealthStatusCard/);
assert.doesNotMatch(page, /ReadOnlyNotice|ConfigSections|ProvenanceCard|UpdateStatusCard|UpdateActionsCard/);
});
test("Task settings shows settings instead of lifecycle reference data", async () => {
const page = await readFile(new URL("../src/settings/SystemTasksPage.vue", import.meta.url), "utf8");
assert.doesNotMatch(page, /LifecycleCard|ReadOnlyNotice/);
const sections = await readFile(new URL("../src/settings/ConfigSections.vue", import.meta.url), "utf8");
assert.doesNotMatch(sections, /section\.description/);
});
+1
View File
@@ -26,6 +26,7 @@ export default defineConfig({
// the dashboard) so the frontend can be developed without rebuilding Go.
proxy: {
"/api": "http://127.0.0.1:8484",
"/health": "http://127.0.0.1:8484",
"/events": { target: "http://127.0.0.1:8484", ws: true },
},
},