@leitwerk-dev/ui 0.1.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/LICENSE +13 -0
- package/dist/assets/ChronicleMarkdown-BLgtHeEE.js +16 -0
- package/dist/assets/ChronicleMarkdown-D6hFzERy.css +1 -0
- package/dist/assets/FutureLaunchDetailPage-KrXSGzHM.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-VPMBtpYc.css +1 -0
- package/dist/assets/GenericLauncher-Cv38FByt.js +1 -0
- package/dist/assets/GenericLauncher-D_GMtsQ5.css +1 -0
- package/dist/assets/HomePage-Cd3lEtwZ.js +1 -0
- package/dist/assets/HomePage-DYh_QHXv.css +1 -0
- package/dist/assets/PageHeader-6PdvYODN.css +1 -0
- package/dist/assets/PageHeader-D6pP4hIh.js +1 -0
- package/dist/assets/ProcessActionsMenu-1QySGNy9.js +1 -0
- package/dist/assets/ProcessActionsMenu-BT2r9vO8.css +1 -0
- package/dist/assets/ProcessDetailPage-BLuc7sjV.js +12 -0
- package/dist/assets/ProcessDetailPage-CSrjzajF.css +1 -0
- package/dist/assets/ProcessFlowDiagram-BAh_M_rb.js +2 -0
- package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +1 -0
- package/dist/assets/ProcessesPage-BcM38HMs.css +1 -0
- package/dist/assets/ProcessesPage-DtPweRU-.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-CQGvY-Rc.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-CadXN9z7.css +1 -0
- package/dist/assets/SkillsPage-B30FAFia.css +1 -0
- package/dist/assets/SkillsPage-bXuv0kEE.js +2 -0
- package/dist/assets/WatchersPage-DNyUsU1y.js +1 -0
- package/dist/assets/WatchersPage-Dnfi1zUK.css +1 -0
- package/dist/assets/api-CqECFdii.js +1 -0
- package/dist/assets/browser-storage-LbKCyf_w.js +1 -0
- package/dist/assets/dist-B7WNbObw.js +2 -0
- package/dist/assets/index-66T4Gmbl.css +1 -0
- package/dist/assets/index-C8qCggeq.js +7 -0
- package/dist/assets/index-client-BqF3_t3P.js +2 -0
- package/dist/assets/mermaid-render.worker-DAVgiVRG.js +6393 -0
- package/dist/assets/retry-config.svelte-DFKCJtCe.js +1 -0
- package/dist/assets/router.svelte-COr45o9R.js +1 -0
- package/dist/fonts/OFL-Public-Sans.txt +115 -0
- package/dist/fonts/OFL-Spectral.txt +93 -0
- package/dist/fonts/README.md +38 -0
- package/dist/fonts/fonts.css +85 -0
- package/dist/fonts/public-sans-latin-cd00287f.woff2 +0 -0
- package/dist/fonts/public-sans-latin-ext-d025d4ba.woff2 +0 -0
- package/dist/fonts/spectral-latin-89d48951.woff2 +0 -0
- package/dist/fonts/spectral-latin-b7578f14.woff2 +0 -0
- package/dist/fonts/spectral-latin-c4e0a00d.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-260738f4.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-ab18ac17.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-f58c1db3.woff2 +0 -0
- package/dist/index.html +32 -0
- package/package.json +47 -0
- package/src/App.svelte +257 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +1035 -0
- package/src/chronicle/components/ChronicleExpandButton.svelte +70 -0
- package/src/chronicle/components/ChronicleFlow.svelte +289 -0
- package/src/chronicle/components/ChronicleLeafOutcomePlaceholder.svelte +44 -0
- package/src/chronicle/components/ChronicleLeafOutcomeRendererHost.svelte +408 -0
- package/src/chronicle/components/ChronicleLeafOutcomeSection.svelte +253 -0
- package/src/chronicle/components/ChronicleLiveChip.svelte +96 -0
- package/src/chronicle/components/ChronicleLiveTail.svelte +376 -0
- package/src/chronicle/components/ChronicleMarkdown.svelte +168 -0
- package/src/chronicle/components/ChronicleOperatorInputSection.svelte +41 -0
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +131 -0
- package/src/chronicle/components/ChroniclePromptSection.svelte +54 -0
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +167 -0
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +893 -0
- package/src/chronicle/components/ChronicleRecoverySection.svelte +338 -0
- package/src/chronicle/components/ChronicleScheduledActionSection.svelte +192 -0
- package/src/chronicle/components/ChronicleSectionHeader.svelte +135 -0
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +138 -0
- package/src/chronicle/components/ChronicleTerminalSummary.svelte +127 -0
- package/src/chronicle/components/ChronicleThinkingSection.svelte +191 -0
- package/src/chronicle/components/ChronicleThinkingText.svelte +46 -0
- package/src/chronicle/components/ChronicleToolCallItem.svelte +477 -0
- package/src/chronicle/components/ChronicleTurnCluster.svelte +325 -0
- package/src/chronicle/components/ChronicleTurnRail.svelte +584 -0
- package/src/chronicle/components/ChronicleUsageStats.svelte +107 -0
- package/src/chronicle/components/CompactActionComposer.svelte +417 -0
- package/src/chronicle/components/ModelProfileOptions.svelte +20 -0
- package/src/chronicle/components/ProviderOptionsEditor.svelte +171 -0
- package/src/chronicle/components/RecoveryModelControl.svelte +95 -0
- package/src/chronicle/lib/action-bindings.ts +90 -0
- package/src/chronicle/lib/action-model-display.ts +133 -0
- package/src/chronicle/lib/action-preview.ts +16 -0
- package/src/chronicle/lib/chronicle-projection.ts +1342 -0
- package/src/chronicle/lib/chronicle-selectable-items.ts +352 -0
- package/src/chronicle/lib/chronicle-view-model.ts +121 -0
- package/src/chronicle/lib/formatting.ts +18 -0
- package/src/chronicle/lib/leaf-outcome-loader.ts +214 -0
- package/src/chronicle/lib/leaf-outcome-runtime.ts +37 -0
- package/src/chronicle/lib/prompt-highlighting.ts +78 -0
- package/src/chronicle/lib/scroll-sync.ts +88 -0
- package/src/chronicle/lib/tool-call-summary.ts +64 -0
- package/src/components/BrowserUiExtensionIndicatorHost.svelte +34 -0
- package/src/components/ConversationTreeDiagram.svelte +393 -0
- package/src/components/FormFieldRenderer.svelte +359 -0
- package/src/components/GenericLauncher.svelte +1970 -0
- package/src/components/KeyboardShortcutsModal.svelte +52 -0
- package/src/components/ModalShell.svelte +105 -0
- package/src/components/PageHeader.svelte +146 -0
- package/src/components/ProcessActionsMenu.svelte +514 -0
- package/src/components/ProcessInfoOverlay.svelte +1229 -0
- package/src/components/ScheduleDateTimePicker.svelte +155 -0
- package/src/components/SkillSelector.svelte +45 -0
- package/src/components/ToastContainer.svelte +192 -0
- package/src/components/launcher-form-copy.ts +172 -0
- package/src/components/launcher-model-config.ts +263 -0
- package/src/components/launcher-schedule.ts +127 -0
- package/src/extension-ui-dev-server.ts +98 -0
- package/src/lib/api.ts +970 -0
- package/src/lib/beautiful-mermaid-elk-instance.ts +54 -0
- package/src/lib/browser-storage.ts +11 -0
- package/src/lib/cost-estimates.ts +41 -0
- package/src/lib/elk-bundled-worker.ts +41 -0
- package/src/lib/flow-layout.ts +326 -0
- package/src/lib/format.ts +96 -0
- package/src/lib/future-executions-logic.ts +12 -0
- package/src/lib/future-launch-detail.ts +145 -0
- package/src/lib/instance-tree-layout.ts +158 -0
- package/src/lib/keyboard-shortcuts-help.ts +20 -0
- package/src/lib/keyboard.ts +40 -0
- package/src/lib/launcher-recent-values.ts +68 -0
- package/src/lib/markdown.ts +94 -0
- package/src/lib/mermaid-render.worker.ts +36 -0
- package/src/lib/pi-stream.ts +3 -0
- package/src/lib/primary-path-detail.ts +337 -0
- package/src/lib/primary-path-replay.ts +27 -0
- package/src/lib/process-browser.ts +179 -0
- package/src/lib/process-initial-prompt.ts +7 -0
- package/src/lib/process-launch-notices.svelte.ts +25 -0
- package/src/lib/process-row-view.ts +60 -0
- package/src/lib/process-terminal-display.ts +17 -0
- package/src/lib/process-toast-focus.svelte.ts +18 -0
- package/src/lib/processes-logic.ts +2 -0
- package/src/lib/processes.svelte.ts +334 -0
- package/src/lib/request-guard.ts +20 -0
- package/src/lib/retry-config.svelte.ts +19 -0
- package/src/lib/rich-markdown-elements.ts +173 -0
- package/src/lib/router-logic.ts +190 -0
- package/src/lib/router.svelte.ts +56 -0
- package/src/lib/runtime-config.ts +96 -0
- package/src/lib/test-fixtures.ts +13 -0
- package/src/lib/toasts.svelte.ts +104 -0
- package/src/lib/tool-call-rendering.ts +66 -0
- package/src/lib/ui-extensions.svelte.ts +381 -0
- package/src/lib/usage-snapshot.ts +9 -0
- package/src/lib/ws-classifier.ts +80 -0
- package/src/lib/ws.svelte.ts +281 -0
- package/src/main.ts +8 -0
- package/src/pages/FutureLaunchDetailPage.svelte +479 -0
- package/src/pages/HomePage.svelte +306 -0
- package/src/pages/ProcessCard.svelte +99 -0
- package/src/pages/ProcessDetailPage.svelte +599 -0
- package/src/pages/ProcessFlowDiagram.svelte +696 -0
- package/src/pages/ProcessGallery.svelte +252 -0
- package/src/pages/ProcessesPage.svelte +994 -0
- package/src/pages/SkillsPage.svelte +665 -0
- package/src/pages/WatchersPage.svelte +330 -0
- package/src/pages/process-detail/OverlayFrame.svelte +58 -0
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +460 -0
- package/src/pages/process-detail/ProcessDetailHeader.svelte +167 -0
- package/src/pages/process-detail/process-detail-action-drafts.svelte.ts +211 -0
- package/src/pages/process-detail/process-detail-actions.svelte.ts +548 -0
- package/src/pages/process-detail/process-detail-chronicle-dom.ts +102 -0
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +711 -0
- package/src/pages/process-detail/process-detail-mutations.svelte.ts +91 -0
- package/src/pages/process-detail/process-detail-view-model.ts +149 -0
- package/src/shell/AppShell.svelte +249 -0
- package/src/shell/RouteLoadBoundary.svelte +43 -0
- package/src/shell/Sidebar.svelte +1358 -0
- package/src/shell/test-fixtures/RouteLoadTestComponent.svelte +5 -0
- package/src/vite-env.d.ts +2 -0
- package/src/vite-server-config.ts +27 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ModelProfileOptionSummary, StartupRecoverySummary } from "@leitwerk-dev/protocol";
|
|
3
|
+
import ProviderOptionsEditor from "./ProviderOptionsEditor.svelte";
|
|
4
|
+
import RecoveryModelControl from "./RecoveryModelControl.svelte";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
recovery: StartupRecoverySummary;
|
|
8
|
+
instanceId: string;
|
|
9
|
+
modelProfiles?: readonly ModelProfileOptionSummary[];
|
|
10
|
+
defaultModelProfileId?: string | null;
|
|
11
|
+
busy?: boolean;
|
|
12
|
+
error?: string | null;
|
|
13
|
+
onRetry: (
|
|
14
|
+
startRecordId: string,
|
|
15
|
+
nextTurnModelProfileId?: string | null,
|
|
16
|
+
providerOptions?: Readonly<Record<string, string>>,
|
|
17
|
+
) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
recovery,
|
|
22
|
+
instanceId,
|
|
23
|
+
modelProfiles = [],
|
|
24
|
+
defaultModelProfileId = null,
|
|
25
|
+
busy = false,
|
|
26
|
+
error = null,
|
|
27
|
+
onRetry,
|
|
28
|
+
}: Props = $props();
|
|
29
|
+
|
|
30
|
+
let modelProfileDraft = $state((() => defaultModelProfileId ?? "")());
|
|
31
|
+
let providerOptionsDraft = $state<Record<string, string> | undefined>(undefined);
|
|
32
|
+
const selectedProfile = $derived(
|
|
33
|
+
modelProfiles.find((profile) => profile.id === modelProfileDraft) ?? null,
|
|
34
|
+
);
|
|
35
|
+
const selectedModelUsable = $derived(
|
|
36
|
+
selectedProfile === null ||
|
|
37
|
+
selectedProfile.availability === undefined ||
|
|
38
|
+
selectedProfile.availability === "available",
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<section class="startup-recovery" data-section="startup-recovery" tabindex="-1">
|
|
43
|
+
<p class="eyebrow">Startup error</p>
|
|
44
|
+
<h3>{recovery.title}</h3>
|
|
45
|
+
<p>{recovery.summary}</p>
|
|
46
|
+
{#if recovery.guidance}<p class="guidance">{recovery.guidance}</p>{/if}
|
|
47
|
+
{#if recovery.technicalDetail}
|
|
48
|
+
<details>
|
|
49
|
+
<summary>Technical details</summary>
|
|
50
|
+
<pre>{recovery.technicalDetail}</pre>
|
|
51
|
+
</details>
|
|
52
|
+
{/if}
|
|
53
|
+
<RecoveryModelControl
|
|
54
|
+
{instanceId}
|
|
55
|
+
{modelProfiles}
|
|
56
|
+
defaultModelProfileId={defaultModelProfileId ?? null}
|
|
57
|
+
initialProviderOptions={recovery.providerOptions}
|
|
58
|
+
disabled={busy}
|
|
59
|
+
selectId={`startup-model-${recovery.startRecordId}`}
|
|
60
|
+
selectLabel="Model"
|
|
61
|
+
selectDataField="startup-recovery-model"
|
|
62
|
+
onModelChange={(profileId) => {
|
|
63
|
+
modelProfileDraft = profileId ?? "";
|
|
64
|
+
}}
|
|
65
|
+
onProviderOptionsChange={(values) => (providerOptionsDraft = values ? { ...values } : undefined)}
|
|
66
|
+
/>
|
|
67
|
+
<button
|
|
68
|
+
type="button"
|
|
69
|
+
data-action="retry-startup"
|
|
70
|
+
data-start-record-id={recovery.startRecordId}
|
|
71
|
+
disabled={busy || !selectedModelUsable || (recovery.action === "choose_model" && !modelProfileDraft)}
|
|
72
|
+
onclick={() =>
|
|
73
|
+
onRetry(recovery.startRecordId, modelProfileDraft || undefined, providerOptionsDraft)}
|
|
74
|
+
>
|
|
75
|
+
{busy
|
|
76
|
+
? "Retrying…"
|
|
77
|
+
: recovery.action === "choose_model"
|
|
78
|
+
? "Choose model and retry startup"
|
|
79
|
+
: "Retry startup"}
|
|
80
|
+
</button>
|
|
81
|
+
{#if error}<p class="error" role="alert">{error}</p>{/if}
|
|
82
|
+
</section>
|
|
83
|
+
|
|
84
|
+
<style>
|
|
85
|
+
.startup-recovery {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 10px;
|
|
89
|
+
padding: 20px 22px;
|
|
90
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-danger) 34%, var(--chronicle-border));
|
|
91
|
+
border-radius: 20px;
|
|
92
|
+
background: color-mix(in srgb, var(--chronicle-danger) 6%, var(--chronicle-card-surface));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.eyebrow,
|
|
96
|
+
h3,
|
|
97
|
+
p {
|
|
98
|
+
margin: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.eyebrow {
|
|
102
|
+
font-size: 0.75rem;
|
|
103
|
+
font-weight: 700;
|
|
104
|
+
text-transform: uppercase;
|
|
105
|
+
color: var(--chronicle-danger);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.guidance {
|
|
109
|
+
color: var(--chronicle-muted);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
button {
|
|
113
|
+
border: 1px solid var(--chronicle-border);
|
|
114
|
+
border-radius: 10px;
|
|
115
|
+
padding: 10px 12px;
|
|
116
|
+
background: var(--chronicle-card-surface);
|
|
117
|
+
color: inherit;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
button {
|
|
121
|
+
align-self: flex-start;
|
|
122
|
+
font-weight: 700;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button:disabled {
|
|
127
|
+
cursor: not-allowed;
|
|
128
|
+
opacity: 0.58;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
pre {
|
|
132
|
+
white-space: pre-wrap;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.error {
|
|
136
|
+
color: var(--chronicle-danger);
|
|
137
|
+
}
|
|
138
|
+
</style>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { formatRelativeTime } from "../../lib/format.js";
|
|
3
|
+
import {
|
|
4
|
+
getProcessTerminalHeading,
|
|
5
|
+
getProcessTerminalIcon,
|
|
6
|
+
type ProcessTerminalStatus,
|
|
7
|
+
} from "../../lib/process-terminal-display.js";
|
|
8
|
+
|
|
9
|
+
function terminalStateCopy(status: ProcessTerminalStatus): string {
|
|
10
|
+
return status === "completed"
|
|
11
|
+
? "All planned work for this process is finished."
|
|
12
|
+
: "This process was stopped before any further turns could run.";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
status: ProcessTerminalStatus;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
anchorId?: string | null;
|
|
19
|
+
isFocused?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let { status, updatedAt, anchorId = null, isFocused = false }: Props = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<section
|
|
26
|
+
id={anchorId ?? undefined}
|
|
27
|
+
class="terminal-summary"
|
|
28
|
+
class:is-completed={status === "completed"}
|
|
29
|
+
class:is-aborted={status === "aborted"}
|
|
30
|
+
class:is-focused={isFocused}
|
|
31
|
+
data-section="chronicle-terminal-state"
|
|
32
|
+
data-terminal-status={status}
|
|
33
|
+
data-anchor-id={anchorId ?? undefined}
|
|
34
|
+
>
|
|
35
|
+
<div class="terminal-copy">
|
|
36
|
+
<p class="terminal-eyebrow">Final state</p>
|
|
37
|
+
<div class="terminal-heading-row">
|
|
38
|
+
<span class="terminal-state-mark" aria-hidden="true">{getProcessTerminalIcon(status)}</span>
|
|
39
|
+
<h3>{getProcessTerminalHeading(status)} · {formatRelativeTime(updatedAt)}</h3>
|
|
40
|
+
</div>
|
|
41
|
+
<p class="terminal-description">{terminalStateCopy(status)}</p>
|
|
42
|
+
</div>
|
|
43
|
+
</section>
|
|
44
|
+
|
|
45
|
+
<style>
|
|
46
|
+
.terminal-summary {
|
|
47
|
+
--terminal-aborted: #8a6044;
|
|
48
|
+
--terminal-tone: var(--chronicle-success);
|
|
49
|
+
|
|
50
|
+
position: relative;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: var(--space-md);
|
|
54
|
+
padding: var(--space-lg) 0 var(--space-xl);
|
|
55
|
+
border-top: 1px solid color-mix(in srgb, var(--terminal-tone) 34%, var(--chronicle-border) 66%);
|
|
56
|
+
border-bottom: 1px solid color-mix(in srgb, var(--terminal-tone) 12%, transparent 88%);
|
|
57
|
+
background: transparent;
|
|
58
|
+
scroll-margin-top: var(--space-xl);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.terminal-summary.is-focused {
|
|
62
|
+
border-top-color: color-mix(in srgb, var(--terminal-tone) 72%, var(--chronicle-accent) 28%);
|
|
63
|
+
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chronicle-accent) 14%, transparent 86%);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.terminal-summary.is-aborted {
|
|
67
|
+
--terminal-tone: var(--terminal-aborted);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.terminal-copy {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
gap: var(--space-2xs);
|
|
74
|
+
min-width: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.terminal-eyebrow {
|
|
78
|
+
margin: 0;
|
|
79
|
+
font-size: var(--type-label);
|
|
80
|
+
font-weight: 700;
|
|
81
|
+
letter-spacing: var(--tracking-label);
|
|
82
|
+
line-height: 1.4;
|
|
83
|
+
text-transform: uppercase;
|
|
84
|
+
color: color-mix(in srgb, var(--terminal-tone) 72%, var(--chronicle-text) 28%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.terminal-heading-row {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: var(--space-xs);
|
|
91
|
+
min-width: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.terminal-state-mark {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
flex: 0 0 auto;
|
|
99
|
+
width: 24px;
|
|
100
|
+
height: 24px;
|
|
101
|
+
border: 1px solid color-mix(in srgb, var(--terminal-tone) 40%, var(--chronicle-border) 60%);
|
|
102
|
+
border-radius: 999px;
|
|
103
|
+
background: color-mix(in srgb, white 90%, var(--terminal-tone) 10%);
|
|
104
|
+
color: color-mix(in srgb, var(--terminal-tone) 78%, var(--chronicle-text) 22%);
|
|
105
|
+
font-size: 13px;
|
|
106
|
+
font-weight: 700;
|
|
107
|
+
line-height: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.terminal-copy h3 {
|
|
111
|
+
margin: 0;
|
|
112
|
+
font-family: var(--font-display);
|
|
113
|
+
font-size: var(--type-title-md);
|
|
114
|
+
line-height: 1.18;
|
|
115
|
+
letter-spacing: -0.01em;
|
|
116
|
+
font-weight: 650;
|
|
117
|
+
color: var(--chronicle-text);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.terminal-description {
|
|
121
|
+
margin: 0;
|
|
122
|
+
max-width: 66ch;
|
|
123
|
+
font-size: var(--type-body);
|
|
124
|
+
line-height: 1.55;
|
|
125
|
+
color: var(--chronicle-text-muted);
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { THINKING_PREVIEW_LINE_COUNT } from "../lib/chronicle-projection.js";
|
|
3
|
+
import { normalizeChronicleText, splitChronicleLines } from "../lib/formatting.js";
|
|
4
|
+
import ChronicleExpandButton from "./ChronicleExpandButton.svelte";
|
|
5
|
+
import ChronicleLiveChip from "./ChronicleLiveChip.svelte";
|
|
6
|
+
import ChronicleThinkingText from "./ChronicleThinkingText.svelte";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
text: string;
|
|
10
|
+
preview: string;
|
|
11
|
+
previewTruncated?: boolean;
|
|
12
|
+
toolCallCount: number;
|
|
13
|
+
traceItemCount: number;
|
|
14
|
+
isLive?: boolean;
|
|
15
|
+
onOpenDetails?: (() => void) | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
text,
|
|
20
|
+
preview,
|
|
21
|
+
previewTruncated = false,
|
|
22
|
+
toolCallCount,
|
|
23
|
+
traceItemCount,
|
|
24
|
+
isLive = false,
|
|
25
|
+
onOpenDetails = null,
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
|
|
28
|
+
const previewLines = $derived(splitChronicleLines(preview));
|
|
29
|
+
const fallbackLines = $derived(splitChronicleLines(text));
|
|
30
|
+
const hasPreview = $derived(previewLines.length > 0);
|
|
31
|
+
const hasText = $derived(normalizeChronicleText(text).length > 0);
|
|
32
|
+
const hasDetails = $derived(Boolean(onOpenDetails));
|
|
33
|
+
const showsReasoningText = $derived(hasPreview || (traceItemCount === 0 && hasText));
|
|
34
|
+
const isCompactReasoning = $derived(!showsReasoningText && !isLive);
|
|
35
|
+
const overflowAffordanceCopy = $derived(
|
|
36
|
+
hasDetails
|
|
37
|
+
? "Earlier reasoning hidden · open details for the full trace"
|
|
38
|
+
: "Earlier reasoning hidden",
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<section
|
|
43
|
+
class="thinking-section"
|
|
44
|
+
class:is-live={isLive}
|
|
45
|
+
data-section="thinking-preview"
|
|
46
|
+
data-live={isLive ? "true" : "false"}
|
|
47
|
+
>
|
|
48
|
+
<div class="reasoning-header">
|
|
49
|
+
<div class="reasoning-heading">
|
|
50
|
+
<p class="reasoning-label">Reasoning</p>
|
|
51
|
+
{#if isLive}
|
|
52
|
+
<ChronicleLiveChip label="Live" size="sm" />
|
|
53
|
+
{/if}
|
|
54
|
+
</div>
|
|
55
|
+
{#if hasDetails}
|
|
56
|
+
<ChronicleExpandButton
|
|
57
|
+
expanded={false}
|
|
58
|
+
collapsedLabel="Expand reasoning"
|
|
59
|
+
class="details-button"
|
|
60
|
+
dataAction="open-reasoning-details"
|
|
61
|
+
ariaLabel="Expand reasoning"
|
|
62
|
+
onClick={() => onOpenDetails?.()}
|
|
63
|
+
/>
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div
|
|
68
|
+
class="thinking-preview-copy"
|
|
69
|
+
data-line-count={previewLines.length > 0 ? previewLines.length : fallbackLines.length}
|
|
70
|
+
data-truncated={previewTruncated ? "true" : "false"}
|
|
71
|
+
data-trace-item-count={traceItemCount}
|
|
72
|
+
data-compact={isCompactReasoning ? "true" : undefined}
|
|
73
|
+
style:--thinking-preview-lines={THINKING_PREVIEW_LINE_COUNT}
|
|
74
|
+
>
|
|
75
|
+
{#if hasPreview}
|
|
76
|
+
<ChronicleThinkingText text={preview} variant="preview" />
|
|
77
|
+
{:else if toolCallCount > 0 || traceItemCount > 0}
|
|
78
|
+
<p class="empty-copy">Open details to inspect the reasoning trace.</p>
|
|
79
|
+
{:else if hasText}
|
|
80
|
+
<ChronicleThinkingText text={text} variant="preview" />
|
|
81
|
+
{:else}
|
|
82
|
+
<p class="empty-copy">No reasoning was recorded.</p>
|
|
83
|
+
{/if}
|
|
84
|
+
|
|
85
|
+
<div
|
|
86
|
+
class="overflow-affordance"
|
|
87
|
+
data-visible={previewTruncated ? "true" : "false"}
|
|
88
|
+
aria-hidden={previewTruncated ? undefined : true}
|
|
89
|
+
>
|
|
90
|
+
{previewTruncated ? overflowAffordanceCopy : "\u00a0"}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</section>
|
|
94
|
+
|
|
95
|
+
<style>
|
|
96
|
+
.thinking-section {
|
|
97
|
+
display: grid;
|
|
98
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
99
|
+
gap: 12px;
|
|
100
|
+
padding: 12px 14px;
|
|
101
|
+
border-radius: 12px;
|
|
102
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-border) 82%, white 18%);
|
|
103
|
+
background: color-mix(in srgb, var(--chronicle-panel-muted) 76%, white 24%);
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.reasoning-header,
|
|
108
|
+
.reasoning-heading {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: var(--space-xs);
|
|
112
|
+
min-width: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.reasoning-header {
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.reasoning-heading {
|
|
120
|
+
flex-wrap: wrap;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.reasoning-label {
|
|
124
|
+
margin: 0;
|
|
125
|
+
font-size: var(--type-label);
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
letter-spacing: var(--tracking-label);
|
|
128
|
+
line-height: 1.4;
|
|
129
|
+
text-transform: uppercase;
|
|
130
|
+
color: var(--chronicle-text-muted);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.thinking-preview-copy {
|
|
134
|
+
--thinking-preview-body-height: calc(var(--thinking-preview-lines, 3) * 1lh);
|
|
135
|
+
display: grid;
|
|
136
|
+
grid-template-rows: var(--thinking-preview-body-height) 1lh;
|
|
137
|
+
gap: 8px;
|
|
138
|
+
width: min(100%, 64ch);
|
|
139
|
+
min-width: 0;
|
|
140
|
+
align-items: start;
|
|
141
|
+
font-size: var(--type-body-sm);
|
|
142
|
+
line-height: 1.72;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.thinking-preview-copy :global(.thinking-copy[data-variant="preview"]),
|
|
146
|
+
.thinking-preview-copy .empty-copy {
|
|
147
|
+
min-height: 0;
|
|
148
|
+
max-height: var(--thinking-preview-body-height);
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.thinking-preview-copy[data-compact="true"] {
|
|
153
|
+
grid-template-rows: auto;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.thinking-preview-copy[data-compact="true"] .empty-copy {
|
|
157
|
+
max-height: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.thinking-preview-copy[data-compact="true"] .overflow-affordance {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.overflow-affordance {
|
|
165
|
+
min-height: 1lh;
|
|
166
|
+
font-size: 11px;
|
|
167
|
+
font-weight: 620;
|
|
168
|
+
letter-spacing: 0.01em;
|
|
169
|
+
color: color-mix(in srgb, var(--chronicle-text-muted) 86%, var(--chronicle-text) 14%);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.overflow-affordance[data-visible="false"] {
|
|
173
|
+
visibility: hidden;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.empty-copy {
|
|
177
|
+
margin: 0;
|
|
178
|
+
max-width: none;
|
|
179
|
+
font-family: inherit;
|
|
180
|
+
font-size: var(--type-body-sm);
|
|
181
|
+
line-height: 1.72;
|
|
182
|
+
color: var(--chronicle-text-muted);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@media (max-width: 720px) {
|
|
186
|
+
.reasoning-header {
|
|
187
|
+
align-items: flex-start;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { splitChronicleLines } from "../lib/formatting.js";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
text: string;
|
|
6
|
+
trim?: boolean;
|
|
7
|
+
variant?: "default" | "preview";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { text, trim = false, variant = "default" }: Props = $props();
|
|
11
|
+
|
|
12
|
+
const lines = $derived(splitChronicleLines(text, { trim }));
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<p class="thinking-copy" data-variant={variant}>
|
|
16
|
+
{#each lines as line, index (`thinking-line-${index}`)}
|
|
17
|
+
<span class="thinking-line">{line.length > 0 ? line : "\u00a0"}</span>
|
|
18
|
+
{/each}
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.thinking-copy {
|
|
23
|
+
margin: 0;
|
|
24
|
+
font-family: inherit;
|
|
25
|
+
font-size: var(--type-body-sm);
|
|
26
|
+
line-height: 1.72;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.thinking-copy[data-variant="default"] {
|
|
30
|
+
max-width: 64ch;
|
|
31
|
+
color: color-mix(in srgb, var(--chronicle-text-muted) 78%, var(--chronicle-text) 22%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.thinking-copy[data-variant="preview"] {
|
|
35
|
+
display: grid;
|
|
36
|
+
gap: 0;
|
|
37
|
+
max-width: 64ch;
|
|
38
|
+
color: color-mix(in srgb, var(--chronicle-text-muted) 82%, var(--chronicle-text) 18%);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.thinking-line {
|
|
42
|
+
display: block;
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
overflow-wrap: anywhere;
|
|
45
|
+
}
|
|
46
|
+
</style>
|