spana-test 0.11.0 → 0.13.0

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 (548) hide show
  1. package/.agents/skills/spana-testing/SKILL.md +0 -0
  2. package/LICENSE +0 -0
  3. package/README.md +5 -2
  4. package/dist/{accessibility-audit-YZOPUY3D.js → accessibility-audit-MHQ65DUD.js} +61 -12
  5. package/dist/accessibility-audit-MHQ65DUD.js.map +1 -0
  6. package/dist/agent/index.d.ts +3 -11
  7. package/dist/agent/index.d.ts.map +1 -0
  8. package/dist/agent/index.js +38 -15
  9. package/dist/agent/index.js.map +1 -1
  10. package/dist/{session-uT8xL03K.d.ts → agent/session.d.ts} +14 -46
  11. package/dist/agent/session.d.ts.map +1 -0
  12. package/dist/{agent-fixture-5C4MCWRD.js → agent-fixture-H6GOUHNX.js} +3 -3
  13. package/dist/{agent-fixture-5C4MCWRD.js.map → agent-fixture-H6GOUHNX.js.map} +0 -0
  14. package/dist/{allure-FGVR5LND.js → allure-XOM7BXL5.js} +5 -2
  15. package/dist/{allure-FGVR5LND.js.map → allure-XOM7BXL5.js.map} +1 -1
  16. package/dist/{android-6BOQTMM3.js → android-C2S4B4TH.js} +3 -3
  17. package/dist/{android-6BOQTMM3.js.map → android-C2S4B4TH.js.map} +0 -0
  18. package/dist/api/agent-fixture.d.ts +119 -0
  19. package/dist/api/agent-fixture.d.ts.map +1 -0
  20. package/dist/api/app.d.ts +399 -0
  21. package/dist/api/app.d.ts.map +1 -0
  22. package/dist/api/expect.d.ts +180 -0
  23. package/dist/api/expect.d.ts.map +1 -0
  24. package/dist/api/fixtures.d.ts +165 -0
  25. package/dist/api/fixtures.d.ts.map +1 -0
  26. package/dist/api/flow.d.ts +123 -0
  27. package/dist/api/flow.d.ts.map +1 -0
  28. package/dist/api/index.d.ts +4 -0
  29. package/dist/api/index.d.ts.map +1 -0
  30. package/dist/api/snapshots.d.ts +26 -0
  31. package/dist/api/snapshots.d.ts.map +1 -0
  32. package/dist/api/storybook.d.ts +18 -0
  33. package/dist/api/storybook.d.ts.map +1 -0
  34. package/dist/api/suite.d.ts +46 -0
  35. package/dist/api/suite.d.ts.map +1 -0
  36. package/dist/app-W6PRRBMD.js +13 -0
  37. package/dist/{app-RSDPDTKT.js.map → app-W6PRRBMD.js.map} +0 -0
  38. package/dist/appium-CC77BJNK.js +935 -0
  39. package/dist/appium-CC77BJNK.js.map +1 -0
  40. package/dist/{appium-server-66GVUL24.js → appium-server-M6CWWUWF.js} +5 -2
  41. package/dist/{appium-server-66GVUL24.js.map → appium-server-M6CWWUWF.js.map} +1 -1
  42. package/dist/{baseline-manager-5TIUCNP5.js → baseline-manager-LVUVH2MJ.js} +5 -2
  43. package/dist/{baseline-manager-5TIUCNP5.js.map → baseline-manager-LVUVH2MJ.js.map} +1 -1
  44. package/dist/bridge-server-S3DHK7XE.js +12 -0
  45. package/dist/{cache-command-PANUAEMZ.js.map → bridge-server-S3DHK7XE.js.map} +0 -0
  46. package/dist/{cache-command-PANUAEMZ.js → cache-command-OL7HUK2K.js} +3 -3
  47. package/dist/{chunk-DGUM43GV.js.map → cache-command-OL7HUK2K.js.map} +0 -0
  48. package/dist/channels/android-cdp.d.ts +71 -0
  49. package/dist/channels/android-cdp.d.ts.map +1 -0
  50. package/dist/channels/apple-webinspector.d.ts +85 -0
  51. package/dist/channels/apple-webinspector.d.ts.map +1 -0
  52. package/dist/channels/bidi-client.d.ts +79 -0
  53. package/dist/channels/bidi-client.d.ts.map +1 -0
  54. package/dist/channels/bridge-server.d.ts +69 -0
  55. package/dist/channels/bridge-server.d.ts.map +1 -0
  56. package/dist/channels/cdp-client.d.ts +115 -0
  57. package/dist/channels/cdp-client.d.ts.map +1 -0
  58. package/dist/channels/dom-channel.d.ts +246 -0
  59. package/dist/channels/dom-channel.d.ts.map +1 -0
  60. package/dist/channels/index.d.ts +8 -0
  61. package/dist/channels/index.d.ts.map +1 -0
  62. package/dist/channels/webkit-inspector.d.ts +85 -0
  63. package/dist/channels/webkit-inspector.d.ts.map +1 -0
  64. package/dist/channels/ws-server.d.ts +21 -0
  65. package/dist/channels/ws-server.d.ts.map +1 -0
  66. package/dist/chunk-27H6NDA5.js +845 -0
  67. package/dist/chunk-27H6NDA5.js.map +1 -0
  68. package/dist/{chunk-WV3ALL3H.js → chunk-2MA5G2VH.js} +6 -2
  69. package/dist/{chunk-WV3ALL3H.js.map → chunk-2MA5G2VH.js.map} +1 -1
  70. package/dist/chunk-4LJ3KYCX.js +94 -0
  71. package/dist/chunk-4LJ3KYCX.js.map +1 -0
  72. package/dist/chunk-5SDVP53E.js +1046 -0
  73. package/dist/chunk-5SDVP53E.js.map +1 -0
  74. package/dist/{chunk-FPQAJNE3.js → chunk-5T7LSBDM.js} +288 -101
  75. package/dist/chunk-5T7LSBDM.js.map +1 -0
  76. package/dist/chunk-6C2EILMC.js +2589 -0
  77. package/dist/chunk-6C2EILMC.js.map +1 -0
  78. package/dist/{chunk-3IZMPNE7.js → chunk-7IUD55GY.js} +1333 -941
  79. package/dist/chunk-7IUD55GY.js.map +1 -0
  80. package/dist/{chunk-JPZCZHL4.js → chunk-7Q7TSUNL.js} +6 -1
  81. package/dist/{chunk-JPZCZHL4.js.map → chunk-7Q7TSUNL.js.map} +1 -1
  82. package/dist/{chunk-X2TJP7LB.js → chunk-7WHQIQPM.js} +11 -1
  83. package/dist/chunk-7WHQIQPM.js.map +1 -0
  84. package/dist/chunk-A7Z52TDQ.js +97 -0
  85. package/dist/chunk-A7Z52TDQ.js.map +1 -0
  86. package/dist/{chunk-WZAQANN6.js → chunk-BUNMIMGA.js} +9 -3
  87. package/dist/{chunk-WZAQANN6.js.map → chunk-BUNMIMGA.js.map} +1 -1
  88. package/dist/chunk-DMF2BPPA.js +547 -0
  89. package/dist/chunk-DMF2BPPA.js.map +1 -0
  90. package/dist/{chunk-Z6K4QQAR.js → chunk-FHCOPLYB.js} +36 -7
  91. package/dist/chunk-FHCOPLYB.js.map +1 -0
  92. package/dist/{chunk-3SH5JQF7.js → chunk-FSPMFRJO.js} +6 -1
  93. package/dist/{chunk-3SH5JQF7.js.map → chunk-FSPMFRJO.js.map} +1 -1
  94. package/dist/chunk-FTXUQMGH.js +56 -0
  95. package/dist/chunk-FTXUQMGH.js.map +1 -0
  96. package/dist/chunk-FUXFXFBM.js +1962 -0
  97. package/dist/chunk-FUXFXFBM.js.map +1 -0
  98. package/dist/{chunk-SIJJVN2D.js → chunk-FV7ONGQ7.js} +9 -3
  99. package/dist/{chunk-SIJJVN2D.js.map → chunk-FV7ONGQ7.js.map} +1 -1
  100. package/dist/{chunk-VUNH4AJD.js → chunk-GDVHJBR2.js} +9 -5
  101. package/dist/{chunk-VUNH4AJD.js.map → chunk-GDVHJBR2.js.map} +1 -1
  102. package/dist/chunk-GLNTGHR6.js +330 -0
  103. package/dist/chunk-GLNTGHR6.js.map +1 -0
  104. package/dist/{chunk-OPTNFLBL.js → chunk-HIGFQRWM.js} +7 -1
  105. package/dist/{chunk-OPTNFLBL.js.map → chunk-HIGFQRWM.js.map} +1 -1
  106. package/dist/chunk-HJY5YN4N.js +272 -0
  107. package/dist/chunk-HJY5YN4N.js.map +1 -0
  108. package/dist/chunk-HNQLWFHL.js +40 -0
  109. package/dist/chunk-HNQLWFHL.js.map +1 -0
  110. package/dist/chunk-HUYC4OAL.js +72 -0
  111. package/dist/chunk-HUYC4OAL.js.map +1 -0
  112. package/dist/chunk-HWS3XUEF.js +109 -0
  113. package/dist/chunk-HWS3XUEF.js.map +1 -0
  114. package/dist/chunk-IDIHDVGC.js +328 -0
  115. package/dist/chunk-IDIHDVGC.js.map +1 -0
  116. package/dist/{chunk-4SA7JK5D.js → chunk-IUK3RJ6W.js} +38 -20
  117. package/dist/{chunk-4SA7JK5D.js.map → chunk-IUK3RJ6W.js.map} +1 -1
  118. package/dist/chunk-K4K2ACT2.js +179 -0
  119. package/dist/chunk-K4K2ACT2.js.map +1 -0
  120. package/dist/chunk-LKGF75QJ.js +654 -0
  121. package/dist/chunk-LKGF75QJ.js.map +1 -0
  122. package/dist/chunk-MAKZK7GY.js +935 -0
  123. package/dist/chunk-MAKZK7GY.js.map +1 -0
  124. package/dist/chunk-MPJCUL2B.js +154 -0
  125. package/dist/chunk-MPJCUL2B.js.map +1 -0
  126. package/dist/chunk-MUMIMDRJ.js +24 -0
  127. package/dist/chunk-MUMIMDRJ.js.map +1 -0
  128. package/dist/{chunk-KJPHH2TW.js → chunk-NHT3XSX3.js} +6 -1
  129. package/dist/{chunk-KJPHH2TW.js.map → chunk-NHT3XSX3.js.map} +1 -1
  130. package/dist/{chunk-6PTUVG6A.js → chunk-NWGA3R2E.js} +7 -18
  131. package/dist/chunk-NWGA3R2E.js.map +1 -0
  132. package/dist/{chunk-3FSZNKEF.js → chunk-NXET4BFJ.js} +7 -1
  133. package/dist/{chunk-3FSZNKEF.js.map → chunk-NXET4BFJ.js.map} +1 -1
  134. package/dist/chunk-PPRNCRTS.js +1104 -0
  135. package/dist/chunk-PPRNCRTS.js.map +1 -0
  136. package/dist/{chunk-64UZQP7Z.js → chunk-PRQTAIYA.js} +30 -4
  137. package/dist/chunk-PRQTAIYA.js.map +1 -0
  138. package/dist/{chunk-4KK4E3N3.js → chunk-RHQJSPOS.js} +1289 -187
  139. package/dist/chunk-RHQJSPOS.js.map +1 -0
  140. package/dist/{chunk-CY3DKTBZ.js → chunk-RIXZISMX.js} +6 -1
  141. package/dist/{chunk-CY3DKTBZ.js.map → chunk-RIXZISMX.js.map} +1 -1
  142. package/dist/{chunk-S7MSBZ3F.js → chunk-TFEXYI6N.js} +6 -1
  143. package/dist/{chunk-S7MSBZ3F.js.map → chunk-TFEXYI6N.js.map} +1 -1
  144. package/dist/chunk-U56N5JCJ.js +19842 -0
  145. package/dist/chunk-U56N5JCJ.js.map +1 -0
  146. package/dist/{chunk-IHVZKQQW.js → chunk-UKUXNFQP.js} +6 -1
  147. package/dist/{chunk-IHVZKQQW.js.map → chunk-UKUXNFQP.js.map} +1 -1
  148. package/dist/{chunk-SGZMO456.js → chunk-VWJNINPX.js} +667 -123
  149. package/dist/chunk-VWJNINPX.js.map +1 -0
  150. package/dist/chunk-WFC4DCFF.js +529 -0
  151. package/dist/chunk-WFC4DCFF.js.map +1 -0
  152. package/dist/{chunk-26NJXP55.js → chunk-WJH5K42V.js} +6 -2
  153. package/dist/{chunk-26NJXP55.js.map → chunk-WJH5K42V.js.map} +1 -1
  154. package/dist/chunk-X5FRYDZ3.js +91 -0
  155. package/dist/chunk-X5FRYDZ3.js.map +1 -0
  156. package/dist/{chunk-VP6V4XEJ.js → chunk-XD6A3VXB.js} +10 -5
  157. package/dist/{chunk-VP6V4XEJ.js.map → chunk-XD6A3VXB.js.map} +1 -1
  158. package/dist/{chunk-2AFWVHQK.js → chunk-XVL4FHXA.js} +6 -1
  159. package/dist/{chunk-2AFWVHQK.js.map → chunk-XVL4FHXA.js.map} +1 -1
  160. package/dist/chunk-YFTHJRDO.js +37 -0
  161. package/dist/chunk-YFTHJRDO.js.map +1 -0
  162. package/dist/{chunk-LAMTF4LX.js → chunk-ZIETAMAD.js} +6 -1
  163. package/dist/{chunk-LAMTF4LX.js.map → chunk-ZIETAMAD.js.map} +1 -1
  164. package/dist/cli/cache-command.d.ts +29 -0
  165. package/dist/cli/cache-command.d.ts.map +1 -0
  166. package/dist/cli/command-errors.d.ts +7 -0
  167. package/dist/cli/command-errors.d.ts.map +1 -0
  168. package/dist/cli/config-loader.d.ts +11 -0
  169. package/dist/cli/config-loader.d.ts.map +1 -0
  170. package/dist/cli/doctor-command.d.ts +64 -0
  171. package/dist/cli/doctor-command.d.ts.map +1 -0
  172. package/dist/cli/gen-types-command.d.ts +2 -0
  173. package/dist/cli/gen-types-command.d.ts.map +1 -0
  174. package/dist/cli/index.d.ts +2 -0
  175. package/dist/cli/index.d.ts.map +1 -0
  176. package/dist/cli/init-command.d.ts +7 -0
  177. package/dist/cli/init-command.d.ts.map +1 -0
  178. package/dist/cli/init-flow-command.d.ts +11 -0
  179. package/dist/cli/init-flow-command.d.ts.map +1 -0
  180. package/dist/cli/iteration.d.ts +44 -0
  181. package/dist/cli/iteration.d.ts.map +1 -0
  182. package/dist/cli/scaffolds.d.ts +13 -0
  183. package/dist/cli/scaffolds.d.ts.map +1 -0
  184. package/dist/cli/studio-command.d.ts +8 -0
  185. package/dist/cli/studio-command.d.ts.map +1 -0
  186. package/dist/cli/test-command.d.ts +61 -0
  187. package/dist/cli/test-command.d.ts.map +1 -0
  188. package/dist/cli/watch-mode.d.ts +9 -0
  189. package/dist/cli/watch-mode.d.ts.map +1 -0
  190. package/dist/cli.js +86 -30
  191. package/dist/cli.js.map +1 -1
  192. package/dist/cloud/browserstack.d.ts +9 -0
  193. package/dist/cloud/browserstack.d.ts.map +1 -0
  194. package/dist/cloud/common.d.ts +26 -0
  195. package/dist/cloud/common.d.ts.map +1 -0
  196. package/dist/cloud/provider.d.ts +21 -0
  197. package/dist/cloud/provider.d.ts.map +1 -0
  198. package/dist/cloud/saucelabs.d.ts +9 -0
  199. package/dist/cloud/saucelabs.d.ts.map +1 -0
  200. package/dist/{compiler-X6WTFMYF.js → compiler-44UW2FID.js} +7 -3
  201. package/dist/{compiler-X6WTFMYF.js.map → compiler-44UW2FID.js.map} +1 -1
  202. package/dist/config-loader-7W7OEWRG.js +10 -0
  203. package/dist/{config-loader-CNGIW2XK.js.map → config-loader-7W7OEWRG.js.map} +0 -0
  204. package/dist/{console-DIYEJSSP.js → console-T6TVZ65G.js} +8 -2
  205. package/dist/console-T6TVZ65G.js.map +1 -0
  206. package/dist/core/accessibility-audit.d.ts +29 -0
  207. package/dist/core/accessibility-audit.d.ts.map +1 -0
  208. package/dist/core/artifacts.d.ts +27 -0
  209. package/dist/core/artifacts.d.ts.map +1 -0
  210. package/dist/core/baseline-manager.d.ts +18 -0
  211. package/dist/core/baseline-manager.d.ts.map +1 -0
  212. package/dist/core/benchmark.d.ts +21 -0
  213. package/dist/core/benchmark.d.ts.map +1 -0
  214. package/dist/core/debug-repl.d.ts +17 -0
  215. package/dist/core/debug-repl.d.ts.map +1 -0
  216. package/dist/core/engine.d.ts +51 -0
  217. package/dist/core/engine.d.ts.map +1 -0
  218. package/dist/core/filters.d.ts +248 -0
  219. package/dist/core/filters.d.ts.map +1 -0
  220. package/dist/core/flow-generator.d.ts +13 -0
  221. package/dist/core/flow-generator.d.ts.map +1 -0
  222. package/dist/core/graphemes.d.ts +2 -0
  223. package/dist/core/graphemes.d.ts.map +1 -0
  224. package/dist/core/index.d.ts +6 -0
  225. package/dist/core/index.d.ts.map +1 -0
  226. package/dist/core/native-accel.d.ts +21 -0
  227. package/dist/core/native-accel.d.ts.map +1 -0
  228. package/dist/core/network-cache.d.ts +68 -0
  229. package/dist/core/network-cache.d.ts.map +1 -0
  230. package/dist/core/orchestrator.d.ts +44 -0
  231. package/dist/core/orchestrator.d.ts.map +1 -0
  232. package/dist/core/parallel.d.ts +42 -0
  233. package/dist/core/parallel.d.ts.map +1 -0
  234. package/dist/core/port-allocator.d.ts +16 -0
  235. package/dist/core/port-allocator.d.ts.map +1 -0
  236. package/dist/core/projects.d.ts +60 -0
  237. package/dist/core/projects.d.ts.map +1 -0
  238. package/dist/core/replay-cache.d.ts +127 -0
  239. package/dist/core/replay-cache.d.ts.map +1 -0
  240. package/dist/core/runner.d.ts +50 -0
  241. package/dist/core/runner.d.ts.map +1 -0
  242. package/dist/core/screenshot-compare.d.ts +50 -0
  243. package/dist/core/screenshot-compare.d.ts.map +1 -0
  244. package/dist/core/session-manager.d.ts +35 -0
  245. package/dist/core/session-manager.d.ts.map +1 -0
  246. package/dist/core/step-recorder.d.ts +20 -0
  247. package/dist/core/step-recorder.d.ts.map +1 -0
  248. package/dist/core/target-matrix.d.ts +29 -0
  249. package/dist/core/target-matrix.d.ts.map +1 -0
  250. package/dist/core/trace-viewer.d.ts +91 -0
  251. package/dist/core/trace-viewer.d.ts.map +1 -0
  252. package/dist/core/validator.d.ts +18 -0
  253. package/dist/core/validator.d.ts.map +1 -0
  254. package/dist/core/video-recorder.d.ts +120 -0
  255. package/dist/core/video-recorder.d.ts.map +1 -0
  256. package/dist/core/worker-pool.d.ts +87 -0
  257. package/dist/core/worker-pool.d.ts.map +1 -0
  258. package/dist/{daemon-manager-2EQDVUVM.js → daemon-manager-2SK5PHJR.js} +3 -3
  259. package/dist/{daemon-manager-2EQDVUVM.js.map → daemon-manager-2SK5PHJR.js.map} +0 -0
  260. package/dist/device/android.d.ts +66 -0
  261. package/dist/device/android.d.ts.map +1 -0
  262. package/dist/device/discover.d.ts +15 -0
  263. package/dist/device/discover.d.ts.map +1 -0
  264. package/dist/device/index.d.ts +4 -0
  265. package/dist/device/index.d.ts.map +1 -0
  266. package/dist/device/ios.d.ts +126 -0
  267. package/dist/device/ios.d.ts.map +1 -0
  268. package/dist/diagnostics/live-inspector.d.ts +121 -0
  269. package/dist/diagnostics/live-inspector.d.ts.map +1 -0
  270. package/dist/diagnostics/native-logs.d.ts +38 -0
  271. package/dist/diagnostics/native-logs.d.ts.map +1 -0
  272. package/dist/discover-6ULCTB5T.js +15 -0
  273. package/dist/{discover-NKDMB4UI.js.map → discover-6ULCTB5T.js.map} +0 -0
  274. package/dist/{doctor-command-6ZVJWCW7.js → doctor-command-4CQQLB7M.js} +24 -14
  275. package/dist/{doctor-command-6ZVJWCW7.js.map → doctor-command-4CQQLB7M.js.map} +1 -1
  276. package/dist/driver-3MEIFYST.js +19 -0
  277. package/dist/{filters-MQG2RMPX.js.map → driver-3MEIFYST.js.map} +0 -0
  278. package/dist/driver-QTIAADUZ.js +19 -0
  279. package/dist/{github-pr-YMWIPCCZ.js.map → driver-QTIAADUZ.js.map} +0 -0
  280. package/dist/drivers/adapter-registry.d.ts +96 -0
  281. package/dist/drivers/adapter-registry.d.ts.map +1 -0
  282. package/dist/drivers/appium/android.d.ts +22 -0
  283. package/dist/drivers/appium/android.d.ts.map +1 -0
  284. package/dist/drivers/appium/client.d.ts +26 -0
  285. package/dist/drivers/appium/client.d.ts.map +1 -0
  286. package/dist/drivers/appium/ios.d.ts +28 -0
  287. package/dist/drivers/appium/ios.d.ts.map +1 -0
  288. package/dist/drivers/appium/window-size.d.ts +8 -0
  289. package/dist/drivers/appium/window-size.d.ts.map +1 -0
  290. package/dist/drivers/browser-extensions.d.ts +62 -0
  291. package/dist/drivers/browser-extensions.d.ts.map +1 -0
  292. package/dist/drivers/cdp-browser.d.ts +129 -0
  293. package/dist/drivers/cdp-browser.d.ts.map +1 -0
  294. package/dist/drivers/common/xml-tokenizer.d.ts +26 -0
  295. package/dist/drivers/common/xml-tokenizer.d.ts.map +1 -0
  296. package/dist/drivers/device-controls.d.ts +36 -0
  297. package/dist/drivers/device-controls.d.ts.map +1 -0
  298. package/dist/drivers/electrobun.d.ts +47 -0
  299. package/dist/drivers/electrobun.d.ts.map +1 -0
  300. package/dist/drivers/electron.d.ts +36 -0
  301. package/dist/drivers/electron.d.ts.map +1 -0
  302. package/dist/drivers/index.d.ts +2 -0
  303. package/dist/drivers/index.d.ts.map +1 -0
  304. package/dist/drivers/launch-options.d.ts +10 -0
  305. package/dist/drivers/launch-options.d.ts.map +1 -0
  306. package/dist/drivers/network-profiles.d.ts +9 -0
  307. package/dist/drivers/network-profiles.d.ts.map +1 -0
  308. package/dist/drivers/playwright-parser.d.ts +16 -0
  309. package/dist/drivers/playwright-parser.d.ts.map +1 -0
  310. package/dist/drivers/playwright.d.ts +65 -0
  311. package/dist/drivers/playwright.d.ts.map +1 -0
  312. package/dist/drivers/raw-driver.d.ts +403 -0
  313. package/dist/drivers/raw-driver.d.ts.map +1 -0
  314. package/dist/drivers/uiautomator2/client.d.ts +77 -0
  315. package/dist/drivers/uiautomator2/client.d.ts.map +1 -0
  316. package/dist/drivers/uiautomator2/driver.d.ts +20 -0
  317. package/dist/drivers/uiautomator2/driver.d.ts.map +1 -0
  318. package/dist/drivers/uiautomator2/index.d.ts +5 -0
  319. package/dist/drivers/uiautomator2/index.d.ts.map +1 -0
  320. package/dist/drivers/uiautomator2/installer.d.ts +20 -0
  321. package/dist/drivers/uiautomator2/installer.d.ts.map +1 -0
  322. package/dist/drivers/uiautomator2/pagesource.d.ts +12 -0
  323. package/dist/drivers/uiautomator2/pagesource.d.ts.map +1 -0
  324. package/dist/drivers/wasm-utils.d.ts +100 -0
  325. package/dist/drivers/wasm-utils.d.ts.map +1 -0
  326. package/dist/drivers/wasm.d.ts +57 -0
  327. package/dist/drivers/wasm.d.ts.map +1 -0
  328. package/dist/drivers/wda/client.d.ts +116 -0
  329. package/dist/drivers/wda/client.d.ts.map +1 -0
  330. package/dist/drivers/wda/driver.d.ts +26 -0
  331. package/dist/drivers/wda/driver.d.ts.map +1 -0
  332. package/dist/drivers/wda/index.d.ts +5 -0
  333. package/dist/drivers/wda/index.d.ts.map +1 -0
  334. package/dist/drivers/wda/installer.d.ts +51 -0
  335. package/dist/drivers/wda/installer.d.ts.map +1 -0
  336. package/dist/drivers/wda/pagesource.d.ts +12 -0
  337. package/dist/drivers/wda/pagesource.d.ts.map +1 -0
  338. package/dist/electrobun-MPAHMSI2.js +15 -0
  339. package/dist/{installer-5UHTYQTB.js.map → electrobun-MPAHMSI2.js.map} +0 -0
  340. package/dist/electron-SQACDON3.js +9 -0
  341. package/dist/{ios-Y4TO5MBR.js.map → electron-SQACDON3.js.map} +0 -0
  342. package/dist/errors.d.ts +82 -0
  343. package/dist/errors.d.ts.map +1 -0
  344. package/dist/{filters-MQG2RMPX.js → filters-5DCGGJRN.js} +3 -3
  345. package/dist/{local-DM3YBSV5.js.map → filters-5DCGGJRN.js.map} +0 -0
  346. package/dist/gherkin/compiler.d.ts +3 -0
  347. package/dist/gherkin/compiler.d.ts.map +1 -0
  348. package/dist/gherkin/index.d.ts +7 -0
  349. package/dist/gherkin/index.d.ts.map +1 -0
  350. package/dist/gherkin/matcher.d.ts +9 -0
  351. package/dist/gherkin/matcher.d.ts.map +1 -0
  352. package/dist/gherkin/registry.d.ts +28 -0
  353. package/dist/gherkin/registry.d.ts.map +1 -0
  354. package/dist/gherkin/steps.d.ts +13 -31
  355. package/dist/gherkin/steps.d.ts.map +1 -0
  356. package/dist/gherkin/steps.js +5 -2
  357. package/dist/gherkin/steps.js.map +1 -1
  358. package/dist/gherkin/world.d.ts +15 -0
  359. package/dist/gherkin/world.d.ts.map +1 -0
  360. package/dist/{github-pr-YMWIPCCZ.js → github-pr-RYO6IAKD.js} +3 -3
  361. package/dist/{machine-6H25TRTU.js.map → github-pr-RYO6IAKD.js.map} +0 -0
  362. package/dist/{html-FLMWPFQD.js → html-KJ2QAGF4.js} +6 -3
  363. package/dist/{html-FLMWPFQD.js.map → html-KJ2QAGF4.js.map} +1 -1
  364. package/dist/index.d.ts +57 -2267
  365. package/dist/index.d.ts.map +1 -0
  366. package/dist/index.js +460 -69
  367. package/dist/index.js.map +1 -1
  368. package/dist/{init-command-Z3QREABL.js → init-command-V5VGN3IS.js} +5 -2
  369. package/dist/{init-command-Z3QREABL.js.map → init-command-V5VGN3IS.js.map} +1 -1
  370. package/dist/{init-flow-command-4EKRVTNT.js → init-flow-command-INYUCC6N.js} +6 -3
  371. package/dist/{init-flow-command-4EKRVTNT.js.map → init-flow-command-INYUCC6N.js.map} +1 -1
  372. package/dist/{installer-5UHTYQTB.js → installer-DMTY47SI.js} +5 -5
  373. package/dist/{provider-YIPU5K42.js.map → installer-DMTY47SI.js.map} +0 -0
  374. package/dist/installer-KL2NCILK.js +17 -0
  375. package/dist/{runner-WOVZWUQR.js.map → installer-KL2NCILK.js.map} +0 -0
  376. package/dist/{ios-Y4TO5MBR.js → ios-SZ4RBI7Q.js} +4 -4
  377. package/dist/{server-ING5D5ZJ.js.map → ios-SZ4RBI7Q.js.map} +0 -0
  378. package/dist/json-57Z2YSES.js +39 -0
  379. package/dist/json-57Z2YSES.js.map +1 -0
  380. package/dist/{junit-CGB3LKHD.js → junit-MHD5AXBU.js} +26 -6
  381. package/dist/junit-MHD5AXBU.js.map +1 -0
  382. package/dist/{local-DM3YBSV5.js → local-SWHWINSA.js} +11 -12
  383. package/dist/{session-5TNWVGQQ.js.map → local-SWHWINSA.js.map} +0 -0
  384. package/dist/{machine-6H25TRTU.js → machine-NOOFRT45.js} +3 -3
  385. package/dist/{validator-WO5IL7IY.js.map → machine-NOOFRT45.js.map} +0 -0
  386. package/dist/machine.d.ts +20 -0
  387. package/dist/machine.d.ts.map +1 -0
  388. package/dist/mcp/server.d.ts +73 -0
  389. package/dist/mcp/server.d.ts.map +1 -0
  390. package/dist/pagesource-KIQ5T5MA.js +9 -0
  391. package/dist/pagesource-KIQ5T5MA.js.map +1 -0
  392. package/dist/pagesource-KKG7WMFJ.js +9 -0
  393. package/dist/pagesource-KKG7WMFJ.js.map +1 -0
  394. package/dist/playwright-42QYIZEE.js +28 -0
  395. package/dist/playwright-42QYIZEE.js.map +1 -0
  396. package/dist/{provider-YIPU5K42.js → provider-CBAXZ2VA.js} +3 -3
  397. package/dist/provider-CBAXZ2VA.js.map +1 -0
  398. package/dist/{redact-U72BUBBR.js → redact-OG4M3IEU.js} +5 -2
  399. package/dist/{redact-U72BUBBR.js.map → redact-OG4M3IEU.js.map} +1 -1
  400. package/dist/report/allure.d.ts +3 -0
  401. package/dist/report/allure.d.ts.map +1 -0
  402. package/dist/report/classify-error.d.ts +7 -0
  403. package/dist/report/classify-error.d.ts.map +1 -0
  404. package/dist/report/code-frame.d.ts +16 -0
  405. package/dist/report/code-frame.d.ts.map +1 -0
  406. package/dist/report/console.d.ts +7 -0
  407. package/dist/report/console.d.ts.map +1 -0
  408. package/dist/report/failure-bundle.d.ts +66 -0
  409. package/dist/report/failure-bundle.d.ts.map +1 -0
  410. package/dist/report/failure-diagnostics.d.ts +11 -0
  411. package/dist/report/failure-diagnostics.d.ts.map +1 -0
  412. package/dist/report/github-pr.d.ts +20 -0
  413. package/dist/report/github-pr.d.ts.map +1 -0
  414. package/dist/report/html.d.ts +3 -0
  415. package/dist/report/html.d.ts.map +1 -0
  416. package/dist/report/index.d.ts +8 -0
  417. package/dist/report/index.d.ts.map +1 -0
  418. package/dist/report/json.d.ts +3 -0
  419. package/dist/report/json.d.ts.map +1 -0
  420. package/dist/report/junit.d.ts +3 -0
  421. package/dist/report/junit.d.ts.map +1 -0
  422. package/dist/report/redact.d.ts +29 -0
  423. package/dist/report/redact.d.ts.map +1 -0
  424. package/dist/report/selector-guardrails.d.ts +12 -0
  425. package/dist/report/selector-guardrails.d.ts.map +1 -0
  426. package/dist/report/types.d.ts +164 -0
  427. package/dist/report/types.d.ts.map +1 -0
  428. package/dist/{runner-WOVZWUQR.js → runner-ABGUVOJG.js} +5 -3
  429. package/dist/runner-ABGUVOJG.js.map +1 -0
  430. package/dist/runtime/appium-server.d.ts +34 -0
  431. package/dist/runtime/appium-server.d.ts.map +1 -0
  432. package/dist/runtime/appium.d.ts +5 -0
  433. package/dist/runtime/appium.d.ts.map +1 -0
  434. package/dist/runtime/capabilities.d.ts +19 -0
  435. package/dist/runtime/capabilities.d.ts.map +1 -0
  436. package/dist/runtime/daemon-manager.d.ts +83 -0
  437. package/dist/runtime/daemon-manager.d.ts.map +1 -0
  438. package/dist/runtime/local.d.ts +38 -0
  439. package/dist/runtime/local.d.ts.map +1 -0
  440. package/dist/runtime/types.d.ts +21 -0
  441. package/dist/runtime/types.d.ts.map +1 -0
  442. package/dist/runtime/web-server.d.ts +57 -0
  443. package/dist/runtime/web-server.d.ts.map +1 -0
  444. package/dist/schemas/config.d.ts +812 -0
  445. package/dist/schemas/config.d.ts.map +1 -0
  446. package/dist/schemas/device.d.ts +12 -0
  447. package/dist/schemas/device.d.ts.map +1 -0
  448. package/dist/schemas/element.d.ts +66 -0
  449. package/dist/schemas/element.d.ts.map +1 -0
  450. package/dist/schemas/index.d.ts +5 -0
  451. package/dist/schemas/index.d.ts.map +1 -0
  452. package/dist/schemas/selector.d.ts +193 -0
  453. package/dist/schemas/selector.d.ts.map +1 -0
  454. package/dist/screenshot-compare-BJRJHKNQ.js +12 -0
  455. package/dist/screenshot-compare-BJRJHKNQ.js.map +1 -0
  456. package/dist/server-2Y46CDVB.js +6749 -0
  457. package/dist/server-2Y46CDVB.js.map +1 -0
  458. package/dist/{server-ING5D5ZJ.js → server-ZCBZ4UYF.js} +3 -3
  459. package/dist/server-ZCBZ4UYF.js.map +1 -0
  460. package/dist/session-5XW6TKF4.js +39 -0
  461. package/dist/session-5XW6TKF4.js.map +1 -0
  462. package/dist/smart/auto-wait.d.ts +38 -0
  463. package/dist/smart/auto-wait.d.ts.map +1 -0
  464. package/dist/smart/channel-resolver.d.ts +90 -0
  465. package/dist/smart/channel-resolver.d.ts.map +1 -0
  466. package/dist/smart/coordinator.d.ts +162 -0
  467. package/dist/smart/coordinator.d.ts.map +1 -0
  468. package/dist/smart/diagnostics.d.ts +15 -0
  469. package/dist/smart/diagnostics.d.ts.map +1 -0
  470. package/dist/smart/element-matcher.d.ts +24 -0
  471. package/dist/smart/element-matcher.d.ts.map +1 -0
  472. package/dist/smart/hierarchy-cache.d.ts +16 -0
  473. package/dist/smart/hierarchy-cache.d.ts.map +1 -0
  474. package/dist/smart/index.d.ts +4 -0
  475. package/dist/smart/index.d.ts.map +1 -0
  476. package/dist/studio/api.d.ts +317 -0
  477. package/dist/studio/api.d.ts.map +1 -0
  478. package/dist/studio/context.d.ts +7 -0
  479. package/dist/studio/context.d.ts.map +1 -0
  480. package/dist/studio/core/element-tree.d.ts +15 -0
  481. package/dist/studio/core/element-tree.d.ts.map +1 -0
  482. package/dist/studio/effect-handler.d.ts +3 -0
  483. package/dist/studio/effect-handler.d.ts.map +1 -0
  484. package/dist/studio/procedures.d.ts +4 -0
  485. package/dist/studio/procedures.d.ts.map +1 -0
  486. package/dist/studio/recording-session.d.ts +31 -0
  487. package/dist/studio/recording-session.d.ts.map +1 -0
  488. package/dist/studio/routers/devices.d.ts +11 -0
  489. package/dist/studio/routers/devices.d.ts.map +1 -0
  490. package/dist/studio/routers/inspector.d.ts +104 -0
  491. package/dist/studio/routers/inspector.d.ts.map +1 -0
  492. package/dist/studio/routers/recording.d.ts +130 -0
  493. package/dist/studio/routers/recording.d.ts.map +1 -0
  494. package/dist/studio/routers/tests.d.ts +93 -0
  495. package/dist/studio/routers/tests.d.ts.map +1 -0
  496. package/dist/studio/server.d.ts +12 -0
  497. package/dist/studio/server.d.ts.map +1 -0
  498. package/dist/{studio-command-KK7A3KN6.js → studio-command-BNBOL424.js} +6 -3
  499. package/dist/{studio-command-KK7A3KN6.js.map → studio-command-BNBOL424.js.map} +1 -1
  500. package/dist/{test-command-QGIJBRH7.js → test-command-T4PLAZXU.js} +311 -1080
  501. package/dist/test-command-T4PLAZXU.js.map +1 -0
  502. package/dist/{validator-WO5IL7IY.js → validator-AJNOFBQM.js} +4 -4
  503. package/dist/validator-AJNOFBQM.js.map +1 -0
  504. package/dist/watch-mode-NR5MHNNL.js +10 -0
  505. package/dist/watch-mode-NR5MHNNL.js.map +1 -0
  506. package/native/darwin-arm64/libspana_native.dylib +0 -0
  507. package/native/darwin-x64/libspana_native.dylib +0 -0
  508. package/native/linux-arm64/libspana_native.so +0 -0
  509. package/native/linux-x64/libspana_native.so +0 -0
  510. package/native/win32-x64/spana_native.dll +0 -0
  511. package/package.json +16 -19
  512. package/studio-dist/assets/index-CHLA4F7b.css +2 -0
  513. package/studio-dist/assets/index-DXGUfzm3.js +23 -0
  514. package/studio-dist/index.html +2 -2
  515. package/dist/accessibility-audit-YZOPUY3D.js.map +0 -1
  516. package/dist/app-RSDPDTKT.js +0 -10
  517. package/dist/chunk-3IZMPNE7.js.map +0 -1
  518. package/dist/chunk-4KK4E3N3.js.map +0 -1
  519. package/dist/chunk-54ASKII6.js +0 -183
  520. package/dist/chunk-54ASKII6.js.map +0 -1
  521. package/dist/chunk-64UZQP7Z.js.map +0 -1
  522. package/dist/chunk-6PTUVG6A.js.map +0 -1
  523. package/dist/chunk-DGUM43GV.js +0 -11
  524. package/dist/chunk-FPQAJNE3.js.map +0 -1
  525. package/dist/chunk-FXBWACUT.js +0 -4378
  526. package/dist/chunk-FXBWACUT.js.map +0 -1
  527. package/dist/chunk-SGZMO456.js.map +0 -1
  528. package/dist/chunk-WS2TVNMY.js +0 -2494
  529. package/dist/chunk-WS2TVNMY.js.map +0 -1
  530. package/dist/chunk-X2TJP7LB.js.map +0 -1
  531. package/dist/chunk-XA6LWLZQ.js +0 -310
  532. package/dist/chunk-XA6LWLZQ.js.map +0 -1
  533. package/dist/chunk-Z6K4QQAR.js.map +0 -1
  534. package/dist/config-loader-CNGIW2XK.js +0 -9
  535. package/dist/console-DIYEJSSP.js.map +0 -1
  536. package/dist/discover-NKDMB4UI.js +0 -15
  537. package/dist/flow-DddAj1xv.d.ts +0 -1913
  538. package/dist/json-JMRPUVY2.js +0 -20
  539. package/dist/json-JMRPUVY2.js.map +0 -1
  540. package/dist/junit-CGB3LKHD.js.map +0 -1
  541. package/dist/screenshot-compare-POTXVUTL.js +0 -136
  542. package/dist/screenshot-compare-POTXVUTL.js.map +0 -1
  543. package/dist/server-JNQ2PLCC.js +0 -855
  544. package/dist/server-JNQ2PLCC.js.map +0 -1
  545. package/dist/session-5TNWVGQQ.js +0 -21
  546. package/dist/test-command-QGIJBRH7.js.map +0 -1
  547. package/studio-dist/assets/index-CBFsOh-9.js +0 -193
  548. package/studio-dist/assets/index-DH_18EyL.css +0 -1
