@slack/radar-mcp 1.19.0 → 1.21.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 (44) hide show
  1. package/README.md +48 -8
  2. package/dist/mcp/api-paths.d.ts +11 -0
  3. package/dist/mcp/api-paths.js +67 -16
  4. package/dist/mcp/index.js +24 -7
  5. package/dist/mcp/network-detail.d.ts +5 -0
  6. package/dist/mcp/network-detail.js +86 -0
  7. package/dist/mcp/radar-response.d.ts +7 -0
  8. package/dist/mcp/radar-response.js +15 -0
  9. package/dist/mcp/session-backfill.d.ts +9 -3
  10. package/dist/mcp/session-backfill.js +77 -17
  11. package/dist/mcp/session-detail.js +54 -2
  12. package/dist/mcp/session-query.js +53 -11
  13. package/dist/mcp/sources-gate.js +4 -0
  14. package/dist/mcp/switchboard-tools.d.ts +9 -0
  15. package/dist/mcp/switchboard-tools.js +40 -0
  16. package/dist/mcp/tools.js +69 -18
  17. package/dist/shared/constants.d.ts +14 -3
  18. package/dist/shared/constants.js +14 -3
  19. package/dist/shared/event-spool.js +3 -2
  20. package/dist/shared/form-body.d.ts +18 -0
  21. package/dist/shared/form-body.js +251 -0
  22. package/dist/shared/stream.d.ts +1 -1
  23. package/dist/shared/switchboard.d.ts +9 -0
  24. package/dist/shared/switchboard.js +54 -0
  25. package/dist/shared/wire.d.ts +32 -0
  26. package/dist/web/install-app.d.ts +64 -1
  27. package/dist/web/install-app.js +174 -24
  28. package/dist/web/macapp/RadarApp.swift +1287 -71
  29. package/dist/web/public/index.html +216 -11
  30. package/dist/web/public/next/app.js +22 -12
  31. package/dist/web/public/next/db.js +180 -18
  32. package/dist/web/public/next/feed.js +571 -53
  33. package/dist/web/public/next/filters.js +160 -34
  34. package/dist/web/public/next/form-body.js +252 -0
  35. package/dist/web/public/next/inspector.js +103 -12
  36. package/dist/web/public/next/registry.js +33 -3
  37. package/dist/web/public/next/store.js +577 -53
  38. package/dist/web/public/next/voice-model.js +532 -0
  39. package/dist/web/public/next/voice.js +397 -0
  40. package/dist/web/server.d.ts +110 -6
  41. package/dist/web/server.js +436 -40
  42. package/dist/web/spec.d.ts +13 -6
  43. package/dist/web/spec.js +89 -6
  44. package/package.json +3 -3
@@ -14,7 +14,7 @@
14
14
  component lands. ---- */
15
15
  :root {
16
16
  color-scheme: dark; --row-h:24px;
17
- --bg:#0b0f14; --surface:#121925; --surface-2:#0e151e; --surface-3:#141d2b; --inset:#0c1117;
17
+ --bg:#0b0f14; --surface:#121925; --surface-2:#0e151e; --surface-3:#141d2b; --inset:#0c1117; --chip-sb-bg:#1b2a3d;
18
18
  --text:#e8f0f8; --text-2:#cfd8e3; --muted:#5f7186; --muted-2:#8aa0b4;
19
19
  --border:#1e2a3a; --border-2:#243244; --border-3:#2c3e52; --rowline:#11161d;
20
20
  --accent:#39d98a; --accent-bg:#1c3a2a; --accent-text:#39d98a;
@@ -29,7 +29,7 @@
29
29
  }
