@slack/radar-mcp 1.22.0 → 1.24.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 +62 -12
- package/dist/mcp/dashboard-identity.d.ts +10 -0
- package/dist/mcp/dashboard-identity.js +20 -0
- package/dist/mcp/debug-package-reset.d.ts +5 -0
- package/dist/mcp/debug-package-reset.js +28 -0
- package/dist/mcp/flags-tools.d.ts +2 -0
- package/dist/mcp/flags-tools.js +15 -1
- package/dist/mcp/index.js +172 -142
- package/dist/mcp/radar-http.d.ts +22 -0
- package/dist/mcp/radar-http.js +63 -0
- package/dist/mcp/radar-response.d.ts +1 -0
- package/dist/mcp/session-enable.d.ts +15 -0
- package/dist/mcp/session-enable.js +195 -33
- package/dist/mcp/sources-gate.js +5 -0
- package/dist/mcp/switchboard-tools.d.ts +5 -2
- package/dist/mcp/switchboard-tools.js +18 -12
- 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.js +106 -171
- package/dist/mcp/web-child-env.js +2 -1
- package/dist/shared/android.d.ts +75 -10
- package/dist/shared/android.js +352 -109
- package/dist/shared/constants.d.ts +17 -5
- package/dist/shared/constants.js +59 -5
- package/dist/shared/db.d.ts +1 -1
- package/dist/shared/db.js +21 -14
- package/dist/shared/debug-log.js +2 -4
- package/dist/shared/enable-diagnosis.d.ts +27 -1
- package/dist/shared/enable-diagnosis.js +73 -0
- package/dist/shared/log-session.d.ts +2 -1
- package/dist/shared/logcat-capture.js +17 -1
- package/dist/shared/prefs.js +4 -5
- package/dist/shared/radar-request-raw.js +3 -1
- package/dist/shared/switchboard.d.ts +1 -0
- package/dist/shared/switchboard.js +3 -1
- package/dist/shared/transport.d.ts +30 -0
- package/dist/web/install-app.d.ts +18 -0
- package/dist/web/install-app.js +60 -7
- package/dist/web/macapp/RadarApp.swift +147 -1
- package/dist/web/server.d.ts +17 -0
- package/dist/web/server.js +180 -35
- package/package.json +1 -1
package/dist/shared/android.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ChildProcess } from "child_process";
|
|
2
2
|
import { TokenFileError } from "./radar-token.js";
|
|
3
|
+
import { BareEnableError, type PinReason } from "./enable-diagnosis.js";
|
|
4
|
+
import type { ArgvReason } from "./transport.js";
|
|
3
5
|
import { LogSession, type LogFrame } from "./log-session.js";
|
|
4
6
|
import type { DeviceInfo, DeviceTransport, LogResult, ProcessState, DevicePick } from "./transport.js";
|
|
5
7
|
export declare function describeBroadcastFailure(error: Error): string;
|
|
@@ -35,6 +37,50 @@ export declare class AndroidPidPackageMap {
|
|
|
35
37
|
}
|
|
36
38
|
/** Parse one adb logcat threadtime line into the dashboard's normalized log frame. */
|
|
37
39
|
export declare function parseAndroidLogcat(line: string, resolvePackage?: (pid: number) => string | undefined): LogFrame | null;
|
|
40
|
+
export declare function adbNotFoundError(): string;
|
|
41
|
+
export declare function tokenFileWriteArgs(userId: string, pkg?: string): string[];
|
|
42
|
+
export declare function tokenFileCheckArgs(userId: string, pkg?: string): string[];
|
|
43
|
+
export declare function tokenFileWritten(stdout: string): boolean;
|
|
44
|
+
export declare function tokenFileLeftover(stdout: string): boolean | null;
|
|
45
|
+
export type PsProbe = {
|
|
46
|
+
state: ProcessState;
|
|
47
|
+
lines: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function classifyPsDebugBuild(stdout: string): PsProbe;
|
|
50
|
+
export type PsRow = {
|
|
51
|
+
user: string;
|
|
52
|
+
pkg: string | null;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The rows the probe lines carry: the Android user and the debug package behind the process name.
|
|
56
|
+
* A `:process` suffix folds into its package, and a name that breaks the package rule gets a null
|
|
57
|
+
* pkg (never trusted into a shell string) but its row still counts for its user. Lines that are
|
|
58
|
+
* not an app process of a user, such as root's, are skipped.
|
|
59
|
+
*/
|
|
60
|
+
export declare function parsePsRows(lines: string): PsRow[];
|
|
61
|
+
/** The distinct valid debug packages ps shows for one Android user. */
|
|
62
|
+
export declare function debugPackagesForUser(lines: string, userId: string): string[];
|
|
63
|
+
export type DebugPackagePick = {
|
|
64
|
+
kind: "use";
|
|
65
|
+
pkg: string;
|
|
66
|
+
detected: boolean;
|
|
67
|
+
} | {
|
|
68
|
+
kind: "stopped";
|
|
69
|
+
pkg?: string;
|
|
70
|
+
reason?: PinReason;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "ambiguous";
|
|
73
|
+
packages: string[];
|
|
74
|
+
} | {
|
|
75
|
+
kind: "unknown_flavour";
|
|
76
|
+
packages: string[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Which package to arm for one user. `unknown` keeps the current package and never blocks,
|
|
80
|
+
* the same as the process gate always did. A pinned package (the override, else the build this
|
|
81
|
+
* session already armed) is only checked, never replaced.
|
|
82
|
+
*/
|
|
83
|
+
export declare function pickDebugPackage(probe: PsProbe, userId: string, override: string | null, current: string, held?: string | null): DebugPackagePick;
|
|
38
84
|
/**
|
|
39
85
|
* Parse the output of `ps -A -o USER,NAME` to extract the Android user ID
|
|
40
86
|
* for the debug build process. When multiple profiles are running, prefers
|
|
@@ -43,6 +89,15 @@ export declare function parseAndroidLogcat(line: string, resolvePackage?: (pid:
|
|
|
43
89
|
* "10", which is often a work profile, but the id alone cannot prove that).
|
|
44
90
|
*/
|
|
45
91
|
export declare function parseUserFromPsOutput(psOutput: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Same pick as parseUserFromPsOutput, plus whether a line of a target package decided it.
|
|
94
|
+
* With targets, only their lines count; when none match the user still comes from all lines
|
|
95
|
+
* (so errors can name a real user) and `matched` is false.
|
|
96
|
+
*/
|
|
97
|
+
export declare function pickUserFromPs(psOutput: string, targetPackages?: readonly string[]): {
|
|
98
|
+
userId: string;
|
|
99
|
+
matched: boolean;
|
|
100
|
+
};
|
|
46
101
|
/**
|
|
47
102
|
* Parse `adb devices -l` output into a list of attached devices. Skips the
|
|
48
103
|
* "List of devices attached" header and the daemon-restart preamble adb sometimes
|
|
@@ -65,7 +120,9 @@ export interface AndroidTransportDependencies {
|
|
|
65
120
|
}
|
|
66
121
|
export declare class AndroidTransport implements DeviceTransport {
|
|
67
122
|
readonly platform = "android";
|
|
68
|
-
|
|
123
|
+
get logPackage(): string;
|
|
124
|
+
adoptRadarOwner(ping: Record<string, unknown>): void;
|
|
125
|
+
foreignRadarOwner(ping: Record<string, unknown>): string | null;
|
|
69
126
|
readonly supportsHostLogs = true;
|
|
70
127
|
readonly logSession: LogSession;
|
|
71
128
|
readonly supportsRadarHttpTools = true;
|
|
@@ -74,11 +131,16 @@ export declare class AndroidTransport implements DeviceTransport {
|
|
|
74
131
|
readonly supportsDeviceDashboard = true;
|
|
75
132
|
private portForwarded;
|
|
76
133
|
private detectedUserId;
|
|
134
|
+
private psSawUser;
|
|
135
|
+
private armedBuild;
|
|
136
|
+
private commitBuild;
|
|
77
137
|
private currentTimeoutMinutes;
|
|
78
138
|
private radarEnabled;
|
|
79
139
|
private lastForwardError;
|
|
80
140
|
private lastActivateError;
|
|
81
141
|
private lastActivateTokenFileError;
|
|
142
|
+
private lastActivateBareError;
|
|
143
|
+
private lastTokenViaArgv;
|
|
82
144
|
private selectedDevice;
|
|
83
145
|
private readonly dashboardPidPackages;
|
|
84
146
|
constructor(dependencies?: AndroidTransportDependencies);
|
|
@@ -97,12 +159,7 @@ export declare class AndroidTransport implements DeviceTransport {
|
|
|
97
159
|
private rebuildForwardAsync;
|
|
98
160
|
getLastForwardError(): string | null;
|
|
99
161
|
activate(timeoutMinutes: number): void;
|
|
100
|
-
/**
|
|
101
|
-
* activate, off the event loop. Same skip guard, the same broadcast argv, and the same
|
|
102
|
-
* state recording as the sync twin, but the `ps` user detection and the broadcast run
|
|
103
|
-
* through execFileAsync so a caller serving HTTP (the dashboard's boot-arm chain) keeps
|
|
104
|
-
* answering while adb runs.
|
|
105
|
-
*/
|
|
162
|
+
/** Keep adb off the event loop so HTTP requests still get answers during an arm. */
|
|
106
163
|
activateAsync(timeoutMinutes: number): Promise<void>;
|
|
107
164
|
/**
|
|
108
165
|
* Whether the device-side Radar server's abstract socket exists right now, read from the
|
|
@@ -113,11 +170,20 @@ export declare class AndroidTransport implements DeviceTransport {
|
|
|
113
170
|
* can. "unknown" (adb missing, or the table could not be read) leaves the caller its safe branch.
|
|
114
171
|
*/
|
|
115
172
|
radarSocketPresentAsync(): Promise<"present" | "absent" | "unknown">;
|
|
173
|
+
private runEnableSteps;
|
|
174
|
+
private runEnableStepsAsync;
|
|
175
|
+
private applyArmOutcome;
|
|
176
|
+
private clearArmOutcome;
|
|
116
177
|
private recordActivateSuccess;
|
|
117
178
|
private recordActivateFailure;
|
|
118
179
|
private readArmToken;
|
|
119
180
|
getLastActivateError(): string | null;
|
|
181
|
+
ensureLogCapture(): void;
|
|
120
182
|
getLastActivateTokenFileError(): TokenFileError | null;
|
|
183
|
+
getLastActivateBareError(): BareEnableError | null;
|
|
184
|
+
getLastTokenViaArgv(): ArgvReason | null;
|
|
185
|
+
/** Forget the held build so the next arm detects one afresh. */
|
|
186
|
+
releaseDebugBuild(): void;
|
|
121
187
|
resetState(): void;
|
|
122
188
|
dropForward(): void;
|
|
123
189
|
isForwarded(): boolean;
|
|
@@ -188,10 +254,9 @@ export declare class AndroidTransport implements DeviceTransport {
|
|
|
188
254
|
*/
|
|
189
255
|
private psDebugBuildProbe;
|
|
190
256
|
private psDebugBuildProbeAsync;
|
|
191
|
-
/** Raw `ps` lines for running debug-build Slack processes, or null if there are none. */
|
|
192
|
-
private psDebugBuildLine;
|
|
193
257
|
private detectDebugBuildUser;
|
|
194
|
-
private
|
|
258
|
+
private detectDebugBuildUserProbe;
|
|
259
|
+
private detectDebugBuildUserProbeAsync;
|
|
195
260
|
private cacheUserFromPs;
|
|
196
261
|
/**
|
|
197
262
|
* State of the debug-build Slack process, checked fresh via `ps` (independent of
|