@slack/radar-mcp 1.26.0 → 1.27.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 +9 -2
- package/dist/mcp/api-paths.d.ts +25 -1
- package/dist/mcp/api-paths.js +85 -9
- package/dist/mcp/index.js +23 -4
- package/dist/mcp/snapshot-cli.d.ts +1 -1
- package/dist/mcp/snapshot-cli.js +16 -1
- package/dist/mcp/snapshot.js +46 -24
- package/dist/mcp/test-runs-tools.d.ts +2 -0
- package/dist/mcp/test-runs-tools.js +58 -5
- package/dist/mcp/tools.js +25 -3
- package/dist/shared/android.d.ts +15 -4
- package/dist/shared/android.js +102 -12
- package/dist/shared/constants.d.ts +6 -5
- package/dist/shared/constants.js +6 -5
- package/dist/shared/switchboard-note.js +2 -1
- package/dist/shared/switchboard-report.js +1 -1
- package/dist/shared/test-case-capture.d.ts +15 -0
- package/dist/shared/test-case-capture.js +235 -0
- package/dist/shared/test-case-store.d.ts +54 -0
- package/dist/shared/test-case-store.js +208 -0
- package/dist/shared/transport.d.ts +9 -1
- package/dist/web/install-app.js +1 -1
- package/dist/web/public/index.html +1 -0
- package/dist/web/public/next/app.js +12 -1
- package/dist/web/public/next/feed.js +17 -2
- package/dist/web/public/next/filters.js +5 -5
- package/dist/web/public/next/registry.js +3 -2
- package/dist/web/public/next/save-case.js +92 -0
- package/dist/web/public/next/store.js +3 -1
- package/dist/web/public/next/switchboard-note.js +2 -1
- package/dist/web/public/next/test-cases.js +328 -0
- package/dist/web/public/next/voice.js +1 -1
- package/dist/web/server.d.ts +1 -0
- package/dist/web/server.js +214 -2
- package/dist/web/spec.d.ts +3 -2
- package/dist/web/spec.js +10 -9
- package/package.json +1 -1
- package/dist/mcp/test-cases.d.ts +0 -14
- package/dist/mcp/test-cases.js +0 -77
- /package/dist/web/public/icons/{radar-1024.png → icon-1024.png} +0 -0
- /package/dist/web/public/icons/{radar.svg → icon.svg} +0 -0
package/package.json
CHANGED
package/dist/mcp/test-cases.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
package/dist/mcp/test-cases.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
}
|
|
File without changes
|
|
File without changes
|