@joewinke/jatui 0.23.0 → 0.25.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 (36) hide show
  1. package/CLAUDE.md +32 -2
  2. package/dist/components/AudioRecorder.svelte +84 -304
  3. package/dist/components/AudioRecorder.svelte.d.ts +1 -7
  4. package/dist/components/BulkActionBar.svelte +40 -0
  5. package/dist/components/BulkActionBar.svelte.d.ts +9 -0
  6. package/dist/components/ConfirmDialog.svelte +39 -35
  7. package/dist/components/CopyButton.svelte +5 -2
  8. package/dist/components/FloatingActionBar.svelte +55 -1
  9. package/dist/components/FloatingActionBar.svelte.d.ts +8 -1
  10. package/dist/components/InputDialog.svelte +49 -38
  11. package/dist/components/KeyboardShortcutsOverlay.svelte +54 -0
  12. package/dist/components/KeyboardShortcutsOverlay.svelte.d.ts +30 -0
  13. package/dist/components/bulkActionBarKeys.d.ts +40 -0
  14. package/dist/components/bulkActionBarKeys.js +38 -0
  15. package/dist/components/linked-columns/LinkedColumns.svelte +10 -22
  16. package/dist/components/linked-columns/LinkedColumns.svelte.d.ts +1 -9
  17. package/dist/components/linked-columns/types.d.ts +9 -0
  18. package/dist/components/linked-columns/types.js +1 -0
  19. package/dist/components/replay/ChapterTimeline.svelte +43 -25
  20. package/dist/components/replay/ChapterTimeline.svelte.d.ts +26 -1
  21. package/dist/components/session-nav/transcriptModel.d.ts +46 -0
  22. package/dist/components/session-nav/transcriptModel.js +143 -19
  23. package/dist/components/toast/ToastItem.svelte +47 -2
  24. package/dist/index.d.ts +8 -5
  25. package/dist/index.js +7 -2
  26. package/dist/stores/toast.d.ts +8 -0
  27. package/dist/stores/toast.js +2 -0
  28. package/dist/utils/audioRecorder.d.ts +28 -0
  29. package/dist/utils/audioRecorder.js +58 -0
  30. package/dist/utils/audioRecorderCore.d.ts +132 -0
  31. package/dist/utils/audioRecorderCore.js +447 -0
  32. package/dist/utils/clipboard.d.ts +25 -0
  33. package/dist/utils/clipboard.js +59 -0
  34. package/dist/utils/dateFormatters.d.ts +11 -2
  35. package/dist/utils/dateFormatters.js +22 -2
  36. package/package.json +1 -1
@@ -23,7 +23,23 @@
23
23
  *
24
24
  * Precedence: `sections` > `registry` > `shortcuts`. The overlay owns `?` —
25
25
  * don't register it in the registry too.