@@ -1,855 +0,0 @@
1
- import {
2
- connect
3
- } from "./chunk-4SA7JK5D.js";
4
- import {
5
- discoverDevices
6
- } from "./chunk-VUNH4AJD.js";
7
- import "./chunk-FXBWACUT.js";
8
- import "./chunk-WS2TVNMY.js";
9
- import "./chunk-2AFWVHQK.js";
10
- import "./chunk-WV3ALL3H.js";
11
- import "./chunk-VP6V4XEJ.js";
12
- import "./chunk-Z6K4QQAR.js";
13
- import "./chunk-JPZCZHL4.js";
14
- import {
15
- discoverFlows,
16
- discoverStepFiles,
17
- filterFlows,
18
- loadStepFiles,
19
- loadTestSource
20
- } from "./chunk-64UZQP7Z.js";
21
- import "./chunk-4KK4E3N3.js";
22
- import "./chunk-6PTUVG6A.js";
23
- import "./chunk-SGZMO456.js";
24
- import {
25
- __require
26
- } from "./chunk-DGUM43GV.js";
27
-
28
- // src/studio/server.ts
29
- import { Hono } from "hono";
30
- import { cors } from "hono/cors";
31
- import { serve } from "@hono/node-server";
32
- import { onError } from "@orpc/server";
33
- import { readFile, stat } from "fs/promises";
34
- import { join, resolve as resolve3, sep } from "path";
35
- import { RPCHandler } from "@orpc/server/fetch";
36
- import { ManagedRuntime, Layer } from "effect";
37
-
38
- // src/studio/routers/devices.ts
39
- import { z } from "zod";
40
-
41
- // src/studio/procedures.ts
42
- import { os } from "@orpc/server";
43
- var o = os.$context();
44
- var publicProcedure = o;
45
-
46
- // src/studio/routers/devices.ts
47
- var devicesRouter = {
48
- list: publicProcedure.input(
49
- z.object({
50
- platforms: z.array(z.enum(["web", "android", "ios"])).optional()
51
- }).optional()
52
- ).handler(async ({ input }) => {
53
- const platforms = input?.platforms ?? ["web", "android", "ios"];
54
- const devices = discoverDevices(platforms);
55
- return devices;
56
- })
57
- };
58
-
59
- // src/studio/routers/inspector.ts
60
- import { z as z2 } from "zod";
61
- var sessions = /* @__PURE__ */ new Map();
62
- function sessionKey(platform, deviceId) {
63
- return `${platform}:${deviceId ?? "default"}`;
64
- }
65
- function connectOptsFromConfig(platform, config, deviceId) {
66
- const opts = { platform, device: deviceId };
67
- if (platform === "web") {
68
- opts.baseUrl = config.apps?.web?.url ?? "http://localhost:3000";
69
- opts.browser = config.execution?.web?.browser;
70
- opts.storageState = config.execution?.web?.storageState;
71
- opts.headless = false;
72
- } else if (platform === "android") {
73
- opts.packageName = config.apps?.android?.packageName ?? "";
74
- } else if (platform === "ios") {
75
- opts.bundleId = config.apps?.ios?.bundleId ?? "";
76
- }
77
- return opts;
78
- }
79
- async function getOrCreateSession(platform, config, deviceId) {
80
- const key = sessionKey(platform, deviceId);
81
- const existing = sessions.get(key);
82
- if (existing) return existing;
83
- const opts = connectOptsFromConfig(platform, config, deviceId);
84
- const session = await connect(opts);
85
- sessions.set(key, session);
86
- return session;
87
- }
88
- async function disconnectSession(platform, deviceId) {
89
- const key = sessionKey(platform, deviceId);
90
- const session = sessions.get(key);
91
- sessions.delete(key);
92
- if (session) {
93
- await session.disconnect();
94
- }
95
- }
96
- async function runWithRecoveredSession(action, resetSession) {
97
- try {
98
- return await action();
99
- } catch {
100
- await resetSession();
101
- }
102
- try {
103
- return await action();
104
- } catch (error) {
105
- await resetSession();
106
- throw error;
107
- }
108
- }
109
- var inspectorInput = z2.object({
110
- platform: z2.enum(["web", "android", "ios"]),
111
- deviceId: z2.string().optional()
112
- });
113
- var inspectorRouter = {
114
- screenshot: publicProcedure.input(inspectorInput).handler(async ({ input, context }) => {
115
- const data = await runWithRecoveredSession(
116
- async () => {
117
- const session = await getOrCreateSession(input.platform, context.config, input.deviceId);
118
- return session.screenshot();
119
- },
120
- () => disconnectSession(input.platform, input.deviceId)
121
- );
122
- return { image: Buffer.from(data).toString("base64") };
123
- }),
124
- hierarchy: publicProcedure.input(inspectorInput).handler(async ({ input, context }) => {
125
- return runWithRecoveredSession(
126
- async () => {
127
- const session = await getOrCreateSession(input.platform, context.config, input.deviceId);
128
- return session.hierarchy();
129
- },
130
- () => disconnectSession(input.platform, input.deviceId)
131
- );
132
- }),
133
- selectors: publicProcedure.input(inspectorInput).handler(async ({ input, context }) => {
134
- return runWithRecoveredSession(
135
- async () => {
136
- const session = await getOrCreateSession(input.platform, context.config, input.deviceId);
137
- return session.selectors();
138
- },
139
- () => disconnectSession(input.platform, input.deviceId)
140
- );
141
- }),
142
- disconnect: publicProcedure.input(inspectorInput).handler(async ({ input }) => {
143
- await disconnectSession(input.platform, input.deviceId);
144
- return { disconnected: true };
145
- })
146
- };
147
-
148
- // src/studio/routers/recording.ts
149
- import { z as z3 } from "zod";
150
- import * as fs from "fs/promises";
151
- import * as path from "path";
152
-
153
- // src/studio/recording-session.ts
154
- var _idCounter = 0;
155
- function generateId(prefix) {
156
- return `${prefix}-${Date.now()}-${++_idCounter}`;
157
- }
158
- var RecordingSessionStore = class {
159
- sessions = /* @__PURE__ */ new Map();
160
- start(platform) {
161
- const session = {
162
- id: generateId("session"),
163
- platform,
164
- status: "recording",
165
- actions: []
166
- };
167
- this.sessions.set(session.id, session);
168
- return session;
169
- }
170
- get(sessionId) {
171
- return this.sessions.get(sessionId);
172
- }
173
- stop(sessionId) {
174
- const session = this.sessions.get(sessionId);
175
- if (!session) return void 0;
176
- session.status = "stopped";
177
- return session;
178
- }
179
- addAction(sessionId, input) {
180
- const session = this.sessions.get(sessionId);
181
- if (!session) return void 0;
182
- const action = { id: generateId("action"), ...input };
183
- session.actions.push(action);
184
- return action;
185
- }
186
- deleteAction(sessionId, actionId) {
187
- const session = this.sessions.get(sessionId);
188
- if (!session) return void 0;
189
- session.actions = session.actions.filter((a) => a.id !== actionId);
190
- return session;
191
- }
192
- reorderActions(sessionId, orderedIds) {
193
- const session = this.sessions.get(sessionId);
194
- if (!session) return void 0;
195
- const byId = new Map(session.actions.map((a) => [a.id, a]));
196
- session.actions = orderedIds.flatMap((id) => {
197
- const action = byId.get(id);
198
- return action ? [action] : [];
199
- });
200
- return session;
201
- }
202
- updateSelector(sessionId, actionId, selector) {
203
- const session = this.sessions.get(sessionId);
204
- if (!session) return void 0;
205
- const action = session.actions.find((a) => a.id === actionId);
206
- if (!action) return void 0;
207
- action.selector = selector;
208
- return session;
209
- }
210
- };
211
-
212
- // src/core/flow-generator.ts
213
- function formatSelector(selector) {
214
- if (typeof selector === "string") {
215
- return `"${selector}"`;
216
- }
217
- if ("testID" in selector) {
218
- return `{ testID: "${selector.testID}" }`;
219
- }
220
- if ("text" in selector) {
221
- return `{ text: "${selector.text}" }`;
222
- }
223
- if ("accessibilityLabel" in selector) {
224
- return `{ accessibilityLabel: "${selector.accessibilityLabel}" }`;
225
- }
226
- if ("point" in selector) {
227
- return `{ point: { x: ${selector.point.x}, y: ${selector.point.y} } }`;
228
- }
229
- return JSON.stringify(selector);
230
- }
231
- function generateActionLine(action) {
232
- const { type, selector, params } = action;
233
- if (type === "expect.toBeVisible") {
234
- const sel = selector ? formatSelector(selector) : "undefined";
235
- return `await expect(${sel}).toBeVisible();`;
236
- }
237
- if (type === "expect.toHaveText") {
238
- const sel = selector ? formatSelector(selector) : "undefined";
239
- const expected = typeof params.expected === "string" ? params.expected : String(params.expected);
240
- return `await expect(${sel}).toHaveText("${expected}");`;
241
- }
242
- if (type === "back") {
243
- return `await app.back();`;
244
- }
245
- if (type === "pressKey") {
246
- const key = typeof params.key === "string" ? params.key : String(params.key);
247
- return `await app.pressKey("${key}");`;
248
- }
249
- if (type === "inputText") {
250
- const text = typeof params.text === "string" ? params.text : String(params.text);
251
- if (selector) {
252
- return `await app.inputText("${text}", ${formatSelector(selector)});`;
253
- }
254
- return `await app.inputText("${text}");`;
255
- }
256
- if (type === "scroll" || type === "swipe") {
257
- const direction = typeof params.direction === "string" ? params.direction : String(params.direction);
258
- if (selector) {
259
- return `await app.${type}("${direction}", ${formatSelector(selector)});`;
260
- }
261
- return `await app.${type}("${direction}");`;
262
- }
263
- if (selector) {
264
- return `await app.${type}(${formatSelector(selector)});`;
265
- }
266
- return `await app.${type}();`;
267
- }
268
- function generateFlowCode(flowName, actions) {
269
- const lines = actions.map((action) => ` ${generateActionLine(action)}`);
270
- const body = lines.length > 0 ? `
271
- ${lines.join("\n")}
272
- ` : "\n";
273
- return `import { flow } from "spana-test";
274
-
275
- export default flow("${flowName}", async ({ app, expect }) => {${body}});`;
276
- }
277
-
278
- // src/studio/routers/recording.ts
279
- var store = new RecordingSessionStore();
280
- var selectorSchema = z3.union([
281
- z3.string(),
282
- z3.object({ testID: z3.string() }),
283
- z3.object({ text: z3.string() }),
284
- z3.object({ accessibilityLabel: z3.string() }),
285
- z3.object({ point: z3.object({ x: z3.number(), y: z3.number() }) })
286
- ]);
287
- var platformEnum = z3.enum(["web", "android", "ios"]);
288
- var recordingRouter = {
289
- start: publicProcedure.input(
290
- z3.object({
291
- platform: platformEnum,
292
- deviceId: z3.string().optional()
293
- })
294
- ).handler(async ({ input }) => {
295
- const session = store.start(input.platform);
296
- return { sessionId: session.id };
297
- }),
298
- stop: publicProcedure.input(z3.object({ sessionId: z3.string() })).handler(async ({ input }) => {
299
- store.stop(input.sessionId);
300
- }),
301
- addAction: publicProcedure.input(
302
- z3.object({
303
- sessionId: z3.string(),
304
- action: z3.object({
305
- type: z3.string(),
306
- selector: selectorSchema.optional(),
307
- selectorAlternatives: z3.array(selectorSchema).default([]),
308
- params: z3.record(z3.string(), z3.unknown()).default({}),
309
- timestamp: z3.number(),
310
- screenshotPath: z3.string().optional()
311
- })
312
- })
313
- ).handler(async ({ input }) => {
314
- const action = store.addAction(input.sessionId, input.action);
315
- if (!action) throw new Error(`Session not found: ${input.sessionId}`);
316
- return { actionId: action.id };
317
- }),
318
- deleteAction: publicProcedure.input(z3.object({ sessionId: z3.string(), actionId: z3.string() })).handler(async ({ input }) => {
319
- store.deleteAction(input.sessionId, input.actionId);
320
- }),
321
- reorderActions: publicProcedure.input(z3.object({ sessionId: z3.string(), actionIds: z3.array(z3.string()) })).handler(async ({ input }) => {
322
- store.reorderActions(input.sessionId, input.actionIds);
323
- }),
324
- updateSelector: publicProcedure.input(
325
- z3.object({
326
- sessionId: z3.string(),
327
- actionId: z3.string(),
328
- selector: selectorSchema
329
- })
330
- ).handler(async ({ input }) => {
331
- store.updateSelector(input.sessionId, input.actionId, input.selector);
332
- }),
333
- getSession: publicProcedure.input(z3.object({ sessionId: z3.string() })).handler(async ({ input }) => {
334
- const session = store.get(input.sessionId);
335
- if (!session) throw new Error(`Session not found: ${input.sessionId}`);
336
- return session;
337
- }),
338
- generateCode: publicProcedure.input(z3.object({ sessionId: z3.string(), flowName: z3.string() })).handler(async ({ input }) => {
339
- const session = store.get(input.sessionId);
340
- if (!session) throw new Error(`Session not found: ${input.sessionId}`);
341
- const code = generateFlowCode(input.flowName, session.actions);
342
- return { code };
343
- }),
344
- save: publicProcedure.input(
345
- z3.object({
346
- sessionId: z3.string(),
347
- flowName: z3.string(),
348
- flowDir: z3.string().optional()
349
- })
350
- ).handler(async ({ input, context }) => {
351
- const session = store.get(input.sessionId);
352
- if (!session) throw new Error(`Session not found: ${input.sessionId}`);
353
- const code = generateFlowCode(input.flowName, session.actions);
354
- const dir = input.flowDir ?? context.config.flowDir ?? "flows";
355
- const fileName = `${input.flowName}.ts`;
356
- const filePath = path.resolve(dir, fileName);
357
- await fs.mkdir(dir, { recursive: true });
358
- await fs.writeFile(filePath, code, "utf8");
359
- return { filePath, code };
360
- }),
361
- executeAction: publicProcedure.input(
362
- z3.object({
363
- sessionId: z3.string(),
364
- platform: platformEnum,
365
- deviceId: z3.string().optional(),
366
- actionType: z3.string(),
367
- selector: selectorSchema.optional(),
368
- params: z3.record(z3.string(), z3.unknown()).optional()
369
- })
370
- ).handler(async ({ input, context }) => {
371
- const agentSession = await getOrCreateSession(input.platform, context.config, input.deviceId);
372
- const sel = input.selector;
373
- const params = input.params ?? {};
374
- switch (input.actionType) {
375
- case "tap":
376
- if (sel) await agentSession.tap(sel);
377
- break;
378
- case "doubleTap":
379
- if (sel) await agentSession.doubleTap(sel);
380
- break;
381
- case "longPress":
382
- if (sel) await agentSession.longPress(sel);
383
- break;
384
- case "inputText":
385
- await agentSession.inputText(String(params.text ?? ""));
386
- break;
387
- case "scroll":
388
- await agentSession.scroll(
389
- String(params.direction ?? "down")
390
- );
391
- break;
392
- case "swipe":
393
- await agentSession.swipe(
394
- String(params.direction ?? "left")
395
- );
396
- break;
397
- case "pressKey":
398
- await agentSession.pressKey(String(params.key ?? ""));
399
- break;
400
- case "back":
401
- await agentSession.back();
402
- break;
403
- default:
404
- break;
405
- }
406
- const selectorAlternatives = await agentSession.selectors();
407
- return { selectorAlternatives };
408
- })
409
- };
410
-
411
- // src/studio/routers/tests.ts
412
- import { z as z4 } from "zod";
413
- import { resolve as resolve2 } from "path";
414
- var mapAttachments = (atts) => atts?.filter((a) => a.contentType === "image/png").map((a) => {
415
- const match = a.path.match(/spana-output\/(.+)$/);
416
- const relativePath = match ? match[1] : a.path;
417
- return {
418
- name: a.name,
419
- contentType: a.contentType,
420
- path: a.path,
421
- url: `/artifacts/${relativePath}`
422
- };
423
- }) ?? [];
424
- var activeChildren = /* @__PURE__ */ new Set();
425
- function killActiveChildren() {
426
- for (const child of activeChildren) {
427
- child.kill("SIGTERM");
428
- }
429
- activeChildren.clear();
430
- }
431
- var activeRuns = /* @__PURE__ */ new Map();
432
- var runCounter = 0;
433
- function nextRunId() {
434
- runCounter += 1;
435
- return `run-${Date.now()}-${runCounter}`;
436
- }
437
- var platformEnum2 = z4.enum(["web", "android", "ios"]);
438
- function buildDeviceSelectionArgs(devices) {
439
- if (!devices || devices.length === 0) {
440
- return [];
441
- }
442
- const selectedPlatforms = new Set(devices.map((device) => device.platform));
443
- const explicitlyTargeted = devices.filter(
444
- (device) => Boolean(device.deviceId)
445
- );
446
- const explicitPlatforms = new Set(explicitlyTargeted.map((device) => device.platform));
447
- const explicitDeviceIds = [...new Set(explicitlyTargeted.map((device) => device.deviceId))];
448
- if (explicitDeviceIds.length === 0) {
449
- return [];
450
- }
451
- const canUseSingleDeviceFlag = explicitDeviceIds.length === 1 && explicitPlatforms.size === 1 && selectedPlatforms.size === explicitPlatforms.size;
452
- return canUseSingleDeviceFlag ? ["--device", explicitDeviceIds[0]] : ["--devices", explicitDeviceIds.join(",")];
453
- }
454
- async function discoverAndLoad(flowDir) {
455
- const dir = resolve2(flowDir);
456
- try {
457
- const { execFileSync } = await import("child_process");
458
- const runnerPath = resolve2(dir, "../../src/core/runner.ts");
459
- const script = `
460
- import { discoverFlows, loadTestSource } from ${JSON.stringify(runnerPath)};
461
- const paths = await discoverFlows(${JSON.stringify(dir)});
462
- const flows = [];
463
- for (const p of paths) {
464
- try {
465
- const loaded = await loadTestSource(p);
466
- flows.push(...loaded.map(f => ({ name: f.name, tags: f.config.tags ?? [], platforms: f.config.platforms ?? [] })));
467
- } catch {}
468
- }
469
- console.log(JSON.stringify(flows));
470
- `;
471
- const json = execFileSync("bun", ["-e", script], {
472
- encoding: "utf-8",
473
- timeout: 15e3,
474
- cwd: dir
475
- }).trim();
476
- const metadata = JSON.parse(json);
477
- return metadata.map((m) => ({
478
- name: m.name,
479
- fn: async () => {
480
- },
481
- config: { tags: m.tags, platforms: m.platforms }
482
- }));
483
- } catch {
484
- const flowPaths = await discoverFlows(dir);
485
- const hasFeature = flowPaths.some((p) => p.endsWith(".feature"));
486
- if (hasFeature) {
487
- const stepPaths = await discoverStepFiles(dir);
488
- if (stepPaths.length > 0) {
489
- await loadStepFiles(stepPaths);
490
- }
491
- }
492
- const flows = [];
493
- for (const p of flowPaths) {
494
- const loaded = await loadTestSource(p);
495
- flows.push(...loaded);
496
- }
497
- return flows;
498
- }
499
- }
500
- var testsRouter = {
501
- /** Discover flows and return metadata */
502
- listFlows: publicProcedure.input(
503
- z4.object({
504
- flowDir: z4.string().optional(),
505
- tags: z4.array(z4.string()).optional(),
506
- platforms: z4.array(platformEnum2).optional(),
507
- grep: z4.string().optional()
508
- }).optional()
509
- ).handler(async ({ input, context }) => {
510
- const flowDir = input?.flowDir ?? context.config.flowDir ?? "./flows";
511
- let flows;
512
- try {
513
- flows = await discoverAndLoad(flowDir);
514
- } catch (err) {
515
- console.error("[studio] Failed to discover flows:", err);
516
- return { flows: [] };
517
- }
518
- if (flows.length === 0) return { flows: [] };
519
- const filtered = filterFlows(flows, {
520
- tags: input?.tags,
521
- grep: input?.grep,
522
- platforms: input?.platforms
523
- });
524
- return {
525
- flows: filtered.map((f) => ({
526
- name: f.name,
527
- tags: f.config.tags ?? [],
528
- platforms: f.config.platforms ?? []
529
- }))
530
- };
531
- }),
532
- /** Start a test run in the background, return a run ID */
533
- run: publicProcedure.input(
534
- z4.object({
535
- platforms: z4.array(platformEnum2).min(1),
536
- flowDir: z4.string().optional(),
537
- tags: z4.array(z4.string()).optional(),
538
- grep: z4.string().optional(),
539
- captureScreenshots: z4.boolean().optional(),
540
- captureSteps: z4.boolean().optional(),
541
- devices: z4.array(z4.object({ platform: platformEnum2, deviceId: z4.string().optional() })).optional()
542
- })
543
- ).handler(async ({ input, context }) => {
544
- const runId = nextRunId();
545
- const run = { id: runId, status: "running", results: [] };
546
- const platforms = input.platforms;
547
- try {
548
- const flowDir = input.flowDir ?? context.config.flowDir ?? "./flows";
549
- const flows = await discoverAndLoad(flowDir);
550
- const filtered = filterFlows(flows, {
551
- tags: input.tags,
552
- grep: input.grep,
553
- platforms: input.platforms
554
- });
555
- const totals = {};
556
- for (const p of platforms) {
557
- totals[p] = filtered.length;
558
- }
559
- run.platformTotals = totals;
560
- } catch {
561
- }
562
- activeRuns.set(runId, run);
563
- void (async () => {
564
- const flowDir = input.flowDir ?? context.config.flowDir ?? "./flows";
565
- try {
566
- const { spawn } = await import("child_process");
567
- const cliPath = resolve2(process.argv[1]);
568
- const args = [
569
- cliPath,
570
- "test",
571
- flowDir,
572
- "--platform",
573
- platforms.join(","),
574
- "--reporter",
575
- "json"
576
- ];
577
- if (input.grep) {
578
- args.push("--grep", input.grep);
579
- }
580
- if (input.tags && input.tags.length > 0) {
581
- args.push("--tag", input.tags.join(","));
582
- }
583
- args.push(
584
- ...buildDeviceSelectionArgs(
585
- input.devices
586
- )
587
- );
588
- let tmpConfig;
589
- if (input.captureScreenshots || input.captureSteps) {
590
- const { writeFileSync } = await import("fs");
591
- const { tmpdir } = await import("os");
592
- tmpConfig = resolve2(tmpdir(), `spana-studio-${runId}.config.js`);
593
- const originalConfig = context.config;
594
- const configObj = {
595
- ...originalConfig,
596
- artifacts: {
597
- ...originalConfig.artifacts,
598
- captureOnSuccess: input.captureScreenshots ?? false,
599
- captureOnFailure: true,
600
- captureSteps: input.captureSteps ?? false,
601
- screenshot: true,
602
- uiHierarchy: true
603
- }
604
- };
605
- writeFileSync(tmpConfig, `export default ${JSON.stringify(configObj)};`);
606
- args.push("--config", tmpConfig);
607
- }
608
- const child = spawn("bun", args, {
609
- cwd: resolve2("."),
610
- stdio: ["ignore", "pipe", "pipe"]
611
- });
612
- activeChildren.add(child);
613
- child.on("close", () => activeChildren.delete(child));
614
- child.stderr.on("data", (chunk) => {
615
- const msg = chunk.toString().trim();
616
- if (msg) console.log("[studio:test]", msg);
617
- });
618
- let stdout = "";
619
- child.stdout.on("data", (chunk) => {
620
- stdout += chunk.toString();
621
- const lines = stdout.split("\n");
622
- stdout = lines.pop() ?? "";
623
- for (const line of lines) {
624
- if (!line.trim()) continue;
625
- try {
626
- const event = JSON.parse(line);
627
- if (event.event === "flowPass" || event.event === "flowFail") {
628
- run.results.push({
629
- name: event.name,
630
- platform: event.platform,
631
- status: event.status,
632
- durationMs: event.durationMs,
633
- error: event.error,
634
- steps: event.steps?.map((s) => ({
635
- ...s,
636
- attachments: mapAttachments(s.attachments)
637
- })),
638
- attachments: mapAttachments(event.attachments)
639
- });
640
- }
641
- if (event.event === "runComplete") {
642
- run.summary = {
643
- total: event.total,
644
- passed: event.passed,
645
- failed: event.failed,
646
- skipped: event.skipped,
647
- flaky: event.flaky ?? 0,
648
- durationMs: event.durationMs,
649
- results: run.results,
650
- platforms
651
- };
652
- }
653
- } catch {
654
- }
655
- }
656
- });
657
- child.on("close", (code) => {
658
- if (code !== 0) {
659
- console.error("[studio:test] Process exited with code", code);
660
- }
661
- if (tmpConfig) {
662
- try {
663
- const { unlinkSync } = __require("fs");
664
- unlinkSync(tmpConfig);
665
- } catch {
666
- }
667
- }
668
- run.status = "completed";
669
- if (!run.summary) {
670
- run.summary = {
671
- total: run.results.length,
672
- passed: run.results.filter((r) => r.status === "passed").length,
673
- failed: run.results.filter((r) => r.status === "failed").length,
674
- skipped: run.results.filter((r) => r.status === "skipped").length,
675
- flaky: 0,
676
- durationMs: 0,
677
- results: run.results,
678
- platforms
679
- };
680
- }
681
- });
682
- } catch (err) {
683
- console.error("[studio] Failed to start test run:", err?.message ?? err, err?.stack);
684
- run.status = "completed";
685
- run.summary = {
686
- total: 0,
687
- passed: 0,
688
- failed: 0,
689
- skipped: 0,
690
- flaky: 0,
691
- durationMs: 0,
692
- results: [],
693
- platforms
694
- };
695
- }
696
- })();
697
- return { runId };
698
- }),
699
- /** Poll for run progress */
700
- status: publicProcedure.input(z4.object({ runId: z4.string() })).handler(({ input }) => {
701
- const run = activeRuns.get(input.runId);
702
- if (!run) {
703
- return { status: "not_found", results: [], progress: {} };
704
- }
705
- const progress = {};
706
- if (run.platformTotals) {
707
- for (const [platform, total] of Object.entries(run.platformTotals)) {
708
- const done = run.results.filter((r) => r.platform === platform).length;
709
- progress[platform] = { done, total };
710
- }
711
- }
712
- return {
713
- status: run.status,
714
- results: run.results,
715
- summary: run.summary,
716
- progress
717
- };
718
- }),
719
- /** Get final results for a completed run */
720
- results: publicProcedure.input(z4.object({ runId: z4.string() })).handler(({ input }) => {
721
- const run = activeRuns.get(input.runId);
722
- if (!run || run.status !== "completed") {
723
- return null;
724
- }
725
- return run.summary ?? null;
726
- })
727
- };
728
-
729
- // src/studio/api.ts
730
- var studioRouter = {
731
- devices: devicesRouter,
732
- inspector: inspectorRouter,
733
- recording: recordingRouter,
734
- tests: testsRouter
735
- };
736
-
737
- // src/studio/server.ts
738
- async function startStudio(options) {
739
- const { port, open, config, staticDir } = options;
740
- const app = new Hono();
741
- const StudioLayer = Layer.empty;
742
- const runtime = ManagedRuntime.make(StudioLayer);
743
- const rpcHandler = new RPCHandler(studioRouter, {
744
- interceptors: [
745
- onError((error) => {
746
- console.error("[studio]", error);
747
- })
748
- ]
749
- });
750
- app.use("/*", cors({ origin: `http://localhost:${port}`, credentials: true }));
751
- app.all("/rpc", async (c) => {
752
- const context = { runtime, config };
753
- const result = await rpcHandler.handle(c.req.raw, {
754
- prefix: "/rpc",
755
- context
756
- });
757
- if (result.matched) {
758
- return c.newResponse(result.response.body, result.response);
759
- }
760
- return c.notFound();
761
- });
762
- app.all("/rpc/*", async (c) => {
763
- const context = { runtime, config };
764
- const result = await rpcHandler.handle(c.req.raw, {
765
- prefix: "/rpc",
766
- context
767
- });
768
- if (result.matched) {
769
- return c.newResponse(result.response.body, result.response);
770
- }
771
- return c.notFound();
772
- });
773
- app.get("/artifacts/*", async (c) => {
774
- const artifactPath = decodeURIComponent(c.req.path.replace("/artifacts/", ""));
775
- const configOutputDir = config.artifacts?.outputDir ?? "spana-output";
776
- const outputDir = resolve3(
777
- configOutputDir.startsWith("/") ? configOutputDir : join(process.cwd(), configOutputDir)
778
- );
779
- const filePath = resolve3(outputDir, artifactPath);
780
- if (filePath !== outputDir && !filePath.startsWith(outputDir + sep)) {
781
- return c.text("Forbidden", 403);
782
- }
783
- try {
784
- const info = await stat(filePath);
785
- if (info.isFile()) {
786
- const content = await readFile(filePath);
787
- const ext = filePath.substring(filePath.lastIndexOf("."));
788
- const mime = ext === ".png" ? "image/png" : ext === ".json" ? "application/json" : "application/octet-stream";
789
- return c.body(content, 200, { "Content-Type": mime });
790
- }
791
- } catch {
792
- }
793
- return c.notFound();
794
- });
795
- if (staticDir) {
796
- const resolvedStaticDir = resolve3(staticDir);
797
- const mimeTypes = {
798
- ".html": "text/html",
799
- ".js": "application/javascript",
800
- ".css": "text/css",
801
- ".json": "application/json",
802
- ".png": "image/png",
803
- ".svg": "image/svg+xml",
804
- ".ico": "image/x-icon"
805
- };
806
- app.get("/*", async (c) => {
807
- const urlPath = c.req.path === "/" ? "/index.html" : c.req.path;
808
- const filePath = resolve3(resolvedStaticDir, urlPath.replace(/^\/+/, ""));
809
- if (filePath === resolvedStaticDir || filePath.startsWith(resolvedStaticDir + sep)) {
810
- try {
811
- const info = await stat(filePath);
812
- if (info.isFile()) {
813
- const content = await readFile(filePath);
814
- const ext = urlPath.substring(urlPath.lastIndexOf("."));
815
- return c.body(content, 200, {
816
- "Content-Type": mimeTypes[ext] ?? "application/octet-stream"
817
- });
818
- }
819
- } catch {
820
- }
821
- }
822
- const indexPath = join(resolvedStaticDir, "index.html");
823
- const html = await readFile(indexPath);
824
- return c.body(html, 200, { "Content-Type": "text/html" });
825
- });
826
- }
827
- const server = serve({ fetch: app.fetch, port });
828
- console.log(`
829
- Spana Studio running at http://localhost:${port}
830
- `);
831
- if (open) {
832
- const { execFile } = await import("child_process");
833
- const url = `http://localhost:${port}`;
834
- const [cmd, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url]] : ["xdg-open", [url]];
835
- execFile(cmd, args, (error) => {
836
- if (error) {
837
- console.warn(`[studio] Failed to open browser:`, error.message);
838
- }
839
- });
840
- }
841
- const shutdown = async () => {
842
- console.log("\n Shutting down Spana Studio...\n");
843
- killActiveChildren();
844
- server.close();
845
- await runtime.dispose();
846
- process.exit(0);
847
- };
848
- process.on("SIGTERM", shutdown);
849
- process.on("SIGINT", shutdown);
850
- return { server, shutdown };
851
- }
852
- export {
853
- startStudio
854
- };
855
- //# sourceMappingURL=server-JNQ2PLCC.js.map