@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.
- package/README.md +40 -4
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/tools.js +7 -2
- package/dist/mcp/web-child-env.js +10 -7
- package/dist/shared/android.d.ts +10 -21
- package/dist/shared/android.js +30 -9
- package/dist/shared/constants.d.ts +4 -3
- package/dist/shared/constants.js +4 -3
- package/dist/shared/ios.d.ts +5 -10
- package/dist/shared/ios.js +23 -5
- package/dist/shared/transport.d.ts +31 -19
- package/dist/shared/wire.d.ts +24 -0
- package/dist/shared/wire.js +6 -0
- package/dist/web/install-app.d.ts +64 -1
- package/dist/web/install-app.js +174 -24
- package/dist/web/macapp/RadarApp.swift +1311 -75
- package/dist/web/public/index.html +72 -5
- package/dist/web/public/next/app.js +173 -24
- package/dist/web/public/next/db.js +177 -18
- package/dist/web/public/next/feed.js +129 -20
- package/dist/web/public/next/filter.js +24 -11
- package/dist/web/public/next/filters.js +8 -0
- package/dist/web/public/next/registry.js +12 -1
- package/dist/web/public/next/store.js +666 -45
- package/dist/web/server.d.ts +115 -8
- package/dist/web/server.js +734 -58
- package/dist/web/spec.d.ts +3 -0
- package/dist/web/spec.js +28 -0
- package/package.json +1 -1
package/dist/web/spec.d.ts
CHANGED
|
@@ -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") {
|