@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.
Files changed (170) hide show
  1. package/dist/LICENSE +13 -0
  2. package/dist/assets/ChronicleMarkdown-BLgtHeEE.js +16 -0
  3. package/dist/assets/ChronicleMarkdown-D6hFzERy.css +1 -0
  4. package/dist/assets/FutureLaunchDetailPage-KrXSGzHM.js +1 -0
  5. package/dist/assets/FutureLaunchDetailPage-VPMBtpYc.css +1 -0
  6. package/dist/assets/GenericLauncher-Cv38FByt.js +1 -0
  7. package/dist/assets/GenericLauncher-D_GMtsQ5.css +1 -0
  8. package/dist/assets/HomePage-Cd3lEtwZ.js +1 -0
  9. package/dist/assets/HomePage-DYh_QHXv.css +1 -0
  10. package/dist/assets/PageHeader-6PdvYODN.css +1 -0
  11. package/dist/assets/PageHeader-D6pP4hIh.js +1 -0
  12. package/dist/assets/ProcessActionsMenu-1QySGNy9.js +1 -0
  13. package/dist/assets/ProcessActionsMenu-BT2r9vO8.css +1 -0
  14. package/dist/assets/ProcessDetailPage-BLuc7sjV.js +12 -0
  15. package/dist/assets/ProcessDetailPage-CSrjzajF.css +1 -0
  16. package/dist/assets/ProcessFlowDiagram-BAh_M_rb.js +2 -0
  17. package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +1 -0
  18. package/dist/assets/ProcessesPage-BcM38HMs.css +1 -0
  19. package/dist/assets/ProcessesPage-DtPweRU-.js +1 -0
  20. package/dist/assets/ScheduleDateTimePicker-CQGvY-Rc.js +1 -0
  21. package/dist/assets/ScheduleDateTimePicker-CadXN9z7.css +1 -0
  22. package/dist/assets/SkillsPage-B30FAFia.css +1 -0
  23. package/dist/assets/SkillsPage-bXuv0kEE.js +2 -0
  24. package/dist/assets/WatchersPage-DNyUsU1y.js +1 -0
  25. package/dist/assets/WatchersPage-Dnfi1zUK.css +1 -0
  26. package/dist/assets/api-CqECFdii.js +1 -0
  27. package/dist/assets/browser-storage-LbKCyf_w.js +1 -0
  28. package/dist/assets/dist-B7WNbObw.js +2 -0
  29. package/dist/assets/index-66T4Gmbl.css +1 -0
  30. package/dist/assets/index-C8qCggeq.js +7 -0
  31. package/dist/assets/index-client-BqF3_t3P.js +2 -0
  32. package/dist/assets/mermaid-render.worker-DAVgiVRG.js +6393 -0
  33. package/dist/assets/retry-config.svelte-DFKCJtCe.js +1 -0
  34. package/dist/assets/router.svelte-COr45o9R.js +1 -0
  35. package/dist/fonts/OFL-Public-Sans.txt +115 -0
  36. package/dist/fonts/OFL-Spectral.txt +93 -0
  37. package/dist/fonts/README.md +38 -0
  38. package/dist/fonts/fonts.css +85 -0
  39. package/dist/fonts/public-sans-latin-cd00287f.woff2 +0 -0
  40. package/dist/fonts/public-sans-latin-ext-d025d4ba.woff2 +0 -0
  41. package/dist/fonts/spectral-latin-89d48951.woff2 +0 -0
  42. package/dist/fonts/spectral-latin-b7578f14.woff2 +0 -0
  43. package/dist/fonts/spectral-latin-c4e0a00d.woff2 +0 -0
  44. package/dist/fonts/spectral-latin-ext-260738f4.woff2 +0 -0
  45. package/dist/fonts/spectral-latin-ext-ab18ac17.woff2 +0 -0
  46. package/dist/fonts/spectral-latin-ext-f58c1db3.woff2 +0 -0
  47. package/dist/index.html +32 -0
  48. package/package.json +47 -0
  49. package/src/App.svelte +257 -0
  50. package/src/chronicle/components/ChronicleActionSection.svelte +1035 -0
  51. package/src/chronicle/components/ChronicleExpandButton.svelte +70 -0
  52. package/src/chronicle/components/ChronicleFlow.svelte +289 -0
  53. package/src/chronicle/components/ChronicleLeafOutcomePlaceholder.svelte +44 -0
  54. package/src/chronicle/components/ChronicleLeafOutcomeRendererHost.svelte +408 -0
  55. package/src/chronicle/components/ChronicleLeafOutcomeSection.svelte +253 -0
  56. package/src/chronicle/components/ChronicleLiveChip.svelte +96 -0
  57. package/src/chronicle/components/ChronicleLiveTail.svelte +376 -0
  58. package/src/chronicle/components/ChronicleMarkdown.svelte +168 -0
  59. package/src/chronicle/components/ChronicleOperatorInputSection.svelte +41 -0
  60. package/src/chronicle/components/ChronicleProcessErrorSection.svelte +131 -0
  61. package/src/chronicle/components/ChroniclePromptSection.svelte +54 -0
  62. package/src/chronicle/components/ChronicleQuestionRequest.svelte +167 -0
  63. package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +893 -0
  64. package/src/chronicle/components/ChronicleRecoverySection.svelte +338 -0
  65. package/src/chronicle/components/ChronicleScheduledActionSection.svelte +192 -0
  66. package/src/chronicle/components/ChronicleSectionHeader.svelte +135 -0
  67. package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +138 -0
  68. package/src/chronicle/components/ChronicleTerminalSummary.svelte +127 -0
  69. package/src/chronicle/components/ChronicleThinkingSection.svelte +191 -0
  70. package/src/chronicle/components/ChronicleThinkingText.svelte +46 -0
  71. package/src/chronicle/components/ChronicleToolCallItem.svelte +477 -0
  72. package/src/chronicle/components/ChronicleTurnCluster.svelte +325 -0
  73. package/src/chronicle/components/ChronicleTurnRail.svelte +584 -0
  74. package/src/chronicle/components/ChronicleUsageStats.svelte +107 -0
  75. package/src/chronicle/components/CompactActionComposer.svelte +417 -0
  76. package/src/chronicle/components/ModelProfileOptions.svelte +20 -0
  77. package/src/chronicle/components/ProviderOptionsEditor.svelte +171 -0
  78. package/src/chronicle/components/RecoveryModelControl.svelte +95 -0
  79. package/src/chronicle/lib/action-bindings.ts +90 -0
  80. package/src/chronicle/lib/action-model-display.ts +133 -0
  81. package/src/chronicle/lib/action-preview.ts +16 -0
  82. package/src/chronicle/lib/chronicle-projection.ts +1342 -0
  83. package/src/chronicle/lib/chronicle-selectable-items.ts +352 -0
  84. package/src/chronicle/lib/chronicle-view-model.ts +121 -0
  85. package/src/chronicle/lib/formatting.ts +18 -0
  86. package/src/chronicle/lib/leaf-outcome-loader.ts +214 -0
  87. package/src/chronicle/lib/leaf-outcome-runtime.ts +37 -0
  88. package/src/chronicle/lib/prompt-highlighting.ts +78 -0
  89. package/src/chronicle/lib/scroll-sync.ts +88 -0
  90. package/src/chronicle/lib/tool-call-summary.ts +64 -0
  91. package/src/components/BrowserUiExtensionIndicatorHost.svelte +34 -0
  92. package/src/components/ConversationTreeDiagram.svelte +393 -0
  93. package/src/components/FormFieldRenderer.svelte +359 -0
  94. package/src/components/GenericLauncher.svelte +1970 -0
  95. package/src/components/KeyboardShortcutsModal.svelte +52 -0
  96. package/src/components/ModalShell.svelte +105 -0
  97. package/src/components/PageHeader.svelte +146 -0
  98. package/src/components/ProcessActionsMenu.svelte +514 -0
  99. package/src/components/ProcessInfoOverlay.svelte +1229 -0
  100. package/src/components/ScheduleDateTimePicker.svelte +155 -0
  101. package/src/components/SkillSelector.svelte +45 -0
  102. package/src/components/ToastContainer.svelte +192 -0
  103. package/src/components/launcher-form-copy.ts +172 -0
  104. package/src/components/launcher-model-config.ts +263 -0
  105. package/src/components/launcher-schedule.ts +127 -0
  106. package/src/extension-ui-dev-server.ts +98 -0
  107. package/src/lib/api.ts +970 -0
  108. package/src/lib/beautiful-mermaid-elk-instance.ts +54 -0
  109. package/src/lib/browser-storage.ts +11 -0
  110. package/src/lib/cost-estimates.ts +41 -0
  111. package/src/lib/elk-bundled-worker.ts +41 -0
  112. package/src/lib/flow-layout.ts +326 -0
  113. package/src/lib/format.ts +96 -0
  114. package/src/lib/future-executions-logic.ts +12 -0
  115. package/src/lib/future-launch-detail.ts +145 -0
  116. package/src/lib/instance-tree-layout.ts +158 -0
  117. package/src/lib/keyboard-shortcuts-help.ts +20 -0
  118. package/src/lib/keyboard.ts +40 -0
  119. package/src/lib/launcher-recent-values.ts +68 -0
  120. package/src/lib/markdown.ts +94 -0
  121. package/src/lib/mermaid-render.worker.ts +36 -0
  122. package/src/lib/pi-stream.ts +3 -0
  123. package/src/lib/primary-path-detail.ts +337 -0
  124. package/src/lib/primary-path-replay.ts +27 -0
  125. package/src/lib/process-browser.ts +179 -0
  126. package/src/lib/process-initial-prompt.ts +7 -0
  127. package/src/lib/process-launch-notices.svelte.ts +25 -0
  128. package/src/lib/process-row-view.ts +60 -0
  129. package/src/lib/process-terminal-display.ts +17 -0
  130. package/src/lib/process-toast-focus.svelte.ts +18 -0
  131. package/src/lib/processes-logic.ts +2 -0
  132. package/src/lib/processes.svelte.ts +334 -0
  133. package/src/lib/request-guard.ts +20 -0
  134. package/src/lib/retry-config.svelte.ts +19 -0
  135. package/src/lib/rich-markdown-elements.ts +173 -0
  136. package/src/lib/router-logic.ts +190 -0
  137. package/src/lib/router.svelte.ts +56 -0
  138. package/src/lib/runtime-config.ts +96 -0
  139. package/src/lib/test-fixtures.ts +13 -0
  140. package/src/lib/toasts.svelte.ts +104 -0
  141. package/src/lib/tool-call-rendering.ts +66 -0
  142. package/src/lib/ui-extensions.svelte.ts +381 -0
  143. package/src/lib/usage-snapshot.ts +9 -0
  144. package/src/lib/ws-classifier.ts +80 -0
  145. package/src/lib/ws.svelte.ts +281 -0
  146. package/src/main.ts +8 -0
  147. package/src/pages/FutureLaunchDetailPage.svelte +479 -0
  148. package/src/pages/HomePage.svelte +306 -0
  149. package/src/pages/ProcessCard.svelte +99 -0
  150. package/src/pages/ProcessDetailPage.svelte +599 -0
  151. package/src/pages/ProcessFlowDiagram.svelte +696 -0
  152. package/src/pages/ProcessGallery.svelte +252 -0
  153. package/src/pages/ProcessesPage.svelte +994 -0
  154. package/src/pages/SkillsPage.svelte +665 -0
  155. package/src/pages/WatchersPage.svelte +330 -0
  156. package/src/pages/process-detail/OverlayFrame.svelte +58 -0
  157. package/src/pages/process-detail/ProcessDetailChronicle.svelte +460 -0
  158. package/src/pages/process-detail/ProcessDetailHeader.svelte +167 -0
  159. package/src/pages/process-detail/process-detail-action-drafts.svelte.ts +211 -0
  160. package/src/pages/process-detail/process-detail-actions.svelte.ts +548 -0
  161. package/src/pages/process-detail/process-detail-chronicle-dom.ts +102 -0
  162. package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +711 -0
  163. package/src/pages/process-detail/process-detail-mutations.svelte.ts +91 -0
  164. package/src/pages/process-detail/process-detail-view-model.ts +149 -0
  165. package/src/shell/AppShell.svelte +249 -0
  166. package/src/shell/RouteLoadBoundary.svelte +43 -0
  167. package/src/shell/Sidebar.svelte +1358 -0
  168. package/src/shell/test-fixtures/RouteLoadTestComponent.svelte +5 -0
  169. package/src/vite-env.d.ts +2 -0
  170. package/src/vite-server-config.ts +27 -0
