opera-devtools-mcp 0.4.1 → 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.
@@ -553,19 +553,20 @@ export class McpPage {
553
553
  return this.#resolveElementHandle(node, uid);
554
554
  }
555
555
  async #resolveElementHandle(node, uid) {
556
- const message = `Element with uid ${uid} no longer exists on the page.`;
556
+ let handle;
557
557
  try {
558
- const handle = await node.elementHandle();
559
- if (!handle) {
560
- throw new Error(message);
561
- }
562
- return handle;
558
+ handle = await node.elementHandle();
563
559
  }
564
560
  catch (error) {
565
- throw new Error(message, {
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);
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * Modified by Opera Software AS.
7
7
  */
8
- export const VERSION = '0.4.0';
8
+ export const VERSION = '0.4.2';
9
9
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opera-devtools-mcp",
3
- "version": "0.4.1",
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",