use green icons. do not tell about reset on timeouts
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="424" height="424" fill="none" overflow="visible"><g><path d="M 0 212 C 0 112.063 0 62.095 31.037 31.037 C 62.116 0 112.063 0 212 0 C 311.937 0 361.905 0 392.942 31.037 C 424 62.116 424 112.063 424 212 C 424 311.937 424 361.905 392.942 392.942 C 361.926 424 311.937 424 212 424 C 112.063 424 62.095 424 31.037 392.942 C 0 361.926 0 311.937 0 212" fill="rgb(0, 0, 0)"></path><path d="M 225.732 260.521 L 277.905 312.673 C 283.311 318.1 286.003 320.793 289.014 322.043 C 293.042 323.718 297.557 323.718 301.585 322.043 C 304.596 320.793 307.309 318.1 312.694 312.694 C 318.1 307.288 320.793 304.596 322.043 301.585 C 323.722 297.563 323.722 293.036 322.043 289.014 C 320.793 286.003 318.1 283.29 312.694 277.905 L 260.521 225.732 L 276.442 209.789 C 292.766 193.465 300.907 185.325 298.999 176.548 C 297.07 167.792 286.237 163.785 264.591 155.814 L 192.384 129.208 C 149.2 113.308 127.618 105.358 116.488 116.488 C 105.358 127.618 113.308 149.2 129.208 192.384 L 155.814 264.591 C 163.785 286.237 167.792 297.07 176.548 298.999 C 185.303 300.928 193.465 292.766 209.789 276.442 Z" fill="rgb(255, 255, 255)"></path></g></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -706,10 +706,10 @@ function isRestrictedUrl(url: string | undefined): boolean {
|
|||||||
const icons = {
|
const icons = {
|
||||||
connected: {
|
connected: {
|
||||||
path: {
|
path: {
|
||||||
'16': '/icons/icon-16.png',
|
'16': '/icons/icon-green-16.png',
|
||||||
'32': '/icons/icon-32.png',
|
'32': '/icons/icon-green-32.png',
|
||||||
'48': '/icons/icon-48.png',
|
'48': '/icons/icon-green-48.png',
|
||||||
'128': '/icons/icon-128.png',
|
'128': '/icons/icon-green-128.png',
|
||||||
},
|
},
|
||||||
title: 'Connected - Click to disconnect',
|
title: 'Connected - Click to disconnect',
|
||||||
badgeText: '',
|
badgeText: '',
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ import { getCdpUrl, LOG_FILE_PATH } from './utils.js'
|
|||||||
import { waitForPageLoad, WaitForPageLoadOptions, WaitForPageLoadResult } from './wait-for-page-load.js'
|
import { waitForPageLoad, WaitForPageLoadOptions, WaitForPageLoadResult } from './wait-for-page-load.js'
|
||||||
import { getCDPSessionForPage, CDPSession } from './cdp-session.js'
|
import { getCDPSessionForPage, CDPSession } from './cdp-session.js'
|
||||||
|
|
||||||
|
class CodeExecutionTimeoutError extends Error {
|
||||||
|
constructor(timeout: number) {
|
||||||
|
super(`Code execution timed out after ${timeout}ms`)
|
||||||
|
this.name = 'CodeExecutionTimeoutError'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const require = createRequire(import.meta.url)
|
const require = createRequire(import.meta.url)
|
||||||
|
|
||||||
const usefulGlobals = {
|
const usefulGlobals = {
|
||||||
@@ -616,7 +623,7 @@ server.tool(
|
|||||||
displayErrors: true,
|
displayErrors: true,
|
||||||
}),
|
}),
|
||||||
new Promise((_, reject) =>
|
new Promise((_, reject) =>
|
||||||
setTimeout(() => reject(new Error(`Code execution timed out after ${timeout}ms`)), timeout),
|
setTimeout(() => reject(new CodeExecutionTimeoutError(timeout)), timeout),
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -655,7 +662,7 @@ server.tool(
|
|||||||
|
|
||||||
const logsText = formatConsoleLogs(consoleLogs, 'Console output (before error)')
|
const logsText = formatConsoleLogs(consoleLogs, 'Console output (before error)')
|
||||||
|
|
||||||
const isTimeoutError = error.name === 'TimeoutError' || error.message.includes('Timeout')
|
const isTimeoutError = error instanceof CodeExecutionTimeoutError || error.name === 'TimeoutError'
|
||||||
if (!isTimeoutError) {
|
if (!isTimeoutError) {
|
||||||
sendLogToRelayServer('error', '[MCP] Error:', errorStack)
|
sendLogToRelayServer('error', '[MCP] Error:', errorStack)
|
||||||
}
|
}
|
||||||
|
|||||||