rechrome 1.19.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/README.md +8 -3
  2. package/package.json +5 -3
  3. package/rech.js +153 -55
  4. package/rech.ts +153 -55
  5. package/serve.js +106 -23
  6. package/serve.ts +106 -23
  7. package/vendor/playwright-cli/node_modules/playwright-core/README.md +3 -0
  8. package/vendor/playwright-cli/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
  9. package/vendor/playwright-cli/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
  10. package/vendor/playwright-cli/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
  11. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  12. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  13. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  14. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  15. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  16. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  17. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  18. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  19. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  20. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  21. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  22. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  23. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  24. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  25. package/vendor/playwright-cli/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  26. package/vendor/playwright-cli/node_modules/playwright-core/browsers.json +81 -0
  27. package/vendor/playwright-cli/node_modules/playwright-core/cli.js +21 -0
  28. package/vendor/playwright-cli/node_modules/playwright-core/index.d.ts +17 -0
  29. package/vendor/playwright-cli/node_modules/playwright-core/index.js +32 -0
  30. package/vendor/playwright-cli/node_modules/playwright-core/index.mjs +28 -0
  31. package/vendor/playwright-cli/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
  32. package/vendor/playwright-cli/node_modules/playwright-core/lib/bootstrap.js +77 -0
  33. package/vendor/playwright-cli/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
  34. package/vendor/playwright-cli/node_modules/playwright-core/lib/cli/driver.js +98 -0
  35. package/vendor/playwright-cli/node_modules/playwright-core/lib/cli/program.js +597 -0
  36. package/vendor/playwright-cli/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
  37. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/android.js +361 -0
  38. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/api.js +137 -0
  39. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/artifact.js +79 -0
  40. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/browser.js +169 -0
  41. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/browserContext.js +583 -0
  42. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/browserType.js +153 -0
  43. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/cdpSession.js +55 -0
  44. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
  45. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
  46. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
  47. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
  48. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/clock.js +68 -0
  49. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/connect.js +143 -0
  50. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/connection.js +322 -0
  51. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/consoleMessage.js +61 -0
  52. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/coverage.js +44 -0
  53. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/debugger.js +57 -0
  54. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/dialog.js +56 -0
  55. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/disposable.js +76 -0
  56. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/download.js +62 -0
  57. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/electron.js +138 -0
  58. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/elementHandle.js +281 -0
  59. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/errors.js +77 -0
  60. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
  61. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/events.js +103 -0
  62. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/fetch.js +367 -0
  63. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
  64. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
  65. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/frame.js +404 -0
  66. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/harRouter.js +99 -0
  67. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/input.js +84 -0
  68. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/jsHandle.js +105 -0
  69. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
  70. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/localUtils.js +60 -0
  71. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/locator.js +367 -0
  72. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/network.js +750 -0
  73. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/page.js +729 -0
  74. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/platform.js +77 -0
  75. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/playwright.js +71 -0
  76. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/screencast.js +48 -0
  77. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/selectors.js +57 -0
  78. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/stream.js +39 -0
  79. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
  80. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/tracing.js +126 -0
  81. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/types.js +28 -0
  82. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/video.js +68 -0
  83. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/waiter.js +142 -0
  84. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/webError.js +39 -0
  85. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/worker.js +85 -0
  86. package/vendor/playwright-cli/node_modules/playwright-core/lib/client/writableStream.js +39 -0
  87. package/vendor/playwright-cli/node_modules/playwright-core/lib/coreBundle.js +68170 -0
  88. package/vendor/playwright-cli/node_modules/playwright-core/lib/electron/loader.js +67 -0
  89. package/vendor/playwright-cli/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
  90. package/vendor/playwright-cli/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
  91. package/vendor/playwright-cli/node_modules/playwright-core/lib/entry/mcp.js +10 -0
  92. package/vendor/playwright-cli/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
  93. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
  94. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
  95. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
  96. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
  97. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
  98. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
  99. package/vendor/playwright-cli/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
  100. package/vendor/playwright-cli/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
  101. package/vendor/playwright-cli/node_modules/playwright-core/lib/inprocess.js +3 -0
  102. package/vendor/playwright-cli/node_modules/playwright-core/lib/mcpBundle.js +81 -0
  103. package/vendor/playwright-cli/node_modules/playwright-core/lib/mcpBundleImpl/index.js +91 -0
  104. package/vendor/playwright-cli/node_modules/playwright-core/lib/outofprocess.js +76 -0
  105. package/vendor/playwright-cli/node_modules/playwright-core/lib/package.js +50 -0
  106. package/vendor/playwright-cli/node_modules/playwright-core/lib/protocol/serializers.js +197 -0
  107. package/vendor/playwright-cli/node_modules/playwright-core/lib/protocol/validator.js +3034 -0
  108. package/vendor/playwright-cli/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
  109. package/vendor/playwright-cli/node_modules/playwright-core/lib/remote/playwrightConnection.js +131 -0
  110. package/vendor/playwright-cli/node_modules/playwright-core/lib/remote/playwrightPipeServer.js +100 -0
  111. package/vendor/playwright-cli/node_modules/playwright-core/lib/remote/playwrightServer.js +339 -0
  112. package/vendor/playwright-cli/node_modules/playwright-core/lib/remote/playwrightWebSocketServer.js +73 -0
  113. package/vendor/playwright-cli/node_modules/playwright-core/lib/remote/serverTransport.js +96 -0
  114. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/android/android.js +465 -0
  115. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
  116. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/artifact.js +127 -0
  117. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +571 -0
  118. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +162 -0
  119. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +213 -0
  120. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiDeserializer.js +116 -0
  121. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +267 -0
  122. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +128 -0
  123. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
  124. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +411 -0
  125. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
  126. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiPage.js +599 -0
  127. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
  128. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
  129. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
  130. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
  131. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +180 -0
  132. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
  133. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
  134. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +261 -0
  135. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/browser.js +223 -0
  136. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/browserContext.js +703 -0
  137. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/browserType.js +338 -0
  138. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/callLog.js +82 -0
  139. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  140. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/chromium.js +399 -0
  141. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
  142. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crBrowser.js +532 -0
  143. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crConnection.js +197 -0
  144. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
  145. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crDevTools.js +111 -0
  146. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
  147. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
  148. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
  149. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +708 -0
  150. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crPage.js +1004 -0
  151. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
  152. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
  153. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +137 -0
  154. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
  155. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
  156. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/clock.js +149 -0
  157. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
  158. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
  159. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/javascript.js +247 -0
  160. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
  161. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
  162. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
  163. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
  164. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
  165. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/console.js +61 -0
  166. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
  167. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/debugController.js +197 -0
  168. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/debugger.js +120 -0
  169. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
  170. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
  171. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dialog.js +116 -0
  172. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
  173. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
  174. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +381 -0
  175. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +124 -0
  176. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +71 -0
  177. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +47 -0
  178. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
  179. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/debuggerDispatcher.js +80 -0
  180. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
  181. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +364 -0
  182. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/disposableDispatcher.js +39 -0
  183. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +90 -0
  184. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
  185. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
  186. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
  187. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
  188. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +185 -0
  189. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +214 -0
  190. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +434 -0
  191. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
  192. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
  193. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
  194. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +164 -0
  195. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
  196. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/disposable.js +41 -0
  197. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/dom.js +823 -0
  198. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/download.js +71 -0
  199. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/electron/electron.js +272 -0
  200. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/electron/loader.js +115 -0
  201. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/errors.js +69 -0
  202. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/fetch.js +621 -0
  203. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
  204. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
  205. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +415 -0
  206. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/ffConnection.js +142 -0
  207. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
  208. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/ffInput.js +175 -0
  209. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
  210. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/ffPage.js +495 -0
  211. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/firefox.js +114 -0
  212. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
  213. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/formData.js +147 -0
  214. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/frameSelectors.js +160 -0
  215. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/frames.js +1495 -0
  216. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
  217. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/har/harTracer.js +608 -0
  218. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/harBackend.js +157 -0
  219. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/helper.js +96 -0
  220. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/index.js +58 -0
  221. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/input.js +277 -0
  222. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/instrumentation.js +72 -0
  223. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/javascript.js +291 -0
  224. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/launchApp.js +127 -0
  225. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/localUtils.js +214 -0
  226. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
  227. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/network.js +668 -0
  228. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/page.js +884 -0
  229. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
  230. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/playwright.js +69 -0
  231. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/progress.js +136 -0
  232. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/protocolError.js +52 -0
  233. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
  234. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder/recorderApp.js +367 -0
  235. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
  236. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
  237. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
  238. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
  239. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/recorder.js +540 -0
  240. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/registry/browserFetcher.js +177 -0
  241. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
  242. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/registry/index.js +1395 -0
  243. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1281 -0
  244. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +127 -0
  245. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/screencast.js +216 -0
  246. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
  247. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/selectors.js +112 -0
  248. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
  249. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
  250. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
  251. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +561 -0
  252. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +607 -0
  253. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +244 -0
  254. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/transport.js +181 -0
  255. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/types.js +28 -0
  256. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/usKeyboardLayout.js +152 -0
  257. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
  258. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
  259. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
  260. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
  261. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
  262. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/disposable.js +32 -0
  263. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/env.js +73 -0
  264. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/eventsHelper.js +41 -0
  265. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/expectUtils.js +123 -0
  266. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
  267. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
  268. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/hostPlatform.js +123 -0
  269. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/httpServer.js +205 -0
  270. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
  271. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
  272. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
  273. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
  274. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
  275. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/network.js +244 -0
  276. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/nodePlatform.js +154 -0
  277. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
  278. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/processLauncher.js +243 -0
  279. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
  280. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
  281. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
  282. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/task.js +51 -0
  283. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
  284. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
  285. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
  286. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
  287. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/videoRecorder.js +133 -0
  288. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
  289. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/webkit.js +108 -0
  290. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +331 -0
  291. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkConnection.js +144 -0
  292. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
  293. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
  294. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +197 -0
  295. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkPage.js +1164 -0
  296. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
  297. package/vendor/playwright-cli/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +106 -0
  298. package/vendor/playwright-cli/node_modules/playwright-core/lib/serverRegistry.js +7343 -0
  299. package/vendor/playwright-cli/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +354 -0
  300. package/vendor/playwright-cli/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
  301. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/browserBackend.js +79 -0
  302. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/common.js +63 -0
  303. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/config.js +41 -0
  304. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/console.js +66 -0
  305. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/context.js +290 -0
  306. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/cookies.js +152 -0
  307. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/devtools.js +69 -0
  308. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/dialogs.js +59 -0
  309. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/evaluate.js +64 -0
  310. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/files.js +60 -0
  311. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/form.js +64 -0
  312. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/keyboard.js +155 -0
  313. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/logFile.js +95 -0
  314. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/mouse.js +168 -0
  315. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/navigate.js +106 -0
  316. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/network.js +135 -0
  317. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/pdf.js +48 -0
  318. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/response.js +302 -0
  319. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/route.js +140 -0
  320. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/runCode.js +76 -0
  321. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/screenshot.js +88 -0
  322. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/sessionLog.js +74 -0
  323. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/snapshot.js +208 -0
  324. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/storage.js +67 -0
  325. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/tab.js +445 -0
  326. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/tabs.js +67 -0
  327. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/tool.js +47 -0
  328. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/tools.js +102 -0
  329. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/tracing.js +75 -0
  330. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/utils.js +83 -0
  331. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/verify.js +151 -0
  332. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/video.js +89 -0
  333. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/wait.js +63 -0
  334. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/backend/webstorage.js +223 -0
  335. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
  336. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/cli.js +6 -0
  337. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/help.json +679 -0
  338. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
  339. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/output.js +343 -0
  340. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/program.js +380 -0
  341. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/registry.js +176 -0
  342. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/session.js +265 -0
  343. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/SKILL.md +388 -0
  344. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
  345. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
  346. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
  347. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/running-code.md +241 -0
  348. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/session-management.md +225 -0
  349. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/spec-driven-testing.md +305 -0
  350. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/storage-state.md +275 -0
  351. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/test-generation.md +134 -0
  352. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/tracing.md +139 -0
  353. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-client/skill/references/video-recording.md +143 -0
  354. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-daemon/command.js +73 -0
  355. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-daemon/commands.js +933 -0
  356. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-daemon/daemon.js +178 -0
  357. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-daemon/helpGenerator.js +173 -0
  358. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/cli-daemon/program.js +118 -0
  359. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
  360. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/dashboard/dashboardApp.js +286 -0
  361. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/dashboard/dashboardController.js +296 -0
  362. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/exports.js +60 -0
  363. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/browserFactory.js +233 -0
  364. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/cdpRelay.js +356 -0
  365. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/cli-stub.js +7 -0
  366. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/config.d.js +16 -0
  367. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/config.js +401 -0
  368. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/configIni.js +189 -0
  369. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/extensionContextFactory.js +59 -0
  370. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/index.js +62 -0
  371. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/log.js +35 -0
  372. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/program.js +107 -0
  373. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/protocol.js +28 -0
  374. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/mcp/watchdog.js +44 -0
  375. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/SKILL.md +171 -0
  376. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/installSkill.js +48 -0
  377. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceActions.js +142 -0
  378. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceAttachments.js +69 -0
  379. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceCli.js +80 -0
  380. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceConsole.js +97 -0
  381. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceErrors.js +55 -0
  382. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceOpen.js +69 -0
  383. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceParser.js +96 -0
  384. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceRequests.js +158 -0
  385. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceScreenshot.js +68 -0
  386. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceSnapshot.js +149 -0
  387. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/trace/traceUtils.js +135 -0
  388. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/utils/connect.js +32 -0
  389. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/utils/extension.js +78 -0
  390. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/utils/mcp/http.js +152 -0
  391. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/utils/mcp/server.js +230 -0
  392. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/utils/mcp/tool.js +47 -0
  393. package/vendor/playwright-cli/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
  394. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +455 -0
  395. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
  396. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
  397. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
  398. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
  399. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/formatUtils.js +64 -0
  400. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
  401. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/imageUtils.js +141 -0
  402. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
  403. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
  404. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
  405. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/lruCache.js +51 -0
  406. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
  407. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +464 -0
  408. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
  409. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
  410. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +342 -0
  411. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
  412. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
  413. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
  414. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
  415. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +204 -0
  416. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
  417. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
  418. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/entries.js +16 -0
  419. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotRenderer.js +502 -0
  420. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
  421. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
  422. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/traceLoader.js +131 -0
  423. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModel.js +366 -0
  424. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModernizer.js +401 -0
  425. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/traceUtils.js +58 -0
  426. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
  427. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
  428. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
  429. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
  430. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
  431. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
  432. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
  433. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +243 -0
  434. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +262 -0
  435. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils/isomorphic/yaml.js +84 -0
  436. package/vendor/playwright-cli/node_modules/playwright-core/lib/utils.js +113 -0
  437. package/vendor/playwright-cli/node_modules/playwright-core/lib/utilsBundle.js +86478 -0
  438. package/vendor/playwright-cli/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +2058 -0
  439. package/vendor/playwright-cli/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
  440. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  441. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  442. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  443. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  444. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/index-BY2S1tHT.css +1 -0
  445. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/index-DpEq2p62.js +52 -0
  446. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  447. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
  448. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
  449. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
  450. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/htmlReport/report.css +1 -0
  451. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/htmlReport/report.js +72 -0
  452. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BHYmBp6h.js +32 -0
  453. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
  454. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  455. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/assets/index-4ZiSSCmn.css +1 -0
  456. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/assets/index-DA10QRaq.js +193 -0
  457. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
  458. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  459. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BRrOnXSS.js +32 -0
  460. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BtGnd8kr.js +32 -0
  461. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-CnvO0fko.js +32 -0
  462. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BkMbME_o.js +262 -0
  463. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BoN8TZYy.js +262 -0
  464. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CN3cwLGD.js +262 -0
  465. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-BYQrIQwR.js +1 -0
  466. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
  467. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
  468. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  469. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.B4dS75f0.css +1 -0
  470. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BDKsFU3c.css +1 -0
  471. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.DcQiWcKS.css +1 -0
  472. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/index.B2ffe31o.js +2 -0
  473. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/index.CzXZzn5A.css +1 -0
  474. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/index.Df3uWWXm.js +2 -0
  475. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/index.PqVYgODr.js +2 -0
  476. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
  477. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  478. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  479. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
  480. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/snapshot.v8KI4P3m.js +2 -0
  481. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +5 -0
  482. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/uiMode.B-IwVgWY.js +6 -0
  483. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BZQ54Kgt.css +1 -0
  484. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
  485. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CmAqMvmy.js +6 -0
  486. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
  487. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/uiMode.u9Eas4CP.js +6 -0
  488. package/vendor/playwright-cli/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
  489. package/vendor/playwright-cli/node_modules/playwright-core/lib/xdg-open +1066 -0
  490. package/vendor/playwright-cli/node_modules/playwright-core/lib/zipBundle.js +34 -0
  491. package/vendor/playwright-cli/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
  492. package/vendor/playwright-cli/node_modules/playwright-core/package.json +34 -0
  493. package/vendor/playwright-cli/node_modules/playwright-core/types/protocol.d.ts +24565 -0
  494. package/vendor/playwright-cli/node_modules/playwright-core/types/structs.d.ts +45 -0
  495. package/vendor/playwright-cli/node_modules/playwright-core/types/types.d.ts +23879 -0
  496. package/vendor/playwright-cli/package.json +6 -0
  497. package/vendor/playwright-cli/playwright-cli.js +50 -0
