@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/mcp/snapshot.js
CHANGED
|
@@ -267,32 +267,9 @@ export async function createSnapshot(device, fetchBuffer, opts = {}, now = Date.
|
|
|
267
267
|
files.unshift(bundleFile);
|
|
268
268
|
// Auto-zip: collapse the 4-file directory into a single shareable
|
|
269
269
|
// artifact. Users universally want to attach ONE file to Jira or drop
|
|
270
|
-
// ONE file in Slack, not drag a directory. Best-effort:
|
|
271
|
-
//
|
|
272
|
-
|
|
273
|
-
let zipPath = null;
|
|
274
|
-
const zipCandidate = `${dir}.zip`;
|
|
275
|
-
try {
|
|
276
|
-
const zipResult = spawnSync("zip", ["-rq", zipCandidate, "."], {
|
|
277
|
-
cwd: dir,
|
|
278
|
-
timeout: 10000,
|
|
279
|
-
});
|
|
280
|
-
if (zipResult.status === 0) {
|
|
281
|
-
try {
|
|
282
|
-
fs.chmodSync(zipCandidate, FILE_MODE);
|
|
283
|
-
}
|
|
284
|
-
catch {
|
|
285
|
-
// Leave mode as-is; already a zip copy of owner-readable files.
|
|
286
|
-
}
|
|
287
|
-
zipPath = zipCandidate;
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
errors.push(`zip failed with status ${zipResult.status ?? "null"}${zipResult.stderr ? ": " + zipResult.stderr.toString().trim() : ""}`);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
catch (e) {
|
|
294
|
-
errors.push(`zip not available: ${e.message}`);
|
|
295
|
-
}
|
|
270
|
+
// ONE file in Slack, not drag a directory. Best-effort: record the
|
|
271
|
+
// failure and the user can zip manually.
|
|
272
|
+
const zipPath = zipSnapshotDir(dir, errors);
|
|
296
273
|
return {
|
|
297
274
|
path: dir,
|
|
298
275
|
files,
|
|
@@ -304,6 +281,45 @@ export async function createSnapshot(device, fetchBuffer, opts = {}, now = Date.
|
|
|
304
281
|
privacy_notice: PRIVACY_NOTICE,
|
|
305
282
|
};
|
|
306
283
|
}
|
|
284
|
+
// `zip` ships with macOS and most Linux distros but not every image (the
|
|
285
|
+
// shared devspace base has none). python3 has a zipfile CLI that builds the
|
|
286
|
+
// same archive, so try it before giving up. Every tool that runs and fails
|
|
287
|
+
// is recorded, and the next one still gets a shot.
|
|
288
|
+
const ZIP_TOOLS = [
|
|
289
|
+
{ cmd: "zip", args: (out) => ["-rq", out, "."] },
|
|
290
|
+
{ cmd: "python3", args: (out) => ["-m", "zipfile", "-c", out, "."] },
|
|
291
|
+
];
|
|
292
|
+
function zipSnapshotDir(dir, errors) {
|
|
293
|
+
const out = `${dir}.zip`;
|
|
294
|
+
const failures = [];
|
|
295
|
+
for (const tool of ZIP_TOOLS) {
|
|
296
|
+
const result = spawnSync(tool.cmd, tool.args(out), {
|
|
297
|
+
cwd: dir,
|
|
298
|
+
timeout: 10000,
|
|
299
|
+
});
|
|
300
|
+
if (result.error?.code === "ENOENT") {
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (result.status === 0) {
|
|
304
|
+
try {
|
|
305
|
+
fs.chmodSync(out, FILE_MODE);
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
// Leave mode as-is; already a zip copy of owner-readable files.
|
|
309
|
+
}
|
|
310
|
+
return out;
|
|
311
|
+
}
|
|
312
|
+
// A timeout or kill leaves status null, so say why instead.
|
|
313
|
+
const why = result.error?.message ?? result.signal ?? result.stderr?.toString().trim();
|
|
314
|
+
failures.push(`${tool.cmd} exited with status ${result.status ?? "null"}${why ? ": " + why : ""}`);
|
|
315
|
+
// A half-written archive would look like a good one to the user.
|
|
316
|
+
fs.rmSync(out, { force: true });
|
|
317
|
+
}
|
|
318
|
+
errors.push(failures.length > 0
|
|
319
|
+
? `zip failed: ${failures.join("; ")}`
|
|
320
|
+
: `zip not available: no ${ZIP_TOOLS.map((t) => t.cmd).join(" or ")} on PATH`);
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
307
323
|
/**
|
|
308
324
|
* Count items inside a buffer response. Handles the `{ calls: [...] }`,
|
|
309
325
|
* `{ events: [...] }`, `{ clogs: [...] }`, `{ traces: [...] }` shapes the
|
package/dist/mcp/sources-gate.js
CHANGED
|
@@ -22,6 +22,12 @@ export const TOOL_SOURCE = {
|
|
|
22
22
|
// routes, so the gate turns that into the uniform "build does not serve" error.
|
|
23
23
|
get_switchboard_sessions: "switchboard",
|
|
24
24
|
get_switchboard_session: "switchboard",
|
|
25
|
+
export_switchboard_session: "switchboard",
|
|
26
|
+
// Replay needs a build that declares the test_runs source.
|
|
27
|
+
// Reads and writes share the same capability check.
|
|
28
|
+
run_test_case: "test_runs",
|
|
29
|
+
get_test_run: "test_runs",
|
|
30
|
+
stop_test_run: "test_runs",
|
|
25
31
|
};
|
|
26
32
|
// null = no discovery info (old build or no session); gating is off.
|
|
27
33
|
let sessionSources = null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface DashboardFingerprint {
|
|
2
|
+
version: string | null;
|
|
3
|
+
inUse: "no" | "yes" | "unknown";
|
|
4
|
+
inUseBy: string | null;
|
|
5
|
+
readFailed: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface DashboardReply {
|
|
8
|
+
url?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
interface OpenDashboardResult {
|
|
12
|
+
ok: true;
|
|
13
|
+
url: string;
|
|
14
|
+
title: string;
|
|
15
|
+
note: string;
|
|
16
|
+
stale_dashboard?: true | null;
|
|
17
|
+
stale_mcp?: true;
|
|
18
|
+
dashboard_version?: string;
|
|
19
|
+
mcp_version?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function readDashboardFingerprint(base: string): Promise<DashboardFingerprint>;
|
|
22
|
+
export declare function buildOpenDashboardResult(out: DashboardReply, fingerprint: DashboardFingerprint, currentVersion: string, trustedBase: string): OpenDashboardResult;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { compareVersions, parseVersion } from "../shared/version.js";
|
|
2
|
+
const FINGERPRINT_TIMEOUT_MS = 2000;
|
|
3
|
+
const PORT_ADVICE = "Or set SLACK_RADAR_WEB_PORT to a free port in this MCP server's config and restart this Claude Code session.";
|
|
4
|
+
const STANDALONE_PORT_ADVICE = "To use a separate dashboard instead, set SLACK_RADAR_WEB_PORT to a free port in this MCP server's config and restart this Claude Code session.";
|
|
5
|
+
const RELAUNCHER_ADVICE = "If the older version comes back, another Radar launcher on an older version restarted it (the dock app, or another Claude Code session), so ask the user to update or quit that one.";
|
|
6
|
+
function dashboardInUse(claim, inUseBy) {
|
|
7
|
+
if (inUseBy === "mcp")
|
|
8
|
+
return "unknown";
|
|
9
|
+
if (inUseBy !== null)
|
|
10
|
+
return "yes";
|
|
11
|
+
if (claim === "1")
|
|
12
|
+
return "yes";
|
|
13
|
+
if (claim === "0")
|
|
14
|
+
return "no";
|
|
15
|
+
return "unknown";
|
|
16
|
+
}
|
|
17
|
+
export async function readDashboardFingerprint(base) {
|
|
18
|
+
const failed = { version: null, inUse: "unknown", inUseBy: null, readFailed: true };
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(`${base}/spec`, {
|
|
21
|
+
// We only advise a stop; take would keep an unopened dashboard in use forever.
|
|
22
|
+
headers: { "X-Radar-In-Use-For": "stop" },
|
|
23
|
+
signal: AbortSignal.timeout(FINGERPRINT_TIMEOUT_MS),
|
|
24
|
+
redirect: "error",
|
|
25
|
+
});
|
|
26
|
+
await response.body?.cancel();
|
|
27
|
+
if (!response.ok)
|
|
28
|
+
return failed;
|
|
29
|
+
const inUseBy = response.headers.get("X-Radar-In-Use-By");
|
|
30
|
+
const claim = response.headers.get("X-Radar-In-Use");
|
|
31
|
+
return {
|
|
32
|
+
version: response.headers.get("X-Radar-Version"),
|
|
33
|
+
inUse: dashboardInUse(claim, inUseBy),
|
|
34
|
+
inUseBy,
|
|
35
|
+
readFailed: false,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return failed;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function stopAdvice(fingerprint, base, hasShutdown) {
|
|
43
|
+
const url = new URL(base);
|
|
44
|
+
const port = url.port || (url.protocol === "https:" ? "443" : "80");
|
|
45
|
+
let first;
|
|
46
|
+
if (fingerprint.inUse === "yes") {
|
|
47
|
+
const holder = fingerprint.inUseBy === "tab"
|
|
48
|
+
? "Someone has this dashboard open in a window."
|
|
49
|
+
: "Something is using it.";
|
|
50
|
+
first = `${holder} Ask the user before stopping it.`;
|
|
51
|
+
}
|
|
52
|
+
else if (fingerprint.inUse === "no") {
|
|
53
|
+
// The five-minute mcp claim is documented in docs/wire-contract.md.
|
|
54
|
+
first = "The dashboard reports no open window and no Claude Code session use in the last 5 minutes. A quiet session may still rely on it, so ask the user before stopping it.";
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
first = "Could not tell whether anyone else is using it, so ask the user before stopping it.";
|
|
58
|
+
}
|
|
59
|
+
const controls = hasShutdown
|
|
60
|
+
? `To stop it, click ⏻ Stop dashboard in its header, then click it again to confirm, or run curl -X POST -H 'X-Radar-Dashboard: 1' ${base}/shutdown.`
|
|
61
|
+
: `Stop the process that holds the port. Find it with lsof -nP -iTCP:${port} -sTCP:LISTEN and confirm it is a Radar dashboard first.`;
|
|
62
|
+
return `${first} ${controls}`;
|
|
63
|
+
}
|
|
64
|
+
export function buildOpenDashboardResult(out, fingerprint, currentVersion,
|
|
65
|
+
// This MCP's own WEB_BASE; the reported URL is untrusted and must stay out of the shell hint.
|
|
66
|
+
trustedBase) {
|
|
67
|
+
const title = out.title ?? "";
|
|
68
|
+
const result = {
|
|
69
|
+
ok: true,
|
|
70
|
+
url: out.url ?? trustedBase,
|
|
71
|
+
title,
|
|
72
|
+
note: `Custom dashboard "${title}" is live at ${trustedBase} (the 'Custom' tab). ` +
|
|
73
|
+
"It reads the connected device, so Slack Radar must be enabled on it — the dashboard has " +
|
|
74
|
+
"its own Reconnect button if the device is not yet armed. Call open_radar_dashboard again to refine it.",
|
|
75
|
+
};
|
|
76
|
+
if (parseVersion(currentVersion) === null) {
|
|
77
|
+
result.stale_dashboard = null;
|
|
78
|
+
result.note += ` This MCP server's version (${currentVersion}) is not a plain x.y.z, so the version check was skipped.`;
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
if (fingerprint.readFailed) {
|
|
82
|
+
result.stale_dashboard = null;
|
|
83
|
+
result.note += " This MCP server could not read the dashboard server's version this time, so the version check was skipped.";
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
const version = fingerprint.version;
|
|
87
|
+
if (version === null) {
|
|
88
|
+
result.stale_dashboard = true;
|
|
89
|
+
result.mcp_version = currentVersion;
|
|
90
|
+
result.note += " The dashboard server did not report its version, so it is older than 1.6.0. " +
|
|
91
|
+
stopAdvice(fingerprint, trustedBase, false) +
|
|
92
|
+
` Then call open_radar_dashboard again. ${RELAUNCHER_ADVICE} ${PORT_ADVICE}`;
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
if (parseVersion(version) === null) {
|
|
96
|
+
result.stale_dashboard = null;
|
|
97
|
+
// The header comes from whatever holds the port, so it never goes into text the model reads.
|
|
98
|
+
result.note += " The dashboard server reported a version that is not a plain x.y.z, so the version check was skipped. " +
|
|
99
|
+
STANDALONE_PORT_ADVICE;
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
const comparisonOrder = compareVersions(version, currentVersion);
|
|
103
|
+
if (comparisonOrder === 0)
|
|
104
|
+
return result;
|
|
105
|
+
result.dashboard_version = version;
|
|
106
|
+
result.mcp_version = currentVersion;
|
|
107
|
+
const comparison = `The dashboard server is running version ${version}, while this MCP server is running version ${currentVersion}.`;
|
|
108
|
+
if (comparisonOrder > 0) {
|
|
109
|
+
result.stale_mcp = true;
|
|
110
|
+
result.note += ` ${comparison} This MCP server is older than the dashboard. ` +
|
|
111
|
+
"Either a newer Radar was installed after this Claude Code session started, or this MCP server's config pins an older version. " +
|
|
112
|
+
"The dashboard still works. To match versions, ask the user to restart this Claude Code session or update the pinned version.";
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
result.stale_dashboard = true;
|
|
116
|
+
result.note += ` ${comparison} The dashboard is older than this MCP server. An install does not stop a server that is already running. ` +
|
|
117
|
+
stopAdvice(fingerprint, trustedBase, compareVersions(version, "1.14.0") >= 0) +
|
|
118
|
+
" Then call open_radar_dashboard again to relaunch on the current version. " +
|
|
119
|
+
RELAUNCHER_ADVICE + " " +
|
|
120
|
+
PORT_ADVICE;
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Hide every switchboard record spooled so far from the export's host copy (clear_buffers). */
|
|
2
|
+
export declare function markSwitchboardSpoolCleared(): void;
|
|
3
|
+
/**
|
|
4
|
+
* The spooled records of `sessionId`'s newest call, each once, in id order. [] when the spool is
|
|
5
|
+
* closed (disabled) or this process never spooled the id.
|
|
6
|
+
*
|
|
7
|
+
* Walked in time order, a call starts at a session/begin, or at an id at or below one already
|
|
8
|
+
* seen (ids climb within a call, so this catches a restart whose begin was never spooled).
|
|
9
|
+
*/
|
|
10
|
+
export declare function getSpoolSwitchboardRecords(sessionId: number): Record<string, unknown>[];
|
|
11
|
+
/** Ranked by timestamp, not id: ids restart with the app process, timestamps keep climbing. */
|
|
12
|
+
export declare function newestSpoolSwitchboardSessionId(): number | null;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// The MCP export tool's host copy of switchboard records, read out of the session event spool,
|
|
2
|
+
// which already holds every switchboard frame this process received.
|
|
3
|
+
//
|
|
4
|
+
// A session_id restarts with the app process, so the spool can hold several calls under one id,
|
|
5
|
+
// and the enable backfill can append device rows after live ones or duplicate them.
|
|
6
|
+
// getSpoolSwitchboardRecords reduces that to the current call, each record once, because
|
|
7
|
+
// mergeSwitchboardRecords keys on the bare id and must never see an older call's id 1 next to
|
|
8
|
+
// this call's id 1.
|
|
9
|
+
//
|
|
10
|
+
// An auto-disable leaves the spool open, so these keep working after one; an explicit disable or
|
|
11
|
+
// a device switch closes it, which empties the fallback. clear_buffers keeps the spool open for
|
|
12
|
+
// other readers, so it records a mark and both functions read only past it.
|
|
13
|
+
import fs from "node:fs";
|
|
14
|
+
import { getSpoolFilePath, readSpool } from "../shared/event-spool.js";
|
|
15
|
+
import { SWITCHBOARD_KIND } from "../shared/switchboard.js";
|
|
16
|
+
// A mark only counts for the file it was taken on: a rotation or a re-enable opens a new file,
|
|
17
|
+
// which holds nothing from before the clear.
|
|
18
|
+
let clearMark = null;
|
|
19
|
+
// The spool can reach 100MB and one export reads it up to four times (the disabled gate, then the
|
|
20
|
+
// newest id and the records), so the switchboard frames are kept until the file changes.
|
|
21
|
+
let parsed = null;
|
|
22
|
+
function switchboardFrames() {
|
|
23
|
+
const file = getSpoolFilePath();
|
|
24
|
+
if (file === null)
|
|
25
|
+
return [];
|
|
26
|
+
let stat;
|
|
27
|
+
try {
|
|
28
|
+
stat = fs.statSync(file);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
if (parsed !== null && parsed.file === file && parsed.size === stat.size && parsed.mtimeMs === stat.mtimeMs)
|
|
34
|
+
return parsed.frames;
|
|
35
|
+
const frames = readSpool().filter((f) => f.type === SWITCHBOARD_KIND);
|
|
36
|
+
parsed = { file, size: stat.size, mtimeMs: stat.mtimeMs, frames };
|
|
37
|
+
return frames;
|
|
38
|
+
}
|
|
39
|
+
/** Hide every switchboard record spooled so far from the export's host copy (clear_buffers). */
|
|
40
|
+
export function markSwitchboardSpoolCleared() {
|
|
41
|
+
const file = getSpoolFilePath();
|
|
42
|
+
clearMark = file === null ? null : { file, frames: switchboardFrames().length };
|
|
43
|
+
}
|
|
44
|
+
function framesSinceClear() {
|
|
45
|
+
const frames = switchboardFrames();
|
|
46
|
+
return clearMark !== null && clearMark.file === getSpoolFilePath() ? frames.slice(clearMark.frames) : frames;
|
|
47
|
+
}
|
|
48
|
+
function switchboardEventOf(frame) {
|
|
49
|
+
if (frame.type !== SWITCHBOARD_KIND)
|
|
50
|
+
return null;
|
|
51
|
+
return frame.event !== null && typeof frame.event === "object" ? frame.event : null;
|
|
52
|
+
}
|
|
53
|
+
const finiteOr = (v, fallback) => (typeof v === "number" && Number.isFinite(v) ? v : fallback);
|
|
54
|
+
/**
|
|
55
|
+
* The spooled records of `sessionId`'s newest call, each once, in id order. [] when the spool is
|
|
56
|
+
* closed (disabled) or this process never spooled the id.
|
|
57
|
+
*
|
|
58
|
+
* Walked in time order, a call starts at a session/begin, or at an id at or below one already
|
|
59
|
+
* seen (ids climb within a call, so this catches a restart whose begin was never spooled).
|
|
60
|
+
*/
|
|
61
|
+
export function getSpoolSwitchboardRecords(sessionId) {
|
|
62
|
+
const byKey = new Map();
|
|
63
|
+
for (const frame of framesSinceClear()) {
|
|
64
|
+
const event = switchboardEventOf(frame);
|
|
65
|
+
if (event === null || event.session_id !== sessionId)
|
|
66
|
+
continue;
|
|
67
|
+
if (typeof event.id !== "number" || !Number.isFinite(event.id))
|
|
68
|
+
continue;
|
|
69
|
+
const key = `${event.id}\u0000${String(event.timestamp)}`;
|
|
70
|
+
if (!byKey.has(key))
|
|
71
|
+
byKey.set(key, event);
|
|
72
|
+
}
|
|
73
|
+
const records = [...byKey.values()].sort((a, b) => finiteOr(a.timestamp, -Infinity) - finiteOr(b.timestamp, -Infinity) || a.id - b.id);
|
|
74
|
+
let start = 0;
|
|
75
|
+
let maxId = -Infinity;
|
|
76
|
+
for (let i = 0; i < records.length; i++) {
|
|
77
|
+
const r = records[i];
|
|
78
|
+
const id = r.id;
|
|
79
|
+
if ((r.kind === "session" && r.event === "begin") || id <= maxId) {
|
|
80
|
+
start = i;
|
|
81
|
+
maxId = -Infinity;
|
|
82
|
+
}
|
|
83
|
+
maxId = Math.max(maxId, id);
|
|
84
|
+
}
|
|
85
|
+
return records.slice(start).sort((a, b) => a.id - b.id);
|
|
86
|
+
}
|
|
87
|
+
/** Ranked by timestamp, not id: ids restart with the app process, timestamps keep climbing. */
|
|
88
|
+
export function newestSpoolSwitchboardSessionId() {
|
|
89
|
+
let bestId = null;
|
|
90
|
+
let bestTimestamp = -Infinity;
|
|
91
|
+
for (const frame of framesSinceClear()) {
|
|
92
|
+
const event = switchboardEventOf(frame);
|
|
93
|
+
if (event === null)
|
|
94
|
+
continue;
|
|
95
|
+
const sessionId = event.session_id;
|
|
96
|
+
const timestamp = event.timestamp;
|
|
97
|
+
if (typeof sessionId !== "number" || !Number.isFinite(sessionId))
|
|
98
|
+
continue;
|
|
99
|
+
if (typeof timestamp !== "number" || !Number.isFinite(timestamp))
|
|
100
|
+
continue;
|
|
101
|
+
if (timestamp > bestTimestamp) {
|
|
102
|
+
bestTimestamp = timestamp;
|
|
103
|
+
bestId = sessionId;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return bestId;
|
|
107
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { RadarTokenSender } from "../shared/radar-token.js";
|
|
2
|
+
import { type SwitchboardExportGet } from "../shared/switchboard.js";
|
|
1
3
|
import { type RadarResponse } from "./radar-response.js";
|
|
2
4
|
export interface HandlerResult {
|
|
3
5
|
data: unknown;
|
|
@@ -7,3 +9,10 @@ export type RadarFetch = (apiPath: string) => Promise<RadarResponse>;
|
|
|
7
9
|
export declare const SWITCHBOARD_BUDGET_HINT = "Pass kind or lower limit; for the whole session use query_session with source switchboard, which pages with a cursor.";
|
|
8
10
|
export declare function handleGetSwitchboardSessions(fetch: RadarFetch): Promise<HandlerResult>;
|
|
9
11
|
export declare function handleGetSwitchboardSession(args: Record<string, unknown>, fetch: RadarFetch): Promise<HandlerResult>;
|
|
12
|
+
export declare const SESSION_DISABLED_SUFFIX_LINE = "Session disabled. Use /radar-enable to reconnect.";
|
|
13
|
+
export declare const RECONNECT_ONLY_SUFFIX_LINE = "Use /radar-enable to reconnect.";
|
|
14
|
+
export declare function appendSessionDisabledSuffix(message: string, sessionJustDisabled: boolean): string;
|
|
15
|
+
export declare function handleExportSwitchboardSession(args: Record<string, unknown>, get: SwitchboardExportGet, sender: RadarTokenSender, now?: number, exportRoot?: string): Promise<HandlerResult>;
|
|
16
|
+
export declare function shouldExportSwitchboardOffline(requestedId: number | null, getHostRecords: (sessionId: number) => Record<string, unknown>[], getNewestHostSessionId: () => number | null): boolean;
|
|
17
|
+
export declare function handleExportSwitchboardSessionOffline(args: Record<string, unknown>, now?: number, exportRoot?: string): HandlerResult;
|
|
18
|
+
export declare function dispatchExportSwitchboardSession(args: Record<string, unknown>, isSessionEnabled: () => boolean, get: SwitchboardExportGet, sender: RadarTokenSender, now?: number, exportRoot?: string): Promise<HandlerResult>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
// The
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// keep the device's own error body (a 404 for an unknown id) as the tool error. An answer over the
|
|
5
|
-
// response budget, whether radarRequest cut it on the wire or the parsed body would blow it once
|
|
6
|
-
// serialized, comes back as the shared over-budget note with a hint of their own, since
|
|
1
|
+
// The switchboard tools' handlers. The two get_ tools are pure so a test can drive them with a
|
|
2
|
+
// fake callRadar; they validate args host-side (a bad id never reaches the device) and keep the
|
|
3
|
+
// device's own error body as the tool error. An over-budget answer gets its own hint, since
|
|
7
4
|
// capture_snapshot does not bundle switchboard.
|
|
5
|
+
import os from "os";
|
|
6
|
+
import path from "path";
|
|
8
7
|
import { MAX_RADAR_RESPONSE_BYTES } from "../shared/constants.js";
|
|
8
|
+
import { buildSwitchboardReport, capitalizeSwitchboardNote, stripSwitchboardControlChars, switchboardReportNotes } from "../shared/switchboard-report.js";
|
|
9
|
+
import { writeSwitchboardReportFile } from "../shared/switchboard-report-file.js";
|
|
10
|
+
import { getSpoolSwitchboardRecords, newestSpoolSwitchboardSessionId } from "./switchboard-spool.js";
|
|
11
|
+
import { assembleSwitchboardExport, hostOnlyGapCount, hostOnlySwitchboardDetail, nonNegativeIntArg, } from "../shared/switchboard.js";
|
|
9
12
|
import { buildApiPath, switchboardSessionQuery } from "./api-paths.js";
|
|
10
13
|
import { responseBudgetError } from "./radar-response.js";
|
|
11
14
|
export const SWITCHBOARD_BUDGET_HINT = "Pass kind or lower limit; for the whole session use query_session with source switchboard, which pages with a cursor.";
|
|
@@ -38,3 +41,138 @@ export async function handleGetSwitchboardSession(args, fetch) {
|
|
|
38
41
|
return { data: { error: q.error }, isError: true };
|
|
39
42
|
return passThrough(await fetch(q.path));
|
|
40
43
|
}
|
|
44
|
+
// Restrictive permissions like snapshot.ts, since a session record can carry a team_id.
|
|
45
|
+
const SWITCHBOARD_EXPORT_DIR = path.join(os.homedir(), ".slack-radar", "exports");
|
|
46
|
+
function parseSwitchboardExportId(args) {
|
|
47
|
+
if (args?.id === undefined || args.id === null)
|
|
48
|
+
return { ok: true, id: null };
|
|
49
|
+
const parsed = nonNegativeIntArg(args.id);
|
|
50
|
+
if (parsed === null) {
|
|
51
|
+
return { ok: false, error: `id must be a non-negative integer session_id from get_switchboard_sessions; got ${JSON.stringify(args.id)}.` };
|
|
52
|
+
}
|
|
53
|
+
return { ok: true, id: parsed };
|
|
54
|
+
}
|
|
55
|
+
export const SESSION_DISABLED_SUFFIX_LINE = "Session disabled. Use /radar-enable to reconnect.";
|
|
56
|
+
// For a session already off before the call: the report notes already say the session is off.
|
|
57
|
+
export const RECONNECT_ONLY_SUFFIX_LINE = "Use /radar-enable to reconnect.";
|
|
58
|
+
// switchboard.ts's messages are shared with the web export route, which has no session concept,
|
|
59
|
+
// so the MCP appends this itself when the export call is what disabled the session.
|
|
60
|
+
export function appendSessionDisabledSuffix(message, sessionJustDisabled) {
|
|
61
|
+
return sessionJustDisabled ? `${message} ${SESSION_DISABLED_SUFFIX_LINE}` : message;
|
|
62
|
+
}
|
|
63
|
+
export async function handleExportSwitchboardSession(args, get, sender, now = Date.now(), exportRoot = SWITCHBOARD_EXPORT_DIR) {
|
|
64
|
+
const parsedId = parseSwitchboardExportId(args);
|
|
65
|
+
if (!parsedId.ok)
|
|
66
|
+
return { data: { error: parsedId.error }, isError: true };
|
|
67
|
+
const assembled = await assembleSwitchboardExport(parsedId.id, get, getSpoolSwitchboardRecords, newestSpoolSwitchboardSessionId, sender, "mcp");
|
|
68
|
+
if (!assembled.ok) {
|
|
69
|
+
return { data: { error: assembled.message }, isError: true };
|
|
70
|
+
}
|
|
71
|
+
return writeSwitchboardReport(assembled, now, exportRoot);
|
|
72
|
+
}
|
|
73
|
+
// Lets the export through a disabled gate only when the spool holds records for the id it would
|
|
74
|
+
// resolve to; otherwise the ordinary gate error stands.
|
|
75
|
+
export function shouldExportSwitchboardOffline(requestedId, getHostRecords, getNewestHostSessionId) {
|
|
76
|
+
const sessionId = requestedId ?? getNewestHostSessionId();
|
|
77
|
+
return sessionId !== null && getHostRecords(sessionId).length > 0;
|
|
78
|
+
}
|
|
79
|
+
// Makes no device calls at all, which is what makes it safe to run through a disabled gate.
|
|
80
|
+
export function handleExportSwitchboardSessionOffline(args, now = Date.now(), exportRoot = SWITCHBOARD_EXPORT_DIR) {
|
|
81
|
+
const parsedId = parseSwitchboardExportId(args);
|
|
82
|
+
if (!parsedId.ok)
|
|
83
|
+
return { data: { error: parsedId.error }, isError: true };
|
|
84
|
+
const sessionId = parsedId.id ?? newestSpoolSwitchboardSessionId();
|
|
85
|
+
const hostRecords = sessionId !== null ? getSpoolSwitchboardRecords(sessionId) : [];
|
|
86
|
+
if (sessionId === null || hostRecords.length === 0) {
|
|
87
|
+
// Unreachable through the gate, which already requires spooled records.
|
|
88
|
+
return {
|
|
89
|
+
data: { error: "Radar is not active. Use /radar-enable to connect, or ask about the device to auto-enable." },
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const detail = hostOnlySwitchboardDetail(sessionId, hostRecords);
|
|
94
|
+
const heldEvents = Array.isArray(detail.events) ? detail.events : [];
|
|
95
|
+
const assembly = {
|
|
96
|
+
ok: true,
|
|
97
|
+
sessionId,
|
|
98
|
+
detail,
|
|
99
|
+
hostStreamCount: heldEvents.length,
|
|
100
|
+
deviceEventCount: null,
|
|
101
|
+
deviceOldestTimestamp: null,
|
|
102
|
+
hostOnlyCause: "disabled",
|
|
103
|
+
walkStopReason: null,
|
|
104
|
+
gapCount: hostOnlyGapCount(heldEvents),
|
|
105
|
+
};
|
|
106
|
+
return writeSwitchboardReport(assembly, now, exportRoot, RECONNECT_ONLY_SUFFIX_LINE);
|
|
107
|
+
}
|
|
108
|
+
// isSessionEnabled is a getter so it can be read again after the device call, which may have
|
|
109
|
+
// disabled the session.
|
|
110
|
+
export async function dispatchExportSwitchboardSession(args, isSessionEnabled, get, sender, now = Date.now(), exportRoot = SWITCHBOARD_EXPORT_DIR) {
|
|
111
|
+
if (!isSessionEnabled()) {
|
|
112
|
+
return handleExportSwitchboardSessionOffline(args, now, exportRoot);
|
|
113
|
+
}
|
|
114
|
+
const result = await handleExportSwitchboardSession(args, get, sender, now, exportRoot);
|
|
115
|
+
return isSessionEnabled() ? result : withSessionDisabledSuffix(result);
|
|
116
|
+
}
|
|
117
|
+
// Touches only the returned data, never the file already on disk.
|
|
118
|
+
function withSessionDisabledSuffix(result) {
|
|
119
|
+
const data = result.data;
|
|
120
|
+
if (data === null || typeof data !== "object" || Array.isArray(data))
|
|
121
|
+
return result;
|
|
122
|
+
const d = { ...data };
|
|
123
|
+
if (typeof d.error === "string") {
|
|
124
|
+
d.error = appendSessionDisabledSuffix(d.error, true);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
if (Array.isArray(d.notes))
|
|
128
|
+
d.notes = [...d.notes, SESSION_DISABLED_SUFFIX_LINE];
|
|
129
|
+
if (typeof d.summary === "string")
|
|
130
|
+
d.summary = appendSessionDisabledSuffix(d.summary, true);
|
|
131
|
+
}
|
|
132
|
+
return { data: d, isError: result.isError };
|
|
133
|
+
}
|
|
134
|
+
// Build and write the report; a build or disk failure is a clean tool error, never a throw.
|
|
135
|
+
function writeSwitchboardReport(assembly, now, exportRoot,
|
|
136
|
+
// Describes the tool call, not the session, so it goes last in notes and summary and never
|
|
137
|
+
// into the file.
|
|
138
|
+
sessionDisabledSuffix = null) {
|
|
139
|
+
const { sessionId, detail, hostOnlyCause = null } = assembly;
|
|
140
|
+
let report;
|
|
141
|
+
try {
|
|
142
|
+
report = buildSwitchboardReport(assembly, now);
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
return { data: { error: `Failed to build the report: ${e.message}` }, isError: true };
|
|
146
|
+
}
|
|
147
|
+
const reportNotes = switchboardReportNotes(report);
|
|
148
|
+
const notes = sessionDisabledSuffix ? [...reportNotes, sessionDisabledSuffix] : reportNotes;
|
|
149
|
+
// Stripped here too: the JSON result repeats server_session_id outside the stripped report.
|
|
150
|
+
const serverSessionId = typeof detail.server_session_id === "string" ? stripSwitchboardControlChars(detail.server_session_id) : null;
|
|
151
|
+
const recordCount = Array.isArray(detail.events) ? detail.events.length : 0;
|
|
152
|
+
const totalCaptured = typeof detail.total_captured === "number" ? detail.total_captured : null;
|
|
153
|
+
let file;
|
|
154
|
+
try {
|
|
155
|
+
file = writeSwitchboardReportFile(exportRoot, `switchboard-session-${sessionId}`, report, now);
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
return { data: { error: `Failed to write the report to disk: ${e.message}` }, isError: true };
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
data: {
|
|
162
|
+
path: file,
|
|
163
|
+
session_id: sessionId,
|
|
164
|
+
server_session_id: serverSessionId,
|
|
165
|
+
record_count: recordCount,
|
|
166
|
+
total_captured: totalCaptured,
|
|
167
|
+
notes,
|
|
168
|
+
host_recovered: assembly.hostStreamCount ?? 0,
|
|
169
|
+
device_gone: hostOnlyCause === "not-found",
|
|
170
|
+
device_unreachable: hostOnlyCause === "unreachable",
|
|
171
|
+
host_only_cause: hostOnlyCause,
|
|
172
|
+
summary: `Voice session ${sessionId}${serverSessionId ? ` (server ${serverSessionId})` : ""}: ${recordCount} record${recordCount === 1 ? "" : "s"} exported to ${file}.` +
|
|
173
|
+
(reportNotes.length > 0 ? ` ${capitalizeSwitchboardNote(reportNotes[0])}` : "") +
|
|
174
|
+
(sessionDisabledSuffix ? ` ${sessionDisabledSuffix}` : ""),
|
|
175
|
+
},
|
|
176
|
+
isError: false,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CASE_NAME: RegExp;
|
|
2
|
+
export declare const MAX_CASE_FILE_BYTES: number;
|
|
3
|
+
export declare const testCaseDir: () => string;
|
|
4
|
+
export interface TestCase {
|
|
5
|
+
repeat?: number;
|
|
6
|
+
rate_per_second: number | null;
|
|
7
|
+
events: Record<string, unknown>[];
|
|
8
|
+
}
|
|
9
|
+
export declare const BUILTIN_CASES: Map<string, TestCase>;
|
|
10
|
+
export declare function caseStem(name: string): string;
|
|
11
|
+
export declare function loadCase(name: string, dir?: string): TestCase | {
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildRunBody(caseDef: TestCase, overrides: Partial<Pick<TestCase, "repeat" | "rate_per_second">>, runId: string): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import path from "path";
|
|
4
|
+
export const CASE_NAME = /^[A-Za-z0-9_-]{1,64}$/;
|
|
5
|
+
export const MAX_CASE_FILE_BYTES = 256 * 1024;
|
|
6
|
+
export const testCaseDir = () => path.join(os.homedir(), ".slack-radar", "test-cases");
|
|
7
|
+
function filler(label) {
|
|
8
|
+
return `${label} {{seq}} ${"made up replay text ".repeat(205)}`;
|
|
9
|
+
}
|
|
10
|
+
const seed = { type: "message", channel: "{{test_channel}}", ts: "{{seq_ts}}", client_msg_id: "{{seq_uuid}}", text: filler("seed"), user: "UZRDR0000001" };
|
|
11
|
+
export const BUILTIN_CASES = new Map([
|
|
12
|
+
["message_changed", { repeat: 100, rate_per_second: 10, events: [seed, {
|
|
13
|
+
type: "message", subtype: "message_changed", channel: "{{test_channel}}",
|
|
14
|
+
message: { ts: "{{seq_ts}}", text: filler("edit"), client_msg_id: "{{seq_uuid}}" },
|
|
15
|
+
}] }],
|
|
16
|
+
["message_replied", { repeat: 100, rate_per_second: 10, events: [seed, {
|
|
17
|
+
type: "message", subtype: "message_replied", channel: "{{test_channel}}",
|
|
18
|
+
message: { ts: "{{seq_ts}}", thread_ts: "{{seq_ts}}", text: filler("reply"), client_msg_id: "{{seq_uuid}}", reply_count: 1, replies: [{ user: "UZRDR0000001", ts: "{{frame_ts}}" }] },
|
|
19
|
+
}] }],
|
|
20
|
+
]);
|
|
21
|
+
export function caseStem(name) {
|
|
22
|
+
return name.replace(/\.json$/, "");
|
|
23
|
+
}
|
|
24
|
+
export function loadCase(name, dir = testCaseDir()) {
|
|
25
|
+
const stem = caseStem(name);
|
|
26
|
+
if (!CASE_NAME.test(stem))
|
|
27
|
+
return { error: "case must match [A-Za-z0-9_-]{1,64}, optionally followed by .json" };
|
|
28
|
+
const filename = path.join(dir, `${stem}.json`);
|
|
29
|
+
let fd;
|
|
30
|
+
try {
|
|
31
|
+
fd = fs.openSync(filename, fs.constants.O_RDONLY | fs.constants.O_NONBLOCK);
|
|
32
|
+
const stat = fs.fstatSync(fd);
|
|
33
|
+
if (!stat.isFile())
|
|
34
|
+
return { error: `${filename} must be a regular file` };
|
|
35
|
+
if (stat.size > MAX_CASE_FILE_BYTES)
|
|
36
|
+
return { error: `${filename} exceeds 256 KB` };
|
|
37
|
+
const text = fs.readFileSync(fd, "utf8");
|
|
38
|
+
let obj;
|
|
39
|
+
try {
|
|
40
|
+
obj = JSON.parse(text.replace(/^\uFEFF/, ""));
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const message = error.message;
|
|
44
|
+
const line = message.match(/line (\d+) column (\d+)/);
|
|
45
|
+
const position = message.match(/position (\d+)/);
|
|
46
|
+
const location = line ? ` at line ${line[1]} column ${line[2]}` : position ? ` at position ${position[1]}` : "";
|
|
47
|
+
return { error: `${filename} is not valid JSON${location}` };
|
|
48
|
+
}
|
|
49
|
+
if (typeof obj !== "object" || obj === null || Array.isArray(obj) || !Array.isArray(obj.events)) {
|
|
50
|
+
return { error: `${filename} needs an events array in an object` };
|
|
51
|
+
}
|
|
52
|
+
if (!("rate_per_second" in obj))
|
|
53
|
+
return { error: `${filename} needs a rate_per_second key (a number, or null for a burst)` };
|
|
54
|
+
return obj;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (!["ENOENT", "ENOTDIR"].includes(error.code ?? ""))
|
|
58
|
+
return { error: `${filename}: ${error.message}` };
|
|
59
|
+
const builtin = BUILTIN_CASES.get(stem);
|
|
60
|
+
if (builtin)
|
|
61
|
+
return builtin;
|
|
62
|
+
let stems = [];
|
|
63
|
+
try {
|
|
64
|
+
stems = fs.readdirSync(dir).filter((entry) => entry.endsWith(".json")).map(caseStem).sort();
|
|
65
|
+
}
|
|
66
|
+
catch { }
|
|
67
|
+
return { error: `no case named ${stem}. Built in: ${[...BUILTIN_CASES.keys()].join(", ")}. In ${dir}: ${stems.join(", ") || "none"}` };
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
if (fd !== undefined)
|
|
71
|
+
fs.closeSync(fd);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export function buildRunBody(caseDef, overrides, runId) {
|
|
75
|
+
return JSON.stringify({ run_id: runId, repeat: overrides.repeat ?? caseDef.repeat ?? 1,
|
|
76
|
+
rate_per_second: "rate_per_second" in overrides ? overrides.rate_per_second : caseDef.rate_per_second, events: caseDef.events });
|
|
77
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RadarResponse } from "./radar-response.js";
|
|
2
|
+
import type { RadarRequestInit } from "./radar-http.js";
|
|
3
|
+
import type { HandlerResult } from "./switchboard-tools.js";
|
|
4
|
+
type RadarCall = (path: string, init?: RadarRequestInit) => Promise<RadarResponse>;
|
|
5
|
+
export declare function handleRunTestCase(args: Record<string, unknown>, call: RadarCall, dir?: string, newRunId?: () => string, now?: () => number): Promise<HandlerResult>;
|
|
6
|
+
export declare function handleGetTestRun(args: Record<string, unknown>, call: RadarCall, sleep?: (ms: number) => Promise<void>, now?: () => number): Promise<HandlerResult>;
|
|
7
|
+
export declare function handleStopTestRun(args: Record<string, unknown>, call: RadarCall): Promise<HandlerResult>;
|
|
8
|
+
export {};
|