Fix CLI/protocol mismatches for select, frame main, and headers (#45)

* fix: align CLI command payloads with protocol

* fix(cli): support multi-value select in CLI
This commit is contained in:
Nicenonecb
2026-01-17 20:25:19 -06:00
committed by GitHub
parent 4112234371
commit 28740acecf
4 changed files with 57 additions and 8 deletions
+16
View File
@@ -15,6 +15,22 @@ describe('parseCommand', () => {
}
});
it('should parse navigate with headers', () => {
const result = parseCommand(
cmd({
id: '1',
action: 'navigate',
url: 'https://example.com',
headers: { Authorization: 'Bearer token' },
})
);
expect(result.success).toBe(true);
if (result.success) {
expect(result.command.action).toBe('navigate');
expect(result.command.headers).toEqual({ Authorization: 'Bearer token' });
}
});
it('should reject navigate without url', () => {
const result = parseCommand(cmd({ id: '1', action: 'navigate' }));
expect(result.success).toBe(false);
+1
View File
@@ -36,6 +36,7 @@ const navigateSchema = baseCommandSchema.extend({
action: z.literal('navigate'),
url: z.string().min(1),
waitUntil: z.enum(['load', 'domcontentloaded', 'networkidle']).optional(),
headers: z.record(z.string()).optional(),
});
const clickSchema = baseCommandSchema.extend({