@skyramp/mcp 0.0.63 → 0.0.64-rc.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 (577) hide show
  1. package/build/index.js +23 -6
  2. package/build/playwright/PlaywrightTraceService.js +74 -0
  3. package/build/playwright/index.js +3 -0
  4. package/build/playwright/registerPlaywrightTools.js +117 -0
  5. package/build/playwright/traceRecordingPrompt.js +54 -0
  6. package/build/prompts/startTraceCollectionPrompts.js +4 -2
  7. package/build/prompts/test-recommendation/recommendationSections.js +88 -212
  8. package/build/prompts/test-recommendation/test-recommendation-prompt.js +336 -85
  9. package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +58 -15
  10. package/build/prompts/testGenerationPrompt.js +1 -1
  11. package/build/prompts/testbot/testbot-prompts.js +44 -22
  12. package/build/services/ModularizationService.js +1 -1
  13. package/build/services/TestExecutionService.js +1 -1
  14. package/build/services/TestGenerationService.js +8 -1
  15. package/build/services/TestGenerationService.test.js +11 -11
  16. package/build/tools/code-refactor/modularizationTool.js +50 -8
  17. package/build/tools/generate-tests/generateContractRestTool.js +125 -12
  18. package/build/tools/generate-tests/generateIntegrationRestTool.js +83 -1
  19. package/build/tools/generate-tests/generateUIRestTool.js +10 -2
  20. package/build/tools/submitReportTool.js +26 -7
  21. package/build/tools/submitReportTool.test.js +1 -1
  22. package/build/tools/test-management/analyzeChangesTool.js +9 -4
  23. package/build/tools/trace/startTraceCollectionTool.js +6 -9
  24. package/build/tools/trace/stopTraceCollectionTool.js +2 -2
  25. package/build/types/RepositoryAnalysis.js +3 -1
  26. package/build/utils/normalizeParams.js +45 -0
  27. package/build/utils/scenarioDrafting.js +418 -93
  28. package/build/utils/scenarioDrafting.test.js +190 -2
  29. package/build/utils/trace-parser.js +49 -22
  30. package/node_modules/playwright/ThirdPartyNotices.txt +7456 -0
  31. package/node_modules/playwright/cli.js +19 -0
  32. package/node_modules/playwright/index.d.ts +17 -0
  33. package/node_modules/playwright/index.js +17 -0
  34. package/node_modules/playwright/index.mjs +18 -0
  35. package/node_modules/playwright/jsx-runtime.js +42 -0
  36. package/node_modules/playwright/jsx-runtime.mjs +21 -0
  37. package/node_modules/playwright/lib/agents/agentParser.js +89 -0
  38. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  39. package/node_modules/playwright/lib/agents/generateAgents.js +348 -0
  40. package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  41. package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  42. package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  43. package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  44. package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
  45. package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  46. package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +73 -0
  47. package/node_modules/playwright/lib/common/config.js +282 -0
  48. package/node_modules/playwright/lib/common/configLoader.js +344 -0
  49. package/node_modules/playwright/lib/common/esmLoaderHost.js +104 -0
  50. package/node_modules/playwright/lib/common/expectBundle.js +28 -0
  51. package/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
  52. package/node_modules/playwright/lib/common/fixtures.js +302 -0
  53. package/node_modules/playwright/lib/common/globals.js +58 -0
  54. package/node_modules/playwright/lib/common/ipc.js +60 -0
  55. package/node_modules/playwright/lib/common/poolBuilder.js +85 -0
  56. package/node_modules/playwright/lib/common/process.js +132 -0
  57. package/node_modules/playwright/lib/common/suiteUtils.js +140 -0
  58. package/node_modules/playwright/lib/common/test.js +321 -0
  59. package/node_modules/playwright/lib/common/testLoader.js +101 -0
  60. package/node_modules/playwright/lib/common/testType.js +298 -0
  61. package/node_modules/playwright/lib/common/validators.js +68 -0
  62. package/node_modules/playwright/lib/fsWatcher.js +67 -0
  63. package/node_modules/playwright/lib/index.js +726 -0
  64. package/node_modules/playwright/lib/internalsForTest.js +42 -0
  65. package/node_modules/playwright/lib/isomorphic/events.js +77 -0
  66. package/node_modules/playwright/lib/isomorphic/folders.js +30 -0
  67. package/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
  68. package/node_modules/playwright/lib/isomorphic/teleReceiver.js +521 -0
  69. package/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +157 -0
  70. package/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
  71. package/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
  72. package/node_modules/playwright/lib/isomorphic/testTree.js +329 -0
  73. package/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
  74. package/node_modules/playwright/lib/loader/loaderMain.js +59 -0
  75. package/node_modules/playwright/lib/matchers/expect.js +311 -0
  76. package/node_modules/playwright/lib/matchers/matcherHint.js +44 -0
  77. package/node_modules/playwright/lib/matchers/matchers.js +383 -0
  78. package/node_modules/playwright/lib/matchers/toBeTruthy.js +75 -0
  79. package/node_modules/playwright/lib/matchers/toEqual.js +100 -0
  80. package/node_modules/playwright/lib/matchers/toHaveURL.js +101 -0
  81. package/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
  82. package/node_modules/playwright/lib/matchers/toMatchSnapshot.js +342 -0
  83. package/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
  84. package/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +329 -0
  85. package/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +84 -0
  86. package/node_modules/playwright/lib/mcp/browser/config.js +421 -0
  87. package/node_modules/playwright/lib/mcp/browser/context.js +296 -0
  88. package/node_modules/playwright/lib/mcp/browser/response.js +278 -0
  89. package/node_modules/playwright/lib/mcp/browser/sessionLog.js +75 -0
  90. package/node_modules/playwright/lib/mcp/browser/tab.js +343 -0
  91. package/node_modules/playwright/lib/mcp/browser/tools/common.js +65 -0
  92. package/node_modules/playwright/lib/mcp/browser/tools/console.js +46 -0
  93. package/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
  94. package/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +61 -0
  95. package/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
  96. package/node_modules/playwright/lib/mcp/browser/tools/form.js +63 -0
  97. package/node_modules/playwright/lib/mcp/browser/tools/install.js +72 -0
  98. package/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +107 -0
  99. package/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
  100. package/node_modules/playwright/lib/mcp/browser/tools/navigate.js +71 -0
  101. package/node_modules/playwright/lib/mcp/browser/tools/network.js +63 -0
  102. package/node_modules/playwright/lib/mcp/browser/tools/open.js +57 -0
  103. package/node_modules/playwright/lib/mcp/browser/tools/pdf.js +49 -0
  104. package/node_modules/playwright/lib/mcp/browser/tools/runCode.js +78 -0
  105. package/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +93 -0
  106. package/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +173 -0
  107. package/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
  108. package/node_modules/playwright/lib/mcp/browser/tools/tool.js +47 -0
  109. package/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
  110. package/node_modules/playwright/lib/mcp/browser/tools/utils.js +94 -0
  111. package/node_modules/playwright/lib/mcp/browser/tools/verify.js +143 -0
  112. package/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
  113. package/node_modules/playwright/lib/mcp/browser/tools.js +84 -0
  114. package/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
  115. package/node_modules/playwright/lib/mcp/config.d.js +16 -0
  116. package/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
  117. package/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +76 -0
  118. package/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
  119. package/node_modules/playwright/lib/mcp/index.js +61 -0
  120. package/node_modules/playwright/lib/mcp/log.js +35 -0
  121. package/node_modules/playwright/lib/mcp/program.js +111 -0
  122. package/node_modules/playwright/lib/mcp/sdk/exports.js +28 -0
  123. package/node_modules/playwright/lib/mcp/sdk/http.js +152 -0
  124. package/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
  125. package/node_modules/playwright/lib/mcp/sdk/server.js +223 -0
  126. package/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
  127. package/node_modules/playwright/lib/mcp/skyramp/exportTool.js +88 -0
  128. package/node_modules/playwright/lib/mcp/skyramp/index.js +36 -0
  129. package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +236 -0
  130. package/node_modules/playwright/lib/mcp/skyramp/types.js +31 -0
  131. package/node_modules/playwright/lib/mcp/terminal/cli.js +296 -0
  132. package/node_modules/playwright/lib/mcp/terminal/command.js +56 -0
  133. package/node_modules/playwright/lib/mcp/terminal/commands.js +333 -0
  134. package/node_modules/playwright/lib/mcp/terminal/daemon.js +129 -0
  135. package/node_modules/playwright/lib/mcp/terminal/help.json +32 -0
  136. package/node_modules/playwright/lib/mcp/terminal/helpGenerator.js +88 -0
  137. package/node_modules/playwright/lib/mcp/terminal/socketConnection.js +80 -0
  138. package/node_modules/playwright/lib/mcp/test/browserBackend.js +98 -0
  139. package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  140. package/node_modules/playwright/lib/mcp/test/plannerTools.js +145 -0
  141. package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  142. package/node_modules/playwright/lib/mcp/test/skyRampExport.js +313 -0
  143. package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  144. package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  145. package/node_modules/playwright/lib/mcp/test/testContext.js +285 -0
  146. package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  147. package/node_modules/playwright/lib/mcp/test/testTools.js +108 -0
  148. package/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
  149. package/node_modules/playwright/lib/plugins/index.js +28 -0
  150. package/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
  151. package/node_modules/playwright/lib/program.js +417 -0
  152. package/node_modules/playwright/lib/reporters/base.js +634 -0
  153. package/node_modules/playwright/lib/reporters/blob.js +138 -0
  154. package/node_modules/playwright/lib/reporters/dot.js +99 -0
  155. package/node_modules/playwright/lib/reporters/empty.js +32 -0
  156. package/node_modules/playwright/lib/reporters/github.js +128 -0
  157. package/node_modules/playwright/lib/reporters/html.js +633 -0
  158. package/node_modules/playwright/lib/reporters/internalReporter.js +138 -0
  159. package/node_modules/playwright/lib/reporters/json.js +254 -0
  160. package/node_modules/playwright/lib/reporters/junit.js +232 -0
  161. package/node_modules/playwright/lib/reporters/line.js +131 -0
  162. package/node_modules/playwright/lib/reporters/list.js +253 -0
  163. package/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
  164. package/node_modules/playwright/lib/reporters/markdown.js +144 -0
  165. package/node_modules/playwright/lib/reporters/merge.js +558 -0
  166. package/node_modules/playwright/lib/reporters/multiplexer.js +112 -0
  167. package/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
  168. package/node_modules/playwright/lib/reporters/teleEmitter.js +317 -0
  169. package/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
  170. package/node_modules/playwright/lib/runner/dispatcher.js +530 -0
  171. package/node_modules/playwright/lib/runner/failureTracker.js +72 -0
  172. package/node_modules/playwright/lib/runner/lastRun.js +77 -0
  173. package/node_modules/playwright/lib/runner/loadUtils.js +334 -0
  174. package/node_modules/playwright/lib/runner/loaderHost.js +89 -0
  175. package/node_modules/playwright/lib/runner/processHost.js +180 -0
  176. package/node_modules/playwright/lib/runner/projectUtils.js +241 -0
  177. package/node_modules/playwright/lib/runner/rebase.js +189 -0
  178. package/node_modules/playwright/lib/runner/reporters.js +138 -0
  179. package/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
  180. package/node_modules/playwright/lib/runner/storage.js +91 -0
  181. package/node_modules/playwright/lib/runner/taskRunner.js +127 -0
  182. package/node_modules/playwright/lib/runner/tasks.js +410 -0
  183. package/node_modules/playwright/lib/runner/testGroups.js +125 -0
  184. package/node_modules/playwright/lib/runner/testRunner.js +398 -0
  185. package/node_modules/playwright/lib/runner/testServer.js +269 -0
  186. package/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
  187. package/node_modules/playwright/lib/runner/vcs.js +72 -0
  188. package/node_modules/playwright/lib/runner/watchMode.js +396 -0
  189. package/node_modules/playwright/lib/runner/workerHost.js +104 -0
  190. package/node_modules/playwright/lib/third_party/pirates.js +62 -0
  191. package/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
  192. package/node_modules/playwright/lib/transform/babelBundle.js +46 -0
  193. package/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
  194. package/node_modules/playwright/lib/transform/compilationCache.js +274 -0
  195. package/node_modules/playwright/lib/transform/esmLoader.js +103 -0
  196. package/node_modules/playwright/lib/transform/md.js +221 -0
  197. package/node_modules/playwright/lib/transform/portTransport.js +67 -0
  198. package/node_modules/playwright/lib/transform/transform.js +303 -0
  199. package/node_modules/playwright/lib/util.js +400 -0
  200. package/node_modules/playwright/lib/utilsBundle.js +50 -0
  201. package/node_modules/playwright/lib/utilsBundleImpl.js +103 -0
  202. package/node_modules/playwright/lib/worker/fixtureRunner.js +262 -0
  203. package/node_modules/playwright/lib/worker/testInfo.js +536 -0
  204. package/node_modules/playwright/lib/worker/testTracing.js +345 -0
  205. package/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
  206. package/node_modules/playwright/lib/worker/util.js +31 -0
  207. package/node_modules/playwright/lib/worker/workerMain.js +530 -0
  208. package/node_modules/playwright/package.json +73 -0
  209. package/node_modules/playwright/test.d.ts +18 -0
  210. package/node_modules/playwright/test.js +24 -0
  211. package/node_modules/playwright/test.mjs +34 -0
  212. package/node_modules/playwright/types/test.d.ts +10251 -0
  213. package/node_modules/playwright/types/testReporter.d.ts +822 -0
  214. package/node_modules/playwright-core/LICENSE +202 -0
  215. package/node_modules/playwright-core/NOTICE +5 -0
  216. package/node_modules/playwright-core/README.md +3 -0
  217. package/node_modules/playwright-core/ThirdPartyNotices.txt +4076 -0
  218. package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
  219. package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
  220. package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  221. package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  222. package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  223. package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  224. package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  225. package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  226. package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  227. package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  228. package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  229. package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  230. package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  231. package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  232. package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  233. package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  234. package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  235. package/node_modules/playwright-core/browsers.json +79 -0
  236. package/node_modules/playwright-core/cli.js +18 -0
  237. package/node_modules/playwright-core/index.d.ts +17 -0
  238. package/node_modules/playwright-core/index.js +32 -0
  239. package/node_modules/playwright-core/index.mjs +28 -0
  240. package/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
  241. package/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
  242. package/node_modules/playwright-core/lib/cli/driver.js +97 -0
  243. package/node_modules/playwright-core/lib/cli/program.js +589 -0
  244. package/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
  245. package/node_modules/playwright-core/lib/client/android.js +361 -0
  246. package/node_modules/playwright-core/lib/client/api.js +137 -0
  247. package/node_modules/playwright-core/lib/client/artifact.js +79 -0
  248. package/node_modules/playwright-core/lib/client/browser.js +161 -0
  249. package/node_modules/playwright-core/lib/client/browserContext.js +582 -0
  250. package/node_modules/playwright-core/lib/client/browserType.js +185 -0
  251. package/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
  252. package/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
  253. package/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
  254. package/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
  255. package/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
  256. package/node_modules/playwright-core/lib/client/clock.js +68 -0
  257. package/node_modules/playwright-core/lib/client/connection.js +318 -0
  258. package/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
  259. package/node_modules/playwright-core/lib/client/coverage.js +44 -0
  260. package/node_modules/playwright-core/lib/client/dialog.js +56 -0
  261. package/node_modules/playwright-core/lib/client/download.js +62 -0
  262. package/node_modules/playwright-core/lib/client/electron.js +138 -0
  263. package/node_modules/playwright-core/lib/client/elementHandle.js +284 -0
  264. package/node_modules/playwright-core/lib/client/errors.js +77 -0
  265. package/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
  266. package/node_modules/playwright-core/lib/client/events.js +103 -0
  267. package/node_modules/playwright-core/lib/client/fetch.js +368 -0
  268. package/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
  269. package/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
  270. package/node_modules/playwright-core/lib/client/frame.js +409 -0
  271. package/node_modules/playwright-core/lib/client/harRouter.js +87 -0
  272. package/node_modules/playwright-core/lib/client/input.js +84 -0
  273. package/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
  274. package/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
  275. package/node_modules/playwright-core/lib/client/localUtils.js +60 -0
  276. package/node_modules/playwright-core/lib/client/locator.js +369 -0
  277. package/node_modules/playwright-core/lib/client/network.js +747 -0
  278. package/node_modules/playwright-core/lib/client/page.js +745 -0
  279. package/node_modules/playwright-core/lib/client/pageAgent.js +64 -0
  280. package/node_modules/playwright-core/lib/client/platform.js +77 -0
  281. package/node_modules/playwright-core/lib/client/playwright.js +71 -0
  282. package/node_modules/playwright-core/lib/client/selectors.js +55 -0
  283. package/node_modules/playwright-core/lib/client/stream.js +39 -0
  284. package/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
  285. package/node_modules/playwright-core/lib/client/tracing.js +119 -0
  286. package/node_modules/playwright-core/lib/client/types.js +28 -0
  287. package/node_modules/playwright-core/lib/client/video.js +59 -0
  288. package/node_modules/playwright-core/lib/client/waiter.js +142 -0
  289. package/node_modules/playwright-core/lib/client/webError.js +39 -0
  290. package/node_modules/playwright-core/lib/client/webSocket.js +93 -0
  291. package/node_modules/playwright-core/lib/client/worker.js +85 -0
  292. package/node_modules/playwright-core/lib/client/writableStream.js +39 -0
  293. package/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
  294. package/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
  295. package/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
  296. package/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
  297. package/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
  298. package/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
  299. package/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
  300. package/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
  301. package/node_modules/playwright-core/lib/inprocess.js +3 -0
  302. package/node_modules/playwright-core/lib/mcpBundle.js +84 -0
  303. package/node_modules/playwright-core/lib/mcpBundleImpl/index.js +147 -0
  304. package/node_modules/playwright-core/lib/outofprocess.js +76 -0
  305. package/node_modules/playwright-core/lib/protocol/serializers.js +197 -0
  306. package/node_modules/playwright-core/lib/protocol/validator.js +2969 -0
  307. package/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
  308. package/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
  309. package/node_modules/playwright-core/lib/remote/playwrightServer.js +334 -0
  310. package/node_modules/playwright-core/lib/server/agent/actionRunner.js +335 -0
  311. package/node_modules/playwright-core/lib/server/agent/actions.js +128 -0
  312. package/node_modules/playwright-core/lib/server/agent/codegen.js +111 -0
  313. package/node_modules/playwright-core/lib/server/agent/context.js +150 -0
  314. package/node_modules/playwright-core/lib/server/agent/expectTools.js +156 -0
  315. package/node_modules/playwright-core/lib/server/agent/pageAgent.js +204 -0
  316. package/node_modules/playwright-core/lib/server/agent/performTools.js +262 -0
  317. package/node_modules/playwright-core/lib/server/agent/tool.js +109 -0
  318. package/node_modules/playwright-core/lib/server/android/android.js +465 -0
  319. package/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
  320. package/node_modules/playwright-core/lib/server/artifact.js +127 -0
  321. package/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +549 -0
  322. package/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +149 -0
  323. package/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +213 -0
  324. package/node_modules/playwright-core/lib/server/bidi/bidiDeserializer.js +116 -0
  325. package/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +267 -0
  326. package/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +128 -0
  327. package/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
  328. package/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
  329. package/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
  330. package/node_modules/playwright-core/lib/server/bidi/bidiPage.js +583 -0
  331. package/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
  332. package/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
  333. package/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
  334. package/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
  335. package/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +180 -0
  336. package/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
  337. package/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
  338. package/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
  339. package/node_modules/playwright-core/lib/server/browser.js +149 -0
  340. package/node_modules/playwright-core/lib/server/browserContext.js +702 -0
  341. package/node_modules/playwright-core/lib/server/browserType.js +336 -0
  342. package/node_modules/playwright-core/lib/server/callLog.js +82 -0
  343. package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  344. package/node_modules/playwright-core/lib/server/chromium/chromium.js +397 -0
  345. package/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
  346. package/node_modules/playwright-core/lib/server/chromium/crBrowser.js +520 -0
  347. package/node_modules/playwright-core/lib/server/chromium/crConnection.js +197 -0
  348. package/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
  349. package/node_modules/playwright-core/lib/server/chromium/crDevTools.js +111 -0
  350. package/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
  351. package/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
  352. package/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
  353. package/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +707 -0
  354. package/node_modules/playwright-core/lib/server/chromium/crPage.js +1001 -0
  355. package/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
  356. package/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
  357. package/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
  358. package/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
  359. package/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
  360. package/node_modules/playwright-core/lib/server/clock.js +149 -0
  361. package/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
  362. package/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
  363. package/node_modules/playwright-core/lib/server/codegen/javascript.js +247 -0
  364. package/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
  365. package/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
  366. package/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
  367. package/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
  368. package/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
  369. package/node_modules/playwright-core/lib/server/console.js +57 -0
  370. package/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
  371. package/node_modules/playwright-core/lib/server/debugController.js +191 -0
  372. package/node_modules/playwright-core/lib/server/debugger.js +119 -0
  373. package/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
  374. package/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
  375. package/node_modules/playwright-core/lib/server/dialog.js +116 -0
  376. package/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
  377. package/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
  378. package/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +384 -0
  379. package/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
  380. package/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
  381. package/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
  382. package/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
  383. package/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
  384. package/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +364 -0
  385. package/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
  386. package/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
  387. package/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
  388. package/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
  389. package/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
  390. package/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
  391. package/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
  392. package/node_modules/playwright-core/lib/server/dispatchers/pageAgentDispatcher.js +96 -0
  393. package/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +393 -0
  394. package/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
  395. package/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
  396. package/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
  397. package/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
  398. package/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
  399. package/node_modules/playwright-core/lib/server/dom.js +815 -0
  400. package/node_modules/playwright-core/lib/server/download.js +70 -0
  401. package/node_modules/playwright-core/lib/server/electron/electron.js +273 -0
  402. package/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
  403. package/node_modules/playwright-core/lib/server/errors.js +69 -0
  404. package/node_modules/playwright-core/lib/server/fetch.js +621 -0
  405. package/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
  406. package/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
  407. package/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +418 -0
  408. package/node_modules/playwright-core/lib/server/firefox/ffConnection.js +142 -0
  409. package/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
  410. package/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
  411. package/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
  412. package/node_modules/playwright-core/lib/server/firefox/ffPage.js +497 -0
  413. package/node_modules/playwright-core/lib/server/firefox/firefox.js +114 -0
  414. package/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
  415. package/node_modules/playwright-core/lib/server/formData.js +147 -0
  416. package/node_modules/playwright-core/lib/server/frameSelectors.js +160 -0
  417. package/node_modules/playwright-core/lib/server/frames.js +1471 -0
  418. package/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
  419. package/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
  420. package/node_modules/playwright-core/lib/server/harBackend.js +157 -0
  421. package/node_modules/playwright-core/lib/server/helper.js +96 -0
  422. package/node_modules/playwright-core/lib/server/index.js +58 -0
  423. package/node_modules/playwright-core/lib/server/input.js +277 -0
  424. package/node_modules/playwright-core/lib/server/instrumentation.js +72 -0
  425. package/node_modules/playwright-core/lib/server/javascript.js +291 -0
  426. package/node_modules/playwright-core/lib/server/launchApp.js +128 -0
  427. package/node_modules/playwright-core/lib/server/localUtils.js +214 -0
  428. package/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
  429. package/node_modules/playwright-core/lib/server/network.js +667 -0
  430. package/node_modules/playwright-core/lib/server/page.js +830 -0
  431. package/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
  432. package/node_modules/playwright-core/lib/server/playwright.js +69 -0
  433. package/node_modules/playwright-core/lib/server/progress.js +132 -0
  434. package/node_modules/playwright-core/lib/server/protocolError.js +52 -0
  435. package/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
  436. package/node_modules/playwright-core/lib/server/recorder/recorderApp.js +366 -0
  437. package/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
  438. package/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
  439. package/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
  440. package/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
  441. package/node_modules/playwright-core/lib/server/recorder.js +499 -0
  442. package/node_modules/playwright-core/lib/server/registry/browserFetcher.js +177 -0
  443. package/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
  444. package/node_modules/playwright-core/lib/server/registry/index.js +1422 -0
  445. package/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
  446. package/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +127 -0
  447. package/node_modules/playwright-core/lib/server/screencast.js +190 -0
  448. package/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
  449. package/node_modules/playwright-core/lib/server/selectors.js +112 -0
  450. package/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
  451. package/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
  452. package/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
  453. package/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +561 -0
  454. package/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
  455. package/node_modules/playwright-core/lib/server/trace/viewer/traceParser.js +72 -0
  456. package/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +245 -0
  457. package/node_modules/playwright-core/lib/server/transport.js +181 -0
  458. package/node_modules/playwright-core/lib/server/types.js +28 -0
  459. package/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
  460. package/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
  461. package/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
  462. package/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
  463. package/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
  464. package/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
  465. package/node_modules/playwright-core/lib/server/utils/env.js +73 -0
  466. package/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
  467. package/node_modules/playwright-core/lib/server/utils/expectUtils.js +123 -0
  468. package/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
  469. package/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
  470. package/node_modules/playwright-core/lib/server/utils/hostPlatform.js +138 -0
  471. package/node_modules/playwright-core/lib/server/utils/httpServer.js +203 -0
  472. package/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
  473. package/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
  474. package/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
  475. package/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
  476. package/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
  477. package/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
  478. package/node_modules/playwright-core/lib/server/utils/network.js +242 -0
  479. package/node_modules/playwright-core/lib/server/utils/nodePlatform.js +154 -0
  480. package/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
  481. package/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
  482. package/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
  483. package/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
  484. package/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
  485. package/node_modules/playwright-core/lib/server/utils/task.js +51 -0
  486. package/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
  487. package/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
  488. package/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
  489. package/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
  490. package/node_modules/playwright-core/lib/server/videoRecorder.js +124 -0
  491. package/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
  492. package/node_modules/playwright-core/lib/server/webkit/webkit.js +108 -0
  493. package/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +335 -0
  494. package/node_modules/playwright-core/lib/server/webkit/wkConnection.js +144 -0
  495. package/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
  496. package/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
  497. package/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +197 -0
  498. package/node_modules/playwright-core/lib/server/webkit/wkPage.js +1159 -0
  499. package/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
  500. package/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
  501. package/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
  502. package/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +455 -0
  503. package/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
  504. package/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
  505. package/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
  506. package/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
  507. package/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
  508. package/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
  509. package/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
  510. package/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
  511. package/node_modules/playwright-core/lib/utils/isomorphic/lruCache.js +51 -0
  512. package/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
  513. package/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
  514. package/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
  515. package/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
  516. package/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +330 -0
  517. package/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
  518. package/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
  519. package/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
  520. package/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
  521. package/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +204 -0
  522. package/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
  523. package/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
  524. package/node_modules/playwright-core/lib/utils/isomorphic/trace/entries.js +16 -0
  525. package/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotRenderer.js +499 -0
  526. package/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
  527. package/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
  528. package/node_modules/playwright-core/lib/utils/isomorphic/trace/traceLoader.js +131 -0
  529. package/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModel.js +365 -0
  530. package/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModernizer.js +400 -0
  531. package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
  532. package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
  533. package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
  534. package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
  535. package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
  536. package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
  537. package/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
  538. package/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
  539. package/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
  540. package/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
  541. package/node_modules/playwright-core/lib/utils/isomorphic/yaml.js +84 -0
  542. package/node_modules/playwright-core/lib/utils.js +111 -0
  543. package/node_modules/playwright-core/lib/utilsBundle.js +109 -0
  544. package/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
  545. package/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
  546. package/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
  547. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
  548. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DadYNm1I.js +32 -0
  549. package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  550. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BSjZa4pk.css +1 -0
  551. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BhTWtUlo.js +193 -0
  552. package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
  553. package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  554. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-a5XoALAZ.js +32 -0
  555. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CJSZINFr.js +266 -0
  556. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
  557. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
  558. package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  559. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +1 -0
  560. package/node_modules/playwright-core/lib/vite/traceViewer/index.BDwrLSGN.js +2 -0
  561. package/node_modules/playwright-core/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
  562. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
  563. package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  564. package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  565. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
  566. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +5 -0
  567. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
  568. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CQJ9SCIQ.js +5 -0
  569. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
  570. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
  571. package/node_modules/playwright-core/lib/zipBundle.js +34 -0
  572. package/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
  573. package/node_modules/playwright-core/package.json +43 -0
  574. package/node_modules/playwright-core/types/protocol.d.ts +23824 -0
  575. package/node_modules/playwright-core/types/structs.d.ts +45 -0
  576. package/node_modules/playwright-core/types/types.d.ts +22843 -0
  577. package/package.json +6 -2
