opera-devtools-mcp 0.4.0 → 0.4.2
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/build/src/McpPage.js
CHANGED
|
@@ -553,19 +553,20 @@ export class McpPage {
|
|
|
553
553
|
return this.#resolveElementHandle(node, uid);
|
|
554
554
|
}
|
|
555
555
|
async #resolveElementHandle(node, uid) {
|
|
556
|
-
|
|
556
|
+
let handle;
|
|
557
557
|
try {
|
|
558
|
-
|
|
559
|
-
if (!handle) {
|
|
560
|
-
throw new Error(message);
|
|
561
|
-
}
|
|
562
|
-
return handle;
|
|
558
|
+
handle = await node.elementHandle();
|
|
563
559
|
}
|
|
564
560
|
catch (error) {
|
|
565
|
-
|
|
561
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
562
|
+
throw new Error(`Failed to resolve element with uid ${uid}: ${reason}`, {
|
|
566
563
|
cause: error,
|
|
567
564
|
});
|
|
568
565
|
}
|
|
566
|
+
if (!handle) {
|
|
567
|
+
throw new Error(`Element with uid ${uid} no longer exists on the page.`);
|
|
568
|
+
}
|
|
569
|
+
return handle;
|
|
569
570
|
}
|
|
570
571
|
getAXNodeByUid(uid) {
|
|
571
572
|
return this.textSnapshot?.idToNode.get(uid);
|
|
@@ -228,6 +228,7 @@ export const operaListMcpServers = definePageTool({
|
|
|
228
228
|
try {
|
|
229
229
|
const result = await dispatchAction(session, {
|
|
230
230
|
action: 'listMcpServers',
|
|
231
|
+
type: 'LIST_SERVERS',
|
|
231
232
|
});
|
|
232
233
|
response.appendResponseLine(result);
|
|
233
234
|
}
|
|
@@ -260,6 +261,7 @@ export const operaListMcpTools = definePageTool({
|
|
|
260
261
|
const result = await dispatchAction(session, {
|
|
261
262
|
action: 'listMcpTools',
|
|
262
263
|
server: request.params.server,
|
|
264
|
+
type: 'LIST_TOOLS',
|
|
263
265
|
});
|
|
264
266
|
response.appendResponseLine(result);
|
|
265
267
|
}
|
|
@@ -301,7 +303,8 @@ export const operaCallMcpTool = definePageTool({
|
|
|
301
303
|
const payload = {
|
|
302
304
|
action: 'callMcpTool',
|
|
303
305
|
server: request.params.server,
|
|
304
|
-
|
|
306
|
+
toolName: request.params.tool,
|
|
307
|
+
type: 'EXECUTE_TOOL',
|
|
305
308
|
};
|
|
306
309
|
if (request.params.parameters !== undefined) {
|
|
307
310
|
payload['parameters'] = request.params.parameters;
|
package/build/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opera-devtools-mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "MCP server for Opera DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"prepare": "node scripts/prepare.ts && node scripts/setup-intake.ts",
|
|
30
30
|
"sync": "npm ci && git submodule update --init",
|
|
31
31
|
"verify-upstream-seam": "node scripts/verify-upstream-seam.ts",
|
|
32
|
-
"verify-server-json-version": "node scripts/verify-server-json-version.ts",
|
|
33
32
|
"update-lighthouse": "node scripts/update-lighthouse.ts",
|
|
34
33
|
"update-metrics": "node scripts/update_metrics.ts",
|
|
35
34
|
"verify-npm-package": "node scripts/verify-npm-package.js",
|