@ait-co/devtools 0.1.117 → 0.1.119
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/dist/attach-orchestrator-CFotueL3.js +1749 -0
- package/dist/attach-orchestrator-CFotueL3.js.map +1 -0
- package/dist/attach-orchestrator-CII9Gl5m.js +2797 -0
- package/dist/attach-orchestrator-CII9Gl5m.js.map +1 -0
- package/dist/attach-orchestrator-C_6xb_L5.js +3 -0
- package/dist/attach-orchestrator-DEJfLm7V.js +1749 -0
- package/dist/attach-orchestrator-DEJfLm7V.js.map +1 -0
- package/dist/{cli-CvUNQKqw.js → attach-orchestrator-qFEMBUwb.js} +3 -805
- package/dist/attach-orchestrator-qFEMBUwb.js.map +1 -0
- package/dist/{bundle-KFs4t-wc.d.ts → bundle-CA1TCXED.d.ts} +1 -1
- package/dist/bundle-CA1TCXED.d.ts.map +1 -0
- package/dist/capture-BmK_cBqQ.d.ts +58 -0
- package/dist/capture-BmK_cBqQ.d.ts.map +1 -0
- package/dist/{cdp-connection-C0AP0tH2.d.ts → cdp-connection-DB2zgthr.d.ts} +1 -1
- package/dist/{cdp-connection-C0AP0tH2.d.ts.map → cdp-connection-DB2zgthr.d.ts.map} +1 -1
- package/dist/cell-BJiaGlVu.js +3 -0
- package/dist/cell-BPWZUm_X.js +85 -0
- package/dist/cell-BPWZUm_X.js.map +1 -0
- package/dist/cell-Cv3e_qwn.js +84 -0
- package/dist/cell-Cv3e_qwn.js.map +1 -0
- package/dist/cell-bLwQ4gTq.js +85 -0
- package/dist/cell-bLwQ4gTq.js.map +1 -0
- package/dist/cell-nrWFeqvG.js +84 -0
- package/dist/cell-nrWFeqvG.js.map +1 -0
- package/dist/cli-RhzASQef.js +1057 -0
- package/dist/cli-RhzASQef.js.map +1 -0
- package/dist/debug-server-BhHVy3XT.js +1191 -0
- package/dist/debug-server-BhHVy3XT.js.map +1 -0
- package/dist/{debug-server-jrI9U_f4.js → debug-server-Bi6jLuY6.js} +467 -2989
- package/dist/debug-server-Bi6jLuY6.js.map +1 -0
- package/dist/debug-server-Buc8yoa7.js +1909 -0
- package/dist/debug-server-Buc8yoa7.js.map +1 -0
- package/dist/{debug-server-BvrESnaV.js → debug-server-C_5ag9jj.js} +5 -3
- package/dist/debug-server-C_5ag9jj.js.map +1 -0
- package/dist/mcp/cli.js +3 -2
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/{pool-htlVnEFl.d.ts → pool-U9FrxEuR.d.ts} +5 -5
- package/dist/{pool-htlVnEFl.d.ts.map → pool-U9FrxEuR.d.ts.map} +1 -1
- package/dist/relay-factory-DVI7TrX4.js +69 -0
- package/dist/relay-factory-DVI7TrX4.js.map +1 -0
- package/dist/relay-secret-store-BcVrWwTq.js +153 -0
- package/dist/relay-secret-store-BcVrWwTq.js.map +1 -0
- package/dist/{relay-secret-store-BHcOmaNK.js → relay-secret-store-BlFEhqwb.js} +1 -1
- package/dist/{relay-secret-store-CmqchhR5.js → relay-secret-store-CFc9n0OA.js} +1 -1
- package/dist/{relay-secret-store-CmqchhR5.js.map → relay-secret-store-CFc9n0OA.js.map} +1 -1
- package/dist/{relay-secret-store-CkA7KNUb.js → relay-secret-store-CmDDfZMh.js} +2 -2
- package/dist/{relay-secret-store-CkA7KNUb.js.map → relay-secret-store-CmDDfZMh.js.map} +1 -1
- package/dist/relay-secret-store-DNPJKHNs.js +153 -0
- package/dist/relay-secret-store-DNPJKHNs.js.map +1 -0
- package/dist/relay-url-store-CdA58fgw.js +122 -0
- package/dist/relay-url-store-CdA58fgw.js.map +1 -0
- package/dist/{relay-url-store-C0qukm3R.js → relay-url-store-CnL2zwbH.js} +2 -2
- package/dist/{relay-url-store-C0qukm3R.js.map → relay-url-store-CnL2zwbH.js.map} +1 -1
- package/dist/{relay-url-store-NDtEcOE-.js → relay-url-store-DGQ-HPQC.js} +2 -2
- package/dist/{relay-url-store-NDtEcOE-.js.map → relay-url-store-DGQ-HPQC.js.map} +1 -1
- package/dist/relay-url-store-Dv5HSzwb.js +122 -0
- package/dist/relay-url-store-Dv5HSzwb.js.map +1 -0
- package/dist/{relay-worker-DWW4vZxU.d.ts → relay-worker-D-3aAyDO.d.ts} +28 -4
- package/dist/relay-worker-D-3aAyDO.d.ts.map +1 -0
- package/dist/{runtime-BU-iMHz6.d.ts → runtime-D57Rtnsd.d.ts} +1 -1
- package/dist/{runtime-BU-iMHz6.d.ts.map → runtime-D57Rtnsd.d.ts.map} +1 -1
- package/dist/test-runner/bundle.d.ts +1 -1
- package/dist/test-runner/bundle.js +45 -27
- package/dist/test-runner/bundle.js.map +1 -1
- package/dist/test-runner/capture.d.ts +2 -0
- package/dist/test-runner/capture.js +44 -0
- package/dist/test-runner/capture.js.map +1 -0
- package/dist/test-runner/cli.d.ts +85 -12
- package/dist/test-runner/cli.d.ts.map +1 -1
- package/dist/test-runner/cli.js +2 -2
- package/dist/test-runner/config.d.ts +76 -2
- package/dist/test-runner/config.d.ts.map +1 -1
- package/dist/test-runner/config.js +4 -2
- package/dist/test-runner/config.js.map +1 -1
- package/dist/test-runner/pool.d.ts +1 -1
- package/dist/test-runner/relay-factory.d.ts +11136 -0
- package/dist/test-runner/relay-factory.d.ts.map +1 -0
- package/dist/test-runner/relay-factory.js +69 -0
- package/dist/test-runner/relay-factory.js.map +1 -0
- package/dist/test-runner/relay-worker.d.ts +1 -1
- package/dist/test-runner/relay-worker.js +66 -20
- package/dist/test-runner/relay-worker.js.map +1 -1
- package/dist/test-runner/report.d.ts +106 -0
- package/dist/test-runner/report.d.ts.map +1 -0
- package/dist/test-runner/report.js +139 -0
- package/dist/test-runner/report.js.map +1 -0
- package/dist/test-runner/rpc.d.ts +2 -2
- package/dist/test-runner/runtime.d.ts +1 -1
- package/dist/test-runner/task-graph.d.ts +1 -1
- package/dist/{totp-D70zD5tJ.js → totp-0bvlo9Yb.js} +1 -1
- package/dist/{totp-D70zD5tJ.js.map → totp-0bvlo9Yb.js.map} +1 -1
- package/dist/totp-DfekTBk3.js +211 -0
- package/dist/totp-DfekTBk3.js.map +1 -0
- package/dist/totp-zGIlDsZS.js +3 -0
- package/package.json +1 -1
- package/dist/bundle-KFs4t-wc.d.ts.map +0 -1
- package/dist/cli-CvUNQKqw.js.map +0 -1
- package/dist/debug-server-BvrESnaV.js.map +0 -1
- package/dist/debug-server-jrI9U_f4.js.map +0 -1
- package/dist/relay-worker-DWW4vZxU.d.ts.map +0 -1
- package/dist/totp-D104cJQN.js +0 -3
|
@@ -345,6 +345,44 @@ interface BundleOptions {
|
|
|
345
345
|
globalName?: string;
|
|
346
346
|
}
|
|
347
347
|
//#endregion
|
|
348
|
+
//#region src/test-runner/capture.d.ts
|
|
349
|
+
/**
|
|
350
|
+
* `__AIT_CAPTURE__` console-line parser (devtools#696).
|
|
351
|
+
*
|
|
352
|
+
* env3 test runs inject sdk-example's `aitCapture.ts`, which — when running in a
|
|
353
|
+
* WebView (no filesystem) — emits one `console.log` line per category in the
|
|
354
|
+
* stable form:
|
|
355
|
+
*
|
|
356
|
+
* __AIT_CAPTURE__ <category> <json>
|
|
357
|
+
*
|
|
358
|
+
* The relay-worker harvests `Runtime.consoleAPICalled` events as plain text
|
|
359
|
+
* lines (see `relay-worker.ts`) and hands them here. This module's only job is
|
|
360
|
+
* to recognise the allowlisted prefix, split off the category, and keep the
|
|
361
|
+
* remaining JSON string OPAQUE — devtools does NOT own or interpret the
|
|
362
|
+
* `__AIT_CAPTURE__` record shape (that lives in sdk-example). We carry
|
|
363
|
+
* `{ category, json }` through untouched so the 2.x↔3.0 line comparison stays a
|
|
364
|
+
* downstream concern.
|
|
365
|
+
*
|
|
366
|
+
* Why a strict allowlist prefix (SECRET-HANDLING): the raw console stream may
|
|
367
|
+
* also contain wss/scheme/relay noise lines. Only lines that EXACTLY start with
|
|
368
|
+
* `'__AIT_CAPTURE__ '` pass; everything else is discarded, so a stray relay URL
|
|
369
|
+
* can never be serialised into a capture artifact.
|
|
370
|
+
*
|
|
371
|
+
* react-free, dependency-free — safe to import from any test-runner entry
|
|
372
|
+
* without dragging in the chii/cloudflared Node graph.
|
|
373
|
+
*/
|
|
374
|
+
/**
|
|
375
|
+
* One parsed capture line. `json` is the raw JSON string exactly as the page
|
|
376
|
+
* emitted it (an array of sdk-example capture records). devtools treats it as
|
|
377
|
+
* opaque — it is validated as parseable JSON but never inspected.
|
|
378
|
+
*/
|
|
379
|
+
interface AitCaptureLine {
|
|
380
|
+
/** The capture category (first whitespace-delimited token after the prefix). */
|
|
381
|
+
category: string;
|
|
382
|
+
/** The remaining JSON payload, verbatim. Opaque to devtools. */
|
|
383
|
+
json: string;
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
348
386
|
//#region src/test-runner/runtime.d.ts
|
|
349
387
|
/**
|
|
350
388
|
* Thin test runtime for WebView execution.
|
|
@@ -418,6 +456,17 @@ interface RelayRunReport {
|
|
|
418
456
|
skipped: number;
|
|
419
457
|
total: number;
|
|
420
458
|
};
|
|
459
|
+
/**
|
|
460
|
+
* `__AIT_CAPTURE__` lines harvested from the page console during the run
|
|
461
|
+
* (additive field, devtools#696). Empty unless `collectCaptures` was set.
|
|
462
|
+
* Each entry is opaque (`{ category, json }`) — devtools does not interpret
|
|
463
|
+
* the record shape, only forwards it for downstream 2.x↔3.0 diffing.
|
|
464
|
+
*
|
|
465
|
+
* SECRET-HANDLING: only lines matching the `__AIT_CAPTURE__ ` allowlist
|
|
466
|
+
* prefix reach here; relay/wss/scheme noise lines are dropped in
|
|
467
|
+
* `parseCaptureLines`.
|
|
468
|
+
*/
|
|
469
|
+
captures: AitCaptureLine[];
|
|
421
470
|
}
|
|
422
471
|
/** Options for `runTestFilesOverRelay`. */
|
|
423
472
|
interface RelayRunOptions {
|
|
@@ -430,6 +479,18 @@ interface RelayRunOptions {
|
|
|
430
479
|
* Increase for long-running suites or split the file.
|
|
431
480
|
*/
|
|
432
481
|
timeoutMs?: number;
|
|
482
|
+
/**
|
|
483
|
+
* When `true`, registers a live `Runtime.consoleAPICalled` listener for the
|
|
484
|
+
* duration of the run and harvests `__AIT_CAPTURE__` lines into
|
|
485
|
+
* `RelayRunReport.captures`. Defaults to **false** so the build-only
|
|
486
|
+
* eval/e2e path (and the Vitest pool) pay no listener/state overhead —
|
|
487
|
+
* `captures` is then an empty array.
|
|
488
|
+
*
|
|
489
|
+
* The listener is registered just BEFORE the first file runs and removed in a
|
|
490
|
+
* `finally` so it never accumulates across runs (no ring-buffer drain — the
|
|
491
|
+
* default 500-entry buffer would silently drop lines via `shift`).
|
|
492
|
+
*/
|
|
493
|
+
collectCaptures?: boolean;
|
|
433
494
|
}
|
|
434
495
|
//#endregion
|
|
435
496
|
//#region src/test-runner/cli.d.ts
|
|
@@ -445,30 +506,42 @@ interface RunWithConnectionOptions extends RelayRunOptions {
|
|
|
445
506
|
* separate from `main()` so tests can call it without spawning a subprocess.
|
|
446
507
|
*/
|
|
447
508
|
declare function runWithConnection(connection: CdpConnection, files: string[], opts?: RunWithConnectionOptions): Promise<RelayRunReport>;
|
|
509
|
+
/**
|
|
510
|
+
* Decides whether to suppress the QR/attach block on stdout.
|
|
511
|
+
*
|
|
512
|
+
* Suppress when EITHER the user passed `--no-qr-stdout`, OR stdout is not a TTY
|
|
513
|
+
* / `CI` is set / `AIT_NO_QR_STDOUT` is set (non-interactive — a captured stdout
|
|
514
|
+
* must not leak the relay wss + TOTP `at=` code that the QR block encodes). The
|
|
515
|
+
* suppression is whole-chunk: `attachUrl` AND `relayUrl` ride in the same block.
|
|
516
|
+
*
|
|
517
|
+
* Exported for unit testing.
|
|
518
|
+
*/
|
|
519
|
+
declare function shouldSuppressQr(noQrFlag: boolean): boolean;
|
|
448
520
|
/**
|
|
449
521
|
* CLI entry point.
|
|
450
522
|
*
|
|
451
|
-
* Performs a standalone relay attach → run lifecycle
|
|
523
|
+
* Performs a standalone relay attach → run lifecycle, sharing the attach
|
|
524
|
+
* assembly with the Vitest pool via `createRelayConnectionFactory` (single
|
|
525
|
+
* source — no drift):
|
|
452
526
|
*
|
|
453
527
|
* 1. Parse args: globs, --timeout, --cell-sdk-line, --cell-platform,
|
|
454
|
-
* --scheme-url (required for env3), --
|
|
528
|
+
* --scheme-url (required for env3), --report-dir, --no-qr-stdout,
|
|
529
|
+
* --headless, --project-root.
|
|
455
530
|
* 2. Discover test files; exit 1 if none.
|
|
456
|
-
* 3.
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
* 8. runWithConnection(conn, files, { timeoutMs, printSummary: true }).
|
|
462
|
-
* 9. family.stop(); process.exitCode = failed > 0 ? 1 : 0.
|
|
531
|
+
* 3. factory.open() — boot relay → render QR (suppressed on non-interactive
|
|
532
|
+
* stdout) → wait for phone → inject cell → enableDomains. Returns the conn.
|
|
533
|
+
* 4. runWithConnection(conn, files, { timeoutMs, collectCaptures, printSummary }).
|
|
534
|
+
* 5. With --report-dir: write the runner-agnostic report + capture files.
|
|
535
|
+
* 6. factory.close(); process.exitCode = failed > 0 ? 1 : 0.
|
|
463
536
|
*
|
|
464
537
|
* The CLI is not a daemon — no lock, router, SSE, or tools_list is needed.
|
|
465
538
|
* Attach timeout exits with code 1; test failures exit with code 1.
|
|
466
539
|
*
|
|
467
540
|
* SECRET-HANDLING: scheme_url / relay wssUrl / TOTP codes are never written to
|
|
468
|
-
* stdout/stderr directly.
|
|
469
|
-
*
|
|
541
|
+
* stdout/stderr directly. The QR block (which encodes the TOTP `at=` code) is
|
|
542
|
+
* printed only when stdout is interactive AND not suppressed.
|
|
470
543
|
*/
|
|
471
544
|
declare function main(argv?: string[]): Promise<void>;
|
|
472
545
|
//#endregion
|
|
473
|
-
export { RunWithConnectionOptions, main, runWithConnection };
|
|
546
|
+
export { RunWithConnectionOptions, main, runWithConnection, shouldSuppressQr };
|
|
474
547
|
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -1 +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,IAAA;AAAA;;UAIe,4BAAA;EACf,SAAA;EACA,QAAA;IACE,GAAA;IACA,MAAA;IACA,UAAA;IACA,QAAA;EAAA;EAEF,SAAA;EACA,IAAA;AAAA;;;;;UAOe,YAAA;EACf,YAAA;EACA,QAAA;EACA,GAAA;EACA,UAAA;EACA,YAAA;AAAA;;UAIe,2BAAA;EAcD;EAZd,SAAA;EACA,gBAAA;IACE,WAAA;IACA,IAAA;IACA,UAAA;IACA,YAAA;IACA,QAAA;IACA,GAAA;IACA,UAAA;MACE,UAAA,EAAY,YAAA;IAAA,GAShB;IANE,SAAA,GAAY,eAAA;EAAA;AAAA;;UAKC,WAAA;EACf,0BAAA,EAA4B,qBAAA;EAC5B,2BAAA,EAA6B,6BAAA;EAC7B,0BAAA,EAA4B,4BAAA;EAC5B,yBAAA,EAA2B,2BAAA;AAAA;AAAA,KAGjB,YAAA,SAAqB,WAAA;;UAOhB,UAAA;EACf,MAAA;EADe;EAGf,QAAA;E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,MAAA,GAAS,aAAA,CAAc,CAAA,cACtB,OAAA,CAAQ,aAAA,CAAc,CAAA;EAnBR;;;;;;EA2BjB,KAAA;EArB0C;;;;;;;;;EAgC1C,cAAA,KAAmB,OAAA,CAAQ,SAAA;EA7B0C;;;;;;;;;;;EA0CrE,kBAAA,EACE,QAAA,GAAW,OAAA,EAAS,SAAA,gBACpB,SAAA,WACA,cAAA,YACC,OAAA,CAAQ,SAAA;AAAA;;;;AArRb;;;;;;;;;AAUA;;;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;AAeA;AAAA,UCPiB,aAAA;;;;;;;EAOf,cAAA;EDME;;;;ECDF,UAAA;AAAA;;;;ADzDF;;;;;;;;;AAUA;;;;;;;;;;;AASA;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/mcp/cdp-connection.ts","../../src/test-runner/bundle.ts","../../src/test-runner/capture.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,IAAA;AAAA;;UAIe,4BAAA;EACf,SAAA;EACA,QAAA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EGbd,KAAA;AAAA;;UAIe,SAAA;EHaC;EGXhB,SAAA;EHiBe;EGff,QAAA;EACA,MAAA;EACA,MAAA;EACA,OAAA;EACA,KAAA,EAAO,UAAA;AAAA;;;;UC1BQ,UAAA;EJmBqB;EIjBpC,IAAA;EJyBmB;EIvBnB,MAAA,EAAQ,SAAA;IAAc,KAAA;EAAA;AAAA;;UAIP,cAAA;EJmBb;EIjBF,SAAA;EJkBI;EIhBJ,QAAA;EJkBI;EIhBJ,KAAA,EAAO,UAAA;EJiBS;EIfhB,MAAA;IACE,MAAA;IACA,MAAA;IACA,OAAA;IACA,KAAA;EAAA;EJmBF;;;;;;;;;;EIPA,QAAA,EAAU,cAAA;AAAA;;UAIK,eAAA;EJiBf;;;EIbA,aAAA,GAAgB,aAAA;EJiBd;;;;EIZF,SAAA;EJgBI;AAON;;;;;;;;;;EIXE,eAAA;AAAA;;;;UCHe,wBAAA,SAAiC,eAAA;ELzChD;EK2CA,YAAA;AAAA;;;ALrCF;;;;iBK8CsB,iBAAA,CACpB,UAAA,EAAY,aAAA,EACZ,KAAA,YACA,IAAA,GAAO,wBAAA,GACN,OAAA,CAAQ,cAAA;;;;;;;;;;;iBA2BK,gBAAA,CAAiB,QAAA;;;AL3DjC;;;;;;;;;;;;;;;AAeA;;;;;;;iBK6EsB,IAAA,CAAK,IAAA,cAAyC,OAAA"}
|
package/dist/test-runner/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as runWithConnection, t as main } from "../cli-
|
|
3
|
-
export { main, runWithConnection };
|
|
2
|
+
import { n as runWithConnection, r as shouldSuppressQr, t as main } from "../cli-RhzASQef.js";
|
|
3
|
+
export { main, runWithConnection, shouldSuppressQr };
|
|
@@ -1,5 +1,71 @@
|
|
|
1
|
-
import { i as createRelayPool, n as RelayConnectionFactory, t as RELAY_POOL_NAME } from "../pool-
|
|
1
|
+
import { i as createRelayPool, n as RelayConnectionFactory, t as RELAY_POOL_NAME } from "../pool-U9FrxEuR.js";
|
|
2
2
|
|
|
3
|
+
//#region src/test-runner/relay-factory.d.ts
|
|
4
|
+
/** Options for {@link createRelayConnectionFactory}. */
|
|
5
|
+
interface RelayConnectionFactoryOptions {
|
|
6
|
+
/**
|
|
7
|
+
* intoss-private:// scheme URL from `ait deploy --scheme-only` (env3). The
|
|
8
|
+
* phone cold-loads the candidate bundle this URL points at. SECRET-HANDLING:
|
|
9
|
+
* never logged.
|
|
10
|
+
*/
|
|
11
|
+
schemeUrl: string;
|
|
12
|
+
/**
|
|
13
|
+
* Project root for the `.ait_relay` secret lookup (read-only). Defaults to
|
|
14
|
+
* `process.cwd()`.
|
|
15
|
+
*/
|
|
16
|
+
projectRoot?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Attach wait timeout in ms — how long `open()` waits for the phone to scan
|
|
19
|
+
* the QR and attach. Defaults to 600 000 (10 min) to give time for a manual
|
|
20
|
+
* scan. (The per-file evaluate timeout is separate, passed via the pool's
|
|
21
|
+
* `run` options.)
|
|
22
|
+
*/
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
/** Disable browser auto-open of the QR dashboard (text QR only). */
|
|
25
|
+
headless?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Cell axes injected as `__AIT_CELL__` before the first test bundle runs, so
|
|
28
|
+
* sdk-example's capture picks up the correct sdkLine/platform. Optional — when
|
|
29
|
+
* omitted no cell is injected. The values are not secrets.
|
|
30
|
+
*/
|
|
31
|
+
cell?: {
|
|
32
|
+
sdkLine: string;
|
|
33
|
+
platform: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Receives the QR/attach render content (text chunks) from
|
|
37
|
+
* `renderAndMaybeWait`, so the caller decides whether to print them — e.g.
|
|
38
|
+
* suppress on non-interactive stdout.
|
|
39
|
+
*
|
|
40
|
+
* REQUIRED (not optional) on purpose: these chunks contain the QR payload
|
|
41
|
+
* (which encodes the relay wss + TOTP `at=` code) and the attach JSON block.
|
|
42
|
+
* Making the hook mandatory means the factory never falls back to printing
|
|
43
|
+
* them itself — a downstream `vitest.config.ts` consumer that wires this via
|
|
44
|
+
* the `@ait-co/devtools/test-runner` barrel is forced to make an explicit
|
|
45
|
+
* stdout decision rather than silently leaking the secret-bearing block.
|
|
46
|
+
*
|
|
47
|
+
* SECRET-HANDLING: when a non-interactive caller is detected the hook MUST
|
|
48
|
+
* suppress the WHOLE chunk (not just `attachUrl`), since `relayUrl` rides in
|
|
49
|
+
* the same block.
|
|
50
|
+
*/
|
|
51
|
+
onQrContent: (textChunks: string[]) => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Builds a {@link RelayConnectionFactory} that opens a standalone env3 relay
|
|
55
|
+
* connection.
|
|
56
|
+
*
|
|
57
|
+
* `open()` performs the full attach lifecycle and BLOCKS for tens of seconds (up
|
|
58
|
+
* to `timeoutMs`) while a human scans the rendered QR with their phone — there
|
|
59
|
+
* is no way around the manual scan for env3. It resolves with the live
|
|
60
|
+
* `CdpConnection` once a matching page attaches; `close()` tears the relay
|
|
61
|
+
* family down.
|
|
62
|
+
*
|
|
63
|
+
* The factory holds the booted relay family in a closure so `close()` can stop
|
|
64
|
+
* it. A second `open()` on the same factory boots a fresh family (the previous
|
|
65
|
+
* one should have been `close()`d first).
|
|
66
|
+
*/
|
|
67
|
+
declare function createRelayConnectionFactory(opts: RelayConnectionFactoryOptions): RelayConnectionFactory;
|
|
68
|
+
//#endregion
|
|
3
69
|
//#region src/test-runner/config.d.ts
|
|
4
70
|
/**
|
|
5
71
|
* Resolved phone-test configuration returned by `definePhoneTestConfig`.
|
|
@@ -58,6 +124,14 @@ interface PhoneVitestUserConfig extends PhoneTestUserConfig {
|
|
|
58
124
|
* never stores or logs those values.
|
|
59
125
|
*/
|
|
60
126
|
connection: RelayConnectionFactory;
|
|
127
|
+
/**
|
|
128
|
+
* When `true`, the relay pool harvests `__AIT_CAPTURE__` console lines during
|
|
129
|
+
* the run (forwarded as `collectCaptures` to `runTestFilesOverRelay`), so
|
|
130
|
+
* `RelayRunReport.captures` is populated; a downstream consumer persists the
|
|
131
|
+
* artifacts (pool-side artifact writing + cell-meta wiring lands in PR-S1).
|
|
132
|
+
* Omitted/`false` = no capture harvest (build-only, zero listener overhead).
|
|
133
|
+
*/
|
|
134
|
+
collectCaptures?: boolean;
|
|
61
135
|
}
|
|
62
136
|
/**
|
|
63
137
|
* Build the Vitest `test` config slice for running tests on a device over the
|
|
@@ -76,5 +150,5 @@ interface PhoneVitestUserConfig extends PhoneTestUserConfig {
|
|
|
76
150
|
*/
|
|
77
151
|
declare function definePhoneVitestConfig(userConfig: PhoneVitestUserConfig): PhoneVitestTestConfig;
|
|
78
152
|
//#endregion
|
|
79
|
-
export { PhoneTestConfig, PhoneTestUserConfig, PhoneVitestTestConfig, PhoneVitestUserConfig, RELAY_POOL_NAME, type RelayConnectionFactory, createRelayPool, definePhoneTestConfig, definePhoneVitestConfig };
|
|
153
|
+
export { PhoneTestConfig, PhoneTestUserConfig, PhoneVitestTestConfig, PhoneVitestUserConfig, RELAY_POOL_NAME, type RelayConnectionFactory, type RelayConnectionFactoryOptions, createRelayConnectionFactory, createRelayPool, definePhoneTestConfig, definePhoneVitestConfig };
|
|
80
154
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","names":[],"sources":["../../src/test-runner/config.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"config.d.ts","names":[],"sources":["../../src/test-runner/relay-factory.ts","../../src/test-runner/config.ts"],"mappings":";;;;UAgDiB,6BAAA;ECFA;;;;;EDQf,SAAA;ECLA;;;AAgBF;EDNE,WAAA;;;;;;;EAOA,SAAA;ECae;EDXf,QAAA;;;;;;EAMA,IAAA;IAAS,OAAA;IAAiB,QAAA;EAAA;ECeX;;;;;;;;;;AAkCjB;;;;;;EDhCE,WAAA,GAAc,UAAA;AAAA;;;;;;;;;;;;;;;iBAiBA,4BAAA,CACd,IAAA,EAAM,6BAAA,GACL,sBAAA;;;;;;UClFc,eAAA;EDkFd;;;;EC7ED,OAAA;;AALF;;EASE,SAAA;EAT8B;;;;EAc9B,cAAA;AAAA;AAIF;AAAA,UAAiB,mBAAA;EACf,OAAA;EACA,SAAA;EACA,cAAA;AAAA;;;;AAgBF;;;;iBAAgB,qBAAA,CAAsB,UAAA,GAAa,mBAAA,GAAsB,eAAA;;;;;AAczE;;UAAiB,qBAAA;EAEC;EAAhB,IAAA,EAAM,UAAA,QAAkB,eAAA;EAAlB;EAEN,OAAA;EAAA;EAEA,WAAA;AAAA;;UAIe,qBAAA,SAA8B,mBAAA;EAAR;;;;;;;EAQrC,UAAA,EAAY,sBAAA;EAQG;AAkBjB;;;;;;EAlBE,eAAA;AAAA;;;;;;;;;;;;;;;;iBAkBc,uBAAA,CAAwB,UAAA,EAAY,qBAAA,GAAwB,qBAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RELAY_POOL_NAME, createRelayPool } from "./pool.js";
|
|
2
|
+
import { t as createRelayConnectionFactory } from "../relay-factory-DVI7TrX4.js";
|
|
2
3
|
//#region src/test-runner/config.ts
|
|
3
4
|
const DEFAULT_CONFIG = {
|
|
4
5
|
include: ["**/*.ait.test.ts"],
|
|
@@ -41,7 +42,8 @@ function definePhoneVitestConfig(userConfig) {
|
|
|
41
42
|
connection: userConfig.connection,
|
|
42
43
|
run: {
|
|
43
44
|
timeoutMs: resolved.timeoutMs,
|
|
44
|
-
bundleOptions: { extraExternals: resolved.extraExternals }
|
|
45
|
+
bundleOptions: { extraExternals: resolved.extraExternals },
|
|
46
|
+
collectCaptures: userConfig.collectCaptures === true
|
|
45
47
|
}
|
|
46
48
|
}),
|
|
47
49
|
include: resolved.include,
|
|
@@ -49,6 +51,6 @@ function definePhoneVitestConfig(userConfig) {
|
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
//#endregion
|
|
52
|
-
export { RELAY_POOL_NAME, createRelayPool, definePhoneTestConfig, definePhoneVitestConfig };
|
|
54
|
+
export { RELAY_POOL_NAME, createRelayConnectionFactory, createRelayPool, definePhoneTestConfig, definePhoneVitestConfig };
|
|
53
55
|
|
|
54
56
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../../src/test-runner/config.ts"],"sourcesContent":["/**\n * Configuration helper for phone-relay test runs.\n *\n * `definePhoneTestConfig` is the user-facing entry point for configuring the\n * relay test runner. It mirrors the pattern of Vitest's `defineConfig` so\n * users can write:\n *\n * // ait-test.config.ts\n * import { definePhoneTestConfig } from '@ait-co/devtools/test-runner';\n * export default definePhoneTestConfig({ ... });\n *\n * The helper resolves user config and, when given a relay connection factory,\n * builds the Vitest `pool` (`createRelayPool`) so Vitest's own config\n * resolution routes matching files to the device over the relay (#645). Without\n * a connection factory it still returns the resolved config for use with the\n * lower-level `runTestFilesOverRelay` transport (#644).\n */\n\nimport type { RelayConnectionFactory } from './pool.js';\nimport { createRelayPool, RELAY_POOL_NAME } from './pool.js';\n\n/**\n * Resolved phone-test configuration returned by `definePhoneTestConfig`.\n */\nexport interface PhoneTestConfig {\n /**\n * Glob patterns (relative to cwd) for test files to run on the device.\n * Defaults to `['**\\/*.ait.test.ts']`.\n */\n include: string[];\n /**\n * Per-file evaluate timeout in milliseconds. Defaults to 30 000.\n */\n timeoutMs: number;\n /**\n * Additional esbuild `external` patterns for bundling.\n * The SDK package is always external; add more here if needed.\n */\n extraExternals: string[];\n}\n\n/** User-facing config shape accepted by `definePhoneTestConfig`. */\nexport interface PhoneTestUserConfig {\n include?: string[];\n timeoutMs?: number;\n extraExternals?: string[];\n}\n\nconst DEFAULT_CONFIG: PhoneTestConfig = {\n include: ['**/*.ait.test.ts'],\n timeoutMs: 30_000,\n extraExternals: [],\n};\n\n/**\n * Define a phone-relay test configuration.\n *\n * Merges user overrides with sensible defaults and returns a resolved\n * `PhoneTestConfig`. This object can be passed to `runTestFilesOverRelay`\n * (via the CLI or custom scripts) to run tests on a real device WebView.\n */\nexport function definePhoneTestConfig(userConfig?: PhoneTestUserConfig): PhoneTestConfig {\n return {\n include: userConfig?.include ?? DEFAULT_CONFIG.include,\n timeoutMs: userConfig?.timeoutMs ?? DEFAULT_CONFIG.timeoutMs,\n extraExternals: userConfig?.extraExternals ?? DEFAULT_CONFIG.extraExternals,\n };\n}\n\n/**\n * The slice of a Vitest `test` config this helper produces — `pool`,\n * `include`, and `testTimeout`. Typed structurally (not against Vitest's\n * `InlineConfig`) so consumers can spread it into their own `defineConfig`\n * without this module taking a value dependency on `vitest`.\n */\nexport interface PhoneVitestTestConfig {\n /** The relay `PoolRunnerInitializer`, matched by `getFilePoolName`. */\n pool: ReturnType<typeof createRelayPool>;\n /** Glob patterns for device test files. */\n include: string[];\n /** Per-test timeout in ms (mirrors the relay per-file evaluate timeout). */\n testTimeout: number;\n}\n\n/** User config accepted by {@link definePhoneVitestConfig}. */\nexport interface PhoneVitestUserConfig extends PhoneTestUserConfig {\n /**\n * Opens/closes the CDP relay connection that tests run over. Required —\n * without it there is no device to dispatch files to.\n *\n * SECRET-HANDLING: the factory owns the relay wss/TOTP; this config object\n * never stores or logs those values.\n */\n connection: RelayConnectionFactory;\n}\n\n/**\n * Build the Vitest `test` config slice for running tests on a device over the\n * relay. Spread the result into your Vitest config:\n *\n * @example\n * // vitest.config.ts\n * import { defineConfig } from 'vitest/config';\n * import { definePhoneVitestConfig } from '@ait-co/devtools/test-runner';\n * export default defineConfig({\n * test: definePhoneVitestConfig({ connection: myRelayFactory }),\n * });\n *\n * Files matching `include` are dispatched to the relay pool (named\n * {@link RELAY_POOL_NAME}); everything else runs in Vitest's default pool.\n */\nexport function definePhoneVitestConfig(userConfig: PhoneVitestUserConfig): PhoneVitestTestConfig {\n const resolved = definePhoneTestConfig(userConfig);\n return {\n pool: createRelayPool({\n connection: userConfig.connection,\n run: {\n timeoutMs: resolved.timeoutMs,\n bundleOptions: { extraExternals: resolved.extraExternals },\n },\n }),\n include: resolved.include,\n testTimeout: resolved.timeoutMs,\n };\n}\n\nexport type { RelayConnectionFactory };\nexport { createRelayPool, RELAY_POOL_NAME };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../../src/test-runner/config.ts"],"sourcesContent":["/**\n * Configuration helper for phone-relay test runs.\n *\n * `definePhoneTestConfig` is the user-facing entry point for configuring the\n * relay test runner. It mirrors the pattern of Vitest's `defineConfig` so\n * users can write:\n *\n * // ait-test.config.ts\n * import { definePhoneTestConfig } from '@ait-co/devtools/test-runner';\n * export default definePhoneTestConfig({ ... });\n *\n * The helper resolves user config and, when given a relay connection factory,\n * builds the Vitest `pool` (`createRelayPool`) so Vitest's own config\n * resolution routes matching files to the device over the relay (#645). Without\n * a connection factory it still returns the resolved config for use with the\n * lower-level `runTestFilesOverRelay` transport (#644).\n */\n\nimport type { RelayConnectionFactory } from './pool.js';\nimport { createRelayPool, RELAY_POOL_NAME } from './pool.js';\nimport {\n createRelayConnectionFactory,\n type RelayConnectionFactoryOptions,\n} from './relay-factory.js';\n\n/**\n * Resolved phone-test configuration returned by `definePhoneTestConfig`.\n */\nexport interface PhoneTestConfig {\n /**\n * Glob patterns (relative to cwd) for test files to run on the device.\n * Defaults to `['**\\/*.ait.test.ts']`.\n */\n include: string[];\n /**\n * Per-file evaluate timeout in milliseconds. Defaults to 30 000.\n */\n timeoutMs: number;\n /**\n * Additional esbuild `external` patterns for bundling.\n * The SDK package is always external; add more here if needed.\n */\n extraExternals: string[];\n}\n\n/** User-facing config shape accepted by `definePhoneTestConfig`. */\nexport interface PhoneTestUserConfig {\n include?: string[];\n timeoutMs?: number;\n extraExternals?: string[];\n}\n\nconst DEFAULT_CONFIG: PhoneTestConfig = {\n include: ['**/*.ait.test.ts'],\n timeoutMs: 30_000,\n extraExternals: [],\n};\n\n/**\n * Define a phone-relay test configuration.\n *\n * Merges user overrides with sensible defaults and returns a resolved\n * `PhoneTestConfig`. This object can be passed to `runTestFilesOverRelay`\n * (via the CLI or custom scripts) to run tests on a real device WebView.\n */\nexport function definePhoneTestConfig(userConfig?: PhoneTestUserConfig): PhoneTestConfig {\n return {\n include: userConfig?.include ?? DEFAULT_CONFIG.include,\n timeoutMs: userConfig?.timeoutMs ?? DEFAULT_CONFIG.timeoutMs,\n extraExternals: userConfig?.extraExternals ?? DEFAULT_CONFIG.extraExternals,\n };\n}\n\n/**\n * The slice of a Vitest `test` config this helper produces — `pool`,\n * `include`, and `testTimeout`. Typed structurally (not against Vitest's\n * `InlineConfig`) so consumers can spread it into their own `defineConfig`\n * without this module taking a value dependency on `vitest`.\n */\nexport interface PhoneVitestTestConfig {\n /** The relay `PoolRunnerInitializer`, matched by `getFilePoolName`. */\n pool: ReturnType<typeof createRelayPool>;\n /** Glob patterns for device test files. */\n include: string[];\n /** Per-test timeout in ms (mirrors the relay per-file evaluate timeout). */\n testTimeout: number;\n}\n\n/** User config accepted by {@link definePhoneVitestConfig}. */\nexport interface PhoneVitestUserConfig extends PhoneTestUserConfig {\n /**\n * Opens/closes the CDP relay connection that tests run over. Required —\n * without it there is no device to dispatch files to.\n *\n * SECRET-HANDLING: the factory owns the relay wss/TOTP; this config object\n * never stores or logs those values.\n */\n connection: RelayConnectionFactory;\n /**\n * When `true`, the relay pool harvests `__AIT_CAPTURE__` console lines during\n * the run (forwarded as `collectCaptures` to `runTestFilesOverRelay`), so\n * `RelayRunReport.captures` is populated; a downstream consumer persists the\n * artifacts (pool-side artifact writing + cell-meta wiring lands in PR-S1).\n * Omitted/`false` = no capture harvest (build-only, zero listener overhead).\n */\n collectCaptures?: boolean;\n}\n\n/**\n * Build the Vitest `test` config slice for running tests on a device over the\n * relay. Spread the result into your Vitest config:\n *\n * @example\n * // vitest.config.ts\n * import { defineConfig } from 'vitest/config';\n * import { definePhoneVitestConfig } from '@ait-co/devtools/test-runner';\n * export default defineConfig({\n * test: definePhoneVitestConfig({ connection: myRelayFactory }),\n * });\n *\n * Files matching `include` are dispatched to the relay pool (named\n * {@link RELAY_POOL_NAME}); everything else runs in Vitest's default pool.\n */\nexport function definePhoneVitestConfig(userConfig: PhoneVitestUserConfig): PhoneVitestTestConfig {\n const resolved = definePhoneTestConfig(userConfig);\n return {\n pool: createRelayPool({\n connection: userConfig.connection,\n run: {\n timeoutMs: resolved.timeoutMs,\n bundleOptions: { extraExternals: resolved.extraExternals },\n // Harvest captures only when explicitly opted in — keeps the build-only\n // path free of the live console listener (#696).\n collectCaptures: userConfig.collectCaptures === true,\n },\n }),\n include: resolved.include,\n testTimeout: resolved.timeoutMs,\n };\n}\n\nexport type { RelayConnectionFactory, RelayConnectionFactoryOptions };\n// Re-exported so a downstream `vitest.config.ts` can build the connection\n// factory straight from the `@ait-co/devtools/test-runner` barrel. relay-factory\n// keeps its heavy MCP graph behind dynamic imports, so this static re-export does\n// NOT drag chii/cloudflared/tools onto this Node-config entry (verified by\n// scripts/check-test-runner-dist.sh).\nexport { createRelayConnectionFactory, createRelayPool, RELAY_POOL_NAME };\n"],"mappings":";;;AAoDA,MAAM,iBAAkC;CACtC,SAAS,CAAC,mBAAmB;CAC7B,WAAW;CACX,gBAAgB,EAAE;CACnB;;;;;;;;AASD,SAAgB,sBAAsB,YAAmD;AACvF,QAAO;EACL,SAAS,YAAY,WAAW,eAAe;EAC/C,WAAW,YAAY,aAAa,eAAe;EACnD,gBAAgB,YAAY,kBAAkB,eAAe;EAC9D;;;;;;;;;;;;;;;;;AAqDH,SAAgB,wBAAwB,YAA0D;CAChG,MAAM,WAAW,sBAAsB,WAAW;AAClD,QAAO;EACL,MAAM,gBAAgB;GACpB,YAAY,WAAW;GACvB,KAAK;IACH,WAAW,SAAS;IACpB,eAAe,EAAE,gBAAgB,SAAS,gBAAgB;IAG1D,iBAAiB,WAAW,oBAAoB;IACjD;GACF,CAAC;EACF,SAAS,SAAS;EAClB,aAAa,SAAS;EACvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as createRelayPool, n as RelayConnectionFactory, r as RelayPoolOptions, t as RELAY_POOL_NAME } from "../pool-
|
|
1
|
+
import { i as createRelayPool, n as RelayConnectionFactory, r as RelayPoolOptions, t as RELAY_POOL_NAME } from "../pool-U9FrxEuR.js";
|
|
2
2
|
export { RELAY_POOL_NAME, RelayConnectionFactory, RelayPoolOptions, createRelayPool };
|