@@ -1,5 +1,6 @@
1
+ import * as crypto from "crypto";
1
2
  import { WorkspaceAuthType } from "../../utils/workspaceAuth.js";
2
- import { buildPrioritizationDimensions, buildTestExamples, buildTestPatternGuidelines, buildTestQualityCriteria, buildGenerationRules, buildToolWorkflows, buildCoverageChecklist, getAuthSnippets, MAX_CRITICAL_TESTS, } from "./recommendationSections.js";
3
+ import { buildToolWorkflows, buildTestPatternGuidelines, buildTestQualityCriteria, buildTestExamples, buildGenerationRules, getAuthSnippets, MAX_TESTS_TO_GENERATE, MAX_RECOMMENDATIONS, MAX_CRITICAL_TESTS, } from "./recommendationSections.js";
3
4
  function formatTestLocations(locs) {
4
5
  const entries = Object.entries(locs || {});
5
6
  if (entries.length === 0)
@@ -7,7 +8,221 @@ function formatTestLocations(locs) {
7
8
  return "\n**Existing test files (do NOT duplicate these):**\n" +
8
9
  entries.map(([type, files]) => " - [" + type + "] " + files).join("\n");
9
10
  }
10
- export function buildRecommendationPrompt(analysis, analysisScope = "full_repo", topN = 10, prContext, workspaceAuthHeader, workspaceAuthType) {
11
+ const CATEGORY_PRIORITY = {
12
+ new_endpoint: "CRITICAL", // diff-direct scenarios always fill GENERATE slots first
13
+ security_boundary: "HIGH",
14
+ business_rule: "HIGH",
15
+ data_integrity: "HIGH",
16
+ breaking_change: "HIGH",
17
+ auth: "HIGH",
18
+ workflow: "MEDIUM",
19
+ "error-handling": "MEDIUM",
20
+ "data-validation": "MEDIUM",
21
+ crud: "LOW",
22
+ };
23
+ const PRIORITY_ORDER = { CRITICAL: 4, HIGH: 3, MEDIUM: 2, LOW: 1 };
24
+ const NOVELTY_ORDER = { new: 3, modified: 2, existing: 1 };
25
+ function classifyNovelty(scenario, diffContext) {
26
+ if (!diffContext)
27
+ return "existing";
28
+ const paths = scenario.steps.map(s => s.path);
29
+ const newPaths = new Set((diffContext.newEndpoints || []).map(ep => ep.path));
30
+ const modPaths = new Set((diffContext.modifiedEndpoints || []).map(ep => ep.path));
31
+ if (paths.some(p => newPaths.has(p)))
32
+ return "new";
33
+ if (paths.some(p => modPaths.has(p)))
34
+ return "modified";
35
+ return "existing";
36
+ }
37
+ function prioritiseCandidate(scenario, diffContext) {
38
+ const priority = CATEGORY_PRIORITY[scenario.category] ?? "LOW";
39
+ const novelty = classifyNovelty(scenario, diffContext);
40
+ return { priority, novelty };
41
+ }
42
+ function computeTiebreakerSeed(endpoints, diffFiles) {
43
+ const canonical = [...endpoints].sort().join("|") + "::" + [...diffFiles].sort().join("|");
44
+ return crypto.createHash("sha256").update(canonical).digest("hex").slice(0, 8);
45
+ }
46
+ // ── Execution Plan (replaces pre-ranked + scenarios + heuristic sections) ──
47
+ function buildExecutionPlan(scored, maxGen, topN, baseUrl, authHeaderValue, authSchemeSnippet, authTypeValue, seed, endpointCount, isUIOnlyPR, hasFrontendChanges = false, hasTraces = false) {
48
+ const generateItems = scored.slice(0, Math.min(maxGen, scored.length));
49
+ const additionalItems = scored.slice(maxGen, topN);
50
+ const authRef = authHeaderValue
51
+ ? `, authHeader: "${authHeaderValue}"${authSchemeSnippet}`
52
+ : `, authHeader: <check OpenAPI securitySchemes or auth middleware; "" if confirmed unauthenticated>`;
53
+ const hasWorkspaceAuthType = !!authTypeValue && authTypeValue !== "none";
54
+ // For skyramp_scenario_test_generation: always embed full auth so the generated test file
55
+ // includes the correct Authorization header at execution time.
56
+ // The workspace authType conflict only applies to skyramp_integration_test_generation (not scenario gen).
57
+ const scenarioAuthRef = authRef;
58
+ // For skyramp_integration_test_generation with scenarioFile:
59
+ // - If workspace has authType set: omit auth entirely — workspace handles Bearer prefix.
60
+ // - If no authType: pass authHeader only (no authScheme).
61
+ const authHeaderOnlyRef = hasWorkspaceAuthType
62
+ ? ""
63
+ : authHeaderValue
64
+ ? `, authHeader: "${authHeaderValue}"`
65
+ : `, authHeader: <check OpenAPI securitySchemes or auth middleware; "" if confirmed unauthenticated>`;
66
+ const generateBlocks = generateItems.map((item, i) => {
67
+ const rank = i + 1;
68
+ const s = item.scenario;
69
+ const testType = s.testType ?? (s.steps.length === 1 ? "contract" : "integration");
70
+ if (testType === "contract") {
71
+ const step = s.steps[0];
72
+ const endpointURL = `${baseUrl}${step.path}`;
73
+ const isBodyMethod = ["POST", "PUT", "PATCH"].includes(step.method);
74
+ const dataParam = isBodyMethod
75
+ ? `, requestData: <${step.method} ${step.path} body from source code schemas>`
76
+ : "";
77
+ return (`**#${rank} — GENERATE** | ${testType} | ${s.category} | priority=${item.priority} | ${item.novelty}\n` +
78
+ `${step.method} ${step.path} → ${step.expectedStatusCode}\n` +
79
+ `Tool: skyramp_contract_test_generation({ endpointURL: "${endpointURL}", method: "${step.method}"${authRef}${dataParam} })\n` + // contract tests always use full authRef
80
+ `From source: authScheme (OpenAPI securitySchemes or auth middleware)${isBodyMethod ? "; requestData field shapes" : ""}`);
81
+ }
82
+ else {
83
+ // integration / e2e / ui — multi-step scenario pipeline
84
+ const stepLines = s.steps.map((st) => {
85
+ const chains = st.chainsFrom
86
+ ? ` (chains: ${Array.isArray(st.chainsFrom)
87
+ ? st.chainsFrom.map(c => `${c.sourceField} from step ${c.sourceStep}`).join(", ")
88
+ : `${st.chainsFrom.sourceField} from step ${st.chainsFrom.sourceStep}`})`
89
+ : "";
90
+ return ` ${st.order}. ${st.method} ${st.path} → ${st.expectedStatusCode}: ${st.description}${chains}`;
91
+ }).join("\n");
92
+ const toolCalls = s.steps.map((st) => {
93
+ const isBodyMethod = ["POST", "PUT", "PATCH"].includes(st.method);
94
+ const dataParam = isBodyMethod
95
+ ? `, requestBody: <${st.method} ${st.path} body from source code schemas>`
96
+ : "";
97
+ return ` skyramp_scenario_test_generation({ scenarioName: "${s.scenarioName}", destination: "${s.scenarioName}", baseURL: "${baseUrl}", method: "${st.method}", path: "${st.path}", statusCode: ${st.expectedStatusCode}${scenarioAuthRef}${dataParam} })`;
98
+ }).join("\n");
99
+ const prereqNote = s.category === "new_endpoint"
100
+ ? `\nPrerequisite discovery (MANDATORY for new_endpoint): Before executing these tool calls, read the source code for the new endpoint's request body. Look for FK fields (e.g. \`product_id\`, \`user_id\`, \`order_id\`). For each FK field found, prepend one \`skyramp_scenario_test_generation\` call to create that prerequisite resource first, then chain its \`id\` into the dependent step. If no FK fields exist, proceed with the steps above as-is.`
101
+ : "";
102
+ return (`**#${rank} — GENERATE** | ${testType} | ${s.category} | priority=${item.priority} | ${item.novelty}\n` +
103
+ `Scenario: ${s.scenarioName} (${s.steps.length} steps)\n` +
104
+ `${stepLines}\n` +
105
+ `Tool calls:\n` +
106
+ `${toolCalls}\n` +
107
+ ` skyramp_integration_test_generation({ scenarioFile: "scenario_${s.scenarioName}.json"${authHeaderOnlyRef} })\n` +
108
+ `From source: requestBody shapes for POST/PUT/PATCH steps; responseBody shapes; authScheme` +
109
+ prereqNote);
110
+ }
111
+ }).join("\n\n");
112
+ // For mixed PRs, always reserve slots for UI and E2E recommendations regardless of whether
113
+ // traces already exist — the user can record them later or the bot can record during the run.
114
+ const needsE2ESlot = hasFrontendChanges && !isUIOnlyPR;
115
+ const needsUISlot = hasFrontendChanges && !isUIOnlyPR;
116
+ const frontendSlots = (needsE2ESlot ? 1 : 0) + (needsUISlot ? 1 : 0);
117
+ const backendAdditionalItems = frontendSlots > 0
118
+ ? additionalItems.slice(0, Math.max(additionalItems.length - frontendSlots, 0))
119
+ : additionalItems;
120
+ // Additional items — compact listing, no tool calls needed
121
+ const additionalLines = backendAdditionalItems.map((item, i) => {
122
+ const rank = maxGen + i + 1;
123
+ const s = item.scenario;
124
+ const testType = s.testType ?? (s.steps.length === 1 ? "contract" : "integration");
125
+ const target = s.steps.length === 1
126
+ ? `${s.steps[0].method} ${s.steps[0].path} → ${s.steps[0].expectedStatusCode}`
127
+ : `Scenario: ${s.scenarioName} (${s.steps.map(st => `${st.method} ${st.path}`).join(" → ")})`;
128
+ return `#${rank} [ADDITIONAL] | ${testType} | ${s.category} | priority=${item.priority} | ${item.novelty}\n ${target}\n Validates: ${s.description}`;
129
+ }).join("\n\n");
130
+ const uiSlotLine = needsUISlot ? (() => {
131
+ const rank = maxGen + backendAdditionalItems.length + 1;
132
+ const traceNote = hasTraces
133
+ ? "Use an existing Playwright `.zip` trace from the repo."
134
+ : "Record a trace using `browser_navigate` + `browser_snapshot` + `skyramp_export_zip`, then call `skyramp_ui_test_generation`.";
135
+ return `\n\n#${rank} [ADDITIONAL] | UI | workflow | priority=HIGH | new\n Scenario: ui-interaction-for-changed-components (frontend files changed in this diff)\n Validates: Component-level interaction flow for the changed UI — derive the scenario name and steps from the actual changed frontend files. ${traceNote}`;
136
+ })() : "";
137
+ const e2eSlotLine = needsE2ESlot ? (() => {
138
+ const rank = maxGen + backendAdditionalItems.length + (needsUISlot ? 1 : 0) + 1;
139
+ const traceNote = hasTraces
140
+ ? "Call `skyramp_e2e_test_generation` with the discovered trace/recording files."
141
+ : "No traces exist yet — record a backend trace via `skyramp_start_trace_collection` + `skyramp_stop_trace_collection` and a UI trace via Playwright browser tools, then call `skyramp_e2e_test_generation`.";
142
+ return `\n\n#${rank} [ADDITIONAL] | E2E | workflow | priority=HIGH | new\n Scenario: e2e-flow-for-changed-feature (frontend + backend files changed in this diff)\n Validates: Full browser-level flow for the changed UI components end-to-end — derive the scenario name and steps from the actual changed frontend files. ${traceNote}`;
143
+ })() : "";
144
+ const supplementCount = topN - generateItems.length - backendAdditionalItems.length - frontendSlots;
145
+ const supplementNote = supplementCount > 0
146
+ ? `\n**REQUIRED — You MUST add ${supplementCount} more to reach the total of ${topN}.** Draft them from endpoint interactions and source code patterns not yet covered. Use the same 5-dimension rubric and quality gate to assign priority (HIGH/MEDIUM/LOW), testType, and category.${hasFrontendChanges && !isUIOnlyPR ? " Since this PR has frontend changes, at least 1 of these should be a UI or E2E test targeting the changed components." : ""} Do NOT produce fewer than ${topN} total.`
147
+ : "";
148
+ return `## Execution Plan
149
+ Seed: ${seed} | Endpoints: ${endpointCount} | Budget: ${generateItems.length} generate + ${Math.max(topN - generateItems.length, 0)} additional = ${topN} total
150
+
151
+ **Step 1 — Source-Code Enrichment (MANDATORY before executing anything)**
152
+ Read the source code for ALL changed files. Look for:
153
+ - **Auth middleware** (passport, jwt.verify, authMiddleware, @requires_auth, Depends(get_current_user), @UseGuards, EnsureSessionDep, session middleware) — if found, override \`authHeader\` and \`authScheme\` in scenario and contract tool calls even if workspace.yml says authType: none. Exception: for \`skyramp_integration_test_generation\` with \`scenarioFile\`, omit auth params entirely if workspace has \`api.authType\` set (workspace handles it); if workspace has no \`authType\`, pass \`authHeader\` only.
154
+ - Business rules and formulas (e.g. total_cost = compute * rate + memory * rate)
155
+ - State transitions and domain constraints (e.g. budget cannot drop below current spend)
156
+ - Validation logic (field constraints, cross-field dependencies)
157
+ - Security boundaries not covered by the structural candidates below
158
+
159
+ For each one found, evaluate it against these 5 dimensions and assign priority:
160
+ | Dimension | What to assess |
161
+ | Production Safety | Guards a critical boundary (auth, unique constraint, cascade delete, data integrity, breaking migration)? → HIGH |
162
+ | Bug-Finding Potential | Targets a known failure mode (race condition, data consistency, state transition, cascade effect)? → HIGH |
163
+ | User Journey Relevance | Reflects how real users interact (from traces, business flows, critical paths)? → HIGH or MEDIUM |
164
+ | Coverage Gap | Addresses an area with zero existing test coverage? → bump up one tier |
165
+ | Code Insight | Derived from actual implementation (spotted middleware pattern, N+1 risk, unique constraint)? → bump up one tier |
166
+
167
+ Quality gate — ask both questions:
168
+ 1. "Would this test prevent a production incident?" → YES = HIGH priority regardless of other dimensions
169
+ 2. "Does this test exercise a real workflow or catch a real bug?" → YES = at least MEDIUM
170
+
171
+ Assign category: security_boundary | business_rule | data_integrity | breaking_change | auth | workflow | error-handling | data-validation | crud
172
+
173
+ ${buildTestPatternGuidelines()}
174
+
175
+ ${buildTestExamples()}
176
+
177
+ INSERT a source-code-derived candidate into the ranked list **only if ALL three conditions are met**:
178
+ 1. Priority is HIGH (it guards a critical boundary or would prevent a production incident)
179
+ 2. It is specific to THIS codebase — derived from a concrete business rule, formula, or constraint found in the changed files (not a general pattern that applies to any API)
180
+ 3. It is not already covered by a structural candidate in the list below
181
+
182
+ If these conditions are not met, add it to ADDITIONAL only — do NOT displace a pre-ranked GENERATE item.
183
+
184
+ When a qualifying candidate is inserted: place it HIGH before MEDIUM before LOW; within the same priority, source-code-derived candidates go BEFORE structural ones. Re-number ranks after insertion. The top ${generateItems.length} become GENERATE items.
185
+
186
+ **Cascade vs referential integrity:** If both a \`cascade-delete\` and a \`delete-blocked\` scenario appear for the same resource pair, keep only the one that matches the source code's FK delete policy (e.g. \`ON DELETE CASCADE\`, \`cascade=True\`, or \`onDelete: 'CASCADE'\` → keep cascade-delete; \`RESTRICT\`/\`PROTECT\`/no cascade → keep delete-blocked). Remove the inapplicable variant before executing.
187
+
188
+ **Unique constraints:** Unique-constraint scenarios (duplicate POST → expect 409) are pre-drafted for all resources. Before keeping them, check whether the storage backend actually enforces uniqueness — look for SQL \`UNIQUE\` indexes, Mongoose \`unique: true\`, Prisma \`@unique\`, or explicit duplicate-check logic in the source. If the backend is Redis, an in-memory store, or a schema-less DB with no explicit unique constraint in the changed files, move the unique-constraint scenario to ADDITIONAL with a note that enforcement is unconfirmed — do NOT generate it as a GENERATE item.
189
+
190
+ **Step 2 — Execute merged plan in rank order**
191
+ Replace any scenario that pairs unrelated resources with one reflecting actual FK relationships in the codebase.
192
+ Use realistic request bodies from source code schemas; verify response data (not just status codes).
193
+
194
+ ${buildTestQualityCriteria()}
195
+
196
+ ${buildGenerationRules(isUIOnlyPR)}
197
+
198
+ **Per-recommendation format** (apply to all items — GENERATE and ADDITIONAL):
199
+ 1. Test type 2. Category 3. Priority (HIGH/MEDIUM/LOW) 4. Target endpoint/scenario
200
+ 5. What it validates (business logic — not just "tests the endpoint")
201
+ 6. Exact tool call with key params for zero-editing execution
202
+ 7. For integration/E2E: reference draftedScenario by scenarioName
203
+ 8. Reasoning — the specific production risk prevented or business rule enforced
204
+
205
+ **Never mark a recommendation "blocked":** No OpenAPI spec → use source code for shapes. No traces → provide \`skyramp_start_trace_collection\` instructions. No backend trace → use the scenario pipeline.
206
+
207
+ **Critical-category minimum:** At least ${Math.min(MAX_CRITICAL_TESTS, maxGen)} of the ${maxGen} GENERATE items MUST be from HIGH-priority categories (security_boundary, business_rule, data_integrity, breaking_change). The pre-ranked plan below already prioritises this — only override if source-code enrichment reveals a higher-value candidate.
208
+
209
+ ### GENERATE (execute these in order after Step 1 insertion, one retry on failure then skip)
210
+
211
+ ${generateBlocks || " (no pre-ranked generate items — draft your own based on endpoint analysis)"}
212
+
213
+ ### ADDITIONAL (list in additionalRecommendations in this order after Step 1 insertion)
214
+
215
+ ${additionalLines || " (none pre-ranked)"}${uiSlotLine}${e2eSlotLine}
216
+ ${supplementNote}
217
+
218
+ **You MUST produce EXACTLY ${topN} total recommendations: ${generateItems.length} to generate + ${Math.max(topN - generateItems.length, 0)} as additionalRecommendations. Do NOT produce fewer. Generate recommendations now.**
219
+
220
+ ## Recommendation Stability
221
+ - **Carry forward** previous additionalRecommendations that still apply — match by scenarioName (multi-step) or endpoint (single-endpoint). Re-derive category and priority from test content.
222
+ - **Only drop** a previous recommendation if its target endpoint was removed, its business logic changed, or it is now covered by a generated test.
223
+ - **Only add** new recommendations for code paths introduced since the last run.`;
224
+ }
225
+ export function buildRecommendationPrompt(analysis, analysisScope = "full_repo", topN = MAX_RECOMMENDATIONS, prContext, workspaceAuthHeader, workspaceAuthType) {
11
226
  const isDiffScope = analysisScope === "current_branch_diff";
12
227
  const diffContext = analysis.branchDiffContext;
13
228
  const openApiSpec = analysis.artifacts?.openApiSpecs?.[0];
@@ -30,12 +245,14 @@ export function buildRecommendationPrompt(analysis, analysisScope = "full_repo",
30
245
  ? (diffContext.newEndpoints.length > 0 || diffContext.modifiedEndpoints.length > 0)
31
246
  : false;
32
247
  const isUIOnlyPR = hasFrontendChanges && !hasApiChanges;
248
+ const hasTraces = (analysis.artifacts?.traceFiles?.length ?? 0) > 0 ||
249
+ (analysis.artifacts?.playwrightRecordings?.length ?? 0) > 0;
33
250
  // ── Mode preamble ──
34
251
  const modePreamble = isDiffScope
35
252
  ? `You are in **PR mode**. Maximize test coverage for the branch changes.
36
253
  Focus on tests that validate the changed fields, endpoints, and their interactions.
37
254
  ${isUIOnlyPR ? `\n**UI-only PR** — no backend changes. UI and E2E tests are most relevant.`
38
- : hasFrontendChanges ? `\n**Mixed PR** — both frontend and backend changes detected.`
255
+ : hasFrontendChanges ? `\n**Mixed PR** — both frontend and backend changes detected. Backend and E2E/UI tests are both required.`
39
256
  : ``}
40
257
  Output should be concise and immediately actionable.`
41
258
  : `You are in **Repo mode**. Comprehensive test strategy across all endpoints.`;
@@ -58,7 +275,7 @@ Output should be concise and immediately actionable.`
58
275
  : /api[_-]?key/i.test(authMethod) ? "X-API-Key"
59
276
  : "Authorization";
60
277
  }
61
- const { authSchemeSnippet, authTokenSnippet } = getAuthSnippets(authHeaderValue);
278
+ const { authSchemeSnippet } = getAuthSnippets(authHeaderValue, authTypeValue);
62
279
  const sourcePriority = `
63
280
  ## Source Priority
64
281
  When information conflicts, prefer: **Traces** (actual behavior) > **Code** (implemented behavior) > **Spec/Docs** (documented behavior).
@@ -123,80 +340,120 @@ ${isDiffScope ? "Changed endpoints only. " : ""}Use source code schemas (Zod/Pyd
123
340
  ${detailBlocks}
124
341
  `;
125
342
  }
126
- // ── Scenarios ──
127
- let scenarioSection = "";
128
- {
129
- const scenarios = analysis.businessContext.draftedScenarios;
130
- if (scenarios.length > 0) {
131
- const baseUrl = analysis.apiEndpoints.baseUrl;
132
- const scenarioBlocks = scenarios
133
- .map((s) => {
134
- const stepLines = s.steps.map((st) => ` ${st.order ?? ""}. **${st.method} ${st.path}** → ${st.expectedStatusCode ?? 200}: ${st.description || ""}`).join("\n");
135
- const toolCalls = s.steps.map((st) => {
136
- const isBodyMethod = ["POST", "PUT", "PATCH"].includes(st.method);
137
- const hasQueryParams = st.queryParams && Object.keys(st.queryParams).length > 0;
138
- const isIdPath = /\{\w+\}$/.test(st.path);
139
- let dataParam;
140
- if (isBodyMethod) {
141
- dataParam = `requestBody: <from source schemas for ${st.method} ${st.path}>`;
142
- }
143
- else if (hasQueryParams) {
144
- dataParam = `queryParams: '${JSON.stringify(st.queryParams)}'`;
145
- }
146
- else if (isIdPath) {
147
- dataParam = "";
148
- }
149
- else {
150
- dataParam = `queryParams: <derive from source code for ${st.method} ${st.path} as a JSON string of URL query params>`;
151
- }
152
- const dataSnippet = dataParam ? `, ${dataParam}` : "";
153
- const authSnippet = authHeaderValue
154
- ? `, authHeader: "${authHeaderValue}"${authSchemeSnippet}${authTokenSnippet}`
155
- : `, authHeader: <determine from OpenAPI spec securitySchemes or source code auth middleware — use "" ONLY if confirmed unauthenticated>`;
156
- return ` skyramp_scenario_test_generation({ scenarioName: "${s.scenarioName}", destination: "${s.scenarioName}", baseURL: "${baseUrl}", method: "${st.method}", path: "${st.path}", statusCode: ${st.expectedStatusCode ?? 200}${authSnippet}${dataSnippet} })`;
157
- }).join("\n");
158
- return (` ### ${s.scenarioName} (${s.category}, ${s.priority})\n` +
159
- ` ${s.description}\n` +
160
- ` **Steps:**\n${stepLines}\n` +
161
- ` **Chaining keys:** ${s.chainingKeys.join(", ") || "none"}\n` +
162
- ` **Tool calls:**\n${toolCalls}\n` +
163
- ` Then: skyramp_integration_test_generation({ scenarioFile: "scenario_${s.scenarioName}.json"${authHeaderValue ? `, authHeader: "${authHeaderValue}"${authSchemeSnippet}${authTokenSnippet}` : `, authHeader: <same auth as scenario calls above>`} })`);
164
- })
165
- .join("\n\n");
166
- const authWarning = !authHeaderValue
167
- ? `\n**WARNING — No auth configured.** Before generating scenarios without auth, verify the API does not require authentication by checking the OpenAPI spec \`securitySchemes\` and source code auth middleware. If auth is needed, include \`authHeader\` (and \`authScheme\` if applicable) in every \`skyramp_scenario_test_generation\` call.\n`
168
- : "";
169
- scenarioSection = `
170
- ## Drafted Scenarios
171
- **Base URL:** \`${baseUrl}\` | **Auth:** \`${authHeaderValue || "none (verify independently)"}\`${authTypeValue ? ` | **Auth type:** \`${authTypeValue}\`` : ""}${authWarning}
343
+ // ── Scoring ──
344
+ const endpointCount = allEndpoints.reduce((acc, ep) => acc + (ep.methods ?? []).length, 0);
345
+ const maxGen = isUIOnlyPR ? (hasTraces ? MAX_TESTS_TO_GENERATE : 0) : MAX_TESTS_TO_GENERATE;
346
+ const scenarios = analysis.businessContext.draftedScenarios;
347
+ let scored = [];
348
+ let seed = "";
349
+ if (!isUIOnlyPR && scenarios.length > 0) {
350
+ const diffFiles = filteredChangedFiles; // use filtered list so bot-committed test files don't shift the seed
351
+ const endpointPaths = allEndpoints.map(ep => ep.path);
352
+ seed = computeTiebreakerSeed(endpointPaths, diffFiles);
353
+ scored = scenarios.map(s => {
354
+ const result = prioritiseCandidate(s, diffContext ?? undefined);
355
+ return { scenario: s, ...result };
356
+ });
357
+ scored.sort((a, b) => {
358
+ const pa = PRIORITY_ORDER[a.priority], pb = PRIORITY_ORDER[b.priority];
359
+ if (pb !== pa)
360
+ return pb - pa;
361
+ const na = NOVELTY_ORDER[a.novelty], nb = NOVELTY_ORDER[b.novelty];
362
+ if (nb !== na)
363
+ return nb - na;
364
+ const crossA = a.scenario.steps.length > 2 ? 1 : 0;
365
+ const crossB = b.scenario.steps.length > 2 ? 1 : 0;
366
+ if (crossB !== crossA)
367
+ return crossB - crossA;
368
+ if (b.scenario.steps.length !== a.scenario.steps.length)
369
+ return b.scenario.steps.length - a.scenario.steps.length;
370
+ const errorA = a.scenario.steps.some(s => s.interactionType === "error" || s.interactionType === "edge-case") ? 1 : 0;
371
+ const errorB = b.scenario.steps.some(s => s.interactionType === "error" || s.interactionType === "edge-case") ? 1 : 0;
372
+ if (errorB !== errorA)
373
+ return errorB - errorA;
374
+ // Use locale-independent comparison to avoid runtime-locale non-determinism
375
+ const nameA = a.scenario.scenarioName;
376
+ const nameB = b.scenario.scenarioName;
377
+ if (nameA < nameB)
378
+ return -1;
379
+ if (nameA > nameB)
380
+ return 1;
381
+ const hashA = parseInt(crypto.createHash("sha256").update(seed + a.scenario.scenarioName).digest("hex").slice(0, 8), 16);
382
+ const hashB = parseInt(crypto.createHash("sha256").update(seed + b.scenario.scenarioName).digest("hex").slice(0, 8), 16);
383
+ return hashA - hashB;
384
+ });
385
+ }
386
+ // ── Main section: execution plan, UI-only guidance, or draft-your-own ──
387
+ let mainSection;
388
+ if (isUIOnlyPR) {
389
+ mainSection = hasTraces ? `
390
+ ## Test Recommendations (UI-only PR — traces available)
391
+
392
+ **Budget: ${maxGen} generate + ${Math.max(topN - maxGen, 0)} additional = ${topN} total**
393
+
394
+ No backend API changes detected. Generate UI/E2E tests from the available traces. Do NOT generate integration or contract tests.
395
+
396
+ **Generate from traces:**
397
+ 1. Call \`skyramp_ui_test_generation\` or \`skyramp_e2e_test_generation\` using the trace files
398
+ 2. Generate exactly ${maxGen} tests targeting the changed UI flows
399
+
400
+ **You MUST produce EXACTLY ${topN} total recommendations: ${maxGen} to generate + ${topN - maxGen} as additionalRecommendations. Do NOT produce fewer. Generate recommendations now.**
172
401
 
173
- Only use scenarios where resources are ACTUALLY related in the codebase. Replace any
174
- scenario that pairs unrelated resources with one reflecting real foreign key relationships.
402
+ Do not churn recommendations without cause.
403
+ ` : `
404
+ ## Test Recommendations (UI-only PR)
175
405
 
176
- **Quality bar:** Realistic request bodies, actual foreign keys for chaining, response data
177
- verification (not just status codes), realistic test data (not "test product").
178
- **Query vs Body:** For GET/DELETE requests, use \`queryParams\` (not \`requestBody\`) for search terms,
179
- filters, pagination. Only POST/PUT/PATCH use \`requestBody\`.
180
- **Path verification:** Cross-reference paths against Router Mounting context — use correct
181
- nested paths. **Request bodies:** Replace placeholders with actual schemas from source code.
406
+ **Budget: ${maxGen} generate + ${topN - maxGen} additional = ${topN} total**
182
407
 
183
- ${scenarioBlocks}
408
+ No backend API changes detected and no traces available. Do NOT generate or execute any tests.
409
+ All ${topN} recommendations go into additionalRecommendations only.
410
+
411
+ Draft ${topN} UI and E2E test recommendations covering:
412
+ - Component rendering (correct copy, classes, layout for changed components)
413
+ - User interactions (clicks, form submissions, navigation triggered by changed UI)
414
+ - Empty/error states (if the PR touches empty state or error UI)
415
+ - Cross-browser or responsive behavior (if applicable)
416
+ - Full E2E user journeys that exercise the changed UI flows end-to-end
417
+
418
+ **To generate UI/E2E tests** (when ready):
419
+ 1. Call \`skyramp_start_trace_collection\` (playwright: true)
420
+ 2. Exercise the changed UI flows in the browser
421
+ 3. Call \`skyramp_stop_trace_collection\`
422
+ 4. Generate with \`skyramp_ui_test_generation\` or \`skyramp_e2e_test_generation\`
423
+
424
+ **You MUST produce EXACTLY ${topN} total recommendations in additionalRecommendations. Do NOT produce fewer. Generate recommendations now.**
425
+
426
+ Do not churn recommendations without cause.
184
427
  `;
185
- }
186
- else {
187
- scenarioSection = `
188
- ## Scenarios — Draft From Your Analysis
428
+ }
429
+ else if (scored.length > 0) {
430
+ mainSection = buildExecutionPlan(scored, maxGen, topN, analysis.apiEndpoints.baseUrl, authHeaderValue, authSchemeSnippet, authTypeValue, seed, endpointCount, isUIOnlyPR, hasFrontendChanges, hasTraces);
431
+ }
432
+ else {
433
+ mainSection = `
434
+ ## Draft Your Execution Plan
435
+
436
+ **Budget: ${maxGen} generate + ${topN - maxGen} additional = ${topN} total**
437
+
438
+ No pre-drafted scenarios available. Draft ${maxGen} tests from your analysis of the endpoint interactions and source code above, then supplement with your own candidates to reach ${topN} total. Prioritize critical categories (security_boundary > data_integrity > business_rule > workflow > crud).
189
439
 
190
- Draft at least 2-3 MEANINGFUL scenarios based on your codebase analysis:
191
- 1. **Cross-resource workflow** — resources referencing each other via foreign keys
192
- 2. **Search/filter + verify** — create data, search, verify results
193
- 3. **Error handling** — invalid cross-resource references → appropriate errors
440
+ For each test: pick the highest-impact endpoint(s), draft a realistic scenario with actual request/response shapes from source code, and execute the same pipeline described in Tool Workflows below.
194
441
 
195
- Use base URL: \`${analysis.apiEndpoints.baseUrl}\` and auth: \`${authHeaderValue || "none verify independently from OpenAPI spec and source code"}\`${authTypeValue ? ` (auth type: \`${authTypeValue}\`)` : ""}.
196
- ${!authHeaderValue ? "**Verify auth requirements** from OpenAPI spec and source code before omitting auth headers." : ""}
442
+ **You MUST produce EXACTLY ${topN} total recommendations: ${maxGen} to generate + ${topN - maxGen} as additionalRecommendations. Do NOT produce fewer. Generate recommendations now.**
443
+
444
+ ## Recommendation Stability
445
+ - **Carry forward** previous additionalRecommendations that still apply — match by scenarioName (multi-step) or endpoint (single-endpoint). Re-derive category and priority from test content.
446
+ - **Only drop** a previous recommendation if its target endpoint was removed, its business logic changed, or it is now covered by a generated test.
447
+ - **Only add** new recommendations for code paths introduced since the last run.
448
+ - Do not churn recommendations without cause.
197
449
  `;
198
- }
199
450
  }
451
+ // ── OpenAPI spec note ──
452
+ const specNote = openApiSpec
453
+ ? `\n**OpenAPI Spec available**: \`${openApiSpec.path}\`
454
+ Use it for contract tests (\`apiSchema: "${openApiSpec.path}"\`) and to extract request/response shapes.
455
+ `
456
+ : "";
200
457
  // ── PR History ──
201
458
  let prHistorySection = "";
202
459
  if (prContext && prContext.previousRecommendations.length > 0) {
@@ -280,32 +537,26 @@ ${modePreamble}
280
537
 
281
538
  Scope: ${scopeNote}
282
539
 
283
- ${buildTestQualityCriteria()}
284
-
285
540
  ${sourcePriority}
286
541
 
287
- ${buildPrioritizationDimensions()}
288
-
289
- ${buildTestExamples()}
290
-
291
- ${buildTestPatternGuidelines()}
292
-
293
- ${buildGenerationRules(isUIOnlyPR)}
294
-
295
- ${diffSection}
296
542
  ## Repository Context
297
543
 
298
544
  ${repoContext}
299
-
545
+ ${specNote}
546
+ ${diffSection}
300
547
  ${interactionSection}
301
- ${scenarioSection}
548
+ ${mainSection}
302
549
  ${prHistorySection}
303
550
  ## Existing Tests
304
551
  - Frameworks: ${analysis.existingTests.frameworks.join(", ") || "none"}
305
552
  ${formatTestLocations(analysis.existingTests.testLocations)}
306
553
 
307
- ${buildToolWorkflows(authHeaderValue, authTypeValue)}
554
+ ${isUIOnlyPR
555
+ ? `## How to Generate Tests — Tool Workflows
308
556
 
309
- ${buildCoverageChecklist(openApiSpec, isUIOnlyPR, topN, undefined, MAX_CRITICAL_TESTS)}
557
+ **For UI tests:** \`skyramp_start_trace_collection\` (playwright: true) perform browser steps → \`skyramp_stop_trace_collection\` → \`skyramp_ui_test_generation\` with the playwright zip.
558
+ **For E2E tests:** Same trace flow, pass both trace file and playwright zip to \`skyramp_e2e_test_generation\`.
559
+ Without traces, list as additionalRecommendations with instructions to record traces first.`
560
+ : buildToolWorkflows(authHeaderValue, authTypeValue)}
310
561
  `;
311
562
  }
@@ -2,7 +2,7 @@ jest.mock("@skyramp/skyramp", () => ({
2
2
  WorkspaceConfigManager: { create: jest.fn() },
3
3
  }));
4
4
  import { buildRecommendationPrompt } from "./test-recommendation-prompt.js";
5
- import { buildCoverageChecklist, PATH_PARAM_UUID_GUIDANCE, MAX_CRITICAL_TESTS, MAX_TESTS_TO_GENERATE } from "./recommendationSections.js";
5
+ import { PATH_PARAM_UUID_GUIDANCE, MAX_TESTS_TO_GENERATE } from "./recommendationSections.js";
6
6
  // ---------------------------------------------------------------------------
7
7
  // Minimal fixtures
8
8
  // ---------------------------------------------------------------------------
@@ -261,30 +261,73 @@ describe("buildRecommendationPrompt — PR History section", () => {
261
261
  });
262
262
  });
263
263
  // ---------------------------------------------------------------------------
264
- // Tests — Coverage Checklist stability section
264
+ // Tests — Stability and supplement in buildRecommendationPrompt
265
265
  // ---------------------------------------------------------------------------
266
- describe("buildCoverageChecklist Recommendation Stability section", () => {
267
- it("includes Recommendation Stability section in output", () => {
268
- const checklist = buildCoverageChecklist(null, false, 10);
269
- expect(checklist).toContain("## Recommendation Stability");
266
+ function minimalScenario(overrides = {}) {
267
+ return {
268
+ scenarioName: "item-create-delete",
269
+ description: "Create and delete an item to verify cascade",
270
+ category: "data_integrity",
271
+ priority: "high",
272
+ steps: [
273
+ { order: 1, method: "POST", path: "/api/items", description: "Create item", interactionType: "success", expectedStatusCode: 201 },
274
+ { order: 2, method: "DELETE", path: "/api/items/{id}", description: "Delete item", interactionType: "success", expectedStatusCode: 204 },
275
+ ],
276
+ chainingKeys: ["id"],
277
+ requiresAuth: false,
278
+ estimatedComplexity: "simple",
279
+ testType: "integration",
280
+ ...overrides,
281
+ };
282
+ }
283
+ describe("buildRecommendationPrompt — Stability and supplement section", () => {
284
+ it("includes Recommendation Stability section in output when scenarios exist", () => {
285
+ const analysis = minimalAnalysis({
286
+ businessContext: { mainPurpose: "Test API", userFlows: [], dataFlows: [], integrationPatterns: [], draftedScenarios: [minimalScenario()] },
287
+ });
288
+ const prompt = buildRecommendationPrompt(analysis, "full_repo", 10);
289
+ expect(prompt).toContain("## Recommendation Stability");
270
290
  });
271
291
  it("stability section uses scenarioName/endpoint matching strategy", () => {
272
- const checklist = buildCoverageChecklist(null, false, 10);
273
- const stabilityStart = checklist.indexOf("## Recommendation Stability");
274
- const stabilityBlock = checklist.slice(stabilityStart, stabilityStart + 500);
292
+ const analysis = minimalAnalysis({
293
+ businessContext: { mainPurpose: "Test API", userFlows: [], dataFlows: [], integrationPatterns: [], draftedScenarios: [minimalScenario()] },
294
+ });
295
+ const prompt = buildRecommendationPrompt(analysis, "full_repo", 10);
296
+ const stabilityStart = prompt.indexOf("## Recommendation Stability");
297
+ const stabilityBlock = prompt.slice(stabilityStart, stabilityStart + 500);
275
298
  expect(stabilityBlock).toContain("scenarioName");
276
299
  expect(stabilityBlock).toContain("endpoint");
277
300
  expect(stabilityBlock).toContain("Re-derive category and priority");
278
301
  });
279
302
  it("stability section specifies when to drop a recommendation", () => {
280
- const checklist = buildCoverageChecklist(null, false, 10);
281
- expect(checklist).toContain("target endpoint was removed");
282
- expect(checklist).toContain("business logic changed");
283
- expect(checklist).toContain("covered by a generated test");
303
+ const analysis = minimalAnalysis({
304
+ businessContext: { mainPurpose: "Test API", userFlows: [], dataFlows: [], integrationPatterns: [], draftedScenarios: [minimalScenario()] },
305
+ });
306
+ const prompt = buildRecommendationPrompt(analysis, "full_repo", 10);
307
+ expect(prompt).toContain("target endpoint was removed");
308
+ expect(prompt).toContain("business logic changed");
309
+ expect(prompt).toContain("covered by a generated test");
310
+ });
311
+ it("instructs to supplement beyond pre-ranked list to reach topN", () => {
312
+ // 1 scenario, topN=10 → supplementCount=9 → supplement note should appear
313
+ const analysis = minimalAnalysis({
314
+ businessContext: { mainPurpose: "Test API", userFlows: [], dataFlows: [], integrationPatterns: [], draftedScenarios: [minimalScenario()] },
315
+ });
316
+ const prompt = buildRecommendationPrompt(analysis, "full_repo", 10);
317
+ expect(prompt).toContain("REQUIRED — You MUST add");
318
+ expect(prompt).toContain("5-dimension rubric");
319
+ });
320
+ // Verify MAX_TESTS_TO_GENERATE is still exported and equals 3
321
+ it("MAX_TESTS_TO_GENERATE is 3", () => {
322
+ expect(MAX_TESTS_TO_GENERATE).toBe(3);
284
323
  });
285
324
  it("uses MAX_CRITICAL_TESTS in category-aware selection rules", () => {
286
- const checklist = buildCoverageChecklist(null, false, 10, MAX_TESTS_TO_GENERATE, MAX_CRITICAL_TESTS);
287
- expect(checklist).toContain(`up to ${Math.min(MAX_CRITICAL_TESTS, MAX_TESTS_TO_GENERATE)} of the ${MAX_TESTS_TO_GENERATE} generated tests MUST be from critical categories`);
325
+ const analysis = minimalAnalysis({
326
+ businessContext: { mainPurpose: "Test API", userFlows: [], dataFlows: [], integrationPatterns: [], draftedScenarios: [minimalScenario()] },
327
+ });
328
+ const prompt = buildRecommendationPrompt(analysis, "full_repo", 10);
329
+ // The critical-category minimum line references MAX_CRITICAL_TESTS (= 3)
330
+ expect(prompt).toContain("GENERATE items MUST be from HIGH-priority categories");
288
331
  });
289
332
  });
290
333
  // ---------------------------------------------------------------------------
@@ -198,7 +198,7 @@ Trace File:
198
198
 
199
199
  **CRITICAL: FOR A SINGLE SCENARIO CREATE A SINGLE SCENARIO FILE WITH EACH STEP AS A JSON OBJECT IN THE ARRAY.**
200
200
 
201
- **CRITICAL: SHOW STEPS TO START/STOP PLAYWRIGHT TRACE COLLECTION FOR UI TESTS. NEVER SHOW THE CLI COMMANDS.**
201
+ **CRITICAL: For UI test trace collection, use the browser_* tools (browser_navigate, browser_click, browser_type, etc.) to interact with the application, then call skyramp_export_zip to export the trace zip. Do NOT use skyramp_start_trace_collection/skyramp_stop_trace_collection.**
202
202
  `,
203
203
  },
204
204
  },