waygraph 0.15.14 → 0.15.16

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.
Files changed (47) hide show
  1. package/README.md +69 -19
  2. package/dist/cli.d.ts +1 -0
  3. package/dist/cli.js +43 -9
  4. package/examples/saucedemo/.waygraph-auto/179dde38.log +0 -0
  5. package/examples/saucedemo/.waygraph-auto/1a7d471e.log +0 -0
  6. package/examples/saucedemo/.waygraph-auto/1e33a93d.log +0 -0
  7. package/examples/saucedemo/.waygraph-auto/2fbf6b8d.log +0 -0
  8. package/examples/saucedemo/.waygraph-auto/301ff7e3.log +0 -0
  9. package/examples/saucedemo/.waygraph-auto/3178c318.log +0 -0
  10. package/examples/saucedemo/.waygraph-auto/3eb1df41.log +0 -0
  11. package/examples/saucedemo/.waygraph-auto/4d68438c.log +0 -0
  12. package/examples/saucedemo/.waygraph-auto/5030cca5.log +0 -0
  13. package/examples/saucedemo/.waygraph-auto/51a5387a.log +0 -0
  14. package/examples/saucedemo/.waygraph-auto/55df2b0f.log +0 -0
  15. package/examples/saucedemo/.waygraph-auto/5a4374f7.log +0 -0
  16. package/examples/saucedemo/.waygraph-auto/5eafc682.log +0 -0
  17. package/examples/saucedemo/.waygraph-auto/6fc3d553.log +0 -0
  18. package/examples/saucedemo/.waygraph-auto/7531b70f.log +0 -0
  19. package/examples/saucedemo/.waygraph-auto/7774f054.log +0 -0
  20. package/examples/saucedemo/.waygraph-auto/7a08e89a.log +0 -0
  21. package/examples/saucedemo/.waygraph-auto/7d9f231d.log +0 -0
  22. package/examples/saucedemo/.waygraph-auto/8557750f.log +0 -0
  23. package/examples/saucedemo/.waygraph-auto/86a5ff4d.log +0 -0
  24. package/examples/saucedemo/.waygraph-auto/8c5b1caa.log +0 -0
  25. package/examples/saucedemo/.waygraph-auto/9918377b.log +0 -0
  26. package/examples/saucedemo/.waygraph-auto/9c4fd0a0.log +0 -0
  27. package/examples/saucedemo/.waygraph-auto/9cd2da32.log +0 -0
  28. package/examples/saucedemo/.waygraph-auto/a7c3d248.log +0 -0
  29. package/examples/saucedemo/.waygraph-auto/ab26aeb4.log +0 -0
  30. package/examples/saucedemo/.waygraph-auto/b13d08e4.log +0 -0
  31. package/examples/saucedemo/.waygraph-auto/bde6d205.log +0 -0
  32. package/examples/saucedemo/.waygraph-auto/be0bb35f.log +0 -0
  33. package/examples/saucedemo/.waygraph-auto/c10c4038.log +0 -0
  34. package/examples/saucedemo/.waygraph-auto/c23b2654.log +0 -0
  35. package/examples/saucedemo/.waygraph-auto/c8825eda.log +0 -0
  36. package/examples/saucedemo/.waygraph-auto/d440e60f.log +0 -0
  37. package/examples/saucedemo/.waygraph-auto/d52ce64b.log +0 -0
  38. package/examples/saucedemo/.waygraph-auto/d6e0cb19.log +0 -0
  39. package/examples/saucedemo/.waygraph-auto/e62bdb4a.log +0 -0
  40. package/examples/saucedemo/.waygraph-auto/e9b84105.log +0 -0
  41. package/examples/saucedemo/.waygraph-auto/f1949241.log +0 -0
  42. package/examples/saucedemo/package.json +2 -1
  43. package/package.json +4 -2
  44. package/templates/quickstart/package.json +2 -1
  45. package/templates/scaffold/package.json +2 -1
  46. package/templates/skills/waygraph-blind-pilot.skill.md +30 -15
  47. package/templates/skills/waygraph-pilot.skill.md +1 -1
