@simular-ai/simulang-js 7.0.1 → 8.0.0
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/CHANGELOG.md +18 -0
- package/examples/element_at_point.mjs +75 -0
- package/index.d.ts +167 -44
- package/index.js +52 -52
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [8.0.0] - 2026-06-05
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `AccessibilityNode.fromPoint(x, y)` — element under a screen coordinate via the platform hit-test (UIA `ElementFromPoint` on Windows, `AXUIElementCopyElementAtPosition` on macOS, recursive AT-SPI `GetAccessibleAtPoint` on Linux). Coordinates are global desktop coordinates in OS-native units (physical pixels on Windows/Linux, logical points on macOS), the same space as `boundingBox()` and `MouseController`; returns an uncached, one-shot handle for reading properties such as `.boundingBox()` / `.overallDescription`, or `null` when the point has no accessible element (empty desktop, gaps, or — on Linux — outside the focused app). Throws only on a genuine backend failure.
|
|
15
|
+
- `AccessibilityTree.findByDescription(description)` — every node whose `overallDescription` exactly equals `description` (pre-order depth-first)
|
|
16
|
+
- `GroundingModel.checkAuth()`, `AskModel.checkAuth()`, and `SttModel.checkAuth()` — probe the provider's auth-check endpoint to validate credentials before launching any UI automation. Throws (and logs a warning) on rejection or transport failure; no-op for providers without an auth-check endpoint. Idiom: `try { model.checkAuth() } catch { process.exit(1) }`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `GroundingModel.default()` / `AskModel.default()` / `SttModel.default()` now produce a per-candidate diagnostic when no provider has working credentials, naming each provider and explaining exactly why its credentials were unavailable (env var unset, env var empty, credentials file missing, …). The previous error misleadingly said "no provider advertises a VLM service" even when the provider was correctly configured but its API-key env var was unset.
|
|
21
|
+
- Corrected the documented coordinate space across the API (`MouseController`, `Window.boundingBox()`, `AccessibilityNode.boundingBox()` / `fromPoint()`, `Screen.boundingBox()`, screenshots, and grounding output). Coordinates are in **OS-native units** — physical pixels on Windows/Linux and **logical points on macOS** (where one point spans two hardware pixels on a 2× display) — not uniformly "physical pixels" as previously stated. Behavior is unchanged; coordinates still round-trip between these APIs without conversion on a given OS.
|
|
22
|
+
|
|
23
|
+
### Breaking
|
|
24
|
+
|
|
25
|
+
- `Image.addGrid()` and `Screenshot.addGrid()` are renamed to `drawGrid()` to match the underlying `simulang-rs` API. Same signature and behavior; update call sites from `.addGrid(w, h)` to `.drawGrid(w, h)`.
|
|
26
|
+
- `Screenshot.toGlobalPhysicalPixels()` is renamed to `Screenshot.toGlobalDesktopCoordinates()`. The old name implied physical pixels, but the result is in the canonical global-desktop space (OS-native units — logical points on macOS, physical pixels on Windows/Linux). Same signature and behavior; update call sites from `.toGlobalPhysicalPixels(...)` to `.toGlobalDesktopCoordinates(...)`.
|
|
27
|
+
|
|
10
28
|
## [7.0.1] - 2026-05-22
|
|
11
29
|
|
|
12
30
|
## [7.0.0] - 2026-05-22
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Run: node examples/element_at_point.mjs
|
|
2
|
+
// Optionally pass coordinates: node examples/element_at_point.mjs 400 300
|
|
3
|
+
//
|
|
4
|
+
// Demonstrates the element-picker primitives:
|
|
5
|
+
// 1. AccessibilityNode.fromPoint(x, y) — hit-test the element under a
|
|
6
|
+
// screen coordinate (used per-poll to draw a hover highlight). The
|
|
7
|
+
// returned node is already actionable (activate / setValue / …).
|
|
8
|
+
// 2. AccessibilityTree.findByDescription(desc) — the picker's grounding
|
|
9
|
+
// check: is this element's overallDescription unique in the window?
|
|
10
|
+
// `isUnique` is just `matches.length === 1`.
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
AccessibilityNode,
|
|
14
|
+
AccessibilityTree,
|
|
15
|
+
MouseController,
|
|
16
|
+
Window,
|
|
17
|
+
ariaRoleToString,
|
|
18
|
+
} from '@simular-ai/simulang-js'
|
|
19
|
+
|
|
20
|
+
// Coordinates: explicit args, or the live cursor location.
|
|
21
|
+
const args = process.argv.slice(2)
|
|
22
|
+
const [x, y] = args.length >= 2 ? [Number(args[0]), Number(args[1])] : new MouseController().location()
|
|
23
|
+
|
|
24
|
+
// 1. Hit-test — cheap, resolves a single element. Returns null when the
|
|
25
|
+
// point has no accessible element (empty desktop, gaps, etc.).
|
|
26
|
+
const t0 = Date.now()
|
|
27
|
+
const node = AccessibilityNode.fromPoint(x, y)
|
|
28
|
+
if (!node) {
|
|
29
|
+
console.log(`=== No accessible element at (${x}, ${y}) (${Date.now() - t0}ms) ===`)
|
|
30
|
+
process.exit(0)
|
|
31
|
+
}
|
|
32
|
+
const description = node.overallDescription
|
|
33
|
+
console.log(`=== Element at (${x}, ${y}) — fromPoint in ${Date.now() - t0}ms ===`)
|
|
34
|
+
console.log(`role: ${ariaRoleToString(node.role)}`)
|
|
35
|
+
console.log(`name: ${JSON.stringify(node.name)}`)
|
|
36
|
+
console.log(`value: ${JSON.stringify(node.value)}`)
|
|
37
|
+
console.log(`description: ${JSON.stringify(description)}`)
|
|
38
|
+
console.log('bounds: ', node.boundingBox())
|
|
39
|
+
// The fromPoint node is already actionable — no tree round-trip to click it.
|
|
40
|
+
console.log('actions: ', node.supportedActions())
|
|
41
|
+
|
|
42
|
+
// 2. Uniqueness of the description across the whole window (the picker's
|
|
43
|
+
// grounding check). This walks the *entire* tree computing
|
|
44
|
+
// summary_with_context per node, so it is far heavier than fromPoint —
|
|
45
|
+
// especially on macOS, where every attribute read is a live AX IPC.
|
|
46
|
+
console.log('\n=== findByDescription on foreground window (app-scoped) ===')
|
|
47
|
+
const t1 = Date.now()
|
|
48
|
+
const tree = AccessibilityTree.fromForeground()
|
|
49
|
+
const matches = tree.findByDescription(description)
|
|
50
|
+
console.log(`matches: ${matches.length} (in ${Date.now() - t1}ms)`)
|
|
51
|
+
console.log(`isUnique: ${matches.length === 1}`)
|
|
52
|
+
if (matches.length > 1) {
|
|
53
|
+
console.log(
|
|
54
|
+
'Not a stable grounding key — the cursor is over a generic/nameless ' +
|
|
55
|
+
'container whose description many siblings share.',
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 3. Window-scoped uniqueness: resolve the window under the cursor and check
|
|
60
|
+
// uniqueness WITHIN that window only (cross-platform: AXWindow subtree on
|
|
61
|
+
// macOS, the HWND subtree on Windows). This is what the element picker
|
|
62
|
+
// should use so a description shared across other windows of the same app
|
|
63
|
+
// doesn't count against it.
|
|
64
|
+
console.log('\n=== findByDescription on hovered window (window-scoped) ===')
|
|
65
|
+
const window = Window.fromPoint(x, y)
|
|
66
|
+
if (!window) {
|
|
67
|
+
console.log(`No window under (${x}, ${y}).`)
|
|
68
|
+
} else {
|
|
69
|
+
console.log(`window: ${JSON.stringify(window.title)} (pid ${window.pid})`)
|
|
70
|
+
const t2 = Date.now()
|
|
71
|
+
const windowTree = AccessibilityTree.fromWindow(window)
|
|
72
|
+
const windowMatches = windowTree.findByDescription(description)
|
|
73
|
+
console.log(`matches: ${windowMatches.length} (in ${Date.now() - t2}ms)`)
|
|
74
|
+
console.log(`isUnique: ${windowMatches.length === 1}`)
|
|
75
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,26 @@ export declare class AccessibilityNode {
|
|
|
16
16
|
static fromFocusedApplication(): AccessibilityNode
|
|
17
17
|
/** Root node of the application identified by `pid`. */
|
|
18
18
|
static fromPid(pid: number): AccessibilityNode
|
|
19
|
+
/**
|
|
20
|
+
* Element at screen coordinates (`x`, `y`) via the platform hit-test
|
|
21
|
+
* (Windows UIA `ElementFromPoint`, macOS
|
|
22
|
+
* `AXUIElementCopyElementAtPosition`, Linux recursive AT-SPI
|
|
23
|
+
* `GetAccessibleAtPoint`).
|
|
24
|
+
*
|
|
25
|
+
* `(x, y)` are global desktop coordinates in the canonical coordinate space
|
|
26
|
+
* (OS-native units; see [`MouseController`])
|
|
27
|
+
* — the same space `.boundingBox()` and `MouseController` use, so a
|
|
28
|
+
* `boundingBox()` corner or cursor `location()` can be passed straight in.
|
|
29
|
+
* Returns an **uncached** handle suitable for one-shot reads of properties
|
|
30
|
+
* such as `.boundingBox()` or `.overallDescription`; it is not registered
|
|
31
|
+
* for ref-based action methods (`activate`, `setValue`, …).
|
|
32
|
+
*
|
|
33
|
+
* Returns `null` when the point has no accessible element (empty
|
|
34
|
+
* desktop, gaps between controls, or — on Linux — a point outside the
|
|
35
|
+
* focused application). Throws only on a genuine accessibility-backend
|
|
36
|
+
* failure.
|
|
37
|
+
*/
|
|
38
|
+
static fromPoint(x: number, y: number): AccessibilityNode | null
|
|
19
39
|
/** Cross-platform ARIA role. */
|
|
20
40
|
get role(): AriaRole
|
|
21
41
|
/** Accessible name (title / label). */
|
|
@@ -42,7 +62,9 @@ export declare class AccessibilityNode {
|
|
|
42
62
|
/** Whether the node accepts user input. */
|
|
43
63
|
get isEnabled(): boolean
|
|
44
64
|
/**
|
|
45
|
-
* Live bounding box of the element
|
|
65
|
+
* Live bounding box of the element on the global desktop, in the canonical
|
|
66
|
+
* coordinate space (OS-native units; see
|
|
67
|
+
* [`MouseController`]).
|
|
46
68
|
* `right` and `bottom` are exclusive (Playwright / DOM convention).
|
|
47
69
|
*/
|
|
48
70
|
boundingBox(): BoundingBox
|
|
@@ -138,6 +160,22 @@ export declare class AccessibilityTree {
|
|
|
138
160
|
* On Windows this is an HWND; on macOS it is a PID.
|
|
139
161
|
*/
|
|
140
162
|
static fromHwnd(hwnd: number): AccessibilityTree
|
|
163
|
+
/**
|
|
164
|
+
* Create an accessibility tree scoped to a single window.
|
|
165
|
+
*
|
|
166
|
+
* Unlike [`AccessibilityTree.fromForeground`] / [`fromPid`] — which on
|
|
167
|
+
* macOS scope to the whole application (every window plus the app menu
|
|
168
|
+
* bar) — this scopes to exactly the given window's subtree on **both**
|
|
169
|
+
* Windows and macOS. Use it to measure "is this element unique within
|
|
170
|
+
* this window", or to snapshot / act on one window of a multi-window
|
|
171
|
+
* app.
|
|
172
|
+
*
|
|
173
|
+
* The window is resolved once at construction; subsequent snapshots
|
|
174
|
+
* target that same window. On macOS the underlying `AXWindow` handle can
|
|
175
|
+
* go stale if the window is destroyed and recreated (as an `HWND` can on
|
|
176
|
+
* Windows).
|
|
177
|
+
*/
|
|
178
|
+
static fromWindow(window: Window): AccessibilityTree
|
|
141
179
|
/** Get the window title. */
|
|
142
180
|
get windowTitle(): string
|
|
143
181
|
/**
|
|
@@ -217,6 +255,15 @@ export declare class AccessibilityTree {
|
|
|
217
255
|
maxResults?: number | undefined | null,
|
|
218
256
|
collapseStructural?: boolean | undefined | null,
|
|
219
257
|
): Array<AccessibilityNodeJs>
|
|
258
|
+
/**
|
|
259
|
+
* Find every node whose `overallDescription`
|
|
260
|
+
* (`AXNodeSynthetic::summary_with_context`) is **exactly** equal to
|
|
261
|
+
* `description`, walked in pre-order depth-first.
|
|
262
|
+
*
|
|
263
|
+
* Clears existing refs; returned nodes carry `refId` values usable
|
|
264
|
+
* with the action methods (`activate`, `setValue`, …).
|
|
265
|
+
*/
|
|
266
|
+
findByDescription(description: string): Array<AccessibilityNodeJs>
|
|
220
267
|
}
|
|
221
268
|
|
|
222
269
|
/** Represents an application that can be opened. */
|
|
@@ -286,6 +333,17 @@ export declare class AskModel {
|
|
|
286
333
|
static availableAliases(): Array<string>
|
|
287
334
|
/** The wire-level model identifier sent in the request body. */
|
|
288
335
|
get name(): string
|
|
336
|
+
/**
|
|
337
|
+
* Check that the API key works. Throws if it doesn't.
|
|
338
|
+
*
|
|
339
|
+
* Call right after creating the model so a bad key fails fast,
|
|
340
|
+
* before any UI automation has had a chance to steal focus:
|
|
341
|
+
*
|
|
342
|
+
* ```ts
|
|
343
|
+
* try { model.checkAuth() } catch { process.exit(1) }
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
checkAuth(): void
|
|
289
347
|
/**
|
|
290
348
|
* Ask the model a question, optionally grounded in accessibility text
|
|
291
349
|
* and/or images.
|
|
@@ -502,16 +560,25 @@ export declare class GroundingModel {
|
|
|
502
560
|
static availableAliases(): Array<string>
|
|
503
561
|
/** The wire-level model identifier sent in the request body. */
|
|
504
562
|
get name(): string
|
|
563
|
+
/**
|
|
564
|
+
* Check that the API key works. Throws if it doesn't.
|
|
565
|
+
*
|
|
566
|
+
* Call right after creating the model so a bad key fails fast,
|
|
567
|
+
* before any UI automation has had a chance to steal focus:
|
|
568
|
+
*
|
|
569
|
+
* ```ts
|
|
570
|
+
* try { model.checkAuth() } catch { process.exit(1) }
|
|
571
|
+
* ```
|
|
572
|
+
*/
|
|
573
|
+
checkAuth(): void
|
|
505
574
|
/**
|
|
506
575
|
* Locate `concept` on `target` and return zero-based pixel coordinates
|
|
507
576
|
* `[x, y]`:
|
|
508
577
|
*
|
|
509
578
|
* * If `target` is an `Image`, coordinates are in **image-space**.
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
* screen space** — suitable to feed directly into primitives that
|
|
514
|
-
* expect global screen coordinates (e.g. `moveTo`, `clickAt`).
|
|
579
|
+
* * If `target` is a `Screenshot`, coordinates are in the **global desktop
|
|
580
|
+
* space** in OS-native units (may be negative on multi-monitor setups;
|
|
581
|
+
* see [`MouseController`]).
|
|
515
582
|
*
|
|
516
583
|
* Equivalent to `target.ground(model, concept)`.
|
|
517
584
|
*/
|
|
@@ -527,7 +594,7 @@ export declare class Image {
|
|
|
527
594
|
*
|
|
528
595
|
* Grid squares have the specified `width` and `height`.
|
|
529
596
|
*/
|
|
530
|
-
|
|
597
|
+
drawGrid(width: number, height: number): void
|
|
531
598
|
/**
|
|
532
599
|
* Compress the image by converting it to JPEG with the specified quality.
|
|
533
600
|
*
|
|
@@ -746,20 +813,35 @@ export declare class LoopbackSource {
|
|
|
746
813
|
}
|
|
747
814
|
|
|
748
815
|
/**
|
|
749
|
-
*
|
|
816
|
+
* Contains functions to control the mouse and to get the cursor position.
|
|
817
|
+
*
|
|
818
|
+
* # Canonical coordinate space
|
|
819
|
+
*
|
|
820
|
+
* This is the reference description of the coordinate space used throughout
|
|
821
|
+
* the library. `Window.boundingBox()`, `AccessibilityNode.boundingBox()`,
|
|
822
|
+
* `AccessibilityNode.fromPoint()`, screenshots, and grounding-model output
|
|
823
|
+
* all live in this same space, so coordinates round-trip between them
|
|
824
|
+
* **without conversion**.
|
|
825
|
+
*
|
|
826
|
+
* Absolute coordinates live on the **global desktop**: top-left origin at
|
|
827
|
+
* `(0, 0)` on the primary monitor, with the OS's native units. The unit is
|
|
828
|
+
* **not** the same on every OS:
|
|
750
829
|
*
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
* screenshots.
|
|
830
|
+
* - **Windows** and **Linux** use **physical pixels** (raw hardware pixels).
|
|
831
|
+
* - **macOS** uses **logical points** — on a 2× Retina display one point spans
|
|
832
|
+
* two hardware pixels, so coordinates are half the physical-pixel count.
|
|
755
833
|
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
*
|
|
834
|
+
* Within a single OS every function speaks that OS's unit, so the
|
|
835
|
+
* round-trip guarantee holds; only code that crosses into a *different*
|
|
836
|
+
* coordinate system (e.g. an Electron overlay measured in CSS pixels) needs to
|
|
837
|
+
* account for the per-OS unit. These are also the native units the OS
|
|
838
|
+
* input/accessibility APIs expect, so they are *not* the browser logical/CSS
|
|
839
|
+
* pixel.
|
|
761
840
|
*
|
|
762
|
-
*
|
|
841
|
+
* Monitors arranged to the left of or above the primary display contribute
|
|
842
|
+
* **negative** coordinates, so callers should not assume `x, y >= 0`. Use
|
|
843
|
+
* [`Screen.all`] / [`Screen.fromWindow`] to discover where the
|
|
844
|
+
* addressable region actually is.
|
|
763
845
|
*/
|
|
764
846
|
export declare class MouseController {
|
|
765
847
|
constructor()
|
|
@@ -775,11 +857,11 @@ export declare class MouseController {
|
|
|
775
857
|
* You can specify absolute coordinates or relative from the current
|
|
776
858
|
* position.
|
|
777
859
|
*
|
|
778
|
-
* With absolute coordinates, `(x, y)` is in the global
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
* monitors arranged above / to the left
|
|
782
|
-
*
|
|
860
|
+
* With absolute coordinates, `(x, y)` is in the global desktop space
|
|
861
|
+
* described on [`MouseController`]: top-left of the primary monitor is
|
|
862
|
+
* `(0, 0)`, OS-native units (physical pixels on Windows/Linux, logical
|
|
863
|
+
* points on macOS), and secondary monitors arranged above / to the left
|
|
864
|
+
* of the primary may have negative coordinates.
|
|
783
865
|
*
|
|
784
866
|
* With relative coordinates, a positive `x` moves the cursor `x`
|
|
785
867
|
* pixels to the right; a positive `y` moves it down.
|
|
@@ -792,7 +874,10 @@ export declare class MouseController {
|
|
|
792
874
|
* ones up/left.
|
|
793
875
|
*/
|
|
794
876
|
scroll(deltaX: number, deltaY: number): void
|
|
795
|
-
/**
|
|
877
|
+
/**
|
|
878
|
+
* Get the location of the mouse in the canonical global-desktop space
|
|
879
|
+
* (OS-native units; see [`MouseController`]).
|
|
880
|
+
*/
|
|
796
881
|
location(): [number, number]
|
|
797
882
|
}
|
|
798
883
|
|
|
@@ -926,7 +1011,7 @@ export declare class SamplesBuffer {
|
|
|
926
1011
|
transcribe(model: SttModel): string
|
|
927
1012
|
}
|
|
928
1013
|
|
|
929
|
-
/** Represents a
|
|
1014
|
+
/** Represents a connected display/screen on the global desktop. */
|
|
930
1015
|
export declare class Screen {
|
|
931
1016
|
/** Returns the main / primary screen. */
|
|
932
1017
|
static mainScreen(): Screen
|
|
@@ -962,9 +1047,10 @@ export declare class Screen {
|
|
|
962
1047
|
*/
|
|
963
1048
|
static all(): Array<Screen>
|
|
964
1049
|
/**
|
|
965
|
-
* Live bounding box of the screen
|
|
1050
|
+
* Live bounding box of the screen on the global desktop.
|
|
966
1051
|
*
|
|
967
|
-
* Top-left of the primary monitor is `(0, 0)`,
|
|
1052
|
+
* Top-left of the primary monitor is `(0, 0)`, in the canonical coordinate
|
|
1053
|
+
* space (OS-native units; see [`MouseController`]).
|
|
968
1054
|
* Monitors arranged to the left of or above the primary display
|
|
969
1055
|
* contribute **negative** `left` / `top`. `right` and `bottom` are
|
|
970
1056
|
* exclusive (Playwright / DOM convention), matching
|
|
@@ -985,7 +1071,7 @@ export declare class Screenshot {
|
|
|
985
1071
|
*
|
|
986
1072
|
* Grid squares have the specified `width` and `height`.
|
|
987
1073
|
*/
|
|
988
|
-
|
|
1074
|
+
drawGrid(width: number, height: number): void
|
|
989
1075
|
/**
|
|
990
1076
|
* Compress the image by converting it to JPEG with the specified quality.
|
|
991
1077
|
*
|
|
@@ -1015,23 +1101,27 @@ export declare class Screenshot {
|
|
|
1015
1101
|
*/
|
|
1016
1102
|
base64(): string
|
|
1017
1103
|
/**
|
|
1018
|
-
* Converts a point in this screenshot to global
|
|
1019
|
-
* coordinates.
|
|
1104
|
+
* Converts a point in this screenshot to global desktop coordinates.
|
|
1020
1105
|
*
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
1024
|
-
*
|
|
1106
|
+
* The result is in the library's canonical coordinate space (OS-native
|
|
1107
|
+
* units; see [`MouseController`]), so it can be fed straight to
|
|
1108
|
+
* `MouseController.moveMouse` without conversion.
|
|
1109
|
+
*
|
|
1110
|
+
* Screenshots may represent only part of a display, and the captured
|
|
1111
|
+
* region may have been resampled to a different image size, so this
|
|
1112
|
+
* rescales `(x, y)` from image space back to the captured region (for
|
|
1113
|
+
* example, when moving the mouse to the same on-screen point).
|
|
1025
1114
|
*
|
|
1026
1115
|
* See `ScreenshotCoordinateType` for how `coord_type` affects
|
|
1027
1116
|
* interpretation of `(x, y)`.
|
|
1028
1117
|
*/
|
|
1029
|
-
|
|
1118
|
+
toGlobalDesktopCoordinates(x: number, y: number, coordType: ScreenshotCoordinateType): [number, number]
|
|
1030
1119
|
/**
|
|
1031
1120
|
* Locate `concept` on this screenshot using the given grounding model and
|
|
1032
|
-
* return the corresponding **global
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1121
|
+
* return the corresponding **global desktop coordinates** `[x, y]` in
|
|
1122
|
+
* OS-native units (may be negative on multi-monitor setups; see
|
|
1123
|
+
* [`MouseController`]). The output can be fed
|
|
1124
|
+
* directly to primitives that expect global screen coordinates.
|
|
1035
1125
|
*
|
|
1036
1126
|
* Equivalent to `model.ground(screenshot, concept)`.
|
|
1037
1127
|
*/
|
|
@@ -1039,8 +1129,9 @@ export declare class Screenshot {
|
|
|
1039
1129
|
}
|
|
1040
1130
|
|
|
1041
1131
|
/**
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1132
|
+
* How a screenshot-relative `(x, y)` coordinate is expressed: as absolute
|
|
1133
|
+
* screenshot-image pixels or normalized to a fixed range. Construct one with
|
|
1134
|
+
* [`ScreenshotCoordinateType.absolute`] or [`ScreenshotCoordinateType.normalized`].
|
|
1044
1135
|
*/
|
|
1045
1136
|
export declare class ScreenshotCoordinateType {
|
|
1046
1137
|
/**
|
|
@@ -1089,6 +1180,17 @@ export declare class SttModel {
|
|
|
1089
1180
|
static availableAliases(): Array<string>
|
|
1090
1181
|
/** The wire-level model identifier sent in the request body. */
|
|
1091
1182
|
get name(): string
|
|
1183
|
+
/**
|
|
1184
|
+
* Check that the API key works. Throws if it doesn't.
|
|
1185
|
+
*
|
|
1186
|
+
* Call right after creating the model so a bad key fails fast,
|
|
1187
|
+
* before any UI automation has had a chance to steal focus:
|
|
1188
|
+
*
|
|
1189
|
+
* ```ts
|
|
1190
|
+
* try { model.checkAuth() } catch { process.exit(1) }
|
|
1191
|
+
* ```
|
|
1192
|
+
*/
|
|
1193
|
+
checkAuth(): void
|
|
1092
1194
|
/** Transcribe a single audio chunk and return the recognised text. */
|
|
1093
1195
|
transcribe(audio: SamplesBuffer): string
|
|
1094
1196
|
}
|
|
@@ -1114,12 +1216,32 @@ export declare class Window {
|
|
|
1114
1216
|
static allForPid(pid: number): Array<Window>
|
|
1115
1217
|
/** All visible top-level windows across every process. */
|
|
1116
1218
|
static all(): Array<Window>
|
|
1219
|
+
/**
|
|
1220
|
+
* The top-level window at screen coordinates `(x, y)`, or `null` when no
|
|
1221
|
+
* window sits under the point.
|
|
1222
|
+
*
|
|
1223
|
+
* `(x, y)` are global desktop coordinates in the canonical coordinate
|
|
1224
|
+
* space (OS-native units; see [`MouseController`]) — the same space
|
|
1225
|
+
* `Window.boundingBox`, `AccessibilityNode.fromPoint`, and
|
|
1226
|
+
* `MouseController.location` use, so a cursor `location()` can be passed
|
|
1227
|
+
* straight in.
|
|
1228
|
+
*
|
|
1229
|
+
* Platform notes:
|
|
1230
|
+
* - **macOS**: returns the containing `AXWindow` of the element under the
|
|
1231
|
+
* cursor — the window itself, not the whole application.
|
|
1232
|
+
* - **Windows**: returns the top-level window (`GA_ROOT`) of whatever
|
|
1233
|
+
* control sits under the cursor.
|
|
1234
|
+
* - **Linux**: always `null` (no per-point window hit-test).
|
|
1235
|
+
*/
|
|
1236
|
+
static fromPoint(x: number, y: number): Window | null
|
|
1117
1237
|
/** Window title (may be empty). */
|
|
1118
1238
|
get title(): string
|
|
1119
1239
|
/** Process ID that owns this window. */
|
|
1120
1240
|
get pid(): number
|
|
1121
1241
|
/**
|
|
1122
|
-
* Live bounding box of the window
|
|
1242
|
+
* Live bounding box of the window on the global desktop, in the canonical
|
|
1243
|
+
* coordinate space (OS-native units; see
|
|
1244
|
+
* [`MouseController`]).
|
|
1123
1245
|
* `right` and `bottom` are exclusive (Playwright / DOM convention).
|
|
1124
1246
|
* Coordinates can be negative when the window sits on a monitor that
|
|
1125
1247
|
* is arranged to the left of / above the primary display.
|
|
@@ -1165,9 +1287,10 @@ export declare class Window {
|
|
|
1165
1287
|
/**
|
|
1166
1288
|
* Move the cursor to a point inside this window.
|
|
1167
1289
|
*
|
|
1168
|
-
* `(x, y)` are **window-frame-relative
|
|
1169
|
-
*
|
|
1170
|
-
* title bar and
|
|
1290
|
+
* `(x, y)` are **window-frame-relative**, in OS-native units (physical
|
|
1291
|
+
* pixels on Windows/Linux, logical points on macOS) — `(0, 0)` is the
|
|
1292
|
+
* top-left of [`Window.boundingBox`], which includes the title bar and
|
|
1293
|
+
* other OS chrome.
|
|
1171
1294
|
*
|
|
1172
1295
|
* Does **not** focus the window. Call [`Window.focus`] (or
|
|
1173
1296
|
* [`Instance.focus`]) first if the click target requires the window
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@simular-ai/simulang-js-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@simular-ai/simulang-js-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
80
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@simular-ai/simulang-js-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@simular-ai/simulang-js-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
96
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@simular-ai/simulang-js-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@simular-ai/simulang-js-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
117
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@simular-ai/simulang-js-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@simular-ai/simulang-js-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
133
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@simular-ai/simulang-js-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@simular-ai/simulang-js-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
150
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@simular-ai/simulang-js-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@simular-ai/simulang-js-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
166
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@simular-ai/simulang-js-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@simular-ai/simulang-js-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
185
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@simular-ai/simulang-js-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@simular-ai/simulang-js-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
201
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@simular-ai/simulang-js-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@simular-ai/simulang-js-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
217
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@simular-ai/simulang-js-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@simular-ai/simulang-js-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
237
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@simular-ai/simulang-js-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@simular-ai/simulang-js-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
253
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@simular-ai/simulang-js-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
274
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@simular-ai/simulang-js-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
290
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@simular-ai/simulang-js-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
308
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@simular-ai/simulang-js-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
324
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@simular-ai/simulang-js-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
342
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@simular-ai/simulang-js-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
358
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@simular-ai/simulang-js-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
376
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@simular-ai/simulang-js-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
392
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@simular-ai/simulang-js-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
410
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@simular-ai/simulang-js-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
426
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@simular-ai/simulang-js-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
443
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@simular-ai/simulang-js-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@simular-ai/simulang-js-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
459
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@simular-ai/simulang-js-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@simular-ai/simulang-js-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
479
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@simular-ai/simulang-js-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@simular-ai/simulang-js-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
495
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@simular-ai/simulang-js-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@simular-ai/simulang-js-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
511
|
+
if (bindingPackageVersion !== '8.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 8.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simular-ai/simulang-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Node.js bindings for simulang-rs",
|
|
5
5
|
"main": "wrapped.js",
|
|
6
6
|
"types": "./wrapped.d.ts",
|
|
@@ -82,21 +82,21 @@
|
|
|
82
82
|
"prepare": "husky"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@napi-rs/cli": "^3.
|
|
85
|
+
"@napi-rs/cli": "^3.7.0",
|
|
86
86
|
"@oxc-node/core": "^0.1.0",
|
|
87
87
|
"@taplo/cli": "^0.7.0",
|
|
88
|
-
"@types/node": "^25.
|
|
88
|
+
"@types/node": "^25.9.1",
|
|
89
89
|
"husky": "^9.1.7",
|
|
90
|
-
"lint-staged": "^17.0.
|
|
91
|
-
"npm-run-all2": "^
|
|
92
|
-
"oxlint": "^1.
|
|
90
|
+
"lint-staged": "^17.0.5",
|
|
91
|
+
"npm-run-all2": "^9.0.1",
|
|
92
|
+
"oxlint": "^1.67.0",
|
|
93
93
|
"prettier": "^3.8.2",
|
|
94
94
|
"tinybench": "^6.0.0",
|
|
95
95
|
"typedoc": "^0.28.19",
|
|
96
96
|
"typedoc-plugin-frontmatter": "^1.3.1",
|
|
97
97
|
"typedoc-plugin-markdown": "^4.11.0",
|
|
98
98
|
"typescript": "^6.0.2",
|
|
99
|
-
"vitest": "^4.1.
|
|
99
|
+
"vitest": "^4.1.7"
|
|
100
100
|
},
|
|
101
101
|
"lint-staged": {
|
|
102
102
|
"*.@(js|ts|tsx)": [
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
"arrowParens": "always"
|
|
118
118
|
},
|
|
119
119
|
"optionalDependencies": {
|
|
120
|
-
"@simular-ai/simulang-js-win32-x64-msvc": "
|
|
121
|
-
"@simular-ai/simulang-js-win32-arm64-msvc": "
|
|
122
|
-
"@simular-ai/simulang-js-darwin-x64": "
|
|
123
|
-
"@simular-ai/simulang-js-darwin-arm64": "
|
|
124
|
-
"@simular-ai/simulang-js-linux-x64-gnu": "
|
|
125
|
-
"@simular-ai/simulang-js-linux-arm64-gnu": "
|
|
120
|
+
"@simular-ai/simulang-js-win32-x64-msvc": "8.0.0",
|
|
121
|
+
"@simular-ai/simulang-js-win32-arm64-msvc": "8.0.0",
|
|
122
|
+
"@simular-ai/simulang-js-darwin-x64": "8.0.0",
|
|
123
|
+
"@simular-ai/simulang-js-darwin-arm64": "8.0.0",
|
|
124
|
+
"@simular-ai/simulang-js-linux-x64-gnu": "8.0.0",
|
|
125
|
+
"@simular-ai/simulang-js-linux-arm64-gnu": "8.0.0"
|
|
126
126
|
}
|
|
127
127
|
}
|