@ai-ecoverse/slicc-shared-web 1.29.12 → 1.29.13

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 CHANGED
@@ -300,7 +300,7 @@ test('boots', async (t) => {
300
300
  - both errors end with the last five lines of the browser's stderr, and each test keeps up to 200 lines it wrote during the test in `chrome-stderr.log`.
301
301
  - a test that saw a renderer crash, or a browser that died of anything but `SIGKILL`, keeps Chrome's minidump of it as `<id>.dmp` in its artifact directory (see [Crash dumps](#crash-dumps)).
302
302
 
303
- `chrome.cdp` is the browser's own pipe, the one the harness already drives, with no session of its own: test-only, unguarded access that bypasses everything a product guard would do, and never for product code. `send(method, params, sessionId)` makes a raw call at browser level, or in any session the browser has (the harness's auto-attached ones included); a protocol error rejects with the message and keeps the error object as `error.cdp`. `on(listener)` receives every event the browser sends, as `{ method, params, sessionId }`, until `off(listener)` or the function `on` returned. `waitEvent(method, predicate, ms)` resolves with the next matching event (call it before the action that causes the event); the predicate is optional, a predicate alone works too (`waitEvent(predicate, ms)`), and it rejects after `ms` (10 s unless given). `events` is an append-only array of every event since it was first read. That is the `{ send, waitEvent, events }` client the guard runner of `@ai-ecoverse/slicc-browsers` takes, so `run(set, { client, unguarded: chrome.cdp, … })` gives it the unguarded observer that 14 of its vectors need.
303
+ `chrome.cdp` is the browser's own pipe, the one the harness already drives, with no session of its own: test-only, unguarded access that bypasses everything a product guard would do, and never for product code. `send(method, params, sessionId, ms)` makes a raw call at browser level, or in any session the browser has (the harness's auto-attached ones included), and rejects with `<method>: no answer in <ms> ms` after the caller's `ms` (60 s unless given); a protocol error rejects with the message and keeps the error object as `error.cdp`. `on(listener)` receives every event the browser sends, as `{ method, params, sessionId }`, until `off(listener)` or the function `on` returned. `waitEvent(method, predicate, ms)` resolves with the next matching event (call it before the action that causes the event); the predicate is optional, a predicate alone works too (`waitEvent(predicate, ms)`), and it rejects after `ms` (10 s unless given). `events` is an append-only array of every event since it was first read. That is the `{ send, waitEvent, events }` client the guard runner of `@ai-ecoverse/slicc-browsers` takes, so `run(set, { client, unguarded: chrome.cdp, … })` gives it the unguarded observer that 14 of its vectors need.
304
304
 
305
305
  When one evaluation runs past `stallAfter`, the harness probes once, without interrupting the wait:
306
306
  - it adds a `pending` line to `console.log` for every navigation and request of the page that has no answer yet, with its age. A worker's script loads in the worker's own session, so its request is left out. Chrome holds CDP messages to a page while a navigation is waiting for its response, so an evaluation that hangs while the page is idle usually means one of these;
@@ -7,7 +7,7 @@ import { env as inherited } from 'node:process';
7
7
  import { promisify } from 'node:util';
8
8
  import { executablePath, explicit } from './browser.mjs';
9
9
  import { cdn } from './cdn.mjs';
10
- import { CRASHED, connect, pipe } from './cdp.mjs';
10
+ import { CRASHED, connect, pipe, SEND_TIMEOUT } from './cdp.mjs';
11
11
  import { crashpad } from './dumps.mjs';
12
12
  import {
13
13
  builtinWanted,
@@ -262,7 +262,8 @@ export function unguarded(cdp) {
262
262
  return () => off(listener);
263
263
  };
264
264
  return {
265
- send: (method, params = {}, sessionId = undefined) => cdp.send(method, params, sessionId),
265
+ send: (method, params = {}, sessionId = undefined, ms = SEND_TIMEOUT) =>
266
+ cdp.send(method, params, sessionId, ms),
266
267
  on,
267
268
  off,
268
269
  get events() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "1.29.12",
3
+ "version": "1.29.13",
4
4
  "description": "Shared Renovate, Biome, TypeScript, lefthook and GitHub Actions configuration, plus the CDP integration-test harness, for SLICC's web repos",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",