package/README.md CHANGED
@@ -296,6 +296,13 @@ nothing is blocked, nothing fails to build. `waygraph check [project]` is the
296
296
  complementary whole-project sweep for contexts with no editor watching (CI, generated
297
297
  code, an autonomous agent authoring Blocks) - it warns, never fails the process.
298
298
 
299
+ **`waygraph typecheck [project]`** runs `tsc --noEmit` then the same **bad-practice** scan
300
+ (wildcard `Checkpoint<string>`, assert blocks missing type args, multi-`.fill()` Methods,
301
+ fill+click in one Method). Practices warn only unless `tsc` fails; use `--no-practices` to
302
+ skip the scan. Opt out per file: `// waygraph-ignore-practices` or
303
+ `// waygraph-ignore: multi-input, combined-action`. Print full agent guidance:
304
+ `waygraph --skill-convention`.
305
+
299
306
  ### Demo narration
300
307
 
301
308
  Automation rings are gray; authored stubs/slides can use
@@ -662,27 +669,52 @@ space is constrained to this project's own pre-verified Blocks (each with a real
662
669
  already checked) instead of freeform DOM/pixel guessing - narrower, but far more accurate and
663
670
  deterministic.
664
671
 
672
+ ### auto vs browser vs pilot
673
+
674
+ | Layer | Command | What it is |
675
+ |-------|---------|------------|
676
+ | **auto** | `waygraph auto` | Interactive explore (picker / `--cli` menu). **Not** a persistent agent browser. |
677
+ | **browser** | `waygraph browser start` | New persistent Playwright session — **headful by default**, **about:blank by default**. |
678
+ | **pilot** | `waygraph pilot start` | Bootstrap only: `browser start` + whole-project `graph` + starting `snapshot` in one JSON payload. Does not plan or act. |
679
+
680
+ Session control (`send`, `status`, `highlight`, `dom`, …) works on **`auto`**, **`browser`**, and
681
+ **`pilot`** — same socket, same session id. Prefer the `browser`/`pilot` prefix when driving a
682
+ detached session; `auto` remains for the interactive picker and legacy `--cli --detach`.
683
+
684
+ **Session lifecycle is explicit** — list what's live before opening another:
685
+
665
686
  ```bash
666
- waygraph pilot start --non-headless
687
+ waygraph browser # show browser subcommands
688
+ waygraph browser sessions [--json] # list live sessions; --json for agents
689
+ waygraph browser start # always opens a new session
690
+ waygraph browser stop <sessionId> # shut one down
691
+ waygraph browser stop --all # shut every session for this project
692
+ waygraph browser attach <sessionId> # terminal picker on an existing session
693
+ waygraph pilot attach <sessionId> # graph + snapshot, no new browser
694
+ ```
695
+
696
+ ```bash
697
+ waygraph pilot start
667
698
  # {"sessionId":"bb65d74c","socketPath":"...","headless":false,"graph":{...},"snapshot":{...}}
668
699
  ```
669
700
 
670
- One call gives an agent everything it needs to start: a real, already-running Playwright
671
- session (the exact mechanism `auto --cli --detach` already provides), and the whole project's
672
- Block graph (`graph` - every Checkpoint/edge/description, not just what's reachable from the
673
- current position, so the agent can plan several steps ahead). From there, the agent drives the
674
- session itself, one pick at a time, using the session-control commands that already existed
675
- before Pilot did:
701
+ `pilot start` is one round trip for agents that need the whole graph immediately. For browser-only
702
+ work (no graph payload), use `browser start`. `auto --cli --detach` still works but is the older
703
+ explore entry point — prefer `browser start` for agent-driven sessions.
704
+
705
+ From a live session, drive one pick at a time:
676
706
 
