mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-09-14 19:45:30 +08:00
fix(cli): have pageId as first argument (#2142)
Refs #1777 This change makes pageId as the first argument for CLI if experimentalPageIdRouting flag is enabled Co-authored-by: Samiya Caur <samiyac@chromium.org>
This commit is contained in:
+1
-1
@@ -163,7 +163,7 @@ export class ToolHandler {
|
||||
tool.pageScoped &&
|
||||
serverArgs.experimentalPageIdRouting &&
|
||||
!serverArgs.slim
|
||||
? {...tool.schema, ...pageIdSchema}
|
||||
? {...pageIdSchema, ...tool.schema}
|
||||
: tool.schema;
|
||||
this.registeredInputSchema = zod.object(this.inputSchema).passthrough();
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,6 +24,7 @@ so returned values have to be JSON-serializable.`,
|
||||
readOnlyHint: false,
|
||||
},
|
||||
schema: {
|
||||
...(cliArgs?.experimentalPageIdRouting ? pageIdSchema : {}),
|
||||
function: zod.string().describe(
|
||||
`A JavaScript function declaration to be executed by the tool in the currently selected page.
|
||||
Example without arguments: \`() => {
|
||||
@@ -58,7 +59,6 @@ Example with arguments: \`(el) => {
|
||||
.describe(
|
||||
'Handle dialogs while execution. "accept", "dismiss", or string for response of window.prompt. Defaults to accept.',
|
||||
),
|
||||
...(cliArgs?.experimentalPageIdRouting ? pageIdSchema : {}),
|
||||
...(cliArgs?.categoryExtensions
|
||||
? {
|
||||
serviceWorkerId: zod
|
||||
|
||||
Reference in New Issue
Block a user