@spotterjs/core
v1.0.1
Published
spotterjs desktop automation - TypeScript API
Downloads
244
Readme
@spotterjs/core
Main TypeScript entrypoint for spotterjs desktop automation. It provides screen capture, template matching, mouse and keyboard input, window discovery, accessibility automation, clipboard access, PNG encoding, coordinate helpers, and sandboxed host I/O for agent workflows.
Install
npm install @spotterjs/coreThe package loads a matching @spotterjs/node native binary. Current prebuilt
targets are Windows x64 (MSVC) and Linux x64 (glibc).
Quick Start
import { keyboard, mouse, screen } from "@spotterjs/core";
const match = await screen.find("./assets/button.png", {
confidence: 0.9,
scale: true,
});
mouse.tap(match.center.x, match.center.y);
keyboard.write("hello");Window-scoped matching:
import { desktop, windows } from "@spotterjs/core";
const win = desktop.waitForWindow("Notepad", 10_000);
windows.tapTemplate(win.id, "./assets/save-btn.png", { confidence: 0.9 });Modules
| Export | Purpose |
|--------|---------|
| screen | Screen size, capture, full-screen NCC matching, find, findAll, waitFor, and tap |
| windows | List, focus, move, resize, capture, and window-scoped template matching |
| mouse / keyboard / clipboard | Input simulation and clipboard text |
| desktop | List apps by process, find windows by title, and wait for windows |
| accessibility | UIA / AT-SPI quick actions and diagnostics |
| host | Sandboxed workspace file I/O and optional shell execution for agent scenarios |
| encodePng / encodePngBase64 | Encode CaptureImage to PNG bytes or base64 |
| toMatchBox / matchTapScreen | Coordinate conversion helpers |
| image | Match templates against an existing raw RGBA capture; decode encoded image buffers |
| @spotterjs/core/native | Unstable low-level N-API escape hatch |
Public APIs include English TSDoc in the generated declarations, so IDE hover text explains parameters, coordinate spaces, errors, and side effects.
Documentation
License
Learning and non-commercial use are free. Commercial use requires authorization. See LICENSE.
