@desplega.ai/qa-use 2.11.0 → 2.13.2

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 (393) hide show
  1. package/dist/lib/api/browser-types.d.ts +1 -0
  2. package/dist/lib/api/browser-types.d.ts.map +1 -1
  3. package/dist/lib/api/browser.d.ts +1 -0
  4. package/dist/lib/api/browser.d.ts.map +1 -1
  5. package/dist/lib/api/browser.js +14 -1
  6. package/dist/lib/api/browser.js.map +1 -1
  7. package/dist/lib/api/index.d.ts +4 -3
  8. package/dist/lib/api/index.d.ts.map +1 -1
  9. package/dist/lib/api/index.js +18 -2
  10. package/dist/lib/api/index.js.map +1 -1
  11. package/dist/lib/env/index.d.ts +7 -0
  12. package/dist/lib/env/index.d.ts.map +1 -1
  13. package/dist/lib/env/index.js +29 -0
  14. package/dist/lib/env/index.js.map +1 -1
  15. package/dist/package.json +1 -1
  16. package/dist/src/cli/commands/api/examples.d.ts +3 -0
  17. package/dist/src/cli/commands/api/examples.d.ts.map +1 -0
  18. package/dist/src/cli/commands/api/examples.js +48 -0
  19. package/dist/src/cli/commands/api/examples.js.map +1 -0
  20. package/dist/src/cli/commands/api/index.d.ts.map +1 -1
  21. package/dist/src/cli/commands/api/index.js +22 -0
  22. package/dist/src/cli/commands/api/index.js.map +1 -1
  23. package/dist/src/cli/commands/api/info.d.ts +3 -0
  24. package/dist/src/cli/commands/api/info.d.ts.map +1 -0
  25. package/dist/src/cli/commands/api/info.js +59 -0
  26. package/dist/src/cli/commands/api/info.js.map +1 -0
  27. package/dist/src/cli/commands/api/lib/openapi-spec.d.ts +22 -0
  28. package/dist/src/cli/commands/api/lib/openapi-spec.d.ts.map +1 -1
  29. package/dist/src/cli/commands/api/lib/openapi-spec.js +33 -1
  30. package/dist/src/cli/commands/api/lib/openapi-spec.js.map +1 -1
  31. package/dist/src/cli/commands/api/lib/output.d.ts +4 -0
  32. package/dist/src/cli/commands/api/lib/output.d.ts.map +1 -1
  33. package/dist/src/cli/commands/api/lib/output.js +90 -0
  34. package/dist/src/cli/commands/api/lib/output.js.map +1 -1
  35. package/dist/src/cli/commands/api/lib/route-matching.d.ts +4 -0
  36. package/dist/src/cli/commands/api/lib/route-matching.d.ts.map +1 -0
  37. package/dist/src/cli/commands/api/lib/route-matching.js +9 -0
  38. package/dist/src/cli/commands/api/lib/route-matching.js.map +1 -0
  39. package/dist/src/cli/commands/api/lib/schema-resolver.d.ts +30 -0
  40. package/dist/src/cli/commands/api/lib/schema-resolver.d.ts.map +1 -0
  41. package/dist/src/cli/commands/api/lib/schema-resolver.js +91 -0
  42. package/dist/src/cli/commands/api/lib/schema-resolver.js.map +1 -0
  43. package/dist/src/cli/commands/api/ls.d.ts.map +1 -1
  44. package/dist/src/cli/commands/api/ls.js +6 -1
  45. package/dist/src/cli/commands/api/ls.js.map +1 -1
  46. package/dist/src/cli/commands/api/openapi.d.ts +3 -0
  47. package/dist/src/cli/commands/api/openapi.d.ts.map +1 -0
  48. package/dist/src/cli/commands/api/openapi.js +55 -0
  49. package/dist/src/cli/commands/api/openapi.js.map +1 -0
  50. package/dist/src/cli/commands/api/request.d.ts.map +1 -1
  51. package/dist/src/cli/commands/api/request.js +9 -11
  52. package/dist/src/cli/commands/api/request.js.map +1 -1
  53. package/dist/src/cli/commands/app-config/create.d.ts +6 -0
  54. package/dist/src/cli/commands/app-config/create.d.ts.map +1 -0
  55. package/dist/src/cli/commands/app-config/create.js +32 -0
  56. package/dist/src/cli/commands/app-config/create.js.map +1 -0
  57. package/dist/src/cli/commands/app-config/delete.d.ts +6 -0
  58. package/dist/src/cli/commands/app-config/delete.d.ts.map +1 -0
  59. package/dist/src/cli/commands/app-config/delete.js +31 -0
  60. package/dist/src/cli/commands/app-config/delete.js.map +1 -0
  61. package/dist/src/cli/commands/app-config/index.d.ts +6 -0
  62. package/dist/src/cli/commands/app-config/index.d.ts.map +1 -0
  63. package/dist/src/cli/commands/app-config/index.js +16 -0
  64. package/dist/src/cli/commands/app-config/index.js.map +1 -0
  65. package/dist/src/cli/commands/app-config/info.d.ts +6 -0
  66. package/dist/src/cli/commands/app-config/info.d.ts.map +1 -0
  67. package/dist/src/cli/commands/app-config/info.js +67 -0
  68. package/dist/src/cli/commands/app-config/info.js.map +1 -0
  69. package/dist/src/cli/commands/app-config/list.d.ts +6 -0
  70. package/dist/src/cli/commands/app-config/list.d.ts.map +1 -0
  71. package/dist/src/cli/commands/app-config/list.js +58 -0
  72. package/dist/src/cli/commands/app-config/list.js.map +1 -0
  73. package/dist/src/cli/commands/app-config/update.d.ts +6 -0
  74. package/dist/src/cli/commands/app-config/update.d.ts.map +1 -0
  75. package/dist/src/cli/commands/app-config/update.js +31 -0
  76. package/dist/src/cli/commands/app-config/update.js.map +1 -0
  77. package/dist/src/cli/commands/app-context/create.d.ts +6 -0
  78. package/dist/src/cli/commands/app-context/create.d.ts.map +1 -0
  79. package/dist/src/cli/commands/app-context/create.js +32 -0
  80. package/dist/src/cli/commands/app-context/create.js.map +1 -0
  81. package/dist/src/cli/commands/app-context/delete.d.ts +6 -0
  82. package/dist/src/cli/commands/app-context/delete.d.ts.map +1 -0
  83. package/dist/src/cli/commands/app-context/delete.js +31 -0
  84. package/dist/src/cli/commands/app-context/delete.js.map +1 -0
  85. package/dist/src/cli/commands/app-context/index.d.ts +6 -0
  86. package/dist/src/cli/commands/app-context/index.d.ts.map +1 -0
  87. package/dist/src/cli/commands/app-context/index.js +16 -0
  88. package/dist/src/cli/commands/app-context/index.js.map +1 -0
  89. package/dist/src/cli/commands/app-context/info.d.ts +6 -0
  90. package/dist/src/cli/commands/app-context/info.d.ts.map +1 -0
  91. package/dist/src/cli/commands/app-context/info.js +51 -0
  92. package/dist/src/cli/commands/app-context/info.js.map +1 -0
  93. package/dist/src/cli/commands/app-context/list.d.ts +6 -0
  94. package/dist/src/cli/commands/app-context/list.d.ts.map +1 -0
  95. package/dist/src/cli/commands/app-context/list.js +58 -0
  96. package/dist/src/cli/commands/app-context/list.js.map +1 -0
  97. package/dist/src/cli/commands/app-context/update.d.ts +6 -0
  98. package/dist/src/cli/commands/app-context/update.d.ts.map +1 -0
  99. package/dist/src/cli/commands/app-context/update.js +31 -0
  100. package/dist/src/cli/commands/app-context/update.js.map +1 -0
  101. package/dist/src/cli/commands/browser/back.d.ts.map +1 -1
  102. package/dist/src/cli/commands/browser/back.js +2 -4
  103. package/dist/src/cli/commands/browser/back.js.map +1 -1
  104. package/dist/src/cli/commands/browser/blur.d.ts.map +1 -1
  105. package/dist/src/cli/commands/browser/blur.js +2 -4
  106. package/dist/src/cli/commands/browser/blur.js.map +1 -1
  107. package/dist/src/cli/commands/browser/check.d.ts.map +1 -1
  108. package/dist/src/cli/commands/browser/check.js +2 -4
  109. package/dist/src/cli/commands/browser/check.js.map +1 -1
  110. package/dist/src/cli/commands/browser/click.d.ts.map +1 -1
  111. package/dist/src/cli/commands/browser/click.js +2 -4
  112. package/dist/src/cli/commands/browser/click.js.map +1 -1
  113. package/dist/src/cli/commands/browser/close.d.ts.map +1 -1
  114. package/dist/src/cli/commands/browser/close.js +2 -4
  115. package/dist/src/cli/commands/browser/close.js.map +1 -1
  116. package/dist/src/cli/commands/browser/create.d.ts.map +1 -1
  117. package/dist/src/cli/commands/browser/create.js +7 -4
  118. package/dist/src/cli/commands/browser/create.js.map +1 -1
  119. package/dist/src/cli/commands/browser/downloads.d.ts.map +1 -1
  120. package/dist/src/cli/commands/browser/downloads.js +2 -4
  121. package/dist/src/cli/commands/browser/downloads.js.map +1 -1
  122. package/dist/src/cli/commands/browser/drag.d.ts.map +1 -1
  123. package/dist/src/cli/commands/browser/drag.js +2 -4
  124. package/dist/src/cli/commands/browser/drag.js.map +1 -1
  125. package/dist/src/cli/commands/browser/evaluate.d.ts.map +1 -1
  126. package/dist/src/cli/commands/browser/evaluate.js +2 -4
  127. package/dist/src/cli/commands/browser/evaluate.js.map +1 -1
  128. package/dist/src/cli/commands/browser/fill.d.ts.map +1 -1
  129. package/dist/src/cli/commands/browser/fill.js +2 -4
  130. package/dist/src/cli/commands/browser/fill.js.map +1 -1
  131. package/dist/src/cli/commands/browser/focus.d.ts.map +1 -1
  132. package/dist/src/cli/commands/browser/focus.js +2 -4
  133. package/dist/src/cli/commands/browser/focus.js.map +1 -1
  134. package/dist/src/cli/commands/browser/forward.d.ts.map +1 -1
  135. package/dist/src/cli/commands/browser/forward.js +2 -4
  136. package/dist/src/cli/commands/browser/forward.js.map +1 -1
  137. package/dist/src/cli/commands/browser/generate-test.d.ts.map +1 -1
  138. package/dist/src/cli/commands/browser/generate-test.js +2 -4
  139. package/dist/src/cli/commands/browser/generate-test.js.map +1 -1
  140. package/dist/src/cli/commands/browser/get-blocks.d.ts.map +1 -1
  141. package/dist/src/cli/commands/browser/get-blocks.js +2 -4
  142. package/dist/src/cli/commands/browser/get-blocks.js.map +1 -1
  143. package/dist/src/cli/commands/browser/goto.d.ts.map +1 -1
  144. package/dist/src/cli/commands/browser/goto.js +2 -4
  145. package/dist/src/cli/commands/browser/goto.js.map +1 -1
  146. package/dist/src/cli/commands/browser/hover.d.ts.map +1 -1
  147. package/dist/src/cli/commands/browser/hover.js +2 -4
  148. package/dist/src/cli/commands/browser/hover.js.map +1 -1
  149. package/dist/src/cli/commands/browser/list.d.ts.map +1 -1
  150. package/dist/src/cli/commands/browser/list.js +2 -4
  151. package/dist/src/cli/commands/browser/list.js.map +1 -1
  152. package/dist/src/cli/commands/browser/logs.d.ts.map +1 -1
  153. package/dist/src/cli/commands/browser/logs.js +3 -6
  154. package/dist/src/cli/commands/browser/logs.js.map +1 -1
  155. package/dist/src/cli/commands/browser/mfa-totp.d.ts.map +1 -1
  156. package/dist/src/cli/commands/browser/mfa-totp.js +2 -4
  157. package/dist/src/cli/commands/browser/mfa-totp.js.map +1 -1
  158. package/dist/src/cli/commands/browser/press.d.ts.map +1 -1
  159. package/dist/src/cli/commands/browser/press.js +2 -4
  160. package/dist/src/cli/commands/browser/press.js.map +1 -1
  161. package/dist/src/cli/commands/browser/reload.d.ts.map +1 -1
  162. package/dist/src/cli/commands/browser/reload.js +2 -4
  163. package/dist/src/cli/commands/browser/reload.js.map +1 -1
  164. package/dist/src/cli/commands/browser/run.d.ts.map +1 -1
  165. package/dist/src/cli/commands/browser/run.js +5 -4
  166. package/dist/src/cli/commands/browser/run.js.map +1 -1
  167. package/dist/src/cli/commands/browser/screenshot.d.ts.map +1 -1
  168. package/dist/src/cli/commands/browser/screenshot.js +2 -4
  169. package/dist/src/cli/commands/browser/screenshot.js.map +1 -1
  170. package/dist/src/cli/commands/browser/scroll-into-view.d.ts.map +1 -1
  171. package/dist/src/cli/commands/browser/scroll-into-view.js +2 -4
  172. package/dist/src/cli/commands/browser/scroll-into-view.js.map +1 -1
  173. package/dist/src/cli/commands/browser/scroll.d.ts.map +1 -1
  174. package/dist/src/cli/commands/browser/scroll.js +2 -4
  175. package/dist/src/cli/commands/browser/scroll.js.map +1 -1
  176. package/dist/src/cli/commands/browser/select.d.ts.map +1 -1
  177. package/dist/src/cli/commands/browser/select.js +2 -4
  178. package/dist/src/cli/commands/browser/select.js.map +1 -1
  179. package/dist/src/cli/commands/browser/snapshot.d.ts.map +1 -1
  180. package/dist/src/cli/commands/browser/snapshot.js +2 -4
  181. package/dist/src/cli/commands/browser/snapshot.js.map +1 -1
  182. package/dist/src/cli/commands/browser/status.d.ts.map +1 -1
  183. package/dist/src/cli/commands/browser/status.js +6 -4
  184. package/dist/src/cli/commands/browser/status.js.map +1 -1
  185. package/dist/src/cli/commands/browser/stream.d.ts.map +1 -1
  186. package/dist/src/cli/commands/browser/stream.js +2 -4
  187. package/dist/src/cli/commands/browser/stream.js.map +1 -1
  188. package/dist/src/cli/commands/browser/type.d.ts.map +1 -1
  189. package/dist/src/cli/commands/browser/type.js +2 -4
  190. package/dist/src/cli/commands/browser/type.js.map +1 -1
  191. package/dist/src/cli/commands/browser/uncheck.d.ts.map +1 -1
  192. package/dist/src/cli/commands/browser/uncheck.js +2 -4
  193. package/dist/src/cli/commands/browser/uncheck.js.map +1 -1
  194. package/dist/src/cli/commands/browser/upload.d.ts.map +1 -1
  195. package/dist/src/cli/commands/browser/upload.js +2 -4
  196. package/dist/src/cli/commands/browser/upload.js.map +1 -1
  197. package/dist/src/cli/commands/browser/url.d.ts.map +1 -1
  198. package/dist/src/cli/commands/browser/url.js +2 -4
  199. package/dist/src/cli/commands/browser/url.js.map +1 -1
  200. package/dist/src/cli/commands/browser/wait-for-load.d.ts.map +1 -1
  201. package/dist/src/cli/commands/browser/wait-for-load.js +2 -4
  202. package/dist/src/cli/commands/browser/wait-for-load.js.map +1 -1
  203. package/dist/src/cli/commands/browser/wait-for-selector.d.ts.map +1 -1
  204. package/dist/src/cli/commands/browser/wait-for-selector.js +2 -4
  205. package/dist/src/cli/commands/browser/wait-for-selector.js.map +1 -1
  206. package/dist/src/cli/commands/browser/wait.d.ts.map +1 -1
  207. package/dist/src/cli/commands/browser/wait.js +2 -4
  208. package/dist/src/cli/commands/browser/wait.js.map +1 -1
  209. package/dist/src/cli/commands/data-asset/delete.d.ts +6 -0
  210. package/dist/src/cli/commands/data-asset/delete.d.ts.map +1 -0
  211. package/dist/src/cli/commands/data-asset/delete.js +31 -0
  212. package/dist/src/cli/commands/data-asset/delete.js.map +1 -0
  213. package/dist/src/cli/commands/data-asset/index.d.ts +6 -0
  214. package/dist/src/cli/commands/data-asset/index.d.ts.map +1 -0
  215. package/dist/src/cli/commands/data-asset/index.js +14 -0
  216. package/dist/src/cli/commands/data-asset/index.js.map +1 -0
  217. package/dist/src/cli/commands/data-asset/info.d.ts +6 -0
  218. package/dist/src/cli/commands/data-asset/info.d.ts.map +1 -0
  219. package/dist/src/cli/commands/data-asset/info.js +75 -0
  220. package/dist/src/cli/commands/data-asset/info.js.map +1 -0
  221. package/dist/src/cli/commands/data-asset/list.d.ts +6 -0
  222. package/dist/src/cli/commands/data-asset/list.d.ts.map +1 -0
  223. package/dist/src/cli/commands/data-asset/list.js +76 -0
  224. package/dist/src/cli/commands/data-asset/list.js.map +1 -0
  225. package/dist/src/cli/commands/data-asset/upload.d.ts +6 -0
  226. package/dist/src/cli/commands/data-asset/upload.d.ts.map +1 -0
  227. package/dist/src/cli/commands/data-asset/upload.js +83 -0
  228. package/dist/src/cli/commands/data-asset/upload.js.map +1 -0
  229. package/dist/src/cli/commands/docs.d.ts.map +1 -1
  230. package/dist/src/cli/commands/docs.js +7 -1
  231. package/dist/src/cli/commands/docs.js.map +1 -1
  232. package/dist/src/cli/commands/info.d.ts.map +1 -1
  233. package/dist/src/cli/commands/info.js +9 -0
  234. package/dist/src/cli/commands/info.js.map +1 -1
  235. package/dist/src/cli/commands/issues/index.d.ts +6 -0
  236. package/dist/src/cli/commands/issues/index.d.ts.map +1 -0
  237. package/dist/src/cli/commands/issues/index.js +12 -0
  238. package/dist/src/cli/commands/issues/index.js.map +1 -0
  239. package/dist/src/cli/commands/issues/info.d.ts +6 -0
  240. package/dist/src/cli/commands/issues/info.d.ts.map +1 -0
  241. package/dist/src/cli/commands/issues/info.js +57 -0
  242. package/dist/src/cli/commands/issues/info.js.map +1 -0
  243. package/dist/src/cli/commands/issues/list.d.ts +6 -0
  244. package/dist/src/cli/commands/issues/list.d.ts.map +1 -0
  245. package/dist/src/cli/commands/issues/list.js +71 -0
  246. package/dist/src/cli/commands/issues/list.js.map +1 -0
  247. package/dist/src/cli/commands/issues/occurrences.d.ts +6 -0
  248. package/dist/src/cli/commands/issues/occurrences.d.ts.map +1 -0
  249. package/dist/src/cli/commands/issues/occurrences.js +54 -0
  250. package/dist/src/cli/commands/issues/occurrences.js.map +1 -0
  251. package/dist/src/cli/commands/persona/create.d.ts +6 -0
  252. package/dist/src/cli/commands/persona/create.d.ts.map +1 -0
  253. package/dist/src/cli/commands/persona/create.js +30 -0
  254. package/dist/src/cli/commands/persona/create.js.map +1 -0
  255. package/dist/src/cli/commands/persona/delete.d.ts +6 -0
  256. package/dist/src/cli/commands/persona/delete.d.ts.map +1 -0
  257. package/dist/src/cli/commands/persona/delete.js +31 -0
  258. package/dist/src/cli/commands/persona/delete.js.map +1 -0
  259. package/dist/src/cli/commands/persona/index.d.ts +6 -0
  260. package/dist/src/cli/commands/persona/index.d.ts.map +1 -0
  261. package/dist/src/cli/commands/persona/index.js +16 -0
  262. package/dist/src/cli/commands/persona/index.js.map +1 -0
  263. package/dist/src/cli/commands/persona/info.d.ts +6 -0
  264. package/dist/src/cli/commands/persona/info.d.ts.map +1 -0
  265. package/dist/src/cli/commands/persona/info.js +51 -0
  266. package/dist/src/cli/commands/persona/info.js.map +1 -0
  267. package/dist/src/cli/commands/persona/list.d.ts +6 -0
  268. package/dist/src/cli/commands/persona/list.d.ts.map +1 -0
  269. package/dist/src/cli/commands/persona/list.js +58 -0
  270. package/dist/src/cli/commands/persona/list.js.map +1 -0
  271. package/dist/src/cli/commands/persona/update.d.ts +6 -0
  272. package/dist/src/cli/commands/persona/update.d.ts.map +1 -0
  273. package/dist/src/cli/commands/persona/update.js +31 -0
  274. package/dist/src/cli/commands/persona/update.js.map +1 -0
  275. package/dist/src/cli/commands/setup.d.ts.map +1 -1
  276. package/dist/src/cli/commands/setup.js +2 -0
  277. package/dist/src/cli/commands/setup.js.map +1 -1
  278. package/dist/src/cli/commands/suite/create.d.ts +6 -0
  279. package/dist/src/cli/commands/suite/create.d.ts.map +1 -0
  280. package/dist/src/cli/commands/suite/create.js +30 -0
  281. package/dist/src/cli/commands/suite/create.js.map +1 -0
  282. package/dist/src/cli/commands/suite/delete.d.ts +6 -0
  283. package/dist/src/cli/commands/suite/delete.d.ts.map +1 -0
  284. package/dist/src/cli/commands/suite/delete.js +31 -0
  285. package/dist/src/cli/commands/suite/delete.js.map +1 -0
  286. package/dist/src/cli/commands/suite/index.d.ts +6 -0
  287. package/dist/src/cli/commands/suite/index.d.ts.map +1 -0
  288. package/dist/src/cli/commands/suite/index.js +18 -0
  289. package/dist/src/cli/commands/suite/index.js.map +1 -0
  290. package/dist/src/cli/commands/suite/info.d.ts +6 -0
  291. package/dist/src/cli/commands/suite/info.d.ts.map +1 -0
  292. package/dist/src/cli/commands/suite/info.js +66 -0
  293. package/dist/src/cli/commands/suite/info.js.map +1 -0
  294. package/dist/src/cli/commands/suite/list.d.ts +6 -0
  295. package/dist/src/cli/commands/suite/list.d.ts.map +1 -0
  296. package/dist/src/cli/commands/suite/list.js +58 -0
  297. package/dist/src/cli/commands/suite/list.js.map +1 -0
  298. package/dist/src/cli/commands/suite/run.d.ts +6 -0
  299. package/dist/src/cli/commands/suite/run.d.ts.map +1 -0
  300. package/dist/src/cli/commands/suite/run.js +34 -0
  301. package/dist/src/cli/commands/suite/run.js.map +1 -0
  302. package/dist/src/cli/commands/suite/update.d.ts +6 -0
  303. package/dist/src/cli/commands/suite/update.d.ts.map +1 -0
  304. package/dist/src/cli/commands/suite/update.js +31 -0
  305. package/dist/src/cli/commands/suite/update.js.map +1 -0
  306. package/dist/src/cli/commands/test/diff.d.ts.map +1 -1
  307. package/dist/src/cli/commands/test/diff.js +2 -4
  308. package/dist/src/cli/commands/test/diff.js.map +1 -1
  309. package/dist/src/cli/commands/test/export.d.ts.map +1 -1
  310. package/dist/src/cli/commands/test/export.js +2 -4
  311. package/dist/src/cli/commands/test/export.js.map +1 -1
  312. package/dist/src/cli/commands/test/index.js +1 -1
  313. package/dist/src/cli/commands/test/index.js.map +1 -1
  314. package/dist/src/cli/commands/test/info.d.ts.map +1 -1
  315. package/dist/src/cli/commands/test/info.js +150 -46
  316. package/dist/src/cli/commands/test/info.js.map +1 -1
  317. package/dist/src/cli/commands/test/list.d.ts.map +1 -1
  318. package/dist/src/cli/commands/test/list.js +78 -23
  319. package/dist/src/cli/commands/test/list.js.map +1 -1
  320. package/dist/src/cli/commands/test/run.d.ts.map +1 -1
  321. package/dist/src/cli/commands/test/run.js +8 -6
  322. package/dist/src/cli/commands/test/run.js.map +1 -1
  323. package/dist/src/cli/commands/test/runs/cancel.d.ts +6 -0
  324. package/dist/src/cli/commands/test/runs/cancel.d.ts.map +1 -0
  325. package/dist/src/cli/commands/test/runs/cancel.js +31 -0
  326. package/dist/src/cli/commands/test/runs/cancel.js.map +1 -0
  327. package/dist/src/cli/commands/test/runs/index.d.ts +6 -0
  328. package/dist/src/cli/commands/test/runs/index.d.ts.map +1 -0
  329. package/dist/src/cli/commands/test/runs/index.js +16 -0
  330. package/dist/src/cli/commands/test/runs/index.js.map +1 -0
  331. package/dist/src/cli/commands/test/runs/info.d.ts +6 -0
  332. package/dist/src/cli/commands/test/runs/info.d.ts.map +1 -0
  333. package/dist/src/cli/commands/test/runs/info.js +72 -0
  334. package/dist/src/cli/commands/test/runs/info.js.map +1 -0
  335. package/dist/src/cli/commands/test/runs/list.d.ts +6 -0
  336. package/dist/src/cli/commands/test/runs/list.d.ts.map +1 -0
  337. package/dist/src/cli/commands/test/runs/list.js +128 -0
  338. package/dist/src/cli/commands/test/runs/list.js.map +1 -0
  339. package/dist/src/cli/commands/test/runs/logs.d.ts +6 -0
  340. package/dist/src/cli/commands/test/runs/logs.d.ts.map +1 -0
  341. package/dist/src/cli/commands/test/runs/logs.js +88 -0
  342. package/dist/src/cli/commands/test/runs/logs.js.map +1 -0
  343. package/dist/src/cli/commands/test/runs/steps.d.ts +6 -0
  344. package/dist/src/cli/commands/test/runs/steps.d.ts.map +1 -0
  345. package/dist/src/cli/commands/test/runs/steps.js +110 -0
  346. package/dist/src/cli/commands/test/runs/steps.js.map +1 -0
  347. package/dist/src/cli/commands/test/runs.d.ts.map +1 -1
  348. package/dist/src/cli/commands/test/runs.js +2 -4
  349. package/dist/src/cli/commands/test/runs.js.map +1 -1
  350. package/dist/src/cli/commands/test/schema.d.ts.map +1 -1
  351. package/dist/src/cli/commands/test/schema.js +2 -6
  352. package/dist/src/cli/commands/test/schema.js.map +1 -1
  353. package/dist/src/cli/commands/test/sync.d.ts.map +1 -1
  354. package/dist/src/cli/commands/test/sync.js +3 -6
  355. package/dist/src/cli/commands/test/sync.js.map +1 -1
  356. package/dist/src/cli/commands/test/validate.d.ts.map +1 -1
  357. package/dist/src/cli/commands/test/validate.js +2 -4
  358. package/dist/src/cli/commands/test/validate.js.map +1 -1
  359. package/dist/src/cli/commands/usage.d.ts +6 -0
  360. package/dist/src/cli/commands/usage.d.ts.map +1 -0
  361. package/dist/src/cli/commands/usage.js +106 -0
  362. package/dist/src/cli/commands/usage.js.map +1 -0
  363. package/dist/src/cli/generated/docs-content.d.ts +1 -1
  364. package/dist/src/cli/generated/docs-content.d.ts.map +1 -1
  365. package/dist/src/cli/generated/docs-content.js +34 -0
  366. package/dist/src/cli/generated/docs-content.js.map +1 -1
  367. package/dist/src/cli/index.js +43 -1
  368. package/dist/src/cli/index.js.map +1 -1
  369. package/dist/src/cli/lib/api-helpers.d.ts +59 -0
  370. package/dist/src/cli/lib/api-helpers.d.ts.map +1 -0
  371. package/dist/src/cli/lib/api-helpers.js +149 -0
  372. package/dist/src/cli/lib/api-helpers.js.map +1 -0
  373. package/dist/src/cli/lib/config.d.ts +11 -0
  374. package/dist/src/cli/lib/config.d.ts.map +1 -1
  375. package/dist/src/cli/lib/config.js +44 -0
  376. package/dist/src/cli/lib/config.js.map +1 -1
  377. package/dist/src/cli/lib/output.d.ts +6 -0
  378. package/dist/src/cli/lib/output.d.ts.map +1 -1
  379. package/dist/src/cli/lib/output.js +37 -0
  380. package/dist/src/cli/lib/output.js.map +1 -1
  381. package/dist/src/cli/lib/table.d.ts +47 -0
  382. package/dist/src/cli/lib/table.d.ts.map +1 -0
  383. package/dist/src/cli/lib/table.js +161 -0
  384. package/dist/src/cli/lib/table.js.map +1 -0
  385. package/dist/src/types/test-definition.d.ts +29 -2
  386. package/dist/src/types/test-definition.d.ts.map +1 -1
  387. package/dist/src/types/test-definition.js +2 -2
  388. package/lib/api/browser-types.ts +1 -0
  389. package/lib/api/browser.test.ts +28 -0
  390. package/lib/api/browser.ts +15 -1
  391. package/lib/api/index.ts +28 -5
  392. package/lib/env/index.ts +32 -0
  393. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  * DO NOT EDIT MANUALLY — Generated from plugins/qa-use/skills/qa-use/
