@jeffawe/understudy 0.2.0 → 0.2.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/README.md +10 -15
- package/dist/entry/cli.js +9 -1
- package/extension/README.md +7 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -15,7 +15,9 @@ Understudy never calls a model itself — the agent is the model.
|
|
|
15
15
|
record → save → replay / run → findings
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
- **record** — click through a flow in your own browser, with the
|
|
18
|
+
- **record** — click through a flow in your own browser, with the
|
|
19
|
+
[Understudy recorder](https://chromewebstore.google.com/detail/understudy-recorder/mdobdjogkgimabdpmbmhhcdeoahoapjf) extension from the Chrome Web Store. Passwords
|
|
20
|
+
are never stored: a password field is kept as
|
|
19
21
|
a reference like `SECRET.password`, and you supply the value when replaying.
|
|
20
22
|
- **save** — the recording is replayed headless first. It is kept only if every
|
|
21
23
|
step passes, so memory only holds flows known to work.
|
|
@@ -39,8 +41,8 @@ You need **Node 22+** and a **MongoDB** with vector search — a free
|
|
|
39
41
|
Community Edition with `mongot` running locally.
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
|
-
npm install -g @jeffawe/understudy
|
|
43
|
-
npx playwright install --only-shell chromium
|
|
44
|
+
npm install -g @jeffawe/understudy
|
|
45
|
+
npx playwright install --only-shell chromium
|
|
44
46
|
|
|
45
47
|
understudy config set MONGODB_URI="mongodb+srv://…" EMBED_KEY="…"
|
|
46
48
|
```
|
|
@@ -55,20 +57,15 @@ Already keep your settings in an env file? Point at it instead:
|
|
|
55
57
|
understudy config --env-file ~/secrets/understudy.env
|
|
56
58
|
```
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
once.
|
|
62
|
-
|
|
63
|
-
Settings come from, highest first: real environment variables, `--env-file
|
|
64
|
-
<path>` on any command, the env file saved with `understudy config`, then a
|
|
65
|
-
`.env` in the current folder.
|
|
60
|
+
To record, install the [Understudy recorder](https://chromewebstore.google.com/detail/understudy-recorder/mdobdjogkgimabdpmbmhhcdeoahoapjf) from the Chrome Web Store.
|
|
61
|
+
Not using Chrome or another Chromium browser? See
|
|
62
|
+
[extension/README.md](extension/README.md).
|
|
66
63
|
|
|
67
64
|
| Setting | What it's for |
|
|
68
65
|
|---|---|
|
|
69
66
|
| `MONGODB_URI` | your Atlas `mongodb+srv://…` string, or local Community |
|
|
70
67
|
| `EMBED_KEY` | optional: a Voyage key, to match goals by meaning (`voyage-4-lite`). Using another model? See below. |
|
|
71
|
-
| `UNDERSTUDY_<REF>` | login values. A recording never stores a password: the field is kept as a name like `SECRET.password`, and at replay Understudy reads the value from `UNDERSTUDY_SECRET_PASSWORD`. Or pass it per run (`--value SECRET.password=…`, or `values` from an agent). Not set? The terminal asks for it (hidden) and offers to save it; an agent is told which line to add to your env file.
|
|
68
|
+
| `UNDERSTUDY_<REF>` | login values. A recording never stores a password: the field is kept as a name like `SECRET.password`, and at replay Understudy reads the value from `UNDERSTUDY_SECRET_PASSWORD`. Or pass it per run (`--value SECRET.password=…`, or `values` from an agent). Not set? The terminal asks for it (hidden) and offers to save it; an agent is told which line to add to your env file. |
|
|
72
69
|
|
|
73
70
|
### Using a different embedding model
|
|
74
71
|
|
|
@@ -117,9 +114,7 @@ npx playwright install chromium
|
|
|
117
114
|
understudy record myapp --new-browser --url https://your-app.example
|
|
118
115
|
```
|
|
119
116
|
|
|
120
|
-
Click through the flow in the window that opens, then close it to stop.
|
|
121
|
-
users can also load the extension's Firefox build — see
|
|
122
|
-
[extension/README.md](extension/README.md).
|
|
117
|
+
Click through the flow in the window that opens, then close it to stop.
|
|
123
118
|
|
|
124
119
|
## Where your data goes
|
|
125
120
|
|
package/dist/entry/cli.js
CHANGED
|
@@ -27,6 +27,12 @@ import { recall } from '../memory/recall.js';
|
|
|
27
27
|
import { setPlaceholders, appPlaceholders } from '../memory/placeholders.js';
|
|
28
28
|
import * as store from '../store/db.js';
|
|
29
29
|
import { valueEnvName, readConfig, writeConfig, loadedFrom, HOME, expandHome, writeEnvValues } from '../store/settings.js';
|
|
30
|
+
// Piped into `head` and the pipe closed early: stop quietly, like other CLIs.
|
|
31
|
+
process.stdout.on('error', (e) => {
|
|
32
|
+
if (e.code === 'EPIPE')
|
|
33
|
+
process.exit(0);
|
|
34
|
+
throw e;
|
|
35
|
+
});
|
|
30
36
|
const USAGE = `understudy — learn a web app, then test it by intent
|
|
31
37
|
|
|
32
38
|
USAGE
|
|
@@ -419,7 +425,9 @@ async function cmdApp(positional, flags) {
|
|
|
419
425
|
}
|
|
420
426
|
/** Where the Chrome extension is, and how to load it — it ships inside the package. */
|
|
421
427
|
function cmdExtension() {
|
|
422
|
-
console.log(
|
|
428
|
+
console.log('Chrome, Edge, Brave and other Chromium browsers — install it from the Chrome Web Store:');
|
|
429
|
+
console.log(' https://chromewebstore.google.com/detail/understudy-recorder/mdobdjogkgimabdpmbmhhcdeoahoapjf\n');
|
|
430
|
+
console.log(`or load it by hand from:\n ${extensionDir()}\n`);
|
|
423
431
|
console.log(' 1. open the extensions page (chrome://extensions, edge://extensions, …) and turn on Developer mode');
|
|
424
432
|
console.log(' 2. click "Load unpacked" and choose the folder above');
|
|
425
433
|
console.log(' 3. pin it (puzzle-piece icon) so it is one click away');
|
package/extension/README.md
CHANGED
|
@@ -5,7 +5,13 @@ signed in or not — instead of a fresh browser that Understudy opens.
|
|
|
5
5
|
|
|
6
6
|
## Install (once)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
**Chrome, Brave, Arc, Opera, Vivaldi, Edge:** install it from the
|
|
9
|
+
[Chrome Web Store](https://chromewebstore.google.com/detail/understudy-recorder/mdobdjogkgimabdpmbmhhcdeoahoapjf), then pin it (puzzle-piece icon → pin
|
|
10
|
+
**Understudy recorder**) so it's one click away. Edge asks you to allow
|
|
11
|
+
extensions from other stores first.
|
|
12
|
+
|
|
13
|
+
**Or load it by hand**= — `understudy extension`
|
|
14
|
+
prints where this folder is:
|
|
9
15
|
|
|
10
16
|
1. Open your browser's extensions page and turn on **Developer mode**:
|
|
11
17
|
| Browser | Extensions page |
|
|
@@ -17,15 +23,6 @@ signed in or not — instead of a fresh browser that Understudy opens.
|
|
|
17
23
|
2. Click **Load unpacked** and choose this `extension/` folder.
|
|
18
24
|
3. Pin it (puzzle-piece icon → pin **Understudy recorder**) so it's one click away.
|
|
19
25
|
|
|
20
|
-
Tested in Chrome and Chromium. Other Chromium-based browsers load Chrome
|
|
21
|
-
extensions the same way and should work.
|
|
22
|
-
|
|
23
|
-
**Firefox:** until it's listed on Firefox Add-ons, load the Firefox build
|
|
24
|
-
yourself — it ships with Understudy, and `understudy extension` prints where.
|
|
25
|
-
In Firefox open `about:debugging#/runtime/this-firefox` → **Load Temporary
|
|
26
|
-
Add-on…** → choose `manifest.json` in that folder. Firefox removes temporary
|
|
27
|
-
add-ons when it restarts.
|
|
28
|
-
|
|
29
26
|
**Safari (and anywhere else the extension won't run):** record in a fresh
|
|
30
27
|
browser that Understudy opens instead. It's a one-time extra download — the
|
|
31
28
|
full Chromium browser, about 350 MB:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffawe/understudy",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "End-to-end tests for your own web apps: record a flow once, and Understudy remembers it, replays it, notices when the app changes, and runs goals you describe in words
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "End-to-end tests for your own web apps: record a flow once, and Understudy remembers it, replays it, notices when the app changes, and runs goals you describe in words — on its own or as an MCP server for AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"node": ">=22"
|
|
27
27
|
},
|
|
28
28
|
"bin": {
|
|
29
|
-
"understudy": "
|
|
30
|
-
"understudy-mcp": "
|
|
29
|
+
"understudy": "dist/entry/cli.js",
|
|
30
|
+
"understudy-mcp": "dist/entry/mcp.js"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|