waygraph 0.15.43 → 0.15.45

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 (99) hide show
  1. package/dist/analysis/coverage-gap.d.ts +11 -0
  2. package/dist/analysis/coverage-gap.js +119 -0
  3. package/dist/analysis/graph.d.ts +92 -0
  4. package/dist/analysis/graph.js +467 -0
  5. package/dist/analysis/map-check.d.ts +18 -0
  6. package/dist/analysis/map-check.js +140 -0
  7. package/dist/analysis/practices-check.d.ts +14 -0
  8. package/dist/analysis/practices-check.js +195 -0
  9. package/dist/auto-explore.d.ts +1 -1
  10. package/dist/auto-explore.js +1 -1
  11. package/dist/auto-session/helpers.d.ts +2 -2
  12. package/dist/auto-session/session.js +4 -4
  13. package/dist/cli/usage.d.ts +1 -1
  14. package/dist/cli/util.d.ts +8 -1
  15. package/dist/cli/util.js +9 -2
  16. package/dist/commands/check.js +2 -2
  17. package/dist/commands/map.js +1 -1
  18. package/dist/commands/session.js +7 -7
  19. package/dist/commands/traverse.js +2 -2
  20. package/dist/engine/branch-regression.js +2 -1
  21. package/dist/engine/compose.js +3 -2
  22. package/dist/engine/core.js +5 -4
  23. package/dist/engine/engine-class.js +13 -12
  24. package/dist/engine/flow.js +4 -3
  25. package/dist/engine/run-graph.js +4 -3
  26. package/dist/errors.d.ts +122 -0
  27. package/dist/errors.js +125 -0
  28. package/dist/highlights/shorthand.d.ts +24 -0
  29. package/dist/highlights/shorthand.js +30 -0
  30. package/dist/index.d.ts +13 -11
  31. package/dist/index.js +7 -6
  32. package/dist/mem-page.js +2 -1
  33. package/dist/pilot.d.ts +1 -1
  34. package/dist/pilot.js +1 -1
  35. package/dist/session/auto-explore-run.d.ts +37 -0
  36. package/dist/session/auto-explore-run.js +670 -0
  37. package/dist/session/auto-explore.d.ts +57 -0
  38. package/dist/session/auto-explore.js +376 -0
  39. package/dist/session/auto-session-ipc.d.ts +150 -0
  40. package/dist/session/auto-session-ipc.js +499 -0
  41. package/dist/session/block-inject.d.ts +21 -0
  42. package/dist/session/block-inject.js +97 -0
  43. package/dist/session/browser.d.ts +15 -0
  44. package/dist/session/browser.js +29 -0
  45. package/dist/session/overlay-beacon.d.ts +44 -0
  46. package/dist/session/overlay-beacon.js +85 -0
  47. package/dist/session/pilot.d.ts +54 -0
  48. package/dist/session/pilot.js +80 -0
  49. package/dist/traverse/coverage.d.ts +59 -0
  50. package/dist/traverse/coverage.js +127 -0
  51. package/dist/traverse/lease.d.ts +18 -0
  52. package/dist/traverse/lease.js +62 -0
  53. package/dist/traverse/run.d.ts +47 -0
  54. package/dist/traverse/run.js +439 -0
  55. package/examples/saucedemo/.waygraph-auto/00b0c55c.log +22 -0
  56. package/examples/saucedemo/.waygraph-auto/00e5d037.log +5 -0
  57. package/examples/saucedemo/.waygraph-auto/015be8f6.log +6 -0
  58. package/examples/saucedemo/.waygraph-auto/026e188e.log +0 -0
  59. package/examples/saucedemo/.waygraph-auto/050e5b55.log +0 -0
  60. package/examples/saucedemo/.waygraph-auto/07845ed1.log +0 -0
  61. package/examples/saucedemo/.waygraph-auto/096fea05.log +20 -0
  62. package/examples/saucedemo/.waygraph-auto/0c19e232.log +5 -0
  63. package/examples/saucedemo/.waygraph-auto/1122c13c.log +0 -0
  64. package/examples/saucedemo/.waygraph-auto/123d1cad.log +5 -0
  65. package/examples/saucedemo/.waygraph-auto/12ed8e28.log +0 -0
  66. package/examples/saucedemo/.waygraph-auto/1cb6f44c.log +5 -0
  67. package/examples/saucedemo/.waygraph-auto/1fdb2100.log +0 -0
  68. package/examples/saucedemo/.waygraph-auto/2b9b56fc.log +20 -0
  69. package/examples/saucedemo/.waygraph-auto/30a5c848.log +20 -0
  70. package/examples/saucedemo/.waygraph-auto/33a50dc0.log +0 -0
  71. package/examples/saucedemo/.waygraph-auto/3a208bb8.log +20 -0
  72. package/examples/saucedemo/.waygraph-auto/3e3c0f3b.log +0 -0
  73. package/examples/saucedemo/.waygraph-auto/573abedd.log +0 -0
  74. package/examples/saucedemo/.waygraph-auto/756fd326.log +20 -0
  75. package/examples/saucedemo/.waygraph-auto/78043767.log +20 -0
  76. package/examples/saucedemo/.waygraph-auto/976394cd.log +20 -0
  77. package/examples/saucedemo/.waygraph-auto/9a26134c.log +20 -0
  78. package/examples/saucedemo/.waygraph-auto/9d827954.log +20 -0
  79. package/examples/saucedemo/.waygraph-auto/a4f8d355.log +20 -0
  80. package/examples/saucedemo/.waygraph-auto/aa226dd0.log +22 -0
  81. package/examples/saucedemo/.waygraph-auto/ac5dde3d.log +0 -0
  82. package/examples/saucedemo/.waygraph-auto/af2fae12.log +0 -0
  83. package/examples/saucedemo/.waygraph-auto/b0752c49.log +0 -0
  84. package/examples/saucedemo/.waygraph-auto/b14811d7.log +6 -0
  85. package/examples/saucedemo/.waygraph-auto/c9d76e32.log +0 -0
  86. package/examples/saucedemo/.waygraph-auto/cae91469.log +0 -0
  87. package/examples/saucedemo/.waygraph-auto/cc989184.log +20 -0
  88. package/examples/saucedemo/.waygraph-auto/d846cd78.log +0 -0
  89. package/examples/saucedemo/.waygraph-auto/e5127c03.log +22 -0
  90. package/examples/saucedemo/.waygraph-auto/eb38d92e.log +22 -0
  91. package/examples/saucedemo/.waygraph-auto/ee86203e.log +0 -0
  92. package/package.json +1 -1
  93. package/templates/agents/waygraph-author.agent.md +24 -51
  94. package/templates/agents/waygraph-planner.agent.md +12 -5
  95. package/templates/scaffold/scripts/README.md +13 -0
  96. package/templates/scaffold/src/flows/README.md +18 -0
  97. package/templates/scaffold/src/map/README.md +31 -0
  98. package/templates/scaffold/src/states/README.md +15 -0
  99. package/templates/scaffold/tests/README.md +10 -0
