* diff

* fixes

* fixes

* fixes

* fixes

* fixes

* better docs
This commit is contained in:
Chris Tate
2026-02-19 23:51:09 -06:00
committed by GitHub
parent 9732031087
commit d5a667ea2d
21 changed files with 2446 additions and 88 deletions
+33
View File
@@ -740,6 +740,36 @@ const deviceListSchema = baseCommandSchema.extend({
action: z.literal('device_list'),
});
// Diff schemas
const diffSnapshotSchema = baseCommandSchema.extend({
action: z.literal('diff_snapshot'),
baseline: z.string().optional(),
selector: z.string().optional(),
compact: z.boolean().optional(),
maxDepth: z.number().nonnegative().optional(),
});
const diffScreenshotSchema = baseCommandSchema.extend({
action: z.literal('diff_screenshot'),
baseline: z.string().min(1),
output: z.string().optional(),
threshold: z.number().min(0).max(1).optional(),
selector: z.string().min(1).optional(),
fullPage: z.boolean().optional(),
});
const diffUrlSchema = baseCommandSchema.extend({
action: z.literal('diff_url'),
url1: z.string().min(1),
url2: z.string().min(1),
screenshot: z.boolean().optional(),
fullPage: z.boolean().optional(),
waitUntil: z.enum(['load', 'domcontentloaded', 'networkidle']).optional(),
selector: z.string().optional(),
compact: z.boolean().optional(),
maxDepth: z.number().nonnegative().optional(),
});
const pressSchema = baseCommandSchema.extend({
action: z.literal('press'),
key: z.string().min(1),
@@ -972,6 +1002,9 @@ const commandSchema = z.discriminatedUnion('action', [
inputTouchSchema,
swipeSchema,
deviceListSchema,
diffSnapshotSchema,
diffScreenshotSchema,
diffUrlSchema,
]);
// Parse result type