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:
Samiya Caur
2026-05-27 09:23:41 +02:00
committed by GitHub
parent 0089ebdd37
commit 60be3e6bc1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -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