@leitwerk-dev/ui 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ApiTokensPage-DCmYvZdE.js +1 -0
- package/dist/assets/ChronicleMarkdown-CDe1jngc.js +1 -0
- package/dist/assets/DashboardPage-BRxe3uuy.css +1 -0
- package/dist/assets/DashboardPage-LiQ0_72g.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-DvyW_J5d.js +1 -0
- package/dist/assets/GenericLauncher-D1qQy9hq.js +4 -0
- package/dist/assets/GenericLauncher-DRUMMTd7.css +1 -0
- package/dist/assets/HomePage-Cnmp6osB.js +1 -0
- package/dist/assets/ProcessActionsMenu-DEQynjFa.js +1 -0
- package/dist/assets/ProcessDetailPage-DvjQQTDj.js +14 -0
- package/dist/assets/ProcessDetailPage-km76G8wj.css +1 -0
- package/dist/assets/ProcessFlowDiagram-DI5KZ2Qj.js +1 -0
- package/dist/assets/ProcessFlowDiagram-NQ6oEZi7.css +1 -0
- package/dist/assets/ProcessesPage-B4BMXJT7.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-2eJ0jBQ-.css +1 -0
- package/dist/assets/ScheduleDateTimePicker-fg0Vau5Z.js +3 -0
- package/dist/assets/SettingsPage-BHSV4rl7.css +1 -0
- package/dist/assets/SettingsPage-w1RHZ2l6.js +2 -0
- package/dist/assets/SkillsPage-Ber36rAD.js +2 -0
- package/dist/assets/WatchersPage-Btq_SIk3.js +1 -0
- package/dist/assets/WikiPage-BjncVYf1.js +1 -0
- package/dist/assets/WikiPage-Bvnhxl3m.css +1 -0
- package/dist/assets/http-client-Cvi3zOou.js +2 -0
- package/dist/assets/http-contracts-public-BUgTIHYG.js +1 -0
- package/dist/assets/index-Dz0T5gKc.js +21 -0
- package/dist/assets/index-DzKWCM-z.css +1 -0
- package/dist/assets/{index-client-BYQviCtQ.js → index-client-BSAA7n1a.js} +2 -2
- package/dist/assets/mermaid-render.worker-BN0bcvGc.js +6398 -0
- package/dist/assets/retry-config.svelte-HNNF65qc.js +1 -0
- package/dist/assets/settings-Dk5UoSQa.js +1 -0
- package/dist/index.html +4 -7
- package/package.json +10 -9
- package/src/App.svelte +9 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +10 -2
- package/src/chronicle/components/ChronicleEntryHeader.svelte +4 -16
- package/src/chronicle/components/ChronicleFlow.svelte +24 -6
- package/src/chronicle/components/ChronicleLiveTail.svelte +52 -24
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +14 -0
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +1 -1
- package/src/chronicle/components/ChronicleRecoverySection.svelte +14 -10
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +22 -10
- package/src/chronicle/components/ChronicleThinkingSection.svelte +8 -2
- package/src/chronicle/components/ChronicleToolApproval.svelte +120 -17
- package/src/chronicle/components/ChronicleToolCallItem.svelte +32 -6
- package/src/chronicle/components/ChronicleTurnCluster.svelte +6 -6
- package/src/chronicle/components/ChronicleTurnProgress.svelte +10 -4
- package/src/chronicle/components/ChronicleTurnRail.svelte +1 -0
- package/src/chronicle/components/RecoveryModelControl.svelte +14 -13
- package/src/chronicle/lib/chronicle-projection.ts +74 -376
- package/src/chronicle/lib/chronicle-selectable-items.ts +23 -3
- package/src/chronicle/lib/recovery-model.ts +17 -0
- package/src/components/ConversationTreeDiagram.svelte +93 -30
- package/src/components/FormFieldRenderer.svelte +184 -27
- package/src/components/GenericLauncher.svelte +438 -259
- package/src/components/NamedSelectionList.svelte +77 -0
- package/src/components/ProcessActionsMenu.svelte +37 -59
- package/src/components/ProcessSettings.svelte +110 -0
- package/src/components/ScheduleDateTimePicker.svelte +9 -4
- package/src/components/SettingsField.svelte +317 -0
- package/src/components/SettingsOverview.svelte +237 -0
- package/src/components/SkillSelector.svelte +15 -3
- package/src/components/launcher-form-copy.ts +2 -1
- package/src/components/launcher-model-config.ts +8 -7
- package/src/components/launcher-selections.ts +123 -0
- package/src/lib/api.ts +100 -43
- package/src/lib/dashboard-refresh.ts +47 -0
- package/src/lib/http-client.ts +20 -1
- package/src/lib/instance-tree-layout.ts +41 -10
- package/src/lib/primary-path-detail.ts +56 -341
- package/src/lib/primary-path-replay.ts +8 -9
- package/src/lib/process-history.ts +57 -0
- package/src/lib/processes.svelte.ts +71 -79
- package/src/lib/reasoning-history.ts +31 -23
- package/src/lib/router-logic.ts +127 -56
- package/src/lib/router.svelte.ts +10 -6
- package/src/lib/settings.ts +114 -0
- package/src/lib/wiki.ts +34 -0
- package/src/pages/DashboardPage.svelte +194 -0
- package/src/pages/FutureLaunchDetailPage.svelte +2 -2
- package/src/pages/HomePage.svelte +4 -4
- package/src/pages/ProcessDetailPage.svelte +55 -344
- package/src/pages/ProcessFlowDiagram.svelte +39 -684
- package/src/pages/SettingsPage.svelte +265 -0
- package/src/pages/SkillsPage.svelte +26 -12
- package/src/pages/WikiPage.svelte +9 -0
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +57 -13
- package/src/pages/process-detail/ProcessDetailHeader.svelte +9 -3
- package/src/pages/process-detail/TicketCreationComposer.svelte +49 -10
- package/src/pages/process-detail/inspector/ExecutionDetails.svelte +210 -0
- package/src/pages/process-detail/inspector/InspectionEvidence.svelte +48 -0
- package/src/pages/process-detail/inspector/InspectionMessage.svelte +71 -0
- package/src/pages/process-detail/inspector/ProcessInspector.svelte +144 -0
- package/src/pages/process-detail/inspector/ProcessModelEditor.svelte +161 -0
- package/src/pages/process-detail/inspector/ProcessReference.svelte +166 -0
- package/src/pages/process-detail/inspector/inspection-activity.ts +118 -0
- package/src/pages/process-detail/inspector/inspection-data.svelte.ts +107 -0
- package/src/pages/process-detail/inspector/inspection-tool-call.ts +30 -0
- package/src/pages/process-detail/inspector/inspector-navigation.ts +190 -0
- package/src/pages/process-detail/inspector/model-source-label.ts +17 -0
- package/src/pages/process-detail/process-detail-actions.svelte.ts +10 -0
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +18 -2
- package/src/pages/process-detail/process-detail-view-model.ts +2 -2
- package/src/shell/AppShell.svelte +55 -56
- package/src/shell/Sidebar.svelte +136 -232
- package/src/test-support/mount.ts +34 -0
- package/src/test-support/wait.ts +19 -0
- package/dist/assets/ApiTokensPage-ClJp9PYr.js +0 -1
- package/dist/assets/ChronicleMarkdown-lqwX9Ywa.js +0 -16
- package/dist/assets/FutureLaunchDetailPage-ygp-IdXC.js +0 -1
- package/dist/assets/GenericLauncher-CExW6wei.css +0 -1
- package/dist/assets/GenericLauncher-DOwsERpB.js +0 -1
- package/dist/assets/HomePage-D1J-Rmsw.js +0 -1
- package/dist/assets/PageHeader-DPuQInDo.css +0 -1
- package/dist/assets/PageHeader-sphJnWL1.js +0 -1
- package/dist/assets/ProcessActionsMenu-DV9zaxNS.js +0 -1
- package/dist/assets/ProcessDetailPage-BW1M2IH8.js +0 -14
- package/dist/assets/ProcessDetailPage-Cth6A0DN.css +0 -1
- package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +0 -1
- package/dist/assets/ProcessFlowDiagram-Dx2wheGN.js +0 -2
- package/dist/assets/ProcessesPage-CSPH5L7E.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-DmojMRxN.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-uacJAkIq.css +0 -1
- package/dist/assets/SkillsPage-KnLql0n1.js +0 -2
- package/dist/assets/WatchersPage-B4jf3Ywp.js +0 -1
- package/dist/assets/http-client-VpPXJwbR.js +0 -2
- package/dist/assets/index-DPCokDbS.js +0 -6
- package/dist/assets/index-DtEI5gsQ.css +0 -1
- package/dist/assets/mermaid-render.worker-QW2WZpEE.js +0 -6393
- package/dist/assets/process-terminal-display-BQRQwGod.js +0 -1
- package/dist/assets/router.svelte-EEldxHlO.js +0 -1
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +0 -855
- package/src/components/ProcessInfoOverlay.svelte +0 -1221
- package/src/lib/flow-layout.ts +0 -319
- package/src/pages/process-detail/OverlayFrame.svelte +0 -58
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { ScopedSettingsSnapshot, SettingsContext } from "@leitwerk-dev/domain";
|
|
2
|
+
import type {
|
|
3
|
+
SettingChoice,
|
|
4
|
+
SettingsOverviewResponse,
|
|
5
|
+
SettingsPreview,
|
|
6
|
+
SettingsScopesResponse,
|
|
7
|
+
} from "@leitwerk-dev/protocol/http-contracts";
|
|
8
|
+
import { on } from "svelte/events";
|
|
9
|
+
import { apiResponseError, jsonRequestInit, requestJson } from "./http-client.js";
|
|
10
|
+
|
|
11
|
+
export function onSettingsChanged(refresh: () => void, refreshOnFocus = false) {
|
|
12
|
+
const unsubscribe = on(window, "leitwerk:settings-changed", refresh);
|
|
13
|
+
const unfocus = refreshOnFocus ? on(window, "focus", refresh) : undefined;
|
|
14
|
+
return () => {
|
|
15
|
+
unsubscribe();
|
|
16
|
+
unfocus?.();
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { ApiResponseError as SettingsRequestError } from "./http-client.js";
|
|
21
|
+
|
|
22
|
+
// Fastify supplies a status title in error and the actionable detail in message.
|
|
23
|
+
const settingsError = (fallback: string) => apiResponseError(fallback, true);
|
|
24
|
+
|
|
25
|
+
export interface SettingsChange {
|
|
26
|
+
subjectId: string;
|
|
27
|
+
key: string;
|
|
28
|
+
value: unknown;
|
|
29
|
+
mode: "replace";
|
|
30
|
+
reset: boolean;
|
|
31
|
+
expectedRevision: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function fetchSettingsScopes(refresh = false) {
|
|
35
|
+
return requestJson<SettingsScopesResponse>({
|
|
36
|
+
path: `/api/settings/scopes${refresh ? "/refresh" : ""}`,
|
|
37
|
+
...(refresh ? { init: jsonRequestInit("POST", {}) } : {}),
|
|
38
|
+
malformed: "Could not read settings scopes",
|
|
39
|
+
error: settingsError("Could not load settings scopes"),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function fetchSettingsPreview(subjectId: string) {
|
|
43
|
+
return requestJson<SettingsPreview>({
|
|
44
|
+
path: `/api/settings/preview?subjectId=${encodeURIComponent(subjectId)}`,
|
|
45
|
+
malformed: "Could not read settings",
|
|
46
|
+
error: settingsError("Could not load settings"),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function fetchSettingsOverview(scopeType: string) {
|
|
50
|
+
return requestJson<SettingsOverviewResponse>({
|
|
51
|
+
path: `/api/settings/overview?${new URLSearchParams({ scopeType })}`,
|
|
52
|
+
malformed: "Could not read settings overview",
|
|
53
|
+
error: settingsError("Could not load settings overview"),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function fetchSettingsChoices(
|
|
57
|
+
subjectId: string,
|
|
58
|
+
key: string,
|
|
59
|
+
search = "",
|
|
60
|
+
signal?: AbortSignal,
|
|
61
|
+
) {
|
|
62
|
+
return requestJson<{ choices: SettingChoice[] }>({
|
|
63
|
+
path: `/api/settings/choices?${new URLSearchParams({ subjectId, key, search })}`,
|
|
64
|
+
init: { signal },
|
|
65
|
+
malformed: "Could not read options",
|
|
66
|
+
error: settingsError("Could not load options. Try again or refine your search."),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export function changeSettings(change: SettingsChange, preview = false) {
|
|
70
|
+
return requestJson<SettingsPreview>({
|
|
71
|
+
path: `/api/settings/${preview ? "preview" : "overrides"}`,
|
|
72
|
+
init: jsonRequestInit(preview ? "POST" : "PUT", change),
|
|
73
|
+
malformed: "Could not read settings",
|
|
74
|
+
error: settingsError(preview ? "Could not preview setting" : "Could not save setting"),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export interface ProcessSettingsView {
|
|
78
|
+
primaryRepositoryKey: string | null;
|
|
79
|
+
future: Array<{ turnId: string; settings: ScopedSettingsSnapshot | null; error: string | null }>;
|
|
80
|
+
context: SettingsContext;
|
|
81
|
+
explanations: string[];
|
|
82
|
+
repositories: Array<{ key: string; subjectId: string; label: string }>;
|
|
83
|
+
captured: Array<{
|
|
84
|
+
startRecordId: string;
|
|
85
|
+
turnId: string;
|
|
86
|
+
createdAt: string;
|
|
87
|
+
state: string;
|
|
88
|
+
settings: ScopedSettingsSnapshot;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
export function fetchProcessSettings(instanceId: string) {
|
|
92
|
+
return requestJson<ProcessSettingsView>({
|
|
93
|
+
path: `/api/settings/processes/${encodeURIComponent(instanceId)}`,
|
|
94
|
+
malformed: "Could not read process settings",
|
|
95
|
+
error: settingsError("Could not load process settings"),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function settingsPath(subjectId = "instance") {
|
|
100
|
+
return `/settings?scope=${encodeURIComponent(subjectId)}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function bindPrimaryRepository(
|
|
104
|
+
instanceId: string,
|
|
105
|
+
primaryRepositoryKey: string | null,
|
|
106
|
+
expectedPrimaryRepositoryKey: string | null,
|
|
107
|
+
) {
|
|
108
|
+
return requestJson<{ primaryRepositoryKey: string | null }>({
|
|
109
|
+
path: `/api/settings/processes/${encodeURIComponent(instanceId)}/primary-repository`,
|
|
110
|
+
init: jsonRequestInit("PUT", { primaryRepositoryKey, expectedPrimaryRepositoryKey }),
|
|
111
|
+
malformed: "Could not read primary repository",
|
|
112
|
+
error: settingsError("Could not bind primary repository"),
|
|
113
|
+
});
|
|
114
|
+
}
|
package/src/lib/wiki.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createWikiClient, type WikiUiHost } from "@leitwerk-dev/wiki/ui";
|
|
2
|
+
import ExternalLink from "../components/ExternalLink.svelte";
|
|
3
|
+
import PageHeader from "../components/PageHeader.svelte";
|
|
4
|
+
import { ApiResponseError, apiResponseError, requestJson } from "./http-client.js";
|
|
5
|
+
import { renderMarkdownToHtml } from "./markdown.js";
|
|
6
|
+
import { followLink, navigate } from "./router.svelte.js";
|
|
7
|
+
|
|
8
|
+
/** @internal */
|
|
9
|
+
export function notifyWikiUpdated(topicId: string): void {
|
|
10
|
+
window.dispatchEvent(new CustomEvent("leitwerk:wiki-updated", { detail: { topicId } }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
export function onWikiUpdated(listener: (topicId: string) => void): () => void {
|
|
15
|
+
const handler = (event: Event) =>
|
|
16
|
+
listener((event as CustomEvent<{ topicId: string }>).detail.topicId);
|
|
17
|
+
window.addEventListener("leitwerk:wiki-updated", handler);
|
|
18
|
+
return () => window.removeEventListener("leitwerk:wiki-updated", handler);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const client = createWikiClient((input) =>
|
|
22
|
+
requestJson({ ...input, error: apiResponseError(input.error) }),
|
|
23
|
+
);
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const wikiUiHost: WikiUiHost = {
|
|
26
|
+
client,
|
|
27
|
+
renderMarkdownToHtml,
|
|
28
|
+
followLink,
|
|
29
|
+
navigate,
|
|
30
|
+
onWikiUpdated,
|
|
31
|
+
PageHeader,
|
|
32
|
+
ExternalLink,
|
|
33
|
+
errorStatus: (error) => (error instanceof ApiResponseError ? error.status : undefined),
|
|
34
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
import PageHeader from "../components/PageHeader.svelte";
|
|
4
|
+
import { fetchDashboard } from "../lib/api.js";
|
|
5
|
+
import { createDashboardRefresh, type DashboardLoadState } from "../lib/dashboard-refresh.js";
|
|
6
|
+
import {
|
|
7
|
+
buildCreateProcessPath,
|
|
8
|
+
buildProcessesPath,
|
|
9
|
+
buildSkillsPath,
|
|
10
|
+
buildWatchersPath,
|
|
11
|
+
followLink,
|
|
12
|
+
} from "../lib/router.svelte.js";
|
|
13
|
+
import { wsStore } from "../lib/ws.svelte.js";
|
|
14
|
+
|
|
15
|
+
let snapshot = $state<DashboardLoadState>({ data: null, loading: true, error: null });
|
|
16
|
+
const loader = createDashboardRefresh(fetchDashboard, (state) => {
|
|
17
|
+
snapshot = state;
|
|
18
|
+
});
|
|
19
|
+
let grouping = $state<"status" | "definition">("status");
|
|
20
|
+
let allModels = $state(false);
|
|
21
|
+
let allIssues = $state(false);
|
|
22
|
+
const data = $derived(snapshot.data);
|
|
23
|
+
const definitions = $derived(data?.definitions.items ?? []);
|
|
24
|
+
const watchers = $derived(data?.watchers.items ?? []);
|
|
25
|
+
const rankedDefinitions = $derived(data?.processes.byDefinition ?? []);
|
|
26
|
+
const processMaximum = $derived(Math.max(1, ...rankedDefinitions.map((item) => item.count)));
|
|
27
|
+
const modelMaximum = $derived(
|
|
28
|
+
Math.max(0, ...(data?.costs.byModel.map((item) => item.costUsd) ?? [])),
|
|
29
|
+
);
|
|
30
|
+
const usd = new Intl.NumberFormat("en-US", {
|
|
31
|
+
style: "currency",
|
|
32
|
+
currency: "USD",
|
|
33
|
+
minimumFractionDigits: 2,
|
|
34
|
+
maximumFractionDigits: 4,
|
|
35
|
+
});
|
|
36
|
+
function statusLabel(status: string) {
|
|
37
|
+
return status.charAt(0).toUpperCase() + status.slice(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
onMount(() => {
|
|
41
|
+
void loader.refresh();
|
|
42
|
+
let reconnectCount: number | null = null;
|
|
43
|
+
const unsubscribe = wsStore.subscribe((connection) => {
|
|
44
|
+
if (reconnectCount !== null && connection.reconnectCount > reconnectCount)
|
|
45
|
+
void loader.refresh();
|
|
46
|
+
reconnectCount = connection.reconnectCount;
|
|
47
|
+
});
|
|
48
|
+
const visible = () => {
|
|
49
|
+
if (document.visibilityState === "visible") void loader.refresh();
|
|
50
|
+
};
|
|
51
|
+
document.addEventListener("visibilitychange", visible);
|
|
52
|
+
const timer = setInterval(visible, 30_000);
|
|
53
|
+
return () => {
|
|
54
|
+
clearInterval(timer);
|
|
55
|
+
document.removeEventListener("visibilitychange", visible);
|
|
56
|
+
unsubscribe();
|
|
57
|
+
loader.dispose();
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<div class="dashboard" data-page="dashboard">
|
|
63
|
+
<PageHeader title="Dashboard" subtitle="An overview of your processes, resources, and model readiness.">
|
|
64
|
+
{#snippet actions()}
|
|
65
|
+
<a class="ui-button" data-variant="primary" href={buildCreateProcessPath()} onclick={(event) => followLink(event, buildCreateProcessPath())}>Start a process</a>
|
|
66
|
+
<button type="button" class="ui-button" disabled={snapshot.loading} onclick={() => void loader.refresh()}>{snapshot.loading ? "Refreshing…" : "Refresh"}</button>
|
|
67
|
+
{/snippet}
|
|
68
|
+
</PageHeader>
|
|
69
|
+
{#if snapshot.error}
|
|
70
|
+
<div class="refresh-error" role="alert"><p>{snapshot.error} {data ? "Showing the last loaded overview." : ""}</p><button type="button" class="ui-button" disabled={snapshot.loading} onclick={() => void loader.refresh()}>Retry</button></div>
|
|
71
|
+
{/if}
|
|
72
|
+
{#if !data}
|
|
73
|
+
{#if snapshot.loading}<p role="status" class="empty">Loading dashboard…</p>{/if}
|
|
74
|
+
{:else}
|
|
75
|
+
<div class="catalogs">
|
|
76
|
+
<a class="catalog" href={buildCreateProcessPath()} onclick={(event) => followLink(event, buildCreateProcessPath())}>
|
|
77
|
+
<h2>Process definitions <span class="count">{data.definitions.total}</span></h2>
|
|
78
|
+
{#if definitions.length}<ul>{#each definitions.slice(0, 3) as item (item.id)}<li>{item.name}</li>{/each}</ul>{:else}<p>No process definitions loaded.</p>{/if}
|
|
79
|
+
{#if data.definitions.total > 3}<p class="more">+{data.definitions.total - 3} more</p>{/if}
|
|
80
|
+
</a>
|
|
81
|
+
<a class="catalog" href={buildWatchersPath()} onclick={(event) => followLink(event, buildWatchersPath())}>
|
|
82
|
+
<h2>Watchers <span class="count">{data.watchers.total}</span></h2><p>{data.watchers.enabled} enabled</p>
|
|
83
|
+
{#if watchers.length}<ul>{#each watchers.slice(0, 3) as item (item.id)}<li>{item.name}</li>{/each}</ul>{:else}<p>No watchers registered.</p>{/if}
|
|
84
|
+
{#if data.watchers.total > 3}<p class="more">+{data.watchers.total - 3} more</p>{/if}
|
|
85
|
+
</a>
|
|
86
|
+
<a class="catalog" href={buildSkillsPath()} onclick={(event) => followLink(event, buildSkillsPath())}>
|
|
87
|
+
<h2>Skills <span class="count">{data.skills.total}</span></h2>
|
|
88
|
+
<dl class="skill-totals"><div><dt>Installed</dt><dd>{data.skills.installed}</dd></div><div><dt>Bundled</dt><dd>{data.skills.bundled}</dd></div></dl>
|
|
89
|
+
{#if !data.skills.total}<p>No skills available.</p>{/if}
|
|
90
|
+
</a>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="overview">
|
|
93
|
+
<section class="panel" aria-labelledby="dashboard-processes">
|
|
94
|
+
<header class="panel-header"><h2 id="dashboard-processes">Processes <span class="count">{data.processes.total}</span></h2><a href={buildProcessesPath()} onclick={(event) => followLink(event, buildProcessesPath())}>View processes</a></header>
|
|
95
|
+
<p class="muted">All retained process instances</p>
|
|
96
|
+
<div class="grouping" role="group" aria-label="Group processes"><button type="button" aria-pressed={grouping === "status"} onclick={() => { grouping = "status"; }}>By status</button><button type="button" aria-pressed={grouping === "definition"} onclick={() => { grouping = "definition"; }}>By definition</button></div>
|
|
97
|
+
{#if data.processes.total === 0}<p class="empty">No processes yet. Start a process to see its progress here.</p>
|
|
98
|
+
{:else if grouping === "status"}
|
|
99
|
+
<div class="status-bar" aria-hidden="true">{#each data.processes.byStatus.filter((item) => item.count > 0) as item (item.status)}<span data-status={item.status} style:flex-grow={item.count}></span>{/each}</div>
|
|
100
|
+
<dl class="status-list">{#each data.processes.byStatus as item (item.status)}<div><dt><span class="status-dot" data-status={item.status} aria-hidden="true"></span>{statusLabel(item.status)}</dt><dd>{item.count}</dd></div>{/each}</dl>
|
|
101
|
+
{:else}
|
|
102
|
+
<ul class="ranked">{#each rankedDefinitions as item (item.processId)}<li><div class="row-label"><span>{item.name}</span><strong>{item.count}</strong></div><div class="track" aria-hidden="true"><span style:width={`${(item.count / processMaximum) * 100}%`}></span></div></li>{/each}</ul>
|
|
103
|
+
{/if}
|
|
104
|
+
</section>
|
|
105
|
+
<section class="panel" aria-labelledby="dashboard-costs">
|
|
106
|
+
<header class="panel-header"><h2 id="dashboard-costs">LLM costs</h2><span class="muted">All time · estimated USD</span></header>
|
|
107
|
+
{#if data.costs.totalLlmTurnCount === 0}<p class="empty">No LLM usage recorded yet.</p>
|
|
108
|
+
{:else if data.costs.totalUsd === null}<p class="empty">Cost unavailable. Recorded LLM turns have no cost information.</p>
|
|
109
|
+
{:else}
|
|
110
|
+
<p class="cost-total">{usd.format(data.costs.totalUsd)}</p>
|
|
111
|
+
{#if data.costs.totalUsd === 0}<p class="muted">Recorded usage has zero estimated cost.</p>{/if}
|
|
112
|
+
{#if data.costs.isPartial}<p class="coverage">Partial coverage: {data.costs.pricedTurnCount} of {data.costs.totalLlmTurnCount} LLM turns include cost. {data.costs.missingCostTurnCount} have no recorded cost.</p>{/if}
|
|
113
|
+
<ul class="cost-list">{#each data.costs.byModel.slice(0, allModels ? undefined : 5) as model}<li><div class="cost-row"><div><span>{model.modelId ?? "Unknown model"}</span><small>{model.providerId ?? "Unknown provider"} · {model.turnCount} {model.turnCount === 1 ? "priced turn" : "priced turns"}</small></div><strong>{usd.format(model.costUsd)}</strong></div><div class="track cost-track" aria-hidden="true"><span style:width={`${modelMaximum > 0 ? (model.costUsd / modelMaximum) * 100 : 0}%`}></span></div></li>{/each}</ul>
|
|
114
|
+
{#if data.costs.byModel.length > 5}<button type="button" class="text-button" aria-expanded={allModels} onclick={() => { allModels = !allModels; }}>{allModels ? "Show fewer models" : `Show all ${data.costs.byModel.length} models`}</button>{/if}
|
|
115
|
+
{/if}
|
|
116
|
+
</section>
|
|
117
|
+
</div>
|
|
118
|
+
<section class="panel configuration" aria-labelledby="dashboard-configuration">
|
|
119
|
+
<header class="panel-header"><h2 id="dashboard-configuration">Configuration issues</h2>{#if data.configuration.issues.length}<span class="muted">{data.configuration.issues.length} {data.configuration.issues.length === 1 ? "issue" : "issues"}</span>{/if}</header>
|
|
120
|
+
{#if !data.configuration.issues.length}<p class="healthy">No model readiness issues detected.</p>
|
|
121
|
+
{:else}
|
|
122
|
+
<ul class="issues">{#each data.configuration.issues.slice(0, allIssues ? undefined : 3) as issue (issue.id)}<li><span class="severity" data-severity={issue.severity}>{statusLabel(issue.severity)}</span><div><p>{issue.message}</p><div class="sources">{#each issue.sources as source}{#if source.href}<a href={source.href} onclick={(event) => followLink(event, source.href ?? "/")}>{source.label}</a>{:else}<span>{source.label}</span>{/if}{/each}</div></div></li>{/each}</ul>
|
|
123
|
+
{#if data.configuration.issues.length > 3}<button type="button" class="text-button" aria-expanded={allIssues} onclick={() => { allIssues = !allIssues; }}>{allIssues ? "Show fewer issues" : `Show all ${data.configuration.issues.length} issues`}</button>{/if}
|
|
124
|
+
{/if}
|
|
125
|
+
</section>
|
|
126
|
+
<p class="updated">Updated <time datetime={data.generatedAt}>{new Date(data.generatedAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}</time></p>
|
|
127
|
+
{/if}
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<style>
|
|
131
|
+
.dashboard { display: grid; gap: var(--space-lg); min-width: 0; padding: var(--space-2xs) 2px var(--space-xl); color: var(--chronicle-text); font-size: var(--type-body); }
|
|
132
|
+
.catalogs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
|
|
133
|
+
.catalog { display: block; padding: var(--space-md) var(--space-lg); border-radius: 14px; background: var(--chronicle-panel-muted); color: inherit; text-decoration: none; transition: background 150ms ease-out; }
|
|
134
|
+
.catalog:hover { background: var(--chronicle-accent-soft); }
|
|
135
|
+
h2 { margin: 0; font-size: var(--type-title-sm); font-weight: 650; line-height: 1.35; }
|
|
136
|
+
.count { margin-left: var(--space-xs); color: var(--chronicle-text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
137
|
+
p { margin: var(--space-xs) 0 0; line-height: 1.55; }
|
|
138
|
+
.catalog p, .muted, .updated, small { color: var(--chronicle-text-muted); font-size: var(--type-body-sm); }
|
|
139
|
+
ul { list-style: none; padding: 0; margin: var(--space-sm) 0 0; }
|
|
140
|
+
.catalog li { overflow-wrap: anywhere; line-height: 1.6; }
|
|
141
|
+
.more { color: var(--chronicle-accent); }
|
|
142
|
+
.skill-totals { margin: var(--space-sm) 0 0; display: grid; gap: var(--space-xs); }
|
|
143
|
+
.skill-totals div, .status-list div { display: flex; justify-content: space-between; gap: var(--space-md); }
|
|
144
|
+
dd { margin: 0; font-variant-numeric: tabular-nums; }
|
|
145
|
+
.overview { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-lg); }
|
|
146
|
+
.panel { min-width: 0; padding: var(--space-lg); border: 1px solid var(--chronicle-border); border-radius: 14px; }
|
|
147
|
+
.panel-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); }
|
|
148
|
+
a:not(.ui-button):not(.catalog), .text-button { color: var(--chronicle-accent); text-underline-offset: 3px; }
|
|
149
|
+
a:focus-visible, button:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 4px; }
|
|
150
|
+
.grouping { display: inline-flex; flex-wrap: wrap; margin-top: var(--space-lg); padding: 3px; gap: 3px; background: var(--chronicle-panel-muted); border-radius: 10px; }
|
|
151
|
+
.grouping button { border: 0; border-radius: 7px; padding: 8px 12px; background: transparent; color: var(--chronicle-text-muted); font: inherit; cursor: pointer; }
|
|
152
|
+
.grouping button[aria-pressed="true"] { color: var(--chronicle-text); background: var(--chronicle-card-surface); }
|
|
153
|
+
.grouping button:hover { color: var(--chronicle-text); }
|
|
154
|
+
.status-bar { display: flex; height: 16px; overflow: hidden; border-radius: 4px; margin-top: var(--space-lg); gap: 3px; }
|
|
155
|
+
[data-status="running"] { background: var(--chronicle-accent); }
|
|
156
|
+
[data-status="waiting"] { background: var(--chronicle-attention); }
|
|
157
|
+
[data-status="error"] { background: var(--chronicle-danger); }
|
|
158
|
+
[data-status="completed"] { background: var(--chronicle-success); }
|
|
159
|
+
[data-status="aborted"] { background: var(--chronicle-text-muted); }
|
|
160
|
+
.status-list { display: grid; gap: var(--space-sm); margin: var(--space-md) 0 0; }
|
|
161
|
+
.status-list dt { display: flex; align-items: center; gap: var(--space-xs); }
|
|
162
|
+
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
|
|
163
|
+
.ranked li { margin-bottom: var(--space-md); }
|
|
164
|
+
.row-label { display: flex; justify-content: space-between; gap: var(--space-md); }
|
|
165
|
+
.row-label span, .cost-list span, .sources { overflow-wrap: anywhere; }
|
|
166
|
+
.track { margin-top: 6px; height: 7px; border-radius: 3px; background: var(--chronicle-panel-muted); overflow: hidden; }
|
|
167
|
+
.track span { display: block; height: 100%; background: var(--chronicle-accent); }
|
|
168
|
+
.cost-total { font-size: 1.65rem; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: var(--space-lg); }
|
|
169
|
+
.coverage { font-size: var(--type-body-sm); color: var(--chronicle-text-muted); }
|
|
170
|
+
.cost-list li { padding: var(--space-sm) 0; }
|
|
171
|
+
.cost-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); }
|
|
172
|
+
.cost-track span { background: var(--chronicle-text-muted); }
|
|
173
|
+
.cost-row > div { min-width: 0; }
|
|
174
|
+
.cost-list small { display: block; margin-top: 3px; }
|
|
175
|
+
strong { font-weight: 620; font-variant-numeric: tabular-nums; }
|
|
176
|
+
.cost-list strong { white-space: nowrap; }
|
|
177
|
+
.text-button { background: transparent; border: 0; font: inherit; padding: var(--space-sm) 0; text-decoration: underline; cursor: pointer; }
|
|
178
|
+
.text-button:hover { color: var(--chronicle-text); }
|
|
179
|
+
.issues li { display: flex; align-items: baseline; gap: var(--space-md); padding: var(--space-md) 0; border-top: 1px solid var(--chronicle-border); }
|
|
180
|
+
.issues li > div { min-width: 0; }
|
|
181
|
+
.issues p { margin: 0; overflow-wrap: anywhere; }
|
|
182
|
+
.severity { flex: 0 0 auto; font-weight: 620; font-size: var(--type-body-sm); }
|
|
183
|
+
.severity[data-severity="error"] { color: var(--chronicle-danger-text); }
|
|
184
|
+
.severity[data-severity="warning"] { color: var(--chronicle-attention); }
|
|
185
|
+
.sources { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-top: var(--space-xs); color: var(--chronicle-text-muted); font-size: var(--type-body-sm); }
|
|
186
|
+
.healthy { color: var(--chronicle-success); font-weight: 550; }
|
|
187
|
+
.empty { padding: var(--space-lg) 0; color: var(--chronicle-text-muted); max-width: 68ch; }
|
|
188
|
+
.refresh-error { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding: var(--space-md); border-radius: 14px; background: color-mix(in srgb, var(--chronicle-danger) 7%, white); color: var(--chronicle-danger-text); }
|
|
189
|
+
.refresh-error p { margin: 0; }
|
|
190
|
+
.updated { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
|
|
191
|
+
@media (max-width: 900px) { .catalogs { grid-template-columns: 1fr; } .overview { grid-template-columns: 1fr; } }
|
|
192
|
+
@media (max-width: 540px) { .panel, .catalog { padding: var(--space-md); } .issues li, .refresh-error { align-items: flex-start; flex-direction: column; gap: var(--space-xs); } }
|
|
193
|
+
@media (prefers-reduced-motion: reduce) { .catalog { transition: none; } }
|
|
194
|
+
</style>
|
|
@@ -12,8 +12,8 @@ import { formatLocalDateTime24Hour, formatUtcDateTime24Hour } from "../lib/forma
|
|
|
12
12
|
import { buildFutureLaunchDetailSections } from "../lib/future-launch-detail.js";
|
|
13
13
|
import { loadProcessesList, upsertFutureExecution } from "../lib/processes.svelte";
|
|
14
14
|
import {
|
|
15
|
+
buildCreateProcessPath,
|
|
15
16
|
buildFutureLaunchPath,
|
|
16
|
-
buildHomePath,
|
|
17
17
|
buildProcessesPath,
|
|
18
18
|
buildProcessPath,
|
|
19
19
|
navigate,
|
|
@@ -40,7 +40,7 @@ let observedFutureExecutionId = $state<string | null>(null);
|
|
|
40
40
|
let launchersLoadToken = 0;
|
|
41
41
|
let futureLaunchDetailLoadToken = 0;
|
|
42
42
|
|
|
43
|
-
const homePath =
|
|
43
|
+
const homePath = buildCreateProcessPath();
|
|
44
44
|
const processesPath = buildProcessesPath();
|
|
45
45
|
const futureLaunch = $derived(
|
|
46
46
|
loadedFutureLaunch?.id === futureExecutionId ? loadedFutureLaunch : null,
|
|
@@ -13,8 +13,8 @@ import { queueProcessLaunchNotice } from "../lib/process-launch-notices.svelte";
|
|
|
13
13
|
import { upsertFutureExecution } from "../lib/processes.svelte.js";
|
|
14
14
|
import { consumePendingRetryConfig } from "../lib/retry-config.svelte.js";
|
|
15
15
|
import {
|
|
16
|
+
buildCreateProcessPath,
|
|
16
17
|
buildFutureLaunchPath,
|
|
17
|
-
buildHomePath,
|
|
18
18
|
buildProcessPath,
|
|
19
19
|
navigate,
|
|
20
20
|
} from "../lib/router.svelte";
|
|
@@ -168,7 +168,7 @@ async function loadLaunchers() {
|
|
|
168
168
|
retryInitialDraft = pendingRetry;
|
|
169
169
|
unavailableLauncherId = null;
|
|
170
170
|
if (!routeLauncherId) {
|
|
171
|
-
navigate(
|
|
171
|
+
navigate(buildCreateProcessPath(pendingRetry.launcherId), { replace: true });
|
|
172
172
|
}
|
|
173
173
|
} else {
|
|
174
174
|
retryLauncherId = null;
|
|
@@ -199,12 +199,12 @@ function openLauncher(nextLauncherId: string) {
|
|
|
199
199
|
if (launcherId === undefined) {
|
|
200
200
|
retryLauncherId = nextLauncherId;
|
|
201
201
|
}
|
|
202
|
-
navigate(
|
|
202
|
+
navigate(buildCreateProcessPath(nextLauncherId));
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
function goBackToGallery() {
|
|
206
206
|
clearRetryPrefill();
|
|
207
|
-
navigate(
|
|
207
|
+
navigate(buildCreateProcessPath());
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
function handleLaunched(instanceId: string, launchWarning?: string | null) {
|