@@ -0,0 +1,20 @@
1
+ [13:02:58.767] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:02:58.768] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:02:58.768] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:02:58.768] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:02:58.768] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:02:59.901] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [13:03:01.746] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [13:03:01.917] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [13:03:03.342] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [13:03:03.706] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [13:03:03.706] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [13:03:03.706] waygraph pilot: stub.after ctx.device(mobile)
13
+ [13:03:03.706] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [13:03:07.006] waygraph pilot: stub.before ctx.title("Open cart · landscape")
15
+ [13:03:07.006] waygraph pilot: stub.before ctx.todos n=6 index=5
16
+ [13:03:07.006] waygraph pilot: stub.before ctx.device(mobile)
17
+ [13:03:07.006] waygraph pilot: stub.before ctx.zoom(1.4)
18
+ [13:03:07.007] waygraph pilot: stub.before ring .shopping_cart_link tone=planned label="Cart"
19
+ [13:03:07.381] waygraph pilot: stub.after ctx.title("Your cart · desktop")
20
+ [13:03:07.381] waygraph pilot: stub.after ring .cart_item tone=success label="Cart items"
@@ -0,0 +1,20 @@
1
+ [12:45:05.504] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [12:45:05.504] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [12:45:05.504] waygraph pilot: stub.before ctx.device(mobile)
4
+ [12:45:05.504] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [12:45:05.505] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [12:45:06.709] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [12:45:08.058] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [12:45:08.158] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [12:45:09.619] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [12:45:09.890] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [12:45:09.890] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [12:45:09.890] waygraph pilot: stub.after ctx.device(mobile)
13
+ [12:45:09.890] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [12:45:12.501] waygraph pilot: stub.before ctx.title("Open cart · landscape")
15
+ [12:45:12.501] waygraph pilot: stub.before ctx.todos n=6 index=5
16
+ [12:45:12.501] waygraph pilot: stub.before ctx.device(mobile)
17
+ [12:45:12.501] waygraph pilot: stub.before ctx.zoom(1.4)
18
+ [12:45:12.501] waygraph pilot: stub.before ring .shopping_cart_link tone=planned label="Cart"
19
+ [12:45:12.724] waygraph pilot: stub.after ctx.title("Your cart · desktop")
20
+ [12:45:12.724] waygraph pilot: stub.after ring .cart_item tone=success label="Cart items"
@@ -0,0 +1,20 @@
1
+ node:internal/modules/esm/resolve:272
2
+ throw new ERR_MODULE_NOT_FOUND(
3
+ ^
4
+
5
+ Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/dan/Desktop/Projects/waygraph/dist/dist/cli.js' imported from /home/dan/Desktop/Projects/waygraph/
6
+  at finalizeResolution (node:internal/modules/esm/resolve:272:11)
7
+  at moduleResolve (node:internal/modules/esm/resolve:879:10)
8
+  at defaultResolve (node:internal/modules/esm/resolve:1006:11)
9
+  at #cachedDefaultResolve (node:internal/modules/esm/loader:708:20)
10
+  at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:728:38)
11
+  at nextStep (node:internal/modules/customization_hooks:189:26)
12
+ at resolveBaseSync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:10932)
13
+ at resolveDirectorySync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:12238)
14
+ at resolveTsPathsSync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:13445)
15
+ at resolve (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:15991) {
16
+ code: 'ERR_MODULE_NOT_FOUND',
17
+ url: 'file:///home/dan/Desktop/Projects/waygraph/dist/dist/cli.js'
18
+ }
19
+
20
+ Node.js v26.7.0
@@ -0,0 +1,20 @@
1
+ node:internal/modules/esm/resolve:272
2
+ throw new ERR_MODULE_NOT_FOUND(
3
+ ^
4
+
5
+ Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/dan/Desktop/Projects/waygraph/dist/dist/cli.js' imported from /home/dan/Desktop/Projects/waygraph/
6
+  at finalizeResolution (node:internal/modules/esm/resolve:272:11)
7
+  at moduleResolve (node:internal/modules/esm/resolve:879:10)
8
+  at defaultResolve (node:internal/modules/esm/resolve:1006:11)
9
+  at #cachedDefaultResolve (node:internal/modules/esm/loader:708:20)
10
+  at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:728:38)
11
+  at nextStep (node:internal/modules/customization_hooks:189:26)
12
+ at resolveBaseSync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:10932)
13
+ at resolveDirectorySync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:12238)
14
+ at resolveTsPathsSync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:13445)
15
+ at resolve (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:15991) {
16
+ code: 'ERR_MODULE_NOT_FOUND',
17
+ url: 'file:///home/dan/Desktop/Projects/waygraph/dist/dist/cli.js'
18
+ }
19
+
20
+ Node.js v26.7.0
@@ -0,0 +1,22 @@
1
+ [12:45:12.771] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [12:45:12.771] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [12:45:12.771] waygraph pilot: stub.before ctx.device(mobile)
4
+ [12:45:12.772] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [12:45:12.772] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [12:45:13.786] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [12:45:15.938] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [12:45:16.050] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [12:45:18.381] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [12:45:18.790] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [12:45:18.790] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [12:45:18.790] waygraph pilot: stub.after ctx.device(mobile)
13
+ [12:45:18.790] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [12:45:24.718] waygraph pilot: stub.before ctx.title("Pick a product · tablet")
15
+ [12:45:24.720] waygraph pilot: stub.before ctx.todos n=6 index=3
16
+ [12:45:24.720] waygraph pilot: stub.before ctx.device(tablet)
17
+ [12:45:24.720] waygraph pilot: stub.before ctx.zoom(1.35)
18
+ [12:45:24.720] waygraph pilot: stub.before ring div.inventory_item:has(button[data-test="add-to-cart-sauce-labs-backpack"], button[data-test="remove-sauce-labs-backpack"]) .inventory_item_name tone=info label="Sauce Labs Backpack"
19
+ [12:45:24.720] waygraph pilot: stub.before ring [data-test="add-to-cart-sauce-labs-backpack"] tone=success label="Add to cart"
20
+ [12:45:25.945] waygraph pilot: stub.after ctx.title("In the cart")
21
+ [12:45:25.945] waygraph pilot: stub.after ctx.todos n=6 index=4
22
+ [12:45:25.945] waygraph pilot: stub.after ring .shopping_cart_badge tone=success label="Cart badge"
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ [13:05:33.005] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:05:33.006] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:05:33.006] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:05:33.006] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:05:33.006] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:05:34.576] waygraph pilot: stub.after ctx.todos n=6 index=1
File without changes
File without changes
@@ -0,0 +1,20 @@
1
+ node:internal/modules/esm/resolve:272
2
+ throw new ERR_MODULE_NOT_FOUND(
3
+ ^
4
+
5
+ Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/dan/Desktop/Projects/waygraph/dist/dist/cli.js' imported from /home/dan/Desktop/Projects/waygraph/
6
+  at finalizeResolution (node:internal/modules/esm/resolve:272:11)
7
+  at moduleResolve (node:internal/modules/esm/resolve:879:10)
8
+  at defaultResolve (node:internal/modules/esm/resolve:1006:11)
9
+  at #cachedDefaultResolve (node:internal/modules/esm/loader:708:20)
10
+  at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:728:38)
11
+  at nextStep (node:internal/modules/customization_hooks:189:26)
12
+ at resolveBaseSync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:10932)
13
+ at resolveDirectorySync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:12238)
14
+ at resolveTsPathsSync (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:13445)
15
+ at resolve (file:///home/dan/Desktop/Projects/waygraph/node_modules/tsx/dist/register-SoqaU4rg.mjs:2:15991) {
16
+ code: 'ERR_MODULE_NOT_FOUND',
17
+ url: 'file:///home/dan/Desktop/Projects/waygraph/dist/dist/cli.js'
18
+ }
19
+
20
+ Node.js v26.7.0
File without changes
@@ -0,0 +1,22 @@
1
+ [13:04:44.176] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:04:44.177] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:04:44.177] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:04:44.177] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:04:44.177] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:04:45.401] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [13:04:48.550] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [13:04:48.656] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [13:04:52.040] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [13:04:52.285] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [13:04:52.285] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [13:04:52.285] waygraph pilot: stub.after ctx.device(mobile)
13
+ [13:04:52.285] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [13:04:58.453] waygraph pilot: stub.before ctx.title("Pick a product · tablet")
15
+ [13:04:58.453] waygraph pilot: stub.before ctx.todos n=6 index=3
16
+ [13:04:58.454] waygraph pilot: stub.before ctx.device(tablet)
17
+ [13:04:58.454] waygraph pilot: stub.before ctx.zoom(1.35)
18
+ [13:04:58.454] waygraph pilot: stub.before ring div.inventory_item:has(button[data-test="add-to-cart-sauce-labs-backpack"], button[data-test="remove-sauce-labs-backpack"]) .inventory_item_name tone=info label="Sauce Labs Backpack"
19
+ [13:04:58.454] waygraph pilot: stub.before ring [data-test="add-to-cart-sauce-labs-backpack"] tone=success label="Add to cart"
20
+ [13:04:59.651] waygraph pilot: stub.after ctx.title("In the cart")
21
+ [13:04:59.651] waygraph pilot: stub.after ctx.todos n=6 index=4
22
+ [13:04:59.651] waygraph pilot: stub.after ring .shopping_cart_badge tone=success label="Cart badge"
@@ -0,0 +1,22 @@
1
+ [12:51:48.396] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [12:51:48.397] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [12:51:48.397] waygraph pilot: stub.before ctx.device(mobile)
4
+ [12:51:48.397] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [12:51:48.397] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [12:51:49.455] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [12:51:51.829] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [12:51:51.971] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [12:51:54.622] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [12:51:55.128] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [12:51:55.128] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [12:51:55.128] waygraph pilot: stub.after ctx.device(mobile)
13
+ [12:51:55.128] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [12:52:00.976] waygraph pilot: stub.before ctx.title("Pick a product · tablet")
15
+ [12:52:00.976] waygraph pilot: stub.before ctx.todos n=6 index=3
16
+ [12:52:00.976] waygraph pilot: stub.before ctx.device(tablet)
17
+ [12:52:00.976] waygraph pilot: stub.before ctx.zoom(1.35)
18
+ [12:52:00.976] waygraph pilot: stub.before ring div.inventory_item:has(button[data-test="add-to-cart-sauce-labs-backpack"], button[data-test="remove-sauce-labs-backpack"]) .inventory_item_name tone=info label="Sauce Labs Backpack"
19
+ [12:52:00.976] waygraph pilot: stub.before ring [data-test="add-to-cart-sauce-labs-backpack"] tone=success label="Add to cart"
20
+ [12:52:01.987] waygraph pilot: stub.after ctx.title("In the cart")
21
+ [12:52:01.987] waygraph pilot: stub.after ctx.todos n=6 index=4
22
+ [12:52:01.987] waygraph pilot: stub.after ring .shopping_cart_badge tone=success label="Cart badge"
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.15.43",
3
+ "version": "0.15.45",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",
@@ -8,67 +8,40 @@ tools:
8
8
  - edit
