waygraph 0.15.47 → 0.15.50

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 (364) hide show
  1. package/dist/analysis/graph.js +2 -2
  2. package/dist/auto-session/session.js +3 -3
  3. package/dist/cli/discover.d.ts +1 -1
  4. package/dist/cli/discover.js +1 -1
  5. package/dist/cli/flags.d.ts +7 -5
  6. package/dist/cli/flags.js +9 -32
  7. package/dist/cli/run-chain.js +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/{agent-dive.js → commands/agent-dive-scaffold.js} +2 -2
  10. package/dist/commands/agent-dive.js +1 -1
  11. package/dist/commands/check.js +1 -1
  12. package/dist/commands/run.js +4 -4
  13. package/dist/commands/session.js +7 -7
  14. package/dist/config.d.ts +34 -0
  15. package/dist/config.js +94 -0
  16. package/dist/{engine/core.js → core/block.js} +6 -6
  17. package/dist/core/blocks/api.d.ts +54 -0
  18. package/dist/core/blocks/api.js +75 -0
  19. package/dist/{engine → core}/blocks/effect.d.ts +1 -1
  20. package/dist/{engine → core}/blocks/effect.js +1 -1
  21. package/dist/{engine → core}/blocks/method.d.ts +1 -1
  22. package/dist/{engine → core}/blocks/method.js +1 -1
  23. package/dist/{engine → core}/blocks/nav.js +1 -1
  24. package/dist/{engine → core}/blocks/page.js +1 -1
  25. package/dist/{engine → core}/branch-regression.js +2 -3
  26. package/dist/{engine → core}/compose.js +4 -4
  27. package/dist/{engine/engine-class.d.ts → core/engine.d.ts} +2 -133
  28. package/dist/core/engine.js +50 -0
  29. package/dist/{engine → core}/flow.js +5 -5
  30. package/dist/core/map-builder.d.ts +171 -0
  31. package/dist/{engine/engine-class.js → core/map-builder.js} +82 -98
  32. package/dist/{engine → core}/run-graph.js +4 -6
  33. package/dist/core.d.ts +14 -0
  34. package/dist/core.js +15 -0
  35. package/dist/env-file.d.ts +10 -0
  36. package/dist/env-file.js +58 -0
  37. package/dist/errors.d.ts +54 -20
  38. package/dist/errors.js +67 -20
  39. package/dist/highlights/run-phase.js +15 -2
  40. package/dist/highlights/stub-ctx.js +16 -0
  41. package/dist/highlights/types.d.ts +38 -0
  42. package/dist/index.d.ts +7 -3
  43. package/dist/index.js +2 -1
  44. package/dist/mem-page.js +2 -2
  45. package/dist/mem-stub.d.ts +1 -1
  46. package/dist/pilot-overlay/fixtures.js +42 -10
  47. package/dist/pilot-overlay/shell.js +23 -10
  48. package/dist/runner/banner-log.js +1 -0
  49. package/dist/runner/device-stage.js +35 -15
  50. package/dist/runner/inpage/banner.d.ts +9 -1
  51. package/dist/runner/inpage/banner.js +27 -2
  52. package/dist/runner/inpage/caption.d.ts +3 -0
  53. package/dist/runner/inpage/caption.js +23 -0
  54. package/dist/runner/inpage/core.js +32 -9
  55. package/dist/runner/inpage/network.d.ts +15 -0
  56. package/dist/runner/inpage/network.js +217 -0
  57. package/dist/runner/inpage/panel-chrome.js +41 -1
  58. package/dist/runner/inpage/swipe-zoom.js +1 -1
  59. package/dist/runner/inpage/todos.js +6 -1
  60. package/dist/runner/main.js +9 -2
  61. package/dist/runner/network-capture.d.ts +9 -0
  62. package/dist/runner/network-capture.js +126 -0
  63. package/dist/runner/overlay-css.js +71 -7
  64. package/dist/runner/overlay-install.js +39 -2
  65. package/dist/runner/overlay-stage.js +5 -0
  66. package/dist/runner/rings.js +69 -45
  67. package/dist/runner/slides.js +14 -8
  68. package/dist/runner/step-mode.js +12 -0
  69. package/dist/runner/step-panels.js +9 -3
  70. package/dist/runner/teardown.js +16 -9
  71. package/dist/session/auto-explore-run.d.ts +5 -2
  72. package/dist/session/auto-explore-run.js +52 -36
  73. package/dist/{step-overlay.d.ts → session/step-overlay.d.ts} +1 -1
  74. package/dist/{step-overlay.js → session/step-overlay.js} +1 -1
  75. package/dist/trait.d.ts +1 -0
  76. package/dist/trait.js +15 -0
  77. package/dist/traverse/run.js +3 -22
  78. package/dist/ui/components/ring.js +4 -2
  79. package/dist/ui/overlay.css +36 -3
  80. package/examples/saucedemo/.waygraph-auto/00d147d1.log +21 -0
  81. package/examples/saucedemo/.waygraph-auto/0402cfcf.log +6 -0
  82. package/examples/saucedemo/.waygraph-auto/062b581f.log +20 -0
  83. package/examples/saucedemo/.waygraph-auto/0681582b.log +6 -0
  84. package/examples/saucedemo/.waygraph-auto/07f3e964.log +6 -0
  85. package/examples/saucedemo/.waygraph-auto/0868ae4d.log +0 -0
  86. package/examples/saucedemo/.waygraph-auto/0924ddaa.log +22 -0
  87. package/examples/saucedemo/.waygraph-auto/092d6173.log +5 -0
  88. package/examples/saucedemo/.waygraph-auto/09924510.log +0 -0
  89. package/examples/saucedemo/.waygraph-auto/0998c941.log +21 -0
  90. package/examples/saucedemo/.waygraph-auto/0bf74300.log +21 -0
  91. package/examples/saucedemo/.waygraph-auto/0c01fd29.log +4 -0
  92. package/examples/saucedemo/.waygraph-auto/0c302590.log +0 -0
  93. package/examples/saucedemo/.waygraph-auto/0dee62d6.log +5 -0
  94. package/examples/saucedemo/.waygraph-auto/0eb4c081.log +5 -0
  95. package/examples/saucedemo/.waygraph-auto/10fd431c.log +0 -0
  96. package/examples/saucedemo/.waygraph-auto/13c6fe3c.log +0 -0
  97. package/examples/saucedemo/.waygraph-auto/1581b677.log +0 -0
  98. package/examples/saucedemo/.waygraph-auto/161cc8dd.log +22 -0
  99. package/examples/saucedemo/.waygraph-auto/164761a5.log +6 -0
  100. package/examples/saucedemo/.waygraph-auto/1905ceb2.log +0 -0
  101. package/examples/saucedemo/.waygraph-auto/1b1d55c6.log +0 -0
  102. package/examples/saucedemo/.waygraph-auto/1b80fd24.log +6 -0
  103. package/examples/saucedemo/.waygraph-auto/1c30a3c2.log +0 -0
  104. package/examples/saucedemo/.waygraph-auto/1d90aa9a.log +0 -0
  105. package/examples/saucedemo/.waygraph-auto/1de7d889.log +0 -0
  106. package/examples/saucedemo/.waygraph-auto/1f233a4c.log +6 -0
  107. package/examples/saucedemo/.waygraph-auto/20e66801.log +0 -0
  108. package/examples/saucedemo/.waygraph-auto/20ffdb77.log +0 -0
  109. package/examples/saucedemo/.waygraph-auto/22048fff.log +4 -0
  110. package/examples/saucedemo/.waygraph-auto/22f1a704.log +5 -0
  111. package/examples/saucedemo/.waygraph-auto/239cced3.log +20 -0
  112. package/examples/saucedemo/.waygraph-auto/25204b46.log +4 -0
  113. package/examples/saucedemo/.waygraph-auto/25e2e90f.log +0 -0
  114. package/examples/saucedemo/.waygraph-auto/2708455e.log +22 -0
  115. package/examples/saucedemo/.waygraph-auto/272a96fd.log +20 -0
  116. package/examples/saucedemo/.waygraph-auto/28d7be5d.log +0 -0
  117. package/examples/saucedemo/.waygraph-auto/2a6a8266.log +6 -0
  118. package/examples/saucedemo/.waygraph-auto/2b3401cf.log +20 -0
  119. package/examples/saucedemo/.waygraph-auto/2ceccd6d.log +0 -0
  120. package/examples/saucedemo/.waygraph-auto/2f1b0c13.log +6 -0
  121. package/examples/saucedemo/.waygraph-auto/2f8d4073.log +6 -0
  122. package/examples/saucedemo/.waygraph-auto/30739278.log +6 -0
  123. package/examples/saucedemo/.waygraph-auto/31cb2e80.log +0 -0
  124. package/examples/saucedemo/.waygraph-auto/322d63cd.log +0 -0
  125. package/examples/saucedemo/.waygraph-auto/3239aa8a.log +6 -0
  126. package/examples/saucedemo/.waygraph-auto/326d87b7.log +6 -0
  127. package/examples/saucedemo/.waygraph-auto/3351c0b6.log +0 -0
  128. package/examples/saucedemo/.waygraph-auto/33df0770.log +0 -0
  129. package/examples/saucedemo/.waygraph-auto/340d624d.log +0 -0
  130. package/examples/saucedemo/.waygraph-auto/36367ccf.log +0 -0
  131. package/examples/saucedemo/.waygraph-auto/372536a5.log +6 -0
  132. package/examples/saucedemo/.waygraph-auto/3a412f3c.log +0 -0
  133. package/examples/saucedemo/.waygraph-auto/3a859bd7.log +0 -0
  134. package/examples/saucedemo/.waygraph-auto/3cb0add7.log +0 -0
  135. package/examples/saucedemo/.waygraph-auto/3e42f0d8.log +0 -0
  136. package/examples/saucedemo/.waygraph-auto/4144071d.log +0 -0
  137. package/examples/saucedemo/.waygraph-auto/4176a3c6.log +0 -0
  138. package/examples/saucedemo/.waygraph-auto/41d0793d.log +4 -0
  139. package/examples/saucedemo/.waygraph-auto/424b4d5d.log +0 -0
  140. package/examples/saucedemo/.waygraph-auto/43253aba.log +0 -0
  141. package/examples/saucedemo/.waygraph-auto/438c6c53.log +22 -0
  142. package/examples/saucedemo/.waygraph-auto/4477db12.log +0 -0
  143. package/examples/saucedemo/.waygraph-auto/4a1258b7.log +0 -0
  144. package/examples/saucedemo/.waygraph-auto/4adcd179.log +20 -0
  145. package/examples/saucedemo/.waygraph-auto/4c9d9b16.log +21 -0
  146. package/examples/saucedemo/.waygraph-auto/4da39c36.log +6 -0
  147. package/examples/saucedemo/.waygraph-auto/4dbefa7e.log +5 -0
  148. package/examples/saucedemo/.waygraph-auto/4efa7035.log +6 -0
  149. package/examples/saucedemo/.waygraph-auto/505affdc.log +4 -0
  150. package/examples/saucedemo/.waygraph-auto/51bcb60a.log +0 -0
  151. package/examples/saucedemo/.waygraph-auto/5291bc78.log +22 -0
  152. package/examples/saucedemo/.waygraph-auto/54274c39.log +5 -0
  153. package/examples/saucedemo/.waygraph-auto/5440ce7e.log +0 -0
  154. package/examples/saucedemo/.waygraph-auto/5738175f.log +22 -0
  155. package/examples/saucedemo/.waygraph-auto/57ce5643.log +22 -0
  156. package/examples/saucedemo/.waygraph-auto/5984426b.log +6 -0
  157. package/examples/saucedemo/.waygraph-auto/5a682e7c.log +22 -0
  158. package/examples/saucedemo/.waygraph-auto/5b79320c.log +21 -0
  159. package/examples/saucedemo/.waygraph-auto/5c55aaac.log +21 -0
  160. package/examples/saucedemo/.waygraph-auto/5d285cd3.log +0 -0
  161. package/examples/saucedemo/.waygraph-auto/5ed00b16.log +4 -0
  162. package/examples/saucedemo/.waygraph-auto/60b9c066.log +6 -0
  163. package/examples/saucedemo/.waygraph-auto/610dd127.log +0 -0
  164. package/examples/saucedemo/.waygraph-auto/61105500.log +5 -0
  165. package/examples/saucedemo/.waygraph-auto/6134afe8.log +20 -0
  166. package/examples/saucedemo/.waygraph-auto/62a0bdc9.log +22 -0
  167. package/examples/saucedemo/.waygraph-auto/6376fc15.log +0 -0
  168. package/examples/saucedemo/.waygraph-auto/6599cbca.log +22 -0
  169. package/examples/saucedemo/.waygraph-auto/67aaca30.log +0 -0
  170. package/examples/saucedemo/.waygraph-auto/68b10298.log +0 -0
  171. package/examples/saucedemo/.waygraph-auto/68be5e12.log +0 -0
  172. package/examples/saucedemo/.waygraph-auto/68df05a6.log +22 -0
  173. package/examples/saucedemo/.waygraph-auto/693f67c4.log +20 -0
  174. package/examples/saucedemo/.waygraph-auto/69ae030a.log +6 -0
  175. package/examples/saucedemo/.waygraph-auto/69e73f35.log +6 -0
  176. package/examples/saucedemo/.waygraph-auto/6b2333b0.log +5 -0
  177. package/examples/saucedemo/.waygraph-auto/6c4c3817.log +0 -0
  178. package/examples/saucedemo/.waygraph-auto/6c954911.log +0 -0
  179. package/examples/saucedemo/.waygraph-auto/6d65a439.log +5 -0
  180. package/examples/saucedemo/.waygraph-auto/6d700055.log +0 -0
  181. package/examples/saucedemo/.waygraph-auto/6ead848f.log +0 -0
  182. package/examples/saucedemo/.waygraph-auto/72675b2d.log +6 -0
  183. package/examples/saucedemo/.waygraph-auto/733dd260.log +5 -0
  184. package/examples/saucedemo/.waygraph-auto/75016486.log +0 -0
  185. package/examples/saucedemo/.waygraph-auto/752b01c6.log +22 -0
  186. package/examples/saucedemo/.waygraph-auto/75675227.log +6 -0
  187. package/examples/saucedemo/.waygraph-auto/75e2e658.log +0 -0
  188. package/examples/saucedemo/.waygraph-auto/76ac1a86.log +0 -0
  189. package/examples/saucedemo/.waygraph-auto/77605295.log +0 -0
  190. package/examples/saucedemo/.waygraph-auto/792671f4.log +22 -0
  191. package/examples/saucedemo/.waygraph-auto/79915adb.log +20 -0
  192. package/examples/saucedemo/.waygraph-auto/7a398774.log +6 -0
  193. package/examples/saucedemo/.waygraph-auto/7a72f66e.log +6 -0
  194. package/examples/saucedemo/.waygraph-auto/7a984334.log +4 -0
  195. package/examples/saucedemo/.waygraph-auto/7c6ee793.log +20 -0
  196. package/examples/saucedemo/.waygraph-auto/7c726dc4.log +22 -0
  197. package/examples/saucedemo/.waygraph-auto/7c72e8a5.log +4 -0
  198. package/examples/saucedemo/.waygraph-auto/7dbee625.log +22 -0
  199. package/examples/saucedemo/.waygraph-auto/7df66956.log +0 -0
  200. package/examples/saucedemo/.waygraph-auto/7e053160.log +0 -0
  201. package/examples/saucedemo/.waygraph-auto/7fcb512f.log +22 -0
  202. package/examples/saucedemo/.waygraph-auto/802a0b5b.log +0 -0
  203. package/examples/saucedemo/.waygraph-auto/80322e0b.log +0 -0
  204. package/examples/saucedemo/.waygraph-auto/80a4978e.log +6 -0
  205. package/examples/saucedemo/.waygraph-auto/81cfe480.log +22 -0
  206. package/examples/saucedemo/.waygraph-auto/832f5add.log +0 -0
  207. package/examples/saucedemo/.waygraph-auto/8337b6ad.log +0 -0
  208. package/examples/saucedemo/.waygraph-auto/8493928e.log +0 -0
  209. package/examples/saucedemo/.waygraph-auto/84dc6480.log +6 -0
  210. package/examples/saucedemo/.waygraph-auto/853bde43.log +0 -0
  211. package/examples/saucedemo/.waygraph-auto/86350ea6.log +22 -0
  212. package/examples/saucedemo/.waygraph-auto/86bb598a.log +0 -0
  213. package/examples/saucedemo/.waygraph-auto/86d09876.log +22 -0
  214. package/examples/saucedemo/.waygraph-auto/878ad01b.log +4 -0
  215. package/examples/saucedemo/.waygraph-auto/87c88ba5.log +0 -0
  216. package/examples/saucedemo/.waygraph-auto/87cb80ff.log +0 -0
  217. package/examples/saucedemo/.waygraph-auto/880b2e78.log +6 -0
  218. package/examples/saucedemo/.waygraph-auto/88527936.log +5 -0
  219. package/examples/saucedemo/.waygraph-auto/88eda676.log +0 -0
  220. package/examples/saucedemo/.waygraph-auto/893023ea.log +5 -0
  221. package/examples/saucedemo/.waygraph-auto/89416718.log +0 -0
  222. package/examples/saucedemo/.waygraph-auto/8996a857.log +6 -0
  223. package/examples/saucedemo/.waygraph-auto/8a08b68d.log +6 -0
  224. package/examples/saucedemo/.waygraph-auto/8a64ba0f.log +6 -0
  225. package/examples/saucedemo/.waygraph-auto/8b1cc2aa.log +6 -0
  226. package/examples/saucedemo/.waygraph-auto/8b73d13e.log +6 -0
  227. package/examples/saucedemo/.waygraph-auto/8d9e5cd2.log +21 -0
  228. package/examples/saucedemo/.waygraph-auto/8ec7d260.log +0 -0
  229. package/examples/saucedemo/.waygraph-auto/8ed43279.log +0 -0
  230. package/examples/saucedemo/.waygraph-auto/93acae32.log +5 -0
  231. package/examples/saucedemo/.waygraph-auto/96321a08.log +0 -0
  232. package/examples/saucedemo/.waygraph-auto/9742b6c2.log +6 -0
  233. package/examples/saucedemo/.waygraph-auto/99cc93eb.log +6 -0
  234. package/examples/saucedemo/.waygraph-auto/9cbfbedc.log +0 -0
  235. package/examples/saucedemo/.waygraph-auto/9dc147d2.log +22 -0
  236. package/examples/saucedemo/.waygraph-auto/a215a395.log +22 -0
  237. package/examples/saucedemo/.waygraph-auto/a23b7086.log +4 -0
  238. package/examples/saucedemo/.waygraph-auto/a35bd5ec.log +0 -0
  239. package/examples/saucedemo/.waygraph-auto/a68995e9.log +22 -0
  240. package/examples/saucedemo/.waygraph-auto/a6e4f936.log +22 -0
  241. package/examples/saucedemo/.waygraph-auto/a7da862b.log +0 -0
  242. package/examples/saucedemo/.waygraph-auto/a82e2a48.log +0 -0
  243. package/examples/saucedemo/.waygraph-auto/a952eb91.log +0 -0
  244. package/examples/saucedemo/.waygraph-auto/a9559653.log +5 -0
  245. package/examples/saucedemo/.waygraph-auto/aa478de2.log +0 -0
  246. package/examples/saucedemo/.waygraph-auto/ac350fc7.log +20 -0
  247. package/examples/saucedemo/.waygraph-auto/acc1b63a.log +0 -0
  248. package/examples/saucedemo/.waygraph-auto/ad12d191.log +0 -0
  249. package/examples/saucedemo/.waygraph-auto/b04638f4.log +6 -0
  250. package/examples/saucedemo/.waygraph-auto/b48863e5.log +22 -0
  251. package/examples/saucedemo/.waygraph-auto/b56968e1.log +6 -0
  252. package/examples/saucedemo/.waygraph-auto/b64e0620.log +20 -0
  253. package/examples/saucedemo/.waygraph-auto/b86a6218.log +6 -0
  254. package/examples/saucedemo/.waygraph-auto/b8e9e956.log +22 -0
  255. package/examples/saucedemo/.waygraph-auto/b9b310ff.log +21 -0
  256. package/examples/saucedemo/.waygraph-auto/bc111745.log +22 -0
  257. package/examples/saucedemo/.waygraph-auto/bf7a77a2.log +0 -0
  258. package/examples/saucedemo/.waygraph-auto/c0d6f353.log +21 -0
  259. package/examples/saucedemo/.waygraph-auto/c0febcf2.log +20 -0
  260. package/examples/saucedemo/.waygraph-auto/c4c52998.log +6 -0
  261. package/examples/saucedemo/.waygraph-auto/c809ceb4.log +22 -0
  262. package/examples/saucedemo/.waygraph-auto/ca6de7e7.log +0 -0
  263. package/examples/saucedemo/.waygraph-auto/ca8561bc.log +0 -0
  264. package/examples/saucedemo/.waygraph-auto/cb86d45b.log +0 -0
  265. package/examples/saucedemo/.waygraph-auto/cb9a1978.log +6 -0
  266. package/examples/saucedemo/.waygraph-auto/cbbc689c.log +6 -0
  267. package/examples/saucedemo/.waygraph-auto/cd88364b.log +0 -0
  268. package/examples/saucedemo/.waygraph-auto/cd919e1d.log +0 -0
  269. package/examples/saucedemo/.waygraph-auto/cfff9eef.log +20 -0
  270. package/examples/saucedemo/.waygraph-auto/d0f59b21.log +4 -0
  271. package/examples/saucedemo/.waygraph-auto/d1195079.log +20 -0
  272. package/examples/saucedemo/.waygraph-auto/d2ef067a.log +5 -0
  273. package/examples/saucedemo/.waygraph-auto/d425471f.log +6 -0
  274. package/examples/saucedemo/.waygraph-auto/d5293921.log +0 -0
  275. package/examples/saucedemo/.waygraph-auto/d62a22c2.log +21 -0
  276. package/examples/saucedemo/.waygraph-auto/d6d1761f.log +22 -0
  277. package/examples/saucedemo/.waygraph-auto/d6d5f411.log +22 -0
  278. package/examples/saucedemo/.waygraph-auto/d6df2771.log +6 -0
  279. package/examples/saucedemo/.waygraph-auto/d7075012.log +21 -0
  280. package/examples/saucedemo/.waygraph-auto/d9ddc297.log +0 -0
  281. package/examples/saucedemo/.waygraph-auto/db4ac845.log +0 -0
  282. package/examples/saucedemo/.waygraph-auto/db6d7774.log +0 -0
  283. package/examples/saucedemo/.waygraph-auto/db839827.log +5 -0
  284. package/examples/saucedemo/.waygraph-auto/dde5e859.log +22 -0
  285. package/examples/saucedemo/.waygraph-auto/de8cac58.log +0 -0
  286. package/examples/saucedemo/.waygraph-auto/dedfcb18.log +0 -0
  287. package/examples/saucedemo/.waygraph-auto/def4d9b1.log +0 -0
  288. package/examples/saucedemo/.waygraph-auto/e1549e40.log +0 -0
  289. package/examples/saucedemo/.waygraph-auto/e1b0676d.log +21 -0
  290. package/examples/saucedemo/.waygraph-auto/e5111463.log +0 -0
  291. package/examples/saucedemo/.waygraph-auto/e5fc1d7c.log +5 -0
  292. package/examples/saucedemo/.waygraph-auto/e6fd2202.log +0 -0
  293. package/examples/saucedemo/.waygraph-auto/edaa806d.log +0 -0
  294. package/examples/saucedemo/.waygraph-auto/edaf33de.log +0 -0
  295. package/examples/saucedemo/.waygraph-auto/edd40cbb.log +20 -0
  296. package/examples/saucedemo/.waygraph-auto/eddfbffc.log +6 -0
  297. package/examples/saucedemo/.waygraph-auto/ee9fa1ad.log +5 -0
  298. package/examples/saucedemo/.waygraph-auto/ef319474.log +22 -0
  299. package/examples/saucedemo/.waygraph-auto/f28eee8d.log +0 -0
  300. package/examples/saucedemo/.waygraph-auto/f33bde90.log +0 -0
  301. package/examples/saucedemo/.waygraph-auto/f6ba7cb4.log +6 -0
  302. package/examples/saucedemo/.waygraph-auto/f7ac4d62.log +20 -0
  303. package/examples/saucedemo/.waygraph-auto/f929bb79.log +0 -0
  304. package/examples/saucedemo/.waygraph-auto/f92d4c6c.log +22 -0
  305. package/examples/saucedemo/.waygraph-auto/f92faf40.log +5 -0
  306. package/examples/saucedemo/.waygraph-auto/fa784369.log +21 -0
  307. package/examples/saucedemo/.waygraph-auto/fb55f723.log +20 -0
  308. package/examples/saucedemo/.waygraph-auto/fba3b738.log +0 -0
  309. package/examples/saucedemo/.waygraph-auto/fdf66b74.log +0 -0
  310. package/examples/saucedemo/.waygraph-auto/ffdf2854.log +6 -0
  311. package/examples/saucedemo/README.md +13 -2
  312. package/examples/saucedemo/package.json +4 -0
  313. package/examples/saucedemo/src/flows/api-demo.flow.ts +37 -0
  314. package/examples/saucedemo/src/flows/checkout.flow.ts +34 -11
  315. package/package.json +5 -3
  316. package/templates/scaffold/src/flows/shop.flow.ts +42 -27
  317. package/dist/auto-explore-run.d.ts +0 -37
  318. package/dist/auto-explore-run.js +0 -670
  319. package/dist/auto-explore.d.ts +0 -57
  320. package/dist/auto-explore.js +0 -376
  321. package/dist/auto-session-ipc.d.ts +0 -150
  322. package/dist/auto-session-ipc.js +0 -497
  323. package/dist/block-inject.d.ts +0 -15
  324. package/dist/block-inject.js +0 -91
  325. package/dist/browser.d.ts +0 -15
  326. package/dist/browser.js +0 -29
  327. package/dist/coverage-gap.d.ts +0 -11
  328. package/dist/coverage-gap.js +0 -119
  329. package/dist/engine.d.ts +0 -12
  330. package/dist/engine.js +0 -13
  331. package/dist/graph.d.ts +0 -92
  332. package/dist/graph.js +0 -467
  333. package/dist/highlight-shorthand.d.ts +0 -24
  334. package/dist/highlight-shorthand.js +0 -30
  335. package/dist/map-check.d.ts +0 -18
  336. package/dist/map-check.js +0 -140
  337. package/dist/overlay-beacon.d.ts +0 -44
  338. package/dist/overlay-beacon.js +0 -85
  339. package/dist/pilot.d.ts +0 -54
  340. package/dist/pilot.js +0 -80
  341. package/dist/practices-check.d.ts +0 -14
  342. package/dist/practices-check.js +0 -195
  343. package/dist/traverse-coverage.d.ts +0 -59
  344. package/dist/traverse-coverage.js +0 -127
  345. package/dist/traverse-lease.d.ts +0 -18
  346. package/dist/traverse-lease.js +0 -62
  347. package/dist/traverse-run.d.ts +0 -47
  348. package/dist/traverse-run.js +0 -439
  349. package/dist/ui/compose.d.ts +0 -4
  350. package/dist/ui/compose.js +0 -7
  351. /package/dist/{verbose-log.d.ts → auto-session/verbose-log.d.ts} +0 -0
  352. /package/dist/{verbose-log.js → auto-session/verbose-log.js} +0 -0
  353. /package/dist/{agent-dive.d.ts → commands/agent-dive-scaffold.d.ts} +0 -0
  354. /package/dist/{engine/core.d.ts → core/block.d.ts} +0 -0
  355. /package/dist/{engine → core}/blocks/nav.d.ts +0 -0
  356. /package/dist/{engine → core}/blocks/page.d.ts +0 -0
  357. /package/dist/{engine → core}/branch-regression.d.ts +0 -0
  358. /package/dist/{engine → core}/compose.d.ts +0 -0
  359. /package/dist/{engine → core}/config.d.ts +0 -0
  360. /package/dist/{engine → core}/config.js +0 -0
  361. /package/dist/{engine → core}/flow.d.ts +0 -0
  362. /package/dist/{engine → core}/locate.d.ts +0 -0
  363. /package/dist/{engine → core}/locate.js +0 -0
  364. /package/dist/{engine → core}/run-graph.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  // Split out of the former 2,900-line engine.ts (see src/ARCHITECTURE.md). Behavior unchanged.
