@orkestrel/browser 0.0.1
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/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/src/core/index.cjs +1209 -0
- package/dist/src/core/index.cjs.map +1 -0
- package/dist/src/core/index.d.cts +742 -0
- package/dist/src/core/index.d.ts +742 -0
- package/dist/src/core/index.js +1174 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/server/index.cjs +1172 -0
- package/dist/src/server/index.cjs.map +1 -0
- package/dist/src/server/index.d.cts +567 -0
- package/dist/src/server/index.d.ts +567 -0
- package/dist/src/server/index.js +1120 -0
- package/dist/src/server/index.js.map +1 -0
- package/package.json +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orkestrel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @orkestrel/browser
|
|
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
|
+
`BrowserCodegen`) never touches `node:*` or the DOM; the Node runtime (`src/server`)
|
|
8
|
+
adapts it with a `WebSocketCDPTransport`, browser process launch/discovery
|
|
9
|
+
(`node:child_process` + `fetch`), a filesystem screenshot writer, and the
|
|
10
|
+
`Browser` façade that ties launch → context → page together. Part of the
|
|
11
|
+
`@orkestrel` line.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install @orkestrel/browser
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- Node.js >= 24 for the server surface (the core surface is environment-agnostic)
|
|
22
|
+
- ESM and CommonJS builds ship for both the core and server entry points
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
Launch or connect to a browser and drive a page from Node:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { createBrowser } from '@orkestrel/browser/server'
|
|
30
|
+
|
|
31
|
+
const browser = createBrowser()
|
|
32
|
+
await browser.connect()
|
|
33
|
+
const page = await browser.create({ url: 'https://example.com' })
|
|
34
|
+
await page.click('#submit')
|
|
35
|
+
await page.screenshot({ path: 'example.png' })
|
|
36
|
+
await browser.destroy()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Drive the same protocol from any environment by injecting your own transport
|
|
40
|
+
over the environment-agnostic core:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { CDPClient } from '@orkestrel/browser'
|
|
44
|
+
import type { CDPTransportInterface } from '@orkestrel/browser'
|
|
45
|
+
|
|
46
|
+
const transport: CDPTransportInterface = /* your injected transport */
|
|
47
|
+
const client = new CDPClient({ transport })
|
|
48
|
+
await client.connect()
|
|
49
|
+
const result = await client.send('Page.navigate', { url: 'https://example.com' })
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Guide
|
|
53
|
+
|
|
54
|
+
For the full surface — the CDP dispatch core, the `BrowserContext` /
|
|
55
|
+
`BrowserPage` / `BrowserCodegen` entities, the server transports, and usage
|
|
56
|
+
patterns — see [`guides/src/browser.md`](guides/src/browser.md).
|
|
57
|
+
|
|
58
|
+
## Package
|
|
59
|
+
|
|
60
|
+
Published with two entry points per the `exports` field in `package.json`:
|
|
61
|
+
the environment-agnostic core (`.`) — `CDPClient`, `BrowserContext`,
|
|
62
|
+
`BrowserPage`, `BrowserCodegen`, `createCDPClient`, `CDPTransportInterface` —
|
|
63
|
+
and the Node-only server surface (`./server`) — `Browser`, `createBrowser`,
|
|
64
|
+
`createCDPTransport`, `createScreenshotWriter`, `WebSocketCDPTransport`.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT © [Orkestrel](https://github.com/orkestrel) — see [LICENSE](./LICENSE).
|