@capyclaw/browser-suite 0.2.36 → 0.2.37

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 (187) hide show
  1. package/composition.lock.json +3 -3
  2. package/contract/browser-contract.json +1 -1
  3. package/dsh-suite.json +5 -5
  4. package/node_modules/@capyclaw/asset-service/src/index.mjs +86 -5
  5. package/node_modules/@capyclaw/browser-skill-api/contract/browser-contract.json +1 -1
  6. package/node_modules/@capyclaw/browser-skill-api/skills/browser-api/references/tool-contract.md +1 -1
  7. package/node_modules/@capyclaw/browser-skill-browser/contract/browser-contract.json +1 -1
  8. package/node_modules/@capyclaw/browser-skill-ops/contract/browser-contract.json +1 -1
  9. package/node_modules/@capyclaw/browser-workbench/contract/browser-contract.json +1 -1
  10. package/node_modules/@capyclaw/browser-workbench/package.json +1 -1
  11. package/node_modules/@capyclaw/browser-workbench/server/contract.mjs +1 -1
  12. package/node_modules/@capyclaw/browser-workbench/server/session-engines.mjs +39 -0
  13. package/node_modules/@capyclaw/document-workbench/src/session/context.mjs +17 -5
  14. package/node_modules/@capyclaw/foundation/lib/adapters/raw.mjs +11 -10
  15. package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +8 -1
  16. package/node_modules/@capyclaw/foundation/lib/skill/scan.mjs +31 -3
  17. package/node_modules/@capyclaw/plugin-kit/src/service/mcp-http.mjs +13 -6
  18. package/node_modules/@capyclaw/plugin-kit/src/tools/result.mjs +31 -15
  19. package/node_modules/@capyclaw/tool-host/src/descriptors.mjs +28 -4
  20. package/node_modules/@capyclaw/tool-host/src/index.mjs +32 -6
  21. package/package.json +5 -6
  22. package/node_modules/playwright/LICENSE +0 -202
  23. package/node_modules/playwright/NOTICE +0 -5
  24. package/node_modules/playwright/README.md +0 -318
  25. package/node_modules/playwright/ThirdPartyNotices.txt +0 -14
  26. package/node_modules/playwright/cli.js +0 -19
  27. package/node_modules/playwright/index.d.ts +0 -17
  28. package/node_modules/playwright/index.js +0 -17
  29. package/node_modules/playwright/index.mjs +0 -18
  30. package/node_modules/playwright/lib/agents/agentParser.js +0 -89
  31. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +0 -34
  32. package/node_modules/playwright/lib/agents/generateAgents.js +0 -395
  33. package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +0 -31
  34. package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +0 -8
  35. package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +0 -88
  36. package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +0 -6
  37. package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +0 -56
  38. package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +0 -9
  39. package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +0 -74
  40. package/node_modules/playwright/lib/cli/reportActions.js +0 -78
  41. package/node_modules/playwright/lib/cli/testActions.js +0 -217
  42. package/node_modules/playwright/lib/common/index.js +0 -2937
  43. package/node_modules/playwright/lib/common/index.js.txt +0 -33
  44. package/node_modules/playwright/lib/errorContext.js +0 -129
  45. package/node_modules/playwright/lib/globals.js +0 -58
  46. package/node_modules/playwright/lib/index.js +0 -827
  47. package/node_modules/playwright/lib/isomorphic.js +0 -260
  48. package/node_modules/playwright/lib/isomorphic.js.txt +0 -9
  49. package/node_modules/playwright/lib/loader/loaderProcessEntry.js +0 -34
  50. package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +0 -9
  51. package/node_modules/playwright/lib/matchers/expect.js +0 -13496
  52. package/node_modules/playwright/lib/matchers/expect.js.LICENSE +0 -640
  53. package/node_modules/playwright/lib/matchers/expect.js.txt +0 -67
  54. package/node_modules/playwright/lib/package.js +0 -47
  55. package/node_modules/playwright/lib/program.js +0 -242
  56. package/node_modules/playwright/lib/runner/index.js +0 -8721
  57. package/node_modules/playwright/lib/runner/index.js.txt +0 -62
  58. package/node_modules/playwright/lib/transform/babelBundle.js +0 -72490
  59. package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +0 -2384
  60. package/node_modules/playwright/lib/transform/babelBundle.js.txt +0 -328
  61. package/node_modules/playwright/lib/transform/esmLoader.js +0 -8066
  62. package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +0 -355
  63. package/node_modules/playwright/lib/transform/esmLoader.js.txt +0 -60
  64. package/node_modules/playwright/lib/util.js +0 -373
  65. package/node_modules/playwright/lib/worker/workerProcessEntry.js +0 -1860
  66. package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +0 -19
  67. package/node_modules/playwright/package.json +0 -50
  68. package/node_modules/playwright/test.d.ts +0 -18
  69. package/node_modules/playwright/test.js +0 -24
  70. package/node_modules/playwright/test.mjs +0 -35
  71. package/node_modules/playwright/types/test.d.ts +0 -11191
  72. package/node_modules/playwright/types/testReporter.d.ts +0 -950
  73. package/node_modules/playwright-core/LICENSE +0 -202
  74. package/node_modules/playwright-core/NOTICE +0 -5
  75. package/node_modules/playwright-core/README.md +0 -3
  76. package/node_modules/playwright-core/ThirdPartyNotices.txt +0 -13
  77. package/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
  78. package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +0 -33
  79. package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -42
  80. package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
  81. package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
  82. package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -42
  83. package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
  84. package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
  85. package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -48
  86. package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
  87. package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
  88. package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -48
  89. package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
  90. package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
  91. package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -48
  92. package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
  93. package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
  94. package/node_modules/playwright-core/browsers.json +0 -52
  95. package/node_modules/playwright-core/cli.js +0 -22
  96. package/node_modules/playwright-core/index.d.ts +0 -17
  97. package/node_modules/playwright-core/index.js +0 -17
  98. package/node_modules/playwright-core/index.mjs +0 -28
  99. package/node_modules/playwright-core/lib/bootstrap.js +0 -149
  100. package/node_modules/playwright-core/lib/coreBundle.js +0 -78041
  101. package/node_modules/playwright-core/lib/entry/cliDaemon.js +0 -5
  102. package/node_modules/playwright-core/lib/entry/dashboardApp.js +0 -3
  103. package/node_modules/playwright-core/lib/entry/mcp.js +0 -10
  104. package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +0 -3
  105. package/node_modules/playwright-core/lib/package.js +0 -50
  106. package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  107. package/node_modules/playwright-core/lib/server/electron/loader.js +0 -123
  108. package/node_modules/playwright-core/lib/serverRegistry.js +0 -1939
  109. package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +0 -65
  110. package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +0 -141
  111. package/node_modules/playwright-core/lib/tools/cli-client/cli.js +0 -7
  112. package/node_modules/playwright-core/lib/tools/cli-client/help.json +0 -808
  113. package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +0 -128
  114. package/node_modules/playwright-core/lib/tools/cli-client/output.js +0 -352
  115. package/node_modules/playwright-core/lib/tools/cli-client/program.js +0 -422
  116. package/node_modules/playwright-core/lib/tools/cli-client/registry.js +0 -180
  117. package/node_modules/playwright-core/lib/tools/cli-client/session.js +0 -261
  118. package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
  119. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +0 -493
  120. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +0 -23
  121. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +0 -39
  122. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +0 -60
  123. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +0 -87
  124. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +0 -245
  125. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +0 -227
  126. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +0 -275
  127. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +0 -433
  128. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +0 -139
  129. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +0 -216
  130. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +0 -136
  131. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +0 -144
  132. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +0 -89
  133. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +0 -69
  134. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +0 -173
  135. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +0 -77
  136. package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +0 -174
  137. package/node_modules/playwright-core/lib/tools/utils/extension.js +0 -112
  138. package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +0 -108
  139. package/node_modules/playwright-core/lib/utilsBundle.js +0 -86078
  140. package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +0 -1890
  141. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +0 -1
  142. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +0 -32
  143. package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  144. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +0 -1
  145. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +0 -1
  146. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +0 -1
  147. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +0 -1
  148. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +0 -12
  149. package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +0 -1
  150. package/node_modules/playwright-core/lib/vite/dashboard/index.html +0 -29
  151. package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +0 -24
  152. package/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -16
  153. package/node_modules/playwright-core/lib/vite/htmlReport/report.css +0 -2
  154. package/node_modules/playwright-core/lib/vite/htmlReport/report.js +0 -32
  155. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +0 -1
  156. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DK72OMRi.js +0 -32
  157. package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  158. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +0 -1
  159. package/node_modules/playwright-core/lib/vite/recorder/assets/index-Cn0mmDuv.js +0 -129
  160. package/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
  161. package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
  162. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js +0 -32
  163. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +0 -184
  164. package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +0 -1
  165. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-B794rD2Z.js +0 -7
  166. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +0 -1
  167. package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  168. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +0 -1
  169. package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +0 -1
  170. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -44
  171. package/node_modules/playwright-core/lib/vite/traceViewer/index.oNry3Hjv.js +0 -1
  172. package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +0 -16
  173. package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
  174. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +0 -1
  175. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -10
  176. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -4
  177. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CYwC_gH1.js +0 -5
  178. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +0 -1
  179. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -18
  180. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +0 -1
  181. package/node_modules/playwright-core/lib/webp_codec.LICENSE +0 -173
  182. package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
  183. package/node_modules/playwright-core/lib/xdg-open +0 -1267
  184. package/node_modules/playwright-core/package.json +0 -34
  185. package/node_modules/playwright-core/types/protocol.d.ts +0 -24776
  186. package/node_modules/playwright-core/types/structs.d.ts +0 -52
  187. package/node_modules/playwright-core/types/types.d.ts +0 -27167
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
- set -x
4
-
5
- cd /tmp
6
- curl -L --retry 3 -o ./msedge_stable.pkg "$1"
7
- # Note: there's no way to uninstall previously installed MSEdge.
8
- # However, running PKG again seems to update installation.
9
- sudo installer -pkg /tmp/msedge_stable.pkg -target /
10
- rm -rf /tmp/msedge_stable.pkg
11
- /Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version
@@ -1,24 +0,0 @@
1
- $ErrorActionPreference = 'Stop'
2
-
3
- $url = $args[0]
4
-
5
- Write-Host "Downloading Microsoft Edge"
6
- $wc = New-Object net.webclient
7
- $msiInstaller = "$env:temp\microsoft-edge-stable.msi"
8
- $wc.Downloadfile($url, $msiInstaller)
9
-
10
- Write-Host "Installing Microsoft Edge"
11
- $arguments = "/i `"$msiInstaller`" /quiet"
12
- Start-Process msiexec.exe -ArgumentList $arguments -Wait
13
- Remove-Item $msiInstaller
14
-
15
- $suffix = "\\Microsoft\\Edge\\Application\\msedge.exe"
16
- if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
17
- (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
18
- } elseif (Test-Path "${env:ProgramFiles}$suffix") {
19
- (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
20
- } else {
21
- Write-Host "ERROR: Failed to install Microsoft Edge."
22
- Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
23
- exit 1
24
- }
@@ -1,52 +0,0 @@
1
- {
2
- "comment": "Do not edit this file, use utils/roll_browser.js",
3
- "browsers": [
4
- {
5
- "name": "chromium",
6
- "revision": "1248",
7
- "installByDefault": true,
8
- "browserVersion": "156.0.8078.4",
9
- "title": "Chrome for Testing"
10
- },
11
- {
12
- "name": "chromium-headless-shell",
13
- "revision": "1248",
14
- "installByDefault": true,
15
- "browserVersion": "156.0.8078.4",
16
- "title": "Chrome Headless Shell"
17
- },
18
- {
19
- "name": "firefox",
20
- "revision": "1555",
21
- "installByDefault": true,
22
- "browserVersion": "157.0",
23
- "title": "Firefox"
24
- },
25
- {
26
- "name": "webkit",
27
- "revision": "2370",
28
- "installByDefault": true,
29
- "revisionOverrides": {
30
- "mac14": "2251",
31
- "mac14-arm64": "2251"
32
- },
33
- "browserVersion": "27.2",
34
- "title": "WebKit"
35
- },
36
- {
37
- "name": "ffmpeg",
38
- "revision": "1013",
39
- "installByDefault": true
40
- },
41
- {
42
- "name": "winldd",
43
- "revision": "1007",
44
- "installByDefault": false
45
- },
46
- {
47
- "name": "android",
48
- "revision": "1001",
49
- "installByDefault": false
50
- }
51
- ]
52
- }
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- require('./lib/bootstrap');
18
- const { libCli, libCliTestStub } = require('./lib/coreBundle');
19
- const { program } = require('./lib/utilsBundle');
20
- libCli.decorateProgram(program);
21
- libCliTestStub.decorateProgram(program);
22
- program.parse(process.argv);
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- export * from './types/types';
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- require('./lib/bootstrap');
17
- module.exports = require('./lib/coreBundle').inprocess.playwright;
@@ -1,28 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import playwright from './index.js';
18
-
19
- export const chromium = playwright.chromium;
20
- export const firefox = playwright.firefox;
21
- export const webkit = playwright.webkit;
22
- export const selectors = playwright.selectors;
23
- export const devices = playwright.devices;
24
- export const errors = playwright.errors;
25
- export const request = playwright.request;
26
- export const _electron = playwright._electron;
27
- export const _android = playwright._android;
28
- export default playwright;
@@ -1,149 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var bootstrap_exports = {};
20
- __export(bootstrap_exports, {
21
- processExit: () => processExit
22
- });
23
- module.exports = __toCommonJS(bootstrap_exports);
24
- const minimumMajorNodeVersion = 20;
25
- const currentNodeVersion = process.versions.node;
26
- const major = +currentNodeVersion.split(".")[0];
27
- if (major < minimumMajorNodeVersion) {
28
- console.error(
29
- "You are running Node.js " + currentNodeVersion + `.
30
- Playwright requires Node.js ${minimumMajorNodeVersion} or higher.
31
- Please update your version of Node.js.`
32
- );
33
- process.exit(1);
34
- }
35
- let stopProfiling = (callback) => callback();
36
- if (process.env.PW_PROFILE_DIR) {
37
- const fs = require("fs");
38
- const path = require("path");
39
- const { Session } = require("inspector");
40
- const profileDir = path.resolve(process.env.PW_PROFILE_DIR);
41
- const script = process.argv[1] ? path.basename(process.argv[1], path.extname(process.argv[1])) : "node";
42
- const command = /^[a-z][\w-]*$/i.test(process.argv[2] ?? "") ? process.argv[2] : void 0;
43
- const profileName = [script, command, process.pid].filter(Boolean).join("-");
44
- const session = new Session();
45
- session.connect();
46
- session.post("Profiler.enable");
47
- session.post("Profiler.start");
48
- stopProfiling = (callback) => {
49
- stopProfiling = (callback2) => callback2();
50
- session.post("Profiler.stop", (error, result) => {
51
- try {
52
- if (!error) {
53
- fs.mkdirSync(profileDir, { recursive: true });
54
- fs.writeFileSync(path.join(profileDir, profileName + ".cpuprofile"), JSON.stringify(result.profile));
55
- }
56
- } finally {
57
- callback();
58
- }
59
- });
60
- };
61
- process.on("beforeExit", () => stopProfiling(() => {
62
- }));
63
- }
64
- function processExit(code) {
65
- stopProfiling(() => {
66
- process.exit(code);
67
- });
68
- return void 0;
69
- }
70
- if (process.env.PW_INSTRUMENT_MODULES) {
71
- const Module = require("module");
72
- const originalLoad = Module._load;
73
- const root = { name: "<root>", selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
74
- let current = root;
75
- const stack = [];
76
- Module._load = function(request, _parent, _isMain) {
77
- const node = { name: request, selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
78
- current.children.push(node);
79
- stack.push(current);
80
- current = node;
81
- const start = performance.now();
82
- let result;
83
- try {
84
- result = originalLoad.apply(this, arguments);
85
- } catch (e) {
86
- current = stack.pop();
87
- current.children.pop();
88
- throw e;
89
- }
90
- const duration = performance.now() - start;
91
- node.totalMs = duration;
92
- node.selfMs = Math.max(0, duration - node.childrenMs);
93
- current = stack.pop();
94
- current.childrenMs += duration;
95
- return result;
96
- };
97
- process.on("exit", () => {
98
- function printTree(node, prefix, isLast, lines2, depth) {
99
- if (node.totalMs < 1 && depth > 0)
100
- return;
101
- const connector = depth === 0 ? "" : isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
102
- const time = `${node.totalMs.toFixed(1).padStart(8)}ms`;
103
- const self = node.children.length ? ` (self: ${node.selfMs.toFixed(1)}ms)` : "";
104
- lines2.push(`${time} ${prefix}${connector}${node.name}${self}`);
105
- const childPrefix = prefix + (depth === 0 ? "" : isLast ? " " : "\u2502 ");
106
- const sorted2 = node.children.slice().sort((a, b) => b.totalMs - a.totalMs);
107
- for (let i = 0; i < sorted2.length; i++)
108
- printTree(sorted2[i], childPrefix, i === sorted2.length - 1, lines2, depth + 1);
109
- }
110
- let totalModules = 0;
111
- function count(n) {
112
- totalModules++;
113
- n.children.forEach(count);
114
- }
115
- root.children.forEach(count);
116
- const lines = [];
117
- const sorted = root.children.slice().sort((a, b) => b.totalMs - a.totalMs);
118
- for (let i = 0; i < sorted.length; i++)
119
- printTree(sorted[i], "", i === sorted.length - 1, lines, 0);
120
- const totalMs = root.children.reduce((s, c) => s + c.totalMs, 0);
121
- process.stderr.write(`
122
- --- Module load tree: ${totalModules} modules, ${totalMs.toFixed(0)}ms total ---
123
- ` + lines.join("\n") + "\n");
124
- const flat = /* @__PURE__ */ new Map();
125
- function gather(n) {
126
- const existing = flat.get(n.name);
127
- if (existing) {
128
- existing.selfMs += n.selfMs;
129
- existing.totalMs += n.totalMs;
130
- existing.count++;
131
- } else {
132
- flat.set(n.name, { selfMs: n.selfMs, totalMs: n.totalMs, count: 1 });
133
- }
134
- n.children.forEach(gather);
135
- }
136
- root.children.forEach(gather);
137
- const top50 = [...flat.entries()].sort((a, b) => b[1].selfMs - a[1].selfMs).slice(0, 50);
138
- const flatLines = top50.map(
139
- ([mod, { selfMs, totalMs: totalMs2, count: count2 }]) => `${selfMs.toFixed(1).padStart(8)}ms self ${totalMs2.toFixed(1).padStart(8)}ms total (x${String(count2).padStart(3)}) ${mod}`
140
- );
141
- process.stderr.write(`
142
- --- Top 50 modules by self time ---
143
- ` + flatLines.join("\n") + "\n");
144
- });
145
- }
146
- // Annotate the CommonJS export names for ESM import in node:
147
- 0 && (module.exports = {
148
- processExit
149
- });