feat(ui,api,admin): sveltekit admin spa, usage by day/agent/conversation/model, rate limits, memory tree, turn snapshot

This commit is contained in:
hh
2026-08-28 22:14:15 +02:00
parent 61562e947d
commit 98796a82c6
158 changed files with 8459 additions and 2531 deletions
+52
View File
@@ -0,0 +1,52 @@
<script lang="ts">
import { onMount } from "svelte";
import type { ApiClient } from "$lib/api/client";
import EmptyState from "$lib/components/empty-state.svelte";
import type { ActivityModel } from "./activity.svelte";
import QuestionCard from "./question-card.svelte";
import TurnCard from "./turn-card.svelte";
let {
model,
client,
conversationId,
connected,
}: {
model: ActivityModel;
client: ApiClient;
conversationId: string;
connected: boolean;
} = $props();
let now = $state(Date.now());
const TICK_MS = 1000;
onMount(() => {
const timer = setInterval(() => {
if (model.running) {
now = Date.now();
}
}, TICK_MS);
return () => clearInterval(timer);
});
</script>
<div class="flex flex-col gap-3">
{#if model.question}
<QuestionCard {client} {conversationId} question={model.question} />
{/if}
{#if model.turns.length === 0}
<EmptyState
hint={connected
? "Live turns, tool calls and subagents land here the moment the agent moves; earlier turns are under History."
: "Connecting to the event stream…"}
title="Nothing live right now"
/>
{:else}
<div class="flex flex-col">
{#each model.turns as turn (turn.id)}
<TurnCard {now} {turn} />
{/each}
</div>
{/if}
</div>