feat(webui): five-place top bar with Settings, New task and one connection pill
Dashboard, Tasks, Workflows, Events and Settings replace the Work, Agent and System menus. Configuration pages move under /settings/* with redirects from their old paths; Logs and Appearance leave the bar and stay reachable from Jump to, the Dashboard and the account menu. New task opens the Start work form in a dialog and lands on the new task. One pill reports the live stream's state. Drops docs/prds/dashboard-navigation-groups.md: web UI design is not tracked in PRDs.
This commit is contained in:
23 files changed
+453
-383
No files matched your search
@@ -95,5 +95,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/`.
|
||||
@@ -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.
|
||||
|
||||
@@ -30,18 +30,18 @@ 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/advanced", Label: "Advanced", Description: "Identity, storage, sandboxing, and dangerous actions."},
|
||||
}
|
||||
|
||||
// DashboardPages returns a copy of the dashboard page registry.
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.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-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,Line truncated
|
||||
.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-divide-x-reverse:0;--tw-border-style:solid;--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-divide-y-reverse:0;--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-15Line truncated
|
||||
Vendored
+6
-6
@@ -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
|
||||
`))),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
|
||||
|
||||
`);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 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($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`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`]
Line truncated
|
||||
`).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 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($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`,`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=_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;if(e.contains(t))return!0;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)){r.removeEventListener(`click`,a.value),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.layersWithOutsidePointer
Line truncated
|
||||
- a positive number
|
||||
- less than the value passed to \`max\` (or ${Ex} 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
|
||||
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
|
||||
`).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 Xj(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 Zj(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 Qj(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 $j(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 eM(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function tM(e){return(e?.repository??`required`)!==`none`}function nM(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function rM(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 iM={pending_approval:`pending approval`,armed:`armed`},aM={pending_approval:`warn`,armed:`ok`};function oM(e){return e?iM[e]??e:`unknown`}function sM(e){return aM[e??``]??`idle`}function cM(){return{id:null,name:``,eventTypeId:``,mappingId:``,filter:``,workflow:``,owner:``,repo:``,repoParam:``,inputs:{}}}function lM(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 uM(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:rM(r.value,n.type)})}let o=tM(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 dM(e){return e.repo_param?`from ${e.repo_param}`:e.owner&&e.repo?`${e.owner}/${e.repo}`:`—`}function fM(e,t){return t.find(t=>t.id===e.mapping_id)?.event_type_id}var pM={class:`font-mono`},mM={class:`text-fg-muted`},hM={class:`grid grid-cols-2 items-start gap-3`},gM={class:`grid grid-cols-2 items-start gap-3`},_M=`__constant__`,vM=`__none__`,yM=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(cM());A(r,e=>{e&&(a.value=n.binding?lM(n.binding,n.mappings):cM())},{immediate:!0});let o=U(()=>eM(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(()=>nM(l.value,`string`));function d(e){return a.value.inputs[e]??={param:``,value:``},a.value.inputs[e]}function f(e){return d(e).param||_M}function p(e,t){d(e).param=t===_M?``:String(t)}let m=U({get:()=>a.value.repoParam||vM,set:e=>{a.value.repoParam=e===vM?``: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
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import { StatusPill } from "@/components/ui/status-pill";
|
||||
import { connectionStatus } from "@/lib/connection";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
const { streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
const status = computed(() => connectionStatus(streamState.value));
|
||||
const pill = {
|
||||
ok: { tone: "neutral", dot: "live" },
|
||||
warn: { tone: "warn", dot: "warn" },
|
||||
danger: { tone: "danger", dot: "danger" },
|
||||
} as const;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<StatusPill
|
||||
:tone="pill[status.tone].tone"
|
||||
:dot="pill[status.tone].dot"
|
||||
role="status"
|
||||
class="max-sm:hidden"
|
||||
>{{ status.label }}</StatusPill
|
||||
>
|
||||
</template>
|
||||
@@ -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,13 @@
|
||||
import type { StreamState } from "./stream-state";
|
||||
|
||||
export type ConnectionState = StreamState | "connecting";
|
||||
|
||||
/** What the UI calls the live stream's state, and the tone it is shown in. */
|
||||
export function connectionStatus(state: ConnectionState): {
|
||||
label: string;
|
||||
tone: "ok" | "warn" | "danger";
|
||||
} {
|
||||
if (state === "live") return { label: "Connected", tone: "ok" };
|
||||
if (state === "unavailable") return { label: "Disconnected", tone: "danger" };
|
||||
return { label: "Connecting", tone: "warn" };
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
export interface NavEntry {
|
||||
path: string;
|
||||
label: string;
|
||||
description: string;
|
||||
section?: string;
|
||||
dividerBefore?: string;
|
||||
soon?: boolean;
|
||||
}
|
||||
|
||||
export interface NavLink {
|
||||
kind: "link";
|
||||
entry: NavEntry;
|
||||
}
|
||||
|
||||
export interface NavGroup {
|
||||
kind: "group";
|
||||
label: string;
|
||||
items: NavEntry[];
|
||||
}
|
||||
|
||||
export type NavNode = NavLink | NavGroup;
|
||||
|
||||
export interface NavRoute {
|
||||
path: string;
|
||||
meta?: {
|
||||
label?: string;
|
||||
description?: string;
|
||||
section?: string;
|
||||
soon?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export type NavSpec =
|
||||
| { kind: "link"; path: string }
|
||||
| {
|
||||
kind: "group";
|
||||
label: string;
|
||||
sections: { label: string; paths: string[] }[];
|
||||
};
|
||||
|
||||
/**
|
||||
* buildNav turns the specs into the bar, with the routes the serving
|
||||
* composition cannot back removed. A group whose every child is hidden is
|
||||
* dropped; each section's label moves to its first visible item. jumpTargets
|
||||
* is everything the bar reaches plus the unlisted pages, for the Jump to box.
|
||||
*/
|
||||
export function buildNav(
|
||||
table: NavRoute[],
|
||||
specs: NavSpec[],
|
||||
hidden: string[] = [],
|
||||
unlisted: string[] = [],
|
||||
): { tree: NavNode[]; jumpTargets: NavEntry[] } {
|
||||
const entryFor = (path: string): NavEntry => {
|
||||
const route = table.find((r) => r.path === path);
|
||||
if (!route) throw new Error(`nav references ${path}, which is not a route`);
|
||||
return {
|
||||
path,
|
||||
label: route.meta?.label ?? path,
|
||||
description: route.meta?.description ?? "",
|
||||
section: route.meta?.section,
|
||||
soon: route.meta?.soon,
|
||||
};
|
||||
};
|
||||
const visible = (path: string) => !hidden.includes(path);
|
||||
|
||||
const tree: NavNode[] = [];
|
||||
for (const spec of specs) {
|
||||
if (spec.kind === "link") {
|
||||
if (visible(spec.path))
|
||||
tree.push({ kind: "link", entry: entryFor(spec.path) });
|
||||
continue;
|
||||
}
|
||||
const items = spec.sections.flatMap((section) =>
|
||||
section.paths
|
||||
.filter(visible)
|
||||
.map(entryFor)
|
||||
.map((entry, i) =>
|
||||
i === 0 ? { ...entry, dividerBefore: section.label } : entry,
|
||||
),
|
||||
);
|
||||
if (items.length > 0) tree.push({ kind: "group", label: spec.label, items });
|
||||
}
|
||||
|
||||
const reached = tree.flatMap((node) =>
|
||||
node.kind === "link" ? [node.entry] : node.items,
|
||||
);
|
||||
const extra = unlisted.filter(visible).map(entryFor);
|
||||
return { tree, jumpTargets: [...reached, ...extra] };
|
||||
}
|
||||
+42
-101
@@ -1,121 +1,62 @@
|
||||
import { routes } from "@/router";
|
||||
import {
|
||||
buildNav,
|
||||
type NavNode,
|
||||
type NavRoute,
|
||||
type NavSpec,
|
||||
} from "./nav-tree";
|
||||
|
||||
export interface NavEntry {
|
||||
path: string;
|
||||
label: string;
|
||||
description: string;
|
||||
section?: string;
|
||||
dividerBefore?: string;
|
||||
soon?: boolean;
|
||||
}
|
||||
export type { NavEntry, NavGroup, NavLink, NavNode } from "./nav-tree";
|
||||
|
||||
export interface NavLink {
|
||||
kind: "link";
|
||||
entry: NavEntry;
|
||||
}
|
||||
|
||||
export interface NavGroup {
|
||||
kind: "group";
|
||||
label: string;
|
||||
items: NavEntry[];
|
||||
}
|
||||
|
||||
export type NavNode = NavLink | NavGroup;
|
||||
|
||||
interface RouteMeta {
|
||||
label?: string;
|
||||
description?: string;
|
||||
section?: string;
|
||||
nav?: boolean;
|
||||
navPath?: string;
|
||||
soon?: boolean;
|
||||
}
|
||||
|
||||
const table = routes as Array<{ path: string; meta?: RouteMeta }>;
|
||||
|
||||
// The bar reads left to right. A destination that is its own top-level thing is
|
||||
// a link rather than a group of one: Events carries the three surfaces that used
|
||||
// to sit in a dropdown, and a group whose only child shares its name is a menu
|
||||
// that says nothing.
|
||||
type NavSpec =
|
||||
| { kind: "link"; path: string }
|
||||
| {
|
||||
kind: "group";
|
||||
label: string;
|
||||
paths: string[];
|
||||
dividerBefore?: { path: string; label: string };
|
||||
};
|
||||
const table = routes as Array<NavRoute & { meta?: { navPath?: string } }>;
|
||||
|
||||
// Five places. Configuration lives under Settings, grouped the way the
|
||||
// settings sidebar groups it (docs/design/ui-redesign/README.md, section 2).
|
||||
const specs: NavSpec[] = [
|
||||
{ kind: "link", path: "/" },
|
||||
{
|
||||
kind: "group",
|
||||
label: "Work",
|
||||
paths: ["/tasks", "/workflows", "/channels", "/logs"],
|
||||
},
|
||||
{ kind: "group", label: "Agent", paths: ["/skills", "/curators"] },
|
||||
{ kind: "link", path: "/tasks" },
|
||||
{ kind: "link", path: "/workflows" },
|
||||
{ kind: "link", path: "/events" },
|
||||
{
|
||||
kind: "group",
|
||||
label: "System",
|
||||
paths: [
|
||||
"/system/status",
|
||||
"/system/appearance",
|
||||
"/system/tasks",
|
||||
"/system/models",
|
||||
"/system/repos",
|
||||
"/system/identities",
|
||||
"/system/advanced",
|
||||
label: "Settings",
|
||||
sections: [
|
||||
{
|
||||
label: "Agents",
|
||||
paths: [
|
||||
"/settings/models",
|
||||
"/settings/skills",
|
||||
"/settings/curators",
|
||||
"/settings/advanced",
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Integrations",
|
||||
paths: [
|
||||
"/settings/channels",
|
||||
"/settings/repositories",
|
||||
"/settings/identities",
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Runtime",
|
||||
paths: ["/settings/task-execution", "/settings/status"],
|
||||
},
|
||||
],
|
||||
dividerBefore: { path: "/system/tasks", label: "Settings" },
|
||||
},
|
||||
];
|
||||
|
||||
function entryFor(path: string): NavEntry {
|
||||
const route = table.find((r) => r.path === path);
|
||||
if (!route) throw new Error(`nav references ${path}, which is not a route`);
|
||||
return {
|
||||
path,
|
||||
label: route.meta?.label ?? path,
|
||||
description: route.meta?.description ?? "",
|
||||
section: route.meta?.section,
|
||||
soon: route.meta?.soon,
|
||||
};
|
||||
}
|
||||
// Reached from the Dashboard's Logs button and the account menu, and by
|
||||
// Jump to, but not from the bar.
|
||||
const unlisted = ["/logs", "/settings/appearance"];
|
||||
|
||||
/**
|
||||
* navTree returns the bar, with routes the serving composition cannot back
|
||||
* removed. A group whose every child is hidden is dropped; a group left with
|
||||
* one child stays a group, so the bar has the same shape on every deployment.
|
||||
*/
|
||||
export function navTree(hidden: string[] = []): NavNode[] {
|
||||
const visible = (e: NavEntry) => !hidden.includes(e.path);
|
||||
const nodes: NavNode[] = [];
|
||||
for (const spec of specs) {
|
||||
if (spec.kind === "link") {
|
||||
const entry = entryFor(spec.path);
|
||||
if (visible(entry)) nodes.push({ kind: "link", entry });
|
||||
continue;
|
||||
}
|
||||
const items = spec.paths.map(entryFor).filter(visible);
|
||||
const divided = items.map((item) => ({
|
||||
...item,
|
||||
dividerBefore:
|
||||
item.path === spec.dividerBefore?.path
|
||||
? spec.dividerBefore.label
|
||||
: undefined,
|
||||
}));
|
||||
if (divided.length > 0)
|
||||
nodes.push({ kind: "group", label: spec.label, items: divided });
|
||||
}
|
||||
return nodes;
|
||||
return buildNav(table, specs, hidden).tree;
|
||||
}
|
||||
|
||||
/** navEntries flattens the tree to the destinations it can reach. */
|
||||
export function navEntries(hidden: string[] = []): NavEntry[] {
|
||||
return navTree(hidden).flatMap((node) =>
|
||||
node.kind === "link" ? [node.entry] : node.items,
|
||||
);
|
||||
/** navEntries lists every destination Jump to can reach. */
|
||||
export function navEntries(hidden: string[] = []) {
|
||||
return buildNav(table, specs, hidden, unlisted).jumpTargets;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+25
-12
@@ -63,7 +63,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/skills",
|
||||
path: "/settings/skills",
|
||||
name: "skills",
|
||||
component: SkillsPage,
|
||||
meta: {
|
||||
@@ -73,7 +73,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/curators",
|
||||
path: "/settings/curators",
|
||||
name: "curators",
|
||||
component: CuratorsPage,
|
||||
meta: {
|
||||
@@ -93,7 +93,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/status",
|
||||
path: "/settings/status",
|
||||
name: "system-status",
|
||||
component: SystemStatusPage,
|
||||
meta: {
|
||||
@@ -114,7 +114,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/appearance",
|
||||
path: "/settings/appearance",
|
||||
name: "system-appearance",
|
||||
component: SystemAppearancePage,
|
||||
meta: {
|
||||
@@ -123,17 +123,17 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/tasks",
|
||||
path: "/settings/task-execution",
|
||||
name: "system-tasks",
|
||||
component: SystemTasksPage,
|
||||
meta: {
|
||||
label: "Task settings",
|
||||
label: "Task execution",
|
||||
description: "Work lifecycle: statuses, operator actions, and budgets.",
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/models",
|
||||
path: "/settings/models",
|
||||
name: "system-models",
|
||||
component: SystemModelsPage,
|
||||
meta: {
|
||||
@@ -143,7 +143,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/repos",
|
||||
path: "/settings/repositories",
|
||||
name: "system-repos",
|
||||
component: SystemReposPage,
|
||||
meta: {
|
||||
@@ -154,7 +154,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/identities",
|
||||
path: "/settings/identities",
|
||||
name: "system-identities",
|
||||
component: SystemIdentitiesPage,
|
||||
meta: {
|
||||
@@ -164,7 +164,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/channels",
|
||||
path: "/settings/channels",
|
||||
name: "channels",
|
||||
component: ChannelsPage,
|
||||
meta: {
|
||||
@@ -174,7 +174,7 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/system/advanced",
|
||||
path: "/settings/advanced",
|
||||
name: "system-advanced",
|
||||
component: SystemAdvancedPage,
|
||||
meta: {
|
||||
@@ -183,7 +183,20 @@ const routes = [
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{ path: "/settings", redirect: "/system/status", meta: { nav: false } },
|
||||
{ path: "/settings", redirect: "/settings/status", meta: { nav: false } },
|
||||
// Paths from before Settings existed, kept for bookmarks and chat history.
|
||||
...Object.entries({
|
||||
"/system/status": "/settings/status",
|
||||
"/system/appearance": "/settings/appearance",
|
||||
"/system/tasks": "/settings/task-execution",
|
||||
"/system/models": "/settings/models",
|
||||
"/system/repos": "/settings/repositories",
|
||||
"/system/identities": "/settings/identities",
|
||||
"/system/advanced": "/settings/advanced",
|
||||
"/channels": "/settings/channels",
|
||||
"/skills": "/settings/skills",
|
||||
"/curators": "/settings/curators",
|
||||
}).map(([path, redirect]) => ({ path, redirect, meta: { nav: false } })),
|
||||
];
|
||||
|
||||
export { routes };
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
|
||||
import { api } from "@/lib/api";
|
||||
import { connectionStatus } from "@/lib/connection";
|
||||
import { useLiveResource, useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
interface HealthComponent {
|
||||
@@ -24,13 +25,7 @@ const report = ref<HealthReport | null>(null);
|
||||
const error = ref<string | null>(null);
|
||||
const { streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
|
||||
const liveState = computed(() => {
|
||||
if (streamState.value === "live")
|
||||
return { label: "Connected", kind: "ok" as const };
|
||||
if (streamState.value === "unavailable")
|
||||
return { label: "Unavailable", kind: "danger" as const };
|
||||
return { label: "Connecting", kind: "warn" as const };
|
||||
});
|
||||
const liveState = computed(() => connectionStatus(streamState.value));
|
||||
|
||||
const names: Record<string, string> = {
|
||||
state_db: "State store",
|
||||
@@ -70,7 +65,7 @@ onMounted(load);
|
||||
<TableRow>
|
||||
<TableCell class="font-medium">Live updates</TableCell>
|
||||
<TableCell class="w-px text-right">
|
||||
<Badge :variant="liveState.kind">{{ liveState.label }}</Badge>
|
||||
<Badge :variant="liveState.tone">{{ liveState.label }}</Badge>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { Plus } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import { api } from "@/lib/api";
|
||||
import StartWorkForm from "@/workflows/StartWorkForm.vue";
|
||||
import type { WorkflowDefinition } from "@/workflows/workflow-rows";
|
||||
|
||||
const router = useRouter();
|
||||
const open = ref(false);
|
||||
const definitions = ref<WorkflowDefinition[]>([]);
|
||||
const error = ref("");
|
||||
|
||||
watch(open, async (isOpen) => {
|
||||
if (!isOpen) return;
|
||||
try {
|
||||
const data = await api.workflows<{ definitions?: WorkflowDefinition[] }>();
|
||||
definitions.value = data?.definitions ?? [];
|
||||
error.value = definitions.value.length ? "" : "No workflow definitions are served.";
|
||||
} catch (err) {
|
||||
error.value = String((err as Error).message || err);
|
||||
}
|
||||
});
|
||||
|
||||
function started(taskId: number) {
|
||||
open.value = false;
|
||||
void router.push(`/tasks/${taskId}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog v-model:open="open">
|
||||
<DialogTrigger as-child>
|
||||
<Button size="sm">
|
||||
<Plus data-icon="inline-start" /> New task
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent class="sm:max-w-[640px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>New task</DialogTitle>
|
||||
<DialogDescription>Enters Archie's admitted task queue.</DialogDescription>
|
||||
</DialogHeader>
|
||||
<p v-if="error" class="text-sm text-danger" role="alert">{{ error }}</p>
|
||||
<StartWorkForm
|
||||
v-else-if="definitions.length"
|
||||
:definitions="definitions"
|
||||
@started="started"
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</template>
|
||||
@@ -1,14 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watchEffect } from "vue";
|
||||
import { computed, ref, useId, watchEffect } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
@@ -31,6 +24,8 @@ interface Definition {
|
||||
}
|
||||
|
||||
const props = defineProps<{ definitions: Definition[] }>();
|
||||
const uid = useId();
|
||||
const emit = defineEmits<{ started: [taskId: number] }>();
|
||||
|
||||
/** Starting work enters Archie's normal admitted task queue, not a side door. */
|
||||
|
||||
@@ -64,6 +59,7 @@ async function submit() {
|
||||
instructions: instructions.value,
|
||||
});
|
||||
notice.value = `Queued task #${result.task_id}.`;
|
||||
emit("started", result.task_id);
|
||||
identity.value = "";
|
||||
repository.value = "";
|
||||
workflow.value = defaultWorkflow.value;
|
||||
@@ -78,63 +74,53 @@ async function submit() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card class="mb-4">
|
||||
<CardHeader>
|
||||
<CardTitle>Start work</CardTitle>
|
||||
<CardDescription
|
||||
>This enters Archie's normal admitted task queue.</CardDescription
|
||||
>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form @submit.prevent="submit">
|
||||
<FieldGroup>
|
||||
<Field>
|
||||
<FieldLabel for="wf-identity">Identity</FieldLabel>
|
||||
<Input id="wf-identity" v-model="identity" required />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel for="wf-repository">Repository</FieldLabel>
|
||||
<Input
|
||||
id="wf-repository"
|
||||
v-model="repository"
|
||||
placeholder="owner/repository"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel for="wf-workflow">Workflow</FieldLabel>
|
||||
<Select v-model="workflow" required>
|
||||
<SelectTrigger id="wf-workflow">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="d in enabled" :key="d.id" :value="d.id">
|
||||
{{ workflowLabel(d.name || d.id) }}
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel for="wf-title">Task title</FieldLabel>
|
||||
<Input id="wf-title" v-model="title" required />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel for="wf-instructions">Instructions</FieldLabel>
|
||||
<Textarea
|
||||
id="wf-instructions"
|
||||
v-model="instructions"
|
||||
:rows="3"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field orientation="horizontal">
|
||||
<Button type="submit" :disabled="submitting">Start work</Button>
|
||||
<p v-if="notice" class="text-sm text-fg-muted">{{ notice }}</p>
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<form @submit.prevent="submit">
|
||||
<FieldGroup>
|
||||
<Field>
|
||||
<FieldLabel :for="`${uid}-identity`">Identity</FieldLabel>
|
||||
<Input :id="`${uid}-identity`" v-model="identity" required />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel :for="`${uid}-repository`">Repository</FieldLabel>
|
||||
<Input
|
||||
:id="`${uid}-repository`"
|
||||
v-model="repository"
|
||||
placeholder="owner/repository"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel :for="`${uid}-workflow`">Workflow</FieldLabel>
|
||||
<Select v-model="workflow" required>
|
||||
<SelectTrigger :id="`${uid}-workflow`">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="d in enabled" :key="d.id" :value="d.id">
|
||||
{{ workflowLabel(d.name || d.id) }}
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel :for="`${uid}-title`">Task title</FieldLabel>
|
||||
<Input :id="`${uid}-title`" v-model="title" required />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel :for="`${uid}-instructions`">Instructions</FieldLabel>
|
||||
<Textarea
|
||||
:id="`${uid}-instructions`"
|
||||
v-model="instructions"
|
||||
:rows="3"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field orientation="horizontal">
|
||||
<Button type="submit" :disabled="submitting">Start work</Button>
|
||||
<p v-if="notice" class="text-sm text-fg-muted">{{ notice }}</p>
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
</form>
|
||||
</template>
|
||||
@@ -2,7 +2,13 @@
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -57,7 +63,17 @@ onMounted(async () => {
|
||||
|
||||
<!-- Starting work needs a definition to start: with none served, the form
|
||||
could only be submitted to fail. -->
|
||||
<StartWorkForm v-if="definitions.length" :definitions="definitions" />
|
||||
<Card v-if="definitions.length" class="mb-4">
|
||||
<CardHeader>
|
||||
<CardTitle>Start work</CardTitle>
|
||||
<CardDescription
|
||||
>This enters Archie's normal admitted task queue.</CardDescription
|
||||
>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<StartWorkForm :definitions="definitions" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card v-if="error">
|
||||
<CardContent>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { connectionStatus } from "../src/lib/connection.ts";
|
||||
|
||||
test("the connection pill names the stream state", () => {
|
||||
for (const [state, label, tone] of [
|
||||
["live", "Connected", "ok"],
|
||||
["connecting", "Connecting", "warn"],
|
||||
["reconnecting", "Connecting", "warn"],
|
||||
["unavailable", "Disconnected", "danger"],
|
||||
] as const) {
|
||||
assert.deepEqual(connectionStatus(state), { label, tone }, state);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,74 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { buildNav, type NavRoute, type NavSpec } from "../src/lib/nav-tree.ts";
|
||||
|
||||
const table: NavRoute[] = [
|
||||
{ path: "/", meta: { label: "Dashboard" } },
|
||||
{ path: "/tasks", meta: { label: "Tasks" } },
|
||||
{ path: "/settings/models", meta: { label: "Models" } },
|
||||
{ path: "/settings/skills", meta: { label: "Skills" } },
|
||||
{ path: "/settings/channels", meta: { label: "Channels" } },
|
||||
{ path: "/logs", meta: { label: "Logs" } },
|
||||
];
|
||||
|
||||
const specs: NavSpec[] = [
|
||||
{ kind: "link", path: "/" },
|
||||
{ kind: "link", path: "/tasks" },
|
||||
{
|
||||
kind: "group",
|
||||
label: "Settings",
|
||||
sections: [
|
||||
{ label: "Agents", paths: ["/settings/models", "/settings/skills"] },
|
||||
{ label: "Integrations", paths: ["/settings/channels"] },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
test("each settings section labels its first visible item", () => {
|
||||
const nav = buildNav(table, specs, ["/settings/models"]);
|
||||
const group = nav.tree.find((n) => n.kind === "group");
|
||||
assert.ok(group && group.kind === "group");
|
||||
assert.deepEqual(
|
||||
group.items.map((i) => [i.path, i.dividerBefore]),
|
||||
[
|
||||
["/settings/skills", "Agents"],
|
||||
["/settings/channels", "Integrations"],
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
test("a section with every item hidden leaves no label behind", () => {
|
||||
const nav = buildNav(table, specs, ["/settings/models", "/settings/skills"]);
|
||||
const group = nav.tree.find((n) => n.kind === "group");
|
||||
assert.ok(group && group.kind === "group");
|
||||
assert.deepEqual(
|
||||
group.items.map((i) => [i.path, i.dividerBefore]),
|
||||
[["/settings/channels", "Integrations"]],
|
||||
);
|
||||
});
|
||||
|
||||
test("a group with every item hidden is dropped", () => {
|
||||
const nav = buildNav(table, specs, [
|
||||
"/settings/models",
|
||||
"/settings/skills",
|
||||
"/settings/channels",
|
||||
]);
|
||||
assert.deepEqual(
|
||||
nav.tree.map((n) => (n.kind === "link" ? n.entry.path : n.label)),
|
||||
["/", "/tasks"],
|
||||
);
|
||||
});
|
||||
|
||||
test("jump targets add unlisted pages to what the bar reaches", () => {
|
||||
const nav = buildNav(table, specs, [], ["/logs"]);
|
||||
assert.deepEqual(
|
||||
nav.jumpTargets.map((e) => e.path),
|
||||
["/", "/tasks", "/settings/models", "/settings/skills", "/settings/channels", "/logs"],
|
||||
);
|
||||
assert.deepEqual(buildNav(table, specs, ["/logs"], ["/logs"]).jumpTargets.map((e) => e.path).includes("/logs"), false);
|
||||
});
|
||||
|
||||
test("a spec naming a missing route fails loudly", () => {
|
||||
assert.throws(() => buildNav(table, [{ kind: "link", path: "/nope" }]), /\/nope/);
|
||||
});
|
||||
@@ -1,22 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import test from "node:test";
|
||||
|
||||
const navModel = await readFile(
|
||||
new URL("../src/lib/nav.ts", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
const navGroup = await readFile(
|
||||
new URL("../src/components/topbar/NavGroup.vue", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
test("System separates operational pages from settings before Task settings", () => {
|
||||
assert.match(
|
||||
navModel,
|
||||
/label:\s*"System"[\s\S]*dividerBefore:\s*\{\s*path:\s*"\/system\/tasks",\s*label:\s*"Settings"\s*\}/,
|
||||
);
|
||||
assert.match(navGroup, /DropdownMenuSeparator/);
|
||||
assert.match(navGroup, /DropdownMenuLabel/);
|
||||
assert.match(navGroup, /item\.dividerBefore/);
|
||||
});
|
||||
Reference in new issue
Block a user