@simular-ai/simulang-js 6.0.0 → 6.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.
@@ -31,6 +31,7 @@ node screenshot.mjs
31
31
  | `chrome_google_search_button.mjs` | Opens google.com in Chrome and locates the search button by _concept text_, using BoW Jaccard scoring over `overallDescription`. |
32
32
  | `open-app.mjs` | Opens an app, lists its windows, snapshots its accessibility tree. |
33
33
  | `loopback.mjs` | Plays an audio file while capturing system audio, then transcribes it. |
34
+ | `ask.mjs` | Drives the `AskModel` LLM primitive through prompt-only, text-only, image-only, and text + multi-image calls, using a real ax-tree snapshot and back-to-back screenshots as context. |
34
35
  | `logger.mjs` | Forwards Rust `log` records to a JS callback (env_logger-style filter spec). |
35
36
  | `log-window.mjs` | Pipes Rust `log::*!` records into a floating, always-on-top log window. Requires the optional [`@simular-ai/simulang-log-viewer`](../README.md#3-optional--install-the-log-viewer) peer dep. |
36
37
 
@@ -40,8 +41,9 @@ Unlike a sandboxed library call, most of these examples perform **real actions**
40
41
 
41
42
  - `keyboard.mjs` and `google_search.mjs` synthesize keystrokes — make sure the intended window is focused, or text will land somewhere unexpected.
42
43
  - `clipboard.mjs` overwrites your current clipboard contents (it restores them at the end).
43
- - `screenshot.mjs`, `google_search.mjs`, and `loopback.mjs` capture your screen or system audio.
44
+ - `screenshot.mjs`, `google_search.mjs`, `loopback.mjs`, and `ask.mjs` capture your screen or system audio.
44
45
  - `system.mjs` and `google_search.mjs` launch a browser window.
46
+ - `ask.mjs` and `loopback.mjs` send screen captures / audio to a remote LLM provider — make sure the configured provider is one you're OK sharing that content with. Set `OPENROUTER_API_KEY` (or drop a custom provider config under `~/.config/simulang/providers/`) before running `ask.mjs`.
45
47
 
46
48
  ### Required OS permissions
47
49
 
@@ -0,0 +1,76 @@
1
+ // Run: node examples/ask.mjs
2
+ //
3
+ // Drive `AskModel` through its four input shapes — prompt-only, text-only,
4
+ // image-only, and text + multiple images — using a real accessibility-tree
5
+ // snapshot of the foreground window as text context and back-to-back
6
+ // screen captures as images.
7
+ //
8
+ // This is the JS analog of `simulang-rs/examples/ask_about_screenshot.rs`.
9
+ //
10
+ // Requirements:
11
+ // - A configured ask provider (the bundled `openrouter` provider needs
12
+ // `OPENROUTER_API_KEY`; see PROVIDERS.md for alternatives)
13
+ // - Screen recording permission (for the screenshots)
14
+ // - Accessibility permission (for the ax-tree snapshot)
15
+
16
+ import { AccessibilityTree, AskModel, Screen, ariaRoleToString, screenshotFull } from '@simular-ai/simulang-js'
17
+
18
+ /**
19
+ * Render an `AccessibilityNodeJs` subtree as an indented Playwright-style
20
+ * aria snapshot (mirrors `WindowTrait::snapshot()` in simulang-rs).
21
+ *
22
+ * @param {import('@simular-ai/simulang-js').AccessibilityNodeJs} node
23
+ * @param {number} [depth]
24
+ * @returns {string}
25
+ */
26
+ function snapshotToString(node, depth = 0) {
27
+ const indent = ' '.repeat(depth)
28
+ let line = `${indent}- ${ariaRoleToString(node.role)}`
29
+ if (node.name) line += ` ${JSON.stringify(node.name)}`
30
+ if (node.value) line += `: ${JSON.stringify(node.value)}`
31
+ const childLines = node.children.map((c) => snapshotToString(c, depth + 1))
32
+ return [line, ...childLines].join('\n')
33
+ }
34
+
35
+ const aliases = AskModel.availableAliases()
36
+ if (aliases.length === 0) {
37
+ console.error(
38
+ 'No LLM model is reachable. Set OPENROUTER_API_KEY (or drop a custom provider config under ~/.config/simulang/providers/) and try again.',
39
+ )
40
+ process.exit(1)
41
+ }
42
+
43
+ const model = AskModel.default()
44
+ console.log(`Using ask model ${JSON.stringify(model.name)}`)
45
+ console.log(`Available aliases: ${aliases.join(', ')}\n`)
46
+
47
+ // 1. Prompt-only — no context at all.
48
+ const pong = model.ask('Reply with just the word PONG.')
49
+ console.log(`[prompt only] -> ${JSON.stringify(pong)}\n`)
50
+
51
+ // 2. Text-only — ground the model on a real accessibility-tree snapshot of
52
+ // whatever window is currently in the foreground.
53
+ const tree = AccessibilityTree.fromForeground()
54
+ const axSnapshot = snapshotToString(tree.snapshot())
55
+ console.log(`Snapshotted foreground window: ${JSON.stringify(tree.windowTitle)}`)
56
+ const summary = model.ask('Summarize this UI in one sentence and list any buttons that look clickable.', axSnapshot)
57
+ console.log(`[text only]\n${summary}\n`)
58
+
59
+ // 3. Image-only — full screenshot of the main display.
60
+ const shotA = screenshotFull(true, Screen.mainScreen())
61
+ shotA.shrink(1024, 1024)
62
+ shotA.compress(80)
63
+ const description = model.ask('Describe what is on screen in one sentence.', null, [shotA])
64
+ console.log(`[image only]\n${description}\n`)
65
+
66
+ // 4. Text + multiple images — capture a second screenshot back-to-back and
67
+ // ask the model to compare them with the ax-tree snapshot for context.
68
+ const shotB = screenshotFull(true, Screen.mainScreen())
69
+ shotB.shrink(1024, 1024)
70
+ shotB.compress(80)
71
+ const diff = model.ask(
72
+ 'These two screenshots were taken back-to-back. Did anything change between them? Be specific.',
73
+ axSnapshot,
74
+ [shotA, shotB],
75
+ )
76
+ console.log(`[text + 2 images]\n${diff}`)
package/index.d.ts CHANGED
@@ -87,13 +87,7 @@ export declare class AccessibilityNode {
87
87
  * against each node's `overallDescription`
88
88
  * - `threshold` – minimum score to keep a node
89
89
  */
90
- scoredSearch(
91
- order: TraversalOrder,
92
- maxNodes: number,
93
- collapseStructural: boolean,
94
- query: string,
95
- threshold: number,
96
- ): Array<AccessibilityNode>
90
+ scoredSearch(order: TraversalOrder, maxNodes: number, collapseStructural: boolean, query: string, threshold: number): Array<AccessibilityNode>
97
91
  /** Invoke / click the element (button, link, menu item). */
98
92
  activate(): void
99
93
  /** Set the text value of the element (textbox, combobox, …). */
@@ -189,14 +183,7 @@ export declare class AccessibilityTree {
189
183
  * Clears existing refs; returned nodes carry `refId` values usable
190
184
  * with action methods (`activate`, `setValue`, …).
191
185
  */
192
- find(
193
- order: TraversalOrder,
194
- role?: AriaRole | undefined | null,
195
- name?: string | undefined | null,
196
- visibleOnly?: boolean | undefined | null,
197
- maxResults?: number | undefined | null,
198
- collapseStructural?: boolean | undefined | null,
199
- ): Array<AccessibilityNodeJs>
186
+ find(order: TraversalOrder, role?: AriaRole | undefined | null, name?: string | undefined | null, visibleOnly?: boolean | undefined | null, maxResults?: number | undefined | null, collapseStructural?: boolean | undefined | null): Array<AccessibilityNodeJs>
200
187
  }
201
188
 
202
189
  /** Represents an application that can be opened. */
@@ -227,12 +214,54 @@ export declare class App {
227
214
  * When `wait_for_load_complete` is true, this blocks for a short, fixed
228
215
  * delay to allow the app or URL to become responsive before returning.
229
216
  */
230
- open(
231
- url: string | undefined | null,
232
- focusPolicy: FocusPolicy,
233
- visibility: Visibility,
234
- waitForLoadComplete: boolean,
235
- ): Instance
217
+ open(url: string | undefined | null, focusPolicy: FocusPolicy, visibility: Visibility, waitForLoadComplete: boolean): Instance
218
+ }
219
+
220
+ /**
221
+ * A free-form chat-completions LLM (optionally vision-capable) — the JS
222
+ * analogue of the `ask` primitive.
223
+ *
224
+ * Given a `prompt`, optional accessibility/structural `text`, and zero or
225
+ * more `images`, [`AskModel.ask`] returns the model's response as a plain
226
+ * string. The wire format is OpenAI-compatible chat completions, so any
227
+ * provider config that points at such an endpoint works.
228
+ */
229
+ export declare class AskModel {
230
+ /**
231
+ * First LLM model advertised by the first LLM-capable provider in the
232
+ * loaded configuration whose credentials are currently available.
233
+ * Throws if no provider in the loaded config advertises an LLM service.
234
+ */
235
+ static default(): AskModel
236
+ /**
237
+ * Resolve a model alias against the loaded config (e.g.
238
+ * `"openrouter_gpt_4o_mini"` from the bundled `openrouter` provider, or
239
+ * any alias declared by a user provider). Throws if the alias is unknown.
240
+ */
241
+ static byAlias(alias: string): AskModel
242
+ /**
243
+ * Every LLM model alias accepted by `byAlias` on this machine,
244
+ * deduplicated and sorted alphabetically. Use to discover what aliases
245
+ * the loaded config (bundled defaults plus any user provider files)
246
+ * advertises.
247
+ */
248
+ static availableAliases(): Array<string>
249
+ /** The wire-level model identifier sent in the request body. */
250
+ get name(): string
251
+ /**
252
+ * Ask the model a question, optionally grounded in accessibility text
253
+ * and/or images.
254
+ *
255
+ * - `prompt`: the question or task to answer.
256
+ * - `text`: optional accessibility-tree (or any) text included as
257
+ * structural context. Pass `null` / omit to skip.
258
+ * - `images`: zero or more images to attach. Each is encoded as a
259
+ * base64 data URL and sent as an `image_url` chat content part. Pass
260
+ * `null` / omit for none.
261
+ *
262
+ * Returns the trimmed assistant response on success.
263
+ */
264
+ ask(prompt: string, text?: string | undefined | null, images?: Array<Image> | undefined | null): string
236
265
  }
237
266
 
238
267
  /**
@@ -559,13 +588,7 @@ export declare class Instance {
559
588
  * methods (`activate`, `setValue`, …) directly on them, walk children
560
589
  * with `.children()`, or render a snapshot with `.snapshot()`.
561
590
  */
562
- scoredSearch(
563
- order: TraversalOrder,
564
- maxNodes: number,
565
- collapseStructural: boolean,
566
- query: string,
567
- threshold: number,
568
- ): Array<AccessibilityNode>
591
+ scoredSearch(order: TraversalOrder, maxNodes: number, collapseStructural: boolean, query: string, threshold: number): Array<AccessibilityNode>
569
592
  }
570
593
 
571
594
  /**
@@ -1042,13 +1065,7 @@ export declare class Window {
1042
1065
  * methods (`activate`, `setValue`, …) directly on them, walk children
1043
1066
  * with `.children()`, or render a snapshot with `.snapshot()`.
1044
1067
  */
1045
- scoredSearch(
1046
- order: TraversalOrder,
1047
- maxNodes: number,
1048
- collapseStructural: boolean,
1049
- query: string,
1050
- threshold: number,
1051
- ): Array<AccessibilityNode>
1068
+ scoredSearch(order: TraversalOrder, maxNodes: number, collapseStructural: boolean, query: string, threshold: number): Array<AccessibilityNode>
1052
1069
  }
