File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import fs from 'node:fs/promises' ;
88import path from 'node:path' ;
99
10- import type { WebMCPTool } from 'puppeteer-core' ;
11-
1210import type { TargetUniverse } from './DevtoolsUtils.js' ;
1311import { UniverseManager } from './DevtoolsUtils.js' ;
1412import { McpPage } from './McpPage.js' ;
@@ -224,10 +222,6 @@ export class McpContext implements Context {
224222 ) ;
225223 }
226224
227- getWebMcpTools ( page : McpPage ) : WebMCPTool [ ] {
228- return page . pptrPage . webmcp . tools ( ) ;
229- }
230-
231225 getDevToolsUniverse ( page : McpPage ) : TargetUniverse | null {
232226 return this . #devtoolsUniverseManager. get ( page . pptrPage ) ;
233227 }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type {
99 ElementHandle ,
1010 Page ,
1111 Viewport ,
12+ WebMCPTool ,
1213} from './third_party/index.js' ;
1314import type { ToolGroup , ToolDefinition } from './tools/inPage.js' ;
1415import { takeSnapshot } from './tools/snapshot.js' ;
@@ -78,6 +79,10 @@ export class McpPage implements ContextPage {
7879 return this . inPageTools ;
7980 }
8081
82+ getWebMcpTools ( ) : WebMCPTool [ ] {
83+ return this . pptrPage . webmcp . tools ( ) ;
84+ }
85+
8186 get networkConditions ( ) : string | null {
8287 return this . emulationSettings . networkConditions ?? null ;
8388 }
Original file line number Diff line number Diff line change @@ -502,7 +502,7 @@ export class McpResponse implements Response {
502502 let webmcpTools : WebMCPTool [ ] | undefined ;
503503 if ( this . #listWebMcpTools && this . #args. experimentalWebmcp ) {
504504 const page = this . #page ?? context . getSelectedMcpPage ( ) ;
505- webmcpTools = context . getWebMcpTools ( page ) ;
505+ webmcpTools = page . getWebMcpTools ( ) ;
506506 }
507507
508508 let consoleMessages : Array < ConsoleFormatter | IssueFormatter > | undefined ;
You can’t perform that action at this time.
0 commit comments