@slack/radar-mcp 1.18.1 → 1.20.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.
@@ -24,6 +24,8 @@ export type Viz = (typeof VIZ)[number];
24
24
  export declare const SERIES_METRICS: readonly ["ratePerSec", "count", "avg", "errorRate"];
25
25
  export type SeriesMetric = (typeof SERIES_METRICS)[number];
26
26
  declare const HIGHLIGHT_OPS: readonly [">", ">=", "<", "<=", "=="];
27
+ export declare const LOG_LEVELS: readonly ["VERBOSE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"];
28
+ export type LogLevel = (typeof LOG_LEVELS)[number];
27
29
  export type HighlightOp = (typeof HIGHLIGHT_OPS)[number];
28
30
  export interface GraphSeries {
29
31
  label?: string;
@@ -61,6 +63,7 @@ export interface Spec {
61
63
  source?: Source;
62
64
  match?: Record<string, string>;
63
65
  bodyContains?: string;
66
+ minLevel?: LogLevel;
64
67
  viz?: Viz[];
65
68
  rateWindowSec?: number;
66
69
  series?: GraphSeries[];
package/dist/web/spec.js CHANGED
@@ -33,6 +33,9 @@ export const SERIES_METRICS = [
33
33
  "errorRate",
34
34
  ];
35
35
  const HIGHLIGHT_OPS = [">", ">=", "<", "<=", "=="];
36
+ // Logcat priorities, lowest first. `minLevel` on a log-carrying spec keeps rows at that priority
37
+ // or above, and this order is what "or above" means.
38
+ export const LOG_LEVELS = ["VERBOSE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"];
36
39
  /** The empty dashboard. Rendered until a spec is pushed. */
37
40
  export const BLANK_SPEC = { title: "", blank: true, viz: [] };
38
41
  function isRecord(v) {
@@ -50,6 +53,19 @@ export function coerceSpec(input) {
50
53
  if (!isRecord(input))
51
54
  return BLANK_SPEC;
52
55
  const s = input;
56
+ // Ahead of the browser-source return below, so a lowercase level on those sources is refused
57
+ // for the reason that applies (the source), not for its spelling. VERBOSE is the floor, and the
58
+ // floor is spelled as no field: with the field present it would hide a log row whose priority
59
+ // levelRank cannot place, and the page would show a "level ≥ VERBOSE" chip for what the UI treats
60
+ // as no filter. The UI never sends it (changeLevel drops the field), but the MCP enum offers it,
61
+ // and both wire entry points (/setspec and the SLACK_RADAR_INITIAL_SPEC seed) come through here.
62
+ if (typeof s.minLevel === "string") {
63
+ const up = s.minLevel.toUpperCase();
64
+ if (up === LOG_LEVELS[0])
65
+ delete s.minLevel;
66
+ else
67
+ s.minLevel = up;
68
+ }
53
69
  // The DB, Prefs, and feature-flags browsers have no match/viz/series to repair; leave as-is.
54
70
  if (s.source === "db" || s.source === "prefs" || s.source === "flags")
55
71
  return s;
@@ -100,6 +116,18 @@ export function validateSpec(s) {
100
116
  if (!spec.source || !SOURCES.includes(spec.source)) {
101
117
  return `source must be one of ${SOURCES.join("|")}`;
102
118
  }
119
+ // Checked ahead of the per-source returns below so a browser source cannot carry the field
120
+ // through unexamined. Only log rows have a priority, so accepting it anywhere but log and all
121
+ // would store a filter that can never act, which reads as "the level is set" while changing
122
+ // nothing.
123
+ if (spec.minLevel !== undefined) {
124
+ if (!LOG_LEVELS.includes(spec.minLevel)) {
125
+ return `minLevel must be one of ${LOG_LEVELS.join("|")}`;
126
+ }
127
+ if (spec.source !== "log" && spec.source !== "all") {
128
+ return "minLevel applies to the log and all sources only";
129
+ }
130
+ }
103
131
  // The DB browser is a distinct view: no viz/series/match. Only its optional deep-link
104
132
  // fields are constrained (each must be a string when present).
105
133
  if (spec.source === "db") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack/radar-mcp",
3
- "version": "1.18.1",
3
+ "version": "1.20.0",
4
4
  "description": "MCP server and web dashboard for debugging Slack on Android and iOS Simulator",
5
5
  "type": "module",
6
6
  "main": "dist/mcp/index.js",