package/README.md CHANGED
@@ -16,9 +16,14 @@ Built on top of [playwright-multi-tab](https://github.com/snomiao/playwright-mul
16
16
  ## Prerequisites
17
17
 
18
18
  - [Bun](https://bun.sh/) ≥ 1.0
19
- - [playwright-cli](https://www.npmjs.com/package/playwright-cli) (works out of the box)
20
19
 
21
- > **💡 Recommended:** For full multi-tab and multi-session support, install [playwright-multi-tab](https://github.com/snomiao/playwright-multi-tab) and set `PLAYWRIGHT_CLI=playwright-cli-multi-tab` in your `.env.local`.
20
+ The patched multi-tab playwright CLI that drives Chrome (with multi-tab, multi-session, and
21
+ per-profile `PLAYWRIGHT_MCP_PROFILE_DIRECTORY` support) is **bundled inside the package** — no
22
+ separate install, no `playwright` browser-binary download. `bun i -g rechrome` is enough for
23
+ `rechrome setup` to work out of the box.
24
+
25
+ > **Advanced:** override the bundled CLI with `PLAYWRIGHT_CLI=<cmd>` in your `.env.local` (e.g. to
26
+ > point at a local checkout of the [playwright-cli fork](https://github.com/snomiao/playwright-cli)).
22
27
 
23
28
  ## Install
24
29
 
@@ -113,7 +118,7 @@ cp .env.example .env.local
113
118
  | Variable | Description | Default |
114
119
  | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
115
120
  | `RECHROME_URL` | Connection URL (auto-generated by `rech serve`). Also accepts `?extension_id=`, `?token=`, `?profile=` query params | — |
116
- | `PLAYWRIGHT_CLI` | Path to playwright-cli binary (recommended: `playwright-cli-multi-tab` for full multi-tab support) | `playwright-cli` |
121
+ | `PLAYWRIGHT_CLI` | Override the playwright-cli command/path (defaults to the bundled `@playwright/cli`; set this only for a custom or forked CLI) | bundled `@playwright/cli` |
117
122
  | `RECH_HOST` | Server bind address | `127.0.0.1` |
118
123
  | `PLAYWRIGHT_MCP_EXTENSION_ID` | Chrome extension ID (client overrides server) | — |
119
124
  | `PLAYWRIGHT_MCP_EXTENSION_TOKEN` | Chrome extension token — profile-specific, get it from the extension's status page (client overrides server) | — |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rechrome",
3
- "version": "1.19.0",
3
+ "version": "1.21.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/snomiao/rechrome.git"
@@ -17,13 +17,15 @@
17
17
  "rech.js",
18
18
  "rech.ts",
19
19
  "serve.js",
20
- "serve.ts"
20
+ "serve.ts",
21
+ "vendor"
21
22
  ],
22
23
  "type": "module",
23
24
  "scripts": {
24
25
  "serve": "bun run rech.ts serve",
25
26
  "test": "bun test",
26
- "prepublishOnly": "sed 's/\\.ts/\\.js/g' rech.ts > rech.js && sed 's/\\.ts/\\.js/g' serve.ts > serve.js"
27
+ "vendor-cli": "bash scripts/vendor-cli.sh",
28
+ "prepublishOnly": "bash scripts/vendor-cli.sh && sed 's/\\.ts/\\.js/g' rech.ts > rech.js && sed 's/\\.ts/\\.js/g' serve.ts > serve.js"
27
29
  },
28
30
  "devDependencies": {
29
31
  "@types/bun": "latest"
package/rech.js CHANGED
@@ -194,48 +194,116 @@ export function authCheck(req: Request, key: string): Response | null {
194
194
  return null;
195
195
  }
196
196
 
197
- async function getClientIdentity(): Promise<{ gitUrl?: string; hostname?: string; cwd?: string }> {
198
- const cwd = process.cwd();
197
+ function realpathSafe(p: string): string {
198
+ try { return realpathSync(p); } catch { return p; }
199
+ }
200
+
201
+ async function gitOutput(args: string[], cwd: string): Promise<string | null> {
199
202
  try {
200
- const remoteProc = Bun.spawn(["git", "remote", "get-url", "origin"], {
201
- cwd,
202
- stdout: "pipe",
203
- stderr: "ignore",
204
- });
205
- const remoteUrl = (await new Response(remoteProc.stdout).text()).trim();
206
- await remoteProc.exited;
203
+ const proc = Bun.spawn(["git", ...args], { cwd, stdout: "pipe", stderr: "ignore" });
204
+ const out = (await new Response(proc.stdout).text()).trim();
205
+ await proc.exited;
206
+ return out || null;
207
+ } catch {
208
+ return null;
209
+ }
210
+ }
207
211
 
208
- const branchProc = Bun.spawn(["git", "rev-parse", "--abbrev-ref", "HEAD"], {
209
- cwd,
210
- stdout: "pipe",
211
- stderr: "ignore",
212
- });
213
- const branch = (await new Response(branchProc.stdout).text()).trim();
214
- await branchProc.exited;
215
-
216
- if (remoteUrl) {
217
- let gitUrl: string;
218
- const sshMatch = remoteUrl.match(/^git@([^:]+):(.+?)(?:\.git)?$/);
219
- const httpsMatch = remoteUrl.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);
220
- if (sshMatch) {
221
- gitUrl = `https://${sshMatch[1]}/${sshMatch[2]}`;
222
- } else if (httpsMatch) {
223
- gitUrl = `https://${httpsMatch[1]}/${httpsMatch[2]}`;
224
- } else {
225
- gitUrl = remoteUrl.replace(/\.git$/, "");
226
- }
227
- if (branch) gitUrl += `/tree/${branch}`;
228
- // Strip any embedded credentials from the URL
229
- try {
230
- const u = new URL(gitUrl);
231
- u.username = "";
232
- u.password = "";
233
- gitUrl = u.toString();
234
- } catch {}
235
- return { gitUrl };
212
+ // Normalize a git remote URL to "host/owner/repo" — no scheme, no .git, no credentials.
213
+ export function normalizeRemote(remoteUrl: string): string {
214
+ const sshMatch = remoteUrl.match(/^git@([^:]+):(.+?)(?:\.git)?$/);
215
+ const httpsMatch = remoteUrl.match(/^https?:\/\/(?:[^@/]+@)?([^/]+)\/(.+?)(?:\.git)?$/);
216
+ if (sshMatch) return `${sshMatch[1]}/${sshMatch[2]}`;
217
+ if (httpsMatch) return `${httpsMatch[1]}/${httpsMatch[2]}`;
218
+ return remoteUrl.replace(/^[^/]*:\/\//, "").replace(/^[^@]*@/, "").replace(/\.git$/, "");
219
+ }
220
+
221
+ // Derive the session bucket KEY (what the server hashes) and a human LABEL (logs / tab group)
222
+ // from already-gathered git facts. KEY and LABEL are deliberately decoupled: the key is keyed
223
+ // on the *worktree root path* for predictability (a human can tell which browser they drive),
224
+ // while the label renders a pretty <remote>#<basename>@<branch> for display only.
225
+ // - mode "worktree" (default): key = realpath(worktree root). Stable across `cd` within the
226
+ // project, distinct per worktree (no same-branch collisions), survives `git checkout`
227
+ // (no mutable-branch surprise), and has no branch so detached HEAD doesn't degrade it.
228
+ // - mode "branch": legacy opt-in — key = <remote>/tree/<branch> (the old behavior).
229
+ // - mode "cwd": key = realpath(cwd).
230
+ // Pass realpath'd `cwd` and `root`.
231
+ export function deriveIdentity(opts: {
232
+ mode: string;
233
+ cwd: string;
234
+ host: string;
235
+ root?: string | null; // worktree root (already realpath'd), null when not in git
236
+ remote?: string | null; // normalized host/owner/repo
237
+ branch?: string | null; // branch name, or short SHA when detached
238
+ }): { key: string; label: string } {
239
+ const { mode, cwd, host } = opts;
240
+ const root = opts.root || null;
241
+ const remote = opts.remote || null;
242
+ const branch = opts.branch || null;
243
+
244
+ let key: string;
245
+ if (mode === "branch") {
246
+ key = remote ? `https://${remote}${branch ? `/tree/${branch}` : ""}` : `${host}:${cwd}`;
247
+ } else if (mode === "cwd") {
248
+ key = `cwd:${cwd}`;
249
+ } else {
250
+ key = `worktree:${root || cwd}`;
251
+ }
252
+
253
+ let label: string;
254
+ if (root) {
255
+ label = `${remote ? `${remote}#` : ""}${basename(root)}${branch ? `@${branch}` : ""}`;
256
+ } else if (remote) {
257
+ label = `${remote}${branch ? `/tree/${branch}` : ""}`;
258
+ } else {
259
+ label = `${host}:${cwd}`;
260
+ }
261
+ return { key, label };
262
+ }
263
+
264
+ async function getClientIdentity(): Promise<{ key: string; label: string; profile?: string }> {
265
+ const cwd = realpathSafe(process.cwd());
266
+ const mode = (process.env.RECH_IDENTITY || "worktree").toLowerCase();
267
+ let root: string | null = null;
268
+ let remote: string | null = null;
269
+ let branch: string | null = null;
270
+
271
+ const top = await gitOutput(["rev-parse", "--show-toplevel"], cwd);
272
+ if (top) {
273
+ // Roll a submodule cwd up to the outermost superproject working tree, so submodule work
274
+ // shares the parent worktree's browser session (monorepo-friendly). Bounded loop guards
275
+ // against pathological nesting.
276
+ let superCwd = top;
277
+ for (let i = 0; i < 16; i++) {
278
+ const sup = await gitOutput(["rev-parse", "--show-superproject-working-tree"], superCwd);
279
+ if (!sup) break;
280
+ superCwd = sup;
236
281
  }
237
- } catch {}
238
- return { hostname: hostname(), cwd };
282
+ root = realpathSafe(superCwd);
283
+ branch = await gitOutput(["rev-parse", "--abbrev-ref", "HEAD"], root);
284
+ if (!branch || branch === "HEAD")
285
+ branch = await gitOutput(["rev-parse", "--short", "HEAD"], root); // detached HEAD
286
+ const remoteUrl = await gitOutput(["remote", "get-url", "origin"], root);
287
+ if (remoteUrl) remote = normalizeRemote(remoteUrl);
288
+ }
289
+
290
+ return deriveIdentity({ mode, cwd, host: hostname(), root, remote, branch });
291
+ }
292
+
293
+ // Profile precedence: an explicit `?profile=` in RECHROME_URL is authoritative; the
294
+ // PLAYWRIGHT_MCP_PROFILE_DIRECTORY shell env is the fallback. When both are set and differ,
295
+ // warn once — a silent mismatch here is how an OAuth/login flow can target the WRONG account.
296
+ let _profileMismatchWarned = false;
297
+ function resolveEffectiveProfile(urlProfile?: string): string | undefined {
298
+ const envProfile = process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY;
299
+ if (urlProfile && envProfile && urlProfile !== envProfile && !_profileMismatchWarned) {
300
+ _profileMismatchWarned = true;
301
+ console.error(
302
+ `[rech] warning: profile mismatch — RECHROME_URL profile="${urlProfile}" wins over ` +
303
+ `PLAYWRIGHT_MCP_PROFILE_DIRECTORY="${envProfile}". Unset the env var to silence this.`,
304
+ );
305
+ }
306
+ return urlProfile || envProfile;
239
307
  }
240
308
 
241
309
  async function getClientEnv(urlExtras?: { extensionId?: string; extensionToken?: string; profileDirectory?: string; userDataDir?: string; loadExtension?: string }): Promise<Record<string, string>> {
@@ -429,8 +497,8 @@ async function callServe(
429
497
  ): Promise<{ status: number; stdout: string; stderr: string; files?: string[]; existingSession?: boolean }> {
430
498
  const { key, host, port, protocol, extensionId, extensionToken, profileDirectory, userDataDir, loadExtension } = parseUrl(url);
431
499
  const identity = await getClientIdentity();
432
- const effectiveProfile = profileDirectory || process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY;
433
- if (effectiveProfile) (identity as any).profile = effectiveProfile;
500
+ const effectiveProfile = resolveEffectiveProfile(profileDirectory);
501
+ if (effectiveProfile) identity.profile = effectiveProfile;
434
502
  const env = { ...(await getClientEnv({ extensionId, extensionToken, profileDirectory, userDataDir, loadExtension })), ...overrideEnv };
435
503
  const res = await fetch(`${protocol}://${host}:${port}/run`, {
436
504
  method: "POST",
@@ -468,12 +536,12 @@ async function callServe(
468
536
 
469
537
  async function run(url: string, args: string[]) {
470
538
  const { host, port, protocol, extensionId, extensionToken, profileDirectory, userDataDir, loadExtension } = parseUrl(url);
471
- const effectiveProfile = profileDirectory || process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY;
539
+ const effectiveProfile = resolveEffectiveProfile(profileDirectory);
472
540
  const displayProfile = effectiveProfile ? await resolveProfileEmail(effectiveProfile) : undefined;
473
541
  const identity = await getClientIdentity();
474
542
  const profileSuffix = displayProfile ? ` profile:${displayProfile}` : "";
475
543
  console.error(
476
- `[rech] connecting to ${host}:${port} (identity: ${identity.gitUrl || `${identity.hostname}:${identity.cwd}`}${profileSuffix})`,
544
+ `[rech] connecting to ${host}:${port} (identity: ${identity.label}${profileSuffix})`,
477
545
  );
478
546
 
479
547
  const resolvedEnv = await getClientEnv({ extensionId, extensionToken, profileDirectory, userDataDir, loadExtension });
@@ -603,6 +671,27 @@ async function pmList(): Promise<string> {
603
671
  return await new Response(proc.stdout).text();
604
672
  }
605
673
 
674
+ // Resolve which playwright-cli the daemon runs to drive Chrome. Priority:
675
+ // 1. PLAYWRIGHT_CLI env override — explicit, already a full command string.
676
+ // 2. Vendored fork in a git checkout (lib/playwright-cli/playwright-cli.js) — the patched
677
+ // multi-tab CLI + patched playwright-core (PLAYWRIGHT_MCP_PROFILE_DIRECTORY etc.).
678
+ // 3. The fork bundled into the npm tarball (vendor/playwright-cli/playwright-cli.js, produced by
679
+ // scripts/vendor-cli.sh at prepublish). This is the batteries-included default for
680
+ // `bun i -g rechrome`: self-contained, no @playwright/cli dep, no browser-binary download.
681
+ // 4. Bare `playwright-cli-multi-tab` on PATH — legacy fallback for a pre-existing global link.
682
+ // A resolved .js entry is run through `node` on Windows (which can't exec a .js by shebang) and
683
+ // bare on POSIX (its `#!/usr/bin/env node` shebang runs it under node, which the relay handshake
684
+ // needs — see daemonInstall). serve splits the result on spaces into argv.
685
+ export function resolvePlaywrightCli(): string {
686
+ if (process.env.PLAYWRIGHT_CLI) return process.env.PLAYWRIGHT_CLI;
687
+ const jsEntry = [
688
+ join(import.meta.dir, "lib/playwright-cli/playwright-cli.js"),
689
+ join(import.meta.dir, "vendor/playwright-cli/playwright-cli.js"),
690
+ ].find(existsSync);
691
+ if (jsEntry) return IS_WINDOWS ? `node ${jsEntry}` : jsEntry;
692
+ return "playwright-cli-multi-tab";
693
+ }
694
+
606
695
  export async function daemonInstall(serveUrl: string): Promise<void> {
607
696
  // Persist the URL to ~/.env.local before starting the daemon. The daemon's
608
697
  // loadEnv() walks CWD→root reading .env.local files and unconditionally
@@ -619,20 +708,14 @@ export async function daemonInstall(serveUrl: string): Promise<void> {
619
708
  const bunBin = Bun.which("bun") ?? process.execPath;
620
709
  const rechScript = import.meta.filename;
621
710
 
622
- // Resolve PLAYWRIGHT_CLI: env override > bundled fork (development checkout) > "playwright-cli-multi-tab".
623
- // The fork is a .js script: POSIX execs it via its shebang (`#!/usr/bin/env node`), but Windows
624
- // can't exec a .js directly, so it must be invoked through an interpreter. It MUST be node, not
625
- // bun: the cliDaemon inherits its parent's runtime (spawned via process.execPath), and the
711
+ // Resolve PLAYWRIGHT_CLI (see resolvePlaywrightCli). The resolved .js entry MUST run under node,
712
+ // not bun: the cliDaemon inherits its parent's runtime (spawned via process.execPath), and the
626
713
  // extension-bridge relay's WebSocket handshake hangs under Bun (the extension WS connects but
627
714
  // `extension.initialized` never completes) — under node it completes, matching the POSIX shebang.
628
- // serve splits PLAYWRIGHT_CLI on spaces into argv, so we use bare `node` (the node path lives
629
- // under "Program Files" and contains a space); node must be on the daemon's PATH, same as the
630
- // shebang's `env node` assumption. The repo path contains no spaces.
631
- const bundledForkCli = join(import.meta.dir, "lib/playwright-cli/playwright-cli.js");
632
- const resolvedPlaywrightCli = process.env.PLAYWRIGHT_CLI
633
- || (existsSync(bundledForkCli)
634
- ? (IS_WINDOWS ? `node ${bundledForkCli}` : bundledForkCli)
635
- : "playwright-cli-multi-tab");
715
+ // serve splits PLAYWRIGHT_CLI on spaces into argv, so on Windows we use bare `node` (the node
716
+ // path lives under "Program Files" and contains a space); node must be on the daemon's PATH, same
717
+ // as the shebang's `env node` assumption. The repo / install paths contain no spaces.
718
+ const resolvedPlaywrightCli = resolvePlaywrightCli();
636
719
 
637
720
  // Environment the managed `serve` process must run with.
638
721
  const daemonEnv: Record<string, string> = {
@@ -1381,10 +1464,16 @@ Usage:
1381
1464
  rech serve Start the serve server manually (foreground)
1382
1465
  rech profiles List Chrome profiles
1383
1466
  rech <playwright-args...> Run Playwright CLI command (requires ${ENV_KEY})
1467
+ rech --isolate <args...> Run in a throwaway session (sugar for -s=<random>) so a
1468
+ fragile single-shot flow (OAuth/login) never shares tabs
1469
+ with the worktree's default session
1384
1470
 
1385
1471
  Environment:
1386
1472
  ${ENV_KEY} Server URL set by \`rech setup\`
1387
1473
  RECH_TOKEN Auth token for \`rech setup\` (same as --token)
1474
+ RECH_IDENTITY Session bucket mode: worktree (default) | branch | cwd. The session a
1475
+ client reuses is keyed on the worktree root path; \`branch\` restores the
1476
+ old <remote>/tree/<branch> keying, \`cwd\` keys on the exact directory
1388
1477
 
1389
1478
  Examples:
1390
1479
  rech setup
@@ -1453,6 +1542,15 @@ if (import.meta.main) {
1453
1542
  printHelp();
1454
1543
  process.exit(1);
1455
1544
  }
1545
+ // --isolate: ephemeral session isolation, sugar for -s=iso-<random>. For fragile single-shot
1546
+ // flows (OAuth/login) that must not share tabs with the worktree's default session. The `iso-`
1547
+ // marker lets the daemon reap these throwaway sessions on an idle TTL (see serve.js), so an
1548
+ // OAuth drive can't leak an orphaned browser context.
1549
+ const isolateIdx = args.findIndex((a) => a === "--isolate" || a === "--isolated");
1550
+ if (isolateIdx !== -1) {
1551
+ args.splice(isolateIdx, 1);
1552
+ args.push(`-s=iso-${randomBytes(8).toString("hex")}`);
1553
+ }
1456
1554
  await run(url, args);
1457
1555
  envWatcher?.close();
1458
1556
  }
package/rech.ts CHANGED
@@ -194,48 +194,116 @@ export function authCheck(req: Request, key: string): Response | null {
194
194
  return null;
195
195
  }
196
196
 
197
- async function getClientIdentity(): Promise<{ gitUrl?: string; hostname?: string; cwd?: string }> {
198
- const cwd = process.cwd();
197
+ function realpathSafe(p: string): string {
198
+ try { return realpathSync(p); } catch { return p; }
199
+ }
200
+
201
+ async function gitOutput(args: string[], cwd: string): Promise<string | null> {
199
202
  try {
200
- const remoteProc = Bun.spawn(["git", "remote", "get-url", "origin"], {
201
- cwd,
202
- stdout: "pipe",
203
- stderr: "ignore",
204
- });
205
- const remoteUrl = (await new Response(remoteProc.stdout).text()).trim();
206
- await remoteProc.exited;
203
+ const proc = Bun.spawn(["git", ...args], { cwd, stdout: "pipe", stderr: "ignore" });
204
+ const out = (await new Response(proc.stdout).text()).trim();
205
+ await proc.exited;
206
+ return out || null;
207
+ } catch {
208
+ return null;
209
+ }
210
+ }
207
211
 
208
- const branchProc = Bun.spawn(["git", "rev-parse", "--abbrev-ref", "HEAD"], {
209
- cwd,
210
- stdout: "pipe",
211
- stderr: "ignore",
212
- });
213
- const branch = (await new Response(branchProc.stdout).text()).trim();
214
- await branchProc.exited;
215
-
216
- if (remoteUrl) {
217
- let gitUrl: string;
218
- const sshMatch = remoteUrl.match(/^git@([^:]+):(.+?)(?:\.git)?$/);
219
- const httpsMatch = remoteUrl.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);
220
- if (sshMatch) {
221
- gitUrl = `https://${sshMatch[1]}/${sshMatch[2]}`;
222
- } else if (httpsMatch) {
223
- gitUrl = `https://${httpsMatch[1]}/${httpsMatch[2]}`;
224
- } else {
225
- gitUrl = remoteUrl.replace(/\.git$/, "");
226
- }
227
- if (branch) gitUrl += `/tree/${branch}`;
228
- // Strip any embedded credentials from the URL
229
- try {
230
- const u = new URL(gitUrl);
231
- u.username = "";
232
- u.password = "";
233
- gitUrl = u.toString();
234
- } catch {}
235
- return { gitUrl };
212
+ // Normalize a git remote URL to "host/owner/repo" — no scheme, no .git, no credentials.
213
+ export function normalizeRemote(remoteUrl: string): string {
214
+ const sshMatch = remoteUrl.match(/^git@([^:]+):(.+?)(?:\.git)?$/);
215
+ const httpsMatch = remoteUrl.match(/^https?:\/\/(?:[^@/]+@)?([^/]+)\/(.+?)(?:\.git)?$/);
216
+ if (sshMatch) return `${sshMatch[1]}/${sshMatch[2]}`;
217
+ if (httpsMatch) return `${httpsMatch[1]}/${httpsMatch[2]}`;
218
+ return remoteUrl.replace(/^[^/]*:\/\//, "").replace(/^[^@]*@/, "").replace(/\.git$/, "");
219
+ }
220
+
221
+ // Derive the session bucket KEY (what the server hashes) and a human LABEL (logs / tab group)
222
+ // from already-gathered git facts. KEY and LABEL are deliberately decoupled: the key is keyed
223
+ // on the *worktree root path* for predictability (a human can tell which browser they drive),
224
+ // while the label renders a pretty <remote>#<basename>@<branch> for display only.
225
+ // - mode "worktree" (default): key = realpath(worktree root). Stable across `cd` within the
226
+ // project, distinct per worktree (no same-branch collisions), survives `git checkout`
227
+ // (no mutable-branch surprise), and has no branch so detached HEAD doesn't degrade it.
228
+ // - mode "branch": legacy opt-in — key = <remote>/tree/<branch> (the old behavior).
229
+ // - mode "cwd": key = realpath(cwd).
230
+ // Pass realpath'd `cwd` and `root`.
231
+ export function deriveIdentity(opts: {
232
+ mode: string;
233
+ cwd: string;
234
+ host: string;
235
+ root?: string | null; // worktree root (already realpath'd), null when not in git
236
+ remote?: string | null; // normalized host/owner/repo
237
+ branch?: string | null; // branch name, or short SHA when detached
238
+ }): { key: string; label: string } {
239
+ const { mode, cwd, host } = opts;
240
+ const root = opts.root || null;
241
+ const remote = opts.remote || null;
242
+ const branch = opts.branch || null;
243
+
244
+ let key: string;
245
+ if (mode === "branch") {
246
+ key = remote ? `https://${remote}${branch ? `/tree/${branch}` : ""}` : `${host}:${cwd}`;
247
+ } else if (mode === "cwd") {
248
+ key = `cwd:${cwd}`;
249
+ } else {
250
+ key = `worktree:${root || cwd}`;
251
+ }
252
+
253
+ let label: string;
254
+ if (root) {
255
+ label = `${remote ? `${remote}#` : ""}${basename(root)}${branch ? `@${branch}` : ""}`;
256
+ } else if (remote) {
257
+ label = `${remote}${branch ? `/tree/${branch}` : ""}`;
258
+ } else {
259
+ label = `${host}:${cwd}`;
260
+ }
261
+ return { key, label };
262
+ }
263
+
264
+ async function getClientIdentity(): Promise<{ key: string; label: string; profile?: string }> {
265
+ const cwd = realpathSafe(process.cwd());
266
+ const mode = (process.env.RECH_IDENTITY || "worktree").toLowerCase();
267
+ let root: string | null = null;
268
+ let remote: string | null = null;
269
+ let branch: string | null = null;
270
+
271
+ const top = await gitOutput(["rev-parse", "--show-toplevel"], cwd);
272
+ if (top) {
273
+ // Roll a submodule cwd up to the outermost superproject working tree, so submodule work
274
+ // shares the parent worktree's browser session (monorepo-friendly). Bounded loop guards
275
+ // against pathological nesting.
276
+ let superCwd = top;
277
+ for (let i = 0; i < 16; i++) {
278
+ const sup = await gitOutput(["rev-parse", "--show-superproject-working-tree"], superCwd);
279
+ if (!sup) break;
280
+ superCwd = sup;
236
281
  }
237
- } catch {}
238
- return { hostname: hostname(), cwd };
282
+ root = realpathSafe(superCwd);
283
+ branch = await gitOutput(["rev-parse", "--abbrev-ref", "HEAD"], root);
284
+ if (!branch || branch === "HEAD")
285
+ branch = await gitOutput(["rev-parse", "--short", "HEAD"], root); // detached HEAD
286
+ const remoteUrl = await gitOutput(["remote", "get-url", "origin"], root);
287
+ if (remoteUrl) remote = normalizeRemote(remoteUrl);
288
+ }
289
+
290
+ return deriveIdentity({ mode, cwd, host: hostname(), root, remote, branch });
291
+ }
292
+
293
+ // Profile precedence: an explicit `?profile=` in RECHROME_URL is authoritative; the
294
+ // PLAYWRIGHT_MCP_PROFILE_DIRECTORY shell env is the fallback. When both are set and differ,
295
+ // warn once — a silent mismatch here is how an OAuth/login flow can target the WRONG account.
296
+ let _profileMismatchWarned = false;
297
+ function resolveEffectiveProfile(urlProfile?: string): string | undefined {
298
+ const envProfile = process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY;
299
+ if (urlProfile && envProfile && urlProfile !== envProfile && !_profileMismatchWarned) {
300
+ _profileMismatchWarned = true;
301
+ console.error(
302
+ `[rech] warning: profile mismatch — RECHROME_URL profile="${urlProfile}" wins over ` +
303
+ `PLAYWRIGHT_MCP_PROFILE_DIRECTORY="${envProfile}". Unset the env var to silence this.`,
304
+ );
305
+ }
306
+ return urlProfile || envProfile;
239
307
  }
240
308
 
241
309
  async function getClientEnv(urlExtras?: { extensionId?: string; extensionToken?: string; profileDirectory?: string; userDataDir?: string; loadExtension?: string }): Promise<Record<string, string>> {
@@ -429,8 +497,8 @@ async function callServe(
429
497
  ): Promise<{ status: number; stdout: string; stderr: string; files?: string[]; existingSession?: boolean }> {
430
498
  const { key, host, port, protocol, extensionId, extensionToken, profileDirectory, userDataDir, loadExtension } = parseUrl(url);
431
499
  const identity = await getClientIdentity();
432
- const effectiveProfile = profileDirectory || process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY;
433
- if (effectiveProfile) (identity as any).profile = effectiveProfile;
500
+ const effectiveProfile = resolveEffectiveProfile(profileDirectory);
501
+ if (effectiveProfile) identity.profile = effectiveProfile;
434
502
  const env = { ...(await getClientEnv({ extensionId, extensionToken, profileDirectory, userDataDir, loadExtension })), ...overrideEnv };
435
503
  const res = await fetch(`${protocol}://${host}:${port}/run`, {
436
504
  method: "POST",
@@ -468,12 +536,12 @@ async function callServe(
468
536
 
469
537
  async function run(url: string, args: string[]) {
470
538
  const { host, port, protocol, extensionId, extensionToken, profileDirectory, userDataDir, loadExtension } = parseUrl(url);
471
- const effectiveProfile = profileDirectory || process.env.PLAYWRIGHT_MCP_PROFILE_DIRECTORY;
539
+ const effectiveProfile = resolveEffectiveProfile(profileDirectory);
472
540
  const displayProfile = effectiveProfile ? await resolveProfileEmail(effectiveProfile) : undefined;
473
541
  const identity = await getClientIdentity();
474
542
  const profileSuffix = displayProfile ? ` profile:${displayProfile}` : "";
475
543
  console.error(
476
- `[rech] connecting to ${host}:${port} (identity: ${identity.gitUrl || `${identity.hostname}:${identity.cwd}`}${profileSuffix})`,
544
+ `[rech] connecting to ${host}:${port} (identity: ${identity.label}${profileSuffix})`,
477
545
  );
478
546
 
479
547
  const resolvedEnv = await getClientEnv({ extensionId, extensionToken, profileDirectory, userDataDir, loadExtension });
@@ -603,6 +671,27 @@ async function pmList(): Promise<string> {
603
671
  return await new Response(proc.stdout).text();
604
672
  }
605
673
 
674
+ // Resolve which playwright-cli the daemon runs to drive Chrome. Priority:
675
+ // 1. PLAYWRIGHT_CLI env override — explicit, already a full command string.
676
+ // 2. Vendored fork in a git checkout (lib/playwright-cli/playwright-cli.js) — the patched
677
+ // multi-tab CLI + patched playwright-core (PLAYWRIGHT_MCP_PROFILE_DIRECTORY etc.).
678
+ // 3. The fork bundled into the npm tarball (vendor/playwright-cli/playwright-cli.js, produced by
679
+ // scripts/vendor-cli.sh at prepublish). This is the batteries-included default for
680
+ // `bun i -g rechrome`: self-contained, no @playwright/cli dep, no browser-binary download.
681
+ // 4. Bare `playwright-cli-multi-tab` on PATH — legacy fallback for a pre-existing global link.
682
+ // A resolved .js entry is run through `node` on Windows (which can't exec a .js by shebang) and
683
+ // bare on POSIX (its `#!/usr/bin/env node` shebang runs it under node, which the relay handshake
684
+ // needs — see daemonInstall). serve splits the result on spaces into argv.
685
+ export function resolvePlaywrightCli(): string {
686
+ if (process.env.PLAYWRIGHT_CLI) return process.env.PLAYWRIGHT_CLI;
687
+ const jsEntry = [
688
+ join(import.meta.dir, "lib/playwright-cli/playwright-cli.js"),
689
+ join(import.meta.dir, "vendor/playwright-cli/playwright-cli.js"),
690
+ ].find(existsSync);
691
+ if (jsEntry) return IS_WINDOWS ? `node ${jsEntry}` : jsEntry;
692
+ return "playwright-cli-multi-tab";
693
+ }
694
+
606
695
  export async function daemonInstall(serveUrl: string): Promise<void> {
607
696
  // Persist the URL to ~/.env.local before starting the daemon. The daemon's
608
697
  // loadEnv() walks CWD→root reading .env.local files and unconditionally
@@ -619,20 +708,14 @@ export async function daemonInstall(serveUrl: string): Promise<void> {
619
708
  const bunBin = Bun.which("bun") ?? process.execPath;
620
709
  const rechScript = import.meta.filename;
621
710
 
622
- // Resolve PLAYWRIGHT_CLI: env override > bundled fork (development checkout) > "playwright-cli-multi-tab".
623
- // The fork is a .js script: POSIX execs it via its shebang (`#!/usr/bin/env node`), but Windows
624
- // can't exec a .js directly, so it must be invoked through an interpreter. It MUST be node, not
625
- // bun: the cliDaemon inherits its parent's runtime (spawned via process.execPath), and the
711
+ // Resolve PLAYWRIGHT_CLI (see resolvePlaywrightCli). The resolved .js entry MUST run under node,
712
+ // not bun: the cliDaemon inherits its parent's runtime (spawned via process.execPath), and the
626
713
  // extension-bridge relay's WebSocket handshake hangs under Bun (the extension WS connects but
627
714
  // `extension.initialized` never completes) — under node it completes, matching the POSIX shebang.
628
- // serve splits PLAYWRIGHT_CLI on spaces into argv, so we use bare `node` (the node path lives
629
- // under "Program Files" and contains a space); node must be on the daemon's PATH, same as the
630
- // shebang's `env node` assumption. The repo path contains no spaces.
631
- const bundledForkCli = join(import.meta.dir, "lib/playwright-cli/playwright-cli.js");
632
- const resolvedPlaywrightCli = process.env.PLAYWRIGHT_CLI
633
- || (existsSync(bundledForkCli)
634
- ? (IS_WINDOWS ? `node ${bundledForkCli}` : bundledForkCli)
635
- : "playwright-cli-multi-tab");
715
+ // serve splits PLAYWRIGHT_CLI on spaces into argv, so on Windows we use bare `node` (the node
716
+ // path lives under "Program Files" and contains a space); node must be on the daemon's PATH, same
717
+ // as the shebang's `env node` assumption. The repo / install paths contain no spaces.
718
+ const resolvedPlaywrightCli = resolvePlaywrightCli();
636
719
 
637
720
  // Environment the managed `serve` process must run with.
638
721
  const daemonEnv: Record<string, string> = {
@@ -1381,10 +1464,16 @@ Usage:
1381
1464
  rech serve Start the serve server manually (foreground)
1382
1465
  rech profiles List Chrome profiles
1383
1466
  rech <playwright-args...> Run Playwright CLI command (requires ${ENV_KEY})
1467
+ rech --isolate <args...> Run in a throwaway session (sugar for -s=<random>) so a
1468
+ fragile single-shot flow (OAuth/login) never shares tabs
1469
+ with the worktree's default session
1384
1470
 
1385
1471
  Environment:
1386
1472
  ${ENV_KEY} Server URL set by \`rech setup\`
1387
1473
  RECH_TOKEN Auth token for \`rech setup\` (same as --token)
1474
+ RECH_IDENTITY Session bucket mode: worktree (default) | branch | cwd. The session a
1475
+ client reuses is keyed on the worktree root path; \`branch\` restores the
1476
+ old <remote>/tree/<branch> keying, \`cwd\` keys on the exact directory
1388
1477
 
1389
1478
  Examples:
1390
1479
  rech setup
@@ -1453,6 +1542,15 @@ if (import.meta.main) {
1453
1542
  printHelp();
1454
1543
  process.exit(1);
1455
1544
  }
1545
+ // --isolate: ephemeral session isolation, sugar for -s=iso-<random>. For fragile single-shot
1546
+ // flows (OAuth/login) that must not share tabs with the worktree's default session. The `iso-`
1547
+ // marker lets the daemon reap these throwaway sessions on an idle TTL (see serve.ts), so an
1548
+ // OAuth drive can't leak an orphaned browser context.
1549
+ const isolateIdx = args.findIndex((a) => a === "--isolate" || a === "--isolated");
1550
+ if (isolateIdx !== -1) {
1551
+ args.splice(isolateIdx, 1);
1552
+ args.push(`-s=iso-${randomBytes(8).toString("hex")}`);
1553
+ }
1456
1554
  await run(url, args);
1457
1555
  envWatcher?.close();
1458
1556
  }