electron-agent-bridge
Preparing search index...
@electron-agent-bridge/engine
EngineFacade
Class EngineFacade
Transport-agnostic operations the runtime exposes over the control channel.
Index
Constructors
constructor
Methods
act
dispatch
State
find
list
Targets
read
Component
read
State
screenshot
snapshot
wait
Constructors
constructor
new
EngineFacade
(
deps
:
EngineDeps
)
:
EngineFacade
Parameters
deps
:
EngineDeps
Returns
EngineFacade
Methods
act
act
(
params
:
{
actions
:
(
|
{
button
?:
"left"
|
"right"
|
"middle"
;
clickCount
?:
number
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
modifiers
?:
(
"Alt"
|
"Control"
|
"Meta"
|
"Shift"
)
[]
;
type
:
"click"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"hover"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"fill"
;
value
:
string
;
}
|
{
fields
:
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
value
:
string
|
boolean
|
string
[]
;
}
[]
;
type
:
"fillForm"
;
}
|
{
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
text
:
string
;
type
:
"type"
;
}
|
{
key
:
string
;
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"press"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"check"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"uncheck"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"select"
;
values
:
string
[]
;
}
|
{
deltaX
?:
number
;
deltaY
?:
number
;
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"scroll"
;
}
|
{
files
:
string
[]
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"upload"
;
}
|
{
from
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
to
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"drag"
;
}
)
[]
;
continueOnError
?:
boolean
;
delta
?:
boolean
;
target
?:
string
;
timeoutMs
?:
number
;
}
,
)
:
Promise
<
Envelope
<
{
cursor
?:
string
;
delta
?:
string
;
observations
:
{
consoleErrors
:
string
[]
;
dialogs
:
string
[]
;
failedRequests
:
string
[]
;
ipc
:
{
channel
:
string
;
kind
:
string
;
seq
:
number
}
[]
;
navigation
?:
{
url
:
string
}
;
toasts
:
string
[]
;
}
;
steps
:
{
error
?:
{
code
:
string
;
hint
?:
string
;
message
:
string
}
;
ok
:
boolean
;
resolved
?:
{
name
:
string
;
ref
:
string
;
role
:
string
}
[]
;
timings
:
{
actionMs
:
number
;
settleMs
:
number
}
;
type
:
string
;
}
[]
;
}
,
>
,
>
Parameters
params
:
{
actions
:
(
|
{
button
?:
"left"
|
"right"
|
"middle"
;
clickCount
?:
number
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
modifiers
?:
(
"Alt"
|
"Control"
|
"Meta"
|
"Shift"
)
[]
;
type
:
"click"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"hover"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"fill"
;
value
:
string
;
}
|
{
fields
:
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
value
:
string
|
boolean
|
string
[]
;
}
[]
;
type
:
"fillForm"
;
}
|
{
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
text
:
string
;
type
:
"type"
;
}
|
{
key
:
string
;
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"press"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"check"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"uncheck"
;
}
|
{
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"select"
;
values
:
string
[]
;
}
|
{
deltaX
?:
number
;
deltaY
?:
number
;
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"scroll"
;
}
|
{
files
:
string
[]
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"upload"
;
}
|
{
from
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
to
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
type
:
"drag"
;
}
)
[]
;
continueOnError
?:
boolean
;
delta
?:
boolean
;
target
?:
string
;
timeoutMs
?:
number
;
}
Returns
Promise
<
Envelope
<
{
cursor
?:
string
;
delta
?:
string
;
observations
:
{
consoleErrors
:
string
[]
;
dialogs
:
string
[]
;
failedRequests
:
string
[]
;
ipc
:
{
channel
:
string
;
kind
:
string
;
seq
:
number
}
[]
;
navigation
?:
{
url
:
string
}
;
toasts
:
string
[]
;
}
;
steps
:
{
error
?:
{
code
:
string
;
hint
?:
string
;
message
:
string
}
;
ok
:
boolean
;
resolved
?:
{
name
:
string
;
ref
:
string
;
role
:
string
}
[]
;
timings
:
{
actionMs
:
number
;
settleMs
:
number
}
;
type
:
string
;
}
[]
;
}
,
>
,
>
dispatch
State
dispatchState
(
params
:
{
action
:
z.ZodRecord
<
z.ZodString
,
z.ZodUnknown
>
;
store
?:
string
;
target
?:
string
;
}
,
)
:
Promise
<
Envelope
<
{
dispatched
:
true
}
>
>
Parameters
params
:
{
action
:
z.ZodRecord
<
z.ZodString
,
z.ZodUnknown
>
;
store
?:
string
;
target
?:
string
;
}
Returns
Promise
<
Envelope
<
{
dispatched
:
true
}
>
>
find
find
(
params
:
{
limit
?:
number
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
target
?:
string
;
}
,
)
:
Promise
<
Envelope
<
{
matches
:
{
line
:
string
;
name
:
string
;
ref
:
string
;
role
:
string
}
[]
;
total
:
number
;
}
,
>
,
>
Parameters
params
:
{
limit
?:
number
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
target
?:
string
;
}
Returns
Promise
<
Envelope
<
{
matches
:
{
line
:
string
;
name
:
string
;
ref
:
string
;
role
:
string
}
[]
;
total
:
number
;
}
,
>
,
>
list
Targets
listTargets
()
:
Envelope
<
{
targets
:
{
attached
:
boolean
;
detachedReason
?:
|
"unknown"
|
"host-debugger"
|
"target-closed"
|
"crashed"
|
"closed"
;
id
:
string
;
kind
:
|
"window"
|
"view"
|
"webview"
|
"other"
|
"worker"
|
"serviceWorker"
|
"offscreen"
;
name
:
string
;
title
:
string
;
url
:
string
;
visible
?:
boolean
;
}
[]
;
}
,
>
Returns
Envelope
<
{
targets
:
{
attached
:
boolean
;
detachedReason
?:
|
"unknown"
|
"host-debugger"
|
"target-closed"
|
"crashed"
|
"closed"
;
id
:
string
;
kind
:
|
"window"
|
"view"
|
"webview"
|
"other"
|
"worker"
|
"serviceWorker"
|
"offscreen"
;
name
:
string
;
title
:
string
;
url
:
string
;
visible
?:
boolean
;
}
[]
;
}
,
>
read
Component
readComponent
(
params
:
{
component
?:
number
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
maxDepth
?:
number
;
path
?:
string
;
target
?:
string
;
}
,
)
:
Promise
<
Envelope
<
{
chain
:
string
[]
;
framework
:
"react"
|
"vue"
;
name
:
string
;
path
?:
string
;
truncated
:
boolean
;
value
:
unknown
;
}
,
>
,
>
Parameters
params
:
{
component
?:
number
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
maxDepth
?:
number
;
path
?:
string
;
target
?:
string
;
}
Returns
Promise
<
Envelope
<
{
chain
:
string
[]
;
framework
:
"react"
|
"vue"
;
name
:
string
;
path
?:
string
;
truncated
:
boolean
;
value
:
unknown
;
}
,
>
,
>
read
State
readState
(
params
:
{
maxDepth
?:
number
;
path
?:
string
;
store
?:
string
;
target
?:
string
;
}
,
)
:
Promise
<
Envelope
<
{
path
?:
string
;
store
?:
string
;
stores
:
{
actions
?:
number
;
kind
:
"generic"
|
"redux"
|
"zustand"
|
"mobx"
;
name
:
string
;
}
[]
;
truncated
:
boolean
;
value
:
unknown
;
}
,
>
,
>
Parameters
params
:
{
maxDepth
?:
number
;
path
?:
string
;
store
?:
string
;
target
?:
string
}
Returns
Promise
<
Envelope
<
{
path
?:
string
;
store
?:
string
;
stores
:
{
actions
?:
number
;
kind
:
"generic"
|
"redux"
|
"zustand"
|
"mobx"
;
name
:
string
;
}
[]
;
truncated
:
boolean
;
value
:
unknown
;
}
,
>
,
>
screenshot
screenshot
(
params
:
{
format
?:
"png"
|
"jpeg"
;
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
quality
?:
number
;
target
?:
string
;
}
,
)
:
Promise
<
Envelope
<
{
base64
?:
string
;
height
:
number
;
mimeType
:
"image/png"
|
"image/jpeg"
;
path
?:
string
;
width
:
number
;
}
,
>
,
>
Parameters
params
:
{
format
?:
"png"
|
"jpeg"
;
locator
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
quality
?:
number
;
target
?:
string
;
}
Returns
Promise
<
Envelope
<
{
base64
?:
string
;
height
:
number
;
mimeType
:
"image/png"
|
"image/jpeg"
;
path
?:
string
;
width
:
number
;
}
,
>
,
>
snapshot
snapshot
(
params
:
{
depth
?:
number
;
fidelity
?:
"dom"
|
"ax"
;
maxLines
?:
number
;
mode
?:
"delta"
|
"full"
;
root
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
since
?:
string
;
target
?:
string
;
}
,
)
:
Promise
<
Envelope
<
{
cursor
?:
string
;
kind
:
"delta"
|
"full"
|
"unchanged"
;
lineCount
:
number
;
target
:
string
;
text
:
string
;
title
:
string
;
url
:
string
;
}
,
>
,
>
Parameters
params
:
{
depth
?:
number
;
fidelity
?:
"dom"
|
"ax"
;
maxLines
?:
number
;
mode
?:
"delta"
|
"full"
;
root
?:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
since
?:
string
;
target
?:
string
;
}
Returns
Promise
<
Envelope
<
{
cursor
?:
string
;
kind
:
"delta"
|
"full"
|
"unchanged"
;
lineCount
:
number
;
target
:
string
;
text
:
string
;
title
:
string
;
url
:
string
;
}
,
>
,
>
wait
wait
(
params
:
{
condition
:
|
{
kind
:
"element"
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
state
?:
"enabled"
|
"visible"
|
"attached"
|
"detached"
|
"hidden"
;
}
|
{
kind
:
"text"
;
present
?:
boolean
;
text
:
string
}
|
{
contains
:
string
;
kind
:
"url"
}
|
{
channel
:
string
;
kind
:
"ipc"
}
|
{
idleMs
?:
number
;
kind
:
"networkIdle"
}
|
{
equals
:
{}
|
null
;
kind
:
"state"
;
path
:
string
;
store
?:
string
}
;
target
?:
string
;
timeoutMs
?:
number
;
}
,
)
:
Promise
<
Envelope
<
{
elapsedMs
:
number
;
observed
?:
string
}
>
>
Parameters
params
:
{
condition
:
|
{
kind
:
"element"
;
locator
:
{
css
?:
string
;
exact
?:
boolean
;
name
?:
string
;
nth
?:
number
;
ref
?:
string
;
role
?:
string
;
text
?:
string
;
}
;
state
?:
"enabled"
|
"visible"
|
"attached"
|
"detached"
|
"hidden"
;
}
|
{
kind
:
"text"
;
present
?:
boolean
;
text
:
string
}
|
{
contains
:
string
;
kind
:
"url"
}
|
{
channel
:
string
;
kind
:
"ipc"
}
|
{
idleMs
?:
number
;
kind
:
"networkIdle"
}
|
{
equals
:
{}
|
null
;
kind
:
"state"
;
path
:
string
;
store
?:
string
}
;
target
?:
string
;
timeoutMs
?:
number
;
}
Returns
Promise
<
Envelope
<
{
elapsedMs
:
number
;
observed
?:
string
}
>
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
act
dispatch
State
find
list
Targets
read
Component
read
State
screenshot
snapshot
wait
electron-agent-bridge
Loading...
Transport-agnostic operations the runtime exposes over the control channel.