xcodebug 1.0.0 → 1.1.1

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 CHANGED
@@ -32,6 +32,15 @@ pi install npm:xcodebug@1.0.0
32
32
  pi install /path/to/xcodebug
33
33
  ```
34
34
 
35
+ **Upgrading from `xcodebug-extension`:** the package was renamed, so both names
36
+ register the same `xcodebug` tool and the loader refuses to start the second one
37
+ (`Tool "xcodebug" conflicts with ...`). Remove the old package first:
38
+
39
+ ```bash
40
+ pi remove npm:xcodebug-extension
41
+ pi install npm:xcodebug
42
+ ```
43
+
35
44
  Or copy the directory into the global extensions dir, which the engine discovers
36
45
  on startup:
37
46
 
@@ -48,6 +57,90 @@ extension: pi has no reload command at all, and omp's `/reload-plugins` only
48
57
  clears plugin discovery, not the imported module graph. Editing `index.ts` while
49
58
  a session is running therefore has no effect on that session.
50
59
 
60
+ ## Claude Code and Codex (MCP)
61
+
62
+ Neither client has an in-process extension API - tools reach them as MCP servers.
63
+ `mcp/server.ts` is that adapter: it loads `index.ts` with a stub host and serves
64
+ the tool it registers, so it exposes the same actions and arguments as the pi
65
+ extension rather than a parallel implementation.
66
+
67
+ ### Set up (once per machine)
68
+
69
+ ```bash
70
+ npm i -g xcodebug # >= 1.1.0, the first release that ships mcp/
71
+ codex mcp add xcodebug -- bun "$(npm root -g)/xcodebug/mcp/server.ts"
72
+ claude mcp add xcodebug -- bun "$(npm root -g)/xcodebug/mcp/server.ts"
73
+ ```
74
+
75
+ Working from a checkout instead? Point both at `mcp/server.ts` in the repo:
76
+
77
+ ```bash
78
+ codex mcp add xcodebug -- bun /path/to/xcodebug/mcp/server.ts
79
+ claude mcp add xcodebug -- bun /path/to/xcodebug/mcp/server.ts
80
+ ```
81
+
82
+ Bun is required ([bun.sh](https://bun.sh)). The sources are TypeScript, and Node
83
+ refuses to strip types for files under `node_modules`
84
+ (`ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING`) - which is exactly where npm
85
+ installs the package, so `node` cannot start an installed copy. Bun loads the
86
+ same file from either location, so one command covers both.
87
+
88
+ Check that the client picked it up:
89
+
90
+ ```bash
91
+ codex mcp list # xcodebug bun …
92
+ claude mcp list # xcodebug: … ✔ Connected
93
+ ```
94
+
95
+ ### Use
96
+
97
+ Start the client **in the project directory**. The server inherits its cwd, and
98
+ that directory is the project root every action resolves against.
99
+
100
+ ```bash
101
+ cd ~/myapp # holds the .xcworkspace or .xcodeproj
102
+ codex # or: claude
103
+ ```
104
+
105
+ Then ask for the outcome; the model calls the tool:
106
+
107
+ ```text
108
+ Build and launch on my device, then show me the console.
109
+ ```
110
+
111
+ The actions that matter in this mode:
112
+
113
+ ```text
114
+ action=launch device=<udid> build + install + launch; the capture starts
115
+ action=logs since=0 incremental read - the cursor is per capture
116
+ action=logs grep=Weather narrow to one subsystem
117
+ action=wait match="..." block until a line appears
118
+ action=status captures, line counts, log paths
119
+ action=stop close every running capture
120
+ ```
121
+
122
+ ### What differs from pi
123
+
124
+ | | pi / omp / omo | Claude Code / Codex |
125
+ |---|---|---|
126
+ | how the tool is exposed | registered in-process | MCP server process |
127
+ | status line, widget | yes | none |
128
+ | `push` | mirrors new lines into the session | refused |
129
+ | capture state | in the session | in the server process |
130
+ | lifetime | the session | the client process |
131
+
132
+ - **`push` is refused on purpose.** MCP has no channel that injects content into a
133
+ running turn, and neither client renders `notifications/message` - measured on
134
+ both, where the model reported that nothing arrived on its own between two tool
135
+ calls. Read with `action=logs` or `action=wait`; both are pull-based, and the
136
+ cursor means you only pay for new lines.
137
+ - **Captures end with the client.** The server is a child of Codex/Claude, so
138
+ quitting the client stops the bridges. Relaunch next session.
139
+
140
+ Logs land in `~/.xcodebug/logs/xcodebug/`, or under `XCODEBUG_AGENT_DIR` when set.
141
+ Every response also reports the exact path, so the model can read the file once a
142
+ run is over.
143
+
51
144
  ## Requirements
52
145
 
53
146
  | Need | Why |
@@ -56,8 +149,10 @@ a session is running therefore has no effect on that session.
56
149
  | `idevicesyslog` from libimobiledevice | optional; only `syslog` and the dual-channel safety net |
57
150
  | git | change detection; without a repo every run rebuilds |
58
151
  | CocoaPods | optional; only projects with a `Podfile` |
152
+ | Bun | only for the MCP clients (Claude Code, Codex); pi runs the extension itself |
59
153
 
60
- `xcodebug action=doctor` reports which of these are present.
154
+ `xcodebug action=doctor` reports the Xcode toolchain, the capture tools, the
155
+ active config and the log directory.
61
156
 
62
157
  ## Imports
63
158
 
package/archive.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { mkdir, readdir, rm, stat } from "node:fs/promises";
18
18
  import { dirname, join } from "node:path";
19
- import { runCommand, timestamp } from "./exec";
19
+ import { runCommand, timestamp } from "./exec.ts";
20
20
 
21
21
  export interface ArchiveResult {
22
22
  ok: boolean;
package/capture.ts CHANGED
@@ -7,7 +7,7 @@ import { spawn, type ChildProcess } from "node:child_process";
7
7
  import { createWriteStream, type WriteStream } from "node:fs";
8
8
  import { mkdir } from "node:fs/promises";
9
9
  import { dirname } from "node:path";
10
- import { timestamp } from "./exec";
10
+ import { timestamp } from "./exec.ts";
11
11
 
12
12
  const ANSI = /\u001b\[[0-9;?]*[ -/]*[@-~]/g;
13
13
  const MAX_BUFFER_LINES = 20_000;
package/changes.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
14
14
  import { dirname, join, relative, resolve } from "node:path";
15
- import { runCommand } from "./exec";
15
+ import { runCommand } from "./exec.ts";
16
16
 
17
17
  const SOURCE_EXTENSIONS = new Set([
18
18
  ".swift", ".h", ".m", ".mm", ".c", ".cc", ".cpp", ".metal",
@@ -334,7 +334,10 @@ export async function runPodInstall(
334
334
  signal: options.signal,
335
335
  });
336
336
  const durationMs = Date.now() - started;
337
- const output = `$ pod install --no-repo-update (cwd ${podfileDir})\n\n${result.stdout}\n${result.stderr}`;
337
+ const dropped = result.truncated
338
+ ? "[xcodebug] output exceeded the size cap; the beginning was dropped and this log keeps the tail.\n\n"
339
+ : "";
340
+ const output = `$ pod install --no-repo-update (cwd ${podfileDir})\n\n${dropped}${result.stdout}\n${result.stderr}`;
338
341
  // The log directory is created lazily by whatever wrote a log first; pod
339
342
  // install can be the very first thing a run does, so ensure it here.
340
343
  await mkdir(dirname(options.logFile), { recursive: true });
package/devices.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * devicectl accepts a uuid, ecid, serial number, udid, name or DNS name, so
5
5
  * every identifier we keep is accepted verbatim by later commands.
6
6
  */
7
- import { asRecord, asString, runCommand } from "./exec";
7
+ import { asRecord, asString, runCommand } from "./exec.ts";
8
8
 
9
9
  export interface DeviceInfo {
10
10
  /** CoreDevice identifier (uuid) — accepted by devicectl. */
package/exec.ts CHANGED
@@ -11,6 +11,15 @@ export interface CommandResult {
11
11
  stderr: string;
12
12
  code: number;
13
13
  timedOut: boolean;
14
+ /**
15
+ * True when a stream exceeded `maxBytes` and its beginning was dropped.
16
+ *
17
+ * The head is what gets dropped because the useful end of a build is the end:
18
+ * a 12MB cap on a four-minute build used to keep thousands of identical
19
+ * compile commands and throw away the `error:` diagnostics and the verdict,
20
+ * leaving a log that says BUILD FAILED and nothing else.
21
+ */
22
+ truncated: boolean;
14
23
  }
15
24
 
16
25
  export interface CommandOptions {
@@ -33,6 +42,7 @@ export function runCommand(
33
42
  let stderr = "";
34
43
  let timedOut = false;
35
44
  let settled = false;
45
+ let truncated = false;
36
46
 
37
47
  // `detached` puts the child in its own process group so the whole tree can
38
48
  // be signalled at once. `sh -lc "cd x && npm test"` runs the real work as a
@@ -66,15 +76,24 @@ export function runCommand(
66
76
  }, timeoutMs)
67
77
  : undefined;
68
78
 
69
- const append = (current: string, chunk: string): string =>
70
- current.length >= maxBytes ? current : (current + chunk).slice(0, maxBytes);
79
+ // Keep the tail, not the head: a build's diagnostics and verdict are at the
80
+ // end. Trim in blocks (down to 75% of the cap) so a long build re-copies the
81
+ // buffer a few times instead of once per chunk, and so memory stays bounded.
82
+ const append = (current: string, chunk: string): string => {
83
+ const next = current + chunk;
84
+ if (next.length <= maxBytes) return next;
85
+ truncated = true;
86
+ // `slice(-0)` is `slice(0)`, which would keep the whole buffer: clamp to at
87
+ // least one character so a tiny cap still truncates.
88
+ return next.slice(-Math.max(1, Math.floor(maxBytes * 0.75)));
89
+ };
71
90
 
72
91
  const finish = (code: number): void => {
73
92
  if (settled) return;
74
93
  settled = true;
75
94
  if (timer) clearTimeout(timer);
76
95
  signal?.removeEventListener("abort", onAbort);
77
- resolve({ stdout, stderr, code, timedOut });
96
+ resolve({ stdout, stderr, code, timedOut, truncated });
78
97
  };
79
98
 
80
99
  child.stdout?.setEncoding("utf8");
package/index.ts CHANGED
@@ -16,12 +16,12 @@ import { basename, dirname, join } from "node:path";
16
16
  // one distribution of the engine.
17
17
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
18
18
  import { Type } from "typebox";
19
- import { Capture, type LogLine } from "./capture";
20
- import { describeDevices, findProcessPid, listDevices, lookupProcess, resolveDevice, type DeviceInfo } from "./devices";
21
- import { lastLines, runCommand, timestamp } from "./exec";
22
- import { buildForDevice, consoleLaunchArgs, installApp, terminateApp, type BuildTarget } from "./xcode";
23
- import { checkPodLockSync, describeChanges, detectChanges, runPodInstall, type ChangeReport } from "./changes";
24
- import { clearArchives } from "./archive";
19
+ import { Capture, type LogLine } from "./capture.ts";
20
+ import { describeDevices, findProcessPid, listDevices, lookupProcess, resolveDevice, type DeviceInfo } from "./devices.ts";
21
+ import { lastLines, runCommand, timestamp } from "./exec.ts";
22
+ import { buildForDevice, consoleLaunchArgs, installApp, terminateApp, type BuildTarget } from "./xcode.ts";
23
+ import { checkPodLockSync, describeChanges, detectChanges, runPodInstall, type ChangeReport } from "./changes.ts";
24
+ import { clearArchives } from "./archive.ts";
25
25
 
26
26
  const CAPTURE_PREFIX = "xcodebug";
27
27
  const PUSH_INTERVAL_MS = 4_000;
@@ -1874,6 +1874,7 @@ export default function xcodebug(pi: ExtensionAPI): void {
1874
1874
  const matches: LogLine[] = [];
1875
1875
  const seen = new Set<number>();
1876
1876
  let finished = false;
1877
+ let cancelled = false;
1877
1878
  let timer: ReturnType<typeof setTimeout> | undefined;
1878
1879
  let unsubscribeLine: () => void = () => {};
1879
1880
  let unsubscribeExit: () => void = () => {};
@@ -1883,6 +1884,9 @@ export default function xcodebug(pi: ExtensionAPI): void {
1883
1884
  const settle = (timedOut: boolean): string => {
1884
1885
  const cursor = capture.status().cursor;
1885
1886
  if (matches.length === 0) {
1887
+ // Abort also settles through `finish`, so say what happened instead of
1888
+ // reporting a timeout that never elapsed.
1889
+ if (cancelled) return `cancelled while waiting for "${needle}" (cursor ${cursor})`;
1886
1890
  return timedOut
1887
1891
  ? `timed out after ${timeoutMs / 1000}s waiting for "${needle}" (cursor ${cursor})`
1888
1892
  : `capture ended before "${needle}" appeared (cursor ${cursor})`;
@@ -1925,7 +1929,10 @@ export default function xcodebug(pi: ExtensionAPI): void {
1925
1929
  });
1926
1930
  unsubscribeExit = capture.onExit(() => setTimeout(() => finish(false), 0));
1927
1931
  timer = setTimeout(() => finish(true), timeoutMs);
1928
- onAbort = (): void => finish(true);
1932
+ onAbort = (): void => {
1933
+ cancelled = true;
1934
+ finish(true);
1935
+ };
1929
1936
  signal?.addEventListener("abort", onAbort, { once: true });
1930
1937
 
1931
1938
  for (const line of capture.read({ since, limit: 500, grep: needle }).lines) collect(line);
package/mcp/server.ts ADDED
@@ -0,0 +1,197 @@
1
+ /**
2
+ * MCP entry point: serve the xcodebug tool to MCP clients such as Codex CLI.
3
+ *
4
+ * Codex has no in-process extension API - tools reach it as MCP servers - so this
5
+ * file is the adapter, not a second implementation: it loads index.ts with a stub
6
+ * host, captures the tool the extension registers, and forwards calls to that
7
+ * tool's execute. index.ts stays untouched, which is what keeps the pi path
8
+ * behaving exactly as verified across pi, omp and omo.
9
+ *
10
+ * Run it with bun. Node can load this file from a checkout, but not from
11
+ * node_modules: it refuses to strip types there
12
+ * (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), and that is where npm installs
13
+ * the package.
14
+ *
15
+ * codex mcp add xcodebug -- bun /path/to/xcodebug/mcp/server.ts
16
+ *
17
+ * The protocol is hand-written JSON-RPC over stdio because only three methods are
18
+ * needed (initialize, tools/list, tools/call); the official SDK would add ~97
19
+ * transitive packages to every install, including the pi users who never run MCP.
20
+ */
21
+ import { readFileSync } from "node:fs";
22
+ import { homedir } from "node:os";
23
+ import { join } from "node:path";
24
+ import { createInterface } from "node:readline";
25
+
26
+ /** Only the fields index.ts reads off its context. */
27
+ interface ExtensionContextLike {
28
+ cwd: string;
29
+ agentDir: string;
30
+ ui: { notify(): void; setStatus(): void; setWidget(): void };
31
+ }
32
+
33
+ interface ToolResult {
34
+ content: Array<{ type: "text"; text: string }>;
35
+ isError?: boolean;
36
+ }
37
+
38
+ /** The slice of a pi-registered tool this server forwards to. */
39
+ interface RegisteredTool {
40
+ description: string;
41
+ /** Typebox schema; JSON-serialized before it reaches the client. */
42
+ parameters: unknown;
43
+ execute(
44
+ toolCallId: string,
45
+ params: unknown,
46
+ signal: AbortSignal | undefined,
47
+ onUpdate: undefined,
48
+ ctx: ExtensionContextLike,
49
+ ): Promise<ToolResult>;
50
+ }
51
+
52
+ /** Only the members index.ts calls on the host API. */
53
+ interface StubPi {
54
+ cwd: string;
55
+ on(): void;
56
+ registerCommand(): void;
57
+ sendMessage(): void;
58
+ registerTool(tool: RegisteredTool): void;
59
+ }
60
+
61
+ const AGENT_DIR = process.env.XCODEBUG_AGENT_DIR ?? join(homedir(), ".xcodebug");
62
+ const PROTOCOL_VERSION = "2024-11-05";
63
+
64
+ // Reported to clients on initialize; read from the package so a version bump does
65
+ // not leave the handshake advertising the previous release.
66
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) as {
67
+ version: string;
68
+ };
69
+
70
+ let registered: RegisteredTool | undefined;
71
+ const stubPi: StubPi = {
72
+ cwd: process.cwd(),
73
+ on() {},
74
+ registerCommand() {},
75
+ // Nothing consumes pushed lines here: MCP has no channel that injects messages
76
+ // into the conversation, so push is refused below instead of silently dropped.
77
+ sendMessage() {},
78
+ registerTool(tool) {
79
+ registered = tool;
80
+ },
81
+ };
82
+
83
+ // Dynamic import because the extension is a plugin: it is loaded at run time,
84
+ // once the stub host exists, rather than imported for its side effects at start
85
+ // up. The cast is the adapter boundary: the extension declares the full
86
+ // ExtensionAPI, this server supplies only the members it reads.
87
+ const extensionModule = (await import("../index.ts")) as unknown as {
88
+ default(pi: StubPi): void;
89
+ };
90
+ extensionModule.default(stubPi);
91
+ if (!registered) {
92
+ console.error("xcodebug-mcp: the extension did not register a tool");
93
+ process.exit(1);
94
+ }
95
+ const tool = registered;
96
+
97
+ const ctx: ExtensionContextLike = {
98
+ cwd: process.cwd(),
99
+ agentDir: AGENT_DIR,
100
+ ui: { notify() {}, setStatus() {}, setWidget() {} },
101
+ };
102
+
103
+ // Typebox attaches symbol metadata; JSON round-tripping leaves a plain schema.
104
+ const inputSchema = JSON.parse(JSON.stringify(tool.parameters)) as Record<string, unknown>;
105
+
106
+ function reply(id: unknown, result: unknown): void {
107
+ process.stdout.write(`${JSON.stringify({ jsonrpc: "2.0", id, result })}\n`);
108
+ }
109
+
110
+ function replyError(id: unknown, code: number, message: string): void {
111
+ process.stdout.write(`${JSON.stringify({ jsonrpc: "2.0", id, error: { code, message } })}\n`);
112
+ }
113
+
114
+ async function callTool(args: Record<string, unknown>, signal: AbortSignal): Promise<ToolResult> {
115
+ // `defaultPushMode` defaults to "context", but this transport cannot deliver
116
+ // pushed lines. Refusing an explicit request beats accepting it and going quiet.
117
+ if (args.push !== undefined && args.push !== "off") {
118
+ return {
119
+ content: [{ type: "text", text: 'MCP has no push channel; use push=off and read with action=logs.' }],
120
+ isError: true,
121
+ };
122
+ }
123
+ return tool.execute("mcp", { ...args, push: "off" }, signal, undefined, ctx);
124
+ }
125
+
126
+ async function handle(message: Record<string, unknown>): Promise<void> {
127
+ const id = message.id;
128
+ const method = message.method;
129
+ // Notifications carry no id and must never be answered.
130
+ if (id === undefined) return;
131
+
132
+ if (method === "initialize") {
133
+ const requested = (message.params as { protocolVersion?: string } | undefined)?.protocolVersion;
134
+ reply(id, {
135
+ protocolVersion: requested ?? PROTOCOL_VERSION,
136
+ capabilities: { tools: {} },
137
+ serverInfo: { name: "xcodebug", version: pkg.version },
138
+ });
139
+ return;
140
+ }
141
+ if (method === "ping") {
142
+ reply(id, {});
143
+ return;
144
+ }
145
+ if (method === "tools/list") {
146
+ reply(id, { tools: [{ name: "xcodebug", description: tool.description, inputSchema }] });
147
+ return;
148
+ }
149
+ if (method === "tools/call") {
150
+ const params = (message.params ?? {}) as { name?: string; arguments?: Record<string, unknown> };
151
+ if (params.name !== "xcodebug") {
152
+ replyError(id, -32602, `Unknown tool "${params.name ?? ""}"`);
153
+ return;
154
+ }
155
+ // Registered before the call starts so a cancellation that arrives while it
156
+ // runs finds the controller; `finally` keeps the map from growing.
157
+ const controller = new AbortController();
158
+ inflight.set(id, controller);
159
+ try {
160
+ reply(id, await callTool(params.arguments ?? {}, controller.signal));
161
+ } catch (error) {
162
+ reply(id, { content: [{ type: "text", text: (error as Error).message }], isError: true });
163
+ } finally {
164
+ inflight.delete(id);
165
+ }
166
+ return;
167
+ }
168
+ replyError(id, -32601, `Unknown method "${String(method)}"`);
169
+ }
170
+
171
+ // Requests are serialized: a capture's state is a plain map, and two overlapping
172
+ // calls (launch + stop) would interleave mutations on it.
173
+ let queue: Promise<void> = Promise.resolve();
174
+ /** Calls running right now, so a cancellation can reach the one it names. */
175
+ const inflight = new Map<unknown, AbortController>();
176
+ createInterface({ input: process.stdin }).on("line", (line) => {
177
+ const text = line.trim();
178
+ if (text.length === 0) return;
179
+ let message: Record<string, unknown>;
180
+ try {
181
+ message = JSON.parse(text) as Record<string, unknown>;
182
+ } catch {
183
+ replyError(null, -32700, "Parse error");
184
+ return;
185
+ }
186
+ // Handled here rather than in handle(): the queue serializes calls, so a
187
+ // cancellation queued behind the very call it targets could never arrive in
188
+ // time. It is a notification, so nothing is sent back.
189
+ if (message.method === "notifications/cancelled") {
190
+ const requestId = (message.params as { requestId?: unknown } | undefined)?.requestId;
191
+ inflight.get(requestId)?.abort();
192
+ return;
193
+ }
194
+ queue = queue.then(() => handle(message)).catch((error: unknown) => {
195
+ console.error("xcodebug-mcp:", error);
196
+ });
197
+ });
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "xcodebug",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
+ "type": "module",
4
5
  "description": "Build, install and launch an iOS app on a physical device and read its console inside the agent session (pi / omp extension)",
5
6
  "keywords": [
6
7
  "pi-package",
@@ -26,6 +27,7 @@
26
27
  },
27
28
  "files": [
28
29
  "*.ts",
30
+ "mcp/",
29
31
  "README.md",
30
32
  "GUIDE.md",
31
33
  "LICENSE"
package/xcode.ts CHANGED
@@ -7,9 +7,9 @@
7
7
  */
8
8
  import { mkdir, writeFile } from "node:fs/promises";
9
9
  import { dirname, join } from "node:path";
10
- import { asRecord, asString, lastLines, runCommand, timestamp } from "./exec";
11
- import { BuildProgressTracker, formatProgress } from "./progress";
12
- import type { DeviceInfo } from "./devices";
10
+ import { asRecord, asString, lastLines, runCommand, timestamp } from "./exec.ts";
11
+ import { BuildProgressTracker, formatProgress } from "./progress.ts";
12
+ import type { DeviceInfo } from "./devices.ts";
13
13
 
14
14
  export interface BuildTarget {
15
15
  workspace?: string;
@@ -105,7 +105,12 @@ export async function buildForDevice(
105
105
  },
106
106
  });
107
107
  clearInterval(heartbeat);
108
- await writeFile(logFile, `$ xcodebuild ${args.join(" ")}\n\n${result.stdout}\n${result.stderr}`);
108
+ // Say so when the cap cut the head: a log that silently starts mid-build reads
109
+ // like a truncated file the user has to explain away.
110
+ const dropped = result.truncated
111
+ ? "[xcodebug] output exceeded the size cap; the beginning was dropped and this log keeps the tail.\n\n"
112
+ : "";
113
+ await writeFile(logFile, `$ xcodebuild ${args.join(" ")}\n\n${dropped}${result.stdout}\n${result.stderr}`);
109
114
 
110
115
  const durationMs = Date.now() - started;
111
116
  if (result.code !== 0) {