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.
Files changed (141) hide show
  1. package/LICENSE +184 -0
  2. package/README.md +853 -0
  3. package/dist/accessibility.d.ts +227 -0
  4. package/dist/accessibility.d.ts.map +1 -0
  5. package/dist/accessibility.js +602 -0
  6. package/dist/accessibility.js.map +1 -0
  7. package/dist/agent.d.ts +870 -0
  8. package/dist/agent.d.ts.map +1 -0
  9. package/dist/agent.js +1107 -0
  10. package/dist/agent.js.map +1 -0
  11. package/dist/audio-stream.d.ts +114 -0
  12. package/dist/audio-stream.d.ts.map +1 -0
  13. package/dist/audio-stream.js +167 -0
  14. package/dist/audio-stream.js.map +1 -0
  15. package/dist/clipboard.d.ts +99 -0
  16. package/dist/clipboard.d.ts.map +1 -0
  17. package/dist/clipboard.js +352 -0
  18. package/dist/clipboard.js.map +1 -0
  19. package/dist/config.d.ts +183 -0
  20. package/dist/config.d.ts.map +1 -0
  21. package/dist/config.js +477 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/context.d.ts +213 -0
  24. package/dist/context.d.ts.map +1 -0
  25. package/dist/context.js +387 -0
  26. package/dist/context.js.map +1 -0
  27. package/dist/cortex.d.ts +548 -0
  28. package/dist/cortex.d.ts.map +1 -0
  29. package/dist/cortex.js +1479 -0
  30. package/dist/cortex.js.map +1 -0
  31. package/dist/errors.d.ts +133 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +278 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/events.d.ts +227 -0
  36. package/dist/events.d.ts.map +1 -0
  37. package/dist/events.js +429 -0
  38. package/dist/events.js.map +1 -0
  39. package/dist/executor.d.ts +212 -0
  40. package/dist/executor.d.ts.map +1 -0
  41. package/dist/executor.js +545 -0
  42. package/dist/executor.js.map +1 -0
  43. package/dist/index.d.ts +69 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +167 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/integration.d.ts +159 -0
  48. package/dist/integration.d.ts.map +1 -0
  49. package/dist/integration.js +533 -0
  50. package/dist/integration.js.map +1 -0
  51. package/dist/keyboard.d.ts +276 -0
  52. package/dist/keyboard.d.ts.map +1 -0
  53. package/dist/keyboard.js +404 -0
  54. package/dist/keyboard.js.map +1 -0
  55. package/dist/logger.d.ts +198 -0
  56. package/dist/logger.d.ts.map +1 -0
  57. package/dist/logger.js +516 -0
  58. package/dist/logger.js.map +1 -0
  59. package/dist/middleware.d.ts +183 -0
  60. package/dist/middleware.d.ts.map +1 -0
  61. package/dist/middleware.js +493 -0
  62. package/dist/middleware.js.map +1 -0
  63. package/dist/monitor.d.ts +136 -0
  64. package/dist/monitor.d.ts.map +1 -0
  65. package/dist/monitor.js +341 -0
  66. package/dist/monitor.js.map +1 -0
  67. package/dist/mouse.d.ts +290 -0
  68. package/dist/mouse.d.ts.map +1 -0
  69. package/dist/mouse.js +466 -0
  70. package/dist/mouse.js.map +1 -0
  71. package/dist/plugin.d.ts +157 -0
  72. package/dist/plugin.d.ts.map +1 -0
  73. package/dist/plugin.js +409 -0
  74. package/dist/plugin.js.map +1 -0
  75. package/dist/process.d.ts +106 -0
  76. package/dist/process.d.ts.map +1 -0
  77. package/dist/process.js +326 -0
  78. package/dist/process.js.map +1 -0
  79. package/dist/recorder.d.ts +100 -0
  80. package/dist/recorder.d.ts.map +1 -0
  81. package/dist/recorder.js +258 -0
  82. package/dist/recorder.js.map +1 -0
  83. package/dist/safety.d.ts +59 -0
  84. package/dist/safety.d.ts.map +1 -0
  85. package/dist/safety.js +98 -0
  86. package/dist/safety.js.map +1 -0
  87. package/dist/scheduler.d.ts +152 -0
  88. package/dist/scheduler.d.ts.map +1 -0
  89. package/dist/scheduler.js +615 -0
  90. package/dist/scheduler.js.map +1 -0
  91. package/dist/screen.d.ts +96 -0
  92. package/dist/screen.d.ts.map +1 -0
  93. package/dist/screen.js +154 -0
  94. package/dist/screen.js.map +1 -0
  95. package/dist/session.d.ts +209 -0
  96. package/dist/session.d.ts.map +1 -0
  97. package/dist/session.js +479 -0
  98. package/dist/session.js.map +1 -0
  99. package/dist/stream.d.ts +168 -0
  100. package/dist/stream.d.ts.map +1 -0
  101. package/dist/stream.js +298 -0
  102. package/dist/stream.js.map +1 -0
  103. package/dist/telemetry.d.ts +223 -0
  104. package/dist/telemetry.d.ts.map +1 -0
  105. package/dist/telemetry.js +433 -0
  106. package/dist/telemetry.js.map +1 -0
  107. package/dist/types.d.ts +165 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/dist/types.js +8 -0
  110. package/dist/types.js.map +1 -0
  111. package/dist/utils/bezier.d.ts +51 -0
  112. package/dist/utils/bezier.d.ts.map +1 -0
  113. package/dist/utils/bezier.js +117 -0
  114. package/dist/utils/bezier.js.map +1 -0
  115. package/dist/utils/helpers.d.ts +90 -0
  116. package/dist/utils/helpers.d.ts.map +1 -0
  117. package/dist/utils/helpers.js +143 -0
  118. package/dist/utils/helpers.js.map +1 -0
  119. package/dist/utils/index.d.ts +4 -0
  120. package/dist/utils/index.d.ts.map +1 -0
  121. package/dist/utils/index.js +18 -0
  122. package/dist/utils/index.js.map +1 -0
  123. package/dist/validation.d.ts +254 -0
  124. package/dist/validation.d.ts.map +1 -0
  125. package/dist/validation.js +478 -0
  126. package/dist/validation.js.map +1 -0
  127. package/dist/vision.d.ts +719 -0
  128. package/dist/vision.d.ts.map +1 -0
  129. package/dist/vision.js +1197 -0
  130. package/dist/vision.js.map +1 -0
  131. package/dist/window.d.ts +80 -0
  132. package/dist/window.d.ts.map +1 -0
  133. package/dist/window.js +170 -0
  134. package/dist/window.js.map +1 -0
  135. package/dist/workflow.d.ts +224 -0
  136. package/dist/workflow.d.ts.map +1 -0
  137. package/dist/workflow.js +578 -0
  138. package/dist/workflow.js.map +1 -0
  139. package/index.d.ts +840 -0
  140. package/index.js +495 -0
  141. package/package.json +91 -0