9
9
  ---
10
10
 
11
- You are a waygraph block author. Implement Blocks and Flows that match the consumer SITE-MAP.
11
+ You are a waygraph block author. Implement Blocks and Flows that match the approved plan (a Map
12
+ folder layout under `src/map/`, or a `SITE-MAP.md`/`NAV.md` plan for a freeform project).
12
13
 
13
- ## Rules
14
+ **Load the `waygraph-convention` skill first** (`--skill-convention` / the skill tool) - it owns
15
+ the actual authoring rules (one action per Block, `_nav`/`_page`/`_sel.ts`/`_methods/` naming,
16
+ selectors never inline, when to reach for `defineAssertBlock`, Mem key typing). Don't restate
17
+ those rules here from memory; re-read the skill, since it's the one place they're kept current.
14
18
 
15
- 1. One concern per file: `nav-*.block.ts`, `*.page.block.ts`, `*.method.block.ts`, `*.effect.block.ts`, `*.flow.ts`.
16
- 2. **One distinct action per Block - hard rule, not a style preference.** A Method/Effect that
17
- fills form fields *and* submits, or that drives a multi-step sequence inside one `act()`,
18
- is wrong even if it "works" - split it into separate atomic Blocks. Concretely: a login
19
- form is `fill-username` (self-loop) + `fill-password` (self-loop) + `submit-login` (the
20
- real transition), never one Block doing all three. See `examples/saucedemo/src/blocks/saucedemo-web/methods/`
21
- (`fill-username.method.block.ts`, `fill-password.method.block.ts`,
22
- `submit-login.method.block.ts`) for the canonical before/after shape - `submit-login`
23
- used to also fill both fields; now it only clicks. A Block that only asserts something on
24
- the current page (no state change) is `defineAssertBlock({ name, checkpoint, verify,
25
- requires? })` - self-loop and `resolve` are generated for you, so there is no hand-written
26
- `act`/`resolve` to accidentally make do two things. Give it an explicit type argument
27
- (`defineAssertBlock<LoggedIn>({...})`) whenever it is not the last Block before `end` -
28
- without one it defaults to wildcard `Checkpoint<string>`, which breaks `defineFlow`'s
29
- tuple typing once the assert sits between two specifically-typed Blocks.
30
- 3. Navigation only inside `defineNavBlock` / `defineNavClickBlock`. Regular Method/Effect `act` uses ActionPage (no goto).
31
- 4. Effects that appear in `waygraph auto` menus need `instanceOptions` that scan the live DOM (or mem) for labeled rows.
32
- 5. Stubs: `stubBefore` / `stubAfter` / `stubOnError` for demo narration; YAP slides on Methods when useful; flow fixtures via `withHighlightFixtures` when AC copy is flow-specific.
33
- 6. Mem: `requires` lists keys the block needs; seed via `--data` / `WAYGRAPH_DATA` / project defaults - never assume saucedemo creds for email keys. A key an *earlier Block in the same chain* produces (not the caller) is never declared under `requires` - `requires` means externally supplied, and preflight checks the whole chain up front, before any Block runs.
34
- 7. **External Mailpit/MailHog: nav to inbox URL from env; Methods open message / read or click
35
- the link; never put mail UI under `*-web/`.** Read the message via `page.locator`/
36
- `page.frameLocator` DOM calls, never the catcher's REST API - zero new engine surface, and
37
- it's narratable in `waygraph demo`/`auto`. Live, proven reference:
38
- `templates/scaffold/src/blocks/demo-external/mailpit/` + `mail-verify.flow.ts`. Match a
39
- specific inbox row by a mem-supplied recipient, not inbox position (a shared inbox across
40
- runs can hold mail for more than one recipient). **Build the mail-reading Blocks
41
- scenario-agnostic from the start**, not one Block set per email type: put the
42
- link-matching pattern and expected body copy in mem too (alongside the recipient), so the
43
- same fixed Blocks serve signup confirmation, password reset, magic link, etc. - a Block
44
- named for one scenario (`extract-verification-link`) is a sign it should instead be named
45
- for its mechanism (`extract-email-link`) and driven by mem. For asserting the message
46
- *body* content (not just that a link exists), the top-level page's own `Trait.text`/
47
- `Trait.visible` cannot see inside the preview iframe at all - use `Trait.frameVisible`/
48
- `Trait.frameText`/`Trait.frameContains` (or a bespoke mem-aware `{ name, check(page, mem) }`
49
- Trait when the expected value itself must vary per run).
50
- 8. `verify`/`defineAssertBlock` selectors live in a `*Sel` object next to the route, never
51
- inlined as a literal string in `Trait.visible(...)`/`Trait.text(...)` - `waygraph check`
52
- warns on this (see below); fix by moving the string into that route's `*Sel`.
19
+ ## This agent's own job (on top of the skill)
53
20
 
