@simular-ai/simulang-js 6.0.1 → 7.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/CHANGELOG.md +43 -0
- package/LICENSE +2 -2
- package/README.md +4 -0
- package/bin/init-claude.mjs +0 -0
- package/index.d.ts +230 -39
- package/index.js +52 -52
- package/package.json +11 -10
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@simular-ai/simulang-js` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [7.0.1] - 2026-05-22
|
|
11
|
+
|
|
12
|
+
## [7.0.0] - 2026-05-22
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `Instance.windows()` — enumerate visible top-level windows belonging to a specific opened application (companion to the global `Window.all()` / `Window.allForPid()` enumerators).
|
|
17
|
+
- `Window.boundingBox()` — live bounding box of a window in global physical pixels (`right` / `bottom` exclusive, Playwright / DOM convention).
|
|
18
|
+
- `Screen.boundingBox()` — live bounding box of a screen in global physical pixels (matches `Window.boundingBox()` shape; secondary monitors may report negative `left` / `top`).
|
|
19
|
+
- `Instance.close()`, `Instance.kill()`, and `Instance.isRunning()` — request graceful exit, force-terminate, or poll whether the underlying process is still running.
|
|
20
|
+
- `Screen.all()`, `Screen.fromWindow(window)`, and `Window.screen()` — enumerate connected displays and find the screen a specific window lives on (multi-monitor support). Matches the OS-native algorithm (`NSWindow.screen` on macOS, `MonitorFromWindow` on Windows); throws when the window has no measurable overlap with any display.
|
|
21
|
+
- `Window.focus()` — bring a specific window to the foreground.
|
|
22
|
+
- `Window.moveMouse()`, `Window.button()`, `Window.click()`, `Window.scroll()` — frame-relative mouse input on a window. Coordinates are relative to the window's `boundingBox()` top-left (i.e. include the title bar / chrome); the caller is responsible for focusing the window first if needed.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Clarified that mouse coordinates in `MouseController` are in the **global virtual desktop** (top-left of the primary monitor at `(0, 0)`, physical pixels, may be **negative** on secondary monitors arranged to the left of / above the primary). The previous "current screen" wording was wrong on multi-monitor setups.
|
|
27
|
+
|
|
28
|
+
### Breaking
|
|
29
|
+
|
|
30
|
+
- `Screen.dimensions()` is removed; use `Screen.boundingBox()` and read its `right - left` / `bottom - top` (or the `left` / `top` origin). The previous `[x, y, width, height]` tuple shape was redundant with `Window.boundingBox()` and the accessibility-tree `BoundingBox`, and a single canonical shape is friendlier for AI agents driving the API.
|
|
31
|
+
|
|
32
|
+
## [6.0.1] - 2026-05-16
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- `AskModel` (`AskModel.default()`, `AskModel.byAlias()`, `AskModel.availableAliases()`, `ask()`) — JS bindings for the `ask` LLM primitive (OpenAI-compatible chat completions, optional vision via `Image` attachments).
|
|
37
|
+
|
|
38
|
+
## [6.0.0] - 2026-05-15
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- `setPauseHook(fn | null)` on the JS wrapper — synchronous hook invoked before every exported call; used by `@simular-ai/simulang-log-viewer` for pause/grab behavior without wrapping each API by hand.
|
|
43
|
+
- Default stderr logging on `import '@simular-ai/simulang-js'` — `initLogger` auto-installs unless overridden; filter follows `RUST_LOG` or `simulang_rs=info,warn`.
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026 Simular
|
|
3
|
+
Copyright (c) 2026 Simular LLC
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -73,3 +73,7 @@ You can also point `simulang` at a local `simulang-js` checkout during developme
|
|
|
73
73
|
```bash
|
|
74
74
|
simulang run --simulang-js=/path/to/simulang-js my-script.js
|
|
75
75
|
```
|
|
76
|
+
|
|
77
|
+
## Changelog
|
|
78
|
+
|
|
79
|
+
See [`CHANGELOG.md`](./CHANGELOG.md) for version history and unreleased API changes.
|
package/bin/init-claude.mjs
CHANGED
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -87,7 +87,13 @@ export declare class AccessibilityNode {
|
|
|
87
87
|
* against each node's `overallDescription`
|
|
88
88
|
* - `threshold` – minimum score to keep a node
|
|
89
89
|
*/
|
|
90
|
-
scoredSearch(
|
|
90
|
+
scoredSearch(
|
|
91
|
+
order: TraversalOrder,
|
|
92
|
+
maxNodes: number,
|
|
93
|
+
collapseStructural: boolean,
|
|
94
|
+
query: string,
|
|
95
|
+
threshold: number,
|
|
96
|
+
): Array<AccessibilityNode>
|
|
91
97
|
/** Invoke / click the element (button, link, menu item). */
|
|
92
98
|
activate(): void
|
|
93
99
|
/** Set the text value of the element (textbox, combobox, …). */
|
|
@@ -112,9 +118,20 @@ export declare class AccessibilityNode {
|
|
|
112
118
|
* ref-based actions for desktop automation (Windows UIA).
|
|
113
119
|
*/
|
|
114
120
|
export declare class AccessibilityTree {
|
|
115
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Create an accessibility tree bound to the current foreground window.
|
|
123
|
+
*
|
|
124
|
+
* The foreground window is resolved **once** at construction time and
|
|
125
|
+
* the resulting identifier (HWND on Windows, PID on macOS) is stored
|
|
126
|
+
* — subsequent snapshots target that same window even if the user
|
|
127
|
+
* alt-tabs away.
|
|
128
|
+
*/
|
|
116
129
|
static fromForeground(): AccessibilityTree
|
|
117
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Create an accessibility tree bound to the first visible window of a
|
|
132
|
+
* process. The window is selected at construction time; subsequent
|
|
133
|
+
* snapshots target that same window.
|
|
134
|
+
*/
|
|
118
135
|
static fromPid(pid: number): AccessibilityTree
|
|
119
136
|
/**
|
|
120
137
|
* Create an accessibility tree from a platform-specific window identifier.
|
|
@@ -123,11 +140,20 @@ export declare class AccessibilityTree {
|
|
|
123
140
|
static fromHwnd(hwnd: number): AccessibilityTree
|
|
124
141
|
/** Get the window title. */
|
|
125
142
|
get windowTitle(): string
|
|
126
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* Get the window handle as an integer ID.
|
|
145
|
+
* On Windows this is the HWND; on macOS it is the PID.
|
|
146
|
+
*/
|
|
127
147
|
get windowId(): number
|
|
128
148
|
/**
|
|
129
149
|
* Take a snapshot of the window's accessibility tree.
|
|
130
150
|
*
|
|
151
|
+
* Re-resolves the root through `Window::node()` so each call sees
|
|
152
|
+
* current data. On Windows the resolve issues a single
|
|
153
|
+
* `BuildUpdatedCache` IPC; the recursive walk over children and
|
|
154
|
+
* properties then stays entirely in-process, ~40× faster than
|
|
155
|
+
* walking a live `cached: false` root.
|
|
156
|
+
*
|
|
131
157
|
* `visible_only` (default `false`) controls whether nodes whose
|
|
132
158
|
* non-standard `AXVisible` attribute reads `false` are dropped from
|
|
133
159
|
* the result.
|
|
@@ -183,7 +209,14 @@ export declare class AccessibilityTree {
|
|
|
183
209
|
* Clears existing refs; returned nodes carry `refId` values usable
|
|
184
210
|
* with action methods (`activate`, `setValue`, …).
|
|
185
211
|
*/
|
|
186
|
-
find(
|
|
212
|
+
find(
|
|
213
|
+
order: TraversalOrder,
|
|
214
|
+
role?: AriaRole | undefined | null,
|
|
215
|
+
name?: string | undefined | null,
|
|
216
|
+
visibleOnly?: boolean | undefined | null,
|
|
217
|
+
maxResults?: number | undefined | null,
|
|
218
|
+
collapseStructural?: boolean | undefined | null,
|
|
219
|
+
): Array<AccessibilityNodeJs>
|
|
187
220
|
}
|
|
188
221
|
|
|
189
222
|
/** Represents an application that can be opened. */
|
|
@@ -214,7 +247,12 @@ export declare class App {
|
|
|
214
247
|
* When `wait_for_load_complete` is true, this blocks for a short, fixed
|
|
215
248
|
* delay to allow the app or URL to become responsive before returning.
|
|
216
249
|
*/
|
|
217
|
-
open(
|
|
250
|
+
open(
|
|
251
|
+
url: string | undefined | null,
|
|
252
|
+
focusPolicy: FocusPolicy,
|
|
253
|
+
visibility: Visibility,
|
|
254
|
+
waitForLoadComplete: boolean,
|
|
255
|
+
): Instance
|
|
218
256
|
}
|
|
219
257
|
|
|
220
258
|
/**
|
|
@@ -547,6 +585,8 @@ export declare class Instance {
|
|
|
547
585
|
isFocused(): boolean
|
|
548
586
|
/** Brings the instance to the foreground and gives it focus. */
|
|
549
587
|
focus(): boolean
|
|
588
|
+
/** Returns all visible top-level windows belonging to this instance. */
|
|
589
|
+
windows(): Array<Window>
|
|
550
590
|
content(): string
|
|
551
591
|
/** Returns true if the instance has an accessibility tree. */
|
|
552
592
|
isAccessible(): boolean
|
|
@@ -564,6 +604,19 @@ export declare class Instance {
|
|
|
564
604
|
* instance, we should disable the accessibility tree to save resources.
|
|
565
605
|
*/
|
|
566
606
|
disableAccessibility(): void
|
|
607
|
+
/**
|
|
608
|
+
* Request the application to exit gracefully. Returns when the request has
|
|
609
|
+
* been dispatched, not when the process has actually terminated; poll
|
|
610
|
+
* [`Self::is_running`] if you need to wait.
|
|
611
|
+
*/
|
|
612
|
+
close(): void
|
|
613
|
+
/**
|
|
614
|
+
* Force-terminate immediately. The application gets no chance to save state
|
|
615
|
+
* or run cleanup handlers.
|
|
616
|
+
*/
|
|
617
|
+
kill(): void
|
|
618
|
+
/** `true` if the underlying process is still running. Cheap, non-blocking. */
|
|
619
|
+
isRunning(): boolean
|
|
567
620
|
/**
|
|
568
621
|
* Search this application's accessibility tree by *concept text*, using
|
|
569
622
|
* bag-of-words paired-Jaccard scoring against each node's
|
|
@@ -588,7 +641,13 @@ export declare class Instance {
|
|
|
588
641
|
* methods (`activate`, `setValue`, …) directly on them, walk children
|
|
589
642
|
* with `.children()`, or render a snapshot with `.snapshot()`.
|
|
590
643
|
*/
|
|
591
|
-
scoredSearch(
|
|
644
|
+
scoredSearch(
|
|
645
|
+
order: TraversalOrder,
|
|
646
|
+
maxNodes: number,
|
|
647
|
+
collapseStructural: boolean,
|
|
648
|
+
query: string,
|
|
649
|
+
threshold: number,
|
|
650
|
+
): Array<AccessibilityNode>
|
|
592
651
|
}
|
|
593
652
|
|
|
594
653
|
/**
|
|
@@ -687,11 +746,19 @@ export declare class LoopbackSource {
|
|
|
687
746
|
}
|
|
688
747
|
|
|
689
748
|
/**
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
* coordinates
|
|
693
|
-
*
|
|
694
|
-
*
|
|
749
|
+
* Mouse cursor control and queries.
|
|
750
|
+
*
|
|
751
|
+
* Absolute coordinates live in the **global virtual desktop** — top-left
|
|
752
|
+
* origin at `(0, 0)` on the primary monitor, physical pixels, and the
|
|
753
|
+
* same coordinate space used by `Window.boundingBox()`, `Screen`, and
|
|
754
|
+
* screenshots.
|
|
755
|
+
*
|
|
756
|
+
* Monitors arranged to the left of or above the primary display
|
|
757
|
+
* contribute **negative** coordinates, so callers should not assume
|
|
758
|
+
* `x, y >= 0`. Use [`Screen.all`] / [`Screen.fromWindow`] (or
|
|
759
|
+
* [`Window.moveMouse`] for window-frame-relative input) to discover
|
|
760
|
+
* where the addressable region actually is.
|
|
761
|
+
*
|
|
695
762
|
* The same coordinate system is used on all operating systems.
|
|
696
763
|
*/
|
|
697
764
|
export declare class MouseController {
|
|
@@ -708,14 +775,14 @@ export declare class MouseController {
|
|
|
708
775
|
* You can specify absolute coordinates or relative from the current
|
|
709
776
|
* position.
|
|
710
777
|
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
778
|
+
* With absolute coordinates, `(x, y)` is in the global virtual
|
|
779
|
+
* desktop described on [`MouseController`]: top-left of the
|
|
780
|
+
* primary monitor is `(0, 0)`, physical pixels, and secondary
|
|
781
|
+
* monitors arranged above / to the left of the primary may have
|
|
782
|
+
* **negative** coordinates.
|
|
714
783
|
*
|
|
715
|
-
*
|
|
716
|
-
*
|
|
717
|
-
* moves the mouse cursor to the left. A positive value of y moves
|
|
718
|
-
* the mouse cursor down, a negative one moves the mouse cursor up.
|
|
784
|
+
* With relative coordinates, a positive `x` moves the cursor `x`
|
|
785
|
+
* pixels to the right; a positive `y` moves it down.
|
|
719
786
|
*/
|
|
720
787
|
moveMouse(x: number, y: number, coordinate: Coordinate): void
|
|
721
788
|
/**
|
|
@@ -859,22 +926,54 @@ export declare class SamplesBuffer {
|
|
|
859
926
|
transcribe(model: SttModel): string
|
|
860
927
|
}
|
|
861
928
|
|
|
862
|
-
/** Represents a physical display/screen. */
|
|
929
|
+
/** Represents a physical display/screen in the global virtual desktop. */
|
|
863
930
|
export declare class Screen {
|
|
864
|
-
/** Returns the
|
|
931
|
+
/** Returns the main / primary screen. */
|
|
865
932
|
static mainScreen(): Screen
|
|
866
933
|
/**
|
|
867
|
-
* Returns the screen
|
|
868
|
-
*
|
|
869
|
-
*
|
|
934
|
+
* Returns the screen on which the mouse cursor is located.
|
|
935
|
+
* Falls back to the main screen if the cursor is not on any
|
|
936
|
+
* connected display.
|
|
870
937
|
*/
|
|
871
938
|
static fromCurrentMouseLocation(): Screen
|
|
872
939
|
/**
|
|
873
|
-
* Returns the
|
|
940
|
+
* Returns the screen the given window is on.
|
|
941
|
+
*
|
|
942
|
+
* "On" is the connected display that contains the largest area of
|
|
943
|
+
* [`Window.boundingBox`] — the same heuristic the OS uses to decide
|
|
944
|
+
* a window's "owning" screen, so the result matches what the system
|
|
945
|
+
* considers the window's screen (the one its window controls render
|
|
946
|
+
* on, the one full-screen mode targets, etc.).
|
|
947
|
+
*
|
|
948
|
+
* Throws if the window has no measurable overlap with any connected
|
|
949
|
+
* display — for example when the window is fully off-screen,
|
|
950
|
+
* minimised to an off-screen state, or on a virtual desktop with no
|
|
951
|
+
* attached display. There is no "correct" screen to pick in that
|
|
952
|
+
* case; callers that prefer a fallback can wrap in `try` / `catch`
|
|
953
|
+
* and call [`Screen.mainScreen`].
|
|
954
|
+
*/
|
|
955
|
+
static fromWindow(window: Window): Screen
|
|
956
|
+
/**
|
|
957
|
+
* All currently connected displays.
|
|
874
958
|
*
|
|
875
|
-
*
|
|
959
|
+
* Order is platform-defined; do not rely on it. The result is a
|
|
960
|
+
* snapshot — connect / disconnect events that happen during the
|
|
961
|
+
* call are not signalled.
|
|
876
962
|
*/
|
|
877
|
-
|
|
963
|
+
static all(): Array<Screen>
|
|
964
|
+
/**
|
|
965
|
+
* Live bounding box of the screen in the global virtual desktop.
|
|
966
|
+
*
|
|
967
|
+
* Top-left of the primary monitor is `(0, 0)`, physical pixels.
|
|
968
|
+
* Monitors arranged to the left of or above the primary display
|
|
969
|
+
* contribute **negative** `left` / `top`. `right` and `bottom` are
|
|
970
|
+
* exclusive (Playwright / DOM convention), matching
|
|
971
|
+
* [`Window.boundingBox`].
|
|
972
|
+
*
|
|
973
|
+
* For just the size, read `right - left` and `bottom - top` on the
|
|
974
|
+
* returned box.
|
|
975
|
+
*/
|
|
976
|
+
boundingBox(): BoundingBox
|
|
878
977
|
}
|
|
879
978
|
|
|
880
979
|
/** Represents a screenshot capture. */
|
|
@@ -1019,6 +1118,28 @@ export declare class Window {
|
|
|
1019
1118
|
get title(): string
|
|
1020
1119
|
/** Process ID that owns this window. */
|
|
1021
1120
|
get pid(): number
|
|
1121
|
+
/**
|
|
1122
|
+
* Live bounding box of the window in global virtual-desktop pixels.
|
|
1123
|
+
* `right` and `bottom` are exclusive (Playwright / DOM convention).
|
|
1124
|
+
* Coordinates can be negative when the window sits on a monitor that
|
|
1125
|
+
* is arranged to the left of / above the primary display.
|
|
1126
|
+
*/
|
|
1127
|
+
boundingBox(): BoundingBox
|
|
1128
|
+
/**
|
|
1129
|
+
* The screen this window currently lives on.
|
|
1130
|
+
*
|
|
1131
|
+
* "Lives on" is the connected display that contains the largest
|
|
1132
|
+
* area of [`Window.boundingBox`] — the same heuristic the OS uses
|
|
1133
|
+
* to decide a window's "owning" screen, so the result matches what
|
|
1134
|
+
* the system considers the window's screen (the one its window
|
|
1135
|
+
* controls render on, the one full-screen mode targets, etc.).
|
|
1136
|
+
*
|
|
1137
|
+
* Throws if the window has no measurable overlap with any connected
|
|
1138
|
+
* display. Callers that prefer a fallback can wrap in
|
|
1139
|
+
* `try` / `catch` and call [`Screen.mainScreen`]. Equivalent to
|
|
1140
|
+
* `Screen.fromWindow(window)`.
|
|
1141
|
+
*/
|
|
1142
|
+
screen(): Screen
|
|
1022
1143
|
/** Minimize the window (hide to taskbar / Dock). */
|
|
1023
1144
|
minimize(): void
|
|
1024
1145
|
/** Maximize / zoom the window. */
|
|
@@ -1028,6 +1149,56 @@ export declare class Window {
|
|
|
1028
1149
|
* pressing Alt+F4 / Cmd+W).
|
|
1029
1150
|
*/
|
|
1030
1151
|
close(): void
|
|
1152
|
+
/**
|
|
1153
|
+
* Bring this window to the foreground and give it keyboard focus.
|
|
1154
|
+
*
|
|
1155
|
+
* Platform notes:
|
|
1156
|
+
* - **macOS**: activates the owning application and raises the
|
|
1157
|
+
* window via the accessibility `AXRaise` action.
|
|
1158
|
+
* - **Windows**: `SetForegroundWindow` + `BringWindowToTop`.
|
|
1159
|
+
* Subject to the foreground-lock rules — may silently downgrade
|
|
1160
|
+
* to a taskbar flash if the foreground process hasn't granted
|
|
1161
|
+
* permission.
|
|
1162
|
+
* - **Linux**: EWMH `_NET_ACTIVE_WINDOW` client message to the WM.
|
|
1163
|
+
*/
|
|
1164
|
+
focus(): boolean
|
|
1165
|
+
/**
|
|
1166
|
+
* Move the cursor to a point inside this window.
|
|
1167
|
+
*
|
|
1168
|
+
* `(x, y)` are **window-frame-relative** physical pixels — `(0, 0)`
|
|
1169
|
+
* is the top-left of [`Window.boundingBox`], which includes the
|
|
1170
|
+
* title bar and other OS chrome.
|
|
1171
|
+
*
|
|
1172
|
+
* Does **not** focus the window. Call [`Window.focus`] (or
|
|
1173
|
+
* [`Instance.focus`]) first if the click target requires the window
|
|
1174
|
+
* to be active.
|
|
1175
|
+
*/
|
|
1176
|
+
moveMouse(x: number, y: number): void
|
|
1177
|
+
/**
|
|
1178
|
+
* Press / release a mouse button at the cursor's current location.
|
|
1179
|
+
*
|
|
1180
|
+
* Provided for ergonomic parity with [`Window.moveMouse`] — combine
|
|
1181
|
+
* the two for press / drag / release patterns. Takes no coordinate
|
|
1182
|
+
* argument: pair with `moveMouse` when you need to control where the
|
|
1183
|
+
* press lands.
|
|
1184
|
+
*/
|
|
1185
|
+
button(button: Button, direction: Direction): void
|
|
1186
|
+
/**
|
|
1187
|
+
* Move the cursor to `(x, y)` inside this window and synthesise a
|
|
1188
|
+
* mouse button event. Sugar for `moveMouse(x, y); button(...)`.
|
|
1189
|
+
*
|
|
1190
|
+
* Coordinates are window-frame-relative (see [`Window.moveMouse`]).
|
|
1191
|
+
* Does not focus the window.
|
|
1192
|
+
*/
|
|
1193
|
+
click(x: number, y: number, button: Button, direction: Direction): void
|
|
1194
|
+
/**
|
|
1195
|
+
* Scroll the wheel by `(deltaX, deltaY)` ticks at the cursor's
|
|
1196
|
+
* current location. Positive `deltaY` scrolls down; positive
|
|
1197
|
+
* `deltaX` scrolls right. Does not reposition the cursor first —
|
|
1198
|
+
* pair with [`Window.moveMouse`] if you need scrolling to happen at
|
|
1199
|
+
* a specific point inside the window.
|
|
1200
|
+
*/
|
|
1201
|
+
scroll(deltaX: number, deltaY: number): void
|
|
1031
1202
|
/**
|
|
1032
1203
|
* Render the window's accessibility subtree as an indented
|
|
1033
1204
|
* Playwright-style aria snapshot.
|
|
@@ -1065,7 +1236,13 @@ export declare class Window {
|
|
|
1065
1236
|
* methods (`activate`, `setValue`, …) directly on them, walk children
|
|
1066
1237
|
* with `.children()`, or render a snapshot with `.snapshot()`.
|
|
1067
1238
|
*/
|
|
1068
|
-
scoredSearch(
|
|
1239
|
+
scoredSearch(
|
|
1240
|
+
order: TraversalOrder,
|
|
1241
|
+
maxNodes: number,
|
|
1242
|
+
collapseStructural: boolean,
|
|
1243
|
+
query: string,
|
|
1244
|
+
threshold: number,
|
|
1245
|
+
): Array<AccessibilityNode>
|
|
1069
1246
|
}
|
|
1070
1247
|
|
|
1071
1248
|
export interface AccessibilityNodeJs {
|
|
@@ -1178,7 +1355,7 @@ export declare enum AriaRole {
|
|
|
1178
1355
|
TreeItem = 84,
|
|
1179
1356
|
Treegrid = 85,
|
|
1180
1357
|
Video = 86,
|
|
1181
|
-
Window = 87
|
|
1358
|
+
Window = 87,
|
|
1182
1359
|
}
|
|
1183
1360
|
|
|
1184
1361
|
/**
|
|
@@ -1212,20 +1389,20 @@ export declare enum Button {
|
|
|
1212
1389
|
ScrollUp = 5,
|
|
1213
1390
|
ScrollDown = 6,
|
|
1214
1391
|
ScrollLeft = 7,
|
|
1215
|
-
ScrollRight = 8
|
|
1392
|
+
ScrollRight = 8,
|
|
1216
1393
|
}
|
|
1217
1394
|
|
|
1218
1395
|
/** Specifies if coordinates are relative or absolute. */
|
|
1219
1396
|
export declare enum Coordinate {
|
|
1220
1397
|
Abs = 0,
|
|
1221
|
-
Rel = 1
|
|
1398
|
+
Rel = 1,
|
|
1222
1399
|
}
|
|
1223
1400
|
|
|
1224
1401
|
/** The direction of a button event. */
|
|
1225
1402
|
export declare enum Direction {
|
|
1226
1403
|
Press = 0,
|
|
1227
1404
|
Release = 1,
|
|
1228
|
-
Click = 2
|
|
1405
|
+
Click = 2,
|
|
1229
1406
|
}
|
|
1230
1407
|
|
|
1231
1408
|
/** Enables the accessibility tree for the frontmost application. */
|
|
@@ -1239,7 +1416,7 @@ export declare enum FocusPolicy {
|
|
|
1239
1416
|
*/
|
|
1240
1417
|
DoNotSteal = 0,
|
|
1241
1418
|
/** Allow the launched app to become active/frontmost. */
|
|
1242
|
-
Steal = 1
|
|
1419
|
+
Steal = 1,
|
|
1243
1420
|
}
|
|
1244
1421
|
|
|
1245
1422
|
export declare function hasScreenCapturePermission(): boolean
|
|
@@ -1283,7 +1460,10 @@ export declare function hasScreenCapturePermission(): boolean
|
|
|
1283
1460
|
* on forever. The callback itself runs on the Node main thread; the
|
|
1284
1461
|
* non-blocking dispatch from Rust is what creates the recursion risk.
|
|
1285
1462
|
*/
|
|
1286
|
-
export declare function initLogger(
|
|
1463
|
+
export declare function initLogger(
|
|
1464
|
+
cb?: ((arg: JsLogRecord) => unknown) | undefined | null,
|
|
1465
|
+
spec?: string | undefined | null,
|
|
1466
|
+
): void
|
|
1287
1467
|
|
|
1288
1468
|
/** A single log entry forwarded to the JS callback. */
|
|
1289
1469
|
export interface JsLogRecord {
|
|
@@ -1651,14 +1831,19 @@ export declare enum Key {
|
|
|
1651
1831
|
/** Use `key_unicode` to provide the character. */
|
|
1652
1832
|
Unicode = 290,
|
|
1653
1833
|
/** Use `key_other` to provide the raw key value. */
|
|
1654
|
-
Other = 291
|
|
1834
|
+
Other = 291,
|
|
1655
1835
|
}
|
|
1656
1836
|
|
|
1657
1837
|
/** Convert a string representation into a `Key`. */
|
|
1658
1838
|
export declare function keyFromString(value: string): Key
|
|
1659
1839
|
|
|
1660
1840
|
/** Legacy helper used by Electron to open an app or URL. */
|
|
1661
|
-
export declare function legacyOpen(
|
|
1841
|
+
export declare function legacyOpen(
|
|
1842
|
+
app: string | undefined | null,
|
|
1843
|
+
url: string | undefined | null,
|
|
1844
|
+
focusPolicy: FocusPolicy,
|
|
1845
|
+
visibility: Visibility,
|
|
1846
|
+
): void
|
|
1662
1847
|
|
|
1663
1848
|
/** Legacy helper used by Electron to capture a screenshot as base64. */
|
|
1664
1849
|
export declare function legacyTakeScreenshot(needsCompression: boolean, shrinkTo1080P: boolean): string
|
|
@@ -1672,7 +1857,13 @@ export declare function legacyTakeScreenshot(needsCompression: boolean, shrinkTo
|
|
|
1672
1857
|
export declare function readFile(path: string): string
|
|
1673
1858
|
|
|
1674
1859
|
/** Takes the screenshot of a cropped region of the workspace. */
|
|
1675
|
-
export declare function screenshotCropped(
|
|
1860
|
+
export declare function screenshotCropped(
|
|
1861
|
+
x: number,
|
|
1862
|
+
y: number,
|
|
1863
|
+
width: number,
|
|
1864
|
+
height: number,
|
|
1865
|
+
hideCursor: boolean,
|
|
1866
|
+
): Screenshot
|
|
1676
1867
|
|
|
1677
1868
|
/** Takes the screenshot of the entire selected screen */
|
|
1678
1869
|
export declare function screenshotFull(hideCursor: boolean, screen: Screen): Screenshot
|
|
@@ -1682,7 +1873,7 @@ export declare enum TraversalOrder {
|
|
|
1682
1873
|
/** Pre-order depth-first (each node before its descendants). */
|
|
1683
1874
|
DepthFirst = 0,
|
|
1684
1875
|
/** Level-order breadth-first (parents before children). */
|
|
1685
|
-
BreadthFirst = 1
|
|
1876
|
+
BreadthFirst = 1,
|
|
1686
1877
|
}
|
|
1687
1878
|
|
|
1688
1879
|
/** Visibility behavior when opening an application. */
|
|
@@ -1690,7 +1881,7 @@ export declare enum Visibility {
|
|
|
1690
1881
|
/** Launch hidden when supported by the platform. */
|
|
1691
1882
|
Hidden = 0,
|
|
1692
1883
|
/** Launch in a visible state. */
|
|
1693
|
-
Show = 1
|
|
1884
|
+
Show = 1,
|
|
1694
1885
|
}
|
|
1695
1886
|
|
|
1696
1887
|
/**
|
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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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 !== '7.0.1' && 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 7.0.1 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": "7.0.1",
|
|
4
4
|
"description": "Node.js bindings for simulang-rs",
|
|
5
5
|
"main": "wrapped.js",
|
|
6
6
|
"types": "./wrapped.d.ts",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"index.js",
|
|
37
37
|
"wrapped.d.ts",
|
|
38
38
|
"wrapped.js",
|
|
39
|
+
"CHANGELOG.md",
|
|
39
40
|
"CLAUDE.md",
|
|
40
41
|
"bin/init-claude.mjs",
|
|
41
42
|
"bin/postinstall-hint.mjs",
|
|
@@ -77,16 +78,16 @@
|
|
|
77
78
|
"test": "vitest run",
|
|
78
79
|
"typecheck": "tsc --noEmit && tsc --noEmit -p __test__/tsconfig.json && tsc --noEmit -p benchmark/tsconfig.json && tsc --noEmit -p bin/tsconfig.json && tsc --noEmit -p examples/tsconfig.json",
|
|
79
80
|
"preversion": "napi build --platform && npm run typecheck && git add .",
|
|
80
|
-
"version": "napi version",
|
|
81
|
+
"version": "napi version && node scripts/stamp-changelog.mjs",
|
|
81
82
|
"prepare": "husky"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"@napi-rs/cli": "^3.6.1",
|
|
85
86
|
"@oxc-node/core": "^0.1.0",
|
|
86
87
|
"@taplo/cli": "^0.7.0",
|
|
87
|
-
"@types/node": "^25.
|
|
88
|
+
"@types/node": "^25.8.0",
|
|
88
89
|
"husky": "^9.1.7",
|
|
89
|
-
"lint-staged": "^17.0.
|
|
90
|
+
"lint-staged": "^17.0.4",
|
|
90
91
|
"npm-run-all2": "^8.0.4",
|
|
91
92
|
"oxlint": "^1.63.0",
|
|
92
93
|
"prettier": "^3.8.2",
|
|
@@ -116,11 +117,11 @@
|
|
|
116
117
|
"arrowParens": "always"
|
|
117
118
|
},
|
|
118
119
|
"optionalDependencies": {
|
|
119
|
-
"@simular-ai/simulang-js-win32-x64-msvc": "
|
|
120
|
-
"@simular-ai/simulang-js-win32-arm64-msvc": "
|
|
121
|
-
"@simular-ai/simulang-js-darwin-x64": "
|
|
122
|
-
"@simular-ai/simulang-js-darwin-arm64": "
|
|
123
|
-
"@simular-ai/simulang-js-linux-x64-gnu": "
|
|
124
|
-
"@simular-ai/simulang-js-linux-arm64-gnu": "
|
|
120
|
+
"@simular-ai/simulang-js-win32-x64-msvc": "7.0.1",
|
|
121
|
+
"@simular-ai/simulang-js-win32-arm64-msvc": "7.0.1",
|
|
122
|
+
"@simular-ai/simulang-js-darwin-x64": "7.0.1",
|
|
123
|
+
"@simular-ai/simulang-js-darwin-arm64": "7.0.1",
|
|
124
|
+
"@simular-ai/simulang-js-linux-x64-gnu": "7.0.1",
|
|
125
|
+
"@simular-ai/simulang-js-linux-arm64-gnu": "7.0.1"
|
|
125
126
|
}
|
|
126
127
|
}
|