add screencast (#67)
* docs * updates * Fix: The handleCopy function fails to handle errors from navigator.clipboard.writeText(), causing unhandled exceptions and misleading UI feedback when clipboard operations fail. Co-authored-by: ctate <chris@ctate.dev> * Fix: The benchmark file uses emojis (📊, 🚀, 🔨, 📈, 📋, ✅, ⏱️, ⚠) in console output, violating repository guidelines that forbid emojis in code and output. Co-authored-by: ctate <chris@ctate.dev> * Remove benchmark/run.ts from PR * screencast * update docs * address comments --------- Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Vercel <vercel[bot]@users.noreply.github.com>
parent
673e2e266e
commit
2dc093cd62
+63
-1
@@ -459,6 +459,49 @@ export interface ResponseBodyCommand extends BaseCommand {
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
// Screencast commands for streaming browser viewport
|
||||
export interface ScreencastStartCommand extends BaseCommand {
|
||||
action: 'screencast_start';
|
||||
format?: 'jpeg' | 'png';
|
||||
quality?: number; // 0-100, jpeg only
|
||||
maxWidth?: number;
|
||||
maxHeight?: number;
|
||||
everyNthFrame?: number;
|
||||
}
|
||||
|
||||
export interface ScreencastStopCommand extends BaseCommand {
|
||||
action: 'screencast_stop';
|
||||
}
|
||||
|
||||
// Input injection commands for pair browsing
|
||||
export interface InputMouseCommand extends BaseCommand {
|
||||
action: 'input_mouse';
|
||||
type: 'mousePressed' | 'mouseReleased' | 'mouseMoved' | 'mouseWheel';
|
||||
x: number;
|
||||
y: number;
|
||||
button?: 'left' | 'right' | 'middle' | 'none';
|
||||
clickCount?: number;
|
||||
deltaX?: number;
|
||||
deltaY?: number;
|
||||
modifiers?: number;
|
||||
}
|
||||
|
||||
export interface InputKeyboardCommand extends BaseCommand {
|
||||
action: 'input_keyboard';
|
||||
type: 'keyDown' | 'keyUp' | 'char';
|
||||
key?: string;
|
||||
code?: string;
|
||||
text?: string;
|
||||
modifiers?: number;
|
||||
}
|
||||
|
||||
export interface InputTouchCommand extends BaseCommand {
|
||||
action: 'input_touch';
|
||||
type: 'touchStart' | 'touchEnd' | 'touchMove' | 'touchCancel';
|
||||
touchPoints: Array<{ x: number; y: number; id?: number }>;
|
||||
modifiers?: number;
|
||||
}
|
||||
|
||||
// Video recording
|
||||
export interface VideoStartCommand extends BaseCommand {
|
||||
action: 'video_start';
|
||||
@@ -842,7 +885,12 @@ export type Command =
|
||||
| InsertTextCommand
|
||||
| MultiSelectCommand
|
||||
| WaitForDownloadCommand
|
||||
| ResponseBodyCommand;
|
||||
| ResponseBodyCommand
|
||||
| ScreencastStartCommand
|
||||
| ScreencastStopCommand
|
||||
| InputMouseCommand
|
||||
| InputKeyboardCommand
|
||||
| InputTouchCommand;
|
||||
|
||||
// Response types
|
||||
export interface SuccessResponse<T = unknown> {
|
||||
@@ -910,6 +958,20 @@ export interface TabCloseData {
|
||||
remaining: number;
|
||||
}
|
||||
|
||||
export interface ScreencastStartData {
|
||||
started: boolean;
|
||||
format: string;
|
||||
quality: number;
|
||||
}
|
||||
|
||||
export interface ScreencastStopData {
|
||||
stopped: boolean;
|
||||
}
|
||||
|
||||
export interface InputEventData {
|
||||
injected: boolean;
|
||||
}
|
||||
|
||||
// Browser state
|
||||
export interface BrowserState {
|
||||
browser: Browser | null;
|
||||
|
||||
Reference in New Issue
Block a user