@ait-co/devtools 0.1.129 → 0.1.132
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-DvrgUIx7.js → attach-orchestrator-BiaYiNOr.js} +31 -13
- package/dist/{attach-orchestrator-DvrgUIx7.js.map → attach-orchestrator-BiaYiNOr.js.map} +1 -1
- package/dist/{attach-orchestrator-RhOdO3DS.js → attach-orchestrator-Cjdhir2U.js} +31 -13
- package/dist/{attach-orchestrator-RhOdO3DS.js.map → attach-orchestrator-Cjdhir2U.js.map} +1 -1
- package/dist/{attach-orchestrator-Bdt5Zdo9.js → attach-orchestrator-ca34r46y.js} +31 -13
- package/dist/{attach-orchestrator-Bdt5Zdo9.js.map → attach-orchestrator-ca34r46y.js.map} +1 -1
- package/dist/{cell-Ba9lCI3B.js → cell-Bi8MAPA8.js} +11 -7
- package/dist/cell-Bi8MAPA8.js.map +1 -0
- package/dist/{cell-DA_lcpDI.js → cell-Cw4fVOl2.js} +11 -7
- package/dist/cell-Cw4fVOl2.js.map +1 -0
- package/dist/{cell-DLRv4iG6.js → cell-rr6gL9AT.js} +11 -7
- package/dist/cell-rr6gL9AT.js.map +1 -0
- package/dist/{debug-server-e1qPe0ZB.js → debug-server-BBUzxZSf.js} +4 -4
- package/dist/{debug-server-e1qPe0ZB.js.map → debug-server-BBUzxZSf.js.map} +1 -1
- package/dist/{debug-server--Y0QZVJS.js → debug-server-Ch5p0ryv.js} +33 -11
- package/dist/debug-server-Ch5p0ryv.js.map +1 -0
- package/dist/{debug-server-Bu3pCG9c.js → debug-server-DoWAtTNj.js} +27 -9
- package/dist/debug-server-DoWAtTNj.js.map +1 -0
- package/dist/in-app/auto.js +15 -0
- package/dist/in-app/auto.js.map +1 -1
- package/dist/in-app/index.d.ts +27 -0
- package/dist/in-app/index.d.ts.map +1 -1
- package/dist/in-app/index.js +15 -0
- package/dist/in-app/index.js.map +1 -1
- package/dist/mcp/cli.js +211 -38
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/panel/index.js +11 -1
- package/dist/panel/index.js.map +1 -1
- package/dist/{pool-C0pc7T2p.d.ts → pool-BtLh7U1y.d.ts} +24 -2
- package/dist/{pool-C0pc7T2p.d.ts.map → pool-BtLh7U1y.d.ts.map} +1 -1
- package/dist/{qr-http-server-DM2R25jP.cjs → qr-http-server-DX_9UA-p.cjs} +77 -6
- package/dist/qr-http-server-DX_9UA-p.cjs.map +1 -0
- package/dist/{qr-http-server-HANhOFwI.js → qr-http-server-DeRrKp_R.js} +77 -6
- package/dist/qr-http-server-DeRrKp_R.js.map +1 -0
- package/dist/{qr-http-server-CrGohOwC.js → qr-http-server-FVn61xAq.js} +77 -6
- package/dist/qr-http-server-FVn61xAq.js.map +1 -0
- package/dist/{qr-http-server-s1iW_5VQ.js → qr-http-server-KB147M-S.js} +77 -6
- package/dist/qr-http-server-KB147M-S.js.map +1 -0
- package/dist/{qr-http-server-BH0UFeUn.js → qr-http-server-V0xuU5TJ.js} +77 -6
- package/dist/qr-http-server-V0xuU5TJ.js.map +1 -0
- package/dist/{qr-http-server-Bt_RAxFn.cjs → qr-http-server-iH_Hh_si.cjs} +77 -6
- package/dist/qr-http-server-iH_Hh_si.cjs.map +1 -0
- package/dist/{relay-factory-Ck3vBonr.js → relay-factory-cNgPfrWg.js} +39 -13
- package/dist/relay-factory-cNgPfrWg.js.map +1 -0
- package/dist/{relay-worker-o0M2ndyJ.d.ts → relay-worker-BMSnlyls.d.ts} +39 -2
- package/dist/relay-worker-BMSnlyls.d.ts.map +1 -0
- package/dist/{relay-worker-Bt0QYKQH.js → relay-worker-l34xNuci.js} +28 -7
- package/dist/relay-worker-l34xNuci.js.map +1 -0
- package/dist/test-runner/bin.js +202 -36
- package/dist/test-runner/bin.js.map +1 -1
- package/dist/test-runner/config.d.ts +15 -9
- package/dist/test-runner/config.d.ts.map +1 -1
- package/dist/test-runner/config.js +1 -1
- package/dist/test-runner/pool.d.ts +1 -1
- package/dist/test-runner/pool.js +1 -1
- package/dist/test-runner/pool.js.map +1 -1
- package/dist/test-runner/relay-factory.d.ts +36 -8
- package/dist/test-runner/relay-factory.d.ts.map +1 -1
- package/dist/test-runner/relay-factory.js +38 -12
- package/dist/test-runner/relay-factory.js.map +1 -1
- package/dist/test-runner/relay-worker.d.ts +2 -2
- package/dist/test-runner/relay-worker.js +2 -2
- package/dist/test-runner/report.d.ts +26 -4
- package/dist/test-runner/report.d.ts.map +1 -1
- package/dist/test-runner/report.js +41 -7
- package/dist/test-runner/report.js.map +1 -1
- package/dist/{tunnel-DyEV6WwL.cjs → tunnel-DP453L4e.cjs} +4 -3
- package/dist/{tunnel-DyEV6WwL.cjs.map → tunnel-DP453L4e.cjs.map} +1 -1
- package/dist/{tunnel-BFwOSwT4.js → tunnel-Djf-zmjJ.js} +4 -3
- package/dist/{tunnel-BFwOSwT4.js.map → tunnel-Djf-zmjJ.js.map} +1 -1
- package/dist/unplugin/index.cjs +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/unplugin/tunnel.cjs +3 -2
- package/dist/unplugin/tunnel.cjs.map +1 -1
- package/dist/unplugin/tunnel.d.cts.map +1 -1
- package/dist/unplugin/tunnel.d.ts.map +1 -1
- package/dist/unplugin/tunnel.js +3 -2
- package/dist/unplugin/tunnel.js.map +1 -1
- package/package.json +1 -1
- package/dist/cell-Ba9lCI3B.js.map +0 -1
- package/dist/cell-DA_lcpDI.js.map +0 -1
- package/dist/cell-DLRv4iG6.js.map +0 -1
- package/dist/debug-server--Y0QZVJS.js.map +0 -1
- package/dist/debug-server-Bu3pCG9c.js.map +0 -1
- package/dist/qr-http-server-BH0UFeUn.js.map +0 -1
- package/dist/qr-http-server-Bt_RAxFn.cjs.map +0 -1
- package/dist/qr-http-server-CrGohOwC.js.map +0 -1
- package/dist/qr-http-server-DM2R25jP.cjs.map +0 -1
- package/dist/qr-http-server-HANhOFwI.js.map +0 -1
- package/dist/qr-http-server-s1iW_5VQ.js.map +0 -1
- package/dist/relay-factory-Ck3vBonr.js.map +0 -1
- package/dist/relay-worker-Bt0QYKQH.js.map +0 -1
- package/dist/relay-worker-o0M2ndyJ.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildIndicatorExpression } from "./attach-orchestrator-
|
|
1
|
+
import { buildIndicatorExpression } from "./attach-orchestrator-BiaYiNOr.js";
|
|
2
2
|
//#region src/test-runner/cell.ts
|
|
3
3
|
/**
|
|
4
4
|
* Cell injection utility for the `devtools-test` CLI (issue #684 §4.1).
|
|
@@ -42,12 +42,16 @@ async function injectGlobals(conn, globals) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Injects the "Debugger Connected"
|
|
45
|
+
* Injects (or updates) the "Debugger Connected"/"Debugger Disconnected"
|
|
46
|
+
* on-phone indicator via `Runtime.evaluate` (#730).
|
|
46
47
|
*
|
|
47
48
|
* Uses the same CDP mechanism as {@link injectGlobals} — a single
|
|
48
49
|
* `Runtime.evaluate` round-trip with the expression built by
|
|
49
|
-
* {@link buildIndicatorExpression}. The indicator is a
|
|
50
|
-
*
|
|
50
|
+
* {@link buildIndicatorExpression}. The indicator is a LIVE badge rendered at
|
|
51
|
+
* the bottom-left of the page (position:fixed, safe-area-aware): the badge's
|
|
52
|
+
* controller is idempotent, so calling this again (e.g. right before
|
|
53
|
+
* `close()` with `{ state: 'disconnected' }`) UPDATES the existing badge in
|
|
54
|
+
* place instead of injecting a duplicate.
|
|
51
55
|
*
|
|
52
56
|
* **Isolation**: unlike {@link injectGlobals}, this function NEVER throws to
|
|
53
57
|
* its caller. Injection failure (e.g. page detached during inject, CSS not
|
|
@@ -57,12 +61,12 @@ async function injectGlobals(conn, globals) {
|
|
|
57
61
|
* `src/in-app/attach.ts`.
|
|
58
62
|
*
|
|
59
63
|
* Call this ONLY on the manual debug paths (start_attach MCP, devtools-test
|
|
60
|
-
* CLI). Do NOT call on the `run_tests` auto-attach path — the
|
|
64
|
+
* CLI). Do NOT call on the `run_tests` auto-attach path — the badge
|
|
61
65
|
* would contaminate screenshots, measure_safe_area probes, and DOM snapshots
|
|
62
66
|
* taken during automated measurement runs.
|
|
63
67
|
*
|
|
64
68
|
* SECRET-HANDLING: the injected expression contains no secrets, relay URLs,
|
|
65
|
-
* wss addresses, or TOTP codes — it is pure DOM UI text built by
|
|
69
|
+
* wss addresses, or TOTP codes — it is pure DOM UI text + enum state built by
|
|
66
70
|
* {@link buildIndicatorExpression}.
|
|
67
71
|
*
|
|
68
72
|
* @param conn - The live CDP connection (relay-attached page).
|
|
@@ -81,4 +85,4 @@ async function injectDebugIndicator(conn, opts) {
|
|
|
81
85
|
//#endregion
|
|
82
86
|
export { injectDebugIndicator, injectGlobals };
|
|
83
87
|
|
|
84
|
-
//# sourceMappingURL=cell-
|
|
88
|
+
//# sourceMappingURL=cell-Bi8MAPA8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-Bi8MAPA8.js","names":[],"sources":["../src/test-runner/cell.ts"],"sourcesContent":["/**\n * Cell injection utility for the `devtools-test` CLI (issue #684 §4.1).\n *\n * Injects arbitrary globals into the page via `Runtime.evaluate` BEFORE the\n * first test bundle is injected. The injected values are session-global — one\n * call covers all files in the run.\n *\n * The primary use-case is injecting `__AIT_CELL__` (sdkLine/platform) so\n * sdk-example's `aitCapture.ts` picks up the correct test-axis values instead\n * of falling back to `'2.x'`/`'mock'`.\n *\n * devtools does NOT know the shape of `__AIT_CELL__` — it only provides the\n * general injection mechanism. The caller (CLI or MCP auto-attach path) is\n * responsible for constructing the cell object.\n *\n * SECRET-HANDLING: cell values (sdkLine/platform) are not secrets and may be\n * logged at the caller's discretion. This module does NOT log them itself.\n *\n * Node-only. react-free. CdpConnection only.\n */\n\nimport { buildIndicatorExpression } from '../mcp/attach-orchestrator.js';\nimport type { CdpConnection } from '../mcp/cdp-connection.js';\n\n/**\n * Injects each key of `globals` into `globalThis` in the page via a single\n * `Runtime.evaluate` call. Must be called BEFORE the first `bundleTestFile`\n * inject — the cell is session-global and applies to all subsequent files.\n *\n * Throws if the CDP evaluate returns an exception.\n *\n * @param conn - The live CDP connection (relay-attached page).\n * @param globals - Plain-JSON-serialisable key→value map to assign onto `globalThis`.\n */\nexport async function injectGlobals(\n conn: CdpConnection,\n globals: Record<string, unknown>,\n): Promise<void> {\n // JSON.stringify is safe here: globals values are plain data (sdkLine/platform\n // strings or simple objects). If a value is not JSON-serialisable this throws\n // at call time, which surfaces the error early and clearly.\n const expr = `(() => { Object.assign(globalThis, ${JSON.stringify(globals)}); return true; })()`;\n const result = await conn.send('Runtime.evaluate', { expression: expr, returnByValue: true });\n if (result.exceptionDetails) {\n const msg =\n result.exceptionDetails.exception?.description ??\n result.exceptionDetails.text ??\n 'unknown error';\n throw new Error(`injectGlobals: Runtime.evaluate threw: ${msg}`);\n }\n}\n\n/**\n * Injects (or updates) the \"Debugger Connected\"/\"Debugger Disconnected\"\n * on-phone indicator via `Runtime.evaluate` (#730).\n *\n * Uses the same CDP mechanism as {@link injectGlobals} — a single\n * `Runtime.evaluate` round-trip with the expression built by\n * {@link buildIndicatorExpression}. The indicator is a LIVE badge rendered at\n * the bottom-left of the page (position:fixed, safe-area-aware): the badge's\n * controller is idempotent, so calling this again (e.g. right before\n * `close()` with `{ state: 'disconnected' }`) UPDATES the existing badge in\n * place instead of injecting a duplicate.\n *\n * **Isolation**: unlike {@link injectGlobals}, this function NEVER throws to\n * its caller. Injection failure (e.g. page detached during inject, CSS not\n * supported) is swallowed and logged as `console.debug` — the badge is\n * informational UI and must never block attach success or test execution.\n * This is the same fire-and-forget spirit as the in-page console mount in\n * `src/in-app/attach.ts`.\n *\n * Call this ONLY on the manual debug paths (start_attach MCP, devtools-test\n * CLI). Do NOT call on the `run_tests` auto-attach path — the badge\n * would contaminate screenshots, measure_safe_area probes, and DOM snapshots\n * taken during automated measurement runs.\n *\n * SECRET-HANDLING: the injected expression contains no secrets, relay URLs,\n * wss addresses, or TOTP codes — it is pure DOM UI text + enum state built by\n * {@link buildIndicatorExpression}.\n *\n * @param conn - The live CDP connection (relay-attached page).\n * @param opts - Optional overrides forwarded to {@link buildIndicatorExpression}.\n */\nexport async function injectDebugIndicator(\n conn: CdpConnection,\n opts?: { label?: string; disconnectedLabel?: string; state?: 'attached' | 'disconnected' },\n): Promise<void> {\n try {\n await conn.send('Runtime.evaluate', {\n expression: buildIndicatorExpression(opts),\n returnByValue: true,\n });\n } catch (err) {\n // Badge injection is informational UI — swallow and log; never propagate.\n console.debug('[@ait-co/devtools] debug indicator inject skipped:', err);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,cACpB,MACA,SACe;CAIf,MAAM,OAAO,sCAAsC,KAAK,UAAU,QAAQ,CAAC;CAC3E,MAAM,SAAS,MAAM,KAAK,KAAK,oBAAoB;EAAE,YAAY;EAAM,eAAe;EAAM,CAAC;AAC7F,KAAI,OAAO,kBAAkB;EAC3B,MAAM,MACJ,OAAO,iBAAiB,WAAW,eACnC,OAAO,iBAAiB,QACxB;AACF,QAAM,IAAI,MAAM,0CAA0C,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCpE,eAAsB,qBACpB,MACA,MACe;AACf,KAAI;AACF,QAAM,KAAK,KAAK,oBAAoB;GAClC,YAAY,yBAAyB,KAAK;GAC1C,eAAe;GAChB,CAAC;UACK,KAAK;AAEZ,UAAQ,MAAM,sDAAsD,IAAI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildIndicatorExpression } from "./attach-orchestrator-
|
|
1
|
+
import { buildIndicatorExpression } from "./attach-orchestrator-Cjdhir2U.js";
|
|
2
2
|
//#region src/test-runner/cell.ts
|
|
3
3
|
/**
|
|
4
4
|
* Cell injection utility for the `devtools-test` CLI (issue #684 §4.1).
|
|
@@ -42,12 +42,16 @@ async function injectGlobals(conn, globals) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Injects the "Debugger Connected"
|
|
45
|
+
* Injects (or updates) the "Debugger Connected"/"Debugger Disconnected"
|
|
46
|
+
* on-phone indicator via `Runtime.evaluate` (#730).
|
|
46
47
|
*
|
|
47
48
|
* Uses the same CDP mechanism as {@link injectGlobals} — a single
|
|
48
49
|
* `Runtime.evaluate` round-trip with the expression built by
|
|
49
|
-
* {@link buildIndicatorExpression}. The indicator is a
|
|
50
|
-
*
|
|
50
|
+
* {@link buildIndicatorExpression}. The indicator is a LIVE badge rendered at
|
|
51
|
+
* the bottom-left of the page (position:fixed, safe-area-aware): the badge's
|
|
52
|
+
* controller is idempotent, so calling this again (e.g. right before
|
|
53
|
+
* `close()` with `{ state: 'disconnected' }`) UPDATES the existing badge in
|
|
54
|
+
* place instead of injecting a duplicate.
|
|
51
55
|
*
|
|
52
56
|
* **Isolation**: unlike {@link injectGlobals}, this function NEVER throws to
|
|
53
57
|
* its caller. Injection failure (e.g. page detached during inject, CSS not
|
|
@@ -57,12 +61,12 @@ async function injectGlobals(conn, globals) {
|
|
|
57
61
|
* `src/in-app/attach.ts`.
|
|
58
62
|
*
|
|
59
63
|
* Call this ONLY on the manual debug paths (start_attach MCP, devtools-test
|
|
60
|
-
* CLI). Do NOT call on the `run_tests` auto-attach path — the
|
|
64
|
+
* CLI). Do NOT call on the `run_tests` auto-attach path — the badge
|
|
61
65
|
* would contaminate screenshots, measure_safe_area probes, and DOM snapshots
|
|
62
66
|
* taken during automated measurement runs.
|
|
63
67
|
*
|
|
64
68
|
* SECRET-HANDLING: the injected expression contains no secrets, relay URLs,
|
|
65
|
-
* wss addresses, or TOTP codes — it is pure DOM UI text built by
|
|
69
|
+
* wss addresses, or TOTP codes — it is pure DOM UI text + enum state built by
|
|
66
70
|
* {@link buildIndicatorExpression}.
|
|
67
71
|
*
|
|
68
72
|
* @param conn - The live CDP connection (relay-attached page).
|
|
@@ -81,4 +85,4 @@ async function injectDebugIndicator(conn, opts) {
|
|
|
81
85
|
//#endregion
|
|
82
86
|
export { injectDebugIndicator, injectGlobals };
|
|
83
87
|
|
|
84
|
-
//# sourceMappingURL=cell-
|
|
88
|
+
//# sourceMappingURL=cell-Cw4fVOl2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-Cw4fVOl2.js","names":[],"sources":["../src/test-runner/cell.ts"],"sourcesContent":["/**\n * Cell injection utility for the `devtools-test` CLI (issue #684 §4.1).\n *\n * Injects arbitrary globals into the page via `Runtime.evaluate` BEFORE the\n * first test bundle is injected. The injected values are session-global — one\n * call covers all files in the run.\n *\n * The primary use-case is injecting `__AIT_CELL__` (sdkLine/platform) so\n * sdk-example's `aitCapture.ts` picks up the correct test-axis values instead\n * of falling back to `'2.x'`/`'mock'`.\n *\n * devtools does NOT know the shape of `__AIT_CELL__` — it only provides the\n * general injection mechanism. The caller (CLI or MCP auto-attach path) is\n * responsible for constructing the cell object.\n *\n * SECRET-HANDLING: cell values (sdkLine/platform) are not secrets and may be\n * logged at the caller's discretion. This module does NOT log them itself.\n *\n * Node-only. react-free. CdpConnection only.\n */\n\nimport { buildIndicatorExpression } from '../mcp/attach-orchestrator.js';\nimport type { CdpConnection } from '../mcp/cdp-connection.js';\n\n/**\n * Injects each key of `globals` into `globalThis` in the page via a single\n * `Runtime.evaluate` call. Must be called BEFORE the first `bundleTestFile`\n * inject — the cell is session-global and applies to all subsequent files.\n *\n * Throws if the CDP evaluate returns an exception.\n *\n * @param conn - The live CDP connection (relay-attached page).\n * @param globals - Plain-JSON-serialisable key→value map to assign onto `globalThis`.\n */\nexport async function injectGlobals(\n conn: CdpConnection,\n globals: Record<string, unknown>,\n): Promise<void> {\n // JSON.stringify is safe here: globals values are plain data (sdkLine/platform\n // strings or simple objects). If a value is not JSON-serialisable this throws\n // at call time, which surfaces the error early and clearly.\n const expr = `(() => { Object.assign(globalThis, ${JSON.stringify(globals)}); return true; })()`;\n const result = await conn.send('Runtime.evaluate', { expression: expr, returnByValue: true });\n if (result.exceptionDetails) {\n const msg =\n result.exceptionDetails.exception?.description ??\n result.exceptionDetails.text ??\n 'unknown error';\n throw new Error(`injectGlobals: Runtime.evaluate threw: ${msg}`);\n }\n}\n\n/**\n * Injects (or updates) the \"Debugger Connected\"/\"Debugger Disconnected\"\n * on-phone indicator via `Runtime.evaluate` (#730).\n *\n * Uses the same CDP mechanism as {@link injectGlobals} — a single\n * `Runtime.evaluate` round-trip with the expression built by\n * {@link buildIndicatorExpression}. The indicator is a LIVE badge rendered at\n * the bottom-left of the page (position:fixed, safe-area-aware): the badge's\n * controller is idempotent, so calling this again (e.g. right before\n * `close()` with `{ state: 'disconnected' }`) UPDATES the existing badge in\n * place instead of injecting a duplicate.\n *\n * **Isolation**: unlike {@link injectGlobals}, this function NEVER throws to\n * its caller. Injection failure (e.g. page detached during inject, CSS not\n * supported) is swallowed and logged as `console.debug` — the badge is\n * informational UI and must never block attach success or test execution.\n * This is the same fire-and-forget spirit as the in-page console mount in\n * `src/in-app/attach.ts`.\n *\n * Call this ONLY on the manual debug paths (start_attach MCP, devtools-test\n * CLI). Do NOT call on the `run_tests` auto-attach path — the badge\n * would contaminate screenshots, measure_safe_area probes, and DOM snapshots\n * taken during automated measurement runs.\n *\n * SECRET-HANDLING: the injected expression contains no secrets, relay URLs,\n * wss addresses, or TOTP codes — it is pure DOM UI text + enum state built by\n * {@link buildIndicatorExpression}.\n *\n * @param conn - The live CDP connection (relay-attached page).\n * @param opts - Optional overrides forwarded to {@link buildIndicatorExpression}.\n */\nexport async function injectDebugIndicator(\n conn: CdpConnection,\n opts?: { label?: string; disconnectedLabel?: string; state?: 'attached' | 'disconnected' },\n): Promise<void> {\n try {\n await conn.send('Runtime.evaluate', {\n expression: buildIndicatorExpression(opts),\n returnByValue: true,\n });\n } catch (err) {\n // Badge injection is informational UI — swallow and log; never propagate.\n console.debug('[@ait-co/devtools] debug indicator inject skipped:', err);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,cACpB,MACA,SACe;CAIf,MAAM,OAAO,sCAAsC,KAAK,UAAU,QAAQ,CAAC;CAC3E,MAAM,SAAS,MAAM,KAAK,KAAK,oBAAoB;EAAE,YAAY;EAAM,eAAe;EAAM,CAAC;AAC7F,KAAI,OAAO,kBAAkB;EAC3B,MAAM,MACJ,OAAO,iBAAiB,WAAW,eACnC,OAAO,iBAAiB,QACxB;AACF,QAAM,IAAI,MAAM,0CAA0C,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCpE,eAAsB,qBACpB,MACA,MACe;AACf,KAAI;AACF,QAAM,KAAK,KAAK,oBAAoB;GAClC,YAAY,yBAAyB,KAAK;GAC1C,eAAe;GAChB,CAAC;UACK,KAAK;AAEZ,UAAQ,MAAM,sDAAsD,IAAI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { buildIndicatorExpression } from "./attach-orchestrator-
|
|
2
|
+
import { buildIndicatorExpression } from "./attach-orchestrator-ca34r46y.js";
|
|
3
3
|
//#region src/test-runner/cell.ts
|
|
4
4
|
/**
|
|
5
5
|
* Cell injection utility for the `devtools-test` CLI (issue #684 §4.1).
|
|
@@ -43,12 +43,16 @@ async function injectGlobals(conn, globals) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Injects the "Debugger Connected"
|
|
46
|
+
* Injects (or updates) the "Debugger Connected"/"Debugger Disconnected"
|
|
47
|
+
* on-phone indicator via `Runtime.evaluate` (#730).
|
|
47
48
|
*
|
|
48
49
|
* Uses the same CDP mechanism as {@link injectGlobals} — a single
|
|
49
50
|
* `Runtime.evaluate` round-trip with the expression built by
|
|
50
|
-
* {@link buildIndicatorExpression}. The indicator is a
|
|
51
|
-
*
|
|
51
|
+
* {@link buildIndicatorExpression}. The indicator is a LIVE badge rendered at
|
|
52
|
+
* the bottom-left of the page (position:fixed, safe-area-aware): the badge's
|
|
53
|
+
* controller is idempotent, so calling this again (e.g. right before
|
|
54
|
+
* `close()` with `{ state: 'disconnected' }`) UPDATES the existing badge in
|
|
55
|
+
* place instead of injecting a duplicate.
|
|
52
56
|
*
|
|
53
57
|
* **Isolation**: unlike {@link injectGlobals}, this function NEVER throws to
|
|
54
58
|
* its caller. Injection failure (e.g. page detached during inject, CSS not
|
|
@@ -58,12 +62,12 @@ async function injectGlobals(conn, globals) {
|
|
|
58
62
|
* `src/in-app/attach.ts`.
|
|
59
63
|
*
|
|
60
64
|
* Call this ONLY on the manual debug paths (start_attach MCP, devtools-test
|
|
61
|
-
* CLI). Do NOT call on the `run_tests` auto-attach path — the
|
|
65
|
+
* CLI). Do NOT call on the `run_tests` auto-attach path — the badge
|
|
62
66
|
* would contaminate screenshots, measure_safe_area probes, and DOM snapshots
|
|
63
67
|
* taken during automated measurement runs.
|
|
64
68
|
*
|
|
65
69
|
* SECRET-HANDLING: the injected expression contains no secrets, relay URLs,
|
|
66
|
-
* wss addresses, or TOTP codes — it is pure DOM UI text built by
|
|
70
|
+
* wss addresses, or TOTP codes — it is pure DOM UI text + enum state built by
|
|
67
71
|
* {@link buildIndicatorExpression}.
|
|
68
72
|
*
|
|
69
73
|
* @param conn - The live CDP connection (relay-attached page).
|
|
@@ -82,4 +86,4 @@ async function injectDebugIndicator(conn, opts) {
|
|
|
82
86
|
//#endregion
|
|
83
87
|
export { injectDebugIndicator, injectGlobals };
|
|
84
88
|
|
|
85
|
-
//# sourceMappingURL=cell-
|
|
89
|
+
//# sourceMappingURL=cell-rr6gL9AT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-rr6gL9AT.js","names":[],"sources":["../src/test-runner/cell.ts"],"sourcesContent":["/**\n * Cell injection utility for the `devtools-test` CLI (issue #684 §4.1).\n *\n * Injects arbitrary globals into the page via `Runtime.evaluate` BEFORE the\n * first test bundle is injected. The injected values are session-global — one\n * call covers all files in the run.\n *\n * The primary use-case is injecting `__AIT_CELL__` (sdkLine/platform) so\n * sdk-example's `aitCapture.ts` picks up the correct test-axis values instead\n * of falling back to `'2.x'`/`'mock'`.\n *\n * devtools does NOT know the shape of `__AIT_CELL__` — it only provides the\n * general injection mechanism. The caller (CLI or MCP auto-attach path) is\n * responsible for constructing the cell object.\n *\n * SECRET-HANDLING: cell values (sdkLine/platform) are not secrets and may be\n * logged at the caller's discretion. This module does NOT log them itself.\n *\n * Node-only. react-free. CdpConnection only.\n */\n\nimport { buildIndicatorExpression } from '../mcp/attach-orchestrator.js';\nimport type { CdpConnection } from '../mcp/cdp-connection.js';\n\n/**\n * Injects each key of `globals` into `globalThis` in the page via a single\n * `Runtime.evaluate` call. Must be called BEFORE the first `bundleTestFile`\n * inject — the cell is session-global and applies to all subsequent files.\n *\n * Throws if the CDP evaluate returns an exception.\n *\n * @param conn - The live CDP connection (relay-attached page).\n * @param globals - Plain-JSON-serialisable key→value map to assign onto `globalThis`.\n */\nexport async function injectGlobals(\n conn: CdpConnection,\n globals: Record<string, unknown>,\n): Promise<void> {\n // JSON.stringify is safe here: globals values are plain data (sdkLine/platform\n // strings or simple objects). If a value is not JSON-serialisable this throws\n // at call time, which surfaces the error early and clearly.\n const expr = `(() => { Object.assign(globalThis, ${JSON.stringify(globals)}); return true; })()`;\n const result = await conn.send('Runtime.evaluate', { expression: expr, returnByValue: true });\n if (result.exceptionDetails) {\n const msg =\n result.exceptionDetails.exception?.description ??\n result.exceptionDetails.text ??\n 'unknown error';\n throw new Error(`injectGlobals: Runtime.evaluate threw: ${msg}`);\n }\n}\n\n/**\n * Injects (or updates) the \"Debugger Connected\"/\"Debugger Disconnected\"\n * on-phone indicator via `Runtime.evaluate` (#730).\n *\n * Uses the same CDP mechanism as {@link injectGlobals} — a single\n * `Runtime.evaluate` round-trip with the expression built by\n * {@link buildIndicatorExpression}. The indicator is a LIVE badge rendered at\n * the bottom-left of the page (position:fixed, safe-area-aware): the badge's\n * controller is idempotent, so calling this again (e.g. right before\n * `close()` with `{ state: 'disconnected' }`) UPDATES the existing badge in\n * place instead of injecting a duplicate.\n *\n * **Isolation**: unlike {@link injectGlobals}, this function NEVER throws to\n * its caller. Injection failure (e.g. page detached during inject, CSS not\n * supported) is swallowed and logged as `console.debug` — the badge is\n * informational UI and must never block attach success or test execution.\n * This is the same fire-and-forget spirit as the in-page console mount in\n * `src/in-app/attach.ts`.\n *\n * Call this ONLY on the manual debug paths (start_attach MCP, devtools-test\n * CLI). Do NOT call on the `run_tests` auto-attach path — the badge\n * would contaminate screenshots, measure_safe_area probes, and DOM snapshots\n * taken during automated measurement runs.\n *\n * SECRET-HANDLING: the injected expression contains no secrets, relay URLs,\n * wss addresses, or TOTP codes — it is pure DOM UI text + enum state built by\n * {@link buildIndicatorExpression}.\n *\n * @param conn - The live CDP connection (relay-attached page).\n * @param opts - Optional overrides forwarded to {@link buildIndicatorExpression}.\n */\nexport async function injectDebugIndicator(\n conn: CdpConnection,\n opts?: { label?: string; disconnectedLabel?: string; state?: 'attached' | 'disconnected' },\n): Promise<void> {\n try {\n await conn.send('Runtime.evaluate', {\n expression: buildIndicatorExpression(opts),\n returnByValue: true,\n });\n } catch (err) {\n // Badge injection is informational UI — swallow and log; never propagate.\n console.debug('[@ait-co/devtools] debug indicator inject skipped:', err);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,cACpB,MACA,SACe;CAIf,MAAM,OAAO,sCAAsC,KAAK,UAAU,QAAQ,CAAC;CAC3E,MAAM,SAAS,MAAM,KAAK,KAAK,oBAAoB;EAAE,YAAY;EAAM,eAAe;EAAM,CAAC;AAC7F,KAAI,OAAO,kBAAkB;EAC3B,MAAM,MACJ,OAAO,iBAAiB,WAAW,eACnC,OAAO,iBAAiB,QACxB;AACF,QAAM,IAAI,MAAM,0CAA0C,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCpE,eAAsB,qBACpB,MACA,MACe;AACf,KAAI;AACF,QAAM,KAAK,KAAK,oBAAoB;GAClC,YAAY,yBAAyB,KAAK;GAC1C,eAAe;GAChB,CAAC;UACK,KAAK;AAEZ,UAAQ,MAAM,sDAAsD,IAAI"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as buildRelayVerifyAuth, t as assertRelayAuthConfigured } from "./totp-DvOYkYim.js";
|
|
3
3
|
import { a as RELAY_AUTH_REJECT_REASON, i as RELAY_AUTH_REJECT_CLOSE_CODE, n as logError, r as logInfo, t as ChiiCdpConnection } from "./test-runner/bin.js";
|
|
4
|
-
import { a as startTunnelHealthProbe, i as startQuickTunnel, n as makeTunnelStatus, r as printAttachBanner, t as generateAttachToken } from "./attach-orchestrator-
|
|
5
|
-
import "./cell-
|
|
6
|
-
import "./qr-http-server-
|
|
4
|
+
import { a as startTunnelHealthProbe, i as startQuickTunnel, n as makeTunnelStatus, r as printAttachBanner, t as generateAttachToken } from "./attach-orchestrator-ca34r46y.js";
|
|
5
|
+
import "./cell-rr6gL9AT.js";
|
|
6
|
+
import "./qr-http-server-KB147M-S.js";
|
|
7
7
|
import "./relay-secret-store-CFc9n0OA.js";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import "node:events";
|
|
@@ -376,4 +376,4 @@ async function bootRelayFamily(options = {}) {
|
|
|
376
376
|
//#endregion
|
|
377
377
|
export { bootRelayFamily, buildRelayVerifyAuth };
|
|
378
378
|
|
|
379
|
-
//# sourceMappingURL=debug-server-
|
|
379
|
+
//# sourceMappingURL=debug-server-BBUzxZSf.js.map
|