1053
1070
 
1054
1071
  export interface AccessibilityNodeJs {
@@ -1161,7 +1178,7 @@ export declare enum AriaRole {
1161
1178
  TreeItem = 84,
1162
1179
  Treegrid = 85,
1163
1180
  Video = 86,
1164
- Window = 87,
1181
+ Window = 87
1165
1182
  }
1166
1183
 
1167
1184
  /**
@@ -1195,20 +1212,20 @@ export declare enum Button {
1195
1212
  ScrollUp = 5,
1196
1213
  ScrollDown = 6,
1197
1214
  ScrollLeft = 7,
1198
- ScrollRight = 8,
1215
+ ScrollRight = 8
1199
1216
  }
1200
1217
 
1201
1218
  /** Specifies if coordinates are relative or absolute. */
1202
1219
  export declare enum Coordinate {
1203
1220
  Abs = 0,
1204
- Rel = 1,
1221
+ Rel = 1
1205
1222
  }
1206
1223
 
1207
1224
  /** The direction of a button event. */
1208
1225
  export declare enum Direction {
1209
1226
  Press = 0,
1210
1227
  Release = 1,
1211
- Click = 2,
1228
+ Click = 2
1212
1229
  }
1213
1230
 
1214
1231
  /** Enables the accessibility tree for the frontmost application. */
@@ -1222,7 +1239,7 @@ export declare enum FocusPolicy {
1222
1239
  */
1223
1240
  DoNotSteal = 0,
1224
1241
  /** Allow the launched app to become active/frontmost. */
1225
- Steal = 1,
1242
+ Steal = 1
1226
1243
  }
1227
1244
 
1228
1245
  export declare function hasScreenCapturePermission(): boolean
@@ -1266,10 +1283,7 @@ export declare function hasScreenCapturePermission(): boolean
1266
1283
  * on forever. The callback itself runs on the Node main thread; the
1267
1284
  * non-blocking dispatch from Rust is what creates the recursion risk.
1268
1285
  */
1269
- export declare function initLogger(
1270
- cb?: ((arg: JsLogRecord) => unknown) | undefined | null,
1271
- spec?: string | undefined | null,
1272
- ): void
1286
+ export declare function initLogger(cb?: (((arg: JsLogRecord) => unknown)) | undefined | null, spec?: string | undefined | null): void
1273
1287
 
1274
1288
  /** A single log entry forwarded to the JS callback. */
1275
1289
  export interface JsLogRecord {
@@ -1637,19 +1651,14 @@ export declare enum Key {
1637
1651
  /** Use `key_unicode` to provide the character. */
1638
1652
  Unicode = 290,
1639
1653
  /** Use `key_other` to provide the raw key value. */
1640
- Other = 291,
1654
+ Other = 291
1641
1655
  }
1642
1656
 
1643
1657
  /** Convert a string representation into a `Key`. */
1644
1658
  export declare function keyFromString(value: string): Key
1645
1659
 
1646
1660
  /** Legacy helper used by Electron to open an app or URL. */
1647
- export declare function legacyOpen(
1648
- app: string | undefined | null,
1649
- url: string | undefined | null,
1650
- focusPolicy: FocusPolicy,
1651
- visibility: Visibility,
1652
- ): void
1661
+ export declare function legacyOpen(app: string | undefined | null, url: string | undefined | null, focusPolicy: FocusPolicy, visibility: Visibility): void
1653
1662
 
1654
1663
  /** Legacy helper used by Electron to capture a screenshot as base64. */
1655
1664
  export declare function legacyTakeScreenshot(needsCompression: boolean, shrinkTo1080P: boolean): string
@@ -1663,13 +1672,7 @@ export declare function legacyTakeScreenshot(needsCompression: boolean, shrinkTo
1663
1672
  export declare function readFile(path: string): string
1664
1673
 
1665
1674
  /** Takes the screenshot of a cropped region of the workspace. */
1666
- export declare function screenshotCropped(
1667
- x: number,
1668
- y: number,
1669
- width: number,
1670
- height: number,
1671
- hideCursor: boolean,
1672
- ): Screenshot
1675
+ export declare function screenshotCropped(x: number, y: number, width: number, height: number, hideCursor: boolean): Screenshot
1673
1676
 
1674
1677
  /** Takes the screenshot of the entire selected screen */
1675
1678
  export declare function screenshotFull(hideCursor: boolean, screen: Screen): Screenshot
@@ -1679,7 +1682,7 @@ export declare enum TraversalOrder {
1679
1682
  /** Pre-order depth-first (each node before its descendants). */
1680
1683
  DepthFirst = 0,
1681
1684
  /** Level-order breadth-first (parents before children). */
1682
- BreadthFirst = 1,
1685
+ BreadthFirst = 1
1683
1686
  }
1684
1687
 
1685
1688
  /** Visibility behavior when opening an application. */
@@ -1687,7 +1690,7 @@ export declare enum Visibility {
1687
1690
  /** Launch hidden when supported by the platform. */
1688
1691
  Hidden = 0,
1689
1692
  /** Launch in a visible state. */
1690
- Show = 1,
1693
+ Show = 1
1691
1694
  }
1692
1695
 
1693
1696
  /**
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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '6.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 6.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 !== '6.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 6.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '6.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 6.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -579,6 +579,7 @@ module.exports = nativeBinding
579
579
  module.exports.AccessibilityNode = nativeBinding.AccessibilityNode
580
580
  module.exports.AccessibilityTree = nativeBinding.AccessibilityTree
581
581
  module.exports.App = nativeBinding.App
582
+ module.exports.AskModel = nativeBinding.AskModel
582
583
  module.exports.AudioOutput = nativeBinding.AudioOutput
583
584
  module.exports.Clipboard = nativeBinding.Clipboard
584
585
  module.exports.Directory = nativeBinding.Directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simular-ai/simulang-js",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Node.js bindings for simulang-rs",
5
5
  "main": "wrapped.js",
6
6
  "types": "./wrapped.d.ts",
@@ -116,11 +116,11 @@
116
116
  "arrowParens": "always"
117
117
  },
118
118
  "optionalDependencies": {
119
- "@simular-ai/simulang-js-win32-x64-msvc": "6.0.0",
120
- "@simular-ai/simulang-js-win32-arm64-msvc": "6.0.0",
121
- "@simular-ai/simulang-js-darwin-x64": "6.0.0",
122
- "@simular-ai/simulang-js-darwin-arm64": "6.0.0",
123
- "@simular-ai/simulang-js-linux-x64-gnu": "6.0.0",
124
- "@simular-ai/simulang-js-linux-arm64-gnu": "6.0.0"
119
+ "@simular-ai/simulang-js-win32-x64-msvc": "6.0.1",
120
+ "@simular-ai/simulang-js-win32-arm64-msvc": "6.0.1",
121
+ "@simular-ai/simulang-js-darwin-x64": "6.0.1",
122
+ "@simular-ai/simulang-js-darwin-arm64": "6.0.1",
123
+ "@simular-ai/simulang-js-linux-x64-gnu": "6.0.1",
124
+ "@simular-ai/simulang-js-linux-arm64-gnu": "6.0.1"
125
125
  }
126
126
  }