54
- ## Verify locally
21
+ 1. Match whatever plan you were handed - a Map folder (`src/map/(group)/page/`) or a
22
+ `SITE-MAP.md`/`NAV.md` route list. Don't invent a route/folder the plan didn't call for.
23
+ 2. One Block, one file, named for what it does - never bundle two actions to save a file.
24
+ 3. `waygraph check .` clean before reporting done - see below.
25
+
26
+ ## Verify before reporting done
55
27
 
56
28
  ```bash
57
29
  npx waygraph check .
58
30
  npx waygraph list
59
31
  npm run typecheck
60
- # offline fixtures or live:
61
- npx playwright test
62
- # explore:
63
- npm run auto # or: npx waygraph auto --cli
32
+ npx playwright test # offline fixtures or live
33
+ npm run auto # or: npx waygraph auto --cli
64
34
  ```
65
35
 
66
- **Do not report this work done until `waygraph check .` shows zero orphan Blocks and zero
67
- inline-selector warnings, and zero nav-escape warnings for anything you touched.** A nonzero
68
- count in any of those three is not an informational note to mention and move past - it means
69
- go fix it first (wire the orphan into a `.flow.ts`, move the inline selector into `*Sel`, or
70
- move the escaping navigation into a `defineNavBlock`), then re-run `check`.
36
+ **Do not report this work done until `waygraph check .` shows zero orphan Blocks, zero
37
+ inline-selector warnings, zero overcomplex-selector warnings, and zero nav-escape warnings for
38
+ anything you touched.** A nonzero count in any of those is not an informational note to mention
39
+ and move past - fix it (wire the orphan into a `.flow.ts`, move the inline selector into
40
+ `_sel.ts`/`*Sel`, replace a regex/XPath match with a plain selector, or move the escaping
41
+ navigation into a `defineNavBlock`), then re-run `check`.
71
42
 
