@slack/radar-mcp 1.21.0 → 1.23.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 +114 -18
- package/dist/mcp/api-paths.d.ts +2 -2
- package/dist/mcp/api-paths.js +4 -19
- package/dist/mcp/dashboard-identity.d.ts +6 -0
- package/dist/mcp/dashboard-identity.js +11 -0
- package/dist/mcp/index.js +210 -145
- package/dist/mcp/logs-result.d.ts +1 -0
- package/dist/mcp/logs-result.js +1 -0
- package/dist/mcp/radar-export-get.d.ts +30 -0
- package/dist/mcp/radar-export-get.js +49 -0
- package/dist/mcp/radar-http.d.ts +22 -0
- package/dist/mcp/radar-http.js +61 -0
- package/dist/mcp/radar-response.d.ts +5 -1
- package/dist/mcp/radar-response.js +8 -3
- package/dist/mcp/session-backfill.js +3 -4
- package/dist/mcp/session-enable.d.ts +15 -0
- package/dist/mcp/session-enable.js +268 -19
- package/dist/mcp/snapshot.js +42 -26
- package/dist/mcp/sources-gate.js +6 -0
- package/dist/mcp/stale-dashboard.d.ts +23 -0
- package/dist/mcp/stale-dashboard.js +122 -0
- package/dist/mcp/switchboard-spool.d.ts +12 -0
- package/dist/mcp/switchboard-spool.js +107 -0
- package/dist/mcp/switchboard-tools.d.ts +9 -0
- package/dist/mcp/switchboard-tools.js +144 -6
- package/dist/mcp/test-cases.d.ts +14 -0
- package/dist/mcp/test-cases.js +77 -0
- package/dist/mcp/test-runs-tools.d.ts +8 -0
- package/dist/mcp/test-runs-tools.js +95 -0
- package/dist/mcp/tools.d.ts +4 -1
- package/dist/mcp/tools.js +101 -21
- package/dist/mcp/web-child-env.d.ts +4 -1
- package/dist/mcp/web-child-env.js +4 -1
- package/dist/shared/android.d.ts +44 -0
- package/dist/shared/android.js +234 -24
- package/dist/shared/constants.d.ts +9 -4
- package/dist/shared/constants.js +9 -4
- package/dist/shared/feature-flags.d.ts +1 -0
- package/dist/shared/feature-flags.js +1 -0
- package/dist/shared/ios-logs.d.ts +10 -0
- package/dist/shared/ios-logs.js +91 -0
- package/dist/shared/ios.d.ts +25 -2
- package/dist/shared/ios.js +157 -3
- package/dist/{web → shared}/log-session.d.ts +45 -31
- package/dist/shared/log-session.js +300 -0
- package/dist/shared/logcat-capture.js +17 -1
- package/dist/shared/radar-request-raw.d.ts +7 -0
- package/dist/shared/radar-request-raw.js +89 -0
- package/dist/shared/radar-token.d.ts +25 -0
- package/dist/shared/radar-token.js +164 -0
- package/dist/shared/stream.d.ts +3 -0
- package/dist/shared/stream.js +107 -15
- package/dist/shared/switchboard-host-store.d.ts +21 -0
- package/dist/shared/switchboard-host-store.js +166 -0
- package/dist/shared/switchboard-note.d.ts +15 -0
- package/dist/shared/switchboard-note.js +92 -0
- package/dist/shared/switchboard-report-file.d.ts +5 -0
- package/dist/shared/switchboard-report-file.js +26 -0
- package/dist/shared/switchboard-report.d.ts +20 -0
- package/dist/shared/switchboard-report.js +406 -0
- package/dist/shared/switchboard.d.ts +111 -2
- package/dist/shared/switchboard.js +436 -3
- package/dist/shared/transport.d.ts +49 -3
- package/dist/shared/version.d.ts +2 -0
- package/dist/shared/version.js +18 -0
- package/dist/shared/wire.d.ts +14 -1
- package/dist/web/install-app.d.ts +75 -8
- package/dist/web/install-app.js +330 -67
- package/dist/web/macapp/RadarApp.swift +487 -23
- package/dist/web/public/index.html +51 -9
- package/dist/web/public/next/app.js +33 -18
- package/dist/web/public/next/feed.js +102 -15
- package/dist/web/public/next/flags.js +3 -0
- package/dist/web/public/next/inspector.js +69 -3
- package/dist/web/public/next/prefs.js +5 -2
- package/dist/web/public/next/registry.js +18 -5
- package/dist/web/public/next/store.js +455 -29
- package/dist/web/public/next/switchboard-note.js +93 -0
- package/dist/web/public/next/toast.js +9 -5
- package/dist/web/public/next/voice-model.js +215 -35
- package/dist/web/public/next/voice.js +173 -18
- package/dist/web/server.d.ts +15 -11
- package/dist/web/server.js +690 -168
- package/dist/web/spec.d.ts +2 -1
- package/dist/web/spec.js +2 -1
- package/package.json +2 -2
- package/dist/web/log-session.js +0 -166
package/dist/web/spec.d.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* Sources the dashboard can read. The first five plus "switchboard" are live streams; "all" is
|
|
15
15
|
* their unified timeline. "db", "prefs", and "flags" are read-only point-in-time browsers (not
|
|
16
16
|
* streams) and are each handled as a distinct view. "switchboard" is the Slackbot voice transport's
|
|
17
|
-
* own event stream (session / state / frame / phase / player records),
|
|
17
|
+
* own event stream (session / state / frame / phase / player / levels / turn / saved_turn records),
|
|
18
|
+
* device-produced like rtm.
|
|
18
19
|
*/
|
|
19
20
|
export declare const SOURCES: readonly ["rtm", "network", "clog", "trace", "log", "switchboard", "all", "db", "prefs", "flags"];
|
|
20
21
|
export type Source = (typeof SOURCES)[number];
|
package/dist/web/spec.js
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* Sources the dashboard can read. The first five plus "switchboard" are live streams; "all" is
|
|
15
15
|
* their unified timeline. "db", "prefs", and "flags" are read-only point-in-time browsers (not
|
|
16
16
|
* streams) and are each handled as a distinct view. "switchboard" is the Slackbot voice transport's
|
|
17
|
-
* own event stream (session / state / frame / phase / player records),
|
|
17
|
+
* own event stream (session / state / frame / phase / player / levels / turn / saved_turn records),
|
|
18
|
+
* device-produced like rtm.
|
|
18
19
|
*/
|
|
19
20
|
export const SOURCES = ["rtm", "network", "clog", "trace", "log", "switchboard", "all", "db", "prefs", "flags"];
|
|
20
21
|
/** Widgets a spec may compose. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slack/radar-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"start:web": "node dist/web/bin.js",
|
|
24
24
|
"watch": "tsc --watch",
|
|
25
25
|
"test": "npm run build && node tests/run.mjs",
|
|
26
|
-
"test:tap": "npm run build && node --test tests/*.test.mjs",
|
|
26
|
+
"test:tap": "npm run build && node --import ./tests/temp-home.mjs --test tests/*.test.mjs",
|
|
27
27
|
"test:smoke": "npm run build && bash tests/smoke.sh",
|
|
28
28
|
"test:all": "npm run test && npm run test:smoke",
|
|
29
29
|
"prepare": "npm run build"
|
package/dist/web/log-session.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { MAX_LOG_SESSION_BUFFER } from "../shared/constants.js";
|
|
2
|
-
/**
|
|
3
|
-
* A single session-long logcat capture with a bounded ring buffer and listener
|
|
4
|
-
* fan-out. One instance is shared across every dashboard stream connection.
|
|
5
|
-
*/
|
|
6
|
-
export class LogSession {
|
|
7
|
-
spawnLogcat;
|
|
8
|
-
parseLine;
|
|
9
|
-
cap;
|
|
10
|
-
child = null;
|
|
11
|
-
lineBuf = "";
|
|
12
|
-
ring = [];
|
|
13
|
-
listeners = new Set();
|
|
14
|
-
cleanupRegistered = false;
|
|
15
|
-
constructor(spawnLogcat, parseLine, cap = MAX_LOG_SESSION_BUFFER) {
|
|
16
|
-
this.spawnLogcat = spawnLogcat;
|
|
17
|
-
this.parseLine = parseLine;
|
|
18
|
-
this.cap = cap > 0 ? cap : MAX_LOG_SESSION_BUFFER;
|
|
19
|
-
}
|
|
20
|
-
/** True while a logcat child is running. */
|
|
21
|
-
isRunning() {
|
|
22
|
-
return this.child !== null;
|
|
23
|
-
}
|
|
24
|
-
/** Number of frames currently retained (for tests / diagnostics). */
|
|
25
|
-
bufferSize() {
|
|
26
|
-
return this.ring.length;
|
|
27
|
-
}
|
|
28
|
-
/** Number of attached stream listeners (for tests / diagnostics). */
|
|
29
|
-
listenerCount() {
|
|
30
|
-
return this.listeners.size;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Start the capture if it is not already running. Idempotent: a second call
|
|
34
|
-
* while a child is alive is a no-op, so concurrent tab opens cannot fan out
|
|
35
|
-
* duplicate logcat processes. Returns true if a capture is running after the
|
|
36
|
-
* call (already-running counts as success), false if the spawn failed.
|
|
37
|
-
*/
|
|
38
|
-
start() {
|
|
39
|
-
if (this.child)
|
|
40
|
-
return true;
|
|
41
|
-
let child;
|
|
42
|
-
try {
|
|
43
|
-
child = this.spawnLogcat();
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
this.child = child;
|
|
49
|
-
this.lineBuf = "";
|
|
50
|
-
// A background diagnostic child must not keep the host process alive on its
|
|
51
|
-
// own. The listening dashboard socket is what holds the event loop open in
|
|
52
|
-
// production; when that closes (a test, or a clean shutdown) node should be
|
|
53
|
-
// free to exit even if a logcat capture is still running. registerCleanup
|
|
54
|
-
// still kills the child on exit, so unref only removes the loop-blocking ref.
|
|
55
|
-
child.unref?.();
|
|
56
|
-
child.stdout?.on("data", (c) => this.onData(c));
|
|
57
|
-
// A crashed/killed logcat (device unplugged, adb server restart) clears the
|
|
58
|
-
// child so the next connect() can restart it. The retained ring survives so
|
|
59
|
-
// history is not lost across a transient device drop.
|
|
60
|
-
child.on("error", () => this.onChildGone(child));
|
|
61
|
-
child.on("exit", () => this.onChildGone(child));
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
/** Stop the capture and drop the child. The ring buffer is preserved. */
|
|
65
|
-
stop() {
|
|
66
|
-
const child = this.child;
|
|
67
|
-
this.child = null;
|
|
68
|
-
this.lineBuf = "";
|
|
69
|
-
if (child) {
|
|
70
|
-
try {
|
|
71
|
-
child.kill();
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
// already dead
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Stop the capture AND drop the retained ring, for when the underlying device
|
|
80
|
-
* actually changed (PR #94 multi-device switch), not just dropped transiently.
|
|
81
|
-
* stop() alone preserves the ring by design (a transient adb-server hiccup or
|
|
82
|
-
* device unplug/replug is the SAME device coming back, so its history is still
|
|
83
|
-
* valid and should survive) -- but a switch to DIFFERENT hardware means every
|
|
84
|
-
* retained frame belongs to the wrong device, and replaying them into a freshly
|
|
85
|
-
* opened /stream on the new device would show device A's logs mislabeled as
|
|
86
|
-
* device B's. The caller (handleEnable's switched branch) is responsible for
|
|
87
|
-
* calling armLogcat() / start() again afterward if a log tab is active; this
|
|
88
|
-
* method only tears down, matching stop()'s existing division of labor.
|
|
89
|
-
*/
|
|
90
|
-
restart() {
|
|
91
|
-
this.stop();
|
|
92
|
-
this.ring.length = 0;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Install process-exit handlers (once) so the persistent `adb logcat` child is
|
|
96
|
-
* killed when the server process exits. Without this, the capture orphans when
|
|
97
|
-
* the server is terminated by signal — notably when `open_radar_dashboard`
|
|
98
|
-
* spawns the dashboard as a child and later kills it by PID — and orphaned adb
|
|
99
|
-
* logcat readers accumulate across dashboard open/close cycles, holding the
|
|
100
|
-
* device's logcat stream. Mirrors logcat-capture.ts's registerCleanup().
|
|
101
|
-
*/
|
|
102
|
-
registerCleanup() {
|
|
103
|
-
if (this.cleanupRegistered)
|
|
104
|
-
return;
|
|
105
|
-
this.cleanupRegistered = true;
|
|
106
|
-
process.on("exit", () => this.stop());
|
|
107
|
-
process.on("SIGINT", () => {
|
|
108
|
-
this.stop();
|
|
109
|
-
process.exit(130);
|
|
110
|
-
});
|
|
111
|
-
process.on("SIGTERM", () => {
|
|
112
|
-
this.stop();
|
|
113
|
-
process.exit(143);
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Subscribe a stream to the session. The listener is FIRST replayed the entire
|
|
118
|
-
* retained ring (replay=true) so a freshly opened tab shows full history, then
|
|
119
|
-
* receives every subsequent live frame (replay=false). Returns an unsubscribe
|
|
120
|
-
* function; call it when the stream closes (this does NOT stop the capture).
|
|
121
|
-
*/
|
|
122
|
-
subscribe(listener) {
|
|
123
|
-
// Replay a snapshot of the current ring. Snapshot first so a frame arriving
|
|
124
|
-
// mid-replay is not delivered twice (once via replay, once live).
|
|
125
|
-
const snapshot = this.ring.slice();
|
|
126
|
-
for (const frame of snapshot)
|
|
127
|
-
listener(frame, true);
|
|
128
|
-
this.listeners.add(listener);
|
|
129
|
-
return () => {
|
|
130
|
-
this.listeners.delete(listener);
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
onChildGone(child) {
|
|
134
|
-
// Guard against a late event from an already-replaced child.
|
|
135
|
-
if (this.child === child) {
|
|
136
|
-
this.child = null;
|
|
137
|
-
this.lineBuf = "";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
onData(chunk) {
|
|
141
|
-
this.lineBuf += chunk.toString();
|
|
142
|
-
let nl;
|
|
143
|
-
while ((nl = this.lineBuf.indexOf("\n")) >= 0) {
|
|
144
|
-
const line = this.lineBuf.slice(0, nl);
|
|
145
|
-
this.lineBuf = this.lineBuf.slice(nl + 1);
|
|
146
|
-
const frame = this.parseLine(line);
|
|
147
|
-
if (frame)
|
|
148
|
-
this.push(frame);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
push(frame) {
|
|
152
|
-
this.ring.push(frame);
|
|
153
|
-
if (this.ring.length > this.cap)
|
|
154
|
-
this.ring.shift();
|
|
155
|
-
for (const listener of this.listeners) {
|
|
156
|
-
// A throwing listener (e.g. a closed response) must not kill the capture
|
|
157
|
-
// or starve the other listeners.
|
|
158
|
-
try {
|
|
159
|
-
listener(frame, false);
|
|
160
|
-
}
|
|
161
|
-
catch {
|
|
162
|
-
// best-effort fan-out
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|