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
@@ -1,843 +1,3 @@
1
- import { dirname, join, resolve } from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { Engine } from "./engine.js";
4
- import { MemPage } from "./mem-page.js";
5
- import { buildExploreContext, buildExploreMenu, } from "./auto-explore.js";
6
- import { ensureLivePage, detectHere, seedDefaultMem, ensureMem, runOneBlock, resolveBaseUrl, } from "./auto-explore-run.js";
7
- import { runStubPhase } from "./highlights.js";
8
- import { findBlockPathDetailed } from "./graph.js";
9
- import { updatePilotOverlay, showPilotActivity, showPilotVision, showPilotFixtures, installPersistentPilotOverlay, } from "./pilot-overlay.js";
10
- import { collectKnownInteractionSelectors, unmappedInteractionsPageScript, } from "./coverage-gap.js";
11
- /** True when a stub-phase result actually carries authored content worth keeping. */
12
- function stubPhaseHasContent(r) {
13
- return (Object.keys(r.highlights).length > 0 ||
14
- r.todos.length > 0 ||
15
- r.device !== undefined ||
16
- r.todoDock !== undefined);
17
- }
18
- /** Plain, JSON-serializable view of a menu - no Block/MemKey/class references. */
19
- export function buildSessionSnapshot(menu, library, here, lastRunNote) {
20
- let n = 0;
21
- const sections = menu.sections.map((section) => ({
22
- title: section.title,
23
- edges: section.edges.map((edge) => {
24
- n++;
25
- const entry = library.get(edge.block);
26
- return {
27
- index: n,
28
- block: edge.block,
29
- kind: edge.kind,
30
- to: edge.to,
31
- ...(edge.label ? { label: edge.label } : {}),
32
- ...(entry?.description ? { description: entry.description } : {}),
33
- };
34
- }),
35
- }));
36
- return { here, sections, done: menu.flat.length === 0, lastRunNote };
37
- }
38
- /**
39
- * Same number/`q`/range rules `cliPick` already applies, but returning a
40
- * result instead of looping to re-prompt - one request gets one answer.
41
- * Also accepts a Block name (exact, case-sensitive) as a shorthand for its
42
- * menu index - `send <id> "submit-login"` instead of hunting the number.
43
- * Ambiguous (the same Block name appearing more than once in one menu)
44
- * refuses rather than guessing which occurrence was meant - a pick runs a
45
- * real browser action, not something to silently get wrong.
46
- */
47
- export function parsePick(raw, menu) {
48
- const ans = raw.trim();
49
- const lower = ans.toLowerCase();
50
- if (lower === "q" || lower === "quit")
51
- return { type: "quit" };
52
- const n = Number(lower);
53
- if (Number.isInteger(n) && n >= 1 && n <= menu.flat.length) {
54
- return { type: "pick", index: n - 1 };
55
- }
56
- const matches = [];
57
- menu.flat.forEach((edge, i) => {
58
- if (edge.block === ans)
59
- matches.push(i);
60
- });
61
- if (matches.length === 1) {
62
- return { type: "pick", index: matches[0] };
63
- }
64
- if (matches.length > 1) {
65
- return {
66
- type: "invalid",
67
- reason: `"${raw}" matches ${matches.length} menu entries - use the numeric index instead of the Block name`,
68
- };
69
- }
70
- return {
71
- type: "invalid",
72
- reason: `"${raw}" is not a valid pick - enter a number from 1 to ${menu.flat.length}, a Block name, or "q" to quit`,
73
- };
74
- }
75
- const FULL_MODE_DEFAULT_DEPTH = 12;
76
- const FULL_MODE_MAX_NODES = 800;
77
- const FULL_MODE_MAX_TEXT_LENGTH = 300;
78
- /** Runs entirely inside the browser (page.evaluate) - no closures over outer TS state. */
79
- function walkFullDom(root, caps) {
80
- let count = 0;
81
- let truncated = false;
82
- function walk(el, depth) {
83
- if (depth > caps.depth) {
84
- truncated = true;
85
- return null;
86
- }
87
- if (count >= caps.maxNodes) {
88
- truncated = true;
89
- return null;
90
- }
91
- count++;
92
- const node = { tag: el.tagName.toLowerCase() };
93
- const attrs = {};
94
- for (const a of Array.from(el.attributes))
95
- attrs[a.name] = a.value;
96
- if (Object.keys(attrs).length > 0)
97
- node.attrs = attrs;
98
- const directText = Array.from(el.childNodes)
99
- .filter((n) => n.nodeType === 3)
100
- .map((n) => n.textContent ?? "")
101
- .join("")
102
- .trim();
103
- if (directText) {
104
- node.text =
105
- directText.length > caps.maxTextLength
106
- ? directText.slice(0, caps.maxTextLength) + "..."
107
- : directText;
108
- }
109
- const children = [];
110
- for (const child of Array.from(el.children)) {
111
- if (count >= caps.maxNodes) {
112
- truncated = true;
113
- break;
114
- }
115
- const c = walk(child, depth + 1);
116
- if (c)
117
- children.push(c);
118
- }
119
- if (children.length > 0)
120
- node.children = children;
121
- return node;
122
- }
123
- const tree = walk(root, 0) ?? { tag: root.tagName.toLowerCase() };
124
- return { tree, truncated };
125
- }
126
- const TRACE_MAX_STEPS = 500;
127
- /**
128
- * Real, minimal, valid fixture files bundled at `assets/stubs/` - not
129
- * placeholder/renamed-empty files: `stub.png` is a real 1x1 PNG,
130
- * `stub.pdf` a real single-page PDF, `stub.mp4` a real ffmpeg-encoded
131
- * 1s black clip. Real, direct user request: Blind Pilot hitting a real
132
- * `<input type="file">` (e.g. an avatar upload) had no way to supply
133
- * anything without a human handing over a real file each time - these are
134
- * small enough to ship in the package and pass most apps' basic file-type
135
- * checks (magic bytes, not just extension).
136
- */
137
- /**
138
- * Public so a Block a consumer writes can reach the same real fixture files
139
- * `rawUpload` uses - not just the raw primitive. Needed when a real upload
140
- * flow has no stable `<input type="file">` to hand a selector to at all
141
- * (e.g. one created on the fly inside a click handler, then immediately
142
- * `.click()`'d to open the OS picker and possibly torn down right after) -
143
- * a Block's own `act()` should pair this with `page.waitForEvent("filechooser")`
144
- * around the triggering click, not go hunting for a selector that may not
145
- * exist for more than a moment.
146
- */
147
- export function stubFilePath(kind) {
148
- const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
149
- const names = {
150
- image: "stub.png",
151
- pdf: "stub.pdf",
152
- video: "stub.mp4",
153
- };
154
- return join(packageRoot, "assets", "stubs", names[kind]);
155
- }
156
- const CONSOLE_LOG_MAX_ENTRIES = 200;
157
- /**
158
- * Non-interactive explore session: same graph/library/mem/browser setup
159
- * `runAutoExplore` runs in `--cli` mode, driven by `applyPick` instead of a
160
- * blocking `readline` loop. Headless by default (matching
161
- * `runAutoExplore`'s own `cli` branch), optionally visible via
162
- * `AutoSessionInit.headless: false` - this type only ever backs the `--cli`
163
- * picker, never the headful page-embedded panel, headless or not.
164
- */
165
- export class AutoSession {
166
- projectDir;
167
- inject;
168
- blocksSelect;
169
- graph;
170
- library;
171
- mem;
172
- engine;
173
- browser;
174
- context;
175
- page;
176
- startUrl;
177
- sessionId;
178
- here = null;
179
- lastRunNote = null;
180
- trace = [];
181
- consoleLog = [];
182
- knownInteractionSelectors;
183
- headless;
184
- lastOverlayInfo = null;
185
- constructor(projectDir, inject, blocksSelect, graph, library, mem, engine, browser, context, page, startUrl, sessionId, knownInteractionSelectors, headless) {
186
- this.projectDir = projectDir;
187
- this.inject = inject;
188
- this.blocksSelect = blocksSelect;
189
- this.graph = graph;
190
- this.library = library;
191
- this.mem = mem;
192
- this.engine = engine;
193
- this.browser = browser;
194
- this.context = context;
195
- this.page = page;
196
- this.startUrl = startUrl;
197
- this.sessionId = sessionId;
198
- this.knownInteractionSelectors = knownInteractionSelectors;
199
- this.headless = headless;
200
- }
201
- static async start(init) {
202
- const baseURL = init.baseURL ?? resolveBaseUrl(init.projectDir);
203
- const skipNav = init.skipInitialNavigation === true;
204
- const startUrl = skipNav ? undefined : (init.startUrl ?? baseURL);
205
- const exploreOpts = {
206
- ...(init.blocksSelect ? { blocksSelect: init.blocksSelect } : {}),
207
- ...(init.inject?.length ? { inject: init.inject } : {}),
208
- };
209
- const { graph, library } = await buildExploreContext(init.projectDir, Object.keys(exploreOpts).length ? exploreOpts : undefined);
210
- const mem = new MemPage();
211
- seedDefaultMem(library.byName, mem);
212
- const headless = init.headless ?? true;
213
- const engine = new Engine({ headless });
214
- const { chromium } = await import("@playwright/test");
215
- const executablePath = process.env.CHROME_PATH || process.env.CHROMIUM_PATH;
216
- // Real gap found live: a headed (--non-headless) session kept a fixed
217
- // 1280x720 content area even when the user maximized/fullscreened the
218
- // actual window - `viewport: null` alone only makes the PAGE track the
219
- // window; the window itself still launches at Chromium's own small
220
- // default size unless told to start maximized. Same fix cli.ts's own
221
- // --step/headed launch already uses (see its own comment there) -
222
- // headless keeps the fixed viewport since there's no real window to size.
223
- const launchOpts = {
224
- headless,
225
- // Keep Playwright's default --no-startup-window for headful: without it
226
- // Chromium opens its own "New Tab" window AND our context.newPage() opens
227
- // a second about:blank window. bringToFront() below surfaces the real page.
228
- args: headless ? [] : ["--start-maximized"],
229
- };
230
- if (executablePath)
231
- launchOpts.executablePath = executablePath;
232
- const browser = await chromium.launch(launchOpts);
233
- const contextOpts = {
234
- viewport: headless ? { width: 1280, height: 720 } : null,
235
- };
236
- if (baseURL)
237
- contextOpts.baseURL = baseURL;
238
- const context = await browser.newContext(contextOpts);
239
- await installPersistentPilotOverlay(context);
240
- const page = await context.newPage();
241
- if (startUrl) {
242
- await page.goto(startUrl, { waitUntil: "domcontentloaded" }).catch(() => { });
243
- await page.waitForLoadState("load").catch(() => { });
244
- }
245
- else {
246
- await page.goto("about:blank").catch(() => { });
247
- }
248
- const knownInteractionSelectors = collectKnownInteractionSelectors(init.projectDir, library, init.inject);
249
- const session = new AutoSession(init.projectDir, init.inject, init.blocksSelect, graph, library, mem, engine, browser, context, page, startUrl, init.sessionId, knownInteractionSelectors, headless);
250
- page.on("load", () => {
251
- void session.repaintOverlayAfterNavigation();
252
- });
253
- if (!headless) {
254
- await session.bootstrapOverlay().catch(() => { });
255
- await page.bringToFront().catch(() => { });
256
- }
257
- // Attached once, on the page created here - `ensureLivePage` only swaps
258
- // to a fresh Page if the current one closed (a rare case, e.g. the human
259
- // closing the tab), not on ordinary same-page SPA navigation, which is
260
- // all this target (and most real sites) actually do.
261
- page.on("console", (msg) => {
262
- session.pushConsoleLog({
263
- type: "console",
264
- level: msg.type(),
265
- text: msg.text(),
266
- timestamp: new Date().toISOString(),
267
- });
268
- });
269
- page.on("pageerror", (err) => {
270
- session.pushConsoleLog({
271
- type: "pageerror",
272
- text: err instanceof Error ? err.message : String(err),
273
- timestamp: new Date().toISOString(),
274
- });
275
- });
276
- page.on("response", (res) => {
277
- // Every failed response (the original case), PLUS every mutation
278
- // (non-GET) response regardless of status - a real gap found live:
279
- // "auto console" only logging failures made a SUCCESSFUL POST that
280
- // simply didn't navigate anywhere look identical to "nothing
281
- // happened at all," undiagnosable the same way a real failure was.
282
- // A mutation's outcome (2xx or not) is always diagnostically
283
- // relevant; a GET's usually isn't (assets, trackers) unless it failed.
284
- const method = res.request().method();
285
- if (res.status() < 400 && method === "GET")
286
- return;
287
- session.pushConsoleLog({
288
- type: "response",
289
- text: `${method} ${res.statusText()}`,
290
- url: res.url(),
291
- status: res.status(),
292
- timestamp: new Date().toISOString(),
293
- });
294
- });
295
- return session;
296
- }
297
- /** Pure getter - returns a copy, not the live array. */
298
- getTrace() {
299
- return [...this.trace];
300
- }
301
- pushTrace(step) {
302
- this.trace.push(step);
303
- if (this.trace.length > TRACE_MAX_STEPS)
304
- this.trace.shift();
305
- }
306
- /** Pure getter - returns a copy, not the live array. */
307
- getConsoleLog() {
308
- return [...this.consoleLog];
309
- }
310
- pushConsoleLog(entry) {
311
- this.consoleLog.push(entry);
312
- if (this.consoleLog.length > CONSOLE_LOG_MAX_ENTRIES)
313
- this.consoleLog.shift();
314
- }
315
- async currentMenu() {
316
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
317
- if (this.here === null) {
318
- this.here = await detectHere(this.page, this.library.navBlocks);
319
- }
320
- const menu = await buildExploreMenu(this.page, this.graph, this.library, this.here);
321
- // Every caller of currentMenu() (status reads, applyPick/applyPath,
322
- // the raw click/type/goto primitives, resync) already routes through
323
- // here, so hooking the overlay refresh at this one point covers every
324
- // real state-changing (and reading) path without needing a separate
325
- // call at each site. Awaited deliberately, not fire-and-forget - the
326
- // whole point is a human watching the screen sees the SAME state a
327
- // concurrent API caller just got back, not a stale frame that catches
328
- // up moments later.
329
- this.lastOverlayInfo = {
330
- sessionId: this.sessionId,
331
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
332
- graph: this.graph,
333
- };
334
- await updatePilotOverlay(this.page, this.lastOverlayInfo);
335
- await this.warnUnmappedInteractions();
336
- return menu;
337
- }
338
- /** Paint the overlay on about:blank / immediately after session start (headful browser). */
339
- async bootstrapOverlay() {
340
- await this.currentMenu();
341
- }
342
- /** Re-apply cached overlay state after navigation (init script restores shell only). */
343
- async repaintOverlayAfterNavigation() {
344
- if (this.lastOverlayInfo) {
345
- await updatePilotOverlay(this.page, this.lastOverlayInfo).catch(() => { });
346
- return;
347
- }
348
- if (!this.headless) {
349
- await this.bootstrapOverlay().catch(() => { });
350
- }
351
- }
352
- /**
353
- * Flags same-origin `<a href>` paths and visible buttons with no NavBlock
354
- * URL / Block selector in the loaded library — read via `auto console`.
355
- * Deduped per page load so repeated status/send calls stay quiet.
356
- */
357
- async warnUnmappedInteractions() {
358
- const knownPathnames = [];
359
- for (const entry of this.library.navBlocks) {
360
- const url = entry.block.__waygraphNavUrl;
361
- if (!url)
362
- continue;
363
- try {
364
- knownPathnames.push(new URL(url, this.page.url()).pathname);
365
- }
366
- catch {
367
- /* not a resolvable URL (relative to an unset base, etc.) - skip */
368
- }
369
- }
370
- const payload = {
371
- knownPathnames,
372
- knownSelectors: this.knownInteractionSelectors,
373
- };
374
- await this.page.evaluate(unmappedInteractionsPageScript, payload).catch(() => { });
375
- }
376
- /** Pure getter - no Block runs, no mem/page mutation. */
377
- async currentSnapshot() {
378
- const menu = await this.currentMenu();
379
- return buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote);
380
- }
381
- /**
382
- * Pure getter - reads the live page's structure at the requested fidelity.
383
- * No Block runs, no mem/page mutation. `selector` scopes either mode to one
384
- * element's subtree; it is a modifier, not a third mode.
385
- */
386
- async inspectDom(opts) {
387
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
388
- const mode = opts.mode ?? "aria";
389
- const ariaOptions = opts.depth !== undefined ? { mode: "ai", depth: opts.depth } : { mode: "ai" };
390
- if (opts.selector) {
391
- const locator = this.page.locator(opts.selector).first();
392
- if ((await locator.count()) === 0) {
393
- return { ok: false, error: `no element matches selector "${opts.selector}"` };
394
- }
395
- await showPilotVision(this.page, opts.selector, `dom (${mode}): ${opts.selector}`, "orange");
396
- if (mode === "full") {
397
- const caps = {
398
- depth: opts.depth ?? FULL_MODE_DEFAULT_DEPTH,
399
- maxNodes: FULL_MODE_MAX_NODES,
400
- maxTextLength: FULL_MODE_MAX_TEXT_LENGTH,
401
- };
402
- const { tree, truncated } = await locator.evaluate(walkFullDom, caps);
403
- return { ok: true, snapshot: { mode: "full", selector: opts.selector, truncated, tree } };
404
- }
405
- const tree = await locator.ariaSnapshotJSON(ariaOptions);
406
- return { ok: true, snapshot: { mode: "aria", selector: opts.selector, truncated: false, tree } };
407
- }
408
- await showPilotActivity(this.page, `Running (Dom): ${mode}, whole page`);
409
- if (mode === "full") {
410
- // page.evaluate only ships the one function passed to it - it can't
411
- // reach another named function by closure. Routing the whole-page case
412
- // through the same `html` Locator lets both cases share one
413
- // self-contained walkFullDom instead of two near-duplicate callbacks.
414
- const caps = {
415
- depth: opts.depth ?? FULL_MODE_DEFAULT_DEPTH,
416
- maxNodes: FULL_MODE_MAX_NODES,
417
- maxTextLength: FULL_MODE_MAX_TEXT_LENGTH,
418
- };
419
- const { tree, truncated } = await this.page.locator("html").first().evaluate(walkFullDom, caps);
420
- return { ok: true, snapshot: { mode: "full", truncated, tree } };
421
- }
422
- const tree = await this.page.ariaSnapshotJSON(ariaOptions);
423
- return { ok: true, snapshot: { mode: "aria", truncated: false, tree } };
424
- }
425
- /**
426
- * Pure getter - reads the live page's client-side state: localStorage,
427
- * sessionStorage, and registered service workers (scope/active URL/state).
428
- * Real, direct follow-up to `auto console`'s own gap: a site doing web
429
- * push (this target has a real `NOTIFICATION_VAPID` config, confirmed via
430
- * `auto dom` earlier) keeps push-subscription/auth state in these places,
431
- * not in the rendered DOM `inspectDom` reads.
432
- */
433
- async inspectStorage() {
434
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
435
- const [localStorageEntries, sessionStorageEntries] = await this.page.evaluate(() => [
436
- Object.entries(window.localStorage),
437
- Object.entries(window.sessionStorage),
438
- ]);
439
- const cookies = await this.context.cookies();
440
- const workers = this.context.serviceWorkers();
441
- const registrations = await this.page
442
- .evaluate(async () => {
443
- if (!("serviceWorker" in navigator))
444
- return [];
445
- const regs = await navigator.serviceWorker.getRegistrations();
446
- return regs.map((r) => ({
447
- scope: r.scope,
448
- ...(r.active?.scriptURL ? { activeUrl: r.active.scriptURL } : {}),
449
- ...(r.active?.state ? { state: r.active.state } : {}),
450
- }));
451
- })
452
- .catch(() => []);
453
- return {
454
- localStorage: Object.fromEntries(localStorageEntries),
455
- sessionStorage: Object.fromEntries(sessionStorageEntries),
456
- cookies: cookies.map((c) => ({
457
- name: c.name,
458
- value: c.value,
459
- domain: c.domain,
460
- path: c.path,
461
- httpOnly: c.httpOnly,
462
- secure: c.secure,
463
- })),
464
- serviceWorkers: workers.map((w) => w.url()),
465
- serviceWorkerRegistrations: registrations,
466
- };
467
- }
468
- /**
469
- * Runs one already-resolved Block entry for real - the shared core both
470
- * `applyPick` (resolved via a live-menu index) and `applyPath` (resolved
471
- * directly by name, bypassing live-menu-visibility entirely - see
472
- * `applyPath`'s own comment for why) call. `expectedTo` is only used as a
473
- * fallback when a Block's own `resolve()` doesn't set `__state` - same
474
- * behavior `applyPick` always had, just factored out, not changed.
475
- */
476
- async runNamedBlock(entry, expectedTo, instanceOption) {
477
- const from = this.here;
478
- const stubBeforeResult = await runStubPhase(entry.block, "stubBefore");
479
- const stepBase = {
480
- block: entry.block.name,
481
- from,
482
- timestamp: new Date().toISOString(),
483
- ...(stubPhaseHasContent(stubBeforeResult) ? { stubBefore: stubBeforeResult } : {}),
484
- };
485
- try {
486
- if (instanceOption) {
487
- this.mem.set(instanceOption.key, instanceOption.value);
488
- }
489
- // Always the non-interactive path (cli: false) - a detached session has
490
- // no TTY to prompt on; a missing mem key fails loud instead of hanging.
491
- await ensureMem(entry, this.mem, false);
492
- const result = await runOneBlock(this.engine, entry, this.context, this.page, this.mem, false);
493
- this.here = result.__state ?? expectedTo;
494
- this.lastRunNote = `${entry.block.name} -> ${this.here}`;
495
- const stubAfterResult = await runStubPhase(entry.block, "stubAfter", { out: result });
496
- this.pushTrace({
497
- ...stepBase,
498
- to: this.here,
499
- ...(stubPhaseHasContent(stubAfterResult) ? { stubAfter: stubAfterResult } : {}),
500
- });
501
- }
502
- catch (err) {
503
- this.lastRunNote = `${entry.block.name} failed`;
504
- const message = err instanceof Error ? err.message : String(err);
505
- const stubOnErrorResult = await runStubPhase(entry.block, "stubOnError", { error: err });
506
- this.pushTrace({
507
- ...stepBase,
508
- error: message,
509
- ...(stubPhaseHasContent(stubOnErrorResult) ? { stubOnError: stubOnErrorResult } : {}),
510
- });
511
- return { ok: false, error: `${entry.block.name} failed - ${message}` };
512
- }
513
- const nextMenu = await this.currentMenu();
514
- return {
515
- ok: true,
516
- snapshot: buildSessionSnapshot(nextMenu, this.library.byName, this.here, this.lastRunNote),
517
- quit: false,
518
- };
519
- }
520
- /** Applies exactly one pick: runs at most one Block, returns the resulting state. */
521
- async applyPick(raw) {
522
- const menu = await this.currentMenu();
523
- const pick = parsePick(raw, menu);
524
- if (pick.type === "invalid")
525
- return { ok: false, error: pick.reason };
526
- if (pick.type === "quit") {
527
- return {
528
- ok: true,
529
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
530
- quit: true,
531
- };
532
- }
533
- const edge = menu.flat[pick.index];
534
- const entry = this.library.byName.get(edge.block);
535
- if (!entry) {
536
- return { ok: false, error: `Block "${edge.block}" not loaded - skipped` };
537
- }
538
- await showPilotActivity(this.page, `Running (Block): ${edge.block}`);
539
- return this.runNamedBlock(entry, edge.to, edge.instanceOption);
540
- }
541
- /**
542
- * Re-discovers the project's Block library and graph from disk, using the
543
- * exact same call `start()` itself makes - not a duplicated read - and
544
- * replaces `this.library`/`this.graph` in place. Leaves the live page,
545
- * mem, browser/context, and current Checkpoint (`here`) untouched, so a
546
- * Block written to disk mid-session becomes pickable via a later
547
- * `applyPick` without restarting the session. See
548
- * openspec/changes/waygraph-blind-pilot/design.md.
549
- */
550
- async reloadLibrary() {
551
- if (this.page)
552
- await showPilotActivity(this.page, "Running: reload");
553
- const exploreOpts = {
554
- ...(this.blocksSelect ? { blocksSelect: this.blocksSelect } : {}),
555
- ...(this.inject?.length ? { inject: this.inject } : {}),
556
- };
557
- const { graph, library } = await buildExploreContext(this.projectDir, Object.keys(exploreOpts).length ? exploreOpts : undefined);
558
- this.graph = graph;
559
- this.library = library;
560
- if (this.page)
561
- await showPilotActivity(this.page, "Map updated");
562
- }
563
- /**
564
- * Forces `here` to be re-detected from the real live page, discarding
565
- * whatever was cached - the fix for a real, confirmed gap: `here` is only
566
- * ever updated by an action this class itself ran (`applyPick`/`applyPath`
567
- * set it to a Block's own resolved Checkpoint; `rawClick`/`rawType`/
568
- * `rawGoto` reset it to `null` because *they* just changed the page). If a
569
- * human co-driving the same visible session clicks/types/navigates
570
- * directly - a real scenario for a headful Pilot session someone is
571
- * watching, not hypothetical - none of that goes through this class at
572
- * all, so `here` silently goes stale: `currentMenu()`'s own lazy check
573
- * (`if (this.here === null)`, just above) only re-detects when `here` is
574
- * already unknown, never to confirm a *known* value is still correct.
575
- * This does not crash the session (the process/socket/page all stay
576
- * alive) but subsequent `send`/`reach` calls would act on a menu built
577
- * from the wrong Checkpoint until something forces re-detection - this
578
- * method is that: unconditionally re-run the same `detectHere` logic the
579
- * lazy path already uses, regardless of what `here` currently holds.
580
- */
581
- async resync() {
582
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
583
- await showPilotActivity(this.page, "Running: resync");
584
- this.here = await detectHere(this.page, this.library.navBlocks);
585
- const menu = await this.currentMenu();
586
- this.lastRunNote = `resync -> ${this.here ?? "Unknown"}`;
587
- return {
588
- ok: true,
589
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
590
- quit: false,
591
- };
592
- }
593
- /**
594
- * Raw interaction primitives for a page no Block covers yet (Blind Pilot -
595
- * see openspec/changes/waygraph-blind-pilot). Unlike `applyPick`, the
596
- * resulting Checkpoint isn't known ahead of time from a Block's own
597
- * `resolve()`, so each of these invalidates the cached `here` (forcing
598
- * `currentMenu()`'s existing lazy `detectHere` call to run again) rather
599
- * than assuming the page didn't move anywhere a Block now recognizes.
600
- * A selector matching nothing is a reported failure, not a silent no-op.
601
- */
602
- async rawClick(selector) {
603
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
604
- await showPilotActivity(this.page, `Running (no Block): click "${selector}"`);
605
- const locator = this.page.locator(selector).first();
606
- if ((await locator.count()) === 0) {
607
- return { ok: false, error: `no element matches selector "${selector}"` };
608
- }
609
- await showPilotVision(this.page, selector, `click: ${selector}`);
610
- await locator.click();
611
- this.here = null;
612
- const menu = await this.currentMenu();
613
- this.lastRunNote = `click "${selector}" -> ${this.here ?? "Unknown"}`;
614
- return {
615
- ok: true,
616
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
617
- quit: false,
618
- };
619
- }
620
- async rawType(selector, text) {
621
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
622
- await showPilotActivity(this.page, `Running (no Block): type into "${selector}"`);
623
- const locator = this.page.locator(selector).first();
624
- if ((await locator.count()) === 0) {
625
- return { ok: false, error: `no element matches selector "${selector}"` };
626
- }
627
- await showPilotVision(this.page, selector, `type: ${selector}`);
628
- await locator.fill(text);
629
- this.here = null;
630
- const menu = await this.currentMenu();
631
- this.lastRunNote = `type into "${selector}" -> ${this.here ?? "Unknown"}`;
632
- return {
633
- ok: true,
634
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
635
- quit: false,
636
- };
637
- }
638
- /**
639
- * Presses a real key on a real focused element - a real gap found live:
640
- * many real inline-edit inputs (no visible Save button at all) commit on
641
- * Enter, not on blur/click-elsewhere. `key` is a Playwright key name
642
- * (e.g. "Enter", "Escape", "Tab") - same vocabulary as
643
- * `page.keyboard.press`, which this wraps.
644
- */
645
- async rawPress(selector, key) {
646
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
647
- await showPilotActivity(this.page, `Running (no Block): press "${key}" on "${selector}"`);
648
- const locator = this.page.locator(selector).first();
649
- if ((await locator.count()) === 0) {
650
- return { ok: false, error: `no element matches selector "${selector}"` };
651
- }
652
- await showPilotVision(this.page, selector, `press ${key}: ${selector}`);
653
- await locator.press(key);
654
- this.here = null;
655
- const menu = await this.currentMenu();
656
- this.lastRunNote = `press "${key}" on "${selector}" -> ${this.here ?? "Unknown"}`;
657
- return {
658
- ok: true,
659
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
660
- quit: false,
661
- };
662
- }
663
- async rawGoto(url) {
664
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
665
- await showPilotActivity(this.page, `Running (no Block): goto "${url}"`);
666
- try {
667
- await this.page.goto(url, { waitUntil: "domcontentloaded" });
668
- }
669
- catch (err) {
670
- return { ok: false, error: `goto "${url}" failed - ${err instanceof Error ? err.message : String(err)}` };
671
- }
672
- this.here = null;
673
- const menu = await this.currentMenu();
674
- this.lastRunNote = `goto "${url}" -> ${this.here ?? "Unknown"}`;
675
- return {
676
- ok: true,
677
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
678
- quit: false,
679
- };
680
- }
681
- /**
682
- * Fills a real `<input type="file">` - a built-in stub kind
683
- * ("image"/"pdf"/"video", see `stubFilePath`) or a caller-supplied
684
- * `filePath` for anything else ("whatever", per the real request this
685
- * responds to). Same raw-primitive shape as click/type/goto: works with
686
- * zero Blocks, invalidates `here` since the app may react to the upload.
687
- */
688
- async rawUpload(selector, stub) {
689
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
690
- const filePath = typeof stub === "string" ? stubFilePath(stub) : stub.filePath;
691
- const label = typeof stub === "string" ? stub : filePath;
692
- await showPilotActivity(this.page, `Running (no Block): upload ${label} into "${selector}"`);
693
- const locator = this.page.locator(selector).first();
694
- if ((await locator.count()) === 0) {
695
- return { ok: false, error: `no element matches selector "${selector}"` };
696
- }
697
- await showPilotVision(this.page, selector, `upload ${label}: ${selector}`);
698
- try {
699
- await locator.setInputFiles(filePath);
700
- }
701
- catch (err) {
702
- return { ok: false, error: `upload into "${selector}" failed - ${err instanceof Error ? err.message : String(err)}` };
703
- }
704
- this.here = null;
705
- const menu = await this.currentMenu();
706
- this.lastRunNote = `upload ${label} into "${selector}" -> ${this.here ?? "Unknown"}`;
707
- return {
708
- ok: true,
709
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
710
- quit: false,
711
- };
712
- }
713
- /**
714
- * Agent-sent highlight fixtures (rings + optional todos) on the live page -
715
- * the Pilot equivalent of Block `stubBefore` narration in `waygraph demo`.
716
- * Does not run a Block; paint-only. Missing selectors are reported, not fatal.
717
- */
718
- async applyHighlight(fixtures) {
719
- this.page = await ensureLivePage(this.context, this.page, this.startUrl);
720
- const detail = fixtures.clear === true
721
- ? "clear"
722
- : [
723
- fixtures.rings?.length ? `${fixtures.rings.length} ring(s)` : null,
724
- fixtures.todos?.length ? `${fixtures.todos.length} todo(s)` : null,
725
- fixtures.zoom && fixtures.zoom > 1.001 ? `zoom ${fixtures.zoom}` : null,
726
- fixtures.device
727
- ? `device ${typeof fixtures.device === "string" ? fixtures.device : fixtures.device.preset || "custom"}`
728
- : null,
729
- fixtures.rings?.some((r) => r.focus) ? "focus" : null,
730
- ]
731
- .filter(Boolean)
732
- .join(", ") || "fixtures";
733
- // Same bottom-left activity toast as Running (Dom)/(Block) - agent narration.
734
- await showPilotActivity(this.page, `Highlighting: ${detail}`);
735
- try {
736
- const { painted, missing } = await showPilotFixtures(this.page, fixtures);
737
- const menu = await this.currentMenu();
738
- this.lastRunNote = fixtures.clear
739
- ? "highlight cleared"
740
- : `highlight painted ${painted}` +
741
- (missing.length ? ` (missing: ${missing.join(", ")})` : "");
742
- return {
743
- ok: true,
744
- painted,
745
- missing,
746
- snapshot: buildSessionSnapshot(menu, this.library.byName, this.here, this.lastRunNote),
747
- };
748
- }
749
- catch (err) {
750
- return {
751
- ok: false,
752
- error: `highlight failed - ${err instanceof Error ? err.message : String(err)}`,
753
- };
754
- }
755
- }
756
- /**
757
- * Runs a whole multi-step route to `targetCheckpoint` in one call, instead
758
- * of an agent hand-picking one index at a time across many separate
759
- * `applyPick` round trips - real, reported pain for any non-trivial task
760
- * on a rich graph ("the entire prompts of the day" driving one step per
761
- * call).
762
- *
763
- * Two other designs were tried and rejected by direct reproduction against
764
- * live saucedemo.com before this one, both undone by the same root cause:
765
- * a `from: "*"` edge (e.g. "Checkout", only clickable once you're actually
766
- * on the cart page with items) looks globally reachable to
767
- * `findBlockPath`'s static-graph BFS, which has no live-page access and
768
- * can't know the edge's real precondition isn't showing yet. Computing the
769
- * whole route once upfront names a premature wildcard step immediately;
770
- * scoring each live menu option by its static-graph distance to the
771
- * target (greedy best-first) doesn't fix it either - a harmless self-loop
772
- * Method can score just as well as real progress once wildcard "shortcuts"
773
- * are baked into every distance calculation, and the session gets stuck
774
- * repeating it.
775
- *
776
- * The fix that actually works: stop trying to be clever about live-menu
777
- * visibility per step, and reuse `auto --blocks <From> <To>`'s own already
778
- * -proven approach instead - compute the path ONCE (via
779
- * `findBlockPathDetailed`, the same BFS `findBlockPath`/`runChainAuto`
780
- * already use, extended to also return each hop's specific edge - see its
781
- * own doc comment for why that extra detail is load-bearing, not cosmetic),
782
- * then run each Block in it directly via `runNamedBlock`, trusting the
783
- * graph the same way `runChain`'s own flow execution already does, not
784
- * gated on live-menu visibility at all. The one real difference from
785
- * `runChainAuto`: this runs against the session's own already-live
786
- * page/context/mem, not a freshly spawned browser - the whole point of
787
- * staying in one session. A step whose real precondition genuinely isn't
788
- * met still fails loud, naming that step, exactly the way a mis-ordered
789
- * `runChain` spec would - and a step that runs without throwing but lands
790
- * somewhere other than what its own edge promised (a real, observed case,
791
- * not hypothetical - see this method's own test suite) fails loud too,
792
- * rather than reporting false success.
793
- */
794
- async applyPath(targetCheckpoint) {
795
- await this.currentMenu();
796
- const from = this.here;
797
- if (from === null) {
798
- return { ok: false, error: "cannot path-find: the session's current Checkpoint is unknown (here is null)" };
799
- }
800
- const path = findBlockPathDetailed(this.graph, from, targetCheckpoint);
801
- if (!path) {
802
- return { ok: false, error: `no Block path from "${from}" to "${targetCheckpoint}" in the discovered graph` };
803
- }
804
- for (const step of path) {
805
- const entry = this.library.byName.get(step.block);
806
- if (!entry) {
807
- return { ok: false, error: `path step "${step.block}" is in the discovered graph but not loaded in this session's library` };
808
- }
809
- if (entry.block.instanceOptions) {
810
- return {
811
- ok: false,
812
- 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`,
813
- };
814
- }
815
- if (this.page)
816
- await showPilotActivity(this.page, `Running (Block): ${step.block} (reach -> ${targetCheckpoint})`);
817
- const result = await this.runNamedBlock(entry, step.to);
818
- if (!result.ok) {
819
- return { ok: false, error: `step "${step.block}" failed - ${result.error}` };
820
- }
821
- // A Block can resolve to a DIFFERENT real Checkpoint than this exact
822
- // hop's own edge expected, without throwing at all - e.g.
823
- // submit-login's own resolve() legitimately "stays on LoginPage" on
824
- // bad auth instead of erroring. Trusting `result.ok` alone would
825
- // silently report success while sitting on the wrong page - a real
826
- // bug caught by this method's own test suite, not theoretical.
827
- // `step.to` (not a name-based re-lookup - a union-Out Block can have
828
- // several edges sharing one name with different `to` tags) is exactly
829
- // the Checkpoint THIS hop's own edge in the computed route promised.
830
- if (this.here !== step.to) {
831
- return {
832
- ok: false,
833
- 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`,
834
- };
835
- }
836
- }
837
- return { ok: true, path: path.map((s) => s.block), snapshot: await this.currentSnapshot() };
838
- }
839
- async close() {
840
- await this.context.close();
841
- await this.browser.close();
842
- }
843
- }
1
+ // Barrel: auto-session lives in src/auto-session/ (see src/ARCHITECTURE.md). Kept so existing imports of "./auto-session.js" don't change.
2
+ export * from "./auto-session/helpers.js";
3
+ export * from "./auto-session/session.js";