72
43
  ## Output
73
44
 
74
- Ship compiling TypeScript under `src/blocks/` + `src/flows/` + `src/states/`. Update NAV.md when edges change. Keep STRUCTURE / SITE-MAP honest.
45
+ Ship compiling TypeScript under `src/map/` (Map layout) or `src/blocks/` + `src/flows/` +
46
+ `src/states/` (freeform layout) - match whatever this project already uses; don't introduce the
47
+ other layout partway through. Update `NAV.md`/`STRUCTURE.md` when edges change.
@@ -8,7 +8,11 @@ tools:
8
8
  - edit
9
9
  ---
10
10
 
11
- You are a waygraph planner. Your job is to dive an existing app and produce a SITE-MAP + NAV.md plan — not dump ad hoc Playwright helpers.
11
+ You are a waygraph planner. Your job is to dive an existing app and produce a plan - a Map folder
12
+ layout (`src/map/(group)/page/`) for a new project, or a `SITE-MAP.md`/`NAV.md` plan when adding to
13
+ an existing freeform-layout project - not dump ad hoc Playwright helpers. Load the
14
+ `waygraph-convention` skill first for the actual folder/naming rules; this file is the planning
15
+ workflow on top of it, not a restatement of them.
12
16
 
13
17
  ## Hard conventions
