Skip to content

Commit 60be3e6

Browse files
samiyacSamiya Caur
andauthored
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>
1 parent 0089ebd commit 60be3e6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ToolHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class ToolHandler {
163163
tool.pageScoped &&
164164
serverArgs.experimentalPageIdRouting &&
165165
!serverArgs.slim
166-
? {...tool.schema, ...pageIdSchema}
166+
? {...pageIdSchema, ...tool.schema}
167167
: tool.schema;
168168
this.registeredInputSchema = zod.object(this.inputSchema).passthrough();
169169
}

src/tools/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ so returned values have to be JSON-serializable.`,
2424
readOnlyHint: false,
2525
},
2626
schema: {
27+
...(cliArgs?.experimentalPageIdRouting ? pageIdSchema : {}),
2728
function: zod.string().describe(
2829
`A JavaScript function declaration to be executed by the tool in the currently selected page.
2930
Example without arguments: \`() => {
@@ -58,7 +59,6 @@ Example with arguments: \`(el) => {
5859
.describe(
5960
'Handle dialogs while execution. "accept", "dismiss", or string for response of window.prompt. Defaults to accept.',
6061
),
61-
...(cliArgs?.experimentalPageIdRouting ? pageIdSchema : {}),
6262
...(cliArgs?.categoryExtensions
6363
? {
6464
serviceWorkerId: zod

0 commit comments

Comments
 (0)