fix(webui): stop empty states re-deriving their own titles
A title that states the fact does not need a description that derives it: the log, panels, lifecycle lists, dashboard cards, stages, skills and captures empty states now say the fact once, and keep only the descriptions that carry an action, a cause, or a distinct reading.
This commit is contained in:
1 parent
2963f89c0f
commit
e5a8526130
43 files changed
+239
-315
No files matched your search
@@ -1,12 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import ChatLauncher from "@/chat/ChatLauncher.vue";
|
||||
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
|
||||
import Topbar from "@/components/topbar/Topbar.vue";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { hidden, loadCapabilities } from "@/lib/capabilities";
|
||||
import { loadTaskMeta } from "@/lib/task-meta";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
const { authenticationRequired } = storeToRefs(useLiveUpdatesStore());
|
||||
|
||||
onMounted(() => {
|
||||
// Asked for once, after the shell is up: the nav paints immediately and
|
||||
@@ -41,6 +46,12 @@ onMounted(() => {
|
||||
>
|
||||
<Topbar :hidden="hidden" />
|
||||
<main class="w-full flex-1 overflow-x-hidden p-8 max-[900px]:p-4">
|
||||
<Alert v-if="authenticationRequired" variant="destructive" class="mb-4">
|
||||
<AlertTitle>Dashboard authentication required</AlertTitle>
|
||||
<AlertDescription>
|
||||
Open the dashboard URL Archie logged at startup to establish a new authenticated session.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
<!--
|
||||
Keyed on the path and its parameters but not the query: a query-only
|
||||
change is an entry state, so the page keeps the operator's filters,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { Plus, RefreshCw } from "@lucide/vue";
|
||||
import { Plus } from "@lucide/vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import BindingEditor from "./BindingEditor.vue";
|
||||
import BindingsTable from "./BindingsTable.vue";
|
||||
import DeleteBindingDialog from "./DeleteBindingDialog.vue";
|
||||
@@ -40,6 +41,7 @@ const editorOpen = ref(false);
|
||||
const editing = ref<Binding | null>(null);
|
||||
const deleting = ref<Binding | null>(null);
|
||||
|
||||
useLiveResource(null, () => void load());
|
||||
onMounted(load);
|
||||
|
||||
function startCreate(): void {
|
||||
@@ -72,11 +74,7 @@ async function handleDelete(binding: Binding): Promise<void> {
|
||||
title="Playbook bindings"
|
||||
subtitle="Tie a matcher, a field mapping, and a workflow together. New and edited bindings need explicit approval before they can fire."
|
||||
>
|
||||
<Button v-if="failure" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Retry
|
||||
</Button>
|
||||
<Button v-else @click="startCreate">
|
||||
<Button v-if="!failure" @click="startCreate">
|
||||
<Plus data-icon="inline-start" />
|
||||
New binding
|
||||
</Button>
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { load } from "./state";
|
||||
|
||||
/** Read the list again, for an operator who does not want to wait for the
|
||||
* stream to invalidate it. */
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</template>
|
||||
@@ -1,6 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { streamKind, streamState } from "./state";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
const { streamKind, streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
|
||||
/**
|
||||
* The state of the stream that is supposed to be adding to this list. Without
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import CaptureActions from "./CaptureActions.vue";
|
||||
import CaptureStatus from "./CaptureStatus.vue";
|
||||
|
||||
/** The page's title, and what belongs beside it: where the stream has got to,
|
||||
@@ -14,7 +13,6 @@ import CaptureStatus from "./CaptureStatus.vue";
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<CaptureStatus />
|
||||
<CaptureActions />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -33,7 +33,6 @@ const webhookHint = "Point a webhook at /webhooks/capture/<source> and it will s
|
||||
<EmptyHeader>
|
||||
<EmptyMedia variant="icon"><Inbox /></EmptyMedia>
|
||||
<EmptyTitle>Capture is not configured</EmptyTitle>
|
||||
<EmptyDescription>This deployment has no capture storage wired up.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import { api, subscribeEvents } from "@/lib/api";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import type { StreamState } from "@/lib/stream-state";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
|
||||
/**
|
||||
* The event inspector's shared state.
|
||||
@@ -43,7 +42,6 @@ export const captures = ref<Capture[]>([]);
|
||||
export const enabled = ref(true);
|
||||
export const error = ref<string | null>(null);
|
||||
export const loading = ref(true);
|
||||
export const streamState = ref<StreamState | "connecting">("connecting");
|
||||
|
||||
/**
|
||||
* The open row's capture, or null. Held by value rather than by id: the list
|
||||
@@ -53,13 +51,6 @@ export const streamState = ref<StreamState | "connecting">("connecting");
|
||||
*/
|
||||
export const selected = ref<Capture | null>(null);
|
||||
|
||||
/** The stream's state as a badge kind. A stream still connecting and one that
|
||||
* has given up are different answers, so they do not share a tone. */
|
||||
export const streamKind = computed<StatusKind>(() => {
|
||||
if (streamState.value === "live") return "ok";
|
||||
return streamState.value === "unavailable" ? "danger" : "warn";
|
||||
});
|
||||
|
||||
/**
|
||||
* load re-reads the list. It runs once on mount and again on every capture
|
||||
* event, so it deliberately never re-enters the loading state: the skeletons
|
||||
@@ -81,26 +72,9 @@ export async function load(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
function handleEvent(raw: unknown): void {
|
||||
// The "capture" event on /events carries the id and source only, no payload
|
||||
// (see handleCapture), so it is an invalidation signal rather than data: it
|
||||
// says a capture exists, and the authoritative list -- the only place the
|
||||
// redacted payload lives -- is asked for again. Merging it into local state
|
||||
// instead would put a row in the list with nothing behind it.
|
||||
if ((raw as { kind?: string } | null)?.kind !== "capture") return;
|
||||
void load();
|
||||
}
|
||||
|
||||
let unsubscribe: (() => void) | undefined;
|
||||
|
||||
/** Owns the initial read and the live stream that invalidates it, for the
|
||||
* page's lifetime. */
|
||||
export function useCaptures(): void {
|
||||
onMounted(() => {
|
||||
void load();
|
||||
unsubscribe = subscribeEvents(handleEvent, (state) => {
|
||||
streamState.value = state;
|
||||
});
|
||||
});
|
||||
onUnmounted(() => unsubscribe?.());
|
||||
useLiveResource("captures", () => void load());
|
||||
onMounted(load);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ChannelCard, { type Channel } from "./ChannelCard.vue";
|
||||
|
||||
/** The conversational front-ends Archie can be reached through. */
|
||||
@@ -34,6 +33,7 @@ async function reload(id: string) {
|
||||
await load();
|
||||
}
|
||||
|
||||
useLiveResource(null, () => void load());
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
@@ -42,12 +42,7 @@ onMounted(load);
|
||||
<PageHeader
|
||||
title="Channels"
|
||||
subtitle="The conversational front-ends Archie can be reached through."
|
||||
>
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
/>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 min-[1080px]:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]">
|
||||
<Empty v-if="error">
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import CuratorCard, { type Curator } from "./CuratorCard.vue";
|
||||
|
||||
/**
|
||||
@@ -28,6 +27,7 @@ async function load() {
|
||||
}
|
||||
}
|
||||
|
||||
useLiveResource("curators", () => void load());
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
@@ -36,12 +36,7 @@ onMounted(load);
|
||||
<PageHeader
|
||||
title="Curators"
|
||||
subtitle="Background agents that maintain memory and skills: what ran, and why."
|
||||
>
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
/>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 min-[1080px]:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]">
|
||||
<Empty v-if="loadError">
|
||||
@@ -54,7 +49,7 @@ onMounted(load);
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No curators registered</EmptyTitle>
|
||||
<EmptyDescription>
|
||||
Curators are background agent loops that maintain memory and skills. None are registered on this daemon.
|
||||
Curators are background agent loops that maintain memory and skills.
|
||||
</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { AlignLeft, ListChecks, RefreshCw, Route } from "@lucide/vue";
|
||||
import { AlignLeft, ListChecks, Route } from "@lucide/vue";
|
||||
import { computed } from "vue";
|
||||
import { RouterLink } from "vue-router";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { error, loadDashboard, tasks } from "./state";
|
||||
import { error, tasks } from "./state";
|
||||
import { dashboardTaskTargets } from "./task-targets";
|
||||
|
||||
/**
|
||||
@@ -16,11 +16,7 @@ const targets = computed(() => dashboardTaskTargets(tasks.value ?? []));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Button v-if="error" @click="loadDashboard">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Retry
|
||||
</Button>
|
||||
<template v-else-if="tasks !== null">
|
||||
<template v-if="!error && tasks !== null">
|
||||
<Button v-if="targets.attention.count > 0" variant="attention" as-child>
|
||||
<RouterLink :to="targets.attention.href">
|
||||
<ListChecks data-icon="inline-start" />
|
||||
@@ -39,9 +35,5 @@ const targets = computed(() => dashboardTaskTargets(tasks.value ?? []));
|
||||
Logs
|
||||
</RouterLink>
|
||||
</Button>
|
||||
<Button @click="loadDashboard">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@ import { computed } from "vue";
|
||||
import Gauge from "@/base/Gauge.vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { summary, workflows } from "./state";
|
||||
|
||||
/** Sharer of runs: how much of the work that finished passed its gates. */
|
||||
@@ -27,7 +27,6 @@ const totals = computed(() => ({
|
||||
<Empty v-if="!totals.runs">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No completed runs yet</EmptyTitle>
|
||||
<EmptyDescription>Once Archie finishes a task, its gate pass rate appears here.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<template v-else>
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
import ActivityRow from "./ActivityRow.vue";
|
||||
import { activity, streamStateKind, streamStateText } from "./state";
|
||||
|
||||
/** The last 50 events, newest first, with the stream's own state on the card. */
|
||||
|
||||
const router = useRouter();
|
||||
const { activity, streamKind, streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
|
||||
function openTask(taskID: number) {
|
||||
void router.push(`/tasks?task=${encodeURIComponent(taskID)}`);
|
||||
@@ -23,7 +25,7 @@ function openTask(taskID: number) {
|
||||
<CardTitle>Live activity</CardTitle>
|
||||
<CardDescription>Last 50, newest first</CardDescription>
|
||||
<CardAction>
|
||||
<Badge :variant="streamStateKind">{{ streamStateText }}</Badge>
|
||||
<Badge :variant="streamKind">{{ streamState }}</Badge>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
@@ -50,7 +52,6 @@ function openTask(taskID: number) {
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Waiting for activity</EmptyTitle>
|
||||
<EmptyDescription>Events appear here as Archie works.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</TableCell>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { computed } from "vue";
|
||||
|
||||
import SegmentBar from "@/base/SegmentBar.vue";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { compact } from "@/lib/format";
|
||||
import { summary } from "./state";
|
||||
|
||||
@@ -26,7 +26,6 @@ const projected = computed(() => Math.round(perDay.value * 30));
|
||||
<Empty v-if="!days.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Nothing spent yet</EmptyTitle>
|
||||
<EmptyDescription>Usage appears here once Archie runs its first task.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<template v-else>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { onMounted, onUnmounted, ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import { api, subscribeEvents } from "@/lib/api";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import type { ActivityDetailInput } from "./activity-detail";
|
||||
import type { Setup } from "./setup-preference";
|
||||
|
||||
@@ -53,9 +53,6 @@ export const workflows = ref<{ workflows?: WorkflowStat[] } | null>(null);
|
||||
export const tasks = ref<DashboardTask[] | null>(null);
|
||||
export const error = ref<string | null>(null);
|
||||
|
||||
export const activity = ref<ActivityEvent[]>([]);
|
||||
export const streamStateText = ref("connecting");
|
||||
export const streamStateKind = ref<StatusKind>("idle");
|
||||
export const taskIDsBySource = ref(new Map<string, number>());
|
||||
|
||||
export async function loadDashboard(): Promise<void> {
|
||||
@@ -95,23 +92,8 @@ export function taskIDFor(event: ActivityEvent): number {
|
||||
return taskIDForEvent(event, taskIDsBySource.value);
|
||||
}
|
||||
|
||||
let unsubscribe: (() => void) | undefined;
|
||||
|
||||
/** Owns the initial fetch and the event stream for the page's lifetime. */
|
||||
export function useDashboard(): void {
|
||||
onMounted(async () => {
|
||||
await loadDashboard();
|
||||
unsubscribe = subscribeEvents(
|
||||
(event) => {
|
||||
const next = [event as ActivityEvent, ...activity.value];
|
||||
next.splice(50);
|
||||
activity.value = next;
|
||||
},
|
||||
(state) => {
|
||||
streamStateText.value = state;
|
||||
streamStateKind.value = state === "live" ? "ok" : "warn";
|
||||
},
|
||||
);
|
||||
});
|
||||
onUnmounted(() => unsubscribe?.());
|
||||
useLiveResource("tasks", () => void loadDashboard(), 500);
|
||||
onMounted(loadDashboard);
|
||||
}
|
||||
@@ -42,6 +42,13 @@ async function errorMessage(res: Response): Promise<string> {
|
||||
return `${res.status} ${res.statusText}`;
|
||||
}
|
||||
|
||||
let authenticationStateHandler: ((required: boolean) => void) | undefined;
|
||||
|
||||
/** Let the app shell own authentication state without coupling requests to UI. */
|
||||
export function setAuthenticationStateHandler(handler: (required: boolean) => void): void {
|
||||
authenticationStateHandler = handler;
|
||||
}
|
||||
|
||||
export class ApiError extends Error {
|
||||
status: number;
|
||||
|
||||
@@ -77,6 +84,7 @@ export function classifyActionError(err: unknown): { kind: ActionErrorKind; mess
|
||||
// itself.
|
||||
async function send(path: string, init: RequestInit): Promise<Response> {
|
||||
const res = await fetch(path, init);
|
||||
authenticationStateHandler?.(res.status === 401);
|
||||
if (!res.ok) throw new ApiError(await errorMessage(res), res.status);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { Pause, Play, RefreshCw } from "@lucide/vue";
|
||||
import { Pause, Play } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { loadLogs, paused } from "./state";
|
||||
import { paused } from "./state";
|
||||
|
||||
/**
|
||||
* Freeze the tail, or read the history again.
|
||||
@@ -23,9 +23,5 @@ function togglePause(): void {
|
||||
<Pause v-else data-icon="inline-start" />
|
||||
{{ paused ? "Resume" : "Pause" }}
|
||||
</Button>
|
||||
<Button variant="outline" @click="loadLogs">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -6,6 +6,7 @@ import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import router from "./router";
|
||||
import { useAppearanceStore } from "./stores/appearance";
|
||||
import { useLiveUpdatesStore } from "./stores/live-updates";
|
||||
// One stylesheet: the design tokens, and the element defaults that have no
|
||||
// component to live in (the canvas, the focus floor, the motion preference).
|
||||
// Everything else is Tailwind on the component that owns it.
|
||||
@@ -16,4 +17,5 @@ const pinia = createPinia();
|
||||
|
||||
app.use(pinia).use(router);
|
||||
useAppearanceStore(pinia).initialize();
|
||||
useLiveUpdatesStore(pinia).initialize();
|
||||
app.mount("#app");
|
||||
@@ -19,7 +19,7 @@ import { configError } from "./state";
|
||||
<EmptyTitle>{{ configError ? "Cannot reach archied" : "No configuration loaded" }}</EmptyTitle>
|
||||
<EmptyDescription v-if="configError">{{ configError }}</EmptyDescription>
|
||||
<EmptyDescription v-else>
|
||||
archied is running without a config file wired into the dashboard, so there is nothing to show.
|
||||
archied is running without a config file wired into the dashboard.
|
||||
</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Button, type ButtonVariants } from "@/components/ui/button";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
import ConfigRow from "./ConfigRow.vue";
|
||||
import type { LifecycleEntry } from "./types";
|
||||
@@ -26,7 +26,6 @@ function actionVariant(kind?: string): ButtonVariants["variant"] {
|
||||
<Empty v-if="!props.actions.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No actions reported</EmptyTitle>
|
||||
<EmptyDescription>The server did not return any operator actions.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ConfigList v-else>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import { statusKind, statusLabel } from "@/lib/task-meta";
|
||||
import ConfigList from "./ConfigList.vue";
|
||||
@@ -21,7 +21,6 @@ const props = defineProps<{ statuses: LifecycleEntry[] }>();
|
||||
<Empty v-if="!props.statuses.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No statuses reported</EmptyTitle>
|
||||
<EmptyDescription>The server did not return any lifecycle statuses.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<ConfigList v-else>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import DangerousActionsCard from "./DangerousActionsCard.vue";
|
||||
@@ -23,17 +22,13 @@ async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadDangerous()]);
|
||||
}
|
||||
|
||||
useLiveResource(null, () => void load());
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Advanced" subtitle="Identity, storage and sandboxing, and dangerous actions.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Advanced" subtitle="Identity, storage and sandboxing, and dangerous actions." />
|
||||
|
||||
<ReadOnlyNotice />
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import ModelsCard from "./ModelsCard.vue";
|
||||
import { configUnavailable, loadConfig } from "./state";
|
||||
@@ -13,17 +12,13 @@ import { configUnavailable, loadConfig } from "./state";
|
||||
* Nothing on this page is editable from the dashboard: a model role is a
|
||||
* structured field, and the server keeps those behind its own config path.
|
||||
*/
|
||||
useLiveResource(null, () => void loadConfig());
|
||||
onMounted(loadConfig);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Models" subtitle="Model roles, and the providers backing them.">
|
||||
<Button variant="outline" @click="loadConfig">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Models" subtitle="Model roles, and the providers backing them." />
|
||||
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
<ModelsCard v-else />
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import ReadOnlyNotice from "./ReadOnlyNotice.vue";
|
||||
import RepositoriesCard from "./RepositoriesCard.vue";
|
||||
@@ -12,17 +11,13 @@ import { configUnavailable, loadConfig } from "./state";
|
||||
/**
|
||||
* The repositories Archie watches, and the gate overrides each one carries.
|
||||
*/
|
||||
useLiveResource(null, () => void loadConfig());
|
||||
onMounted(loadConfig);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Repositories" subtitle="The repositories Archie polls, and their per-repo gate overrides.">
|
||||
<Button variant="outline" @click="loadConfig">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Repositories" subtitle="The repositories Archie polls, and their per-repo gate overrides." />
|
||||
|
||||
<ReadOnlyNotice />
|
||||
<ConfigUnavailable v-if="configUnavailable" />
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigNotices from "./ConfigNotices.vue";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
@@ -27,17 +26,13 @@ async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadVersion(), loadUpdate()]);
|
||||
}
|
||||
|
||||
useLiveResource("updates", () => void load());
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Status" subtitle="What archied is running with right now.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Status" subtitle="Runtime health, versions, updates, and configuration." />
|
||||
|
||||
<!-- Only the configuration projection is gated on the config read: update
|
||||
checking and the reload notices come from other endpoints, so a config
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ConfigSections from "./ConfigSections.vue";
|
||||
import ConfigUnavailable from "./ConfigUnavailable.vue";
|
||||
import LifecycleCard from "./LifecycleCard.vue";
|
||||
@@ -19,17 +18,13 @@ async function load(): Promise<void> {
|
||||
await Promise.all([loadConfig(), loadLifecycle()]);
|
||||
}
|
||||
|
||||
useLiveResource(null, () => void load());
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Task settings" subtitle="How work moves through archied, and what it is allowed to spend.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Task settings" subtitle="How work moves through archied, and what it is allowed to spend." />
|
||||
|
||||
<ReadOnlyNotice />
|
||||
<LifecycleCard />
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import SkillCard, { type Skill } from "./SkillCard.vue";
|
||||
|
||||
/** What Archie can do, in plain language. */
|
||||
@@ -27,6 +26,7 @@ async function load() {
|
||||
}
|
||||
}
|
||||
|
||||
useLiveResource("skills", () => void load());
|
||||
onMounted(load);
|
||||
|
||||
const filtered = computed(() => {
|
||||
@@ -38,12 +38,7 @@ const filtered = computed(() => {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Skills" subtitle="What Archie can do, in plain language.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Skills" subtitle="What Archie can do, in plain language." />
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
@@ -64,14 +59,13 @@ const filtered = computed(() => {
|
||||
<EmptyTitle>No skills discovered yet</EmptyTitle>
|
||||
<EmptyDescription>
|
||||
Skills live as SKILL.md files under project, shared, or user-global .agents/skills/<name>/
|
||||
directories. Add one and refresh to make it available.
|
||||
directories. Newly discovered skills appear here automatically.
|
||||
</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<Empty v-else-if="!filtered.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No skills match</EmptyTitle>
|
||||
<EmptyDescription>Nothing found for "{{ search }}".</EmptyDescription>
|
||||
<EmptyTitle>No skills match "{{ search }}"</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<SkillCard v-for="skill in filtered" v-else :key="skill.name" :skill="skill" />
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
export type LiveResource = "tasks" | "captures" | "curators" | "skills" | "updates";
|
||||
|
||||
export interface LiveEvent {
|
||||
id?: number;
|
||||
kind?: string;
|
||||
type?: string;
|
||||
task_id?: number | string;
|
||||
repo?: string;
|
||||
issue?: number | string;
|
||||
at?: string | number;
|
||||
detail?: string;
|
||||
data?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
const taskKinds = new Set([
|
||||
"stage_start",
|
||||
"stage_finish",
|
||||
"agent_finish",
|
||||
"tool_call",
|
||||
"parked",
|
||||
"outcome",
|
||||
"pr_merged",
|
||||
"pr_rejected",
|
||||
"human_approved",
|
||||
"human_rejected",
|
||||
"changes_captured",
|
||||
"config_captured",
|
||||
"work_request_submitted",
|
||||
]);
|
||||
|
||||
/** Map a durable backend event to the read projections it invalidates. */
|
||||
export function resourcesForEvent(raw: unknown): LiveResource[] {
|
||||
const event = raw as LiveEvent | null;
|
||||
const kind = event?.kind ?? "";
|
||||
const resources = new Set<LiveResource>();
|
||||
if (event?.task_id || kind.startsWith("task_") || taskKinds.has(kind)) resources.add("tasks");
|
||||
if (kind === "capture") resources.add("captures");
|
||||
if (kind.startsWith("curator_")) resources.add("curators");
|
||||
if (kind === "curator_action") resources.add("skills");
|
||||
if (kind === "update_report") resources.add("updates");
|
||||
return [...resources];
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { computed, onUnmounted, reactive, ref, watch, type ComputedRef } from "vue";
|
||||
|
||||
import { setAuthenticationStateHandler, subscribeEvents } from "@/lib/api";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import type { StreamState } from "@/lib/stream-state";
|
||||
import { resourcesForEvent, type LiveEvent, type LiveResource } from "./live-events";
|
||||
|
||||
export const useLiveUpdatesStore = defineStore("live-updates", () => {
|
||||
const streamState = ref<StreamState | "connecting">("connecting");
|
||||
const connectionRevision = ref(0);
|
||||
const authenticationRequired = ref(false);
|
||||
const activity = ref<LiveEvent[]>([]);
|
||||
const revisions = reactive<Record<LiveResource, number>>({
|
||||
tasks: 0,
|
||||
captures: 0,
|
||||
curators: 0,
|
||||
skills: 0,
|
||||
updates: 0,
|
||||
});
|
||||
let unsubscribe: (() => void) | undefined;
|
||||
|
||||
const streamKind: ComputedRef<StatusKind> = computed(() => {
|
||||
if (streamState.value === "live") return "ok";
|
||||
return streamState.value === "unavailable" ? "danger" : "warn";
|
||||
});
|
||||
|
||||
function receive(raw: unknown): void {
|
||||
const event = raw as LiveEvent;
|
||||
activity.value = [event, ...activity.value].slice(0, 50);
|
||||
for (const resource of resourcesForEvent(event)) revisions[resource] += 1;
|
||||
}
|
||||
|
||||
function initialize(): void {
|
||||
if (unsubscribe) return;
|
||||
setAuthenticationStateHandler((required) => {
|
||||
authenticationRequired.value = required;
|
||||
});
|
||||
unsubscribe = subscribeEvents(receive, (state) => {
|
||||
streamState.value = state;
|
||||
if (state === "live") connectionRevision.value += 1;
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
activity,
|
||||
authenticationRequired,
|
||||
connectionRevision,
|
||||
revisions,
|
||||
streamKind,
|
||||
streamState,
|
||||
initialize,
|
||||
receive,
|
||||
};
|
||||
});
|
||||
|
||||
/** Re-read one mounted projection when SSE says its backend resource changed. */
|
||||
export function useLiveResource(resource: LiveResource | null, load: () => void, debounceMs = 100): void {
|
||||
const live = useLiveUpdatesStore();
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
const revision = () => resource === null
|
||||
? live.connectionRevision
|
||||
: [live.revisions[resource], live.connectionRevision];
|
||||
const stop = watch(revision, () => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(load, debounceMs);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
clearTimeout(timer);
|
||||
stop();
|
||||
});
|
||||
}
|
||||
@@ -19,8 +19,6 @@ const props = defineProps<{
|
||||
attempt: number | null;
|
||||
}>();
|
||||
|
||||
defineEmits<{ retry: [] }>();
|
||||
|
||||
const event = computed(() => selectConfigEvent(props.events, props.attempt));
|
||||
|
||||
// An unrecognised schema is shown verbatim with a note rather than
|
||||
@@ -38,13 +36,12 @@ const recognised = computed(() => schema.value === CONFIG_SCHEMA);
|
||||
<PanelError
|
||||
v-else-if="events === null"
|
||||
title="Could not load this task's events"
|
||||
detail="The run configuration could not be read — retry, or check the daemon."
|
||||
@retry="$emit('retry')"
|
||||
detail="The run configuration could not be read. Live updates will try again when the daemon reconnects."
|
||||
/>
|
||||
|
||||
<Empty v-else-if="!event">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No configuration captured for attempt {{ attempt }}</EmptyTitle>
|
||||
<EmptyTitle>No configuration captured</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ const props = defineProps<{
|
||||
task: TaskRecord | null;
|
||||
}>();
|
||||
|
||||
defineEmits<{ retry: [] }>();
|
||||
|
||||
const captures = computed(() => props.state?.captures || []);
|
||||
|
||||
// A capture event WAS recorded but its payload could not be read.
|
||||
@@ -36,8 +34,7 @@ const nothingRecorded = computed(() => !props.state?.found || !captures.value.le
|
||||
<PanelError
|
||||
v-else-if="state === null"
|
||||
title="Could not load this attempt's changed files"
|
||||
detail="archied did not answer for this attempt. It may be restarting — retry, or check the daemon."
|
||||
@retry="$emit('retry')"
|
||||
detail="archied did not answer for this attempt. Live updates will try again when the daemon reconnects."
|
||||
/>
|
||||
|
||||
<Empty v-else-if="undecodable">
|
||||
|
||||
@@ -19,7 +19,6 @@ defineProps<{
|
||||
attempt: number | null;
|
||||
}>();
|
||||
|
||||
defineEmits<{ retry: [] }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -27,8 +26,7 @@ defineEmits<{ retry: [] }>();
|
||||
<PanelError
|
||||
v-else-if="state === null"
|
||||
title="Could not load the stored record"
|
||||
detail="archied did not answer for this task's debug view. It may be restarting — retry, or check the daemon."
|
||||
@retry="$emit('retry')"
|
||||
detail="archied did not answer for this task's debug view. Live updates will try again when the daemon reconnects."
|
||||
/>
|
||||
<div v-else>
|
||||
<p class="mb-3 text-sm text-fg-muted">The stored record and every event, verbatim.</p>
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
/**
|
||||
* A panel whose read failed. A failed read is reported as a failed read: it is
|
||||
* never dressed up as an empty result, which would be a claim about the run
|
||||
* that nothing here can make.
|
||||
*/
|
||||
defineProps<{ title: string; detail: string }>();
|
||||
defineEmits<{ retry: [] }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col items-start gap-2 py-3">
|
||||
<p class="font-medium">{{ title }}</p>
|
||||
<p class="max-w-[60ch] text-sm text-fg-muted">{{ detail }}</p>
|
||||
<Button variant="outline" @click="$emit('retry')">Retry</Button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -25,7 +25,6 @@ import type { AttemptsState } from "./task-run";
|
||||
* per-stage durations exist and only those are shown.
|
||||
*/
|
||||
const props = defineProps<{ state: AttemptsState | null | undefined }>();
|
||||
defineEmits<{ retry: [] }>();
|
||||
|
||||
const run = useTaskRun();
|
||||
|
||||
@@ -53,8 +52,7 @@ const startedAt = computed(() => {
|
||||
<PanelError
|
||||
v-else-if="state === null"
|
||||
title="Could not load this task's attempts"
|
||||
detail="archied did not answer for this task's run history. It may be restarting — retry, or check the daemon."
|
||||
@retry="$emit('retry')"
|
||||
detail="archied did not answer for this task's run history. Live updates will try again when the daemon reconnects."
|
||||
/>
|
||||
<template v-else>
|
||||
<Empty v-if="!attempts.length">
|
||||
@@ -88,7 +86,6 @@ const startedAt = computed(() => {
|
||||
<Empty v-else>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No stages recorded for this attempt</EmptyTitle>
|
||||
<EmptyDescription>The attempt exists, but nothing recorded a stage for it.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<p class="mt-3 max-w-[70ch] text-xs text-fg-muted">
|
||||
|
||||
@@ -49,7 +49,7 @@ const unavailable = computed(() => {
|
||||
const errorText = computed(() => {
|
||||
const err = run.retryError;
|
||||
if (!err) return "";
|
||||
if (err.kind === "session-expired") return "Your session has expired. Reload to sign in.";
|
||||
if (err.kind === "session-expired") return "Dashboard authentication is required.";
|
||||
if (err.kind === "refused") return `${err.message} — this run cannot be restarted from here.`;
|
||||
return `${err.message} — try again, or check the daemon.`;
|
||||
});
|
||||
@@ -85,4 +85,4 @@ const errorText = computed(() => {
|
||||
<Alert v-if="errorText" variant="destructive" class="mt-2">
|
||||
<AlertDescription>{{ errorText }}</AlertDescription>
|
||||
</Alert>
|
||||
</template>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ArrowLeft, RefreshCw } from "@lucide/vue";
|
||||
import { ArrowLeft } from "@lucide/vue";
|
||||
import { computed } from "vue";
|
||||
import { RouterLink } from "vue-router";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useTaskRun } from "./use-task-run";
|
||||
|
||||
/**
|
||||
* The run page's head, one strip: the task, its workflow line, and the
|
||||
* actions. Back and Refresh are page chrome; Start a new run lives here too,
|
||||
* actions. Back is page chrome; Start a new run lives here too,
|
||||
* since a restart is the page's one decision. The commit-discard consequence
|
||||
* is stated in the confirm dialog, not beside the button. The forge
|
||||
* coordinates (repo, issue, PR) sit at the row's far end: context, not
|
||||
@@ -37,10 +37,6 @@ const workflow = computed(() => (run.task?.workflow ? `${run.task.workflow} work
|
||||
Back to tasks
|
||||
</RouterLink>
|
||||
</Button>
|
||||
<Button variant="outline" @click="run.refreshAll">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
<StartNewRun compact :id="id" class="mr-auto" />
|
||||
<a
|
||||
v-if="run.task?.repo_url"
|
||||
@@ -71,4 +67,4 @@ const workflow = computed(() => (run.task?.workflow ? `${run.task.workflow} work
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -46,7 +46,7 @@ const props = withDefaults(
|
||||
},
|
||||
);
|
||||
|
||||
defineEmits<{ retry: []; filter: [next: LogFilters] }>();
|
||||
defineEmits<{ filter: [next: LogFilters] }>();
|
||||
|
||||
const resolvedAttempt = computed(() => Number(props.attempt) || Number(props.state?.attempt) || 0);
|
||||
|
||||
@@ -106,8 +106,9 @@ const download = computed(() =>
|
||||
<PanelLoading v-if="view.kind === 'loading'" label="Loading attempt log…" />
|
||||
|
||||
<div v-else-if="view.kind === 'failed'" class="flex flex-col items-start gap-2 py-3">
|
||||
<p class="text-sm text-fg-muted">Could not load this attempt's log.</p>
|
||||
<Button variant="outline" @click="$emit('retry')">Retry</Button>
|
||||
<p class="text-sm text-fg-muted">
|
||||
Could not load this attempt's log. Live updates will try again when the daemon reconnects.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Empty v-else-if="view.kind === 'nolog'">
|
||||
@@ -120,16 +121,13 @@ const download = computed(() =>
|
||||
<Empty v-else-if="view.kind === 'disabled'">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No persisted log for this attempt</EmptyTitle>
|
||||
<EmptyDescription>
|
||||
This dashboard cannot read task logs. The service that owns the log files is not reporting a log reader.
|
||||
</EmptyDescription>
|
||||
<EmptyDescription>The log service is not reporting a reader, so the file cannot be read.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
<Empty v-else-if="view.kind === 'empty'">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Nothing recorded</EmptyTitle>
|
||||
<EmptyDescription>This attempt's log has no entries matching the current filter.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
<EmptyContent v-if="download">
|
||||
<Button variant="outline" size="sm" as-child>
|
||||
|
||||
@@ -84,10 +84,11 @@ const confirmLabel = computed(() => confirmingMeta.value?.label || "Confirm");
|
||||
|
||||
// A refused action ("you can't do that" -- bad input, a conflicting task state)
|
||||
// is the operator's to correct; a broken one (5xx, network drop, timeout) is
|
||||
// the daemon's, and says so. An expired session is neither, and gets its own
|
||||
// treatment above rather than either framing.
|
||||
// the daemon's, and says so. Authentication failures are surfaced by the app
|
||||
// shell because they affect every request, not only this row.
|
||||
const errorText = computed(() => {
|
||||
if (!error.value) return "";
|
||||
if (error.value.kind === "session-expired") return "Dashboard authentication is required.";
|
||||
if (error.value.kind === "refused") return `${error.value.message} — you can't do that.`;
|
||||
return `${error.value.message} — try again, or check the daemon.`;
|
||||
});
|
||||
@@ -152,12 +153,6 @@ function requestFromMenu(id: string) {
|
||||
request(id);
|
||||
}
|
||||
|
||||
// A full reload, not a router navigation: the point is to re-establish the
|
||||
// session with whatever is in front of archied, which a client-side route
|
||||
// change would leave exactly as it was.
|
||||
function reloadPage() {
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -167,13 +162,8 @@ function reloadPage() {
|
||||
variant="destructive"
|
||||
class="w-56 gap-0.5 px-2 py-1.5 text-xs whitespace-normal"
|
||||
>
|
||||
<template v-if="error.kind === 'session-expired'">
|
||||
<AlertTitle class="text-xs">Your session has expired</AlertTitle>
|
||||
<AlertDescription class="text-xs">
|
||||
<Button size="xs" variant="outline" @click.stop="reloadPage">Reload to sign in</Button>
|
||||
</AlertDescription>
|
||||
</template>
|
||||
<AlertDescription v-else class="text-xs">{{ errorText }}</AlertDescription>
|
||||
<AlertTitle v-if="error.kind === 'session-expired'" class="text-xs">Authentication required</AlertTitle>
|
||||
<AlertDescription class="text-xs">{{ errorText }}</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { TabsContent } from "@/components/ui/tabs";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
|
||||
import AttemptConfig from "./AttemptConfig.vue";
|
||||
import ChangedFiles from "./ChangedFiles.vue";
|
||||
@@ -24,23 +24,11 @@ import { useTaskRun } from "./use-task-run";
|
||||
const props = defineProps<{ id: string }>();
|
||||
|
||||
const run = useTaskRun();
|
||||
|
||||
function retryLogs(): void {
|
||||
if (run.attemptNumber != null) run.loadLogs(run.attemptNumber, { force: true });
|
||||
}
|
||||
|
||||
function retryChanges(): void {
|
||||
if (run.attemptNumber != null) run.loadChanges(run.attemptNumber, { force: true });
|
||||
}
|
||||
|
||||
function retryDebug(): void {
|
||||
if (run.attemptNumber != null) run.loadDebug(run.attemptNumber, { force: true });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TabsContent v-for="tab in RUN_TABS" :key="tab.id" :value="tab.id">
|
||||
<StageRail v-if="tab.id === 'stages'" :state="run.attempts" @retry="run.loadAttempts" />
|
||||
<StageRail v-if="tab.id === 'stages'" :state="run.attempts" />
|
||||
|
||||
<template v-else>
|
||||
<PanelLoading v-if="run.attempts === undefined" label="Loading this task's attempts…" />
|
||||
@@ -49,15 +37,11 @@ function retryDebug(): void {
|
||||
v-else-if="run.attempts === null"
|
||||
title="Could not load this task's attempts"
|
||||
detail="The task's run history could not be read."
|
||||
@retry="run.loadAttempts"
|
||||
/>
|
||||
|
||||
<Empty v-else-if="run.attemptNumber == null">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No attempt recorded</EmptyTitle>
|
||||
<EmptyDescription>
|
||||
This task has no recorded run.
|
||||
</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
@@ -69,19 +53,17 @@ function retryDebug(): void {
|
||||
:filters="run.filters"
|
||||
:task-id="props.id"
|
||||
@filter="run.setFilters"
|
||||
@retry="retryLogs"
|
||||
/>
|
||||
|
||||
<ChangedFiles v-else-if="tab.id === 'changes'" :state="run.changesState" :task="run.task" @retry="retryChanges" />
|
||||
<ChangedFiles v-else-if="tab.id === 'changes'" :state="run.changesState" :task="run.task" />
|
||||
|
||||
<AttemptConfig
|
||||
v-else-if="tab.id === 'config'"
|
||||
:events="run.events"
|
||||
:attempt="run.attemptNumber"
|
||||
@retry="run.loadEvents"
|
||||
/>
|
||||
|
||||
<DebugView v-else-if="tab.id === 'debug'" :state="run.debugState" :attempt="run.attemptNumber" @retry="retryDebug" />
|
||||
<DebugView v-else-if="tab.id === 'debug'" :state="run.debugState" :attempt="run.attemptNumber" />
|
||||
</template>
|
||||
</TabsContent>
|
||||
</template>
|
||||
@@ -14,13 +14,12 @@ export function revealBehavior(): ScrollBehavior {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { api, subscribeEvents } from "@/lib/api";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import TaskFilters, { initialTaskFilter, taskMatchesStatus } from "./TaskFilters.vue";
|
||||
import type { Task } from "./TaskRow.vue";
|
||||
import TaskTable from "./TaskTable.vue";
|
||||
@@ -80,39 +79,6 @@ const state = computed<"loading" | "error" | "empty" | "no-match">(() => {
|
||||
return "no-match";
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
unsubscribe = subscribeEvents(handleEvent);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearTimeout(refreshTimer);
|
||||
unsubscribe?.();
|
||||
});
|
||||
|
||||
// The live stream is an invalidation signal, not data (the same rule the
|
||||
// captures page follows): every task-shaped event says the authoritative list
|
||||
// changed, and load() asks for it again. Stage progress fires several events a
|
||||
// minute, so the re-read is debounced -- 500ms trailing, so a burst of events
|
||||
// collapses into one fetch that lands after the last one.
|
||||
const REFRESH_DEBOUNCE_MS = 500;
|
||||
let refreshTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
let unsubscribe: (() => void) | undefined;
|
||||
|
||||
function handleEvent(raw: unknown): void {
|
||||
const ev = raw as { kind?: string; task_id?: number | string } | null;
|
||||
if (!ev) return;
|
||||
// Task-shaped: anything carrying a task id (stage_start, agent_finish,
|
||||
// outcome, parked, human_approved, ...) or a lifecycle kind of its own
|
||||
// (task_queued, task_retried, ...). Chat turns and log lines never re-read
|
||||
// the board.
|
||||
if (!ev.task_id && !(typeof ev.kind === "string" && ev.kind.startsWith("task_"))) return;
|
||||
clearTimeout(refreshTimer);
|
||||
refreshTimer = setTimeout(() => {
|
||||
void load();
|
||||
}, REFRESH_DEBOUNCE_MS);
|
||||
}
|
||||
|
||||
async function load() {
|
||||
error.value = null;
|
||||
try {
|
||||
@@ -123,6 +89,9 @@ async function load() {
|
||||
}
|
||||
}
|
||||
|
||||
useLiveResource("tasks", () => void load(), 500);
|
||||
onMounted(load);
|
||||
|
||||
// A filter change is a query-only route change, so it must not remount the
|
||||
// list: the table keeps its identity and only its rows move. An empty status is
|
||||
// dropped from the query rather than written as `?status=`.
|
||||
@@ -168,22 +137,16 @@ async function reveal(id: number) {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="mb-5 flex flex-wrap items-start justify-between gap-5">
|
||||
<div class="mb-5">
|
||||
<div>
|
||||
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Tasks</h1>
|
||||
<p class="text-fg-muted mt-2 text-sm">Every issue archied has picked up, and where it stands.</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<Button @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Card v-if="error">
|
||||
<CardContent>
|
||||
<TasksState kind="error" :detail="error" @retry="load" />
|
||||
<TasksState kind="error" :detail="error" />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -210,7 +173,7 @@ async function reveal(id: number) {
|
||||
-->
|
||||
<TaskTable :tasks="visible" :show-repo="showRepo" @done="load">
|
||||
<template #state>
|
||||
<TasksState :kind="state" @retry="load" @clear="clearFilters" />
|
||||
<TasksState :kind="state" @clear="clearFilters" />
|
||||
</template>
|
||||
</TaskTable>
|
||||
</CardContent>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -15,7 +14,7 @@ type StateKind = "loading" | "error" | "empty" | "no-match";
|
||||
|
||||
const props = defineProps<{ kind: StateKind; detail?: string | null }>();
|
||||
|
||||
const emit = defineEmits<{ retry: []; clear: [] }>();
|
||||
const emit = defineEmits<{ clear: [] }>();
|
||||
|
||||
const copy = computed(() => {
|
||||
if (props.kind === "error") {
|
||||
@@ -44,12 +43,8 @@ const copy = computed(() => {
|
||||
<EmptyTitle>{{ copy.title }}</EmptyTitle>
|
||||
<EmptyDescription>{{ copy.description }}</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
<EmptyContent v-if="props.kind !== 'empty'">
|
||||
<Button v-if="props.kind === 'error'" variant="outline" size="sm" @click="emit('retry')">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Retry
|
||||
</Button>
|
||||
<Button v-else variant="ghost" size="sm" @click="emit('clear')">Clear filters</Button>
|
||||
<EmptyContent v-if="props.kind === 'no-match'">
|
||||
<Button variant="ghost" size="sm" @click="emit('clear')">Clear filters</Button>
|
||||
</EmptyContent>
|
||||
</Empty>
|
||||
</template>
|
||||
@@ -15,6 +15,7 @@ import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { api, classifyActionError, type ActionErrorKind } from "@/lib/api";
|
||||
import { actionFor } from "@/lib/task-meta";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
|
||||
import {
|
||||
attemptKey,
|
||||
@@ -250,6 +251,8 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
|
||||
refreshToken.value += 1;
|
||||
}
|
||||
|
||||
useLiveResource("tasks", refreshAll, 500);
|
||||
|
||||
async function performRetry(): Promise<void> {
|
||||
if (id.value == null) return;
|
||||
retryError.value = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import SlowestStagesCard from "./SlowestStagesCard.vue";
|
||||
import StageFailuresCard from "./StageFailuresCard.vue";
|
||||
import type { StageStats } from "./stages";
|
||||
@@ -28,7 +28,6 @@ const props = defineProps<{ stages: StageStats[] }>();
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No stage data yet</EmptyTitle>
|
||||
<EmptyDescription>Stage timing and failures appear here once workflows have run.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</CardContent>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshCw } from "@lucide/vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import StartWorkForm from "./StartWorkForm.vue";
|
||||
import type { StageStats } from "./stages";
|
||||
import StagesSection from "./StagesSection.vue";
|
||||
@@ -38,17 +37,13 @@ async function load() {
|
||||
}
|
||||
}
|
||||
|
||||
useLiveResource("tasks", () => void load(), 500);
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Workflows" subtitle="Run outcomes and spend per workflow, and where stages get stuck.">
|
||||
<Button variant="outline" @click="load">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<PageHeader title="Workflows" subtitle="Run outcomes and spend per workflow, and where stages get stuck." />
|
||||
|
||||
<!-- Starting work needs a definition to start: with none served, the form
|
||||
could only be submitted to fail. -->
|
||||
|
||||
Reference in new issue
Block a user