@capyclaw/ppt-suite 2.5.67 → 2.5.69

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 (147) hide show
  1. package/composition.lock.json +3 -3
  2. package/contract/ppt-contract.json +1 -1
  3. package/dsh-suite.json +4 -4
  4. package/node_modules/@capyclaw/asset-service/src/index.mjs +92 -6
  5. package/node_modules/@capyclaw/document-workbench/src/session/context.mjs +17 -5
  6. package/node_modules/@capyclaw/editor-host/src/index.mjs +7 -2
  7. package/node_modules/@capyclaw/foundation/abi/loader.mjs +8 -1
  8. package/node_modules/@capyclaw/foundation/abi/spec.mjs +5 -2
  9. package/node_modules/@capyclaw/foundation/abi/version.mjs +63 -5
  10. package/node_modules/@capyclaw/foundation/lib/adapters/raw.mjs +11 -10
  11. package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +8 -1
  12. package/node_modules/@capyclaw/foundation/lib/skill/scan.mjs +31 -3
  13. package/node_modules/@capyclaw/foundation/lib/subsystems/net.mjs +12 -2
  14. package/node_modules/@capyclaw/plugin-kit/src/editor/lease.mjs +0 -81
  15. package/node_modules/@capyclaw/plugin-kit/src/service/mcp-http.mjs +13 -6
  16. package/node_modules/@capyclaw/plugin-kit/src/tools/result.mjs +31 -15
  17. package/node_modules/@capyclaw/ppt-editor/contract/ppt-contract.json +1 -1
  18. package/node_modules/@capyclaw/ppt-skill-api/contract/ppt-contract.json +1 -1
  19. package/node_modules/@capyclaw/ppt-skill-api/skills/pptist-api/references/tool-contract.md +1 -1
  20. package/node_modules/@capyclaw/ppt-skill-proposal/contract/ppt-contract.json +1 -1
  21. package/node_modules/@capyclaw/ppt-workbench/contract/ppt-contract.json +1 -1
  22. package/node_modules/@capyclaw/ppt-workbench/package.json +1 -1
  23. package/node_modules/@capyclaw/ppt-workbench/server/contract.mjs +1 -1
  24. package/node_modules/@capyclaw/ppt-workbench/server/relay.mjs +18 -18
  25. package/node_modules/@capyclaw/ppt-workbench/server/routes/session.mjs +8 -1
  26. package/node_modules/@capyclaw/ppt-workbench/server/store/sessions.mjs +15 -4
  27. package/node_modules/@capyclaw/service-broker/lib/manifest.mjs +15 -2
  28. package/node_modules/@capyclaw/service-broker/lib/recovery.mjs +0 -50
  29. package/node_modules/@capyclaw/service-host/src/index.mjs +9 -1
  30. package/node_modules/@capyclaw/tool-host/src/descriptors.mjs +28 -4
  31. package/node_modules/@capyclaw/tool-host/src/index.mjs +32 -6
  32. package/package.json +4 -4
  33. package/node_modules/playwright-core/LICENSE +0 -202
  34. package/node_modules/playwright-core/NOTICE +0 -5
  35. package/node_modules/playwright-core/README.md +0 -3
  36. package/node_modules/playwright-core/ThirdPartyNotices.txt +0 -13
  37. package/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
  38. package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +0 -33
  39. package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -42
  40. package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
  41. package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
  42. package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -42
  43. package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
  44. package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
  45. package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -48
  46. package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
  47. package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
  48. package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -48
  49. package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
  50. package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
  51. package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -48
  52. package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
  53. package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
  54. package/node_modules/playwright-core/browsers.json +0 -52
  55. package/node_modules/playwright-core/cli.js +0 -22
  56. package/node_modules/playwright-core/index.d.ts +0 -17
  57. package/node_modules/playwright-core/index.js +0 -17
  58. package/node_modules/playwright-core/index.mjs +0 -28
  59. package/node_modules/playwright-core/lib/bootstrap.js +0 -149
  60. package/node_modules/playwright-core/lib/coreBundle.js +0 -78041
  61. package/node_modules/playwright-core/lib/entry/cliDaemon.js +0 -5
  62. package/node_modules/playwright-core/lib/entry/dashboardApp.js +0 -3
  63. package/node_modules/playwright-core/lib/entry/mcp.js +0 -10
  64. package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +0 -3
  65. package/node_modules/playwright-core/lib/package.js +0 -50
  66. package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  67. package/node_modules/playwright-core/lib/server/electron/loader.js +0 -123
  68. package/node_modules/playwright-core/lib/serverRegistry.js +0 -1939
  69. package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +0 -65
  70. package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +0 -141
  71. package/node_modules/playwright-core/lib/tools/cli-client/cli.js +0 -7
  72. package/node_modules/playwright-core/lib/tools/cli-client/help.json +0 -808
  73. package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +0 -128
  74. package/node_modules/playwright-core/lib/tools/cli-client/output.js +0 -352
  75. package/node_modules/playwright-core/lib/tools/cli-client/program.js +0 -422
  76. package/node_modules/playwright-core/lib/tools/cli-client/registry.js +0 -180
  77. package/node_modules/playwright-core/lib/tools/cli-client/session.js +0 -261
  78. package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
  79. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +0 -493
  80. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +0 -23
  81. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +0 -39
  82. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +0 -60
  83. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +0 -87
  84. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +0 -245
  85. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +0 -227
  86. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +0 -275
  87. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +0 -433
  88. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +0 -139
  89. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +0 -216
  90. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +0 -136
  91. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +0 -144
  92. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +0 -89
  93. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +0 -69
  94. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +0 -173
  95. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +0 -77
  96. package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +0 -174
  97. package/node_modules/playwright-core/lib/tools/utils/extension.js +0 -112
  98. package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +0 -108
  99. package/node_modules/playwright-core/lib/utilsBundle.js +0 -86078
  100. package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +0 -1890
  101. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +0 -1
  102. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +0 -32
  103. package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  104. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +0 -1
  105. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +0 -1
  106. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +0 -1
  107. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +0 -1
  108. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +0 -12
  109. package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +0 -1
  110. package/node_modules/playwright-core/lib/vite/dashboard/index.html +0 -29
  111. package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +0 -24
  112. package/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -16
  113. package/node_modules/playwright-core/lib/vite/htmlReport/report.css +0 -2
  114. package/node_modules/playwright-core/lib/vite/htmlReport/report.js +0 -32
  115. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +0 -1
  116. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DK72OMRi.js +0 -32
  117. package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  118. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +0 -1
  119. package/node_modules/playwright-core/lib/vite/recorder/assets/index-Cn0mmDuv.js +0 -129
  120. package/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
  121. package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
  122. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js +0 -32
  123. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +0 -184
  124. package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +0 -1
  125. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-B794rD2Z.js +0 -7
  126. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +0 -1
  127. package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  128. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +0 -1
  129. package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +0 -1
  130. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -44
  131. package/node_modules/playwright-core/lib/vite/traceViewer/index.oNry3Hjv.js +0 -1
  132. package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +0 -16
  133. package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
  134. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +0 -1
  135. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -10
  136. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -4
  137. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CYwC_gH1.js +0 -5
  138. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +0 -1
  139. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -18
  140. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +0 -1
  141. package/node_modules/playwright-core/lib/webp_codec.LICENSE +0 -173
  142. package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
  143. package/node_modules/playwright-core/lib/xdg-open +0 -1267
  144. package/node_modules/playwright-core/package.json +0 -34
  145. package/node_modules/playwright-core/types/protocol.d.ts +0 -24776
  146. package/node_modules/playwright-core/types/structs.d.ts +0 -52
  147. 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
- });