@leitwerk-dev/ui 0.1.9 → 0.2.0
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-B15IzsLp.css +1 -0
- package/dist/assets/ApiTokensPage-ClJp9PYr.js +1 -0
- package/dist/assets/ChronicleMarkdown-lqwX9Ywa.js +16 -0
- package/dist/assets/ChronicleMarkdown-wsUF8Z75.css +1 -0
- package/dist/assets/FutureLaunchDetailPage-BOoZaG11.css +1 -0
- package/dist/assets/FutureLaunchDetailPage-Bdlgm4cJ.js +1 -0
- package/dist/assets/GenericLauncher-Bf7Eb1Rw.js +1 -0
- package/dist/assets/GenericLauncher-CExW6wei.css +1 -0
- package/dist/assets/HomePage-CSkNdC4m.js +1 -0
- package/dist/assets/PageHeader-DPuQInDo.css +1 -0
- package/dist/assets/PageHeader-sphJnWL1.js +1 -0
- package/dist/assets/ProcessActionsMenu-DLMywI9c.js +1 -0
- package/dist/assets/ProcessActionsMenu-VKT7PE6z.css +1 -0
- package/dist/assets/ProcessDetailPage-Cth6A0DN.css +1 -0
- package/dist/assets/ProcessDetailPage-fvvdvO19.js +14 -0
- package/dist/assets/ProcessFlowDiagram-Dx2wheGN.js +2 -0
- package/dist/assets/ProcessesPage-uLl7LXp8.js +1 -0
- package/dist/assets/ProcessesPage-yPjjrzjg.css +1 -0
- package/dist/assets/ScheduleDateTimePicker-DmojMRxN.js +1 -0
- package/dist/assets/{ScheduleDateTimePicker-CadXN9z7.css → ScheduleDateTimePicker-uacJAkIq.css} +1 -1
- package/dist/assets/SkillsPage-CJrtt8xU.css +1 -0
- package/dist/assets/SkillsPage-CotbGUxm.js +2 -0
- package/dist/assets/WatchersPage-ByWGNJet.js +1 -0
- package/dist/assets/WatchersPage-cRBnmTAD.css +1 -0
- package/dist/assets/external-links-CX92-VRP.js +1 -0
- package/dist/assets/http-client-VpPXJwbR.js +2 -0
- package/dist/assets/index-C7zNe3je.js +6 -0
- package/dist/assets/index-DtEI5gsQ.css +1 -0
- package/dist/assets/index-client-BYQviCtQ.js +2 -0
- package/dist/assets/{mermaid-render.worker-DAVgiVRG.js → mermaid-render.worker-QW2WZpEE.js} +12 -12
- package/dist/assets/process-terminal-display-BQRQwGod.js +1 -0
- package/dist/assets/router.svelte-EEldxHlO.js +1 -0
- package/dist/index.html +8 -8
- package/package.json +8 -8
- package/src/App.svelte +36 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +70 -143
- package/src/chronicle/components/ChronicleCreateIssueButton.svelte +22 -0
- package/src/chronicle/components/ChronicleEntryHeader.svelte +76 -0
- package/src/chronicle/components/ChronicleExpandButton.svelte +11 -34
- package/src/chronicle/components/ChronicleFailureMessage.svelte +41 -0
- package/src/chronicle/components/ChronicleFlow.svelte +133 -28
- package/src/chronicle/components/ChronicleLeafOutcomeRendererHost.svelte +1 -8
- package/src/chronicle/components/ChronicleLeafOutcomeSection.svelte +25 -52
- package/src/chronicle/components/ChronicleLiveChip.svelte +1 -35
- package/src/chronicle/components/ChronicleLiveTail.svelte +55 -154
- package/src/chronicle/components/ChronicleMarkdown.svelte +6 -6
- package/src/chronicle/components/ChronicleOperatorInputSection.svelte +5 -18
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +10 -107
- package/src/chronicle/components/ChroniclePromptSection.svelte +6 -26
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +22 -5
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +71 -109
- package/src/chronicle/components/ChronicleRecoverySection.svelte +96 -264
- package/src/chronicle/components/ChronicleScheduledActionSection.svelte +1 -1
- package/src/chronicle/components/ChronicleSectionHeader.svelte +1 -4
- package/src/chronicle/components/ChronicleStartupHistory.svelte +63 -0
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +10 -26
- package/src/chronicle/components/ChronicleThinkingSection.svelte +25 -165
- package/src/chronicle/components/ChronicleThinkingText.svelte +1 -0
- package/src/chronicle/components/ChronicleToolApproval.svelte +40 -0
- package/src/chronicle/components/ChronicleToolCallItem.svelte +1 -1
- package/src/chronicle/components/ChronicleTurnCluster.svelte +208 -284
- package/src/chronicle/components/ChronicleTurnDetailsButton.svelte +16 -0
- package/src/chronicle/components/ChronicleTurnProgress.svelte +77 -54
- package/src/chronicle/components/ChronicleTurnRail.svelte +327 -391
- package/src/chronicle/components/CompactActionComposer.svelte +36 -13
- package/src/chronicle/components/ReadonlyJsonValue.svelte +30 -0
- package/src/chronicle/lib/action-bindings.ts +1 -1
- package/src/chronicle/lib/action-model-display.ts +2 -2
- package/src/chronicle/lib/action-preview.ts +1 -1
- package/src/chronicle/lib/chronicle-projection.ts +125 -109
- package/src/chronicle/lib/chronicle-rail-groups.ts +158 -0
- package/src/chronicle/lib/chronicle-selectable-items.ts +16 -11
- package/src/chronicle/lib/chronicle-ticket-artifact.ts +7 -0
- package/src/chronicle/lib/formatting.ts +19 -0
- package/src/chronicle/lib/leaf-outcome-loader.ts +30 -111
- package/src/chronicle/lib/leaf-outcome-runtime.ts +3 -15
- package/src/chronicle/lib/result-presentation.ts +40 -0
- package/src/chronicle/lib/retry-groups.ts +24 -0
- package/src/chronicle/lib/scroll-sync.ts +1 -0
- package/src/chronicle/lib/tool-call-summary.ts +1 -9
- package/src/chronicle/ticket-selection.ts +23 -0
- package/src/components/ElapsedTime.svelte +31 -0
- package/src/components/ExternalLink.svelte +39 -0
- package/src/components/FormFieldRenderer.svelte +4 -1
- package/src/components/GenericLauncher.svelte +40 -15
- package/src/components/KeyboardShortcutsModal.svelte +2 -2
- package/src/components/LaunchChecklist.svelte +184 -0
- package/src/components/ModalShell.svelte +43 -32
- package/src/components/PageHeader.svelte +7 -33
- package/src/components/ProcessActionsMenu.svelte +217 -140
- package/src/components/ProcessInfoOverlay.svelte +13 -21
- package/src/components/ProgressChecklist.svelte +46 -0
- package/src/components/ProgressChecklistRows.svelte +80 -0
- package/src/components/launcher-form-copy.ts +4 -1
- package/src/components/launcher-model-config.ts +1 -1
- package/src/extension-ui-dev-server.ts +2 -5
- package/src/lib/api-tokens.ts +34 -0
- package/src/lib/api.ts +323 -455
- package/src/lib/elapsed-time.ts +19 -0
- package/src/lib/external-links.ts +81 -0
- package/src/lib/flow-layout.ts +1 -8
- package/src/lib/format.ts +3 -26
- package/src/lib/future-launch-detail.ts +1 -1
- package/src/lib/http-client.ts +79 -0
- package/src/lib/launch-updates.ts +17 -0
- package/src/lib/markdown.ts +8 -1
- package/src/lib/primary-path-detail.ts +97 -3
- package/src/lib/primary-path-replay.ts +13 -7
- package/src/lib/process-row-view.ts +1 -1
- package/src/lib/process-terminal-display.ts +4 -7
- package/src/lib/processes.svelte.ts +41 -9
- package/src/lib/reasoning-history.ts +95 -0
- package/src/lib/retry-config.svelte.ts +1 -1
- package/src/lib/rich-markdown-elements.ts +2 -2
- package/src/lib/router-logic.ts +3 -0
- package/src/lib/runtime-config.ts +1 -3
- package/src/lib/test-fixtures.ts +1 -1
- package/src/lib/tool-call-rendering.ts +4 -1
- package/src/lib/ui-extensions.svelte.ts +78 -127
- package/src/lib/ws-classifier.ts +8 -1
- package/src/pages/ApiTokensPage.svelte +213 -0
- package/src/pages/FutureLaunchDetailPage.svelte +7 -35
- package/src/pages/HomePage.svelte +7 -7
- package/src/pages/ProcessCard.svelte +1 -1
- package/src/pages/ProcessDetailPage.svelte +158 -62
- package/src/pages/ProcessGallery.svelte +1 -1
- package/src/pages/ProcessesPage.svelte +7 -42
- package/src/pages/SkillsPage.svelte +37 -26
- package/src/pages/WatchersPage.svelte +31 -53
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +125 -28
- package/src/pages/process-detail/ProcessDetailHeader.svelte +24 -2
- package/src/pages/process-detail/ProcessSummary.svelte +35 -0
- package/src/pages/process-detail/TicketCreationComposer.svelte +219 -0
- package/src/pages/process-detail/process-detail-action-drafts.svelte.ts +5 -5
- package/src/pages/process-detail/process-detail-actions.svelte.ts +4 -2
- package/src/pages/process-detail/process-detail-chronicle-dom.ts +39 -14
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +68 -10
- package/src/pages/process-detail/process-detail-view-model.ts +10 -24
- package/src/shell/AppShell.svelte +4 -1
- package/src/shell/Sidebar.svelte +88 -125
- package/src/styles/controls.css +188 -0
- package/dist/assets/ChronicleMarkdown-B1hD4HFS.js +0 -16
- package/dist/assets/ChronicleMarkdown-D6hFzERy.css +0 -1
- package/dist/assets/FutureLaunchDetailPage-Dy3FlLih.js +0 -1
- package/dist/assets/FutureLaunchDetailPage-UFgp7Ju4.css +0 -1
- package/dist/assets/GenericLauncher-BPEQjJ1J.js +0 -1
- package/dist/assets/GenericLauncher-D_GMtsQ5.css +0 -1
- package/dist/assets/HomePage-E41Krxko.js +0 -1
- package/dist/assets/PageHeader-DDgWPeHS.js +0 -1
- package/dist/assets/PageHeader-vhyfX7xT.css +0 -1
- package/dist/assets/ProcessActionsMenu-BWlFe5c4.css +0 -1
- package/dist/assets/ProcessActionsMenu-cI0j2LWe.js +0 -1
- package/dist/assets/ProcessDetailPage-DVHldJgi.js +0 -12
- package/dist/assets/ProcessDetailPage-Oh6ld320.css +0 -1
- package/dist/assets/ProcessFlowDiagram-C6m6V_cB.js +0 -2
- package/dist/assets/ProcessesPage-B2QGyCZO.js +0 -1
- package/dist/assets/ProcessesPage-BcM38HMs.css +0 -1
- package/dist/assets/ScheduleDateTimePicker-aey_oMiH.js +0 -1
- package/dist/assets/SkillsPage-MPITMvhn.css +0 -1
- package/dist/assets/SkillsPage-iB4sbq7r.js +0 -2
- package/dist/assets/WatchersPage-BOSgjtw0.css +0 -1
- package/dist/assets/WatchersPage-l0rwv-Nx.js +0 -1
- package/dist/assets/api-CtKbU0lT.js +0 -1
- package/dist/assets/dist-eOPUi0B8.js +0 -2
- package/dist/assets/index-B4flHG_s.js +0 -7
- package/dist/assets/index-DunTIQSW.css +0 -1
- package/dist/assets/index-client-CnG8mWmF.js +0 -2
- package/dist/assets/retry-config.svelte-WukHimiy.js +0 -1
- package/dist/assets/router.svelte-2RvxUvs5.js +0 -1
- package/src/lib/process-initial-prompt.ts +0 -7
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
type ProcessTimelineTurnSummary,
|
|
5
5
|
type TurnTraceSnapshot,
|
|
6
6
|
} from "@leitwerk-dev/protocol";
|
|
7
|
-
import { onDestroy, tick } from "svelte";
|
|
7
|
+
import { onDestroy, tick, untrack } from "svelte";
|
|
8
8
|
import ChronicleReasoningDetailsOverlay from "../chronicle/components/ChronicleReasoningDetailsOverlay.svelte";
|
|
9
|
+
import type { ChronicleReasoningDetailEntry } from "../chronicle/lib/chronicle-projection.js";
|
|
9
10
|
import {
|
|
10
11
|
buildChronicleProjection,
|
|
11
12
|
extractChronicleReasoningDetailEntries,
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
} from "../chronicle/lib/chronicle-selectable-items.js";
|
|
18
19
|
import ProcessInfoOverlay from "../components/ProcessInfoOverlay.svelte";
|
|
19
20
|
import { fetchTurnReasoningDetail, type ProcessDetailData } from "../lib/api.js";
|
|
21
|
+
import { getBrowserStorage } from "../lib/browser-storage.js";
|
|
20
22
|
import { shouldIgnorePlainShortcut } from "../lib/keyboard.js";
|
|
21
23
|
import { getPrimaryPathActiveTurnOutput } from "../lib/primary-path-detail.js";
|
|
22
24
|
import {
|
|
@@ -24,7 +26,13 @@ import {
|
|
|
24
26
|
consumeProcessLaunchNotice,
|
|
25
27
|
} from "../lib/process-launch-notices.svelte";
|
|
26
28
|
import type { ProcessTerminalStatus } from "../lib/process-terminal-display.js";
|
|
27
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
clearDetail,
|
|
31
|
+
detailState,
|
|
32
|
+
loadProcessDetail,
|
|
33
|
+
subscribeReasoningFrames,
|
|
34
|
+
} from "../lib/processes.svelte";
|
|
35
|
+
import { ReasoningHistory } from "../lib/reasoning-history.js";
|
|
28
36
|
import {
|
|
29
37
|
buildProcessesPath,
|
|
30
38
|
buildProcessPath,
|
|
@@ -37,6 +45,7 @@ import { wsStore } from "../lib/ws.svelte";
|
|
|
37
45
|
import OverlayFrame from "./process-detail/OverlayFrame.svelte";
|
|
38
46
|
import ProcessDetailChronicle from "./process-detail/ProcessDetailChronicle.svelte";
|
|
39
47
|
import ProcessDetailHeader from "./process-detail/ProcessDetailHeader.svelte";
|
|
48
|
+
import ProcessSummary from "./process-detail/ProcessSummary.svelte";
|
|
40
49
|
import { createProcessDetailActions } from "./process-detail/process-detail-actions.svelte.js";
|
|
41
50
|
import {
|
|
42
51
|
buildJumpToLatestLabel,
|
|
@@ -49,6 +58,52 @@ interface Props {
|
|
|
49
58
|
|
|
50
59
|
let { instanceId }: Props = $props();
|
|
51
60
|
|
|
61
|
+
let summaryDismissed = $state(false);
|
|
62
|
+
const summaryStorageKey = $derived(`leitwerk:process-summary:hidden:${instanceId}`);
|
|
63
|
+
const waitingReport = $derived(
|
|
64
|
+
$detailState.data?.process.lifecycleStatus === "waiting"
|
|
65
|
+
? $detailState.data.timeline.turns.findLast(
|
|
66
|
+
(turn) =>
|
|
67
|
+
turn.turnId === $detailState.data?.process.selectedTurnId &&
|
|
68
|
+
turn.progress?.summary?.trim(),
|
|
69
|
+
)
|
|
70
|
+
: null,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
function readSummaryPreference() {
|
|
74
|
+
try {
|
|
75
|
+
summaryDismissed = getBrowserStorage()?.getItem(summaryStorageKey) === "true";
|
|
76
|
+
} catch {
|
|
77
|
+
summaryDismissed = false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
$effect(() => {
|
|
81
|
+
readSummaryPreference();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
function setSummaryDismissed(hidden: boolean) {
|
|
85
|
+
summaryDismissed = hidden;
|
|
86
|
+
try {
|
|
87
|
+
getBrowserStorage()?.setItem(summaryStorageKey, String(hidden));
|
|
88
|
+
} catch {
|
|
89
|
+
/* Keep the preference for this page when browser storage is unavailable. */
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function dismissSummary() {
|
|
93
|
+
setSummaryDismissed(true);
|
|
94
|
+
// The dismissed control leaves the DOM; retain a useful keyboard position.
|
|
95
|
+
const title = document.getElementById(processDetailTitleId);
|
|
96
|
+
title?.setAttribute("tabindex", "-1");
|
|
97
|
+
title?.focus();
|
|
98
|
+
}
|
|
99
|
+
function showSummary() {
|
|
100
|
+
setSummaryDismissed(false);
|
|
101
|
+
closeProcessInfoOverlay();
|
|
102
|
+
}
|
|
103
|
+
function handleSummaryStorage(event: StorageEvent) {
|
|
104
|
+
if (event.key === null || event.key === summaryStorageKey) readSummaryPreference();
|
|
105
|
+
}
|
|
106
|
+
|
|
52
107
|
let launchWarning = $state<string | null>(null);
|
|
53
108
|
let observedInstanceId: string | null = null;
|
|
54
109
|
let loadedInstanceId = $state<string | null>(null);
|
|
@@ -60,6 +115,14 @@ let activeReasoningRequest = $state.raw<{
|
|
|
60
115
|
status: "loading" | "error";
|
|
61
116
|
error: string | null;
|
|
62
117
|
} | null>(null);
|
|
118
|
+
let reasoningHistory: ReasoningHistory | null = null;
|
|
119
|
+
let observedReasoningKey: string | null = null;
|
|
120
|
+
let retainedReasoningEntry = $state.raw<ChronicleReasoningDetailEntry | null>(null);
|
|
121
|
+
const unsubscribeReasoningFrames = subscribeReasoningFrames((frame) => {
|
|
122
|
+
if (!reasoningHistory) return;
|
|
123
|
+
const trace = reasoningHistory.push(frame);
|
|
124
|
+
if (trace) reasoningTraceCache = { [reasoningHistory.turnRecordId]: trace };
|
|
125
|
+
});
|
|
63
126
|
let reasoningRequestGeneration = 0;
|
|
64
127
|
let reasoningRequestAbortController: AbortController | null = null;
|
|
65
128
|
|
|
@@ -109,6 +172,7 @@ $effect(() => {
|
|
|
109
172
|
});
|
|
110
173
|
|
|
111
174
|
onDestroy(() => {
|
|
175
|
+
unsubscribeReasoningFrames();
|
|
112
176
|
reasoningRequestAbortController?.abort();
|
|
113
177
|
clearDetail();
|
|
114
178
|
});
|
|
@@ -157,19 +221,18 @@ function projectTimelineTurns(detail: ProcessDetailData): ProcessTimelineTurnSum
|
|
|
157
221
|
];
|
|
158
222
|
}
|
|
159
223
|
|
|
160
|
-
const turnRecords = $derived
|
|
161
|
-
const turnTraceIndex = $derived.by(() => {
|
|
224
|
+
const turnRecords = $derived.by(() => {
|
|
162
225
|
const detail = $detailState.data;
|
|
163
|
-
if (!detail)
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
);
|
|
226
|
+
if (!detail) return [];
|
|
227
|
+
return projectTimelineTurns(detail).map((turn) => ({
|
|
228
|
+
...turn,
|
|
229
|
+
displayTurn:
|
|
230
|
+
turn.status === "in_progress" && detail.selectedTurn?.turnId === turn.turnId
|
|
231
|
+
? detail.selectedTurn.description
|
|
232
|
+
: turn.displayTurn,
|
|
233
|
+
}));
|
|
172
234
|
});
|
|
235
|
+
const turnTraceIndex = $derived(reasoningTraceCache);
|
|
173
236
|
const toolRendererIndex = $derived(createToolRendererIndex($detailState.data?.toolRenderers ?? []));
|
|
174
237
|
const chroniclePrompt = $derived({
|
|
175
238
|
text: $detailState.data?.timeline.prompt.text ?? null,
|
|
@@ -194,7 +257,10 @@ const chronicleProjection = $derived(
|
|
|
194
257
|
}),
|
|
195
258
|
);
|
|
196
259
|
const reasoningDetailEntries = $derived(
|
|
197
|
-
extractChronicleReasoningDetailEntries(
|
|
260
|
+
extractChronicleReasoningDetailEntries(
|
|
261
|
+
chronicleProjection,
|
|
262
|
+
$detailState.data?.questionRequests ?? [],
|
|
263
|
+
),
|
|
198
264
|
);
|
|
199
265
|
const processDetailOverlay = $derived(readProcessDetailOverlay($locationStore));
|
|
200
266
|
const isProcessInfoOverlayOpen = $derived(processDetailOverlay.kind === "process-info");
|
|
@@ -211,7 +277,9 @@ const activeReasoningDetailIndex = $derived.by(() => {
|
|
|
211
277
|
});
|
|
212
278
|
const activeReasoningDetail = $derived.by(() => {
|
|
213
279
|
if (activeReasoningDetailIndex < 0) {
|
|
214
|
-
return
|
|
280
|
+
return retainedReasoningEntry?.turnRecordId === requestedReasoningDetailTurnRecordId
|
|
281
|
+
? retainedReasoningEntry
|
|
282
|
+
: null;
|
|
215
283
|
}
|
|
216
284
|
return reasoningDetailEntries[activeReasoningDetailIndex] ?? null;
|
|
217
285
|
});
|
|
@@ -223,84 +291,91 @@ const hasBlockingDetailOverlay = $derived(
|
|
|
223
291
|
isProcessInfoOverlayOpen || activeReasoningDetail !== null,
|
|
224
292
|
);
|
|
225
293
|
|
|
226
|
-
function
|
|
227
|
-
return JSON.stringify([sessionSignature, turnRecordId]);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
async function loadReasoningDetail(
|
|
231
|
-
requestInstanceId: string,
|
|
232
|
-
turnRecordId: string,
|
|
233
|
-
sessionSignature: string | null,
|
|
234
|
-
) {
|
|
235
|
-
const key = reasoningCacheKey(sessionSignature, turnRecordId);
|
|
294
|
+
async function loadReasoningDetail(requestInstanceId: string, turnRecordId: string, key: string) {
|
|
236
295
|
reasoningRequestAbortController?.abort();
|
|
237
296
|
const controller = new AbortController();
|
|
238
297
|
reasoningRequestAbortController = controller;
|
|
239
298
|
const generation = ++reasoningRequestGeneration;
|
|
299
|
+
if (
|
|
300
|
+
reasoningHistory?.instanceId !== requestInstanceId ||
|
|
301
|
+
reasoningHistory.turnRecordId !== turnRecordId
|
|
302
|
+
) {
|
|
303
|
+
reasoningHistory = new ReasoningHistory(requestInstanceId, turnRecordId);
|
|
304
|
+
reasoningTraceCache = {};
|
|
305
|
+
}
|
|
306
|
+
const history = reasoningHistory;
|
|
307
|
+
history.beginRequest();
|
|
240
308
|
activeReasoningRequest = { key, status: "loading", error: null };
|
|
309
|
+
// Let a direct link render the shell and controls before starting independent detail I/O.
|
|
310
|
+
await tick();
|
|
311
|
+
if (controller.signal.aborted) return;
|
|
241
312
|
try {
|
|
242
313
|
const response = await fetchTurnReasoningDetail(
|
|
243
314
|
requestInstanceId,
|
|
244
315
|
turnRecordId,
|
|
245
|
-
|
|
316
|
+
null,
|
|
246
317
|
controller.signal,
|
|
247
318
|
);
|
|
248
|
-
const currentDetail = $detailState.data;
|
|
249
319
|
if (
|
|
250
320
|
generation !== reasoningRequestGeneration ||
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
) {
|
|
321
|
+
requestedReasoningDetailTurnRecordId !== turnRecordId ||
|
|
322
|
+
instanceId !== requestInstanceId
|
|
323
|
+
)
|
|
255
324
|
return;
|
|
256
|
-
}
|
|
257
|
-
reasoningTraceCache = { ...reasoningTraceCache, [key]: response.reasoning };
|
|
325
|
+
reasoningTraceCache = { [turnRecordId]: history.accept(response) };
|
|
258
326
|
activeReasoningRequest = null;
|
|
259
327
|
} catch (error) {
|
|
260
|
-
if (generation !== reasoningRequestGeneration || controller.signal.aborted)
|
|
261
|
-
|
|
262
|
-
}
|
|
328
|
+
if (generation !== reasoningRequestGeneration || controller.signal.aborted) return;
|
|
329
|
+
history.failedRequest();
|
|
263
330
|
activeReasoningRequest = {
|
|
264
331
|
key,
|
|
265
332
|
status: "error",
|
|
266
333
|
error: error instanceof Error ? error.message : "Couldn't load full reasoning details",
|
|
267
334
|
};
|
|
268
335
|
} finally {
|
|
269
|
-
if (reasoningRequestAbortController === controller)
|
|
270
|
-
reasoningRequestAbortController = null;
|
|
271
|
-
}
|
|
336
|
+
if (reasoningRequestAbortController === controller) reasoningRequestAbortController = null;
|
|
272
337
|
}
|
|
273
338
|
}
|
|
274
339
|
|
|
275
340
|
$effect(() => {
|
|
276
341
|
const detail = $detailState.data;
|
|
277
342
|
const turnRecordId = requestedReasoningDetailTurnRecordId;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
343
|
+
const reconnect = $wsStore.reconnectCount;
|
|
344
|
+
if (!detail || !turnRecordId) {
|
|
345
|
+
untrack(() => {
|
|
346
|
+
observedReasoningKey = null;
|
|
347
|
+
reasoningRequestGeneration++;
|
|
348
|
+
reasoningRequestAbortController?.abort();
|
|
349
|
+
reasoningHistory = null;
|
|
350
|
+
reasoningTraceCache = {};
|
|
351
|
+
activeReasoningRequest = null;
|
|
352
|
+
retainedReasoningEntry = null;
|
|
353
|
+
});
|
|
283
354
|
return;
|
|
284
355
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
356
|
+
const entry = reasoningDetailEntries.find((entry) => entry.turnRecordId === turnRecordId);
|
|
357
|
+
if (entry) retainedReasoningEntry = entry;
|
|
358
|
+
const turn = detail.timeline.turns.find((turn) => turn.id === turnRecordId);
|
|
359
|
+
const state = turn?.status === "completed" ? "committed" : "live";
|
|
360
|
+
const key = JSON.stringify([
|
|
361
|
+
instanceId,
|
|
362
|
+
turnRecordId,
|
|
363
|
+
state,
|
|
364
|
+
reconnect,
|
|
365
|
+
state === "committed" ? detail.session.signature : null,
|
|
366
|
+
]);
|
|
367
|
+
if (observedReasoningKey === key) return;
|
|
368
|
+
observedReasoningKey = key;
|
|
369
|
+
untrack(() => {
|
|
370
|
+
void loadReasoningDetail(instanceId, turnRecordId, key);
|
|
371
|
+
});
|
|
295
372
|
});
|
|
296
373
|
|
|
374
|
+
const activeReasoningRequestState = $derived(activeReasoningRequest);
|
|
297
375
|
function retryReasoningDetail() {
|
|
298
|
-
const detail = $detailState.data;
|
|
299
376
|
const turnRecordId = requestedReasoningDetailTurnRecordId;
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
void loadReasoningDetail(detail.process.id, turnRecordId, detail.session.signature);
|
|
377
|
+
if (turnRecordId && observedReasoningKey)
|
|
378
|
+
void loadReasoningDetail(instanceId, turnRecordId, observedReasoningKey);
|
|
304
379
|
}
|
|
305
380
|
const scheduledActionDetail = $derived($detailState.data?.scheduledAction ?? null);
|
|
306
381
|
const isTerminalProcess = $derived.by(() => {
|
|
@@ -315,7 +390,10 @@ const selectedTurnExternalTriggerSignals = $derived(
|
|
|
315
390
|
$detailState.data?.timeline.externalTriggerSignals ?? [],
|
|
316
391
|
);
|
|
317
392
|
const currentTurnRecovery = $derived($detailState.data?.recovery ?? null);
|
|
318
|
-
const
|
|
393
|
+
const startup = $derived(
|
|
394
|
+
$detailState.data?.startup ?? { authoritativeAttemptId: null, attempts: [], recovery: null },
|
|
395
|
+
);
|
|
396
|
+
const startupRecovery = $derived(startup.recovery);
|
|
319
397
|
const currentProcessError = $derived($detailState.data?.processError ?? null);
|
|
320
398
|
const pendingRailItem = $derived(
|
|
321
399
|
buildPendingRailItem({
|
|
@@ -343,6 +421,7 @@ const chronicleSelectableItems = $derived(
|
|
|
343
421
|
buildChronicleSelectableItems({
|
|
344
422
|
projection: chronicleProjection,
|
|
345
423
|
pendingRailItem,
|
|
424
|
+
externalWaitingTurnId: startupRecovery ? null : $detailState.data?.selectedTurn?.turnId,
|
|
346
425
|
}),
|
|
347
426
|
);
|
|
348
427
|
const terminalSummaryStatus = $derived.by((): ProcessTerminalStatus | null => {
|
|
@@ -473,7 +552,7 @@ function openNextReasoningDetails() {
|
|
|
473
552
|
}
|
|
474
553
|
</script>
|
|
475
554
|
|
|
476
|
-
<svelte:window onkeydown={handlePageKeydown} />
|
|
555
|
+
<svelte:window onkeydown={handlePageKeydown} onstorage={handleSummaryStorage} />
|
|
477
556
|
|
|
478
557
|
<div class="process-detail-page" data-page="process-detail">
|
|
479
558
|
<div class="page-shell" inert={hasBlockingDetailOverlay ? true : undefined}>
|
|
@@ -486,6 +565,11 @@ function openNextReasoningDetails() {
|
|
|
486
565
|
onDeleted={handleProcessDeleted}
|
|
487
566
|
/>
|
|
488
567
|
|
|
568
|
+
|
|
569
|
+
{#if waitingReport?.progress?.summary && !summaryDismissed}
|
|
570
|
+
<ProcessSummary summary={waitingReport.progress.summary} recordedAt={waitingReport.progressRecordedAt} onDismiss={dismissSummary} />
|
|
571
|
+
{/if}
|
|
572
|
+
|
|
489
573
|
<ProcessDetailChronicle
|
|
490
574
|
{instanceId}
|
|
491
575
|
detail={$detailState.data}
|
|
@@ -501,6 +585,7 @@ function openNextReasoningDetails() {
|
|
|
501
585
|
externalTriggerSignals={selectedTurnExternalTriggerSignals}
|
|
502
586
|
selectedTurn={$detailState.data?.selectedTurn ?? null}
|
|
503
587
|
recovery={currentTurnRecovery}
|
|
588
|
+
{startup}
|
|
504
589
|
{startupRecovery}
|
|
505
590
|
processError={currentProcessError}
|
|
506
591
|
{scheduledActionDetail}
|
|
@@ -529,6 +614,7 @@ function openNextReasoningDetails() {
|
|
|
529
614
|
{processUsageEstimate}
|
|
530
615
|
onClose={() => closeProcessInfoOverlay()}
|
|
531
616
|
railItems={chronicleSelectableItems}
|
|
617
|
+
onShowSummary={waitingReport && summaryDismissed ? showSummary : undefined}
|
|
532
618
|
/>
|
|
533
619
|
</OverlayFrame>
|
|
534
620
|
{:else if activeReasoningDetail}
|
|
@@ -543,11 +629,14 @@ function openNextReasoningDetails() {
|
|
|
543
629
|
<button type="button" onclick={retryReasoningDetail}>Retry</button>
|
|
544
630
|
</div>
|
|
545
631
|
{:else if activeReasoningRequestState?.status === "loading"}
|
|
546
|
-
<p class="
|
|
632
|
+
<p class="reasoning-load-status" role="status">Loading reasoning…</p>
|
|
547
633
|
{/if}
|
|
548
634
|
<ChronicleReasoningDetailsOverlay
|
|
549
635
|
entry={activeReasoningDetail}
|
|
550
636
|
{toolRendererIndex}
|
|
637
|
+
questionRequests={$detailState.data?.questionRequests.filter(
|
|
638
|
+
(request) => request.turnRecordId === activeReasoningDetail.turnRecordId,
|
|
639
|
+
) ?? []}
|
|
551
640
|
hasPrevious={hasPreviousReasoningDetail}
|
|
552
641
|
hasNext={hasNextReasoningDetail}
|
|
553
642
|
onClose={() => closeReasoningDetails()}
|
|
@@ -578,6 +667,13 @@ function openNextReasoningDetails() {
|
|
|
578
667
|
min-height: 0;
|
|
579
668
|
}
|
|
580
669
|
|
|
670
|
+
.reasoning-load-status {
|
|
671
|
+
margin: 0;
|
|
672
|
+
padding: var(--space-sm) var(--space-md);
|
|
673
|
+
font-size: var(--type-body-sm);
|
|
674
|
+
color: var(--chronicle-text-muted);
|
|
675
|
+
}
|
|
676
|
+
|
|
581
677
|
.reasoning-load-error {
|
|
582
678
|
display: flex;
|
|
583
679
|
gap: var(--space-sm);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { UiLauncherSummary } from "@leitwerk-dev/protocol/http-contracts";
|
|
2
3
|
import PageHeader from "../components/PageHeader.svelte";
|
|
3
|
-
import type { UiLauncherSummary } from "../lib/api.js";
|
|
4
4
|
import ProcessCard from "./ProcessCard.svelte";
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
@@ -262,14 +262,14 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
262
262
|
</p>
|
|
263
263
|
|
|
264
264
|
{#if hasActiveFilter}
|
|
265
|
-
<button type="button" class="reset-view-button" data-pressable="true" onclick={clearFilters}>
|
|
265
|
+
<button type="button" class="ui-button reset-view-button" data-pressable="true" onclick={clearFilters}>
|
|
266
266
|
Clear filters
|
|
267
267
|
</button>
|
|
268
268
|
{/if}
|
|
269
269
|
|
|
270
270
|
<button
|
|
271
271
|
type="button"
|
|
272
|
-
class="refresh-button"
|
|
272
|
+
class="ui-button refresh-button"
|
|
273
273
|
data-action="refresh-processes"
|
|
274
274
|
data-pressable="true"
|
|
275
275
|
disabled={$browseState.loading}
|
|
@@ -292,7 +292,7 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
292
292
|
{#if $browseState.error}
|
|
293
293
|
<div class="state-banner" role="status" data-state="process-list-error">
|
|
294
294
|
<p>Process list couldn’t refresh. Existing results may be out of date.</p>
|
|
295
|
-
<button type="button" data-pressable="true" onclick={refreshProcesses}>Try again</button>
|
|
295
|
+
<button type="button" class="ui-button" data-pressable="true" onclick={refreshProcesses}>Try again</button>
|
|
296
296
|
</div>
|
|
297
297
|
{/if}
|
|
298
298
|
|
|
@@ -315,7 +315,7 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
315
315
|
<div class="empty-state" data-state="processes-no-results">
|
|
316
316
|
<h2>No processes match these filters</h2>
|
|
317
317
|
<p>Change the search or filters to see more process records.</p>
|
|
318
|
-
<button type="button" class="clear-button" data-pressable="true" onclick={clearFilters}>
|
|
318
|
+
<button type="button" class="ui-button clear-button" data-pressable="true" onclick={clearFilters}>
|
|
319
319
|
Clear search and filters
|
|
320
320
|
</button>
|
|
321
321
|
</div>
|
|
@@ -383,7 +383,7 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
383
383
|
|
|
384
384
|
{#if hasMore}
|
|
385
385
|
<div class="pagination-row">
|
|
386
|
-
<button type="button" class="show-more-button" data-pressable="true" onclick={showMore}>
|
|
386
|
+
<button type="button" class="ui-button show-more-button" data-pressable="true" onclick={showMore}>
|
|
387
387
|
Show more
|
|
388
388
|
</button>
|
|
389
389
|
</div>
|
|
@@ -458,45 +458,10 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
458
458
|
font-family: var(--font-mono);
|
|
459
459
|
font-size: 1.35rem;
|
|
460
460
|
line-height: 1;
|
|
461
|
-
letter-spacing:
|
|
461
|
+
letter-spacing: normal;
|
|
462
462
|
color: var(--chronicle-text);
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
-
.refresh-button,
|
|
466
|
-
.reset-view-button,
|
|
467
|
-
.clear-button,
|
|
468
|
-
.show-more-button,
|
|
469
|
-
.state-banner button {
|
|
470
|
-
display: inline-flex;
|
|
471
|
-
align-items: center;
|
|
472
|
-
justify-content: center;
|
|
473
|
-
min-height: 40px;
|
|
474
|
-
padding: 0 14px;
|
|
475
|
-
border-radius: 10px;
|
|
476
|
-
border: 1px solid var(--chronicle-border-strong);
|
|
477
|
-
background: var(--chronicle-card-surface);
|
|
478
|
-
color: var(--chronicle-text);
|
|
479
|
-
font-size: var(--type-body-sm);
|
|
480
|
-
font-weight: 800;
|
|
481
|
-
cursor: pointer;
|
|
482
|
-
white-space: nowrap;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.refresh-button:hover:not(:disabled),
|
|
486
|
-
.reset-view-button:hover,
|
|
487
|
-
.clear-button:hover,
|
|
488
|
-
.show-more-button:hover,
|
|
489
|
-
.state-banner button:hover {
|
|
490
|
-
border-color: color-mix(in srgb, var(--chronicle-accent) 32%, var(--chronicle-border-strong) 68%);
|
|
491
|
-
background: color-mix(in srgb, var(--chronicle-card-surface) 84%, var(--chronicle-accent) 16%);
|
|
492
|
-
transform: translateY(-1px);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
.refresh-button:disabled {
|
|
496
|
-
opacity: 0.6;
|
|
497
|
-
cursor: default;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
465
|
.search-field {
|
|
501
466
|
flex: 1 1 auto;
|
|
502
467
|
min-width: 200px;
|
|
@@ -509,7 +474,7 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
509
474
|
.search-field input,
|
|
510
475
|
.type-filter select {
|
|
511
476
|
width: 100%;
|
|
512
|
-
min-height:
|
|
477
|
+
min-height: 44px;
|
|
513
478
|
border: 1px solid var(--chronicle-border);
|
|
514
479
|
border-radius: 10px;
|
|
515
480
|
background: var(--chronicle-card-surface);
|