@workerdeck/ui 0.13.0 → 0.16.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 (69) hide show
  1. package/README.md +72 -0
  2. package/build/{SessionPanel-CZMA44NM.d.mts → SessionPanel-B9CHoq8x.d.mts} +213 -27
  3. package/build/{SessionPanel-CKQa4i0Y.mjs → SessionPanel-DII9MmQ8.mjs} +5192 -2542
  4. package/build/SessionPanel-DII9MmQ8.mjs.map +1 -0
  5. package/build/{format-ljc3lKpA.d.mts → format-DfI_je9S.d.mts} +1 -1
  6. package/build/format.d.mts +39 -4
  7. package/build/format.mjs +2 -118
  8. package/build/index.d.mts +494 -45
  9. package/build/index.mjs +182 -24
  10. package/build/index.mjs.map +1 -1
  11. package/build/status-Ydzi7n6j.mjs +143 -0
  12. package/build/status-Ydzi7n6j.mjs.map +1 -0
  13. package/build/workspace.d.mts +13 -1
  14. package/build/workspace.mjs +111 -5
  15. package/build/workspace.mjs.map +1 -1
  16. package/package.json +14 -7
  17. package/src/components/agent/Composer.tsx +251 -84
  18. package/src/components/agent/Conversation.tsx +12 -12
  19. package/src/components/agent/FileCard.tsx +0 -26
  20. package/src/components/agent/FileTree.tsx +9 -8
  21. package/src/components/agent/Loader.tsx +22 -72
  22. package/src/components/agent/Message.tsx +11 -43
  23. package/src/components/agent/PermissionPrompt.tsx +0 -92
  24. package/src/components/agent/QuestionPrompt.tsx +0 -122
  25. package/src/components/agent/Reasoning.tsx +5 -19
  26. package/src/components/agent/Response.tsx +1 -132
  27. package/src/components/agent/SessionBrowser.tsx +35 -25
  28. package/src/components/agent/SessionPanel.tsx +312 -63
  29. package/src/components/agent/SessionWorkspace.tsx +36 -0
  30. package/src/components/agent/StatusBar.tsx +70 -15
  31. package/src/components/agent/ToolCallCard.tsx +17 -111
  32. package/src/components/agent/Transcript.tsx +710 -203
  33. package/src/components/agent/UsageDialog.tsx +20 -106
  34. package/src/components/agent/UsageMeters.tsx +133 -0
  35. package/src/components/agent/pulse.tsx +3 -2
  36. package/src/components/agent/transcript-rows.ts +82 -0
  37. package/src/components/agent/transcript-variant.tsx +43 -51
  38. package/src/components/agent/use-height-epoch.ts +60 -0
  39. package/src/components/agent/use-path-links.ts +147 -0
  40. package/src/components/agent/use-transcript-jumps.ts +190 -0
  41. package/src/components/prompt-area/cursor-helpers.ts +65 -0
  42. package/src/components/prompt-area/use-prompt-area.ts +16 -10
  43. package/src/components/terminal/PermissionPrompt.tsx +119 -0
  44. package/src/components/terminal/QuestionPrompt.tsx +322 -0
  45. package/src/components/terminal/StatusLine.tsx +159 -0
  46. package/src/components/terminal/TerminalTranscript.tsx +147 -0
  47. package/src/components/terminal/affordances.tsx +118 -0
  48. package/src/components/terminal/diff.tsx +130 -0
  49. package/src/components/terminal/height.ts +727 -0
  50. package/src/components/terminal/items.tsx +449 -0
  51. package/src/components/terminal/markdown.tsx +191 -0
  52. package/src/components/terminal/press.tsx +120 -0
  53. package/src/components/terminal/prompt.tsx +343 -0
  54. package/src/components/terminal/result-preview.ts +72 -0
  55. package/src/components/terminal/row.tsx +132 -0
  56. package/src/components/terminal/scrubber.tsx +663 -0
  57. package/src/components/terminal/surface.tsx +80 -0
  58. package/src/components/terminal/tool-run.ts +91 -0
  59. package/src/components/ui/Badge.tsx +6 -1
  60. package/src/components/ui/Empty.tsx +56 -0
  61. package/src/components/ui/Splitter.tsx +14 -0
  62. package/src/index.ts +36 -0
  63. package/src/lib/status.ts +59 -3
  64. package/src/lib/tool-icon.ts +14 -0
  65. package/src/styles/terminal.css +1011 -0
  66. package/src/styles/theme.css +73 -0
  67. package/build/SessionPanel-CKQa4i0Y.mjs.map +0 -1
  68. package/build/format.mjs.map +0 -1
  69. package/src/components/agent/line-prompt.tsx +0 -249
