LavaUI docs

struct AgentHost

Swift

struct AgentHost

Callbacks the host app provides so the server stays UI-framework-agnostic.

Sources/LavaUI/AgentServer.swift:62

Constructors

init(framebufferSize: @escaping () -> (w: Float, h: Float), settle: @escaping () -> Void, layoutTreeJSON: @escaping (_ maxDepth: Int) -> String, hitLabel: @escaping (_ x: Float, _ y: Float) -> String?, resolveFrame: @escaping (_ sid: String?, _ label: String?, _ id: UInt64?, _ query: String?) -> (label: String, sid: String, x: Float, y: Float, w: Float, h: Float)?, find: @escaping (_ query: String, _ limit: Int) -> [[String : Any]], injectMove: @escaping (_ x: Float, _ y: Float) -> Void, injectClick: @escaping (_ x: Float, _ y: Float, _ button: Int32) -> Void, injectPointerButton: @escaping (_ x: Float, _ y: Float, _ button: Int32, _ pressed: Bool) -> Void, injectScroll: @escaping (_ dx: Float, _ dy: Float) -> Void, injectKey: @escaping (_ key: Int32, _ action: Int32, _ mods: Int32) -> Void, injectText: @escaping (_ text: String) -> Void, screenshotBase64: @escaping (_ x: Int32, _ y: Int32, _ w: Int32, _ h: Int32, _ maxSide: Int32) -> (b64: String, w: Int32, h: Int32)?)

Not documented.

Sources/LavaUI/AgentServer.swift:87

Properties

var find: (_ query: String, _ limit: Int) -> [[String : Any]]

Not documented.

Sources/LavaUI/AgentServer.swift:72

var framebufferSize: () -> (w: Float, h: Float)

Not documented.

Sources/LavaUI/AgentServer.swift:63

var hitLabel: (_ x: Float, _ y: Float) -> String?

Not documented.

Sources/LavaUI/AgentServer.swift:67

var injectClick: (_ x: Float, _ y: Float, _ button: Int32) -> Void

Not documented.

Sources/LavaUI/AgentServer.swift:74

var injectKey: (_ key: Int32, _ action: Int32, _ mods: Int32) -> Void

Not documented.

Sources/LavaUI/AgentServer.swift:79

var injectMove: (_ x: Float, _ y: Float) -> Void

Not documented.

Sources/LavaUI/AgentServer.swift:73

var injectPointerButton: (_ x: Float, _ y: Float, _ button: Int32, _ pressed: Bool) -> Void

Not documented.

Sources/LavaUI/AgentServer.swift:75

var injectScroll: (_ dx: Float, _ dy: Float) -> Void

Not documented.

Sources/LavaUI/AgentServer.swift:78

var injectText: (_ text: String) -> Void

Not documented.

Sources/LavaUI/AgentServer.swift:80

var layoutTreeJSON: (_ maxDepth: Int) -> String

Not documented.

Sources/LavaUI/AgentServer.swift:66

var resolveFrame: (_ sid: String?, _ label: String?, _ id: UInt64?, _ query: String?) -> (label: String, sid: String, x: Float, y: Float, w: Float, h: Float)?

Resolve a frame by sid/agentId, label, process id, or first find hit.

Sources/LavaUI/AgentServer.swift:69

var screenshotBase64: (_ x: Int32, _ y: Int32, _ w: Int32, _ h: Int32, _ maxSide: Int32) -> (b64: String, w: Int32, h: Int32)?

Capture pixels only (caller settles when needed). Returns base64 PNG plus encoded size (after optional downsample).

Sources/LavaUI/AgentServer.swift:83

var settle: () -> Void

Force layout+present; should also drain any injected input first.

Sources/LavaUI/AgentServer.swift:65