26
+ *
27
+ * App-specific sections (marks, list motions, cockpit panels…) that the
28
+ * overlay itself doesn't know about come in via `extraSections` — they
29
+ * render after the primary content, before the meta rows, in EVERY mode:
30
+ *
31
+ * <KeyboardShortcutsOverlay {registry} extraSections={[
32
+ * { title: 'Marks & jumps (Vim)', shortcuts: [{ key: "m{a-z}", description: 'Drop a mark' }] },
33
+ * ]} />
34
+ *
35
+ * For content the section renderer can't express, an `extra` snippet is
36
+ * rendered last (just above the meta rows):
37
+ *
38
+ * <KeyboardShortcutsOverlay {registry}>
39
+ * {#snippet extra()}<div>…custom footer…</div>{/snippet}
40
+ * </KeyboardShortcutsOverlay>
26
41
  */
42
+ import type { Snippet } from 'svelte';
27
43
  import type { ShortcutRegistry } from '../utils/keyboardShortcutRegistry';
28
44
  export interface KeyboardShortcut {
29
45
  key: string;
@@ -52,6 +68,20 @@ type $$ComponentProps = {
52
68
  * the stack first). Ignored when `sections` is given.
53
69
  */
54
70
  registry?: ShortcutRegistry;
71
+ /**
72
+ * Extra app-provided sections (e.g. marks, list motions, cockpit
73
+ * panels) appended after the primary content and before the meta
74
+ * rows, regardless of whether the primary content came from
75
+ * `sections`, `registry` or the flat `shortcuts` list. Same shape
76
+ * as `sections`, with per-key `color` tinting supported.
77
+ */
78
+ extraSections?: ShortcutSection[];
79
+ /**
80
+ * Fully custom footer content, rendered after `extraSections` and
81
+ * just above the built-in meta rows. Use when the section renderer
82
+ * (title + key/description rows) can't express the markup.
83
+ */
84
+ extra?: Snippet;
55
85
  title?: string;
56
86
  open?: boolean;
57
87
  };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Pure hotkey resolution for `BulkActionBar` (jatui-is2ow.6) — ported from
3
+ * the IDE's fork (`ide/src/lib/components/BulkActionBar.svelte`, audit
4
+ * jat-1alfp row 15).
5
+ *
6
+ * The IDE fork keeps key handling in the host page; here it lives in the
7
+ * component, but the DECIDING logic is this pure function so it can be
8
+ * unit-tested without a DOM. The component's keydown handler calls
9
+ * `matchBulkHotkey(event, actions)` and invokes the returned action's
10
+ * `onSelect`.
11
+ *
12
+ * Rules (mirroring the shortcut registry's sharp edges):
13
+ * - single printable keys only (`event.key.length === 1`) — an action
14
+ * declaring a multi-char `key` is never matched;
15
+ * - matched case-insensitively (`'C'` on the action fires on `'c'`);
16
+ * - ignored while the focus is in a text entry target (`isTypingTarget`);
17
+ * - ignored for modifier combos (Ctrl/⌘/Alt) and already-handled events.
18
+ */
19
+ /** The subset of `BulkAction` the resolver needs. */
20
+ export interface BulkHotkeyAction {
21
+ /** Single-key binding (e.g. 'c'). Multi-char values never match. */
22
+ key?: string;
23
+ /** Click handler — fired by the component when the hotkey matches. */
24
+ onSelect: () => void;
25
+ }
26
+ /** Minimal structural subset of `KeyboardEvent` — real events satisfy it. */
27
+ export interface BulkHotkeyEvent {
28
+ key: string;
29
+ target: EventTarget | null;
30
+ defaultPrevented?: boolean;
31
+ ctrlKey?: boolean;
32
+ metaKey?: boolean;
33
+ altKey?: boolean;
34
+ }
35
+ /**
36
+ * Resolve a keydown to the bulk action whose single-key binding matches,
37
+ * or return null when the event must not fire a hotkey (typing target,
38
+ * modifier combo, defaultPrevented, non-printable key, no match).
39
+ */
40
+ export declare function matchBulkHotkey(event: BulkHotkeyEvent, actions: readonly BulkHotkeyAction[]): BulkHotkeyAction | null;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Pure hotkey resolution for `BulkActionBar` (jatui-is2ow.6) — ported from
3
+ * the IDE's fork (`ide/src/lib/components/BulkActionBar.svelte`, audit
4
+ * jat-1alfp row 15).
5
+ *
6
+ * The IDE fork keeps key handling in the host page; here it lives in the
7
+ * component, but the DECIDING logic is this pure function so it can be
8
+ * unit-tested without a DOM. The component's keydown handler calls
9
+ * `matchBulkHotkey(event, actions)` and invokes the returned action's
10
+ * `onSelect`.
11
+ *
12
+ * Rules (mirroring the shortcut registry's sharp edges):
13
+ * - single printable keys only (`event.key.length === 1`) — an action
14
+ * declaring a multi-char `key` is never matched;
15
+ * - matched case-insensitively (`'C'` on the action fires on `'c'`);
16
+ * - ignored while the focus is in a text entry target (`isTypingTarget`);
17
+ * - ignored for modifier combos (Ctrl/⌘/Alt) and already-handled events.
18
+ */
19
+ import { isTypingTarget } from '../utils/keyboardShortcutRegistry';
20
+ /**
21
+ * Resolve a keydown to the bulk action whose single-key binding matches,
22
+ * or return null when the event must not fire a hotkey (typing target,
23
+ * modifier combo, defaultPrevented, non-printable key, no match).
24
+ */
25
+ export function matchBulkHotkey(event, actions) {
26
+ if (event.defaultPrevented)
27
+ return null;
28
+ if (event.ctrlKey || event.metaKey || event.altKey)
29
+ return null;
30
+ if (isTypingTarget(event.target))
31
+ return null;
32
+ // Single printable keys only — 'Escape', 'ArrowDown', 'Enter' etc. are
33
+ // navigation keys owned by listNav and must never trigger a bulk action.
34
+ if (!event.key || event.key.length !== 1)
35
+ return null;
36
+ const wanted = event.key.toLowerCase();
37
+ return (actions.find((a) => a.key && a.key.length === 1 && a.key.toLowerCase() === wanted) ?? null);
38
+ }
@@ -1,17 +1,3 @@
1
- <script module lang="ts">
2
- // Declared in the module script so `import type { ColumnLink } from
3
- // './LinkedColumns.svelte'` resolves (instance-script exports are not module members).
4
- /** Describes which left items a single right (anchor) item covers. */
5
- export interface ColumnLink {
6
- /** The right item's id this link belongs to. */
7
- rightId: string | number;
8
- /** First left item id in the covered range (inclusive). */
9
- leftStartId: string | number;
10
- /** Last left item id in the covered range (inclusive). */
11
- leftEndId: string | number;
12
- }
13
- </script>
14
-
15
1
  <script lang="ts" generics="L extends { id: string | number }, R extends { id: string | number }">
16
2
  /**
17
3
  * LinkedColumns — generic two-column ink-up ribbon primitive.
@@ -64,8 +50,7 @@
64
50
  */
65
51
 
66
52
  import type { Snippet } from 'svelte';
67
-
68
- // ColumnLink is declared in the module <script> above so it's importable as a module member.
53
+ import type { ColumnLink } from './types.js';
69
54
 
70
55
  let {
71
56
  leftItems,
@@ -410,12 +395,15 @@
410
395
  </div>
411
396
 
412
397
  <style>
398
+ /* Theme tokens (jatui-is2ow.3): fallbacks chain token → token (never a
399
+ hard-coded oklch). --n-16 is a jat-IDE neutral; its inline fallback keeps
400
+ standalone consumers (no app.css) rendering the same value. */
413
401
  .lc-wrap {
414
402
  position: relative;
415
403
  display: flex;
416
404
  height: 100%;
417
405
  min-height: 0;
418
- background: var(--color-base-100, oklch(0.16 0.01 250));
406
+ background: var(--color-base-100, var(--color-base-300));
419
407
  border-radius: 0.75rem;
420
408
  overflow: hidden;
421
409
  }
@@ -431,7 +419,7 @@
431
419
  transition: stroke-opacity 0.25s ease, stroke-width 0.25s ease;
432
420
  }
433
421
  .lc-ribbon-active {
434
- filter: drop-shadow(0 0 6px var(--color-success, oklch(0.7 0.18 145)));
422
+ filter: drop-shadow(0 0 6px var(--color-success));
435
423
  }
436
424
 
437
425
  /* Columns */
@@ -473,10 +461,10 @@
473
461
  font-weight: 700;
474
462
  letter-spacing: 0.08em;
475
463
  text-transform: uppercase;
476
- color: var(--color-base-content, oklch(0.85 0.02 250));
464
+ color: var(--color-base-content);
477
465
  opacity: 0.55;
478
466
  background: linear-gradient(
479
- var(--color-base-100, oklch(0.16 0.01 250)) 70%,
467
+ var(--color-base-100, var(--n-16, oklch(0.16 0.01 250))) 70%,
480
468
  transparent
481
469
  );
482
470
  }
