@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 @@
|
|
|
1
|
+
import{W as e,at as t,rt as n}from"./index-client-BSAA7n1a.js";var r=t(null);function i(e){n(r,e,!0)}function a(){let t=e(r);return n(r,null),t}export{i as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as e}from"./index-client-BSAA7n1a.js";import{n as t,o as n,r}from"./http-client-Cvi3zOou.js";function i(t,n=!1){let r=e(window,`leitwerk:settings-changed`,t),i=n?e(window,`focus`,t):void 0;return()=>{r(),i?.()}}var a=e=>t(e,!0);function o(e=!1){return n({path:`/api/settings/scopes${e?`/refresh`:``}`,...e?{init:r(`POST`,{})}:{},malformed:`Could not read settings scopes`,error:a(`Could not load settings scopes`)})}function s(e){return n({path:`/api/settings/preview?subjectId=${encodeURIComponent(e)}`,malformed:`Could not read settings`,error:a(`Could not load settings`)})}function c(e){return n({path:`/api/settings/overview?${new URLSearchParams({scopeType:e})}`,malformed:`Could not read settings overview`,error:a(`Could not load settings overview`)})}function l(e,t,r=``,i){return n({path:`/api/settings/choices?${new URLSearchParams({subjectId:e,key:t,search:r})}`,init:{signal:i},malformed:`Could not read options`,error:a(`Could not load options. Try again or refine your search.`)})}function u(e,t=!1){return n({path:`/api/settings/${t?`preview`:`overrides`}`,init:r(t?`POST`:`PUT`,e),malformed:`Could not read settings`,error:a(t?`Could not preview setting`:`Could not save setting`)})}function d(e){return n({path:`/api/settings/processes/${encodeURIComponent(e)}`,malformed:`Could not read process settings`,error:a(`Could not load process settings`)})}function f(e=`instance`){return`/settings?scope=${encodeURIComponent(e)}`}function p(e,t,i){return n({path:`/api/settings/processes/${encodeURIComponent(e)}/primary-repository`,init:r(`PUT`,{primaryRepositoryKey:t,expectedPrimaryRepositoryKey:i}),malformed:`Could not read primary repository`,error:a(`Could not bind primary repository`)})}export{c as a,i as c,l as i,f as l,u as n,s as o,d as r,o as s,p as t};
|
package/dist/index.html
CHANGED
|
@@ -17,14 +17,11 @@
|
|
|
17
17
|
/>
|
|
18
18
|
<link rel="stylesheet" href="/fonts/fonts.css" />
|
|
19
19
|
<title>Leitwerk</title>
|
|
20
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/index-client-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/http-client-
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-Dz0T5gKc.js"></script>
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/index-client-BSAA7n1a.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/http-client-Cvi3zOou.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/external-links-CX92-VRP.js">
|
|
24
|
-
<link rel="
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/router.svelte-EEldxHlO.js">
|
|
26
|
-
<link rel="stylesheet" crossorigin href="/assets/ChronicleMarkdown-wsUF8Z75.css">
|
|
27
|
-
<link rel="stylesheet" crossorigin href="/assets/index-DtEI5gsQ.css">
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DzKWCM-z.css">
|
|
28
25
|
</head>
|
|
29
26
|
<body>
|
|
30
27
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leitwerk-dev/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/leitwerk-dev/leitwerk.git",
|
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
"preview": "vite preview"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@leitwerk-dev/
|
|
18
|
-
"@leitwerk-dev/
|
|
19
|
-
"@leitwerk-dev/protocol": "0.
|
|
20
|
-
"@leitwerk-dev/worker-protocol": "0.3.1",
|
|
16
|
+
"@leitwerk-dev/domain": "0.4.1",
|
|
17
|
+
"@leitwerk-dev/process-sdk": "0.4.1",
|
|
18
|
+
"@leitwerk-dev/protocol": "0.4.1",
|
|
19
|
+
"@leitwerk-dev/worker-protocol": "0.4.1",
|
|
21
20
|
"beautiful-mermaid": "^1.1.3",
|
|
22
21
|
"dompurify": "^3.4.0",
|
|
23
|
-
"elkjs": "^0.
|
|
22
|
+
"elkjs": "^0.12.0",
|
|
24
23
|
"markdown-it": "^14.1.1",
|
|
25
|
-
"valibot": "^1.3.1"
|
|
24
|
+
"valibot": "^1.3.1",
|
|
25
|
+
"@leitwerk-dev/wiki": "0.4.1",
|
|
26
|
+
"@leitwerk-dev/workflow-graph": "0.4.1"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@leitwerk-dev/test-support": "0.
|
|
29
|
+
"@leitwerk-dev/test-support": "0.4.1",
|
|
29
30
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
30
31
|
"@types/markdown-it": "^14.1.2",
|
|
31
32
|
"svelte": "^5.55.0",
|
package/src/App.svelte
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
dispatchBrowserUiExtensionWsFrame,
|
|
17
17
|
loadBrowserUiExtensions,
|
|
18
18
|
} from "./lib/ui-extensions.svelte.js";
|
|
19
|
+
import { notifyWikiUpdated } from "./lib/wiki.js";
|
|
19
20
|
import { connect, onWsEvent } from "./lib/ws.svelte";
|
|
20
21
|
import AppShell from "./shell/AppShell.svelte";
|
|
21
22
|
|
|
@@ -61,6 +62,14 @@ $effect(() => {
|
|
|
61
62
|
realtimeStarted = true;
|
|
62
63
|
void loadBrowserUiExtensions();
|
|
63
64
|
onWsEvent((frame) => {
|
|
65
|
+
if (frame.type === "wiki.updated") {
|
|
66
|
+
notifyWikiUpdated(frame.payload.topicId);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (frame.type === "settings.updated") {
|
|
70
|
+
window.dispatchEvent(new Event("leitwerk:settings-changed"));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
64
73
|
if (dispatchLaunchUpdated(frame)) {
|
|
65
74
|
return;
|
|
66
75
|
}
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
import { tick } from "svelte";
|
|
11
11
|
import FormFieldRenderer from "../../components/FormFieldRenderer.svelte";
|
|
12
12
|
import ScheduleDateTimePicker from "../../components/ScheduleDateTimePicker.svelte";
|
|
13
|
-
import { formatRelativeTime } from "../../lib/format.js";
|
|
13
|
+
import { formatLocalDateTime, formatRelativeTime } from "../../lib/format.js";
|
|
14
14
|
import type { ActionSectionController } from "../lib/action-bindings.js";
|
|
15
15
|
import { buildActionModelDisplay } from "../lib/action-model-display.js";
|
|
16
16
|
import { describeActionPreview as describeSharedActionPreview } from "../lib/action-preview.js";
|
|
@@ -58,6 +58,7 @@ const sectionTitle = $derived.by(() => {
|
|
|
58
58
|
if (actions.length > 0) {
|
|
59
59
|
return "Decide what happens next";
|
|
60
60
|
}
|
|
61
|
+
if (selectedTurn?.readiness) return "Waiting to continue";
|
|
61
62
|
return "Waiting for an update";
|
|
62
63
|
});
|
|
63
64
|
const sectionDescription = $derived.by(() => {
|
|
@@ -335,7 +336,7 @@ function presentExternalTriggerSignal(signal: ProcessExternalTriggerSignal) {
|
|
|
335
336
|
<div class="action-header-copy">
|
|
336
337
|
<div class="action-status-row" aria-label={actions.length > 0 ? "Action required" : "External trigger"}>
|
|
337
338
|
<span class="action-status-dot" aria-hidden="true"></span>
|
|
338
|
-
<span>{actions.length > 0 ? "Action required" : "Waiting for an event"}</span>
|
|
339
|
+
<span>{actions.length > 0 ? "Action required" : selectedTurn?.readiness ? "Waiting for a condition" : "Waiting for an event"}</span>
|
|
339
340
|
</div>
|
|
340
341
|
<h3>{sectionTitle}</h3>
|
|
341
342
|
<p class="action-description">{sectionDescription}</p>
|
|
@@ -356,6 +357,13 @@ function presentExternalTriggerSignal(signal: ProcessExternalTriggerSignal) {
|
|
|
356
357
|
</div>
|
|
357
358
|
{/if}
|
|
358
359
|
|
|
360
|
+
{#if selectedTurn?.readiness}
|
|
361
|
+
<div data-section="turn-readiness" role="status">
|
|
362
|
+
<p class="action-description">{selectedTurn.readiness.message ?? "This step will continue when its condition is met."}</p>
|
|
363
|
+
<p class="action-description">{selectedTurn.readiness.nextCheckAt ? `Next check: ${formatLocalDateTime(selectedTurn.readiness.nextCheckAt)}.` : "Checking readiness…"}</p>
|
|
364
|
+
</div>
|
|
365
|
+
{/if}
|
|
366
|
+
|
|
359
367
|
{#if actions.length > 0}
|
|
360
368
|
<div class="action-row" role="group" aria-label="Available actions">
|
|
361
369
|
{#each actions as action, actionIndex (action.id)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Icon from "@leitwerk-dev/workflow-graph/internal/WorkflowIcon.svelte";
|
|
2
3
|
import type { Snippet } from "svelte";
|
|
3
4
|
import { formatRelativeTime } from "../../lib/format.js";
|
|
4
5
|
|
|
@@ -25,20 +26,7 @@ let {
|
|
|
25
26
|
|
|
26
27
|
<header class="entry-header" data-kind={kind}>
|
|
27
28
|
<span class="entry-icon" aria-hidden="true">
|
|
28
|
-
<
|
|
29
|
-
{#if kind === "llm"}
|
|
30
|
-
<path d="m10 3 2.2 6.8L19 12l-6.8 2.2L10 21l-2.2-6.8L1 12l6.8-2.2L10 3Z" fill="currentColor" stroke="none" />
|
|
31
|
-
<path d="m19 1 1 3 3 1-3 1-1 3-1-3-3-1 3-1 1-3Zm1 14 .8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8L20 15Z" fill="currentColor" stroke="none" />
|
|
32
|
-
{:else if kind === "operator"}
|
|
33
|
-
<circle cx="12" cy="7" r="3" /><path d="M5 21v-3a7 7 0 0 1 14 0v3M9 17l2 2 4-4" />
|
|
34
|
-
{:else if kind === "external"}
|
|
35
|
-
<path d="M5 5h14v14H5zM2 12h11m-3-3 3 3-3 3" />
|
|
36
|
-
{:else if kind === "prompt" || kind === "result"}
|
|
37
|
-
<path d="M6 3h8l4 4v14H6zM14 3v5h4M9 12h6M9 16h6" />
|
|
38
|
-
{:else}
|
|
39
|
-
<path d="m10 3-1 3-3 1-3 3v4l3 1 1 3 3 3h4l1-3 3-1 3-3v-4l-3-1-1-3-3-3h-4Z" transform="translate(0 -1) scale(1 .95)" /><circle cx="12" cy="11" r="3" />
|
|
40
|
-
{/if}
|
|
41
|
-
</svg>
|
|
29
|
+
<Icon name={kind === 'system' ? 'automatic' : kind === 'operator' ? 'human' : kind === 'prompt' || kind === 'result' ? 'document' : kind} />
|
|
42
30
|
{#if failed}<svg class="failure-badge" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="7" fill="var(--chronicle-danger)" stroke="var(--chronicle-card-surface)" stroke-width="1.5" /><path d="M8 4.5v4M8 11v.5" stroke="white" stroke-width="1.5" stroke-linecap="round" /></svg>{/if}
|
|
43
31
|
</span>
|
|
44
32
|
<div class="entry-heading">
|
|
@@ -56,7 +44,7 @@ let {
|
|
|
56
44
|
<style>
|
|
57
45
|
.entry-header { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 28px; align-items: start; gap: 10px; min-width: 0; }
|
|
58
46
|
.entry-icon { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--chronicle-panel-muted); color: var(--chronicle-text-muted); }
|
|
59
|
-
.entry-icon svg { width: 20px; height: 20px; }
|
|
47
|
+
.entry-icon :global(svg) { width: 20px; height: 20px; }
|
|
60
48
|
.entry-icon .failure-badge { position: absolute; top: 0; right: -5px; width: 16px; height: 16px; }
|
|
61
49
|
[data-kind="llm"] .entry-icon { color: var(--chronicle-accent); background: color-mix(in srgb, var(--chronicle-accent) 9%, var(--chronicle-card-surface)); }
|
|
62
50
|
.entry-heading { min-width: 0; padding-top: 3px; }
|
|
@@ -67,7 +55,7 @@ let {
|
|
|
67
55
|
@media (max-width: 540px) {
|
|
68
56
|
.entry-header { grid-template-columns: 26px minmax(0, 1fr) auto 24px; gap: 6px; }
|
|
69
57
|
.entry-icon { width: 26px; height: 26px; }
|
|
70
|
-
.entry-icon svg { width: 17px; height: 17px; }
|
|
58
|
+
.entry-icon :global(svg) { width: 17px; height: 17px; }
|
|
71
59
|
.entry-heading { padding-top: 2px; }
|
|
72
60
|
h3 { font-size: var(--type-body); }
|
|
73
61
|
.entry-timing { gap: 4px; font-size: 11px; padding-top: 4px; }
|
|
@@ -73,9 +73,10 @@ interface Props {
|
|
|
73
73
|
summary: string;
|
|
74
74
|
guidance?: string;
|
|
75
75
|
technicalDetail?: string | null;
|
|
76
|
+
canRetry?: boolean;
|
|
76
77
|
} | null;
|
|
77
78
|
modelConfiguration: ProcessModelConfigurationView;
|
|
78
|
-
onOpenReasoningDetails: (turnRecordId: string) => void;
|
|
79
|
+
onOpenReasoningDetails: (turnRecordId: string, itemId?: string) => void;
|
|
79
80
|
onDraftTicket?: (artifact: ChronicleTicketArtifact) => void;
|
|
80
81
|
hasTerminalSummary?: boolean;
|
|
81
82
|
}
|
|
@@ -105,6 +106,16 @@ let {
|
|
|
105
106
|
hasTerminalSummary = false,
|
|
106
107
|
}: Props = $props();
|
|
107
108
|
|
|
109
|
+
const inheritedRecoveryModel = $derived(
|
|
110
|
+
modelConfiguration.turns.find((turn) => turn.turnId === selectedTurn?.turnId)
|
|
111
|
+
?.effectiveModelProfileId ?? null,
|
|
112
|
+
);
|
|
113
|
+
const recoveryModel = $derived(
|
|
114
|
+
modelConfiguration.effectiveSelectedTurn?.source === "action_override"
|
|
115
|
+
? modelConfiguration.effectiveSelectedTurn.modelProfileId
|
|
116
|
+
: inheritedRecoveryModel,
|
|
117
|
+
);
|
|
118
|
+
|
|
108
119
|
const retryGroups = $derived(
|
|
109
120
|
groupRetryChains(projection.timelineItems, (item) =>
|
|
110
121
|
item.kind === "turn_cluster" || item.kind === "live_tail"
|
|
@@ -197,6 +208,7 @@ const hasTrailingProcessSection = $derived(
|
|
|
197
208
|
recovery !== null ||
|
|
198
209
|
startupRecovery !== null ||
|
|
199
210
|
processError !== null ||
|
|
211
|
+
selectedTurn?.readiness !== undefined ||
|
|
200
212
|
actionBindings.actionSectionActions.length > 0 ||
|
|
201
213
|
externalTriggers.length > 0,
|
|
202
214
|
);
|
|
@@ -244,7 +256,8 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
244
256
|
retryBusy={recoveryController.retryBusy}
|
|
245
257
|
retryError={recoveryController.retryError}
|
|
246
258
|
modelProfiles={modelConfiguration.availableProfiles}
|
|
247
|
-
defaultModelProfileId={
|
|
259
|
+
defaultModelProfileId={recoveryModel}
|
|
260
|
+
inheritedModelProfileId={inheritedRecoveryModel}
|
|
248
261
|
defaultProviderOptions={recovery.providerOptions}
|
|
249
262
|
onContinue={(prompt, modelProfileId, providerOptions) =>
|
|
250
263
|
recoveryController.continueFailedTurn(
|
|
@@ -285,7 +298,8 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
285
298
|
{instanceId}
|
|
286
299
|
recovery={startupRecovery}
|
|
287
300
|
modelProfiles={modelConfiguration.availableProfiles}
|
|
288
|
-
defaultModelProfileId={
|
|
301
|
+
defaultModelProfileId={recoveryModel}
|
|
302
|
+
inheritedModelProfileId={inheritedRecoveryModel}
|
|
289
303
|
busy={recoveryController.startupRetryBusy}
|
|
290
304
|
error={recoveryController.startupRetryError}
|
|
291
305
|
onRetry={recoveryController.retryStartup}
|
|
@@ -298,6 +312,9 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
298
312
|
summary={processError.summary}
|
|
299
313
|
guidance={processError.guidance}
|
|
300
314
|
technicalDetail={processError.technicalDetail}
|
|
315
|
+
onRetry={processError.canRetry ? () => recoveryController.retryFailedTurn() : undefined}
|
|
316
|
+
busy={recoveryController.retryBusy}
|
|
317
|
+
error={recoveryController.retryError}
|
|
301
318
|
/>
|
|
302
319
|
{:else}
|
|
303
320
|
<ChronicleActionSection
|
|
@@ -357,9 +374,6 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
357
374
|
|
|
358
375
|
<div class="chronicle-flow" class:has-terminal-summary={hasTerminalSummary} data-section="chronicle-flow">
|
|
359
376
|
<ChronicleStartupHistory {startup} />
|
|
360
|
-
{#each toolApprovalRequests.filter((request) => request.status === "open") as request (request.id)}
|
|
361
|
-
<ChronicleToolApproval {request} />
|
|
362
|
-
{/each}
|
|
363
377
|
{#each retryGroups as group, groupIndex (chronicleItemKey(group[0], groupIndex))}
|
|
364
378
|
{#if group.length > 1 && group[0].kind === "turn_cluster"}
|
|
365
379
|
<details data-section="retry-history">
|
|
@@ -375,6 +389,10 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
375
389
|
{/if}
|
|
376
390
|
{/each}
|
|
377
391
|
|
|
392
|
+
{#each toolApprovalRequests.filter((request) => request.status === "open") as request (request.id)}
|
|
393
|
+
<ChronicleToolApproval {request} />
|
|
394
|
+
{/each}
|
|
395
|
+
|
|
378
396
|
{#if shouldRenderTrailingAfterFlow}
|
|
379
397
|
{@render trailingProcessSection()}
|
|
380
398
|
{/if}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ProcessQuestionRequest } from "@leitwerk-dev/domain";
|
|
3
|
-
import { formatDefinition } from "../../lib/format.js";
|
|
3
|
+
import { formatDefinition, formatRelativeTime } from "../../lib/format.js";
|
|
4
4
|
import type { ChronicleLiveTailItem } from "../lib/chronicle-projection.js";
|
|
5
5
|
import { formatChronicleIterationProgress } from "../lib/chronicle-view-model.js";
|
|
6
6
|
import { formatChronicleCost } from "../lib/formatting.js";
|
|
@@ -13,7 +13,7 @@ interface Props {
|
|
|
13
13
|
liveTail: ChronicleLiveTailItem;
|
|
14
14
|
questionRequests?: readonly ProcessQuestionRequest[];
|
|
15
15
|
isFocused: boolean;
|
|
16
|
-
onOpenReasoningDetails: (turnRecordId: string) => void;
|
|
16
|
+
onOpenReasoningDetails: (turnRecordId: string, itemId?: string) => void;
|
|
17
17
|
onAbortTurn?: (() => Promise<void> | void) | null;
|
|
18
18
|
abortBusy?: boolean;
|
|
19
19
|
abortError?: string | null;
|
|
@@ -42,6 +42,29 @@ const hasReasoning = $derived(
|
|
|
42
42
|
liveTail.reasoningSection.traceItemCount),
|
|
43
43
|
),
|
|
44
44
|
);
|
|
45
|
+
const isThinking = $derived(
|
|
46
|
+
!openQuestionRequest &&
|
|
47
|
+
liveTail.state === "thinking" &&
|
|
48
|
+
Boolean(liveTail.reasoningSection?.preview.trim() || liveTail.reasoningSection?.text.trim()),
|
|
49
|
+
);
|
|
50
|
+
const prepared = $derived(
|
|
51
|
+
liveTail.turnType === "llm" &&
|
|
52
|
+
Boolean(
|
|
53
|
+
liveTail.progress &&
|
|
54
|
+
(liveTail.progress.steps.length
|
|
55
|
+
? liveTail.progress.steps.every((step) => step.status === "completed")
|
|
56
|
+
: liveTail.progress.summary &&
|
|
57
|
+
!liveTail.activitySummary &&
|
|
58
|
+
(hasReasoning || liveTail.assistantTextPreview || liveTail.toolCall || liveTail.usage)),
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
const hasProgressDetails = $derived(
|
|
62
|
+
Boolean(
|
|
63
|
+
liveTail.progress?.steps.length ||
|
|
64
|
+
liveTail.progress?.links?.length ||
|
|
65
|
+
(liveTail.progress?.summary && !liveTail.activitySummary),
|
|
66
|
+
),
|
|
67
|
+
);
|
|
45
68
|
|
|
46
69
|
function requestStop() {
|
|
47
70
|
if (!confirmingStop) {
|
|
@@ -88,15 +111,15 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
88
111
|
timestamp={liveTail.facts.startedAt}
|
|
89
112
|
duration={openQuestionRequest ? "Paused" : "Running"}
|
|
90
113
|
/>
|
|
91
|
-
{#if !openQuestionRequest}<p class="live-copy" role="status">{liveTail.stateLabel}{#if liveTail.toolCall} · {formatDefinition(liveTail.toolCall.toolName)}{/if}</p>{/if}
|
|
114
|
+
{#if !openQuestionRequest && !isThinking}<p class="live-copy" role="status">{liveTail.stateLabel}{#if liveTail.toolCall} · {formatDefinition(liveTail.toolCall.toolName)}{/if}{#if liveTail.activitySummary && liveTail.progressRecordedAt} <time class="activity-time" datetime={liveTail.progressRecordedAt} title={new Date(liveTail.progressRecordedAt).toLocaleString()}>Updated {formatRelativeTime(liveTail.progressRecordedAt)}</time>{/if}</p>{/if}
|
|
92
115
|
{#if liveTail.assistantTextPreview}
|
|
93
116
|
<div class="live-result"><p>{liveTail.assistantTextPreview}</p></div>
|
|
94
|
-
{:else if !liveTail.reasoningSection && liveTail.state !== "tool_running"}
|
|
117
|
+
{:else if !liveTail.activitySummary && !liveTail.reasoningSection && liveTail.state !== "tool_running"}
|
|
95
118
|
<p class="live-copy">{liveTail.copy}</p>
|
|
96
119
|
{/if}
|
|
97
120
|
|
|
98
|
-
{#if liveTail.progress}
|
|
99
|
-
<ChronicleTurnProgress report={liveTail.progress} recordedAt={liveTail.progressRecordedAt} attemptStatus="in_progress" />
|
|
121
|
+
{#if liveTail.progress && !prepared && hasProgressDetails}
|
|
122
|
+
<ChronicleTurnProgress report={liveTail.progress} showSummary={!liveTail.activitySummary} recordedAt={liveTail.progressRecordedAt} attemptStatus="in_progress" />
|
|
100
123
|
{/if}
|
|
101
124
|
|
|
102
125
|
{#if liveTail.reasoningSection || questionRequests.length > 0}
|
|
@@ -107,6 +130,7 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
107
130
|
traceItemCount={liveTail.reasoningSection?.traceItemCount ?? 0}
|
|
108
131
|
{questionRequests}
|
|
109
132
|
isLive={true}
|
|
133
|
+
{isThinking}
|
|
110
134
|
/>
|
|
111
135
|
{/if}
|
|
112
136
|
|
|
@@ -156,9 +180,14 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
156
180
|
</div>
|
|
157
181
|
{/if}
|
|
158
182
|
{#if liveTail.turnType === "llm" || hasReasoning}
|
|
159
|
-
<div class="live-footer">
|
|
160
|
-
|
|
161
|
-
|
|
183
|
+
<div class="live-footer" class:has-reasoning={hasReasoning}>
|
|
184
|
+
<div class="support-progress">
|
|
185
|
+
{#if prepared && liveTail.progress}<ChronicleTurnProgress report={liveTail.progress} recordedAt={liveTail.progressRecordedAt} attemptStatus="in_progress" compact />{/if}
|
|
186
|
+
</div>
|
|
187
|
+
<div class="turn-info-actions">
|
|
188
|
+
{#if hasReasoning}<ChronicleTurnDetailsButton kind="reasoning" title={liveTail.title} onClick={() => onOpenReasoningDetails(liveTail.turnRecordId, "reasoning")} />{/if}
|
|
189
|
+
{#if liveTail.turnType === "llm"}<ChronicleTurnDetailsButton title={liveTail.title} onClick={() => onOpenReasoningDetails(liveTail.turnRecordId)} />{/if}
|
|
190
|
+
</div>
|
|
162
191
|
</div>
|
|
163
192
|
{/if}
|
|
164
193
|
</div>
|
|
@@ -168,8 +197,11 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
168
197
|
.live-tail { padding: 14px; border: 1px solid color-mix(in srgb, var(--chronicle-accent) 35%, var(--chronicle-border)); border-radius: 10px; background: var(--chronicle-card-surface); scroll-margin-top: var(--space-sm); }
|
|
169
198
|
.live-tail.is-focused { border-color: var(--chronicle-accent); }
|
|
170
199
|
.live-tail-body { display: flex; flex-direction: column; gap: 10px; }
|
|
171
|
-
.live-footer { display:
|
|
172
|
-
.
|
|
200
|
+
.live-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; min-width: 0; }
|
|
201
|
+
.support-progress { min-width: 0; }
|
|
202
|
+
.turn-info-actions { display: flex; align-items: center; gap: 14px; }
|
|
203
|
+
.live-copy { margin: 0; color: var(--chronicle-text-muted); font-size: var(--type-body-sm); line-height: 1.5; overflow-wrap: anywhere; }
|
|
204
|
+
.activity-time { margin-left: 8px; font-size: var(--type-caption); white-space: nowrap; }
|
|
173
205
|
|
|
174
206
|
.live-result { padding: 10px 12px; border-radius: 6px; background: color-mix(in srgb, var(--chronicle-accent) 6%, var(--chronicle-card-surface)); }
|
|
175
207
|
.live-result p { max-width: 72ch; margin: 0; color: var(--chronicle-text); font-size: var(--type-body); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
@@ -193,27 +225,15 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
193
225
|
|
|
194
226
|
.stop-trigger {
|
|
195
227
|
align-self: flex-start;
|
|
196
|
-
min-height: 34px;
|
|
197
|
-
padding: 0 14px;
|
|
198
|
-
border-radius: 999px;
|
|
199
228
|
border: 1px solid var(--chronicle-danger-border);
|
|
200
229
|
background: var(--chronicle-card-surface);
|
|
201
230
|
color: var(--chronicle-danger-text);
|
|
202
|
-
font: inherit;
|
|
203
|
-
font-size: 13px;
|
|
204
|
-
font-weight: 600;
|
|
205
|
-
cursor: pointer;
|
|
206
231
|
}
|
|
207
232
|
|
|
208
233
|
.stop-trigger:hover:not(:disabled) {
|
|
209
234
|
background: var(--chronicle-danger-surface);
|
|
210
235
|
}
|
|
211
236
|
|
|
212
|
-
.stop-trigger:disabled {
|
|
213
|
-
opacity: 0.5;
|
|
214
|
-
cursor: default;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
237
|
.stop-confirm {
|
|
218
238
|
display: flex;
|
|
219
239
|
flex-wrap: wrap;
|
|
@@ -238,6 +258,7 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
238
258
|
gap: 8px;
|
|
239
259
|
}
|
|
240
260
|
|
|
261
|
+
.stop-trigger,
|
|
241
262
|
.stop-cancel,
|
|
242
263
|
.stop-confirm-btn {
|
|
243
264
|
min-height: 34px;
|
|
@@ -269,10 +290,17 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
269
290
|
opacity: 0.9;
|
|
270
291
|
}
|
|
271
292
|
|
|
293
|
+
.stop-trigger:disabled,
|
|
272
294
|
.stop-cancel:disabled,
|
|
273
295
|
.stop-confirm-btn:disabled {
|
|
274
296
|
opacity: 0.5;
|
|
275
297
|
cursor: default;
|
|
276
298
|
}
|
|
277
|
-
|
|
299
|
+
@media (max-width: 540px) {
|
|
300
|
+
.live-tail { padding: 10px; }
|
|
301
|
+
.live-footer.has-reasoning { grid-template-columns: minmax(0, 1fr); gap: 6px; }
|
|
302
|
+
.has-reasoning .turn-info-actions { grid-row: 1; justify-content: flex-end; }
|
|
303
|
+
.has-reasoning .support-progress { grid-row: 2; }
|
|
304
|
+
.has-reasoning .support-progress:empty { display: none; }
|
|
305
|
+
}
|
|
278
306
|
</style>
|
|
@@ -9,6 +9,9 @@ interface Props {
|
|
|
9
9
|
summary: string;
|
|
10
10
|
guidance?: string;
|
|
11
11
|
technicalDetail?: string | null;
|
|
12
|
+
onRetry?: () => Promise<void> | void;
|
|
13
|
+
busy?: boolean;
|
|
14
|
+
error?: string | null;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
let {
|
|
@@ -18,6 +21,9 @@ let {
|
|
|
18
21
|
summary,
|
|
19
22
|
guidance = "This process stopped before it produced a recoverable failed turn. Inspect the latest state, then retry or restart it when you are ready.",
|
|
20
23
|
technicalDetail = null,
|
|
24
|
+
onRetry,
|
|
25
|
+
busy = false,
|
|
26
|
+
error = null,
|
|
21
27
|
}: Props = $props();
|
|
22
28
|
</script>
|
|
23
29
|
|
|
@@ -25,10 +31,18 @@ let {
|
|
|
25
31
|
<ChronicleEntryHeader {title} kind="system" failed />
|
|
26
32
|
<ChronicleFailureMessage {summary} {technicalDetail} />
|
|
27
33
|
<p class="process-error-guidance">{guidance}</p>
|
|
34
|
+
{#if onRetry}
|
|
35
|
+
<button type="button" class="secondary-button" data-action="retry-waiting-condition" disabled={busy} onclick={() => onRetry?.()}>
|
|
36
|
+
{busy ? "Retrying…" : "Retry condition"}
|
|
37
|
+
</button>
|
|
38
|
+
{/if}
|
|
39
|
+
{#if error}<p class="process-error-retry" role="alert">{error}</p>{/if}
|
|
28
40
|
</section>
|
|
29
41
|
|
|
30
42
|
<style>
|
|
31
43
|
.process-error-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--chronicle-danger) 50%, var(--chronicle-border)); border-radius: 10px; background: color-mix(in srgb, var(--chronicle-danger) 2%, var(--chronicle-card-surface)); scroll-margin-top: 28px; }
|
|
32
44
|
.process-error-guidance { margin: 0; color: var(--chronicle-text-muted); font-size: var(--type-body-sm); line-height: 1.55; }
|
|
45
|
+
button { align-self: flex-start; }
|
|
46
|
+
.process-error-retry { margin: 0; color: var(--chronicle-danger); }
|
|
33
47
|
@media (max-width: 540px) { .process-error-section { padding: 10px; } }
|
|
34
48
|
</style>
|
|
@@ -60,7 +60,7 @@ async function submit() {
|
|
|
60
60
|
}
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
|
-
<section class="question-request" id={
|
|
63
|
+
<section class="question-request" id={`${mode === "trace" ? "question-trace" : "question-request"}-${request.id}`} data-question-request-id={request.id}>
|
|
64
64
|
<div class="question-heading">
|
|
65
65
|
<h4>{request.status === "open" ? "Waiting for your answers" : request.status === "answered" ? "Questions answered" : "Question request interrupted"}</h4>
|
|
66
66
|
<p>{request.status === "open" ? "The active turn will continue here after you send the complete set." : "This durable record belongs to the turn’s reasoning history."}</p>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ModelProfileOptionSummary } from "@leitwerk-dev/protocol";
|
|
3
|
+
import { recoveryModelSelection } from "../lib/recovery-model.js";
|
|
3
4
|
import ChronicleEntryHeader from "./ChronicleEntryHeader.svelte";
|
|
4
5
|
import ChronicleFailureMessage from "./ChronicleFailureMessage.svelte";
|
|
5
6
|
import RecoveryModelControl from "./RecoveryModelControl.svelte";
|
|
@@ -23,6 +24,7 @@ interface Props {
|
|
|
23
24
|
retryError?: string | null;
|
|
24
25
|
modelProfiles?: readonly ModelProfileOptionSummary[];
|
|
25
26
|
defaultModelProfileId?: string | null;
|
|
27
|
+
inheritedModelProfileId?: string | null;
|
|
26
28
|
defaultProviderOptions?: Readonly<Record<string, string>>;
|
|
27
29
|
onContinue: (
|
|
28
30
|
prompt: string,
|
|
@@ -54,24 +56,25 @@ let {
|
|
|
54
56
|
retryError = null,
|
|
55
57
|
modelProfiles = [],
|
|
56
58
|
defaultModelProfileId = null,
|
|
59
|
+
inheritedModelProfileId = null,
|
|
57
60
|
defaultProviderOptions = {},
|
|
58
61
|
onContinue,
|
|
59
62
|
onRetry,
|
|
60
63
|
}: Props = $props();
|
|
61
64
|
|
|
62
65
|
let continuePromptDraft = $state((() => continuePrompt)());
|
|
63
|
-
let modelProfileDraft = $state
|
|
66
|
+
let modelProfileDraft = $state<string | null | undefined>(undefined);
|
|
64
67
|
let providerOptionsDraft = $state<Record<string, string> | undefined>(undefined);
|
|
65
68
|
|
|
66
69
|
const controlsBusy = $derived(continueBusy || retryBusy);
|
|
67
70
|
const continuePromptValid = $derived(continuePromptDraft.trim().length > 0);
|
|
68
|
-
const selectedProfile = $derived(
|
|
69
|
-
modelProfiles.find((profile) => profile.id === modelProfileDraft) ?? null,
|
|
70
|
-
);
|
|
71
71
|
const selectedModelUsable = $derived(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
recoveryModelSelection(
|
|
73
|
+
modelProfiles,
|
|
74
|
+
modelProfileDraft,
|
|
75
|
+
defaultModelProfileId,
|
|
76
|
+
inheritedModelProfileId,
|
|
77
|
+
).usable,
|
|
75
78
|
);
|
|
76
79
|
|
|
77
80
|
let optionsExpanded = $state(false);
|
|
@@ -95,7 +98,7 @@ let optionsExpanded = $state(false);
|
|
|
95
98
|
<label class="continue-label" for={`continue-prompt-${turnRecordId}`}>Message before continuing</label>
|
|
96
99
|
<textarea id={`continue-prompt-${turnRecordId}`} class="continue-textarea" data-field="continue-prompt" rows="3" bind:value={continuePromptDraft} disabled={controlsBusy}></textarea>
|
|
97
100
|
<p class="continue-help">Use the suggested message or add instructions for the resumed run.</p>
|
|
98
|
-
<button type="button" class="recovery-button continue-button" data-action="continue-failed-turn" data-turn-record-id={turnRecordId} data-pressable="true" disabled={controlsBusy || !continuePromptValid || !selectedModelUsable} onclick={() => onContinue(continuePromptDraft, modelProfileDraft
|
|
101
|
+
<button type="button" class="recovery-button continue-button" data-action="continue-failed-turn" data-turn-record-id={turnRecordId} data-pressable="true" disabled={controlsBusy || !continuePromptValid || !selectedModelUsable} onclick={() => onContinue(continuePromptDraft, modelProfileDraft, providerOptionsDraft)}>
|
|
99
102
|
{continueBusy ? "Continuing…" : "Continue from saved work"}
|
|
100
103
|
</button>
|
|
101
104
|
</div>
|
|
@@ -108,7 +111,7 @@ let optionsExpanded = $state(false);
|
|
|
108
111
|
{#if !canContinue}<p class="recovery-guidance" data-section="continue-unavailable">There isn't enough saved progress to resume from the failure point.</p>{/if}
|
|
109
112
|
</div>
|
|
110
113
|
<div class="recovery-actions" role="group" aria-label="Recovery actions">
|
|
111
|
-
<button type="button" class="recovery-button" data-action="retry-failed-turn" data-turn-record-id={turnRecordId} data-pressable="true" disabled={controlsBusy || !selectedModelUsable} onclick={() => onRetry(modelProfileDraft
|
|
114
|
+
<button type="button" class="recovery-button" data-action="retry-failed-turn" data-turn-record-id={turnRecordId} data-pressable="true" disabled={controlsBusy || !selectedModelUsable} onclick={() => onRetry(modelProfileDraft, providerOptionsDraft)}>
|
|
112
115
|
{retryBusy ? "Retrying failed turn…" : "Retry failed turn"}
|
|
113
116
|
</button>
|
|
114
117
|
{#if supportsModelOverride}
|
|
@@ -126,12 +129,13 @@ let optionsExpanded = $state(false);
|
|
|
126
129
|
{instanceId}
|
|
127
130
|
{modelProfiles}
|
|
128
131
|
defaultModelProfileId={defaultModelProfileId ?? null}
|
|
132
|
+
{inheritedModelProfileId}
|
|
129
133
|
initialProviderOptions={defaultProviderOptions}
|
|
130
134
|
disabled={controlsBusy}
|
|
131
135
|
selectId={`recovery-model-${turnRecordId}`}
|
|
132
136
|
selectLabel="Model for the new attempt"
|
|
133
137
|
selectDataField="recovery-model"
|
|
134
|
-
onModelChange={(profileId, _usable) => { modelProfileDraft = profileId
|
|
138
|
+
onModelChange={(profileId, _usable) => { modelProfileDraft = profileId; }}
|
|
135
139
|
onProviderOptionsChange={(values) => (providerOptionsDraft = values ? { ...values } : undefined)}
|
|
136
140
|
/>
|
|
137
141
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ModelProfileOptionSummary, StartupRecoverySummary } from "@leitwerk-dev/protocol";
|
|
3
|
+
import { recoveryModelSelection } from "../lib/recovery-model.js";
|
|
3
4
|
import ChronicleEntryHeader from "./ChronicleEntryHeader.svelte";
|
|
4
5
|
import ChronicleFailureMessage from "./ChronicleFailureMessage.svelte";
|
|
5
6
|
import RecoveryModelControl from "./RecoveryModelControl.svelte";
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
instanceId: string;
|
|
10
11
|
modelProfiles?: readonly ModelProfileOptionSummary[];
|
|
11
12
|
defaultModelProfileId?: string | null;
|
|
13
|
+
inheritedModelProfileId?: string | null;
|
|
12
14
|
busy?: boolean;
|
|
13
15
|
error?: string | null;
|
|
14
16
|
onRetry: (
|
|
@@ -23,20 +25,21 @@ let {
|
|
|
23
25
|
instanceId,
|
|
24
26
|
modelProfiles = [],
|
|
25
27
|
defaultModelProfileId = null,
|
|
28
|
+
inheritedModelProfileId = null,
|
|
26
29
|
busy = false,
|
|
27
30
|
error = null,
|
|
28
31
|
onRetry,
|
|
29
32
|
}: Props = $props();
|
|
30
33
|
|
|
31
|
-
let modelProfileDraft = $state
|
|
34
|
+
let modelProfileDraft = $state<string | null | undefined>(undefined);
|
|
32
35
|
let providerOptionsDraft = $state<Record<string, string> | undefined>(undefined);
|
|
33
|
-
const selectedProfile = $derived(
|
|
34
|
-
modelProfiles.find((profile) => profile.id === modelProfileDraft) ?? null,
|
|
35
|
-
);
|
|
36
36
|
const selectedModelUsable = $derived(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
recoveryModelSelection(
|
|
38
|
+
modelProfiles,
|
|
39
|
+
modelProfileDraft,
|
|
40
|
+
defaultModelProfileId,
|
|
41
|
+
inheritedModelProfileId,
|
|
42
|
+
).usable,
|
|
40
43
|
);
|
|
41
44
|
</script>
|
|
42
45
|
|
|
@@ -44,17 +47,26 @@ const selectedModelUsable = $derived(
|
|
|
44
47
|
<ChronicleEntryHeader title={recovery.title} kind="system" failed />
|
|
45
48
|
<ChronicleFailureMessage summary={recovery.summary} technicalDetail={recovery.technicalDetail} />
|
|
46
49
|
{#if recovery.guidance}<p class="guidance">{recovery.guidance}</p>{/if}
|
|
50
|
+
{#if recovery.automaticRetry}
|
|
51
|
+
<p class="guidance" data-field="startup-retry-policy">
|
|
52
|
+
{recovery.automaticRetry.reason} Starts: {recovery.automaticRetry.starts}/{recovery.automaticRetry.maxStarts}.
|
|
53
|
+
{#if recovery.automaticRetry.nextRetryAt}
|
|
54
|
+
Next automatic retry: <time datetime={recovery.automaticRetry.nextRetryAt}>{new Date(recovery.automaticRetry.nextRetryAt).toLocaleTimeString()}</time>.
|
|
55
|
+
{/if}
|
|
56
|
+
</p>
|
|
57
|
+
{/if}
|
|
47
58
|
<RecoveryModelControl
|
|
48
59
|
{instanceId}
|
|
49
60
|
{modelProfiles}
|
|
50
61
|
defaultModelProfileId={defaultModelProfileId ?? null}
|
|
62
|
+
{inheritedModelProfileId}
|
|
51
63
|
initialProviderOptions={recovery.providerOptions}
|
|
52
64
|
disabled={busy}
|
|
53
65
|
selectId={`startup-model-${recovery.startRecordId}`}
|
|
54
66
|
selectLabel="Model"
|
|
55
67
|
selectDataField="startup-recovery-model"
|
|
56
68
|
onModelChange={(profileId) => {
|
|
57
|
-
modelProfileDraft = profileId
|
|
69
|
+
modelProfileDraft = profileId;
|
|
58
70
|
}}
|
|
59
71
|
onProviderOptionsChange={(values) => (providerOptionsDraft = values ? { ...values } : undefined)}
|
|
60
72
|
/>
|
|
@@ -62,9 +74,9 @@ const selectedModelUsable = $derived(
|
|
|
62
74
|
type="button"
|
|
63
75
|
data-action="retry-startup"
|
|
64
76
|
data-start-record-id={recovery.startRecordId}
|
|
65
|
-
disabled={busy || !selectedModelUsable || (recovery.action === "choose_model" && !modelProfileDraft)}
|
|
77
|
+
disabled={busy || !selectedModelUsable || (recovery.action === "choose_model" && !(modelProfileDraft ?? inheritedModelProfileId ?? defaultModelProfileId))}
|
|
66
78
|
onclick={() =>
|
|
67
|
-
onRetry(recovery.startRecordId, modelProfileDraft
|
|
79
|
+
onRetry(recovery.startRecordId, modelProfileDraft, providerOptionsDraft)}
|
|
68
80
|
>
|
|
69
81
|
{busy
|
|
70
82
|
? "Retrying…"
|