@qontinui/ui-bridge-wrapper 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ import { type NetworkProfile } from './network-throttle.js';
35
35
  import { type CliActionError } from './action-outcome.js';
36
36
  import { type FrameColorScheme, type FrameError, type FrameRecord } from './frame-capture.js';
37
37
  import { type MatrixCell, type MatrixCellReport, type MatrixManifest, type MatrixViewport } from './capture-matrix.js';
38
- export declare const USAGE = "ui-bridge-inject \u2014 drive UI Bridge's injected transport against a UI-Bridge-free page\n\nRequired:\n --url <pageUrl> Page to open. Must start with http:// or https://\n (maps to the transport's options.targetUrl)\n\nRelay (Variant B \u2014 the default mode; --relay is REQUIRED in this mode):\n --relay <uiBridgeBase> UI Bridge relay base; the injected runtime registers\n as a relay tab. Example: http://localhost:3001/api/ui-bridge\n --auth-token <T> Bearer token for an auth-gated relay. Puts the token on THIS\n process's command line, which any local process/user can read\n (Task Manager, /proc, WMI) for the process's whole lifetime \u2014\n prefer --auth-token-file or $UI_BRIDGE_AUTH_TOKEN instead.\n --auth-token-file <path> Read the bearer token from a file (trimmed) instead of argv.\n Takes priority over $UI_BRIDGE_AUTH_TOKEN, loses to --auth-token.\n --registration-metadata <json>\n JSON {\"userId\":\"...\",\"sessionId\":\"...\"} for per-user\n tab-scoping on relay heartbeats\n --app-id <id> App id reported to the relay registry\n --app-name <name> Display name reported to the relay registry\n --tab-id <id> Stable per-tab id override\n\nExec (Variant A \u2014 one-shot; presence of any --exec/--exec-stdin selects this mode):\n --exec '<action> <json>' Run one action (repeatable). The value is an action\n id, a space, then a JSON payload (payload optional \u2192\n defaults {}). Example: --exec 'find {\"text\":\"Sign in\"}'\n --exec-stdin Read NDJSON lines from stdin; each line is\n {\"action\":\"...\",\"payload\":{...}}\n\n Waiting BETWEEN exec steps (CLI-side actions, not in-page ones):\n Exec steps run back to back with nothing between them, so state that\n arrives AFTER ready()/settle \u2014 a row fetched by a request the previous\n step kicked off, a panel that mounts a tick later \u2014 cannot be awaited.\n Two action ids are handled by the CLI itself for exactly that:\n\n waitForSelector {\"selector\":\"<css>\",\"timeoutMs\":10000,\"state\":\"attached\"}\n Wait until the selector reaches 'state' in the page. 'state' is one of\n attached (DEFAULT \u2014 the same \"exists in the DOM\" test --expect-selector\n applies) | visible | hidden | detached. 'timeoutMs' defaults to 10000.\n On timeout the step FAILS like any other: an \"error\" line on stdout and\n exit 1 at the end.\n Result: {\"waited\":true,\"selector\":..,\"state\":..,\"elapsedMs\":..}\n\n sleep {\"ms\":250}\n Unconditional pause. 'ms' is required, 0..600000. Prefer\n waitForSelector \u2014 a sleep encodes a guess, not a condition.\n Result: {\"slept\":250}\n\n Both go through the same one-line-per-action channel as an in-page action,\n so an N-step run still prints N lines in order. Neither shadows an in-page\n action id \u2014 the injected dispatcher defines neither.\n\n A timed multi-frame capture (CLI-side too):\n\n captureTimeline {\"dir\":\"<dir>\",\"frames\":8,\"intervalMs\":250,\"reload\":false}\n Screenshot the page 'frames' times (1..120), one every 'intervalMs'\n (0..10000), into <dir>/frame-<k>.png \u2014 the loading-to-loaded timeline\n of a slot, NOT a lockstep pair (it records movement on purpose). <dir>\n must be empty or not exist. With \"reload\":true the clock starts at a\n fresh navigation commit, so frame 1 is the page before it painted; the\n reload drops any media override, and the action waits for the injected\n runtime to settle again ('readyTimeoutMs', default 30000) so the next\n step finds a drivable page. In --capture-matrix a relative <dir> lands\n inside each cell's directory.\n Result: {\"success\",\"dir\",\"reloaded\",\"intervalMs\",\"startedAt\",\n \"frames\":[{\"index\",\"path\",\"offsetMs\",\"capturedAt\",\"width\",\"height\"}],\n \"devicePixelRatio\",\"cssViewport\",\"colorScheme\",\"runtimeReady\",\"network\"}\n A frame that could not be taken carries \"error\" and fails the step.\n \"during\":{\"action\":\"mediaOverride\",\"payload\":{...}} runs that in-page\n action CONCURRENTLY with the frames, so the timeline shows the candidate\n ARRIVING (under --throttle, its slow-network load) while the override\n still confirms decode before it answers; its result rides on the line\n as \"during\" and a failed action fails the step. Not with \"reload\".\n\n Swapping an image in place (dev control, served by the injected runtime):\n\n mediaOverride {\"slotId\":\"hero\",\"src\":\"/candidate.png\"}\n mediaOverride {\"elementId\":\"img-logo\",\"srcset\":\"/c-1x.avif 1x, /c-2x.avif 2x\"}\n mediaOverride {\"slotId\":\"hero\",\"src\":\"/c.png\",\"sources\":[{\"type\":\"image/avif\",\"srcset\":\"/c.avif\"}]}\n mediaOverride {\"slotId\":\"banner\",\"backgroundImage\":\"/c.png\",\"ttlMs\":60000}\n Swap one slot's image, wait for decode() and confirm currentSrc before\n answering (an override that cannot be confirmed is rolled back and\n fails). Inside a <picture> every <source srcset> is replaced too.\n mediaOverrideRestore {\"overrideId\":\"mo-\u2026\"} (or {} for all)\n Put the originals back and verify each attribute reads back.\n mediaOverrideList {}\n What is still overridden \u2014 the proof the page ended restored.\n\n Exec output & exit code:\n One JSON line per action, in order, on stdout \u2014 ALWAYS one line per action,\n including failures. An action that succeeded prints {\"action\":..,\"result\":..}.\n An action that FAILED additionally carries an \"error\" key:\n {\"action\":..,\"result\":..,\"error\":{\"code\":..,\"message\":..,\"source\":\"returned\",\n \"details\":{..}}}\n A failure is EITHER thrown by the transport (source \"thrown\") OR returned by\n the in-page handler as {\"success\":false,...} (source \"returned\") \u2014 a missing,\n invisible or disabled element is the RETURNED kind, so \"result\" alone never\n tells you whether the action did anything. Branch on \"error\"; \"error.code\" is\n the handler's own errorCode (ELEMENT_NOT_FOUND / ELEMENT_NOT_VISIBLE /\n ELEMENT_NOT_ENABLED / ...) and \"error.details\" is its full failureDetails,\n unflattened.\n\n A failed action does NOT abort the actions after it. Every action runs, each\n gets its line, and the process exits 1 at the end if ANY action failed (0 if\n all succeeded). This is the pre-existing behaviour of a thrown failure, kept\n for a returned one so there is one convention rather than two \u2014 and it is\n what keeps the one-line-per-action contract intact for a caller that pairs\n N actions with N lines. A caller that wants stop-on-first-failure gets it by\n running one action per invocation and checking the exit code.\n\nFrames (Variant A):\n --screenshot <path> Capture a PNG frame IN LOCKSTEP with every\n getControlSnapshot action: snapshot, frame, snapshot\n again, retried until both snapshots agree on every\n element's box. That action's line gains a \"frame\":\n {\"path\",\"format\":\"png\",\"width\",\"height\",\n \"devicePixelRatio\",\"cssViewport\":{\"width\",\"height\"},\n \"colorScheme\",\"capturedAt\",\n \"lockstep\":{\"verified\",\"attempts\",\"changedElements\"}}\n every field read off the page or the PNG at capture\n time, never copied from the flags. {n} in the FILE\n NAME of <path> is replaced by the action's 1-based\n position (= its output line) and is REQUIRED when the\n run takes more than one snapshot; {n} in a directory\n name is refused. A frame that cannot be produced leaves\n \"frame\":null plus \"frameError\":{\"code\",\"message\"} on the\n line \u2014 the snapshot still stands \u2014 and exit 1.\n A frame is RAW PIXELS of the page: data-bridge-redact\n masks elements in snapshots and over the relay, never\n in a screenshot, so a frame shows whatever the page\n showed. Directories created for frames are 0700 and\n the files 0600.\n --dpr <n> Device pixel ratio of the browser context, e.g. 2 or\n 2.625 (Chromium's --force-device-scale-factor does NOT\n reach the page; this does). Default 1.\n --color-scheme <dark|light> prefers-color-scheme of the browser context.\n Default: no override (light).\n Both are read back from the page after launch; a page\n that reports anything else fails the run\n (EMULATION_NOT_APPLIED) instead of being measured as if.\n\nNetwork (every mode; applied to the page once it is ready, before any action):\n --throttle <profile> Emulate a slow network on the page (CDP\n Network.emulateNetworkConditions). <profile> is\n slow-3g (2000 ms, 400/400 kbit/s), fast-3g (563 ms,\n 1475/675 kbit/s), or latency=<ms>,down=<kbps>,up=<kbps>.\n It persists across reloads of the page, so a\n captureTimeline {\"reload\":true} loads throttled.\n --no-cache Disable the HTTP cache too (Network.setCacheDisabled):\n a warm cache would let a \"slow\" reload paint at once.\n What was applied is stamped as \"network\" on every\n captureTimeline result, each capture-matrix cell, and\n the relay info line; CDP has no getter, so the stamp\n says what Chromium ACCEPTED, and a refused command\n fails the run rather than measuring unthrottled.\n\nCapture matrix (its own mode):\n --capture-matrix <dir> Run the plan once per --viewport \u00D7 --dpr \u00D7 --color-scheme\n combination, each a fresh browser context, and store\n every frame-and-snapshot pair with its provenance:\n <dir>/<cell>/frame-<n>.png, snapshot-<n>.json,\n results.ndjson, and <dir>/matrix.json for all cells.\n In this mode those three flags take comma-separated\n lists (or repeat): --viewport 390x844,1280x720\n --dpr 1,2 --color-scheme light,dark. An axis left out\n stays at the browser default and is named so in the\n cell id (e.g. 390x844_dpr-default_dark). --exec /\n --exec-stdin give the per-cell plan (default: one\n 'getControlSnapshot {}'); a frame is captured beside\n every getControlSnapshot in it. Prints one JSON line\n per cell; exits 1 if any cell is not \"captured\".\n Takes no --relay and no --screenshot. <dir> must be\n empty or not exist yet: a non-empty one is refused,\n never cleared. Directories it creates are 0700 and\n every frame, snapshot and manifest 0600 \u2014 frames are\n raw pixels that data-bridge-redact does not scrub.\n\nOptional:\n --storage-state <path> Seed the browser context from a Playwright storageState\n JSON file (cookies + localStorage) produced by\n 'ui-bridge-login-web --storage-state-out <path>'. This\n carries a saved authenticated session past a login wall,\n so you can drive a login-walled page (e.g. an /admin\n wizard) WITHOUT re-driving the hosted-UI login each run.\n --headed Launch with a visible window (default: headless)\n --ready-timeout <ms> Max wait for the injected runtime ready/settle gate (default 30000)\n --no-settle Gate ready on the runtime being live only, NOT on the DOM\n settling. By default the launcher waits for the page to paint\n + go quiet (so a client-rendered SPA is drivable immediately),\n which is almost always what you want.\n --settle-quiet <ms> Quiet window with no DOM re-seed before settled (default 500)\n --settle-timeout <ms> Hard cap before settling regardless of mutations (default 10000)\n --expect-selector <css> Don't settle until an element matching this CSS selector\n exists \u2014 use when the target control (e.g. a login form)\n mounts lazily after unrelated chrome. If it never appears\n before --settle-timeout, ready() fails with a BLOCKED error\n instead of returning a control-less page.\n --viewport <WxH> Viewport size in CSS pixels, e.g. 1280x720 (default 1280x720).\n Each side 1..8192 CSS pixels.\n --launch-arg <arg> Extra Chromium command-line argument (repeatable),\n passed through to chromium.launch({ args }).\n NOTE: when --url is https and --relay resolves to a\n loopback host, the LNA-disable flags\n (--disable-features=LocalNetworkAccessChecks,...) are\n auto-appended \u2014 Chromium otherwise blocks the\n https-page \u2192 loopback-relay fetch (Local Network Access).\n --quiet Suppress human-readable logs (JSON results still print)\n --help, -h Print this help and exit\n\nExamples:\n # Variant B: register an injected tab against a relay and stay alive\n ui-bridge-inject --url https://example.com/login \\\n --relay http://localhost:3001/api/ui-bridge --app-name \"example login\"\n\n # Variant B against an auth-gated relay, without putting the token on argv\n ui-bridge-inject --url https://qontinui.io/admin/coord/fleet \\\n --relay https://qontinui.io/api/ui-bridge --auth-token-file \"$HOME/.idtok\"\n\n # Variant A: snapshot the controls on a page, then exit\n ui-bridge-inject --url https://example.com/login \\\n --exec 'getControlSnapshot {}'\n\n # Variant A: find a control and act on it\n ui-bridge-inject --url https://example.com/login \\\n --exec 'find {\"text\":\"Sign in\"}'\n\n # Variant A: wait for a late-arriving row, THEN read it (no --expect-selector)\n ui-bridge-inject --url https://example.com/account --exec 'waitForSelector {\"selector\":\"[data-row=account]\",\"timeoutMs\":15000}' --exec 'discover {}'\n\n # A frame in lockstep with the snapshot, at a Retina DPR in dark mode\n ui-bridge-inject --url http://127.0.0.1:3000/ --viewport 1280x720 --dpr 2 \\\n --color-scheme dark --screenshot ./frame.png --exec 'getControlSnapshot {}'\n\n # Before/after a click: {n} names each frame by its action's position\n ui-bridge-inject --url http://127.0.0.1:3000/ --screenshot './frame-{n}.png' \\\n --exec 'getControlSnapshot {}' \\\n --exec 'executeElementAction {\"id\":\"open\",\"request\":{\"action\":\"click\"}}' \\\n --exec 'getControlSnapshot {}'\n\n # A candidate in its real slot, its slow-network load timeline, then restored\n ui-bridge-inject --url http://127.0.0.1:3000/ --throttle slow-3g --no-cache --exec 'mediaOverride {\"slotId\":\"hero\",\"src\":\"http://127.0.0.1:8080/cand.png\"}' --exec 'captureTimeline {\"dir\":\"./tl\",\"frames\":6,\"intervalMs\":200}' --exec 'mediaOverrideRestore {}' --exec 'mediaOverrideList {}'\n\n # Capture matrix: 2 breakpoints x 2 schemes x 2 DPRs = 8 frame-and-snapshot pairs\n ui-bridge-inject --url http://127.0.0.1:3000/ --capture-matrix ./matrix \\\n --viewport 390x844,1280x720 --color-scheme light,dark --dpr 1,2\n\n # Reuse a saved login: drive a login-walled page with a captured auth artifact\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fadmin\" \\\n --success /admin --storage-state-out auth.json\n ui-bridge-inject --url https://qontinui.io/admin \\\n --storage-state auth.json --exec 'getControlSnapshot {}'\n";
38
+ export declare const USAGE = "ui-bridge-inject \u2014 drive UI Bridge's injected transport against a UI-Bridge-free page\n\nRequired:\n --url <pageUrl> Page to open. Must start with http:// or https://\n (maps to the transport's options.targetUrl)\n\nRelay (Variant B \u2014 the default mode; --relay is REQUIRED in this mode):\n --relay <uiBridgeBase> UI Bridge relay base; the injected runtime registers\n as a relay tab. Example: http://localhost:3001/api/ui-bridge\n --auth-token <T> Bearer token for an auth-gated relay. Puts the token on THIS\n process's command line, which any local process/user can read\n (Task Manager, /proc, WMI) for the process's whole lifetime \u2014\n prefer --auth-token-file or $UI_BRIDGE_AUTH_TOKEN instead.\n --auth-token-file <path> Read the bearer token from a file (trimmed) instead of argv.\n Takes priority over $UI_BRIDGE_AUTH_TOKEN, loses to --auth-token.\n --registration-metadata <json>\n JSON {\"userId\":\"...\",\"sessionId\":\"...\"} for per-user\n tab-scoping on relay heartbeats\n --app-id <id> App id reported to the relay registry\n --app-name <name> Display name reported to the relay registry\n --tab-id <id> Stable per-tab id override\n\nExec (Variant A \u2014 one-shot; presence of any --exec/--exec-stdin selects this mode):\n --exec '<action> <json>' Run one action (repeatable). The value is an action\n id, a space, then a JSON payload (payload optional \u2192\n defaults {}). Example: --exec 'find {\"text\":\"Sign in\"}'\n --exec-stdin Read NDJSON lines from stdin; each line is\n {\"action\":\"...\",\"payload\":{...}}\n\n Waiting BETWEEN exec steps (CLI-side actions, not in-page ones):\n Exec steps run back to back with nothing between them, so state that\n arrives AFTER ready()/settle \u2014 a row fetched by a request the previous\n step kicked off, a panel that mounts a tick later \u2014 cannot be awaited.\n Two action ids are handled by the CLI itself for exactly that:\n\n waitForSelector {\"selector\":\"<css>\",\"timeoutMs\":10000,\"state\":\"attached\"}\n Wait until the selector reaches 'state' in the page. 'state' is one of\n attached (DEFAULT \u2014 the same \"exists in the DOM\" test --expect-selector\n applies) | visible | hidden | detached. 'timeoutMs' defaults to 10000.\n On timeout the step FAILS like any other: an \"error\" line on stdout and\n exit 1 at the end.\n Result: {\"waited\":true,\"selector\":..,\"state\":..,\"elapsedMs\":..}\n\n sleep {\"ms\":250}\n Unconditional pause. 'ms' is required, 0..600000. Prefer\n waitForSelector \u2014 a sleep encodes a guess, not a condition.\n Result: {\"slept\":250}\n\n Both go through the same one-line-per-action channel as an in-page action,\n so an N-step run still prints N lines in order. Neither shadows an in-page\n action id \u2014 the injected dispatcher defines neither.\n\n A timed multi-frame capture (CLI-side too):\n\n captureTimeline {\"dir\":\"<dir>\",\"frames\":8,\"intervalMs\":250,\"reload\":false}\n Screenshot the page 'frames' times (1..120), one every 'intervalMs'\n (0..10000), into <dir>/frame-<k>.png \u2014 the loading-to-loaded timeline\n of a slot, NOT a lockstep pair (it records movement on purpose). <dir>\n must be empty or not exist. With \"reload\":true the clock starts at a\n fresh navigation commit, so frame 1 is the page before it painted; the\n reload drops any media override, and the action waits for the injected\n runtime to settle again ('readyTimeoutMs', default 30000) so the next\n step finds a drivable page. In --capture-matrix a relative <dir> lands\n inside each cell's directory.\n Result: {\"success\",\"dir\",\"reloaded\",\"intervalMs\",\"startedAt\",\n \"frames\":[{\"index\",\"path\",\"offsetMs\",\"capturedAt\",\"width\",\"height\"}],\n \"devicePixelRatio\",\"cssViewport\",\"colorScheme\",\"runtimeReady\",\"network\"}\n A frame that could not be taken carries \"error\" and fails the step.\n \"during\":{\"action\":\"mediaOverride\",\"payload\":{...}} runs that in-page\n action CONCURRENTLY with the frames, so the timeline shows the candidate\n ARRIVING (under --throttle, its slow-network load) while the override\n still confirms decode before it answers; its result rides on the line\n as \"during\" and a failed action fails the step. Not with \"reload\".\n\n Swapping an image in place (dev control, served by the injected runtime):\n\n mediaOverride {\"slotId\":\"hero\",\"src\":\"/candidate.png\"}\n mediaOverride {\"elementId\":\"img-logo\",\"srcset\":\"/c-1x.avif 1x, /c-2x.avif 2x\"}\n mediaOverride {\"slotId\":\"hero\",\"src\":\"/c.png\",\"sources\":[{\"type\":\"image/avif\",\"srcset\":\"/c.avif\"}]}\n mediaOverride {\"slotId\":\"banner\",\"backgroundImage\":\"/c.png\",\"ttlMs\":60000}\n Swap one slot's image, wait for decode() and confirm currentSrc before\n answering (an override that cannot be confirmed is rolled back and\n fails). Inside a <picture> every <source srcset> is replaced too.\n mediaOverrideRestore {\"overrideId\":\"mo-\u2026\"} (or {} for all)\n Put the originals back and verify each attribute reads back.\n mediaOverrideList {}\n What is still overridden \u2014 the proof the page ended restored.\n\n Hiding text for one frame (dev control, served by the injected runtime):\n\n textVisibility {\"hidden\":true,\"ttlMs\":30000}\n Make every glyph on the page transparent (colour, text fill, SVG text\n fill, text-shadow), with transitions off so the frame is not caught\n mid-fade; nothing moves, and currentColor borders and icons keep their\n colour. Capture frame A before and frame B after: inside a text\n element's box the two differ exactly where its glyphs paint. A TTL\n (default 30000 ms) restores the page if the run dies.\n textVisibility {\"hidden\":false}\n Restore exactly (the style attributes read back byte for byte);\n \"restore\":{\"verified\":true} is a clean restore.\n\n Exec output & exit code:\n One JSON line per action, in order, on stdout \u2014 ALWAYS one line per action,\n including failures. An action that succeeded prints {\"action\":..,\"result\":..}.\n An action that FAILED additionally carries an \"error\" key:\n {\"action\":..,\"result\":..,\"error\":{\"code\":..,\"message\":..,\"source\":\"returned\",\n \"details\":{..}}}\n A failure is EITHER thrown by the transport (source \"thrown\") OR returned by\n the in-page handler as {\"success\":false,...} (source \"returned\") \u2014 a missing,\n invisible or disabled element is the RETURNED kind, so \"result\" alone never\n tells you whether the action did anything. Branch on \"error\"; \"error.code\" is\n the handler's own errorCode (ELEMENT_NOT_FOUND / ELEMENT_NOT_VISIBLE /\n ELEMENT_NOT_ENABLED / ...) and \"error.details\" is its full failureDetails,\n unflattened.\n\n A failed action does NOT abort the actions after it. Every action runs, each\n gets its line, and the process exits 1 at the end if ANY action failed (0 if\n all succeeded). This is the pre-existing behaviour of a thrown failure, kept\n for a returned one so there is one convention rather than two \u2014 and it is\n what keeps the one-line-per-action contract intact for a caller that pairs\n N actions with N lines. A caller that wants stop-on-first-failure gets it by\n running one action per invocation and checking the exit code.\n\nFrames (Variant A):\n --screenshot <path> Capture a PNG frame IN LOCKSTEP with every\n getControlSnapshot action: snapshot, frame, snapshot\n again, retried until both snapshots agree on every\n element's box. That action's line gains a \"frame\":\n {\"path\",\"format\":\"png\",\"width\",\"height\",\n \"devicePixelRatio\",\"cssViewport\":{\"width\",\"height\"},\n \"colorScheme\",\"capturedAt\",\n \"lockstep\":{\"verified\",\"attempts\",\"changedElements\"}}\n every field read off the page or the PNG at capture\n time, never copied from the flags. {n} in the FILE\n NAME of <path> is replaced by the action's 1-based\n position (= its output line) and is REQUIRED when the\n run takes more than one snapshot; {n} in a directory\n name is refused. A frame that cannot be produced leaves\n \"frame\":null plus \"frameError\":{\"code\",\"message\"} on the\n line \u2014 the snapshot still stands \u2014 and exit 1.\n A frame is RAW PIXELS of the page: data-bridge-redact\n masks elements in snapshots and over the relay, never\n in a screenshot, so a frame shows whatever the page\n showed. Directories created for frames are 0700 and\n the files 0600.\n --dpr <n> Device pixel ratio of the browser context, e.g. 2 or\n 2.625 (Chromium's --force-device-scale-factor does NOT\n reach the page; this does). Default 1.\n --color-scheme <dark|light> prefers-color-scheme of the browser context.\n Default: no override (light).\n Both are read back from the page after launch; a page\n that reports anything else fails the run\n (EMULATION_NOT_APPLIED) instead of being measured as if.\n\nNetwork (every mode; applied to the page once it is ready, before any action):\n --throttle <profile> Emulate a slow network on the page (CDP\n Network.emulateNetworkConditions). <profile> is\n slow-3g (2000 ms, 400/400 kbit/s), fast-3g (563 ms,\n 1475/675 kbit/s), or latency=<ms>,down=<kbps>,up=<kbps>.\n It persists across reloads of the page, so a\n captureTimeline {\"reload\":true} loads throttled.\n --no-cache Disable the HTTP cache too (Network.setCacheDisabled):\n a warm cache would let a \"slow\" reload paint at once.\n What was applied is stamped as \"network\" on every\n captureTimeline result, each capture-matrix cell, and\n the relay info line; CDP has no getter, so the stamp\n says what Chromium ACCEPTED, and a refused command\n fails the run rather than measuring unthrottled.\n\nCapture matrix (its own mode):\n --capture-matrix <dir> Run the plan once per --viewport \u00D7 --dpr \u00D7 --color-scheme\n combination, each a fresh browser context, and store\n every frame-and-snapshot pair with its provenance:\n <dir>/<cell>/frame-<n>.png, snapshot-<n>.json,\n results.ndjson, and <dir>/matrix.json for all cells.\n In this mode those three flags take comma-separated\n lists (or repeat): --viewport 390x844,1280x720\n --dpr 1,2 --color-scheme light,dark. An axis left out\n stays at the browser default and is named so in the\n cell id (e.g. 390x844_dpr-default_dark). --exec /\n --exec-stdin give the per-cell plan (default: one\n 'getControlSnapshot {}'); a frame is captured beside\n every getControlSnapshot in it. Prints one JSON line\n per cell; exits 1 if any cell is not \"captured\".\n Takes no --relay and no --screenshot. <dir> must be\n empty or not exist yet: a non-empty one is refused,\n never cleared. Directories it creates are 0700 and\n every frame, snapshot and manifest 0600 \u2014 frames are\n raw pixels that data-bridge-redact does not scrub.\n\nOptional:\n --storage-state <path> Seed the browser context from a Playwright storageState\n JSON file (cookies + localStorage) produced by\n 'ui-bridge-login-web --storage-state-out <path>'. This\n carries a saved authenticated session past a login wall,\n so you can drive a login-walled page (e.g. an /admin\n wizard) WITHOUT re-driving the hosted-UI login each run.\n --headed Launch with a visible window (default: headless)\n --ready-timeout <ms> Max wait for the injected runtime ready/settle gate (default 30000)\n --no-settle Gate ready on the runtime being live only, NOT on the DOM\n settling. By default the launcher waits for the page to paint\n + go quiet (so a client-rendered SPA is drivable immediately),\n which is almost always what you want.\n --settle-quiet <ms> Quiet window with no DOM re-seed before settled (default 500)\n --settle-timeout <ms> Hard cap before settling regardless of mutations (default 10000)\n --expect-selector <css> Don't settle until an element matching this CSS selector\n exists \u2014 use when the target control (e.g. a login form)\n mounts lazily after unrelated chrome. If it never appears\n before --settle-timeout, ready() fails with a BLOCKED error\n instead of returning a control-less page.\n --viewport <WxH> Viewport size in CSS pixels, e.g. 1280x720 (default 1280x720).\n Each side 1..8192 CSS pixels.\n --launch-arg <arg> Extra Chromium command-line argument (repeatable),\n passed through to chromium.launch({ args }).\n NOTE: when --url is https and --relay resolves to a\n loopback host, the LNA-disable flags\n (--disable-features=LocalNetworkAccessChecks,...) are\n auto-appended \u2014 Chromium otherwise blocks the\n https-page \u2192 loopback-relay fetch (Local Network Access).\n --quiet Suppress human-readable logs (JSON results still print)\n --help, -h Print this help and exit\n\nExamples:\n # Variant B: register an injected tab against a relay and stay alive\n ui-bridge-inject --url https://example.com/login \\\n --relay http://localhost:3001/api/ui-bridge --app-name \"example login\"\n\n # Variant B against an auth-gated relay, without putting the token on argv\n ui-bridge-inject --url https://qontinui.io/admin/coord/fleet \\\n --relay https://qontinui.io/api/ui-bridge --auth-token-file \"$HOME/.idtok\"\n\n # Variant A: snapshot the controls on a page, then exit\n ui-bridge-inject --url https://example.com/login \\\n --exec 'getControlSnapshot {}'\n\n # Variant A: find a control and act on it\n ui-bridge-inject --url https://example.com/login \\\n --exec 'find {\"text\":\"Sign in\"}'\n\n # Variant A: wait for a late-arriving row, THEN read it (no --expect-selector)\n ui-bridge-inject --url https://example.com/account --exec 'waitForSelector {\"selector\":\"[data-row=account]\",\"timeoutMs\":15000}' --exec 'discover {}'\n\n # A frame in lockstep with the snapshot, at a Retina DPR in dark mode\n ui-bridge-inject --url http://127.0.0.1:3000/ --viewport 1280x720 --dpr 2 \\\n --color-scheme dark --screenshot ./frame.png --exec 'getControlSnapshot {}'\n\n # Before/after a click: {n} names each frame by its action's position\n ui-bridge-inject --url http://127.0.0.1:3000/ --screenshot './frame-{n}.png' \\\n --exec 'getControlSnapshot {}' \\\n --exec 'executeElementAction {\"id\":\"open\",\"request\":{\"action\":\"click\"}}' \\\n --exec 'getControlSnapshot {}'\n\n # A candidate in its real slot, its slow-network load timeline, then restored\n ui-bridge-inject --url http://127.0.0.1:3000/ --throttle slow-3g --no-cache --exec 'mediaOverride {\"slotId\":\"hero\",\"src\":\"http://127.0.0.1:8080/cand.png\"}' --exec 'captureTimeline {\"dir\":\"./tl\",\"frames\":6,\"intervalMs\":200}' --exec 'mediaOverrideRestore {}' --exec 'mediaOverrideList {}'\n\n # Capture matrix: 2 breakpoints x 2 schemes x 2 DPRs = 8 frame-and-snapshot pairs\n ui-bridge-inject --url http://127.0.0.1:3000/ --capture-matrix ./matrix \\\n --viewport 390x844,1280x720 --color-scheme light,dark --dpr 1,2\n\n # Reuse a saved login: drive a login-walled page with a captured auth artifact\n ui-bridge-login-web --url \"https://qontinui.io/login?next=%2Fadmin\" \\\n --success /admin --storage-state-out auth.json\n ui-bridge-inject --url https://qontinui.io/admin \\\n --storage-state auth.json --exec 'getControlSnapshot {}'\n";
39
39
  /** A single Variant-A action to execute. */