@@ -489,8 +477,8 @@
489
477
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
490
478
  }
491
479
  .lc-left-item-active {
492
- background: color-mix(in oklch, var(--color-success, oklch(0.7 0.18 145)) 8%, transparent);
493
- box-shadow: inset 2px 0 0 var(--color-success, oklch(0.7 0.18 145));
480
+ background: color-mix(in oklch, var(--color-success) 8%, transparent);
481
+ box-shadow: inset 2px 0 0 var(--color-success);
494
482
  }
495
483
 
496
484
  /* Right item wrapper — consumers style via snippet; provides CSS vars */
@@ -1,12 +1,3 @@
1
- /** Describes which left items a single right (anchor) item covers. */
2
- export interface ColumnLink {
3
- /** The right item's id this link belongs to. */
4
- rightId: string | number;
5
- /** First left item id in the covered range (inclusive). */
6
- leftStartId: string | number;
7
- /** Last left item id in the covered range (inclusive). */
8
- leftEndId: string | number;
9
- }
10
1
  /**
11
2
  * LinkedColumns — generic two-column ink-up ribbon primitive.
12
3
  *
@@ -57,6 +48,7 @@ export interface ColumnLink {
57
48
  * ```
58
49
  */
59
50
  import type { Snippet } from 'svelte';