@@ -15,6 +15,12 @@
15
15
  * data-theme re-themes with zero JS).
16
16
  */
17
17
 
18
+ /* The terminal theme's geometry and palette — see the file's own header. Its
19
+ * tokens are deliberately independent of the app palette below: a terminal
20
+ * looks like a terminal wherever it is embedded. First, because `@import` is
21
+ * only valid ahead of rules. */
22
+ @import './terminal.css';
23
+
18
24
  :root,
19
25
  [data-theme='light'] {
20
26
  /* ---------- Backgrounds ---------- */
@@ -196,6 +202,38 @@
196
202
  --radius: var(--radius-md);
197
203
  }
198
204
 
205
+ /*
206
+ * The agent panel's typeface, from `SessionPanel`'s `transcriptFont` prop.
207
+ *
208
+ * `mono` repoints the **sans** token at the mono stack for that subtree, so the
209
+ * transcript and its composer render monospace and read as part of the terminal
210
+ * rather than as a web app beside one. The mono token itself is left alone: code
211
+ * was already mono, and pointing both at the same stack is what makes the two
212
+ * indistinguishable — which is the point.
213
+ *
214
+ * A subtree rule rather than `:root`, and deliberately: this is the *agent
215
+ * panel's* preference, not the app's. A host's sidebar, dialogs and lists keep
216
+ * their UI font, and nothing outside the panel can pick this up by accident.
217
+ * (VS Code's webview does the same thing one level up, at `html[data-font]`,
218
+ * because there the panel *is* the document.)
219
+ */
220
+ [data-agent-font='mono'] {
221
+ --cw-font-sans: var(--cw-font-mono);
222
+ /* Tailwind's `font-sans` utility reads `--font-sans`, whose `:root` value is
223
+ `var(--cw-font-sans)` — and a `var()` inside a custom property is resolved
224
+ against the element that DECLARED it, not the one that inherits it. So
225
+ repointing `--cw-font-sans` here leaves `--font-sans` still holding the sans
226
+ stack it computed at `:root`. Both have to move. */
227
+ --font-sans: var(--cw-font-mono);
228
+ /* And the actual property, because the ambient typeface is not a token lookup
229
+ at all: `body { font-family: var(--cw-font-sans) }` computed once at `body`,
230
+ and every descendant inherits that *resolved* stack. Nothing under here
231
+ re-reads the token, so the subtree has to be told directly.
232
+ (VS Code's webview gets away with tokens alone only because its override
233
+ sits on `html` — the same element `:root` declares them on.) */
234
+ font-family: var(--cw-font-mono);
235
+ }
236
+
199
237
  /* Drive dark: off the same <html data-theme> the tokens swap on. */
200
238
  @custom-variant dark (&:where([data-theme='dark'], [data-theme='dark'] *));
201
239
 
@@ -388,6 +426,41 @@
388
426
  transform 0.08s cubic-bezier(0.4, 0, 0.2, 1),
389
427
  box-shadow 0.05s ease;
390
428
  }
429
+ /**
430
+ * The replay hold's placeholder, revealed only if the wait is long enough to be
431
+ * worth mentioning.
432
+ *
433
+ * The hold hides the transcript while the attach replay lands — typically ~0.5s
434
+ * — and an unconditional "Loading…" line inside it is *worse than nothing*: it
435
+ * appears and vanishes within half a second, so the flicker the hold exists to
436
+ * remove comes straight back as a blinking line at the top of the panel. The
437
+ * hold is the fix; announcing it is the regression.
438
+ *
439
+ * So the placeholder starts transparent and fades in only after a delay longer
440
+ * than a healthy attach takes. A normal open paints it **never** — the element
441
+ * unmounts while still at `opacity: 0` — and only a genuinely slow attach (a
442
+ * cold gateway, a huge log) ever shows a line, which is exactly when a reader
443
+ * needs to be told something is happening rather than assume the panel is dead.
444
+ *
445
+ * CSS rather than a JS timer on purpose: there is no state to hold, nothing to
446
+ * clean up on unmount, and no render caused by the placeholder appearing.
447
+ * `prefers-reduced-motion` collapses the fade's duration (the global block
448
+ * below) but not its delay, so the behaviour survives: still nothing early,
449
+ * then a line with no animation.
450
+ */
451
+ @keyframes wd-hold-appear {
452
+ from {
453
+ opacity: 0;
454
+ }
455
+ to {
456
+ opacity: 1;
457
+ }
458
+ }
459
+ .wd-hold-appear {
460
+ opacity: 0;
461
+ animation: wd-hold-appear 150ms ease-out 600ms forwards;
462
+ }
463
+
391
464
  @keyframes prompt-area-chip-ripple {
392
465
  0% {
393
466
  transform: scale(0);