@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
|
@@ -11,6 +11,7 @@ interface Props {
|
|
|
11
11
|
previewTruncated?: boolean;
|
|
12
12
|
traceItemCount: number;
|
|
13
13
|
isLive?: boolean;
|
|
14
|
+
isThinking?: boolean;
|
|
14
15
|
questionRequests?: readonly ProcessQuestionRequest[];
|
|
15
16
|
}
|
|
16
17
|
let {
|
|
@@ -19,6 +20,7 @@ let {
|
|
|
19
20
|
previewTruncated = false,
|
|
20
21
|
traceItemCount,
|
|
21
22
|
isLive = false,
|
|
23
|
+
isThinking = false,
|
|
22
24
|
questionRequests = [],
|
|
23
25
|
}: Props = $props();
|
|
24
26
|
const previewLines = $derived(
|
|
@@ -29,7 +31,10 @@ const previewLines = $derived(
|
|
|
29
31
|
{#if (isLive && previewLines.length > 0) || questionRequests.length > 0}
|
|
30
32
|
<section class="thinking-section" class:is-live={isLive} data-section="thinking-preview" data-live={isLive ? "true" : "false"}>
|
|
31
33
|
{#if isLive && previewLines.length > 0}
|
|
32
|
-
<span class="reasoning-label">
|
|
34
|
+
<span class="reasoning-label">
|
|
35
|
+
{#if isThinking}<svg class="reasoning-activity" width="8" height="8" viewBox="0 0 8 8" aria-hidden="true"><circle cx="4" cy="4" r="3" fill="currentColor" /></svg>{/if}
|
|
36
|
+
Reasoning
|
|
37
|
+
</span>
|
|
33
38
|
<div class="thinking-preview-copy" data-line-count={previewLines.length} data-truncated={previewTruncated ? "true" : "false"} data-trace-item-count={traceItemCount} style:--thinking-preview-lines={THINKING_PREVIEW_LINE_COUNT}>
|
|
34
39
|
<ChronicleThinkingText text={previewLines.join("\n")} variant="preview" />
|
|
35
40
|
</div>
|
|
@@ -44,7 +49,8 @@ const previewLines = $derived(
|
|
|
44
49
|
|
|
45
50
|
<style>
|
|
46
51
|
.thinking-section { display: grid; gap: 8px; min-width: 0; }
|
|
47
|
-
.reasoning-label { color: var(--chronicle-text-muted); font-size: var(--type-body-sm); font-weight: 600; }
|
|
52
|
+
.reasoning-label { display: flex; align-items: center; gap: 7px; color: var(--chronicle-text-muted); font-size: var(--type-body-sm); font-weight: 600; }
|
|
53
|
+
.reasoning-activity { color: var(--chronicle-accent); flex-shrink: 0; }
|
|
48
54
|
.thinking-preview-copy { display: flex; flex-direction: column; justify-content: flex-end; max-height: calc(var(--thinking-preview-lines, 4) * 1lh); max-width: 72ch; overflow: clip; color: var(--chronicle-text-muted); font-size: var(--type-body-sm); line-height: 1.6; }
|
|
49
55
|
.thinking-preview-copy > :global(*) { flex: 0 0 auto; }
|
|
50
56
|
.reasoning-questions { display: grid; gap: var(--space-sm); }
|
|
@@ -1,40 +1,143 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
3
|
-
import {
|
|
2
|
+
import { type ProcessToolApprovalRequest, resolveJsonPointer } from "@leitwerk-dev/domain";
|
|
3
|
+
import type { TicketCreationToolSummary } from "@leitwerk-dev/protocol";
|
|
4
|
+
import { tick } from "svelte";
|
|
5
|
+
import { fetchTicketCreationTools, resolveToolApproval } from "../../lib/api.js";
|
|
6
|
+
import ChronicleMarkdown from "./ChronicleMarkdown.svelte";
|
|
4
7
|
import ReadonlyJsonValue from "./ReadonlyJsonValue.svelte";
|
|
5
8
|
|
|
6
9
|
let { request }: { request: ProcessToolApprovalRequest } = $props();
|
|
7
10
|
let feedback = $state("");
|
|
8
|
-
let
|
|
11
|
+
let feedbackOpen = $state(false);
|
|
12
|
+
let feedbackInput: HTMLTextAreaElement | undefined = $state();
|
|
13
|
+
let pending = $state<"accept" | "feedback" | "decline" | null>(null);
|
|
9
14
|
let error = $state<string | null>(null);
|
|
15
|
+
let tool = $state<TicketCreationToolSummary | undefined>();
|
|
16
|
+
|
|
17
|
+
function textAt(pointer: string | undefined): string | null {
|
|
18
|
+
if (!pointer) return null;
|
|
19
|
+
const value = resolveJsonPointer(request.arguments, pointer);
|
|
20
|
+
return typeof value === "string" ? value : null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const title = $derived(textAt(tool?.titlePath));
|
|
24
|
+
const description = $derived(textAt(tool?.descriptionPath));
|
|
25
|
+
|
|
26
|
+
$effect(() => {
|
|
27
|
+
const name = request.toolName;
|
|
28
|
+
let cancelled = false;
|
|
29
|
+
void fetchTicketCreationTools()
|
|
30
|
+
.then((tools) => {
|
|
31
|
+
if (!cancelled) tool = tools.find((candidate) => candidate.name === name);
|
|
32
|
+
})
|
|
33
|
+
.catch(() => {});
|
|
34
|
+
return () => {
|
|
35
|
+
cancelled = true;
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
|
|
10
39
|
async function resolve(action: "accept" | "feedback" | "decline") {
|
|
11
|
-
pending
|
|
40
|
+
if (pending || request.status !== "open" || (action === "feedback" && !feedback.trim())) return;
|
|
41
|
+
pending = action;
|
|
12
42
|
error = null;
|
|
13
43
|
try {
|
|
14
44
|
await resolveToolApproval({
|
|
15
45
|
instanceId: request.instanceId,
|
|
16
46
|
requestId: request.id,
|
|
17
|
-
body: { action, ...(action === "feedback" ? { feedback } : {}) },
|
|
47
|
+
body: { action, ...(action === "feedback" ? { feedback: feedback.trim() } : {}) },
|
|
18
48
|
});
|
|
19
|
-
request = {
|
|
49
|
+
request = {
|
|
50
|
+
...request,
|
|
51
|
+
status: action === "accept" ? "accepted" : action === "decline" ? "declined" : "feedback",
|
|
52
|
+
};
|
|
20
53
|
} catch (reason) {
|
|
21
54
|
error = reason instanceof Error ? reason.message : String(reason);
|
|
22
55
|
} finally {
|
|
23
|
-
pending =
|
|
56
|
+
pending = null;
|
|
24
57
|
}
|
|
25
58
|
}
|
|
59
|
+
|
|
60
|
+
async function requestChanges() {
|
|
61
|
+
feedbackOpen = true;
|
|
62
|
+
await tick();
|
|
63
|
+
feedbackInput?.focus();
|
|
64
|
+
}
|
|
26
65
|
</script>
|
|
27
|
-
|
|
28
|
-
|
|
66
|
+
|
|
67
|
+
<section class="approval" aria-labelledby={`approval-${request.id}`} aria-busy={pending !== null} data-section="ticket-approval">
|
|
68
|
+
<header>
|
|
69
|
+
<h3 id={`approval-${request.id}`}>Review issue</h3>
|
|
70
|
+
<p>Check the draft and destination before creating the issue.</p>
|
|
71
|
+
</header>
|
|
29
72
|
{#if request.destination}
|
|
30
|
-
<div class="destination"
|
|
73
|
+
<div class="destination">
|
|
74
|
+
<span>{tool?.displayName ?? "Destination"}</span>
|
|
75
|
+
<strong>{request.destination.displayName}</strong>
|
|
76
|
+
{#if request.destination.group}<span>{request.destination.group}</span>{/if}
|
|
77
|
+
{#if request.destination.description}<span>{request.destination.description}</span>{/if}
|
|
78
|
+
</div>
|
|
79
|
+
{/if}
|
|
80
|
+
{#if title || description}
|
|
81
|
+
<div class="draft-preview">
|
|
82
|
+
{#if title}<h4>{title}</h4>{/if}
|
|
83
|
+
{#if description}
|
|
84
|
+
{#if tool?.descriptionFormat === "markdown"}<ChronicleMarkdown markdown={description} />
|
|
85
|
+
{:else}<p class="draft-description">{description}</p>{/if}
|
|
86
|
+
{/if}
|
|
87
|
+
</div>
|
|
88
|
+
<details class="ticket-fields"><summary>All issue fields</summary><dl><ReadonlyJsonValue value={request.arguments} /></dl></details>
|
|
89
|
+
{:else}
|
|
90
|
+
<div class="ticket-fields"><dl><ReadonlyJsonValue value={request.arguments} /></dl></div>
|
|
31
91
|
{/if}
|
|
32
|
-
<p>The ticket system will receive these exact read-only arguments.</p>
|
|
33
|
-
<dl><ReadonlyJsonValue value={request.arguments} /></dl>
|
|
34
92
|
{#if request.status === "open"}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
93
|
+
{#if feedbackOpen}
|
|
94
|
+
<form class="feedback" onsubmit={(event) => { event.preventDefault(); void resolve("feedback"); }}>
|
|
95
|
+
<label for={`ticket-feedback-${request.id}`}>What should change?</label>
|
|
96
|
+
<textarea id={`ticket-feedback-${request.id}`} bind:this={feedbackInput} bind:value={feedback} rows="4" placeholder="Describe the changes you’d like in the next draft." disabled={pending !== null} required></textarea>
|
|
97
|
+
<div class="actions">
|
|
98
|
+
<button type="submit" class="ui-button" data-variant="primary" disabled={pending !== null || !feedback.trim()}>{pending === "feedback" ? "Sending changes…" : "Send changes"}</button>
|
|
99
|
+
<button type="button" class="ui-button" disabled={pending !== null} onclick={() => (feedbackOpen = false)}>Back to review</button>
|
|
100
|
+
</div>
|
|
101
|
+
</form>
|
|
102
|
+
{:else}
|
|
103
|
+
<div class="actions">
|
|
104
|
+
<button type="button" class="ui-button" data-variant="primary" disabled={pending !== null} onclick={() => resolve("accept")}>{pending === "accept" ? "Creating issue…" : "Create issue"}</button>
|
|
105
|
+
<button type="button" class="ui-button" disabled={pending !== null} onclick={requestChanges}>Request changes</button>
|
|
106
|
+
<button type="button" class="ui-button discard" disabled={pending !== null} onclick={() => resolve("decline")}>{pending === "decline" ? "Discarding…" : "Discard draft"}</button>
|
|
107
|
+
</div>
|
|
108
|
+
{/if}
|
|
109
|
+
{:else}
|
|
110
|
+
<p role="status">{request.status === "accepted" ? "Approved. The issue is being created." : request.status === "feedback" ? "Changes requested. A revised draft will appear here." : "Draft discarded. No issue was created."}</p>
|
|
111
|
+
{/if}
|
|
112
|
+
{#if error}<p class="approval-error" role="alert">{error}</p>{/if}
|
|
39
113
|
</section>
|
|
40
|
-
|
|
114
|
+
|
|
115
|
+
<style>
|
|
116
|
+
.approval { display: grid; gap: var(--space-md); min-width: 0; padding: var(--space-lg); border: 1px solid var(--chronicle-border-strong); border-radius: var(--radius-md); background: var(--chronicle-card-surface); overflow-wrap: anywhere; }
|
|
117
|
+
header { display: grid; gap: var(--space-xs); }
|
|
118
|
+
h3, h4, p, dl { margin: 0; }
|
|
119
|
+
h3 { font-size: var(--type-title-sm); }
|
|
120
|
+
header p, .destination span { color: var(--chronicle-text-muted); font-size: var(--type-body-sm); }
|
|
121
|
+
.destination { display: grid; gap: var(--space-2xs); padding: var(--space-sm) 0; border-block: 1px solid var(--chronicle-border); }
|
|
122
|
+
.destination strong { font-weight: 650; }
|
|
123
|
+
.draft-preview { display: grid; gap: var(--space-sm); min-width: 0; }
|
|
124
|
+
h4 { font-size: var(--type-title-sm); line-height: 1.4; }
|
|
125
|
+
.draft-description { white-space: pre-wrap; line-height: 1.6; max-width: 72ch; }
|
|
126
|
+
.ticket-fields { min-width: 0; font-size: var(--type-body-sm); }
|
|
127
|
+
summary { display: list-item; cursor: pointer; padding: var(--space-sm) 0; color: var(--chronicle-text-muted); min-height: 44px; }
|
|
128
|
+
summary:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 2px; }
|
|
129
|
+
.feedback { display: grid; gap: var(--space-xs); }
|
|
130
|
+
.feedback label { font-weight: 600; }
|
|
131
|
+
textarea { width: 100%; padding: var(--space-sm); border: 1px solid var(--chronicle-border-strong); border-radius: var(--radius-sm); background: var(--chronicle-card-surface); color: var(--chronicle-text); font: inherit; line-height: 1.5; resize: vertical; }
|
|
132
|
+
textarea:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 2px; }
|
|
133
|
+
textarea::placeholder { color: var(--chronicle-text-muted); }
|
|
134
|
+
.actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); padding-top: var(--space-xs); }
|
|
135
|
+
.discard { margin-left: auto; }
|
|
136
|
+
.approval-error { padding: var(--space-sm); border-radius: var(--radius-sm); background: var(--chronicle-danger-surface-soft); color: var(--chronicle-danger-text-strong); }
|
|
137
|
+
@media (max-width: 540px) {
|
|
138
|
+
.approval { padding: var(--space-md); }
|
|
139
|
+
.actions .ui-button { flex: 1 1 auto; }
|
|
140
|
+
.discard { margin-left: 0; }
|
|
141
|
+
textarea { font-size: 16px; }
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -9,7 +9,11 @@ import { resolveToolRenderer, resolveToolRendererFields } from "../../lib/tool-c
|
|
|
9
9
|
import { formatStructuredValue, summarizeToolPayload } from "../lib/tool-call-summary.js";
|
|
10
10
|
import ChronicleMarkdown from "./ChronicleMarkdown.svelte";
|
|
11
11
|
|
|
12
|
-
type DisplayToolCallSnapshot =
|
|
12
|
+
type DisplayToolCallSnapshot =
|
|
13
|
+
| PrimaryPathToolCallSnapshot
|
|
14
|
+
| (Omit<TurnTraceToolCallSnapshot, "status"> & {
|
|
15
|
+
status: TurnTraceToolCallSnapshot["status"] | "unknown";
|
|
16
|
+
});
|
|
13
17
|
|
|
14
18
|
interface Props {
|
|
15
19
|
toolCall: DisplayToolCallSnapshot;
|
|
@@ -59,13 +63,14 @@ function parseTimestamp(value: string | null | undefined): number | null {
|
|
|
59
63
|
function formatStartAndDurationLabel(
|
|
60
64
|
startedAt: string | null | undefined,
|
|
61
65
|
completedAt: string | null | undefined,
|
|
66
|
+
status: DisplayToolCallSnapshot["status"],
|
|
62
67
|
): string {
|
|
63
68
|
const startedLabel =
|
|
64
69
|
typeof startedAt === "string" && startedAt.trim() !== "" ? startedAt : "Unknown";
|
|
65
70
|
const start = parseTimestamp(startedAt);
|
|
66
71
|
const end = parseTimestamp(completedAt);
|
|
67
72
|
if (start === null || end === null || end < start) {
|
|
68
|
-
return `Started ${startedLabel} · Duration ${
|
|
73
|
+
return `Started ${startedLabel} · Duration ${status === "running" ? "Running" : "Unknown"}`;
|
|
69
74
|
}
|
|
70
75
|
const totalSeconds = Math.max(0, Math.round((end - start) / 1000));
|
|
71
76
|
const durationLabel =
|
|
@@ -119,14 +124,34 @@ const resultText = $derived("resultText" in toolCall ? toolCall.resultText : nul
|
|
|
119
124
|
const isToolTruncated = $derived("truncated" in toolCall && toolCall.truncated);
|
|
120
125
|
const argumentSummary = $derived(primaryArgumentSummary(toolCall));
|
|
121
126
|
const runMetaLabel = $derived(
|
|
122
|
-
formatStartAndDurationLabel(toolCall.startedAt, toolCall.completedAt),
|
|
127
|
+
formatStartAndDurationLabel(toolCall.startedAt, toolCall.completedAt, toolCall.status),
|
|
123
128
|
);
|
|
124
129
|
const statusLabel = $derived(
|
|
125
|
-
toolCall.
|
|
130
|
+
toolCall.status === "unknown"
|
|
131
|
+
? "Outcome not recorded"
|
|
132
|
+
: toolCall.isError
|
|
133
|
+
? "Failed"
|
|
134
|
+
: toolCall.status === "running"
|
|
135
|
+
? "Running"
|
|
136
|
+
: "Completed",
|
|
137
|
+
);
|
|
138
|
+
const statusSymbol = $derived(
|
|
139
|
+
toolCall.status === "unknown"
|
|
140
|
+
? "?"
|
|
141
|
+
: toolCall.isError
|
|
142
|
+
? "✕"
|
|
143
|
+
: toolCall.status === "running"
|
|
144
|
+
? "…"
|
|
145
|
+
: "✓",
|
|
126
146
|
);
|
|
127
|
-
const statusSymbol = $derived(toolCall.isError ? "✕" : toolCall.status === "running" ? "…" : "✓");
|
|
128
147
|
const statusTone = $derived(
|
|
129
|
-
toolCall.
|
|
148
|
+
toolCall.status === "unknown"
|
|
149
|
+
? "unknown"
|
|
150
|
+
: toolCall.isError
|
|
151
|
+
? "error"
|
|
152
|
+
: toolCall.status === "running"
|
|
153
|
+
? "running"
|
|
154
|
+
: "success",
|
|
130
155
|
);
|
|
131
156
|
</script>
|
|
132
157
|
|
|
@@ -150,6 +175,7 @@ const statusTone = $derived(
|
|
|
150
175
|
{/snippet}
|
|
151
176
|
|
|
152
177
|
<details
|
|
178
|
+
data-disclosure-key={`tool:${toolCall.toolCallId}`}
|
|
153
179
|
class="tool-item tool-item-expandable"
|
|
154
180
|
open={isOpen}
|
|
155
181
|
data-section="reasoning-tool-marker"
|
|
@@ -22,7 +22,7 @@ interface Props {
|
|
|
22
22
|
isFocused: boolean;
|
|
23
23
|
compressHistory?: boolean;
|
|
24
24
|
questionRequests?: readonly ProcessQuestionRequest[];
|
|
25
|
-
onOpenReasoningDetails: (turnRecordId: string) => void;
|
|
25
|
+
onOpenReasoningDetails: (turnRecordId: string, itemId?: string) => void;
|
|
26
26
|
onDraftTicket?: (artifact: ChronicleTicketArtifact) => void;
|
|
27
27
|
recoveryContent?: Snippet;
|
|
28
28
|
waitingContent?: Snippet;
|
|
@@ -180,22 +180,22 @@ function openDetails() {
|
|
|
180
180
|
{@render waitingContent?.()}
|
|
181
181
|
|
|
182
182
|
{#if prompt}
|
|
183
|
-
<button class="prompt-row" type="button" data-section="turn-prompt" aria-label={`View prompt for ${cluster.title}`} onclick={
|
|
183
|
+
<button class="prompt-row" type="button" data-section="turn-prompt" aria-label={`View prompt for ${cluster.title}`} onclick={() => onOpenReasoningDetails(cluster.turnRecordId, "input")}>
|
|
184
184
|
<span class="prompt-label">Prompt</span>
|
|
185
185
|
<span class="prompt-preview">{truncateText(markdownToPlainText(prompt), 240)}</span>
|
|
186
186
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" aria-hidden="true"><path d="m9 5 7 7-7 7" /></svg>
|
|
187
187
|
</button>
|
|
188
188
|
{/if}
|
|
189
189
|
|
|
190
|
-
{#if
|
|
190
|
+
{#if cluster.turnRecordId}
|
|
191
191
|
<div class="cluster-support" class:has-reasoning={hasReasoning}>
|
|
192
192
|
<div class="support-progress">{#if progress && isLlm}<ChronicleTurnProgress report={progress.report} attemptStatus={progress.attemptStatus} recordedAt={progress.recordedAt} compact />{/if}</div>
|
|
193
193
|
<div class="footer-actions">
|
|
194
194
|
{#if compactResult && onDraftTicket}<ChronicleCreateIssueButton {onDraftTicket} artifact={{ kind: "turn_result", turnRecordId: cluster.turnRecordId }} />{/if}
|
|
195
|
-
{#if
|
|
195
|
+
{#if cluster.turnRecordId}
|
|
196
196
|
<div class="turn-info-actions">
|
|
197
|
-
{#if hasReasoning}<ChronicleTurnDetailsButton kind="reasoning" title={cluster.title} onClick={
|
|
198
|
-
|
|
197
|
+
{#if hasReasoning}<ChronicleTurnDetailsButton kind="reasoning" title={cluster.title} onClick={() => onOpenReasoningDetails(cluster.turnRecordId, "reasoning")} />{/if}
|
|
198
|
+
<ChronicleTurnDetailsButton title={cluster.title} onClick={openDetails} />
|
|
199
199
|
</div>
|
|
200
200
|
{/if}
|
|
201
201
|
</div>
|
|
@@ -10,11 +10,13 @@ import type { ExternalResourceType } from "../../lib/external-links.js";
|
|
|
10
10
|
let {
|
|
11
11
|
report,
|
|
12
12
|
compact = false,
|
|
13
|
+
showSummary = true,
|
|
13
14
|
attemptStatus,
|
|
14
15
|
recordedAt,
|
|
15
16
|
}: {
|
|
16
17
|
report: TurnProgressReport;
|
|
17
18
|
compact?: boolean;
|
|
19
|
+
showSummary?: boolean;
|
|
18
20
|
attemptStatus?: string;
|
|
19
21
|
recordedAt?: string;
|
|
20
22
|
} = $props();
|
|
@@ -56,22 +58,24 @@ function resourceType(kind: TurnProgressLink["kind"]): ExternalResourceType {
|
|
|
56
58
|
{/if}
|
|
57
59
|
{/snippet}
|
|
58
60
|
|
|
59
|
-
{#if report.summary}<p>{report.summary}{#if recordedAt} <time datetime={recordedAt}>{new Date(recordedAt).toLocaleString()}</time>{/if}</p>{/if}
|
|
61
|
+
{#if showSummary && report.summary}<p data-section="turn-progress-summary">{report.summary}{#if recordedAt} <time datetime={recordedAt}>{new Date(recordedAt).toLocaleString()}</time>{/if}</p>{/if}
|
|
60
62
|
|
|
61
63
|
{#if succeeded}
|
|
62
64
|
<div class="progress-summary" data-section="turn-progress">
|
|
63
65
|
<details>
|
|
64
66
|
<summary>
|
|
65
|
-
<svg class="check" width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><circle cx="10" cy="10" r="8" /><path d="m6 10 3 3 5-6" /></svg>
|
|
67
|
+
{#if !compact}<svg class="check" width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><circle cx="10" cy="10" r="8" /><path d="m6 10 3 3 5-6" /></svg>{/if}
|
|
66
68
|
<span>{summary}</span>
|
|
67
|
-
<svg class="chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
|
|
69
|
+
<svg class="chevron" class:leading={compact} width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" aria-hidden="true"><path d={compact ? "m9 6 6 6-6 6" : "m6 9 6 6 6-6"} /></svg>
|
|
68
70
|
</summary>
|
|
69
71
|
<div class="progress-details"><ProgressChecklistRows {steps} /></div>
|
|
70
72
|
</details>
|
|
71
73
|
{@render createdChanges()}
|
|
72
74
|
</div>
|
|
73
|
-
{:else}
|
|
75
|
+
{:else if steps.length}
|
|
74
76
|
<ProgressChecklist title={report.title} {steps} dataSection="turn-progress">{@render createdChanges()}</ProgressChecklist>
|
|
77
|
+
{:else}
|
|
78
|
+
{@render createdChanges()}
|
|
75
79
|
{/if}
|
|
76
80
|
{#if hasUnfinished}
|
|
77
81
|
<details><summary>Original progress report</summary><ProgressChecklistRows steps={report.steps.map((step) => ({ ...step, status: step.status === "in_progress" ? "incomplete" : step.status, detail: step.status === "in_progress" ? ["Recorded as in progress", step.detail].filter(Boolean).join(" · ") : step.detail }))} /></details>
|
|
@@ -85,7 +89,9 @@ function resourceType(kind: TurnProgressLink["kind"]): ExternalResourceType {
|
|
|
85
89
|
summary:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 2px; border-radius: 4px; }
|
|
86
90
|
.check { color: var(--chronicle-success); flex-shrink: 0; }
|
|
87
91
|
.chevron { color: var(--chronicle-text-faint); }
|
|
92
|
+
.chevron.leading { order: -1; }
|
|
88
93
|
details[open] .chevron { transform: rotate(180deg); }
|
|
94
|
+
details[open] .chevron.leading { transform: rotate(90deg); }
|
|
89
95
|
.progress-details { padding: 10px 0; }
|
|
90
96
|
h5 { margin: 0; color: var(--chronicle-text); font-size: var(--type-body-sm); font-weight: 600; }
|
|
91
97
|
.created-changes { display: grid; gap: 4px; margin-top: 6px; }
|
|
@@ -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 ModelProfileOptions from "./ModelProfileOptions.svelte";
|
|
4
5
|
import ProviderOptionsEditor from "./ProviderOptionsEditor.svelte";
|
|
5
6
|
|
|
@@ -7,12 +8,13 @@ interface Props {
|
|
|
7
8
|
instanceId: string;
|
|
8
9
|
modelProfiles: readonly ModelProfileOptionSummary[];
|
|
9
10
|
defaultModelProfileId: string | null;
|
|
11
|
+
inheritedModelProfileId?: string | null;
|
|
10
12
|
initialProviderOptions?: Readonly<Record<string, string>>;
|
|
11
13
|
disabled: boolean;
|
|
12
14
|
selectId: string;
|
|
13
15
|
selectLabel?: string;
|
|
14
16
|
selectDataField?: string;
|
|
15
|
-
onModelChange: (profileId: string | undefined, usable: boolean) => void;
|
|
17
|
+
onModelChange: (profileId: string | null | undefined, usable: boolean) => void;
|
|
16
18
|
onProviderOptionsChange: (values: Record<string, string> | undefined) => void;
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -20,6 +22,7 @@ let {
|
|
|
20
22
|
instanceId,
|
|
21
23
|
modelProfiles,
|
|
22
24
|
defaultModelProfileId,
|
|
25
|
+
inheritedModelProfileId = null,
|
|
23
26
|
initialProviderOptions = {},
|
|
24
27
|
disabled,
|
|
25
28
|
selectId,
|
|
@@ -29,19 +32,15 @@ let {
|
|
|
29
32
|
onProviderOptionsChange,
|
|
30
33
|
}: Props = $props();
|
|
31
34
|
|
|
32
|
-
let modelProfileDraft = $state(
|
|
35
|
+
let modelProfileDraft = $state("");
|
|
33
36
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
const selectedModelUsable = $derived(
|
|
38
|
-
selectedProfile === null ||
|
|
39
|
-
selectedProfile.availability === undefined ||
|
|
40
|
-
selectedProfile.availability === "available",
|
|
37
|
+
const draft = $derived(modelProfileDraft === "__inherit" ? null : modelProfileDraft || undefined);
|
|
38
|
+
const selection = $derived(
|
|
39
|
+
recoveryModelSelection(modelProfiles, draft, defaultModelProfileId, inheritedModelProfileId),
|
|
41
40
|
);
|
|
42
41
|
|
|
43
42
|
$effect(() => {
|
|
44
|
-
onModelChange(
|
|
43
|
+
onModelChange(draft, selection.usable);
|
|
45
44
|
});
|
|
46
45
|
</script>
|
|
47
46
|
|
|
@@ -54,15 +53,17 @@ $effect(() => {
|
|
|
54
53
|
bind:value={modelProfileDraft}
|
|
55
54
|
{disabled}
|
|
56
55
|
>
|
|
56
|
+
<option value="">Use current model policy{defaultModelProfileId ? ` (${defaultModelProfileId})` : ""}</option>
|
|
57
|
+
<option value="__inherit">Use inherited value{inheritedModelProfileId ? ` (${inheritedModelProfileId})` : ""}</option>
|
|
57
58
|
<ModelProfileOptions profiles={modelProfiles} />
|
|
58
59
|
</select>
|
|
59
|
-
{#if
|
|
60
|
-
<p class="model-reason">{
|
|
60
|
+
{#if selection.profile?.safeReason && !selection.usable}
|
|
61
|
+
<p class="model-reason">{selection.profile.safeReason}</p>
|
|
61
62
|
{/if}
|
|
62
63
|
{/if}
|
|
63
64
|
<ProviderOptionsEditor
|
|
64
65
|
{instanceId}
|
|
65
|
-
modelProfileId={
|
|
66
|
+
modelProfileId={selection.profileId}
|
|
66
67
|
initialValues={initialProviderOptions}
|
|
67
68
|
{disabled}
|
|
68
69
|
onChange={(values) => onProviderOptionsChange(values ? { ...values } : undefined)}
|