@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.
@@ -10,12 +10,16 @@ function Chips({ spec }) {
10
10
  const items = Object.entries(m).map(([k, v]) => ({ k, v, kind: "match" }));
11
11
  if (spec.bodyContains)
12
12
  items.push({ k: "body contains", v: spec.bodyContains, kind: "body" });
13
+ if (typeof spec.minLevel === "string" && spec.minLevel)
14
+ items.push({ k: "level", v: "≥ " + spec.minLevel, kind: "level" });
13
15
  if (!items.length)
14
16
  return null;
15
17
  const clear = (it) => {
16
18
  const next = JSON.parse(JSON.stringify(spec));
17
19
  if (it.kind === "body")
18
20
  delete next.bodyContains;
21
+ else if (it.kind === "level")
22
+ delete next.minLevel;
19
23
  else {
20
24
  if (next.match)
21
25
  delete next.match[it.k];
@@ -74,6 +78,10 @@ export function Filters({ spec }) {
74
78
  const apply = async () => {
75
79
  const next = JSON.parse(JSON.stringify(spec));
76
80
  next.source = source;
81
+ // The level only means something where log rows are; the server rejects it elsewhere, and a
82
+ // rejection from this panel is the last thing it needs.
83
+ if (source !== "log" && source !== "all")
84
+ delete next.minLevel;
77
85
  const match = {};
78
86
  for (const r of rows)
79
87
  if (r.field && r.value.trim())
@@ -9,7 +9,10 @@ export const MATCH_FIELDS = {
9
9
  rtm: ["event_type", "direction", "channel"],
10
10
  clog: ["event_name"],
11
11
  trace: ["trace_name", "span_name"],
12
- log: ["tag", "level", "message", "pid", "package"],
12
+ // No `level` here: a substring on the level name next to the toolbar's "level ≥" floor was two
13
+ // controls with one word and different meanings. A spec that already carries match.level still
14
+ // works and still shows as a row (the row select keeps an unknown field), it is just not offered.
15
+ log: ["tag", "message", "pid", "package"],
13
16
  };
14
17
  // `all` = the union of every streaming source's fields (deduped, order-stable). Derived, not
15
18
  // hand-maintained, so adding a source's fields above surfaces them in the unified Live tab too.
@@ -31,6 +34,14 @@ export const FIELD_VALUES = {
31
34
  level: ["VERBOSE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"],
32
35
  method: ["GET", "POST", "PUT", "DELETE", "PATCH"],
33
36
  };
37
+ // Logcat priorities, lowest first: the order `minLevel` ("this priority or above") is read in.
38
+ export const LOG_LEVEL_ORDER = FIELD_VALUES.level;
39
+ // -1 for a priority the order does not know (absent, or a shape the logcat parser never
40
+ // produces), so such a row never clears a minimum. Hiding it is the visible consequence of the
41
+ // selector the person set; letting it through would show a row as if it had a priority it lacks.
42
+ export function levelRank(level) {
43
+ return LOG_LEVEL_ORDER.indexOf(String(level ?? "").toUpperCase());
44
+ }
34
45
  // SOURCE registry: one row per source. `kind` routes the view (streaming feed vs the
35
46
  // point-in-time state browser) without a hardcoded source check.
36
47
  export const SOURCES = {