Changelog

@nut-tree/nut-js

Changelogs for @nut-tree/nut-js

5.1.1

  • Dependencies: Bump image-js to v1.5.0

5.1.0

  • Feature: Add accessibility event monitoring with support for treeChanged, valueChanged, nameChanged, focusChanged, selectionChanged, menuOpen and menuClose events. Window emits these as an EventEmitter and waitFor accepts a11yEvent(), settled() and actionable() descriptors
  • Feature: Add window event monitoring with support for windowCreated, windowDestroyed, windowFocused, windowMoved, windowResized, windowMinimized, windowRestored, windowShown, windowHidden and windowTitleChanged events. ScreenClass emits these as an EventEmitter and waitFor accepts windowEvent() and settled() descriptors
  • Dependencies: Bump libnut-core to v3.0.2

5.0.1

  • Bugfix: Fix broken clipboard provider after ESM migration

5.0.0

  • Enhancement: Extend screen.grab and screen.capture to accept an optional region parameter, unifying the API with grabRegion and captureRegion
  • Enhancement: Extend toShow matcher to work with Windows
  • Enhancement: Extend WindowElement and WindowElementDescription with isSelected and isChecked properties
  • Enhancement: Extend WindowElementDescription with new relation queries (descendantOf, ancestorOf, after, before, siblingOf, notMatching) and position modifiers (nthChild, firstChild, lastChild)
  • Enhancement: Ship both CommonJS and ESM
  • Enhancement: Resolve package deprecations in dependencies and audit issues
  • Feature: Introduce Vitest matchers
  • Feature: Introduce toMatchContentDescription matcher which uses the VisionFinderInterface to match content expectations
  • Feature: Add vision LLM integration for natural language screen content matching via VisionFinderInterface and contentMatchingDescription query
  • Feature: Add support for screen recording either as a continuous stream or as snippets of defined length for e.g. error recordings
  • Feature: Add toDataURL to Image class for easier integration with LLM-based vision providers and other use cases
  • Feature: Add Linux ARM64 support for libnut provider
  • Feature: Make keyboard.type, mouse.move, mouse.drag and sleep abortable via an optional AbortSignal parameter
  • Bugfix: Fix broken Button mapping in libnut mouse provider
  • Maintenance: Migrate e2e tests to @playwright/test
  • Maintenance: Replace image-js / remove jimp dependency
  • Maintenance: Remove node-abort-controller dependency in favor of node built-in AbortController
  • BREAKING: Drop support for macOS < 14
  • BREAKING: screen.grabRegion and screen.captureRegion were removed in favor of screen.grab(region) and screen.capture(fileName, region)
  • BREAKING: nut.js now requires at least Node.js v22 or later
  • BREAKING: mouse.move is now non-blocking
  • BREAKING: Type docs are no longer published to https://nut-tree.github.io/apidoc/. Instead, they are now integrated into the nutjs.dev website

4.7.0

  • Enhancement: Add Windows ARM64 support for @nut-tree/libnut
  • Bugfix: Re-introduce in relation for WindowElementDescription to support in property in element queries

4.6.0