4
4
  * Run 'bun run generate:docs' to regenerate.
5
5
  */
6
- export declare const MAIN_DOC = "---\nname: qa-use\ndescription: E2E testing and browser automation with qa-use CLI. Use when the user needs to run tests, verify features, automate browser interactions, or debug test failures.\nallowed-tools: Bash(qa-use *)\n---\n\n# qa-use\n\nE2E testing and browser automation for AI-driven development workflows.\n\n## Critical Insight: Plugin Commands as Shortcuts\n\n**For AI Harnesses (codex, opencode, etc.):**\n\nPlugin commands (slash commands like `/qa-use:verify`) are **convenience shortcuts** that wrap CLI workflows. Harnesses with only the Bash tool can access ALL functionality via CLI commands documented below.\n\n**Pattern throughout this document:**\n- **CLI Workflow**: Step-by-step CLI commands (works for ALL harnesses)\n- **Plugin Shortcut**: Optional slash command (convenience)\n\n## Setup & Configuration\n\nBefore using any qa-use commands, verify configuration is in place:\n\n```bash\n# Check current configuration (no-op if already configured)\nqa-use setup\n\n# Configure with API key (validates against server)\nqa-use setup --api-key <key>\n\n# View full configuration details\nqa-use info\n```\n\n**Environment Variables (alternative to config file):**\n\n| Variable | Description |\n|----------|-------------|\n| `QA_USE_API_KEY` | API key for authentication |\n| `QA_USE_REGION` | Region: `us` (default) or `auto` |\n| `QA_USE_API_URL` | Override API base URL |\n\n**Config file:** `.qa-use.json` in the project directory or `~/.qa-use.json` in the home directory. Precedence: env vars > project `.qa-use.json` > `~/.qa-use.json`.\n\n**If you encounter \"API key not configured\", 401, or auth errors:** Run `qa-use setup` to check config state. NEVER fabricate or guess API keys.\n\n## Core Workflow\n\n### 1. Browser Control & Session Lifecycle\n\n**CLI Workflow:**\n```bash\n# Create browser session\nqa-use browser create --viewport desktop\n\n# For localhost testing\nqa-use browser create --tunnel --no-headless\n\n# Navigate\nqa-use browser goto https://example.com\n\n# Snapshot to get element refs (ALWAYS do this before interacting)\nqa-use browser snapshot\n\n# Interact by ref\nqa-use browser click e3\nqa-use browser fill e5 \"text\"\n\n# Close\nqa-use browser close\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:explore https://example.com\n```\n(Wraps create + goto + snapshot with autonomous exploration)\n\n**Critical:** Always run `snapshot` before your **first** interaction on a page. Never guess element refs.\n\n**Snapshot Diff Feature (use it to avoid unnecessary snapshots):**\nAfter each action (goto, click, fill, etc.), the browser automatically shows DOM changes:\n- **Summary**: \"5 elements added, 1 element modified\"\n- **Added elements**: `+ [e54] generic \"Thanks for agreeing!\"` (green)\n- **Modified elements**: `~ [e18] checkbox \"I agree...\"` with `+attrs: checked, active` (yellow)\n- **Removed elements**: `- [e99] button \"Submit\"` (red)\n\n**When you can skip a full `snapshot`:** If the diff output from your last action already shows the element ref you need to interact with next, use it directly \u2014 no need for an intermediate `snapshot`. For example, if clicking a button shows `+ [e54] button \"Submit\"` in the diff, you can `click e54` immediately.\n\n**When you still need a full `snapshot`:** Run `snapshot` when you need to find elements that weren't in the diff (e.g., pre-existing elements you haven't interacted with yet), or when the diff was truncated (shows \"... and N more changes\").\n\n### 2. Understanding Blocks\n\n**What are blocks?**\n\nBlocks are atomic recorded interactions from a browser session. They are:\n- Automatically captured during any browser interaction (click, fill, goto, scroll, etc.)\n- Stored server-side with the session\n- Retrieved via `qa-use browser get-blocks`\n- The foundation for test generation\n\n**Why blocks matter:**\n- **Record-once, replay-many**: Interactive recording becomes automated test\n- **AI-friendly**: Agents can analyze blocks to understand user intent\n- **Version control**: Blocks stored with session enable test iteration\n- **Bridge CLI \u2192 Tests**: Natural workflow from exploration to automation\n\n**How blocks work:**\n\n```bash\n# 1. Create session and interact\nqa-use browser create --tunnel --no-headless\nqa-use browser goto https://example.com\nqa-use browser snapshot # Returns: [ref=e1] button\nqa-use browser click e1 # Records as block\nqa-use browser fill e5 \"text\" # Records as block\n\n# 2. Retrieve blocks (JSON array)\nqa-use browser get-blocks\n# Returns:\n# [\n# {\"type\": \"goto\", \"url\": \"...\", \"timestamp\": \"...\"},\n# {\"type\": \"click\", \"ref\": \"e1\", \"timestamp\": \"...\"},\n# {\"type\": \"fill\", \"ref\": \"e5\", \"value\": \"text\", \"timestamp\": \"...\"}\n# ]\n\n# 3. Generate test YAML from blocks\nqa-use browser generate-test -n \"my_test\" -o qa-tests/my_test.yaml\n\n# 4. Run generated test\nqa-use test run my_test\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record start my_test\n# ... perform interactions ...\n/qa-use:record stop\n```\n(Wraps the interactive workflow with AI-powered test generation)\n\n### 3. Test Management\n\n**CLI Workflow:**\n```bash\n# Run test by name\nqa-use test run login\n\n# Run with autofix (AI self-healing)\nqa-use test run login --autofix\n\n# Validate syntax\nqa-use test validate login\n\n# Show test details\nqa-use test info login\n\n# List test runs\nqa-use test runs --status failed\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:test-run login --autofix\n```\n(Convenience shortcut for common test execution)\n\n### 4. Test Sync Lifecycle\n\n**CLI Workflow:**\n```bash\n# Pull tests from cloud\nqa-use test sync pull\n\n# Push all local tests to cloud\nqa-use test sync push --all\n\n# Push specific test\nqa-use test sync push --id <uuid>\n\n# Force push (overwrite conflicts)\nqa-use test sync push --force\n\n# Compare local vs cloud\nqa-use test diff login.yaml\n```\n\n**No Plugin Shortcut** - Use CLI commands directly\n\n## Essential Commands\n\n### Browser Session Management\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser create` | Create remote browser session |\n| `qa-use browser create <url>` | Create session and navigate to URL |\n| `qa-use browser create --tunnel` | Create local browser with API tunnel |\n| `qa-use browser create --no-headless` | Show browser window (tunnel mode only) |\n| `qa-use browser create --viewport <size>` | Set viewport: `desktop`, `tablet`, `mobile` |\n| `qa-use browser create --ws-url <url>` | Connect to existing WebSocket browser |\n| `qa-use browser create --after-test-id <uuid>` | Run a test first, then become interactive |\n| `qa-use browser create --var <key=value>` | Override app config variables (repeatable) |\n| `qa-use browser list` | List active sessions |\n| `qa-use browser status` | Show current session details (app_url, recording_url, etc.) |\n| `qa-use browser close` | Close active session |\n\nSessions auto-persist in `~/.qa-use.json`. One active session = no `-s` flag needed.\n\n### Navigation\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser goto <url>` | Navigate to URL |\n| `qa-use browser back` | Go back |\n| `qa-use browser forward` | Go forward |\n| `qa-use browser reload` | Reload page |\n\n### Element Interaction\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser click <ref>` | Click element by ref |\n| `qa-use browser click --text \"Button\"` | Click by semantic description |\n| `qa-use browser fill <ref> \"value\"` | Fill input field |\n| `qa-use browser type <ref> \"text\"` | Type with delays (for autocomplete) |\n| `qa-use browser press <key>` | Press key (e.g., `Enter`, `Tab`) |\n| `qa-use browser check <ref>` | Check checkbox |\n| `qa-use browser uncheck <ref>` | Uncheck checkbox |\n| `qa-use browser select <ref> \"option\"` | Select dropdown option |\n| `qa-use browser hover <ref>` | Hover over element |\n| `qa-use browser scroll down 500` | Scroll by pixels |\n| `qa-use browser scroll-into-view <ref>` | Scroll element into view |\n| `qa-use browser drag <ref> --target <ref>` | Drag element to target |\n| `qa-use browser mfa-totp [ref] <secret>` | Generate TOTP code (optionally fill) |\n| `qa-use browser upload <ref> <file>...` | Upload file(s) to input (base64-encoded, works remote & tunnel) |\n\n### Inspection & Snapshot Diff\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser snapshot` | Get full ARIA tree with element refs (use only when diff output is insufficient) |\n| `qa-use browser url` | Get current URL |\n| `qa-use browser screenshot` | Save screenshot.png |\n| `qa-use browser screenshot file.png` | Save to custom path |\n| `qa-use browser screenshot --base64` | Output base64 to stdout |\n| `qa-use browser evaluate <expression>` | Execute JavaScript in browser context |\n\nThe snapshot-diff feature automatically displays DOM changes after each browser action:\n- **Added elements**: Shown with `+` prefix and green color \u2014 these refs are immediately usable\n- **Modified elements**: Shown with `~` prefix and yellow color, including attribute changes (`+attrs: checked`)\n- **Removed elements**: Shown with `-` prefix and red color \u2014 do NOT use these refs\n\n**Downloads:** When an action triggers a file download (e.g., clicking a download link), the response includes download info: filename, size, and a presigned URL. Use `qa-use browser downloads` to list all downloads or `--save <dir>` to save them locally.\n\nUse diff output to interact with newly appeared elements directly, without running a full `snapshot` first.\n\n### Test Operations\n\n| Command | Description |\n|---------|-------------|\n| `qa-use test run <name>` | Run test by name |\n| `qa-use test run --all` | Run all tests |\n| `qa-use test run <name> --tunnel` | Run with local browser tunnel |\n| `qa-use test run <name> --autofix` | Enable AI self-healing |\n| `qa-use test run <name> --update-local` | Persist AI fixes to file |\n| `qa-use test run <name> --download` | Download assets to `/tmp/qa-use/downloads/` |\n| `qa-use test run <name> --var key=value` | Override variable |\n| `qa-use test validate <name>` | Validate test syntax |\n| `qa-use test list` | List available tests |\n| `qa-use test info <name>` | Show test details (steps, tags, description) |\n| `qa-use test info --id <uuid>` | Show cloud test details by ID |\n| `qa-use test runs [name]` | List test run history |\n| `qa-use test runs --id <uuid>` | Filter runs by test ID |\n| `qa-use test runs --status failed` | Filter runs by status |\n| `qa-use test init` | Initialize test directory |\n| `qa-use test sync pull` | Pull tests from cloud |\n| `qa-use test sync push --all` | Push all local tests to cloud |\n| `qa-use test sync push --id <uuid>` | Push specific test |\n| `qa-use test sync push --force` | Push tests, overwriting conflicts |\n| `qa-use test diff <file>` | Compare local vs cloud test |\n| `qa-use test schema [path]` | View test definition schema |\n\n### API Operations (Dynamic OpenAPI)\n\n`qa-use api` dynamically discovers operations from `/api/v1/openapi.json` and caches metadata locally for offline fallback.\n\n| Command | Description |\n|---------|-------------|\n| `qa-use api ls` | List available `/api/v1/*` routes from OpenAPI |\n| `qa-use api ls --refresh` | Force refresh OpenAPI cache |\n| `qa-use api ls --offline` | Use cached OpenAPI metadata only |\n| `qa-use api /api/v1/tests` | Call endpoint (method inferred when possible) |\n| `qa-use api -X GET /api/v1/test-runs -f limit=5` | GET with query fields |\n| `qa-use api -X POST /api/v1/tests-actions/run --input body.json` | POST with JSON body file |\n| `qa-use api -X GET /api/v1/test-runs/<id>` | Fetch detail endpoint by ID |\n\n**No Plugin Shortcut** - Use CLI commands directly.\n\n### Logs & Debugging\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser logs console` | View console logs from session |\n| `qa-use browser logs console -s <id>` | View logs from specific/closed session |\n| `qa-use browser logs network` | View network request logs |\n| `qa-use browser logs network -s <id>` | View network logs from specific session |\n| `qa-use browser downloads` | List downloaded files from session |\n| `qa-use browser downloads --save <dir>` | Save downloaded files to local directory |\n| `qa-use browser downloads --json` | Output download info as JSON |\n\n### Test Generation\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser generate-test` | Generate test YAML from recorded session |\n| `qa-use browser generate-test -s <id>` | Generate from specific session |\n| `qa-use browser generate-test -n <name>` | Specify test name |\n| `qa-use browser generate-test -o <path>` | Specify output path |\n| `qa-use browser get-blocks` | Get recorded interaction blocks (JSON) |\n\n### Waiting\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser wait <ms>` | Fixed wait |\n| `qa-use browser wait-for-selector \".class\"` | Wait for selector |\n| `qa-use browser wait-for-load` | Wait for page load |\n\n### Variable Overrides\n\nUse `--var` to override app config variables at runtime. Common variables:\n\n| Variable | Description |\n|----------|-------------|\n| `base_url` | Base URL for the app (e.g., preview deployment URL) |\n| `login_url` | Login page URL |\n| `login_username` | Username/email for authentication |\n| `login_password` | Password for authentication |\n\nExample with ephemeral preview URL:\n```bash\nqa-use browser create --after-test-id <login-test-uuid> \\\n --var base_url=https://preview-123.example.com \\\n --var login_url=https://preview-123.example.com/auth/login\n```\n\n## Common Patterns\n\n### Pattern 1: Feature Verification\n\n**CLI Workflow:**\n```bash\n# 1. Search for existing test\nqa-use test list | grep \"login\"\n\n# 2. Run test with autofix\nqa-use test run login --autofix\n\n# 3. Debug failures\nqa-use browser logs console\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:verify \"login works with valid credentials\"\n```\n(Wraps the above CLI workflow with AI-powered test discovery and analysis)\n\n### Pattern 2: Record & Generate Test\n\n**CLI Workflow:**\n```bash\n# 1. Create session\nqa-use browser create --tunnel --no-headless\n\n# 2. Navigate and interact\nqa-use browser goto https://example.com\nqa-use browser snapshot\nqa-use browser click e1\nqa-use browser fill e5 \"test\"\n\n# 3. Generate test from blocks\nqa-use browser get-blocks\nqa-use browser generate-test -n \"my_test\"\n\n# 4. Run test\nqa-use test run my_test\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record start my_test\n# ... perform interactions ...\n/qa-use:record stop\n```\n\n### Pattern 3: Authenticated Exploration\n\n**CLI Workflow:**\n```bash\n# Create session that runs login test first\nqa-use browser create --after-test-id <login-test-uuid>\n\n# Session now authenticated, explore\nqa-use browser goto /dashboard\nqa-use browser snapshot\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:explore /dashboard\n```\n(Automatically handles auth detection and session creation)\n\n### Pattern 4: Edit Existing Test\n\n**CLI Workflow:**\n```bash\n# 1. Open test file in editor\nvim qa-tests/login.yaml\n\n# 2. Validate syntax\nqa-use test validate login\n\n# 3. Run to verify\nqa-use test run login\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record edit login\n```\n(AI-assisted editing with validation)\n\n### Pattern 5: Using Snapshot Diff to Avoid Unnecessary Snapshots\n\n**CLI Workflow:**\n```bash\n# Create session and navigate\nqa-use browser create --tunnel --no-headless\nqa-use browser goto https://evals.desplega.ai/checkboxes\n\n# goto shows diff \u2014 initial page load shows all elements:\n# Changes: 45 elements added\n# + [e18] checkbox \"I agree to the terms and conditions\"\n# + [e19] generic \"I agree to the terms and conditions\"\n\n# \u2705 Use ref from diff directly \u2014 no snapshot needed!\nqa-use browser click e18\n\n# Diff shows what changed:\n# Changes: 5 elements added, 1 element modified\n# + [e54] generic \"Thanks for agreeing!\"\n# + [e55] link \"Terms and Conditions\"\n# ~ [e18] checkbox \"I agree to the terms and conditions\"\n# +attrs: active, checked\n\n# \u2705 Can click e55 directly from diff output \u2014 no snapshot needed!\nqa-use browser click e55\n\n# \u274C Need to find an element NOT in the diff? Now run snapshot:\nqa-use browser snapshot\n```\n\n**Key principle:** Use diff output as your primary source of element refs after actions. Only fall back to `snapshot` when you need to find elements that weren't in the diff.\n\n**Benefits:**\n- Fewer API calls = faster automation\n- Diff refs are always fresh (just returned from the server)\n- Instantly see what changed (new elements, attribute changes, removals)\n\n**No Plugin Shortcut** - Automatic feature in all browser commands\n\n## CI/CD Integration\n\n### Running Tests in CI\n\n**Environment Variables:**\n```bash\nexport QA_USE_API_KEY=\"your-api-key\"\nexport QA_USE_REGION=\"us\" # Optional: \"us\" or \"auto\"\n```\n\n**Basic Test Execution:**\n```bash\n# Run all tests\nqa-use test run --all\n\n# Run specific tag\nqa-use test run --tag smoke\n\n# Exit codes: 0 = pass, 1 = fail\n```\n\n### GitHub Actions Example\n\n```yaml\nname: QA Tests\non: [push, pull_request]\n\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3\n with:\n node-version: '20'\n - name: Install qa-use\n run: npm install -g @desplega.ai/qa-use\n - name: Run tests\n run: qa-use test run --all\n env:\n QA_USE_API_KEY: ${{ secrets.QA_USE_API_KEY }}\n```\n\n### Test Artifacts\n\n**Screenshots:**\n- Automatically saved on failure\n- Location: `/tmp/qa-use/downloads/` (local) or cloud (remote)\n\n**Logs:**\n- Console logs: `qa-use browser logs console -s <session-id>`\n- Network logs: `qa-use browser logs network -s <session-id>`\n\n## Advanced Topics\n\n### Localhost Testing (Tunnel Mode)\n\n**When to use tunnel mode:**\n\n```\nTesting localhost (http://localhost:3000)?\n \u251C\u2500 YES \u2192 Use --tunnel\n \u2502 \u2514\u2500 qa-use browser create --tunnel [--no-headless]\n \u2502 (Starts local Playwright, creates localtunnel, keeps running)\n \u2502\n \u2514\u2500 NO (Public URL) \u2192 Use remote browser (default)\n \u2514\u2500 qa-use browser create\n (Uses desplega.ai cloud browser via WebSocket)\n```\n\n**The `--tunnel` flag is a binary choice:**\n- **Local tunnel mode**: Playwright on your machine + localtunnel\n- **Remote mode**: WebSocket URL to cloud-hosted browser\n\n**For test execution:**\n```bash\n# Local app\nqa-use test run my_test --tunnel [--headful]\n\n# Public app\nqa-use test run my_test\n```\n\n**Plugin shortcuts handle tunnel detection automatically:**\n```\n/qa-use:explore http://localhost:3000\n/qa-use:record start local_test\n```\n\nSee [references/localhost-testing.md](references/localhost-testing.md) for troubleshooting.\n\n### Session Persistence\n\nSessions are stored in `~/.qa-use.json` and have:\n- **TTL**: 30 minutes (default)\n- **Auto-resolve**: One active session = no `-s` flag needed\n- **Cleanup**: Automatic on timeout or explicit `browser close`\n\n### Block Limitations\n\n**What's captured:**\n- goto, click, fill, type, check, uncheck, select, hover\n- scroll, scroll-into-view, drag, upload, press\n\n**What's NOT captured:**\n- Assertions (must be added manually)\n- Waits (inferred from timing, may need adjustment)\n- Complex interactions (multi-drag, hover sequences)\n\n**Manual editing:** Edit generated YAML to add assertions and refine selectors.\n\n### WebSocket Sessions\n\n**Sharing sessions across processes:**\n```bash\n# Process 1: Create session\nqa-use browser create --tunnel\n# Output: ws://localhost:12345/browser/abc123\n\n# Process 2: Connect to session\nqa-use browser goto https://example.com --ws-url ws://localhost:12345/browser/abc123\n```\n\n## Deep-Dive References\n\nAccess any reference at runtime via the CLI: `qa-use docs <topic>`\n\n| Topic | CLI Command | Description |\n|-------|-------------|-------------|\n| [browser-commands.md](references/browser-commands.md) | `qa-use docs browser-commands` | Complete browser CLI reference with all flags |\n| [test-format.md](references/test-format.md) | `qa-use docs test-format` | Full test YAML specification |\n| [localhost-testing.md](references/localhost-testing.md) | `qa-use docs localhost-testing` | Tunnel setup for local development |\n| [failure-debugging.md](references/failure-debugging.md) | `qa-use docs failure-debugging` | Failure classification and diagnostics |\n| [ci.md](references/ci.md) | `qa-use docs ci` | CI/CD integration patterns and examples |\n\nUse `qa-use docs --list` to discover all available topics and templates.\n\n## Templates\n\n| Template | Description |\n|----------|-------------|\n| [basic-test.yaml](templates/basic-test.yaml) | Simple navigation and assertion |\n| [auth-flow.yaml](templates/auth-flow.yaml) | Login flow with credentials |\n| [form-test.yaml](templates/form-test.yaml) | Form submission with validation |\n\n## Test Format Overview\n\n```yaml\nname: Login Test\ndescription: Validates login functionality with valid credentials\ntags:\n - smoke\n - auth\napp_config: <app-config-id>\nvariables:\n email: test@example.com\n password: secret123\ndepends_on: setup-test # Optional\nsteps:\n - action: goto\n url: /login\n - action: fill\n target: email input\n value: $email\n - action: click\n target: login button\n - action: to_be_visible\n target: dashboard\n```\n\nSee [references/test-format.md](references/test-format.md) for complete specification.\n\n## Common Mistakes\n\n| \u274C Wrong | \u2705 Correct |\n|---------|-----------|\n| `browser navigate <url>` | `browser goto <url>` |\n| `browser destroy` | `browser close` |\n| `browser close <session-id>` | `browser close` |\n| Guessing element refs | Use refs from diff output or `snapshot` |\n| Running `snapshot` after every action | Use diff output; only `snapshot` when needed |\n| Testing localhost without `--tunnel` | Use `--tunnel` flag |\n| `test sync --pull` | `test sync pull` (subcommand, not flag) |\n| `test sync --push` | `test sync push` (subcommand, not flag) |\n\n## Troubleshooting\n\nWhen stuck or encountering unexpected errors, use the built-in documentation:\n\n```bash\n# Check configuration state\nqa-use setup\n\n# Browse main documentation\nqa-use docs\n\n# List all available topics\nqa-use docs --list\n\n# Access specific topic\nqa-use docs <topic>\n```\n\n| Situation | Command |\n|-----------|---------|\n| Auth / API key errors | `qa-use setup` then `qa-use docs` |\n| Unknown browser command | `qa-use docs browser-commands` |\n| Test failures | `qa-use docs failure-debugging` |\n| Localhost / tunnel issues | `qa-use docs localhost-testing` |\n| Test YAML syntax | `qa-use docs test-format` |\n| CI/CD setup | `qa-use docs ci` |\n\n**Key rules:**\n- ALWAYS consult `qa-use docs` before improvising workarounds\n- NEVER fabricate API keys, tokens, URLs, or credentials\n- If `qa-use setup` shows no config, report it \u2014 don't guess\n\n## npx Alternative\n\nAll commands use `qa-use` assuming global install. For one-off use:\n```bash\nnpx @desplega.ai/qa-use browser <command>\n```\n";
6
+ export declare const MAIN_DOC = "---\nname: qa-use\ndescription: E2E testing and browser automation with qa-use CLI. Use when the user needs to run tests, verify features, automate browser interactions, or debug test failures.\nallowed-tools: Bash(qa-use *)\n---\n\n# qa-use\n\nE2E testing and browser automation for AI-driven development workflows.\n\n## Critical Insight: Plugin Commands as Shortcuts\n\n**For AI Harnesses (codex, opencode, etc.):**\n\nPlugin commands (slash commands like `/qa-use:verify`) are **convenience shortcuts** that wrap CLI workflows. Harnesses with only the Bash tool can access ALL functionality via CLI commands documented below.\n\n**Pattern throughout this document:**\n- **CLI Workflow**: Step-by-step CLI commands (works for ALL harnesses)\n- **Plugin Shortcut**: Optional slash command (convenience)\n\n## Setup & Configuration\n\nBefore using any qa-use commands, verify configuration is in place:\n\n```bash\n# Check current configuration (no-op if already configured)\nqa-use setup\n\n# Configure with API key (validates against server)\nqa-use setup --api-key <key>\n\n# View full configuration details\nqa-use info\n```\n\n**Environment Variables (alternative to config file):**\n\n| Variable | Description |\n|----------|-------------|\n| `QA_USE_API_KEY` | API key for authentication |\n| `QA_USE_REGION` | Region: `us` (default) or `auto` |\n| `QA_USE_API_URL` | Override API base URL |\n\n**Config file:** `.qa-use.json` in the project directory or `~/.qa-use.json` in the home directory. Precedence: env vars > project `.qa-use.json` > `~/.qa-use.json`.\n\n**If you encounter \"API key not configured\", 401, or auth errors:** Run `qa-use setup` to check config state. NEVER fabricate or guess API keys.\n\n## Core Workflow\n\n### 1. Browser Control & Session Lifecycle\n\n**CLI Workflow:**\n```bash\n# Create browser session\nqa-use browser create --viewport desktop\n\n# For localhost testing\nqa-use browser create --tunnel --no-headless\n\n# Navigate\nqa-use browser goto https://example.com\n\n# Snapshot to get element refs (ALWAYS do this before interacting)\nqa-use browser snapshot\n\n# Interact by ref\nqa-use browser click e3\nqa-use browser fill e5 \"text\"\n\n# Close\nqa-use browser close\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:explore https://example.com\n```\n(Wraps create + goto + snapshot with autonomous exploration)\n\n**Critical:** Always run `snapshot` before your **first** interaction on a page. Never guess element refs.\n\n**Snapshot Diff Feature (use it to avoid unnecessary snapshots):**\nAfter each action (goto, click, fill, etc.), the browser automatically shows DOM changes:\n- **Summary**: \"5 elements added, 1 element modified\"\n- **Added elements**: `+ [e54] generic \"Thanks for agreeing!\"` (green)\n- **Modified elements**: `~ [e18] checkbox \"I agree...\"` with `+attrs: checked, active` (yellow)\n- **Removed elements**: `- [e99] button \"Submit\"` (red)\n\n**When you can skip a full `snapshot`:** If the diff output from your last action already shows the element ref you need to interact with next, use it directly \u2014 no need for an intermediate `snapshot`. For example, if clicking a button shows `+ [e54] button \"Submit\"` in the diff, you can `click e54` immediately.\n\n**When you still need a full `snapshot`:** Run `snapshot` when you need to find elements that weren't in the diff (e.g., pre-existing elements you haven't interacted with yet), or when the diff was truncated (shows \"... and N more changes\").\n\n### 2. Understanding Blocks\n\n**What are blocks?**\n\nBlocks are atomic recorded interactions from a browser session. They are:\n- Automatically captured during any browser interaction (click, fill, goto, scroll, etc.)\n- Stored server-side with the session\n- Retrieved via `qa-use browser get-blocks`\n- The foundation for test generation\n\n**Why blocks matter:**\n- **Record-once, replay-many**: Interactive recording becomes automated test\n- **AI-friendly**: Agents can analyze blocks to understand user intent\n- **Version control**: Blocks stored with session enable test iteration\n- **Bridge CLI \u2192 Tests**: Natural workflow from exploration to automation\n\n**How blocks work:**\n\n```bash\n# 1. Create session and interact\nqa-use browser create --tunnel --no-headless\nqa-use browser goto https://example.com\nqa-use browser snapshot # Returns: [ref=e1] button\nqa-use browser click e1 # Records as block\nqa-use browser fill e5 \"text\" # Records as block\n\n# 2. Retrieve blocks (JSON array)\nqa-use browser get-blocks\n# Returns:\n# [\n# {\"type\": \"goto\", \"url\": \"...\", \"timestamp\": \"...\"},\n# {\"type\": \"click\", \"ref\": \"e1\", \"timestamp\": \"...\"},\n# {\"type\": \"fill\", \"ref\": \"e5\", \"value\": \"text\", \"timestamp\": \"...\"}\n# ]\n\n# 3. Generate test YAML from blocks\nqa-use browser generate-test -n \"my_test\" -o qa-tests/my_test.yaml\n\n# 4. Run generated test\nqa-use test run my_test\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record start my_test\n# ... perform interactions ...\n/qa-use:record stop\n```\n(Wraps the interactive workflow with AI-powered test generation)\n\n### 3. Test Management\n\n**CLI Workflow:**\n```bash\n# Run test by name\nqa-use test run login\n\n# Run with autofix (AI self-healing)\nqa-use test run login --autofix\n\n# Run and save the (non-synced) local test to cloud\nqa-use test run login --persist\n\n# Validate syntax\nqa-use test validate login\n\n# Show test details\nqa-use test info login\n\n# List test runs\nqa-use test runs --status failed\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:test-run login --autofix\n```\n(Convenience shortcut for common test execution)\n\n### 4. Test Sync Lifecycle\n\n**CLI Workflow:**\n```bash\n# Pull tests from cloud\nqa-use test sync pull\n\n# Push all local tests to cloud\nqa-use test sync push --all\n\n# Push specific test\nqa-use test sync push --id <uuid>\n\n# Force push (overwrite conflicts)\nqa-use test sync push --force\n\n# Compare local vs cloud\nqa-use test diff login.yaml\n```\n\n**Persist vs Sync:**\n\nA local test is **synced** when its YAML has both an `id:` and a `version_hash:`\n(these are written back by `test sync push`/`pull`). `--persist` on `test run`\nand `qa-use test sync` are related but not the same:\n\n| Local file state | `persist` | What happens at run time |\n|---|---|---|\n| Non-synced | `false` (default) | Runs locally; nothing saved to cloud. Re-run with `--persist` or use `test sync push` to persist. |\n| Non-synced | `true` | Test is uploaded as a **new** cloud entry after the run. Re-running like this creates **duplicates** \u2014 prefer `test sync push` once the file tracks the cloud id. |\n| Synced | `false` | Runs against the cloud-tracked definition; no extra write. |\n| Synced | `true` | Cloud definition is **upserted** (may overwrite newer cloud edits). Use `test sync push`/`pull` for explicit version control. |\n\nRule of thumb: `test sync push`/`pull` is the deliberate path. Reserve `--persist`\n(or `defaults.persist: true` in `.qa-use.json`) for one-off uploads of brand-new\nlocal tests.\n\n**No Plugin Shortcut** - Use CLI commands directly\n\n## Essential Commands\n\n### Browser Session Management\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser create` | Create remote browser session |\n| `qa-use browser create <url>` | Create session and navigate to URL |\n| `qa-use browser create --tunnel` | Create local browser with API tunnel |\n| `qa-use browser create --no-headless` | Show browser window (tunnel mode only) |\n| `qa-use browser create --viewport <size>` | Set viewport: `desktop`, `tablet`, `mobile` |\n| `qa-use browser create --ws-url <url>` | Connect to existing WebSocket browser |\n| `qa-use browser create --after-test-id <uuid>` | Run a test first, then become interactive |\n| `qa-use browser create --var <key=value>` | Override app config variables (repeatable) |\n| `qa-use browser list` | List active sessions |\n| `qa-use browser status` | Show current session details (app_url, recording_url, etc.) |\n| `qa-use browser close` | Close active session |\n\nSessions auto-persist in `~/.qa-use.json`. One active session = no `-s` flag needed.\n\n### Navigation\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser goto <url>` | Navigate to URL |\n| `qa-use browser back` | Go back |\n| `qa-use browser forward` | Go forward |\n| `qa-use browser reload` | Reload page |\n\n### Element Interaction\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser click <ref>` | Click element by ref |\n| `qa-use browser click --text \"Button\"` | Click by semantic description |\n| `qa-use browser fill <ref> \"value\"` | Fill input field |\n| `qa-use browser type <ref> \"text\"` | Type with delays (for autocomplete) |\n| `qa-use browser press <key>` | Press key (e.g., `Enter`, `Tab`) |\n| `qa-use browser check <ref>` | Check checkbox |\n| `qa-use browser uncheck <ref>` | Uncheck checkbox |\n| `qa-use browser select <ref> \"option\"` | Select dropdown option |\n| `qa-use browser hover <ref>` | Hover over element |\n| `qa-use browser scroll down 500` | Scroll by pixels |\n| `qa-use browser scroll-into-view <ref>` | Scroll element into view |\n| `qa-use browser drag <ref> --target <ref>` | Drag element to target |\n| `qa-use browser mfa-totp [ref] <secret>` | Generate TOTP code (optionally fill) |\n| `qa-use browser upload <ref> <file>...` | Upload file(s) to input (base64-encoded, works remote & tunnel) |\n\n### Inspection & Snapshot Diff\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser snapshot` | Get full ARIA tree with element refs (use only when diff output is insufficient) |\n| `qa-use browser url` | Get current URL |\n| `qa-use browser screenshot` | Save screenshot.png |\n| `qa-use browser screenshot file.png` | Save to custom path |\n| `qa-use browser screenshot --base64` | Output base64 to stdout |\n| `qa-use browser evaluate <expression>` | Execute JavaScript in browser context |\n\nThe snapshot-diff feature automatically displays DOM changes after each browser action:\n- **Added elements**: Shown with `+` prefix and green color \u2014 these refs are immediately usable\n- **Modified elements**: Shown with `~` prefix and yellow color, including attribute changes (`+attrs: checked`)\n- **Removed elements**: Shown with `-` prefix and red color \u2014 do NOT use these refs\n\n**Downloads:** When an action triggers a file download (e.g., clicking a download link), the response includes download info: filename, size, and a presigned URL. Use `qa-use browser downloads` to list all downloads or `--save <dir>` to save them locally.\n\nUse diff output to interact with newly appeared elements directly, without running a full `snapshot` first.\n\n### Test Operations\n\n| Command | Description |\n|---------|-------------|\n| `qa-use test run <name>` | Run test by name |\n| `qa-use test run --all` | Run all tests |\n| `qa-use test run <name> --tunnel` | Run with local browser tunnel |\n| `qa-use test run <name> --autofix` | Enable AI self-healing |\n| `qa-use test run <name> --update-local` | Persist AI fixes to file |\n| `qa-use test run <name> --download` | Download assets to `/tmp/qa-use/downloads/` |\n| `qa-use test run <name> --var key=value` | Override variable |\n| `qa-use test validate <name>` | Validate test syntax |\n| `qa-use test list` | List available tests |\n| `qa-use test info <name>` | Show test details (steps, tags, description) |\n| `qa-use test info --id <uuid>` | Show cloud test details by ID |\n| `qa-use test runs [name]` | List test run history |\n| `qa-use test runs --id <uuid>` | Filter runs by test ID |\n| `qa-use test runs --status failed` | Filter runs by status |\n| `qa-use test init` | Initialize test directory |\n| `qa-use test sync pull` | Pull tests from cloud |\n| `qa-use test sync push --all` | Push all local tests to cloud |\n| `qa-use test sync push --id <uuid>` | Push specific test |\n| `qa-use test sync push --force` | Push tests, overwriting conflicts |\n| `qa-use test diff <file>` | Compare local vs cloud test |\n| `qa-use test schema [path]` | View test definition schema |\n\n### API Operations (Dynamic OpenAPI)\n\n`qa-use api` dynamically discovers operations from `/api/v1/openapi.json` and caches metadata locally for offline fallback.\n\n| Command | Description |\n|---------|-------------|\n| `qa-use api` | Show help and available subcommands |\n| `qa-use api ls` | List available `/api/v1/*` routes from OpenAPI |\n| `qa-use api ls --refresh` | Force refresh OpenAPI cache |\n| `qa-use api ls --offline` | Use cached OpenAPI metadata only |\n| `qa-use api info /api/v1/<route>` | Show route details: parameters, request body, responses |\n| `qa-use api info /api/v1/<route> -X POST` | Show info for specific HTTP method |\n| `qa-use api info /api/v1/<route> --json` | Route info as JSON |\n| `qa-use api examples` | Show usage examples |\n| `qa-use api openapi` | Print OpenAPI spec URL |\n| `qa-use api openapi --raw` | Dump full OpenAPI spec as JSON |\n| `qa-use api /api/v1/tests` | Call endpoint (method inferred when possible) |\n| `qa-use api -X GET /api/v1/test-runs -f limit=5` | GET with query fields |\n| `qa-use api -X POST /api/v1/tests-actions/run --input body.json` | POST with JSON body file |\n| `qa-use api -X GET /api/v1/test-runs/<id>` | Fetch detail endpoint by ID |\n\n**No Plugin Shortcut** - Use CLI commands directly.\n\n### Logs & Debugging\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser logs console` | View console logs from session |\n| `qa-use browser logs console -s <id>` | View logs from specific/closed session |\n| `qa-use browser logs network` | View network request logs |\n| `qa-use browser logs network -s <id>` | View network logs from specific session |\n| `qa-use browser downloads` | List downloaded files from session |\n| `qa-use browser downloads --save <dir>` | Save downloaded files to local directory |\n| `qa-use browser downloads --json` | Output download info as JSON |\n\n### Test Generation\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser generate-test` | Generate test YAML from recorded session |\n| `qa-use browser generate-test -s <id>` | Generate from specific session |\n| `qa-use browser generate-test -n <name>` | Specify test name |\n| `qa-use browser generate-test -o <path>` | Specify output path |\n| `qa-use browser get-blocks` | Get recorded interaction blocks (JSON) |\n\n### Waiting\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser wait <ms>` | Fixed wait |\n| `qa-use browser wait-for-selector \".class\"` | Wait for selector |\n| `qa-use browser wait-for-load` | Wait for page load |\n\n### Variable Overrides\n\nUse `--var` to override app config variables at runtime. Common variables:\n\n| Variable | Description |\n|----------|-------------|\n| `base_url` | Base URL for the app (e.g., preview deployment URL) |\n| `login_url` | Login page URL |\n| `login_username` | Username/email for authentication |\n| `login_password` | Password for authentication |\n\nExample with ephemeral preview URL:\n```bash\nqa-use browser create --after-test-id <login-test-uuid> \\\n --var base_url=https://preview-123.example.com \\\n --var login_url=https://preview-123.example.com/auth/login\n```\n\n## Common Patterns\n\n### Pattern 1: Feature Verification\n\n**CLI Workflow:**\n```bash\n# 1. Search for existing test\nqa-use test list | grep \"login\"\n\n# 2. Run test with autofix\nqa-use test run login --autofix\n\n# 3. Debug failures\nqa-use browser logs console\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:verify \"login works with valid credentials\"\n```\n(Wraps the above CLI workflow with AI-powered test discovery and analysis)\n\n### Pattern 2: Record & Generate Test\n\n**CLI Workflow:**\n```bash\n# 1. Create session\nqa-use browser create --tunnel --no-headless\n\n# 2. Navigate and interact\nqa-use browser goto https://example.com\nqa-use browser snapshot\nqa-use browser click e1\nqa-use browser fill e5 \"test\"\n\n# 3. Generate test from blocks\nqa-use browser get-blocks\nqa-use browser generate-test -n \"my_test\"\n\n# 4. Run test\nqa-use test run my_test\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record start my_test\n# ... perform interactions ...\n/qa-use:record stop\n```\n\n### Pattern 3: Authenticated Exploration\n\n**CLI Workflow:**\n```bash\n# Create session that runs login test first\nqa-use browser create --after-test-id <login-test-uuid>\n\n# Session now authenticated, explore\nqa-use browser goto /dashboard\nqa-use browser snapshot\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:explore /dashboard\n```\n(Automatically handles auth detection and session creation)\n\n### Pattern 4: Edit Existing Test\n\n**CLI Workflow:**\n```bash\n# 1. Open test file in editor\nvim qa-tests/login.yaml\n\n# 2. Validate syntax\nqa-use test validate login\n\n# 3. Run to verify\nqa-use test run login\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record edit login\n```\n(AI-assisted editing with validation)\n\n### Pattern 5: Using Snapshot Diff to Avoid Unnecessary Snapshots\n\n**CLI Workflow:**\n```bash\n# Create session and navigate\nqa-use browser create --tunnel --no-headless\nqa-use browser goto https://evals.desplega.ai/checkboxes\n\n# goto shows diff \u2014 initial page load shows all elements:\n# Changes: 45 elements added\n# + [e18] checkbox \"I agree to the terms and conditions\"\n# + [e19] generic \"I agree to the terms and conditions\"\n\n# \u2705 Use ref from diff directly \u2014 no snapshot needed!\nqa-use browser click e18\n\n# Diff shows what changed:\n# Changes: 5 elements added, 1 element modified\n# + [e54] generic \"Thanks for agreeing!\"\n# + [e55] link \"Terms and Conditions\"\n# ~ [e18] checkbox \"I agree to the terms and conditions\"\n# +attrs: active, checked\n\n# \u2705 Can click e55 directly from diff output \u2014 no snapshot needed!\nqa-use browser click e55\n\n# \u274C Need to find an element NOT in the diff? Now run snapshot:\nqa-use browser snapshot\n```\n\n**Key principle:** Use diff output as your primary source of element refs after actions. Only fall back to `snapshot` when you need to find elements that weren't in the diff.\n\n**Benefits:**\n- Fewer API calls = faster automation\n- Diff refs are always fresh (just returned from the server)\n- Instantly see what changed (new elements, attribute changes, removals)\n\n**No Plugin Shortcut** - Automatic feature in all browser commands\n\n## CI/CD Integration\n\n### Running Tests in CI\n\n**Environment Variables:**\n```bash\nexport QA_USE_API_KEY=\"your-api-key\"\nexport QA_USE_REGION=\"us\" # Optional: \"us\" or \"auto\"\n```\n\n**Basic Test Execution:**\n```bash\n# Run all tests\nqa-use test run --all\n\n# Run specific tag\nqa-use test run --tag smoke\n\n# Exit codes: 0 = pass, 1 = fail\n```\n\n### GitHub Actions Example\n\n```yaml\nname: QA Tests\non: [push, pull_request]\n\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3\n with:\n node-version: '20'\n - name: Install qa-use\n run: npm install -g @desplega.ai/qa-use\n - name: Run tests\n run: qa-use test run --all\n env:\n QA_USE_API_KEY: ${{ secrets.QA_USE_API_KEY }}\n```\n\n### Test Artifacts\n\n**Screenshots:**\n- Automatically saved on failure\n- Location: `/tmp/qa-use/downloads/` (local) or cloud (remote)\n\n**Logs:**\n- Console logs: `qa-use browser logs console -s <session-id>`\n- Network logs: `qa-use browser logs network -s <session-id>`\n\n## Advanced Topics\n\n### Localhost Testing (Tunnel Mode)\n\n**When to use tunnel mode:**\n\n```\nTesting localhost (http://localhost:3000)?\n \u251C\u2500 YES \u2192 Use --tunnel\n \u2502 \u2514\u2500 qa-use browser create --tunnel [--no-headless]\n \u2502 (Starts local Playwright, creates localtunnel, keeps running)\n \u2502\n \u2514\u2500 NO (Public URL) \u2192 Use remote browser (default)\n \u2514\u2500 qa-use browser create\n (Uses desplega.ai cloud browser via WebSocket)\n```\n\n**The `--tunnel` flag is a binary choice:**\n- **Local tunnel mode**: Playwright on your machine + localtunnel\n- **Remote mode**: WebSocket URL to cloud-hosted browser\n\n**For test execution:**\n```bash\n# Local app\nqa-use test run my_test --tunnel [--headful]\n\n# Public app\nqa-use test run my_test\n```\n\n**Plugin shortcuts handle tunnel detection automatically:**\n```\n/qa-use:explore http://localhost:3000\n/qa-use:record start local_test\n```\n\nSee [references/localhost-testing.md](references/localhost-testing.md) for troubleshooting.\n\n### Session Persistence\n\nSessions are stored in `~/.qa-use.json` and have:\n- **TTL**: 30 minutes (default)\n- **Auto-resolve**: One active session = no `-s` flag needed\n- **Cleanup**: Automatic on timeout or explicit `browser close`\n\n### Block Limitations\n\n**What's captured:**\n- goto, click, fill, type, check, uncheck, select, hover\n- scroll, scroll-into-view, drag, upload, press\n\n**What's NOT captured:**\n- Assertions (must be added manually)\n- Waits (inferred from timing, may need adjustment)\n- Complex interactions (multi-drag, hover sequences)\n\n**Manual editing:** Edit generated YAML to add assertions and refine selectors.\n\n### WebSocket Sessions\n\n**Sharing sessions across processes:**\n```bash\n# Process 1: Create session\nqa-use browser create --tunnel\n# Output: ws://localhost:12345/browser/abc123\n\n# Process 2: Connect to session\nqa-use browser goto https://example.com --ws-url ws://localhost:12345/browser/abc123\n```\n\n## Deep-Dive References\n\nAccess any reference at runtime via the CLI: `qa-use docs <topic>`\n\n| Topic | CLI Command | Description |\n|-------|-------------|-------------|\n| [browser-commands.md](references/browser-commands.md) | `qa-use docs browser-commands` | Complete browser CLI reference with all flags |\n| [test-format.md](references/test-format.md) | `qa-use docs test-format` | Full test YAML specification |\n| [localhost-testing.md](references/localhost-testing.md) | `qa-use docs localhost-testing` | Tunnel setup for local development |\n| [failure-debugging.md](references/failure-debugging.md) | `qa-use docs failure-debugging` | Failure classification and diagnostics |\n| [ci.md](references/ci.md) | `qa-use docs ci` | CI/CD integration patterns and examples |\n\nUse `qa-use docs --list` to discover all available topics and templates.\n\n## Templates\n\n| Template | Description |\n|----------|-------------|\n| [basic-test.yaml](templates/basic-test.yaml) | Simple navigation and assertion |\n| [auth-flow.yaml](templates/auth-flow.yaml) | Login flow with credentials |\n| [form-test.yaml](templates/form-test.yaml) | Form submission with validation |\n\n## Test Format Overview\n\n```yaml\nname: Login Test\ndescription: Validates login functionality with valid credentials\ntags:\n - smoke\n - auth\napp_config: <app-config-id>\nvariables:\n email: test@example.com\n password: secret123\ndepends_on: setup-test # Optional\nsteps:\n - action: goto\n url: /login\n - action: fill\n target: email input\n value: $email\n - action: click\n target: login button\n - action: to_be_visible\n target: dashboard\n```\n\nSee [references/test-format.md](references/test-format.md) for complete specification.\n\n## Common Mistakes\n\n| \u274C Wrong | \u2705 Correct |\n|---------|-----------|\n| `browser navigate <url>` | `browser goto <url>` |\n| `browser destroy` | `browser close` |\n| `browser close <session-id>` | `browser close` |\n| Guessing element refs | Use refs from diff output or `snapshot` |\n| Running `snapshot` after every action | Use diff output; only `snapshot` when needed |\n| Testing localhost without `--tunnel` | Use `--tunnel` flag |\n| `test sync --pull` | `test sync pull` (subcommand, not flag) |\n| `test sync --push` | `test sync push` (subcommand, not flag) |\n\n## Troubleshooting\n\nWhen stuck or encountering unexpected errors, use the built-in documentation:\n\n```bash\n# Check configuration state\nqa-use setup\n\n# Browse main documentation\nqa-use docs\n\n# List all available topics\nqa-use docs --list\n\n# Access specific topic\nqa-use docs <topic>\n```\n\n| Situation | Command |\n|-----------|---------|\n| Auth / API key errors | `qa-use setup` then `qa-use docs` |\n| Unknown browser command | `qa-use docs browser-commands` |\n| Test failures | `qa-use docs failure-debugging` |\n| Localhost / tunnel issues | `qa-use docs localhost-testing` |\n| Test YAML syntax | `qa-use docs test-format` |\n| CI/CD setup | `qa-use docs ci` |\n\n**Key rules:**\n- ALWAYS consult `qa-use docs` before improvising workarounds\n- NEVER fabricate API keys, tokens, URLs, or credentials\n- If `qa-use setup` shows no config, report it \u2014 don't guess\n\n## npx Alternative\n\nAll commands use `qa-use` assuming global install. For one-off use:\n```bash\nnpx @desplega.ai/qa-use browser <command>\n```\n";
7
7
  export declare const REFERENCE_DOCS: Record<string, {
8
8
  title: string;
9
9
  content: string;
@@ -1 +1 @@
1
- {"version":3,"file":"docs-content.d.ts","sourceRoot":"","sources":["../../../../src/cli/generated/docs-content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,QAAQ,s6tBA0rBpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAuoD7E,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAiIxE,CAAC"}
1
+ {"version":3,"file":"docs-content.d.ts","sourceRoot":"","sources":["../../../../src/cli/generated/docs-content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,QAAQ,2/wBAqtBpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA8oD7E,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAiIxE,CAAC"}
@@ -155,6 +155,9 @@ qa-use test run login
155
155
  # Run with autofix (AI self-healing)
156
156
  qa-use test run login --autofix
157
157
 
158
+ # Run and save the (non-synced) local test to cloud
159
+ qa-use test run login --persist
160
+
158
161
  # Validate syntax
159
162
  qa-use test validate login
160
163
 
@@ -191,6 +194,23 @@ qa-use test sync push --force
191
194
  qa-use test diff login.yaml
192
195
  \`\`\`
193
196
 
197
+ **Persist vs Sync:**
198
+
199
+ A local test is **synced** when its YAML has both an \`id:\` and a \`version_hash:\`
200
+ (these are written back by \`test sync push\`/\`pull\`). \`--persist\` on \`test run\`
201
+ and \`qa-use test sync\` are related but not the same:
202
+
203
+ | Local file state | \`persist\` | What happens at run time |
204
+ |---|---|---|
205
+ | Non-synced | \`false\` (default) | Runs locally; nothing saved to cloud. Re-run with \`--persist\` or use \`test sync push\` to persist. |
206
+ | Non-synced | \`true\` | Test is uploaded as a **new** cloud entry after the run. Re-running like this creates **duplicates** — prefer \`test sync push\` once the file tracks the cloud id. |
207
+ | Synced | \`false\` | Runs against the cloud-tracked definition; no extra write. |
208
+ | Synced | \`true\` | Cloud definition is **upserted** (may overwrite newer cloud edits). Use \`test sync push\`/\`pull\` for explicit version control. |
209
+
210
+ Rule of thumb: \`test sync push\`/\`pull\` is the deliberate path. Reserve \`--persist\`
211
+ (or \`defaults.persist: true\` in \`.qa-use.json\`) for one-off uploads of brand-new
212
+ local tests.
213
+
194
214
  **No Plugin Shortcut** - Use CLI commands directly
195
215
 
196
216
  ## Essential Commands
@@ -293,9 +313,16 @@ Use diff output to interact with newly appeared elements directly, without runni
293
313
 
294
314
  | Command | Description |
295
315
  |---------|-------------|
316
+ | \`qa-use api\` | Show help and available subcommands |
296
317
  | \`qa-use api ls\` | List available \`/api/v1/*\` routes from OpenAPI |
297
318
  | \`qa-use api ls --refresh\` | Force refresh OpenAPI cache |
298
319
  | \`qa-use api ls --offline\` | Use cached OpenAPI metadata only |
320
+ | \`qa-use api info /api/v1/<route>\` | Show route details: parameters, request body, responses |
321
+ | \`qa-use api info /api/v1/<route> -X POST\` | Show info for specific HTTP method |
322
+ | \`qa-use api info /api/v1/<route> --json\` | Route info as JSON |
323
+ | \`qa-use api examples\` | Show usage examples |
324
+ | \`qa-use api openapi\` | Print OpenAPI spec URL |
325
+ | \`qa-use api openapi --raw\` | Dump full OpenAPI spec as JSON |
299
326
  | \`qa-use api /api/v1/tests\` | Call endpoint (method inferred when possible) |
300
327
  | \`qa-use api -X GET /api/v1/test-runs -f limit=5\` | GET with query fields |
301
328
  | \`qa-use api -X POST /api/v1/tests-actions/run --input body.json\` | POST with JSON body file |
@@ -1653,8 +1680,15 @@ qa-use test run my-test --autofix --update-local
1653
1680
 
1654
1681
  # 3. Check what changed
1655
1682
  git diff qa-tests/my-test.yaml
1683
+
1684
+ # 4. If the test is synced to cloud, push the fix up too
1685
+ qa-use test sync push --id <uuid>
1656
1686
  \`\`\`
1657
1687
 
1688
+ > \`--update-local\` writes the AI-fixed YAML to the local file only. It does not
1689
+ > push to cloud. For synced tests, follow up with \`test sync push\` (or run with
1690
+ > \`--persist\`) so the cloud definition matches what you just committed locally.
1691
+
1658
1692
  ### Suggested Actions
1659
1693
 
1660
1694
  - **Update target description** to match current UI
@@ -1 +1 @@
1
- {"version":3,"file":"docs-content.js","sourceRoot":"","sources":["../../../../src/cli/generated/docs-content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Command } from 'commander';
7
7
  import { apiCommand } from './commands/api/index.js';
8
+ import { appConfigCommand } from './commands/app-config/index.js';
9
+ import { appContextCommand } from './commands/app-context/index.js';
8
10
  import { browserCommand } from './commands/browser/index.js';
11
+ import { dataAssetCommand } from './commands/data-asset/index.js';
9
12
  import { docsCommand } from './commands/docs.js';
10
13
  import { infoCommand } from './commands/info.js';
11
14
  import { installDepsCommand } from './commands/install-deps.js';
15
+ import { issuesCommand } from './commands/issues/index.js';
12
16
  import { mcpCommand } from './commands/mcp.js';
17
+ import { personaCommand } from './commands/persona/index.js';
13
18
  import { setupCommand } from './commands/setup.js';
19
+ import { suiteCommand } from './commands/suite/index.js';
14
20
  import { testCommand } from './commands/test/index.js';
15
21
  import { updateCommand } from './commands/update.js';
22
+ import { usageCommand } from './commands/usage.js';
16
23
  import { checkForUpdateAsync, getUpdateHintForHelp, shouldSkipCheck, showUpdateHintIfAvailable, } from './lib/update-check.js';
17
24
  // Get version from package.json
18
25
  const require = createRequire(import.meta.url);
@@ -27,11 +34,18 @@ program.addCommand(setupCommand);
27
34
  program.addCommand(infoCommand);
28
35
  program.addCommand(docsCommand);
29
36
  program.addCommand(testCommand);
37
+ program.addCommand(suiteCommand);
30
38
  program.addCommand(mcpCommand);
31
39
  program.addCommand(browserCommand);
32
40
  program.addCommand(installDepsCommand);
33
41
  program.addCommand(updateCommand);
34
42
  program.addCommand(apiCommand);
43
+ program.addCommand(appConfigCommand);
44
+ program.addCommand(appContextCommand);
45
+ program.addCommand(personaCommand);
46
+ program.addCommand(dataAssetCommand);
47
+ program.addCommand(issuesCommand);
48
+ program.addCommand(usageCommand);
35
49
  // Auto-update hint (reads from cache, fires async fetch — never blocks)
36
50
  if (!shouldSkipCheck(process.argv)) {
37
51
  showUpdateHintIfAvailable(version);
@@ -53,9 +67,18 @@ program.addHelpText('after', () => {
53
67
  Command Groups:
54
68
  Setup: setup, info, install-deps, update
55
69
  Testing: test run, test list, test validate, test init
70
+ Runs: test runs list, test runs info, test runs steps
71
+ Suites: suite list, suite create, suite run
72
+ Issues: issues list, issues info, issues occurrences
56
73
  Browser: browser create, browser goto, browser snapshot, browser click
74
+ Config: app-config list, app-config create
75
+ Context: app-context list, app-context create
76
+ Personas: persona list, persona create
77
+ Assets: data-asset list, data-asset upload
78
+ Usage: usage, usage --detailed
79
+ API: api ls, api info, api examples, api openapi
57
80
  Docs: docs, docs <topic>, docs --list
58
- Advanced: mcp, api
81
+ Advanced: mcp
59
82
 
60
83
  Common Workflows:
61
84
  # Verify a feature in the browser
@@ -68,12 +91,31 @@ Common Workflows:
68
91
  qa-use test init
69
92
  qa-use test run example-test
70
93
 
94
+ # Explore and call API endpoints
95
+ qa-use api ls
96
+ qa-use api info /api/v1/tests
97
+ qa-use api /api/v1/tests -f limit=5
98
+
71
99
  # Record a flow and generate a test
72
100
  qa-use browser create
73
101
  qa-use browser goto https://your-app.com
74
102
  qa-use browser click <ref>
75
103
  qa-use browser generate-test my-test
76
104
 
105
+ # Manage test suites
106
+ qa-use suite create -F name="Smoke Tests"
107
+ qa-use suite list
108
+ qa-use suite run <suite-id>
109
+
110
+ # Review test run results
111
+ qa-use test runs list --limit 5
112
+ qa-use test runs info <run-id>
113
+ qa-use test runs steps <run-id>
114
+
115
+ # Check issues and usage
116
+ qa-use issues list --limit 10
117
+ qa-use usage --detailed
118
+
77
119
  # Get help on writing tests
78
120
  qa-use docs test-format
79
121
  ${updateHint}`;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":";AAEA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,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C;AACtC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjC,wEAAwE;AACxE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;IACnC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACnC,mBAAmB,EAAE,CAAC;AACxB,CAAC;AAED,iDAAiD;AACjD,OAAO,CAAC,WAAW,CACjB,QAAQ,EACR;;;;;;;CAOD,CACA,CAAC;AAEF,iEAAiE;AACjE,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE;IAChC,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDP,UAAU,EAAE,CAAC;AACf,CAAC,CAAC,CAAC;AAEH,+BAA+B;AAC/B,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Shared API request helpers for CLI commands.
3
+ *
4
+ * Config-aware wrapper around executeApiRequest (from api/lib/http.ts)
5
+ * so individual CLI commands don't repeat boilerplate.
6
+ */
7
+ import type { CliConfig } from './config.js';
8
+ /**
9
+ * Validates that the config contains an API key.
10
+ * Exits the process with a helpful message when missing.
11
+ */
12
+ export declare function requireApiKey(config: CliConfig): asserts config is CliConfig & {
13
+ api_key: string;
14
+ };
15
+ export interface ApiCallOptions {
16
+ query?: Record<string, string>;
17
+ body?: unknown;
18
+ headers?: Record<string, string>;
19
+ }
20
+ /**
21
+ * Makes an authenticated API request using the CLI config.
22
+ * Throws on HTTP errors (status >= 400) with a human-readable message.
23
+ */
24
+ export declare function apiCall(config: CliConfig, method: string, path: string, options?: ApiCallOptions): Promise<unknown>;
25
+ /**
26
+ * Builds pagination query params from common CLI options.
27
+ * Only includes keys whose values are defined.
28
+ */
29
+ export declare function paginationQuery(options: {
30
+ limit?: string;
31
+ offset?: string;
32
+ }): Record<string, string>;
33
+ /**
34
+ * Collector for Commander's repeatable `-F`/`--field` option.
35
+ *
36
+ * Usage with Commander:
37
+ * ```
38
+ * .option('-F, --field <key=value>', 'Set field', collectFields, [])
39
+ * ```
40
+ */
41
+ export declare function collectFields(value: string, previous: string[]): string[];
42
+ /**
43
+ * Reads body from `--input` file and/or `-F` fields and merges them.
44
+ * Values that parse as valid JSON are treated as JSON
45
+ * (e.g. `-F test_ids='["id1","id2"]'`).
46
+ *
47
+ * Stdin (piped) is intentionally **not** read here — that would complicate
48
+ * interactive commands. Add it later if needed.
49
+ */
50
+ export declare function parseResourceInput(options: {
51
+ input?: string;
52
+ field?: string[];
53
+ }): Promise<Record<string, unknown>>;
54
+ /**
55
+ * Confirmation prompt for destructive operations.
56
+ * Returns `true` when the user types y/yes (case-insensitive).
57
+ */
58
+ export declare function confirmAction(message: string): Promise<boolean>;
59
+ //# sourceMappingURL=api-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-helpers.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/api-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,MAAM,IAAI,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAMnD;AAMD,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,CAoBlB;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKzB;AAMD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGzE;AAMD;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA4CnC;AAMD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYrE"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Shared API request helpers for CLI commands.
3
+ *
4
+ * Config-aware wrapper around executeApiRequest (from api/lib/http.ts)
5
+ * so individual CLI commands don't repeat boilerplate.
6
+ */
7
+ import * as fs from 'node:fs/promises';
8
+ import * as readline from 'node:readline/promises';
9
+ import { executeApiRequest, formatApiResponseError } from '../commands/api/lib/http.js';
10
+ // ---------------------------------------------------------------------------
11
+ // requireApiKey
12
+ // ---------------------------------------------------------------------------
13
+ /**
14
+ * Validates that the config contains an API key.
15
+ * Exits the process with a helpful message when missing.
16
+ */
17
+ export function requireApiKey(config) {
18
+ if (!config.api_key) {
19
+ console.log('\x1b[31m✗\x1b[0m API key not configured');
20
+ console.log(' Run `qa-use setup` to configure');
21
+ process.exit(1);
22
+ }
23
+ }
24
+ /**
25
+ * Makes an authenticated API request using the CLI config.
26
+ * Throws on HTTP errors (status >= 400) with a human-readable message.
27
+ */
28
+ export async function apiCall(config, method, path, options = {}) {
29
+ requireApiKey(config);
30
+ const apiUrl = config.api_url || 'https://api.desplega.ai';
31
+ const response = await executeApiRequest({
32
+ apiUrl,
33
+ apiKey: config.api_key,
34
+ method,
35
+ path,
36
+ headers: { ...config.headers, ...options.headers },
37
+ query: options.query,
38
+ body: options.body,
39
+ });
40
+ if (response.status >= 400) {
41
+ throw new Error(formatApiResponseError(response.status, response.statusText, response.data));
42
+ }
43
+ return response.data;
44
+ }
45
+ // ---------------------------------------------------------------------------
46
+ // paginationQuery
47
+ // ---------------------------------------------------------------------------
48
+ /**
49
+ * Builds pagination query params from common CLI options.
50
+ * Only includes keys whose values are defined.
51
+ */
52
+ export function paginationQuery(options) {
53
+ const query = {};
54
+ if (options.limit !== undefined)
55
+ query.limit = options.limit;
56
+ if (options.offset !== undefined)
57
+ query.offset = options.offset;
58
+ return query;
59
+ }
60
+ // ---------------------------------------------------------------------------
61
+ // collectFields
62
+ // ---------------------------------------------------------------------------
63
+ /**
64
+ * Collector for Commander's repeatable `-F`/`--field` option.
65
+ *
66
+ * Usage with Commander:
67
+ * ```
68
+ * .option('-F, --field <key=value>', 'Set field', collectFields, [])
69
+ * ```
70
+ */
71
+ export function collectFields(value, previous) {
72
+ previous.push(value);
73
+ return previous;
74
+ }
75
+ // ---------------------------------------------------------------------------
76
+ // parseResourceInput
77
+ // ---------------------------------------------------------------------------
78
+ /**
79
+ * Reads body from `--input` file and/or `-F` fields and merges them.
80
+ * Values that parse as valid JSON are treated as JSON
81
+ * (e.g. `-F test_ids='["id1","id2"]'`).
82
+ *
83
+ * Stdin (piped) is intentionally **not** read here — that would complicate
84
+ * interactive commands. Add it later if needed.
85
+ */
86
+ export async function parseResourceInput(options) {
87
+ let base = {};
88
+ // 1. --input file
89
+ if (options.input) {
90
+ const raw = await fs.readFile(options.input, 'utf-8');
91
+ try {
92
+ const parsed = JSON.parse(raw);
93
+ if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {
94
+ base = parsed;
95
+ }
96
+ else {
97
+ throw new Error(`Input file must contain a JSON object, got ${typeof parsed}`);
98
+ }
99
+ }
100
+ catch (err) {
101
+ if (err instanceof SyntaxError) {
102
+ throw new Error(`Failed to parse JSON input file: ${options.input}`);
103
+ }
104
+ throw err;
105
+ }
106
+ }
107
+ // 2. -F fields (override --input values)
108
+ if (options.field) {
109
+ for (const entry of options.field) {
110
+ const idx = entry.indexOf('=');
111
+ if (idx <= 0) {
112
+ throw new Error(`Invalid field \`${entry}\`. Expected format key=value`);
113
+ }
114
+ const key = entry.slice(0, idx).trim();
115
+ const rawValue = entry.slice(idx + 1).trim();
116
+ // Try to parse as JSON (arrays, objects, numbers, booleans)
117
+ let value = rawValue;
118
+ try {
119
+ value = JSON.parse(rawValue);
120
+ }
121
+ catch {
122
+ // Not valid JSON — keep as string
123
+ }
124
+ base[key] = value;
125
+ }
126
+ }
127
+ return base;
128
+ }
129
+ // ---------------------------------------------------------------------------
130
+ // confirmAction
131
+ // ---------------------------------------------------------------------------
132
+ /**
133
+ * Confirmation prompt for destructive operations.
134
+ * Returns `true` when the user types y/yes (case-insensitive).
135
+ */
136
+ export async function confirmAction(message) {
137
+ const rl = readline.createInterface({
138
+ input: process.stdin,
139
+ output: process.stderr,
140
+ });
141
+ try {
142
+ const answer = await rl.question(`${message} [y/N] `);
143
+ return /^y(es)?$/i.test(answer.trim());
144
+ }
145
+ finally {
146
+ rl.close();
147
+ }
148
+ }
149
+ //# sourceMappingURL=api-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-helpers.js","sourceRoot":"","sources":["../../../../src/cli/lib/api-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KA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,CAAC,GAAG,OAAO,SAAS,CAAC,CAAC;QACtD,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC"}
@@ -1,12 +1,15 @@
1
1
  /**
2
2
  * Configuration file management for .qa-use.json
3
3
  */
4
+ import { BrowserApiClient } from '../../../lib/api/browser.js';
5
+ import { ApiClient } from '../../../lib/api/index.js';
4
6
  export interface CliConfig {
5
7
  env?: Record<string, string>;
6
8
  api_key?: string;
7
9
  api_url?: string;
8
10
  default_app_config_id?: string;
9
11
  test_directory?: string;
12
+ headers?: Record<string, string>;
10
13
  defaults?: {
11
14
  headless?: boolean;
12
15
  persist?: boolean;
@@ -37,4 +40,12 @@ export declare function saveConfig(config: CliConfig): Promise<void>;
37
40
  * Check if config file exists
38
41
  */
39
42
  export declare function configExists(): Promise<boolean>;
43
+ /**
44
+ * Create a BrowserApiClient pre-configured with API key and custom headers from config.
45
+ */
46
+ export declare function createBrowserClient(config: CliConfig): BrowserApiClient;
47
+ /**
48
+ * Create an ApiClient pre-configured with API key and custom headers from config.
49
+ */
50
+ export declare function createApiClient(config: CliConfig): ApiClient;
40
51
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAA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H,wBAAsB,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,CAsErD;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjE;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAErD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,gBAAgB,CAKvE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAK5D"}
@@ -4,6 +4,8 @@
4
4
  import * as fs from 'node:fs/promises';
5
5
  import { homedir } from 'node:os';
6
6
  import * as path from 'node:path';
7
+ import { BrowserApiClient } from '../../../lib/api/browser.js';
8
+ import { ApiClient } from '../../../lib/api/index.js';
7
9
  const CONFIG_FILENAME = '.qa-use.json';
8
10
  const LEGACY_CONFIG_FILENAME = '.qa-use-tests.json';
9
11
  const legacyWarningShown = new Set();
@@ -97,6 +99,26 @@ export async function loadConfig() {
97
99
  if (process.env.QA_USE_DEFAULT_APP_CONFIG_ID) {
98
100
  config.default_app_config_id = process.env.QA_USE_DEFAULT_APP_CONFIG_ID;
99
101
  }
102
+ // Resolve custom headers: config file headers + QA_USE_HEADERS env var (env wins)
103
+ const resolvedHeaders = {};
104
+ if (config.headers) {
105
+ Object.assign(resolvedHeaders, config.headers);
106
+ }
107
+ const envHeaders = process.env.QA_USE_HEADERS;
108
+ if (envHeaders) {
109
+ try {
110
+ const parsed = JSON.parse(envHeaders);
111
+ if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {
112
+ Object.assign(resolvedHeaders, parsed);
113
+ }
114
+ }
115
+ catch {
116
+ console.error('Warning: QA_USE_HEADERS is not valid JSON, ignoring');
117
+ }
118
+ }
119
+ if (Object.keys(resolvedHeaders).length > 0) {
120
+ config.headers = resolvedHeaders;
121
+ }
100
122
  return config;
101
123
  }
102
124
  /**
@@ -113,4 +135,26 @@ export async function saveConfig(config) {
113
135
  export async function configExists() {
114
136
  return (await findConfigFile()) !== null;
115
137
  }
138
+ /**
139
+ * Create a BrowserApiClient pre-configured with API key and custom headers from config.
140
+ */
141
+ export function createBrowserClient(config) {
142
+ const client = new BrowserApiClient(config.api_url);
143
+ if (config.api_key)
144
+ client.setApiKey(config.api_key);
145
+ if (config.headers)
146
+ client.setCustomHeaders(config.headers);
147
+ return client;
148
+ }
149
+ /**
150
+ * Create an ApiClient pre-configured with API key and custom headers from config.
151
+ */
152
+ export function createApiClient(config) {
153
+ const client = new ApiClient(config.api_url);
154
+ if (config.api_key)
155
+ client.setApiKey(config.api_key);
156
+ if (config.headers)
157
+ client.setCustomHeaders(config.headers);
158
+ return client;
159
+ }
116
160
  //# sourceMappingURL=config.js.map