opensteer 0.9.2 → 0.9.4
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 +158 -165
- package/dist/{chunk-HD6KVZ42.js → chunk-GEUHKPC2.js} +46 -16
- package/dist/chunk-GEUHKPC2.js.map +1 -0
- package/dist/{chunk-2TIVULZY.js → chunk-GSCQQKZZ.js} +53 -9
- package/dist/chunk-GSCQQKZZ.js.map +1 -0
- package/dist/{chunk-KPYLS2KQ.js → chunk-HQCMXRBE.js} +5 -4
- package/dist/chunk-HQCMXRBE.js.map +1 -0
- package/dist/{chunk-BMPUL66S.js → chunk-T5P2QGZ3.js} +58 -53
- package/dist/chunk-T5P2QGZ3.js.map +1 -0
- package/dist/{chunk-FIMNKEG5.js → chunk-ZRF7WMS3.js} +4 -4
- package/dist/{chunk-FIMNKEG5.js.map → chunk-ZRF7WMS3.js.map} +1 -1
- package/dist/cli/bin.cjs +160 -72
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.js +17 -7
- package/dist/cli/bin.js.map +1 -1
- package/dist/index.cjs +149 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +4 -4
- package/dist/local-view/public/assets/app.css +219 -55
- package/dist/local-view/public/assets/app.js +58 -2
- package/dist/local-view/public/index.html +101 -26
- package/dist/local-view/serve-entry.cjs +106 -57
- package/dist/local-view/serve-entry.cjs.map +1 -1
- package/dist/local-view/serve-entry.js +2 -2
- package/dist/opensteer-PJI7VUIT.js +6 -0
- package/dist/{opensteer-MIQ43CY4.js.map → opensteer-PJI7VUIT.js.map} +1 -1
- package/dist/{session-control-IFE3IPS3.js → session-control-M3JD7ZKA.js} +4 -4
- package/dist/{session-control-IFE3IPS3.js.map → session-control-M3JD7ZKA.js.map} +1 -1
- package/package.json +5 -5
- package/skills/opensteer/SKILL.md +7 -8
- package/skills/recorder/SKILL.md +43 -48
- package/dist/chunk-2TIVULZY.js.map +0 -1
- package/dist/chunk-BMPUL66S.js.map +0 -1
- package/dist/chunk-HD6KVZ42.js.map +0 -1
- package/dist/chunk-KPYLS2KQ.js.map +0 -1
- package/dist/opensteer-MIQ43CY4.js +0 -6
- package/skills/recorder/references/recorder-reference.md +0 -71
package/README.md
CHANGED
|
@@ -1,211 +1,204 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- This file is generated from the repository README. Run `node scripts/sync-package-readme.mjs`. -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Opensteer</strong><br/>
|
|
5
|
+
<em>AI Browser Automation Framework</em>
|
|
6
|
+
</p>
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/opensteer"><img src="https://img.shields.io/npm/v/opensteer.svg" alt="npm version" /></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/opensteer"><img src="https://img.shields.io/npm/dm/opensteer.svg" alt="npm downloads" /></a>
|
|
11
|
+
<a href="https://github.com/steerlabs/opensteer/blob/main/LICENSE"><img src="https://img.shields.io/github/license/steerlabs/opensteer.svg" alt="license" /></a>
|
|
12
|
+
<a href="https://github.com/steerlabs/opensteer/stargazers"><img src="https://img.shields.io/github/stars/steerlabs/opensteer.svg" alt="stars" /></a>
|
|
13
|
+
</p>
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://opensteer.com">Website</a> ·
|
|
17
|
+
<a href="https://docs.opensteer.com">Docs</a> ·
|
|
18
|
+
<a href="https://github.com/steerlabs/opensteer">GitHub</a> ·
|
|
19
|
+
<a href="https://discord.gg/opensteer">Discord</a>
|
|
20
|
+
</p>
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
Open-source browser automation framework for AI agents. CLI and TypeScript SDK that give coding agents a real Chromium browser with persistent sessions, network capture, and stealth -- so they can browse, inspect, and generate scrapers directly in your codebase.
|
|
14
25
|
|
|
15
26
|
## Install
|
|
16
27
|
|
|
17
28
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
npm i -g opensteer
|
|
30
|
+
```
|
|
20
31
|
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
Then install Chromium for Playwright:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
23
35
|
npx playwright install chromium
|
|
24
36
|
```
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
## Agent Quickstart
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
> **Using Claude Code, Codex, or Cursor?** Point your agent at Opensteer with a single command -- no manual setup needed.
|
|
29
41
|
|
|
30
42
|
```bash
|
|
31
|
-
opensteer
|
|
32
|
-
opensteer goto https://example.com/search --workspace demo --capture-network search
|
|
33
|
-
opensteer network query --workspace demo --capture search
|
|
34
|
-
opensteer network detail rec_123 --workspace demo
|
|
35
|
-
opensteer replay rec_123 --workspace demo
|
|
36
|
-
opensteer cookies example.com --workspace demo
|
|
37
|
-
opensteer storage example.com --workspace demo
|
|
38
|
-
opensteer state example.com --workspace demo
|
|
39
|
-
opensteer close --workspace demo
|
|
43
|
+
opensteer skills install
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
This installs first-party skills that teach your AI agent how to use the Opensteer CLI and SDK. The agent can then open browsers, capture network traffic, extract structured data, and generate scrapers autonomously.
|
|
47
|
+
|
|
48
|
+
Target specific agents:
|
|
43
49
|
|
|
44
50
|
```bash
|
|
51
|
+
opensteer skills install --agent codex --agent cursor --agent claude-code
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quickstart
|
|
55
|
+
|
|
56
|
+
### CLI
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Open a page in a persistent workspace
|
|
60
|
+
opensteer open https://example.com --workspace demo
|
|
61
|
+
|
|
62
|
+
# Take a snapshot and list interactive elements
|
|
45
63
|
opensteer snapshot action --workspace demo
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
opensteer
|
|
49
|
-
|
|
64
|
+
|
|
65
|
+
# Click an element by its annotated index
|
|
66
|
+
opensteer click 3 --workspace demo --persist "cta"
|
|
67
|
+
|
|
68
|
+
# Extract structured data from the page
|
|
69
|
+
opensteer extract '{"title":{"element":3}}' --workspace demo
|
|
70
|
+
|
|
71
|
+
# Close the workspace
|
|
72
|
+
opensteer close --workspace demo
|
|
50
73
|
```
|
|
51
74
|
|
|
52
|
-
|
|
75
|
+
### SDK
|
|
53
76
|
|
|
54
77
|
```ts
|
|
55
78
|
import { Opensteer } from "opensteer";
|
|
56
79
|
|
|
57
|
-
const opensteer = new Opensteer({
|
|
58
|
-
workspace: "demo",
|
|
59
|
-
rootDir: process.cwd(),
|
|
60
|
-
});
|
|
80
|
+
const opensteer = new Opensteer({ workspace: "demo", rootDir: process.cwd() });
|
|
61
81
|
|
|
62
82
|
await opensteer.open("https://example.com");
|
|
63
|
-
await opensteer.
|
|
64
|
-
|
|
65
|
-
|
|
83
|
+
await opensteer.click({ persist: "cta" });
|
|
84
|
+
const data = await opensteer.extract({ persist: "page summary" });
|
|
85
|
+
await opensteer.close();
|
|
86
|
+
```
|
|
66
87
|
|
|
67
|
-
|
|
68
|
-
capture: "search",
|
|
69
|
-
json: true,
|
|
70
|
-
});
|
|
88
|
+
## Features
|
|
71
89
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
90
|
+
<table>
|
|
91
|
+
<tr>
|
|
92
|
+
<td width="50%">
|
|
75
93
|
|
|
76
|
-
|
|
77
|
-
console.log(detail.transportProbe?.recommended);
|
|
78
|
-
```
|
|
94
|
+
### Persistent Sessions
|
|
79
95
|
|
|
80
|
-
|
|
96
|
+
Logins, cookies, and browser state survive across restarts. Each workspace is a full Chrome user-data directory.
|
|
81
97
|
|
|
82
|
-
|
|
98
|
+
### Profile Cloning
|
|
83
99
|
|
|
84
|
-
|
|
85
|
-
import { Opensteer } from "opensteer";
|
|
100
|
+
Clone a real Chrome profile to start a workspace already logged in. Source browser doesn't need to close.
|
|
86
101
|
|
|
87
|
-
|
|
88
|
-
workspace: "target",
|
|
89
|
-
rootDir: process.cwd(),
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
async function ensureTargetSession() {
|
|
93
|
-
const cookies = await opensteer.cookies(".target.com");
|
|
94
|
-
if (cookies.has("visitorId")) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
await opensteer.goto("https://target.com");
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export async function searchTarget(keyword: string, count = 24) {
|
|
101
|
-
await ensureTargetSession();
|
|
102
|
-
|
|
103
|
-
const response = await opensteer.fetch(
|
|
104
|
-
"https://redsky.target.com/redsky_aggregations/v1/web/plp_search_v2",
|
|
105
|
-
{
|
|
106
|
-
query: {
|
|
107
|
-
keyword,
|
|
108
|
-
count,
|
|
109
|
-
offset: 0,
|
|
110
|
-
channel: "WEB",
|
|
111
|
-
platform: "desktop",
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
return response.json();
|
|
117
|
-
}
|
|
118
|
-
```
|
|
102
|
+
### Network Capture
|
|
119
103
|
|
|
120
|
-
|
|
104
|
+
Record traffic during any action, inspect requests, and replay APIs with browser-backed `fetch()`.
|
|
121
105
|
|
|
122
|
-
|
|
123
|
-
const response = await opensteer.fetch("https://api.example.com/search", {
|
|
124
|
-
query: { keyword: "laptop" },
|
|
125
|
-
transport: "matched-tls",
|
|
126
|
-
});
|
|
127
|
-
```
|
|
106
|
+
### Script Analysis
|
|
128
107
|
|
|
129
|
-
|
|
108
|
+
Capture, beautify, deobfuscate, and sandbox page JavaScript.
|
|
130
109
|
|
|
131
|
-
|
|
110
|
+
</td>
|
|
111
|
+
<td width="50%">
|
|
132
112
|
|
|
133
|
-
|
|
134
|
-
const cookies = await opensteer.cookies("example.com");
|
|
135
|
-
const localStorage = await opensteer.storage("example.com", "local");
|
|
136
|
-
const sessionStorage = await opensteer.storage("example.com", "session");
|
|
137
|
-
const state = await opensteer.state("example.com");
|
|
138
|
-
```
|
|
113
|
+
### Computer Use
|
|
139
114
|
|
|
140
|
-
|
|
115
|
+
Coordinate-based mouse and keyboard when DOM targeting isn't enough.
|
|
141
116
|
|
|
142
|
-
|
|
143
|
-
cookies.has("session");
|
|
144
|
-
cookies.get("session");
|
|
145
|
-
cookies.getAll();
|
|
146
|
-
cookies.serialize();
|
|
147
|
-
```
|
|
117
|
+
### Stealth
|
|
148
118
|
|
|
149
|
-
|
|
119
|
+
Anti-detection defaults: UA spoofing, fingerprint management, automation signal removal.
|
|
150
120
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
121
|
+
### Local View
|
|
122
|
+
|
|
123
|
+
Stream live screenshots from headless sessions to a browser-based viewer.
|
|
124
|
+
|
|
125
|
+
### Local or Cloud
|
|
126
|
+
|
|
127
|
+
Run browsers locally or on [Opensteer Cloud](https://opensteer.com). Same CLI, same SDK.
|
|
128
|
+
|
|
129
|
+
</td>
|
|
130
|
+
</tr>
|
|
131
|
+
</table>
|
|
132
|
+
|
|
133
|
+
## How It Works
|
|
134
|
+
|
|
135
|
+
Opensteer follows a **discover-then-codify** workflow:
|
|
136
|
+
|
|
137
|
+
1. **Capture** -- Open a real page, trigger actions, and record network traffic.
|
|
138
|
+
2. **Inspect** -- Query captured traffic, check cookies/storage/state for auth context.
|
|
139
|
+
3. **Probe** -- Test transport viability for captured requests before writing code.
|
|
140
|
+
4. **Codify** -- Write plain TypeScript with `session.fetch()`. The code is the durable artifact.
|
|
141
|
+
|
|
142
|
+
See the full [Workflow Guide](https://github.com/steerlabs/opensteer/blob/main/docs/workflows.md) for details.
|
|
143
|
+
|
|
144
|
+
## Documentation
|
|
145
|
+
|
|
146
|
+
| Resource | Description |
|
|
147
|
+
| -------------------------------------------------- | -------------------------------------- |
|
|
148
|
+
| [Package Guide](https://github.com/steerlabs/opensteer/blob/main/packages/opensteer/README.md) | Full CLI and SDK reference |
|
|
149
|
+
| [Workflow Guide](https://github.com/steerlabs/opensteer/blob/main/docs/workflows.md) | Discover-then-codify methodology |
|
|
150
|
+
| [Instrumentation Guide](https://github.com/steerlabs/opensteer/blob/main/docs/instrumentation.md) | Tracing and observability |
|
|
151
|
+
| [Skills Guide](https://github.com/steerlabs/opensteer/blob/main/skills/README.md) | Agent skill installation and authoring |
|
|
152
|
+
|
|
153
|
+
## FAQ
|
|
154
|
+
|
|
155
|
+
<details>
|
|
156
|
+
<summary><strong>Which AI agents are supported?</strong></summary>
|
|
157
|
+
|
|
158
|
+
Opensteer ships first-party skills for [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview), [Codex](https://openai.com/index/introducing-codex/), [Cursor](https://www.cursor.com/), and any agent compatible with the [skills.sh](https://skills.sh) standard.
|
|
159
|
+
|
|
160
|
+
</details>
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary><strong>Do I need to install a browser separately?</strong></summary>
|
|
164
|
+
|
|
165
|
+
Yes. After installing Opensteer, run `npx playwright install chromium` to download a compatible Chromium build. This is a one-time step.
|
|
166
|
+
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary><strong>Can I use my existing Chrome login sessions?</strong></summary>
|
|
171
|
+
|
|
172
|
+
Yes. Use profile cloning to copy your real Chrome profile into an Opensteer workspace. Your logins, cookies, and extensions carry over without closing your main browser.
|
|
173
|
+
|
|
174
|
+
</details>
|
|
175
|
+
|
|
176
|
+
<details>
|
|
177
|
+
<summary><strong>Does it work in headless mode?</strong></summary>
|
|
178
|
+
|
|
179
|
+
Yes. Opensteer runs headless by default. Use the Local View feature to stream live screenshots from headless sessions to a browser-based viewer for debugging.
|
|
180
|
+
|
|
181
|
+
</details>
|
|
182
|
+
|
|
183
|
+
<details>
|
|
184
|
+
<summary><strong>What Node.js version is required?</strong></summary>
|
|
185
|
+
|
|
186
|
+
Node.js 22 or later.
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
|
|
190
|
+
## Development
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
pnpm install
|
|
194
|
+
pnpm run build
|
|
195
|
+
pnpm run typecheck
|
|
196
|
+
pnpm run test
|
|
167
197
|
```
|
|
168
198
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
- `info()`
|
|
176
|
-
- `listPages()`
|
|
177
|
-
- `newPage()`
|
|
178
|
-
- `activatePage()`
|
|
179
|
-
- `closePage()`
|
|
180
|
-
- `goto(url, { captureNetwork? })`
|
|
181
|
-
- `evaluate(script | input)`
|
|
182
|
-
- `addInitScript(input)`
|
|
183
|
-
- `snapshot("action" | "extraction")`
|
|
184
|
-
- `click({ element? | selector? | persist?, captureNetwork? })`
|
|
185
|
-
- `hover({ element? | selector? | persist?, captureNetwork? })`
|
|
186
|
-
- `input({ text, element? | selector? | persist?, captureNetwork? })`
|
|
187
|
-
- `scroll({ direction, amount, element? | selector? | persist?, captureNetwork? })`
|
|
188
|
-
- `extract({ schema } | { persist, schema? })`
|
|
189
|
-
- `network.query(input?)`
|
|
190
|
-
- `network.detail(recordId, { probe?: boolean })`
|
|
191
|
-
- `waitForPage(input?)`
|
|
192
|
-
- `cookies(domain?)`
|
|
193
|
-
- `storage(domain?, "local" | "session")`
|
|
194
|
-
- `state(domain?)`
|
|
195
|
-
- `fetch(url, options?)`
|
|
196
|
-
- `computerExecute(input)`
|
|
197
|
-
- `route(input)`
|
|
198
|
-
- `interceptScript(input)`
|
|
199
|
-
- `browser.status()`
|
|
200
|
-
- `browser.clone(input)`
|
|
201
|
-
- `browser.reset()`
|
|
202
|
-
- `browser.delete()`
|
|
203
|
-
- `close()`
|
|
204
|
-
- `disconnect()`
|
|
205
|
-
|
|
206
|
-
## Design Notes
|
|
207
|
-
|
|
208
|
-
- `network query` is intentionally summary-oriented. Use `network detail` for deep inspection.
|
|
209
|
-
- `replay` is transport-aware and should usually replace manual probe logic.
|
|
210
|
-
- `browser status` intentionally does not leak the raw browser websocket endpoint.
|
|
211
|
-
- The package also exports advanced cloud and browser-management utilities, but the core agent workflow is the local discovery-first SDK and CLI shown above.
|
|
199
|
+
## Community
|
|
200
|
+
|
|
201
|
+
- [Contributing](https://github.com/steerlabs/opensteer/blob/main/CONTRIBUTING.md)
|
|
202
|
+
- [Code of Conduct](https://github.com/steerlabs/opensteer/blob/main/CODE_OF_CONDUCT.md)
|
|
203
|
+
- [Security Policy](https://github.com/steerlabs/opensteer/blob/main/SECURITY.md)
|
|
204
|
+
- [License](https://github.com/steerlabs/opensteer/blob/main/LICENSE) (MIT)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveFilesystemWorkspacePath, createFilesystemOpensteerWorkspace, DEFAULT_OPENSTEER_ENGINE, assertSupportedEngineOptions, OpensteerBrowserManager, normalizeObservabilityConfig, manifestToExternalBinaryLocation, normalizeObservationContext } from './chunk-
|
|
2
|
-
import { canonicalJsonString, toCanonicalJsonValue, readPersistedCloudSessionRecord, writePersistedSessionRecord, clearPersistedSessionRecord, sha256Hex, resolveBrandUserDataDir, getBrowserBrand, detectInstalledBrowserBrands, __require } from './chunk-
|
|
1
|
+
import { resolveFilesystemWorkspacePath, createFilesystemOpensteerWorkspace, DEFAULT_OPENSTEER_ENGINE, assertSupportedEngineOptions, OpensteerBrowserManager, normalizeObservabilityConfig, manifestToExternalBinaryLocation, normalizeObservationContext } from './chunk-GSCQQKZZ.js';
|
|
2
|
+
import { canonicalJsonString, toCanonicalJsonValue, readPersistedCloudSessionRecord, writePersistedSessionRecord, clearPersistedSessionRecord, sha256Hex, resolveBrandUserDataDir, getBrowserBrand, detectInstalledBrowserBrands, __require } from './chunk-T5P2QGZ3.js';
|
|
3
3
|
import { selectAll } from 'css-select';
|
|
4
4
|
import { createHash, randomUUID, pbkdf2Sync, createDecipheriv } from 'crypto';
|
|
5
5
|
import { existsSync, readFileSync } from 'fs';
|
|
@@ -3743,6 +3743,20 @@ var opensteerBrowserContextOptionsSchema = objectSchema(
|
|
|
3743
3743
|
{
|
|
3744
3744
|
title: "OpensteerStealthProfileInput"
|
|
3745
3745
|
}
|
|
3746
|
+
),
|
|
3747
|
+
humanize: oneOfSchema(
|
|
3748
|
+
[
|
|
3749
|
+
{ type: "boolean" },
|
|
3750
|
+
objectSchema(
|
|
3751
|
+
{
|
|
3752
|
+
mouse: { type: "boolean" },
|
|
3753
|
+
keyboard: { type: "boolean" },
|
|
3754
|
+
scroll: { type: "boolean" }
|
|
3755
|
+
},
|
|
3756
|
+
{ title: "OpensteerHumanizeOptions" }
|
|
3757
|
+
)
|
|
3758
|
+
],
|
|
3759
|
+
{ title: "OpensteerHumanize" }
|
|
3746
3760
|
)
|
|
3747
3761
|
},
|
|
3748
3762
|
{
|
|
@@ -10594,7 +10608,7 @@ async function dispatchSemanticOperation(runtime, operation, input, options = {}
|
|
|
10594
10608
|
|
|
10595
10609
|
// ../runtime-core/package.json
|
|
10596
10610
|
var package_default = {
|
|
10597
|
-
version: "0.2.
|
|
10611
|
+
version: "0.2.3"};
|
|
10598
10612
|
|
|
10599
10613
|
// ../runtime-core/src/version.ts
|
|
10600
10614
|
var OPENSTEER_RUNTIME_CORE_VERSION = package_default.version;
|
|
@@ -14410,6 +14424,7 @@ function diffInteractionTraces(left, right) {
|
|
|
14410
14424
|
// ../runtime-core/src/sdk/runtime.ts
|
|
14411
14425
|
var MUTATION_CAPTURE_FINALIZE_TIMEOUT_MS = 5e3;
|
|
14412
14426
|
var PERSISTED_NETWORK_FLUSH_TIMEOUT_MS = 5e3;
|
|
14427
|
+
var PERSISTED_NETWORK_SETTLE_POLL_MS = 25;
|
|
14413
14428
|
var PENDING_OPERATION_EVENT_CAPTURE_LIMIT = 64;
|
|
14414
14429
|
var PENDING_OPERATION_EVENT_CAPTURE_SKEW_MS = 1e3;
|
|
14415
14430
|
var REPLAY_PROBE_MIN_ATTEMPT_TIMEOUT_MS = 3e3;
|
|
@@ -17184,15 +17199,22 @@ var OpensteerSessionRuntime = class {
|
|
|
17184
17199
|
return [];
|
|
17185
17200
|
}
|
|
17186
17201
|
const root = await this.ensureRoot();
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17202
|
+
let browserRecords = [];
|
|
17203
|
+
for (; ; ) {
|
|
17204
|
+
browserRecords = await this.readBrowserNetworkRecords(
|
|
17205
|
+
{
|
|
17206
|
+
includeBodies: true,
|
|
17207
|
+
includeCurrentPageOnly: options.includeCurrentPageOnly,
|
|
17208
|
+
...options.pageRef === void 0 ? {} : { pageRef: options.pageRef },
|
|
17209
|
+
requestIds
|
|
17210
|
+
},
|
|
17211
|
+
signal
|
|
17212
|
+
);
|
|
17213
|
+
if (browserRecords.length === requestIds.length && browserRecords.every((record) => record.captureState !== "pending")) {
|
|
17214
|
+
break;
|
|
17215
|
+
}
|
|
17216
|
+
await delayWithSignal(PERSISTED_NETWORK_SETTLE_POLL_MS, signal);
|
|
17217
|
+
}
|
|
17196
17218
|
return this.networkHistory.persist(browserRecords, root.registry.savedNetwork, {
|
|
17197
17219
|
bodyWriteMode: "authoritative",
|
|
17198
17220
|
redactSecretHeaders: false
|
|
@@ -22300,8 +22322,10 @@ var OpensteerRuntime = class extends OpensteerSessionRuntime {
|
|
|
22300
22322
|
super(
|
|
22301
22323
|
buildSharedRuntimeOptions({
|
|
22302
22324
|
name: publicWorkspace ?? "default",
|
|
22325
|
+
...options.rootDir === void 0 ? {} : { rootDir: options.rootDir },
|
|
22303
22326
|
rootPath,
|
|
22304
22327
|
...publicWorkspace === void 0 ? {} : { workspaceName: publicWorkspace },
|
|
22328
|
+
...options.environment === void 0 ? {} : { environment: options.environment },
|
|
22305
22329
|
...options.browser === void 0 ? {} : { browser: options.browser },
|
|
22306
22330
|
...options.launch === void 0 ? {} : { launch: options.launch },
|
|
22307
22331
|
...options.context === void 0 ? {} : { context: options.context },
|
|
@@ -22332,7 +22356,9 @@ var OpensteerSessionRuntime2 = class extends OpensteerSessionRuntime {
|
|
|
22332
22356
|
super(
|
|
22333
22357
|
buildSharedRuntimeOptions({
|
|
22334
22358
|
name: options.name,
|
|
22359
|
+
...options.rootDir === void 0 ? {} : { rootDir: options.rootDir },
|
|
22335
22360
|
rootPath,
|
|
22361
|
+
...options.environment === void 0 ? {} : { environment: options.environment },
|
|
22336
22362
|
...options.browser === void 0 ? {} : { browser: options.browser },
|
|
22337
22363
|
...options.launch === void 0 ? {} : { launch: options.launch },
|
|
22338
22364
|
...options.context === void 0 ? {} : { context: options.context },
|
|
@@ -22353,9 +22379,11 @@ var OpensteerSessionRuntime2 = class extends OpensteerSessionRuntime {
|
|
|
22353
22379
|
function buildSharedRuntimeOptions(input) {
|
|
22354
22380
|
const ownership = resolveOwnership(input.browser);
|
|
22355
22381
|
const engineFactory = input.engineFactory ?? ((factoryOptions) => new OpensteerBrowserManager({
|
|
22382
|
+
...input.rootDir === void 0 ? {} : { rootDir: input.rootDir },
|
|
22356
22383
|
rootPath: input.rootPath,
|
|
22357
22384
|
...input.workspaceName === void 0 ? {} : { workspace: input.workspaceName },
|
|
22358
22385
|
engineName: input.engineName,
|
|
22386
|
+
...input.environment === void 0 ? {} : { environment: input.environment },
|
|
22359
22387
|
...(factoryOptions.browser ?? input.browser) === void 0 ? {} : { browser: factoryOptions.browser ?? input.browser },
|
|
22360
22388
|
...(factoryOptions.launch ?? input.launch) === void 0 ? {} : { launch: factoryOptions.launch ?? input.launch },
|
|
22361
22389
|
...(factoryOptions.context ?? input.context) === void 0 ? {} : { context: factoryOptions.context ?? input.context }
|
|
@@ -22416,9 +22444,10 @@ function resolveOpensteerRuntimeConfig(input = {}) {
|
|
|
22416
22444
|
function createOpensteerSemanticRuntime(input = {}) {
|
|
22417
22445
|
const runtimeOptions = input.runtimeOptions ?? {};
|
|
22418
22446
|
const engine = input.engine ?? runtimeOptions.engineName ?? DEFAULT_OPENSTEER_ENGINE;
|
|
22447
|
+
const environment = input.environment ?? process.env;
|
|
22419
22448
|
const config = resolveOpensteerRuntimeConfig({
|
|
22420
22449
|
...input.provider === void 0 ? {} : { provider: input.provider },
|
|
22421
|
-
|
|
22450
|
+
environment
|
|
22422
22451
|
});
|
|
22423
22452
|
assertProviderSupportsEngine(config.provider.mode, engine);
|
|
22424
22453
|
if (config.provider.mode === "cloud") {
|
|
@@ -22433,10 +22462,11 @@ function createOpensteerSemanticRuntime(input = {}) {
|
|
|
22433
22462
|
}
|
|
22434
22463
|
return new OpensteerRuntime({
|
|
22435
22464
|
...runtimeOptions,
|
|
22436
|
-
engineName: engine
|
|
22465
|
+
engineName: engine,
|
|
22466
|
+
environment
|
|
22437
22467
|
});
|
|
22438
22468
|
}
|
|
22439
22469
|
|
|
22440
22470
|
export { CloudSessionProxy, DEFERRED_MATCH_ATTR_KEYS, ElementPathError, FlowRecorderCollector, MATCH_ATTRIBUTE_PRIORITY, OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL, OpensteerCloudClient, OpensteerRuntime, OpensteerSessionRuntime2 as OpensteerSessionRuntime, STABLE_PRIMARY_ATTR_KEYS, assertProviderSupportsEngine, buildArrayFieldPathCandidates, buildDomDescriptorKey, buildDomDescriptorPayload, buildDomDescriptorVersion, buildPathCandidates, buildPathSelectorHint, buildSegmentSelector, cloneElementPath, cloneReplayElementPath, cloneStructuralElementAnchor, createDomDescriptorStore, createDomRuntime, createOpensteerExtractionDescriptorStore, createOpensteerSemanticRuntime, defaultFallbackPolicy, defaultPolicy, defaultRetryPolicy, defaultSettlePolicy, defaultTimeoutPolicy, delayWithSignal, dispatchSemanticOperation, generateReplayScript, hashDomDescriptorPersist, isCurrentUrlField, isValidCssAttributeKey, loadEnvironment, normalizeExtractedValue, normalizeOpensteerProviderMode, parseDomDescriptorRecord, parseExtractionDescriptorRecord, requireCloudAppBaseUrl, resolveCloudConfig, resolveDomActionBridge, resolveExtractedValueInContext, resolveOpensteerEnvironment, resolveOpensteerProvider, resolveOpensteerRuntimeConfig, runWithPolicyTimeout, sanitizeElementPath, sanitizeReplayElementPath, sanitizeStructuralElementAnchor, settleWithPolicy, shouldKeepAttributeForPath };
|
|
22441
|
-
//# sourceMappingURL=chunk-
|
|
22442
|
-
//# sourceMappingURL=chunk-
|
|
22471
|
+
//# sourceMappingURL=chunk-GEUHKPC2.js.map
|
|
22472
|
+
//# sourceMappingURL=chunk-GEUHKPC2.js.map
|