waygraph 0.15.2 → 0.15.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.
Files changed (41) hide show
  1. package/dist/auto-session-ipc.d.ts +14 -0
  2. package/dist/auto-session-ipc.js +4 -0
  3. package/dist/auto-session.d.ts +15 -0
  4. package/dist/auto-session.js +34 -1
  5. package/dist/cli.js +43 -2
  6. package/dist/engine.d.ts +124 -12
  7. package/dist/engine.js +170 -13
  8. package/dist/highlights.d.ts +8 -0
  9. package/dist/highlights.js +2 -0
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.js +1 -1
  12. package/dist/pilot-overlay.d.ts +42 -0
  13. package/dist/pilot-overlay.js +148 -0
  14. package/dist/types.d.ts +17 -0
  15. package/examples/saucedemo/.waygraph-auto/1d266123.log +0 -0
  16. package/examples/saucedemo/.waygraph-auto/2c7e8edd.log +0 -0
  17. package/examples/saucedemo/.waygraph-auto/49edc885.log +4 -0
  18. package/examples/saucedemo/.waygraph-auto/79600ead.log +0 -0
  19. package/examples/saucedemo/.waygraph-auto/d2c6ed66.log +0 -0
  20. package/examples/saucedemo/.waygraph-auto/ddcb4212.log +0 -0
  21. package/examples/saucedemo/.waygraph-auto/ebc2ebdb.log +0 -0
  22. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +8 -7
  23. package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +8 -10
  24. package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +11 -10
  25. package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login-for-flow.ts +5 -4
  26. package/examples/saucedemo/src/flows/checkout.flow.ts +61 -97
  27. package/examples/saucedemo/src/flows/login.flow.ts +11 -2
  28. package/examples/saucedemo/src/flows/shop.flow.ts +13 -13
  29. package/examples/saucedemo/src/flows/viewer-blocked.flow.ts +9 -2
  30. package/package.json +1 -1
  31. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +8 -7
  32. package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +8 -10
  33. package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +11 -10
  34. package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login-for-flow.ts +5 -4
  35. package/templates/quickstart/src/flows/checkout.flow.ts +61 -97
  36. package/templates/quickstart/src/flows/login.flow.ts +11 -2
  37. package/templates/quickstart/src/flows/shop.flow.ts +13 -13
  38. package/templates/quickstart/src/flows/viewer-blocked.flow.ts +9 -2
  39. package/templates/skills/waygraph-blind-pilot.skill.md +2 -1
  40. package/templates/skills/waygraph-pilot.skill.md +17 -0
  41. package/examples/saucedemo/.waygraph-auto/0b1f5b26.json +0 -8
@@ -1,4 +1,4 @@
1
- import { Engine, start, end, withTitle } from "waygraph";
1
+ import { Engine, withTitle } from "waygraph";
2
2
  import { NavLoginBlock } from "../blocks/saucedemo-web/nav-login.block.js";
3
3
  import { FillUsernameBlock } from "../blocks/saucedemo-web/methods/fill-username.method.block.js";
4
4
  import { FillPasswordBlock } from "../blocks/saucedemo-web/methods/fill-password.method.block.js";
@@ -8,7 +8,16 @@ const engine = new Engine();
8
8
 
9
9
  // The step-mode overlay prepends "Episode N: " itself - the title here is
10
10
  // just the label, not the full heading.
11
+ // map() + ctx stubs on the Method blocks (see fill-username / fill-password /
12
+ // submit-login) - no HighlightFixtureMap.
11
13
  export const loginFlow = withTitle(
12
- engine.defineFlow([start, NavLoginBlock, FillUsernameBlock, FillPasswordBlock, SubmitLoginForFlow, end]),
14
+ engine
15
+ .map()
16
+ .start()
17
+ .gotoPage(NavLoginBlock)
18
+ .method(FillUsernameBlock)
19
+ .method(FillPasswordBlock)
20
+ .method(SubmitLoginForFlow)
21
+ .end(),
13
22
  "Sign In",
14
23
  );
@@ -1,4 +1,4 @@
1
- import { Engine, start, end, withTitle } from "waygraph";
1
+ import { Engine, withTitle } from "waygraph";
2
2
  import { AddToCartBlock } from "../blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.js";
3
3
  import { NavCartBlock } from "../blocks/saucedemo-web/cart/nav-cart.block.js";
4
4
  import { NavCheckoutInfoBlock } from "../blocks/saucedemo-web/cart/nav-checkout-info.block.js";
@@ -13,17 +13,17 @@ const engine = new Engine();
13
13
  // Episode-2 half of chainFlow(loginFlow, shopFlow) - assumes already LoggedIn
14
14
  // (AddToCartBlock's In is the Checkpoint<string> wildcard).
