@ait-co/devtools 0.1.106 → 0.1.108

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.
Files changed (91) hide show
  1. package/dist/bundle-BJm5jk56.d.ts +49 -0
  2. package/dist/bundle-BJm5jk56.d.ts.map +1 -0
  3. package/dist/cdp-connection-C0AP0tH2.d.ts +277 -0
  4. package/dist/cdp-connection-C0AP0tH2.d.ts.map +1 -0
  5. package/dist/in-app/auto.d.ts +17 -0
  6. package/dist/in-app/auto.d.ts.map +1 -1
  7. package/dist/in-app/auto.js +76 -0
  8. package/dist/in-app/auto.js.map +1 -1
  9. package/dist/in-app/index.d.ts +48 -1
  10. package/dist/in-app/index.d.ts.map +1 -1
  11. package/dist/in-app/index.js +60 -1
  12. package/dist/in-app/index.js.map +1 -1
  13. package/dist/mcp/cli.js +507 -11
  14. package/dist/mcp/cli.js.map +1 -1
  15. package/dist/mcp/server.d.ts.map +1 -1
  16. package/dist/mcp/server.js +60 -3
  17. package/dist/mcp/server.js.map +1 -1
  18. package/dist/panel/index.js +1 -1
  19. package/dist/pool-Dkp7I9Bf.d.ts +14577 -0
  20. package/dist/pool-Dkp7I9Bf.d.ts.map +1 -0
  21. package/dist/{relay-secret-store-I5q2Wvvv.cjs → relay-secret-store-CPBBlV3J.cjs} +2 -2
  22. package/dist/{relay-secret-store-I5q2Wvvv.cjs.map → relay-secret-store-CPBBlV3J.cjs.map} +1 -1
  23. package/dist/{relay-secret-store-Bns5rndt.js → relay-secret-store-DBwzoCXQ.js} +2 -2
  24. package/dist/{relay-secret-store-Bns5rndt.js.map → relay-secret-store-DBwzoCXQ.js.map} +1 -1
  25. package/dist/{relay-secret-store-B0DH-8Qb.js → relay-secret-store-DhzAnnj-.js} +2 -2
  26. package/dist/{relay-secret-store-B0DH-8Qb.js.map → relay-secret-store-DhzAnnj-.js.map} +1 -1
  27. package/dist/{relay-url-store-CvmnevcO.cjs → relay-url-store-C9QLhB2p.cjs} +2 -2
  28. package/dist/{relay-url-store-CvmnevcO.cjs.map → relay-url-store-C9QLhB2p.cjs.map} +1 -1
  29. package/dist/{relay-url-store-BPeUZsiY.js → relay-url-store-CwKT7i04.js} +2 -2
  30. package/dist/{relay-url-store-BPeUZsiY.js.map → relay-url-store-CwKT7i04.js.map} +1 -1
  31. package/dist/{relay-url-store-DJHZjk8o.js → relay-url-store-j16TRTiJ.js} +2 -2
  32. package/dist/{relay-url-store-DJHZjk8o.js.map → relay-url-store-j16TRTiJ.js.map} +1 -1
  33. package/dist/relay-worker-BzFQ3fv9.d.ts +74 -0
  34. package/dist/relay-worker-BzFQ3fv9.d.ts.map +1 -0
  35. package/dist/runtime-ORdrpizY.d.ts +50 -0
  36. package/dist/runtime-ORdrpizY.d.ts.map +1 -0
  37. package/dist/test-runner/bundle.d.ts +2 -0
  38. package/dist/test-runner/bundle.js +95 -0
  39. package/dist/test-runner/bundle.js.map +1 -0
  40. package/dist/test-runner/cli.d.ts +417 -0
  41. package/dist/test-runner/cli.d.ts.map +1 -0
  42. package/dist/test-runner/cli.js +377 -0
  43. package/dist/test-runner/cli.js.map +1 -0
  44. package/dist/test-runner/config.d.ts +80 -0
  45. package/dist/test-runner/config.d.ts.map +1 -0
  46. package/dist/test-runner/config.js +54 -0
  47. package/dist/test-runner/config.js.map +1 -0
  48. package/dist/test-runner/pool.d.ts +2 -0
  49. package/dist/test-runner/pool.js +136 -0
  50. package/dist/test-runner/pool.js.map +1 -0
  51. package/dist/test-runner/relay-worker.d.ts +2 -0
  52. package/dist/test-runner/relay-worker.js +96 -0
  53. package/dist/test-runner/relay-worker.js.map +1 -0
  54. package/dist/test-runner/rpc.d.ts +53 -0
  55. package/dist/test-runner/rpc.d.ts.map +1 -0
  56. package/dist/test-runner/rpc.js +78 -0
  57. package/dist/test-runner/rpc.js.map +1 -0
  58. package/dist/test-runner/task-graph.d.ts +38 -0
  59. package/dist/test-runner/task-graph.d.ts.map +1 -0
  60. package/dist/test-runner/task-graph.js +182 -0
  61. package/dist/test-runner/task-graph.js.map +1 -0
  62. package/dist/{totp-BmKSPb5d.js → totp-95OAa20j.js} +2 -2
  63. package/dist/totp-95OAa20j.js.map +1 -0
  64. package/dist/{totp-BwDZ6dUT.cjs → totp-BjtoQNfu.cjs} +2 -2
  65. package/dist/totp-BjtoQNfu.cjs.map +1 -0
  66. package/dist/totp-D1pulXLa.js +3 -0
  67. package/dist/{totp-DYdP9N3o.js → totp-DIbrZtI7.js} +2 -2
  68. package/dist/totp-DIbrZtI7.js.map +1 -0
  69. package/dist/{totp-CNw0w89F.cjs → totp-Df252ZdA.cjs} +2 -2
  70. package/dist/totp-Df252ZdA.cjs.map +1 -0
  71. package/dist/{totp-Xq3ACwkm.js → totp-WY6l0ysP.js} +2 -2
  72. package/dist/totp-WY6l0ysP.js.map +1 -0
  73. package/dist/{tunnel-BmDcTrnU.js → tunnel-BjJROkcj.js} +2 -2
  74. package/dist/{tunnel-BmDcTrnU.js.map → tunnel-BjJROkcj.js.map} +1 -1
  75. package/dist/{tunnel-RB5zB8IK.cjs → tunnel-d_G9AIFn.cjs} +2 -2
  76. package/dist/{tunnel-RB5zB8IK.cjs.map → tunnel-d_G9AIFn.cjs.map} +1 -1
  77. package/dist/unplugin/index.cjs +4 -4
  78. package/dist/unplugin/index.d.cts +13 -32
  79. package/dist/unplugin/index.d.cts.map +1 -1
  80. package/dist/unplugin/index.d.ts +13 -32
  81. package/dist/unplugin/index.d.ts.map +1 -1
  82. package/dist/unplugin/index.js +4 -4
  83. package/dist/unplugin/tunnel.cjs +1 -1
  84. package/dist/unplugin/tunnel.js +1 -1
  85. package/package.json +13 -3
  86. package/dist/totp-BcBNRoDD.js +0 -3
  87. package/dist/totp-BmKSPb5d.js.map +0 -1
  88. package/dist/totp-BwDZ6dUT.cjs.map +0 -1
  89. package/dist/totp-CNw0w89F.cjs.map +0 -1
  90. package/dist/totp-DYdP9N3o.js.map +0 -1
  91. package/dist/totp-Xq3ACwkm.js.map +0 -1
