omowright 0.3.5 → 0.3.6

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/index.js CHANGED
@@ -24479,21 +24479,38 @@ function redactValue(error, value) {
24479
24479
  return `<redacted, unreadable ${typeof payload}>`;
24480
24480
  }
24481
24481
  };
24482
- if (!(error instanceof Error))
24483
- return scrubPayload(error);
24484
24482
  const seen = new Set;
24485
- for (let link = error;link instanceof Error && !seen.has(link); link = link.cause) {
24483
+ function scrubMember(member) {
24484
+ if (member instanceof Error) {
24485
+ scrubError(member);
24486
+ return member;
24487
+ }
24488
+ if (Array.isArray(member)) {
24489
+ const items = member;
24490
+ if (items.some((item) => item instanceof Error))
24491
+ return items.map((item) => scrubMember(item));
24492
+ }
24493
+ return scrubPayload(member);
24494
+ }
24495
+ function scrubError(link) {
24496
+ if (seen.has(link))
24497
+ return;
24486
24498
  seen.add(link);
24487
24499
  link.message = scrub(link.message);
24488
24500
  if (link.stack !== undefined)
24489
24501
  link.stack = scrub(link.stack);
24490
- const data = Reflect.get(link, "data");
24491
- if (data !== undefined)
24492
- Reflect.set(link, "data", scrubPayload(data));
24493
- if (link.cause !== undefined && !(link.cause instanceof Error))
24494
- link.cause = scrubPayload(link.cause);
24502
+ for (const key of Reflect.ownKeys(link)) {
24503
+ if (key === "message" || key === "stack")
24504
+ continue;
24505
+ const descriptor = Reflect.getOwnPropertyDescriptor(link, key);
24506
+ if (descriptor === undefined || !("value" in descriptor))
24507
+ continue;
24508
+ const scrubbed = scrubMember(descriptor.value);
24509
+ if (!Reflect.set(link, key, scrubbed))
24510
+ Reflect.defineProperty(link, key, { ...descriptor, value: scrubbed });
24511
+ }
24495
24512
  }
24496
- return error;
24513
+ return scrubMember(error);
24497
24514
  }
24498
24515
 
24499
24516
  // src/core.ts
@@ -35719,7 +35736,7 @@ async function snapshotWithFrames(page, opts = {}) {
35719
35736
  // package.json
35720
35737
  var package_default = {
35721
35738
  name: "omowright",
35722
- version: "0.3.5",
35739
+ version: "0.3.6",
35723
35740
  description: "OmOWright browser automation for standard Chromium CDP endpoints.",
35724
35741
  keywords: [
35725
35742
  "accessibility-snapshot",
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * Strips a value being entered (fill/type) out of the error its failure raised, so a secret typed
3
3
  * into a form never reaches an agent transcript (#335). The layers below (a CDP transport, the
4
- * BrowserSkill daemon) may quote the command they refused, raw or JSON-escaped, in the message,
5
- * the stack, a `data` payload or a cause of any type; each is rewritten in place down the cause chain.
4
+ * BrowserSkill daemon) may quote the command they refused, raw or JSON-escaped, anywhere in what they
5
+ * throw: the message, the stack, a cause of any type, an `AggregateError`'s members, or a field of
6
+ * their own (`data`, `request`). Every own property of every error reachable from the one raised is
7
+ * rewritten in place, so no list of known error shapes has to keep up with them (#362).
6
8
  * A value of four characters or more is removed even where it touches a letter or a digit
7
9
  * (`field7<value>`); a shorter one is removed only as a whole token, because taking one or two
8
10
  * letters out of every word would leave the message unreadable (fill("a") must keep "locator").
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omowright",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "OmOWright browser automation for standard Chromium CDP endpoints.",
5
5
  "keywords": [
6
6
  "accessibility-snapshot",
@@ -95,6 +95,10 @@ handoff holds the kernel until they finish. Subscribe the harness watcher to a
95
95
  flag file first, start the handoff without `await`, and end the cell:
96
96
 
97
97
  ```js
98
+ const { requestHuman } = await import("omowright");
99
+ const fs = await import("node:fs");
100
+ const os = await import("node:os");
101
+ const path = await import("node:path");
98
102
  const flag = path.join(os.tmpdir(), `omowright-handoff-${Date.now()}.flag`);
99
103
  await tool.monitor({ description: "handoff finished", path: flag, event: "create" }); // omo's watcher; subscribe first
100
104
  globalThis.omwHandoff = requestHuman(page, {