( interactor: Interactor, positionals: string[], )
| 57 | }; |
| 58 | |
| 59 | export async function handleLongPressCommand( |
| 60 | interactor: Interactor, |
| 61 | positionals: string[], |
| 62 | ): Promise<Record<string, unknown>> { |
| 63 | const { x, y } = readPoint(positionals, 'longpress requires x y [durationMs]', { |
| 64 | hint: 'Direct platform longpress requires coordinates. In an open daemon session, use agent-device longpress @ref|selector [durationMs]; otherwise run snapshot -i, use the target rect center as x y, then retry longpress x y durationMs.', |
| 65 | }); |
| 66 | const durationMs = positionals[2] ? Number(positionals[2]) : undefined; |
| 67 | await interactor.longPress(x, y, durationMs); |
| 68 | return { x, y, durationMs, ...successText(`Long pressed (${x}, ${y})`) }; |
| 69 | } |
| 70 | |
| 71 | export async function handleFocusCommand( |
| 72 | interactor: Interactor, |
no test coverage detected