40
40
  export interface ExecAction {
41
41
  action: string;
@@ -1 +1 @@
1
- {"version":3,"file":"inject-cli.d.ts","sourceRoot":"","sources":["../src/inject-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAQL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEf,KAAK,WAAW,EAEjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEnB,KAAK,cAAc,EACpB,M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GAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAe,GACrE,OAAO,CAAC,cAAc,CAAC,CAwCzB"}
@@ -606,7 +606,7 @@ var InjectedTransport = class extends HeadlessTransport {
606
606
  }
607
607
  /**
608
608
  * Best-effort digest of the first {@link DIGEST_MAX_ELEMENTS} registered
609
- * interactive elements, read through the in-page dispatcher's
609
+ * interactive and media elements, read through the in-page dispatcher's
610
610
  * `getControlSnapshot` action (the snapshot's per-element projection is
611
611
  * already redaction-safe — we never read raw DOM labels here). Returns
612
612
  * `null` on ANY failure or timeout: this feeds error diagnostics only, and a
@@ -628,7 +628,10 @@ var InjectedTransport = class extends HeadlessTransport {
628
628
  const elements = snapshot.elements;
629
629
  if (!Array.isArray(elements)) return null;
630
630
  const digest = [];
631
- for (const el of elements.slice(0, DIGEST_MAX_ELEMENTS)) {
631
+ const counted = elements.filter(
632
+ (el) => el?.category !== "content"
633
+ );
634
+ for (const el of counted.slice(0, DIGEST_MAX_ELEMENTS)) {
632
635
  if (!el || typeof el !== "object") continue;
633
636
  const e = el;
634
637
  if (typeof e.id !== "string") continue;