14
18
 
@@ -30,13 +34,14 @@ You are a waygraph planner. Your job is to dive an existing app and produce a SI
30
34
  ## Workflow
31
35
 
32
36
  1. Read the app router (Next.js `app/`, etc.) and list real page URLs.
33
- 2. Draft `src/blocks/SITE-MAP.md` with namespaces + route folders.
37
+ 2. New project: lay out `src/map/(group)/page/` folders per route. Existing freeform project:
38
+ draft `src/blocks/SITE-MAP.md` with namespaces + route folders instead - match what's there.
34
39
  3. For each route: list nav-to edges, methods/effects, checkpoints, mem keys in `NAV.md` (plan only).
35
40
  4. Call out external surfaces (Mailpit inbox, magic-link verify) under `*-external/`. Plan
36
41
  these Blocks as reusable across every email-driven scenario the product has (signup
37
42
  confirmation, password reset, magic link, ...) via mem (recipient, link pattern, expected
38
43
  copy), not as a separate Block set per scenario - see
39
- `templates/scaffold/src/blocks/demo-external/mailpit/` for the live, proven shape.
44
+ `templates/scaffold/src/map/(external)/mailpit/` for the live, proven shape.
40
45
  5. Propose 1-3 starter flows (happy path, login/verify, one feature) — do not implement unless asked.
