@slack/radar-mcp 1.18.0 → 1.19.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.
@@ -1,4 +1,5 @@
1
1
  import http from "http";
2
+ import type { StatusReason } from "../shared/wire.js";
2
3
  import { type DashboardScreenController } from "../shared/dashboard-screen.js";
3
4
  import type { ProcessState } from "../shared/transport.js";
4
5
  import { type LogFrame } from "./log-session.js";
@@ -31,6 +32,14 @@ export declare function seedInitialSpec(): void;
31
32
  * Same post-bind discipline as seedInitialSpec: the port owner is the sole legitimate writer.
32
33
  */
33
34
  export declare function cleanupOnBind(): void;
35
+ /**
36
+ * Arm the screen cleanup-on-exit handlers for THIS process. Same post-bind discipline, and the
37
+ * same reason, as cleanupOnBind and seedInitialSpec: the handler deletes ~/.slack-radar/screen
38
+ * captures, which are per USER rather than per port, so a second launcher that LOSES the bind
39
+ * would delete the running dashboard's clips on its way out. Registered from createServer()
40
+ * before, which is exactly the window that made adopting a dashboard cost the winner its saves.
41
+ */
42
+ export declare function registerScreenCleanupOnBind(): void;
34
43
  export declare const TAB_LIVENESS_MS = 75000;
35
44
  export declare const AUTO_CLOSE_GRACE_MS: number;
36
45
  /**
@@ -129,12 +138,15 @@ export declare function shutdownDashboard(server: {
129
138
  *
130
139
  * NOT routed through handleEnable, which is written around an HTTP response. Two of the steps it
131
140
  * additionally performs really are no-ops in a fresh process (resetState and resetDbState only clear
132
- * in-process fields that are already at their defaults), but two are NOT, and this is deliberately
133
- * left as a known gap rather than claimed away: resetScreenState() kills orphaned device-side
134
- * screenrecord processes left by a crashed prior dashboard, and the switched-device branch
135
- * (cleanupPulledDatabases + logSession.restart) is gated on a serial inherited from the environment,
136
- * so a boot carrying a stale ANDROID_SERIAL can legitimately be a switch. Pressing Reconnect still
137
- * performs both. If a third step is ever needed here, extract the shared core instead of copying it.
141
+ * in-process fields that are already at their defaults). The screen teardown is NOT a no-op and runs
142
+ * here instead (see armDevice): boot owns the orphan reap, which is what lets /enable reserve its
143
+ * own teardown for a genuine device switch rather than spend one on its first press. /enable still
144
+ * reaps as a fallback when boot could not pin a serial to reap for, so a launch that cannot arm
145
+ * does not leave the orphan alive for the whole process. One gap is deliberately left rather than
146
+ * claimed away: the switched-device branch (cleanupPulledDatabases + logSession.restart) is gated
147
+ * on a serial inherited from the environment, so a boot carrying a stale ANDROID_SERIAL can
148
+ * legitimately be a switch, and only Reconnect performs that part. If a third step is ever needed
149
+ * here, extract the shared core instead of copying it.
138
150
  */
139
151
  export declare function armOnBoot(): void;
140
152
  /**
@@ -200,9 +212,13 @@ export declare function isOpenToAnyCaller(urlPath: string, method: string | unde
200
212
  */
201
213
  export declare function isLocalHostHeader(host: string | string[] | undefined, allowedHosts?: string | undefined): boolean;
202
214
  export declare function enableResultBody(enabled: boolean, onEnabled?: () => void, processState?: ProcessState): {
203
- enabled: boolean;
204
- error?: string;
215
+ enabled: true;
216
+ } | {
217
+ enabled: false;
218
+ error: string;
219
+ instructs: boolean;
205
220
  };
221
+ export declare function _setEnableFaultForTest(err: Error | null, delayMs?: number): void;
206
222
  export declare const DEVICE_SOURCES: Record<string, {
207
223
  segment: string;
208
224
  arrayKey: string;
@@ -224,4 +240,9 @@ type ParsedLog = LogFrame;
224
240
  * Exported for tests.
225
241
  */
226
242
  export declare function parseLogcat(line: string, resolvePkg?: (pid: number) => string | undefined): ParsedLog | null;
243
+ export declare function _setStreamResponseTimeoutForTest(ms: number | null): void;
244
+ export declare function _setOutageDiagnosisTtlForTest(ms: number | null): void;
245
+ export declare function _setOutageProbeForTest(probe: (() => Promise<"present" | "absent" | "unknown">) | null): void;
246
+ export declare function _diagnoseOutageForTest(): Promise<StatusReason | null>;
247
+ export declare function _invalidateOutageDiagnosisForTest(): void;
227
248
  export { WEB_PORT };