omowright 0.3.0 → 0.3.2

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.
@@ -28,6 +28,7 @@
28
28
  li: "listitem",
29
29
  p: "paragraph",
30
30
  label: "label",
31
+ output: "status",
31
32
  };
32
33
  const VALID_ARIA_ROLES = /* @__PURE__ */ new Set([
33
34
  "alert",
@@ -422,8 +423,13 @@
422
423
  .map((id) => doc.getElementById(id))
423
424
  .filter(Boolean);
424
425
  }
426
+ // aria-hidden is an ASCII case-insensitive token: "TRUE" hides like "true"; any other value is the spec's
427
+ // undefined state and hides nothing.
428
+ function hasAriaHiddenTrue(element) {
429
+ return element.getAttribute("aria-hidden")?.toLowerCase() === "true";
430
+ }
425
431
  function isHiddenForAria(element) {
426
- if (element.getAttribute("aria-hidden") === "true") return true;
432
+ if (hasAriaHiddenTrue(element)) return true;
427
433
  try {
428
434
  const style = window.getComputedStyle(element);
429
435
  if (style.display === "none" || style.visibility === "hidden") return true;
@@ -704,7 +710,7 @@
704
710
  return result;
705
711
  }
706
712
  function isVisibleUncached(element) {
707
- if (element.getAttribute("aria-hidden") === "true") return false;
713
+ if (hasAriaHiddenTrue(element)) return false;
708
714
  const targetVisibility = window.getComputedStyle(element).visibility;
709
715
  let hasContentsAncestor = false;
710
716
  for (
@@ -794,7 +800,7 @@
794
800
  function shouldTraverse(element, options) {
795
801
  const tag = element.tagName.toLowerCase();
796
802
  if (SKIP_TAGS.has(tag)) return false;
797
- if (element.getAttribute("aria-hidden") === "true" && element.children.length === 0) return false;
803
+ if (hasAriaHiddenTrue(element) && element.children.length === 0) return false;
798
804
  if (!options.showHidden && !isVisible(element)) {
799
805
  if (tag === "input") {
800
806
  const type = element.type;
@@ -1048,7 +1054,11 @@
1048
1054
  : [];
1049
1055
  return;
1050
1056
  }
1051
- if (withoutWhitespace(current.name) === withoutWhitespace(merged)) current.children = [];
1057
+ if (withoutWhitespace(current.name) === withoutWhitespace(merged))
1058
+ current.children =
1059
+ current.element && !getLiveRegionRoot(current.element)
1060
+ ? nestedLiveTexts(current.element, withoutWhitespace(texts.join(" ")), withoutWhitespace(current.name))
1061
+ : [];
1052
1062
  };
1053
1063
  // Capped text of the live regions inside `element` that appears in the node's text but not in its cut name.
1054
1064
  const nestedLiveTexts = (element, fullText, nameText) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omowright",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "OmOWright browser automation for standard Chromium CDP endpoints.",
5
5
  "keywords": [
6
6
  "accessibility-snapshot",
@@ -46,35 +46,38 @@
46
46
  "provenance": true
47
47
  },
48
48
  "scripts": {
49
- "test": "bun test",
49
+ "test": "bun test --parallel",
50
50
  "test:node": "bun scripts/node-test.ts",
51
51
  "test:cloak-profile": "bun test test/cloak-profile.test.ts test/cloak-profile.integration.test.ts",
52
- "typecheck": "tsc --noEmit -p tsconfig.json",
52
+ "typecheck": "bun check --no-script --no-pretty -p tsconfig.json",
53
53
  "typecheck:control": "bun scripts/typecheck-control.ts",
54
54
  "check": "bun run typecheck:control && bun run typecheck && bun run lint && bun run fmt:check",
55
- "lint": "oxlint --deny-warnings src bin bridge test scripts",
55
+ "lint": "oxlint --deny-warnings src bin bridge test scripts && bun scripts/lint-ratchet.ts",
56
+ "lint:ratchet:update": "bun scripts/lint-ratchet.ts --update",
56
57
  "lint:fix": "oxlint --fix src bin bridge test scripts",
57
- "fmt": "oxfmt --write src bin bridge test scripts",
58
- "fmt:check": "oxfmt --check src bin bridge test scripts",
58
+ "fmt": "bun fmt --no-script --write src bin bridge test scripts",
59
+ "fmt:check": "bun fmt --no-script --check src bin bridge test scripts",
59
60
  "format": "bun run fmt",
60
61
  "format:check": "bun run fmt:check",
61
62
  "verify": "bun run check",
63
+ "check:push": "bun run check && bun run build && git diff --exit-code HEAD --",
64
+ "prepare": "husky",
62
65
  "build": "bun build.ts",
63
66
  "build:extension": "bun bridge/build-extension.ts",
64
67
  "prepack": "bun run build",
65
68
  "preversion": "git diff --quiet HEAD --"
66
69
  },
67
70
  "dependencies": {
68
- "ws": "^8.18.3",
69
- "zod": "^4.1.5"
71
+ "ws": "^8.23.0",
72
+ "zod": "^4.6.7"
70
73
  },
71
74
  "devDependencies": {
72
- "@types/bun": "1.4.4",
73
- "acorn": "8.15.0",
74
- "gpt-tokenizer": "4.1.0",
75
- "oxfmt": "^0.77.0",
76
- "oxlint": "^1.92.0",
77
- "typescript": "^7.0.2",
75
+ "@types/bun": "1.4.5",
76
+ "acorn": "8.19.0",
77
+ "gpt-tokenizer": "4.1.2",
78
+ "husky": "9.1.7",
79
+ "oxc-parser": "0.159.0",
80
+ "oxlint": "^1.94.0",
78
81
  "typescript-5": "npm:typescript@5.9.3"
79
82
  },
80
83
  "engines": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: omowright
3
- description: "The default code-driven browser path for interactive browsing work: drives any browser from code with token-efficient a11y snapshots (57% smaller via compactSnapshot), ref-based clicks, coordinate control (CUA), viewport pinning, CAPTCHA solving (reCAPTCHA, Turnstile, hCaptcha, slider, OCR), Chrome MV3 APIs (tabs/bookmarks/history/downloads/topSites), network snoop (read API JSON instead of DOM), flight-recorder trace (jsonl + HAR + screenshots), OOPIF-aware snapshots, dialog policy, human handoff for login/OTP, device emulation, request routes, and one connectBrowser() entry that picks the engine in priority order: the user's agent browser (Aside, Ego Lite), then the user's own browser through BrowserSkill, then the owned stealth CloakBrowser with zero exposed CDP ports; each engine has its own setup check (asideOnboard, bskOnboard). MUST USE for interactive browser work: scraping, blocked/WAF/JS-rendered pages, logins, the user's logged-in sites and open tabs, extension popups, form filling, screenshots, web QA, CAPTCHAs. The ulw-research browsing lane runs on ultimate-browsing, not this skill."
3
+ description: "The default code-driven browser path for interactive browsing work: drives any browser from code with token-efficient a11y snapshots (compactSnapshot drops the refs map), ref-based clicks, coordinate control (CUA), viewport pinning, CAPTCHA input helpers for reCAPTCHA, Turnstile, hCaptcha, slider and text OCR, with a human fallback (not a solver), Chrome MV3 APIs (tabs/bookmarks/history/downloads/topSites), network snoop (read API JSON instead of DOM), flight-recorder trace (jsonl + HAR + screenshots), OOPIF-aware snapshots, dialog policy, human handoff for login/OTP, device emulation, request routes, and one connectBrowser() entry that picks the engine in priority order: the user's agent browser (Aside, Ego Lite), then the user's own browser through BrowserSkill, then the owned stealth CloakBrowser with zero exposed CDP ports; each engine has its own setup check (asideOnboard, bskOnboard). MUST USE for interactive browser work: scraping, blocked/WAF/JS-rendered pages, logins, the user's logged-in sites and open tabs, extension popups, form filling, screenshots, web QA, CAPTCHAs. The ulw-research browsing lane runs on ultimate-browsing, not this skill."
4
4
  ---
5
5
 
6
6
  # OmOWright
@@ -30,7 +30,8 @@ const { engine, handle, attempts } = await connectBrowser({ allow: ["aside", "eg
30
30
  `attempts` has one entry per engine in order: `ok`, `ms`, and `verified` (the
31
31
  check that proved it attached) or the `reason` it did not (often one step only
32
32
  the user can take, such as `aside login`); engines after the primary read
33
- `not tried`. `crossCheck: true` also attaches the other allowed engines, returned
33
+ `not tried` when allowed, or `not allowed by the caller` when excluded from `allow`.
34
+ `crossCheck: true` also attaches the other allowed engines, returned
34
35
  in `crossCheck` and listed in `attached`. Each is a SECOND BROWSER (a BrowserSkill
35
36
  tab has no CDP endpoint): compare results through it, act through `handle`, and
36
37
  end with `await result.closeAll()`, which closes every handle the call opened. When a
@@ -150,6 +151,8 @@ screenshot — coordinates read off an unpinned screenshot are stale.
150
151
  | First use, page API, snapshot options, locator rules | `references/quickstart.md`; dialogs and readiness in `TOOLS.md` |
151
152
  | Driving a browser inside `eval` cells, kernel persistence, parallel lanes | `references/eval-kernel.md` |
152
153
  | Tabs/windows/bookmarks/history/downloads/topSites (Chrome MV3) | `presets/chrome/SKILL.md` |
154
+ | Tab, popup and download lifecycle as push events, manager-owned background tabs (no polling) | `presets/agent-events/SKILL.md` |
155
+ | A user-driven CloakBrowser profile that needs MV3 Chrome writes/events through the native-messaging bridge | `presets/cloak-bridge/SKILL.md` |
153
156
  | API JSON instead of DOM scraping, wait for a request, infinite scroll, QA flight trace (jsonl/HAR), request routes | `presets/network/SKILL.md` |
154
157
  | Cross-origin iframes and shadow DOM, overlays that swallow clicks, login/OTP handoff to a human, device emulation | `references/frames-layers-human.md` |
155
158
  | Reading an item from the 1Password web vault (tab-scoped session, sign-in check, secret handling) | `references/1password.md` |
@@ -164,7 +167,8 @@ Preset and `TOOLS.md` paths are relative to the package root.
164
167
  cookies. Detail in `references/stealth.md`. Cookie reuse is fine for ordinary
165
168
  sessions (Grafana, internal tools).
166
169
  - **Always `compactSnapshot()`** before sending a snapshot to a model — the refs
167
- map is ~54% of bytes and resolves in-page, so dropping it is free.
170
+ map resolves in-page, so dropping it is free; it was 7% to 64% of the bytes
171
+ across pages measured on 2026-11-09.
168
172
  - **Refs die on every new snapshot.** Pass `page.locator("e1")` straight from the
169
173
  latest snapshot; never reuse a ref across snapshots, never put one in CSS.
170
174
  - **Refs stay page-level.** Child-frame refs look like `f1e3` and still go to
@@ -183,7 +187,7 @@ Preset and `TOOLS.md` paths are relative to the package root.
183
187
 
184
188
  ## Delegating the pixel loop
185
189
 
186
- CAPTCHA solving and pixel-level visual browsing are iterative (screenshot, reason,
190
+ Working through a CAPTCHA and pixel-level visual browsing are iterative (screenshot, reason,
187
191
  act, verify). When that loop would consume your own context, delegate the blocked
188
192
  page to a `deep` subagent that loads these references. Drive it yourself when the
189
193
  flow is short or the state is already in your hands.
@@ -5,7 +5,7 @@ Ego Lite is second in `connectBrowser()`'s order. Its CDP bindings
5
5
  load omowright there by absolute path:
6
6
 
7
7
  ```bash
8
- ego-browser nodejs -e "const { connectBrowser } = await import('file:///<abs>/omowright/src/index.js'); const { handle: browser } = await connectBrowser({ allow: ['ego'] }); const page = await browser.newTab('https://example.com'); console.log(await page.title()); await browser.close();"
8
+ ego-browser nodejs -e "const { connectBrowser } = await import('file:///<abs>/omowright/src/index.ts'); const { handle: browser } = await connectBrowser({ allow: ['ego'] }); const page = await browser.newTab('https://example.com'); console.log(await page.title()); await browser.close();"
9
9
  ```
10
10
 
11
11
  The script runs as ESM with top-level await, outside your shell's working
@@ -21,4 +21,4 @@ One client at a time owns Ego's callbacks in a runtime: a second connect
21
21
  rejects with `ego_busy` and changes nothing, so close the first.
22
22
  `close()` releases the callbacks and leaves the user's browser running.
23
23
  Sends Ego refuses (the user took the space over, no space selected) reject at
24
- once with Ego's `error_code`, such as `EGO_TASK_SPACE_USER_CONTROLLED`.
24
+ once with Ego's `error_code`, such as `EGO_TASK_SPACE_USER_IN_CONTROL`.
@@ -46,7 +46,10 @@ await userBrowser.close();
46
46
  ```
47
47
 
48
48
  Always launch with a dedicated `--user-data-dir` (a `mkdtemp` dir) and delete it
49
- after `browser.close()`. Under Node, `node:sqlite` loads lazily with a
49
+ after `browser.close()`. On Windows a second launch on Chrome's shared default
50
+ profile exits with code 21. Also on Windows, write `browserPath` with forward
51
+ slashes or `String.raw`: backslashes in a plain string literal are escapes
52
+ (usually ENOENT, a SyntaxError for segments such as `\u`). Under Node, `node:sqlite` loads lazily with a
50
53
  `bun:sqlite` fallback under Bun (see Runtime above).
51
54
 
52
55
  ## Page essentials
@@ -69,7 +72,7 @@ await page.close();
69
72
 
70
73
  ```js
71
74
  const snap = await page.snapshot(); // { tree, refs } or JSON string
72
- const tree = compactSnapshot(snap); // raw tree, ~57% smaller
75
+ const tree = compactSnapshot(snap); // raw tree without the refs map: 7%-64% smaller on pages measured 2026-11-09
73
76
  await page.snapshot({ interactive: true }); // controls, headings, landmarks and state feedback
74
77
  await page.snapshot({ maxDepth: 20, maxChars: 4000, selector: "main" });
75
78
  ```
@@ -12,7 +12,10 @@ python3 -c "import cloakbrowser, json; print(cloakbrowser.binary_info()['binary_
12
12
  ```
13
13
 
14
14
  Not installed: `uv pip install "cloakbrowser==0.5.7"` in a venv, then
15
- `python -c "import cloakbrowser; cloakbrowser.ensure_binary()"`.
15
+ `python -c "import cloakbrowser; cloakbrowser.ensure_binary()"`. The pin is
16
+ deliberate: these docs are written against 0.5.7, and current releases (0.7.1
17
+ on 2026-11-07) ask for a license key on every launch. Moving it is a separate,
18
+ tested change.
16
19
 
17
20
  ## Single-instance rule
18
21