@nothumanwork/sauron 0.2.1 → 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 mandatory runtime sessions (`start` before browser commands)
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,38 +73,54 @@ The `sauron` launcher inside the package selects the matching binary for the cur
72
73
 
73
74
  ## Quick start
74
75
 
75
- Each shell/process must start a runtime session first:
76
+ Use the flat surface directly (auto-runtime defaults to `auto` on flat commands):
76
77
 
77
78
  ```bash
78
- sauron runtime start
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
- macOS defaults to GPU + WebGL on `runtime start` (opt out with `--no-webgl --no-gpu`).
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
- Then run browser commands from the same project directory:
102
+ To force explicit runtime behavior on flat commands:
84
103
 
85
104
  ```bash
86
- sauron page goto https://example.com
87
- sauron page snapshot --format json
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
- Clean up with:
109
+ To stop the active runtime when finished:
93
110
 
94
111
  ```bash
95
112
  sauron runtime stop
96
113
  ```
97
114
 
98
- ## Mandatory session lifecycle
115
+ ## Legacy Grouped Surface
99
116
 
100
- - Non-`runtime start` commands require an active runtime session.
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:
102
119
  - explicit `--session-id`
103
120
  - current process binding
104
121
  - current project binding
105
122
  - `SAURON_SESSION_ID` fallback
106
- - If none resolve to an active session, commands fail with `SESSION_REQUIRED`.
123
+ - If none resolve to an active session, commands that need one fail with `SESSION_REQUIRED`.
107
124
  - `start` auto-generates:
108
125
  - `session_id` (`sess-...`)
109
126
  - `instance` (`inst-...`)
@@ -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
@@ -179,6 +205,7 @@ unset SAURON_SESSION_ID
179
205
  ## Runtime state
180
206
 
181
207
  Runtime session state is stored on the local filesystem under `~/.sauron/runtime/`.
208
+ After `runtime stop` or `runtime cleanup`, `sauron runtime status` reports `stopped`.
182
209
 
183
210
  ## Session logs
184
211
 
@@ -190,10 +217,11 @@ Each line includes timestamp, session metadata, command name, status, and error
190
217
 
191
218
  ## CLI flag placement
192
219
 
193
- 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:
194
221
 
195
222
  ```bash
196
223
  sauron --session-id mysession page goto https://example.com
224
+ sauron --session qa open https://example.com
197
225
  ```
198
226
 
199
227
  `--viewport` is global and applies to `start` and browser commands:
@@ -203,6 +231,12 @@ sauron --viewport 1440x900 runtime start
203
231
  sauron --viewport 390x844 page screenshot
204
232
  ```
205
233
 
234
+ `--profile` is a higher-level alias for browser profile persistence:
235
+
236
+ ```bash
237
+ sauron --profile ./profiles/qa runtime start
238
+ ```
239
+
206
240
  ## Output contract
207
241
 
208
242
  All commands return exactly one JSON object in a unified v2 envelope:
@@ -236,6 +270,17 @@ All commands return exactly one JSON object in a unified v2 envelope:
236
270
  }
237
271
  ```
238
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
+
239
284
  ## Notes
240
285
 
241
286
  - You need a local Chrome/Chromium install.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nothumanwork/sauron",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Rust-native CLI for controlling Chrome via CDP",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/thehumanworks/sauron#readme",