@@ -0,0 +1,417 @@
1
+
2
+ //#region src/mcp/cdp-connection.d.ts
3
+ /**
4
+ * Injectable CDP connection abstraction for the debug-mode MCP server.
5
+ *
6
+ * The Phase 1 tool layer (`list_console_messages`, `list_network_requests`,
7
+ * `list_pages`) reads from CDP events captured off a Chii relay connection.
8
+ * To keep that tool layer CI-verifiable without a phone roundtrip, the actual
9
+ * relay websocket sits behind this interface. Production wires
10
+ * `ChiiCdpConnection` (see `chii-connection.ts`); tests inject a fake that
11
+ * emits canned `Runtime.consoleAPICalled` / `Network.*` events.
12
+ *
13
+ * Phase 2 adds CDP *commands* (request→response): `DOM.getDocument`,
14
+ * `DOMSnapshot.captureSnapshot`, `Page.captureScreenshot`. Unlike Phase 1's
15
+ * event streams these need a `send(method, params)` round-trip, so the
16
+ * connection grows a typed `send`. The fake returns canned command results.
17
+ *
18
+ * Phase 2 extension: `Runtime.evaluate` (read-only probe) added for the
19
+ * `measure_safe_area` tool — executes a JS snippet on the attached page and
20
+ * returns the result as a `RemoteObject`. The fake returns canned results for
21
+ * unit tests without a phone roundtrip.
22
+ *
23
+ * Only the slice of the Chrome DevTools Protocol the tools need is typed here.
24
+ */
25
+ /** A target (page) the Chii relay currently sees attached. */
26
+ interface CdpTarget {
27
+ /** Chii's internal target id (session UUID). */
28
+ id: string;
29
+ /** Page title reported by the in-app target. */
30
+ title: string;
31
+ /** Page URL reported by the in-app target. */
32
+ url: string;
33
+ }
34
+ /** `Runtime.RemoteObject` subset we surface for console args. */
35
+ interface CdpRemoteObject {
36
+ type: string;
37
+ subtype?: string;
38
+ value?: unknown;
39
+ description?: string;
40
+ className?: string;
41
+ }
42
+ /** Payload of a `Runtime.consoleAPICalled` event. */
43
+ interface ConsoleApiCalledEvent {
44
+ /** log | warning | error | info | debug | … */
45
+ type: string;
46
+ args: CdpRemoteObject[];
47
+ /** Milliseconds since epoch (CDP `Runtime.Timestamp`). */
48
+ timestamp: number;
49
+ executionContextId?: number;
50
+ stackTrace?: {
51
+ callFrames: Array<{
52
+ functionName: string;
53
+ url: string;
54
+ lineNumber: number;
55
+ columnNumber: number;
56
+ }>;
57
+ };
58
+ }
59
+ /** Payload of a `Network.requestWillBeSent` event (subset). */
60
+ interface NetworkRequestWillBeSentEvent {
61
+ requestId: string;
62
+ request: {
63
+ url: string;
64
+ method: string;
65
+ headers?: Record<string, string>;
66
+ };
67
+ /** CDP `Network.MonotonicTime` (seconds). */
68
+ timestamp: number;
69
+ /** Wall-clock seconds since epoch, when available. */
70
+ wallTime?: number;
71
+ type?: string;
72
+ }
73
+ /** Payload of a `Network.responseReceived` event (subset). */
74
+ interface NetworkResponseReceivedEvent {
75
+ requestId: string;
76
+ response: {
77
+ url: string;
78
+ status: number;
79
+ statusText: string;
80
+ mimeType?: string;
81
+ };
82
+ timestamp: number;
83
+ type?: string;
84
+ }
85
+ /**
86
+ * A single call frame in a `Runtime.exceptionThrown` stack trace.
87
+ * Subset of the CDP `Runtime.CallFrame` shape.
88
+ */
89
+ interface CdpCallFrame {
90
+ functionName: string;
91
+ scriptId?: string;
92
+ url: string;
93
+ lineNumber: number;
94
+ columnNumber: number;
95
+ }
96
+ /** Payload of a `Runtime.exceptionThrown` event. */
97
+ interface RuntimeExceptionThrownEvent {
98
+ /** Milliseconds since epoch (CDP `Runtime.Timestamp`). */
99
+ timestamp: number;
100
+ exceptionDetails: {
101
+ exceptionId: number;
102
+ text: string;
103
+ lineNumber: number;
104
+ columnNumber: number;
105
+ scriptId?: string;
106
+ url?: string;
107
+ stackTrace?: {
108
+ callFrames: CdpCallFrame[];
109
+ }; /** The thrown value as a CDP `RemoteObject`. */
110
+ exception?: CdpRemoteObject;
111
+ };
112
+ }
113
+ /** Map of the CDP event names Phase 1 consumes to their payload shapes. */
114
+ interface CdpEventMap {
115
+ 'Runtime.consoleAPICalled': ConsoleApiCalledEvent;
116
+ 'Network.requestWillBeSent': NetworkRequestWillBeSentEvent;
117
+ 'Network.responseReceived': NetworkResponseReceivedEvent;
118
+ 'Runtime.exceptionThrown': RuntimeExceptionThrownEvent;
119
+ }
120
+ type CdpEventName = keyof CdpEventMap;
121
+ /** A `DOM.Node` subset (recursive) returned by `DOM.getDocument`. */
122
+ interface CdpDomNode {
123
+ nodeId: number;
124
+ /** CDP node type (1 = element, 3 = text, 9 = document, …). */
125
+ nodeType: number;
126
+ nodeName: string;
127
+ /** Tag/local name for elements. */
128
+ localName?: string;
129
+ nodeValue?: string;
130
+ /** Flattened attribute list: `[name, value, name, value, …]`. */
131
+ attributes?: string[];
132
+ childNodeCount?: number;
133
+ children?: CdpDomNode[];
134
+ documentURL?: string;
135
+ baseURL?: string;
136
+ }
137
+ /** Result of `DOM.getDocument`. */
138
+ interface DomGetDocumentResult {
139
+ root: CdpDomNode;
140
+ }
141
+ /** Result of `DOMSnapshot.captureSnapshot` (subset we surface). */
142
+ interface DomSnapshotResult {
143
+ documents: unknown[];
144
+ strings: string[];
145
+ }
146
+ /** Result of `Page.captureScreenshot`. */
147
+ interface PageCaptureScreenshotResult {
148
+ /** Base64-encoded image bytes (PNG by default). */
149
+ data: string;
150
+ }
151
+ /**
152
+ * Params for `Runtime.evaluate`.
153
+ * Covers the subset used by the `measure_safe_area` read-only probe.
154
+ */
155
+ interface RuntimeEvaluateParams {
156
+ /** JavaScript expression to evaluate in the page context. */
157
+ expression: string;
158
+ /** Return the result as a plain JSON value (vs. a handle). Default false. */
159
+ returnByValue?: boolean;
160
+ /** Await a returned Promise before resolving. Default false. */
161
+ awaitPromise?: boolean;
162
+ }
163
+ /** Result of `Runtime.evaluate`. */
164
+ interface RuntimeEvaluateResult {
165
+ /** The evaluation result. */
166
+ result: CdpRemoteObject;
167
+ /** Present when evaluation threw an uncaught exception. */
168
+ exceptionDetails?: {
169
+ text: string;
170
+ exception?: CdpRemoteObject;
171
+ };
172
+ }
173
+ /**
174
+ * Map of CDP command method → params/result shape. Keeps `send` typed so a
175
+ * `DOM.getDocument` call resolves to a `DomGetDocumentResult`, etc.
176
+ */
177
+ interface CdpCommandMap {
178
+ 'DOM.getDocument': {
179
+ params: {
180
+ depth?: number;
181
+ pierce?: boolean;
182
+ };
183
+ result: DomGetDocumentResult;
184
+ };
185
+ 'DOMSnapshot.captureSnapshot': {
186
+ params: {
187
+ computedStyles?: string[];
188
+ };
189
+ result: DomSnapshotResult;
190
+ };
191
+ 'Page.captureScreenshot': {
192
+ params: {
193
+ format?: 'png' | 'jpeg' | 'webp';
194
+ quality?: number;
195
+ };
196
+ result: PageCaptureScreenshotResult;
197
+ };
198
+ 'Runtime.evaluate': {
199
+ params: RuntimeEvaluateParams;
200
+ result: RuntimeEvaluateResult;
201
+ };
202
+ }
203
+ type CdpCommandName = keyof CdpCommandMap;
204
+ /**
205
+ * The connection the tool layer reads from. The production implementation
206
+ * wraps the Chii relay's CDP websocket; tests inject a fake.
207
+ *
208
+ * Implementations are expected to maintain an internal ring buffer of recent
209
+ * events (so a tool call returns recent history rather than only live events).
210
+ */
211
+ interface CdpConnection {
212
+ /**
213
+ * Authoritative kind of this connection's transport (issue #348).
214
+ *
215
+ * - `'relay'` — backed by the Chii relay + cloudflared tunnel (a real-device
216
+ * WebView, env 3/4). `ChiiCdpConnection`.
217
+ * - `'local'` — backed by a direct CDP websocket to a local Chromium (env 1).
218
+ * `LocalCdpConnection`.
219
+ *
220
+ * This replaces the old `getEnvironment()` URL-pattern sniffing: the
221
+ * `mock` vs `relay` split is now a free, authoritative property of the
222
+ * connection itself, known before any target attaches. The `relay-dev` vs
223
+ * `relay-live` distinction is orthogonal (operator-supplied `liveIntent`,
224
+ * see `environment.ts`) because dog-food and production relays are
225
+ * byte-identical on the wire.
226
+ */
227
+ readonly kind: 'relay' | 'local';
228
+ /**
229
+ * Enable the CDP domains Phase 1 needs (`Runtime.enable`, `Network.enable`).
230
+ * Idempotent. Resolves once the relay has acknowledged (or immediately for a
231
+ * fake connection).
232
+ */
233
+ enableDomains(): Promise<void>;
234
+ /** Targets (pages) the relay currently sees attached. */
235
+ listTargets(): CdpTarget[];
236
+ /** Recent buffered events for a domain, oldest-first. */
237
+ getBufferedEvents<E extends CdpEventName>(event: E): ReadonlyArray<CdpEventMap[E]>;
238
+ /** Subscribe to live events. Returns an unsubscribe function. */
239
+ on<E extends CdpEventName>(event: E, listener: (payload: CdpEventMap[E]) => void): () => void;
240
+ /**
241
+ * Issue a CDP command (request → response). Phase 2's DOM/snapshot/screenshot
242
+ * tools use this; resolves with the typed result or rejects on a CDP error.
243
+ * Implementations must have called {@link enableDomains} first.
244
+ */
245
+ send<M extends CdpCommandName>(method: M, params?: CdpCommandMap[M]['params']): Promise<CdpCommandMap[M]['result']>;
246
+ /**
247
+ * Close the underlying transport and reject any in-flight commands.
248
+ * Optional so that minimal test fakes that don't need teardown remain
249
+ * compatible without change. Both `ChiiCdpConnection` and
250
+ * `LocalCdpConnection` already implement this.
251
+ */
252
+ close?(): void;
253
+ /**
254
+ * Refresh the attached-target list from the relay and return the result.
255
+ * Emits an internal `'target:attached'` event when a new target appears so
256
+ * that {@link waitForFirstTarget} can race against the polling round.
257
+ *
258
+ * Optional — only `ChiiCdpConnection` (relay mode) supports this; local
259
+ * connections and test fakes may omit it. Callers should guard with
260
+ * `connection.refreshTargets?.()`.
261
+ */
262
+ refreshTargets?(): Promise<CdpTarget[]>;
263
+ /**
264
+ * Waits until at least one target satisfying `filterFn` is attached, then
265
+ * resolves with the full target list at that moment.
266
+ *
267
+ * Optional — only `ChiiCdpConnection` provides the event-driven
268
+ * implementation. When absent, callers fall back to a generic polling loop.
269
+ *
270
+ * @param filterFn - Predicate the resolved targets must satisfy.
271
+ * @param timeoutMs - Reject after this many ms (default 90 000).
272
+ * @param pollIntervalMs - Fallback poll interval (default 500 ms).
273
+ */
274
+ waitForFirstTarget?(filterFn: (targets: CdpTarget[]) => boolean, timeoutMs?: number, pollIntervalMs?: number): Promise<CdpTarget[]>;
275
+ }
276
+ //#endregion
277
+ //#region src/test-runner/bundle.d.ts
278
+ /**
279
+ * esbuild-based bundler for user test files.
280
+ *
281
+ * Bundles a single test file into a self-contained IIFE string that can be
282
+ * injected into a WebView via `Runtime.evaluate`. The user's SDK imports
283
+ * (`@apps-in-toss/web-framework` and sub-paths) are intercepted via an
284
+ * esbuild plugin that redirects them to `window.__sdk`, which the in-app
285
+ * debug gate (`src/in-app/auto.ts`) installs as a namespace mirror of the
286
+ * SDK exports (works for both 2.x and 3.x SDK).
287
+ *
288
+ * SECRET-HANDLING: the returned bundle code is caller-managed; never log it.
289
+ */
290
+ /** Options accepted by `bundleTestFile`. */
291
+ interface BundleOptions {
292
+ /**
293
+ * Additional esbuild `external` patterns. The SDK package
294
+ * (`@apps-in-toss/web-framework` and `@apps-in-toss/web-framework/*`) is
295
+ * always handled by the SDK redirect plugin — callers may add more patterns
296
+ * to be left as globals.
297
+ */
298
+ extraExternals?: string[];
299
+ /**
300
+ * Global name for the IIFE output object. Defaults to `__testBundle`.
301
+ * The runtime entry uses this to call `__testBundle.runTestModule()`.
302
+ */
303
+ globalName?: string;
304
+ }
305
+ //#endregion
306
+ //#region src/test-runner/runtime.d.ts
307
+ /**
308
+ * Thin test runtime for WebView execution.
309
+ *
310
+ * This file is bundled by `bundle.ts` together with the user's test file
311
+ * into a single IIFE injected into the WebView via `Runtime.evaluate`.
312
+ * It MUST stay browser-compatible — no Node.js APIs allowed.
313
+ *
314
+ * Design: rather than shipping @vitest/runner verbatim into a WebView (where
315
+ * its Node-side internals cause issues), this runtime provides a minimal
316
+ * compatible API surface — describe/it/test/expect globals — collects results
317
+ * into a plain JSON-safe object, and exports `runTestModule` as the entry point.
318
+ *
319
+ * @vitest/runner and @vitest/expect are listed as dependencies so that the
320
+ * package's type contracts are available and so the browser-compatible subsets
321
+ * can be referenced. Full pool integration (PoolRunnerInitializer) is tracked
322
+ * in issue #645.
323
+ *
324
+ * NOTE: this file is imported by type from Node-side code (rpc.ts / relay-worker.ts)
325
+ * for the RunReport / TestResult type shapes. The runtime ITSELF is not imported
326
+ * at runtime on the Node side — only the types are used.
327
+ */
328
+ /**
329
+ * Result of a single test case.
330
+ * All fields are JSON-serialisable.
331
+ */
332
+ interface TestResult {
333
+ /** Full dot-joined test name including nested suite names. */
334
+ name: string;
335
+ /** `'pass'` or `'fail'`. `'skip'` for skipped tests. */
336
+ status: 'pass' | 'fail' | 'skip';
337
+ /** Duration in milliseconds. */
338
+ duration: number;
339
+ /** Error message (fail only). Does NOT include the expression/secret. */
340
+ error?: string;
341
+ }
342
+ /** Aggregate report returned by `runTestModule`. */
343
+ interface RunReport {
344
+ /** ISO timestamp of when `runTestModule` was called. */
345
+ startedAt: string;
346
+ /** Total elapsed milliseconds (wall-clock). */
347
+ duration: number;
348
+ passed: number;
349
+ failed: number;
350
+ skipped: number;
351
+ tests: TestResult[];
352
+ }
353
+ //#endregion
354
+ //#region src/test-runner/relay-worker.d.ts
355
+ /** Per-file result in the aggregate `RunReport`. */
356
+ interface FileResult {
357
+ /** Absolute or relative path to the test file. */
358
+ file: string;
359
+ /** Full run report for this file, or an error if bundling/injection failed. */
360
+ result: RunReport | {
361
+ error: string;
362
+ };
363
+ }
364
+ /** Aggregate report returned by `runTestFilesOverRelay`. */
365
+ interface RelayRunReport {
366
+ /** ISO timestamp of when the run started. */
367
+ startedAt: string;
368
+ /** Total elapsed wall-clock milliseconds. */
369
+ duration: number;
370
+ /** Per-file results in execution order. */
371
+ files: FileResult[];
372
+ /** Flattened totals across all files. */
373
+ totals: {
374
+ passed: number;
375
+ failed: number;
376
+ skipped: number;
377
+ total: number;
378
+ };
379
+ }
380
+ /** Options for `runTestFilesOverRelay`. */
381
+ interface RelayRunOptions {
382
+ /**
383
+ * Options forwarded to `bundleTestFile` for each file.
384
+ */
385
+ bundleOptions?: BundleOptions;
386
+ /**
387
+ * Per-file evaluate timeout in milliseconds. Defaults to 30 000.
388
+ * Increase for long-running suites or split the file.
389
+ */
390
+ timeoutMs?: number;
391
+ }
392
+ //#endregion
393
+ //#region src/test-runner/cli.d.ts
394
+ /** Options for `runWithConnection`. */
395
+ interface RunWithConnectionOptions extends RelayRunOptions {
396
+ /** If true, print a summary to stdout. Defaults to false in tests. */
397
+ printSummary?: boolean;
398
+ }
399
+ /**
400
+ * Runs `files` over `connection` and returns the aggregate report.
401
+ * This pure function is the testable core of the CLI; it is separate from
402
+ * `main()` so tests can call it without spawning a subprocess.
403
+ *
404
+ * TODO (#645): add real relay attach/detach lifecycle here (connect via
405
+ * Chii relay URL, call enableDomains, run, then close).
406
+ */
407
+ declare function runWithConnection(connection: CdpConnection, files: string[], opts?: RunWithConnectionOptions): Promise<RelayRunReport>;
408
+ /**
409
+ * CLI entry point.
410
+ *
411
+ * MVP: prints usage and a "relay attach required" notice. Real relay wiring
412
+ * (resolve CDP URL, attach, run, close) is tracked in issues #645 / #646.
413
+ */
414
+ declare function main(argv?: string[]): Promise<void>;
415
+ //#endregion
416
+ export { RunWithConnectionOptions, main, runWithConnection };
417
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/mcp/cdp-connection.ts","../../src/test-runner/bundle.ts","../../src/test-runner/runtime.ts","../../src/test-runner/relay-worker.ts","../../src/test-runner/cli.ts"],"mappings":";;;AAwBA;;;;;;;;;AAUA;;;;;;;;;;;AASA;;UAnBiB,SAAA;EA2BI;EAzBnB,EAAA;EAoBA;EAlBA,KAAA;EAoBA;EAlBA,GAAA;AAAA;;UAIe,eAAA;EACf,IAAA;EACA,OAAA;EACA,KAAA;EACA,WAAA;EACA,SAAA;AAAA;AAsBF;AAAA,UAlBiB,qBAAA;;EAEf,IAAA;EACA,IAAA,EAAM,eAAA;EAiBN;EAfA,SAAA;EACA,kBAAA;EACA,UAAA;IACE,UAAA,EAAY,KAAA;MACV,YAAA;MACA,GAAA;MACA,UAAA;MACA,YAAA;IAAA;EAAA;AAAA;;UAMW,6BAAA;EACf,SAAA;EACA,OAAA;IACE,GAAA;IACA,MAAA;IACA,OAAA,GAAU,MAAA;EAAA;EAkBZ;EAfA,SAAA;EAgBI;EAdJ,QAAA;EACA,I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