677
707
  ```bash
678
- waygraph auto status <sessionId> # read the current menu (no side effects)
679
- waygraph auto send <sessionId> "<pick>" # run one pick, get the resulting menu back
680
- waygraph auto dom <sessionId> # inspect the live DOM/ARIA tree
681
- waygraph auto trace <sessionId> # read the Checkpoint/Block history so far
682
- waygraph auto reach <sessionId> <Checkpoint> # run a whole multi-step route in one call
683
- waygraph auto resync <sessionId> # force here to re-detect from the real page
708
+ waygraph browser status <sessionId> # read the current menu (no side effects)
709
+ waygraph browser send <sessionId> "<pick>" # run one pick, get the resulting menu back
710
+ waygraph browser dom <sessionId> # inspect the live DOM/ARIA tree
711
+ waygraph browser trace <sessionId> # read the Checkpoint/Block history so far
712
+ waygraph browser reach <sessionId> <Checkpoint> # run a whole multi-step route in one call
713
+ waygraph browser resync <sessionId> # force here to re-detect from the real page
684
714
  ```
685
715
 
716
+ (`auto …` and `pilot …` accept the same subcommands with the same `<sessionId>`.)
717
+
686
718
  Worked example (run for real against `examples/saucedemo`, no new execution code involved): an
687
719
  agent gets a plain request - "log me in and buy the backpack" - reads the graph and the starting
688
720
  `status`, reasons out login -> add-to-cart -> cart -> checkout info -> submit -> finish as the
@@ -1007,6 +1039,14 @@ immediately - see "Waygraph Pilot" above for the full picture.
1007
1039
  when no Block covers that action yet, and `auto reload <sessionId>` picks up a Block just
1008
1040
  written to disk without restarting the session - see "Blind Pilot" above.
1009
1041
 