2
2
  import { checkpoint } from "../../types.js";
3
- import { defineBlock } from "../core.js";
3
+ import { defineBlock } from "../block.js";
4
4
  export function defineMethodBlock(base) {
5
5
  const built = defineBlock(base);
6
6
  Object.defineProperty(built, "__waygraphSalt", {
@@ -1,6 +1,6 @@
1
1
  // Split out of the former 2,900-line engine.ts (see src/ARCHITECTURE.md). Behavior unchanged.
2
2
  import { checkpoint } from "../../types.js";
3
- import { defineBlock } from "../core.js";
3
+ import { defineBlock } from "../block.js";
4
4
  /**
5
5
  * Builds a {@link NavBlock}. The generated `act()` is always exactly
6
6
  * `page.goto(url)` or `page.locator(click).click()` - never anything else,
@@ -1,6 +1,6 @@
1
1
  // Split out of the former 2,900-line engine.ts (see src/ARCHITECTURE.md). Behavior unchanged.
2
2
  import { checkpoint } from "../../types.js";
3
- import { defineBlock } from "../core.js";
3
+ import { defineBlock } from "../block.js";
4
4
  function resolvePageMethods(methods) {
5
5
  if (!methods)
6
6
  return [];
@@ -1,4 +1,4 @@
1
- import { WaygraphError } from "../errors.js";
1
+ import { WaygraphError, MSG_BRANCH_REGRESSION_NO_BROWSER } from "../errors.js";
2
2
  import { MemPage } from "../mem-page.js";
3
3
  import { seedMemStub } from "../mem-stub.js";
4
4
  function branchInfo(flow) {
@@ -48,8 +48,7 @@ export async function runBranchRegression(flow, context, mem = new MemPage(), op
48
48
  const results = [];
49
49
  const browser = cloneSession ? context.browser() : null;
50
50
  if (cloneSession && !browser) {
51
- throw new WaygraphError("WG_BRANCH_REGRESSION_NO_BROWSER", "Waygraph runBranchRegression: cloneSession needs context.browser() (a persistent context " +
52
- "has none) - pass { cloneSession: false } to run the single live path in this context instead.");
51
+ throw new WaygraphError("WG_BRANCH_REGRESSION_NO_BROWSER", MSG_BRANCH_REGRESSION_NO_BROWSER);
53
52
  }
54
53
  /** `entryPage`, when given, is already positioned (cloned session + navigated) - reused as-is,
55
54
  * never replaced by a fresh `ctx.newPage()` (that would throw away the whole point of cloning). */
@@ -1,9 +1,9 @@
1
1
  import { connect } from "../types.js";
2
- import { WaygraphError } from "../errors.js";
3
- import { findBlockIndex, modVerify, withVerify } from "./core.js";
2
+ import { WaygraphError, MSG_COMPOSE_EMPTY, MSG_FASTFORWARD_EMPTY } from "../errors.js";
3
+ import { findBlockIndex, modVerify, withVerify } from "./block.js";
4
4
  export function composeBlock(name, steps) {
5
5
  if (steps.length === 0) {
6
- throw new WaygraphError("WG_COMPOSE_EMPTY", `composeBlock: "${name}" needs at least one step`);
6
+ throw new WaygraphError("WG_COMPOSE_EMPTY", MSG_COMPOSE_EMPTY(name));
7
7
  }
8
8
  const chain = steps.reduce((a, b) => connect(a, b));
9
9
  return {
@@ -42,7 +42,7 @@ function wrapFfError(ffName, err) {
42
42
  }
43
43
  export function fastForwardComposeBlock(name, steps) {
44
44
  if (steps.length === 0) {
45
- throw new WaygraphError("WG_FASTFORWARD_EMPTY", `fastForwardComposeBlock: "${name}" needs at least one step`);
45
+ throw new WaygraphError("WG_FASTFORWARD_EMPTY", MSG_FASTFORWARD_EMPTY(name));
46
46
  }
47
47
  const base = composeBlock(name, steps);
48
48
  const origAct = base.instruction.act.bind(base.instruction);
@@ -2,10 +2,8 @@ import type { Block, Checkpoint } from "../types.js";
2
2
  import type { EngineConfig } from "./config.js";
3
3
  import type { EndMarker, StartMarker } from "./run-graph.js";
4
4
  import type { Flow } from "./flow.js";
5
- import type { NavBlock } from "./blocks/nav.js";
6
- import type { PageBlock } from "./blocks/page.js";
7
- import type { AssertBlock, MethodBlock } from "./blocks/method.js";
8
- import type { EffectBlock } from "./blocks/effect.js";
5
+ import { MapBuilder } from "./map-builder.js";
6
+ import type { MapBuilderOptions } from "./map-builder.js";
9
7
  type S = Checkpoint<"__start__">;
10
8
  /**
11
9
  * Holds engine-level configuration shared across every flow defined from it -
@@ -187,135 +185,6 @@ export declare class Engine {
187
185
  */
188
186
  map(options?: MapBuilderOptions): MapBuilder<S>;
189
187
  }
190
- export interface MapBuilderOptions {
191
- /**
192
- * This project's own origin (e.g. `"https://app.example.com"`) - enables
193
- * `.gotoPage()`/`.gotoExternal()`'s origin check against a Block's static
194
- * `url`. Omit to skip that check entirely (still fully kind-checked either
195
- * way; only the internal/external origin distinction is opt-in).
196
- */
197
- homeOrigin?: string;
198
- }
199
- /**
200
- * Fluent builder over {@link Engine.defineFlow} - see `map()`'s own doc
201
- * comment for why this exists. Each step method is scoped to exactly the
202
- * Block kind its name promises, checked at RUNTIME against the
203
- * `__waygraphKind`/`__waygraphSalt` markers `defineNavBlock`/`definePageBlock`/
204
- * `defineAssertBlock`/`defineMethodBlock`/`defineEffectBlock` already set
205
- * (the same markers `graph.ts` and `map-check.ts` trust) - not just a type
206
- * hint, since a hand-rolled object can satisfy the TypeScript `Block<In,Out>`
207
- * shape without ever going through a real factory. Each call also
208
- * typechecks the accumulated Checkpoint chain exactly like `defineFlow`'s
209
- * own tuple overloads do (a step's `In` must equal the previous step's
210
- * `Out`) - this is what "no teleporting" means: there is no method on this
211
- * builder that can skip from one Checkpoint to an unrelated one without a
212
- * real, kind-correct Block in between.
213
- */
214
- export declare class MapBuilder<Out extends Checkpoint<string>> {
215
- private readonly engine;
216
- private readonly steps;
217
- private readonly homeOrigin;
218
- private readonly ff;
219
- private constructor();
220
- /** @internal - use `engine.map()` or the standalone `map()` export. */
221
- static begin(engine: Engine, homeOrigin: string | undefined): MapBuilder<S>;
222
- /** Readable chain-opener - mirrors `defineFlow`'s leading `start` sentinel. Returns `this` unchanged; entirely optional. */
223
- start(): MapBuilder<Out>;
224
- /**
225
- * Open a fast-forward window - steps until {@link ffEnd} collapse into one
226
- * opaque `fastForwardComposeBlock` (blitz theater). Kind/salt checks still
227
- * run on each inner step as it is added.
228
- */
229
- ffStart(name?: string): MapBuilder<Out>;
230
- /**
231
- * Close the current fast-forward window and append one FFCompose step.
232
- * Throws if empty or if {@link ffStart} was never opened.
233
- */
234
- ffEnd(): MapBuilder<Out>;
235
- private appendStep;
236
- /**
237
- * Appends an internal navigation/page-arrival step - requires a Block from
238
- * `defineNavBlock`/`defineMemNavBlock`/`definePageBlock`. Throws if given
239
- * anything else, including a `homeOrigin`-mismatched static `url`.
240
- * Compile-time: {@link NavBlock} or {@link PageBlock} only (not Assert/Method).
241
- */
242
- gotoPage<NextOut extends Checkpoint<string>>(block: (NavBlock<NextOut> | PageBlock<NextOut>) & {
243
- name: string;
244
- }): MapBuilder<NextOut>;
245
- /**
246
- * Appends a genuinely cross-origin navigation step (e.g. `(external)/`
247
- * Blocks in the Waygraph Map convention: mailpit, maildrop.cc) - same
248
- * kind requirement as {@link gotoPage}, plus the inverse `homeOrigin` check.
249
- * Compile-time: {@link NavBlock} or {@link PageBlock} only.
250
- */
251
- gotoExternal<NextOut extends Checkpoint<string>>(block: (NavBlock<NextOut> | PageBlock<NextOut>) & {
252
- name: string;
253
- }): MapBuilder<NextOut>;
254
- /**
255
- * Appends a self-loop verification step - requires a Block from
256
- * `defineAssertBlock`. Compile-time: {@link AssertBlock} only (not `.method()`).
257
- */
258
- assert(block: AssertBlock<Out> & {
259
- name: string;
260
- }): MapBuilder<Out>;
261
- /**
262
- * Appends a non-navigating page action (submit, upload, add/remove an
263
- * instance) - requires a Block from `defineMethodBlock`/`defineActionBlock`/
264
- * `defineEffectBlock`/`defineMemEffectBlock`.
265
- * Compile-time: {@link MethodBlock} or {@link EffectBlock} only - Assert
266
- * Blocks must use `.assert()`. Runtime also rejects `__waygraphKind =
267
- * "assert"` (those still carry method salt from the factory internals).
268
- */
269
- method<NextOut extends Checkpoint<string>>(block: (MethodBlock<Out, NextOut> | EffectBlock<Out, NextOut>) & {
270
- name: string;
271
- }): MapBuilder<NextOut>;
272
- /**
273
- * Branch: run everything added so far, then continue into whichever `routes[tag]` matches the
274
- * resolved Checkpoint's tag - same page, same context, same mem. `routes` must cover every tag
275
- * of `Out` (a missing one is a compile error, matching {@link branch}'s own exhaustiveness);
276
- * `null` means that tag is terminal (the branched Flow just returns that Checkpoint).
277
- *
278
- * Each non-null route is a function, not a ready-made `Flow` - a fresh Flow always starts at the
279
- * special `S` (start) Checkpoint, but a branch's blocks start from the TAG it routes on (e.g.
280
- * `LoggedIn`), so the function is handed a brand-new `MapBuilder` already seeded at that exact
281
- * Checkpoint to chain `.method()/.gotoPage()/.assert()/.end()` (or another `.branch()`) off of.
282
- *
283
- * Real gap this fixes: the plain `branch()` helper's `.next` routing is only ever consulted by
284
- * `runGraph`'s own graph walk - `defineFlow`/`.end()` compose steps pairwise via `connect()`,
285
- * which never looks at `.next` at all, so a Map-built Flow had no way to branch. This method
286
- * branches at the Flow level instead: it finalizes the prefix, runs it, and picks the next Flow
287
- * itself once the real tag is known - no engine-level routing involved.
288
- *
289
- * Only the `run(context, mem[, options])` signature is supported - the page must survive across
290
- * the branch, and the bare `run(mem, config)` convenience form always closes its own browser
291
- * before a tag is even known, so it throws instead of silently reopening a fresh (state-losing) page.
292
- *
293
- * The route's first Block still sees `input.__state === "__start__"` in `act()`, not the tag that
294
- * routed there - `runGraph` seeds every Flow's entry Block that way unconditionally, the same as
295
- * any standalone `defineFlow([start, block, end])` already does. Read `page`/`mem`, not `input`,
296
- * in `act()` - every real Block in this codebase already follows that convention.
297
- *
298
- * @example
299
- * map({ homeOrigin }).gotoPage(NavCartBlock).branch({
300
- * ItemInCart: (m) => m.method(RemoveFromCartBlock).end(),
301
- * LoggedIn: (m) => m.method(AddToCartBlock).end(),
302
- * });
303
- */
304
- branch<Routes extends {
305
- [K in Out["__state"]]: ((m: MapBuilder<Extract<Out, Checkpoint<K>>>) => Flow<any>) | null;
306
- }>(routes: Routes): Flow<{
307
- [K in keyof Routes & string]: Routes[K] extends (m: any) => Flow<infer R> ? R : Extract<Out, Checkpoint<K>>;
308
- }[keyof Routes & string]>;
309
- /**
310
- * Finalizes this chain into a real, runnable {@link Flow} - same object
311
- * `defineFlow` returns, so `withBlockVerify`/`modBlockVerify` and every
312
- * `withTitle`/`withHighlightFixtures`/etc. decorator still apply exactly
313
- * as they do today; this builder only changes how the chain is assembled,
314
- * never what it produces. Throws if no step was ever added - an empty map
315
- * isn't a flow.
316
- */
317
- end(): Flow<Out>;
318
- }
319
188
  /**
320
189
  * Standalone convenience for `new Engine(config).map(options)` - use this
321
190
  * when a call site doesn't otherwise need its own `Engine` instance (no
@@ -0,0 +1,50 @@
1
+ import { buildFlow } from "./flow.js";
2
+ import { MapBuilder } from "./map-builder.js";
3
+ /**
4
+ * Holds engine-level configuration shared across every flow defined from it -
5
+ * for now, just how to launch a browser when a Flow owns its own
6
+ * (`headless`/`browserName`/`slowMo`); traits/interstitials/watchers land here
7
+ * in a later change.
8
+ * @example const engine = new Engine({ headless: false, slowMo: 250 });
9
+ */
10
+ export class Engine {
11
+ config;
12
+ constructor(config = {}) {
13
+ this.config = config;
14
+ }
15
+ defineFlow(blocks) {
16
+ return buildFlow(blocks.slice(1, -1), this.config);
17
+ }
18
+ /**
19
+ * Fluent, kind-checked alternative to `defineFlow([start, ...blocks, end])` -
20
+ * see {@link MapBuilder}. Real, direct request this responds to: pia/zsign's
21
+ * own agents kept hand-editing/hand-composing Blocks into ad hoc shapes
22
+ * ("locks" convention tried, still got broken) - `map()` forces every step
23
+ * through this Engine's own `define*Block` factories (checked by the same
24
+ * `__waygraphKind`/`__waygraphSalt` runtime markers `graph.ts`/`map-check.ts`
25
+ * already trust), so a hand-rolled plain-object Block can never silently
26
+ * pass as a real navigation/assertion/method step. `homeOrigin`, if given,
27
+ * also gates `.gotoPage()`/`.gotoExternal()` against each Nav/Page Block's
28
+ * own static `url` (skipped, honestly, for click-based/dynamic nav - not
29
+ * statically checkable, same limitation `map-check.ts` already documents).
30
+ * @example
31
+ * const flow = engine.map({ homeOrigin: "https://app.example.com" })
32
+ * .start()
33
+ * .gotoPage(NavHomeBlock)
34
+ * .assert(AssertHelloBlock)
35
+ * .gotoExternal(NavMailpitBlock)
36
+ * .end();
37
+ */
38
+ map(options) {
39
+ return MapBuilder.begin(this.defineFlow.bind(this), options?.homeOrigin);
40
+ }
41
+ }
42
+ /**
43
+ * Standalone convenience for `new Engine(config).map(options)` - use this
44
+ * when a call site doesn't otherwise need its own `Engine` instance (no
45
+ * shared `headless`/`slowMo`/`layouts` across several flows).
46
+ * @example const flow = map({ homeOrigin: "https://app.example.com" }).gotoPage(NavHomeBlock).end();
47
+ */
48
+ export function map(options) {
49
+ return new Engine(options).map(options);
50
+ }
@@ -1,10 +1,10 @@
1
1
  // Split out of the former 2,900-line engine.ts (see src/ARCHITECTURE.md). Behavior unchanged.
2
2
  import { connect } from "../types.js";
3
- import { WaygraphError } from "../errors.js";
3
+ import { WaygraphError, MSG_CHAINFLOW_BLOCK_NOT_FOUND_BY_INDEX, MSG_CHAINFLOW_BLOCK_NOT_FOUND_BY_NAME, MSG_CHAINFLOW_EMPTY, } from "../errors.js";
4
4
  import { preflight, runGraph } from "./run-graph.js";
5
5
  import { resolveLauncher } from "./config.js";
6
6
  import { MemPage } from "../mem-page.js";
7
- import { findBlockIndex, modVerify, withVerify } from "./core.js";
7
+ import { findBlockIndex, modVerify, withVerify } from "./block.js";
8
8
  import { normalizeHighlightSize, normalizeHighlightTone, normalizeHighlightWeight } from "../highlights.js";
9
9
  export function buildFlow(middle, engineConfig) {
10
10
  // resetSession/title start false/unset here - defineFlow itself carries
@@ -268,7 +268,7 @@ function locateInChain(flows, block) {
268
268
  return { flowIndex: fi, localIndex: remaining };
269
269
  remaining -= len;
270
270
  }
271
- throw new WaygraphError("WG_FLOW_BLOCK_NOT_FOUND", `chainFlow: no Block at index ${block} across ${flows.length} chained flows`);
271
+ throw new WaygraphError("WG_FLOW_BLOCK_NOT_FOUND", MSG_CHAINFLOW_BLOCK_NOT_FOUND_BY_INDEX(block, flows.length));
272
272
  }
273
273
  const blockName = typeof block === "string" ? block : block.name;
274
274
  for (let fi = 0; fi < flows.length; fi++) {
@@ -276,7 +276,7 @@ function locateInChain(flows, block) {
276
276
  if (localIndex !== -1)
277
277
  return { flowIndex: fi, localIndex };
278
278
  }
279
- throw new WaygraphError("WG_FLOW_BLOCK_NOT_FOUND", `chainFlow: no Block named "${blockName}" in any chained flow`);
279
+ throw new WaygraphError("WG_FLOW_BLOCK_NOT_FOUND", MSG_CHAINFLOW_BLOCK_NOT_FOUND_BY_NAME(blockName));
280
280
  }
281
281
  async function clearSessionState(context, page) {
282
282
  await context.clearCookies().catch(() => { });
@@ -312,7 +312,7 @@ async function clearSessionState(context, page) {
312
312
  */
313
313
  export function chainFlow(...flows) {
314
314
  if (flows.length === 0) {
315
- throw new WaygraphError("WG_CHAINFLOW_EMPTY", "chainFlow: give at least one Flow");
315
+ throw new WaygraphError("WG_CHAINFLOW_EMPTY", MSG_CHAINFLOW_EMPTY);
316
316
  }
317
317
  const run = async function run(contextOrMem, memOrConfig, options) {
318
318
  if (contextOrMem instanceof MemPage) {
@@ -0,0 +1,171 @@
1
+ import type { Block, Checkpoint } from "../types.js";
2
+ import type { EndMarker, StartMarker } from "./run-graph.js";
3
+ import type { Flow } from "./flow.js";
4
+ import type { NavBlock } from "./blocks/nav.js";
5
+ import type { PageBlock } from "./blocks/page.js";
6
+ import type { AssertBlock, MethodBlock } from "./blocks/method.js";
7
+ import type { EffectBlock } from "./blocks/effect.js";
8
+ type S = Checkpoint<"__start__">;
9
+ /**
10
+ * The one capability MapBuilder needs from Engine - a plain defineFlow-shaped function, not the
11
+ * whole Engine class. Depending on Engine-the-type here would make engine.ts and map-builder.ts
12
+ * import each other (Engine.map() builds a MapBuilder; MapBuilder.end() calls back into
13
+ * defineFlow) - a real cycle check:structure forbids. This type is how that's avoided.
14
+ */
15
+ export type DefineFlowFn = (blocks: readonly [StartMarker, ...Block<any, any>[], EndMarker]) => Flow<any>;
16
+ /** Per-step options every `MapBuilder` step method (`.gotoPage()`/`.method()`/`.assert()`) takes. */
17
+ export interface MapStepOpts {
18
+ /**
19
+ * Fast-forward just this step, inline - no `.ffStart()/.ffEnd()` bracket needed. Consecutive
20
+ * `{ ff: true }` steps merge into ONE fast-forward block, same result as the explicit bracket
21
+ * form; a step without the flag closes an auto-opened window first.
22
+ * @example map().gotoPage(NavLoginBlock, { ff: true }).method(FillUsernameBlock, { ff: true })
23
+ */
24
+ ff?: boolean;
25
+ }
26
+ export interface MapBuilderOptions {
27
+ /**
28
+ * This project's own origin (e.g. `"https://app.example.com"`) - enables
29
+ * `.gotoPage()`/`.gotoExternal()`'s origin check against a Block's static
30
+ * `url`. Omit to skip that check entirely (still fully kind-checked either
31
+ * way; only the internal/external origin distinction is opt-in).
32
+ */
33
+ homeOrigin?: string;
34
+ }
35
+ /**
36
+ * Fluent builder over {@link Engine.defineFlow} - see `map()`'s own doc
37
+ * comment for why this exists. Each step method is scoped to exactly the
38
+ * Block kind its name promises, checked at RUNTIME against the
39
+ * `__waygraphKind`/`__waygraphSalt` markers `defineNavBlock`/`definePageBlock`/
40
+ * `defineAssertBlock`/`defineMethodBlock`/`defineEffectBlock` already set
41
+ * (the same markers `graph.ts` and `map-check.ts` trust) - not just a type
42
+ * hint, since a hand-rolled object can satisfy the TypeScript `Block<In,Out>`
43
+ * shape without ever going through a real factory. Each call also
44
+ * typechecks the accumulated Checkpoint chain exactly like `defineFlow`'s
45
+ * own tuple overloads do (a step's `In` must equal the previous step's
46
+ * `Out`) - this is what "no teleporting" means: there is no method on this
47
+ * builder that can skip from one Checkpoint to an unrelated one without a
48
+ * real, kind-correct Block in between.
49
+ */
50
+ export declare class MapBuilder<Out extends Checkpoint<string>> {
51
+ private readonly defineFlow;
52
+ private readonly steps;
53
+ private readonly homeOrigin;
54
+ private readonly ff;
55
+ private constructor();
56
+ /** @internal - use `engine.map()` or the standalone `map()` export. */
57
+ static begin(defineFlow: DefineFlowFn, homeOrigin: string | undefined): MapBuilder<S>;
58
+ /** Readable chain-opener - mirrors `defineFlow`'s leading `start` sentinel. Returns `this` unchanged; entirely optional. */
59
+ start(): MapBuilder<Out>;
60
+ /**
61
+ * Open a fast-forward window - steps until {@link ffEnd} collapse into one
62
+ * opaque `fastForwardComposeBlock` (blitz theater). Kind/salt checks still
63
+ * run on each inner step as it is added.
64
+ */
65
+ ffStart(name?: string): MapBuilder<Out>;
66
+ /**
67
+ * Close the current fast-forward window and append one FFCompose step.
68
+ * Throws if empty or if {@link ffStart} was never opened.
69
+ */
70
+ ffEnd(): MapBuilder<Out>;
71
+ /** Shared by the explicit {@link ffEnd} and the implicit close a `{ ff: true }` step flag triggers. */
72
+ private closeFf;
73
+ /**
74
+ * `ff`: inline fast-forward, no `.ffStart()/.ffEnd()` bracket needed - `.method(X, { ff: true })`
75
+ * marks just that step; consecutive `{ ff: true }` steps merge into ONE fast-forward block (same
76
+ * runtime result as the explicit bracket form), same as if they'd been wrapped in
77
+ * `.ffStart()/.ffEnd()`. A step WITHOUT the flag closes an auto-opened window first, so a plain
78
+ * step is never silently swept into one; an EXPLICIT `.ffStart()` window still behaves as before
79
+ * (stays open until its own `.ffEnd()`, regardless of whether a step passed `{ ff: true }`).
80
+ */
81
+ private appendStep;
82
+ /**
83
+ * Appends an internal navigation/page-arrival step - requires a Block from
84
+ * `defineNavBlock`/`defineMemNavBlock`/`definePageBlock`. Throws if given
85
+ * anything else, including a `homeOrigin`-mismatched static `url`.
86
+ * Compile-time: {@link NavBlock} or {@link PageBlock} only (not Assert/Method).
87
+ * `{ ff: true }`: fast-forward this one step inline - see {@link appendStep}'s own comment.
88
+ */
89
+ gotoPage<NextOut extends Checkpoint<string>>(block: (NavBlock<NextOut> | PageBlock<NextOut>) & {
90
+ name: string;
91
+ }, opts?: MapStepOpts): MapBuilder<NextOut>;
92
+ /**
93
+ * Appends a genuinely cross-origin navigation step (e.g. `(external)/`
94
+ * Blocks in the Waygraph Map convention: mailpit, maildrop.cc) - same
95
+ * kind requirement as {@link gotoPage}, plus the inverse `homeOrigin` check.
96
+ * Compile-time: {@link NavBlock} or {@link PageBlock} only.
97
+ * `{ ff: true }`: fast-forward this one step inline - see {@link appendStep}'s own comment.
98
+ */
99
+ gotoExternal<NextOut extends Checkpoint<string>>(block: (NavBlock<NextOut> | PageBlock<NextOut>) & {
100
+ name: string;
101
+ }, opts?: MapStepOpts): MapBuilder<NextOut>;
102
+ /**
103
+ * Appends a self-loop verification step - requires a Block from
104
+ * `defineAssertBlock`. Compile-time: {@link AssertBlock} only (not `.method()`).
105
+ * `{ ff: true }`: fast-forward this one step inline - see {@link appendStep}'s own comment.
106
+ */
107
+ assert(block: AssertBlock<Out> & {
108
+ name: string;
109
+ }, opts?: MapStepOpts): MapBuilder<Out>;
110
+ /**
111
+ * Appends a non-navigating page action (submit, upload, add/remove an
112
+ * instance) - requires a Block from `defineMethodBlock`/`defineActionBlock`/
113
+ * `defineEffectBlock`/`defineMemEffectBlock`.
114
+ * Compile-time: {@link MethodBlock} or {@link EffectBlock} only - Assert
115
+ * Blocks must use `.assert()`. Runtime also rejects `__waygraphKind =
116
+ * "assert"` (those still carry method salt from the factory internals).
117
+ * `{ ff: true }`: fast-forward this one step inline - see {@link appendStep}'s own comment.
118
+ */
119
+ method<NextOut extends Checkpoint<string>>(block: (MethodBlock<Out, NextOut> | EffectBlock<Out, NextOut>) & {
120
+ name: string;
121
+ }, opts?: MapStepOpts): MapBuilder<NextOut>;
122
+ /**
123
+ * Branch: run everything added so far, then continue into whichever `routes[tag]` matches the
124
+ * resolved Checkpoint's tag - same page, same context, same mem. `routes` must cover every tag
125
+ * of `Out` (a missing one is a compile error, matching {@link branch}'s own exhaustiveness);
126
+ * `null` means that tag is terminal (the branched Flow just returns that Checkpoint).
127
+ *
128
+ * Each non-null route is a function, not a ready-made `Flow` - a fresh Flow always starts at the
129
+ * special `S` (start) Checkpoint, but a branch's blocks start from the TAG it routes on (e.g.
130
+ * `LoggedIn`), so the function is handed a brand-new `MapBuilder` already seeded at that exact
131
+ * Checkpoint to chain `.method()/.gotoPage()/.assert()/.end()` (or another `.branch()`) off of.
132
+ *
133
+ * Real gap this fixes: the plain `branch()` helper's `.next` routing is only ever consulted by
134
+ * `runGraph`'s own graph walk - `defineFlow`/`.end()` compose steps pairwise via `connect()`,
135
+ * which never looks at `.next` at all, so a Map-built Flow had no way to branch. This method
136
+ * branches at the Flow level instead: it finalizes the prefix, runs it, and picks the next Flow
137
+ * itself once the real tag is known - no engine-level routing involved.
138
+ *
139
+ * Only the `run(context, mem[, options])` signature is supported - the page must survive across
140
+ * the branch, and the bare `run(mem, config)` convenience form always closes its own browser
141
+ * before a tag is even known, so it throws instead of silently reopening a fresh (state-losing) page.
142
+ *
143
+ * The route's first Block still sees `input.__state === "__start__"` in `act()`, not the tag that
144
+ * routed there - `runGraph` seeds every Flow's entry Block that way unconditionally, the same as
145
+ * any standalone `defineFlow([start, block, end])` already does. Read `page`/`mem`, not `input`,
146
+ * in `act()` - every real Block in this codebase already follows that convention.
147
+ *
148
+ * @example
149
+ * map({ homeOrigin }).gotoPage(NavCartBlock).branch({
150
+ * ItemInCart: (m) => m.method(RemoveFromCartBlock).end(),
151
+ * LoggedIn: (m) => m.method(AddToCartBlock).end(),
152
+ * });
153
+ */
154
+ branch<Routes extends {
155
+ [K in Out["__state"]]: ((m: MapBuilder<Extract<Out, Checkpoint<K>>>) => Flow<any>) | null;
156
+ }>(routes: Routes): Flow<{
157
+ [K in keyof Routes & string]: Routes[K] extends (m: any) => Flow<infer R> ? R : Extract<Out, Checkpoint<K>>;
158
+ }[keyof Routes & string]>;
159
+ /**
160
+ * Finalizes this chain into a real, runnable {@link Flow} - same object
161
+ * `defineFlow` returns, so `withBlockVerify`/`modBlockVerify` and every
162
+ * `withTitle`/`withHighlightFixtures`/etc. decorator still apply exactly
163
+ * as they do today; this builder only changes how the chain is assembled,
164
+ * never what it produces. Throws if no step was ever added - an empty map
165
+ * isn't a flow. An auto-opened `{ ff: true }` window (see {@link MapStepOpts})
166
+ * left open at `.end()` closes silently; an EXPLICIT `.ffStart()` left open
167
+ * still throws - the author opened that one and needs to close it themselves.
168
+ */
169
+ end(): Flow<Out>;
170
+ }
171
+ export {};