@orkestrel/browser 0.0.14 → 0.0.16

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
@@ -1,16 +1,13 @@
1
1
  # @orkestrel/browser
2
2
 
3
- A typed [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/)
4
- browser automation library for the `@orkestrel` line. The environment-agnostic
5
- core (`src/core` — `CDPClient` speaking the CDP wire protocol over an injected
6
- `CDPTransportInterface`, plus `BrowserContext`, `BrowserPage`, and
7
- `BrowserFrame`, semantic locators, trusted input, network/HAR controls,
8
- diagnostics, structured DOM snapshots, content distillation that selects a
9
- document's article rather than its whole body text, and `BrowserCodegen`)
10
- never touches `node:*` or the DOM; the Node runtime (`src/server`)
11
- adapts it with a `WebSocketCDPTransport`, browser process launch/discovery
12
- (`node:child_process` + `fetch`), a filesystem screenshot writer, and the
13
- `Browser` façade that ties launch → context → page together. Part of the
3
+ > A lightweight Chrome DevTools Protocol automation layer for Chromium-family
4
+ > browsers: an environment-agnostic core that drives pages, frames, locators, and
5
+ > DOM snapshots over an injected transport, and a Node runtime that finds,
6
+ > launches, and connects to the browser itself.
7
+
8
+ Connect to a running browser or launch one with the `createBrowser` function, open a page in its
9
+ default context, and drive that page through locators, trusted input, network control, and DOM
10
+ snapshots. Inject your own `CDPTransportInterface` where the runtime is not Node. Part of the
14
11
  `@orkestrel` line.
15
12
 
16
13
  ## Install
@@ -47,29 +44,28 @@ Drive the same protocol from any environment by injecting your own transport
47
44
  over the environment-agnostic core:
48
45
 
49
46
  ```ts
50
- import { CDPClient } from '@orkestrel/browser'
51
- import type { CDPTransportInterface } from '@orkestrel/browser'
47
+ import { createCDPClient } from '@orkestrel/browser'
52
48
 
53
- const transport: CDPTransportInterface = /* your injected transport */
54
- const client = new CDPClient({ transport })
49
+ const client = createCDPClient({ transport }) // transport: CDPTransportInterface
55
50
  await client.connect()
56
51
  const result = await client.send('Page.navigate', { url: 'https://example.com' })
52
+ await client.close()
57
53
  ```
58
54
 
59
55
  ## Guide
60
56
 
61
- For the full surface — the CDP dispatch core, the `BrowserContext` /
62
- `BrowserPage` / `BrowserCodegen` entities, the server transports, and usage
63
- patterns — see [`guides/src/browser.md`](guides/src/browser.md).
57
+ For the full surface — the CDP dispatch core, the `BrowserContext`,
58
+ `BrowserPage`, and `BrowserCodegen` classes, the server transports, and usage
59
+ patterns — see [`guides/browser.md`](guides/browser.md).
64
60
 
65
61
  ## Package
66
62
 
67
- Published with two entry points per the `exports` field in `package.json`:
63
+ Published with the entry points the `exports` field in `package.json` names:
68
64
  the environment-agnostic core (`.`) — `CDPClient`, `BrowserContext`,
69
65
  `BrowserPage`, `BrowserFrame`, DOM snapshot traversal helpers,
70
66
  `BrowserCodegen`, `createCDPClient`, `CDPTransportInterface` —
71
67
  and the Node-only server surface (`./server`) — `Browser`, `createBrowser`,
72
- `createCDPTransport`, `createScreenshotWriter`, `WebSocketCDPTransport`.
68
+ `createCDPTransport`, `createBrowserWriter`, `WebSocketCDPTransport`.
73
69
 
74
70
  ## License
75
71