@slack/radar-mcp 1.20.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 (41) hide show
  1. package/README.md +11 -6
  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 +62 -16
  17. package/dist/shared/constants.d.ts +10 -0
  18. package/dist/shared/constants.js +10 -0
  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/public/index.html +172 -10
  27. package/dist/web/public/next/app.js +16 -10
  28. package/dist/web/public/next/db.js +4 -1
  29. package/dist/web/public/next/feed.js +515 -57
  30. package/dist/web/public/next/filters.js +158 -40
  31. package/dist/web/public/next/form-body.js +252 -0
  32. package/dist/web/public/next/inspector.js +103 -12
  33. package/dist/web/public/next/registry.js +21 -2
  34. package/dist/web/public/next/store.js +503 -51
  35. package/dist/web/public/next/voice-model.js +532 -0
  36. package/dist/web/public/next/voice.js +397 -0
  37. package/dist/web/server.d.ts +7 -0
  38. package/dist/web/server.js +154 -16
  39. package/dist/web/spec.d.ts +10 -6
  40. package/dist/web/spec.js +61 -6
  41. package/package.json +3 -3
@@ -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, specForTab } 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";
@@ -308,16 +309,16 @@ export function ModeBar() {
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(specForTab(specToPush, store.spec, store.lastLogLevel));
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. Through specForTab like
315
+ // user is never stranded on an invisible mode rendering a dead feed. Through pushPreset like
315
316
  // every other preset push, so the level floor rides along: Live carries log rows, so a bare
316
317
  // MODES[0].spec would not just skip the floor for this one push, applySpec would also forget
317
318
  // it (lastLogLevel back to ""), and the next Logs click would start at VERBOSE.
318
319
  useEffect(() => {
319
320
  if (activeKey && activeKey !== "__custom__" && !modeServed(activeKey, deviceSources)) {
320
- store.setSpec(specForTab(MODES[0].spec, store.spec, store.lastLogLevel));
321
+ store.pushPreset(MODES[0].spec);
321
322
  }
322
323
  }, [deviceSources, activeKey]);
323
324
  // Group modes by source kind for visual separation
@@ -392,16 +393,18 @@ function StreamView({ spec }) {
392
393
  <span class="summary">${spec.summary || spec.title}</span>
393
394
  <span class="tech">${tech}</span>
394
395
  </div>
395
- <${Filters} spec=${spec} />
396
+ <${Filters} spec=${spec} remembered=${specMatchesMode(spec) !== null} />
396
397
  <${Cards} spec=${spec} />
398
+ ${showsVoicePanel(spec) ? html `<${VoicePanel} onInspect=${(ev) => setSelected(ev)} />` : null}
397
399
  <div class=${"stage" + (selected ? " split" : "")}>
398
400
  <${Feed} spec=${spec} onInspect=${(ev) => setSelected(ev)} selectedId=${selected && selected.id} />
399
401
  ${selected ? html `<${Inspector} ev=${selected} onClose=${() => setSelected(null)} />` : null}
400
402
  </div>
401
403
  `;
402
404
  }
403
- function Blank() {
404
- 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>`;
405
408
  }
406
409
  function App() {
407
410
  const spec = useStoreValue(store, "spec", () => store.spec);
@@ -442,9 +445,12 @@ function App() {
442
445
  return;
443
446
  const nextKey = keys[next];
444
447
  const preset = MODES.find((m) => m.key === nextKey)?.spec;
445
- const nextSpec = nextKey === "__custom__" ? store.lastCustomSpec : preset && specForTab(preset, store.spec, store.lastLogLevel);
446
- if (nextSpec)
447
- store.setSpec(nextSpec);
448
+ if (nextKey === "__custom__") {
449
+ if (store.lastCustomSpec)
450
+ store.setSpec(store.lastCustomSpec);
451
+ }
452
+ else if (preset)
453
+ store.pushPreset(preset);
448
454
  e.preventDefault();
449
455
  };
450
456
  window.addEventListener("keydown", onKey);
@@ -721,7 +721,10 @@ function Grid({ rows, cols, selectedRow, onSelect, sort, onSort, }) {
721
721
  </tr>
722
722
  </thead>
723
723
  <tbody>
724
- ${rows.map((row) => html `<tr class=${row === selectedRow ? "rowsel" : ""} onClick=${() => onSelect(row)}>
724
+ ${rows.map(
725
+ // Keyed by the row object, which sortRows leaves untouched because it copies the array and
726
+ // not the rows, so a sort moves the existing rows instead of rewriting every cell in place.
727
+ (row) => html `<tr key=${row} class=${row === selectedRow ? "rowsel" : ""} onClick=${() => onSelect(row)}>
725
728
  ${cols.map((c) => html `<td title=${String(row[c] ?? "")}>${String(row[c] ?? "")}</td>`)}
726
729
  </tr>`)}
727
730
  </tbody>