fix(ui/topbar): replace Jump to with a command palette, drop filler chrome (#1650)

* fix(ui/topbar): replace Jump to with a command palette, drop filler chrome

Jump to opens a shadcn-vue Command dialog that finds pages, tasks and
workflows by name. The connection indicator shows only when the stream is
lost, the dead documentation link is gone, and the profile menu label has
no stray whitespace.

* fix(ui): trim stray whitespace from template text and drop em dashes from copy

Element text that started or ended with a line break rendered with leading
and trailing spaces. Also removes the unused 'soon' nav state and the nav
group components no route reaches.

* fix(ui): drop the space a hidden spinner left before button text

* fix(ui/status): one dense Status page, full-width settings, problems-only apply status

Status drops its tabs and the duplicate health card; services list only
what is wrong. Settings pages use the full width, the resizable sidebar
handle is gone, and apply status shows only processes that have not
applied a change. PageHeader puts the title and actions on one line.

* refactor(ui): use shadcn ToggleGroup and Badge, drop SegmentedControl and StatusPill

Status badges show only when a state needs attention: no Running, Enabled,
Active, Listening or live pills next to healthy rows. Removes the unused
pagination, radio-group and scroll-area components.

* fix(ui/history): use the shadcn Table with fixed columns so nothing is clipped

* fix(ui/workflows): apply ?workflow= only once the workflow is listed

Selecting it before the definitions loaded opened an empty canvas.

* refactor(ui/workflows): use shadcn Input, NativeSelect, Checkbox and Button in editors

Replaces hand-rolled inputs, selects, the repository mode switch and icon
buttons in the workflow editor, bind dialog, harness page, sources panel
and review gate. Adds the upstream shadcn-vue NativeSelect.

* style(ui): rounded-rectangle controls instead of pills

Halves the radius scale so inputs, selects and buttons stop reading as
pills, and badges and chips lose their full rounding.

* fix(ui/alerts): centre the bell's failed state and stop it contradicting Needs you

* fix(ui/tasks): one header line, aligned columns, no placeholder issue numbers

Tasks puts its filters beside the title and drops the stat tiles the
dashboard already shows. Sort headers align with their cells, chat tasks
no longer show their synthetic issue number, and Logs and the task
not-found page use the shared header.

* fix(ui/dashboard): shared header and cards, empty cards stay silent

Needs you uses the shadcn Card and drops its duplicate Open button; quality
gates and token outlook render only when there is something to show; the
throughput strip moves into the dashboard, its only user.

* refactor(ui/stores): one Pinia store per feature

Splits the site-wide control-plane store and the module-level refs into
settings, workflows, tasks, events, org and session stores. Identity
requests move into lib/api. Drops store fields nothing read: per-resource
stream state, the states map and loadApplyStatus.

* fix(ui/org): one header for the org area, sections drop their repeated titles

The org name is the page title with the admin's org switcher and New org
beside it; Members and Workspaces tables sit in cards like other pages.

* fix(ui/events): shadcn Tabs for the capture, map and bind steps

Replaces the numbered step strip with line tabs that carry each step's
count; the Listening pill is gone and Capture off shows only when it is.

* fix(ui/workflows): confirm a workflow delete in an AlertDialog, not window.confirm

* style(ui/settings): denser setting rows
This commit is contained in:
sam authored and GitHub committed 2026-10-12 04:40:21 +11:00
1 parent 94d2f98cc0
commit 3bf64933b0
209 files changed
+2158 -3175

No files matched your search

+2 -2
View File
@@ -4,13 +4,13 @@ import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import HistoryLink from "./HistoryLink.vue";
interface Profile { image?: string; kit?: string; adapter?: string; tools?: string[] }
const KIND = "agent-profiles";
const store = useControlPlaneStore();
const store = useSettingsStore();
onMounted(store.load);
const profiles = computed(() => store.drafts[KIND]?.value as Record<string, Profile> | null);
const name = ref("");
+30 -41
View File
@@ -1,57 +1,46 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref } from "vue";
import { computed } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Badge } from "@/components/ui/badge";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { useControlPlaneStore } from "@/stores/control-plane";
import type { ApplyState } from "@/stores/settings";
import { useSettingsStore } from "@/stores/settings";
import { applyStateLabel, applyStateTone } from "./apply-status";
const now = ref(Date.now());
let timer: ReturnType<typeof setInterval>;
onMounted(() => { timer = setInterval(() => { now.value = Date.now(); }, 15_000); });
onUnmounted(() => clearInterval(timer));
function reportAge(at: string): string {
const seconds = Math.max(0, Math.floor((now.value - Date.parse(at)) / 1000));
return seconds < 60 ? `${seconds}s ago` : `${Math.floor(seconds / 60)}m ago`;
}
/**
* The processes that have not applied a resource. Silent while every process
* runs the stored version: a row per healthy process is noise. A restart owed
* is the Restart pending banner's, so it is not repeated here.
*/
const props = defineProps<{ kind: string; compact?: boolean }>();
const store = useControlPlaneStore();
const rows = computed(() => store.applyStatusFor(props.kind));
const mode = computed(
() => store.catalog.find((item) => item.kind === props.kind)?.apply_mode,
);
const store = useSettingsStore();
// The chip stands for the row that most needs attention; processes the
// resource does not apply to are not worth a chip.
const URGENCY = ["failed", "unknown", "pending-restart", "not-reporting", "running"];
const headline = computed(() =>
rows.value
.filter((row) => row.state !== "not-applicable")
.sort((a, b) => URGENCY.indexOf(a.state) - URGENCY.indexOf(b.state))[0],
const PROBLEMS: ApplyState[] = ["failed", "unknown", "not-reporting"];
const problems = computed(() =>
store.applyStatusFor(props.kind).filter((row) => PROBLEMS.includes(row.state)),
);
const mode = computed(() => store.catalog.find((item) => item.kind === props.kind)?.apply_mode);
const title = computed(() => store.catalog.find((item) => item.kind === props.kind)?.title ?? props.kind);
</script>
<template>
<Popover v-if="compact">
<PopoverTrigger v-if="headline" as-child>
<button type="button" class="rounded-full" :aria-label="`Apply status: ${applyStateLabel(headline.state, mode)}`">
<Badge :variant="applyStateTone(headline.state, mode)">{{ applyStateLabel(headline.state, mode) }}</Badge>
<Popover v-if="problems.length && compact">
<PopoverTrigger as-child>
<button type="button" class="rounded-sm" :aria-label="`Apply status: ${applyStateLabel(problems[0]!.state, mode)}`">
<Badge :variant="applyStateTone(problems[0]!.state, mode)">{{ applyStateLabel(problems[0]!.state, mode) }}</Badge>
</button>
</PopoverTrigger>
<PopoverContent align="end" class="w-80"><ApplyStatusRows :kind="kind" /></PopoverContent>
<PopoverContent align="end" class="w-80">
<ApplyStatusRows :kind="kind" />
</PopoverContent>
</Popover>
<div v-else-if="rows.length" class="flex flex-col gap-2">
<p class="text-xs font-medium text-muted-foreground">{{ store.catalog.find(item => item.kind === kind)?.title ?? kind }} · apply status</p>
<div v-for="row in rows" :key="row.process" class="flex flex-col gap-1">
<div class="flex items-center gap-2 text-xs">
<Badge :variant="applyStateTone(row.state, mode)">{{ applyStateLabel(row.state, mode) }}</Badge>
<span class="font-mono">{{ row.process }}</span>
<span v-if="row.state !== 'not-reporting' && row.state !== 'not-applicable'" class="text-muted-foreground"
>applied v{{ row.version }} / stored v{{ row.storedVersion }}</span
>
<span v-if="row.reportedAt" class="text-muted-foreground">reported {{ reportAge(row.reportedAt) }}</span>
</div>
<p v-if="row.error" class="text-xs text-destructive">{{ row.error }}</p>
</div>
</div>
<Alert v-else-if="problems.length">
<AlertTitle>{{ title }} is not applied everywhere</AlertTitle>
<AlertDescription>
<p v-for="row in problems" :key="row.process">
<span class="font-mono">{{ row.process }}</span>: {{ applyStateLabel(row.state, mode) }}<template v-if="row.error">. {{ row.error }}</template>
</p>
</AlertDescription>
</Alert>
</template>
+6 -4
View File
@@ -13,9 +13,9 @@ import {
NumberFieldIncrement,
NumberFieldInput,
} from "@/components/ui/number-field";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
@@ -33,7 +33,7 @@ interface ContainerRuntime {
network: string;
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -71,7 +71,9 @@ const pullPolicy = computed({
</SettingRow>
<SettingRow label="Pull policy">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl v-model="pullPolicy" label="Pull policy" :options="pullPolicies" />
<ToggleGroup type="single" variant="outline" size="sm" :model-value="pullPolicy" aria-label="Pull policy" @update:model-value="(value) => { if (value) pullPolicy = value as typeof pullPolicy; }">
<ToggleGroupItem v-for="option in pullPolicies" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
<DraftHint :kind="KIND" path="pull_policy" />
</div>
</SettingRow>
+2 -2
View File
@@ -4,13 +4,13 @@ import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import HistoryLink from "./HistoryLink.vue";
import SecretRefField from "./SecretRefField.vue";
interface Binding { service: string; org?: string; secret: { engine: string; key: string } }
const KIND = "credential-bindings";
const store = useControlPlaneStore();
const store = useSettingsStore();
onMounted(store.load);
const bindings = computed(() => store.drafts[KIND]?.value as Binding[] | null);
function add() {
+3 -4
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import { formatValue } from "./changes";
/**
@@ -12,12 +12,11 @@ import { formatValue } from "./changes";
* whether a field changed.
*/
const props = defineProps<{ kind: string; path: string }>();
const store = useControlPlaneStore();
const store = useSettingsStore();
const change = computed(() => store.changeFor(props.kind, props.path));
</script>
<template>
<span v-if="change" class="text-xs whitespace-nowrap text-fg-subtle">
was <s class="font-mono">{{ formatValue(change.before) }}</s>
<span v-if="change" class="text-xs whitespace-nowrap text-fg-subtle">was <s class="font-mono">{{ formatValue(change.before) }}</s>
</span>
</template>
+8 -13
View File
@@ -16,7 +16,7 @@ import {
import { Button } from "@/components/ui/button";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Input } from "@/components/ui/input";
import { StatusPill } from "@/components/ui/status-pill";
import { Badge } from "@/components/ui/badge";
import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { grants, stage, useExtensionsStore, type Extension } from "@/stores/extensions";
@@ -51,10 +51,10 @@ async function remove(): Promise<void> {
}
const tones = {
accept: { tone: "warn", dot: "warn", label: "Authority not accepted" },
disabled: { tone: "neutral", dot: "idle", label: "Disabled" },
enabled: { tone: "neutral", dot: "live", label: "Enabled" },
inert: { tone: "neutral", dot: "idle", label: "No extensions" },
accept: { tone: "warn", label: "Authority not accepted" },
disabled: { tone: "idle", label: "Disabled" },
enabled: { tone: undefined, label: "" },
inert: { tone: "idle", label: "No extensions" },
} as const;
</script>
@@ -80,9 +80,7 @@ const tones = {
<p class="text-xs text-fg-subtle">{{ extension.description }}</p>
<p class="truncate font-mono text-xs text-fg-subtle">{{ extension.digest }}</p>
</div>
<StatusPill :tone="tones[stage(extension)].tone" :dot="tones[stage(extension)].dot">
{{ tones[stage(extension)].label }}
</StatusPill>
<Badge v-if="tones[stage(extension)].tone" :variant="tones[stage(extension)].tone">{{ tones[stage(extension)].label }}</Badge>
<div v-if="extension.pending" class="w-full rounded-md border border-border px-3 py-2">
<p class="text-xs font-medium">Update waiting for approval, it adds:</p>
<ul class="font-mono text-xs">
@@ -142,8 +140,7 @@ const tones = {
<p class="text-xs text-fg-subtle">{{ entry.description }}</p>
</div>
<Button size="sm" :disabled="!!store.busy" @click="store.installFromCatalogue(entry.name)">
<Plus data-icon="inline-start" /> Install
</Button>
<Plus data-icon="inline-start" /> Install</Button>
</li>
<li v-if="!available.length" class="px-4 py-3 text-sm text-fg-muted">Everything listed is installed.</li>
</ul>
@@ -163,9 +160,7 @@ const tones = {
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Accept what {{ accepting?.name }} may use?</AlertDialogTitle>
<AlertDialogDescription>
It runs as a process on this host and sees only these.
</AlertDialogDescription>
<AlertDialogDescription>It runs as a process on this host and sees only these.</AlertDialogDescription>
</AlertDialogHeader>
<ul class="font-mono text-xs">
<li v-for="line in accepting ? grants(accepting.declared) : []" :key="line">{{ line }}</li>
-95
View File
@@ -1,95 +0,0 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed, onMounted, ref } from "vue";
import { Badge } from "@/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import { api } from "@/lib/api";
import { connectionStatus } from "@/lib/connection";
import { useLiveResource, useLiveUpdatesStore } from "@/stores/live-updates";
interface HealthComponent {
name: string;
status: "ok" | "degraded";
ready: boolean;
detail?: string;
}
interface HealthReport {
status: "ok" | "degraded";
components: HealthComponent[];
}
const report = ref<HealthReport | null>(null);
const error = ref<string | null>(null);
const { streamState } = storeToRefs(useLiveUpdatesStore());
const liveState = computed(() => connectionStatus(streamState.value));
const names: Record<string, string> = {
state_db: "State store",
gateway: "Gateway",
active_model: "Active model",
};
function componentName(name: string): string {
return (
names[name] ??
name.replaceAll("_", " ").replace(/^./, (letter) => letter.toUpperCase())
);
}
async function load(): Promise<void> {
try {
report.value = await api.health<HealthReport>();
error.value = null;
} catch (err) {
error.value = String((err as Error).message || err);
}
}
useLiveResource(null, () => void load());
onMounted(load);
</script>
<template>
<Card class="mb-4">
<CardHeader>
<CardTitle>Runtime</CardTitle>
</CardHeader>
<CardContent>
<p v-if="error" class="text-sm text-destructive">{{ error }}</p>
<Table v-else>
<TableBody>
<TableRow>
<TableCell class="font-medium">Live updates</TableCell>
<TableCell class="w-px text-right">
<Badge :variant="liveState.tone">{{ liveState.label }}</Badge>
</TableCell>
</TableRow>
<TableRow
v-for="component in report?.components ?? []"
:key="component.name"
>
<TableCell>
<span class="font-medium">{{
componentName(component.name)
}}</span>
<span
v-if="component.detail"
class="ml-2 text-sm text-fg-muted"
>{{ component.detail }}</span
>
</TableCell>
<TableCell class="w-px text-right">
<Badge :variant="component.ready ? 'ok' : 'danger'">
{{ component.ready ? "Ready" : "Degraded" }}
</Badge>
</TableCell>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</template>
+1 -2
View File
@@ -10,7 +10,6 @@ const props = defineProps<{ kinds: string[] }>();
<template>
<Button variant="ghost" size="sm" as-child>
<RouterLink :to="{ path: '/settings/history', query: { section: props.kinds.join(',') } }">
<History data-icon="inline-start" /> History
</RouterLink>
<History data-icon="inline-start" /> History</RouterLink>
</Button>
</template>
+62 -68
View File
@@ -5,6 +5,7 @@ import { storeToRefs } from "pinia";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import {
Select,
@@ -13,8 +14,9 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { ago } from "@/lib/format";
import { useControlPlaneStore, type AuditEntry } from "@/stores/control-plane";
import { useSettingsStore, type AuditEntry } from "@/stores/settings";
import { formatValue } from "./changes";
import { filterHistory, historyEmptyTitle } from "./history";
@@ -23,7 +25,7 @@ import { filterHistory, historyEmptyTitle } from "./history";
* stages the version before a change as a draft; applying it from the save
* bar is an ordinary replace, so the restore is itself recorded here.
*/
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog } = storeToRefs(store);
const route = useRoute();
const router = useRouter();
@@ -144,71 +146,63 @@ const restorable = (entry: AuditEntry) =>
<p v-if="restoreError" class="mb-2 text-sm text-danger" role="alert">{{ restoreError }}</p>
<p v-if="error" class="text-sm text-danger" role="alert">{{ error }}</p>
<div v-else class="overflow-x-auto rounded-lg border border-border bg-card">
<table class="w-full text-[13px]">
<thead>
<tr class="border-b border-border text-left text-[11px] tracking-[0.06em] text-fg-subtle uppercase">
<th class="px-4 py-2.5 font-medium">When</th>
<th class="px-4 py-2.5 font-medium">Section</th>
<th class="px-4 py-2.5 font-medium">Field</th>
<th class="px-4 py-2.5 font-medium">Change</th>
<th class="px-4 py-2.5 font-medium">Version</th>
<th class="px-4 py-2.5 font-medium">Changed by</th>
<th class="px-4 py-2.5"><span class="sr-only">Actions</span></th>
</tr>
</thead>
<tbody>
<tr
v-for="entry in rows"
:key="entry.id"
class="border-b border-border align-top last:border-0"
>
<td class="px-4 py-2.5 whitespace-nowrap text-fg-muted" :title="entry.at">
{{ entry.at ? ago(entry.at) : "" }}
</td>
<td class="px-4 py-2.5 whitespace-nowrap">{{ titles.get(entry.record_key) ?? entry.record_key }}</td>
<td class="px-4 py-2.5 font-mono text-xs">{{ entry.field || "whole value" }}</td>
<td class="max-w-[22rem] px-4 py-2.5 font-mono text-xs">
<button
type="button"
class="block w-full text-left"
:aria-expanded="expanded === entry.id"
@click="expanded = expanded === entry.id ? null : entry.id"
>
<span :class="expanded === entry.id ? 'break-all' : 'block truncate'" class="text-danger">
− {{ formatValue(entry.old_value ?? undefined) }}
</span>
<span :class="expanded === entry.id ? 'break-all' : 'block truncate'" class="text-ok">
+ {{ formatValue(entry.new_value ?? undefined) }}
</span>
</button>
</td>
<td class="px-4 py-2.5 font-mono text-xs">{{ entry.version }}</td>
<td class="px-4 py-2.5 whitespace-nowrap">
{{ entry.actor }}<span class="text-fg-subtle"> · {{ entry.source }}</span>
</td>
<td class="px-2 py-1.5 text-right">
<Button
v-if="restorable(entry)"
variant="ghost"
size="sm"
:disabled="store.stateFor(entry.record_key).saving"
@click="restoreBefore(entry)"
>Restore</Button
>
</td>
</tr>
<tr v-if="!rows.length">
<td colspan="7">
<Empty>
<EmptyHeader>
<EmptyTitle>{{ historyEmptyTitle(entries.length > 0) }}</EmptyTitle>
</EmptyHeader>
</Empty>
</td>
</tr>
</tbody>
</table>
</div>
<Card v-else>
<CardContent>
<Table class="table-fixed">
<TableHeader>
<TableRow>
<TableHead class="w-28">When</TableHead>
<TableHead class="w-48">Section</TableHead>
<TableHead class="w-40">Field</TableHead>
<TableHead>Change</TableHead>
<TableHead class="w-16">Version</TableHead>
<TableHead class="w-56">Changed by</TableHead>
<TableHead class="w-24"><span class="sr-only">Actions</span></TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="entry in rows" :key="entry.id" class="align-top">
<TableCell class="text-fg-muted" :title="entry.at">{{ entry.at ? ago(entry.at) : "" }}</TableCell>
<TableCell class="truncate">{{ titles.get(entry.record_key) ?? entry.record_key }}</TableCell>
<TableCell class="truncate font-mono text-xs">{{ entry.field || "whole value" }}</TableCell>
<TableCell class="font-mono text-xs whitespace-normal">
<button
type="button"
class="block w-full min-w-0 text-left"
:aria-expanded="expanded === entry.id"
@click="expanded = expanded === entry.id ? null : entry.id"
>
<span :class="expanded === entry.id ? 'break-all' : 'truncate'" class="block text-danger">− {{ formatValue(entry.old_value ?? undefined) }}</span>
<span :class="expanded === entry.id ? 'break-all' : 'truncate'" class="block text-ok">+ {{ formatValue(entry.new_value ?? undefined) }}</span>
</button>
</TableCell>
<TableCell class="font-mono text-xs">{{ entry.version }}</TableCell>
<TableCell class="truncate" :title="`${entry.actor} · ${entry.source}`">
{{ entry.actor }}<span class="text-fg-subtle"> · {{ entry.source }}</span>
</TableCell>
<TableCell class="py-1 text-right">
<Button
v-if="restorable(entry)"
variant="ghost"
size="sm"
:disabled="store.stateFor(entry.record_key).saving"
@click="restoreBefore(entry)"
>Restore</Button
>
</TableCell>
</TableRow>
<TableRow v-if="!rows.length">
<TableCell colspan="7">
<Empty>
<EmptyHeader>
<EmptyTitle>{{ historyEmptyTitle(entries.length > 0) }}</EmptyTitle>
</EmptyHeader>
</Empty>
</TableCell>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</div>
</template>
+2 -2
View File
@@ -4,7 +4,7 @@ import { Plus, X } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
/** The identity-grants document: the root identity's credential services,
@@ -15,7 +15,7 @@ interface IdentityGrants {
}
const KIND = "identity-grants";
const store = useControlPlaneStore();
const store = useSettingsStore();
onMounted(() => store.load());
const grants = computed(() => store.drafts[KIND]?.value as IdentityGrants | undefined);
+11 -17
View File
@@ -4,7 +4,7 @@ import { Trash2 } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { Switch } from "@/components/ui/switch";
import {
TagsInput,
@@ -59,15 +59,16 @@ const args = computed({
placeholder="name"
class="max-w-56 font-mono"
/>
<SegmentedControl v-model="transport" label="Transport" :options="transports" />
<ToggleGroup type="single" variant="outline" size="sm" :model-value="transport" aria-label="Transport" @update:model-value="(value) => { if (value) transport = value as typeof transport; }">
<ToggleGroupItem v-for="option in transports" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
<Button variant="ghost" size="icon" class="ml-auto" aria-label="Remove server" @click="$emit('remove')">
<Trash2 />
</Button>
</div>
<template v-if="transport === 'stdio'">
<label class="grid gap-1 text-xs text-fg-subtle">
Command
<label class="grid gap-1 text-xs text-fg-subtle">Command
<Input v-model="server.command" class="font-mono" placeholder="npx" />
</label>
<div class="grid gap-1 text-xs text-fg-subtle">
@@ -80,22 +81,18 @@ const args = computed({
<TagsInputInput placeholder="Add argument" />
</TagsInput>
</div>
<label class="grid gap-1 text-xs text-fg-subtle">
Working directory
<label class="grid gap-1 text-xs text-fg-subtle">Working directory
<Input v-model="server.work_dir" class="font-mono" placeholder="the daemon's working directory" />
</label>
</template>
<label v-else-if="transport === 'http'" class="grid gap-1 text-xs text-fg-subtle">
URL
<label v-else-if="transport === 'http'" class="grid gap-1 text-xs text-fg-subtle">URL
<Input v-model="server.url" class="font-mono" placeholder="https://host/mcp" />
</label>
<template v-else>
<label class="grid gap-1 text-xs text-fg-subtle">
SSE endpoint
<label class="grid gap-1 text-xs text-fg-subtle">SSE endpoint
<Input v-model="server.sse_endpoint" class="font-mono" />
</label>
<label class="grid gap-1 text-xs text-fg-subtle">
Message endpoint
<label class="grid gap-1 text-xs text-fg-subtle">Message endpoint
<Input v-model="server.message_endpoint" class="font-mono" />
</label>
</template>
@@ -103,11 +100,8 @@ const args = computed({
<div class="flex flex-wrap items-center gap-x-6 gap-y-2 text-sm">
<label class="flex items-center gap-2">
<Switch v-model="server.parallel_tool_calls" />
Parallel tool calls
</label>
<span v-if="server.headers_configured" class="text-xs text-fg-subtle">
Headers supplied at startup
</span>
Parallel tool calls</label>
<span v-if="server.headers_configured" class="text-xs text-fg-subtle">Headers supplied at startup</span>
</div>
</div>
</template>
+1 -3
View File
@@ -66,9 +66,7 @@ onMounted(load);
<Button v-if="available" size="sm" :disabled="busy" @click="create"><Plus data-icon="inline-start" />New token</Button>
</div>
<p v-if="!available && !busy && !error" class="mb-3 text-sm text-fg-subtle">Personal tokens need a signed-in person.</p>
<p v-if="available" class="mb-3 text-xs text-fg-subtle">
Send it as <code>Authorization: Bearer &lt;token&gt;</code>.
</p>
<p v-if="available" class="mb-3 text-xs text-fg-subtle">Send it as <code>Authorization: Bearer &lt;token&gt;</code>.</p>
<p v-if="error" role="alert" class="mb-3 text-sm text-danger">{{ error }}</p>
<div v-if="created" class="mb-3 rounded-lg border border-border bg-card p-3">
<p class="mb-2 text-xs">Copy this token now. It is not shown again.</p>
+4 -4
View File
@@ -8,11 +8,11 @@ import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { StatusPill } from "@/components/ui/status-pill";
import { Badge } from "@/components/ui/badge";
import { Switch } from "@/components/ui/switch";
import { Textarea } from "@/components/ui/textarea";
import { cn } from "@/lib/utils";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import HistoryLink from "./HistoryLink.vue";
import {
duplicatePersona,
@@ -23,7 +23,7 @@ import {
const KIND = "personas";
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -97,7 +97,7 @@ function rename(name: string | number) {
<span class="truncate font-mono text-[13px]" :class="index === selected && 'font-medium'">{{
persona.name || "unnamed"
}}</span>
<StatusPill v-if="collection.default === persona.name" tone="accent" class="h-5">default</StatusPill>
<Badge v-if="collection.default === persona.name" variant="outline">Default</Badge>
</span>
<span class="block truncate text-xs text-fg-subtle">{{ persona.prompt || "No prompt yet" }}</span>
</button>
+2 -2
View File
@@ -4,12 +4,12 @@ import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import HistoryLink from "./HistoryLink.vue";
interface Playbook { id: string; yaml: string }
const KIND = "eda-playbooks";
const store = useControlPlaneStore();
const store = useSettingsStore();
onMounted(store.load);
const collection = computed(() => store.drafts[KIND]?.value as { playbooks: Playbook[] } | null);
const id = ref("");
+2 -2
View File
@@ -5,7 +5,7 @@ import { storeToRefs } from "pinia";
import PageHeader from "@/base/PageHeader.vue";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
@@ -16,7 +16,7 @@ interface PluginSettings {
skills_dir: string;
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
+2 -2
View File
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { computed } from "vue";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import { restartPendingTitles } from "./apply-status";
const store = useControlPlaneStore();
const store = useSettingsStore();
// Read from what each process reports it is running, never from this page's
// own saves: a restart that already happened clears it. A restart-required
+4 -5
View File
@@ -6,24 +6,23 @@ import { storeToRefs } from "pinia";
import PageHeader from "@/base/PageHeader.vue";
import { SettingRow } from "@/components/ui/setting-row";
import { Switch } from "@/components/ui/switch";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
import { inForceLabel, reviewDialStatus, type ReviewDials } from "./review";
import { config, loadConfig } from "./state";
const KIND = "review-settings";
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(() => Promise.all([store.load(), loadConfig()]));
onMounted(() => Promise.all([store.load(), store.loadConfig()]));
const resources = computed(() => resourcesForPage(catalog.value, "review"));
const dials = computed(() => store.drafts[KIND]?.value as ReviewDials | undefined);
const error = computed(() => store.pageErrorFor(KIND));
// What the daemon has in force, read from the published config projection, so
// a draft edit is visibly not yet the effective policy.
const status = computed(() => (dials.value ? reviewDialStatus(config.value, dials.value) : undefined));
const status = computed(() => (dials.value ? reviewDialStatus(store.config, dials.value) : undefined));
</script>
<template>
+13 -17
View File
@@ -15,10 +15,10 @@ import {
} from "@/components/ui/empty";
import { DurationInput } from "@/components/ui/duration-input";
import { Input } from "@/components/ui/input";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
import { Textarea } from "@/components/ui/textarea";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
@@ -36,7 +36,7 @@ interface Job {
next_run?: string;
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -56,7 +56,7 @@ const jobKinds = [
{ value: "chat", label: "Send a message" },
];
const pools = [
{ value: "", label: "Sequential" },
{ value: "sequential", label: "Sequential" },
{ value: "parallel", label: "Parallel" },
];
@@ -131,12 +131,9 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
</SettingRow>
<SettingRow label="Does">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl
:model-value="job.kind"
label="Does"
:options="jobKinds"
@update:model-value="(k: string) => { job.kind = k; job.target = k === 'chat' ? { channel: 'telegram', chat_id: '' } : {}; }"
/>
<ToggleGroup type="single" variant="outline" size="sm" :model-value="job.kind" aria-label="Does" @update:model-value="(value) => { if (!value) return; job.kind = value as string; job.target = value === 'chat' ? { channel: 'telegram', chat_id: '' } : {}; }">
<ToggleGroupItem v-for="option in jobKinds" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
<DraftHint :kind="KIND" :path="`${i}.kind`" />
</div>
</SettingRow>
@@ -159,12 +156,9 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
</SettingRow>
<SettingRow label="When">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl
:model-value="whenKind(job)"
label="When"
:options="whenKinds"
@update:model-value="(k: string) => (job.schedule = { kind: k, interval: k === 'interval' ? '24h0m0s' : undefined })"
/>
<ToggleGroup type="single" variant="outline" size="sm" :model-value="whenKind(job)" aria-label="When" @update:model-value="(value) => { if (value) job.schedule = { kind: value as string, interval: value === 'interval' ? '24h0m0s' : undefined }; }">
<ToggleGroupItem v-for="option in whenKinds" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
<DurationInput v-if="whenKind(job) === 'interval'" v-model="job.schedule.interval!" :units="['m', 'h']" />
<Input
v-else-if="whenKind(job) === 'cron'"
@@ -190,7 +184,9 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
</SettingRow>
<SettingRow label="Overlap">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl :model-value="job.pool ?? ''" label="Overlap" :options="pools" @update:model-value="(p: string) => (job.pool = p)" />
<ToggleGroup type="single" variant="outline" size="sm" :model-value="job.pool || 'sequential'" aria-label="Overlap" @update:model-value="(value) => { if (value) job.pool = value === 'sequential' ? '' : (value as string); }">
<ToggleGroupItem v-for="option in pools" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
<DraftHint :kind="KIND" :path="`${i}.pool`" />
</div>
</SettingRow>
+6 -4
View File
@@ -14,9 +14,9 @@ import {
NumberFieldIncrement,
NumberFieldInput,
} from "@/components/ui/number-field";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
const KIND = "scheduling-policy";
@@ -28,7 +28,7 @@ interface SchedulingPolicy {
dispatch: { trigger: string; ack_reaction: string };
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -63,7 +63,9 @@ const labelIssue = computed(() => issue("label"));
<h2 class="mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase">Dispatch</h2>
<SettingRow label="Trigger">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl v-model="policy.dispatch.trigger" label="Trigger" :options="triggers" />
<ToggleGroup type="single" variant="outline" size="sm" :model-value="policy.dispatch.trigger" aria-label="Trigger" @update:model-value="(value) => { if (value && policy) policy.dispatch.trigger = value as string; }">
<ToggleGroupItem v-for="option in triggers" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
<DraftHint :kind="KIND" path="dispatch.trigger" />
</div>
</SettingRow>
+2 -4
View File
@@ -38,12 +38,10 @@ const editing = ref(false);
/>
</div>
<div v-else class="flex flex-wrap items-end gap-2">
<label class="grid gap-1 text-xs text-fg-subtle">
Engine
<label class="grid gap-1 text-xs text-fg-subtle">Engine
<Input :id="`${idPrefix}-engine`" v-model="model.engine" class="w-28 font-mono" />
</label>
<label class="grid min-w-48 flex-1 gap-1 text-xs text-fg-subtle">
Key
<label class="grid min-w-48 flex-1 gap-1 text-xs text-fg-subtle">Key
<Input :id="`${idPrefix}-key`" v-model="model.key" class="font-mono" />
</label>
<Button variant="ghost" size="sm" @click="editing = false">Done</Button>
+42 -32
View File
@@ -53,6 +53,27 @@ function uptime(service: Service): string {
return `${minutes}m`;
}
function lastSeen(service: Service): string {
const at = Date.parse(service.reported_at);
return at && new Date(at).getFullYear() > 1 ? new Date(at).toLocaleString() : "";
}
// A row names what is wrong with a service and nothing else: passing checks
// and applied versions that match are noise here.
function problems(service: Service): { key: string; text: string }[] {
return [
...(service.checks ?? [])
.filter((check) => check.status !== "ok")
.map((check) => ({
key: `check:${check.name}`,
text: [check.name, check.detail].filter(Boolean).join(": "),
})),
...service.applied
.filter((record) => record.error)
.map((record) => ({ key: `applied:${record.kind}`, text: `${record.kind}: ${record.error}` })),
];
}
async function load(): Promise<void> {
try {
services.value = await api.services<Service[]>();
@@ -70,7 +91,7 @@ onUnmounted(() => clearInterval(timer));
</script>
<template>
<Card class="mb-4">
<Card>
<CardHeader>
<CardTitle>Services</CardTitle>
</CardHeader>
@@ -83,43 +104,32 @@ onUnmounted(() => clearInterval(timer));
<TableHead>Version</TableHead>
<TableHead>Uptime</TableHead>
<TableHead>Last seen</TableHead>
<TableHead>Applied</TableHead>
<TableHead class="w-px text-right">State</TableHead>
<TableHead class="w-full">Problems</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="service in services" :key="`${service.service}/${service.instance_id}`">
<TableRow
v-for="service in services"
:key="`${service.service}/${service.instance_id}`"
class="align-top"
>
<TableCell>
<span class="font-mono font-medium">{{ service.service }}</span>
<span v-if="service.service === 'archie-agent'" class="ml-2 text-sm text-fg-muted">task {{ service.instance_id }}</span>
<span v-if="service.detail" class="ml-2 text-sm text-fg-muted"
>{{ service.state }}: {{ service.detail }}</span
>
<div v-for="check in service.checks" :key="check.name" class="mt-1 flex items-center gap-2 text-xs">
<span>{{ check.name }}</span>
<Badge :variant="check.status === 'ok' ? 'ok' : 'warn'">{{ check.status }}</Badge>
<span v-if="check.detail" class="text-fg-muted">{{ check.detail }}</span>
</div>
<span class="font-mono">{{ service.service }}</span>
<span v-if="service.service === 'archie-agent'" class="ml-2 text-fg-muted">task {{ service.instance_id }}</span>
</TableCell>
<TableCell class="text-sm">
<template v-if="service.version">
{{ service.version }}
<span class="text-fg-muted">{{ service.install_type }}</span>
</template>
<TableCell class="font-mono text-fg-muted">
{{ service.version }}<span v-if="service.install_type" class="ml-2 font-sans">{{ service.install_type }}</span>
</TableCell>
<TableCell class="text-sm">{{ uptime(service) }}</TableCell>
<TableCell class="text-xs">{{ service.reported_at && new Date(service.reported_at).getFullYear() > 1 ? new Date(service.reported_at).toLocaleString() : "" }}</TableCell>
<TableCell class="text-xs">
<div v-for="record in service.applied" :key="record.kind">
<span class="font-mono">{{ record.kind }}</span>
v{{ record.applied_version }}
<span v-if="record.error" class="text-destructive">{{
record.error
}}</span>
</div>
</TableCell>
<TableCell class="w-px text-right">
<Badge :variant="tone[service.state]">{{ service.service === "archie-agent" && service.state === "down" ? "stale" : service.state }}</Badge>
<TableCell class="tabular-nums">{{ uptime(service) }}</TableCell>
<TableCell class="text-fg-muted">{{ lastSeen(service) }}</TableCell>
<TableCell class="whitespace-normal">
<Badge v-if="service.state !== 'up'" :variant="tone[service.state]">{{
service.service === "archie-agent" && service.state === "down" ? "stale" : service.state
}}</Badge>
<span v-if="service.state !== 'up' && service.detail && !problems(service).length" class="ml-2 text-fg-muted">{{
service.detail
}}</span>
<p v-for="problem in problems(service)" :key="problem.key" class="text-warn">{{ problem.text }}</p>
</TableCell>
</TableRow>
</TableBody>
+8 -14
View File
@@ -12,11 +12,11 @@ import {
SheetTitle,
} from "@/components/ui/sheet";
import { Spinner } from "@/components/ui/spinner";
import { StatusPill } from "@/components/ui/status-pill";
import { useControlPlaneStore } from "@/stores/control-plane";
import { Badge } from "@/components/ui/badge";
import { useSettingsStore } from "@/stores/settings";
import { formatValue } from "./changes";
const store = useControlPlaneStore();
const store = useSettingsStore();
const { reviewing } = storeToRefs(store);
onUnmounted(() => { reviewing.value = false; });
const saving = ref(false);
@@ -104,16 +104,13 @@ async function save() {
<p
v-if="needsRestart"
class="rounded-md border border-warn/40 bg-warn-soft px-3 py-2 text-sm text-warn"
>
Some changes apply after restart.
</p>
>Some changes apply after restart.</p>
<p
v-if="invalid.length"
class="rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm text-danger"
role="alert"
>
{{ invalid.length }} invalid {{ invalid.length === 1 ? "field" : "fields" }} must be fixed before saving.
</p>
{{ invalid.length }} invalid {{ invalid.length === 1 ? "field" : "fields" }} must be fixed before saving.</p>
<section
v-for="section in sections"
:key="section.kind"
@@ -121,10 +118,8 @@ async function save() {
>
<header class="flex items-center gap-2 border-b border-border px-3 py-2">
<h3 class="flex-1 truncate text-sm font-medium">{{ section.title }}</h3>
<StatusPill v-if="section.restart" tone="warn">After restart</StatusPill>
<Button variant="ghost" size="sm" @click="store.resetDraft(section.kind)">
Revert
</Button>
<Badge v-if="section.restart" variant="warn">After restart</Badge>
<Button variant="ghost" size="sm" @click="store.resetDraft(section.kind)">Revert</Button>
</header>
<ul class="divide-y divide-border font-mono text-xs">
<li v-for="change in section.changes" :key="change.path" class="px-3 py-2">
@@ -150,8 +145,7 @@ async function save() {
<SheetFooter class="flex-row justify-end gap-2 border-t border-border">
<Button variant="ghost" @click="discardAll">Discard all</Button>
<Button :disabled="saving || invalid.length > 0" @click="save">
<Spinner v-if="saving" data-icon="inline-start" /> Save
</Button>
<Spinner v-if="saving" data-icon="inline-start" />Save</Button>
</SheetFooter>
</SheetContent>
</Sheet>
+12 -69
View File
@@ -1,59 +1,21 @@
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
import { computed, onBeforeUnmount, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { hidden } from "@/lib/capabilities";
import { settingsNav } from "@/lib/nav";
import { hiddenPaths, settingsNav } from "@/lib/nav";
import { cn } from "@/lib/utils";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSessionStore } from "@/stores/session";
import { useSettingsStore } from "@/stores/settings";
import RestartPendingBanner from "./RestartPendingBanner.vue";
import SettingsSaveBar from "./SettingsSaveBar.vue";
const route = useRoute();
const items = computed(() => settingsNav(hidden.value));
// The sidebar's width, dragged or keyed on its edge, kept per browser.
const MIN_WIDTH = 180;
const MAX_WIDTH = 420;
const DEFAULT_WIDTH = 240;
const WIDTH_KEY = "archie.settingsSidebarWidth";
const clampWidth = (w: number) => Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, Math.round(w)));
const width = ref(clampWidth(Number(localStorage.getItem(WIDTH_KEY)) || DEFAULT_WIDTH));
watch(width, (w) => localStorage.setItem(WIDTH_KEY, String(w)));
function startResize(event: PointerEvent) {
event.preventDefault();
const handle = event.currentTarget as HTMLElement;
const startX = event.clientX;
const startWidth = width.value;
handle.setPointerCapture(event.pointerId);
const move = (e: PointerEvent) => (width.value = clampWidth(startWidth + e.clientX - startX));
const stop = () => {
handle.removeEventListener("pointermove", move);
handle.removeEventListener("pointerup", stop);
handle.removeEventListener("pointercancel", stop);
};
handle.addEventListener("pointermove", move);
handle.addEventListener("pointerup", stop);
handle.addEventListener("pointercancel", stop);
}
function keyResize(event: KeyboardEvent) {
const step = event.shiftKey ? 48 : 16;
const next: Record<string, number> = {
ArrowLeft: width.value - step,
ArrowRight: width.value + step,
Home: MIN_WIDTH,
End: MAX_WIDTH,
};
if (!(event.key in next)) return;
event.preventDefault();
width.value = clampWidth(next[event.key]!);
}
const session = useSessionStore();
const items = computed(() => settingsNav(hiddenPaths(session.sections)));
// Drafts live in the store, so moving between Settings pages keeps them;
// leaving Settings, or the page, with edits unsaved asks first.
const store = useControlPlaneStore();
const store = useSettingsStore();
const dirty = () => store.dirtyKinds.length > 0;
const removeGuard = useRouter().beforeEach((to) => {
if (to.meta.settings || !dirty()) return true;
@@ -70,18 +32,18 @@ onBeforeUnmount(() => {
</script>
<template>
<div class="flex max-lg:flex-col max-lg:gap-4" :style="{ '--sidebar-w': `${width}px` }">
<div class="flex gap-8 max-lg:flex-col max-lg:gap-4">
<nav
id="settings-sidebar"
aria-label="Settings"
class="shrink-0 lg:w-[var(--sidebar-w)] max-lg:-mx-4 max-lg:w-auto max-lg:scroll-fade-x max-lg:overflow-x-auto max-lg:[scrollbar-width:none] max-lg:border-b max-lg:px-4"
class="shrink-0 lg:w-48 max-lg:-mx-4 max-lg:w-auto max-lg:scroll-fade-x max-lg:overflow-x-auto max-lg:[scrollbar-width:none] max-lg:border-b max-lg:px-4"
>
<ul class="flex flex-col gap-0.5 lg:sticky lg:top-20 max-lg:flex-row max-lg:gap-1">
<li v-for="(item, index) in items" :key="item.path" class="contents">
<hr v-if="item.dividerBefore === ''" class="my-4 border-border max-lg:hidden" />
<p
v-else-if="item.dividerBefore"
:class="cn('mb-1.5 px-3 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase max-lg:hidden', index > 0 && 'mt-5')"
:class="cn('mb-1 px-3 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase max-lg:hidden', index > 0 && 'mt-4')"
>
{{ item.dividerBefore }}
</p>
@@ -90,7 +52,7 @@ onBeforeUnmount(() => {
:aria-current="route.path === item.path ? 'page' : undefined"
:class="
cn(
'flex h-9 items-center rounded-md px-3 text-[13px] whitespace-nowrap text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring',
'flex h-8 items-center rounded-md px-3 text-[13px] whitespace-nowrap text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring',
route.path === item.path &&
'bg-secondary font-medium text-foreground',
)
@@ -101,28 +63,9 @@ onBeforeUnmount(() => {
</li>
</ul>
</nav>
<div
role="separator"
aria-orientation="vertical"
aria-label="Resize settings sidebar"
aria-controls="settings-sidebar"
:aria-valuenow="width"
:aria-valuemin="MIN_WIDTH"
:aria-valuemax="MAX_WIDTH"
tabindex="0"
class="group relative w-10 shrink-0 cursor-col-resize touch-none outline-none max-lg:hidden"
@pointerdown="startResize"
@keydown="keyResize"
@dblclick="width = DEFAULT_WIDTH"
>
<span
class="absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors group-hover:bg-border-strong group-focus-visible:bg-primary group-active:bg-primary"
aria-hidden="true"
/>
</div>
<!-- At least a screen tall, so the sticky save bar always rests at the
viewport's bottom edge rather than under the last setting. -->
<div class="flex min-h-screen min-w-0 flex-1 flex-col" :class="route.meta.wide ? '' : 'max-w-[960px]'">
<div class="flex min-h-screen min-w-0 flex-1 flex-col">
<RestartPendingBanner />
<!-- Room below the last setting, so it can be scrolled up to eye level. -->
<div class="pb-[40vh]">
+4 -7
View File
@@ -5,13 +5,13 @@ import { storeToRefs } from "pinia";
import PageHeader from "@/base/PageHeader.vue";
import { Textarea } from "@/components/ui/textarea";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
const KIND = "soul";
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -37,9 +37,7 @@ const chars = computed(() => soul.value?.text.length ?? 0);
<label for="soul-text" class="text-[13px] font-medium">Identity</label>
<DraftHint :kind="KIND" path="text" />
</div>
<p class="mt-1 text-xs text-fg-subtle">
Empty falls back to the SOUL file, then the shipped default.
</p>
<p class="mt-1 text-xs text-fg-subtle">Empty falls back to the SOUL file, then the shipped default.</p>
<Textarea
id="soul-text"
v-model="soul.text"
@@ -48,8 +46,7 @@ const chars = computed(() => soul.value?.text.length ?? 0);
aria-label="SOUL text"
/>
<p class="mt-1.5 text-xs text-fg-subtle">
{{ chars.toLocaleString() }} chars · ~{{ Math.round(chars / 4).toLocaleString() }} tokens
</p>
{{ chars.toLocaleString() }} chars · ~{{ Math.round(chars / 4).toLocaleString() }} tokens</p>
</section>
</div>
</template>
+1 -3
View File
@@ -101,9 +101,7 @@ function chooseMotion(value: unknown): void {
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-tooltips" class="text-sm font-medium">
Tooltips
</h2>
<h2 id="appearance-tooltips" class="text-sm font-medium">Tooltips</h2>
</div>
<Switch
:model-value="tooltipsEnabled"
+11 -17
View File
@@ -17,13 +17,12 @@ import {
} from "@/components/ui/select";
import { SettingRow } from "@/components/ui/setting-row";
import { Switch } from "@/components/ui/switch";
import { instanceAdmin, loadOrg, orgs } from "@/org/org";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { useOrgStore } from "@/stores/org";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
import { availableProviders, aliasModelOptions } from "./model-choices";
import SecretRefField from "./SecretRefField.vue";
import { config, loadConfig } from "./state";
interface Provider {
class: string;
@@ -38,9 +37,10 @@ const KNOWN_ALIASES = ["default", "embedding", "transcription"];
// Provider classes the runtime SDK registers.
const CLASSES = ["openai", "anthropic", "azure", "cohere", "deepseek", "gemini", "groq", "mistral", "ollama", "perplexity", "xai"];
const store = useControlPlaneStore();
const store = useSettingsStore();
const orgStore = useOrgStore();
const { catalog: resourceCatalog, catalogError } = storeToRefs(store);
onMounted(() => Promise.all([store.load(), loadConfig(), loadOrg()]));
onMounted(() => Promise.all([store.load(), store.loadConfig(), orgStore.loadOrg()]));
const resources = computed(() => resourcesForPage(resourceCatalog.value, "models"));
const providers = computed(() => store.drafts["provider-settings"]?.value as Record<string, Provider> | undefined);
@@ -49,7 +49,7 @@ const errors = computed(() =>
["provider-settings", "model-aliases"].map((k) => store.pageErrorFor(k)).filter(Boolean),
);
const modelCatalog = computed(() => config.value?.catalog ?? []);
const modelCatalog = computed(() => store.config?.catalog ?? []);
const configuredIds = computed(() => Object.keys(providers.value ?? {}));
const modelOptions = computed(() => aliasModelOptions(modelCatalog.value, configuredIds.value));
const available = computed(() => availableProviders(modelCatalog.value, configuredIds.value));
@@ -126,7 +126,7 @@ interface OrgPolicy {
own_providers: boolean;
}
const policies = computed(() => store.drafts["org-model-policy"]?.value as Record<string, OrgPolicy> | undefined);
const otherOrgs = computed(() => (instanceAdmin.value ? orgs.value.filter((o) => o.id !== "org-sys") : []));
const otherOrgs = computed(() => (orgStore.instanceAdmin ? orgStore.orgs.filter((o) => o.id !== "org-sys") : []));
const providerWildcards = computed(() => configuredIds.value.map((id) => `${id}/*`));
function policyFor(id: string): OrgPolicy {
return policies.value?.[id] ?? { allowed: [], own_providers: false };
@@ -157,9 +157,7 @@ const eyebrow = "mb-2 text-[11px] font-medium tracking-[0.06em] text-fg-subtle u
<template v-if="aliases">
<h2 :class="eyebrow">Aliases</h2>
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">
Set the default alias: agent steps and chat that name no alias cannot run without it.
</p>
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">Set the default alias: agent steps and chat that name no alias cannot run without it.</p>
<datalist id="alias-models">
<option v-for="m in modelOptions" :key="m" :value="m" />
</datalist>
@@ -226,8 +224,7 @@ const eyebrow = "mb-2 text-[11px] font-medium tracking-[0.06em] text-fg-subtle u
/>
<label class="flex items-center gap-2 text-xs text-fg-muted">
<Switch :model-value="policyFor(o.id).own_providers" @update:model-value="(v) => setPolicy(o.id, { own_providers: !!v })" />
Own providers
</label>
Own providers</label>
<DraftHint kind="org-model-policy" :path="o.id" />
</div>
</div>
@@ -289,11 +286,8 @@ const eyebrow = "mb-2 text-[11px] font-medium tracking-[0.06em] text-fg-subtle u
<form class="flex flex-wrap items-center gap-2 border-t border-border px-4 py-3" @submit.prevent="addProvider">
<Input v-model="newProvider" list="available-providers" class="max-w-56 font-mono" placeholder="provider" aria-label="New provider" />
<Button type="submit" variant="outline" size="sm" :disabled="!newProvider.trim()"><Plus data-icon="inline-start" />Add provider</Button>
<span v-if="available.length" class="text-xs text-fg-subtle">
Available:
<button v-for="p in available" :key="p.id" type="button" class="mr-2 font-mono hover:text-foreground" @click="newProvider = p.id; addProvider()">
{{ p.id }}
</button>
<span v-if="available.length" class="text-xs text-fg-subtle">Available:
<Button v-for="p in available" :key="p.id" type="button" variant="link" size="xs" class="h-auto px-1 font-mono text-fg-subtle" @click="newProvider = p.id; addProvider()">{{ p.id }}</Button>
</span>
</form>
</div>
+3 -4
View File
@@ -30,7 +30,7 @@ import {
TagsInputItemDelete,
TagsInputItemText,
} from "@/components/ui/tags-input";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import CommandListEditor from "./CommandListEditor.vue";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
@@ -51,7 +51,7 @@ interface Repo {
allow_concurrent: boolean;
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -176,8 +176,7 @@ const protectOf = (repo: Repo) => repo.protect ?? [];
<div class="flex gap-2">
<Input v-model="newRepo" class="max-w-72 font-mono" placeholder="owner/repository" aria-label="New repository" @keydown.enter="addRepo" />
<Button variant="outline" size="sm" :disabled="!/^[^/\s]+\/[^/\s]+$/.test(newRepo.trim())" @click="addRepo">
<Plus data-icon="inline-start" /> Add repository
</Button>
<Plus data-icon="inline-start" /> Add repository</Button>
</div>
</template>
</div>
+38 -33
View File
@@ -1,47 +1,52 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { onMounted, onUnmounted } from "vue";
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
import { config, loadConfig } from "./state";
let timer: ReturnType<typeof setInterval>;
onMounted(() => { void loadConfig(); timer = setInterval(() => void loadConfig(), 15_000); });
onUnmounted(() => clearInterval(timer));
import PageHeader from "@/base/PageHeader.vue";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import HealthStatusCard from "./HealthStatusCard.vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import ServicesCard from "./ServicesCard.vue";
import UpdateSettingsCard from "./UpdateSettingsCard.vue";
import VersionsCard from "./VersionsCard.vue";
import { useSettingsStore } from "@/stores/settings";
const store = useSettingsStore();
const { config } = storeToRefs(store);
let timer: ReturnType<typeof setInterval>;
onMounted(() => {
void store.loadConfig();
timer = setInterval(() => void store.loadConfig(), 15_000);
});
onUnmounted(() => clearInterval(timer));
</script>
<template>
<div>
<PageHeader title="Status" />
<Alert v-if="config?.reload?.last_error" variant="destructive" class="mb-4">
<PageHeader title="Status" />
<div class="flex flex-col gap-4">
<Alert v-if="config?.reload?.last_error" variant="destructive">
<AlertTitle>Configuration reload failed</AlertTitle>
<AlertDescription>{{ config.reload.last_error }}</AlertDescription>
</Alert>
<Tabs default-value="services" class="space-y-4">
<TabsList>
<TabsTrigger value="services">Services</TabsTrigger>
<TabsTrigger value="health">Health</TabsTrigger>
<TabsTrigger value="versions">Versions</TabsTrigger>
<TabsTrigger value="startup">Startup settings</TabsTrigger>
</TabsList>
<TabsContent value="startup">
<p class="mb-4 text-sm text-fg-subtle">These settings configure process startup. They are read-only here and require a restart.</p>
<dl class="divide-y divide-border rounded-lg border border-border bg-card">
<div v-for="(reason,key) in config?.bootstrap" :key="key" class="grid gap-2 px-4 py-3 md:grid-cols-[18rem_1fr]">
<dt class="font-mono text-xs">{{ key }}</dt><dd class="text-sm text-fg-subtle">{{ reason }}</dd>
</div>
</dl>
</TabsContent>
<TabsContent value="services"><ServicesCard /></TabsContent>
<TabsContent value="health"><HealthStatusCard /></TabsContent>
<TabsContent value="versions" class="space-y-4">
<VersionsCard />
<UpdateSettingsCard />
</TabsContent>
</Tabs>
<ServicesCard />
<VersionsCard />
<UpdateSettingsCard />
<Card v-if="config?.bootstrap && Object.keys(config.bootstrap).length">
<CardHeader>
<CardTitle>Startup settings</CardTitle>
</CardHeader>
<CardContent>
<p class="mb-2 text-fg-subtle">Read at startup. A change needs a restart.</p>
<Table>
<TableBody>
<TableRow v-for="(reason, key) in config.bootstrap" :key="key">
<TableCell class="font-mono">{{ key }}</TableCell>
<TableCell class="w-full whitespace-normal text-fg-muted">{{ reason }}</TableCell>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</div>
</template>
+2 -2
View File
@@ -16,7 +16,7 @@ import {
NumberFieldInput,
} from "@/components/ui/number-field";
import { SettingRow } from "@/components/ui/setting-row";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
import SecretRefField from "./SecretRefField.vue";
@@ -31,7 +31,7 @@ interface ExecutionSettings {
max_task_runtime_seconds: number | null;
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
+4 -7
View File
@@ -18,7 +18,7 @@ import {
} from "@/components/ui/input-group";
import { SettingRow } from "@/components/ui/setting-row";
import { Switch } from "@/components/ui/switch";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
import McpServerEditor, { type McpServer } from "./McpServerEditor.vue";
import SecretRefField from "./SecretRefField.vue";
@@ -32,7 +32,7 @@ interface ToolSettings {
web_fetch: { enabled: boolean | null; timeout: string; max_bytes: number; allow_private_networks: boolean };
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
onMounted(store.load);
@@ -107,13 +107,10 @@ const eyebrow = "mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle u
:model-value="server"
@remove="removeServer(server)"
/>
<p v-if="!tools.mcp_servers.length && !pending" class="text-sm text-fg-muted">
No MCP servers.
</p>
<p v-if="!tools.mcp_servers.length && !pending" class="text-sm text-fg-muted">No MCP servers.</p>
<div v-if="!pending">
<Button variant="outline" size="sm" @click="addServer">
<Plus data-icon="inline-start" /> Add MCP server
</Button>
<Plus data-icon="inline-start" /> Add MCP server</Button>
</div>
</div>
+6 -4
View File
@@ -3,14 +3,14 @@ import { computed, onMounted } from "vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
const KIND = "update-settings";
type UpdateSettings = { channel: string; pin: string };
const store = useControlPlaneStore();
const store = useSettingsStore();
onMounted(store.load);
const draft = computed(() => store.drafts[KIND]?.value as UpdateSettings | undefined);
@@ -38,7 +38,9 @@ const channel = computed({
<p v-if="error" class="mb-2 text-sm text-danger" role="alert">{{ error }}</p>
<SettingRow label="Release channel">
<div class="flex justify-end">
<SegmentedControl v-model="channel" label="Release channel" :options="channels" />
<ToggleGroup type="single" variant="outline" size="sm" :model-value="channel" aria-label="Release channel" @update:model-value="(value) => { if (value) channel = value as typeof channel; }">
<ToggleGroupItem v-for="option in channels" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
</div>
</SettingRow>
<SettingRow v-if="channel === 'exact-pin'" label="Version" for="update-pin">
+10 -18
View File
@@ -62,7 +62,7 @@ const statusKind: Record<
};
const statusLabel: Record<ComponentVersion["status"], string> = {
ok: "Up to date",
ok: "",
update_available: "Update available",
drift: "Version drift",
unknown: "Unknown",
@@ -134,9 +134,7 @@ onMounted(load);
</script>
<template>
<p v-if="notConfigured" class="text-sm text-fg-muted">
Update checks not configured.
</p>
<p v-if="notConfigured" class="text-sm text-fg-muted">Update checks not configured.</p>
<Card v-else>
<CardHeader>
<CardTitle>Versions</CardTitle>
@@ -151,22 +149,18 @@ onMounted(load);
<TableHead>Component</TableHead>
<TableHead>Running</TableHead>
<TableHead>Available</TableHead>
<TableHead class="text-right">Status</TableHead>
<TableHead class="w-full"></TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="component in components" :key="component.id">
<TableCell class="font-medium">{{
component.label || component.id
}}</TableCell>
<TableCell>{{ component.label || component.id }}</TableCell>
<TableCell class="font-mono text-fg-muted">{{
component.running_version || component.installed_claim || "—"
component.running_version || component.installed_claim
}}</TableCell>
<TableCell class="font-mono text-fg-muted">{{
component.latest_available || "—"
}}</TableCell>
<TableCell class="text-right">
<Badge :variant="statusKind[component.status]">{{
<TableCell class="font-mono text-fg-muted">{{ component.latest_available }}</TableCell>
<TableCell>
<Badge v-if="component.status !== 'ok'" :variant="statusKind[component.status]">{{
statusLabel[component.status]
}}</Badge>
</TableCell>
@@ -178,16 +172,14 @@ onMounted(load);
v-if="canInstall && updateable.length"
class="mt-4 flex flex-col gap-2"
>
<Button :disabled="installing" @click="install">
<Button class="self-start" :disabled="installing" @click="install">
{{
installing
? "Installing…"
: `Install ${updateable.map((c) => c.label || c.id).join(", ")}`
}}
</Button>
<p v-if="installing" class="text-xs text-fg-muted">
You can leave this page; the restart continues here.
</p>
<p v-if="installing" class="text-xs text-fg-muted">You can leave this page; the restart continues here.</p>
</div>
<div
+1 -1
View File
@@ -2,7 +2,7 @@ import type {
ApplyState,
ApplyStatusRow,
ResourceDescriptor,
} from "../stores/control-plane.ts";
} from "../stores/settings.ts";
/** A resource's apply mode, as the control-plane catalog serves it. */
export type ApplyMode = ResourceDescriptor["apply_mode"];
-41
View File
@@ -1,41 +0,0 @@
import { computed, ref } from "vue";
import { api } from "@/lib/api";
import type { ConfigView } from "./types";
/**
* The System pages' shared state.
*
* Six routes read the same configuration projection, and several of them read
* more than one endpoint, so the data lives in a module rather than being
* threaded down through a chain of props. Each page calls the loaders it needs
* and owns when; the cards read the refs.
*/
/** How archied's own handlers report a failure: a plain-text reason in the
* body, surfaced by lib/api as the Error's message. */
export function errorText(err: unknown): string {
return String((err as Error).message || err);
}
// ── The configuration projection ────────────────────────────────────────────
export const config = ref<ConfigView | null>(null);
export const configError = ref<string | null>(null);
/** Nothing to render: either the read failed, or archied is running without a
* config file wired into the dashboard. */
export const configUnavailable = computed(
() =>
Boolean(configError.value) || Object.keys(config.value ?? {}).length === 0,
);
export async function loadConfig(): Promise<void> {
try {
config.value = await api.config<ConfigView>();
configError.value = null;
} catch (err) {
configError.value = errorText(err);
}
}