@playdrop/playdrop-cli 0.14.7 → 0.14.9
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.
- package/config/client-meta.json +2 -2
- package/dist/commands/worker.d.ts +1 -1
- package/dist/commands/worker.js +29 -8
- package/dist/index.js +1 -1
- package/node_modules/@playdrop/config/client-meta.json +2 -2
- package/node_modules/@playwright/mcp/LICENSE +201 -0
- package/node_modules/@playwright/mcp/README.md +1592 -0
- package/node_modules/@playwright/mcp/cli.js +32 -0
- package/node_modules/@playwright/mcp/config.d.ts +239 -0
- package/node_modules/@playwright/mcp/index.d.ts +23 -0
- package/node_modules/@playwright/mcp/index.js +19 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/LICENSE +202 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/NOTICE +5 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/README.md +318 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/ThirdPartyNotices.txt +14 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/cli.js +19 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/index.d.ts +17 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/index.js +17 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/index.mjs +18 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/jsx-runtime.js +42 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/jsx-runtime.mjs +21 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/agentParser.js +89 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/generateAgents.js +395 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/cli/reportActions.js +78 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/cli/testActions.js +213 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/common/index.js +2966 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/common/index.js.txt +34 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/errorContext.js +129 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/globals.js +58 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/index.js +783 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/isomorphic.js +260 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/isomorphic.js.txt +9 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/matchers/expect.js +13480 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/browserBackend.js +125 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/package.js +47 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/program.js +237 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/runner/index.js +8154 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/runner/index.js.txt +59 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/babelBundle.js +72275 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/babelBundle.js.txt +325 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/esmLoader.js +8060 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/util.js +373 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/worker/workerProcessEntry.js +1850 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/package.json +58 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/test.d.ts +18 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/test.js +24 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/test.mjs +35 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/types/test.d.ts +10709 -0
- package/node_modules/@playwright/mcp/node_modules/playwright/types/testReporter.d.ts +908 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/LICENSE +202 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/NOTICE +5 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/README.md +3 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/browsers.json +81 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/cli.js +21 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/index.d.ts +17 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/index.js +17 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/index.mjs +28 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/bootstrap.js +88 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/coreBundle.js +74495 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/mcp.js +10 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/package.js +50 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/server/electron/loader.js +118 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/serverRegistry.js +7347 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +354 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/cli.js +6 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/help.json +707 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/output.js +343 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/program.js +404 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/registry.js +176 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/session.js +258 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/SKILL.md +420 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/running-code.md +241 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/session-management.md +225 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/storage-state.md +275 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/test-generation.md +433 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/tracing.md +139 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/video-recording.md +143 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/trace/SKILL.md +171 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/utils/extension.js +78 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/utilsBundle.js +90764 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +2179 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +11 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BVGIAA-i.js +32 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/index-BQ57a3QC.js +129 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BSEO6m_i.js +32 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CT5oRh4X.js +181 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-BN2nOuEV.js +7 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/index.DLSGjmWZ.js +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/uiMode.C7UW1sC9.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CZvydVOh.js +5 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/xdg-open +1267 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/package.json +34 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/types/protocol.d.ts +24842 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/types/structs.d.ts +45 -0
- package/node_modules/@playwright/mcp/node_modules/playwright-core/types/types.d.ts +26088 -0
- package/node_modules/@playwright/mcp/package.json +51 -0
- package/package.json +3 -1
package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/minimist.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
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 minimist_exports = {};
|
|
20
|
+
__export(minimist_exports, {
|
|
21
|
+
minimist: () => minimist
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(minimist_exports);
|
|
24
|
+
function minimist(args, opts) {
|
|
25
|
+
if (!opts)
|
|
26
|
+
opts = {};
|
|
27
|
+
const bools = {};
|
|
28
|
+
const strings = {};
|
|
29
|
+
for (const key of toArray(opts.boolean))
|
|
30
|
+
bools[key] = true;
|
|
31
|
+
for (const key of toArray(opts.string))
|
|
32
|
+
strings[key] = true;
|
|
33
|
+
const argv = { _: [] };
|
|
34
|
+
function setArg(key, val) {
|
|
35
|
+
if (argv[key] === void 0 || bools[key] || typeof argv[key] === "boolean")
|
|
36
|
+
argv[key] = val;
|
|
37
|
+
else if (Array.isArray(argv[key]))
|
|
38
|
+
argv[key].push(val);
|
|
39
|
+
else
|
|
40
|
+
argv[key] = [argv[key], val];
|
|
41
|
+
}
|
|
42
|
+
let notFlags = [];
|
|
43
|
+
const doubleDashIndex = args.indexOf("--");
|
|
44
|
+
if (doubleDashIndex !== -1) {
|
|
45
|
+
notFlags = args.slice(doubleDashIndex + 1);
|
|
46
|
+
args = args.slice(0, doubleDashIndex);
|
|
47
|
+
}
|
|
48
|
+
for (let i = 0; i < args.length; i++) {
|
|
49
|
+
const arg = args[i];
|
|
50
|
+
let key;
|
|
51
|
+
let next;
|
|
52
|
+
if (/^--.+=/.test(arg)) {
|
|
53
|
+
const m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
54
|
+
key = m[1];
|
|
55
|
+
if (bools[key])
|
|
56
|
+
throw new Error(`boolean option '--${key}' should not be passed with '=value', use '--${key}' or '--no-${key}' instead`);
|
|
57
|
+
setArg(key, m[2]);
|
|
58
|
+
} else if (/^--no-.+/.test(arg)) {
|
|
59
|
+
key = arg.match(/^--no-(.+)/)[1];
|
|
60
|
+
setArg(key, false);
|
|
61
|
+
} else if (/^--.+/.test(arg)) {
|
|
62
|
+
key = arg.match(/^--(.+)/)[1];
|
|
63
|
+
next = args[i + 1];
|
|
64
|
+
if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !bools[key]) {
|
|
65
|
+
setArg(key, next);
|
|
66
|
+
i += 1;
|
|
67
|
+
} else if (/^(true|false)$/.test(next)) {
|
|
68
|
+
setArg(key, next === "true");
|
|
69
|
+
i += 1;
|
|
70
|
+
} else {
|
|
71
|
+
setArg(key, strings[key] ? "" : true);
|
|
72
|
+
}
|
|
73
|
+
} else if (/^-[^-]+/.test(arg)) {
|
|
74
|
+
const letters = arg.slice(1, -1).split("");
|
|
75
|
+
let broken = false;
|
|
76
|
+
for (let j = 0; j < letters.length; j++) {
|
|
77
|
+
next = arg.slice(j + 2);
|
|
78
|
+
if (next === "-") {
|
|
79
|
+
setArg(letters[j], next);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
83
|
+
setArg(letters[j], next.slice(1));
|
|
84
|
+
broken = true;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
88
|
+
setArg(letters[j], next);
|
|
89
|
+
broken = true;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
93
|
+
setArg(letters[j], arg.slice(j + 2));
|
|
94
|
+
broken = true;
|
|
95
|
+
break;
|
|
96
|
+
} else {
|
|
97
|
+
setArg(letters[j], strings[letters[j]] ? "" : true);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
key = arg.slice(-1)[0];
|
|
101
|
+
if (!broken && key !== "-") {
|
|
102
|
+
if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !bools[key]) {
|
|
103
|
+
setArg(key, args[i + 1]);
|
|
104
|
+
i += 1;
|
|
105
|
+
} else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
|
106
|
+
setArg(key, args[i + 1] === "true");
|
|
107
|
+
i += 1;
|
|
108
|
+
} else {
|
|
109
|
+
setArg(key, strings[key] ? "" : true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
argv._.push(arg);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
for (const k of notFlags)
|
|
117
|
+
argv._.push(k);
|
|
118
|
+
return argv;
|
|
119
|
+
}
|
|
120
|
+
function toArray(value) {
|
|
121
|
+
if (!value)
|
|
122
|
+
return [];
|
|
123
|
+
return Array.isArray(value) ? value : [value];
|
|
124
|
+
}
|
|
125
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
126
|
+
0 && (module.exports = {
|
|
127
|
+
minimist
|
|
128
|
+
});
|
package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/output.js
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var output_exports = {};
|
|
30
|
+
__export(output_exports, {
|
|
31
|
+
JsonOutput: () => JsonOutput,
|
|
32
|
+
TextOutput: () => TextOutput
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(output_exports);
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_extension = require("../utils/extension");
|
|
37
|
+
class TextOutput {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.json = false;
|
|
40
|
+
}
|
|
41
|
+
version(v) {
|
|
42
|
+
console.log(v);
|
|
43
|
+
}
|
|
44
|
+
help(text) {
|
|
45
|
+
console.log(text);
|
|
46
|
+
}
|
|
47
|
+
errorUnknownCommand(name, globalHelp) {
|
|
48
|
+
console.error(`Unknown command: ${name}
|
|
49
|
+
`);
|
|
50
|
+
console.log(globalHelp);
|
|
51
|
+
return process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
errorUnknownOption(opts, commandHelp) {
|
|
54
|
+
console.error(`Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}`);
|
|
55
|
+
console.log("");
|
|
56
|
+
console.log(commandHelp);
|
|
57
|
+
return process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
errorTooManyArguments(expected, received, commandHelp) {
|
|
60
|
+
console.error(`error: too many arguments: expected ${expected}, received ${received}`);
|
|
61
|
+
console.log("");
|
|
62
|
+
console.log(commandHelp);
|
|
63
|
+
return process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
errorAttachConflict() {
|
|
66
|
+
console.error(`Error: only one of [name], --cdp, --endpoint, or --extension can be specified`);
|
|
67
|
+
return process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
errorDetachNotAttached(session) {
|
|
70
|
+
console.error(`Error: session '${session}' was not attached; use \`playwright-cli${session !== "default" ? ` -s=${session}` : ""} close\` to stop it.`);
|
|
71
|
+
return process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
errorBrowserNotOpenForTool(session) {
|
|
74
|
+
console.log(`The browser '${session}' is not open, please run open first`);
|
|
75
|
+
console.log("");
|
|
76
|
+
console.log(` playwright-cli${session !== "default" ? ` -s=${session}` : ""} open [params]`);
|
|
77
|
+
return process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
errorAttachNoTarget() {
|
|
80
|
+
console.error(`Error: no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.`);
|
|
81
|
+
return process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
list({ all, browsers, servers, channelSessions }) {
|
|
84
|
+
const byWorkspace = /* @__PURE__ */ new Map();
|
|
85
|
+
for (const browser of browsers) {
|
|
86
|
+
let list = byWorkspace.get(browser.workspace);
|
|
87
|
+
if (!list) {
|
|
88
|
+
list = [];
|
|
89
|
+
byWorkspace.set(browser.workspace, list);
|
|
90
|
+
}
|
|
91
|
+
list.push(browser);
|
|
92
|
+
}
|
|
93
|
+
let count = 0;
|
|
94
|
+
for (const [workspaceKey, list] of byWorkspace) {
|
|
95
|
+
if (count === 0)
|
|
96
|
+
console.log("### Browsers");
|
|
97
|
+
if (all)
|
|
98
|
+
console.log(`${import_path.default.relative(process.cwd(), workspaceKey) || "/"}:`);
|
|
99
|
+
for (const browser of list)
|
|
100
|
+
console.log(renderBrowser(browser));
|
|
101
|
+
count += list.length;
|
|
102
|
+
}
|
|
103
|
+
if (!all) {
|
|
104
|
+
if (!count)
|
|
105
|
+
console.log(" (no browsers)");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (servers?.length) {
|
|
109
|
+
if (count)
|
|
110
|
+
console.log("");
|
|
111
|
+
console.log("### Browser servers available for attach");
|
|
112
|
+
const serversByWorkspace = /* @__PURE__ */ new Map();
|
|
113
|
+
for (const server of servers) {
|
|
114
|
+
let list = serversByWorkspace.get(server.workspaceDir ?? "");
|
|
115
|
+
if (!list) {
|
|
116
|
+
list = [];
|
|
117
|
+
serversByWorkspace.set(server.workspaceDir ?? "", list);
|
|
118
|
+
}
|
|
119
|
+
list.push(server);
|
|
120
|
+
}
|
|
121
|
+
for (const [workspaceKey, list] of serversByWorkspace) {
|
|
122
|
+
if (workspaceKey)
|
|
123
|
+
console.log(`${import_path.default.relative(process.cwd(), workspaceKey) || "/"}:`);
|
|
124
|
+
for (const server of list)
|
|
125
|
+
console.log(renderServer(server));
|
|
126
|
+
}
|
|
127
|
+
count += servers.length;
|
|
128
|
+
}
|
|
129
|
+
if (!count)
|
|
130
|
+
console.log(" (no browsers)");
|
|
131
|
+
if (channelSessions?.length) {
|
|
132
|
+
console.log("");
|
|
133
|
+
console.log("### Browsers available to attach via CDP");
|
|
134
|
+
for (const session of channelSessions)
|
|
135
|
+
console.log(renderChannelSession(session));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
closeAll(_sessions) {
|
|
139
|
+
}
|
|
140
|
+
deleteData(session, result) {
|
|
141
|
+
if (!result.existed) {
|
|
142
|
+
console.log(`No user data found for browser '${session}'.`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (result.deletedUserDataDir)
|
|
146
|
+
console.log(`Deleted user data for browser '${session}'.`);
|
|
147
|
+
}
|
|
148
|
+
killAll(pids) {
|
|
149
|
+
for (const pid of pids)
|
|
150
|
+
console.log(`Killed daemon process ${pid}`);
|
|
151
|
+
if (pids.length === 0)
|
|
152
|
+
console.log("No daemon processes found.");
|
|
153
|
+
else
|
|
154
|
+
console.log(`Killed ${pids.length} daemon process${pids.length === 1 ? "" : "es"}.`);
|
|
155
|
+
}
|
|
156
|
+
open(session, pid, toolResult) {
|
|
157
|
+
console.log(`### Browser \`${session}\` opened with pid ${pid}.`);
|
|
158
|
+
if (toolResult)
|
|
159
|
+
console.log(toolResult);
|
|
160
|
+
}
|
|
161
|
+
attach(session, pid, endpoint, toolResult) {
|
|
162
|
+
if (endpoint) {
|
|
163
|
+
console.log(`### Session \`${session}\` created, attached to \`${endpoint}\`.`);
|
|
164
|
+
console.log(`Run commands with: playwright-cli --s=${session} <command>`);
|
|
165
|
+
console.log("");
|
|
166
|
+
} else {
|
|
167
|
+
console.log(`### Browser \`${session}\` opened with pid ${pid}.`);
|
|
168
|
+
}
|
|
169
|
+
if (toolResult)
|
|
170
|
+
console.log(toolResult);
|
|
171
|
+
}
|
|
172
|
+
close(session, wasOpen) {
|
|
173
|
+
if (!wasOpen) {
|
|
174
|
+
console.log(`Browser '${session}' is not open.`);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
console.log(`Browser '${session}' closed
|
|
178
|
+
`);
|
|
179
|
+
}
|
|
180
|
+
detach(session, wasAttached) {
|
|
181
|
+
if (!wasAttached) {
|
|
182
|
+
console.log(`Browser '${session}' is not attached.`);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
console.log(`Browser '${session}' detached
|
|
186
|
+
`);
|
|
187
|
+
}
|
|
188
|
+
installed() {
|
|
189
|
+
}
|
|
190
|
+
show(_session, pid) {
|
|
191
|
+
if (process.env.PWTEST_PRINT_DASHBOARD_PID_FOR_TEST)
|
|
192
|
+
console.log(`### Dashboard opened with pid ${pid}.`);
|
|
193
|
+
}
|
|
194
|
+
toolResult(text) {
|
|
195
|
+
console.log(text);
|
|
196
|
+
}
|
|
197
|
+
installStdio() {
|
|
198
|
+
return "inherit";
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
class JsonOutput {
|
|
202
|
+
constructor() {
|
|
203
|
+
this.json = true;
|
|
204
|
+
}
|
|
205
|
+
version(v) {
|
|
206
|
+
this._emit({ version: v });
|
|
207
|
+
}
|
|
208
|
+
help(text) {
|
|
209
|
+
this._emit({ help: text });
|
|
210
|
+
}
|
|
211
|
+
errorUnknownCommand(name, _globalHelp) {
|
|
212
|
+
this._emit({ isError: true, error: `Unknown command: ${name}` });
|
|
213
|
+
return process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
errorUnknownOption(opts, _commandHelp) {
|
|
216
|
+
this._emit({ isError: true, error: `Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}` });
|
|
217
|
+
return process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
errorTooManyArguments(expected, received, _commandHelp) {
|
|
220
|
+
this._emit({ isError: true, error: `error: too many arguments: expected ${expected}, received ${received}` });
|
|
221
|
+
return process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
errorAttachConflict() {
|
|
224
|
+
this._emit({ isError: true, error: `only one of [name], --cdp, --endpoint, or --extension can be specified` });
|
|
225
|
+
return process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
errorDetachNotAttached(session) {
|
|
228
|
+
this._emit({ isError: true, error: `session '${session}' was not attached; use close to stop it.` });
|
|
229
|
+
return process.exit(1);
|
|
230
|
+
}
|
|
231
|
+
errorBrowserNotOpenForTool(session) {
|
|
232
|
+
this._emit({ isError: true, error: `The browser '${session}' is not open, please run open first` });
|
|
233
|
+
return process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
errorAttachNoTarget() {
|
|
236
|
+
this._emit({ isError: true, error: `no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.` });
|
|
237
|
+
return process.exit(1);
|
|
238
|
+
}
|
|
239
|
+
list({ all, browsers, servers, channelSessions }) {
|
|
240
|
+
const payload = { browsers };
|
|
241
|
+
if (all) {
|
|
242
|
+
payload.servers = servers ?? [];
|
|
243
|
+
payload.channelSessions = channelSessions ?? [];
|
|
244
|
+
}
|
|
245
|
+
this._emit(payload);
|
|
246
|
+
}
|
|
247
|
+
closeAll(sessions) {
|
|
248
|
+
this._emit({ closed: sessions });
|
|
249
|
+
}
|
|
250
|
+
deleteData(session, result) {
|
|
251
|
+
this._emit({ session, deleted: result.existed });
|
|
252
|
+
}
|
|
253
|
+
killAll(pids) {
|
|
254
|
+
this._emit({ killed: pids.length, pids });
|
|
255
|
+
}
|
|
256
|
+
open(session, pid, toolResult) {
|
|
257
|
+
this._emit({ session, pid, result: parseJsonText(toolResult) });
|
|
258
|
+
}
|
|
259
|
+
attach(session, pid, endpoint, toolResult) {
|
|
260
|
+
this._emit({
|
|
261
|
+
session,
|
|
262
|
+
pid,
|
|
263
|
+
...endpoint ? { endpoint } : {},
|
|
264
|
+
result: parseJsonText(toolResult)
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
close(session, wasOpen) {
|
|
268
|
+
this._emit({ session, status: wasOpen ? "closed" : "not-open" });
|
|
269
|
+
}
|
|
270
|
+
detach(session, wasAttached) {
|
|
271
|
+
this._emit({ session, status: wasAttached ? "detached" : "not-attached" });
|
|
272
|
+
}
|
|
273
|
+
installed() {
|
|
274
|
+
this._emit({ installed: true });
|
|
275
|
+
}
|
|
276
|
+
show(session, pid) {
|
|
277
|
+
this._emit({ session, pid });
|
|
278
|
+
}
|
|
279
|
+
toolResult(text) {
|
|
280
|
+
console.log(text);
|
|
281
|
+
}
|
|
282
|
+
installStdio() {
|
|
283
|
+
return "ignore";
|
|
284
|
+
}
|
|
285
|
+
_emit(value) {
|
|
286
|
+
console.log(JSON.stringify(value, null, 2));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function parseJsonText(text) {
|
|
290
|
+
try {
|
|
291
|
+
return JSON.parse(text);
|
|
292
|
+
} catch {
|
|
293
|
+
return text;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function renderBrowser(browser) {
|
|
297
|
+
const lines = [`- ${browser.name}:`];
|
|
298
|
+
lines.push(` - status: ${browser.status}`);
|
|
299
|
+
if (browser.status === "open" && !browser.compatible)
|
|
300
|
+
lines.push(` - version: v${browser.version} [incompatible please re-open]`);
|
|
301
|
+
if (browser.browserType)
|
|
302
|
+
lines.push(` - browser-type: ${browser.browserType}${browser.attached ? " (attached)" : ""}`);
|
|
303
|
+
if (!browser.attached) {
|
|
304
|
+
if (browser.userDataDir === null)
|
|
305
|
+
lines.push(` - user-data-dir: <in-memory>`);
|
|
306
|
+
else
|
|
307
|
+
lines.push(` - user-data-dir: ${browser.userDataDir}`);
|
|
308
|
+
if (browser.headed !== void 0)
|
|
309
|
+
lines.push(` - headed: ${browser.headed}`);
|
|
310
|
+
}
|
|
311
|
+
return lines.join("\n");
|
|
312
|
+
}
|
|
313
|
+
function renderServer(server) {
|
|
314
|
+
const lines = [`- browser "${server.title}":`];
|
|
315
|
+
lines.push(` - browser: ${server.browser.browserName}`);
|
|
316
|
+
lines.push(` - version: v${server.playwrightVersion}`);
|
|
317
|
+
if (server.browser.userDataDir)
|
|
318
|
+
lines.push(` - data-dir: ${server.browser.userDataDir}`);
|
|
319
|
+
else
|
|
320
|
+
lines.push(` - data-dir: <in-memory>`);
|
|
321
|
+
lines.push(` - run \`playwright-cli attach "${server.title}"\` to attach`);
|
|
322
|
+
return lines.join("\n");
|
|
323
|
+
}
|
|
324
|
+
function renderChannelSession(session) {
|
|
325
|
+
const lines = [`- ${session.channel}:`];
|
|
326
|
+
lines.push(` - data-dir: ${session.userDataDir}`);
|
|
327
|
+
if (session.extensionInstalled)
|
|
328
|
+
lines.push(` - attach (extension): \`playwright-cli attach --extension=${session.channel}\``);
|
|
329
|
+
else
|
|
330
|
+
lines.push(` - attach (extension): install at ${import_extension.playwrightExtensionInstallUrl}`);
|
|
331
|
+
if (session.endpoint) {
|
|
332
|
+
lines.push(` - attach (remote debugging): \`playwright-cli attach --cdp=${session.channel}\``);
|
|
333
|
+
} else {
|
|
334
|
+
const inspectScheme = session.channel.startsWith("msedge") ? "edge" : "chrome";
|
|
335
|
+
lines.push(` - attach (remote debugging): enable at ${inspectScheme}://inspect/#remote-debugging`);
|
|
336
|
+
}
|
|
337
|
+
return lines.join("\n");
|
|
338
|
+
}
|
|
339
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
340
|
+
0 && (module.exports = {
|
|
341
|
+
JsonOutput,
|
|
342
|
+
TextOutput
|
|
343
|
+
});
|