51
+ import type { ColumnLink } from './types.js';
60
52
  declare function $$render<L extends {
61
53
  id: string | number;
62
54
  }, R extends {
@@ -0,0 +1,9 @@
1
+ /** Describes which left items a single right (anchor) item covers. */
2
+ export interface ColumnLink {
3
+ /** The right item's id this link belongs to. */
4
+ rightId: string | number;
5
+ /** First left item id in the covered range (inclusive). */
6
+ leftStartId: string | number;
7
+ /** Last left item id in the covered range (inclusive). */
8
+ leftEndId: string | number;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -11,7 +11,12 @@
11
11
  * on the full IDE codebase (jat-jj79f.16 G1).
12
12
  *
13
13
  * The IDE-specific `SESSION_STATE_VISUALS` import has been replaced with
14
- * an inline `SIGNAL_COLORS` map that covers the same canonical signal types.
14
+ * an inline `SIGNAL_COLORS` map that covers the same canonical signal types,
15
+ * plus an optional `stateVisual(state)` resolver prop (jatui-is2ow.4): a
16
+ * caller — e.g. the jat IDE with its own SESSION_STATE_VISUALS — can supply
17
+ * its own colour resolver and the built-in palette is only used as the
18
+ * default / fallback. `ChapterBlock.itemRange` matches the IDE's WorkBlock
19
+ * shape so IDE callers can pass blocks straight through without remapping.
15
20
  */
16
21
 
17
22
  export interface ChapterBlock {
@@ -22,17 +27,20 @@
22
27
  filesTouched: { path: string; how: string }[];
23
28
  checkpoint: { timestamp: string | null };
24
29
  summary: string | null;
30
+ /** Index span of the transcript items this block owns (IDE WorkBlock shape). */
31
+ itemRange?: { start: number; end: number };
25
32
  }
26
33
 
27
- /** Minimal color descriptors for each canonical signal state. */
28
- interface SignalColor {
34
+ /** Colour descriptors the timeline needs per canonical signal state. */
35
+ export interface ChapterStateVisual {
29
36
  accent: string;
30
37
  bgTint: string;
31
38
  glow: string;
32
39
  shortLabel: string;
33
40
  }
34
41
 
35
- const SIGNAL_COLORS: Record<string, SignalColor> = {
42
+ /** Default palette for each canonical signal state — kept for standalone consumers without a resolver. */
43
+ const SIGNAL_COLORS: Record<string, ChapterStateVisual> = {
36
44
  starting: { accent: 'oklch(0.70 0.16 250)', bgTint: 'oklch(0.70 0.16 250 / 0.10)', glow: 'oklch(0.70 0.16 250 / 0.45)', shortLabel: '🚀 Starting' },
37
45
  working: { accent: 'oklch(0.75 0.16 85)', bgTint: 'oklch(0.75 0.16 85 / 0.08)', glow: 'oklch(0.75 0.16 85 / 0.45)', shortLabel: '🔧 Working' },
38
46
  'needs-input': { accent: 'oklch(0.68 0.19 25)', bgTint: 'oklch(0.68 0.19 25 / 0.08)', glow: 'oklch(0.68 0.19 25 / 0.4)', shortLabel: '❓ Needs Input' },
@@ -49,10 +57,19 @@
49
57
  blocks = [],
50
58
  activeBlockId = null,
51
59
  onSeek = (_blockId: string) => {},
60
+ stateVisual,
52
61
  }: {
53
62
  blocks: ChapterBlock[];
54
63
  activeBlockId: string | null;
55
64
  onSeek?: (blockId: string) => void;
65
+ /**
66
+ * Optional colour resolver: canonical state name → visual. Receives the
67
+ * NORMALIZED state (e.g. `'needs-input'`, not the raw `'needs_input'`),
68
+ * so a caller can pass `(state) => SESSION_STATE_VISUALS[state]` directly.
69
+ * Return `undefined` for unknown states — the built-in palette (then
70
+ * idle) is used as the fallback, matching the IDE's `?? idle` behaviour.
71
+ */
72
+ stateVisual?: (state: string) => ChapterStateVisual | undefined;
56
73
  } = $props();
57
74
 
58
75
  function rawTypeToState(raw: string): string {
@@ -65,8 +82,9 @@
65
82
  }
66
83
  }
67
84
 
68
- function visual(signalType: string): SignalColor {
69
- return SIGNAL_COLORS[rawTypeToState(signalType)] ?? DEFAULT_COLOR;
85
+ function visual(signalType: string): ChapterStateVisual {
86
+ const state = rawTypeToState(signalType);
87
+ return stateVisual?.(state) ?? SIGNAL_COLORS[state] ?? DEFAULT_COLOR;
70
88
  }
71
89
 
72
90
  function glyph(signalType: string): string {
@@ -183,7 +201,7 @@
183
201
 
184
202
  .empty {
185
203
  font-size: 0.75rem;
186
- color: oklch(0.55 0.02 250);
204
+ color: oklch(from var(--color-base-content) l c h / 60%);
187
205
  padding: 0.5rem;
188
206
  text-align: center;
189
207
  }
@@ -193,8 +211,8 @@
193
211
  height: 2.25rem;
194
212
  border-radius: 0.5rem;
195
213
  overflow: hidden;
196
- background: oklch(0.14 0.01 250);
197
- border: 1px solid oklch(0.22 0.02 250);
214
+ background: var(--color-base-300);
215
+ border: 1px solid var(--color-base-100);
198
216
  gap: 1px;
199
217
  }
200
218
 
@@ -203,9 +221,9 @@
203
221
  align-items: center;
204
222
  gap: 0.3rem;
205
223
  padding: 0 0.5rem;
206
- background: var(--chapter-tint, oklch(0.18 0.01 250));
224
+ background: var(--chapter-tint, var(--color-base-200));
207
225
  border: none;
208
- border-right: 1px solid oklch(0.20 0.02 250);
226
+ border-right: 1px solid var(--color-base-100);
209
227
  cursor: pointer;
210
228
  transition: background 0.12s ease, box-shadow 0.12s ease;
211
229
  overflow: hidden;
@@ -218,12 +236,12 @@
218
236
  }
219
237
 
220
238
  .chapter:hover {
221
- background: color-mix(in oklch, var(--chapter-accent) 18%, oklch(0.16 0.01 250));
239
+ background: color-mix(in oklch, var(--chapter-accent) 18%, var(--color-base-300));
222
240
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--chapter-accent) 40%, transparent);
223
241
  }
224
242
 
225
243
  .chapter.active {
226
- background: color-mix(in oklch, var(--chapter-accent) 22%, oklch(0.16 0.01 250));
244
+ background: color-mix(in oklch, var(--chapter-accent) 22%, var(--color-base-300));
227
245
  box-shadow:
228
246
  inset 0 0 0 2px color-mix(in oklch, var(--chapter-accent) 70%, transparent),
229
247
  0 0 12px color-mix(in oklch, var(--chapter-glow) 30%, transparent);
@@ -247,20 +265,20 @@
247
265
 
248
266
  .ch-label {
249
267
  font-size: 0.7rem;
250
- color: oklch(0.78 0.04 250);
268
+ color: oklch(from var(--color-base-content) l c h / 90%);
251
269
  overflow: hidden;
252
270
  text-overflow: ellipsis;
253
271
  min-width: 0;
254
272
  }
255
273
 
256
274
  .chapter.active .ch-label {
257
- color: oklch(0.92 0.06 250);
275
+ color: oklch(from var(--color-primary) 0.92 0.06 h);
258
276
  font-weight: 600;
259
277
  }
260
278
 
261
279
  .ch-meta {
262
280
  font-size: 0.6rem;
263
- color: oklch(0.50 0.02 250);
281
+ color: oklch(from var(--color-base-content) l c h / 55%);
264
282
  margin-left: auto;
265
283
  flex-shrink: 0;
266
284
  font-family: monospace;
@@ -273,10 +291,10 @@
273
291
  gap: 0.6rem;
274
292
  padding: 0.25rem 0.5rem;
275
293
  font-size: 0.72rem;
276
- color: oklch(0.70 0.04 250);
277
- background: oklch(0.15 0.01 250);
294
+ color: oklch(from var(--color-base-content) l c h / 80%);
295
+ background: var(--color-base-300);
278
296
  border-radius: 0.375rem;
279
- border: 1px solid oklch(0.22 0.02 250);
297
+ border: 1px solid var(--color-base-100);
280
298
  min-height: 1.75rem;
281
299
  flex-wrap: wrap;
282
300
  gap-y: 0.15rem;
@@ -285,7 +303,7 @@
285
303
  .ch-detail-idx {
286
304
  font-size: 0.65rem;
287
305
  font-family: monospace;
288
- color: oklch(0.50 0.02 250);
306
+ color: oklch(from var(--color-base-content) l c h / 55%);
289
307
  flex-shrink: 0;
290
308
  }
291
309
 
@@ -297,7 +315,7 @@
297
315
  }
298
316
 
299
317
  .ch-detail-summary.muted {
300
- color: oklch(0.55 0.02 250);
318
+ color: oklch(from var(--color-base-content) l c h / 60%);
301
319
  font-style: italic;
302
320
  }
303
321
 
@@ -310,17 +328,17 @@
310
328
  .ch-file {
311
329
  font-size: 0.64rem;
312
330
  font-family: monospace;
313
- background: oklch(0.19 0.02 250);
314
- border: 1px solid oklch(0.25 0.02 250);
331
+ background: var(--color-base-200);
332
+ border: 1px solid var(--color-base-100);
315
333
  border-radius: 0.2rem;
316
334
  padding: 0.1rem 0.35rem;
317
- color: oklch(0.70 0.08 200);
335
+ color: var(--color-info);
318
336
  }
319
337
 
320
338
  .ch-detail-ts {
321
339
  font-size: 0.62rem;
322
340
  font-family: monospace;
323
- color: oklch(0.48 0.02 250);
341
+ color: oklch(from var(--color-base-content) l c h / 50%);
324
342
  flex-shrink: 0;
325
343
  }
326
344
  </style>
@@ -10,7 +10,12 @@
10
10
  * on the full IDE codebase (jat-jj79f.16 G1).
11
11
  *
12
12
  * The IDE-specific `SESSION_STATE_VISUALS` import has been replaced with
13
- * an inline `SIGNAL_COLORS` map that covers the same canonical signal types.
13
+ * an inline `SIGNAL_COLORS` map that covers the same canonical signal types,
14
+ * plus an optional `stateVisual(state)` resolver prop (jatui-is2ow.4): a
15
+ * caller — e.g. the jat IDE with its own SESSION_STATE_VISUALS — can supply
16
+ * its own colour resolver and the built-in palette is only used as the
17
+ * default / fallback. `ChapterBlock.itemRange` matches the IDE's WorkBlock
18
+ * shape so IDE callers can pass blocks straight through without remapping.
14
19
  */
15
20
  export interface ChapterBlock {
16
21
  id: string;
@@ -28,11 +33,31 @@ export interface ChapterBlock {
28
33
  timestamp: string | null;
29
34
  };
30
35
  summary: string | null;
36
+ /** Index span of the transcript items this block owns (IDE WorkBlock shape). */
37
+ itemRange?: {
38
+ start: number;
39
+ end: number;
40
+ };
41
+ }
42
+ /** Colour descriptors the timeline needs per canonical signal state. */
43
+ export interface ChapterStateVisual {
44
+ accent: string;
45
+ bgTint: string;
46
+ glow: string;
47
+ shortLabel: string;
31
48
  }
32
49
  type $$ComponentProps = {
33
50
  blocks: ChapterBlock[];
34
51
  activeBlockId: string | null;
35
52
  onSeek?: (blockId: string) => void;
53
+ /**
54
+ * Optional colour resolver: canonical state name → visual. Receives the
55
+ * NORMALIZED state (e.g. `'needs-input'`, not the raw `'needs_input'`),
56
+ * so a caller can pass `(state) => SESSION_STATE_VISUALS[state]` directly.
57
+ * Return `undefined` for unknown states — the built-in palette (then
58
+ * idle) is used as the fallback, matching the IDE's `?? idle` behaviour.
59
+ */
60
+ stateVisual?: (state: string) => ChapterStateVisual | undefined;
36
61
  };
37
62
  declare const ChapterTimeline: import("svelte").Component<$$ComponentProps, {}, "">;
38
63
  type ChapterTimeline = ReturnType<typeof ChapterTimeline>;
@@ -34,6 +34,8 @@ export interface TranscriptItem {
34
34
  srcLines: number;
35
35
  /** id of the signal node that owns this item (assigned after parse) */
36
36
  signalId: string | null;
37
+ /** ISO write time of the first source message (null on line-parsed/live items) */
38
+ timestamp?: string | null;
37
39
  }
38
40
  export interface FileTouchedEntry {
39
41
  path: string;
@@ -65,11 +67,46 @@ export interface SignalNode {
65
67
  /** Net lines changed across all diffs for this block */
66
68
  linesAdded: number;
67
69
  linesRemoved: number;
70
+ /**
71
+ * Original signal JSON payload (full data for rich card rendering). Always
72
+ * set by the builders below; optional so SignalNodes constructed by hand
73
+ * (pre-0.25 callers) still type-check.
74
+ */
75
+ payload?: Record<string, unknown> | null;
76
+ /**
77
+ * True when this node represents the OPEN, in-progress turn — either a
78
+ * server-marked open block (`WorkBlockClient.open === true`) or the
79
+ * synthesized live node owning the trailing items past the last block.
80
+ * SessionNavigator uses this to render a ● live affordance. Optional so
81
+ * existing SignalNode consumers are unaffected.
82
+ */
83
+ isLive?: boolean;
68
84
  }
69
85
  export interface LinkedSession {
70
86
  items: TranscriptItem[];
71
87
  signals: SignalNode[];
72
88
  }
89
+ /** Tone drives the marker's hue; deliberately NOT a session-state key. */
90
+ export type MarkerTone = 'success' | 'error' | 'warn' | 'neutral' | 'info';
91
+ /** What a card detector declares when its event deserves a rail marker. */
92
+ export interface TimelineMarkerSpec {
93
+ /** glyph shown on the rail — keep it non-emoji so state glyphs stay distinct */
94
+ glyph: string;
95
+ /** short rail label, e.g. "subtask completed" */
96
+ label: string;
97
+ /** longer text for the title/tooltip */
98
+ detail?: string;
99
+ tone: MarkerTone;
100
+ }
101
+ /** A content event promoted onto the signal timeline, anchored to its row. */
102
+ export interface TimelineMarker extends TimelineMarkerSpec {
103
+ /** rail id — "mrk-<itemId>" */
104
+ id: string;
105
+ /** transcript item this marker anchors to (its `[data-row]`) */
106
+ itemId: number;
107
+ /** signal owning that item — clicking a marker inks this signal's ribbon */
108
+ signalId: string | null;
109
+ }
73
110
  export declare function rawTypeToState(raw: string): string;
74
111
  /** Build the linked model from rendered transcript lines. */
75
112
  export declare function buildLinkedSession(lines: string[]): LinkedSession;
@@ -99,6 +136,14 @@ export interface WorkBlockClient {
99
136
  }>;
100
137
  linesAdded?: number;
101
138
  linesRemoved?: number;
139
+ /**
140
+ * True when the server marks this block as the OPEN in-progress turn
141
+ * (populated by the navigator/sessionWork layer — sibling task jat-difet).
142
+ * Read defensively: may be undefined on blocks from older payloads. When
143
+ * true on the last block, that block's node becomes the live node (it
144
+ * absorbs any trailing items instead of synthesizing a separate one).
145
+ */
146
+ open?: boolean;
102
147
  }
103
148
  export interface WorkTranscriptItemClient {
104
149
  id: number;
@@ -107,6 +152,7 @@ export interface WorkTranscriptItemClient {
107
152
  detail: string[];
108
153
  srcLines: number;
109
154
  blockId: string | null;
155
+ timestamp?: string | null;
110
156
  }
111
157
  /**
112
158
  * Build a LinkedSession from the WorkBlock substrate (B1).