41
46
 
42
47
  ## Blind mode (no frontend source)
@@ -46,7 +51,7 @@ codebase-blind engagement - discover the route/interaction structure live instea
46
51
  `waygraph auto` session tools rather than skipping planning:
47
52
 
48
53
  1. `waygraph auto --cli --detach [--base-url <url>]` against a throwaway project dir (or the
49
- target project once a `src/blocks/` tree exists) - starts a driveable session, prints
54
+ target project once a `src/map/` or `src/blocks/` tree exists) - starts a driveable session, prints
50
55
  `{sessionId, socketPath}`.
51
56
  2. `waygraph auto status <sessionId>` to read the current menu (what Blocks/edges are already
52
57
  discoverable) and `waygraph auto dom <sessionId>` (default `aria` mode) to see the live
@@ -63,4 +68,6 @@ Same output contract as sighted planning: a SITE-MAP/NAV.md plan, not implemente
63
68
 
64
69
  ## Output
65
70
 
66
- Write/update markdown under `src/blocks/` (`SITE-MAP.md`, route `NAV.md` stubs). ASCII only. No localhost ports in shared docs.
71
+ New project: the `src/map/` folders themselves are the plan - no separate SITE-MAP.md needed.
72
+ Existing freeform project: write/update markdown under `src/blocks/` (`SITE-MAP.md`, route
73
+ `NAV.md` stubs). ASCII only. No localhost ports in shared docs.
@@ -0,0 +1,13 @@
1
+ # `scripts/`
2
+
3
+ - `fixture-server.mjs` - serves the offline `.html` fixture pages under `src/map/` on
4
+ `127.0.0.1:4177` (override with `WAYGRAPH_FIXTURE_PORT`/`WAYGRAPH_FIXTURE_HOST`). This is
5
+ what makes `npm test` pass with no network and no real app running.
6
+ - `with-fixture.mjs` - starts `fixture-server.mjs`, runs whatever command you give it
7
+ (`waygraph auto`, `waygraph demo --blocks ...`), then tears the server down when that command
8
+ exits. Every `npm run demo*`/`auto*` script in `package.json` goes through this wrapper -
9
+ don't run `waygraph demo`/`auto` directly against this scaffold's own fixture pages without it.
10
+
11
+ Pointing this scaffold at a real app instead of the offline fixtures: change `_nav.block.ts`'s
12
+ `url`/`homeOrigin` to the real one and drop `with-fixture.mjs` from the scripts that no longer
13
+ need it.
@@ -0,0 +1,18 @@
1
+ # `src/flows/`
2
+
3
+ A `*.flow.ts` composes Blocks from `src/map/` into a runnable path - `waygraph run`/`demo`/`test`
4
+ all point at an export here by name (`waygraph run --blocks shopFlow`).
5
+
6
+ - Prefer `new Engine().map()...end()` (the Map builder: `.gotoPage()`/`.method()`/`.assert()`/
7
+ `.branch()`) over hand-composing raw Blocks - it checks each step's Block kind at runtime and
8
+ the Checkpoint chain at compile time, so a wrong step is a build/test failure, not a
9
+ mid-run surprise.
10
+ - `withTitle`/`withHighlightFixtures`/`withSessionReset`/etc. are non-destructive wrappers -
11
+ `someFlow.withTitle("...")` doesn't mutate `someFlow`, it returns a new one. Compose them
12
+ around the finished `.end()` result, not inside the Map chain itself.
13
+ - One flow, one scenario. A flow that needs a genuinely different starting session
14
+ (re-entering the login page mid-chain) wraps that segment in `withSessionReset`, rather than
15
+ hand-clearing cookies inside a Block.
16
+
17
+ New flow → new file here, named for the scenario (`checkout.flow.ts`), not for the Blocks it
18
+ happens to use.
@@ -0,0 +1,31 @@
1
+ # `src/map/`
2
+
3
+ The Waygraph Map: one folder per page, mirroring your app's real URLs. See the root
4
+ [`STRUCTURE.md`](../../STRUCTURE.md) for the full picture; this file is the local, one-screen
5
+ version for whoever is inside this directory.
6
+
7
+ ## The fixed names, every page folder
8
+
9
+ | File | Kind | Job |
10
+ |---|---|---|
11
+ | `_nav.block.ts` | Nav | How to get here - `url` (goto) or `click` (in-app link). One per page. |
12
+ | `_page.block.ts` | Page | "You have arrived" - the hub other pages navigate to. One per page. |
13
+ | `_sel.ts` | data | Every selector this page's Blocks use, in one object. Never inline a selector when this file exists - `waygraph check` warns on it. |
14
+ | `_methods/` | folder | One file per action, one action per file (`add-item.effect.block.ts`, not one file with three `.fill()` calls). |
15
+
16
+ Never rename these, never combine them into one file, never add a `_selectors/` folder in
17
+ place of `_sel.ts` - one page, one selector file, same as every other page in the Map.
18
+
19
+ ## `(group)` folders
20
+
21
+ A parenthesized folder (`(app_base)`, `(external)`) is organizational only - like a Next.js
22
+ route group. It groups pages by origin/base URL and never appears in a Checkpoint name or a
23
+ real URL. `waygraph map`/`waygraph check` fail loudly if a page folder's real URL stops
24
+ matching its own name - that's the point of this layout: drift becomes a build failure, not a
25
+ silent surprise months later.
26
+
27
+ ## Adding a page
28
+
29
+ Copy an existing page folder, keep the four fixed names, update `_nav`/`_page`/`_sel` for the
30
+ new page, then add `_methods/` files for its actions. Don't invent a new folder shape - every
31
+ page in this Map looks the same on purpose.
@@ -0,0 +1,15 @@
1
+ # `src/states/`
2
+
3
+ Checkpoint types and Mem keys - the typed vocabulary every Block in `src/map/` is written
4
+ against. Nothing here drives the browser; this is pure data shape.
5
+
6
+ - `*.states.ts` - `type X = Checkpoint<"X">` declarations. One per real app state
7
+ (`LoginPage`, `LoggedIn`), never `Checkpoint<string>` (a wildcard - `waygraph check` warns
8
+ on it; a Block should say exactly which states it moves between).
9
+ - `*.mem-keys.ts` - `key<T>("...")` / `keyGroup<T>("...")` declarations. A Mem key stores a
10
+ *value* a Block needs (credentials, a selected row's id) - never a selector (those live in
11
+ `_sel.ts` next to the page) and never something a Block could instead read straight off the
12
+ live page.
13
+
14
+ Add a new Checkpoint or Mem key here before writing the Block that needs it - Blocks import
15
+ from this directory, this directory never imports from `src/map/`.
@@ -0,0 +1,10 @@
1
+ # `tests/`
2
+
3
+ Real `@playwright/test` specs, run through `waygraph test` (an alias for `playwright test`,
4
+ plus `waygraph test ui`/`report`/`show-trace` for Playwright's own UI Mode/HTML report/trace
5
+ viewer). These run against the offline fixture server (see `scripts/README.md`), not a live
6
+ network - that's what makes `npm test` green immediately after `waygraph init`.
7
+
8
+ A spec here typically runs a `*.flow.ts` from `src/flows/` and asserts on its result, rather
9
+ than driving the page directly - the flow already encodes the real path and its own `verify`
10
+ checks; the spec is proving the flow itself still works end to end, not re-deriving selectors.