@nothumanwork/sauron 0.2.2 → 0.2.3
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
|
@@ -7,8 +7,9 @@ This is a rewrite of the attached Bun/TypeScript `sauron` project as a compiled
|
|
|
7
7
|
## Goals
|
|
8
8
|
|
|
9
9
|
- **Agent-friendly** JSON output for all commands (v2 envelope)
|
|
10
|
+
- **Task-first UX** for everyday browser commands (`open`, `snapshot`, `click`, `fill`, `wait`, `get`)
|
|
10
11
|
- **Fast** startup and execution (single static-ish binary)
|
|
11
|
-
- **Process-safe concurrency** with
|
|
12
|
+
- **Process-safe concurrency** with runtime sessions, plus controlled auto-runtime on flat commands
|
|
12
13
|
- **Per-session isolation** with generated `session_id`, `instance`, and `client` IDs by default
|
|
13
14
|
- Filesystem-only runtime state storage under `~/.sauron/runtime/`
|
|
14
15
|
- Uses Chrome **`--headless=new`** only (opinionated headless runtime)
|
|
@@ -72,30 +73,46 @@ The `sauron` launcher inside the package selects the matching binary for the cur
|
|
|
72
73
|
|
|
73
74
|
## Quick start
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
Use the flat surface directly (auto-runtime defaults to `auto` on flat commands):
|
|
76
77
|
|
|
77
78
|
```bash
|
|
78
|
-
sauron
|
|
79
|
+
sauron open https://example.com
|
|
80
|
+
sauron snapshot -i
|
|
81
|
+
sauron get title
|
|
82
|
+
sauron click @e2
|
|
83
|
+
sauron wait --load networkidle
|
|
84
|
+
sauron screenshot --annotate --artifact-mode manifest
|
|
79
85
|
```
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
To inspect resolved config and precedence:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
sauron config show
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`sauron` supports config layering:
|
|
94
|
+
|
|
95
|
+
- `~/.sauron/config.json`
|
|
96
|
+
- `./sauron.json`
|
|
97
|
+
- environment variables
|
|
98
|
+
- CLI flags
|
|
99
|
+
|
|
100
|
+
Precedence is: `user config < project config < env < CLI`.
|
|
82
101
|
|
|
83
|
-
|
|
102
|
+
To force explicit runtime behavior on flat commands:
|
|
84
103
|
|
|
85
104
|
```bash
|
|
86
|
-
sauron
|
|
87
|
-
sauron
|
|
88
|
-
sauron input click --ref @e1
|
|
89
|
-
sauron page screenshot --responsive --quality medium
|
|
105
|
+
sauron --ensure-runtime require open https://example.com
|
|
106
|
+
sauron --ensure-runtime off open https://example.com
|
|
90
107
|
```
|
|
91
108
|
|
|
92
|
-
|
|
109
|
+
To stop the active runtime when finished:
|
|
93
110
|
|
|
94
111
|
```bash
|
|
95
112
|
sauron runtime stop
|
|
96
113
|
```
|
|
97
114
|
|
|
98
|
-
##
|
|
115
|
+
## Legacy Grouped Surface
|
|
99
116
|
|
|
100
117
|
- Most non-`runtime start` commands require an active runtime session. `runtime status` is the exception: it can also report `stopped` when no active session exists.
|
|
101
118
|
- Session resolution order is:
|
|
@@ -114,6 +131,15 @@ sauron runtime stop
|
|
|
114
131
|
sauron --session-id mysession --instance work --client alice runtime start
|
|
115
132
|
```
|
|
116
133
|
|
|
134
|
+
Grouped command examples remain valid and stable:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
sauron page goto https://example.com
|
|
138
|
+
sauron page snapshot --format nodes
|
|
139
|
+
sauron input click --ref @e1
|
|
140
|
+
sauron state show baseline
|
|
141
|
+
```
|
|
142
|
+
|
|
117
143
|
## Interaction Flow
|
|
118
144
|
|
|
119
145
|
```mermaid
|
|
@@ -191,10 +217,11 @@ Each line includes timestamp, session metadata, command name, status, and error
|
|
|
191
217
|
|
|
192
218
|
## CLI flag placement
|
|
193
219
|
|
|
194
|
-
Global flags (`--session-id`, `--port`, etc.) must be placed before the subcommand:
|
|
220
|
+
Global flags (`--session-id`/`--session`, `--port`, `--policy`, `--artifact-mode`, etc.) must be placed before the subcommand:
|
|
195
221
|
|
|
196
222
|
```bash
|
|
197
223
|
sauron --session-id mysession page goto https://example.com
|
|
224
|
+
sauron --session qa open https://example.com
|
|
198
225
|
```
|
|
199
226
|
|
|
200
227
|
`--viewport` is global and applies to `start` and browser commands:
|
|
@@ -204,6 +231,12 @@ sauron --viewport 1440x900 runtime start
|
|
|
204
231
|
sauron --viewport 390x844 page screenshot
|
|
205
232
|
```
|
|
206
233
|
|
|
234
|
+
`--profile` is a higher-level alias for browser profile persistence:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
sauron --profile ./profiles/qa runtime start
|
|
238
|
+
```
|
|
239
|
+
|
|
207
240
|
## Output contract
|
|
208
241
|
|
|
209
242
|
All commands return exactly one JSON object in a unified v2 envelope:
|
|
@@ -237,6 +270,17 @@ All commands return exactly one JSON object in a unified v2 envelope:
|
|
|
237
270
|
}
|
|
238
271
|
```
|
|
239
272
|
|
|
273
|
+
## Scorecard and Benchmarks
|
|
274
|
+
|
|
275
|
+
Run the parity benchmark harness:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
cargo build --release
|
|
279
|
+
BENCH_RUNS=5 scripts/benchmark-matrix.sh
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Latest comparison document: [docs/agent-browser-scorecard.md](/Users/mish/dev/sauron/docs/agent-browser-scorecard.md)
|
|
283
|
+
|
|
240
284
|
## Notes
|
|
241
285
|
|
|
242
286
|
- You need a local Chrome/Chromium install.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|