@leitwerk-dev/ui 0.3.0 → 0.4.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-DCmYvZdE.js +1 -0
- package/dist/assets/ChronicleMarkdown-6T_LF-3B.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-D5Gc8YmZ.js +1 -0
- package/dist/assets/GenericLauncher-4BQGl6fT.js +4 -0
- package/dist/assets/GenericLauncher-DRUMMTd7.css +1 -0
- package/dist/assets/HomePage-mb9RzXht.js +1 -0
- package/dist/assets/ProcessActionsMenu-CEzADnZT.js +1 -0
- package/dist/assets/ProcessDetailPage-0c-fMf4Y.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-CVvENTJg.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-CbNM5RWn.js +2 -0
- package/dist/assets/SkillsPage-rCSwSz89.js +2 -0
- package/dist/assets/WatchersPage-D-uT5vWk.js +1 -0
- package/dist/assets/WikiPage-BNdWnJ6L.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-BXXSFKbw.js +1 -0
- package/dist/assets/index-DybyOt1_.css +1 -0
- package/dist/assets/{index-client-BYQviCtQ.js → index-client-BSAA7n1a.js} +2 -2
- package/dist/assets/index-gVt2yBO1.js +21 -0
- 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 +25 -6
- package/src/chronicle/components/ChronicleLiveTail.svelte +54 -25
- 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 +14 -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 +9 -6
- package/src/chronicle/components/ChronicleTurnProgress.svelte +10 -4
- package/src/chronicle/components/ChronicleTurnRail.svelte +10 -2
- package/src/chronicle/components/RecoveryModelControl.svelte +14 -13
- package/src/chronicle/lib/chronicle-projection.ts +82 -383
- package/src/chronicle/lib/chronicle-rail-groups.ts +8 -1
- package/src/chronicle/lib/chronicle-selectable-items.ts +25 -3
- package/src/chronicle/lib/chronicle-view-model.ts +18 -1
- package/src/chronicle/lib/recovery-model.ts +17 -0
- package/src/chronicle/lib/retry-groups.ts +13 -5
- package/src/components/ConversationTreeDiagram.svelte +93 -30
- package/src/components/FormFieldRenderer.svelte +184 -27
- package/src/components/GenericLauncher.svelte +378 -166
- package/src/components/NamedSelectionList.svelte +77 -0
- 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 +89 -43
- 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 +101 -51
- package/src/lib/router.svelte.ts +4 -4
- package/src/lib/settings.ts +114 -0
- package/src/lib/wiki.ts +34 -0
- 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 +5 -0
- package/src/shell/Sidebar.svelte +10 -0
- package/src/test-support/mount.ts +34 -0
- package/dist/assets/ApiTokensPage-ClJp9PYr.js +0 -1
- package/dist/assets/ChronicleMarkdown-lqwX9Ywa.js +0 -16
- package/dist/assets/FutureLaunchDetailPage-CB7mNpYv.js +0 -1
- package/dist/assets/GenericLauncher-CExW6wei.css +0 -1
- package/dist/assets/GenericLauncher-DTyRwWVd.js +0 -1
- package/dist/assets/HomePage-D_OT6OWU.js +0 -1
- package/dist/assets/PageHeader-DPuQInDo.css +0 -1
- package/dist/assets/PageHeader-sphJnWL1.js +0 -1
- package/dist/assets/ProcessActionsMenu-IKG-csM4.js +0 -1
- package/dist/assets/ProcessDetailPage-CiI5T6pN.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-CdnLkrSk.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-DmojMRxN.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-uacJAkIq.css +0 -1
- package/dist/assets/SkillsPage-CmiSWLOW.js +0 -2
- package/dist/assets/WatchersPage-Bu1vfZQI.js +0 -1
- package/dist/assets/http-client-VpPXJwbR.js +0 -2
- package/dist/assets/index-BkfAI7to.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-gVt2yBO1.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-DybyOt1_.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.0",
|
|
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.0",
|
|
16
|
+
"@leitwerk-dev/domain": "0.4.0",
|
|
17
|
+
"@leitwerk-dev/process-sdk": "0.4.0",
|
|
18
|
+
"@leitwerk-dev/protocol": "0.4.0",
|
|
19
|
+
"@leitwerk-dev/worker-protocol": "0.4.0",
|
|
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.0",
|
|
26
|
+
"@leitwerk-dev/workflow-graph": "0.4.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@leitwerk-dev/test-support": "0.
|
|
29
|
+
"@leitwerk-dev/test-support": "0.4.0",
|
|
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"
|
|
@@ -113,6 +124,7 @@ const retryGroups = $derived(
|
|
|
113
124
|
turnId: item.turnId,
|
|
114
125
|
parentTurnRecordId: item.parentTurnRecordId,
|
|
115
126
|
failed: item.kind === "turn_cluster" && Boolean(item.failure),
|
|
127
|
+
itemKey: item.iteration?.itemKey,
|
|
116
128
|
}
|
|
117
129
|
: null,
|
|
118
130
|
),
|
|
@@ -196,6 +208,7 @@ const hasTrailingProcessSection = $derived(
|
|
|
196
208
|
recovery !== null ||
|
|
197
209
|
startupRecovery !== null ||
|
|
198
210
|
processError !== null ||
|
|
211
|
+
selectedTurn?.readiness !== undefined ||
|
|
199
212
|
actionBindings.actionSectionActions.length > 0 ||
|
|
200
213
|
externalTriggers.length > 0,
|
|
201
214
|
);
|
|
@@ -243,7 +256,8 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
243
256
|
retryBusy={recoveryController.retryBusy}
|
|
244
257
|
retryError={recoveryController.retryError}
|
|
245
258
|
modelProfiles={modelConfiguration.availableProfiles}
|
|
246
|
-
defaultModelProfileId={
|
|
259
|
+
defaultModelProfileId={recoveryModel}
|
|
260
|
+
inheritedModelProfileId={inheritedRecoveryModel}
|
|
247
261
|
defaultProviderOptions={recovery.providerOptions}
|
|
248
262
|
onContinue={(prompt, modelProfileId, providerOptions) =>
|
|
249
263
|
recoveryController.continueFailedTurn(
|
|
@@ -284,7 +298,8 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
284
298
|
{instanceId}
|
|
285
299
|
recovery={startupRecovery}
|
|
286
300
|
modelProfiles={modelConfiguration.availableProfiles}
|
|
287
|
-
defaultModelProfileId={
|
|
301
|
+
defaultModelProfileId={recoveryModel}
|
|
302
|
+
inheritedModelProfileId={inheritedRecoveryModel}
|
|
288
303
|
busy={recoveryController.startupRetryBusy}
|
|
289
304
|
error={recoveryController.startupRetryError}
|
|
290
305
|
onRetry={recoveryController.retryStartup}
|
|
@@ -297,6 +312,9 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
297
312
|
summary={processError.summary}
|
|
298
313
|
guidance={processError.guidance}
|
|
299
314
|
technicalDetail={processError.technicalDetail}
|
|
315
|
+
onRetry={processError.canRetry ? () => recoveryController.retryFailedTurn() : undefined}
|
|
316
|
+
busy={recoveryController.retryBusy}
|
|
317
|
+
error={recoveryController.retryError}
|
|
300
318
|
/>
|
|
301
319
|
{:else}
|
|
302
320
|
<ChronicleActionSection
|
|
@@ -356,9 +374,6 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
356
374
|
|
|
357
375
|
<div class="chronicle-flow" class:has-terminal-summary={hasTerminalSummary} data-section="chronicle-flow">
|
|
358
376
|
<ChronicleStartupHistory {startup} />
|
|
359
|
-
{#each toolApprovalRequests.filter((request) => request.status === "open") as request (request.id)}
|
|
360
|
-
<ChronicleToolApproval {request} />
|
|
361
|
-
{/each}
|
|
362
377
|
{#each retryGroups as group, groupIndex (chronicleItemKey(group[0], groupIndex))}
|
|
363
378
|
{#if group.length > 1 && group[0].kind === "turn_cluster"}
|
|
364
379
|
<details data-section="retry-history">
|
|
@@ -374,6 +389,10 @@ function shouldRenderActionSection(item: ChronicleTimelineItem): boolean {
|
|
|
374
389
|
{/if}
|
|
375
390
|
{/each}
|
|
376
391
|
|
|
392
|
+
{#each toolApprovalRequests.filter((request) => request.status === "open") as request (request.id)}
|
|
393
|
+
<ChronicleToolApproval {request} />
|
|
394
|
+
{/each}
|
|
395
|
+
|
|
377
396
|
{#if shouldRenderTrailingAfterFlow}
|
|
378
397
|
{@render trailingProcessSection()}
|
|
379
398
|
{/if}
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
+
import { formatChronicleIterationProgress } from "../lib/chronicle-view-model.js";
|
|
5
6
|
import { formatChronicleCost } from "../lib/formatting.js";
|
|
6
7
|
import ChronicleEntryHeader from "./ChronicleEntryHeader.svelte";
|
|
7
8
|
import ChronicleThinkingSection from "./ChronicleThinkingSection.svelte";
|
|
@@ -12,7 +13,7 @@ interface Props {
|
|
|
12
13
|
liveTail: ChronicleLiveTailItem;
|
|
13
14
|
questionRequests?: readonly ProcessQuestionRequest[];
|
|
14
15
|
isFocused: boolean;
|
|
15
|
-
onOpenReasoningDetails: (turnRecordId: string) => void;
|
|
16
|
+
onOpenReasoningDetails: (turnRecordId: string, itemId?: string) => void;
|
|
16
17
|
onAbortTurn?: (() => Promise<void> | void) | null;
|
|
17
18
|
abortBusy?: boolean;
|
|
18
19
|
abortError?: string | null;
|
|
@@ -41,6 +42,29 @@ const hasReasoning = $derived(
|
|
|
41
42
|
liveTail.reasoningSection.traceItemCount),
|
|
42
43
|
),
|
|
43
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
|
+
);
|
|
44
68
|
|
|
45
69
|
function requestStop() {
|
|
46
70
|
if (!confirmingStop) {
|
|
@@ -83,19 +107,19 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
83
107
|
<ChronicleEntryHeader
|
|
84
108
|
title={liveTail.title}
|
|
85
109
|
kind={liveTail.turnType === "llm" ? "llm" : "system"}
|
|
86
|
-
metadata={[liveTail.modelProfileId, liveTail.usage?.cost ? formatChronicleCost(liveTail.usage.cost.total) : null].filter(Boolean).join(" · ")}
|
|
110
|
+
metadata={[liveTail.iteration ? formatChronicleIterationProgress(liveTail.iteration) : null, liveTail.modelProfileId, liveTail.usage?.cost ? formatChronicleCost(liveTail.usage.cost.total) : null].filter(Boolean).join(" · ")}
|
|
87
111
|
timestamp={liveTail.facts.startedAt}
|
|
88
112
|
duration={openQuestionRequest ? "Paused" : "Running"}
|
|
89
113
|
/>
|
|
90
|
-
{#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}
|
|
91
115
|
{#if liveTail.assistantTextPreview}
|
|
92
116
|
<div class="live-result"><p>{liveTail.assistantTextPreview}</p></div>
|
|
93
|
-
{:else if !liveTail.reasoningSection && liveTail.state !== "tool_running"}
|
|
117
|
+
{:else if !liveTail.activitySummary && !liveTail.reasoningSection && liveTail.state !== "tool_running"}
|
|
94
118
|
<p class="live-copy">{liveTail.copy}</p>
|
|
95
119
|
{/if}
|
|
96
120
|
|
|
97
|
-
{#if liveTail.progress}
|
|
98
|
-
<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" />
|
|
99
123
|
{/if}
|
|
100
124
|
|
|
101
125
|
{#if liveTail.reasoningSection || questionRequests.length > 0}
|
|
@@ -106,6 +130,7 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
106
130
|
traceItemCount={liveTail.reasoningSection?.traceItemCount ?? 0}
|
|
107
131
|
{questionRequests}
|
|
108
132
|
isLive={true}
|
|
133
|
+
{isThinking}
|
|
109
134
|
/>
|
|
110
135
|
{/if}
|
|
111
136
|
|
|
@@ -155,9 +180,14 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
155
180
|
</div>
|
|
156
181
|
{/if}
|
|
157
182
|
{#if liveTail.turnType === "llm" || hasReasoning}
|
|
158
|
-
<div class="live-footer">
|
|
159
|
-
|
|
160
|
-
|
|
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>
|
|
161
191
|
</div>
|
|
162
192
|
{/if}
|
|
163
193
|
</div>
|
|
@@ -167,8 +197,11 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
167
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); }
|
|
168
198
|
.live-tail.is-focused { border-color: var(--chronicle-accent); }
|
|
169
199
|
.live-tail-body { display: flex; flex-direction: column; gap: 10px; }
|
|
170
|
-
.live-footer { display:
|
|
171
|
-
.
|
|
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; }
|
|
172
205
|
|
|
173
206
|
.live-result { padding: 10px 12px; border-radius: 6px; background: color-mix(in srgb, var(--chronicle-accent) 6%, var(--chronicle-card-surface)); }
|
|
174
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; }
|
|
@@ -192,27 +225,15 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
192
225
|
|
|
193
226
|
.stop-trigger {
|
|
194
227
|
align-self: flex-start;
|
|
195
|
-
min-height: 34px;
|
|
196
|
-
padding: 0 14px;
|
|
197
|
-
border-radius: 999px;
|
|
198
228
|
border: 1px solid var(--chronicle-danger-border);
|
|
199
229
|
background: var(--chronicle-card-surface);
|
|
200
230
|
color: var(--chronicle-danger-text);
|
|
201
|
-
font: inherit;
|
|
202
|
-
font-size: 13px;
|
|
203
|
-
font-weight: 600;
|
|
204
|
-
cursor: pointer;
|
|
205
231
|
}
|
|
206
232
|
|
|
207
233
|
.stop-trigger:hover:not(:disabled) {
|
|
208
234
|
background: var(--chronicle-danger-surface);
|
|
209
235
|
}
|
|
210
236
|
|
|
211
|
-
.stop-trigger:disabled {
|
|
212
|
-
opacity: 0.5;
|
|
213
|
-
cursor: default;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
237
|
.stop-confirm {
|
|
217
238
|
display: flex;
|
|
218
239
|
flex-wrap: wrap;
|
|
@@ -237,6 +258,7 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
237
258
|
gap: 8px;
|
|
238
259
|
}
|
|
239
260
|
|
|
261
|
+
.stop-trigger,
|
|
240
262
|
.stop-cancel,
|
|
241
263
|
.stop-confirm-btn {
|
|
242
264
|
min-height: 34px;
|
|
@@ -268,10 +290,17 @@ const screenReaderStatus = $derived.by(() => {
|
|
|
268
290
|
opacity: 0.9;
|
|
269
291
|
}
|
|
270
292
|
|
|
293
|
+
.stop-trigger:disabled,
|
|
271
294
|
.stop-cancel:disabled,
|
|
272
295
|
.stop-confirm-btn:disabled {
|
|
273
296
|
opacity: 0.5;
|
|
274
297
|
cursor: default;
|
|
275
298
|
}
|
|
276
|
-
|
|
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
|
+
}
|
|
277
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
|
|
|
@@ -48,13 +51,14 @@ const selectedModelUsable = $derived(
|
|
|
48
51
|
{instanceId}
|
|
49
52
|
{modelProfiles}
|
|
50
53
|
defaultModelProfileId={defaultModelProfileId ?? null}
|
|
54
|
+
{inheritedModelProfileId}
|
|
51
55
|
initialProviderOptions={recovery.providerOptions}
|
|
52
56
|
disabled={busy}
|
|
53
57
|
selectId={`startup-model-${recovery.startRecordId}`}
|
|
54
58
|
selectLabel="Model"
|
|
55
59
|
selectDataField="startup-recovery-model"
|
|
56
60
|
onModelChange={(profileId) => {
|
|
57
|
-
modelProfileDraft = profileId
|
|
61
|
+
modelProfileDraft = profileId;
|
|
58
62
|
}}
|
|
59
63
|
onProviderOptionsChange={(values) => (providerOptionsDraft = values ? { ...values } : undefined)}
|
|
60
64
|
/>
|
|
@@ -62,9 +66,9 @@ const selectedModelUsable = $derived(
|
|
|
62
66
|
type="button"
|
|
63
67
|
data-action="retry-startup"
|
|
64
68
|
data-start-record-id={recovery.startRecordId}
|
|
65
|
-
disabled={busy || !selectedModelUsable || (recovery.action === "choose_model" && !modelProfileDraft)}
|
|
69
|
+
disabled={busy || !selectedModelUsable || (recovery.action === "choose_model" && !(modelProfileDraft ?? inheritedModelProfileId ?? defaultModelProfileId))}
|
|
66
70
|
onclick={() =>
|
|
67
|
-
onRetry(recovery.startRecordId, modelProfileDraft
|
|
71
|
+
onRetry(recovery.startRecordId, modelProfileDraft, providerOptionsDraft)}
|
|
68
72
|
>
|
|
69
73
|
{busy
|
|
70
74
|
? "Retrying…"
|