@cotestdev/mcp_playwright 0.0.58 → 0.0.60
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/lib/mcp/browser/config.js +3 -3
- package/lib/mcp/browser/context.js +4 -2
- package/lib/mcp/browser/tools/common.js +2 -1
- package/lib/mcp/browser/tools/devtools.js +42 -0
- package/lib/mcp/browser/tools/dialogs.js +2 -1
- package/lib/mcp/browser/tools/evaluate.js +2 -1
- package/lib/mcp/browser/tools/files.js +2 -1
- package/lib/mcp/browser/tools/form.js +2 -1
- package/lib/mcp/browser/tools/keyboard.js +5 -4
- package/lib/mcp/browser/tools/navigate.js +5 -4
- package/lib/mcp/browser/tools/runCode.js +31 -2
- package/lib/mcp/browser/tools/screenshot.js +2 -1
- package/lib/mcp/browser/tools/snapshot.js +3 -2
- package/lib/mcp/browser/tools/tabs.js +2 -1
- package/lib/mcp/browser/tools/verify.js +5 -4
- package/lib/mcp/browser/tools/wait.js +2 -1
- package/lib/mcp/browser/tools.js +2 -0
- package/lib/mcp/extension/extensionContextFactory.js +2 -3
- package/lib/mcp/program.js +3 -4
- package/lib/mcp/sdk/tool.js +1 -1
- package/lib/mcp/terminal/cli.js +1 -23
- package/lib/mcp/terminal/commands.js +30 -2
- package/lib/mcp/terminal/devtoolsApp.js +248 -0
- package/lib/mcp/terminal/program.js +87 -435
- package/lib/mcp/terminal/registry.js +146 -0
- package/lib/mcp/terminal/session.js +309 -0
- package/lib/mcp/test/browserBackend.js +55 -13
- package/lib/mcp/test/testBackend.js +25 -25
- package/lib/mcp/test/testContext.js +6 -8
- package/lib/mcpBundleImpl/index.js +22 -22
- package/lib/transform/esmLoader.js +8 -6
- package/lib/transform/transform.js +1 -1
- package/package.json +1 -1
- package/lib/index.d.ts +0 -23
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -24
- package/lib/index.js.map +0 -1
|
@@ -37,16 +37,15 @@ var import_fs = __toESM(require("fs"));
|
|
|
37
37
|
var import_os = __toESM(require("os"));
|
|
38
38
|
var import_path = __toESM(require("path"));
|
|
39
39
|
var import_utils = require("playwright-core/lib/utils");
|
|
40
|
+
var import_exports = require("playwright-core/lib/tools/exports");
|
|
41
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
40
42
|
var import_base = require("../../reporters/base");
|
|
41
43
|
var import_list = __toESM(require("../../reporters/list"));
|
|
42
44
|
var import_streams = require("./streams");
|
|
43
45
|
var import_util = require("../../util");
|
|
44
46
|
var import_testRunner = require("../../runner/testRunner");
|
|
45
47
|
var import_seed = require("./seed");
|
|
46
|
-
var import_exports = require("../sdk/exports");
|
|
47
48
|
var import_configLoader = require("../../common/configLoader");
|
|
48
|
-
var import_response = require("../browser/response");
|
|
49
|
-
var import_log = require("../log");
|
|
50
49
|
class GeneratorJournal {
|
|
51
50
|
constructor(rootPath, plan, seed) {
|
|
52
51
|
this._rootPath = rootPath;
|
|
@@ -78,9 +77,8 @@ ${step.code}
|
|
|
78
77
|
class TestContext {
|
|
79
78
|
constructor(clientInfo, configPath, options) {
|
|
80
79
|
this._clientInfo = clientInfo;
|
|
81
|
-
|
|
82
|
-
this.
|
|
83
|
-
this.rootPath = rootPath || this._configLocation.configDir;
|
|
80
|
+
this._configLocation = (0, import_configLoader.resolveConfigLocation)(configPath || clientInfo.cwd);
|
|
81
|
+
this.rootPath = clientInfo.cwd || this._configLocation.configDir;
|
|
84
82
|
if (options?.headless !== void 0)
|
|
85
83
|
this.computedHeaded = !options.headless;
|
|
86
84
|
else
|
|
@@ -213,7 +211,7 @@ class TestContext {
|
|
|
213
211
|
return { output: testRunnerAndScreen.output.join("\n"), status };
|
|
214
212
|
}
|
|
215
213
|
async close() {
|
|
216
|
-
await this._cleanupTestRunner().catch(
|
|
214
|
+
await this._cleanupTestRunner().catch((e) => (0, import_utilsBundle.debug)("pw:mcp:error")(e));
|
|
217
215
|
}
|
|
218
216
|
async sendMessageToPausedTest(request) {
|
|
219
217
|
const sendMessage = this._testRunnerAndScreen?.sendMessageToPausedTest;
|
|
@@ -223,7 +221,7 @@ class TestContext {
|
|
|
223
221
|
if (result.error)
|
|
224
222
|
throw new Error(result.error.message);
|
|
225
223
|
if (typeof request?.callTool?.arguments?.["intent"] === "string") {
|
|
226
|
-
const response = (0,
|
|
224
|
+
const response = (0, import_exports.parseResponse)(result.response.callTool);
|
|
227
225
|
if (response && !response.isError && response.code)
|
|
228
226
|
this.generatorJournal?.logStep(request.callTool.arguments["intent"], response.code);
|
|
229
227
|
}
|