15
15
  export const shopFlow = withTitle(
16
- engine.defineFlow([
17
- start,
18
- AddToCartBlock,
19
- NavCartBlock,
20
- NavCheckoutInfoBlock,
21
- FillFirstNameBlock,
22
- FillLastNameBlock,
23
- FillPostalCodeBlock,
24
- SubmitCheckoutInfoBlock,
25
- FinishOrderBlock,
26
- end,
27
- ]),
16
+ engine
17
+ .map()
18
+ .start()
19
+ .method(AddToCartBlock)
20
+ .gotoPage(NavCartBlock)
21
+ .gotoPage(NavCheckoutInfoBlock)
22
+ .method(FillFirstNameBlock)
23
+ .method(FillLastNameBlock)
24
+ .method(FillPostalCodeBlock)
25
+ .method(SubmitCheckoutInfoBlock)
26
+ .method(FinishOrderBlock)
27
+ .end(),
28
28
  "Shop & Checkout",
29
29
  );
@@ -1,4 +1,4 @@
1
- import { Engine, start, end, withTitle, withSessionReset, withExpectedFailure } from "waygraph";
1
+ import { Engine, withTitle, withSessionReset, withExpectedFailure } from "waygraph";
2
2
  import { NavLoginBlock } from "../blocks/saucedemo-web/nav-login.block.js";
3
3
  import { FillUsernameBlock } from "../blocks/saucedemo-web/methods/fill-username.method.block.js";
4
4
  import { FillPasswordBlock } from "../blocks/saucedemo-web/methods/fill-password.method.block.js";
@@ -25,7 +25,14 @@ const engine = new Engine();
25
25
  export const viewerBlockedFlow = withExpectedFailure(
26
26
  withTitle(
27
27
  withSessionReset(
28
- engine.defineFlow([start, NavLoginBlock, FillUsernameBlock, FillPasswordBlock, SubmitLoginBlock, end]),
28
+ engine
29
+ .map()
30
+ .start()
31
+ .gotoPage(NavLoginBlock)
32
+ .method(FillUsernameBlock)
33
+ .method(FillPasswordBlock)
34
+ .method(SubmitLoginBlock)
35
+ .end(),
29
36
  ),
30
37
  "Viewer: Blocked Login Attempt",
31
38
  ),
@@ -25,7 +25,8 @@ permanent, reusable, typed coverage instead of leaving nothing behind.
25
25
  (`(group)/<page-slug>/page.block.ts` + `nav.block.ts` + `methods/*.block.ts` + one `*.sel.ts`)
26
26
  so the result becomes part of the Waygraph Map, not a scattered one-off file.
27
27
  4. `auto reload <sessionId>` to pick up the newly-written Block(s) without restarting.
28
- 5. Run the new Block for real via `auto send` - prove it works before moving to the next
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
29
30
  pattern, exactly like any other real Block.
30
31
  6. Ask the user a clarifying question only when something genuinely can't be resolved from
31
32
  the DOM alone (is this instance local or published? does a downstream integration exist?)
@@ -16,12 +16,29 @@ waygraph pilot start # bootstraps: {sessionId, socketPath,
16
16
  waygraph auto status <sessionId> # re-read the live menu, no side effects
17
17
  waygraph auto send <sessionId> "<pick>" # run exactly one Block (by menu index or name)
18
18
  waygraph auto reach <sessionId> <Checkpoint> # path-find + run a whole route in one call
19
+ waygraph auto highlight <sessionId> '<json>' # paint rings/todos on the live page (agent fixtures)
19
20
  ```
20
21
 
21
22
  `graph` in `pilot start`'s response is the **whole project's** Block/Checkpoint graph, not
22
23
  just what's reachable from here - use it to plan several steps ahead before you start
23
24
  sending picks.
24
25
 
26
+ ## Highlight fixtures (agent-sent narration)
27
+
28
+ Block `stubBefore` / `withHighlightFixtures` only paint in `waygraph demo`. In Pilot they
29
+ land in `auto trace` as metadata but do **not** draw on the page. When a human is watching
30
+ a headful session (or you want to narrate intent before a send), paint yourself:
31
+
32
+ ```
33
+ waygraph auto highlight <sessionId> '{"rings":[{"selector":"#user-name","label":"Username","tone":"planned"},{"selector":"#password","label":"Password","tone":"info"}],"todos":["Fill username","Fill password","Submit"],"todoIndex":0,"holdMs":0}'
34
+ waygraph auto highlight <sessionId> '{"clear":true}'
35
+ ```
36
+
37
+ - `tone`: `planned` (purple, default) | `auto` | `info` | `warning` | `danger` | `success` (pilot `orange` is for `auto dom` vision only)
38
+ - `holdMs`: ms to keep fixtures; `0` = until the next highlight / clear (default 12000)
39
+ - Missing selectors are listed in the JSON response (`missing`) - not a hard failure
40
+ - Does not replace `auto send` - paint, then run the real Block
41
+
25
42
  ## Rule 1: run real Blocks, not raw primitives
26
43
 
27
44
  Default action is always `auto send`/`auto reach` (a real Block). `auto dom/click/type/
@@ -1,8 +0,0 @@
1
- {
2
- "sessionId": "0b1f5b26",
3
- "socketPath": "/tmp/waygraph-auto/0b1f5b26.sock",
4
- "pid": 1136773,
5
- "projectDir": "/home/dan/Desktop/Work/zsign/services/waygraph/examples/saucedemo",
6
- "startedAt": "2026-09-20T18:04:00.000Z",
7
- "headless": false
8
- }