Merge pull request #996 from samcharles93/feat/ui-graphite-theme
Feat/UI graphite theme
This commit is contained in:
commit
6ba43bbf21
205 files changed
+5312
-3218
No files matched your search
@@ -14,7 +14,19 @@ Not editorial, not marketing, not playful. Every rule below serves that.
|
||||
- Vue 3 SFCs + TypeScript, Vite, Pinia, vue-router.
|
||||
- Tailwind CSS v4 via `@tailwindcss/vite`; `@custom-variant dark` keyed on the
|
||||
`[data-theme]` attribute; shadcn-vue + reka-ui for primitives;
|
||||
`@lucide/vue` for icons; `@fontsource-variable/geist` is the typeface.
|
||||
`@lucide/vue` for icons; IBM Plex Sans for UI, IBM Plex Mono for every
|
||||
machine value (Graphite theme, `docs/design/ui-redesign/`).
|
||||
- `ui/src/components/ui/` is CLI-installed only; never hand-edit it. Order of
|
||||
preference for a missing component: stock shadcn-vue (`npx shadcn-vue add`;
|
||||
reka-ui names differ, e.g. chip input is Tags input), another shadcn-vue
|
||||
registry (e.g. inspira-ui), then a new item in the sibling
|
||||
`archie-component-registry` repo, installed from its `public/r/<item>.json`.
|
||||
The CLI prompts to overwrite stock primitives an item depends on: answer no.
|
||||
To update an installed registry item, delete its `components/ui/<item>/`
|
||||
folder and add it again; never pass `--overwrite`, which also rewrites the
|
||||
stock components listed in its `registryDependencies`.
|
||||
If `npm install` fails with `EALLOWSCRIPTS`, run the CLI with
|
||||
`NPM_CONFIG_USERCONFIG=/dev/null`.
|
||||
- Features live in `ui/src/<feature>/` with colocated `.js`/`.css`. Extract a
|
||||
helper to `ui/src/base/` only on the **second distinct consumer**.
|
||||
- `ui/dist/` is committed and generated — never hand-edit it, never ignore it
|
||||
@@ -86,5 +98,5 @@ decisions into SFCs using shadcn-vue primitives and existing tokens. Mock data
|
||||
in a prototype proves nothing — verify the pattern against real task/log/diff
|
||||
shapes before building around it. A prototype proposing new information
|
||||
architecture (e.g. splitting the task view into a master-detail pane) is an
|
||||
open design question: it needs a decisive 1-page doc in `docs/prds/` before
|
||||
structural work lands, per AGENTS.md.
|
||||
open design question for the maintainer. Web UI design is not tracked in
|
||||
`docs/prds/`; record the decision on the bead and in `docs/design/`.
|
||||
+17
-1
@@ -164,7 +164,7 @@ tasks:
|
||||
- |
|
||||
set -eu
|
||||
for _ in $(seq 1 60); do
|
||||
status=$(docker inspect --format '{{.State.Health.Status}}' "$(docker compose ps -q postgres)" 2>/dev/null || true)
|
||||
status=$(docker inspect --format '{{`{{.State.Health.Status}}`}}' "$(docker compose ps -q postgres)" 2>/dev/null || true)
|
||||
if [ "$status" = "healthy" ]; then
|
||||
exit 0
|
||||
fi
|
||||
@@ -176,6 +176,14 @@ tasks:
|
||||
dev:daemon:
|
||||
desc: Run archied with live reload
|
||||
cmds:
|
||||
- |
|
||||
# The daemon and Gateway read their settings from the State Store at
|
||||
# boot and exit if it is not up yet; it starts only once PostgreSQL
|
||||
# is healthy, so wait for its port ([services.state] in
|
||||
# deployments/dev.toml) first.
|
||||
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
||||
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
||||
exit 1
|
||||
- air -build.args_bin="-config-overlay,deployments/dev.toml"
|
||||
|
||||
dev:dashboard:
|
||||
@@ -192,6 +200,14 @@ tasks:
|
||||
dev:gateway:
|
||||
desc: Run the development Gateway
|
||||
cmds:
|
||||
- |
|
||||
# The daemon and Gateway read their settings from the State Store at
|
||||
# boot and exit if it is not up yet; it starts only once PostgreSQL
|
||||
# is healthy, so wait for its port ([services.state] in
|
||||
# deployments/dev.toml) first.
|
||||
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
||||
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
||||
exit 1
|
||||
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
|
||||
|
||||
dev:ui:
|
||||
|
||||
@@ -252,17 +252,11 @@
|
||||
"section": "PRDs",
|
||||
"body": "# Dashboard live state\n\n**Status:** Approved\n\n## Decision\n\nThe dashboard must not require passive **Refresh** buttons. One app-wide Pinia\nstore owns the existing `/api/stream` EventSource and translates backend events\ninto resource revision counters. Pages load their authoritative HTTP projection\non entry and re-read it when the relevant revision changes. Event payloads are\ninvalidation signals, not substitute read models.\n\nSSE remains the transport. Dashboard updates are server-to-client only, and the\nexisting stream already provides replay, reconnect, and persisted ordering; a\nWebSocket would add a second transport without adding a capability.\n\nThe first slice covers resources for which the backend already emits a truthful\nsignal:\n\n- task events invalidate the dashboard, task board, workflow statistics, and\n the matching task-run page;\n- capture events invalidate the capture list;\n- curator events invalidate curator status, and curator actions also invalidate\n the skill catalogue;\n- update reports invalidate System status;\n- opening a page always loads its resource, and reopening the SSE stream\n invalidates mounted projections after a connection loss.\n\nLogs retain their dedicated SSE tail. Local mutations continue to re-read their\nown resource after success. Configuration, channels, and catalogues that have no\nbackend change event load on route entry; future write contracts must emit an\nowner-specific event rather than introduce polling or restore a button.\n\n## Boundaries\n\nThe Pinia store owns browser connection state and invalidation only. It does not\nbecome an alternate backend cache or copy domain state into a generic global\nobject. Existing feature modules continue to own their DTOs and API reads.\n\nOperational commands are not refresh controls. Channel **Reload** remains an\nexplicit adapter lifecycle action. Authentication recovery is also not a data\nrefresh: a 401 moves the application into shared authentication state; reloading\nthe same URL cannot restore Archie's missing or rotated token and must not be\noffered as a fix.\n\n## Verification\n\n- No passive page action renders the label **Refresh** or **Retry** for a read.\n- Only one shared `/api/stream` EventSource is opened by the application.\n- Resource classification tests distinguish task, capture, curator, skill, and\n update invalidations.\n- UI tests, type checking, generated asset freshness, and `task check` pass.\n"
|
||||
},
|
||||
{
|
||||
"url": "/dev/prds/dashboard-navigation-groups/",
|
||||
"title": "Dashboard navigation groups + Configuration split -- decision",
|
||||
"section": "PRDs",
|
||||
"body": "# Dashboard navigation groups + Configuration split -- decision\n\n**Status:** Approved\n**Date:** 2026-09-20\n**Beads issue:** `archie-core-ocfm`\n**Related:** `archie-core-gl96` (Logs absent from the nav -- subsumed here),\n`archie-core-ggqo` (Configuration's page width -- moot once it splits)\n\n## Problem\n\n`ui/src/main.jsx` declares eleven navigable routes in one flat bar. Three of\nthem (Skills, Curators, Channels) are capability-gated and hidden on the\nreference deployment, so the eight items normally visible are the best case,\nnot the worst: a composition that serves every section wraps the bar. Logs is\ndeclared but was never given a nav entry at all, reachable only from a\ndashboard link.\n\nThe labels compound it. \"Event inspector\", \"Field mappings\" and \"Playbook\nbindings\" are three long labels for three faces of one subject, and they sit\nbeside \"Dashboard\" and \"Tasks\" as though they were peers of equal weight.\n\nConfiguration is the other half. One route renders roughly ten sections --\nupdate status, work lifecycle, identity, budgets, storage, listen address,\nrepositories, models and providers, configuration sources, plus the operator\ncards rehomed in `archie-core-tf20` -- in a 4021px page with no in-page\nnavigation. There is no way to send someone to Repositories.\n\n## Decision\n\nFive top-level nav items. Dashboard is a link; the rest are dropdowns.\n\n| Group | Items |\n| --------- | ----------------------------------------------------------------------------------------------- |\n| Dashboard | (link, `/`) |\n| Work | Tasks, Workflows |\n| Agent | Skills, Curators |\n| Events | Inspector, Mappings, Bindings |\n| System | Status, Logs, Appearance; **Settings:** Task settings, Models, Repositories, Channels, Advanced |\n\nItems are renamed because the group now carries the context: \"Event inspector\"\nbecomes \"Inspector\" under Events, and so on. A group renders only if at least\none of its children survives capability gating, and a group left with one\nchild still renders as a dropdown -- a bar whose shape changes per deployment\nis harder to learn than one with a predictable skeleton.\n\nThe System dropdown has two narratives. Status, Logs and Appearance describe\nthe running dashboard and sit first. A separator and visible **Settings** label\nintroduce Task settings, Models, Repositories, Channels and Advanced; those are\nconfiguration destinations, not awkward phrases such as \"System Models\" or\n\"System Advanced\".\n\n### Route map\n\nConfiguration dissolves into real routes. Anchors into one long page were\nrejected: they leave the 4021px page intact and a deep link lands the reader\nmid-scroll with no context above it.\n\n| Was | Becomes | Content |\n| ----------- | -------------------- | ----------------------------------------------------------- |\n| `/settings` | `/system/status` | Update status, configuration sources, daemon listen address |\n| -- | `/system/appearance` | Theme, and the density/motion preferences that follow it |\n| `/settings` | `/system/tasks` | Work lifecycle: statuses, operator actions, budgets |\n| `/settings` | `/system/models` | Model roles, providers |\n| `/settings` | `/system/repos` | Repositories and their per-repo gate overrides |\n| `/settings` | `/system/advanced` | Identity, storage and sandboxing, dangerous actions |\n| `/captures` | `/captures` | unchanged; label becomes \"Inspector\" |\n| `/mappings` | `/mappings` | unchanged; label becomes \"Mappings\" |\n| `/bindings` | `/bindings` | unchanged; label becomes \"Bindings\" |\n\n`/settings` is kept as a permanent redirect to `/system/status`. It is the URL\nin existing bookmarks, in `dashboardPages` (`internal/gateway/dashboard_tools.go`,\nwhich the chat agent navigates by), and in prior conversation history; breaking\nit to save one route entry is not a trade worth making.\n\n`dashboardPages` gains the new routes in the same change. That registry is\nguarded by `TestDashboardPagesRegistryCoversEveryRoute`, so a route added here\nand forgotten there fails the build -- which is how the deleted `/chat` entry\nwas caught.\n\n### Dropdown behaviour\n\nEach item carries a one-line description shown as a hover tooltip, using\nshadcn-vue's `Tooltip` rather than the `title` attribute, so it is kLine truncated
|
||||
},
|
||||
{
|
||||
"url": "/dev/prds/dashboard-port-brief/",
|
||||
"title": "Dashboard port: what the agent delivers",
|
||||
"section": "PRDs",
|
||||
"body": "# Dashboard port: what the agent delivers\n\n**Status:** Approved\n**Date:** 2026-09-20\n**Beads:** `archie-core-tavn` (epic), `archie-core-ocfm` (navigation)\n**Reads with:** `docs/prds/vue-migration-checklist.md` (the item-by-item),\n`docs/prds/dashboard-navigation-groups.md` (the approved nav design)\n\nThis is the standard the port is held to. The checklist says what to port; this\nsays how, and what counts as done. It exists because the first attempt ported\nthe flat topbar verbatim and invented a palette, both of which had already been\ndecided elsewhere.\n\n## The deliverable\n\nThe Preact dashboard, rebuilt in Vue 3 with shadcn-vue, feature complete\nagainst the checklist, gate clean, with `ui/dist` rebuilt and committed in the\nsame commit as the source it was built from.\n\n## Non-negotiables\n\n- **Vue 3 + shadcn-vue (Reka UI, Tailwind v4, Lucide).** A component that\n exists in shadcn-vue is not hand-rolled. Add it with the CLI\n (`npx shadcn-vue@latest add \u003cname\u003e`), do not paste it in.\n- **History routing.** `createWebHistory`, `base: \"/\"`. No hash routing.\n `src/legacy-hash-redirect.ts` handles old `#/path` links and stays.\n- **No test port.** 43 Preact test files are deliberately dropped.\n `task test:ui` is a `vue-tsc` typecheck. Write a test when there is a real\n failure to pin, not to re-assert a port.\n- **Do not downgrade TypeScript.** The target is TS 7 native, not TS 5.\n- **`ui/dist` is law.** Never hand-edit it, never omit it, never revert it.\n- **`task check` is the gate.** Not an assembled substitute for it.\n- **Beads, not markdown TODOs**, for anything that outlives the change.\n- **Conventional commits**, scoped `feat(webui):`. Commit gate-clean work\n without asking. Do not push without being told.\n\n## Componentisation\n\nOne component, one job, one file. A surface is composed from named components,\nnot assembled inside a single large file. The topbar is the worked example and\nthe required shape:\n\n```\ncomponents/topbar/\n Topbar.vue composes the header, owns nothing else\n Brand.vue Logo + BrandName, links to /\n Logo.vue\n BrandName.vue\n Nav.vue reads the nav model, renders links and groups\n NavTrigger.vue the shared top-level control, link or dropdown trigger\n NavGroup.vue one dropdown\n NavItem.vue one item inside a dropdown, with its tooltip\n SearchBar.vue\n SupportLink.vue\n ThemeToggle.vue\n ProfileDropdown.vue\n```\n\nThe same rule applies to every page ported after it. If a file is doing the\nwork of four named things, it is four files. Data and behaviour that more than\none component needs lives in `src/lib/`, not passed down through a chain of\nprops.\n\n## Ordering\n\nBuild the navigation restructure during the port, not after it. Porting the\nflat eleven-item bar first and restructuring later means writing the topbar\ntwice and touching the Go route registry twice. The approved design is five\ntop-level items (Dashboard, Work, Agent, Events, System), items renamed because\ntheir group carries the context, per-item descriptions shown as hover tooltips,\nConfiguration split into `/system/*`, `/settings` kept as a redirect, and Logs\nfinally given a nav entry.\n\n## Design authority\n\n- The approved documents win. Where a document decides something, implement it\n rather than re-deciding it.\n- **Do not invent a visual direction.** Palette, typography and density are the\n maintainer's call. A palette change is its own request, never a side effect\n of a port.\n- Contrast is AA against every surface the foreground lands on, hover states\n included. The corrected values (`--fg-subtle`, the dark\n `--primary-foreground`) came from a measured failure and must survive.\n- `color-scheme` follows the theme so the UA paints controls, scrollbars and\n overscroll to match.\n\n## Code style\n\nComment the non-obvious why: an invariant, a trap, a measurement, a contract\nanother file depends on. Do not narrate what the code plainly does, do not\nexplain a choice that was never in question, and do not write migration phase\nhistory into a diff. That history belongs in the commit message.\n\n## Done, per surface\n\n1. Renders with real data against `task dev`, not just typechecks.\n2. Keyboard reachable, focus visible, and the nav announces where you are.\n3. Works at 1440x900 and at 720px wide, with nothing clipped and no horizontal\n page scroll.\n4. Empty, loading, failed and unconfigured (501) states all say something true.\n A section that cannot load says so; it does not render blank.\n5. `task check` passes, `ui/dist` rebuilt, committed together.\n"
|
||||
"body": "# Dashboard port: what the agent delivers\n\n**Status:** Approved\n**Date:** 2026-09-20\n**Beads:** `archie-core-tavn` (epic), `archie-core-ocfm` (navigation)\n**Reads with:** `docs/prds/vue-migration-checklist.md` (the item-by-item)\n\nThis is the standard the port is held to. The checklist says what to port; this\nsays how, and what counts as done. It exists because the first attempt ported\nthe flat topbar verbatim and invented a palette, both of which had already been\ndecided elsewhere.\n\n## The deliverable\n\nThe Preact dashboard, rebuilt in Vue 3 with shadcn-vue, feature complete\nagainst the checklist, gate clean, with `ui/dist` rebuilt and committed in the\nsame commit as the source it was built from.\n\n## Non-negotiables\n\n- **Vue 3 + shadcn-vue (Reka UI, Tailwind v4, Lucide).** A component that\n exists in shadcn-vue is not hand-rolled. Add it with the CLI\n (`npx shadcn-vue@latest add \u003cname\u003e`), do not paste it in.\n- **History routing.** `createWebHistory`, `base: \"/\"`. No hash routing.\n `src/legacy-hash-redirect.ts` handles old `#/path` links and stays.\n- **No test port.** 43 Preact test files are deliberately dropped.\n `task test:ui` is a `vue-tsc` typecheck. Write a test when there is a real\n failure to pin, not to re-assert a port.\n- **Do not downgrade TypeScript.** The target is TS 7 native, not TS 5.\n- **`ui/dist` is law.** Never hand-edit it, never omit it, never revert it.\n- **`task check` is the gate.** Not an assembled substitute for it.\n- **Beads, not markdown TODOs**, for anything that outlives the change.\n- **Conventional commits**, scoped `feat(webui):`. Commit gate-clean work\n without asking. Do not push without being told.\n\n## Componentisation\n\nOne component, one job, one file. A surface is composed from named components,\nnot assembled inside a single large file. The topbar is the worked example and\nthe required shape:\n\n```\ncomponents/topbar/\n Topbar.vue composes the header, owns nothing else\n Brand.vue Logo + BrandName, links to /\n Logo.vue\n BrandName.vue\n Nav.vue reads the nav model, renders links and groups\n NavTrigger.vue the shared top-level control, link or dropdown trigger\n NavGroup.vue one dropdown\n NavItem.vue one item inside a dropdown, with its tooltip\n SearchBar.vue\n SupportLink.vue\n ThemeToggle.vue\n ProfileDropdown.vue\n```\n\nThe same rule applies to every page ported after it. If a file is doing the\nwork of four named things, it is four files. Data and behaviour that more than\none component needs lives in `src/lib/`, not passed down through a chain of\nprops.\n\n## Ordering\n\nBuild the navigation restructure during the port, not after it. Porting the\nflat eleven-item bar first and restructuring later means writing the topbar\ntwice and touching the Go route registry twice. The approved design is five\ntop-level items (Dashboard, Work, Agent, Events, System), items renamed because\ntheir group carries the context, per-item descriptions shown as hover tooltips,\nConfiguration split into `/system/*`, `/settings` kept as a redirect, and Logs\nfinally given a nav entry.\n\n## Design authority\n\n- The approved documents win. Where a document decides something, implement it\n rather than re-deciding it.\n- **Do not invent a visual direction.** Palette, typography and density are the\n maintainer's call. A palette change is its own request, never a side effect\n of a port.\n- Contrast is AA against every surface the foreground lands on, hover states\n included. The corrected values (`--fg-subtle`, the dark\n `--primary-foreground`) came from a measured failure and must survive.\n- `color-scheme` follows the theme so the UA paints controls, scrollbars and\n overscroll to match.\n\n## Code style\n\nComment the non-obvious why: an invariant, a trap, a measurement, a contract\nanother file depends on. Do not narrate what the code plainly does, do not\nexplain a choice that was never in question, and do not write migration phase\nhistory into a diff. That history belongs in the commit message.\n\n## Done, per surface\n\n1. Renders with real data against `task dev`, not just typechecks.\n2. Keyboard reachable, focus visible, and the nav announces where you are.\n3. Works at 1440x900 and at 720px wide, with nothing clipped and no horizontal\n page scroll.\n4. Empty, loading, failed and unconfigured (501) states all say something true.\n A section that cannot load says so; it does not render blank.\n5. `task check` passes, `ui/dist` rebuilt, committed together.\n"
|
||||
},
|
||||
{
|
||||
"url": "/dev/prds/dashboard-vocabulary/",
|
||||
@@ -508,7 +502,7 @@
|
||||
"url": "/dev/prds/vue-migration-checklist/",
|
||||
"title": "Preact → Vue 3 + shadcn-vue migration checklist",
|
||||
"section": "PRDs",
|
||||
"body": "# Preact → Vue 3 + shadcn-vue migration checklist\n\n**Status:** Approved\n**Date:** 2026-09-20\n**Bead:** `archie-core-tavn` (epic), `archie-core-ocfm` (navigation restructure)\n**Bootstrap commit:** `e18fb8b2`\n\nThe Preact dashboard was deleted, not ported incrementally. This is the list of\nwhat has to exist again, what must not be lost on the way, and the contracts\nthat break silently if missed.\n\nDeleted source is recoverable at `git show e18fb8b2^:ui/src/\u003cpath\u003e`. Every\nclaim below was cross-checked against that tree; where a number is a live\nmeasurement rather than something recoverable from git, it says so.\n\n## Invariants that outlive the framework\n\nThese are not features; they are things other processes depend on. Breaking one\ndoes not show up as a broken page.\n\n- [ ] **Embed contract.** `ui/embed.go` embeds a committed `ui/dist`. The build\n must keep unhashed `assets/index.{js,css}`: dist/ lives in git, and\n hashed names orphan a file on every rebuild.\n- [ ] **Route registry.** `internal/gateway/dashboard_tools.go` hand-copies the\n route table and `TestDashboardPagesRegistryCoversEveryRoute` parses\n `ui/src/router/index.ts` to hold them in step. The parser needs\n `const routes = [` on its own line, `path: \"...\"` on a single line per\n route, and `nav: false` on any entry the registry should skip. That guard\n caught a stale `/chat` entry earlier.\n- [ ] **Mutation headers.** Every POST/PATCH/DELETE must send **both**\n `X-Archie-CSRF: 1` and `Content-Type: application/json`. The server\n returns 403 without the first and 415 without the second\n (`internal/webui/api_tasks.go`, `authorizeTaskMutation`). GET sends\n neither. This is the single most likely thing to silently break every\n write after the port.\n- [x] **History routing.** `createWebHistory`, `base: \"/\"`. Legacy `#/path`\n links are rewritten by `src/legacy-hash-redirect.ts`. The chat navigate\n chip should emit `/tasks`; the Go side already stores bare paths.\n- [ ] **Capability gating.** `GET /api/capabilities`\n (`internal/webui/api_capabilities.go`) returns a `sections` map of ten\n booleans: chat, logs, skills, curators, channels, captures, mappings,\n bindings, and workflows/settings which are always true. A route whose\n section is false must be hidden, not rendered empty. **Fail open**: on a\n failed or null response hide nothing — the old client used a bare\n `.catch(() =\u003e {})` for exactly this. A page that says \"unavailable\" is\n recoverable; a nav entry that vanished is not.\n- [ ] **`LOG_LEVELS`** in `base/log-row.jsx` is a wire contract, not a display\n list: the CSV level filter is matched server-side by `splitCSV` in\n `internal/webui/api_tasks_logs.go`. A value mismatch breaks filtering\n with no error.\n- [ ] **SSE lifecycle.** Three streams, all `id: \u003cn\u003e\\ndata: \u003cjson\u003e\\n\\n` except\n chat which omits the id:\n `/events` (task lifecycle, `sse.go`, supports `?since=` and\n `Last-Event-ID` resume), `/api/logs/stream` (`api_logs.go`, same\n resume protocol), `/api/chat/stream` (`api_chat.go`, frames typed\n delta/tool/media/navigate). Each must be closed on unmount or the app\n leaks a connection per navigation. Preact used an `archie:teardown`\n event; Vue should use `onUnmounted`.\n\n\u003e **On tests.** Per Sam's call, the 43-file suite was not ported and tests\n\u003e return when there is behaviour worth pinning. Flagging one exception for when\n\u003e that moment comes: the deleted `ui/test/api-client.test.js` classified every\n\u003e API method as mutation/read/stream/url and asserted the right headers per\n\u003e class. It is the only cheap guard on the CSRF contract above. (It did **not**\n\u003e text-scan for a second `fetch()` — that check was deliberately removed\n\u003e upstream for testing the file's wording rather than its behaviour.)\n\n## Phase 1 — Foundation\n\n- [x] **Theme.** `css/tokens.css` was a complete two-theme semantic token set\n (`--fg-subtle`, `--accent`, `--ok/warn/danger`, surfaces, shadows). Mapped\n onto Tailwind v4's `@theme` in `src/style.css`; the second system was not\n kept.\n- [x] **`color-scheme`.** `[data-theme=\"dark\"] { color-scheme: dark }` and the\n light equivalent. Without it the UA paints light scrollbars and light\n native controls inside the dark app. Fixed; trivially lost.\n- [x] **Contrast values.** The violet palette moved these off the values pinned\n here, so they were recomputed against its own backgrounds instead of\n carried: `--fg-subtle` `#A99DBD` dark (7.67:1, AAA) / `#6E6577` light\n (4.87:1, AA), and `--fg-muted` `#B9AECB` / `#635B6B` (9.28:1 and 5.70:1).\n The invariant the pin existed for holds; the values are the palette's.\n- [x] **API client** (`base/api.jsx` → `src/lib/api.tLine truncated
|
||||
"body": "# Preact → Vue 3 + shadcn-vue migration checklist\n\n**Status:** Approved\n**Date:** 2026-09-20\n**Bead:** `archie-core-tavn` (epic), `archie-core-ocfm` (navigation restructure)\n**Bootstrap commit:** `e18fb8b2`\n\nThe Preact dashboard was deleted, not ported incrementally. This is the list of\nwhat has to exist again, what must not be lost on the way, and the contracts\nthat break silently if missed.\n\nDeleted source is recoverable at `git show e18fb8b2^:ui/src/\u003cpath\u003e`. Every\nclaim below was cross-checked against that tree; where a number is a live\nmeasurement rather than something recoverable from git, it says so.\n\n## Invariants that outlive the framework\n\nThese are not features; they are things other processes depend on. Breaking one\ndoes not show up as a broken page.\n\n- [ ] **Embed contract.** `ui/embed.go` embeds a committed `ui/dist`. The build\n must keep unhashed `assets/index.{js,css}`: dist/ lives in git, and\n hashed names orphan a file on every rebuild.\n- [ ] **Route registry.** `internal/gateway/dashboard_tools.go` hand-copies the\n route table and `TestDashboardPagesRegistryCoversEveryRoute` parses\n `ui/src/router/index.ts` to hold them in step. The parser needs\n `const routes = [` on its own line, `path: \"...\"` on a single line per\n route, and `nav: false` on any entry the registry should skip. That guard\n caught a stale `/chat` entry earlier.\n- [ ] **Mutation headers.** Every POST/PATCH/DELETE must send **both**\n `X-Archie-CSRF: 1` and `Content-Type: application/json`. The server\n returns 403 without the first and 415 without the second\n (`internal/webui/api_tasks.go`, `authorizeTaskMutation`). GET sends\n neither. This is the single most likely thing to silently break every\n write after the port.\n- [x] **History routing.** `createWebHistory`, `base: \"/\"`. Legacy `#/path`\n links are rewritten by `src/legacy-hash-redirect.ts`. The chat navigate\n chip should emit `/tasks`; the Go side already stores bare paths.\n- [ ] **Capability gating.** `GET /api/capabilities`\n (`internal/webui/api_capabilities.go`) returns a `sections` map of ten\n booleans: chat, logs, skills, curators, channels, captures, mappings,\n bindings, and workflows/settings which are always true. A route whose\n section is false must be hidden, not rendered empty. **Fail open**: on a\n failed or null response hide nothing — the old client used a bare\n `.catch(() =\u003e {})` for exactly this. A page that says \"unavailable\" is\n recoverable; a nav entry that vanished is not.\n- [ ] **`LOG_LEVELS`** in `base/log-row.jsx` is a wire contract, not a display\n list: the CSV level filter is matched server-side by `splitCSV` in\n `internal/webui/api_tasks_logs.go`. A value mismatch breaks filtering\n with no error.\n- [ ] **SSE lifecycle.** Three streams, all `id: \u003cn\u003e\\ndata: \u003cjson\u003e\\n\\n` except\n chat which omits the id:\n `/events` (task lifecycle, `sse.go`, supports `?since=` and\n `Last-Event-ID` resume), `/api/logs/stream` (`api_logs.go`, same\n resume protocol), `/api/chat/stream` (`api_chat.go`, frames typed\n delta/tool/media/navigate). Each must be closed on unmount or the app\n leaks a connection per navigation. Preact used an `archie:teardown`\n event; Vue should use `onUnmounted`.\n\n\u003e **On tests.** Per Sam's call, the 43-file suite was not ported and tests\n\u003e return when there is behaviour worth pinning. Flagging one exception for when\n\u003e that moment comes: the deleted `ui/test/api-client.test.js` classified every\n\u003e API method as mutation/read/stream/url and asserted the right headers per\n\u003e class. It is the only cheap guard on the CSRF contract above. (It did **not**\n\u003e text-scan for a second `fetch()` — that check was deliberately removed\n\u003e upstream for testing the file's wording rather than its behaviour.)\n\n## Phase 1 — Foundation\n\n- [x] **Theme.** `css/tokens.css` was a complete two-theme semantic token set\n (`--fg-subtle`, `--accent`, `--ok/warn/danger`, surfaces, shadows). Mapped\n onto Tailwind v4's `@theme` in `src/style.css`; the second system was not\n kept.\n- [x] **`color-scheme`.** `[data-theme=\"dark\"] { color-scheme: dark }` and the\n light equivalent. Without it the UA paints light scrollbars and light\n native controls inside the dark app. Fixed; trivially lost.\n- [x] **Contrast values.** The violet palette moved these off the values pinned\n here, so they were recomputed against its own backgrounds instead of\n carried: `--fg-subtle` `#A99DBD` dark (7.67:1, AAA) / `#6E6577` light\n (4.87:1, AA), and `--fg-muted` `#B9AECB` / `#635B6B` (9.28:1 and 5.70:1).\n The invariant the pin existed for holds; the values are the palette's.\n- [x] **API client** (`base/api.jsx` → `src/lib/api.tLine truncated
|
||||
},
|
||||
{
|
||||
"url": "/dev/prds/webhook-intake-security/",
|
||||
@@ -693,10 +687,6 @@
|
||||
"title": "Dashboard live state",
|
||||
"url": "/dev/prds/dashboard-live-state/"
|
||||
},
|
||||
{
|
||||
"title": "Dashboard navigation groups + Configuration split -- decision",
|
||||
"url": "/dev/prds/dashboard-navigation-groups/"
|
||||
},
|
||||
{
|
||||
"title": "Dashboard port: what the agent delivers",
|
||||
"url": "/dev/prds/dashboard-port-brief/"
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
# Dashboard navigation groups + Configuration split -- decision
|
||||
|
||||
**Status:** Approved
|
||||
**Date:** 2026-09-20
|
||||
**Beads issue:** `archie-core-ocfm`
|
||||
**Related:** `archie-core-gl96` (Logs absent from the nav -- subsumed here),
|
||||
`archie-core-ggqo` (Configuration's page width -- moot once it splits)
|
||||
|
||||
## Problem
|
||||
|
||||
`ui/src/main.jsx` declares eleven navigable routes in one flat bar. Three of
|
||||
them (Skills, Curators, Channels) are capability-gated and hidden on the
|
||||
reference deployment, so the eight items normally visible are the best case,
|
||||
not the worst: a composition that serves every section wraps the bar. Logs is
|
||||
declared but was never given a nav entry at all, reachable only from a
|
||||
dashboard link.
|
||||
|
||||
The labels compound it. "Event inspector", "Field mappings" and "Playbook
|
||||
bindings" are three long labels for three faces of one subject, and they sit
|
||||
beside "Dashboard" and "Tasks" as though they were peers of equal weight.
|
||||
|
||||
Configuration is the other half. One route renders roughly ten sections --
|
||||
update status, work lifecycle, identity, budgets, storage, listen address,
|
||||
repositories, models and providers, configuration sources, plus the operator
|
||||
cards rehomed in `archie-core-tf20` -- in a 4021px page with no in-page
|
||||
navigation. There is no way to send someone to Repositories.
|
||||
|
||||
## Decision
|
||||
|
||||
Five top-level nav items. Dashboard is a link; the rest are dropdowns.
|
||||
|
||||
| Group | Items |
|
||||
| --------- | ----------------------------------------------------------------------------------------------- |
|
||||
| Dashboard | (link, `/`) |
|
||||
| Work | Tasks, Workflows |
|
||||
| Agent | Skills, Curators |
|
||||
| Events | Inspector, Mappings, Bindings |
|
||||
| System | Status, Logs, Appearance; **Settings:** Task settings, Models, Repositories, Channels, Advanced |
|
||||
|
||||
Items are renamed because the group now carries the context: "Event inspector"
|
||||
becomes "Inspector" under Events, and so on. A group renders only if at least
|
||||
one of its children survives capability gating, and a group left with one
|
||||
child still renders as a dropdown -- a bar whose shape changes per deployment
|
||||
is harder to learn than one with a predictable skeleton.
|
||||
|
||||
The System dropdown has two narratives. Status, Logs and Appearance describe
|
||||
the running dashboard and sit first. A separator and visible **Settings** label
|
||||
introduce Task settings, Models, Repositories, Channels and Advanced; those are
|
||||
configuration destinations, not awkward phrases such as "System Models" or
|
||||
"System Advanced".
|
||||
|
||||
### Route map
|
||||
|
||||
Configuration dissolves into real routes. Anchors into one long page were
|
||||
rejected: they leave the 4021px page intact and a deep link lands the reader
|
||||
mid-scroll with no context above it.
|
||||
|
||||
| Was | Becomes | Content |
|
||||
| ----------- | -------------------- | ----------------------------------------------------------- |
|
||||
| `/settings` | `/system/status` | Update status, configuration sources, daemon listen address |
|
||||
| -- | `/system/appearance` | Theme, and the density/motion preferences that follow it |
|
||||
| `/settings` | `/system/tasks` | Work lifecycle: statuses, operator actions, budgets |
|
||||
| `/settings` | `/system/models` | Model roles, providers |
|
||||
| `/settings` | `/system/repos` | Repositories and their per-repo gate overrides |
|
||||
| `/settings` | `/system/advanced` | Identity, storage and sandboxing, dangerous actions |
|
||||
| `/captures` | `/captures` | unchanged; label becomes "Inspector" |
|
||||
| `/mappings` | `/mappings` | unchanged; label becomes "Mappings" |
|
||||
| `/bindings` | `/bindings` | unchanged; label becomes "Bindings" |
|
||||
|
||||
`/settings` is kept as a permanent redirect to `/system/status`. It is the URL
|
||||
in existing bookmarks, in `dashboardPages` (`internal/gateway/dashboard_tools.go`,
|
||||
which the chat agent navigates by), and in prior conversation history; breaking
|
||||
it to save one route entry is not a trade worth making.
|
||||
|
||||
`dashboardPages` gains the new routes in the same change. That registry is
|
||||
guarded by `TestDashboardPagesRegistryCoversEveryRoute`, so a route added here
|
||||
and forgotten there fails the build -- which is how the deleted `/chat` entry
|
||||
was caught.
|
||||
|
||||
### Dropdown behaviour
|
||||
|
||||
Each item carries a one-line description shown as a hover tooltip, using
|
||||
shadcn-vue's `Tooltip` rather than the `title` attribute, so it is keyboard
|
||||
reachable on focus and styled with the rest of the menu. Touch gets no tooltip,
|
||||
so no item may depend on one to be identifiable.
|
||||
|
||||
The menu is shadcn-vue's `DropdownMenu` (Reka UI underneath), which already
|
||||
supplies the roving focus, ArrowDown/ArrowUp movement, Escape-closes-and-
|
||||
restores-focus, and outside-pointerdown behaviour this would otherwise hand-
|
||||
roll. It opens on click, never on hover -- hover-opened menus on a control
|
||||
plane are a misclick away from a destructive page. The trigger keeps
|
||||
`aria-current` styling when any of its children is the active route, so the bar
|
||||
still says where you are.
|
||||
|
||||
This section was written against the Preact dashboard; the decisions above
|
||||
survive the Vue migration unchanged, only the primitive supplying them
|
||||
changed.
|
||||
|
||||
### Scope boundaries
|
||||
|
||||
- The daemon-backed configuration pages move sections between routes; this
|
||||
change does not alter their read-only configuration contract.
|
||||
- Appearance preferences remain browser-local; they do not create a daemon
|
||||
configuration path. Theme, density, motion and tooltips apply immediately
|
||||
and persist in local browser storage.
|
||||
- Mobile keeps the existing scrollable row of top-level items; groups expand
|
||||
in place rather than opening a floating menu. Nested floating menus on a
|
||||
phone are a separate problem.
|
||||
|
||||
## Consequences
|
||||
|
||||
The bar goes from eleven items to five, and stops depending on capability
|
||||
gating to fit. Logs gets a home. Configuration becomes six linkable pages, and
|
||||
`archie-core-ggqo`'s question about its page width answers itself, because no
|
||||
single page is long enough for the cap to matter.
|
||||
|
||||
The cost is a real routing change with redirects to maintain, and a nav that
|
||||
now needs keyboard and screen-reader behaviour it did not need as a row of
|
||||
links. Both are paid once.
|
||||
@@ -3,8 +3,7 @@
|
||||
**Status:** Approved
|
||||
**Date:** 2026-09-20
|
||||
**Beads:** `archie-core-tavn` (epic), `archie-core-ocfm` (navigation)
|
||||
**Reads with:** `docs/prds/vue-migration-checklist.md` (the item-by-item),
|
||||
`docs/prds/dashboard-navigation-groups.md` (the approved nav design)
|
||||
**Reads with:** `docs/prds/vue-migration-checklist.md` (the item-by-item)
|
||||
|
||||
This is the standard the port is held to. The checklist says what to port; this
|
||||
says how, and what counts as done. It exists because the first attempt ported
|
||||
|
||||
@@ -191,8 +191,7 @@ no horizontal page scroll at either width.
|
||||
|
||||
## Phase 4 — Navigation restructure
|
||||
|
||||
Approved in `docs/prds/dashboard-navigation-groups.md`; build it during the
|
||||
port rather than porting the flat bar first.
|
||||
Build it during the port rather than porting the flat bar first.
|
||||
|
||||
- [x] Five top-level items: Dashboard, Work, Agent, Events, System.
|
||||
- [x] Rename under their group: Inspector, Mappings, Bindings.
|
||||
|
||||
@@ -361,6 +361,10 @@ func (b *boot) openStores(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
b.secrets = secrets
|
||||
if err := resolveProviderSecrets(&b.cfg, secrets, log); err != nil {
|
||||
log.Error("resolve provider secrets", "err", err)
|
||||
return err
|
||||
}
|
||||
b.forgeClient, b.token = resolveForge(cfg.Forge, secrets, log)
|
||||
|
||||
// The daemon and gateway do not serve the State Store's tables: the
|
||||
@@ -1481,6 +1485,7 @@ func (b *boot) configViewInput(ctx context.Context) webui.ConfigViewInput {
|
||||
in := webui.ConfigViewInput{
|
||||
Config: b.cfgHolder.Get(),
|
||||
Provenance: b.configOrigins(),
|
||||
Catalog: catalogView(b.catalog),
|
||||
}
|
||||
if b.lastReload != nil {
|
||||
status := b.lastReload()
|
||||
|
||||
@@ -3,10 +3,12 @@ package archied
|
||||
import (
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog"
|
||||
"github.com/samcharles93/archie-core/internal/secret"
|
||||
"github.com/samcharles93/archie-core/internal/webui"
|
||||
)
|
||||
|
||||
func applyModelCatalog(cfg *config.Config, snapshot modelcatalog.Snapshot) []string {
|
||||
@@ -53,3 +55,23 @@ func mergeProviders(base, overrides map[string]config.Provider) map[string]confi
|
||||
}
|
||||
return merged
|
||||
}
|
||||
|
||||
// catalogView renders the usable providers for the published config view,
|
||||
// sorted by id with each provider's model ids sorted, so the document is
|
||||
// stable across publishes.
|
||||
func catalogView(snapshot modelcatalog.Snapshot) []webui.CatalogProviderView {
|
||||
view := make([]webui.CatalogProviderView, 0, len(snapshot.Providers))
|
||||
for _, provider := range snapshot.Providers {
|
||||
models := make([]string, 0, len(provider.Models))
|
||||
for _, model := range provider.Models {
|
||||
models = append(models, model.ID)
|
||||
}
|
||||
slices.Sort(models)
|
||||
view = append(view, webui.CatalogProviderView{
|
||||
ID: provider.ID, Name: provider.Name, Class: provider.Class,
|
||||
APIKeyEnv: provider.APIKeyEnv, BaseURL: provider.BaseURL, Models: models,
|
||||
})
|
||||
}
|
||||
slices.SortFunc(view, func(a, b webui.CatalogProviderView) int { return strings.Compare(a.ID, b.ID) })
|
||||
return view
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog"
|
||||
"github.com/samcharles93/archie-core/internal/webui"
|
||||
)
|
||||
|
||||
func TestCatalogViewListsEachAvailableProviderWithItsModels(t *testing.T) {
|
||||
snapshot := modelcatalog.Snapshot{Providers: []modelcatalog.Provider{
|
||||
{ID: "openai", Name: "OpenAI", Class: "openai", APIKeyEnv: "OPENAI_API_KEY", Models: []modelcatalog.Model{{ID: "gpt-b"}, {ID: "gpt-a"}}},
|
||||
{ID: "anthropic", Name: "Anthropic", Class: "anthropic", APIKeyEnv: "ANTHROPIC_API_KEY", BaseURL: "https://api.example", Models: []modelcatalog.Model{{ID: "claude"}}},
|
||||
}}
|
||||
want := []webui.CatalogProviderView{
|
||||
{ID: "anthropic", Name: "Anthropic", Class: "anthropic", APIKeyEnv: "ANTHROPIC_API_KEY", BaseURL: "https://api.example", Models: []string{"claude"}},
|
||||
{ID: "openai", Name: "OpenAI", Class: "openai", APIKeyEnv: "OPENAI_API_KEY", Models: []string{"gpt-a", "gpt-b"}},
|
||||
}
|
||||
if got := catalogView(snapshot); !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("catalogView =\n%#v\nwant\n%#v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCatalogViewOfAnEmptySnapshotIsEmptyNotNil(t *testing.T) {
|
||||
got := catalogView(modelcatalog.Snapshot{})
|
||||
if got == nil || len(got) != 0 {
|
||||
t.Fatalf("catalogView(empty) = %#v, want an empty slice", got)
|
||||
}
|
||||
}
|
||||
@@ -30,9 +30,6 @@ func configuredSecretRegistry(cfg *config.Config, log *slog.Logger) (*secret.Reg
|
||||
}
|
||||
log.Info("secret engines loaded", "count", loaded)
|
||||
}
|
||||
if err := resolveProviderSecrets(cfg, registry, log); err != nil {
|
||||
return nil, fmt.Errorf("resolve provider secrets: %w", err)
|
||||
}
|
||||
return registry, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/secret"
|
||||
)
|
||||
|
||||
// The State Store seeds provider-settings from the config it booted with, so
|
||||
// building its secret registry must leave every provider's source reference
|
||||
// in place rather than rewriting it to a process-local env name.
|
||||
func TestConfiguredSecretRegistryKeepsProviderReferences(t *testing.T) {
|
||||
ref := secret.SecretRef{Engine: "env", Key: "OPENAI_KEY"}
|
||||
t.Setenv("OPENAI_KEY", "sk-test")
|
||||
cfg := config.Config{Providers: map[string]config.Provider{"openai": {Class: "openai", APIKey: ref}}}
|
||||
|
||||
if _, err := configuredSecretRegistry(&cfg, slog.New(slog.DiscardHandler)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got := cfg.Providers["openai"]
|
||||
if got.APIKey != ref || got.APIKeyEnv != "" {
|
||||
t.Fatalf("provider rewritten: api_key=%+v api_key_env=%q", got.APIKey, got.APIKeyEnv)
|
||||
}
|
||||
}
|
||||
@@ -30,18 +30,25 @@ var dashboardPages = []DashboardPage{
|
||||
{Path: "/", Label: "Dashboard", Description: "What Archie is working on, what needs you, and token spend."},
|
||||
{Path: "/tasks", Label: "Tasks", Description: "Issues Archie has picked up, and where each one stands."},
|
||||
{Path: "/workflows", Label: "Workflows", Description: "The routed workflows and their run history."},
|
||||
{Path: "/skills", Label: "Skills", Description: "The SKILL.md capabilities Archie can activate."},
|
||||
{Path: "/curators", Label: "Curators", Description: "Scheduled passes that curate Archie's memory and captures."},
|
||||
{Path: "/settings/skills", Label: "Skills", Description: "The SKILL.md capabilities Archie can activate."},
|
||||
{Path: "/settings/curators", Label: "Curators", Description: "Scheduled passes that curate Archie's memory and captures."},
|
||||
{Path: "/events", Label: "Events", Description: "Captured inbound events, how their fields map, and which workflow they start."},
|
||||
{Path: "/logs", Label: "Logs", Description: "The daemon log stream, filterable by level and component."},
|
||||
{Path: "/channels", Label: "Channels", Description: "Inbound chat and notification channels, and their state."},
|
||||
{Path: "/system/status", Label: "Status", Description: "Update state, configuration sources, and the listen address."},
|
||||
{Path: "/system/appearance", Label: "Appearance", Description: "Theme and display preferences."},
|
||||
{Path: "/system/tasks", Label: "Task settings", Description: "Work lifecycle: statuses, operator actions, and budgets."},
|
||||
{Path: "/system/models", Label: "Models", Description: "Model roles and the providers backing them."},
|
||||
{Path: "/system/repos", Label: "Repositories", Description: "Repositories Archie watches, and their per-repo gate overrides."},
|
||||
{Path: "/system/identities", Label: "Identities", Description: "Persistent actors and lifecycle."},
|
||||
{Path: "/system/advanced", Label: "Advanced", Description: "Identity, storage, sandboxing, and dangerous actions."},
|
||||
{Path: "/settings/channels", Label: "Channels", Description: "Inbound chat and notification channels, and their state."},
|
||||
{Path: "/settings/status", Label: "Status", Description: "Update state, configuration sources, and the listen address."},
|
||||
{Path: "/settings/appearance", Label: "Appearance", Description: "Theme and display preferences."},
|
||||
{Path: "/settings/task-execution", Label: "Task execution", Description: "Work lifecycle: statuses, operator actions, and budgets."},
|
||||
{Path: "/settings/models", Label: "Models", Description: "Model roles and the providers backing them."},
|
||||
{Path: "/settings/repositories", Label: "Repositories", Description: "Repositories Archie watches, and their per-repo gate overrides."},
|
||||
{Path: "/settings/identities", Label: "Identities", Description: "Persistent actors and lifecycle."},
|
||||
{Path: "/settings/personas", Label: "Personas", Description: "The system prompts chat runs under, and the default."},
|
||||
{Path: "/settings/schedules", Label: "Schedules", Description: "Work Archie starts on its own, on a timetable."},
|
||||
{Path: "/settings/scheduling-policy", Label: "Scheduling policy", Description: "How Archie finds work and labels its state on the forge."},
|
||||
{Path: "/settings/tools", Label: "Tools & MCP", Description: "The tools agents can call, and the MCP servers that add more."},
|
||||
{Path: "/settings/history", Label: "History", Description: "Every settings change: who made it, when, and what it was before."},
|
||||
{Path: "/settings/plugins", Label: "Plugins", Description: "Directories Archie loads extensions from at startup."},
|
||||
{Path: "/settings/container-runtime", Label: "Container runtime", Description: "The containers agents run in."},
|
||||
{Path: "/settings/advanced", Label: "Advanced", Description: "Actions that stop or roll back archied."},
|
||||
}
|
||||
|
||||
// DashboardPages returns a copy of the dashboard page registry.
|
||||
|
||||
@@ -141,8 +141,12 @@ type ConfigView struct {
|
||||
// Chat carries the dashboard's own chat-page settings. They are
|
||||
// daemon configuration the page cannot otherwise see: a process that
|
||||
// renders a published snapshot has no [chat] section to read.
|
||||
Chat ChatView `json:"chat"`
|
||||
Provenance []ConfigOrigin `json:"provenance"`
|
||||
Chat ChatView `json:"chat"`
|
||||
// Catalog lists the providers the model catalog found usable (their key
|
||||
// is set in the environment, or they are configured), with their models,
|
||||
// so Settings can offer to enable one and pick role models from it.
|
||||
Catalog []CatalogProviderView `json:"catalog"`
|
||||
Provenance []ConfigOrigin `json:"provenance"`
|
||||
// Reload reports the most recent config reload outcome. Omitted when
|
||||
// the reload status is unavailable.
|
||||
Reload *config.ReloadStatus `json:"reload,omitempty"`
|
||||
@@ -337,6 +341,19 @@ type ConfigViewInput struct {
|
||||
Provenance []ConfigOrigin
|
||||
// Reload is the most recent reload outcome, or nil when unavailable.
|
||||
Reload *config.ReloadStatus
|
||||
// Catalog is the usable-provider catalog the configuration owner loaded.
|
||||
Catalog []CatalogProviderView
|
||||
}
|
||||
|
||||
// CatalogProviderView is one usable provider from the model catalog. It
|
||||
// names the environment variable its key was found in, never the key.
|
||||
type CatalogProviderView struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Class string `json:"class"`
|
||||
APIKeyEnv string `json:"api_key_env,omitempty"`
|
||||
BaseURL string `json:"base_url,omitempty"`
|
||||
Models []string `json:"models"`
|
||||
}
|
||||
|
||||
// BuildConfigView renders the dashboard's secret-free configuration
|
||||
@@ -393,6 +410,7 @@ func BuildConfigView(in ConfigViewInput) ConfigView {
|
||||
Listen: cfg.Web.Listen,
|
||||
TrustForwardedHeaders: cfg.Web.TrustForwardedHeaders,
|
||||
},
|
||||
Catalog: append([]CatalogProviderView{}, in.Catalog...),
|
||||
Chat: ChatView{
|
||||
ShowToolCalls: cfg.Chat.ShowToolCalls,
|
||||
Operator: strings.TrimSpace(cfg.Chat.Operator),
|
||||
|
||||
@@ -84,13 +84,9 @@ type ConfigSection struct {
|
||||
// writing:
|
||||
// - reloadableFields lists BotUser, BotEmail, Label, DiffCapLines, Budgets,
|
||||
// Models -- all reloadable.
|
||||
// - reloadableSubFields["Containers"] allows only VolumeTTL --
|
||||
// every other Containers field (Image, MaxConcurrency,
|
||||
// MaxUptime, PullPolicy, Network) requires a restart.
|
||||
// - reloadableSubFields["Forge"] allows only Host -- Forge.Type requires a
|
||||
// restart even though the dashboard already renders it as editable.
|
||||
// - Web, SkillsDir, PluginDir, SecretEngineDir are absent from both
|
||||
// allowlists entirely, so they require a restart.
|
||||
// - Web is absent from both allowlists entirely, so it requires a restart.
|
||||
// - WorkDir and DatabaseURL are locked (configuration.DeniedKeys), not merely
|
||||
// restart-required -- the dashboard cannot change them at all.
|
||||
func configFieldDescriptors() []ConfigSection {
|
||||
@@ -143,21 +139,12 @@ func configFieldDescriptors() []ConfigSection {
|
||||
},
|
||||
{
|
||||
ID: "storage",
|
||||
Label: "Storage & sandboxing",
|
||||
Description: "Where archied keeps its state, and how it isolates task execution.",
|
||||
Label: "Storage",
|
||||
Description: "Where archied keeps its state.",
|
||||
Fields: []ConfigField{
|
||||
{Key: "work_dir", Label: "Work directory", Type: FieldString, Editable: false},
|
||||
{Key: "state_dir", Label: "State directory", Description: "Embedded NATS store, task logs and the readiness disk probe.", Type: FieldString, Editable: false},
|
||||
{Key: "database_url", Label: "PostgreSQL URL", Description: "The State Store's database connection; set at boot, restart required.", Type: FieldString, Editable: false},
|
||||
{Key: "skills_dir", Label: "Shared skills directory", Description: "Empty uses the work directory.", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
{Key: "plugin_dir", Label: "Daemon plugin directory", Description: "Empty means no daemon plugins.", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
{Key: "secret_engine_dir", Label: "Secret engine plugin directory", Description: "Empty means built-in secret engines only.", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
{Key: "containers.image", Label: "Agent image", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
{Key: "containers.max_concurrency", Label: "Max concurrent tasks", Description: "0 means unlimited.", Type: FieldInt, Editable: true, RestartRequired: true},
|
||||
{Key: "containers.max_uptime", Label: "Container max lifetime", Type: FieldDuration, Editable: true, RestartRequired: true},
|
||||
{Key: "containers.volume_ttl", Label: "Persistent volume retention", Type: FieldDuration, Editable: true},
|
||||
{Key: "containers.pull_policy", Label: "How images are refreshed", Description: `"missing" pulls only when the image isn't present locally; "always" pulls before every run.`, Type: FieldEnum, Options: []string{"missing", "always"}, Editable: true, RestartRequired: true},
|
||||
{Key: "containers.network", Label: "Docker network", Description: "Empty auto-detects the Docker network.", Type: FieldString, Editable: true, RestartRequired: true},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -179,31 +166,22 @@ func configFieldDescriptors() []ConfigSection {
|
||||
// field safe to show."
|
||||
func configFieldValues(view ConfigView) map[string]any {
|
||||
return map[string]any{
|
||||
"bot_user": view.Identity.BotUser,
|
||||
"bot_email": view.Identity.BotEmail,
|
||||
"label": view.Identity.Label,
|
||||
"forge.type": view.Identity.ForgeType,
|
||||
"forge.host": view.Identity.ForgeHost,
|
||||
"diff_cap_lines": view.Identity.DiffCapLines,
|
||||
"repos": view.Repositories,
|
||||
"models": view.Models,
|
||||
"providers": view.Providers,
|
||||
"budgets.max_steps": view.Budgets.MaxSteps,
|
||||
"budgets.wall_clock": view.Budgets.WallClock,
|
||||
"budgets.gate_max_failures": view.Budgets.GateMaxFailures,
|
||||
"work_dir": view.Storage.WorkDir,
|
||||
"state_dir": view.Storage.StateDir,
|
||||
"database_url": view.Storage.DatabaseURL,
|
||||
"skills_dir": view.Storage.SkillsDir,
|
||||
"plugin_dir": view.Storage.PluginDir,
|
||||
"secret_engine_dir": view.Storage.SecretEngineDir,
|
||||
"containers.image": view.Containers.Image,
|
||||
"containers.max_concurrency": view.Containers.MaxConcurrency,
|
||||
"containers.max_uptime": view.Containers.MaxUptime,
|
||||
"containers.volume_ttl": view.Containers.VolumeTTL,
|
||||
"containers.pull_policy": view.Containers.PullPolicy,
|
||||
"containers.network": view.Containers.Network,
|
||||
"web.listen": view.Web.Listen,
|
||||
"bot_user": view.Identity.BotUser,
|
||||
"bot_email": view.Identity.BotEmail,
|
||||
"label": view.Identity.Label,
|
||||
"forge.type": view.Identity.ForgeType,
|
||||
"forge.host": view.Identity.ForgeHost,
|
||||
"diff_cap_lines": view.Identity.DiffCapLines,
|
||||
"repos": view.Repositories,
|
||||
"models": view.Models,
|
||||
"providers": view.Providers,
|
||||
"budgets.max_steps": view.Budgets.MaxSteps,
|
||||
"budgets.wall_clock": view.Budgets.WallClock,
|
||||
"budgets.gate_max_failures": view.Budgets.GateMaxFailures,
|
||||
"work_dir": view.Storage.WorkDir,
|
||||
"state_dir": view.Storage.StateDir,
|
||||
"database_url": view.Storage.DatabaseURL,
|
||||
"web.listen": view.Web.Listen,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,7 @@ func TestConfigFieldDescriptorsAreComplete(t *testing.T) {
|
||||
"bot_user", "bot_email", "label", "forge.type", "forge.host", "diff_cap_lines",
|
||||
"repos", "models", "providers",
|
||||
"budgets.max_steps", "budgets.wall_clock", "budgets.gate_max_failures",
|
||||
"work_dir", "state_dir", "database_url", "skills_dir", "plugin_dir", "secret_engine_dir",
|
||||
"containers.image", "containers.max_concurrency", "containers.max_uptime",
|
||||
"containers.volume_ttl", "containers.pull_policy", "containers.network",
|
||||
"work_dir", "state_dir", "database_url",
|
||||
"web.listen",
|
||||
}
|
||||
for _, key := range wantKeys {
|
||||
@@ -87,31 +85,22 @@ func TestConfigFieldDescriptorsAreComplete(t *testing.T) {
|
||||
// defaulting to false ("this takes effect immediately") when it does not.
|
||||
func TestConfigFieldDescriptorsRestartRequiredIsDeliberate(t *testing.T) {
|
||||
want := map[string]bool{
|
||||
"bot_user": false,
|
||||
"bot_email": false,
|
||||
"label": false,
|
||||
"forge.type": true, // reloadableSubFields["Forge"] allows only Host
|
||||
"forge.host": false,
|
||||
"diff_cap_lines": false,
|
||||
"repos": false,
|
||||
"models": false,
|
||||
"providers": false,
|
||||
"budgets.max_steps": false,
|
||||
"budgets.wall_clock": false,
|
||||
"budgets.gate_max_failures": false,
|
||||
"work_dir": false, // locked, not merely restart-required
|
||||
"state_dir": false, // locked, not merely restart-required
|
||||
"database_url": false, // locked, not merely restart-required
|
||||
"skills_dir": true, // absent from reloadableFields
|
||||
"plugin_dir": true,
|
||||
"secret_engine_dir": true,
|
||||
"containers.image": true, // absent from reloadableSubFields["Containers"]
|
||||
"containers.max_concurrency": true,
|
||||
"containers.max_uptime": true,
|
||||
"containers.volume_ttl": false, // reloadableSubFields["Containers"] allows VolumeTTL
|
||||
"containers.pull_policy": true,
|
||||
"containers.network": true,
|
||||
"web.listen": true, // Web is absent from both allowlists entirely
|
||||
"bot_user": false,
|
||||
"bot_email": false,
|
||||
"label": false,
|
||||
"forge.type": true, // reloadableSubFields["Forge"] allows only Host
|
||||
"forge.host": false,
|
||||
"diff_cap_lines": false,
|
||||
"repos": false,
|
||||
"models": false,
|
||||
"providers": false,
|
||||
"budgets.max_steps": false,
|
||||
"budgets.wall_clock": false,
|
||||
"budgets.gate_max_failures": false,
|
||||
"work_dir": false, // locked, not merely restart-required
|
||||
"state_dir": false, // locked, not merely restart-required
|
||||
"database_url": false, // locked, not merely restart-required
|
||||
"web.listen": true, // Web is absent from both allowlists entirely
|
||||
}
|
||||
for _, section := range configFieldDescriptors() {
|
||||
for _, f := range section.Fields {
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
// Package webui is archied's dashboard: a control room over the daemon's
|
||||
// task board, activity stream and configuration.
|
||||
//
|
||||
// The Go side owns serving and the JSON API only; the frontend lives in the
|
||||
// repo-root ui/ package, which exposes the built assets as an embedded FS.
|
||||
// Handlers are split by concern -- one file per API area -- so a section can
|
||||
// be added without growing a single file without end.
|
||||
// Package webui implements the dashboard's HTTP API and serves the embedded SPA.
|
||||
package webui
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"$schema": "https://shadcn-vue.com/schema.json",
|
||||
"style": "reka-nova",
|
||||
"font": "geist-sans",
|
||||
"typescript": true,
|
||||
"tailwind": {
|
||||
"config": "",
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+2
-1
@@ -1 +1,2 @@
|
||||
.identities-page[data-v-f89d6a16]{max-width:960px}.identity-create[data-v-f89d6a16]{gap:.75rem;margin:1.5rem 0;display:flex}.identity-create input[data-v-f89d6a16]{flex:1}.identity-create input[data-v-f89d6a16],.identity-create select[data-v-f89d6a16],.identity-create button[data-v-f89d6a16],.actions button[data-v-f89d6a16]{border:1px solid var(--border);background:var(--surface);color:inherit;border-radius:.5rem;padding:.6rem .8rem}.identity-list[data-v-f89d6a16]{border-top:1px solid var(--border)}.identity-row[data-v-f89d6a16]{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:1rem;padding:1rem 0;display:flex}.identity-row span[data-v-f89d6a16]{color:var(--muted-foreground);text-transform:capitalize;margin-top:.2rem;font-size:.85rem;display:block}.actions[data-v-f89d6a16]{gap:.5rem;display:flex}.actions .danger[data-v-f89d6a16],.error[data-v-f89d6a16]{color:var(--destructive)}@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-y-reverse:0;--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-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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 thLine truncated
|
||||
/*! 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-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-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:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-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:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-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:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-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:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-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}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-400-normal.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-vietnamese-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-400-normal.woff)fLine truncated
|
||||
Vendored
+11
-11
@@ -1,20 +1,20 @@
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>C(e)===`[object Map]`,h=e=>C(e)===`[object Set]`,g=e=>C(e)===`[object Date]`,_=e=>C(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,ee=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),S=Object.prototype.toString,C=e=>S.call(e),te=e=>C(e).slice(8,-1),ne=e=>C(e)===`[object Object]`,re=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ie=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ae=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},oe=/-\w/g,se=ae(e=>e.replace(oe,e=>e.slice(1).toUpperCase())),ce=/\B([A-Z])/g,le=ae(e=>e.replace(ce,`-$1`).toLowerCase()),ue=ae(e=>e.charAt(0).toUpperCase()+e.slice(1)),de=ae(e=>e?`on${ue(e)}`:``),w=(e,t)=>!Object.is(e,t),fe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},pe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},me=e=>{let t=parseFloat(e);return isNaN(t)?e:t},he=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ge,_e=()=>ge||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ve=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function ye(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?Ce(r):ye(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var be=/;(?![^(]*\))/g,xe=/:([^]+)/,Se=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Ce(e){let t={};return e.replace(Se,e=>e.startsWith(`/*`)?``:e).split(be).forEach(e=>{if(e){let n=e.split(xe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function T(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=T(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function we(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=T(t)),n&&(e.style=ye(n)),e}var Te=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Ee=n(Te);Te+``;function De(e){return!!e||e===``}function Oe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Me(e[i],t[i],n);return r}function ke(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Me(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ae(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?ke(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Me(e[r],t[r],n))return!1}return String(e)===String(t)}function je(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Me(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?je(e,t,n,Oe):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:je(e,t,n,Ae):String(e)===String(t))))}function Ne(e,t){return e.findIndex(e=>Me(e,t))}var Pe=e=>!!(e&&e.__v_isRef===!0),E=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===S||!v(e.toString))?Pe(e)?E(e.value):JSON.stringify(e,Fe,2):String(e),Fe=(e,t)=>Pe(t)?Fe(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ie(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ie(e))}:b(t)?Ie(t):x(t)&&!p(t)&&!ne(t)?String(t):t,Ie=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function Le(e){return e==null?`initial`:tLine truncated
|
||||
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
||||
`)&&(Ai(e,0)||bi(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!ie(a)||a[0]===`.`||t&&!ie(a)||u&&u.includes(a)){if(Di(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&ln(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Ps(x,n,t),h&&Tr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&us(()=>{x&&Ps(x,n,t),l&&g.enter(e),h&&Tr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=js(d[t]),g=h.type===ps;e?(g&&!u&&t+1<p&&js(d[t+1]).type===ps&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,Ai(r,1)||bi()),n(null,h,r,null,o,s,Ci(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&wi(f)&&f.data===`]`?a(t.anchor=f):(bi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Mi(e,t)||bi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,Ci(d),s),r&&(r.vnode.el=t.el,Co(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&wi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var Ei=new Set([`src`,`srcset`,`href`,`poster`]);function Di(e,t,n){return Ei.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Oi=`data-allow-mismatch`,ki={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Ai(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Oi);)e=e.parentElement;return ji(e&&e.getAttribute(Oi),t)}function ji(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(ki[t])}}function Mi(e,t){return Ai(e.parentElement,1)||Ni(e)||Pi(t)}function Ni(e){return e.nodeType===1&&ji(e.getAttribute(Oi),1)}function Pi({props:e}){let t=e&&e[Oi];return typeof t==`string`&&ji(t,1)}var Fi=_e().requestIdleCallback||(e=>setTimeout(e,1)),Ii=_e().cancelIdleCallback||(e=>clearTimeout(e)),Li=(e=1e4)=>t=>{let n=Fi(t,{timeout:e});return()=>Ii(n)};function Ri(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var zi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ri(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Bi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Vi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Hi(e,t){if(wi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(wi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ui=e=>!!e.type.__asyncLoader;function Wi(e){v(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 j({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Hi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Rs;if(pi(e),u)return()=>Gi(u,e);let t=t=>{l=null,Zn(t,e,13,!r)};if(s&&e.suspense||Gs)return p().then(t=>()=>Gi(t,e)).catch(e=>(t(e),()=>r?z(r,{error:e}):null));let a=D(!1),c=D(),d=D(!!i),f,m;return ca(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ki(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Gi(u,e);if(c.value&&r)return z(r,{error:c.value});if(n&&
Line truncated
|
||||
`))),e[Kl]=Ul(i);let a=r||i.props&&i.props.type===`number`;ul(e,t?`change`:`input`,t=>{t.target.composing||e[Kl](Jl(e.value,n,a))}),(n||a)&&ul(e,`change`,()=>{e.value=Jl(e.value,n,a)}),t||(ul(e,`compositionstart`,Wl),ul(e,`compositionend`,Gl),ul(e,`change`,Gl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ql];delete e[ql],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Kl](Jl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Kl]=Ul(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?me(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Xl={deep:!0,created(e,t,n){e[Kl]=Ul(n),ul(e,`change`,()=>{let t=e._modelValue,n=nu(e),r=e.checked,i=e[Kl];if(p(t)){let e=Ne(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(ru(e,r))})},mounted:Zl,beforeUpdate(e,t,n){e[Kl]=Ul(n),Zl(e,t,n)}};function Zl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=Ne(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Me(t,ru(e,!0))}e.checked!==i&&(e.checked=i)}var Ql={created(e,{value:t},n){e.checked=Me(t,n.props.value),e[Kl]=Ul(n),ul(e,`change`,()=>{e[Kl](nu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Kl]=Ul(r),t!==n&&(e.checked=Me(t,r.props.value))}},$l={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ul(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?me(nu(e)):nu(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Kl](i)}finally{or(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Kl]=Ul(r)},mounted(e,{value:t}){tu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Kl]=Ul(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!eu(t,n[1],n[0]))&&tu(e,t)}};function eu(e,t,n){if(!n||p(e))return Me(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function tu(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=nu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ne(t,o)>-1}else a.selected=t.has(o)}else if(Me(nu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function nu(e){return`_value`in e?e._value:e.value}function ru(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var iu={created(e,t,n){ou(e,t,n,null,`created`)},mounted(e,t,n){ou(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ou(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ou(e,t,n,r,`updated`)}};function au(e,t){switch(e){case`SELECT`:return $l;case`TEXTAREA`:return Yl;default:switch(t){case`checkbox`:return Xl;case`radio`:return Ql;default:return Yl}}}function ou(e,t,n,r,i){let a=au(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function su(){Yl.getSSRProps=({value:e})=>({value:e}),Ql.getSSRProps=({value:e},t)=>{if(t.props&&Me(t.props.value,e))return{checked:!0}},Xl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&Ne(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=au(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var cu=[`ctrl`,`shift`,`alt`,`meta`],lu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>cu.some(n=>e[`${n}Key`]&&!t.includes(n))},uu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=lu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},du={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},fu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=le(n.key);if(t.some(e=>e===r||du[e]===r))return e(n)}))},pu=l({patchProp:Sl},Sc),mu,hu=!1;function gu(){return mu||=Uo(pu)}function _u(){return mu=hu?mu:Wo(pu),hu=!0,mu}var vu=((...e)=>{gu().render(...e)}),yu=((...e)=>{_u().hydrate(...e)}),bu=((...e)=>{let t=gu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Cu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Su(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),xu=((
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ip;function Lp(e){Ip=e}var Rp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function zp(e){let t=e instanceof Rp?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 Bp(e,t){let n=await fetch(e,t);if(Ip?.(n.status===401),!n.ok)throw new Rp(await Fp(n),n.status);return n}async function q(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Np,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 Bp(e,s);return a?await c.json():void 0}var J={health:()=>q(`/health/detailed`),summary:()=>q(`/api/summary`),tasks:()=>q(`/api/tasks`),taskMeta:()=>q(`/api/task-meta`),task:e=>q(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>q(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>q(`/api/tasks/${encodeURIComponent(e)}/changes`+Pp(t)),taskDebug:(e,t)=>q(`/api/tasks/${encodeURIComponent(e)}/debug`+Pp(t)),taskAction:(e,t)=>q(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>q(`/api/setup`),capabilities:()=>q(`/api/capabilities`),workflows:()=>q(`/api/workflows`),workRequest:e=>q(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>q(`/api/skills`),channels:()=>q(`/api/channels`),curators:()=>q(`/api/curators`),channelReload:e=>q(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>q(`/api/config`),logs:e=>q(`/api/logs`+Pp(e)),taskLogs:(e,t)=>q(`/api/tasks/${encodeURIComponent(e)}/logs`+Pp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>q(`/api/version`),updateSnapshot:()=>q(`/api/chat/update`),updateInstall:e=>q(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>q(`/api/captures`+Pp({limit:e})),eventTypes:()=>q(`/api/event-types`),eventTypeCreate:e=>q(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>q(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>q(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>q(`/api/mappings`),mappingCreate:e=>q(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>q(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>q(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>q(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>q(`/api/bindings`),bindingCreate:e=>q(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>q(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>q(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>q(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),sources:()=>q(`/api/sources`),sourceCreate:e=>q(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>q(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>q(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>q(`/api/sources/${encodeURIComponent(e)}/secret`,{method:`POST`}),chatSessions:()=>q(`/api/chat/sessions`),chatMessages:e=>q(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>q(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>q(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>q(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Mp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>q(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>q(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>q(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>q(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Bp(`/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 Vp(e,t,n=``,r=!1){let i=new EventSource(jp(n,r));return i.onopen=()=>t(`live`),i.onerror=()=>t(Ap(i.readyState)),i.onmessage=t=>{try{e(JSON.parse(t.data),t.lastEventId)}catch{}},()=>i.close()}var Hp=`archie.web.chat.channel`;function Up(){let e=localStorage.getItem(Hp);return e||(e=Mp(),localStorage.setItem(Hp,e)),e}var Wp=/(?:^|\s)\/([^\s]*)$/,Gp=/(?:^|\s)\/[^\s]*$/,Kp=8;function qp(e,t,n){let r=t.slice(0,n).match(Wp);if(!r)return[];let i=r[1].toLowerCase();return e.filter(e=>`${e.command} ${e.description?Line truncated
|
||||
`))),e[Kl]=Ul(i);let a=r||i.props&&i.props.type===`number`;ul(e,t?`change`:`input`,t=>{t.target.composing||e[Kl](Jl(e.value,n,a))}),(n||a)&&ul(e,`change`,()=>{e.value=Jl(e.value,n,a)}),t||(ul(e,`compositionstart`,Wl),ul(e,`compositionend`,Gl),ul(e,`change`,Gl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ql];delete e[ql],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Kl](Jl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Kl]=Ul(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?me(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Xl={deep:!0,created(e,t,n){e[Kl]=Ul(n),ul(e,`change`,()=>{let t=e._modelValue,n=nu(e),r=e.checked,i=e[Kl];if(p(t)){let e=Ne(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(ru(e,r))})},mounted:Zl,beforeUpdate(e,t,n){e[Kl]=Ul(n),Zl(e,t,n)}};function Zl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=Ne(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Me(t,ru(e,!0))}e.checked!==i&&(e.checked=i)}var Ql={created(e,{value:t},n){e.checked=Me(t,n.props.value),e[Kl]=Ul(n),ul(e,`change`,()=>{e[Kl](nu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Kl]=Ul(r),t!==n&&(e.checked=Me(t,r.props.value))}},$l={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ul(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?me(nu(e)):nu(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Kl](i)}finally{or(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Kl]=Ul(r)},mounted(e,{value:t}){tu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Kl]=Ul(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!eu(t,n[1],n[0]))&&tu(e,t)}};function eu(e,t,n){if(!n||p(e))return Me(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function tu(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=nu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ne(t,o)>-1}else a.selected=t.has(o)}else if(Me(nu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function nu(e){return`_value`in e?e._value:e.value}function ru(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var iu={created(e,t,n){ou(e,t,n,null,`created`)},mounted(e,t,n){ou(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ou(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ou(e,t,n,r,`updated`)}};function au(e,t){switch(e){case`SELECT`:return $l;case`TEXTAREA`:return Yl;default:switch(t){case`checkbox`:return Xl;case`radio`:return Ql;default:return Yl}}}function ou(e,t,n,r,i){let a=au(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function su(){Yl.getSSRProps=({value:e})=>({value:e}),Ql.getSSRProps=({value:e},t)=>{if(t.props&&Me(t.props.value,e))return{checked:!0}},Xl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&Ne(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=au(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var cu=[`ctrl`,`shift`,`alt`,`meta`],lu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>cu.some(n=>e[`${n}Key`]&&!t.includes(n))},uu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=lu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},du={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},fu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=le(n.key);if(t.some(e=>e===r||du[e]===r))return e(n)}))},pu=l({patchProp:Sl},Sc),mu,hu=!1;function gu(){return mu||=Uo(pu)}function _u(){return mu=hu?mu:Wo(pu),hu=!0,mu}var vu=((...e)=>{gu().render(...e)}),yu=((...e)=>{_u().hydrate(...e)}),bu=((...e)=>{let t=gu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Cu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Su(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),xu=((
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Kp;function qp(e){Kp=e}var Jp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Yp(e){let t=e instanceof Jp?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 Xp(e,t){let n=await fetch(e,t);if(Kp?.(n.status===401),!n.ok)throw new Jp(await Gp(n),n.status);return n}async function Zp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Up,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 Xp(e,s);return a?await c.json():void 0}var q={health:()=>Zp(`/health/detailed`),summary:()=>Zp(`/api/summary`),tasks:()=>Zp(`/api/tasks`),taskMeta:()=>Zp(`/api/task-meta`),task:e=>Zp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Zp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Zp(`/api/tasks/${encodeURIComponent(e)}/changes`+Wp(t)),taskDebug:(e,t)=>Zp(`/api/tasks/${encodeURIComponent(e)}/debug`+Wp(t)),taskAction:(e,t)=>Zp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t}}),setup:()=>Zp(`/api/setup`),capabilities:()=>Zp(`/api/capabilities`),workflows:()=>Zp(`/api/workflows`),workRequest:e=>Zp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Zp(`/api/skills`),channels:()=>Zp(`/api/channels`),curators:()=>Zp(`/api/curators`),channelReload:e=>Zp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Zp(`/api/config`),logs:e=>Zp(`/api/logs`+Wp(e)),taskLogs:(e,t)=>Zp(`/api/tasks/${encodeURIComponent(e)}/logs`+Wp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Zp(`/api/version`),updateSnapshot:()=>Zp(`/api/chat/update`),updateInstall:e=>Zp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Zp(`/api/captures`+Wp({limit:e})),eventTypes:()=>Zp(`/api/event-types`),eventTypeCreate:e=>Zp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Zp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Zp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Zp(`/api/mappings`),mappingCreate:e=>Zp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Zp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Zp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Zp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Zp(`/api/bindings`),bindingCreate:e=>Zp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Zp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Zp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Zp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),sources:()=>Zp(`/api/sources`),sourceCreate:e=>Zp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Zp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Zp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Zp(`/api/sources/${encodeURIComponent(e)}/secret`,{method:`POST`}),chatSessions:()=>Zp(`/api/chat/sessions`),chatMessages:e=>Zp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Zp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Zp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Zp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Hp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Zp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>Zp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Zp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Zp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Xp(`/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 Qp(e,t,n=``,r=!1){let i=new EventSource(Vp(n,r));return i.onopen=()=>t(`live`),i.onerror=()=>t(zp(i.readyState)),i.onmessage=t=>{try{e(JSON.parse(t.data),t.lastEventId)}catch{}},()=>i.close()}var $p=`archie.web.chat.channel`;function em(){let e=localStorage.getItem($p);return e||(e=Hp(),localStorage.setItem($p,e)),e}var tm=/(?:^|\s)\/([^\s]*)$/,nm=/(?:^|\s)\/[^\s]*$/,rm=8;function im(e,t,n){let r=t.slice(0,n).match(tm);if(!r)return[];let i=r[1].toLowerCas
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&&(nm.value=n.session_id),n.type===`delta`&&(o+=n.text,sm.value=sm.value?{...sm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],sm.value=sm.value?{...sm.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`);rm.value=[...rm.value,{from:`assistant`,text:o,tool_calls:a}],sm.value=null,am.value=`Ready`,await Sm()}catch(e){let t=e;t.name===`AbortError`&&!c?(sm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},am.value=`Stopped`):(sm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Zp(r):void 0,isRetry:i},am.value=`Error — retry available`)}finally{clearTimeout(l),bm=null,om.value=!1}}function Fm(){am.value=`Stopping…`,nm.value&&J.chatCancel(nm.value).catch(()=>{}),xm()}function Im(){ia(()=>{Sm().catch(e=>{am.value=e.message||`Chat unavailable`})}),ca(()=>{xm()})}var Lm=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Rm=j({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return K(`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)=>(F(),I(`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":O($p),onClick:i[0]||=e=>n(`toggle`)},[R(`span`,{"aria-hidden":`true`,class:T(r(!e.open))},[z(O(Ld),{size:22})],2),R(`span`,{"aria-hidden":`true`,class:T(r(e.open))},[z(O(ef),{size:22})],2)],8,Lm))}});function zm(e){return typeof e==`string`?`'${e}'`:new Um().serialize(e)}var Bm=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Vm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Bm.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Hm(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&&Vm[n]?Vm[n]:n+128,s=a<128&&Vm[a]?Vm[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 Um=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Hm(e,t):n===`number`&&r===`number`?e-t:Hm(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(Hm),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&&(pm.value=n.session_id),n.type===`delta`&&(o+=n.text,vm.value=vm.value?{...vm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],vm.value=vm.value?{...vm.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`);mm.value=[...mm.value,{from:`assistant`,text:o,tool_calls:a}],vm.value=null,gm.value=`Ready`,await Nm()}catch(e){let t=e;t.name===`AbortError`&&!c?(vm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},gm.value=`Stopped`):(vm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?cm(r):void 0,isRetry:i},gm.value=`Error — retry available`)}finally{clearTimeout(l),jm=null,_m.value=!1}}function Km(){gm.value=`Stopping…`,pm.value&&q.chatCancel(pm.value).catch(()=>{}),Mm()}function qm(){ia(()=>{Nm().catch(e=>{gm.value=e.message||`Chat unavailable`})}),ca(()=>{Mm()})}var Jm=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Ym=j({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return K(`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)=>(F(),I(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px 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":O(um),onClick:i[0]||=e=>n(`toggle`)},[R(`span`,{"aria-hidden":`true`,class:T(r(!e.open))},[z(O(Hd),{size:22})],2),R(`span`,{"aria-hidden":`true`,class:T(r(e.open))},[z(O(uf),{size:22})],2)],8,Jm))}});function Xm(e){return typeof e==`string`?`'${e}'`:new eh().serialize(e)}var Zm=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Qm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Zm.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function $m(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&&Qm[n]?Qm[n]:n+128,s=a<128&&Qm[a]?Qm[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 eh=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?$m(e,t):n===`number`&&r===`number`?e-t:$m(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($m),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`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`]
Line truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||o.value?ac(t.default({present:o.value})[0],{ref:e=>{let t=_h(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Cg=j({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Eh(n.default()),r=e.findIndex(e=>e.type!==ms);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?H(t,i.props):t,o=ks({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),wg=[`area`,`img`,`input`],X=j({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`&&wg.includes(r)?()=>ac(r,t):r===`template`?()=>ac(Cg,t,{default:n.default}):()=>ac(e.as,t,{default:n.default})}});function Tg(){let e=D();return{primitiveElement:e,currentElement:U(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:_h(e))}}function Eg({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 Dg({type:e,defaultValue:t,modelValue:n}){return e||Eg({type:e,defaultValue:t,modelValue:n})}function Og({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function kg(e,t){let n=U(()=>Dg(e)),r=Th(e,`modelValue`,t,{defaultValue:Og(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Wm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Xm(t,e)){let n=t.findIndex(t=>Wm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:U(()=>n.value===`single`)}}var[Ag,jg]=Km(`DialogRoot`),Mg=j({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=Th(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=D(),a=D(),{modal:o,unmountOnHide:s}=Dn(n);return jg({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)=>N(e.$slots,`default`,{open:O(r),close:()=>r.value=!1})}}),Ng=j({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=Ag();return(e,r)=>(F(),L(O(X),H(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>O(n).onOpenChange(!1)}),{default:k(()=>[N(e.$slots,`default`)]),_:3},16,[`type`]))}}),Pg=`dismissableLayer.pointerDownOutside`,Fg=`dismissableLayer.focusOutside`;function Ig(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 Lg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=D(!1),a=D(()=>{});return jr(o=>{if(!eh||!Sn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(Ig(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Jm(Pg,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{Sn(n)&&(i.value=!0)}}}function Rg(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=D(!1);return jr(a=>{if(!eh||!Sn(n))return;let o=async n=>{if(!t?.value)return;await or(),await or();let r=n.target;t.value&&r&&!Ig(t.value,r)&&n.target&&!i.value&&Jm(Fg,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{Sn(n)&&(i.value=!0)},onBlurCapture:()=>{Sn(n)&&(i.value=!1)}}}var zg=j({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Y(),o=U(()=>a.value?.ownerDocument??globalThis.document),s=U(()=>Mh.layersRoot),c=U(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=U(()=>Mh.layersWithOutsidePointerEventsDisabled.size>0),u=U(()=>{let e=Array.from(s.value),[t]=[...Mh.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Lg
Line truncated
|
||||
`))}return()=>i.value||r.value||o.value?ac(t.default({present:o.value})[0],{ref:e=>{let t=Mh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Zg=j({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Jh(n.default()),r=e.findIndex(e=>e.type!==ms);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?H(t,i.props):t,o=ks({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Qg=[`area`,`img`,`input`],Y=j({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`&&Qg.includes(r)?()=>ac(r,t):r===`template`?()=>ac(Zg,t,{default:n.default}):()=>ac(e.as,t,{default:n.default})}});function $g(){let e=D();return{primitiveElement:e,currentElement:U(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Mh(e))}}var[e_,t_]=ah(`CollapsibleRoot`),n_=j({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=qh(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=Dn(r);return t_({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),J(),(e,t)=>(F(),L(O(Y),{as:e.as,"as-child":r.asChild,"data-state":O(i)?`open`:`closed`,"data-disabled":O(a)?``:void 0},{default:k(()=>[N(e.$slots,`default`,{open:O(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),r_=j({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=e_();i.contentId||=Bg(void 0,`reka-collapsible-content`);let a=D(),{forwardRef:o,currentElement:s}=J(),c=D(0),l=D(0),u=U(()=>i.open.value),d=D(u.value),f=D();A(()=>[u.value,a.value?.present],async()=>{await or();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=U(()=>d.value&&i.open.value);return ia(()=>{requestAnimationFrame(()=>{d.value=!1})}),Nh(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(F(),L(O(Xg),{ref_key:`presentRef`,ref:a,present:e.forceMount||O(i).open.value,"force-mount":!0},{default:k(({present:t})=>[z(O(Y),H(e.$attrs,{id:O(i).contentId,ref:O(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:O(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:O(i).open.value?`open`:`closed`,"data-disabled":O(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:k(()=>[!O(i).unmountOnHide.value||t?N(e.$slots,`default`,{key:0}):V(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),i_=j({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;J();let n=e_();return(e,r)=>(F(),L(O(Y),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":O(n).contentId,"aria-expanded":O(n).open.value,"data-state":O(n).open.value?`open`:`closed`,"data-disabled":O(n).disabled?.value?``:void 0,disabled:O(n).disabled?.value,onClick:O(n).onOpenToggle},{default:k(()=>[N(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function a_({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 o_({type:e,defaultValue:t,modelValue:n}){return e||a_({type:e,defaultValue:t,modelValue:n})}function s_({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function c_(e,t){let n=U(()=>o_(e)),r=qh(e,`modelValue`,t,{defaultValue:s_(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=th(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(lh(t,e)){let n=t.findIndex(t=>th(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:U(()=>n.value===`single`)}}var[l_,u_]=ah(`AccordionRoot`),d_=j({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,de
Line truncated
|
||||
- a positive number
|
||||
- less than the value passed to \`max\` (or ${Ex} if no \`max\` prop is set)
|
||||
- less than the value passed to \`max\` (or ${FS} if no \`max\` prop is set)
|
||||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||||
|
||||
Defaulting to \`null\`.`),null)}function jx(e){return kx(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 \`${Ex}\`.`),Ex)}var Mx=j({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Ex},getValueLabel:{type:Function,required:!1,default:(e,t)=>kx(e)?`${Math.round(e/t*Ex)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Y();let i=Th(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Th(n,`max`,r,{passive:n.max===void 0});A(()=>i.value,async e=>{let t=Ax(e,n.max);t!==e&&(await or(),i.value=t)},{immediate:!0}),A(()=>n.max,e=>{let t=jx(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=U(()=>Ym(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Ox({modelValue:i,max:a,progressState:o}),(e,t)=>(F(),L(O(X),{"as-child":e.asChild,as:e.as,"aria-valuemax":O(a),"aria-valuemin":0,"aria-valuenow":kx(O(i))?O(i):void 0,"aria-valuetext":e.getValueText?.(O(i),O(a)),"aria-label":e.getValueLabel(O(i),O(a)),role:`progressbar`,"data-state":o.value,"data-value":O(i)??void 0,"data-max":O(a)},{default:k(()=>[N(e.$slots,`default`,{modelValue:O(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),Nx=j({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Dx();return Y(),(e,r)=>(F(),L(O(X),H(t,{"data-state":O(n).progressState.value,"data-value":O(n).modelValue?.value??void 0,"data-max":O(n).max.value}),{default:k(()=>[N(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),Px=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Fx=[` `,`Enter`];function Ix(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>Lx(e,t,n)):Lx(e,t,n)}function Lx(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Wm(e,t)}function Rx(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var zx=[`value`],[Bx,Vx]=Km(`SelectRoot`),Hx=j({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=Dn(n),c=Th(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=Th(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=D(),d=D(),f=D({x:0,y:0}),p=U(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:Ym(c.value));N_({isProvider:!0});let m=Vh(s),h=Kh(u),g=D(new Set),_=U(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>Lx(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>Ix(e,t.value,n.by))}return Vx({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(F(),L(O(K_),null,{default:k(()=>[N(e.$slots,`default`,{modelValue:O(c),open:O(l)}),O(h)&&e.name?(F(),L(Ux,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:O(o),required:O(i),name:e.name,autocomplete:e.autocomplete,disabled:O(a),value:O(c)},{default:k(()=>[O(Ym)(O(c))?(F(),I(`option`,{key:0,value:e.nullableValue},null,8,zx)):V(`v-if`,!0),(F(!0),I(P,null,M(Array.from(g.value),e=>(F(),I(`option`,H({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):V(`v-if`,!0)]),_:3}))}}),Ux=j({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=D(),r=Bx();A(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescrLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:hT(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>hT(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=_T(c),u=e+1<n.length?_T(n[e+1]):null;if(l&&u&&vT(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=_T(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>hT(e)),rows:r.map(e=>e.map(e=>hT(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:hT(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:hT(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function _T(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 vT(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var yT={class:`[overflow-wrap:anywhere]`},bT={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},xT={class:`font-mono text-[0.85em]`},ST={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},CT={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},wT={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},TT={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},ET={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},DT={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},OT={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},kT={key:8,class:`mb-2.5 last:mb-0`},AT=j({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=U(()=>gT(t.text));return(e,t)=>(F(),I(`div`,yT,[(F(!0),I(P,null,M(n.value,(e,t)=>(F(),I(P,{key:t},[e.kind===`pre`?(F(),I(`pre`,bT,[R(`code`,xT,E(e.code),1)])):e.kind===`table`?(F(),I(`table`,ST,[R(`thead`,null,[R(`tr`,null,[(F(!0),I(P,null,M(e.head,(e,t)=>(F(),I(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[z(pT,{inline:e},null,8,[`inline`])]))),128))])]),R(`tbody`,null,[(F(!0),I(P,null,M(e.rows,(e,t)=>(F(),I(`tr`,{key:t},[(F(!0),I(P,null,M(e,(e,t)=>(F(),I(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[z(pT,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(F(),I(`blockquote`,CT,[z(pT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(F(),I(`h1`,wT,[z(pT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(F(),I(`h2`,TT,[z(pT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(F(),I(`h3`,ET,[z(pT,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(F(),I(`ul`,DT,[(F(!0),I(P,null,M(e.items,(e,t)=>(F(),I(`li`,{key:t},[z(pT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(F(),I(`ol`,OT,[(F(!0),I(P,null,M(e.items,(e,t)=>(F(),I(`li`,{key:t},[z(pT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(F(),I(`p`,kT,[z(pT,{inline:e.inline},null,8,[`inline`])])):V(``,!0)],64))),128))]))}}),jT={class:`truncate`},MT=j({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ha(`RouterLink`);return F(),L(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:k(()=>[z(O(bd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,jT,E(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),NT={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},PT={class:`font-semibold text-foreground`},FT={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},IT=j({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=U(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=U(()=>t.tool.parameters||t.tool.Parameters||``),i=U(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=U(()=>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?(F(),L(MT,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(F(),I(`div`,NT,[z(O($d),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),R(`span`,PT,E(n.value),1),r.value?(F(),I(`code`,FT,E(r.value),1)):V(``,!0),R(`span`,{class:T(O(K)(`text-fg-muted`,i.value&&`text-danger`))},E(a.value),3)]))}}),LT={key:0,class:`mb-2 grid gap-0.5 text-xs`},RT={key:2,class:`whitespace-pre-wrap`},zT=j({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(F(),I(`div`,{class:T([`flex`,e.assistant?`justify-start`:`justify-end`])},[R(`div`,{class:T(O(K)(`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?(F(),I(`div`,LT,[(F(!0),I(P,null,M(e.tools,(t,n)=>(F(),L(IT,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):V(``,!0),e.assistant?(F(),L(AT,{key:1,text:e.text},null,8,[`text`])):(F(),I(`div`,RT,E(e.text),1)),N(t.$slots,`default`)],2)],2))}}),BT={class:`w-full self-center justify-self-center py-6 text-center`},VT={class:`grid gap-2`},HT=[`onClick`],UT=j({__name:`ChatEmptyState`,emits:[`prompt`],setup(e,{emit:t}){let n=t,r=[`Summarise active tasks`,`Show running agents`,`Check system status`];return(e,t)=>(F(),I(`div`,BT,[t[0]||=R(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 placLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>cA?`${n.slice(0,cA).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var uA=[`title`],dA=j({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=U(()=>Vk(n.event)),a=U(()=>lA(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=U(()=>n.event.at?fO(n.event.at):`—`);return(e,t)=>(F(),L(O(cO),{class:T(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[fu(uu(o,[`prevent`]),[`enter`]),fu(uu(o,[`prevent`]),[`space`])]},{default:k(()=>[z(O(Q),{class:`font-medium`},{default:k(()=>[B(E(n.event.kind||n.event.type||`event`),1)]),_:1}),z(O(Q),{class:`font-mono`},{default:k(()=>[B(E(i.value>0?`#${i.value}`:`—`),1)]),_:1}),z(O(Q),{class:`w-[55%] max-w-0`},{default:k(()=>[R(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},E(a.value.text),9,uA)]),_:1}),z(O(Q),null,{default:k(()=>[B(E(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}});function fA(e,t){return`${e}:${t??0}`}function pA(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=fA(lA(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var mA={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},hA={class:`max-h-[28rem] overflow-y-auto`},gA=[`aria-expanded`,`aria-label`,`onClick`],_A=[`title`],vA=j({__name:`LiveActivityCard`,setup(e){let t=fE(),{activity:n,streamKind:r,streamState:i}=od(gO()),a=rn(new Set),o=U(()=>pA(n.value));function s(e){a.has(e)?a.delete(e):a.add(e)}function c(e){return a.has(e.key)}function l(e){return lA(e.representative)}function u(e){return e.representative.at?fO(e.representative.at):`—`}function d(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(F(),L(O(QD),null,{default:k(()=>[z(O(rO),null,{default:k(()=>[z(O(iO),null,{default:k(()=>[...t[0]||=[B(`Live activity`,-1)]]),_:1}),z(O($D),null,{default:k(()=>[z(O(UO),{variant:O(r)},{default:k(()=>[B(E(O(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),z(O(eO),null,{default:k(()=>[R(`div`,mA,[R(`div`,hA,[z(O(oO),null,{default:k(()=>[z(O(dO),{class:`sticky top-0 z-10 bg-card`},{default:k(()=>[z(O(cO),null,{default:k(()=>[z(O($),null,{default:k(()=>[...t[1]||=[B(`Event`,-1)]]),_:1}),z(O($),null,{default:k(()=>[...t[2]||=[B(`Task`,-1)]]),_:1}),z(O($),null,{default:k(()=>[...t[3]||=[B(`Detail`,-1)]]),_:1}),z(O($),null,{default:k(()=>[...t[4]||=[B(`When`,-1)]]),_:1})]),_:1})]),_:1}),z(O(sO),null,{default:k(()=>[O(n).length?V(``,!0):(F(),L(O(cO),{key:0},{default:k(()=>[z(O(Q),{colspan:`4`},{default:k(()=>[z(O(FO),null,{default:k(()=>[z(O(RO),null,{default:k(()=>[z(O(VO),null,{default:k(()=>[...t[5]||=[B(`Waiting for activity`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),O(n).length?(F(!0),I(P,{key:1},M(o.value,e=>(F(),I(P,{key:e.key},[e.count===1?(F(),L(dA,{key:0,event:e.representative,onOpen:d},null,8,[`event`])):(F(),I(P,{key:1},[z(O(cO),{class:T(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&d(e.taskID),onKeydown:[fu(uu(t=>e.taskID>0&&d(e.taskID),[`prevent`]),[`enter`]),fu(uu(t=>e.taskID>0&&d(e.taskID),[`prevent`]),[`space`])]},{default:k(()=>[z(O(Q),{class:`font-medium`},{default:k(()=>[R(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":c(e),"aria-label":`${c(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:uu(t=>s(e.key),[`stop`])},[c(e)?(F(),L(O(Sd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(F(),L(O(wd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),B(` `+E(e.label)+` `,1),z(O(UO),{variant:`idle`},{default:k(()=>[B(`×`+E(e.count),1)]),_:2},1024)],8,gA)]),_:2},1024),z(O(Q),{class:`font-mono`},{default:k(()=>[B(E(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),z(O(Q),{class:`w-[55%] max-w-0`},{default:k(()=>[R(`span`,{class:`block truncate`,title:l(e).truncated?l(e).full:void 0},E(l(e).text),9,_A)]),_:2},1024),z(O(Q),null,{default:k(()=>[B(E(u(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),c(e)?(F(!0),I(P,{key:0},M(e.events,(t,n)=>(F(),L(dA,{key:`${e.key}:${n}`,event:t,onOpen:d},null,8,[`event`]))),128)):V(``,!0)],64))],64))),128)):V(``,!0)]),_:1})]),_:1})])])]),_:1})]),_:1}))}}),yA=j({__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=sC(t,`class`);return(e,r)=>(F(),L(O(Mx),H({"data-slot":`progress`},O(n),{class:O(K)(`bg-muted h-1 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class)}),{default:k(()=>[z(O(Nx),{"data-slot":`progress-indicator`,class:`bg-primary size-full flex-1 transition-all`,style:ye(`transLine truncated
|
||||
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function Yj(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function Xj(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function Zj(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function Qj(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}function $j(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function eM(e){return(e?.repository??`required`)!==`none`}function tM(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function nM(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var rM={pending_approval:`pending approval`,armed:`armed`},iM={pending_approval:`warn`,armed:`ok`};function aM(e){return e?rM[e]??e:`unknown`}function oM(e){return iM[e??``]??`idle`}function sM(){return{id:null,name:``,eventTypeId:``,mappingId:``,filter:``,workflow:``,owner:``,repo:``,repoParam:``,inputs:{}}}function cM(e,t){let n=t.find(t=>t.id===e.mapping_id);return{id:e.id,name:e.name,eventTypeId:n?.event_type_id||``,mappingId:e.mapping_id||``,filter:e.filter||``,workflow:e.workflow||``,owner:e.owner||``,repo:e.repo||``,repoParam:e.repo_param||``,inputs:Object.fromEntries(Object.entries(e.inputs??{}).map(([e,t])=>[e,{param:t.param??``,value:t.param?``:typeof t.value==`string`?t.value:JSON.stringify(t.value)}]))}}function lM(e,t,n){let r=t.find(t=>t.id===e.eventTypeId),i=n?.inputs??{},a={};for(let[t,n]of Object.entries(i)){let r=e.inputs[t];r?.param?a[t]={param:r.param}:r&&r.value!==``&&(a[t]={value:nM(r.value,n.type)})}let o=eM(n);return{name:e.name,matcher:{source:r?.source||``},mapping_id:e.mappingId,filter:e.filter.trim(),workflow:e.workflow,owner:o&&!e.repoParam?e.owner:``,repo:o&&!e.repoParam?e.repo:``,repo_param:o?e.repoParam:``,inputs:a}}function uM(e){return e.repo_param?`from ${e.repo_param}`:e.owner&&e.repo?`${e.owner}/${e.repo}`:`—`}function dM(e,t){return t.find(t=>t.id===e.mapping_id)?.event_type_id}var fM={class:`font-mono`},pM={class:`text-fg-muted`},mM={class:`grid grid-cols-2 items-start gap-3`},hM={class:`grid grid-cols-2 items-start gap-3`},gM=`__constant__`,_M=`__none__`,vM=j({__name:`BindingEditor`,props:Va({binding:{},mappings:{},eventTypes:{},workflows:{},saving:{type:Boolean},error:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:Va([`save`],[`update:open`]),setup(e,{emit:t}){let n=e,r=lo(e,`open`),i=t,a=D(sM());A(r,e=>{e&&(a.value=n.binding?cM(n.binding,n.mappings):sM())},{immediate:!0});let o=U(()=>$j(n.mappings,a.value.eventTypeId));A(()=>a.value.eventTypeId,()=>{o.value.some(e=>e.id===a.value.mappingId)||(a.value.mappingId=``)});let s=U(()=>n.workflows.find(e=>e.id===a.value.workflow)),c=U(()=>Object.entries(s.value?.inputs??{}).sort(([e],[t])=>e.localeCompare(t))),l=U(()=>n.mappings.find(e=>e.id===a.value.mappingId)?.fields??[]),u=U(()=>tM(l.value,`string`));function d(e){return a.value.inputs[e]??={param:``,value:``},a.value.inputs[e]}function f(e){return d(e).param||gM}function p(e,t){d(e).param=t===gM?``:String(t)}let m=U({get:()=>a.value.repoParam||_M,set:e=>{a.value.repoParam=e===_M?``:e}}),h=U(()=>n.binding?`Edit binding`:`New binding`);return(e,t)=>(F(),L(O(Vj),{open:r.value,"onUpdate:open":t[10]||=e=>r.value=e},{default:k(()=>[z(O(Uj),{class:`max-h-[85vh] overflow-y-auto sm:max-w-lg`},{default:k(()=>[z(O(Kj),null,{default:k(()=>[z(O(qj),null,{default:k(()=>[B(E(h.value),1)]),_:1}),z(O(Wj),null,{default:k(()=>[...t[11]||=[B(` A binding is not armed until it is approved, and editing one drops it back to pending approval. `,-1)]]),_:1})]),_:1}),R(`form`,{onSubmit:t[9]||=uu(e=>i(`save`,a.value),[`prevent`])},[z(O(HC),null,{default:k(()=>[z(O(BC),null,{default:k(()=>[z(O(WC),{for:`binding-name`},{default:k(()=>[...t[12]||=[B(`Name`,-1)]]),_:1}),z(O(JO),{id:`binding-name`,modelValue:a.value.name,"onUpdate:modelValue":t[0]||=e=>a.value.name=e},null,8,[`modelValue`])]),_:1}),z(O(BC),null,{default:k(()=>[z(O(WC),{for:`binding-event-type`},{default:k(()=>[...t[13]||=[B(`Event type`,-1)]]),_:1}),z(O(qS),{modelValue:a.value.eventTypeId,"onUpdate:modelValue":t[1]||=e=>a.value.eventTypeId=e},{default:k(()=>[z(O(kC),{id:`binding-event-type`,class:`w-full`},{default:k(()=>[z(O(AC),{placeholder:`Pick an event type`})]),_:1}),z(O(CC),null,{default:k(()=>[z(O(wC),null,{default:k(()=>[(F(!0),I(P,null,M(n
Line truncated
|
||||
Defaulting to \`null\`.`),null)}function BS(e){return RS(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 \`${FS}\`.`),FS)}var VS=j({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:FS},getValueLabel:{type:Function,required:!1,default:(e,t)=>RS(e)?`${Math.round(e/t*FS)}%`: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;J();let i=qh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=qh(n,`max`,r,{passive:n.max===void 0});A(()=>i.value,async e=>{let t=zS(e,n.max);t!==e&&(await or(),i.value=t)},{immediate:!0}),A(()=>n.max,e=>{let t=BS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=U(()=>ch(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return LS({modelValue:i,max:a,progressState:o}),(e,t)=>(F(),L(O(Y),{"as-child":e.asChild,as:e.as,"aria-valuemax":O(a),"aria-valuemin":0,"aria-valuenow":RS(O(i))?O(i):void 0,"aria-valuetext":e.getValueText?.(O(i),O(a)),"aria-label":e.getValueLabel(O(i),O(a)),role:`progressbar`,"data-state":o.value,"data-value":O(i)??void 0,"data-max":O(a)},{default:k(()=>[N(e.$slots,`default`,{modelValue:O(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),HS=j({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=IS();return J(),(e,r)=>(F(),L(O(Y),H(t,{"data-state":O(n).progressState.value,"data-value":O(n).modelValue?.value??void 0,"data-max":O(n).max.value}),{default:k(()=>[N(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),US=`radio.select`;function WS(e,t,n){sh(US,n,{originalEvent:e,value:t})}var GS=j({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=qh(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Dn(n),{forwardRef:o,currentElement:s}=J(),c=vg(s),l=xg(),u=U(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||WS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(F(),I(P,null,[z(O(Y),H({id:e.id,ref:O(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":O(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":O(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:O(a),required:e.required,name:e.name},{...O(l),...e.$attrs},{onClick:uu(d,[`stop`])}),{default:k(()=>[N(e.$slots,`default`,{checked:O(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),O(c)&&e.name?(F(),L(O(Tv),H({key:0,type:`radio`,tabindex:`-1`,value:O(a),checked:!!O(i),name:e.name,disabled:e.disabled,required:e.required},O(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):V(`v-if`,!0)],64))}}),[KS,qS]=ah(`RadioGroupRoot`),JS=j({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=J(),o=qh(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=Dn(n),p=pg(f),m=vg(a);return qS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(F(),L(O(sx),{"as-child":``,orientation:O(l),dir:O(p),loop:O(c)},{default:k(()=>[z(O(Y),{ref:O(i),role:`radiogroup`,"data-disabled":O(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":O(l),"aria-required":O(d),dir:O(p)},{default:k(()=>[N(e.$slots,`default`,{modelValue:O(o)}),O(m)&&O(u)?(F(),L(O(Tv),{key:0,required:O(d),disabled:O(s),value:O(o),name:O(u)},null,8,[`required`,`disabled`,`value`,`name`])):V(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[YS,XS]=ah(`RadioGroupItem`),ZS=j({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,reLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:HE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>HE(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=WE(c),u=e+1<n.length?WE(n[e+1]):null;if(l&&u&&GE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=WE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>HE(e)),rows:r.map(e=>e.map(e=>HE(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:HE(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:HE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function WE(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 GE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var KE={class:`[overflow-wrap:anywhere]`},qE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},JE={class:`font-mono text-[0.85em]`},YE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},XE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},ZE={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},QE={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},$E={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},eD={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},tD={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},nD={key:8,class:`mb-2.5 last:mb-0`},rD=j({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=U(()=>UE(t.text));return(e,t)=>(F(),I(`div`,KE,[(F(!0),I(P,null,M(n.value,(e,t)=>(F(),I(P,{key:t},[e.kind===`pre`?(F(),I(`pre`,qE,[R(`code`,JE,E(e.code),1)])):e.kind===`table`?(F(),I(`table`,YE,[R(`thead`,null,[R(`tr`,null,[(F(!0),I(P,null,M(e.head,(e,t)=>(F(),I(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[z(BE,{inline:e},null,8,[`inline`])]))),128))])]),R(`tbody`,null,[(F(!0),I(P,null,M(e.rows,(e,t)=>(F(),I(`tr`,{key:t},[(F(!0),I(P,null,M(e,(e,t)=>(F(),I(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[z(BE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(F(),I(`blockquote`,XE,[z(BE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(F(),I(`h1`,ZE,[z(BE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(F(),I(`h2`,QE,[z(BE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(F(),I(`h3`,$E,[z(BE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(F(),I(`ul`,eD,[(F(!0),I(P,null,M(e.items,(e,t)=>(F(),I(`li`,{key:t},[z(BE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(F(),I(`ol`,tD,[(F(!0),I(P,null,M(e.items,(e,t)=>(F(),I(`li`,{key:t},[z(BE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(F(),I(`p`,nD,[z(BE,{inline:e.inline},null,8,[`inline`])])):V(``,!0)],64))),128))]))}}),iD={class:`truncate`},aD=j({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ha(`RouterLink`);return F(),L(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:k(()=>[z(O(xd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,iD,E(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),oD={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},sD={class:`font-semibold text-foreground`},cD={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},lD=j({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=U(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=U(()=>t.tool.parameters||t.tool.Parameters||``),i=U(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=U(()=>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?(F(),L(aD,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(F(),I(`div`,oD,[z(O(lf),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),R(`span`,sD,E(n.value),1),r.value?(F(),I(`code`,cD,E(r.value),1)):V(``,!0),R(`span`,{class:T(O(K)(`text-fg-muted`,i.value&&`text-danger`))},E(a.value),3)]))}}),uD={key:0,class:`mb-2 grid gap-0.5 text-xs`},dD={key:2,class:`whitespace-pre-wrap`},fD=j({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(F(),I(`div`,{class:T([`flex`,e.assistant?`justify-start`:`justify-end`])},[R(`div`,{class:T(O(K)(`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?(F(),I(`div`,uD,[(F(!0),I(P,null,M(e.tools,(t,n)=>(F(),L(lD,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):V(``,!0),e.assistant?(F(),L(rD,{key:1,text:e.text},null,8,[`text`])):(F(),I(`div`,dD,E(e.text),1)),N(t.$slots,`default`)],2)],2))}}),pD={class:`w-full self-center justify-self-center py-6 text-center`},mD={class:`grid gap-2`},hD=[`onClick`],gD=j({__name:`ChatEmptyState`,emits:[`prompt`],setup(e,{emit:t}){let n=t,r=[`Summarise active tasks`,`Show running agents`,`Check system status`];return(e,t)=>(F(),I(`div`,pD,[t[0]||=R(`span`,{"aria-hidden":`true`,class:`mx-auto mb-3 grid size-9 placLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>EM?`${n.slice(0,EM).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var OM=[`title`],kM=j({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=U(()=>aM(n.event)),a=U(()=>DM(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=U(()=>n.event.at?hj(n.event.at):`—`);return(e,t)=>(F(),L(O(CM),{class:T(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[fu(uu(o,[`prevent`]),[`enter`]),fu(uu(o,[`prevent`]),[`space`])]},{default:k(()=>[z(O($),{class:`font-medium`},{default:k(()=>[B(E(n.event.kind||n.event.type||`event`),1)]),_:1}),z(O($),{class:`font-mono`},{default:k(()=>[B(E(i.value>0?`#${i.value}`:`—`),1)]),_:1}),z(O($),{class:`w-[55%] max-w-0`},{default:k(()=>[R(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},E(a.value.text),9,OM)]),_:1}),z(O($),null,{default:k(()=>[B(E(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}});function AM(e,t){return`${e}:${t??0}`}function jM(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=AM(DM(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var MM={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},NM={class:`max-h-[28rem] overflow-y-auto`},PM=[`aria-expanded`,`aria-label`,`onClick`],FM=[`title`],IM=j({__name:`LiveActivityCard`,setup(e){let t=zD(),{activity:n,streamKind:r,streamState:i}=od(CA()),a=rn(new Set),o=U(()=>jM(n.value));function s(e){a.has(e)?a.delete(e):a.add(e)}function c(e){return a.has(e.key)}function l(e){return DM(e.representative)}function u(e){return e.representative.at?hj(e.representative.at):`—`}function d(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(F(),L(O(cj),null,{default:k(()=>[z(O(pj),null,{default:k(()=>[z(O(mj),null,{default:k(()=>[...t[0]||=[B(`Live activity`,-1)]]),_:1}),z(O(lj),null,{default:k(()=>[z(O(aj),{variant:O(r)},{default:k(()=>[B(E(O(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),z(O(uj),null,{default:k(()=>[R(`div`,MM,[R(`div`,NM,[z(O(xM),null,{default:k(()=>[z(O(TM),{class:`sticky top-0 z-10 bg-card`},{default:k(()=>[z(O(CM),null,{default:k(()=>[z(O(wM),null,{default:k(()=>[...t[1]||=[B(`Event`,-1)]]),_:1}),z(O(wM),null,{default:k(()=>[...t[2]||=[B(`Task`,-1)]]),_:1}),z(O(wM),null,{default:k(()=>[...t[3]||=[B(`Detail`,-1)]]),_:1}),z(O(wM),null,{default:k(()=>[...t[4]||=[B(`When`,-1)]]),_:1})]),_:1})]),_:1}),z(O(SM),null,{default:k(()=>[O(n).length?V(``,!0):(F(),L(O(CM),{key:0},{default:k(()=>[z(O($),{colspan:`4`},{default:k(()=>[z(O(ZA),null,{default:k(()=>[z(O(ej),null,{default:k(()=>[z(O(rj),null,{default:k(()=>[...t[5]||=[B(`Waiting for activity`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),O(n).length?(F(!0),I(P,{key:1},M(o.value,e=>(F(),I(P,{key:e.key},[e.count===1?(F(),L(kM,{key:0,event:e.representative,onOpen:d},null,8,[`event`])):(F(),I(P,{key:1},[z(O(CM),{class:T(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&d(e.taskID),onKeydown:[fu(uu(t=>e.taskID>0&&d(e.taskID),[`prevent`]),[`enter`]),fu(uu(t=>e.taskID>0&&d(e.taskID),[`prevent`]),[`space`])]},{default:k(()=>[z(O($),{class:`font-medium`},{default:k(()=>[R(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":c(e),"aria-label":`${c(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:uu(t=>s(e.key),[`stop`])},[c(e)?(F(),L(O(Td),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(F(),L(O(Ed),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),B(` `+E(e.label)+` `,1),z(O(aj),{variant:`idle`},{default:k(()=>[B(`×`+E(e.count),1)]),_:2},1024)],8,PM)]),_:2},1024),z(O($),{class:`font-mono`},{default:k(()=>[B(E(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),z(O($),{class:`w-[55%] max-w-0`},{default:k(()=>[R(`span`,{class:`block truncate`,title:l(e).truncated?l(e).full:void 0},E(l(e).text),9,FM)]),_:2},1024),z(O($),null,{default:k(()=>[B(E(u(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),c(e)?(F(!0),I(P,{key:0},M(e.events,(t,n)=>(F(),L(kM,{key:`${e.key}:${n}`,event:t,onOpen:d},null,8,[`event`]))),128)):V(``,!0)],64))],64))),128)):V(``,!0)]),_:1})]),_:1})])])]),_:1})]),_:1}))}}),LM=j({__name:`Alert`,props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){let t=e;return(n,r)=>(F(),I(`div`,{"data-slot":`alert`,class:T(O(K)(O(VM)({variant:e.variant}),t.class)),role:`alert`},[N(n.$slots,`default`)],2))}}),RM=j({__name:`AlertAction`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(F(),I(`div`,{"data-slot":`alert-action`,class:T(O(K)(`absolute top-2 right-2`,t.class))},[N(e.$slots,`default`)],2))}}),zM=j(
Line truncated
|
||||
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function RN(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function zN(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function BN(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function VN(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var HN=D([]),UN=D([]),WN=D(!0),GN=D(null),KN=D(null),qN=D(!1),JN=D(null);async function YN(){try{let e=await q.eventTypes();WN.value=e.enabled!==!1,HN.value=e.event_types||[],UN.value=e.proposals||[],GN.value=null}catch(e){GN.value=e.message||String(e)}}function XN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function ZN(e){JN.value=null,KN.value=e}function QN(e){let t=oP.value.find(t=>String(t.id)===e.sample_id);ZN({mode:`proposal`,id:null,source:e.source,name:``,rule:XN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function $N(e=``){ZN({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function eP(e){ZN({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:XN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function tP(){KN.value=null}async function nP(){let e=KN.value;if(e){qN.value=!0;try{if(e.mode===`edit`&&e.id)await q.eventTypeUpdate(e.id,{name:e.name,rule:VN(e.rule)});else{let t=e.mode===`paste`?LN(e.headersText):e.exampleHeaders;await q.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:VN(e.rule),example:{headers:t,body:e.body}})}KN.value=null,await YN()}catch(e){JN.value=e.message||String(e)}finally{qN.value=!1}}}var rP=D(null);async function iP(){let e=rP.value;if(rP.value=null,e)try{await q.eventTypeDelete(e.id),await YN()}catch(e){GN.value=e.message||String(e)}}var aP=100,oP=D([]),sP=D(!0),cP=D(null),lP=D(!0),uP=D(null);async function dP(){try{let e=await q.captures(aP);sP.value=e.enabled!==!1,oP.value=e.captures||[],cP.value=null}catch(e){cP.value=e.message||String(e)}finally{lP.value=!1}}function fP(e){let t=oP.value.find(t=>t.id===e);return t&&(uP.value=t),!!t}function pP(){oP.value.length&&(uP.value=oP.value[0])}function mP(){wA(`captures`,()=>{dP(),YN()})}var hP=j({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=bg(Pw(n,`class`),r);return(e,t)=>(F(),L(O(VC),H({"data-slot":`tabs`,"data-orientation":O(i).orientation||`horizontal`},O(i),{class:O(K)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:k(t=>[N(e.$slots,`default`,we(Os(t)))]),_:3},16,[`data-orientation`,`class`]))}}),gP=j({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Pw(t,`class`);return(e,r)=>(F(),L(O(WC),H({"data-slot":`tabs-content`,class:O(K)(`text-sm flex-1 outline-none`,t.class)},O(n)),{default:k(()=>[N(e.$slots,`default`)]),_:3},16,[`class`]))}}),_P=j({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=Pw(t,`class`,`variant`);return(r,i)=>(F(),L(O(GC),H({"data-slot":`tabs-list`,"data-variant":e.variant},O(n),{class:O(K)(O(yP)({variant:e.variant}),t.class)}),{default:k(()=>[N(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),vP=j({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=yg(Pw(t,`class`));return(e,r)=>(F(),L(O(KC),H({"data-slot":`tabs-trigger`,class:O(K)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabledLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filtLine truncated
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 2.5 21 20h-4.1L12 10.6 7.1 20H3l9-17.5Z" fill="#86b5a0"/><path d="M8.6 16.2h6.8" stroke="#121314" stroke-width="1.6" stroke-linecap="round"/></svg>
|
||||
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 256 B |
Generated
+22
-12
@@ -8,14 +8,15 @@
|
||||
"name": "archie-ui",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@fontsource-variable/geist": "^5.3.0",
|
||||
"@lucide/vue": "^1.47.0",
|
||||
"@fontsource-variable/ibm-plex-sans": "^5.3.0",
|
||||
"@fontsource/ibm-plex-mono": "^5.3.0",
|
||||
"@lucide/vue": "^1.48.0",
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"@vueuse/core": "^15.0.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"pinia": "^4.0.3",
|
||||
"reka-ui": "^2.10.4",
|
||||
"reka-ui": "^2.10.5",
|
||||
"tailwind-merge": "^3.7.0",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
@@ -740,10 +741,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/geist": {
|
||||
"node_modules/@fontsource-variable/ibm-plex-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/geist/-/geist-5.3.0.tgz",
|
||||
"integrity": "sha512-j0m+vLQuG5XAYoHtGCVu0spvlGreR3EzpECUVzkFmI1mTVnAO38l/NEPDCFgZ177JxzYJCLSmTQibIiYPilGrA==",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/ibm-plex-sans/-/ibm-plex-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-agG8tXFEo0hD9+J7npa4vbbWult52eMLVaQ6WQRlhs/iCAojrMAoejru85W9HTVXHfyUj96KM7gp/KGAS87XaQ==",
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource/ibm-plex-mono": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/ibm-plex-mono/-/ibm-plex-mono-5.3.0.tgz",
|
||||
"integrity": "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q==",
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
@@ -933,9 +943,9 @@
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@lucide/vue": {
|
||||
"version": "1.47.0",
|
||||
"resolved": "https://registry.npmjs.org/@lucide/vue/-/vue-1.47.0.tgz",
|
||||
"integrity": "sha512-S0/UX9zra4Z8xmqrA1MH5GiSKA8daAPFwkmORt/u+gUHAkYZoeOcr+DH3scZeyE9bdLWScGK+MJoDYi8rIU5Jg==",
|
||||
"version": "1.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@lucide/vue/-/vue-1.48.0.tgz",
|
||||
"integrity": "sha512-3/Nwx/RsqQ4ZrrSML1GNsSWCSDyLnBgoF/eEr1q9G6iZymn3+WKtzIj7Dbc/Nxrt9WOPuGrJ58S+CBiamK+36w==",
|
||||
"license": "ISC",
|
||||
"peerDependencies": {
|
||||
"vue": ">=3.0.1"
|
||||
@@ -6312,9 +6322,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/reka-ui": {
|
||||
"version": "2.10.4",
|
||||
"resolved": "https://registry.npmjs.org/reka-ui/-/reka-ui-2.10.4.tgz",
|
||||
"integrity": "sha512-kbS5GAbkHkYj0EVKAg5ZPEPndhBjeUFSa1Aq5m5ftQwyHnB1v5tw8X6fcwfKH/ry3StPXblMWM1DW82MVS71cw==",
|
||||
"version": "2.10.5",
|
||||
"resolved": "https://registry.npmjs.org/reka-ui/-/reka-ui-2.10.5.tgz",
|
||||
"integrity": "sha512-/8o0y9BThE0hcHKFg+3770tWcJh3qKdOEFxLOPb9HIajXeFoH/J530cZH62jUJunbqwBgpSBL9v7nB8LJ5pDXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@floating-ui/dom": "^1.6.13",
|
||||
|
||||
+4
-3
@@ -11,14 +11,15 @@
|
||||
"typecheck": "vue-tsc --build --force"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource-variable/geist": "^5.3.0",
|
||||
"@lucide/vue": "^1.47.0",
|
||||
"@fontsource-variable/ibm-plex-sans": "^5.3.0",
|
||||
"@fontsource/ibm-plex-mono": "^5.3.0",
|
||||
"@lucide/vue": "^1.48.0",
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"@vueuse/core": "^15.0.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"pinia": "^4.0.3",
|
||||
"reka-ui": "^2.10.4",
|
||||
"reka-ui": "^2.10.5",
|
||||
"tailwind-merge": "^3.7.0",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filtLine truncated
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 2.5 21 20h-4.1L12 10.6 7.1 20H3l9-17.5Z" fill="#86b5a0"/><path d="M8.6 16.2h6.8" stroke="#121314" stroke-width="1.6" stroke-linecap="round"/></svg>
|
||||
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 256 B |
+7
-3
@@ -5,6 +5,7 @@ import { onMounted, ref } from "vue";
|
||||
import ChatLauncher from "@/chat/ChatLauncher.vue";
|
||||
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
|
||||
import Topbar from "@/components/topbar/Topbar.vue";
|
||||
import SettingsShell from "@/settings/SettingsShell.vue";
|
||||
import {
|
||||
Alert,
|
||||
AlertAction,
|
||||
@@ -64,10 +65,10 @@ onMounted(() => {
|
||||
so the chat launcher has to render outside this element.
|
||||
-->
|
||||
<div
|
||||
class="flex min-h-[calc(100vh-2rem)] flex-col overflow-hidden rounded-xl border border-[var(--hairline)] bg-[var(--workspace)] shadow-[var(--shadow-workspace)] backdrop-blur-[28px] backdrop-saturate-[1.2] max-lg:min-h-screen max-lg:rounded-none max-lg:border-0 max-lg:shadow-none"
|
||||
class="flex min-h-[calc(100vh-2rem)] flex-col overflow-clip rounded-xl border border-[var(--hairline)] bg-[var(--workspace)] shadow-[var(--shadow-workspace)] backdrop-blur-[28px] backdrop-saturate-[1.2] max-lg:min-h-screen max-lg:rounded-none max-lg:border-0 max-lg:shadow-none"
|
||||
>
|
||||
<Topbar :hidden="hidden" />
|
||||
<main class="w-full flex-1 overflow-x-hidden p-8 max-lg:p-4">
|
||||
<main class="w-full flex-1 overflow-x-clip p-8 max-lg:p-4">
|
||||
<Alert v-if="authenticationRequired" variant="destructive" class="mb-4">
|
||||
<AlertTitle>Dashboard authentication required</AlertTitle>
|
||||
<AlertDescription>
|
||||
@@ -93,7 +94,10 @@ onMounted(() => {
|
||||
open tab stays open on the next (W11).
|
||||
-->
|
||||
<RouterView v-slot="{ Component, route }">
|
||||
<component :is="Component" :key="route.path" />
|
||||
<SettingsShell v-if="route.meta.settings">
|
||||
<component :is="Component" :key="route.path" />
|
||||
</SettingsShell>
|
||||
<component :is="Component" v-else :key="route.path" />
|
||||
</RouterView>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableEmpty,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { ago } from "@/lib/format";
|
||||
import {
|
||||
useControlPlaneStore,
|
||||
type AuditEntry,
|
||||
type ResourceDescriptor,
|
||||
} from "@/stores/control-plane";
|
||||
|
||||
/**
|
||||
* The field-level audit of the settings a page shows: one row per changed
|
||||
* field, newest first. Restore puts a resource back to the version before a
|
||||
* change, as an ordinary replace, so the restore is audited like any edit.
|
||||
*/
|
||||
const props = defineProps<{ resources: ResourceDescriptor[] }>();
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const entries = ref<AuditEntry[]>([]);
|
||||
const error = ref("");
|
||||
|
||||
const kinds = computed(() => props.resources.map((r) => r.kind));
|
||||
const titles = computed(
|
||||
() => new Map(props.resources.map((r) => [r.kind, r.title])),
|
||||
);
|
||||
// Every stored version on the page: a save anywhere refreshes the list.
|
||||
const versions = computed(() =>
|
||||
kinds.value.map((kind) => store.stateFor(kind).resource?.version).join(","),
|
||||
);
|
||||
|
||||
async function load(): Promise<void> {
|
||||
if (!kinds.value.length) return;
|
||||
try {
|
||||
entries.value = await store.audit("resources", kinds.value);
|
||||
error.value = "";
|
||||
} catch (err) {
|
||||
error.value = String((err as Error).message || err);
|
||||
}
|
||||
}
|
||||
watch([kinds, versions], load, { immediate: true });
|
||||
|
||||
function show(value: unknown): string {
|
||||
return value === null || value === undefined ? "" : JSON.stringify(value);
|
||||
}
|
||||
|
||||
async function restoreBefore(entry: AuditEntry): Promise<void> {
|
||||
const previous = (await store.history(entry.record_key)).find(
|
||||
(revision) => revision.version === entry.version - 1,
|
||||
);
|
||||
if (previous) await store.replace(entry.record_key, previous.value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card class="mb-4">
|
||||
<CardHeader><CardTitle>Audit</CardTitle></CardHeader>
|
||||
<CardContent>
|
||||
<p v-if="error" class="text-sm text-destructive" role="alert">
|
||||
{{ error }}
|
||||
</p>
|
||||
<Table v-else>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>When</TableHead>
|
||||
<TableHead>Setting</TableHead>
|
||||
<TableHead>Field</TableHead>
|
||||
<TableHead>Old value</TableHead>
|
||||
<TableHead>New value</TableHead>
|
||||
<TableHead>Version</TableHead>
|
||||
<TableHead>Changed by</TableHead>
|
||||
<TableHead />
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
<TableRow v-for="entry in entries" :key="entry.id">
|
||||
<TableCell class="whitespace-nowrap" :title="entry.at">{{
|
||||
entry.at ? ago(entry.at) : ""
|
||||
}}</TableCell>
|
||||
<TableCell>{{
|
||||
titles.get(entry.record_key) || entry.record_key
|
||||
}}</TableCell>
|
||||
<TableCell class="font-mono text-xs">{{
|
||||
entry.field || "(whole value)"
|
||||
}}</TableCell>
|
||||
<TableCell
|
||||
class="max-w-64 truncate font-mono text-xs text-fg-muted"
|
||||
:title="show(entry.old_value)"
|
||||
>{{ show(entry.old_value) }}</TableCell
|
||||
>
|
||||
<TableCell
|
||||
class="max-w-64 truncate font-mono text-xs"
|
||||
:title="show(entry.new_value)"
|
||||
>{{ show(entry.new_value) }}</TableCell
|
||||
>
|
||||
<TableCell>{{ entry.version }}</TableCell>
|
||||
<TableCell class="whitespace-nowrap"
|
||||
>{{ entry.actor
|
||||
}}<span class="text-fg-muted"> · {{ entry.source }}</span></TableCell
|
||||
>
|
||||
<TableCell>
|
||||
<Button
|
||||
v-if="entry.version > 1"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
:disabled="store.stateFor(entry.record_key).saving"
|
||||
@click="restoreBefore(entry)"
|
||||
>Restore</Button
|
||||
>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableEmpty v-if="!entries.length" :colspan="8"
|
||||
>No changes recorded yet.</TableEmpty
|
||||
>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</template>
|
||||
@@ -1,17 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
const { streamKind, streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
|
||||
/**
|
||||
* The state of the stream that is supposed to be adding to this list. Without
|
||||
* it a list that has stopped updating looks exactly like a quiet one.
|
||||
*/
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Badge :variant="streamKind">{{ streamState }}</Badge>
|
||||
</template>
|
||||
@@ -2,7 +2,6 @@
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
@@ -21,10 +20,6 @@ import CapturesList from "./CapturesList.vue";
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Recent captures</CardTitle>
|
||||
<CardDescription
|
||||
>Headers and payloads are redacted before they are
|
||||
stored.</CardDescription
|
||||
>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CapturesList />
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { Inbox, TriangleAlert } from "@lucide/vue";
|
||||
import { ref } from "vue";
|
||||
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -29,8 +31,13 @@ import { captures, enabled, error, loading } from "./state";
|
||||
// The receiver's path, held as a string rather than typed into the template:
|
||||
// its source segment is angle-bracketed, which a template parser reads as a
|
||||
// tag.
|
||||
const webhookHint =
|
||||
"Point a webhook at /webhooks/capture/<source> and it will show up here.";
|
||||
const endpoint = "/webhooks/capture/<source>";
|
||||
const copied = ref(false);
|
||||
async function copyEndpoint() {
|
||||
await navigator.clipboard.writeText(`${location.origin}${endpoint}`);
|
||||
copied.value = true;
|
||||
setTimeout(() => (copied.value = false), 1500);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -57,8 +64,12 @@ const webhookHint =
|
||||
<EmptyHeader>
|
||||
<EmptyMedia variant="icon"><Inbox /></EmptyMedia>
|
||||
<EmptyTitle>No captures yet</EmptyTitle>
|
||||
<EmptyDescription>{{ webhookHint }}</EmptyDescription>
|
||||
<EmptyDescription>Point a webhook at this address and it shows up here.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
<div class="flex items-center gap-2 rounded-md border border-border bg-background py-1 pr-1 pl-3">
|
||||
<code class="font-mono text-xs">{{ endpoint }}</code>
|
||||
<Button variant="ghost" size="sm" @click="copyEndpoint">{{ copied ? "Copied" : "Copy" }}</Button>
|
||||
</div>
|
||||
</Empty>
|
||||
|
||||
<Table v-else>
|
||||
|
||||
@@ -4,11 +4,10 @@ import { onBeforeUnmount, onMounted, ref, watch } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import CaptureDetail from "./CaptureDetail.vue";
|
||||
import CaptureStatus from "./CaptureStatus.vue";
|
||||
import CapturesCard from "./CapturesCard.vue";
|
||||
import EventTypesCard from "./EventTypesCard.vue";
|
||||
import { loadEventTypes } from "./event-type-state";
|
||||
import { load, selectById, selectNewest, selected, useCaptures } from "./state";
|
||||
import { captures, load, selectById, selectNewest, selected, useCaptures } from "./state";
|
||||
|
||||
/**
|
||||
* Event inspector: recent inbound events, newest first, with the selected
|
||||
@@ -91,13 +90,10 @@ watch(selected, (capture) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- The stream's state belongs to this panel, not the page: the page carries
|
||||
tabs whose other two have nothing to do with the capture stream. -->
|
||||
<div class="mb-4 flex flex-wrap items-center justify-end gap-2">
|
||||
<CaptureStatus />
|
||||
</div>
|
||||
<!-- Split only when there is a capture to show beside the list. -->
|
||||
<div
|
||||
class="grid min-w-0 items-start gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]"
|
||||
class="grid min-w-0 items-start gap-4"
|
||||
:class="captures.length ? 'lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]' : ''"
|
||||
>
|
||||
<div ref="listColumn" class="min-w-0">
|
||||
<CapturesCard />
|
||||
|
||||
@@ -154,12 +154,15 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
<p
|
||||
<div
|
||||
v-if="!proposals.length && !eventTypes.length"
|
||||
class="text-sm text-fg-muted"
|
||||
class="flex flex-col items-center py-4 text-center"
|
||||
>
|
||||
No event types or proposals.
|
||||
</p>
|
||||
<p class="text-sm font-medium">No event types yet</p>
|
||||
<p class="mt-1 max-w-md text-sm text-fg-muted">
|
||||
Create one from a captured event.
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<EventTypeDialog />
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<script lang="ts">
|
||||
/** A conversational front-end, as /api/channels serialises it. */
|
||||
export interface Channel {
|
||||
id?: string;
|
||||
name: string;
|
||||
state?: string;
|
||||
configured?: boolean;
|
||||
description?: string;
|
||||
detail?: string;
|
||||
reload_supported?: boolean;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
|
||||
const props = defineProps<{ channel: Channel }>();
|
||||
|
||||
function tone(
|
||||
state: string | undefined,
|
||||
configured: boolean | undefined,
|
||||
): StatusKind {
|
||||
if (state === "running") return "ok";
|
||||
if (state === "failed" || state === "degraded") return "warn";
|
||||
return configured ? "idle" : "idle";
|
||||
}
|
||||
|
||||
const label = computed(
|
||||
() =>
|
||||
props.channel.state ||
|
||||
(props.channel.configured ? "configured" : "stopped"),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{{ props.channel.name }}</CardTitle>
|
||||
<CardDescription v-if="props.channel.description">{{
|
||||
props.channel.description
|
||||
}}</CardDescription>
|
||||
<Badge :variant="tone(props.channel.state, props.channel.configured)">{{
|
||||
label
|
||||
}}</Badge>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p v-if="props.channel.detail" class="text-sm text-fg-muted">
|
||||
{{ props.channel.detail }}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</template>
|
||||
@@ -1,74 +1,267 @@
|
||||
<script setup lang="ts">
|
||||
import AuditTable from "@/base/AuditTable.vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import HistoryLink from "@/settings/HistoryLink.vue";
|
||||
import { computed, onMounted, reactive, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { Globe, Mail, Send } from "@lucide/vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DurationInput } from "@/components/ui/duration-input";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
EmptyHeader,
|
||||
EmptyTitle,
|
||||
} from "@/components/ui/empty";
|
||||
NumberField,
|
||||
NumberFieldContent,
|
||||
NumberFieldDecrement,
|
||||
NumberFieldIncrement,
|
||||
NumberFieldInput,
|
||||
} from "@/components/ui/number-field";
|
||||
import { SegmentedControl } from "@/components/ui/segmented-control";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { StatusPill } from "@/components/ui/status-pill";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import {
|
||||
TagsInput,
|
||||
TagsInputInput,
|
||||
TagsInputItem,
|
||||
TagsInputItemDelete,
|
||||
TagsInputItemText,
|
||||
} from "@/components/ui/tags-input";
|
||||
import { api } from "@/lib/api";
|
||||
import StructuredResourceCard from "@/settings/StructuredResourceCard.vue";
|
||||
import SecretRefField from "@/settings/SecretRefField.vue";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ChannelCard, { type Channel } from "./ChannelCard.vue";
|
||||
|
||||
/** The conversational front-ends Archie can be reached through. */
|
||||
const KIND = "channel-settings";
|
||||
|
||||
const channels = ref<Channel[]>([]);
|
||||
const error = ref<string | null>(null);
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog } = storeToRefs(controlPlane);
|
||||
const settings = computed(() => resourcesForPage(catalog.value, "channels"));
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const res = await api.channels<{ channels?: Channel[] }>();
|
||||
channels.value = res?.channels || [];
|
||||
error.value = null;
|
||||
} catch (err) {
|
||||
error.value = String((err as Error).message || err);
|
||||
}
|
||||
interface SecretRef {
|
||||
engine: string;
|
||||
key: string;
|
||||
}
|
||||
interface ChannelSettings {
|
||||
operator: string;
|
||||
show_tool_calls: boolean;
|
||||
max_steps: number;
|
||||
models: string[] | null;
|
||||
email: { listen_addr: string; relay_addr: string };
|
||||
webhook_addr: string;
|
||||
webhook: { path: string; secret_ref: SecretRef; credential_configured: boolean; template: string; deliver_to: string };
|
||||
telegram: { allowed_user_ids: number[] | null; token_ref: SecretRef; credential_configured: boolean };
|
||||
rate_limit: { window: string; max_requests: number };
|
||||
unrestricted_filesystem: boolean;
|
||||
workspace: string;
|
||||
}
|
||||
|
||||
useLiveResource(null, () => void load());
|
||||
onMounted(() => Promise.all([load(), controlPlane.load()]));
|
||||
/** What the messaging service reports about a running channel. */
|
||||
interface ChannelStatus {
|
||||
id?: string;
|
||||
state?: string;
|
||||
detail?: string;
|
||||
}
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "channels"));
|
||||
const chat = computed(() => store.drafts[KIND]?.value as ChannelSettings | undefined);
|
||||
const error = computed(() => store.stateFor(KIND).error);
|
||||
|
||||
const statuses = ref<ChannelStatus[]>([]);
|
||||
async function loadStatus() {
|
||||
try {
|
||||
statuses.value = (await api.channels<{ channels?: ChannelStatus[] }>())?.channels ?? [];
|
||||
} catch {
|
||||
statuses.value = [];
|
||||
}
|
||||
}
|
||||
useLiveResource(null, () => void loadStatus());
|
||||
onMounted(() => Promise.all([loadStatus(), store.load()]));
|
||||
|
||||
// Running state comes only from the messaging service's report; a channel it
|
||||
// does not mention shows none rather than one guessed from its settings.
|
||||
function statusOf(id: string) {
|
||||
const state = statuses.value.find((s) => s.id === id)?.state;
|
||||
if (!state) return undefined;
|
||||
if (state === "running") return { label: "Running", tone: "neutral", dot: "live" } as const;
|
||||
if (state === "failed") return { label: "Failed", tone: "danger", dot: "danger" } as const;
|
||||
if (state === "degraded") return { label: "Degraded", tone: "warn", dot: "warn" } as const;
|
||||
return { label: state[0]!.toUpperCase() + state.slice(1), tone: "neutral", dot: "idle" } as const;
|
||||
}
|
||||
|
||||
// A channel is set up once its enabling field is filled in, the rule the
|
||||
// daemon applies when it decides what to start.
|
||||
const configured = computed(() => ({
|
||||
telegram: !!chat.value?.telegram.token_ref.key,
|
||||
email: !!chat.value?.email.listen_addr,
|
||||
webhook: !!chat.value?.webhook_addr,
|
||||
}));
|
||||
const opened = reactive({ telegram: false, email: false, webhook: false });
|
||||
const shown = (id: keyof typeof opened) => configured.value[id] || opened[id];
|
||||
|
||||
const channels = [
|
||||
{ id: "telegram", title: "Telegram", icon: Send },
|
||||
{ id: "email", title: "Email", icon: Mail },
|
||||
{ id: "webhook", title: "Webhook", icon: Globe },
|
||||
] as const;
|
||||
|
||||
const allowedUsers = computed({
|
||||
get: () => (chat.value?.telegram.allowed_user_ids ?? []).map(String),
|
||||
set: (ids: string[]) => {
|
||||
if (chat.value)
|
||||
chat.value.telegram.allowed_user_ids = ids.filter((id) => /^\d+$/.test(id)).map(Number);
|
||||
},
|
||||
});
|
||||
const models = computed({
|
||||
get: () => chat.value?.models ?? [],
|
||||
set: (list: string[]) => {
|
||||
if (chat.value) chat.value.models = list;
|
||||
},
|
||||
});
|
||||
const replyModes = [
|
||||
{ value: "", label: "No reply" },
|
||||
{ value: "origin", label: "HTTP response" },
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Channels" />
|
||||
<PageHeader title="Channels">
|
||||
<HistoryLink :kinds="resources.map((r) => r.kind)" />
|
||||
</PageHeader>
|
||||
|
||||
<div
|
||||
class="grid grid-cols-1 gap-4 lg:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]"
|
||||
>
|
||||
<Empty v-if="error">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Cannot reach archied</EmptyTitle>
|
||||
<EmptyDescription>{{ error }}</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<Empty v-else-if="!channels.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No channels configured</EmptyTitle>
|
||||
<EmptyDescription>Add one below.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ChannelCard
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">
|
||||
{{ catalogError || error }}
|
||||
</p>
|
||||
|
||||
<template v-if="chat">
|
||||
<section
|
||||
v-for="channel in channels"
|
||||
v-else
|
||||
:key="channel.id || channel.name"
|
||||
:channel="channel"
|
||||
/>
|
||||
</div>
|
||||
<StructuredResourceCard
|
||||
v-for="descriptor in settings"
|
||||
:key="descriptor.kind"
|
||||
:descriptor="descriptor"
|
||||
/>
|
||||
<AuditTable :resources="settings" />
|
||||
:key="channel.id"
|
||||
class="mb-4 rounded-lg border border-border bg-card"
|
||||
:aria-labelledby="`ch-${channel.id}`"
|
||||
>
|
||||
<header class="flex items-center gap-3 px-5 py-4">
|
||||
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-muted-foreground">
|
||||
<component :is="channel.icon" class="size-4" aria-hidden="true" />
|
||||
</span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<h2 :id="`ch-${channel.id}`" class="text-[15px] font-medium">{{ channel.title }}</h2>
|
||||
</div>
|
||||
<StatusPill v-if="statusOf(channel.id)" :tone="statusOf(channel.id)!.tone" :dot="statusOf(channel.id)!.dot">
|
||||
{{ statusOf(channel.id)!.label }}
|
||||
</StatusPill>
|
||||
<template v-if="!configured[channel.id]">
|
||||
<StatusPill>Not set up</StatusPill>
|
||||
<Button v-if="!opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">
|
||||
Set up
|
||||
</Button>
|
||||
</template>
|
||||
</header>
|
||||
|
||||
<div v-if="shown(channel.id)" class="px-5 pb-2">
|
||||
<template v-if="channel.id === 'telegram'">
|
||||
<SettingRow label="Bot token" hint="Empty disables Telegram.">
|
||||
<SecretRefField
|
||||
v-model="chat.telegram.token_ref"
|
||||
id-prefix="tg-token"
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow label="Allowed users" hint="Everyone else is ignored.">
|
||||
<TagsInput v-model="allowedUsers" aria-label="Allowed users" class="font-mono">
|
||||
<TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="Add user ID" />
|
||||
</TagsInput>
|
||||
</SettingRow>
|
||||
</template>
|
||||
|
||||
<template v-else-if="channel.id === 'email'">
|
||||
<SettingRow label="Listen address" for="em-listen" hint="Empty disables email.">
|
||||
<Input id="em-listen" v-model="chat.email.listen_addr" class="max-w-sm font-mono" placeholder=":2525" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Relay address" for="em-relay">
|
||||
<Input id="em-relay" v-model="chat.email.relay_addr" class="max-w-sm font-mono" />
|
||||
</SettingRow>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<SettingRow label="Listen address" for="wh-addr" hint="Empty disables the webhook.">
|
||||
<Input id="wh-addr" v-model="chat.webhook_addr" class="max-w-sm font-mono" placeholder=":8686" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Path" for="wh-path">
|
||||
<Input id="wh-path" v-model="chat.webhook.path" class="max-w-sm font-mono" placeholder="/webhook" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Message field" for="wh-template" hint="Dot path. Empty: whole body.">
|
||||
<Input id="wh-template" v-model="chat.webhook.template" class="max-w-sm font-mono" placeholder="issue.title" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Replies">
|
||||
<SegmentedControl v-model="chat.webhook.deliver_to" label="Replies" :options="replyModes" />
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="Signing secret"
|
||||
hint="Unset accepts unsigned requests."
|
||||
:tone="chat.webhook.secret_ref.key ? 'default' : 'danger'"
|
||||
>
|
||||
<SecretRefField
|
||||
v-model="chat.webhook.secret_ref"
|
||||
id-prefix="wh-secret"
|
||||
/>
|
||||
</SettingRow>
|
||||
</template>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="mt-8 rounded-lg border border-border bg-card px-5 pt-4 pb-2" aria-labelledby="ch-defaults">
|
||||
<h2 id="ch-defaults" class="text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase">
|
||||
Chat session defaults · all channels
|
||||
</h2>
|
||||
<SettingRow label="Workspace" for="cs-workspace" hint="Empty disables file tools.">
|
||||
<Input id="cs-workspace" v-model="chat.workspace" class="max-w-md font-mono" />
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="Unrestricted filesystem"
|
||||
hint="File tools can write anywhere."
|
||||
:tone="chat.unrestricted_filesystem ? 'danger' : 'default'"
|
||||
>
|
||||
<Switch v-model="chat.unrestricted_filesystem" aria-label="Unrestricted filesystem" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Show tool calls">
|
||||
<Switch v-model="chat.show_tool_calls" aria-label="Show tool calls" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Max steps" hint="0 = default (100).">
|
||||
<NumberField v-model="chat.max_steps" :min="0" class="w-32">
|
||||
<NumberFieldContent>
|
||||
<NumberFieldDecrement />
|
||||
<NumberFieldInput class="font-mono" aria-label="Max steps" />
|
||||
<NumberFieldIncrement />
|
||||
</NumberFieldContent>
|
||||
</NumberField>
|
||||
</SettingRow>
|
||||
<SettingRow label="Rate limit" hint="Per sender. Off while either is 0.">
|
||||
<div class="flex flex-wrap items-center gap-2 text-sm text-fg-muted">
|
||||
<NumberField v-model="chat.rate_limit.max_requests" :min="0" class="w-28">
|
||||
<NumberFieldContent>
|
||||
<NumberFieldInput class="font-mono" aria-label="Requests" />
|
||||
</NumberFieldContent>
|
||||
</NumberField>
|
||||
requests per
|
||||
<DurationInput v-model="chat.rate_limit.window" :units="['s', 'm', 'h']" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
<SettingRow label="Models" hint="Empty: role models.">
|
||||
<TagsInput v-model="models" aria-label="Models" class="font-mono">
|
||||
<TagsInputItem v-for="model in models" :key="model" :value="model">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="provider/model" />
|
||||
</TagsInput>
|
||||
</SettingRow>
|
||||
<SettingRow label="Operator" for="cs-operator">
|
||||
<Input id="cs-operator" v-model="chat.operator" class="max-w-sm" />
|
||||
</SettingRow>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -29,7 +29,7 @@ function glyph(visible: boolean): string {
|
||||
<template>
|
||||
<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"
|
||||
class="relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0"
|
||||
:aria-label="open ? 'Close chat' : 'Chat with Archie'"
|
||||
:title="open ? 'Close chat' : 'Chat with Archie'"
|
||||
:aria-expanded="open"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import { connectionStatus } from "@/lib/connection";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
const { streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
const status = computed(() => connectionStatus(streamState.value));
|
||||
const look = {
|
||||
ok: { dot: "bg-primary", text: "text-fg-subtle" },
|
||||
warn: { dot: "bg-warn", text: "text-warn" },
|
||||
danger: { dot: "bg-danger", text: "text-danger" },
|
||||
} as const;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span role="status" class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden" :class="look[status.tone].text">
|
||||
<span class="size-1.5 rounded-full" :class="look[status.tone].dot" aria-hidden="true" />
|
||||
{{ status.label }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -16,7 +16,7 @@ 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"
|
||||
class="scroll-fade-x flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]"
|
||||
>
|
||||
<template
|
||||
v-for="node in tree"
|
||||
|
||||
@@ -63,8 +63,8 @@ function closeMenuSoon() {
|
||||
@pointerenter="openMenu"
|
||||
@pointerleave="closeMenuSoon"
|
||||
>
|
||||
<template v-for="item in items" :key="item.path">
|
||||
<DropdownMenuSeparator v-if="item.dividerBefore" />
|
||||
<template v-for="(item, index) in items" :key="item.path">
|
||||
<DropdownMenuSeparator v-if="item.dividerBefore && index > 0" />
|
||||
<DropdownMenuLabel v-if="item.dividerBefore">{{
|
||||
item.dividerBefore
|
||||
}}</DropdownMenuLabel>
|
||||
|
||||
@@ -26,15 +26,10 @@ import {
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem as-child>
|
||||
<RouterLink to="/system/appearance" class="w-full cursor-pointer"
|
||||
<RouterLink to="/settings/appearance" class="w-full cursor-pointer"
|
||||
>Appearance</RouterLink
|
||||
>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem as-child>
|
||||
<RouterLink to="/system/status" class="w-full cursor-pointer"
|
||||
>Status</RouterLink
|
||||
>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</template>
|
||||
@@ -1,11 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import NewTaskButton from "@/tasks/NewTaskButton.vue";
|
||||
import Brand from "./Brand.vue";
|
||||
import ConnectionPill from "./ConnectionPill.vue";
|
||||
import Nav from "./Nav.vue";
|
||||
import ProfileDropdown from "./ProfileDropdown.vue";
|
||||
import SearchBar from "./SearchBar.vue";
|
||||
import SupportLink from "./SupportLink.vue";
|
||||
|
||||
defineProps<{ hidden: string[] }>();
|
||||
const props = defineProps<{ hidden: string[] }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -13,15 +15,12 @@ defineProps<{ hidden: string[] }>();
|
||||
class="bg-background/80 sticky top-0 z-40 flex h-14 items-center gap-3 border-b px-3 backdrop-blur-xl sm:px-4"
|
||||
>
|
||||
<Brand />
|
||||
<Nav :hidden="hidden" />
|
||||
<div class="flex shrink-0 items-center gap-1">
|
||||
<SearchBar :hidden="hidden" />
|
||||
<Nav :hidden="props.hidden" />
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
<SearchBar :hidden="props.hidden" />
|
||||
<NewTaskButton v-if="!props.hidden.includes('/workflows')" />
|
||||
<ConnectionPill />
|
||||
<SupportLink />
|
||||
<!--
|
||||
The theme control lives on /system/appearance, not here. Two switches
|
||||
for one preference is two places to look and one of them to be wrong
|
||||
(docs/prds/dashboard-navigation-groups.md).
|
||||
-->
|
||||
<ProfileDropdown />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionRootEmits, AccordionRootProps } from 'reka-ui'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import {
|
||||
AccordionRoot,
|
||||
useForwardPropsEmits,
|
||||
} from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<AccordionRootProps & { class?: HTMLAttributes['class'] }>()
|
||||
const emits = defineEmits<AccordionRootEmits>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccordionRoot
|
||||
v-slot="slotProps"
|
||||
data-slot="accordion"
|
||||
v-bind="forwarded"
|
||||
:class="cn('flex w-full flex-col', props.class)"
|
||||
>
|
||||
<slot v-bind="slotProps" />
|
||||
</AccordionRoot>
|
||||
</template>
|
||||
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionContentProps } from 'reka-ui'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import { AccordionContent } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<AccordionContentProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccordionContent
|
||||
data-slot="accordion-content"
|
||||
v-bind="delegatedProps"
|
||||
class="data-open:animate-accordion-down data-closed:animate-accordion-up text-sm overflow-hidden"
|
||||
>
|
||||
<div
|
||||
:class="cn(
|
||||
'pt-0 pb-2.5 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4',
|
||||
props.class,
|
||||
)"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</template>
|
||||
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionItemProps } from 'reka-ui'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import { AccordionItem, useForwardProps } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<AccordionItemProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwardedProps = useForwardProps(delegatedProps)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccordionItem
|
||||
v-slot="slotProps"
|
||||
data-slot="accordion-item"
|
||||
v-bind="forwardedProps"
|
||||
:class="cn('not-last:border-b', props.class)"
|
||||
>
|
||||
<slot v-bind="slotProps" />
|
||||
</AccordionItem>
|
||||
</template>
|
||||
@@ -0,0 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import type { AccordionTriggerProps } from 'reka-ui'
|
||||
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { ChevronDownIcon, ChevronUpIcon } from '@lucide/vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import {
|
||||
AccordionHeader,
|
||||
AccordionTrigger,
|
||||
} from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<AccordionTriggerProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccordionHeader class="flex">
|
||||
<AccordionTrigger
|
||||
data-slot="accordion-trigger"
|
||||
v-bind="delegatedProps"
|
||||
:class="
|
||||
cn(
|
||||
'focus-visible:ring-ring/50 focus-visible:border-ring focus-visible:after:border-ring **:data-[slot=accordion-trigger-icon]:text-muted-foreground rounded-lg py-2.5 text-left text-sm font-medium hover:underline focus-visible:ring-3 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 group/accordion-trigger relative flex flex-1 items-start justify-between border border-transparent transition-all outline-none disabled:pointer-events-none disabled:opacity-50',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
>
|
||||
<slot />
|
||||
<slot name="icon">
|
||||
<ChevronDownIcon data-slot="accordion-trigger-icon" class="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" />
|
||||
<ChevronUpIcon data-slot="accordion-trigger-icon" class="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" />
|
||||
</slot>
|
||||
</AccordionTrigger>
|
||||
</AccordionHeader>
|
||||
</template>
|
||||
@@ -0,0 +1,4 @@
|
||||
export { default as Accordion } from './Accordion.vue'
|
||||
export { default as AccordionContent } from './AccordionContent.vue'
|
||||
export { default as AccordionItem } from './AccordionItem.vue'
|
||||
export { default as AccordionTrigger } from './AccordionTrigger.vue'
|
||||
@@ -0,0 +1,18 @@
|
||||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<nav
|
||||
aria-label="breadcrumb"
|
||||
data-slot="breadcrumb"
|
||||
:class="cn('', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</nav>
|
||||
</template>
|
||||
@@ -0,0 +1,24 @@
|
||||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
|
||||
import { MoreHorizontalIcon } from '@lucide/vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
data-slot="breadcrumb-ellipsis"
|
||||
role="presentation"
|
||||
aria-hidden="true"
|
||||
:class="cn('size-5 [&>svg]:size-4 flex items-center justify-center', props.class)"
|
||||
>
|
||||
<slot>
|
||||
<MoreHorizontalIcon />
|
||||
</slot>
|
||||
<span class="sr-only">More</span>
|
||||
</span>
|
||||
</template>
|
||||
@@ -0,0 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<li
|
||||
data-slot="breadcrumb-item"
|
||||
:class="cn('gap-1 inline-flex items-center', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</li>
|
||||
</template>
|
||||
@@ -0,0 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
import type { PrimitiveProps } from 'reka-ui'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { Primitive } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = withDefaults(defineProps<PrimitiveProps & { class?: HTMLAttributes['class'] }>(), {
|
||||
as: 'a',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Primitive
|
||||
data-slot="breadcrumb-link"
|
||||
:as="as"
|
||||
:as-child="asChild"
|
||||
:class="cn('hover:text-foreground transition-colors', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</Primitive>
|
||||
</template>
|
||||
@@ -0,0 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ol
|
||||
data-slot="breadcrumb-list"
|
||||
:class="cn('text-muted-foreground gap-1.5 text-sm flex flex-wrap items-center wrap-break-word', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</ol>
|
||||
</template>
|
||||
@@ -0,0 +1,20 @@
|
||||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
data-slot="breadcrumb-page"
|
||||
role="link"
|
||||
aria-disabled="true"
|
||||
aria-current="page"
|
||||
:class="cn('text-foreground font-normal', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
</template>
|
||||
@@ -0,0 +1,23 @@
|
||||
<script lang="ts" setup>
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
|
||||
import { ChevronRightIcon } from '@lucide/vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<li
|
||||
data-slot="breadcrumb-separator"
|
||||
role="presentation"
|
||||
aria-hidden="true"
|
||||
:class="cn('[&>svg]:size-3.5', props.class)"
|
||||
>
|
||||
<slot>
|
||||
<ChevronRightIcon class="cn-rtl-flip" />
|
||||
</slot>
|
||||
</li>
|
||||
</template>
|
||||
@@ -0,0 +1,7 @@
|
||||
export { default as Breadcrumb } from './Breadcrumb.vue'
|
||||
export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue'
|
||||
export { default as BreadcrumbItem } from './BreadcrumbItem.vue'
|
||||
export { default as BreadcrumbLink } from './BreadcrumbLink.vue'
|
||||
export { default as BreadcrumbList } from './BreadcrumbList.vue'
|
||||
export { default as BreadcrumbPage } from './BreadcrumbPage.vue'
|
||||
export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue'
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "@/components/ui/input-group";
|
||||
import { bytesToMB, mbToBytes } from "./bytes";
|
||||
|
||||
defineProps<{ id?: string; disabled?: boolean }>();
|
||||
const model = defineModel<number>({ required: true });
|
||||
|
||||
const mb = ref(0);
|
||||
watch(
|
||||
model,
|
||||
(bytes) => {
|
||||
if (mbToBytes(mb.value) !== bytes) mb.value = bytesToMB(bytes ?? 0);
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
function emitChange() {
|
||||
if (Number.isFinite(mb.value) && mb.value >= 0) model.value = mbToBytes(mb.value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<InputGroup class="w-40">
|
||||
<InputGroupInput
|
||||
:id="id"
|
||||
v-model.number="mb"
|
||||
type="number"
|
||||
min="0"
|
||||
step="any"
|
||||
inputmode="decimal"
|
||||
class="font-mono"
|
||||
:disabled="disabled"
|
||||
@change="emitChange"
|
||||
/>
|
||||
<InputGroupAddon align="inline-end">
|
||||
<InputGroupText class="font-mono text-xs">MB</InputGroupText>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
</template>
|
||||
@@ -0,0 +1,9 @@
|
||||
export const BYTES_PER_MB = 1_000_000;
|
||||
|
||||
export function bytesToMB(bytes: number): number {
|
||||
return Number((bytes / BYTES_PER_MB).toFixed(6));
|
||||
}
|
||||
|
||||
export function mbToBytes(mb: number): number {
|
||||
return Math.round(mb * BYTES_PER_MB);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as ByteSizeInput } from "./ByteSizeInput.vue";
|
||||
export * from "./bytes";
|
||||
@@ -0,0 +1,63 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group";
|
||||
import type { DurationUnit } from "./duration";
|
||||
import {
|
||||
DURATION_UNITS,
|
||||
formatGoDuration,
|
||||
joinDuration,
|
||||
parseGoDuration,
|
||||
splitDuration,
|
||||
} from "./duration";
|
||||
|
||||
const props = defineProps<{ id?: string; disabled?: boolean; units?: DurationUnit[] }>();
|
||||
const model = defineModel<string>({ required: true });
|
||||
|
||||
const units = computed(() => props.units ?? DURATION_UNITS);
|
||||
const amount = ref(0);
|
||||
const unit = ref<DurationUnit>("s");
|
||||
|
||||
watch(
|
||||
model,
|
||||
(text) => {
|
||||
const ms = parseGoDuration(text ?? "");
|
||||
if (ms === null) return;
|
||||
if (joinDuration(amount.value, unit.value) === ms) return;
|
||||
const split = splitDuration(ms);
|
||||
amount.value = split.value;
|
||||
unit.value = units.value.includes(split.unit) ? split.unit : "ms";
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
function emitChange() {
|
||||
if (!Number.isFinite(amount.value) || amount.value < 0) return;
|
||||
model.value = formatGoDuration(joinDuration(amount.value, unit.value));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<InputGroup class="w-48">
|
||||
<InputGroupInput
|
||||
:id="id"
|
||||
v-model.number="amount"
|
||||
type="number"
|
||||
min="0"
|
||||
inputmode="decimal"
|
||||
class="font-mono"
|
||||
:disabled="disabled"
|
||||
@change="emitChange"
|
||||
/>
|
||||
<InputGroupAddon align="inline-end">
|
||||
<select
|
||||
v-model="unit"
|
||||
aria-label="Unit"
|
||||
class="bg-transparent font-mono text-xs text-muted-foreground outline-none"
|
||||
:disabled="disabled"
|
||||
@change="emitChange"
|
||||
>
|
||||
<option v-for="u in units" :key="u" :value="u">{{ u }}</option>
|
||||
</select>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
</template>
|
||||
@@ -0,0 +1,66 @@
|
||||
export type DurationUnit = "ms" | "s" | "m" | "h";
|
||||
|
||||
const UNIT_MS: Record<string, number> = {
|
||||
ns: 1e-6,
|
||||
us: 1e-3,
|
||||
"µs": 1e-3,
|
||||
ms: 1,
|
||||
s: 1000,
|
||||
m: 60_000,
|
||||
h: 3_600_000,
|
||||
};
|
||||
|
||||
export const DURATION_UNITS: DurationUnit[] = ["ms", "s", "m", "h"];
|
||||
|
||||
/** Parses a Go duration string ("1h0m0s", "1m30s", "500ms", "0") to milliseconds. */
|
||||
export function parseGoDuration(input: string): number | null {
|
||||
const text = input.trim();
|
||||
if (text === "0") return 0;
|
||||
const sign = text.startsWith("-") ? -1 : 1;
|
||||
const body = text.replace(/^[-+]/, "");
|
||||
if (body === "") return null;
|
||||
const re = /(\d+(?:\.\d*)?|\.\d+)(ns|us|µs|ms|s|m|h)/gy;
|
||||
let total = 0;
|
||||
let consumed = 0;
|
||||
let match: RegExpExecArray | null;
|
||||
while ((match = re.exec(body)) !== null) {
|
||||
total += Number(match[1]) * UNIT_MS[match[2]];
|
||||
consumed = re.lastIndex;
|
||||
}
|
||||
if (consumed !== body.length) return null;
|
||||
return sign * total;
|
||||
}
|
||||
|
||||
function trimFraction(n: number): string {
|
||||
return Number(n.toFixed(9)).toString();
|
||||
}
|
||||
|
||||
/** Formats milliseconds the way Go's time.Duration.String does. */
|
||||
export function formatGoDuration(ms: number): string {
|
||||
if (ms === 0) return "0s";
|
||||
const sign = ms < 0 ? "-" : "";
|
||||
let rest = Math.abs(ms);
|
||||
if (rest < 1000) return `${sign}${trimFraction(rest)}ms`;
|
||||
const h = Math.floor(rest / 3_600_000);
|
||||
rest -= h * 3_600_000;
|
||||
const m = Math.floor(rest / 60_000);
|
||||
rest -= m * 60_000;
|
||||
const s = `${trimFraction(rest / 1000)}s`;
|
||||
if (h > 0) return `${sign}${h}h${m}m${s}`;
|
||||
if (m > 0) return `${sign}${m}m${s}`;
|
||||
return `${sign}${s}`;
|
||||
}
|
||||
|
||||
/** Picks the largest unit that expresses ms as a whole number. */
|
||||
export function splitDuration(ms: number): { value: number; unit: DurationUnit } {
|
||||
for (const unit of ["h", "m", "s"] as const) {
|
||||
const size = UNIT_MS[unit];
|
||||
if (ms !== 0 && ms % size === 0) return { value: ms / size, unit };
|
||||
}
|
||||
if (ms === 0) return { value: 0, unit: "s" };
|
||||
return { value: ms, unit: "ms" };
|
||||
}
|
||||
|
||||
export function joinDuration(value: number, unit: DurationUnit): number {
|
||||
return value * UNIT_MS[unit];
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as DurationInput } from "./DurationInput.vue";
|
||||
export * from "./duration";
|
||||
@@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<kbd
|
||||
data-slot="kbd"
|
||||
:class="cn('bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*=size-])]:size-3 pointer-events-none inline-flex items-center justify-center select-none', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</kbd>
|
||||
</template>
|
||||
@@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<kbd
|
||||
data-slot="kbd-group"
|
||||
:class="cn('gap-1 inline-flex items-center', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</kbd>
|
||||
</template>
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as Kbd } from './Kbd.vue'
|
||||
export { default as KbdGroup } from './KbdGroup.vue'
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import type { NumberFieldRootEmits, NumberFieldRootProps } from 'reka-ui'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import { NumberFieldRoot, useForwardPropsEmits } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<NumberFieldRootProps & { class?: HTMLAttributes['class'] }>()
|
||||
const emits = defineEmits<NumberFieldRootEmits>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NumberFieldRoot v-slot="slotProps" v-bind="forwarded" :class="cn('grid gap-1.5', props.class)">
|
||||
<slot v-bind="slotProps" />
|
||||
</NumberFieldRoot>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="cn('relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5', props.class)">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
import type { NumberFieldDecrementProps } from 'reka-ui'
|
||||
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { MinusIcon } from '@lucide/vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import { NumberFieldDecrement, useForwardProps } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<NumberFieldDecrementProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwarded = useForwardProps(delegatedProps)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NumberFieldDecrement data-slot="decrement" v-bind="forwarded" :class="cn('absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20', props.class)">
|
||||
<slot>
|
||||
<MinusIcon class="h-4 w-4" />
|
||||
</slot>
|
||||
</NumberFieldDecrement>
|
||||
</template>
|
||||
@@ -0,0 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
import type { NumberFieldIncrementProps } from 'reka-ui'
|
||||
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { PlusIcon } from '@lucide/vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import { NumberFieldIncrement, useForwardProps } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<NumberFieldIncrementProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwarded = useForwardProps(delegatedProps)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NumberFieldIncrement data-slot="increment" v-bind="forwarded" :class="cn('absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3', props.class)">
|
||||
<slot>
|
||||
<PlusIcon class="h-4 w-4" />
|
||||
</slot>
|
||||
</NumberFieldIncrement>
|
||||
</template>
|
||||
@@ -0,0 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { NumberFieldInput } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NumberFieldInput
|
||||
data-slot="input"
|
||||
:class="cn(
|
||||
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 text-center outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
||||
props.class,
|
||||
)"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,5 @@
|
||||
export { default as NumberField } from './NumberField.vue'
|
||||
export { default as NumberFieldContent } from './NumberFieldContent.vue'
|
||||
export { default as NumberFieldDecrement } from './NumberFieldDecrement.vue'
|
||||
export { default as NumberFieldIncrement } from './NumberFieldIncrement.vue'
|
||||
export { default as NumberFieldInput } from './NumberFieldInput.vue'
|
||||
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import type { RadioGroupRootEmits, RadioGroupRootProps } from 'reka-ui'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import { RadioGroupRoot, useForwardPropsEmits } from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<RadioGroupRootProps & { class?: HTMLAttributes['class'] }>()
|
||||
const emits = defineEmits<RadioGroupRootEmits>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RadioGroupRoot
|
||||
v-slot="slotProps"
|
||||
data-slot="radio-group"
|
||||
:class="cn('grid gap-2 w-full', props.class)"
|
||||
v-bind="forwarded"
|
||||
>
|
||||
<slot v-bind="slotProps" />
|
||||
</RadioGroupRoot>
|
||||
</template>
|
||||
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import type { RadioGroupItemProps } from 'reka-ui'
|
||||
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { CircleIcon } from '@lucide/vue'
|
||||
import { reactiveOmit } from '@vueuse/core'
|
||||
import {
|
||||
RadioGroupIndicator,
|
||||
RadioGroupItem,
|
||||
useForwardProps,
|
||||
} from 'reka-ui'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<RadioGroupItemProps & { class?: HTMLAttributes['class'] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, 'class')
|
||||
|
||||
const forwardedProps = useForwardProps(delegatedProps)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RadioGroupItem
|
||||
data-slot="radio-group-item"
|
||||
v-bind="forwardedProps"
|
||||
:class="
|
||||
cn(
|
||||
'border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',
|
||||
props.class,
|
||||
)
|
||||
"
|
||||
>
|
||||
<RadioGroupIndicator
|
||||
data-slot="radio-group-indicator"
|
||||
class="flex size-4 items-center justify-center"
|
||||
>
|
||||
<slot>
|
||||
<CircleIcon class="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full" />
|
||||
</slot>
|
||||
</RadioGroupIndicator>
|
||||
</RadioGroupItem>
|
||||
</template>
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as RadioGroup } from './RadioGroup.vue'
|
||||
export { default as RadioGroupItem } from './RadioGroupItem.vue'
|
||||
Loaded 100 of 205 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user