30
30
  :root.light {
31
31
  color-scheme: light;
32
- --bg:#f4f6f9; --surface:#ffffff; --surface-2:#f0f3f7; --surface-3:#eef2f7; --inset:#ffffff;
32
+ --bg:#f4f6f9; --surface:#ffffff; --surface-2:#f0f3f7; --surface-3:#eef2f7; --inset:#ffffff; --chip-sb-bg:#dfe7f3;
33
33
  --text:#1a2330; --text-2:#33404f; --muted:#6b7787; --muted-2:#4a5666;
34
34
  --border:#d4dde7; --border-2:#c3cedb; --border-3:#aebccb; --rowline:#e7edf3;
35
35
  --accent:#0e9f6e; --accent-bg:#d6f3e6; --accent-text:#0a7d56;
@@ -93,6 +93,7 @@
93
93
  .filters .frow label { color:var(--muted); font-size:12px; min-width:96px; }
94
94
  .filters input, .filters select { background:var(--surface); border:1px solid var(--border-2); border-radius:7px; color:var(--text); padding:6px 9px; font:inherit; font-size:12px; }
95
95
  .filters input:focus, .filters select:focus { outline:none; border-color:var(--accent); }
96
+ .filters input::placeholder { color:var(--muted-2); opacity:1; }
96
97
  .matchrow .f_mk { flex:0 0 130px; } .combo { position:relative; flex:1; display:flex; } .combo .f_mv { flex:1; padding-right:24px; }
97
98
  .combocaret { position:absolute; right:8px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:10px; cursor:pointer; }
98
99
  .combolist { position:absolute; top:100%; left:0; right:0; z-index:30; margin-top:2px; max-height:200px; overflow:auto; background:var(--surface); border:1px solid var(--border-3); border-radius:7px; box-shadow:0 6px 18px var(--shadow); }
@@ -103,9 +104,25 @@
103
104
  .filters .fapply { background:var(--accent-bg); border:1px solid var(--accent); color:var(--accent-text); border-radius:8px; padding:7px 16px; font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }
104
105
  .filters .fmsg { color:var(--muted); font-size:12px; } .filters .fhint { color:var(--muted); font-size:11.5px; font-style:italic; }
105
106
  .chips { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:6px; flex:0 0 auto; }
106
- .chip { display:inline-flex; align-items:center; gap:7px; background:var(--surface-3); border:1px solid var(--border-3); color:var(--text-2); border-radius:999px; padding:4px 6px 4px 11px; font-size:12px; }
107
- .chip b { color:var(--blue-2); font-weight:600; } .chip .v { color:var(--text); }
108
- .chip .x { cursor:pointer; color:var(--muted-2); background:var(--surface); border-radius:50%; width:16px; height:16px; line-height:14px; text-align:center; font-size:11px; }
107
+ .chip { display:inline-flex; align-items:center; gap:7px; background:var(--surface-3); border:1px solid var(--border-3); color:var(--text-2); border-radius:999px; padding:4px 6px 4px 11px; font-size:12px; max-width:340px; }
108
+ .chip b { color:var(--blue-2); font-weight:600; } .chip .v { color:var(--text); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
109
+ /* Exclude chips wear the -term pill's tint (.fpill-neg): hidden-by and shown-if are different
110
+ polarities, and the text stays --text for contrast. */
111
+ .chip-exclude { background:var(--lvl-err-bg); border-color:var(--error-2); }
112
+ /* --blue-2 on the red field measured 4.11:1 on the light page; --text-2 clears AA on both themes. */
113
+ .chip-exclude b { color:var(--text-2); }
114
+ /* An exclude term naming a field no held row of this tab has: still an exclude chip (the tint
115
+ stays), with a dashed muted edge for a term that has no effect here yet. Harmless, so no amber
116
+ and no glyph, which are a refused term's. --muted-2 on the red fill is 6.0:1 dark, 5.8:1 light. */
117
+ .chip.chip-unknown { border-style:dashed; border-color:var(--muted-2); }
118
+ .excluderow input { flex:1; min-width:0; }
119
+ .fexclhint { margin:-2px 0 6px 104px; }
120
+ /* A real button (keyboard reachable) with the chrome reset so it keeps reading as the glyph. */
121
+ /* line-height after font: the shorthand resets it, so before it the glyph sat low. */
122
+ .chip .x { cursor:pointer; color:var(--muted-2); background:var(--surface); border:0; border-radius:50%; width:16px; height:16px; padding:0; margin:0; text-align:center; font:inherit; font-size:11px; line-height:14px; }
123
+ .chip .x:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
124
+ /* --accent on the red chip fill is 2.63:1 in light; the text tint of the accent clears it. */
125
+ :root.light .chip .x:focus-visible { outline-color:var(--accent-text); }
109
126
  .chip .x:hover { color:#fff; background:var(--error-2); }
110
127
  /* stats strip */
111
128
  .statstrip { display:flex; align-items:center; gap:18px; margin-bottom:6px; flex:0 0 auto; min-height:0; }
@@ -144,7 +161,7 @@
144
161
  Studio Logcat style). The wrap owns the border + padding + focus ring; the input inside
145
162
  is chromeless so pills + draft read as one control. Pills flex-wrap onto more lines when
146
163
  the query is long. */
147
- .ffilterwrap { position:relative; flex:1; display:flex; flex-wrap:wrap; align-items:center; gap:5px; min-width:140px; background:var(--surface-2); border:1px solid var(--border-2); border-radius:8px; padding:4px 26px 4px 6px; cursor:text; }
164
+ .ffilterwrap { position:relative; flex:1; display:flex; flex-wrap:wrap; align-items:center; gap:5px; min-width:140px; background:var(--surface-2); border:1px solid var(--border-2); border-radius:8px; padding:4px 48px 4px 6px; cursor:text; }
148
165
  .ffilterwrap:focus-within { border-color:var(--accent); }
149
166
  .ffilterwrap .ffilter { flex:1; min-width:80px; background:transparent; border:none; padding:3px 4px; font:inherit; font-size:12.5px; color:var(--text); }
150
167
  .ffilterwrap .ffilter:focus { outline:none; }
@@ -157,8 +174,21 @@
157
174
  .ffilterwrap:has(.fpill) .ffilter { min-width:28ch; }
158
175
  .feedbar input { background:var(--surface-2); border:1px solid var(--border-2); border-radius:8px; color:var(--text); padding:7px 10px; font:inherit; font-size:12.5px; }
159
176
  .feedbar input:focus { outline:none; border-color:var(--accent); }
160
- .ffilterclear { position:absolute; right:8px; top:9px; cursor:pointer; color:var(--muted-2); background:var(--surface); border-radius:50%; width:16px; height:16px; line-height:14px; text-align:center; font-size:10px; }
177
+ .ffilterclear { position:absolute; right:32px; top:9px; cursor:pointer; color:var(--muted-2); background:var(--surface); border-radius:50%; width:16px; height:16px; line-height:14px; text-align:center; font-size:10px; }
161
178
  .ffilterclear:hover { color:#fff; background:var(--error-2); }
179
+ /* The ? is the standing way in to the syntax; the placeholder only hints at it and vanishes
180
+ the moment somebody types. The legend opens under the box so it reads next to the input. */
181
+ .fhelp { position:absolute; right:8px; top:8px; cursor:pointer; color:var(--muted-2); border:1px solid var(--border-3); border-radius:50%; width:16px; height:16px; line-height:14px; text-align:center; font-size:10px; font-weight:600; user-select:none; }
182
+ .fhelp:hover, .fhelp.open { color:var(--text); border-color:var(--accent); }
183
+ /* Focus is the pill's ring, so it reads as focus and not as "open". */
184
+ .fhelp:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
185
+ /* Anchored to the box's left edge: the box is the wide element on the bar, so the legend has
186
+ room to its right and never runs off the viewport on a narrow window. */
187
+ .fhelppop { position:absolute; left:0; top:calc(100% + 4px); z-index:5; display:grid; grid-template-columns:auto 1fr; gap:4px 12px; max-width:min(460px, 90vw); max-height:min(60vh, 420px); overflow:auto; background:var(--surface); border:1px solid var(--border-3); border-radius:8px; padding:8px 10px; font-size:12px; color:var(--text); box-shadow:0 4px 16px var(--shadow); cursor:default; }
188
+ /* --accent-text, not --accent: the accent lands near 3.4:1 on the light surface, and the same
189
+ call is made for the other small accent text in this file. */
190
+ .fhelppop code { color:var(--accent-text); font-size:11.5px; white-space:nowrap; }
191
+ .fhelppop .fhelpnote { grid-column:1 / -1; color:var(--muted-2); padding-top:2px; }
162
192
  /* The draft input turns amber when its own text is an invalid regex mid-typing. Committed
163
193
  terms use the per-pill amber (.fpill-bad) instead. */
164
194
  .ffilterwrap:has(.ffilter.finvalid) { border-color:var(--warn); }
@@ -208,13 +238,53 @@
208
238
  border-color: var(--error-2);
209
239
  color: var(--error-2);
210
240
  }
211
- .fbtn { background:var(--surface); border:1px solid var(--border-3); border-radius:8px; color:var(--text); padding:6px 10px; font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
212
- .fbtn:hover { border-color:var(--accent); } .fbtn:disabled { opacity:.4; cursor:default; } .fbtn.paused { color:var(--warn); border-color:var(--warn); }
241
+ .fbtn, .fexclude { background:var(--surface); border:1px solid var(--border-3); border-radius:8px; color:var(--text); padding:6px 10px; font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
242
+ .fbtn:hover, .fexclude:hover { border-color:var(--accent); } .fbtn:disabled { opacity:.4; cursor:default; } .fbtn.paused { color:var(--warn); border-color:var(--warn); }
213
243
  .fcount { color:var(--muted); font-size:11.5px; white-space:nowrap; }
214
244
  .fstatus { font-size:11.5px; font-weight:600; white-space:nowrap; }
215
245
  .fstatus.st-live { color:var(--accent); } .fstatus.st-locked { color:var(--warn); } .fstatus.st-paused { color:var(--warn); }
216
- .fsortlbl { color:var(--muted); font-size:12px; display:flex; align-items:center; gap:5px; white-space:nowrap; }
246
+ .fsortlbl { color:var(--muted-2); font-size:12px; display:flex; align-items:center; gap:5px; white-space:nowrap; }
247
+ .fexcludewrap { display:flex; align-items:center; gap:5px; }
248
+ .fexclude[aria-expanded="true"] { border-color:var(--accent); }
249
+ /* Qualified with .feedbar so it outranks the bar's generic input rule (0,1,1) and the box
250
+ matches the exclude… button's size, padding, surface and border. */
251
+ .feedbar .fexclude-input { background:var(--surface); border:1px solid var(--border-3); border-radius:8px; color:var(--text); padding:6px 10px; font:inherit; font-size:12px; field-sizing:content; min-width:120px; max-width:220px; }
252
+ .feedbar .fexclude-input:focus { outline:none; border-color:var(--accent); }
253
+ .feedbar .fexclude-input::placeholder { color:var(--muted-2); opacity:1; }
254
+ /* A refused term: the same amber as an invalid regex in the filter box, with the reason beside it. */
255
+ .feedbar .fexclude-input[aria-invalid="true"] { border-color:var(--warn); }
256
+ /* Hung under the input so it reads as the input's note and never as the caption of the next label;
257
+ the wrap is position:relative for it. The ⚠ glyph matches the Filters panel's "⚠ rejected". */
258
+ .fexcludewrap { position:relative; }
259
+ /* The Switchboard kind chips: the row's .sbkind pill as a button. The strike-through carries the
260
+ state (a struck name is a hidden kind), the fill is secondary: on wears the pill's fill and
261
+ text (10:1 dark, 8.5:1 light); off drops the fill and strikes the name in --muted-2 (7:1 dark,
262
+ 6.9:1 light on the page). Both states share the --muted border (measured 3.8:1 dark, 4.2:1
263
+ light, over the 3:1 non-text bar), so only the fill moves on a press. Padding makes a ~25px target. Never wraps inside a
264
+ chip, and neither the group nor its "kinds" label shrinks (a shrinking group wrapped chips
265
+ onto a second line); it shares the bar's row with exclude…. The note anchors to the group's
266
+ right edge and grows inward, so it cannot run off the bar's end. */
267
+ .fsortlbl:has(.fkinds) { flex:0 0 auto; }
268
+ .fkinds { position:relative; display:inline-flex; align-items:center; gap:3px; flex:0 0 auto; }
269
+ #fkinds-note { left:auto; right:0; }
270
+ .fkind { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:5px 7px; border-radius:4px; background:var(--chip-sb-bg); color:var(--text-2); border:1px solid var(--muted); font-family:inherit; line-height:1.3; cursor:pointer; white-space:nowrap; }
271
+ .fkind:hover { border-color:var(--accent); }
272
+ .fkind:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
273
+ :root.light .fkind:focus-visible { outline-color:var(--accent-text); }
274
+ .fkind-off { background:transparent; color:var(--muted-2); border-color:var(--muted); text-decoration:line-through; text-decoration-thickness:1.5px; }
275
+ /* The note hangs below the bar out of flow; without a reserved row the feed viewport paints
276
+ over it whenever the bar does not wrap. */
277
+ .feedbar:has(.fexclude-note) { margin-bottom:26px; }
278
+ .fexclude-note { position:absolute; left:0; top:100%; margin-top:2px; z-index:1; color:var(--warn); font-size:11.5px; white-space:nowrap; }
279
+ .fexclude-note::before { content:"⚠ "; }
280
+ :root.light .fexclude-note { color:var(--warn-text); }
281
+ /* A note about a term that was taken (the gapped hint) is advice, not a warning: no glyph, muted. */
282
+ .fexclude-note.fexclude-note-plain { color:var(--muted-2); }
283
+ .fexclude-note.fexclude-note-plain::before { content:""; }
284
+ :root.light .fexclude-note.fexclude-note-plain { color:var(--muted-2); }
217
285
  .feedbar select { background:var(--surface); border:1px solid var(--border-3); border-radius:8px; color:var(--text); padding:6px 8px; font:inherit; font-size:12px; cursor:pointer; max-width:200px; }
286
+ /* The cap is for the app selector's package names; the sort labels are short and size to themselves. */
287
+ .feedbar select.fsort { max-width:none; }
218
288
  /* the virtualized viewport */
219
289
  .vpbox { position:relative; flex:1; min-height:0; display:flex; }
220
290
  .vp { position:relative; flex:1; min-height:0; overflow-y:auto; border:1px solid var(--border); border-radius:12px; background:var(--inset); user-select:none; -webkit-user-select:none; }
@@ -228,12 +298,108 @@
228
298
  .row.sel { background:var(--sel); } /* selection background beats breach/failed tint */
229
299
  .row.inspecting { box-shadow:inset 3px 0 var(--accent); } /* inspected row marker (overrides the red bar) */
230
300
  .row .t { color:var(--muted); } .dir-OUTGOING{color:var(--blue)} .dir-INCOMING{color:var(--purple)} .chan { color:var(--muted-2); }
301
+ /* switchboard rows: the device sends lowercase directions; the arrow reads incoming as ← (from the server) */
302
+ .dir-outgoing{color:var(--blue)} .dir-incoming{color:var(--purple)} .sbdir { font-weight:700; }
303
+ .sbsess { color:var(--muted-2); font-variant-numeric:tabular-nums; }
304
+ /* One neutral pill for every kind: the per-kind tints were the Live type-chip colours, which
305
+ would give purple, green, amber and blue a second meaning on the same page. --surface-3 is
306
+ about 1.1:1 against the body, so the pill gets its own background. Failure keeps the red. */
307
+ .sbkind { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:1px 6px; border-radius:4px; background:var(--chip-sb-bg); color:var(--text-2); box-shadow:inset 0 0 0 1px var(--border-2); }
308
+ /* A selected row's tint is close to the pill's, so the outline steps up to keep the pill's shape. */
309
+ .row.sel .sbkind:not(.sbkind-bad) { box-shadow:inset 0 0 0 1px var(--muted); }
310
+ .sbkind-bad { background:var(--lvl-err-bg); color:var(--error); }
311
+ .sbsum { color:var(--text-2); }
312
+ /* voice panel (Switchboard tab): session strip, tracks, stat cards. Every colour is a theme
313
+ token, so light and dark come from :root / :root.light alone; the two light overrides below
314
+ swap amber text for the readable --warn-text the way .fexclude-note does. */
315
+ .voice { display:flex; flex-direction:column; gap:8px; margin-bottom:8px; flex:0 0 auto; }
316
+ .voice-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:8px 12px; }
317
+ .voice-hd { display:flex; justify-content:space-between; align-items:center; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:6px; }
318
+ .voice-strip { display:flex; gap:14px; align-items:center; flex-wrap:wrap; font-size:12.5px; }
319
+ .voice-pill { display:inline-flex; align-items:center; gap:6px; padding:2px 10px; border-radius:999px; border:1px solid var(--border-2); background:var(--surface-2); color:var(--text); }
320
+ .voice-dot { width:8px; height:8px; border-radius:50%; background:var(--muted); }
321
+ .voice-dot.ok { background:var(--accent); box-shadow:0 0 6px var(--accent); }
322
+ .voice-dot.bad { background:var(--error); }
323
+ .voice-dot.warn { background:var(--warn); }
324
+ .voice-dot.muted { background:var(--purple); }
325
+ .voice-kv { color:var(--muted-2); } .voice-kv b { color:var(--text); font-weight:600; }
326
+ .voice-kv.warn { color:var(--warn); }
327
+ .voice-kv.warn b { color:inherit; }
328
+ :root.light .voice-kv.warn { color:var(--warn-text); }
329
+ .voice-note { color:var(--muted-2); } .voice-note b { color:var(--text); font-weight:600; }
330
+ .voice-ended { background:var(--surface-3); color:var(--text-2); font-weight:700; box-shadow:inset 0 0 0 1px var(--border-2); border:0; border-radius:4px; padding:1px 6px; }
331
+ .voice-phases { display:flex; height:10px; border-radius:6px; overflow:hidden; border:1px solid var(--border-2); margin-top:8px; }
332
+ .voice-phase { background:var(--sel-soft); border-right:1px solid var(--border); }
333
+ .voice-phase.slow { background:var(--lvl-err-bg); }
334
+ .voice-phasetext { font-size:11px; margin-top:4px; }
335
+ .voice-slowtxt { color:var(--error); }
336
+ .voice-zoom { display:inline-flex; gap:4px; text-transform:none; letter-spacing:0; }
337
+ .voice-zoombtn { font:inherit; font-size:11px; color:var(--muted-2); background:var(--surface-2); border:1px solid var(--border-2); border-radius:6px; padding:1px 8px; cursor:pointer; }
338
+ .voice-zoombtn:hover { color:var(--text); border-color:var(--border-3); }
339
+ /* Same accent tokens .modebtn.active uses for the mode picker, so the two "selected" controls
340
+ on the page read as one visual language. */
341
+ .voice-zoombtn.on { background:var(--accent-bg); border-color:var(--accent); color:var(--accent-text); font-weight:600; }
342
+ .voice-zoombtn.on:hover { border-color:var(--accent); }
343
+ .voice-zoombtn:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
344
+ :root.light .voice-zoombtn:focus-visible { outline-color:var(--accent-text); }
345
+ /* header re-arm count, its own span so it can carry the warn colour without the whole header
346
+ title turning amber. */
347
+ .voice-hd-rearms { font-weight:600; }
348
+ .voice-hd-rearms.warn { color:var(--warn); }
349
+ :root.light .voice-hd-rearms.warn { color:var(--warn-text); }
350
+ /* Row and tick labels are plain HTML over the plot, not SVG text: the SVG's
351
+ preserveAspectRatio="none" stretches x only, and a glyph drawn inside it would stretch or
352
+ squash along with the bars. The gutter is a fixed-width column so a label never sits under
353
+ a bar; the plot's own children are absolutely positioned over its (relatively positioned)
354
+ box, sized as a percent of its width, which the SVG (width:100%) shares exactly. */
355
+ .voice-trackrow { display:flex; }
356
+ .voice-rowlabels { position:relative; width:56px; flex:0 0 56px; }
357
+ /* line-height 18px matches ROW_H in voice.ts, the bar height each label sits beside, so the
358
+ label text centres on its bar instead of hugging the top of the row. top is a percent of the
359
+ plot's own height (set inline, per row, in voice.ts), not a fixed px, so the label still
360
+ lines up with its bar if H ever changes. */
361
+ .voice-rowlabels span { position:absolute; left:0; font-size:10px; color:var(--muted-2); line-height:18px; }
362
+ .voice-rowlabels { padding-right:6px; }
363
+ .voice-plot { position:relative; flex:1 1 auto; min-width:0; }
364
+ .voice-plot svg { width:100%; height:110px; display:block; }
365
+ .voice-ticklabels { position:absolute; left:0; right:0; bottom:0; height:12px; pointer-events:none; }
366
+ .voice-ticklabels span { position:absolute; bottom:0; transform:translateX(-50%); font-size:10px; color:var(--muted-2); }
367
+ .voice-nomarkers { position:absolute; bottom:14px; right:4px; font-size:10px; }
368
+ /* A guide line's opacity is a class, not an inline attr, so the light theme can read it a
369
+ touch stronger than dark: a faint line against a light background disappears much faster
370
+ than the same opacity against dark. */
371
+ .voice-guide { opacity:.35; }
372
+ :root.light .voice-guide { opacity:.6; }
373
+ .voice-legend { display:flex; gap:8px 14px; font-size:11px; color:var(--muted-2); margin-top:8px; flex-wrap:wrap; }
374
+ .voice-legend span::before { content:""; display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:6px; vertical-align:-1px; background:var(--muted); }
375
+ .voice-legend .m::before { background:var(--blue); } .voice-legend .y::before { background:var(--accent); } .voice-legend .r::before { background:var(--warn); } .voice-legend .s::before { background:var(--purple); } .voice-legend .f::before { background:var(--muted-2); }
376
+ /* Legend swatches teach the tracks' own shapes, not just their colours: a thin vertical bar
377
+ for the line-tick markers (half height for the focus tick, half width for the stop tick,
378
+ matching their own glyphs), a two-band gradient standing in for the stall's dashed cap, and a
379
+ head-plus-stem shape for the error dot and the mixed glyph's own square-capped shape line. */
380
+ .voice-legend .r::before, .voice-legend .s::before, .voice-legend .st::before, .voice-legend .e::before, .voice-legend .f::before { width:3px; height:11px; border-radius:1.5px; }
381
+ .voice-legend .f::before { height:6px; }
382
+ .voice-legend .s::before { width:2px; }
383
+ .voice-legend .st::before { width:3px; height:11px; border:0; border-radius:0; background:repeating-linear-gradient(to bottom, var(--warn-2) 0 4px, transparent 4px 7px); }
384
+ .voice-legend .e::before { width:7px; height:14px; border-radius:0; background:radial-gradient(circle at 50% 3.5px, var(--error) 3.5px, transparent 4px), linear-gradient(var(--error),var(--error)) 50% 100%/3px 10px no-repeat; }
385
+ .voice-legend .mx::before { width:6px; height:14px; border-radius:0; background:linear-gradient(var(--text),var(--text)) 50% 0/6px 6px no-repeat, linear-gradient(var(--text),var(--text)) 50% 100%/3px 6px no-repeat; }
386
+ .voice-legend .mu::before { border:1px dashed var(--purple); background:repeating-linear-gradient(to bottom, var(--purple) 0 1px, transparent 1px 3px); }
387
+ .voice-legend .mb::before { width:7px; height:11px; border-radius:3.5px; background:var(--muted); }
388
+ .voice-cards { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px; }
389
+ .voice-stat { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:6px 10px; display:flex; flex-direction:column; }
390
+ .voice-stat .v { font-size:22px; font-weight:700; line-height:1; margin-bottom:2px; color:var(--text); font-variant-numeric:tabular-nums; } .voice-stat .l { font-size:11px; color:var(--muted-2); margin-top:auto; }
391
+ .voice-stat .sub { font-size:10px; color:var(--muted-2); margin-bottom:2px; }
392
+ .voice-stat.bad .v { color:var(--error); } .voice-stat.warn .v { color:var(--warn); }
393
+ .voice-stat.warn { border-color:var(--warn); background:var(--lvl-warn-bg); } .voice-stat.bad { border-color:var(--error); background:var(--lvl-err-bg); }
394
+ .voice-stat.warn .sub { color:var(--warn); }
395
+ :root.light .voice-stat.warn .v { color:var(--warn-text); }
396
+ :root.light .voice-stat.warn .sub { color:var(--warn-text); }
231
397
  .tchip { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:1px 6px; border-radius:4px; }
232
398
  /* network status code chip in the row */
233
399
  .stchip { font-size:10px; font-weight:700; padding:1px 6px; border-radius:4px; font-variant-numeric:tabular-nums; }
234
400
  .stchip.st2 { background:var(--chip-clog-bg); color:var(--accent); } .stchip.st3 { background:var(--lvl-info-bg); color:var(--blue); }
235
401
  .stchip.st4 { background:var(--lvl-warn-bg); color:var(--warn-2); } .stchip.st5 { background:var(--lvl-err-bg); color:var(--error); }
236
- .t-network{ background:var(--chip-net-bg); color:var(--blue); } .t-rtm{ background:var(--chip-rtm-bg); color:var(--purple); } .t-clog{ background:var(--chip-clog-bg); color:var(--accent); } .t-trace{ background:var(--chip-trace-bg); color:var(--warn); } .t-log{ background:var(--chip-log-bg); color:var(--chip-log-fg); }
402
+ .t-network{ background:var(--chip-net-bg); color:var(--blue); } .t-rtm{ background:var(--chip-rtm-bg); color:var(--purple); } .t-clog{ background:var(--chip-clog-bg); color:var(--accent); } .t-trace{ background:var(--chip-trace-bg); color:var(--warn); } .t-log{ background:var(--chip-log-bg); color:var(--chip-log-fg); } .t-switchboard{ background:var(--chip-sb-bg); color:var(--blue-2); }
237
403
  .lvl { font-size:10px; font-weight:700; padding:1px 5px; border-radius:4px; }
238
404
  .lvl-ERROR,.lvl-FATAL{ background:var(--lvl-err-bg); color:var(--error); } .lvl-WARN{ background:var(--lvl-warn-bg); color:var(--warn-2); } .lvl-INFO{ background:var(--lvl-info-bg); color:var(--blue); } .lvl-DEBUG,.lvl-VERBOSE{ background:var(--lvl-dbg-bg); color:var(--muted-2); }
239
405
  .logpkg { color:var(--blue-2); background:var(--surface-3); font-size:10.5px; padding:1px 6px; border-radius:4px; white-space:nowrap; max-width:130px; overflow:hidden; text-overflow:ellipsis; }
@@ -252,6 +418,7 @@
252
418
  .inspector-hd .x { cursor:pointer; color:var(--muted-2); border:1px solid var(--border-3); border-radius:6px; padding:1px 8px; flex:0 0 auto; }
253
419
  .inspector-hd .x:hover { color:var(--error); border-color:var(--error); }
254
420
  .inspector .empty { color:var(--muted); font-size:12.5px; }
421
+ .vp .empty-row { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:12px; text-align:center; color:var(--muted-2); font-size:12.5px; pointer-events:none; }
255
422
  /* header badges: the at-a-glance facts */
256
423
  .ibadges { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
257
424
  .ibadge { font-size:11px; font-weight:600; padding:2px 8px; border-radius:999px; background:var(--surface-3); color:var(--text-2); white-space:nowrap; }
@@ -286,6 +453,14 @@
286
453
  .inspector pre.rawbody { color:var(--text-2); }
287
454
  .kv { display:grid; grid-template-columns:auto 1fr; gap:2px 12px; font-size:11.5px; }
288
455
  .kv-k { color:var(--muted-2); white-space:nowrap; } .kv-v { color:var(--text-2); word-break:break-all; }
456
+ /* decoded form body: caption + per-field rows; a JSON field nests its own collapsible */
457
+ .formnote { color:var(--muted); font-size:11px; margin-bottom:6px; }
458
+ .formunparsed { color:var(--muted-2); font-size:11px; margin-bottom:3px; }
459
+ .formkv { font-size:12px; row-gap:4px; align-items:start; }
460
+ .formkv .formkey { padding-top:2px; }
461
+ .formkv .kv-v { word-break:normal; overflow-wrap:anywhere; }
462
+ .formkv .kv-v.empty { color:var(--muted); font-style:italic; }
463
+ .formkv .kv-v .insec { margin:0; }
289
464
  /* alert */
290
465
  #flash { position:fixed; inset:0; background:#ff3b30; opacity:0; pointer-events:none; z-index:50; transition:opacity .08s; } #flash.on { opacity:.38; }
291
466
  #alertbanner { position:fixed; top:0; left:0; right:0; z-index:60; text-align:center; background:#ff3b30; color:#fff; font-weight:700; padding:10px; letter-spacing:.04em; box-shadow:0 2px 12px var(--shadow); display:flex; justify-content:center; gap:20px; }
@@ -317,6 +492,36 @@
317
492
  .dbout tr:hover td { background:var(--hover); }
318
493
  .dbout tr { cursor:pointer; }
319
494
  .dbout tr.rowsel td { background:var(--sel-soft); }
495
+ /* Sortable column headers in the results grid. .dbsortable only lands on headers the DB grid
496
+ renders, so the flags table (which reuses .dbout but builds its own header row) picks up none of
497
+ this. Every header owns a direction slot at all times, a dim ↕ when unsorted, which is what
498
+ holds the column boundaries still across a click: measured, 0.00px of movement on every column.
499
+ The slot's fixed width is insurance on top of that, for a fallback font whose glyph advances
500
+ differ; this stack is monospace, so they do not.
501
+ Three colour decisions, each measured against the surface the element actually sits on:
502
+ - the sorted column is --accent-text, not --accent. On light, #0e9f6e is 3.39:1 against the
503
+ header's --surface, under WCAG AA's 4.5:1 for text this size; #0a7d56 is 5.15:1. Dark is
504
+ 9.62:1 either way. Same reasoning as --warn-text above.
505
+ - the slot's three states are a colour progression, not an alpha one. At opacity .3 the
506
+ resting ↕ measured 1.61:1, under the 3:1 floor for a state indicator, and it is the only
507
+ at-rest sign that a header is clickable. As --muted it is 4.55:1 light and 3.52:1 dark.
508
+ - hover is a BACKGROUND change so the SORTED column gets feedback too. The colour rules have
509
+ to exclude .sorted, because hover is the more specific selector and would otherwise
510
+ overwrite the sorted colour and de-highlight the very column being pointed at, which left
511
+ the clearing click with no hover response at all. Brightening instead is not available:
512
+ --accent on light is dimmer than --accent-text. The cost is that hovering the sorted column
513
+ is the tightest state in the feature, 4.52:1 on light, 0.02 over the floor. */
514
+ .dbout th.dbsortable:hover { background:var(--hover-soft); }
515
+ .dbout th.dbsortable:not(.sorted):hover { color:var(--text); }
516
+ .dbout th.sorted { color:var(--accent-text); }
517
+ .dbout th .dbsortdir { display:inline-block; width:9px; margin-left:5px; font-size:10px; vertical-align:1px; text-align:center; color:var(--muted); }
518
+ .dbout th.dbsortable:not(.sorted):hover .dbsortdir { color:var(--text); }
519
+ .dbout th.sorted .dbsortdir { color:var(--accent-text); }
520
+ /* Brighter than the --muted meta text it sits inside: this is the only place the grid says what a
521
+ sort covered, and --muted against the page's --bg measures 3.84:1 on dark. --muted-2 is 7.11:1
522
+ there and 6.89:1 on light. Its separating space is in the TEXT rather than a margin here, so the
523
+ line also reads correctly when it is copied or read aloud. */
524
+ .dbsortnote { color:var(--muted-2); }
320
525
  /* DB dock -- docked right of the grid, shared by the row detail and the query history via
321
526
  tabs; the split shrinks the grid to make room. Mirrors the feed's .stage.split layout. */
322
527
  .dbsplit { flex:1; min-height:0; display:flex; gap:14px; align-items:stretch; }
@@ -8,10 +8,11 @@ import { html } from "./html.js";
8
8
  import { render } from "preact";
9
9
  import { useState, useEffect, useCallback, useRef } from "preact/hooks";
10
10
  import { useStoreValue } from "./hooks.js";
11
- import { store, MODES, modeServed, describeConstraints, AUTO_REARM_MAX_FAILS } from "./store.js";
11
+ import { store, MODES, modeServed, describeConstraints, AUTO_REARM_MAX_FAILS, specMatchesMode } from "./store.js";
12
12
  import { SOURCES } from "./registry.js";
13
13
  import { Feed } from "./feed.js";
14
14
  import { Cards } from "./widgets.js";
15
+ import { VoicePanel, showsVoicePanel } from "./voice.js";
15
16
  import { Inspector } from "./inspector.js";
16
17
  import { Filters } from "./filters.js";
17
18
  import { DbBrowser } from "./db.js";
@@ -303,18 +304,21 @@ export function Header({ screenOpen, onScreenToggle }) {
303
304
  </h1>
304
305
  `;
305
306
  }
306
- function ModeBar() {
307
+ export function ModeBar() {
307
308
  const [, force] = useState(0);
308
309
  useEffect(() => store.on("spec", () => force((n) => n + 1)), []);
309
310
  const deviceSources = useStoreValue(store, "sources", () => store.deviceSources);
310
311
  const activeKey = store.activeModeKey();
311
- const pick = (specToPush) => store.setSpec(specToPush);
312
+ const pick = (specToPush) => store.pushPreset(specToPush);
312
313
  const serves = (m) => modeServed(m.key, deviceSources);
313
314
  // A device switch can hide the active tab (leaner build). Reset to the first tab so the
314
- // user is never stranded on an invisible mode rendering a dead feed.
315
+ // user is never stranded on an invisible mode rendering a dead feed. Through pushPreset like
316
+ // every other preset push, so the level floor rides along: Live carries log rows, so a bare
317
+ // MODES[0].spec would not just skip the floor for this one push, applySpec would also forget
318
+ // it (lastLogLevel back to ""), and the next Logs click would start at VERBOSE.
315
319
  useEffect(() => {
316
320
  if (activeKey && activeKey !== "__custom__" && !modeServed(activeKey, deviceSources)) {
317
- store.setSpec(MODES[0].spec);
321
+ store.pushPreset(MODES[0].spec);
318
322
  }
319
323
  }, [deviceSources, activeKey]);
320
324
  // Group modes by source kind for visual separation
@@ -325,7 +329,7 @@ function ModeBar() {
325
329
  ${streamModes.map((m) => html `<button class=${"modebtn" + (activeKey === m.key ? " active" : "")} onClick=${() => pick(m.spec)}>${m.label}</button>`)}
326
330
  ${stateModes.length > 0 ? html `<span class="modedivider"></span>` : null}
327
331
  ${stateModes.map((m) => html `<button class=${"modebtn" + (activeKey === m.key ? " active" : "")} onClick=${() => pick(m.spec)}>${m.label}</button>`)}
328
- ${store.lastCustomSpec ? html `<button class=${"modebtn custom" + (activeKey === "__custom__" ? " active" : "")} title="pushed from a terminal Claude Code session; persists until refresh" onClick=${() => pick(store.lastCustomSpec)}>✎ ${store.lastCustomSpec.title || "Custom"}</button>` : null}
332
+ ${store.lastCustomSpec ? html `<button class=${"modebtn custom" + (activeKey === "__custom__" ? " active" : "")} title="pushed from a terminal Claude Code session; persists until refresh" onClick=${() => store.setSpec(store.lastCustomSpec)}>✎ ${store.lastCustomSpec.title || "Custom"}</button>` : null}
329
333
  </div>
330
334
  `;
331
335
  }
@@ -389,16 +393,18 @@ function StreamView({ spec }) {
389
393
  <span class="summary">${spec.summary || spec.title}</span>
390
394
  <span class="tech">${tech}</span>
391
395
  </div>
392
- <${Filters} spec=${spec} />
396
+ <${Filters} spec=${spec} remembered=${specMatchesMode(spec) !== null} />
393
397
  <${Cards} spec=${spec} />
398
+ ${showsVoicePanel(spec) ? html `<${VoicePanel} onInspect=${(ev) => setSelected(ev)} />` : null}
394
399
  <div class=${"stage" + (selected ? " split" : "")}>
395
400
  <${Feed} spec=${spec} onInspect=${(ev) => setSelected(ev)} selectedId=${selected && selected.id} />
396
401
  ${selected ? html `<${Inspector} ev=${selected} onClose=${() => setSelected(null)} />` : null}
397
402
  </div>
398
403
  `;
399
404
  }
400
- function Blank() {
401
- return html `<div class="sub"><span class="summary">Pick a dashboard above.</span><span class="tech">Live, Network, RTM, Clogs, Traces, Logs — or ask a terminal Claude Code session to build a custom view.</span></div>`;
405
+ // Exported for the test that pins the tab list; App is the only caller.
406
+ export function Blank() {
407
+ return html `<div class="sub"><span class="summary">Pick a dashboard above.</span><span class="tech">Live, Network, RTM, Clogs, Traces, Logs, Switchboard, Database, Preferences, Feature Flags. Or ask a terminal Claude Code session to build a custom view.</span></div>`;
402
408
  }
403
409
  function App() {
404
410
  const spec = useStoreValue(store, "spec", () => store.spec);
@@ -438,9 +444,13 @@ function App() {
438
444
  if (next === cur)
439
445
  return;
440
446
  const nextKey = keys[next];
441
- const nextSpec = nextKey === "__custom__" ? store.lastCustomSpec : MODES.find((m) => m.key === nextKey)?.spec;
442
- if (nextSpec)
443
- store.setSpec(nextSpec);
447
+ const preset = MODES.find((m) => m.key === nextKey)?.spec;
448
+ if (nextKey === "__custom__") {
449
+ if (store.lastCustomSpec)
450
+ store.setSpec(store.lastCustomSpec);
451
+ }
452
+ else if (preset)
453
+ store.pushPreset(preset);
444
454
  e.preventDefault();
445
455
  };
446
456
  window.addEventListener("keydown", onKey);