4.5.1

  • Bugfix: Fix broken highlight function (#609)
  • Enhancement: Improve stability of window focus operation on Windows and macOS

4.5.0

  • Feature: Introduce new InputMonitor interface
  • Dependencies: Update @nut-tree/libnut to v2.8.0

4.4.1

  • Bugfix: Properly export toWaitFor matcher

4.4.0

  • Feature: New matchers to work with element queries
  • Enhancement: Update types of toShow matcher to accept Promises
  • Feature: New toWaitFor matcher which works with waitFor
  • Bugfix: Bump libnut-core to v2.7.3 to revert window focus change which broke input on Windows

4.3.0

  • Enhancement: Modify text queries to support not only string, but also RegExp
  • Enhancement: Update return type of window.getElements to include missing id property
  • Enhancement: Update type definition of WindowElementDescription in nut.js core to include an in property
  • Enhancement: Update mouse.setPosition to support passing Promise<Point>
  • Feature: Allow users to reset all providers to their default
  • Feature: Allow users to reset providers for clipboard, keyboard, mouse, screen and window to their default
  • Enhancement: Improve keyboard.type input if keyboard.config.autoDelayMs is 0
  • Bugfix: Key.LeftSuper and Key.RightSuper mapped to the wrong low-level key in libnut
  • Dependencies: Update @nut-tree/libnut to v2.7.2

4.2.0

  • Feature: Extend Window class with minimize and restore methods

4.1.0

  • Enhancement: Extend WindowProviderInterface with minimizeWindow and restoreWindow functions
  • Feature: Introduce WindowElementQuery type and extend Window class with find, findAll, waitFor and find hooks

4.0.1

  • Enhancement: Fix channel info for image loader to 4 to avoid processing errors

4.0.0

  • Feature: Add ability to move/focus/resize windows
  • Enhancement: Add support for 'Clear' key on macOS
  • Feature: Optional default providers
  • BREAKING: OCR confidence override not working
  • Enhancement: New 'toHaveColor' Jest matcher
  • Enhancement: Improved error messages for timeouts
  • Maintenance: Migrate nut.js core and its default providers to a monorepo
  • Maintenance: Use PlayWright for E2E tests
  • Bugfix: getActiveWindow returns out-of-bounds coordinates for maximized windows
  • BREAKING: Require minimum node version of 16

3.1.2

  • Bugfix: Screen capture broken on macOS 13
  • Enhancement: Enable newly introduced keys to be used as modifiers
  • Enhancement: Extend move API to handle single point case
  • Feature: Add color queries to search for pixels of a certain color
  • Bugfix: screen.highlight closes Electron window

3.1.1

  • Bugfix: Fix mouse drift on Windows

3.1.0

  • Enhancement: Typo fix
  • Enhancement: Additional keys

3.0.0

  • Enhancement: Improve types of Jest matchers
  • BREAKING: Rename clipboard methods
  • Enhancement: Option to disable automatic request of permissions in macOS
  • BREAKING: Allow screen.find and other to work with non-image needles
  • BREAKING: Add bits per pixel and byteWidth info to image class
  • Bugfix: Installed Electron App crashes after upgrading to 2.3.0
  • Maintenance: Add .nvmrc config
  • Enhancement: Define and export interfaces for keyboard/mouse/screen configs
  • Bugfix: 'RightShift' key is mapped to space
  • Maintenance: Introduce prettier
  • Bugfix: Win2012-R2: Error: The specified procedure could not be found
  • Feature: Logging provider

2.3.0

  • Bugfix: Segmentation Fault when retrieving window title
  • Enhancement: Automatically check and request required permissions on macOS

2.2.1

  • Enhancement: Scale easing function result by base speed before applying
  • Maintenance: Resolve security vulnerabilities

2.2.0

  • Maintenance: Limit CI runs to PRs, not every push
  • Maintenance: Upgrade node version to 16 for all CI runs
  • Bugfix: Fix grave accent
  • Enhancement: Refine error messages on fetchFromUrl
  • Enhancement: Ship Windows runtime dependencies

2.1.1

  • Bugfix: Modifier keys are not properly released on macOS
  • Bugfix: Fix mouse clicks with modifiers on macOS

2.1.0

  • Bugfix: Keyboard methods pressKey and releaseKey ignore updated autoDelayMs
  • Enhancement: Add mappings for missing numpad keys
  • Enhancement: macOS double click
  • Maintenance: Both mouse.leftClick and mouse.rightClick should reuse click
  • Feature: New image loader to fetch remote images
  • Bugfix: Mouse methods pressButton and releaseButton should respect auto delay

2.0.1

  • Bugfix: Issue with keyboard.type in to Spotlight on MacOS
  • Enhancement: Numpad buttons don't work on Linux

2.0.0

  • Feature: Apple Silicon
  • Enhancement: Enable warning message for missing accessibility permissions on macOS
  • Enhancement: Add runtime typechecks for screen.find etc.
  • Bugfix: Fix Windows scaling issue
  • Maintenance: Refine types
  • Maintenance: Cleanup deprecated code
  • Enhancement: Support for mouse capturing games
  • Feature: Provide functions to convert images between BGR and RGB color mode
  • Feature: Audio keys support
  • Enhancement: Configurable interval for waitFor
  • Bugfix: Apply pixel density scaling on colorAt
  • Enhancement: Change find signature to only work on Image instances
  • Enhancement: Adjust assert class to new Screen#find parameter types
  • Feature: Get screen pixel color
  • Feature: Add Screen#findAll to enable matching multiple template occurrences
  • Enhancement: Make Screen#find accept Promise<Image>
  • Enhancement: Accepting a Buffer with image data for Screen#find
  • Enhancement: Get rid of adapter layer in favour of providerRegistry
  • Feature: Provide a default implementation for ImageReader and ImageWriter
  • Feature: Define interface for mouse movement type
  • Feature: Separate image matching code
  • Enhancement: Export FileType
  • Enhancement: Export ImageWriterParameters
  • Enhancement: Export provider interfaces
  • Feature: Introduce a registry for providers
  • Feature: Add methods to grab the current screen content as Buffer

1.7.0

  • Enhancement: Trigger snapshot releases
  • Feature: Cancel screen.waitFor if needed
  • Enhancement: Move docs into separate repo
  • Feature: Support for node 16 and Electron 13

1.6.0

  • Feature: Create screenshot from region
  • Bugfix: Endless loop in timeout function for long-running actions returning undefined
  • Maintenance: Use default exports for all provider classes
  • Enhancement: imprecise error message if image is too large
  • Bugfix: waitFor does not properly cancel
  • Feature: Enable GitHub Actions
  • Enhancement: Use @nut-tree/libnut@next for snapshot releases
  • Enhancement: Requesting image search outside of screen boundaries fails with runtime error

1.5.0

  • Enhancement: Window support
  • Bugfix: screen.find neglects offsets when providing a search region

1.4.2

  • Maintenance: Refactor locationparameters.class.ts
  • Enhancement: Update npmignore
  • Maintenance: Refactor image-processor.class.ts
  • Enhancement: Update to opencv4nodejs-prebuilt@5.3.0-2
  • Enhancement: Add note about macOS permissions to readme
  • Enhancement: Stabilize drag & drop E2E test
  • Bugfix: Hanging shift key after keyboard input on Windows

1.4.1

  • Bugfix: Electron + Windows problems

1.4.0

  • Enhancement: API docs
  • Enhancement: Improve CI pipeline
  • Enhancement: Rename MouseActionInterface
  • Enhancement: Enhance test stability
  • Enhancement: Config cleanup
  • Enhancement: Improve error message when failing to locate images
  • Enhancement: Support for node 13 and 14
  • Enhancement: Support for Electron
  • Enhancement: Native highlight

1.3.2

  • Enhancement: Revisit mouse speed settings

1.3.1

  • Bugfix: Wrong result size for scaled image search
  • Enhancement: Switch from robotjs to libnut
  • Enhancement: Update to OpenCV4
  • Enhancement: Enable matrix builds

1.3.0

  • Enhancement: Enabled prebuilt bindings for OpenCV

1.2.1

  • Enhancement: Exported Button enum

1.2.0

  • Bugfix: Drag & drop gestures were not working on macOS and Windows
  • Enhancement: mouse Public API now exposes pressButton and releaseButton methods

1.1.2

  • Bugfix: Clipboard copy calls did not resolve

1.1.1

  • Minor version upgrade for OpenCV dependency

1.1.0

  • Feature: nut.js now comes with a precompiled version of OpenCV

1.0.1

  • Bugfix: Check dimensions of ROIs to prevent access violations

1.0.0

  • API overhaul
  • find hooks
  • screen.waitFor
  • Code cleanup

0.1.0-beta.3

  • Improved error handling on image search

0.1.0-beta.2

  • Changed default screen.config.resourceDirectory to use process.cwd()

0.1.0-beta.1

  • Enabled pre-built OpenCV bindings via opencv4nodejs-prebuilt