@qontinui/ui-bridge-wrapper 0.12.0 → 0.15.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.
- package/README.md +157 -8
- package/dist/capture-specs-cli.cjs +301 -53
- package/dist/capture-specs-cli.cjs.map +1 -1
- package/dist/capture-specs-cli.d.ts.map +1 -1
- package/dist/chunk-IKHDNIU4.js +478 -0
- package/dist/chunk-IKHDNIU4.js.map +1 -0
- package/dist/chunk-Z32CC665.cjs +488 -0
- package/dist/chunk-Z32CC665.cjs.map +1 -0
- package/dist/create-transport.d.ts.map +1 -1
- package/dist/frame-capture.d.ts +3 -28
- package/dist/frame-capture.d.ts.map +1 -1
- package/dist/frame-page.d.ts +35 -0
- package/dist/frame-page.d.ts.map +1 -0
- package/dist/index.cjs +145 -375
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -351
- package/dist/index.js.map +1 -1
- package/dist/inject-cli.cjs +407 -134
- package/dist/inject-cli.cjs.map +1 -1
- package/dist/inject-cli.d.ts +1 -1
- package/dist/inject-cli.d.ts.map +1 -1
- package/dist/live/index.cjs +40 -0
- package/dist/live/index.cjs.map +1 -0
- package/dist/live/index.d.ts +32 -0
- package/dist/live/index.d.ts.map +1 -0
- package/dist/live/index.js +3 -0
- package/dist/live/index.js.map +1 -0
- package/dist/login-web-cli.cjs +312 -61
- package/dist/login-web-cli.cjs.map +1 -1
- package/dist/login-web-cli.d.ts.map +1 -1
- package/dist/network-throttle.d.ts +5 -0
- package/dist/network-throttle.d.ts.map +1 -1
- package/dist/screenshot-capture.d.ts +82 -0
- package/dist/screenshot-capture.d.ts.map +1 -0
- package/dist/timeline-capture.d.ts +74 -10
- package/dist/timeline-capture.d.ts.map +1 -1
- package/dist/transports/headless.d.ts +46 -1
- package/dist/transports/headless.d.ts.map +1 -1
- package/dist/transports/injected.d.ts +8 -0
- package/dist/transports/injected.d.ts.map +1 -1
- package/dist/transports/live.d.ts +27 -1
- package/dist/transports/live.d.ts.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -8
- package/dist/cli-args.d.ts +0 -13
- package/dist/cli-args.d.ts.map +0 -1
package/dist/inject-cli.d.ts
CHANGED
|
@@ -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 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";
|
|
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 Reading and acting on one element (in-page actions):\n\n getElement {\"id\":\"<id>\"}\n One element as a snapshot carries it: identity (id, type, tagName,\n label, role, accessibleName), \"state\", box (\"bbox\", \"visible\") and\n \"actions\" \u2014 the same object as the matching getControlSnapshot element,\n redaction included. {\"elementId\":\"<id>\"} is accepted too; given both,\n they must name the same element. Nothing settles first: run\n waitForSelector before it for a settled read. Beside the id it\n tolerates, and ignores, settleTimeout and skipSettle (it does not\n settle), targetTabId, and the WebSocket protocol's \"includeState\" (the\n state is always included); any other key is refused with\n INVALID_REQUEST. An unknown id, or one whose DOM node is gone, is a\n RETURNED ELEMENT_NOT_FOUND (an \"error\" line, exit 1), never a null\n result.\n\n getElementState {\"id\":\"<id>\"}\n The state alone (visible, enabled, focused, ariaPressed, value, ...).\n It reads \"id\" only, and an unknown id is a THROWN error (HANDLER_ERROR).\n\n executeElementAction {\"id\":\"<id>\",\"request\":{\"action\":\"click\"}}\n Act on one element. \"request\" holds the verb and the fields it reads\n (\"value\", \"text\", \"clear\", \"params\", \"fromSnapshotId\", ...). Two other\n spellings are accepted:\n {\"elementId\":\"<id>\",\"request\":{\"action\":\"focus\"}} \"elementId\" for \"id\"\n {\"id\":\"<id>\",\"action\":\"type\",\"text\":\"hi\"} flat: the payload,\n minus \"id\"/\"elementId\", IS the request\n No key BESIDE a \"request\" object is silently dropped: a top-level\n \"action\" or request field (\"value\", \"text\", ...) there must equal the\n same field inside \"request\" (an agreeing duplicate is accepted); one\n that is only at the top level, or at both levels with different\n values, is refused, and so are an \"id\" and an \"elementId\" that name\n different elements. settleTimeout, skipSettle and targetTabId stay\n allowed at the top level. The request fields themselves (the keys\n inside \"request\", or every key of a flat payload but the id) reach\n the action as sent, so a misspelt one there (\"txt\" for \"text\") is not\n caught. Every refused shape is a RETURNED INVALID_REQUEST (an \"error\"\n line, exit 1; never a thrown TypeError) whose message names the\n canonical shape\n {\"id\":\"<elementId>\",\"request\":{\"action\":\"<action>\", \u2026}}\n and both accepted spellings, and names keys and the kinds of values,\n never a value, with one exception: an \"id\" and an \"elementId\" that\n disagree are both named (they are the element ids the caller sent, and\n naming both is what makes the conflict diagnosable); \"error.details\"\n adds \"expectedPayload\" and \"receivedKeys\". A well-formed payload with\n an unknown verb is refused with UNSUPPORTED_ACTION, naming the\n accepted verbs.\n\n A timed multi-frame capture (CLI-side, like the waits):\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, and frame 1 is the first frame the page\n produced after that commit. Right after the commit the new document can\n have no compositor frame yet, and Chromium refuses the screenshot\n (\"Unable to capture screenshot\"); frame 1 retries that refusal every\n 16 ms until 'readyTimeoutMs' after the commit. A frame's \"offsetMs\" is\n when the screenshot that produced it was requested, so a frame 1 that\n had to wait reads the tens of ms its retries took, not 0. Under\n --throttle that first frame can still be the previous document's held\n frame; \"offsetMs\" dates it either way. Every other frame retries the\n same refusal only while the retry falls due before the next frame's\n due time (\"intervalMs\":0 is one attempt), so retries never take a\n later frame's slot; an attempt still under way when the next frame\n falls due delays it by what is left of that attempt, as any slow\n screenshot does. No other error is retried. A frame that took more\n than one attempt says how many in \"attempts\". 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 \"attempts\" (only when > 1)}],\n \"devicePixelRatio\",\"cssViewport\",\"colorScheme\",\"runtimeReady\",\"network\"}\n A frame that could not be taken, or was still refused at its deadline,\n 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 An image URL this document already decoded is NOT observed arriving:\n Chromium 158 serves it again with no request, even under --no-cache\n (Chromium 147 refetched it); only a new URL or a reload reaches the\n network. So give the candidate a URL the document has not decoded,\n such as a per-candidate query string (\"cand.png?2\").\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 On Chromium 158 a candidate URL this document already decoded is\n served with no request, even under --no-cache: only a new URL or a\n reload reaches the network, so a slow-network candidate needs its own\n URL (a per-candidate query string).\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 It does NOT reach the document's in-memory image\n cache: on Chromium 158 a URL this page already\n decoded is answered at once, throttle or not -- give\n a repeated mediaOverride candidate its own URL\n (e.g. ?2).\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;
|
package/dist/inject-cli.d.ts.map
CHANGED
|
@@ -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,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AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,EACjE,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,GACjD,OAAO,CAAC,OAAO,CAAC,CA4ClB;AA0KD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAoBtD;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,SAAS,UAAU,EAAE,EAC3B,MAAM,GAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAe,GACrE,OAAO,CAAC,cAAc,CAAC,CAwCzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkZ32CC665_cjs = require('../chunk-Z32CC665.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "HandlerRegistry", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkZ32CC665_cjs.HandlerRegistry; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "LiveSessionTransport", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkZ32CC665_cjs.LiveSessionTransport; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "SCREENSHOT_ACTION", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkZ32CC665_cjs.SCREENSHOT_ACTION; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "SCREENSHOT_CAPABILITY", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkZ32CC665_cjs.SCREENSHOT_CAPABILITY; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "SCREENSHOT_TIMEOUT_MS", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkZ32CC665_cjs.SCREENSHOT_TIMEOUT_MS; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "WrapperTransportError", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkZ32CC665_cjs.WrapperTransportError; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "captureScreenshotReply", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkZ32CC665_cjs.captureScreenshotReply; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "registerScreenshotCapture", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkZ32CC665_cjs.registerScreenshotCapture; }
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.cjs.map
|
|
40
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@qontinui/ui-bridge-wrapper/live` — the BROWSER-SAFE entry.
|
|
3
|
+
*
|
|
4
|
+
* Everything a browser (an extension content script, a page) needs to be a
|
|
5
|
+
* live wrapper instance on the runner's `/ui-bridge/ws`: the live transport,
|
|
6
|
+
* its handler registry and error type, and the `getScreenshot` contract.
|
|
7
|
+
*
|
|
8
|
+
* NODE-FREE by contract. Nothing reachable from this file may import a Node
|
|
9
|
+
* builtin (`node:fs`, `module`, …), `playwright`, `inject-cli` or
|
|
10
|
+
* `InjectedTransport`, or touch `Buffer` / `process` / `require`. The package
|
|
11
|
+
* root (`.`) re-exports Node-only transports, so a bundle of it carries
|
|
12
|
+
* top-level `require("module")`-style calls that throw in a content script;
|
|
13
|
+
* this entry exists so a browser bundle never walks that graph.
|
|
14
|
+
* `ui-bridge-extension`'s `tests/content-bundle-node-free.test.ts` fails the
|
|
15
|
+
* build output if that ever regresses.
|
|
16
|
+
*
|
|
17
|
+
* SHARED CLASSES. This entry and the package root are built with code
|
|
18
|
+
* splitting, so within ONE module format they share a single copy of
|
|
19
|
+
* `WrapperTransportError`, `HandlerRegistry` and `LiveSessionTransport`: a
|
|
20
|
+
* `./live` error thrown through a root registry keeps its code
|
|
21
|
+
* (`tests/live-entry-shared.test.ts`). Across formats they do NOT — the CJS
|
|
22
|
+
* build (`require`) and the ESM build (`import`) are separate copies, the
|
|
23
|
+
* usual dual-package hazard — so do not mix a `require` of one entry with an
|
|
24
|
+
* `import` of the other in one process.
|
|
25
|
+
*/
|
|
26
|
+
export { WrapperTransportError } from '../types.js';
|
|
27
|
+
export type { WrapperTransport, WrapperTransportKind, WrapperTransportStatus, TransportConfig, CommandResponse, } from '../types.js';
|
|
28
|
+
export { HandlerRegistry, type WrapperHandler } from '../handler-registry.js';
|
|
29
|
+
export { LiveSessionTransport, type LiveContext, type LiveTransportOptions, } from '../transports/live.js';
|
|
30
|
+
export { SCREENSHOT_CAPABILITY, SCREENSHOT_ACTION, SCREENSHOT_TIMEOUT_MS, registerScreenshotCapture, captureScreenshotReply, type ScreenshotReply, type ScreenshotRegistrar, type ScreenshotCaptureOptions, } from '../screenshot-capture.js';
|
|
31
|
+
export type { FramePage } from '../frame-page.js';
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/live/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { HandlerRegistry, LiveSessionTransport, SCREENSHOT_ACTION, SCREENSHOT_CAPABILITY, SCREENSHOT_TIMEOUT_MS, WrapperTransportError, captureScreenshotReply, registerScreenshotCapture } from '../chunk-IKHDNIU4.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|