@@ -0,0 +1,994 @@
1
+ <script lang="ts">
2
+ import PageHeader from "../components/PageHeader.svelte";
3
+ import ProcessActionsMenu from "../components/ProcessActionsMenu.svelte";
4
+ import { getBrowserStorage } from "../lib/browser-storage.js";
5
+ import { formatLocalDateTime24Hour } from "../lib/format.js";
6
+ import { isPlainShortcut, isTextEntryTarget } from "../lib/keyboard.js";
7
+ import {
8
+ buildProcessBrowserItems,
9
+ EMPTY_PROCESS_BROWSER_STATUS_COUNTS,
10
+ hasActiveFilters,
11
+ PROCESS_BROWSER_PAGE_SIZE,
12
+ type ProcessBrowserItem,
13
+ type ProcessBrowserSort,
14
+ type ProcessBrowserSortKey,
15
+ type ProcessBrowserStatusFilter,
16
+ readProcessBrowserView,
17
+ writeProcessBrowserView,
18
+ } from "../lib/process-browser.js";
19
+ import { getProcessTerminalIcon } from "../lib/process-terminal-display.js";
20
+ import { browseItems, browseState, loadProcessBrowse } from "../lib/processes.svelte";
21
+ import { buildFutureLaunchPath, buildProcessPath, navigate } from "../lib/router.svelte";
22
+
23
+ type StatusFilterOption = { value: ProcessBrowserStatusFilter; label: string };
24
+ const liveStatusFilters: StatusFilterOption[] = [
25
+ { value: "all", label: "All" },
26
+ { value: "running", label: "Running" },
27
+ { value: "scheduled", label: "Scheduled" },
28
+ { value: "needs_attention", label: "Needs attention" },
29
+ ];
30
+ const archiveStatusFilters: StatusFilterOption[] = [
31
+ { value: "completed", label: "Completed" },
32
+ { value: "aborted", label: "Aborted" },
33
+ ];
34
+ const browserViewStorage = getBrowserStorage();
35
+ const initialView = readProcessBrowserView(browserViewStorage);
36
+
37
+ let searchInputRef = $state<HTMLInputElement | null>(null);
38
+ let query = $state("");
39
+ let statusFilter = $state<ProcessBrowserStatusFilter>(initialView.status);
40
+ let processTypeFilter = $state(initialView.processType);
41
+ let sort = $state<ProcessBrowserSort>(initialView.sort);
42
+
43
+ const allItems = $derived(buildProcessBrowserItems($browseItems));
44
+ const processTypeOptions = $derived($browseState.facets?.processTypes ?? []);
45
+ const filters = $derived({ status: statusFilter, query, processType: processTypeFilter });
46
+ const statusCounts = $derived(
47
+ $browseState.facets?.statusCounts ?? EMPTY_PROCESS_BROWSER_STATUS_COUNTS,
48
+ );
49
+ const hasMore = $derived(Boolean($browseState.pagination?.hasMore));
50
+ const totalResultCount = $derived(
51
+ ($browseState.pagination?.processTotal ?? 0) +
52
+ ($browseState.pagination?.futureExecutionTotal ?? 0),
53
+ );
54
+ const hasActiveFilter = $derived(hasActiveFilters(filters));
55
+
56
+ function browseRequest(limit = PROCESS_BROWSER_PAGE_SIZE, offset?: number) {
57
+ return {
58
+ limit,
59
+ ...(offset === undefined ? {} : { offset }),
60
+ query,
61
+ status: statusFilter,
62
+ processType: processTypeFilter,
63
+ sortKey: sort.key,
64
+ sortDirection: sort.direction,
65
+ };
66
+ }
67
+
68
+ $effect(() => {
69
+ writeProcessBrowserView(browserViewStorage, {
70
+ status: statusFilter,
71
+ processType: processTypeFilter,
72
+ sort,
73
+ });
74
+ });
75
+
76
+ $effect(() => {
77
+ const timer = setTimeout(() => void loadProcessBrowse(browseRequest()), query.trim() ? 180 : 0);
78
+ return () => clearTimeout(timer);
79
+ });
80
+
81
+ function sortButtonLabel(key: ProcessBrowserSortKey, label: string): string {
82
+ if (sort.key !== key) {
83
+ return `Sort by ${label}`;
84
+ }
85
+ const next = sort.direction === "asc" ? "descending" : "ascending";
86
+ const current = sort.direction === "asc" ? "ascending" : "descending";
87
+ return `${label}, sorted ${current}. Activate to sort ${next}.`;
88
+ }
89
+
90
+ function toggleSort(key: ProcessBrowserSortKey) {
91
+ if (sort.key === key) {
92
+ sort = { key, direction: sort.direction === "asc" ? "desc" : "asc" };
93
+ } else {
94
+ // New column starts ascending for names, descending for status/time where
95
+ // the most relevant rows belong at the top.
96
+ sort = { key, direction: key === "title" ? "asc" : "desc" };
97
+ }
98
+ }
99
+
100
+ function updateQuery(event: Event) {
101
+ query = (event.currentTarget as HTMLInputElement).value;
102
+ }
103
+
104
+ function setStatusFilter(next: ProcessBrowserStatusFilter) {
105
+ statusFilter = next;
106
+ }
107
+
108
+ function updateProcessType(event: Event) {
109
+ processTypeFilter = (event.currentTarget as HTMLSelectElement).value;
110
+ }
111
+
112
+ function clearFilters() {
113
+ query = "";
114
+ statusFilter = "all";
115
+ processTypeFilter = "";
116
+ searchInputRef?.focus();
117
+ }
118
+
119
+ function showMore() {
120
+ const pagination = $browseState.pagination;
121
+ if (!pagination) return;
122
+ void loadProcessBrowse(browseRequest(pagination.limit, allItems.length), { append: true });
123
+ }
124
+
125
+ function refreshProcesses() {
126
+ void loadProcessBrowse(browseRequest());
127
+ }
128
+
129
+ function itemHref(item: ProcessBrowserItem): string {
130
+ if (item.kind === "future" && item.futureExecutionId) {
131
+ return buildFutureLaunchPath(item.futureExecutionId);
132
+ }
133
+ return buildProcessPath(item.instanceId ?? item.id);
134
+ }
135
+
136
+ function followItem(item: ProcessBrowserItem, event: MouseEvent) {
137
+ event.preventDefault();
138
+ navigate(itemHref(item));
139
+ }
140
+
141
+ function statusMark(item: ProcessBrowserItem): string {
142
+ switch (item.statusFilter) {
143
+ case "running":
144
+ return "R";
145
+ case "scheduled":
146
+ return "S";
147
+ case "needs_attention":
148
+ return "W";
149
+ case "completed":
150
+ return getProcessTerminalIcon("completed");
151
+ case "aborted":
152
+ return getProcessTerminalIcon("aborted");
153
+ default:
154
+ return "?";
155
+ }
156
+ }
157
+
158
+ function timestampLabel(item: ProcessBrowserItem): string {
159
+ if (!item.sortAt) {
160
+ return "No timestamp";
161
+ }
162
+ const formatted = formatLocalDateTime24Hour(item.sortAt);
163
+ if (item.statusFilter === "scheduled") {
164
+ return `Runs ${formatted}`;
165
+ }
166
+ if (item.statusFilter === "completed" || item.statusFilter === "aborted") {
167
+ return `Closed ${formatted}`;
168
+ }
169
+ return `Updated ${formatted}`;
170
+ }
171
+
172
+ function rowSummary(item: ProcessBrowserItem): string {
173
+ const prompt = item.initialPrompt ? ` Initial prompt: ${item.initialPrompt}` : "";
174
+ return `${item.title}. ${item.statusDetail}. ${timestampLabel(item)}.${prompt}`;
175
+ }
176
+
177
+ function handleWindowKeydown(event: KeyboardEvent) {
178
+ if (event.defaultPrevented || !isPlainShortcut(event) || event.key !== "/") {
179
+ return;
180
+ }
181
+ if (isTextEntryTarget(event.target)) {
182
+ return;
183
+ }
184
+ event.preventDefault();
185
+ searchInputRef?.focus();
186
+ searchInputRef?.select();
187
+ }
188
+ </script>
189
+
190
+ <svelte:window onkeydown={handleWindowKeydown} />
191
+
192
+ {#snippet filterChips(options: StatusFilterOption[], archive = false)}
193
+ {#each options as filter (filter.value)}
194
+ <button
195
+ type="button"
196
+ class="filter-chip"
197
+ class:archive-chip={archive}
198
+ class:is-active={statusFilter === filter.value}
199
+ data-filter-status={filter.value}
200
+ data-pressable="true"
201
+ aria-pressed={statusFilter === filter.value}
202
+ onclick={() => setStatusFilter(filter.value)}
203
+ >
204
+ <span>{filter.label}</span>
205
+ <span class="chip-count">{statusCounts[filter.value]}</span>
206
+ </button>
207
+ {/each}
208
+ {/snippet}
209
+
210
+ {#snippet sortHeader(key: ProcessBrowserSortKey, label: string)}
211
+ <button
212
+ type="button"
213
+ class="column-sort"
214
+ class:is-active={sort.key === key}
215
+ data-sort-key={key}
216
+ aria-label={sortButtonLabel(key, label)}
217
+ onclick={() => toggleSort(key)}
218
+ >
219
+ <span>{label}</span>
220
+ <span class="sort-arrow" aria-hidden="true">
221
+ {#if sort.key === key}{sort.direction === "asc" ? "↑" : "↓"}{:else}↕{/if}
222
+ </span>
223
+ </button>
224
+ {/snippet}
225
+
226
+ <section class="processes-page" data-section="all-processes-page">
227
+ <PageHeader
228
+ title="All processes"
229
+ subtitle="Browse current, scheduled, and past process records. Search or filter to narrow the list."
230
+ />
231
+
232
+ <div class="browser-panel" data-section="process-browser">
233
+ <div class="browser-toolbar" data-section="process-browse-controls">
234
+ <label class="search-field">
235
+ <span class="sr-only">Search</span>
236
+ <input
237
+ bind:this={searchInputRef}
238
+ type="search"
239
+ value={query}
240
+ placeholder="Search processes by title or prompt"
241
+ aria-label="Search processes by title or prompt"
242
+ oninput={updateQuery}
243
+ />
244
+ </label>
245
+
246
+ <label class="type-filter">
247
+ <span class="sr-only">Process type</span>
248
+ <select value={processTypeFilter} onchange={updateProcessType} data-filter="process-type">
249
+ <option value="">All process types</option>
250
+ {#if $browseState.facets && processTypeFilter && !processTypeOptions.some((option) => option.value === processTypeFilter)}
251
+ <option value={processTypeFilter}>{processTypeFilter} (unavailable)</option>
252
+ {/if}
253
+ {#each processTypeOptions as option (option.value)}
254
+ <option value={option.value}>{option.label} ({option.count})</option>
255
+ {/each}
256
+ </select>
257
+ </label>
258
+
259
+ <p class="result-count" aria-live="polite">
260
+ <span>{totalResultCount}</span>
261
+ {totalResultCount === 1 ? "record" : "records"}
262
+ </p>
263
+
264
+ {#if hasActiveFilter}
265
+ <button type="button" class="reset-view-button" data-pressable="true" onclick={clearFilters}>
266
+ Clear filters
267
+ </button>
268
+ {/if}
269
+
270
+ <button
271
+ type="button"
272
+ class="refresh-button"
273
+ data-action="refresh-processes"
274
+ data-pressable="true"
275
+ disabled={$browseState.loading}
276
+ onclick={refreshProcesses}
277
+ >
278
+ {$browseState.loading ? "Refreshing…" : "Refresh"}
279
+ </button>
280
+ </div>
281
+
282
+ <div class="filter-row" role="group" aria-label="Process status filters">
283
+ <span class="filter-row-label">Status</span>
284
+ <div class="filter-group">
285
+ {@render filterChips(liveStatusFilters)}
286
+ </div>
287
+ <div class="filter-group archive-group">
288
+ {@render filterChips(archiveStatusFilters, true)}
289
+ </div>
290
+ </div>
291
+
292
+ {#if $browseState.error}
293
+ <div class="state-banner" role="status" data-state="process-list-error">
294
+ <p>Process list couldn’t refresh. Existing results may be out of date.</p>
295
+ <button type="button" data-pressable="true" onclick={refreshProcesses}>Try again</button>
296
+ </div>
297
+ {/if}
298
+
299
+ <div class="process-table-shell">
300
+ <div class="process-table-heading">
301
+ {@render sortHeader("status", "Status")}
302
+ {@render sortHeader("title", "Process")}
303
+ <span class="prompt-heading">Initial prompt</span>
304
+ {@render sortHeader("timeline", "Timeline")}
305
+ <span class="actions-heading">Actions</span>
306
+ </div>
307
+
308
+ {#if $browseState.loading && allItems.length === 0}
309
+ <div class="skeleton-list" data-state="processes-loading" role="status">
310
+ {#each Array(6) as _, index (index)}
311
+ <div class="skeleton-row"></div>
312
+ {/each}
313
+ </div>
314
+ {:else if allItems.length === 0 && hasActiveFilter}
315
+ <div class="empty-state" data-state="processes-no-results">
316
+ <h2>No processes match these filters</h2>
317
+ <p>Change the search or filters to see more process records.</p>
318
+ <button type="button" class="clear-button" data-pressable="true" onclick={clearFilters}>
319
+ Clear search and filters
320
+ </button>
321
+ </div>
322
+ {:else if allItems.length === 0}
323
+ <div class="empty-state" data-state="processes-empty">
324
+ <h2>No process records yet</h2>
325
+ <p>Started and scheduled processes will appear here.</p>
326
+ </div>
327
+ {:else}
328
+ <div class="process-table" data-section="process-browser-results">
329
+ {#each allItems as item (item.id)}
330
+ <article
331
+ class="process-browser-row"
332
+ data-process-browser-row=""
333
+ data-item-id={item.id}
334
+ data-item-kind={item.kind}
335
+ data-status-filter={item.statusFilter}
336
+ >
337
+ <a
338
+ href={itemHref(item)}
339
+ class="row-main"
340
+ data-pressable="true"
341
+ aria-label={rowSummary(item)}
342
+ onclick={(event) => followItem(item, event)}
343
+ >
344
+ <span class={`status-mark ${item.statusFilter}`} aria-hidden="true">
345
+ {statusMark(item)}
346
+ </span>
347
+
348
+ <span class="row-process">
349
+ <span class="row-title">{item.title}</span>
350
+ <span class="row-meta">
351
+ {item.statusDetail} · {item.processDisplayName}
352
+ </span>
353
+ </span>
354
+
355
+ <span class="prompt-cell">
356
+ {#if item.initialPrompt}
357
+ {item.initialPrompt}
358
+ {:else}
359
+ <span class="muted">No initial prompt captured</span>
360
+ {/if}
361
+ </span>
362
+
363
+ <span class="time-cell">{timestampLabel(item)}</span>
364
+ </a>
365
+
366
+ <div class="row-actions" data-process-actions-for={item.instanceId ?? item.id}>
367
+ {#if item.kind === "process" && item.instanceId}
368
+ <ProcessActionsMenu
369
+ instanceId={item.instanceId}
370
+ lifecycleStatus={item.lifecycleStatus}
371
+ processLabel={item.title}
372
+ onDeleted={refreshProcesses}
373
+ />
374
+ {:else}
375
+ <span class="future-action-note">Scheduled start</span>
376
+ {/if}
377
+ </div>
378
+ </article>
379
+ {/each}
380
+ </div>
381
+ {/if}
382
+ </div>
383
+
384
+ {#if hasMore}
385
+ <div class="pagination-row">
386
+ <button type="button" class="show-more-button" data-pressable="true" onclick={showMore}>
387
+ Show more
388
+ </button>
389
+ </div>
390
+ {/if}
391
+ </div>
392
+ </section>
393
+
394
+ <style>
395
+ .processes-page {
396
+ display: flex;
397
+ flex-direction: column;
398
+ gap: var(--space-lg);
399
+ width: 100%;
400
+ min-height: 0;
401
+ height: 100%;
402
+ padding: var(--space-2xs) 2px var(--space-xl);
403
+ box-sizing: border-box;
404
+ color: var(--chronicle-text);
405
+ }
406
+
407
+ .sr-only {
408
+ position: absolute;
409
+ width: 1px;
410
+ height: 1px;
411
+ padding: 0;
412
+ margin: -1px;
413
+ overflow: hidden;
414
+ clip: rect(0, 0, 0, 0);
415
+ white-space: nowrap;
416
+ border: 0;
417
+ }
418
+
419
+ /* The browser panel binds the toolbar, status chips, and table into one
420
+ surface so the controls read as part of the table rather than floating cards. */
421
+ .browser-panel {
422
+ display: flex;
423
+ flex: 1 1 auto;
424
+ flex-direction: column;
425
+ min-height: 0;
426
+ border: 1px solid color-mix(in srgb, var(--chronicle-border) 88%, white 12%);
427
+ border-radius: 14px;
428
+ background: var(--chronicle-panel-surface);
429
+ overflow: visible;
430
+ box-shadow: var(--chronicle-shadow-soft);
431
+ }
432
+
433
+ .browser-toolbar {
434
+ display: grid;
435
+ grid-template-columns: minmax(280px, 1fr) minmax(210px, 260px) auto auto auto;
436
+ align-items: center;
437
+ gap: var(--space-sm);
438
+ padding: var(--space-md);
439
+ border-bottom: 1px solid var(--chronicle-border);
440
+ border-radius: 14px 14px 0 0;
441
+ background: linear-gradient(180deg, var(--chronicle-card-surface), var(--chronicle-panel-muted));
442
+ }
443
+
444
+ .result-count {
445
+ margin: 0;
446
+ display: inline-flex;
447
+ align-items: baseline;
448
+ justify-content: flex-end;
449
+ gap: 6px;
450
+ font-size: var(--type-caption);
451
+ font-weight: 800;
452
+ letter-spacing: 0.02em;
453
+ color: var(--chronicle-text-muted);
454
+ white-space: nowrap;
455
+ }
456
+
457
+ .result-count span {
458
+ font-family: var(--font-mono);
459
+ font-size: 1.35rem;
460
+ line-height: 1;
461
+ letter-spacing: -0.06em;
462
+ color: var(--chronicle-text);
463
+ }
464
+
465
+ .refresh-button,
466
+ .reset-view-button,
467
+ .clear-button,
468
+ .show-more-button,
469
+ .state-banner button {
470
+ display: inline-flex;
471
+ align-items: center;
472
+ justify-content: center;
473
+ min-height: 40px;
474
+ padding: 0 14px;
475
+ border-radius: 10px;
476
+ border: 1px solid var(--chronicle-border-strong);
477
+ background: var(--chronicle-card-surface);
478
+ color: var(--chronicle-text);
479
+ font-size: var(--type-body-sm);
480
+ font-weight: 800;
481
+ cursor: pointer;
482
+ white-space: nowrap;
483
+ }
484
+
485
+ .refresh-button:hover:not(:disabled),
486
+ .reset-view-button:hover,
487
+ .clear-button:hover,
488
+ .show-more-button:hover,
489
+ .state-banner button:hover {
490
+ border-color: color-mix(in srgb, var(--chronicle-accent) 32%, var(--chronicle-border-strong) 68%);
491
+ background: color-mix(in srgb, var(--chronicle-card-surface) 84%, var(--chronicle-accent) 16%);
492
+ transform: translateY(-1px);
493
+ }
494
+
495
+ .refresh-button:disabled {
496
+ opacity: 0.6;
497
+ cursor: default;
498
+ }
499
+
500
+ .search-field {
501
+ flex: 1 1 auto;
502
+ min-width: 200px;
503
+ }
504
+
505
+ .type-filter {
506
+ flex: 0 0 auto;
507
+ }
508
+
509
+ .search-field input,
510
+ .type-filter select {
511
+ width: 100%;
512
+ min-height: 40px;
513
+ border: 1px solid var(--chronicle-border);
514
+ border-radius: 10px;
515
+ background: var(--chronicle-card-surface);
516
+ color: var(--chronicle-text);
517
+ font-size: var(--type-body);
518
+ outline: none;
519
+ }
520
+
521
+ .search-field input {
522
+ padding: 0 14px;
523
+ }
524
+
525
+ .type-filter select {
526
+ padding: 0 38px 0 12px;
527
+ }
528
+
529
+ .search-field input:focus,
530
+ .type-filter select:focus {
531
+ border-color: color-mix(in srgb, var(--chronicle-accent) 48%, var(--chronicle-border) 52%);
532
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--chronicle-accent) 16%, transparent 84%);
533
+ }
534
+
535
+ .filter-row {
536
+ display: flex;
537
+ flex-wrap: wrap;
538
+ align-items: center;
539
+ gap: var(--space-sm);
540
+ padding: 10px var(--space-md);
541
+ border-bottom: 1px solid var(--chronicle-border);
542
+ background: color-mix(in srgb, var(--chronicle-panel-muted) 72%, white 28%);
543
+ }
544
+
545
+ .filter-row-label {
546
+ font-size: var(--type-label);
547
+ font-weight: 850;
548
+ letter-spacing: 0.1em;
549
+ text-transform: uppercase;
550
+ color: var(--chronicle-text-faint);
551
+ }
552
+
553
+ .filter-group {
554
+ display: inline-flex;
555
+ flex-wrap: wrap;
556
+ gap: 6px;
557
+ align-items: center;
558
+ }
559
+
560
+ .archive-group {
561
+ padding-left: var(--space-sm);
562
+ border-left: 1px solid var(--chronicle-border);
563
+ }
564
+
565
+ .filter-chip {
566
+ display: inline-flex;
567
+ align-items: center;
568
+ gap: 8px;
569
+ min-height: 34px;
570
+ padding: 0 11px;
571
+ border-radius: 9px;
572
+ border: 1px solid color-mix(in srgb, var(--chronicle-border) 92%, white 8%);
573
+ background: color-mix(in srgb, var(--chronicle-card-surface) 86%, var(--chronicle-panel-muted) 14%);
574
+ color: var(--chronicle-text-muted);
575
+ font-size: var(--type-body-sm);
576
+ font-weight: 800;
577
+ cursor: pointer;
578
+ }
579
+
580
+ .filter-chip:hover,
581
+ .filter-chip.is-active {
582
+ border-color: color-mix(in srgb, var(--chronicle-accent) 42%, var(--chronicle-border-strong) 58%);
583
+ background: color-mix(in srgb, var(--chronicle-card-surface) 80%, var(--chronicle-accent) 20%);
584
+ color: var(--chronicle-text);
585
+ }
586
+
587
+ .chip-count {
588
+ display: inline-flex;
589
+ align-items: center;
590
+ justify-content: center;
591
+ min-width: 24px;
592
+ height: 22px;
593
+ padding: 0 7px;
594
+ border-radius: 7px;
595
+ background: color-mix(in srgb, var(--chronicle-panel-muted) 78%, white 22%);
596
+ font-family: var(--font-mono);
597
+ font-size: 11px;
598
+ font-weight: 850;
599
+ font-variant-numeric: tabular-nums;
600
+ letter-spacing: -0.04em;
601
+ color: var(--chronicle-text-faint);
602
+ }
603
+
604
+ .filter-chip.is-active .chip-count {
605
+ background: var(--chronicle-accent);
606
+ color: var(--chronicle-text-on-accent);
607
+ }
608
+
609
+ .state-banner {
610
+ display: flex;
611
+ align-items: center;
612
+ justify-content: space-between;
613
+ gap: var(--space-md);
614
+ margin: var(--space-md);
615
+ padding: 12px 14px;
616
+ border: 1px solid var(--chronicle-danger-border);
617
+ border-radius: var(--radius-lg);
618
+ background: var(--chronicle-danger-surface-soft);
619
+ color: var(--chronicle-danger-text);
620
+ }
621
+
622
+ .state-banner p {
623
+ margin: 0;
624
+ font-size: var(--type-body-sm);
625
+ font-weight: 700;
626
+ }
627
+
628
+ .process-table-shell {
629
+ display: flex;
630
+ flex: 1 1 auto;
631
+ min-height: 0;
632
+ flex-direction: column;
633
+ }
634
+
635
+ .process-table-heading {
636
+ display: grid;
637
+ grid-template-columns: 74px minmax(240px, 1.25fr) minmax(240px, 1fr) minmax(170px, 0.62fr) 76px;
638
+ gap: var(--space-md);
639
+ padding: 4px var(--space-md);
640
+ border-bottom: 1px solid var(--chronicle-border);
641
+ background: color-mix(in srgb, var(--chronicle-text) 5%, var(--chronicle-panel-muted) 95%);
642
+ }
643
+
644
+ .column-sort {
645
+ display: inline-flex;
646
+ align-items: center;
647
+ gap: 6px;
648
+ min-height: 34px;
649
+ padding: 0 8px;
650
+ margin: 0 -8px;
651
+ border: 0;
652
+ border-radius: 8px;
653
+ background: transparent;
654
+ color: var(--chronicle-text-muted);
655
+ font-size: var(--type-label);
656
+ font-weight: 800;
657
+ letter-spacing: 0.07em;
658
+ text-transform: uppercase;
659
+ cursor: pointer;
660
+ }
661
+
662
+ .column-sort:hover {
663
+ background: color-mix(in srgb, var(--chronicle-panel-muted) 60%, var(--chronicle-accent) 12%);
664
+ color: var(--chronicle-text);
665
+ }
666
+
667
+ .column-sort.is-active {
668
+ color: var(--chronicle-accent);
669
+ }
670
+
671
+ .sort-arrow {
672
+ font-size: 12px;
673
+ line-height: 1;
674
+ opacity: 0.55;
675
+ }
676
+
677
+ .column-sort.is-active .sort-arrow {
678
+ opacity: 1;
679
+ }
680
+
681
+ .prompt-heading,
682
+ .actions-heading {
683
+ display: inline-flex;
684
+ align-items: center;
685
+ font-size: var(--type-label);
686
+ font-weight: 800;
687
+ letter-spacing: 0.07em;
688
+ text-transform: uppercase;
689
+ color: var(--chronicle-text-muted);
690
+ }
691
+
692
+ .process-table,
693
+ .skeleton-list {
694
+ overflow-y: auto;
695
+ min-height: 0;
696
+ }
697
+
698
+ .process-browser-row {
699
+ display: grid;
700
+ grid-template-columns: minmax(0, 1fr) auto;
701
+ align-items: stretch;
702
+ border-bottom: 1px solid color-mix(in srgb, var(--chronicle-border) 78%, transparent 22%);
703
+ background: var(--chronicle-card-surface);
704
+ }
705
+
706
+ .process-browser-row:last-child {
707
+ border-bottom: 0;
708
+ }
709
+
710
+ .process-browser-row:hover {
711
+ background: color-mix(in srgb, var(--chronicle-card-surface) 88%, var(--chronicle-accent) 12%);
712
+ }
713
+
714
+ .row-main {
715
+ display: grid;
716
+ grid-template-columns: 74px minmax(240px, 1.25fr) minmax(240px, 1fr) minmax(170px, 0.62fr);
717
+ gap: var(--space-md);
718
+ align-items: center;
719
+ min-width: 0;
720
+ padding: 15px var(--space-md);
721
+ color: inherit;
722
+ text-decoration: none;
723
+ }
724
+
725
+ .status-mark {
726
+ display: inline-flex;
727
+ align-items: center;
728
+ justify-content: center;
729
+ width: 30px;
730
+ height: 30px;
731
+ border-radius: 8px;
732
+ background: var(--chronicle-text-faint);
733
+ color: var(--chronicle-text-on-accent);
734
+ font-family: var(--font-mono);
735
+ font-size: 12px;
736
+ font-weight: 900;
737
+ justify-self: start;
738
+ box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
739
+ }
740
+
741
+ .status-mark.running {
742
+ background: color-mix(in srgb, var(--chronicle-accent) 12%, white 88%);
743
+ color: var(--chronicle-accent);
744
+ box-shadow: inset 0 0 0 2px var(--chronicle-accent);
745
+ }
746
+
747
+ .status-mark.scheduled {
748
+ background: var(--chronicle-attention);
749
+ }
750
+
751
+ .status-mark.needs_attention {
752
+ background: color-mix(in srgb, var(--chronicle-attention) 12%, white 88%);
753
+ color: color-mix(in srgb, var(--chronicle-attention) 76%, var(--chronicle-text) 24%);
754
+ box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--chronicle-attention) 76%, var(--chronicle-text) 24%);
755
+ }
756
+
757
+ .status-mark.completed {
758
+ background: var(--chronicle-success);
759
+ }
760
+
761
+ .status-mark.aborted {
762
+ background: var(--chronicle-text-faint);
763
+ }
764
+
765
+ .row-process,
766
+ .prompt-cell,
767
+ .time-cell {
768
+ min-width: 0;
769
+ }
770
+
771
+ .row-process {
772
+ display: grid;
773
+ gap: 4px;
774
+ }
775
+
776
+ .row-title {
777
+ font-size: var(--type-body-lg);
778
+ font-weight: 760;
779
+ line-height: 1.35;
780
+ color: var(--chronicle-text);
781
+ display: -webkit-box;
782
+ -webkit-line-clamp: 2;
783
+ -webkit-box-orient: vertical;
784
+ overflow: hidden;
785
+ }
786
+
787
+ .row-meta,
788
+ .time-cell,
789
+ .future-action-note {
790
+ font-size: var(--type-caption);
791
+ font-weight: 700;
792
+ line-height: 1.45;
793
+ color: var(--chronicle-text-faint);
794
+ }
795
+
796
+ .prompt-cell {
797
+ font-size: var(--type-body-sm);
798
+ line-height: 1.45;
799
+ color: var(--chronicle-text-muted);
800
+ display: -webkit-box;
801
+ -webkit-line-clamp: 2;
802
+ -webkit-box-orient: vertical;
803
+ overflow: hidden;
804
+ }
805
+
806
+ .muted {
807
+ color: color-mix(in srgb, var(--chronicle-text-faint) 72%, white 28%);
808
+ }
809
+
810
+ .time-cell {
811
+ font-variant-numeric: tabular-nums;
812
+ }
813
+
814
+ .row-actions {
815
+ display: flex;
816
+ align-items: center;
817
+ justify-content: center;
818
+ min-width: 76px;
819
+ padding: 0 var(--space-md) 0 0;
820
+ }
821
+
822
+ .future-action-note {
823
+ padding: 6px 8px;
824
+ border-radius: 8px;
825
+ background: color-mix(in srgb, var(--chronicle-panel-muted) 76%, white 24%);
826
+ }
827
+
828
+ .empty-state {
829
+ display: grid;
830
+ place-items: center;
831
+ align-content: center;
832
+ gap: var(--space-sm);
833
+ min-height: 280px;
834
+ padding: var(--space-xl);
835
+ text-align: center;
836
+ }
837
+
838
+ .empty-state h2,
839
+ .empty-state p {
840
+ margin: 0;
841
+ }
842
+
843
+ .empty-state h2 {
844
+ font-family: var(--font-display);
845
+ font-size: var(--type-title-lg);
846
+ line-height: 1.1;
847
+ }
848
+
849
+ .empty-state p {
850
+ max-width: 48ch;
851
+ color: var(--chronicle-text-muted);
852
+ }
853
+
854
+ .skeleton-list {
855
+ display: grid;
856
+ gap: 0;
857
+ }
858
+
859
+ .skeleton-row {
860
+ height: 74px;
861
+ border-bottom: 1px solid color-mix(in srgb, var(--chronicle-border) 68%, transparent 32%);
862
+ background:
863
+ linear-gradient(
864
+ 90deg,
865
+ transparent,
866
+ color-mix(in srgb, var(--chronicle-panel-muted) 70%, white 30%),
867
+ transparent
868
+ ),
869
+ color-mix(in srgb, var(--chronicle-card-surface) 92%, var(--chronicle-panel-muted) 8%);
870
+ background-size: 220% 100%;
871
+ animation: skeleton-sweep 1.3s var(--ease-out-quart) infinite;
872
+ }
873
+
874
+ @keyframes skeleton-sweep {
875
+ from {
876
+ background-position: 120% 0;
877
+ }
878
+
879
+ to {
880
+ background-position: -120% 0;
881
+ }
882
+ }
883
+
884
+ .pagination-row {
885
+ display: flex;
886
+ justify-content: center;
887
+ padding: var(--space-md);
888
+ border-top: 1px solid color-mix(in srgb, var(--chronicle-border) 82%, white 18%);
889
+ }
890
+
891
+ @media (prefers-reduced-motion: reduce) {
892
+ .skeleton-row {
893
+ animation: none;
894
+ }
895
+ }
896
+
897
+ @media (max-width: 1120px) {
898
+ .browser-toolbar {
899
+ grid-template-columns: minmax(260px, 1fr) minmax(200px, 240px) auto;
900
+ }
901
+
902
+ .result-count,
903
+ .reset-view-button {
904
+ justify-self: start;
905
+ }
906
+
907
+ .process-table-heading {
908
+ display: none;
909
+ }
910
+
911
+ .process-browser-row {
912
+ grid-template-columns: 1fr;
913
+ }
914
+
915
+ .row-main {
916
+ grid-template-columns: 42px minmax(0, 1fr);
917
+ gap: var(--space-sm);
918
+ }
919
+
920
+ .prompt-cell,
921
+ .time-cell {
922
+ grid-column: 2;
923
+ }
924
+
925
+ .row-actions {
926
+ justify-content: flex-start;
927
+ padding: 0 var(--space-md) var(--space-md) 56px;
928
+ }
929
+ }
930
+
931
+ @media (max-width: 720px) {
932
+ .processes-page {
933
+ height: auto;
934
+ gap: var(--space-md);
935
+ }
936
+
937
+ .state-banner {
938
+ align-items: stretch;
939
+ flex-direction: column;
940
+ }
941
+
942
+ .browser-panel {
943
+ overflow: visible;
944
+ border-radius: 12px;
945
+ }
946
+
947
+ .browser-toolbar {
948
+ grid-template-columns: 1fr;
949
+ padding: var(--space-sm);
950
+ }
951
+
952
+ .result-count {
953
+ justify-self: start;
954
+ }
955
+
956
+ .refresh-button,
957
+ .reset-view-button,
958
+ .search-field,
959
+ .type-filter {
960
+ width: 100%;
961
+ }
962
+
963
+ .filter-row {
964
+ align-items: flex-start;
965
+ gap: var(--space-xs);
966
+ padding: var(--space-sm);
967
+ }
968
+
969
+ .filter-row-label {
970
+ width: 100%;
971
+ }
972
+
973
+ .archive-group {
974
+ width: 100%;
975
+ padding-left: 0;
976
+ padding-top: var(--space-xs);
977
+ border-left: 0;
978
+ border-top: 1px solid var(--chronicle-border);
979
+ }
980
+
981
+ .process-table,
982
+ .skeleton-list {
983
+ overflow: visible;
984
+ }
985
+
986
+ .row-main {
987
+ padding: var(--space-md) var(--space-sm) var(--space-sm);
988
+ }
989
+
990
+ .row-actions {
991
+ padding: 0 var(--space-sm) var(--space-md) 54px;
992
+ }
993
+ }
994
+ </style>