1042
+ **`waygraph test [...args]`** is a thin wrapper around the project's own `@playwright/test`
1043
+ suite - it forwards to the local `node_modules/.bin/playwright` (falling back to
1044
+ `npx playwright` if the project hasn't installed it locally yet), so `waygraph test` behaves
1045
+ exactly like `playwright test`, and anything after it (`--grep`, a spec path, `--headed`, …)
1046
+ passes straight through. `waygraph test ui` (or `waygraph test --ui`) launches Playwright's
1047
+ interactive UI Mode the same way. Scaffolded projects (`waygraph init`/`create-waygraph`)
1048
+ wire this up as `npm test` / `npm run test:ui`.
1049
+
1010
1050
  Flows are files (0.10.5+):
1011
1051
 
1012
1052
  | Want | Command |
@@ -1023,22 +1063,31 @@ Flows are files (0.10.5+):
1023
1063
  | Ad-hoc Blocks | `waygraph run --blocks "login then nav-cart" --data '{...}'` |
1024
1064
  | Headed execute | `waygraph run --blocks shopFlow --non-headless --video` |
1025
1065
  | Explore | `waygraph auto` / `waygraph auto --cli` |
1066
+ | Browser command reference | `waygraph browser` |
1067
+ | List live browser sessions | `waygraph browser sessions [--json]` |
1068
+ | Open a new persistent browser | `waygraph browser start` (headful, about:blank by default) |
1069
+ | Stop a browser session | `waygraph browser stop <sessionId>` / `stop --all` |
1070
+ | Pilot bootstrap (browser + graph + snapshot) | `waygraph pilot start` |
1071
+ | Attach to existing session (graph only) | `waygraph pilot attach <sessionId>` |
1026
1072
  | Path-find | `waygraph auto --blocks LoginPage OrderComplete` |
1027
- | Run `--cli` as a background session | `waygraph auto --cli --detach` -> `{sessionId, socketPath}` |
1028
- | Drive a detached session (no TTY) | `waygraph auto send <sessionId> "<pick>"` -> JSON state |
1029
- | Read a detached session's state | `waygraph auto status <sessionId>` (no side effects) |
1030
- | Reattach a terminal to a detached session | `waygraph auto attach <sessionId>` |
1073
+ | Run `--cli` as a background session (legacy) | `waygraph auto --cli --detach` -> `{sessionId, socketPath}` |
1074
+ | Drive a detached session (no TTY) | `waygraph browser send <sessionId> "<pick>"` -> JSON state |
1075
+ | Read a detached session's state | `waygraph browser status <sessionId>` (no side effects) |
1076
+ | Reattach a terminal to a detached session | `waygraph browser attach <sessionId>` |
1031
1077
  | Read the live page (aria, small/default) | `waygraph auto dom <sessionId>` |
1032
1078
  | Read the live page (raw DOM, bounded) | `waygraph auto dom <sessionId> --mode full` |
1033
1079
  | Scope either to one element | `waygraph auto dom <sessionId> --selector ".inventory_list"` |
1034
1080
  | Detached session with a real visible browser | `waygraph auto --cli --detach --non-headless` |
1035
1081
  | Read the session's Checkpoint/Block history | `waygraph auto trace <sessionId>` |
1036
1082
  | Whole-project nav-escape + inline-selector + orphan sweep | `waygraph check [project]` |
1083
+ | `tsc --noEmit` + bad-practice warnings | `waygraph typecheck [project]` (`--no-practices` to skip scan) |
1037
1084
  | Waygraph Map enforcement (verbatim url-vs-folder, exits 1 on a violation) | `waygraph map [project]` |
1038
1085
  | Graph crawl | `waygraph traverse [project] --parallel N --min-edge-coverage 80%` |
1039
1086
  | Coding-agent defs | `waygraph agent-dive --loop claude` |
1040
1087
  | Print packaged skills | `waygraph --skill` / `--skill-pilot` / `--skill-pilot-blind` / `--skill-convention` |
1041
1088
  | One-shot temp-dir demo | `waygraph try demo` / `waygraph try auto` / `waygraph try auto:cli` |
1089
+ | Run the project's `@playwright/test` suite | `waygraph test` |
1090
+ | Same suite, Playwright's interactive UI Mode | `waygraph test ui` (or `--ui`) |
1042
1091
 
1043
1092
  `--blocks` / positional accepts a Flow export, a `.flow.ts` path, or `"a then b"`.
1044
1093
  `auto <file.flow.ts>` **runs** that flow (same as `run`); bare `auto` still explores.
@@ -1167,8 +1216,9 @@ it out from under you.
1167
1216
  git clone git@github.com:deviate-dv8/waygraph.git
1168
1217
  cd waygraph
1169
1218
  npm install
1170
- npm run typecheck # tsc --noEmit
1171
- npm run test # playwright test
1219
+ npm run typecheck # waygraph typecheck . (tsc --noEmit + practice warnings)
1220
+ npm run test # node --test tests/unit + playwright test
1221
+ npm run test:ui # playwright test --ui
1172
1222
  npm run build # tsc -p tsconfig.build.json, emits dist/
1173
1223
  ```
1174
1224
 
package/dist/cli.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * auto Explore picker; `.flow.ts` / `--blocks From To` = run that path
7
7
  * demo Watch (step overlay); `--blocks` `--data` `--auto-next` `--fast` `--full` `--mini` `--ff-expand` `--ff-disabled`
8
8
  * run Execute; `--blocks` `--data` `--non-headless` `--video`
9
+ * test Runs the project's own @playwright/test suite; `test ui` / `--ui` = UI Mode
9
10
  *
10
11
  * Also: list / nav / validate / check / graph / init / agent-dive / traverse / try
11
12
  * Skills: --skill / --skill-pilot / --skill-pilot-blind / --skill-convention
package/dist/cli.js CHANGED
@@ -6,6 +6,7 @@
6
6
  * auto Explore picker; `.flow.ts` / `--blocks From To` = run that path
7
7
  * demo Watch (step overlay); `--blocks` `--data` `--auto-next` `--fast` `--full` `--mini` `--ff-expand` `--ff-disabled`
8
8
  * run Execute; `--blocks` `--data` `--non-headless` `--video`
9
+ * test Runs the project's own @playwright/test suite; `test ui` / `--ui` = UI Mode
9
10
  *
10
11
  * Also: list / nav / validate / check / graph / init / agent-dive / traverse / try
11
12
  * Skills: --skill / --skill-pilot / --skill-pilot-blind / --skill-convention
@@ -7186,6 +7187,24 @@ async function expandSpecFlowFiles(projectDir, spec) {
7186
7187
  }
7187
7188
  const args = process.argv.slice(2);
7188
7189
  const command = args[0];
7190
+ function printBrowserUsage() {
7191
+ console.log(`waygraph browser — persistent Playwright sessions (headful by default)
7192
+
7193
+ waygraph browser start [--inject preset|path] [--goto <url>] [--blank] [--headless] [--cli] [project]
7194
+ Open a new session (about:blank by default)
7195
+ waygraph browser sessions [--json] [project]
7196
+ List live sessions for a project
7197
+ waygraph browser stop <sessionId|--all> [project]
7198
+ waygraph browser attach <sessionId> Terminal picker on a live session
7199
+
7200
+ waygraph browser status <sessionId> Current menu (no side effects)
7201
+ waygraph browser send <sessionId> "<pick>"
7202
+ waygraph browser reach <sessionId> <Checkpoint>
7203
+ waygraph browser dom|trace|console|storage|highlight <sessionId> …
7204
+ waygraph browser click|type|press|goto|upload|reload|resync <sessionId> …
7205
+
7206
+ auto send|status|… and pilot send|status|… use the same session ids.`);
7207
+ }
7189
7208
  function printBrowserSessionsList(sessions, projectDir) {
7190
7209
  if (sessions.length === 0) {
7191
7210
  console.log(`No live browser sessions for ${projectDir}.`);
@@ -7278,7 +7297,7 @@ Primary (less is more):
7278
7297
  label,tone?,size?,weight?}], todos[], todoIndex?,
7279
7298
  todoTitle?, holdMs? (0=until next), clear:true.
7280
7299
  Missing selectors listed in response, not fatal.
7281
- waygraph browser List live browser sessions for cwd
7300
+ waygraph browser Show browser subcommands
7282
7301
  waygraph browser start Open a new session (headful by default, about:blank)
7283
7302
  --inject preset|path Merge an external Block library (e.g. saucedemo)
7284
7303
  --goto <url> Navigate on start (disables blank page)
@@ -7318,6 +7337,11 @@ Primary (less is more):
7318
7337
  --video-viewport WxH Recording size (default run: 1280x720)
7319
7338
  --ff-expand Same as demo (expand FFCompose inners)
7320
7339
  --ff-disabled Same as demo (dispute: expand FF)
7340
+ waygraph test Runs the project's @playwright/test suite (cwd) -
7341
+ thin wrapper: forwards to the local playwright
7342
+ binary (or npx playwright as a fallback)
7343
+ test ui / test --ui Playwright UI Mode (interactive, watch + trace)
7344
+ <any other args> Forwarded verbatim (--grep, a spec path, --headed, …)
7321
7345
 
7322
7346
  Also:
7323
7347
  waygraph list | nav | validate | check | typecheck | graph | init <name>
@@ -7449,6 +7473,21 @@ async function main() {
7449
7473
  await runChain(proj, spec);
7450
7474
  break;
7451
7475
  }
7476
+ case "test": {
7477
+ const rest = args.slice(1);
7478
+ const wantsUi = rest[0] === "ui" || rest.includes("--ui");
7479
+ const forwarded = rest[0] === "ui" ? rest.slice(1) : rest;
7480
+ const pwArgs = wantsUi && !forwarded.includes("--ui")
7481
+ ? ["test", "--ui", ...forwarded]
7482
+ : ["test", ...forwarded];
7483
+ const proj = process.cwd();
7484
+ const localPlaywrightBin = join(proj, "node_modules", ".bin", "playwright");
7485
+ const code = existsSync(localPlaywrightBin)
7486
+ ? await runInherited(localPlaywrightBin, pwArgs, proj)
7487
+ : await runInherited("npx", ["--yes", "playwright", ...pwArgs], proj);
7488
+ process.exitCode = code;
7489
+ break;
7490
+ }
7452
7491
  case "init": {
7453
7492
  initCommand(args[1] ?? "");
7454
7493
  break;
@@ -7784,8 +7823,7 @@ Agents shipped: waygraph-planner, waygraph-author, waygraph-healer.
7784
7823
  break;
7785
7824
  }
7786
7825
  if (!sub) {
7787
- const proj = resolve(process.cwd());
7788
- printBrowserSessionsList(listBrowserSessions(proj), proj);
7826
+ printBrowserUsage();
7789
7827
  break;
7790
7828
  }
7791
7829
  if (sub === "start" || sub.startsWith("-")) {
@@ -7839,12 +7877,8 @@ Agents shipped: waygraph-planner, waygraph-author, waygraph-healer.
7839
7877
  sub !== "reach" &&
7840
7878
  sub !== "resync" &&
7841
7879
  sub !== "highlight") {
7842
- console.error("waygraph browser: usage:\n" +
7843
- " waygraph browser List live sessions (cwd)\n" +
7844
- " waygraph browser start [--inject preset|path] [--goto <url>] [--blank] [--headless] [--cli] [project]\n" +
7845
- " waygraph browser sessions [--json] [project]\n" +
7846
- " waygraph browser stop <sessionId|--all> [project]\n" +
7847
- " waygraph browser send|status|attach|highlight|dom|… <sessionId> … (same as auto)");
7880
+ console.error("waygraph browser: unknown subcommand — run `waygraph browser` for usage");
7881
+ printBrowserUsage();
7848
7882
  process.exit(1);
7849
7883
  }
7850
7884
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -6,7 +6,8 @@
6
6
  "description": "Full Sauce Demo (saucedemo.com) example - Effect / MemNav / waygraph auto.",
7
7
  "scripts": {
8
8
  "typecheck": "tsc --noEmit",
9
- "test": "playwright test",
9
+ "test": "waygraph test",
10
+ "test:ui": "waygraph test ui",
10
11
  "flows": "waygraph list",
11
12
  "demo": "waygraph demo --blocks \"loginFlow then shopFlow\" --data \"{\\\"saucedemo.credentials\\\":{\\\"username\\\":\\\"standard_user\\\",\\\"password\\\":\\\"secret_sauce\\\"},\\\"saucedemo.selectedItem\\\":{\\\"id\\\":\\\"sauce-labs-backpack\\\",\\\"name\\\":\\\"Sauce Labs Backpack\\\"}}\"",
12
13
  "demo:step": "waygraph demo --blocks \"loginFlow then shopFlow\" --title \"Shop demo\" --data \"{\\\"saucedemo.credentials\\\":{\\\"username\\\":\\\"standard_user\\\",\\\"password\\\":\\\"secret_sauce\\\"},\\\"saucedemo.selectedItem\\\":{\\\"id\\\":\\\"sauce-labs-backpack\\\",\\\"name\\\":\\\"Sauce Labs Backpack\\\"}}\"",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.15.14",
3
+ "version": "0.15.16",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",
@@ -36,7 +36,9 @@
36
36
  "scripts": {
37
37
  "build": "tsc -p tsconfig.build.json",
38
38
  "typecheck": "node bin/waygraph typecheck .",
39
- "test": "playwright test",
39
+ "test": "npm run test:unit && playwright test",
40
+ "test:ui": "playwright test --ui",
41
+ "test:unit": "node --import tsx/esm --test tests/unit/*.spec.ts",
40
42
  "docs:preview": "python3 -m http.server 4173 --directory docs",
41
43
  "example:saucedemo:install": "npm --prefix examples/saucedemo install",
42
44
  "example:saucedemo:test": "npm --prefix examples/saucedemo test",
@@ -4,7 +4,8 @@
4
4
  "type": "module",
5
5
  "description": "Self-contained saucedemo quickstart (copied into a temp dir by `waygraph try demo`).",
6
6
  "scripts": {
7
- "test": "playwright test",
7
+ "test": "waygraph test",
8
+ "test:ui": "waygraph test ui",
8
9
  "typecheck": "tsc --noEmit",
9
10
  "check": "waygraph check",
10
11
  "auto": "waygraph auto",
@@ -5,7 +5,8 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "typecheck": "waygraph typecheck .",
8
- "test": "playwright test",
8
+ "test": "waygraph test",
9
+ "test:ui": "waygraph test ui",
9
10
  "fixture": "node scripts/fixture-server.mjs",
10
11
  "list": "waygraph list",
11
12
  "check": "waygraph check",
@@ -4,16 +4,29 @@ description: Cold-start a waygraph project against a real site with zero existin
4
4
  ---
5
5
 
6
6
  Blind Pilot is the same session mechanism as `waygraph-pilot`, minus the requirement of any
7
- pre-existing Blocks. `auto --cli --detach` tolerates a project with zero `.block.ts` files -
8
- `auto click/type/goto/press/upload` act on the real page before any Block exists to cover it.
7
+ pre-existing Blocks. A project with zero `.block.ts` files still gets a live session —
8
+ `browser click/type/goto/press/upload` act on the real page before any Block exists to cover it.
9
9
  This package generates **no Block content for you** - you write real `.block.ts`/`*Sel`/
10
10
  mem-key files by hand as you go. That's the whole point: turn one-off exploration into
11
11
  permanent, reusable, typed coverage instead of leaving nothing behind.
12
12
 
13
+ ## Session lifecycle (list first)
14
+
15
+ ```
16
+ waygraph browser # show browser subcommands
17
+ waygraph browser sessions # list live sessions (cwd)
18
+ waygraph browser start [--goto <url>] # new headful session (about:blank by default)
19
+ waygraph browser attach <sessionId> # terminal picker on existing session
20
+ waygraph browser stop <sessionId|--all> # shut down when done
21
+ ```
22
+
23
+ `browser start` always opens a **new** session. Check `browser sessions` before starting another.
24
+ Session control works as `browser …` or `auto …` with the same `<sessionId>`.
25
+
13
26
  ## The real loop
14
27
 
15
- 1. `auto goto <sessionId> <url>` / `auto click` / `auto type` to explore the real page.
16
- 2. `auto dom <sessionId> --mode full --selector <sel>` to read real structure before writing
28
+ 1. `browser goto <sessionId> <url>` / `browser click` / `browser type` to explore the real page.
29
+ 2. `browser dom <sessionId> --mode full --selector <sel>` to read real structure before writing
17
30
  a selector - never guess a selector, confirm it against the real DOM first. `--mode aria`
18
31
  is faster for a first pass but can show stale/hidden responsive-duplicate content in some
19
32
  real apps (confirmed live: a hidden `lg:hidden` panel's heading text showed up in an aria
@@ -24,19 +37,20 @@ permanent, reusable, typed coverage instead of leaving nothing behind.
24
37
  then `Nav`/`Page`/`Method` Blocks, following `templates/scaffold`'s own folder convention
25
38
  (`(group)/<page-slug>/page.block.ts` + `nav.block.ts` + `methods/*.block.ts` + one `*.sel.ts`)
26
39
  so the result becomes part of the Waygraph Map, not a scattered one-off file.
27
- 4. `auto reload <sessionId>` to pick up the newly-written Block(s) without restarting.
28
- 5. Optionally narrate for a headful watcher: `auto highlight <sessionId> '{"rings":[...],"todos":[...]}'`
29
- 6. Run the new Block for real via `auto send` - prove it works before moving to the next
40
+ 4. `browser reload <sessionId>` to pick up the newly-written Block(s) without restarting.
41
+ 5. Optionally narrate for a headful watcher: `browser highlight <sessionId> '{"rings":[...],"todos":[...]}'`
42
+ Raw ops show **`Running (no Block): …`** in the bottom-left toast; Block runs show **`Running (Block): …`**.
43
+ 6. Run the new Block for real via `browser send` - prove it works before moving to the next
30
44
  pattern, exactly like any other real Block.
31
- 6. Ask the user a clarifying question only when something genuinely can't be resolved from
45
+ 7. Ask the user a clarifying question only when something genuinely can't be resolved from
32
46
  the DOM alone (is this instance local or published? does a downstream integration exist?)
33
- - don't ask about things `auto dom` can just answer.
47
+ - don't ask about things `browser dom` can just answer.
34
48
 
35
49
  ## Real gotchas specific to cold-start authoring
36
50
 
37
51
  - **`discoverGraph`'s per-file import errors are mostly silent.** A malformed newly-written
38
52
  Block file can simply vanish from the graph with no error printed anywhere obvious - if a
39
- Block you just wrote doesn't show up after `auto reload`, check `waygraph graph`'s own
53
+ Block you just wrote doesn't show up after `browser reload`, check `waygraph graph`'s own
40
54
  `skipped` list and the file's syntax directly, don't assume it just needs more time.
41
55
  - **`defineAssertBlock` needs no `<In, Out>` generic to type-check** (`checkpoint: "X"` alone
42
56
  is enough for TypeScript to infer it) - but older/naive static-graph discovery logic may
@@ -47,9 +61,9 @@ permanent, reusable, typed coverage instead of leaving nothing behind.
47
61
  - **A `<p>`/text-based selector often needs scoping**, not just a class name - a sibling
48
62
  "chat list item" and "message preview" frequently share the exact same CSS classes in real
49
63
  apps, distinguished only by DOM position (first vs second child of a specific wrapper).
50
- Confirm via `auto dom --mode full` before assuming a class alone is unique enough.
64
+ Confirm via `browser dom --mode full` before assuming a class alone is unique enough.
51
65
  - **Confirm a selector count, not just its first match**, when building anything the menu
52
- will expand into multiple live rows (an `instanceOptions`-driven Block) - `auto dom`'s
66
+ will expand into multiple live rows (an `instanceOptions`-driven Block) - `browser dom`'s
53
67
  default read can silently show only one match even when several exist; check the real
54
68
  page count (e.g. via a scoped debug script) before assuming a plain `.first()` is safe
55
69
  long-term. A `.first()`-shaped Block is a legitimate STARTING point for a page that only
@@ -57,6 +71,7 @@ permanent, reusable, typed coverage instead of leaving nothing behind.
57
71
  `defineEffectBlock` (see the `waygraph-pilot` skill and
58
72
  `examples/saucedemo/.../nav-item-detail.block.ts` for the real pattern) once a second real
59
73
  row genuinely exists to pick between, not before.
60
- - **Prefer the real Pilot overlay over ad hoc status output** when driving a
61
- `--non-headless` session someone might be watching - it auto-updates on every menu build,
62
- point a human at the badge/panel instead of re-inventing status reporting.
74
+ - **Prefer the real Pilot overlay over ad hoc status output** when driving a headful session
75
+ someone might be watching - badge/panel on `about:blank` and after every navigation; raw
76
+ ops toast **`Running (no Block): …`**. Point a human at the badge instead of re-inventing
77
+ status reporting.
@@ -14,7 +14,7 @@ reading each `auto status`/`auto send` response.
14
14
  | Layer | Command | What it is |
15
15
  |-------|---------|------------|
16
16
  | **auto** | `waygraph auto` | Interactive explore (picker / `--cli` menu). **Not** a persistent agent browser. |
17
- | **browser** | `waygraph browser start` | New persistent Playwright session — **headful by default**, **about:blank by default**. `waygraph browser` lists live sessions only. |
17
+ | **browser** | `waygraph browser start` | New persistent Playwright session — **headful by default**, **about:blank by default**. `waygraph browser` prints subcommands; `browser sessions` lists live ones. |
18
18
  | **pilot** | `waygraph pilot start` | Bootstrap only: `browser start` + whole-project `graph` + starting `snapshot` in one JSON payload. Does not plan or act. |
19
19
 
20
20
  Session control (`send`, `status`, `highlight`, `dom`, …) works on **`auto`**, **`browser`**, and **`pilot`** — same socket, same session id: