waygraph 0.15.26 → 0.15.28

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 (322) hide show
  1. package/dist/auto-session/helpers.d.ts +203 -0
  2. package/dist/auto-session/helpers.js +148 -0
  3. package/dist/auto-session/session.d.ts +191 -0
  4. package/dist/auto-session/session.js +697 -0
  5. package/dist/auto-session.d.ts +2 -369
  6. package/dist/auto-session.js +3 -843
  7. package/dist/highlights/css.js +2 -44
  8. package/dist/pilot-overlay.d.ts +0 -18
  9. package/dist/pilot-overlay.js +27 -32
  10. package/dist/runner/overlay-css.js +7 -18
  11. package/dist/step-overlay.js +2 -46
  12. package/dist/ui/components/banner.d.ts +2 -0
  13. package/dist/ui/components/banner.js +10 -0
  14. package/dist/ui/components/cursor.d.ts +2 -0
  15. package/dist/ui/components/cursor.js +19 -0
  16. package/dist/ui/components/ring.d.ts +4 -0
  17. package/dist/ui/components/ring.js +44 -0
  18. package/dist/ui/compose.d.ts +4 -0
  19. package/dist/ui/compose.js +7 -0
  20. package/dist/ui/tokens.d.ts +31 -0
  21. package/dist/ui/tokens.js +21 -0
  22. package/package.json +1 -1
  23. package/examples/saucedemo/.waygraph-auto/0b937f26.log +0 -4
  24. package/examples/saucedemo/.waygraph-auto/11c497cd.log +0 -44
  25. package/examples/saucedemo/.waygraph-auto/159d541b.log +0 -0
  26. package/examples/saucedemo/.waygraph-auto/16aa2c01.log +0 -0
  27. package/examples/saucedemo/.waygraph-auto/16c35dd5.log +0 -0
  28. package/examples/saucedemo/.waygraph-auto/1706547d.log +0 -0
  29. package/examples/saucedemo/.waygraph-auto/17537e42.log +0 -0
  30. package/examples/saucedemo/.waygraph-auto/175655f7.log +0 -0
  31. package/examples/saucedemo/.waygraph-auto/179dde38.log +0 -0
  32. package/examples/saucedemo/.waygraph-auto/17ede493.log +0 -0
  33. package/examples/saucedemo/.waygraph-auto/19b9eee5.log +0 -0
  34. package/examples/saucedemo/.waygraph-auto/1a7d471e.log +0 -0
  35. package/examples/saucedemo/.waygraph-auto/1d266123.log +0 -0
  36. package/examples/saucedemo/.waygraph-auto/1e33a93d.log +0 -0
  37. package/examples/saucedemo/.waygraph-auto/1fe2414f.log +0 -0
  38. package/examples/saucedemo/.waygraph-auto/1fe2e3b8.log +0 -0
  39. package/examples/saucedemo/.waygraph-auto/2219f00b.log +0 -0
  40. package/examples/saucedemo/.waygraph-auto/22fefa13.log +0 -0
  41. package/examples/saucedemo/.waygraph-auto/23e62571.log +0 -0
  42. package/examples/saucedemo/.waygraph-auto/25f68ada.log +0 -0
  43. package/examples/saucedemo/.waygraph-auto/26ca9cd8.log +0 -0
  44. package/examples/saucedemo/.waygraph-auto/29d11a49.log +0 -44
  45. package/examples/saucedemo/.waygraph-auto/2b608ed3.log +0 -0
  46. package/examples/saucedemo/.waygraph-auto/2bb6c4e8.log +0 -0
  47. package/examples/saucedemo/.waygraph-auto/2c13567b.log +0 -0
  48. package/examples/saucedemo/.waygraph-auto/2c7e8edd.log +0 -0
  49. package/examples/saucedemo/.waygraph-auto/2c9a4003.log +0 -44
  50. package/examples/saucedemo/.waygraph-auto/2d425004.log +0 -0
  51. package/examples/saucedemo/.waygraph-auto/2d45a578.log +0 -0
  52. package/examples/saucedemo/.waygraph-auto/2d9622a5.log +0 -4
  53. package/examples/saucedemo/.waygraph-auto/2f5b3ea6.log +0 -0
  54. package/examples/saucedemo/.waygraph-auto/2fbf6b8d.log +0 -0
  55. package/examples/saucedemo/.waygraph-auto/301ff7e3.log +0 -0
  56. package/examples/saucedemo/.waygraph-auto/305f6e5b.log +0 -4
  57. package/examples/saucedemo/.waygraph-auto/309c107f.log +0 -0
  58. package/examples/saucedemo/.waygraph-auto/3178c318.log +0 -0
  59. package/examples/saucedemo/.waygraph-auto/31bb303d.log +0 -0
  60. package/examples/saucedemo/.waygraph-auto/31f2042f.log +0 -0
  61. package/examples/saucedemo/.waygraph-auto/32e2c26f.log +0 -0
  62. package/examples/saucedemo/.waygraph-auto/32ef32a8.log +0 -44
  63. package/examples/saucedemo/.waygraph-auto/36551ec1.log +0 -0
  64. package/examples/saucedemo/.waygraph-auto/36a1c274.log +0 -0
  65. package/examples/saucedemo/.waygraph-auto/36ba01f7.log +0 -44
  66. package/examples/saucedemo/.waygraph-auto/381aa338.log +0 -0
  67. package/examples/saucedemo/.waygraph-auto/3882bce1.log +0 -0
  68. package/examples/saucedemo/.waygraph-auto/38acd1dc.log +0 -0
  69. package/examples/saucedemo/.waygraph-auto/39f352c7.log +0 -4
  70. package/examples/saucedemo/.waygraph-auto/3ab7c7bd.log +0 -44
  71. package/examples/saucedemo/.waygraph-auto/3b8b77b9.log +0 -0
  72. package/examples/saucedemo/.waygraph-auto/3eb1df41.log +0 -0
  73. package/examples/saucedemo/.waygraph-auto/4028d2a2.log +0 -0
  74. package/examples/saucedemo/.waygraph-auto/4168b208.log +0 -0
  75. package/examples/saucedemo/.waygraph-auto/418befbf.log +0 -4
  76. package/examples/saucedemo/.waygraph-auto/422d4390.log +0 -0
  77. package/examples/saucedemo/.waygraph-auto/4258d26d.log +0 -0
  78. package/examples/saucedemo/.waygraph-auto/42cc9113.log +0 -0
  79. package/examples/saucedemo/.waygraph-auto/439d30aa.log +0 -0
  80. package/examples/saucedemo/.waygraph-auto/43ab66ce.log +0 -0
  81. package/examples/saucedemo/.waygraph-auto/43f66838.log +0 -0
  82. package/examples/saucedemo/.waygraph-auto/442171d4.log +0 -0
  83. package/examples/saucedemo/.waygraph-auto/453b1ce1.log +0 -0
  84. package/examples/saucedemo/.waygraph-auto/457322bd.log +0 -0
  85. package/examples/saucedemo/.waygraph-auto/45864828.log +0 -0
  86. package/examples/saucedemo/.waygraph-auto/46197027.log +0 -0
  87. package/examples/saucedemo/.waygraph-auto/46889468.log +0 -0
  88. package/examples/saucedemo/.waygraph-auto/483bd763.log +0 -4
  89. package/examples/saucedemo/.waygraph-auto/4890da1c.log +0 -0
  90. package/examples/saucedemo/.waygraph-auto/4893a63b.log +0 -0
  91. package/examples/saucedemo/.waygraph-auto/48e3596a.log +0 -0
  92. package/examples/saucedemo/.waygraph-auto/49edc885.log +0 -4
  93. package/examples/saucedemo/.waygraph-auto/4a85f496.log +0 -0
  94. package/examples/saucedemo/.waygraph-auto/4af71440.log +0 -0
  95. package/examples/saucedemo/.waygraph-auto/4c6b9e15.log +0 -0
  96. package/examples/saucedemo/.waygraph-auto/4d68438c.log +0 -0
  97. package/examples/saucedemo/.waygraph-auto/4f0e33e7.log +0 -4
  98. package/examples/saucedemo/.waygraph-auto/4f7496d1.log +0 -0
  99. package/examples/saucedemo/.waygraph-auto/5030cca5.log +0 -0
  100. package/examples/saucedemo/.waygraph-auto/50e8baaa.log +0 -0
  101. package/examples/saucedemo/.waygraph-auto/51a5387a.log +0 -0
  102. package/examples/saucedemo/.waygraph-auto/52b3a455.log +0 -0
  103. package/examples/saucedemo/.waygraph-auto/532dd9b8.log +0 -0
  104. package/examples/saucedemo/.waygraph-auto/537af83d.log +0 -44
  105. package/examples/saucedemo/.waygraph-auto/5391ce40.log +0 -0
  106. package/examples/saucedemo/.waygraph-auto/55df2b0f.log +0 -0
  107. package/examples/saucedemo/.waygraph-auto/57dbddb3.log +0 -0
  108. package/examples/saucedemo/.waygraph-auto/5897f501.log +0 -0
  109. package/examples/saucedemo/.waygraph-auto/59c0b57d.log +0 -0
  110. package/examples/saucedemo/.waygraph-auto/5a4374f7.log +0 -0
  111. package/examples/saucedemo/.waygraph-auto/5adfacd5.log +0 -44
  112. package/examples/saucedemo/.waygraph-auto/5b511794.log +0 -0
  113. package/examples/saucedemo/.waygraph-auto/5bd8fedf.log +0 -4
  114. package/examples/saucedemo/.waygraph-auto/5c0eef7f.log +0 -0
  115. package/examples/saucedemo/.waygraph-auto/5c47910f.log +0 -0
  116. package/examples/saucedemo/.waygraph-auto/5d60da77.log +0 -0
  117. package/examples/saucedemo/.waygraph-auto/5dde8331.log +0 -4
  118. package/examples/saucedemo/.waygraph-auto/5eafc682.log +0 -0
  119. package/examples/saucedemo/.waygraph-auto/5eda8273.log +0 -0
  120. package/examples/saucedemo/.waygraph-auto/5fc3a33b.log +0 -0
  121. package/examples/saucedemo/.waygraph-auto/605d965b.log +0 -0
  122. package/examples/saucedemo/.waygraph-auto/61b6546d.log +0 -0
  123. package/examples/saucedemo/.waygraph-auto/621518ad.log +0 -0
  124. package/examples/saucedemo/.waygraph-auto/632b7118.log +0 -0
  125. package/examples/saucedemo/.waygraph-auto/64314c2b.log +0 -0
  126. package/examples/saucedemo/.waygraph-auto/6443943b.log +0 -0
  127. package/examples/saucedemo/.waygraph-auto/650ed066.log +0 -0
  128. package/examples/saucedemo/.waygraph-auto/66516213.log +0 -0
  129. package/examples/saucedemo/.waygraph-auto/66c17079.log +0 -0
  130. package/examples/saucedemo/.waygraph-auto/68903903.log +0 -0
  131. package/examples/saucedemo/.waygraph-auto/69bf0b80.log +0 -0
  132. package/examples/saucedemo/.waygraph-auto/69c2347a.log +0 -0
  133. package/examples/saucedemo/.waygraph-auto/6b667734.log +0 -0
  134. package/examples/saucedemo/.waygraph-auto/6c9f8e10.log +0 -0
  135. package/examples/saucedemo/.waygraph-auto/6d22bdb0.log +0 -0
  136. package/examples/saucedemo/.waygraph-auto/6d9aaad3.log +0 -0
  137. package/examples/saucedemo/.waygraph-auto/6fc3d553.log +0 -0
  138. package/examples/saucedemo/.waygraph-auto/7103bebb.log +0 -0
  139. package/examples/saucedemo/.waygraph-auto/740c9faa.log +0 -0
  140. package/examples/saucedemo/.waygraph-auto/74872fc5.log +0 -0
  141. package/examples/saucedemo/.waygraph-auto/74ce745a.log +0 -0
  142. package/examples/saucedemo/.waygraph-auto/7531b70f.log +0 -0
  143. package/examples/saucedemo/.waygraph-auto/75846ca9.log +0 -0
  144. package/examples/saucedemo/.waygraph-auto/7626c85b.log +0 -0
  145. package/examples/saucedemo/.waygraph-auto/76308eec.log +0 -0
  146. package/examples/saucedemo/.waygraph-auto/76c1650e.log +0 -0
  147. package/examples/saucedemo/.waygraph-auto/76c7d418.log +0 -44
  148. package/examples/saucedemo/.waygraph-auto/7774f054.log +0 -0
  149. package/examples/saucedemo/.waygraph-auto/78197960.log +0 -44
  150. package/examples/saucedemo/.waygraph-auto/7861f38f.log +0 -0
  151. package/examples/saucedemo/.waygraph-auto/78b21219.log +0 -0
  152. package/examples/saucedemo/.waygraph-auto/78bbf43c.log +0 -0
  153. package/examples/saucedemo/.waygraph-auto/79600ead.log +0 -0
  154. package/examples/saucedemo/.waygraph-auto/7a08e89a.log +0 -0
  155. package/examples/saucedemo/.waygraph-auto/7af224ed.log +0 -0
  156. package/examples/saucedemo/.waygraph-auto/7c2acbc2.log +0 -44
  157. package/examples/saucedemo/.waygraph-auto/7c3be585.log +0 -0
  158. package/examples/saucedemo/.waygraph-auto/7d9f231d.log +0 -0
  159. package/examples/saucedemo/.waygraph-auto/7ed55a2c.log +0 -0
  160. package/examples/saucedemo/.waygraph-auto/7eded669.log +0 -0
  161. package/examples/saucedemo/.waygraph-auto/7efa646f.log +0 -4
  162. package/examples/saucedemo/.waygraph-auto/80086ba2.log +0 -0
  163. package/examples/saucedemo/.waygraph-auto/80206369.log +0 -0
  164. package/examples/saucedemo/.waygraph-auto/844b63ff.log +0 -44
  165. package/examples/saucedemo/.waygraph-auto/847f1092.log +0 -0
  166. package/examples/saucedemo/.waygraph-auto/84d6d293.log +0 -0
  167. package/examples/saucedemo/.waygraph-auto/8557750f.log +0 -0
  168. package/examples/saucedemo/.waygraph-auto/8581abfa.log +0 -0
  169. package/examples/saucedemo/.waygraph-auto/86a5ff4d.log +0 -0
  170. package/examples/saucedemo/.waygraph-auto/87b7e0fd.log +0 -0
  171. package/examples/saucedemo/.waygraph-auto/87c79256.log +0 -0
  172. package/examples/saucedemo/.waygraph-auto/88a4200b.log +0 -0
  173. package/examples/saucedemo/.waygraph-auto/88af2495.log +0 -0
  174. package/examples/saucedemo/.waygraph-auto/89477e92.log +0 -0
  175. package/examples/saucedemo/.waygraph-auto/8a3eb088.log +0 -0
  176. package/examples/saucedemo/.waygraph-auto/8c04a403.log +0 -0
  177. package/examples/saucedemo/.waygraph-auto/8c5b1caa.log +0 -0
  178. package/examples/saucedemo/.waygraph-auto/8c9ab09e.log +0 -0
  179. package/examples/saucedemo/.waygraph-auto/8cc5db51.log +0 -0
  180. package/examples/saucedemo/.waygraph-auto/8ea3a69c.log +0 -0
  181. package/examples/saucedemo/.waygraph-auto/90141d7e.log +0 -4
  182. package/examples/saucedemo/.waygraph-auto/9150f913.log +0 -0
  183. package/examples/saucedemo/.waygraph-auto/929a4313.log +0 -0
  184. package/examples/saucedemo/.waygraph-auto/95a599e4.log +0 -0
  185. package/examples/saucedemo/.waygraph-auto/95bd8371.log +0 -0
  186. package/examples/saucedemo/.waygraph-auto/96c45350.log +0 -0
  187. package/examples/saucedemo/.waygraph-auto/986030e6.log +0 -0
  188. package/examples/saucedemo/.waygraph-auto/9918377b.log +0 -0
  189. package/examples/saucedemo/.waygraph-auto/99787abb.log +0 -0
  190. package/examples/saucedemo/.waygraph-auto/99ddb62c.log +0 -0
  191. package/examples/saucedemo/.waygraph-auto/9c4fd0a0.log +0 -0
  192. package/examples/saucedemo/.waygraph-auto/9cd2da32.log +0 -0
  193. package/examples/saucedemo/.waygraph-auto/9cecb0c8.log +0 -4
  194. package/examples/saucedemo/.waygraph-auto/a2dd30dd.log +0 -0
  195. package/examples/saucedemo/.waygraph-auto/a63a2d20.log +0 -0
  196. package/examples/saucedemo/.waygraph-auto/a78befb7.log +0 -0
  197. package/examples/saucedemo/.waygraph-auto/a7c3d248.log +0 -0
  198. package/examples/saucedemo/.waygraph-auto/a84d9b79.log +0 -0
  199. package/examples/saucedemo/.waygraph-auto/a87bb3ee.log +0 -0
  200. package/examples/saucedemo/.waygraph-auto/a9270890.log +0 -0
  201. package/examples/saucedemo/.waygraph-auto/aa440153.log +0 -0
  202. package/examples/saucedemo/.waygraph-auto/aae57d51.log +0 -0
  203. package/examples/saucedemo/.waygraph-auto/ab26aeb4.log +0 -0
  204. package/examples/saucedemo/.waygraph-auto/ab7561e0.log +0 -0
  205. package/examples/saucedemo/.waygraph-auto/ac19ae60.log +0 -0
  206. package/examples/saucedemo/.waygraph-auto/ae21ad8e.log +0 -0
  207. package/examples/saucedemo/.waygraph-auto/af09042f.log +0 -0
  208. package/examples/saucedemo/.waygraph-auto/b0eed995.log +0 -44
  209. package/examples/saucedemo/.waygraph-auto/b13d08e4.log +0 -0
  210. package/examples/saucedemo/.waygraph-auto/b1684126.log +0 -0
  211. package/examples/saucedemo/.waygraph-auto/b21e9d12.log +0 -0
  212. package/examples/saucedemo/.waygraph-auto/b5a838be.log +0 -0
  213. package/examples/saucedemo/.waygraph-auto/b603549d.log +0 -0
  214. package/examples/saucedemo/.waygraph-auto/b61a08d8.log +0 -0
  215. package/examples/saucedemo/.waygraph-auto/b7e545f0.log +0 -0
  216. package/examples/saucedemo/.waygraph-auto/b81e074f.log +0 -0
  217. package/examples/saucedemo/.waygraph-auto/b83e6259.log +0 -0
  218. package/examples/saucedemo/.waygraph-auto/b9cb2796.log +0 -0
  219. package/examples/saucedemo/.waygraph-auto/ba58abb7.log +0 -0
  220. package/examples/saucedemo/.waygraph-auto/bb0a0018.log +0 -0
  221. package/examples/saucedemo/.waygraph-auto/bb69dc1a.log +0 -44
  222. package/examples/saucedemo/.waygraph-auto/bb9fd384.log +0 -0
  223. package/examples/saucedemo/.waygraph-auto/bc0bdd0e.log +0 -0
  224. package/examples/saucedemo/.waygraph-auto/bc4ae56f.log +0 -0
  225. package/examples/saucedemo/.waygraph-auto/bc7d4a83.log +0 -0
  226. package/examples/saucedemo/.waygraph-auto/bcb9e31a.log +0 -0
  227. package/examples/saucedemo/.waygraph-auto/bd8e082a.log +0 -0
  228. package/examples/saucedemo/.waygraph-auto/bde6d205.log +0 -0
  229. package/examples/saucedemo/.waygraph-auto/be0bb35f.log +0 -0
  230. package/examples/saucedemo/.waygraph-auto/bea0c93e.log +0 -0
  231. package/examples/saucedemo/.waygraph-auto/bf35201a.log +0 -0
  232. package/examples/saucedemo/.waygraph-auto/bffa3a7a.log +0 -0
  233. package/examples/saucedemo/.waygraph-auto/c02ea583.log +0 -0
  234. package/examples/saucedemo/.waygraph-auto/c10c4038.log +0 -0
  235. package/examples/saucedemo/.waygraph-auto/c17253b0.log +0 -44
  236. package/examples/saucedemo/.waygraph-auto/c23b2654.log +0 -0
  237. package/examples/saucedemo/.waygraph-auto/c2caf0a8.log +0 -0
  238. package/examples/saucedemo/.waygraph-auto/c31a9465.log +0 -0
  239. package/examples/saucedemo/.waygraph-auto/c3bdc714.log +0 -0
  240. package/examples/saucedemo/.waygraph-auto/c4afb8bc.log +0 -0
  241. package/examples/saucedemo/.waygraph-auto/c5ac2393.log +0 -44
  242. package/examples/saucedemo/.waygraph-auto/c701e3c2.log +0 -0
  243. package/examples/saucedemo/.waygraph-auto/c8825eda.log +0 -0
  244. package/examples/saucedemo/.waygraph-auto/c916a654.log +0 -0
  245. package/examples/saucedemo/.waygraph-auto/c946f66c.log +0 -0
  246. package/examples/saucedemo/.waygraph-auto/c9b8d69e.log +0 -0
  247. package/examples/saucedemo/.waygraph-auto/cb2726d7.log +0 -0
  248. package/examples/saucedemo/.waygraph-auto/cd0d5b50.log +0 -4
  249. package/examples/saucedemo/.waygraph-auto/cd3e528c.log +0 -0
  250. package/examples/saucedemo/.waygraph-auto/cd5b203c.log +0 -0
  251. package/examples/saucedemo/.waygraph-auto/cd68bbc4.log +0 -0
  252. package/examples/saucedemo/.waygraph-auto/cdc6db50.log +0 -0
  253. package/examples/saucedemo/.waygraph-auto/d01906a7.log +0 -0
  254. package/examples/saucedemo/.waygraph-auto/d02e5e7e.log +0 -0
  255. package/examples/saucedemo/.waygraph-auto/d09aff71.log +0 -0
  256. package/examples/saucedemo/.waygraph-auto/d0e41396.log +0 -0
  257. package/examples/saucedemo/.waygraph-auto/d1370d76.log +0 -0
  258. package/examples/saucedemo/.waygraph-auto/d207a000.log +0 -44
  259. package/examples/saucedemo/.waygraph-auto/d2c6ed66.log +0 -0
  260. package/examples/saucedemo/.waygraph-auto/d3714ae4.log +0 -0
  261. package/examples/saucedemo/.waygraph-auto/d440e60f.log +0 -0
  262. package/examples/saucedemo/.waygraph-auto/d52ce64b.log +0 -0
  263. package/examples/saucedemo/.waygraph-auto/d6e0cb19.log +0 -0
  264. package/examples/saucedemo/.waygraph-auto/d9e5f8a4.log +0 -0
  265. package/examples/saucedemo/.waygraph-auto/da0685dc.log +0 -0
  266. package/examples/saucedemo/.waygraph-auto/da894ad8.log +0 -0
  267. package/examples/saucedemo/.waygraph-auto/daa2f922.log +0 -0
  268. package/examples/saucedemo/.waygraph-auto/daefb614.log +0 -0
  269. package/examples/saucedemo/.waygraph-auto/db97e833.log +0 -0
  270. package/examples/saucedemo/.waygraph-auto/dce1535d.log +0 -0
  271. package/examples/saucedemo/.waygraph-auto/ddcb4212.log +0 -0
  272. package/examples/saucedemo/.waygraph-auto/dec3076e.log +0 -0
  273. package/examples/saucedemo/.waygraph-auto/e101d19a.log +0 -0
  274. package/examples/saucedemo/.waygraph-auto/e1973991.log +0 -0
  275. package/examples/saucedemo/.waygraph-auto/e207c989.log +0 -0
  276. package/examples/saucedemo/.waygraph-auto/e280bf20.log +0 -0
  277. package/examples/saucedemo/.waygraph-auto/e62bdb4a.log +0 -0
  278. package/examples/saucedemo/.waygraph-auto/e633e545.log +0 -0
  279. package/examples/saucedemo/.waygraph-auto/e69aec68.log +0 -0
  280. package/examples/saucedemo/.waygraph-auto/e70e2d06.log +0 -0
  281. package/examples/saucedemo/.waygraph-auto/e8306a4b.log +0 -0
  282. package/examples/saucedemo/.waygraph-auto/e9b84105.log +0 -0
  283. package/examples/saucedemo/.waygraph-auto/ea2df316.log +0 -4
  284. package/examples/saucedemo/.waygraph-auto/ebad3410.log +0 -0
  285. package/examples/saucedemo/.waygraph-auto/ebc2ebdb.log +0 -0
  286. package/examples/saucedemo/.waygraph-auto/ec88b3ef.log +0 -0
  287. package/examples/saucedemo/.waygraph-auto/ecbb0966.log +0 -0
  288. package/examples/saucedemo/.waygraph-auto/ecdee753.log +0 -0
  289. package/examples/saucedemo/.waygraph-auto/ed888783.log +0 -0
  290. package/examples/saucedemo/.waygraph-auto/ed931dac.log +0 -0
  291. package/examples/saucedemo/.waygraph-auto/ee60ed24.log +0 -0
  292. package/examples/saucedemo/.waygraph-auto/ef655a3f.log +0 -0
  293. package/examples/saucedemo/.waygraph-auto/f1949241.log +0 -0
  294. package/examples/saucedemo/.waygraph-auto/f2b6cb1b.log +0 -0
  295. package/examples/saucedemo/.waygraph-auto/f34c9a26.log +0 -0
  296. package/examples/saucedemo/.waygraph-auto/f392cdc8.log +0 -0
  297. package/examples/saucedemo/.waygraph-auto/f3c29b21.log +0 -0
  298. package/examples/saucedemo/.waygraph-auto/f53f7cfc.log +0 -0
  299. package/examples/saucedemo/.waygraph-auto/f5525d53.log +0 -0
  300. package/examples/saucedemo/.waygraph-auto/f5ad5830.log +0 -0
  301. package/examples/saucedemo/.waygraph-auto/f90035b3.log +0 -0
  302. package/examples/saucedemo/.waygraph-auto/fa3c5655.log +0 -44
  303. package/examples/saucedemo/.waygraph-auto/fa687bc2.log +0 -0
  304. package/examples/saucedemo/.waygraph-auto/faed36dd.log +0 -0
  305. package/examples/saucedemo/.waygraph-auto/fb66fba0.log +0 -0
  306. package/examples/saucedemo/.waygraph-auto/fc48fd76.log +0 -0
  307. /package/examples/saucedemo/.waygraph-auto/{008f4e6e.log → 0f0cb120.log} +0 -0
  308. /package/examples/saucedemo/.waygraph-auto/{00d5336e.log → 2324269a.log} +0 -0
  309. /package/examples/saucedemo/.waygraph-auto/{010dd92b.log → 2e2069e7.log} +0 -0
  310. /package/examples/saucedemo/.waygraph-auto/{011ad671.log → 2efd1983.log} +0 -0
  311. /package/examples/saucedemo/.waygraph-auto/{01b45645.log → 413d934d.log} +0 -0
  312. /package/examples/saucedemo/.waygraph-auto/{03710cfc.log → 42e014d1.log} +0 -0
  313. /package/examples/saucedemo/.waygraph-auto/{03764153.log → 6706ead4.log} +0 -0
  314. /package/examples/saucedemo/.waygraph-auto/{0593587e.log → 685714af.log} +0 -0
  315. /package/examples/saucedemo/.waygraph-auto/{06d12823.log → 7773a809.log} +0 -0
  316. /package/examples/saucedemo/.waygraph-auto/{083cc5b9.log → 7f94fd02.log} +0 -0
  317. /package/examples/saucedemo/.waygraph-auto/{0ac58118.log → c60cc55e.log} +0 -0
  318. /package/examples/saucedemo/.waygraph-auto/{0c00f25f.log → d50e58f0.log} +0 -0
  319. /package/examples/saucedemo/.waygraph-auto/{0e480591.log → d934da78.log} +0 -0
  320. /package/examples/saucedemo/.waygraph-auto/{104751ef.log → da6ebb31.log} +0 -0
  321. /package/examples/saucedemo/.waygraph-auto/{110958b8.log → e03cfd8e.log} +0 -0
  322. /package/examples/saucedemo/.waygraph-auto/{138107c1.log → f2943898.log} +0 -0
@@ -0,0 +1,697 @@
1
+ // Split out of the former 1,078-line auto-session.ts (see src/ARCHITECTURE.md). Behavior unchanged.
2
+ import { CONSOLE_LOG_MAX_ENTRIES, FULL_MODE_DEFAULT_DEPTH, FULL_MODE_MAX_NODES, FULL_MODE_MAX_TEXT_LENGTH, TRACE_MAX_STEPS, buildSessionSnapshot, parsePick, stubFilePath, stubPhaseHasContent, walkFullDom } from "./helpers.js";
3
+ import { installPersistentPilotOverlay, showPilotActivity, showPilotFixtures, showPilotVision, updatePilotOverlay } from "../pilot-overlay.js";
4
+ import { buildExploreContext, buildExploreMenu } from "../auto-explore.js";
5
+ import { MemPage } from "../mem-page.js";
6
+ import { Engine } from "../engine.js";
7
+ import { detectHere, ensureLivePage, ensureMem, resolveBaseUrl, runOneBlock, seedDefaultMem } from "../auto-explore-run.js";
8
+ import { collectKnownInteractionSelectors, unmappedInteractionsPageScript } from "../coverage-gap.js";
9
+ import { runStubPhase } from "../highlights.js";
10
+ import { findBlockPathDetailed } from "../graph.js";
11
+ /**
12
+ * Non-interactive explore session: same graph/library/mem/browser setup
13
+ * `runAutoExplore` runs in `--cli` mode, driven by `applyPick` instead of a
14
+ * blocking `readline` loop. Headless by default (matching
15
+ * `runAutoExplore`'s own `cli` branch), optionally visible via
16
+ * `AutoSessionInit.headless: false` - this type only ever backs the `--cli`
17
+ * picker, never the headful page-embedded panel, headless or not.
18
+ */
19
+ export class AutoSession {
20
+ projectDir;
21
+ inject;
22
+ blocksSelect;
23
+ graph;
24
+ library;
25
+ mem;
26
+ engine;
27
+ browser;
28
+ context;
29
+ page;
30
+ startUrl;
31
+ sessionId;
32
+ here = null;
33
+ lastRunNote = null;
34
+ trace = [];
35
+ consoleLog = [];
36
+ knownInteractionSelectors;
37
+ headless;
38
+ lastOverlayInfo = null;
39
+ constructor(projectDir, inject, blocksSelect, graph, library, mem, engine, browser, context, page, startUrl, sessionId, knownInteractionSelectors, headless) {
40
+ this.projectDir = projectDir;
41
+ this.inject = inject;
42
+ this.blocksSelect = blocksSelect;
43
+ this.graph = graph;
44
+ this.library = library;
45
+ this.mem = mem;
46
+ this.engine = engine;
47
+ this.browser = browser;
48
+ this.context = context;
49
+ this.page = page;
50
+ this.startUrl = startUrl;
51
+ this.sessionId = sessionId;
52
+ this.knownInteractionSelectors = knownInteractionSelectors;
53
+ this.headless = headless;
54
+ }
55
+ static async start(init) {
56
+ const baseURL = init.baseURL ?? resolveBaseUrl(init.projectDir);
57
+ const skipNav = init.skipInitialNavigation === true;
58
+ const startUrl = skipNav ? undefined : (init.startUrl ?? baseURL);
59
+ const exploreOpts = {
60
+ ...(init.blocksSelect ? { blocksSelect: init.blocksSelect } : {}),
61
+ ...(init.inject?.length ? { inject: init.inject } : {}),
62
+ };
63
+ const { graph, library } = await buildExploreContext(init.projectDir, Object.keys(exploreOpts).length ? exploreOpts : undefined);
64
+ const mem = new MemPage();
65
+ seedDefaultMem(library.byName, mem);
66
+ const headless = init.headless ?? true;
67
+ const engine = new Engine({ headless });
68
+ const { chromium } = await import("@playwright/test");
69
+ const executablePath = process.env.CHROME_PATH || process.env.CHROMIUM_PATH;
70
+ // Real gap found live: a headed (--non-headless) session kept a fixed
71
+ // 1280x720 content area even when the user maximized/fullscreened the
72
+ // actual window - `viewport: null` alone only makes the PAGE track the
73
+ // window; the window itself still launches at Chromium's own small
74
+ // default size unless told to start maximized. Same fix cli.ts's own
75
+ // --step/headed launch already uses (see its own comment there) -
76
+ // headless keeps the fixed viewport since there's no real window to size.
77
+ const launchOpts = {
78
+ headless,
79
+ // Keep Playwright's default --no-startup-window for headful: without it
80
+ // Chromium opens its own "New Tab" window AND our context.newPage() opens
81
+ // a second about:blank window. bringToFront() below surfaces the real page.
82
+ args: headless ? [] : ["--start-maximized"],
83
+ };
84
+ if (executablePath)
85
+ launchOpts.executablePath = executablePath;
86
+ const browser = await chromium.launch(launchOpts);
87
+ const contextOpts = {
88
+ viewport: headless ? { width: 1280, height: 720 } : null,
89
+ };
90
+ if (baseURL)
91
+ contextOpts.baseURL = baseURL;
92
+ const context = await browser.newContext(contextOpts);
93
+ await installPersistentPilotOverlay(context);
94
+ const page = await context.newPage();
95
+ if (startUrl) {
96
+ await page.goto(startUrl, { waitUntil: "domcontentloaded" }).catch(() => { });
97
+ await page.waitForLoadState("load").catch(() => { });
98
+ }
99
+ else {
100
+ await page.goto("about:blank").catch(() => { });
101
+ }
102
+ const knownInteractionSelectors = collectKnownInteractionSelectors(init.projectDir, library, init.inject);
103
+ const session = new AutoSession(init.projectDir, init.inject, init.blocksSelect, graph, library, mem, engine, browser, context, page, startUrl, init.sessionId, knownInteractionSelectors, headless);
104
+ page.on("load", () => {
105
+ void session.repaintOverlayAfterNavigation();
106
+ });
107
+ if (!headless) {
108
+ await session.bootstrapOverlay().catch(() => { });
109
+ await page.bringToFront().catch(() => { });
110
+ }
111
+ // Attached once, on the page created here - `ensureLivePage` only swaps
112
+ // to a fresh Page if the current one closed (a rare case, e.g. the human
113
+ // closing the tab), not on ordinary same-page SPA navigation, which is
114
+ // all this target (and most real sites) actually do.
115
+ page.on("console", (msg) => {
116
+ session.pushConsoleLog({
117
+ type: "console",
118
+ level: msg.type(),
119
+ text: msg.text(),
120
+ timestamp: new Date().toISOString(),
121
+ });
122
+ });
123
+ page.on("pageerror", (err) => {
124
+ session.pushConsoleLog({
125
+ type: "pageerror",
126
+ text: err instanceof Error ? err.message : String(err),
127
+ timestamp: new Date().toISOString(),
128
+ });
129
+ });
130
+ page.on("response", (res) => {
131
+ // Every failed response (the original case), PLUS every mutation
132
+ // (non-GET) response regardless of status - a real gap found live:
133
+ // "auto console" only logging failures made a SUCCESSFUL POST that
134
+ // simply didn't navigate anywhere look identical to "nothing
135
+ // happened at all," undiagnosable the same way a real failure was.
136
+ // A mutation's outcome (2xx or not) is always diagnostically
137
+ // relevant; a GET's usually isn't (assets, trackers) unless it failed.
138
+ const method = res.request().method();
139
+ if (res.status() < 400 && method === "GET")
140
+ return;
141
+ session.pushConsoleLog({
142
+ type: "response",
143
+ text: `${method} ${res.statusText()}`,
144
+ url: res.url(),
145
+ status: res.status(),
146
+ timestamp: new Date().toISOString(),
147
+ });
148
+ });
149
+ return session;
150
+ }
151
+ /** Pure getter - returns a copy, not the live array. */
152
+ getTrace() {
153
+ return [...this.trace];
154
+ }
155
+ pushTrace(step) {
156
+ this.trace.push(step);
157
+ if (this.trace.length > TRACE_MAX_STEPS)
158
+ this.trace.shift();
159
+ }
160
+ /** Pure getter - returns a copy, not the live array. */
161
+ getConsoleLog() {
162
+ return [...this.consoleLog];
163
+ }
164
+ pushConsoleLog(entry) {
165
+ this.consoleLog.push(entry);
166
+ if (this.consoleLog.length > CONSOLE_LOG_MAX_ENTRIES)
167
+ this.consoleLog.shift();
168
+ }
169
+ async currentMenu() {
170
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
171
+ if (this.here === null) {
172
+ this.here = await detectHere(this.page, this.library.navBlocks);
173
+ }
174
+ const menu = await buildExploreMenu(this.page, this.graph, this.library, this.here);
175
+ // Every caller of currentMenu() (status reads, applyPick/applyPath,
176
+ // the raw click/type/goto primitives, resync) already routes through
177
+ // here, so hooking the overlay refresh at this one point covers every
178
+ // real state-changing (and reading) path without needing a separate
179
+ // call at each site. Awaited deliberately, not fire-and-forget - the
180
+ // whole point is a human watching the screen sees the SAME state a
181
+ // concurrent API caller just got back, not a stale frame that catches
182
+ // up moments later.
183
+ this.lastOverlayInfo = {
184
+ sessionId: this.sessionId,
185
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
186
+ graph: this.graph,
187
+ };
188
+ await updatePilotOverlay(this.page, this.lastOverlayInfo);
189
+ await this.warnUnmappedInteractions();
190
+ return menu;
191
+ }
192
+ /** Paint the overlay on about:blank / immediately after session start (headful browser). */
193
+ async bootstrapOverlay() {
194
+ await this.currentMenu();
195
+ }
196
+ /** Re-apply cached overlay state after navigation (init script restores shell only). */
197
+ async repaintOverlayAfterNavigation() {
198
+ if (this.lastOverlayInfo) {
199
+ await updatePilotOverlay(this.page, this.lastOverlayInfo).catch(() => { });
200
+ return;
201
+ }
202
+ if (!this.headless) {
203
+ await this.bootstrapOverlay().catch(() => { });
204
+ }
205
+ }
206
+ /**
207
+ * Flags same-origin `<a href>` paths and visible buttons with no NavBlock
208
+ * URL / Block selector in the loaded library — read via `auto console`.
209
+ * Deduped per page load so repeated status/send calls stay quiet.
210
+ */
211
+ async warnUnmappedInteractions() {
212
+ const knownPathnames = [];
213
+ for (const entry of this.library.navBlocks) {
214
+ const url = entry.block.__waygraphNavUrl;
215
+ if (!url)
216
+ continue;
217
+ try {
218
+ knownPathnames.push(new URL(url, this.page.url()).pathname);
219
+ }
220
+ catch {
221
+ /* not a resolvable URL (relative to an unset base, etc.) - skip */
222
+ }
223
+ }
224
+ const payload = {
225
+ knownPathnames,
226
+ knownSelectors: this.knownInteractionSelectors,
227
+ };
228
+ await this.page.evaluate(unmappedInteractionsPageScript, payload).catch(() => { });
229
+ }
230
+ /** Pure getter - no Block runs, no mem/page mutation. */
231
+ async currentSnapshot() {
232
+ const menu = await this.currentMenu();
233
+ return buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote);
234
+ }
235
+ /**
236
+ * Pure getter - reads the live page's structure at the requested fidelity.
237
+ * No Block runs, no mem/page mutation. `selector` scopes either mode to one
238
+ * element's subtree; it is a modifier, not a third mode.
239
+ */
240
+ async inspectDom(opts) {
241
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
242
+ const mode = opts.mode ?? "aria";
243
+ const ariaOptions = opts.depth !== undefined ? { mode: "ai", depth: opts.depth } : { mode: "ai" };
244
+ if (opts.selector) {
245
+ const locator = this.page.locator(opts.selector).first();
246
+ if ((await locator.count()) === 0) {
247
+ return { ok: false, error: `no element matches selector "${opts.selector}"` };
248
+ }
249
+ await showPilotVision(this.page, opts.selector, `dom (${mode}): ${opts.selector}`, "orange");
250
+ if (mode === "full") {
251
+ const caps = {
252
+ depth: opts.depth ?? FULL_MODE_DEFAULT_DEPTH,
253
+ maxNodes: FULL_MODE_MAX_NODES,
254
+ maxTextLength: FULL_MODE_MAX_TEXT_LENGTH,
255
+ };
256
+ const { tree, truncated } = await locator.evaluate(walkFullDom, caps);
257
+ return { ok: true, snapshot: { mode: "full", selector: opts.selector, truncated, tree } };
258
+ }
259
+ const tree = await locator.ariaSnapshotJSON(ariaOptions);
260
+ return { ok: true, snapshot: { mode: "aria", selector: opts.selector, truncated: false, tree } };
261
+ }
262
+ await showPilotActivity(this.page, `Running (Dom): ${mode}, whole page`);
263
+ if (mode === "full") {
264
+ // page.evaluate only ships the one function passed to it - it can't
265
+ // reach another named function by closure. Routing the whole-page case
266
+ // through the same `html` Locator lets both cases share one
267
+ // self-contained walkFullDom instead of two near-duplicate callbacks.
268
+ const caps = {
269
+ depth: opts.depth ?? FULL_MODE_DEFAULT_DEPTH,
270
+ maxNodes: FULL_MODE_MAX_NODES,
271
+ maxTextLength: FULL_MODE_MAX_TEXT_LENGTH,
272
+ };
273
+ const { tree, truncated } = await this.page.locator("html").first().evaluate(walkFullDom, caps);
274
+ return { ok: true, snapshot: { mode: "full", truncated, tree } };
275
+ }
276
+ const tree = await this.page.ariaSnapshotJSON(ariaOptions);
277
+ return { ok: true, snapshot: { mode: "aria", truncated: false, tree } };
278
+ }
279
+ /**
280
+ * Pure getter - reads the live page's client-side state: localStorage,
281
+ * sessionStorage, and registered service workers (scope/active URL/state).
282
+ * Real, direct follow-up to `auto console`'s own gap: a site doing web
283
+ * push (this target has a real `NOTIFICATION_VAPID` config, confirmed via
284
+ * `auto dom` earlier) keeps push-subscription/auth state in these places,
285
+ * not in the rendered DOM `inspectDom` reads.
286
+ */
287
+ async inspectStorage() {
288
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
289
+ const [localStorageEntries, sessionStorageEntries] = await this.page.evaluate(() => [
290
+ Object.entries(window.localStorage),
291
+ Object.entries(window.sessionStorage),
292
+ ]);
293
+ const cookies = await this.context.cookies();
294
+ const workers = this.context.serviceWorkers();
295
+ const registrations = await this.page
296
+ .evaluate(async () => {
297
+ if (!("serviceWorker" in navigator))
298
+ return [];
299
+ const regs = await navigator.serviceWorker.getRegistrations();
300
+ return regs.map((r) => ({
301
+ scope: r.scope,
302
+ ...(r.active?.scriptURL ? { activeUrl: r.active.scriptURL } : {}),
303
+ ...(r.active?.state ? { state: r.active.state } : {}),
304
+ }));
305
+ })
306
+ .catch(() => []);
307
+ return {
308
+ localStorage: Object.fromEntries(localStorageEntries),
309
+ sessionStorage: Object.fromEntries(sessionStorageEntries),
310
+ cookies: cookies.map((c) => ({
311
+ name: c.name,
312
+ value: c.value,
313
+ domain: c.domain,
314
+ path: c.path,
315
+ httpOnly: c.httpOnly,
316
+ secure: c.secure,
317
+ })),
318
+ serviceWorkers: workers.map((w) => w.url()),
319
+ serviceWorkerRegistrations: registrations,
320
+ };
321
+ }
322
+ /**
323
+ * Runs one already-resolved Block entry for real - the shared core both
324
+ * `applyPick` (resolved via a live-menu index) and `applyPath` (resolved
325
+ * directly by name, bypassing live-menu-visibility entirely - see
326
+ * `applyPath`'s own comment for why) call. `expectedTo` is only used as a
327
+ * fallback when a Block's own `resolve()` doesn't set `__state` - same
328
+ * behavior `applyPick` always had, just factored out, not changed.
329
+ */
330
+ async runNamedBlock(entry, expectedTo, instanceOption) {
331
+ const from = this.here;
332
+ const stubBeforeResult = await runStubPhase(entry.block, "stubBefore");
333
+ const stepBase = {
334
+ block: entry.block.name,
335
+ from,
336
+ timestamp: new Date().toISOString(),
337
+ ...(stubPhaseHasContent(stubBeforeResult) ? { stubBefore: stubBeforeResult } : {}),
338
+ };
339
+ try {
340
+ if (instanceOption) {
341
+ this.mem.set(instanceOption.key, instanceOption.value);
342
+ }
343
+ // Always the non-interactive path (cli: false) - a detached session has
344
+ // no TTY to prompt on; a missing mem key fails loud instead of hanging.
345
+ await ensureMem(entry, this.mem, false);
346
+ const result = await runOneBlock(this.engine, entry, this.context, this.page, this.mem, false);
347
+ this.here = result.__state ?? expectedTo;
348
+ this.lastRunNote = `${entry.block.name} -> ${this.here}`;
349
+ const stubAfterResult = await runStubPhase(entry.block, "stubAfter", { out: result });
350
+ this.pushTrace({
351
+ ...stepBase,
352
+ to: this.here,
353
+ ...(stubPhaseHasContent(stubAfterResult) ? { stubAfter: stubAfterResult } : {}),
354
+ });
355
+ }
356
+ catch (err) {
357
+ this.lastRunNote = `${entry.block.name} failed`;
358
+ const message = err instanceof Error ? err.message : String(err);
359
+ const stubOnErrorResult = await runStubPhase(entry.block, "stubOnError", { error: err });
360
+ this.pushTrace({
361
+ ...stepBase,
362
+ error: message,
363
+ ...(stubPhaseHasContent(stubOnErrorResult) ? { stubOnError: stubOnErrorResult } : {}),
364
+ });
365
+ return { ok: false, error: `${entry.block.name} failed - ${message}` };
366
+ }
367
+ const nextMenu = await this.currentMenu();
368
+ return {
369
+ ok: true,
370
+ snapshot: buildSessionSnapshot(nextMenu, this.library.byName, this.here, this.lastRunNote),
371
+ quit: false,
372
+ };
373
+ }
374
+ /** Applies exactly one pick: runs at most one Block, returns the resulting state. */
375
+ async applyPick(raw) {
376
+ const menu = await this.currentMenu();
377
+ const pick = parsePick(raw, menu);
378
+ if (pick.type === "invalid")
379
+ return { ok: false, error: pick.reason };
380
+ if (pick.type === "quit") {
381
+ return {
382
+ ok: true,
383
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
384
+ quit: true,
385
+ };
386
+ }
387
+ const edge = menu.flat[pick.index];
388
+ const entry = this.library.byName.get(edge.block);
389
+ if (!entry) {
390
+ return { ok: false, error: `Block "${edge.block}" not loaded - skipped` };
391
+ }
392
+ await showPilotActivity(this.page, `Running (Block): ${edge.block}`);
393
+ return this.runNamedBlock(entry, edge.to, edge.instanceOption);
394
+ }
395
+ /**
396
+ * Re-discovers the project's Block library and graph from disk, using the
397
+ * exact same call `start()` itself makes - not a duplicated read - and
398
+ * replaces `this.library`/`this.graph` in place. Leaves the live page,
399
+ * mem, browser/context, and current Checkpoint (`here`) untouched, so a
400
+ * Block written to disk mid-session becomes pickable via a later
401
+ * `applyPick` without restarting the session. See
402
+ * openspec/changes/waygraph-blind-pilot/design.md.
403
+ */
404
+ async reloadLibrary() {
405
+ if (this.page)
406
+ await showPilotActivity(this.page, "Running: reload");
407
+ const exploreOpts = {
408
+ ...(this.blocksSelect ? { blocksSelect: this.blocksSelect } : {}),
409
+ ...(this.inject?.length ? { inject: this.inject } : {}),
410
+ };
411
+ const { graph, library } = await buildExploreContext(this.projectDir, Object.keys(exploreOpts).length ? exploreOpts : undefined);
412
+ this.graph = graph;
413
+ this.library = library;
414
+ if (this.page)
415
+ await showPilotActivity(this.page, "Map updated");
416
+ }
417
+ /**
418
+ * Forces `here` to be re-detected from the real live page, discarding
419
+ * whatever was cached - the fix for a real, confirmed gap: `here` is only
420
+ * ever updated by an action this class itself ran (`applyPick`/`applyPath`
421
+ * set it to a Block's own resolved Checkpoint; `rawClick`/`rawType`/
422
+ * `rawGoto` reset it to `null` because *they* just changed the page). If a
423
+ * human co-driving the same visible session clicks/types/navigates
424
+ * directly - a real scenario for a headful Pilot session someone is
425
+ * watching, not hypothetical - none of that goes through this class at
426
+ * all, so `here` silently goes stale: `currentMenu()`'s own lazy check
427
+ * (`if (this.here === null)`, just above) only re-detects when `here` is
428
+ * already unknown, never to confirm a *known* value is still correct.
429
+ * This does not crash the session (the process/socket/page all stay
430
+ * alive) but subsequent `send`/`reach` calls would act on a menu built
431
+ * from the wrong Checkpoint until something forces re-detection - this
432
+ * method is that: unconditionally re-run the same `detectHere` logic the
433
+ * lazy path already uses, regardless of what `here` currently holds.
434
+ */
435
+ async resync() {
436
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
437
+ await showPilotActivity(this.page, "Running: resync");
438
+ this.here = await detectHere(this.page, this.library.navBlocks);
439
+ const menu = await this.currentMenu();
440
+ this.lastRunNote = `resync -> ${this.here ?? "Unknown"}`;
441
+ return {
442
+ ok: true,
443
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
444
+ quit: false,
445
+ };
446
+ }
447
+ /**
448
+ * Raw interaction primitives for a page no Block covers yet (Blind Pilot -
449
+ * see openspec/changes/waygraph-blind-pilot). Unlike `applyPick`, the
450
+ * resulting Checkpoint isn't known ahead of time from a Block's own
451
+ * `resolve()`, so each of these invalidates the cached `here` (forcing
452
+ * `currentMenu()`'s existing lazy `detectHere` call to run again) rather
453
+ * than assuming the page didn't move anywhere a Block now recognizes.
454
+ * A selector matching nothing is a reported failure, not a silent no-op.
455
+ */
456
+ async rawClick(selector) {
457
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
458
+ await showPilotActivity(this.page, `Running (no Block): click "${selector}"`);
459
+ const locator = this.page.locator(selector).first();
460
+ if ((await locator.count()) === 0) {
461
+ return { ok: false, error: `no element matches selector "${selector}"` };
462
+ }
463
+ await showPilotVision(this.page, selector, `click: ${selector}`);
464
+ await locator.click();
465
+ this.here = null;
466
+ const menu = await this.currentMenu();
467
+ this.lastRunNote = `click "${selector}" -> ${this.here ?? "Unknown"}`;
468
+ return {
469
+ ok: true,
470
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
471
+ quit: false,
472
+ };
473
+ }
474
+ async rawType(selector, text) {
475
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
476
+ await showPilotActivity(this.page, `Running (no Block): type into "${selector}"`);
477
+ const locator = this.page.locator(selector).first();
478
+ if ((await locator.count()) === 0) {
479
+ return { ok: false, error: `no element matches selector "${selector}"` };
480
+ }
481
+ await showPilotVision(this.page, selector, `type: ${selector}`);
482
+ await locator.fill(text);
483
+ this.here = null;
484
+ const menu = await this.currentMenu();
485
+ this.lastRunNote = `type into "${selector}" -> ${this.here ?? "Unknown"}`;
486
+ return {
487
+ ok: true,
488
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
489
+ quit: false,
490
+ };
491
+ }
492
+ /**
493
+ * Presses a real key on a real focused element - a real gap found live:
494
+ * many real inline-edit inputs (no visible Save button at all) commit on
495
+ * Enter, not on blur/click-elsewhere. `key` is a Playwright key name
496
+ * (e.g. "Enter", "Escape", "Tab") - same vocabulary as
497
+ * `page.keyboard.press`, which this wraps.
498
+ */
499
+ async rawPress(selector, key) {
500
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
501
+ await showPilotActivity(this.page, `Running (no Block): press "${key}" on "${selector}"`);
502
+ const locator = this.page.locator(selector).first();
503
+ if ((await locator.count()) === 0) {
504
+ return { ok: false, error: `no element matches selector "${selector}"` };
505
+ }
506
+ await showPilotVision(this.page, selector, `press ${key}: ${selector}`);
507
+ await locator.press(key);
508
+ this.here = null;
509
+ const menu = await this.currentMenu();
510
+ this.lastRunNote = `press "${key}" on "${selector}" -> ${this.here ?? "Unknown"}`;
511
+ return {
512
+ ok: true,
513
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
514
+ quit: false,
515
+ };
516
+ }
517
+ async rawGoto(url) {
518
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
519
+ await showPilotActivity(this.page, `Running (no Block): goto "${url}"`);
520
+ try {
521
+ await this.page.goto(url, { waitUntil: "domcontentloaded" });
522
+ }
523
+ catch (err) {
524
+ return { ok: false, error: `goto "${url}" failed - ${err instanceof Error ? err.message : String(err)}` };
525
+ }
526
+ this.here = null;
527
+ const menu = await this.currentMenu();
528
+ this.lastRunNote = `goto "${url}" -> ${this.here ?? "Unknown"}`;
529
+ return {
530
+ ok: true,
531
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
532
+ quit: false,
533
+ };
534
+ }
535
+ /**
536
+ * Fills a real `<input type="file">` - a built-in stub kind
537
+ * ("image"/"pdf"/"video", see `stubFilePath`) or a caller-supplied
538
+ * `filePath` for anything else ("whatever", per the real request this
539
+ * responds to). Same raw-primitive shape as click/type/goto: works with
540
+ * zero Blocks, invalidates `here` since the app may react to the upload.
541
+ */
542
+ async rawUpload(selector, stub) {
543
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
544
+ const filePath = typeof stub === "string" ? stubFilePath(stub) : stub.filePath;
545
+ const label = typeof stub === "string" ? stub : filePath;
546
+ await showPilotActivity(this.page, `Running (no Block): upload ${label} into "${selector}"`);
547
+ const locator = this.page.locator(selector).first();
548
+ if ((await locator.count()) === 0) {
549
+ return { ok: false, error: `no element matches selector "${selector}"` };
550
+ }
551
+ await showPilotVision(this.page, selector, `upload ${label}: ${selector}`);
552
+ try {
553
+ await locator.setInputFiles(filePath);
554
+ }
555
+ catch (err) {
556
+ return { ok: false, error: `upload into "${selector}" failed - ${err instanceof Error ? err.message : String(err)}` };
557
+ }
558
+ this.here = null;
559
+ const menu = await this.currentMenu();
560
+ this.lastRunNote = `upload ${label} into "${selector}" -> ${this.here ?? "Unknown"}`;
561
+ return {
562
+ ok: true,
563
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
564
+ quit: false,
565
+ };
566
+ }
567
+ /**
568
+ * Agent-sent highlight fixtures (rings + optional todos) on the live page -
569
+ * the Pilot equivalent of Block `stubBefore` narration in `waygraph demo`.
570
+ * Does not run a Block; paint-only. Missing selectors are reported, not fatal.
571
+ */
572
+ async applyHighlight(fixtures) {
573
+ this.page = await ensureLivePage(this.context, this.page, this.startUrl);
574
+ const detail = fixtures.clear === true
575
+ ? "clear"
576
+ : [
577
+ fixtures.rings?.length ? `${fixtures.rings.length} ring(s)` : null,
578
+ fixtures.todos?.length ? `${fixtures.todos.length} todo(s)` : null,
579
+ fixtures.zoom && fixtures.zoom > 1.001 ? `zoom ${fixtures.zoom}` : null,
580
+ fixtures.device
581
+ ? `device ${typeof fixtures.device === "string" ? fixtures.device : fixtures.device.preset || "custom"}`
582
+ : null,
583
+ fixtures.rings?.some((r) => r.focus) ? "focus" : null,
584
+ ]
585
+ .filter(Boolean)
586
+ .join(", ") || "fixtures";
587
+ // Same bottom-left activity toast as Running (Dom)/(Block) - agent narration.
588
+ await showPilotActivity(this.page, `Highlighting: ${detail}`);
589
+ try {
590
+ const { painted, missing } = await showPilotFixtures(this.page, fixtures);
591
+ const menu = await this.currentMenu();
592
+ this.lastRunNote = fixtures.clear
593
+ ? "highlight cleared"
594
+ : `highlight painted ${painted}` +
595
+ (missing.length ? ` (missing: ${missing.join(", ")})` : "");
596
+ return {
597
+ ok: true,
598
+ painted,
599
+ missing,
600
+ snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
601
+ };
602
+ }
603
+ catch (err) {
604
+ return {
605
+ ok: false,
606
+ error: `highlight failed - ${err instanceof Error ? err.message : String(err)}`,
607
+ };
608
+ }
609
+ }
610
+ /**
611
+ * Runs a whole multi-step route to `targetCheckpoint` in one call, instead
612
+ * of an agent hand-picking one index at a time across many separate
613
+ * `applyPick` round trips - real, reported pain for any non-trivial task
614
+ * on a rich graph ("the entire prompts of the day" driving one step per
615
+ * call).
616
+ *
617
+ * Two other designs were tried and rejected by direct reproduction against
618
+ * live saucedemo.com before this one, both undone by the same root cause:
619
+ * a `from: "*"` edge (e.g. "Checkout", only clickable once you're actually
620
+ * on the cart page with items) looks globally reachable to
621
+ * `findBlockPath`'s static-graph BFS, which has no live-page access and
622
+ * can't know the edge's real precondition isn't showing yet. Computing the
623
+ * whole route once upfront names a premature wildcard step immediately;
624
+ * scoring each live menu option by its static-graph distance to the
625
+ * target (greedy best-first) doesn't fix it either - a harmless self-loop
626
+ * Method can score just as well as real progress once wildcard "shortcuts"
627
+ * are baked into every distance calculation, and the session gets stuck
628
+ * repeating it.
629
+ *
630
+ * The fix that actually works: stop trying to be clever about live-menu
631
+ * visibility per step, and reuse `auto --blocks <From> <To>`'s own already
632
+ * -proven approach instead - compute the path ONCE (via
633
+ * `findBlockPathDetailed`, the same BFS `findBlockPath`/`runChainAuto`
634
+ * already use, extended to also return each hop's specific edge - see its
635
+ * own doc comment for why that extra detail is load-bearing, not cosmetic),
636
+ * then run each Block in it directly via `runNamedBlock`, trusting the
637
+ * graph the same way `runChain`'s own flow execution already does, not
638
+ * gated on live-menu visibility at all. The one real difference from
639
+ * `runChainAuto`: this runs against the session's own already-live
640
+ * page/context/mem, not a freshly spawned browser - the whole point of
641
+ * staying in one session. A step whose real precondition genuinely isn't
642
+ * met still fails loud, naming that step, exactly the way a mis-ordered
643
+ * `runChain` spec would - and a step that runs without throwing but lands
644
+ * somewhere other than what its own edge promised (a real, observed case,
645
+ * not hypothetical - see this method's own test suite) fails loud too,
646
+ * rather than reporting false success.
647
+ */
648
+ async applyPath(targetCheckpoint) {
649
+ await this.currentMenu();
650
+ const from = this.here;
651
+ if (from === null) {
652
+ return { ok: false, error: "cannot path-find: the session's current Checkpoint is unknown (here is null)" };
653
+ }
654
+ const path = findBlockPathDetailed(this.graph, from, targetCheckpoint);
655
+ if (!path) {
656
+ return { ok: false, error: `no Block path from "${from}" to "${targetCheckpoint}" in the discovered graph` };
657
+ }
658
+ for (const step of path) {
659
+ const entry = this.library.byName.get(step.block);
660
+ if (!entry) {
661
+ return { ok: false, error: `path step "${step.block}" is in the discovered graph but not loaded in this session's library` };
662
+ }
663
+ if (entry.block.instanceOptions) {
664
+ return {
665
+ ok: false,
666
+ error: `path step "${step.block}" needs a specific live option chosen (an instanceOptions Block, e.g. one per product) - ambiguous for automatic routing, use applyPick directly with the specific index`,
667
+ };
668
+ }
669
+ if (this.page)
670
+ await showPilotActivity(this.page, `Running (Block): ${step.block} (reach -> ${targetCheckpoint})`);
671
+ const result = await this.runNamedBlock(entry, step.to);
672
+ if (!result.ok) {
673
+ return { ok: false, error: `step "${step.block}" failed - ${result.error}` };
674
+ }
675
+ // A Block can resolve to a DIFFERENT real Checkpoint than this exact
676
+ // hop's own edge expected, without throwing at all - e.g.
677
+ // submit-login's own resolve() legitimately "stays on LoginPage" on
678
+ // bad auth instead of erroring. Trusting `result.ok` alone would
679
+ // silently report success while sitting on the wrong page - a real
680
+ // bug caught by this method's own test suite, not theoretical.
681
+ // `step.to` (not a name-based re-lookup - a union-Out Block can have
682
+ // several edges sharing one name with different `to` tags) is exactly
683
+ // the Checkpoint THIS hop's own edge in the computed route promised.
684
+ if (this.here !== step.to) {
685
+ return {
686
+ ok: false,
687
+ error: `step "${step.block}" ran but landed on "${this.here}", not the expected "${step.to}" - it did not throw, but did not make the expected progress either`,
688
+ };
689
+ }
690
+ }
691
+ return { ok: true, path: path.map((s) => s.block), snapshot: await this.currentSnapshot() };
692
+ }
693
+ async close() {
694
+ await this.context.close();
695
+ await this.browser.close();
696
+ }
697
+ }