stelo 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +184 -0
- package/README.md +853 -0
- package/dist/accessibility.d.ts +227 -0
- package/dist/accessibility.d.ts.map +1 -0
- package/dist/accessibility.js +602 -0
- package/dist/accessibility.js.map +1 -0
- package/dist/agent.d.ts +870 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +1107 -0
- package/dist/agent.js.map +1 -0
- package/dist/audio-stream.d.ts +114 -0
- package/dist/audio-stream.d.ts.map +1 -0
- package/dist/audio-stream.js +167 -0
- package/dist/audio-stream.js.map +1 -0
- package/dist/clipboard.d.ts +99 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +352 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/config.d.ts +183 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +477 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +213 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +387 -0
- package/dist/context.js.map +1 -0
- package/dist/cortex.d.ts +548 -0
- package/dist/cortex.d.ts.map +1 -0
- package/dist/cortex.js +1479 -0
- package/dist/cortex.js.map +1 -0
- package/dist/errors.d.ts +133 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +278 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +227 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +429 -0
- package/dist/events.js.map +1 -0
- package/dist/executor.d.ts +212 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +545 -0
- package/dist/executor.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +167 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +159 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +533 -0
- package/dist/integration.js.map +1 -0
- package/dist/keyboard.d.ts +276 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +404 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/logger.d.ts +198 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +516 -0
- package/dist/logger.js.map +1 -0
- package/dist/middleware.d.ts +183 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +493 -0
- package/dist/middleware.js.map +1 -0
- package/dist/monitor.d.ts +136 -0
- package/dist/monitor.d.ts.map +1 -0
- package/dist/monitor.js +341 -0
- package/dist/monitor.js.map +1 -0
- package/dist/mouse.d.ts +290 -0
- package/dist/mouse.d.ts.map +1 -0
- package/dist/mouse.js +466 -0
- package/dist/mouse.js.map +1 -0
- package/dist/plugin.d.ts +157 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +409 -0
- package/dist/plugin.js.map +1 -0
- package/dist/process.d.ts +106 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +326 -0
- package/dist/process.js.map +1 -0
- package/dist/recorder.d.ts +100 -0
- package/dist/recorder.d.ts.map +1 -0
- package/dist/recorder.js +258 -0
- package/dist/recorder.js.map +1 -0
- package/dist/safety.d.ts +59 -0
- package/dist/safety.d.ts.map +1 -0
- package/dist/safety.js +98 -0
- package/dist/safety.js.map +1 -0
- package/dist/scheduler.d.ts +152 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +615 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/screen.d.ts +96 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +154 -0
- package/dist/screen.js.map +1 -0
- package/dist/session.d.ts +209 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +479 -0
- package/dist/session.js.map +1 -0
- package/dist/stream.d.ts +168 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +298 -0
- package/dist/stream.js.map +1 -0
- package/dist/telemetry.d.ts +223 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +433 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/types.d.ts +165 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/bezier.d.ts +51 -0
- package/dist/utils/bezier.d.ts.map +1 -0
- package/dist/utils/bezier.js +117 -0
- package/dist/utils/bezier.js.map +1 -0
- package/dist/utils/helpers.d.ts +90 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +143 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/validation.d.ts +254 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +478 -0
- package/dist/validation.js.map +1 -0
- package/dist/vision.d.ts +719 -0
- package/dist/vision.d.ts.map +1 -0
- package/dist/vision.js +1197 -0
- package/dist/vision.js.map +1 -0
- package/dist/window.d.ts +80 -0
- package/dist/window.d.ts.map +1 -0
- package/dist/window.js +170 -0
- package/dist/window.js.map +1 -0
- package/dist/workflow.d.ts +224 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +578 -0
- package/dist/workflow.js.map +1 -0
- package/index.d.ts +840 -0
- package/index.js +495 -0
- package/package.json +91 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,840 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Force the process into Per-Monitor DPI Aware V2 mode.
|
|
8
|
+
* Call this ONCE at startup, before any screen/mouse operations.
|
|
9
|
+
* After this call, ALL coordinates and captures use the true native
|
|
10
|
+
* screen resolution (e.g., 2560×1440) — no DPI virtualization.
|
|
11
|
+
*
|
|
12
|
+
* Safe to call multiple times (idempotent). Also called automatically
|
|
13
|
+
* by screen and mouse functions as a safety net.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ensureDpiAwareness(): void
|
|
16
|
+
export interface NativeMousePosition {
|
|
17
|
+
x: number
|
|
18
|
+
y: number
|
|
19
|
+
}
|
|
20
|
+
export interface NativeClickObservation {
|
|
21
|
+
x: number
|
|
22
|
+
y: number
|
|
23
|
+
didChange: boolean
|
|
24
|
+
changeScore: number
|
|
25
|
+
beforeHash: string
|
|
26
|
+
afterHash: string
|
|
27
|
+
}
|
|
28
|
+
export interface NativeScreenSize {
|
|
29
|
+
width: number
|
|
30
|
+
height: number
|
|
31
|
+
}
|
|
32
|
+
export interface NativePixelColor {
|
|
33
|
+
r: number
|
|
34
|
+
g: number
|
|
35
|
+
b: number
|
|
36
|
+
hex: string
|
|
37
|
+
}
|
|
38
|
+
export interface NativeDisplayInfo {
|
|
39
|
+
id: number
|
|
40
|
+
x: number
|
|
41
|
+
y: number
|
|
42
|
+
width: number
|
|
43
|
+
height: number
|
|
44
|
+
isPrimary: boolean
|
|
45
|
+
scaleFactor: number
|
|
46
|
+
name: string
|
|
47
|
+
}
|
|
48
|
+
export interface NativeWindowInfo {
|
|
49
|
+
/** Window handle (as float64 since JS doesn't support u64 natively) */
|
|
50
|
+
id: number
|
|
51
|
+
title: string
|
|
52
|
+
x: number
|
|
53
|
+
y: number
|
|
54
|
+
width: number
|
|
55
|
+
height: number
|
|
56
|
+
isVisible: boolean
|
|
57
|
+
isMinimized: boolean
|
|
58
|
+
processId: number
|
|
59
|
+
processName: string
|
|
60
|
+
processPath: string
|
|
61
|
+
}
|
|
62
|
+
export interface NativeScreenCapture {
|
|
63
|
+
data: Buffer
|
|
64
|
+
width: number
|
|
65
|
+
height: number
|
|
66
|
+
}
|
|
67
|
+
/** Move mouse cursor instantly to absolute screen coordinates. */
|
|
68
|
+
export declare function mouseMove(x: number, y: number): void
|
|
69
|
+
/** Get current mouse cursor position. */
|
|
70
|
+
export declare function mouseGetPosition(): NativeMousePosition
|
|
71
|
+
/** Move mouse smoothly to target with configurable curve and duration. */
|
|
72
|
+
export declare function mouseMoveSmooth(x: number, y: number, durationMs?: number | undefined | null, curve?: string | undefined | null, stepsPerSecond?: number | undefined | null): void
|
|
73
|
+
/** Move mouse with humanized, natural-feeling motion. */
|
|
74
|
+
export declare function mouseMoveHumanized(x: number, y: number, durationMs?: number | undefined | null, jitter?: number | undefined | null, overshoot?: boolean | undefined | null): void
|
|
75
|
+
/** Click a mouse button. button: "left" | "right" | "middle" */
|
|
76
|
+
export declare function mouseClick(button?: string | undefined | null): void
|
|
77
|
+
/** Double-click a mouse button. */
|
|
78
|
+
export declare function mouseDoubleClick(button?: string | undefined | null): void
|
|
79
|
+
/** Triple-click a mouse button (select line/paragraph). */
|
|
80
|
+
export declare function mouseTripleClick(button?: string | undefined | null): void
|
|
81
|
+
/** Press (hold down) a mouse button. */
|
|
82
|
+
export declare function mouseDown(button?: string | undefined | null): void
|
|
83
|
+
/** Release a mouse button. */
|
|
84
|
+
export declare function mouseUp(button?: string | undefined | null): void
|
|
85
|
+
/** Scroll the mouse wheel. direction: "up" | "down" | "left" | "right" */
|
|
86
|
+
export declare function mouseScroll(amount: number, direction?: string | undefined | null): void
|
|
87
|
+
/** Scroll the mouse wheel smoothly over time. direction: "up" | "down" | "left" | "right" */
|
|
88
|
+
export declare function mouseScrollSmooth(amount: number, direction?: string | undefined | null, durationMs?: number | undefined | null): void
|
|
89
|
+
/** Drag from one point to another. */
|
|
90
|
+
export declare function mouseDrag(fromX: number, fromY: number, toX: number, toY: number, button?: string | undefined | null, durationMs?: number | undefined | null): void
|
|
91
|
+
/** Click at a specific position, optionally restoring the original position. */
|
|
92
|
+
export declare function mouseClickAt(x: number, y: number, button?: string | undefined | null, restorePosition?: boolean | undefined | null): void
|
|
93
|
+
/**
|
|
94
|
+
* Click at a position and immediately capture before/after visual state in a local region.
|
|
95
|
+
* This is optimized for fast action feedback loops so agents can avoid blind click chains.
|
|
96
|
+
*/
|
|
97
|
+
export declare function mouseClickObserved(x: number, y: number, button?: string | undefined | null, settleMs?: number | undefined | null, restorePosition?: boolean | undefined | null): NativeClickObservation
|
|
98
|
+
/** Type a text string character by character. */
|
|
99
|
+
export declare function keyboardType(text: string, delayMs?: number | undefined | null): void
|
|
100
|
+
/** Type text with randomized human-like delays. */
|
|
101
|
+
export declare function keyboardTypeHumanized(text: string, minDelayMs?: number | undefined | null, maxDelayMs?: number | undefined | null): void
|
|
102
|
+
/** Press and release a single key. */
|
|
103
|
+
export declare function keyboardPress(key: string): void
|
|
104
|
+
/** Hold a key down. */
|
|
105
|
+
export declare function keyboardDown(key: string): void
|
|
106
|
+
/** Release a key. */
|
|
107
|
+
export declare function keyboardUp(key: string): void
|
|
108
|
+
/** Execute a keyboard shortcut (e.g., ["ctrl", "c"] for copy). */
|
|
109
|
+
export declare function keyboardHotkey(keys: Array<string>): void
|
|
110
|
+
/** Press a key multiple times. */
|
|
111
|
+
export declare function keyboardTap(key: string, count?: number | undefined | null, delayMs?: number | undefined | null): void
|
|
112
|
+
/** Check if a key is currently held down. */
|
|
113
|
+
export declare function keyboardIsPressed(key: string): boolean
|
|
114
|
+
/** Get a list of all recognized key names. */
|
|
115
|
+
export declare function keyboardAllKeys(): Array<string>
|
|
116
|
+
/**
|
|
117
|
+
* Type an entire string in a single atomic operation (10-100x faster).
|
|
118
|
+
* All characters are batched in one SendInput call — no inter-character delay.
|
|
119
|
+
*/
|
|
120
|
+
export declare function keyboardTypeBatch(text: string): void
|
|
121
|
+
/** Execute a hotkey from a string like "ctrl+shift+s". */
|
|
122
|
+
export declare function keyboardHotkeyString(combo: string): void
|
|
123
|
+
/**
|
|
124
|
+
* Execute a sequence of keyboard actions separated by '|'.
|
|
125
|
+
* Each action can be: a hotkey ("ctrl+c"), a key ("enter"), or text ("type:hello").
|
|
126
|
+
* Example: "ctrl+a | ctrl+c | alt+tab | ctrl+v"
|
|
127
|
+
*/
|
|
128
|
+
export declare function keyboardSequence(sequence: string, delayBetweenMs?: number | undefined | null): void
|
|
129
|
+
/**
|
|
130
|
+
* Type text while holding modifier keys.
|
|
131
|
+
* Example: typeWithModifiers("hello", ["shift"]) → types "HELLO"
|
|
132
|
+
*/
|
|
133
|
+
export declare function keyboardTypeWithModifiers(text: string, modifiers: Array<string>): void
|
|
134
|
+
/** Check if a toggle key (CapsLock, NumLock, ScrollLock) is currently ON. */
|
|
135
|
+
export declare function keyboardIsToggled(key: string): boolean
|
|
136
|
+
/** Toggle a lock key (CapsLock, NumLock, ScrollLock). */
|
|
137
|
+
export declare function keyboardToggleKey(key: string): void
|
|
138
|
+
/**
|
|
139
|
+
* Check if multiple keys are all currently pressed.
|
|
140
|
+
* Returns an array of booleans matching the input keys.
|
|
141
|
+
*/
|
|
142
|
+
export declare function keyboardArePressed(keys: Array<string>): Array<boolean>
|
|
143
|
+
/**
|
|
144
|
+
* Wait until a specific key is pressed (blocking).
|
|
145
|
+
* Returns true if pressed, false if timed out.
|
|
146
|
+
*/
|
|
147
|
+
export declare function keyboardWaitForKey(key: string, timeoutMs?: number | undefined | null): boolean
|
|
148
|
+
/**
|
|
149
|
+
* Wait until a specific key is released (blocking).
|
|
150
|
+
* Returns true if released, false if timed out.
|
|
151
|
+
*/
|
|
152
|
+
export declare function keyboardWaitForKeyRelease(key: string, timeoutMs?: number | undefined | null): boolean
|
|
153
|
+
/**
|
|
154
|
+
* Get primary screen dimensions.
|
|
155
|
+
* Returns the TRUE native resolution (DPI awareness is forced automatically).
|
|
156
|
+
*/
|
|
157
|
+
export declare function screenSize(): NativeScreenSize
|
|
158
|
+
/** Get the color of a pixel at screen coordinates. */
|
|
159
|
+
export declare function screenPixelColor(x: number, y: number): NativePixelColor
|
|
160
|
+
/**
|
|
161
|
+
* Capture a screen region as raw RGBA pixel data.
|
|
162
|
+
* Captures at TRUE native resolution (DPI awareness is forced automatically).
|
|
163
|
+
*/
|
|
164
|
+
export declare function screenCapture(x?: number | undefined | null, y?: number | undefined | null, width?: number | undefined | null, height?: number | undefined | null): NativeScreenCapture
|
|
165
|
+
/**
|
|
166
|
+
* Capture a screen region as raw BGRA pixel data (faster, no color conversion).
|
|
167
|
+
* BGRA is the native capture format — skipping the BGRA→RGBA conversion
|
|
168
|
+
* saves CPU time, ideal for real-time pipelines (vision models, streaming).
|
|
169
|
+
* Captures at TRUE native resolution (DPI awareness is forced automatically).
|
|
170
|
+
*/
|
|
171
|
+
export declare function screenCaptureBgra(x?: number | undefined | null, y?: number | undefined | null, width?: number | undefined | null, height?: number | undefined | null): NativeScreenCapture
|
|
172
|
+
/**
|
|
173
|
+
* Get info about all connected displays.
|
|
174
|
+
* Returns TRUE native resolution and positions (DPI awareness is forced automatically).
|
|
175
|
+
*/
|
|
176
|
+
export declare function screenDisplays(): Array<NativeDisplayInfo>
|
|
177
|
+
/** Search for a pixel color in a screen region. */
|
|
178
|
+
export declare function screenFindColor(r: number, g: number, b: number, tolerance?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeMousePosition | null
|
|
179
|
+
/** Get the currently active/focused window. */
|
|
180
|
+
export declare function windowGetActive(): NativeWindowInfo
|
|
181
|
+
/** Get all visible windows. */
|
|
182
|
+
export declare function windowGetAll(): Array<NativeWindowInfo>
|
|
183
|
+
/** Find windows by title substring. */
|
|
184
|
+
export declare function windowFind(title: string): Array<NativeWindowInfo>
|
|
185
|
+
/** Focus a window by ID. */
|
|
186
|
+
export declare function windowFocus(id: number): void
|
|
187
|
+
/** Focus a window by title substring. */
|
|
188
|
+
export declare function windowFocusByTitle(title: string): void
|
|
189
|
+
/** Resize a window. */
|
|
190
|
+
export declare function windowResize(id: number, width: number, height: number): void
|
|
191
|
+
/** Move a window to coordinates. */
|
|
192
|
+
export declare function windowMove(id: number, x: number, y: number): void
|
|
193
|
+
/** Minimize a window. */
|
|
194
|
+
export declare function windowMinimize(id: number): void
|
|
195
|
+
/** Maximize a window. */
|
|
196
|
+
export declare function windowMaximize(id: number): void
|
|
197
|
+
/** Restore a window from minimized/maximized. */
|
|
198
|
+
export declare function windowRestore(id: number): void
|
|
199
|
+
/** Close a window. */
|
|
200
|
+
export declare function windowClose(id: number): void
|
|
201
|
+
/** Set window bounds by title. */
|
|
202
|
+
export declare function windowSetBounds(title: string, x: number, y: number, width: number, height: number): void
|
|
203
|
+
/** Enable failsafe — moving mouse to screen corner triggers emergency stop. */
|
|
204
|
+
export declare function safetyEnableFailsafe(thresholdPx?: number | undefined | null): void
|
|
205
|
+
/** Disable failsafe. */
|
|
206
|
+
export declare function safetyDisableFailsafe(): void
|
|
207
|
+
/** Check if failsafe is enabled. */
|
|
208
|
+
export declare function safetyIsFailsafeEnabled(): boolean
|
|
209
|
+
/** Enable rate limiting (max actions per second). */
|
|
210
|
+
export declare function safetySetRateLimit(maxPerSecond: number): void
|
|
211
|
+
/** Disable rate limiting. */
|
|
212
|
+
export declare function safetyDisableRateLimit(): void
|
|
213
|
+
/** Trigger emergency stop (all operations will fail until reset). */
|
|
214
|
+
export declare function safetyEmergencyStop(): void
|
|
215
|
+
/** Check if emergency stop is active. */
|
|
216
|
+
export declare function safetyIsStopped(): boolean
|
|
217
|
+
/** Reset emergency stop and allow operations to resume. */
|
|
218
|
+
export declare function safetyReset(): void
|
|
219
|
+
export interface NativeStreamConfig {
|
|
220
|
+
/** Target FPS (1–120, default: 30) */
|
|
221
|
+
fps?: number
|
|
222
|
+
/** Capture region (None = full screen) */
|
|
223
|
+
regionX?: number
|
|
224
|
+
regionY?: number
|
|
225
|
+
regionWidth?: number
|
|
226
|
+
regionHeight?: number
|
|
227
|
+
/** Scale factor (0.1–1.0, default: 1.0). Use 0.5 for half res, etc. */
|
|
228
|
+
scale?: number
|
|
229
|
+
/** Max frames to buffer (default: 3) */
|
|
230
|
+
bufferSize?: number
|
|
231
|
+
/** If true, return raw BGRA data (faster, no color conversion) */
|
|
232
|
+
rawBgra?: boolean
|
|
233
|
+
}
|
|
234
|
+
export interface NativeStreamFrame {
|
|
235
|
+
/** Raw RGBA pixel data */
|
|
236
|
+
data: Buffer
|
|
237
|
+
/** Frame width */
|
|
238
|
+
width: number
|
|
239
|
+
/** Frame height */
|
|
240
|
+
height: number
|
|
241
|
+
/** Monotonic frame sequence number */
|
|
242
|
+
sequence: number
|
|
243
|
+
/** Milliseconds since stream started */
|
|
244
|
+
timestampMs: number
|
|
245
|
+
/** Current measured FPS */
|
|
246
|
+
measuredFps: number
|
|
247
|
+
/** Cursor X at time of capture */
|
|
248
|
+
cursorX: number
|
|
249
|
+
/** Cursor Y at time of capture */
|
|
250
|
+
cursorY: number
|
|
251
|
+
}
|
|
252
|
+
export interface NativeStreamStats {
|
|
253
|
+
isRunning: boolean
|
|
254
|
+
totalFrames: number
|
|
255
|
+
droppedFrames: number
|
|
256
|
+
currentFps: number
|
|
257
|
+
targetFps: number
|
|
258
|
+
uptimeMs: number
|
|
259
|
+
}
|
|
260
|
+
/** Start a continuous real-time screen stream. */
|
|
261
|
+
export declare function streamStart(config?: NativeStreamConfig | undefined | null): void
|
|
262
|
+
/** Stop the screen stream. */
|
|
263
|
+
export declare function streamStop(): void
|
|
264
|
+
/** Check if a stream is currently running. */
|
|
265
|
+
export declare function streamIsRunning(): boolean
|
|
266
|
+
/** Get the latest captured frame from the stream. */
|
|
267
|
+
export declare function streamGetLatestFrame(): NativeStreamFrame | null
|
|
268
|
+
/** Get the most recent N frames from the stream buffer. */
|
|
269
|
+
export declare function streamGetRecentFrames(count?: number | undefined | null): Array<NativeStreamFrame>
|
|
270
|
+
/** Wait for the next new frame (blocks until available or timeout). */
|
|
271
|
+
export declare function streamWaitForFrame(timeoutMs?: number | undefined | null): NativeStreamFrame | null
|
|
272
|
+
/** Get stream performance statistics. */
|
|
273
|
+
export declare function streamGetStats(): NativeStreamStats
|
|
274
|
+
export interface NativeAudioStreamConfig {
|
|
275
|
+
/** Max audio chunks to buffer (default: 30 ≈ 300ms) */
|
|
276
|
+
bufferSize?: number
|
|
277
|
+
}
|
|
278
|
+
export interface NativeAudioFormat {
|
|
279
|
+
/** Samples per second (e.g., 44100, 48000) */
|
|
280
|
+
sampleRate: number
|
|
281
|
+
/** Number of channels (e.g., 2 for stereo) */
|
|
282
|
+
channels: number
|
|
283
|
+
/** Bits per sample (typically 32 for float) */
|
|
284
|
+
bitsPerSample: number
|
|
285
|
+
/** Bytes per complete audio frame (channels * bits/8) */
|
|
286
|
+
blockAlign: number
|
|
287
|
+
}
|
|
288
|
+
export interface NativeAudioChunk {
|
|
289
|
+
/** Raw PCM audio data */
|
|
290
|
+
data: Buffer
|
|
291
|
+
/** Number of audio frames in this chunk */
|
|
292
|
+
frames: number
|
|
293
|
+
/** Sequence number */
|
|
294
|
+
sequence: number
|
|
295
|
+
/** Milliseconds since audio stream started */
|
|
296
|
+
timestampMs: number
|
|
297
|
+
}
|
|
298
|
+
export interface NativeAudioStreamStats {
|
|
299
|
+
isRunning: boolean
|
|
300
|
+
totalChunks: number
|
|
301
|
+
totalFrames: number
|
|
302
|
+
sampleRate: number
|
|
303
|
+
channels: number
|
|
304
|
+
bitsPerSample: number
|
|
305
|
+
uptimeMs: number
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Start capturing system audio (loopback) via WASAPI.
|
|
309
|
+
* Captures all desktop audio (what you hear through speakers/headphones).
|
|
310
|
+
*/
|
|
311
|
+
export declare function audioStreamStart(config?: NativeAudioStreamConfig | undefined | null): void
|
|
312
|
+
/** Stop the audio stream. */
|
|
313
|
+
export declare function audioStreamStop(): void
|
|
314
|
+
/** Check if audio stream is currently running. */
|
|
315
|
+
export declare function audioStreamIsRunning(): boolean
|
|
316
|
+
/** Get the audio format (sample rate, channels, bits per sample). */
|
|
317
|
+
export declare function audioStreamGetFormat(): NativeAudioFormat | null
|
|
318
|
+
/** Get the latest audio chunk. */
|
|
319
|
+
export declare function audioStreamGetLatestChunk(): NativeAudioChunk | null
|
|
320
|
+
/** Get recent audio chunks from the buffer. */
|
|
321
|
+
export declare function audioStreamGetRecentChunks(count?: number | undefined | null): Array<NativeAudioChunk>
|
|
322
|
+
/**
|
|
323
|
+
* Drain all buffered audio chunks (empties the buffer).
|
|
324
|
+
* Returns chunks in order, oldest first. Useful for writing to file.
|
|
325
|
+
*/
|
|
326
|
+
export declare function audioStreamDrainChunks(): Array<NativeAudioChunk>
|
|
327
|
+
/** Get audio stream statistics. */
|
|
328
|
+
export declare function audioStreamGetStats(): NativeAudioStreamStats
|
|
329
|
+
export interface NativeMicStreamConfig {
|
|
330
|
+
/** Max mic audio chunks to buffer (default: 30 ≈ 300ms) */
|
|
331
|
+
bufferSize?: number
|
|
332
|
+
}
|
|
333
|
+
export interface NativeMicFormat {
|
|
334
|
+
sampleRate: number
|
|
335
|
+
channels: number
|
|
336
|
+
bitsPerSample: number
|
|
337
|
+
blockAlign: number
|
|
338
|
+
}
|
|
339
|
+
export interface NativeMicChunk {
|
|
340
|
+
data: Buffer
|
|
341
|
+
frames: number
|
|
342
|
+
sequence: number
|
|
343
|
+
timestampMs: number
|
|
344
|
+
}
|
|
345
|
+
export interface NativeMicStreamStats {
|
|
346
|
+
isRunning: boolean
|
|
347
|
+
totalChunks: number
|
|
348
|
+
totalFrames: number
|
|
349
|
+
sampleRate: number
|
|
350
|
+
channels: number
|
|
351
|
+
bitsPerSample: number
|
|
352
|
+
uptimeMs: number
|
|
353
|
+
}
|
|
354
|
+
/** Start capturing microphone audio via WASAPI. */
|
|
355
|
+
export declare function micStreamStart(config?: NativeMicStreamConfig | undefined | null): void
|
|
356
|
+
/** Stop the microphone stream. */
|
|
357
|
+
export declare function micStreamStop(): void
|
|
358
|
+
/** Check if mic stream is currently running. */
|
|
359
|
+
export declare function micStreamIsRunning(): boolean
|
|
360
|
+
/** Get the microphone audio format. */
|
|
361
|
+
export declare function micStreamGetFormat(): NativeMicFormat | null
|
|
362
|
+
/** Get the latest microphone audio chunk. */
|
|
363
|
+
export declare function micStreamGetLatestChunk(): NativeMicChunk | null
|
|
364
|
+
/** Get recent microphone audio chunks. */
|
|
365
|
+
export declare function micStreamGetRecentChunks(count?: number | undefined | null): Array<NativeMicChunk>
|
|
366
|
+
/** Drain all buffered microphone audio chunks. */
|
|
367
|
+
export declare function micStreamDrainChunks(): Array<NativeMicChunk>
|
|
368
|
+
/** Get microphone stream statistics. */
|
|
369
|
+
export declare function micStreamGetStats(): NativeMicStreamStats
|
|
370
|
+
export interface NativeSpeakerConfig {
|
|
371
|
+
/** Input sample rate of audio being fed (default: 24000 for Gemini) */
|
|
372
|
+
inputSampleRate?: number
|
|
373
|
+
}
|
|
374
|
+
export interface NativeSpeakerStats {
|
|
375
|
+
isRunning: boolean
|
|
376
|
+
outputSampleRate: number
|
|
377
|
+
outputChannels: number
|
|
378
|
+
outputBitsPerSample: number
|
|
379
|
+
queuedBytes: number
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Start the speaker for audio playback.
|
|
383
|
+
* Accepts PCM16 mono audio via speaker_write() and plays through system speakers.
|
|
384
|
+
*/
|
|
385
|
+
export declare function speakerStart(config?: NativeSpeakerConfig | undefined | null): void
|
|
386
|
+
/** Stop the speaker. */
|
|
387
|
+
export declare function speakerStop(): void
|
|
388
|
+
/** Check if speaker is currently running. */
|
|
389
|
+
export declare function speakerIsRunning(): boolean
|
|
390
|
+
/**
|
|
391
|
+
* Write PCM16 mono audio data for playback.
|
|
392
|
+
* Data should be 16-bit signed integers, little-endian, mono.
|
|
393
|
+
* The speaker will convert to the system's native format automatically.
|
|
394
|
+
*/
|
|
395
|
+
export declare function speakerWrite(data: Buffer): void
|
|
396
|
+
/** Clear all queued audio (useful for handling interruptions). */
|
|
397
|
+
export declare function speakerClear(): void
|
|
398
|
+
/** Get speaker statistics. */
|
|
399
|
+
export declare function speakerGetStats(): NativeSpeakerStats
|
|
400
|
+
export interface NativeScreenDiff {
|
|
401
|
+
/** Percentage of pixels that changed (0.0 - 100.0) */
|
|
402
|
+
changePercentage: number
|
|
403
|
+
/** Total number of changed pixels */
|
|
404
|
+
changedPixelCount: number
|
|
405
|
+
/** Total pixels compared */
|
|
406
|
+
totalPixelCount: number
|
|
407
|
+
/** Bounding box of changed region (if any) */
|
|
408
|
+
changedX?: number
|
|
409
|
+
changedY?: number
|
|
410
|
+
changedWidth?: number
|
|
411
|
+
changedHeight?: number
|
|
412
|
+
/** Average color difference */
|
|
413
|
+
averageDiff: number
|
|
414
|
+
/** Maximum single-pixel difference */
|
|
415
|
+
maxDiff: number
|
|
416
|
+
/** True if any change was detected */
|
|
417
|
+
hasChanges: boolean
|
|
418
|
+
}
|
|
419
|
+
export interface NativeGridCell {
|
|
420
|
+
gridX: number
|
|
421
|
+
gridY: number
|
|
422
|
+
screenX: number
|
|
423
|
+
screenY: number
|
|
424
|
+
width: number
|
|
425
|
+
height: number
|
|
426
|
+
avgR: number
|
|
427
|
+
avgG: number
|
|
428
|
+
avgB: number
|
|
429
|
+
variance: number
|
|
430
|
+
likelyText: boolean
|
|
431
|
+
likelyUi: boolean
|
|
432
|
+
}
|
|
433
|
+
export interface NativeGridAnalysis {
|
|
434
|
+
cols: number
|
|
435
|
+
rows: number
|
|
436
|
+
cellWidth: number
|
|
437
|
+
cellHeight: number
|
|
438
|
+
cells: Array<NativeGridCell>
|
|
439
|
+
activeCellsX: Array<number>
|
|
440
|
+
activeCellsY: Array<number>
|
|
441
|
+
}
|
|
442
|
+
export interface NativeVerifyResult {
|
|
443
|
+
verified: boolean
|
|
444
|
+
changePercentage: number
|
|
445
|
+
durationMs: number
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Compare two screen regions and return diff statistics.
|
|
449
|
+
* Pass the reference Buffer from a previous screen_capture call.
|
|
450
|
+
*/
|
|
451
|
+
export declare function visionDiff(referenceData: Buffer, referenceWidth: number, referenceHeight: number, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null, tolerance?: number | undefined | null, sampleRate?: number | undefined | null): NativeScreenDiff
|
|
452
|
+
/**
|
|
453
|
+
* Analyze screen as a grid for efficient region selection.
|
|
454
|
+
* Returns cell statistics useful for vision model guidance.
|
|
455
|
+
*/
|
|
456
|
+
export declare function visionAnalyzeGrid(cols: number, rows: number, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeGridAnalysis
|
|
457
|
+
/**
|
|
458
|
+
* Wait until screen changes beyond a threshold.
|
|
459
|
+
* Returns true if change detected, false if timed out.
|
|
460
|
+
*/
|
|
461
|
+
export declare function visionWaitForChange(thresholdPercent: number, timeoutMs: number, pollIntervalMs?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): boolean
|
|
462
|
+
/**
|
|
463
|
+
* Wait until screen stabilizes (stops changing).
|
|
464
|
+
* Useful after triggering actions to wait for animations to complete.
|
|
465
|
+
*/
|
|
466
|
+
export declare function visionWaitForStable(stabilityThreshold: number, stableDurationMs: number, timeoutMs: number, pollIntervalMs?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): boolean
|
|
467
|
+
/**
|
|
468
|
+
* Compute a perceptual hash of a screen region.
|
|
469
|
+
* Similar screens have hashes with low Hamming distance.
|
|
470
|
+
*/
|
|
471
|
+
export declare function visionPerceptualHash(regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): number
|
|
472
|
+
/**
|
|
473
|
+
* Compute Hamming distance between two perceptual hashes.
|
|
474
|
+
* Lower = more similar. 0 = identical.
|
|
475
|
+
*/
|
|
476
|
+
export declare function visionHashDistance(hash1: number, hash2: number): number
|
|
477
|
+
/** Find all pixels matching a color within a region. */
|
|
478
|
+
export declare function visionFindAllColors(r: number, g: number, b: number, tolerance: number, maxResults?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): Array<NativeMousePosition>
|
|
479
|
+
/** Find clusters of similar colors (potential UI elements like buttons). */
|
|
480
|
+
export declare function visionFindColorClusters(r: number, g: number, b: number, tolerance: number, minClusterSize: number, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): Array<NativeRect>
|
|
481
|
+
export interface NativeRect {
|
|
482
|
+
x: number
|
|
483
|
+
y: number
|
|
484
|
+
width: number
|
|
485
|
+
height: number
|
|
486
|
+
}
|
|
487
|
+
export interface NativeActionResult {
|
|
488
|
+
index: number
|
|
489
|
+
success: boolean
|
|
490
|
+
error?: string
|
|
491
|
+
durationMs: number
|
|
492
|
+
mouseX?: number
|
|
493
|
+
mouseY?: number
|
|
494
|
+
changeDetected?: boolean
|
|
495
|
+
}
|
|
496
|
+
export interface NativeBatchResult {
|
|
497
|
+
results: Array<NativeActionResult>
|
|
498
|
+
totalDurationMs: number
|
|
499
|
+
successCount: number
|
|
500
|
+
failureCount: number
|
|
501
|
+
firstFailureIndex: number
|
|
502
|
+
allSucceeded: boolean
|
|
503
|
+
}
|
|
504
|
+
export interface NativeClickVerifyResult {
|
|
505
|
+
verified: boolean
|
|
506
|
+
changePercentage: number
|
|
507
|
+
durationMs: number
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Execute a batch of actions atomically.
|
|
511
|
+
* Actions format: Array of { type: string, ...params }
|
|
512
|
+
* Supported types: mouseMove, mouseMoveRel, mouseClick, mouseClickAt,
|
|
513
|
+
* mouseDoubleClick, mouseDown, mouseUp, mouseScroll, mouseDrag,
|
|
514
|
+
* type, typeHumanized, keyPress, keyDown, keyUp, hotkey, delay,
|
|
515
|
+
* waitForChange, waitForStable
|
|
516
|
+
*/
|
|
517
|
+
export declare function agentExecuteBatch(actions: Array<any>, stopOnError?: boolean | undefined | null): NativeBatchResult
|
|
518
|
+
/**
|
|
519
|
+
* Click at position and verify visual change occurred.
|
|
520
|
+
* Essential for agents to confirm their click had an effect.
|
|
521
|
+
*/
|
|
522
|
+
export declare function agentClickAndVerify(x: number, y: number, button?: string | undefined | null, minChangePercent?: number | undefined | null, timeoutMs?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeClickVerifyResult
|
|
523
|
+
/** Execute a hotkey and verify visual change. */
|
|
524
|
+
export declare function agentHotkeyAndVerify(keys: Array<string>, minChangePercent?: number | undefined | null, timeoutMs?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeClickVerifyResult
|
|
525
|
+
/** Move mouse relative to current position. */
|
|
526
|
+
export declare function agentMoveRelative(dx: number, dy: number): NativeMousePosition
|
|
527
|
+
/** Move mouse relative with smooth motion. */
|
|
528
|
+
export declare function agentMoveRelativeSmooth(dx: number, dy: number, durationMs?: number | undefined | null): NativeMousePosition
|
|
529
|
+
/** Type text and wait for screen to stabilize. */
|
|
530
|
+
export declare function agentTypeAndWaitStable(text: string, stabilityThreshold?: number | undefined | null, stableDurationMs?: number | undefined | null, timeoutMs?: number | undefined | null): boolean
|
|
531
|
+
/**
|
|
532
|
+
* Release all held modifier keys (shift, ctrl, alt, etc).
|
|
533
|
+
* Call this for error recovery or after complex operations.
|
|
534
|
+
*/
|
|
535
|
+
export declare function agentReleaseAllModifiers(): void
|
|
536
|
+
export interface NativeMouseTrailPoint {
|
|
537
|
+
timestampMs: number
|
|
538
|
+
x: number
|
|
539
|
+
y: number
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Record mouse movements for a duration.
|
|
543
|
+
* Useful for gesture capture and replay.
|
|
544
|
+
*/
|
|
545
|
+
export declare function agentRecordMouseTrail(durationMs: number, sampleRateHz?: number | undefined | null): Array<NativeMouseTrailPoint>
|
|
546
|
+
/** Replay a recorded mouse trail. */
|
|
547
|
+
export declare function agentReplayMouseTrail(trail: Array<NativeMouseTrailPoint>, speedMultiplier?: number | undefined | null): void
|
|
548
|
+
/** Read text from the system clipboard. */
|
|
549
|
+
export declare function clipboardReadText(): string | null
|
|
550
|
+
/** Write text to the system clipboard. */
|
|
551
|
+
export declare function clipboardWriteText(text: string): void
|
|
552
|
+
/** Read HTML from the clipboard. */
|
|
553
|
+
export declare function clipboardReadHtml(): string | null
|
|
554
|
+
/** Write HTML to the clipboard. */
|
|
555
|
+
export declare function clipboardWriteHtml(html: string): void
|
|
556
|
+
export interface NativeClipboardImage {
|
|
557
|
+
data: Buffer
|
|
558
|
+
width: number
|
|
559
|
+
height: number
|
|
560
|
+
}
|
|
561
|
+
/** Read image data from the clipboard as RGBA bytes. */
|
|
562
|
+
export declare function clipboardReadImage(): NativeClipboardImage | null
|
|
563
|
+
/** Get available clipboard formats. */
|
|
564
|
+
export declare function clipboardFormats(): Array<string>
|
|
565
|
+
/** Clear the clipboard. */
|
|
566
|
+
export declare function clipboardClear(): void
|
|
567
|
+
export interface NativeProcessInfo {
|
|
568
|
+
pid: number
|
|
569
|
+
name: string
|
|
570
|
+
path?: string
|
|
571
|
+
parentPid?: number
|
|
572
|
+
memoryBytes?: number
|
|
573
|
+
}
|
|
574
|
+
/** List all running processes. */
|
|
575
|
+
export declare function processList(): Array<NativeProcessInfo>
|
|
576
|
+
/** Find processes by name (case-insensitive partial match). */
|
|
577
|
+
export declare function processFind(name: string): Array<NativeProcessInfo>
|
|
578
|
+
/** Check if a process with the given PID is running. */
|
|
579
|
+
export declare function processIsRunning(pid: number): boolean
|
|
580
|
+
/** Kill a process by PID. */
|
|
581
|
+
export declare function processKill(pid: number, force?: boolean | undefined | null): void
|
|
582
|
+
/** Launch a new process and return its PID. */
|
|
583
|
+
export declare function processLaunch(command: string, args?: Array<string> | undefined | null): number
|
|
584
|
+
/** Launch a process and wait for it to exit. Returns exit code. */
|
|
585
|
+
export declare function processLaunchAndWait(command: string, args?: Array<string> | undefined | null): number
|
|
586
|
+
/** Get the PID of the foreground window's process. */
|
|
587
|
+
export declare function processForegroundPid(): number
|
|
588
|
+
export interface NativeOsInfo {
|
|
589
|
+
name: string
|
|
590
|
+
version: string
|
|
591
|
+
arch: string
|
|
592
|
+
hostname: string
|
|
593
|
+
}
|
|
594
|
+
export interface NativeMemoryInfo {
|
|
595
|
+
totalBytes: number
|
|
596
|
+
availableBytes: number
|
|
597
|
+
usedBytes: number
|
|
598
|
+
}
|
|
599
|
+
/** Get the number of logical CPU cores. */
|
|
600
|
+
export declare function sysCpuCount(): number
|
|
601
|
+
/** Get operating system information. */
|
|
602
|
+
export declare function sysOsInfo(): NativeOsInfo
|
|
603
|
+
/** Get memory information (total, available, used). */
|
|
604
|
+
export declare function sysMemoryInfo(): NativeMemoryInfo
|
|
605
|
+
/** Get system uptime in seconds. */
|
|
606
|
+
export declare function sysUptime(): number
|
|
607
|
+
/** Get the current username. */
|
|
608
|
+
export declare function sysUsername(): string
|
|
609
|
+
/** Get the home directory path. */
|
|
610
|
+
export declare function sysHomeDir(): string
|
|
611
|
+
/** Get the temp directory path. */
|
|
612
|
+
export declare function sysTempDir(): string
|
|
613
|
+
/** Start recording input events. */
|
|
614
|
+
export declare function recorderStart(): void
|
|
615
|
+
/** Stop recording and return the recording as JSON bytes. */
|
|
616
|
+
export declare function recorderStop(): Buffer
|
|
617
|
+
/** Check if currently recording. */
|
|
618
|
+
export declare function recorderIsRecording(): boolean
|
|
619
|
+
/** Push a mouse move event into the recording. */
|
|
620
|
+
export declare function recorderMouseMove(x: number, y: number): void
|
|
621
|
+
/** Push a mouse button event into the recording. */
|
|
622
|
+
export declare function recorderMouseButton(button: string, isDown: boolean): void
|
|
623
|
+
/** Push a key event into the recording. */
|
|
624
|
+
export declare function recorderKeyEvent(key: string, isDown: boolean): void
|
|
625
|
+
/** Replay a recording from JSON bytes. */
|
|
626
|
+
export declare function recorderReplay(data: Buffer, speed?: number | undefined | null): void
|
|
627
|
+
export interface NativeHookConfig {
|
|
628
|
+
captureKeyboard?: boolean
|
|
629
|
+
captureMouseClicks?: boolean
|
|
630
|
+
captureMouseMove?: boolean
|
|
631
|
+
captureMouseWheel?: boolean
|
|
632
|
+
bufferSize?: number
|
|
633
|
+
}
|
|
634
|
+
export interface NativeInputEvent {
|
|
635
|
+
/** "key_down", "key_up", "mouse_move", "mouse_down", "mouse_up", "mouse_wheel" */
|
|
636
|
+
eventType: string
|
|
637
|
+
keyCode?: number
|
|
638
|
+
keyName?: string
|
|
639
|
+
x?: number
|
|
640
|
+
y?: number
|
|
641
|
+
button?: string
|
|
642
|
+
delta?: number
|
|
643
|
+
timestampMs: number
|
|
644
|
+
}
|
|
645
|
+
/** Start global input hooks. */
|
|
646
|
+
export declare function hooksStart(config?: NativeHookConfig | undefined | null): void
|
|
647
|
+
/** Stop global input hooks. */
|
|
648
|
+
export declare function hooksStop(): void
|
|
649
|
+
/** Check if hooks are active. */
|
|
650
|
+
export declare function hooksIsActive(): boolean
|
|
651
|
+
/** Drain all buffered input events. */
|
|
652
|
+
export declare function hooksDrainEvents(): Array<NativeInputEvent>
|
|
653
|
+
/** Get buffered event count. */
|
|
654
|
+
export declare function hooksEventCount(): number
|
|
655
|
+
export interface NativeMatchResult {
|
|
656
|
+
x: number
|
|
657
|
+
y: number
|
|
658
|
+
width: number
|
|
659
|
+
height: number
|
|
660
|
+
confidence: number
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Find a template image on screen.
|
|
664
|
+
* needle: RGBA pixel data of the template image.
|
|
665
|
+
*/
|
|
666
|
+
export declare function templateFindOnScreen(needleData: Buffer, needleWidth: number, needleHeight: number, threshold?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeMatchResult | null
|
|
667
|
+
/** Find all occurrences of a template on screen. */
|
|
668
|
+
export declare function templateFindAllOnScreen(needleData: Buffer, needleWidth: number, needleHeight: number, threshold?: number | undefined | null, maxResults?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): Array<NativeMatchResult>
|
|
669
|
+
/** Wait for a template to appear on screen. */
|
|
670
|
+
export declare function templateWaitFor(needleData: Buffer, needleWidth: number, needleHeight: number, threshold?: number | undefined | null, timeoutMs?: number | undefined | null, pollIntervalMs?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeMatchResult | null
|
|
671
|
+
/** Capture a screen region and return it as PNG bytes. */
|
|
672
|
+
export declare function screenCapturePng(x?: number | undefined | null, y?: number | undefined | null, width?: number | undefined | null, height?: number | undefined | null): Buffer
|
|
673
|
+
/**
|
|
674
|
+
* Capture a screen region and return it as JPEG bytes.
|
|
675
|
+
* Quality is 1–100 (80 is a good default for real-time use).
|
|
676
|
+
*/
|
|
677
|
+
export declare function screenCaptureJpeg(quality?: number | undefined | null, x?: number | undefined | null, y?: number | undefined | null, width?: number | undefined | null, height?: number | undefined | null): Buffer
|
|
678
|
+
/** Capture a screen region and save to a PNG file. */
|
|
679
|
+
export declare function screenSaveScreenshot(path: string, x?: number | undefined | null, y?: number | undefined | null, width?: number | undefined | null, height?: number | undefined | null): void
|
|
680
|
+
/** Move mouse relative to current position. */
|
|
681
|
+
export declare function mouseMoveRelative(dx: number, dy: number): NativeMousePosition
|
|
682
|
+
/** Move mouse relative with smooth motion. */
|
|
683
|
+
export declare function mouseMoveRelativeSmooth(dx: number, dy: number, durationMs?: number | undefined | null, curve?: string | undefined | null): NativeMousePosition
|
|
684
|
+
/** Right-click at current position. */
|
|
685
|
+
export declare function mouseRightClick(): void
|
|
686
|
+
/** Middle-click at current position. */
|
|
687
|
+
export declare function mouseMiddleClick(): void
|
|
688
|
+
/** Hover over a position for a duration, then return. */
|
|
689
|
+
export declare function mouseHover(x: number, y: number, durationMs?: number | undefined | null): void
|
|
690
|
+
/** Get distance from current mouse position to target. */
|
|
691
|
+
export declare function mouseDistanceTo(x: number, y: number): number
|
|
692
|
+
/** Move the cursor smoothly through a sequence of waypoints. */
|
|
693
|
+
export declare function mouseMoveThroughPoints(points: Array<Array<number>>, durationMs: number, curve?: string | undefined | null, stepsPerSecond?: number | undefined | null): void
|
|
694
|
+
/** Trace a circular path around a center point. */
|
|
695
|
+
export declare function mouseGestureCircle(centerX: number, centerY: number, radius: number, durationMs: number, clockwise?: boolean | undefined | null, stepsPerSecond?: number | undefined | null): void
|
|
696
|
+
/** Quick swipe gesture from one point to another. */
|
|
697
|
+
export declare function mouseGestureSwipe(fromX: number, fromY: number, toX: number, toY: number, durationMs?: number | undefined | null, holdButton?: string | undefined | null): void
|
|
698
|
+
/** Drag along an arbitrary path of waypoints while holding a mouse button. */
|
|
699
|
+
export declare function mouseGestureDragPath(points: Array<Array<number>>, button: string | undefined | null, durationMs: number, stepsPerSecond?: number | undefined | null): void
|
|
700
|
+
/** Spiral inward or outward from a center point. */
|
|
701
|
+
export declare function mouseGestureSpiral(centerX: number, centerY: number, startRadius: number, endRadius: number, turns: number, durationMs: number, stepsPerSecond?: number | undefined | null): void
|
|
702
|
+
/** Zigzag motion between two points with perpendicular oscillation. */
|
|
703
|
+
export declare function mouseGestureZigzag(fromX: number, fromY: number, toX: number, toY: number, amplitude: number, waves: number, durationMs: number, stepsPerSecond?: number | undefined | null): void
|
|
704
|
+
/** Trace a rectangular path. */
|
|
705
|
+
export declare function mouseGestureRectangle(x: number, y: number, width: number, height: number, durationMs: number, curve?: string | undefined | null): void
|
|
706
|
+
/** Wait until OCR finds the specified text on screen. Returns the word position. */
|
|
707
|
+
export declare function waitForText(needle: string, timeoutMs?: number | undefined | null, intervalMs?: number | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeOcrWord | null
|
|
708
|
+
/** Wait until OCR finds the text, then click on it. Returns position clicked or None on timeout. */
|
|
709
|
+
export declare function waitForTextAndClick(needle: string, timeoutMs?: number | undefined | null, intervalMs?: number | undefined | null, button?: string | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeMousePosition | null
|
|
710
|
+
/**
|
|
711
|
+
* Monitor a screen region and return when it changes beyond the threshold.
|
|
712
|
+
* Returns the diff percentage when change is detected, or None on timeout.
|
|
713
|
+
*/
|
|
714
|
+
export declare function watchRegionOnce(x: number, y: number, width: number, height: number, threshold?: number | undefined | null, timeoutMs?: number | undefined | null, intervalMs?: number | undefined | null): number | null
|
|
715
|
+
/** Find windows by process name. */
|
|
716
|
+
export declare function windowFindByProcess(name: string): Array<NativeWindowInfo>
|
|
717
|
+
/** Find windows by process ID. */
|
|
718
|
+
export declare function windowFindByPid(pid: number): Array<NativeWindowInfo>
|
|
719
|
+
/** Set window always-on-top. */
|
|
720
|
+
export declare function windowSetAlwaysOnTop(id: number, topmost: boolean): void
|
|
721
|
+
/** Set window opacity (0.0 transparent – 1.0 opaque). */
|
|
722
|
+
export declare function windowSetOpacity(id: number, opacity: number): void
|
|
723
|
+
/** Get window bounds. */
|
|
724
|
+
export declare function windowGetBounds(id: number): NativeRect
|
|
725
|
+
/** Check if a window has focus. */
|
|
726
|
+
export declare function windowIsForeground(id: number): boolean
|
|
727
|
+
/** Bring a window to front aggressively. */
|
|
728
|
+
export declare function windowBringToFront(id: number): void
|
|
729
|
+
/** Wait for a window with matching title to appear. */
|
|
730
|
+
export declare function windowWaitFor(title: string, timeoutMs?: number | undefined | null): NativeWindowInfo
|
|
731
|
+
/** Center a window on the primary screen. */
|
|
732
|
+
export declare function windowCenter(id: number): void
|
|
733
|
+
/**
|
|
734
|
+
* Capture a specific window's content as raw RGBA pixel data.
|
|
735
|
+
* Works on background (non-foreground) windows — no focus required.
|
|
736
|
+
*/
|
|
737
|
+
export declare function windowCapture(id: number): NativeScreenCapture
|
|
738
|
+
/**
|
|
739
|
+
* Capture a specific window's content as JPEG bytes.
|
|
740
|
+
* Works on background (non-foreground) windows — no focus required.
|
|
741
|
+
*/
|
|
742
|
+
export declare function windowCaptureJpeg(id: number, quality?: number | undefined | null): Buffer
|
|
743
|
+
/**
|
|
744
|
+
* Send a mouse click to a window without focusing it.
|
|
745
|
+
* Coordinates are relative to the window's client area. Button: "left" or "right".
|
|
746
|
+
*/
|
|
747
|
+
export declare function windowSendClick(id: number, x: number, y: number, button?: string | undefined | null): void
|
|
748
|
+
/**
|
|
749
|
+
* Send a key press to a window without focusing it.
|
|
750
|
+
* vk_code is the Windows virtual-key code (e.g. 0x0D = Enter, 0x09 = Tab).
|
|
751
|
+
*/
|
|
752
|
+
export declare function windowSendKey(id: number, vkCode: number): void
|
|
753
|
+
/** Get the current platform name. */
|
|
754
|
+
export declare function getPlatform(): string
|
|
755
|
+
/** Get the Stelo native addon version. */
|
|
756
|
+
export declare function getVersion(): string
|
|
757
|
+
/** Delay execution for the specified milliseconds (blocking). */
|
|
758
|
+
export declare function delay(ms: number): void
|
|
759
|
+
export interface NativeGroupResult {
|
|
760
|
+
groupId: string
|
|
761
|
+
results: Array<NativeActionResult>
|
|
762
|
+
durationMs: number
|
|
763
|
+
successCount: number
|
|
764
|
+
failureCount: number
|
|
765
|
+
}
|
|
766
|
+
export interface NativeParallelResult {
|
|
767
|
+
groups: Array<NativeGroupResult>
|
|
768
|
+
totalDurationMs: number
|
|
769
|
+
totalActions: number
|
|
770
|
+
totalSuccess: number
|
|
771
|
+
totalFailures: number
|
|
772
|
+
allSucceeded: boolean
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Execute multiple action groups in parallel on native OS threads.
|
|
776
|
+
*
|
|
777
|
+
* Each group is an object { groupId: string, actions: Action[], stopOnError?: bool, startDelayMs?: number }.
|
|
778
|
+
* Groups run concurrently on separate threads. Within a group, actions are sequential.
|
|
779
|
+
*
|
|
780
|
+
* This is the core primitive that makes Stelo faster than any other SDK —
|
|
781
|
+
* true OS-level parallelism, not async pretend.
|
|
782
|
+
*/
|
|
783
|
+
export declare function parallelExecute(groups: Array<any>): NativeParallelResult
|
|
784
|
+
/**
|
|
785
|
+
* Execute actions with interleaved timing (human-like overlapping input).
|
|
786
|
+
*
|
|
787
|
+
* Each entry is { startAtMs: number, ...action }. Actions with the same
|
|
788
|
+
* start time run in parallel. This enables overlapping mouse + keyboard.
|
|
789
|
+
*/
|
|
790
|
+
export declare function interleavedExecute(timedActions: Array<any>): NativeParallelResult
|
|
791
|
+
export interface NativeOcrWord {
|
|
792
|
+
/** The recognized text */
|
|
793
|
+
text: string
|
|
794
|
+
/** Bounding box X */
|
|
795
|
+
x: number
|
|
796
|
+
/** Bounding box Y */
|
|
797
|
+
y: number
|
|
798
|
+
/** Bounding box width */
|
|
799
|
+
width: number
|
|
800
|
+
/** Bounding box height */
|
|
801
|
+
height: number
|
|
802
|
+
/** Confidence (0.0 - 1.0) when available */
|
|
803
|
+
confidence: number
|
|
804
|
+
}
|
|
805
|
+
export interface NativeOcrLine {
|
|
806
|
+
/** Full text of the line */
|
|
807
|
+
text: string
|
|
808
|
+
/** Individual words with positions */
|
|
809
|
+
words: Array<NativeOcrWord>
|
|
810
|
+
/** Line bounding box */
|
|
811
|
+
x: number
|
|
812
|
+
y: number
|
|
813
|
+
width: number
|
|
814
|
+
height: number
|
|
815
|
+
}
|
|
816
|
+
export interface NativeOcrResult {
|
|
817
|
+
/** Full recognized text */
|
|
818
|
+
text: string
|
|
819
|
+
/** Lines with word-level detail */
|
|
820
|
+
lines: Array<NativeOcrLine>
|
|
821
|
+
/** Duration of OCR in milliseconds */
|
|
822
|
+
durationMs: number
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Perform OCR on a screen region. Returns recognized text with word positions.
|
|
826
|
+
* Uses the built-in Windows OCR engine (no external dependencies).
|
|
827
|
+
*
|
|
828
|
+
* Pass region coordinates to OCR a specific area, or omit for full screen.
|
|
829
|
+
*/
|
|
830
|
+
export declare function ocrRecognize(regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeOcrResult
|
|
831
|
+
/**
|
|
832
|
+
* Find text on screen and return its bounding box center.
|
|
833
|
+
* Returns the first match found, or null if text not found.
|
|
834
|
+
*/
|
|
835
|
+
export declare function ocrFindText(needle: string, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeOcrWord | null
|
|
836
|
+
/**
|
|
837
|
+
* Click on text found via OCR. Finds the text, clicks its center.
|
|
838
|
+
* Returns the position clicked, or error if text not found.
|
|
839
|
+
*/
|
|
840
|
+
export declare function ocrClickText(needle: string, button?: string | undefined | null, regionX?: number | undefined | null, regionY?: number | undefined | null, regionWidth?: number | undefined | null, regionHeight?: number | undefined | null): NativeMousePosition
|