@simular-ai/simulang-js 8.1.0 → 9.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 +13 -0
- package/CLAUDE.md +18 -8
- package/index.d.ts +61 -16
- package/index.js +53 -52
- package/package.json +15 -9
- package/sai.d.ts +868 -0
- package/sai.js +749 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [9.0.0] - 2026-06-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `Image.fromBase64()` now accepts GIF and WebP data URLs/payloads.
|
|
15
|
+
- `Image.base64DataUrl()` and `Screenshot.base64DataUrl()` for returning MIME-prefixed data URLs.
|
|
16
|
+
- Bundled OpenRouter config now advertises `openrouter_claude_opus` for both `AskModel` and `GroundingModel`, including Claude-specific grounding coordinate scaling and image size/format limits.
|
|
17
|
+
- `StateSatisfiesModel` for evaluating screen state against a natural-language condition through the dedicated state-satisfaction provider.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- `Image.base64()` and `Screenshot.base64()` now return raw base64 without a `data:image/...;base64,` prefix, matching the Rust API. Use `base64DataUrl()` when a MIME-prefixed data URL is needed.
|
|
22
|
+
|
|
10
23
|
## [8.1.0] - 2026-06-23
|
|
11
24
|
|
|
12
25
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Node.js bindings for the Rust `simulang-rs` crate (via napi-rs). Cross-platform
|
|
4
4
|
desktop automation: apps, windows, accessibility trees, mouse/keyboard,
|
|
5
|
-
screenshots, clipboard, audio, and VLM/STT model access.
|
|
5
|
+
screenshots, clipboard, audio, and VLM/LLM/STT model access.
|
|
6
6
|
|
|
7
7
|
This file ships in the npm tarball alongside `index.d.ts` and is versioned
|
|
8
8
|
with it.
|
|
@@ -10,7 +10,7 @@ with it.
|
|
|
10
10
|
## Where the API is documented
|
|
11
11
|
|
|
12
12
|
Read **`index.d.ts`** first — it is the source of truth. Every class,
|
|
13
|
-
function, and enum is fully typed (~
|
|
13
|
+
function, and enum is fully typed (~2100 lines) and carries JSDoc covering
|
|
14
14
|
idioms, lifecycle rules, platform quirks, and inter-API trade-offs that types
|
|
15
15
|
alone can't express. The JSDoc is generated from doc comments,
|
|
16
16
|
so the per-symbol guidance there is authoritative — trust it over any
|
|
@@ -24,12 +24,22 @@ restatement elsewhere.
|
|
|
24
24
|
- Many objects are **handles to platform resources** (windows, audio devices,
|
|
25
25
|
accessibility trees, file/directory handles). Their lifetime matters;
|
|
26
26
|
dropping them can free the underlying resource.
|
|
27
|
-
- Coordinates
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
- Coordinates live on the **global desktop**: top-left origin at `(0, 0)` on
|
|
28
|
+
the primary monitor, in **OS-native units** — the unit is **not** the same
|
|
29
|
+
on every platform:
|
|
30
|
+
- **Windows / Linux**: **physical pixels** (raw hardware pixels).
|
|
31
|
+
- **macOS**: **logical points** — on a 2× Retina display one point spans two
|
|
32
|
+
hardware pixels, so a 1920×1080-logical screen is `1920×1080` here, not
|
|
33
|
+
`3840×2160`.
|
|
34
|
+
|
|
35
|
+
These are the native units the OS input/accessibility APIs expect, **not**
|
|
36
|
+
the browser logical/CSS pixel. Within a single OS every API speaks that OS's
|
|
37
|
+
unit, so coordinates round-trip between `MouseController`, the various
|
|
38
|
+
`boundingBox()` methods, `Screenshot.toGlobalDesktopCoordinates()`, and
|
|
39
|
+
grounding output **without conversion**; only code crossing into a different
|
|
40
|
+
coordinate system (e.g. an Electron overlay measured in CSS pixels) must
|
|
41
|
+
account for the per-OS unit. Monitors arranged to the left of / above the
|
|
42
|
+
primary contribute **negative** coordinates, so don't assume `x, y >= 0`.
|
|
33
43
|
|
|
34
44
|
## Logging is on by default
|
|
35
45
|
|
package/index.d.ts
CHANGED
|
@@ -347,13 +347,15 @@ export declare class AskModel {
|
|
|
347
347
|
/**
|
|
348
348
|
* First LLM model advertised by the first LLM-capable provider in the
|
|
349
349
|
* loaded configuration whose credentials are currently available.
|
|
350
|
-
*
|
|
350
|
+
* Providers with missing credentials are skipped; throws if no provider
|
|
351
|
+
* remains available.
|
|
351
352
|
*/
|
|
352
353
|
static default(): AskModel
|
|
353
354
|
/**
|
|
354
355
|
* Resolve a model alias against the loaded config (e.g.
|
|
355
|
-
* `"openrouter_gpt_4o_mini"`
|
|
356
|
-
* any alias declared by a user provider).
|
|
356
|
+
* `"openrouter_gpt_4o_mini"` / `"openrouter_claude_opus"` from the
|
|
357
|
+
* bundled `openrouter` provider, or any alias declared by a user provider).
|
|
358
|
+
* Throws if the alias is unknown.
|
|
357
359
|
*/
|
|
358
360
|
static byAlias(alias: string): AskModel
|
|
359
361
|
/**
|
|
@@ -384,8 +386,8 @@ export declare class AskModel {
|
|
|
384
386
|
* - `text`: optional accessibility-tree (or any) text included as
|
|
385
387
|
* structural context. Pass `null` / omit to skip.
|
|
386
388
|
* - `images`: zero or more images to attach. Each is encoded as a
|
|
387
|
-
* base64 data URL and sent as an
|
|
388
|
-
* `null` / omit for none.
|
|
389
|
+
* base64 data URL in a model-supported format and sent as an
|
|
390
|
+
* `image_url` chat content part. Pass `null` / omit for none.
|
|
389
391
|
*
|
|
390
392
|
* Returns the trimmed assistant response on success.
|
|
391
393
|
*/
|
|
@@ -564,14 +566,14 @@ export declare class File {
|
|
|
564
566
|
export declare class GroundingModel {
|
|
565
567
|
/**
|
|
566
568
|
* First VLM model advertised by the first VLM provider in the loaded
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
+
* configuration whose credentials are currently available. Providers with
|
|
570
|
+
* missing credentials are skipped; throws if no provider remains available.
|
|
569
571
|
*/
|
|
570
572
|
static default(): GroundingModel
|
|
571
573
|
/**
|
|
572
574
|
* Resolve a model alias against the loaded config (e.g. `"ui_venus_30b"`,
|
|
573
|
-
* `"ui_tars_7b"`, or any alias declared by a
|
|
574
|
-
* the alias is unknown.
|
|
575
|
+
* `"ui_tars_7b"`, `"openrouter_claude_opus"`, or any alias declared by a
|
|
576
|
+
* user provider). Throws if the alias is unknown.
|
|
575
577
|
*/
|
|
576
578
|
static byAlias(alias: string): GroundingModel
|
|
577
579
|
/**
|
|
@@ -663,19 +665,21 @@ export declare class Image {
|
|
|
663
665
|
shrink(nwidth: number, nheight: number): void
|
|
664
666
|
/** Returns the image dimensions as `[width, height]` in pixels. */
|
|
665
667
|
get dimensions(): [number, number]
|
|
668
|
+
/** Returns the image encoded as raw base64, without a MIME prefix. */
|
|
669
|
+
base64(): string
|
|
666
670
|
/**
|
|
667
671
|
* Returns the image encoded as a base64 data URL.
|
|
668
672
|
*
|
|
669
673
|
* The result includes the MIME prefix, for example
|
|
670
|
-
* `data:image/png;base64
|
|
674
|
+
* `data:image/png;base64,...`, `data:image/jpeg;base64,...`,
|
|
675
|
+
* `data:image/gif;base64,...`, or `data:image/webp;base64,...`.
|
|
671
676
|
*/
|
|
672
|
-
|
|
677
|
+
base64DataUrl(): string
|
|
673
678
|
/**
|
|
674
679
|
* Decodes a base64 image string into an image.
|
|
675
680
|
*
|
|
676
|
-
* Accepts either a raw base64 payload or a
|
|
677
|
-
*
|
|
678
|
-
* `data:image/jpg;base64,...`.
|
|
681
|
+
* Accepts either a raw base64 payload or a PNG, JPEG/JPG, GIF, or WebP
|
|
682
|
+
* data URL.
|
|
679
683
|
*/
|
|
680
684
|
static fromBase64(base64: string): Image
|
|
681
685
|
/**
|
|
@@ -1155,13 +1159,16 @@ export declare class Screenshot {
|
|
|
1155
1159
|
shrink(nwidth: number, nheight: number): void
|
|
1156
1160
|
/** Returns the screenshot dimensions as `[width, height]` in pixels. */
|
|
1157
1161
|
get dimensions(): [number, number]
|
|
1162
|
+
/** Returns the image encoded as raw base64, without a MIME prefix. */
|
|
1163
|
+
base64(): string
|
|
1158
1164
|
/**
|
|
1159
1165
|
* Returns the image encoded as a base64 data URL.
|
|
1160
1166
|
*
|
|
1161
1167
|
* The result includes the MIME prefix, for example
|
|
1162
|
-
* `data:image/png;base64
|
|
1168
|
+
* `data:image/png;base64,...`, `data:image/jpeg;base64,...`,
|
|
1169
|
+
* `data:image/gif;base64,...`, or `data:image/webp;base64,...`.
|
|
1163
1170
|
*/
|
|
1164
|
-
|
|
1171
|
+
base64DataUrl(): string
|
|
1165
1172
|
/**
|
|
1166
1173
|
* Converts a point in this screenshot to global desktop coordinates.
|
|
1167
1174
|
*
|
|
@@ -1210,6 +1217,44 @@ export declare class ScreenshotCoordinateType {
|
|
|
1210
1217
|
static normalized(range: number): ScreenshotCoordinateType
|
|
1211
1218
|
}
|
|
1212
1219
|
|
|
1220
|
+
/**
|
|
1221
|
+
* A dedicated state-satisfaction model that evaluates whether observed screen
|
|
1222
|
+
* state satisfies a natural-language condition.
|
|
1223
|
+
*
|
|
1224
|
+
* This speaks Simular's `v1/perception/state_satisfies` endpoint. It is
|
|
1225
|
+
* separate from `AskModel`, which remains an OpenAI-compatible
|
|
1226
|
+
* chat-completions client.
|
|
1227
|
+
*/
|
|
1228
|
+
export declare class StateSatisfiesModel {
|
|
1229
|
+
/**
|
|
1230
|
+
* First state-satisfaction model advertised by the first capable provider
|
|
1231
|
+
* in the loaded configuration whose credentials are currently available.
|
|
1232
|
+
* Throws if no provider advertises the state-satisfies service.
|
|
1233
|
+
*/
|
|
1234
|
+
static default(): StateSatisfiesModel
|
|
1235
|
+
/**
|
|
1236
|
+
* Resolve a model alias against the loaded config. Throws if the alias is
|
|
1237
|
+
* unknown.
|
|
1238
|
+
*/
|
|
1239
|
+
static byAlias(alias: string): StateSatisfiesModel
|
|
1240
|
+
/** Convenience shim for the bundled `simular_state_satisfies` alias. */
|
|
1241
|
+
static simularStateSatisfies(): StateSatisfiesModel
|
|
1242
|
+
/**
|
|
1243
|
+
* Every state-satisfaction model alias accepted by `byAlias` on this
|
|
1244
|
+
* machine, deduplicated and sorted alphabetically.
|
|
1245
|
+
*/
|
|
1246
|
+
static availableAliases(): Array<string>
|
|
1247
|
+
/** The provider-configured model identifier. */
|
|
1248
|
+
get name(): string
|
|
1249
|
+
/** Check that the provider credentials work. Throws if they do not. */
|
|
1250
|
+
checkAuth(): void
|
|
1251
|
+
/**
|
|
1252
|
+
* Evaluate `condition` against the supplied accessibility text and raw
|
|
1253
|
+
* screenshot base64.
|
|
1254
|
+
*/
|
|
1255
|
+
stateSatisfies(condition: string, text: string, image: string): boolean
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1213
1258
|
/** A speech-to-text model that can transcribe audio. */
|
|
1214
1259
|
export declare class SttModel {
|
|
1215
1260
|
/**
|
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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.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 !== '9.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 9.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -605,6 +605,7 @@ module.exports.SamplesBuffer = nativeBinding.SamplesBuffer
|
|
|
605
605
|
module.exports.Screen = nativeBinding.Screen
|
|
606
606
|
module.exports.Screenshot = nativeBinding.Screenshot
|
|
607
607
|
module.exports.ScreenshotCoordinateType = nativeBinding.ScreenshotCoordinateType
|
|
608
|
+
module.exports.StateSatisfiesModel = nativeBinding.StateSatisfiesModel
|
|
608
609
|
module.exports.SttModel = nativeBinding.SttModel
|
|
609
610
|
module.exports.System = nativeBinding.System
|
|
610
611
|
module.exports.Window = nativeBinding.Window
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simular-ai/simulang-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Node.js bindings for simulang-rs",
|
|
5
5
|
"main": "wrapped.js",
|
|
6
6
|
"types": "./wrapped.d.ts",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./wrapped.d.ts",
|
|
10
10
|
"default": "./wrapped.js"
|
|
11
|
+
},
|
|
12
|
+
"./sai": {
|
|
13
|
+
"types": "./sai.d.ts",
|
|
14
|
+
"default": "./sai.js"
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
"bin": {
|
|
@@ -34,6 +38,8 @@
|
|
|
34
38
|
"files": [
|
|
35
39
|
"index.d.ts",
|
|
36
40
|
"index.js",
|
|
41
|
+
"sai.d.ts",
|
|
42
|
+
"sai.js",
|
|
37
43
|
"wrapped.d.ts",
|
|
38
44
|
"wrapped.js",
|
|
39
45
|
"CHANGELOG.md",
|
|
@@ -85,9 +91,9 @@
|
|
|
85
91
|
"@napi-rs/cli": "^3.7.2",
|
|
86
92
|
"@oxc-node/core": "^0.1.0",
|
|
87
93
|
"@taplo/cli": "^0.7.0",
|
|
88
|
-
"@types/node": "^
|
|
94
|
+
"@types/node": "^26.0.0",
|
|
89
95
|
"husky": "^9.1.7",
|
|
90
|
-
"lint-staged": "^17.0.
|
|
96
|
+
"lint-staged": "^17.0.8",
|
|
91
97
|
"npm-run-all2": "^9.0.2",
|
|
92
98
|
"oxlint": "^1.70.0",
|
|
93
99
|
"prettier": "^3.8.4",
|
|
@@ -117,11 +123,11 @@
|
|
|
117
123
|
"arrowParens": "always"
|
|
118
124
|
},
|
|
119
125
|
"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": "
|
|
126
|
+
"@simular-ai/simulang-js-win32-x64-msvc": "9.0.0",
|
|
127
|
+
"@simular-ai/simulang-js-win32-arm64-msvc": "9.0.0",
|
|
128
|
+
"@simular-ai/simulang-js-darwin-x64": "9.0.0",
|
|
129
|
+
"@simular-ai/simulang-js-darwin-arm64": "9.0.0",
|
|
130
|
+
"@simular-ai/simulang-js-linux-x64-gnu": "9.0.0",
|
|
131
|
+
"@simular-ai/simulang-js-linux-arm64-gnu": "9.0.0"
|
|
126
132
|
}
|
|
127
133
|
}
|