@slack/radar-mcp 1.3.0 → 1.5.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,33 @@
1
1
  import http from "http";
2
+ import { type LogFrame } from "./log-session.js";
2
3
  declare const WEB_PORT: number;
4
+ /**
5
+ * Decide whether to drop a log frame under backpressure. LIVE frames are dropped
6
+ * when the connection's unwritten buffer is already past the cap (an unbounded
7
+ * queue to a slow/backgrounded tab). REPLAY frames are NEVER dropped: replay is a
8
+ * bounded one-time send of the whole ring and IS the connection's purpose; it runs
9
+ * synchronously so writableLength climbs monotonically, and dropping past the cap
10
+ * would silently cut the newest history and reintroduce the reconnect log-loss
11
+ * this feature fixes. Exported pure so the replay-exemption is unit-testable
12
+ * without a socket. `cap` defaults to the live ceiling.
13
+ */
14
+ export declare function shouldDropLogFrame(replay: boolean, writableLength: number, cap?: number): boolean;
3
15
  export declare function createServer(): http.Server;
16
+ /**
17
+ * Finish a /detail proxy response after an upstream error or timeout. The success
18
+ * callback streams the upstream response, so headers may already be sent when a later
19
+ * "error"/"timeout" fires (a partial response then the device drops the socket mid-stream,
20
+ * common when the device idle-shuts). Calling writeHead a second time throws
21
+ * ERR_HTTP_HEADERS_SENT and crashes the whole process, so only write a status when headers
22
+ * have not gone out yet; otherwise just end the already-started response. Exported for tests.
23
+ */
24
+ export declare function failDetailResponse(res: Pick<http.ServerResponse, "headersSent" | "writeHead" | "end">, status: number): void;
25
+ type ParsedLog = LogFrame;
26
+ /**
27
+ * Parse one `adb logcat -v threadtime` line into a structured event, or null if it does
28
+ * not match the format. `resolvePkg` maps a pid to its package name (defaults to the
29
+ * live adb-backed resolver); injectable so this stays a pure, unit-testable function.
30
+ * Exported for tests.
31
+ */
32
+ export declare function parseLogcat(line: string, resolvePkg?: (pid: number) => string | undefined): ParsedLog | null;
4
33
  export { WEB_PORT };