@@ -0,0 +1,290 @@
1
+ import type { MouseButton, Point, ScrollDirection, SmoothMoveOptions, HumanizedMoveOptions, DragOptions } from './types';
2
+ /** Handle returned by async movement operations for cancellation. */
3
+ export interface MovementHandle {
4
+ /** Promise that resolves when the movement completes or is cancelled. */
5
+ promise: Promise<Point>;
6
+ /** Cancel the movement. The cursor stays at its current position. */
7
+ cancel(): void;
8
+ }
9
+ /**
10
+ * Mouse control interface.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { mouse } from 'stelo';
15
+ *
16
+ * // Instant move
17
+ * mouse.move(100, 200);
18
+ *
19
+ * // Smooth bezier movement
20
+ * mouse.moveSmoothly(500, 400, { duration: 1000, curve: 'bezier' });
21
+ *
22
+ * // Human-like movement
23
+ * mouse.moveHumanized(800, 600);
24
+ *
25
+ * // Click, double-click, right-click
26
+ * mouse.click();
27
+ * mouse.doubleClick();
28
+ * mouse.click('right');
29
+ *
30
+ * // Drag
31
+ * mouse.drag(100, 100, 500, 400);
32
+ *
33
+ * // Scroll
34
+ * mouse.scroll(3, 'up');
35
+ * ```
36
+ */
37
+ export declare const mouse: {
38
+ /**
39
+ * Move cursor instantly to absolute screen coordinates.
40
+ */
41
+ move(x: number, y: number): void;
42
+ /**
43
+ * Get current cursor position.
44
+ */
45
+ getPosition(): Point;
46
+ /**
47
+ * Move cursor smoothly to target with configurable curve and duration.
48
+ */
49
+ moveSmoothly(x: number, y: number, options?: SmoothMoveOptions): void;
50
+ /**
51
+ * Move cursor with humanized, natural-feeling motion.
52
+ * Includes micro-jitter, variable speed, and optional overshoot.
53
+ */
54
+ moveHumanized(x: number, y: number, options?: HumanizedMoveOptions): void;
55
+ /**
56
+ * Click a mouse button at the current position.
57
+ * @param button - 'left' (default), 'right', or 'middle'
58
+ */
59
+ click(button?: MouseButton): void;
60
+ /**
61
+ * Double-click a mouse button.
62
+ */
63
+ doubleClick(button?: MouseButton): void;
64
+ /**
65
+ * Triple-click (select line/paragraph).
66
+ */
67
+ tripleClick(button?: MouseButton): void;
68
+ /**
69
+ * Press (hold down) a mouse button without releasing.
70
+ */
71
+ down(button?: MouseButton): void;
72
+ /**
73
+ * Release a mouse button.
74
+ */
75
+ up(button?: MouseButton): void;
76
+ /**
77
+ * Scroll the mouse wheel.
78
+ * @param amount - Number of scroll increments
79
+ * @param direction - 'up' (default), 'down', 'left', 'right'
80
+ */
81
+ scroll(amount?: number, direction?: ScrollDirection): void;
82
+ /**
83
+ * Scroll the mouse wheel smoothly over time.
84
+ * @param amount - Number of scroll increments
85
+ * @param direction - 'up' (default), 'down', 'left', 'right'
86
+ * @param duration - Duration of the scroll in ms
87
+ */
88
+ scrollSmooth(amount?: number, direction?: ScrollDirection, duration?: number): void;
89
+ /**
90
+ * Drag from one point to another.
91
+ */
92
+ drag(fromX: number, fromY: number, toX: number, toY: number, options?: DragOptions): void;
93
+ /**
94
+ * Click at a specific position.
95
+ * @param x - X coordinate
96
+ * @param y - Y coordinate
97
+ * @param button - Mouse button (default: 'left')
98
+ * @param restorePosition If true, returns cursor to original position after clicking
99
+ */
100
+ clickAt(x: number, y: number, button?: MouseButton, restorePosition?: boolean): void;
101
+ /**
102
+ * Move to a position and click in one call.
103
+ */
104
+ moveAndClick(x: number, y: number, button?: MouseButton): void;
105
+ /**
106
+ * Move cursor smoothly to target — **non-blocking**.
107
+ *
108
+ * Unlike `moveSmoothly()` (which blocks the thread), this method yields
109
+ * control back to the event loop between each step. The cursor moves
110
+ * visually on-screen and other code (screen captures, AI inference, etc.)
111
+ * can run in parallel.
112
+ *
113
+ * @returns A `MovementHandle` with `.promise` and `.cancel()`.
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * // Simple await
118
+ * await mouse.moveSmoothAsync(500, 400, { duration: 600 });
119
+ *
120
+ * // Cancel mid-flight
121
+ * const handle = mouse.moveSmoothAsync(500, 400);
122
+ * setTimeout(() => handle.cancel(), 200);
123
+ * await handle.promise;
124
+ *
125
+ * // Run movement + screen monitoring in parallel
126
+ * const [_, frame] = await Promise.all([
127
+ * mouse.moveSmoothAsync(500, 400).promise,
128
+ * captureScreenDuringMovement(),
129
+ * ]);
130
+ * ```
131
+ */
132
+ moveSmoothAsync(x: number, y: number, options?: SmoothMoveOptions): MovementHandle;
133
+ /**
134
+ * Move cursor with humanized motion — **non-blocking**.
135
+ *
136
+ * Same as `moveHumanized()` but non-blocking. The cursor visually traces
137
+ * a natural-looking path with jitter and variable speed, while the event
138
+ * loop stays free for other operations.
139
+ *
140
+ * @returns A `MovementHandle` with `.promise` and `.cancel()`.
141
+ */
142
+ moveHumanizedAsync(x: number, y: number, options?: HumanizedMoveOptions): MovementHandle;
143
+ /**
144
+ * Move the cursor along an arbitrary path of points — **non-blocking**.
145
+ *
146
+ * Pass any array of `{ x, y }` waypoints. The cursor follows the path
147
+ * with the given delay between each point. Ideal for replaying recorded
148
+ * gestures, following geometry, or executing complex paths from AI models.
149
+ *
150
+ * @returns A `MovementHandle` with `.promise` and `.cancel()`.
151
+ *
152
+ * @example
153
+ * ```typescript
154
+ * // Trace a rectangle
155
+ * await mouse.moveAlongPath([
156
+ * { x: 100, y: 100 },
157
+ * { x: 500, y: 100 },
158
+ * { x: 500, y: 400 },
159
+ * { x: 100, y: 400 },
160
+ * { x: 100, y: 100 },
161
+ * ], { stepDelayMs: 5 }).promise;
162
+ * ```
163
+ */
164
+ moveAlongPath(path: Point[], options?: {
165
+ stepDelayMs?: number;
166
+ }): MovementHandle;
167
+ /**
168
+ * Move to target position and click — **non-blocking smooth movement**.
169
+ *
170
+ * Smoothly moves to the target, then clicks. Returns after both complete.
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * await mouse.moveAndClickAsync(500, 300, { duration: 400 });
175
+ * ```
176
+ */
177
+ moveAndClickAsync(x: number, y: number, options?: SmoothMoveOptions & {
178
+ button?: MouseButton;
179
+ }): Promise<void>;
180
+ /**
181
+ * Drag from current position to target — **non-blocking smooth movement**.
182
+ *
183
+ * The cursor visibly moves to the target while holding the mouse button.
184
+ *
185
+ * @example
186
+ * ```typescript
187
+ * mouse.move(100, 100);
188
+ * await mouse.dragAsync(500, 400, { duration: 800 });
189
+ * ```
190
+ */
191
+ dragAsync(toX: number, toY: number, options?: {
192
+ button?: MouseButton;
193
+ duration?: number;
194
+ }): Promise<void>;
195
+ /**
196
+ * Get current X coordinate.
197
+ */
198
+ readonly x: number;
199
+ /**
200
+ * Get current Y coordinate.
201
+ */
202
+ readonly y: number;
203
+ /**
204
+ * Move the cursor smoothly through a sequence of waypoints.
205
+ *
206
+ * @example
207
+ * ```typescript
208
+ * // Visit three points with smooth interpolation
209
+ * mouse.moveThroughPoints([[100,200], [400,300], [600,100]], 1000);
210
+ * ```
211
+ */
212
+ moveThroughPoints(points: [number, number][], durationMs: number, options?: {
213
+ curve?: string;
214
+ stepsPerSecond?: number;
215
+ }): void;
216
+ /**
217
+ * Trace a circular gesture around a center point.
218
+ *
219
+ * @example
220
+ * ```typescript
221
+ * mouse.gestureCircle(500, 400, 100, 1000); // 100px radius circle in 1s
222
+ * ```
223
+ */
224
+ gestureCircle(centerX: number, centerY: number, radius: number, durationMs: number, options?: {
225
+ clockwise?: boolean;
226
+ stepsPerSecond?: number;
227
+ }): void;
228
+ /**
229
+ * Fast swipe gesture — flick-like motion between two points.
230
+ * Optionally holds a mouse button during the swipe (for drag-swipes).
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * mouse.gestureSwipe(100, 500, 100, 100, { duration: 150 }); // swipe up
235
+ * ```
236
+ */
237
+ gestureSwipe(fromX: number, fromY: number, toX: number, toY: number, options?: {
238
+ duration?: number;
239
+ holdButton?: MouseButton;
240
+ }): void;
241
+ /**
242
+ * Drag along an arbitrary path while holding a mouse button.
243
+ * Perfect for drawing, resizing, or complex drag operations.
244
+ *
245
+ * @example
246
+ * ```typescript
247
+ * mouse.gestureDragPath([[100,100], [200,150], [300,100], [400,200]], 1000);
248
+ * ```
249
+ */
250
+ gestureDragPath(points: [number, number][], durationMs: number, options?: {
251
+ button?: MouseButton;
252
+ stepsPerSecond?: number;
253
+ }): void;
254
+ /**
255
+ * Spiral inward or outward from a center point.
256
+ *
257
+ * @example
258
+ * ```typescript
259
+ * // Spiral outward from center, 0→200px radius, 3 turns, 2 seconds
260
+ * mouse.gestureSpiral(500, 400, 0, 200, 3, 2000);
261
+ * ```
262
+ */
263
+ gestureSpiral(centerX: number, centerY: number, startRadius: number, endRadius: number, turns: number, durationMs: number, options?: {
264
+ stepsPerSecond?: number;
265
+ }): void;
266
+ /**
267
+ * Zigzag motion — oscillates perpendicular to the travel direction.
268
+ *
269
+ * @example
270
+ * ```typescript
271
+ * // Zigzag from left to right with 30px amplitude, 5 waves
272
+ * mouse.gestureZigzag(100, 300, 800, 300, 30, 5, 1000);
273
+ * ```
274
+ */
275
+ gestureZigzag(fromX: number, fromY: number, toX: number, toY: number, amplitude: number, waves: number, durationMs: number, options?: {
276
+ stepsPerSecond?: number;
277
+ }): void;
278
+ /**
279
+ * Trace a rectangular path — clockwise from top-left corner.
280
+ *
281
+ * @example
282
+ * ```typescript
283
+ * mouse.gestureRectangle(100, 100, 400, 300, 2000);
284
+ * ```
285
+ */
286
+ gestureRectangle(x: number, y: number, width: number, height: number, durationMs: number, options?: {
287
+ curve?: string;
288
+ }): void;
289
+ };
290
+ //# sourceMappingURL=mouse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouse.d.ts","sourceRoot":"","sources":["../ts/mouse.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACZ,MAAM,SAAS,CAAC;AAWjB,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,qEAAqE;IACrE,MAAM,IAAI,IAAI,CAAC;CAChB;AAsFD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,KAAK;IAChB;;OAEG;YACK,MAAM,KAAK,MAAM,GAA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