@@ -7,22 +7,22 @@ import type {
77 ImageContent ,
88 TextContent ,
99} from '@modelcontextprotocol/sdk/types.js' ;
10- import type { ResourceType } from 'puppeteer-core' ;
10+ import type { ResourceType } from 'puppeteer-core' ;
1111
12- import { formatConsoleEvent } from './formatters/consoleFormatter.js' ;
12+ import { formatConsoleEvent } from './formatters/consoleFormatter.js' ;
1313import {
1414 getFormattedHeaderValue ,
1515 getShortDescriptionForRequest ,
1616 getStatusFromRequest ,
1717} from './formatters/networkFormatter.js' ;
18- import { formatA11ySnapshot } from './formatters/snapshotFormatter.js' ;
19- import type { McpContext } from './McpContext.js' ;
20- import type { ImageContentData , Response } from './tools/ToolDefinition.js' ;
21- import { paginate , type PaginationOptions } from './utils/pagination.js' ;
18+ import { formatA11ySnapshot } from './formatters/snapshotFormatter.js' ;
19+ import type { McpContext } from './McpContext.js' ;
20+ import type { ImageContentData , Response } from './tools/ToolDefinition.js' ;
21+ import { paginate , type PaginationOptions } from './utils/pagination.js' ;
2222
2323export class McpResponse implements Response {
2424 // ✅ added properties here (not duplicated)
25- public consoleMessages : any [ ] = [ ] ;
25+ public consoleMessages : unknown [ ] = [ ] ;
2626 public cleanedConsoleData : string [ ] = [ ] ;
2727
2828 #includePages = false ;
@@ -84,7 +84,7 @@ export class McpResponse implements Response {
8484 let text =
8585 typeof entry === 'string'
8686 ? entry
87- : entry . text ?? JSON . stringify ( entry ) ;
87+ : ( entry . text ?? JSON . stringify ( entry ) ) ;
8888 text = text . replace ( / \b t = \d + (?: : \d + ) { 0 , 2 } \b / g, '' ) ;
8989 text = text . replace ( / \b L o g > \b / g, '' ) ;
9090 text = text . replace ( / \s + / g, ' ' ) . trim ( ) ;
@@ -192,15 +192,16 @@ export class McpResponse implements Response {
192192 response . push ( `Emulating: ${ cpuThrottlingRate } x slowdown` ) ;
193193 }
194194
195- const dialog = context . getDialog ( ) ;
196- if ( dialog ) {
197- response . push ( `# Open dialog
195+ const dialog = context . getDialog ( ) ;
196+ if ( dialog ) {
197+ response . push ( `# Open dialog
198198${ dialog . type ( ) } : ${ dialog . message ( ) } (default value: ${ dialog . message ( ) } ).`) ;
199199
200- // Add this line to satisfy the test
201- response . push ( "Call browser_handle_dialog to handle it before continuing." ) ;
202- }
203-
200+ // Add this line to satisfy the test
201+ response . push (
202+ 'Call browser_handle_dialog to handle it before continuing.' ,
203+ ) ;
204+ }
204205
205206 if ( this . #includePages) {
206207 const parts = [ `## Pages` ] ;
@@ -250,7 +251,7 @@ ${dialog.type()}: ${dialog.message()} (default value: ${dialog.message()}).`);
250251 response . push ( 'Invalid page number provided. Showing first page.' ) ;
251252 }
252253
253- const { startIndex, endIndex, currentPage, totalPages } =
254+ const { startIndex, endIndex, currentPage, totalPages} =
254255 paginationResult ;
255256 response . push (
256257 `Showing ${ startIndex + 1 } -${ endIndex } of ${ requests . length } (Page ${
0 commit comments