mirror of
https://github.com/stablyai/orca.git
synced 2026-11-14 01:47:24 +00:00
The pane's keyboard only sent serve-sim HID frames over the iOS WebSocket. Android sessions have no serve-sim socket, so every key was dropped and every paste failed with "device is not ready". Android panes now send typed characters, paste and editing keys over a new emulator:scrcpyKeyboard IPC beside emulator:scrcpyTouch, keyed by the streamed serial. Main writes them straight to the live scrcpy control socket (text injection, and keycodes with SHIFT_LEFT held for Shift), so keys keep their order with touches. iOS keeps the HID path.
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
export type EmulatorApi = {
|
|
onPaneFocus: (callback: (data: { worktreeId: string }) => void) => () => void
|
|
onAutoAttach: (
|
|
callback: (data: {
|
|
worktreeId: string
|
|
info: { deviceUdid: string; streamUrl: string; wsUrl: string; axUrl?: string }
|
|
}) => void
|
|
) => () => void
|
|
startFrameStream: (args: { streamUrl: string; streamKey?: string }) => Promise<{
|
|
streamId: string
|
|
}>
|
|
stopFrameStream: (args: { streamId: string }) => Promise<void>
|
|
onFrameStreamFrame: (
|
|
callback: (data: { streamId: string; bytes: ArrayBuffer }) => void
|
|
) => () => void
|
|
onFrameStreamError: (
|
|
callback: (data: { streamId: string; message: string }) => void
|
|
) => () => void
|
|
startVideoStream: (args: { deviceId: string; streamId: string }) => Promise<{ streamId: string }>
|
|
stopVideoStream: (args: { streamId: string }) => Promise<void>
|
|
onVideoStreamMeta: (
|
|
callback: (data: {
|
|
streamId: string
|
|
deviceId: string
|
|
meta: { codecId: string; width: number; height: number }
|
|
}) => void
|
|
) => () => void
|
|
sendScrcpyTouch: (touch: {
|
|
deviceId: string
|
|
type: 'begin' | 'move' | 'end'
|
|
x: number
|
|
y: number
|
|
}) => void
|
|
/** Resolves false when the device has no live scrcpy control socket. */
|
|
sendScrcpyKeyboard: (
|
|
input: { deviceId: string; text: string } | { deviceId: string; key: string; shift: boolean }
|
|
) => Promise<boolean>
|
|
onVideoStreamFrame: (
|
|
callback: (data: {
|
|
streamId: string
|
|
deviceId: string
|
|
config: boolean
|
|
keyFrame: boolean
|
|
bytes: ArrayBuffer
|
|
}) => void
|
|
) => () => void
|
|
}
|