@namzu/computer-use 4.3.1 → 4.5.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.
Files changed (143) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/SubprocessComputerUseHost.d.ts +21 -1
  3. package/dist/SubprocessComputerUseHost.d.ts.map +1 -1
  4. package/dist/SubprocessComputerUseHost.js +67 -15
  5. package/dist/SubprocessComputerUseHost.js.map +1 -1
  6. package/dist/a11y/a11y.d.ts +16 -7
  7. package/dist/a11y/a11y.d.ts.map +1 -1
  8. package/dist/a11y/a11y.js +23 -5
  9. package/dist/a11y/a11y.js.map +1 -1
  10. package/dist/a11y/index.d.ts +7 -1
  11. package/dist/a11y/index.d.ts.map +1 -1
  12. package/dist/a11y/index.js +4 -1
  13. package/dist/a11y/index.js.map +1 -1
  14. package/dist/a11y/interface.d.ts +5 -0
  15. package/dist/a11y/interface.d.ts.map +1 -1
  16. package/dist/a11y/interface.js.map +1 -1
  17. package/dist/a11y/macos-helper.d.ts +80 -0
  18. package/dist/a11y/macos-helper.d.ts.map +1 -0
  19. package/dist/a11y/macos-helper.js +436 -0
  20. package/dist/a11y/macos-helper.js.map +1 -0
  21. package/dist/a11y/macos-signing.d.ts +56 -0
  22. package/dist/a11y/macos-signing.d.ts.map +1 -0
  23. package/dist/a11y/macos-signing.js +228 -0
  24. package/dist/a11y/macos-signing.js.map +1 -0
  25. package/dist/a11y/macos.d.ts +173 -0
  26. package/dist/a11y/macos.d.ts.map +1 -0
  27. package/dist/a11y/macos.js +271 -0
  28. package/dist/a11y/macos.js.map +1 -0
  29. package/dist/a11y/windows.d.ts +13 -2
  30. package/dist/a11y/windows.d.ts.map +1 -1
  31. package/dist/a11y/windows.js +29 -6
  32. package/dist/a11y/windows.js.map +1 -1
  33. package/dist/adapters/cua-driver/adapter.d.ts +26 -0
  34. package/dist/adapters/cua-driver/adapter.d.ts.map +1 -1
  35. package/dist/adapters/cua-driver/adapter.js +224 -13
  36. package/dist/adapters/cua-driver/adapter.js.map +1 -1
  37. package/dist/adapters/cua-driver/client.d.ts +5 -0
  38. package/dist/adapters/cua-driver/client.d.ts.map +1 -1
  39. package/dist/adapters/cua-driver/client.js +31 -0
  40. package/dist/adapters/cua-driver/client.js.map +1 -1
  41. package/dist/adapters/cua-driver/ui-tree.d.ts +1 -0
  42. package/dist/adapters/cua-driver/ui-tree.d.ts.map +1 -1
  43. package/dist/adapters/cua-driver/ui-tree.js +2 -0
  44. package/dist/adapters/cua-driver/ui-tree.js.map +1 -1
  45. package/dist/adapters/darwin-ax.d.ts +94 -0
  46. package/dist/adapters/darwin-ax.d.ts.map +1 -0
  47. package/dist/adapters/darwin-ax.js +754 -0
  48. package/dist/adapters/darwin-ax.js.map +1 -0
  49. package/dist/adapters/darwin.d.ts +43 -2
  50. package/dist/adapters/darwin.d.ts.map +1 -1
  51. package/dist/adapters/darwin.js +145 -7
  52. package/dist/adapters/darwin.js.map +1 -1
  53. package/dist/adapters/png.d.ts +6 -0
  54. package/dist/adapters/png.d.ts.map +1 -0
  55. package/dist/adapters/png.js +7 -0
  56. package/dist/adapters/png.js.map +1 -0
  57. package/dist/adapters/types.d.ts +5 -0
  58. package/dist/adapters/types.d.ts.map +1 -1
  59. package/dist/adapters/types.js.map +1 -1
  60. package/dist/adapters/win32-native.d.ts +53 -0
  61. package/dist/adapters/win32-native.d.ts.map +1 -0
  62. package/dist/adapters/win32-native.js +279 -0
  63. package/dist/adapters/win32-native.js.map +1 -0
  64. package/dist/adapters/win32.d.ts +19 -1
  65. package/dist/adapters/win32.d.ts.map +1 -1
  66. package/dist/adapters/win32.js +34 -8
  67. package/dist/adapters/win32.js.map +1 -1
  68. package/dist/foreground/guard.d.ts.map +1 -1
  69. package/dist/foreground/guard.js +2 -0
  70. package/dist/foreground/guard.js.map +1 -1
  71. package/dist/foreground/ladder.d.ts.map +1 -1
  72. package/dist/foreground/ladder.js +5 -1
  73. package/dist/foreground/ladder.js.map +1 -1
  74. package/dist/foreground/types.d.ts +6 -0
  75. package/dist/foreground/types.d.ts.map +1 -1
  76. package/dist/foreground/types.js.map +1 -1
  77. package/dist/foreground/windows.d.ts +2 -0
  78. package/dist/foreground/windows.d.ts.map +1 -1
  79. package/dist/foreground/windows.js +23 -11
  80. package/dist/foreground/windows.js.map +1 -1
  81. package/dist/native/a11y.d.ts +61 -0
  82. package/dist/native/a11y.d.ts.map +1 -0
  83. package/dist/native/a11y.js +197 -0
  84. package/dist/native/a11y.js.map +1 -0
  85. package/dist/native/foreground-monitor.d.ts +51 -0
  86. package/dist/native/foreground-monitor.d.ts.map +1 -0
  87. package/dist/native/foreground-monitor.js +120 -0
  88. package/dist/native/foreground-monitor.js.map +1 -0
  89. package/dist/native/presence.d.ts +24 -0
  90. package/dist/native/presence.d.ts.map +1 -0
  91. package/dist/native/presence.js +47 -0
  92. package/dist/native/presence.js.map +1 -0
  93. package/dist/native/process.d.ts +73 -0
  94. package/dist/native/process.d.ts.map +1 -0
  95. package/dist/native/process.js +292 -0
  96. package/dist/native/process.js.map +1 -0
  97. package/dist/native/protocol.d.ts +408 -0
  98. package/dist/native/protocol.d.ts.map +1 -0
  99. package/dist/native/protocol.js +527 -0
  100. package/dist/native/protocol.js.map +1 -0
  101. package/dist/native/shared.d.ts +16 -0
  102. package/dist/native/shared.d.ts.map +1 -0
  103. package/dist/native/shared.js +62 -0
  104. package/dist/native/shared.js.map +1 -0
  105. package/dist/presence/presence.d.ts +11 -2
  106. package/dist/presence/presence.d.ts.map +1 -1
  107. package/dist/presence/presence.js +15 -0
  108. package/dist/presence/presence.js.map +1 -1
  109. package/dist/presence/windows.d.ts +2 -0
  110. package/dist/presence/windows.d.ts.map +1 -1
  111. package/dist/presence/windows.js +14 -0
  112. package/dist/presence/windows.js.map +1 -1
  113. package/helper-macos/main.swift +1756 -0
  114. package/package.json +3 -2
  115. package/src/SubprocessComputerUseHost.ts +80 -10
  116. package/src/a11y/a11y.ts +36 -11
  117. package/src/a11y/index.ts +28 -1
  118. package/src/a11y/interface.ts +5 -0
  119. package/src/a11y/macos-helper.ts +538 -0
  120. package/src/a11y/macos-signing.ts +280 -0
  121. package/src/a11y/macos.ts +496 -0
  122. package/src/a11y/windows.ts +29 -4
  123. package/src/adapters/cua-driver/adapter.ts +245 -17
  124. package/src/adapters/cua-driver/client.ts +27 -0
  125. package/src/adapters/cua-driver/ui-tree.ts +2 -0
  126. package/src/adapters/darwin-ax.ts +920 -0
  127. package/src/adapters/darwin.ts +184 -4
  128. package/src/adapters/png.ts +5 -0
  129. package/src/adapters/types.ts +5 -0
  130. package/src/adapters/win32-native.ts +328 -0
  131. package/src/adapters/win32.ts +52 -5
  132. package/src/foreground/guard.ts +1 -0
  133. package/src/foreground/ladder.ts +5 -1
  134. package/src/foreground/types.ts +6 -0
  135. package/src/foreground/windows.ts +24 -11
  136. package/src/native/a11y.ts +267 -0
  137. package/src/native/foreground-monitor.ts +165 -0
  138. package/src/native/presence.ts +58 -0
  139. package/src/native/process.ts +335 -0
  140. package/src/native/protocol.ts +963 -0
  141. package/src/native/shared.ts +75 -0
  142. package/src/presence/presence.ts +23 -2
  143. package/src/presence/windows.ts +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namzu/computer-use",
3
- "version": "4.3.1",
3
+ "version": "4.5.0",
4
4
  "description": "Subprocess-based computer-use host for @namzu/sdk. Screenshot, mouse, and keyboard control via platform-native CLIs (screencapture/osascript on darwin, xdotool/maim on Linux X11, grim/wtype/ydotool on Wayland, PowerShell on Windows).",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "engines": {
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "files": [
28
28
  "dist",
29
+ "helper-macos",
29
30
  "!dist/**/*.test.*",
30
31
  "!dist/**/*.proc-test.*",
31
32
  "!dist/**/__tests__",
@@ -53,7 +54,7 @@
53
54
  "@types/node": "^22.19.17",
54
55
  "typescript": "^5.5.0",
55
56
  "vitest": "^4.1.11",
56
- "@namzu/sdk": "^62.6.1"
57
+ "@namzu/sdk": "^69.1.0"
57
58
  },
58
59
  "scripts": {
59
60
  "build": "tsc --build",
@@ -18,7 +18,12 @@ import type {
18
18
  WindowInputResult,
19
19
  WindowScreenshotResult,
20
20
  } from '@namzu/sdk'
21
- import { type AccessibilityBackend, createWindowsA11yHost } from './a11y/index.js'
21
+ import {
22
+ type AccessibilityBackend,
23
+ type MacA11yHandle,
24
+ createMacA11yHost,
25
+ createWindowsA11yHost,
26
+ } from './a11y/index.js'
22
27
  import { type Adapter, AdapterUnavailableError } from './adapters/types.js'
23
28
  import type { Win32AdapterOptions } from './adapters/win32.js'
24
29
  import { detectDisplayServer } from './detect/index.js'
@@ -55,6 +60,9 @@ const UNSAFE_TO_REPLAY_AFTER_START = new Set<ComputerUseAction['type']>([
55
60
  'key',
56
61
  ])
57
62
 
63
+ /** How long an unused host keeps its adapter's process (see `idleReleaseMs`). */
64
+ const DEFAULT_IDLE_RELEASE_MS = 60_000
65
+
58
66
  export interface SubprocessComputerUseHostOptions {
59
67
  readonly env?: NodeJS.ProcessEnv
60
68
  readonly platform?: NodeJS.Platform
@@ -90,6 +98,19 @@ export interface SubprocessComputerUseHostOptions {
90
98
  * for this machine (for tests).
91
99
  */
92
100
  readonly a11y?: boolean | AccessibilityBackend
101
+ /**
102
+ * macOS: the accessibility helper ("Namzu Helper", a small app built from source on first use) that
103
+ * gives the host windows, window capture, the accessibility tree and scroll. On by default; `a11y:
104
+ * false` or `NAMZU_COMPUTER_USE_A11Y=off` turns it off. A ready handle replaces the real one (for tests).
105
+ */
106
+ readonly macHelper?: MacA11yHandle
107
+ /**
108
+ * How long the host may sit unused before it lets go of what its adapter keeps running (on Windows
109
+ * the cua-driver process and the cursor overlay it draws). The next call starts it again. Without
110
+ * this, every conversation of an app keeps its own driver until the conversation closes. Default 60
111
+ * seconds; 0 keeps it for the life of the host.
112
+ */
113
+ readonly idleReleaseMs?: number
93
114
  }
94
115
 
95
116
  export interface SubprocessComputerUseHostForegroundOptions {
@@ -132,6 +153,11 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
132
153
  private ladder: ForegroundLadder | undefined
133
154
  private presence: Presence | undefined
134
155
  private a11y: AccessibilityBackend | undefined
156
+ private macHelper: MacA11yHandle | undefined
157
+ private idleTimer: NodeJS.Timeout | undefined
158
+ private busy = 0
159
+ /** Counts every call start, so a release can tell that one began while it was winding down. */
160
+ private useEpoch = 0
135
161
 
136
162
  constructor(private readonly options: SubprocessComputerUseHostOptions = {}) {
137
163
  const displayServer = detectDisplayServer(options.env, options.platform)
@@ -198,12 +224,23 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
198
224
  ...(option === false ? { enabled: false } : {}),
199
225
  })
200
226
  }
227
+ if (!this.macHelper && displayServer === 'darwin') {
228
+ this.macHelper =
229
+ this.options.macHelper ??
230
+ createMacA11yHost({
231
+ ...(this.options.env !== undefined ? { env: this.options.env } : {}),
232
+ ...(this.options.platform !== undefined ? { platform: this.options.platform } : {}),
233
+ ...(this.options.a11y === false ? { enabled: false } : {}),
234
+ ...(this.options.windows?.onNotice ? { onNotice: this.options.windows.onNotice } : {}),
235
+ })
236
+ }
201
237
  const adapter = await loadAdapter(
202
238
  displayServer,
203
239
  this.options,
204
240
  this.ladder,
205
241
  this.presence,
206
242
  this.a11y,
243
+ this.macHelper,
207
244
  )
208
245
  // Loading an adapter proves its tools exist on PATH, not that a desktop
209
246
  // answers. A WSL process finds PowerShell and still may have no
@@ -226,6 +263,7 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
226
263
  }
227
264
  this.adapter = adapter
228
265
  this._capabilities = adapter.capabilities
266
+ this.armIdleRelease()
229
267
  }
230
268
 
231
269
  async getDisplayGeometry(): Promise<DisplayGeometry> {
@@ -441,6 +479,8 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
441
479
 
442
480
  /** Stops whatever the adapter keeps running (the Windows cua-driver process). */
443
481
  async dispose(): Promise<void> {
482
+ if (this.idleTimer) clearTimeout(this.idleTimer)
483
+ this.idleTimer = undefined
444
484
  const adapter = this.adapter
445
485
  this.adapter = null
446
486
  await adapter?.dispose?.()
@@ -473,15 +513,41 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
473
513
  run: () => Promise<T>,
474
514
  onAbort?: (sent: boolean) => T,
475
515
  ): Promise<T> {
476
- return inCallScope(signal, async (scope) => {
477
- try {
478
- return await run()
479
- } catch (error) {
480
- if (!(error instanceof CallAbortedError)) throw error
481
- if (!onAbort) throw error
482
- return onAbort(scope.sent || error.sent)
516
+ this.busy += 1
517
+ try {
518
+ return await inCallScope(signal, async (scope) => {
519
+ try {
520
+ return await run()
521
+ } catch (error) {
522
+ if (!(error instanceof CallAbortedError)) throw error
523
+ if (!onAbort) throw error
524
+ return onAbort(scope.sent || error.sent)
525
+ }
526
+ })
527
+ } finally {
528
+ this.busy -= 1
529
+ this.armIdleRelease()
530
+ }
531
+ }
532
+
533
+ /** Start counting an idle stretch again; when it runs out with no call in flight the adapter lets go of its process. */
534
+ private armIdleRelease(): void {
535
+ const wait = this.options.idleReleaseMs ?? DEFAULT_IDLE_RELEASE_MS
536
+ if (this.idleTimer) clearTimeout(this.idleTimer)
537
+ this.idleTimer = undefined
538
+ if (wait <= 0 || !this.adapter?.release) return
539
+ this.idleTimer = setTimeout(() => {
540
+ this.idleTimer = undefined
541
+ if (this.busy > 0) {
542
+ this.armIdleRelease()
543
+ return
483
544
  }
484
- })
545
+ const epoch = this.useEpoch
546
+ void this.adapter
547
+ ?.release?.(() => this.busy === 0 && this.useEpoch === epoch)
548
+ .catch(() => undefined)
549
+ }, wait)
550
+ this.idleTimer.unref?.()
485
551
  }
486
552
 
487
553
  /** True when the computer is known to be locked; false when it is not or cannot be told. */
@@ -505,6 +571,9 @@ export class SubprocessComputerUseHost implements ComputerUseHost {
505
571
 
506
572
  private requireAdapter(): Adapter {
507
573
  if (this.ladder?.stopped) throw new ComputerUseStoppedError()
574
+ // A call is starting: the idle stretch starts over.
575
+ this.useEpoch += 1
576
+ this.armIdleRelease()
508
577
  if (!this.adapter) {
509
578
  throw new Error(
510
579
  'SubprocessComputerUseHost: adapter not initialised — call `await host.initialize()` first',
@@ -542,11 +611,12 @@ async function loadAdapter(
542
611
  ladder: ForegroundLadder | undefined,
543
612
  presence: Presence | undefined,
544
613
  a11y: AccessibilityBackend | undefined,
614
+ macHelper: MacA11yHandle | undefined,
545
615
  ): Promise<Adapter> {
546
616
  switch (displayServer) {
547
617
  case 'darwin': {
548
618
  const { DarwinAdapter } = await import('./adapters/darwin.js')
549
- return DarwinAdapter.create()
619
+ return DarwinAdapter.create(macHelper ? { ax: macHelper } : {})
550
620
  }
551
621
  case 'x11': {
552
622
  const { LinuxX11Adapter } = await import('./adapters/linux-x11.js')
package/src/a11y/a11y.ts CHANGED
@@ -30,8 +30,15 @@ export interface A11yProcess {
30
30
  }
31
31
 
32
32
  export interface WindowsA11yOptions {
33
- /** Windows PowerShell, as this process starts it. */
34
- readonly powershell: string
33
+ /** Windows PowerShell, as this process starts it. Not needed when `spawnHelper` is given. */
34
+ readonly powershell?: string
35
+ /** Names the backend for diagnosis. Default `windows-uia`. */
36
+ readonly id?: string
37
+ /**
38
+ * Whether the Windows helper script is written first. Default true; a helper that is its own program
39
+ * (the macOS one) greets by itself and takes no script.
40
+ */
41
+ readonly greeting?: boolean
35
42
  readonly env?: NodeJS.ProcessEnv
36
43
  /** For tests. */
37
44
  readonly spawnHelper?: () => A11yProcess
@@ -41,7 +48,7 @@ export interface WindowsA11yOptions {
41
48
 
42
49
  function spawnPowerShell(options: WindowsA11yOptions): A11yProcess {
43
50
  const child = spawn(
44
- options.powershell,
51
+ options.powershell ?? 'powershell.exe',
45
52
  [
46
53
  '-NoProfile',
47
54
  '-NonInteractive',
@@ -99,8 +106,13 @@ interface Pending {
99
106
  /** The helper's window id (an HWND) → the host's string, the same `0x…` form the adapter uses. */
100
107
  const windowIdOf = (hwnd: number): string => `0x${hwnd.toString(16)}`
101
108
 
102
- function hwndOf(windowId: string): number {
103
- const text = windowId.trim().toLowerCase()
109
+ function hwndOf(windowId: string | number): number {
110
+ if (typeof windowId === 'number') {
111
+ if (!Number.isSafeInteger(windowId) || windowId <= 0)
112
+ throw new A11yError('bad_window_id', 'not a window id this backend handed out')
113
+ return windowId
114
+ }
115
+ const text = String(windowId).trim().toLowerCase()
104
116
  const value = /^0x[0-9a-f]+$/.test(text)
105
117
  ? Number.parseInt(text.slice(2), 16)
106
118
  : /^\d+$/.test(text)
@@ -131,7 +143,7 @@ const records = (value: unknown): Record<string, unknown>[] =>
131
143
  * a second end, or a helper that never came up, leaves it off.
132
144
  */
133
145
  export class WindowsA11yHost implements AccessibilityBackend {
134
- readonly id = 'windows-uia'
146
+ readonly id: string
135
147
 
136
148
  private proc: A11yProcess | undefined
137
149
  private starting: Promise<boolean> | undefined
@@ -143,7 +155,9 @@ export class WindowsA11yHost implements AccessibilityBackend {
143
155
  private nextId = 1
144
156
  private readonly pending = new Map<number, Pending>()
145
157
 
146
- constructor(private readonly options: WindowsA11yOptions) {}
158
+ constructor(protected readonly options: WindowsA11yOptions) {
159
+ this.id = options.id ?? 'windows-uia'
160
+ }
147
161
 
148
162
  get isReady(): boolean {
149
163
  return this.up && !this.dead && !this.closed
@@ -153,6 +167,17 @@ export class WindowsA11yHost implements AccessibilityBackend {
153
167
  if (!this.dead && !this.closed) void this.start()
154
168
  }
155
169
 
170
+ release(): void {
171
+ const proc = this.proc
172
+ if (!proc) return
173
+ // Replaced, not ended: its exit is not a crash (see the exit handler).
174
+ this.proc = undefined
175
+ this.starting = undefined
176
+ this.up = false
177
+ this.failAll(new A11yError('helper_exited', 'the accessibility host was released'))
178
+ proc.kill()
179
+ }
180
+
156
181
  ready(): Promise<boolean> {
157
182
  if (this.dead || this.closed) return Promise.resolve(false)
158
183
  return this.start()
@@ -223,7 +248,7 @@ export class WindowsA11yHost implements AccessibilityBackend {
223
248
  }
224
249
  }
225
250
 
226
- async seq(windowId?: string, signal?: AbortSignal): Promise<A11ySeq> {
251
+ async seq(windowId?: string | number, signal?: AbortSignal): Promise<A11ySeq> {
227
252
  const reply = await this.request(
228
253
  'seq',
229
254
  windowId === undefined ? {} : { hwnd: hwndOf(windowId) },
@@ -340,7 +365,7 @@ export class WindowsA11yHost implements AccessibilityBackend {
340
365
  }
341
366
  }
342
367
 
343
- private async request(
368
+ protected async request(
344
369
  cmd: string,
345
370
  payload: Record<string, unknown>,
346
371
  limitMs: number,
@@ -459,7 +484,7 @@ export class WindowsA11yHost implements AccessibilityBackend {
459
484
  resolve(true)
460
485
  }
461
486
  })
462
- proc.write(a11yScriptLine())
487
+ if (this.options.greeting !== false) proc.write(a11yScriptLine())
463
488
  })
464
489
  return this.starting
465
490
  }
@@ -470,7 +495,7 @@ function rect(value: unknown): A11yRect {
470
495
  return { x: num(r[0]), y: num(r[1]), width: num(r[2]), height: num(r[3]) }
471
496
  }
472
497
 
473
- function toNode(n: Record<string, unknown>): A11yNode {
498
+ export function toNode(n: Record<string, unknown>): A11yNode {
474
499
  const toggle = n.toggle
475
500
  const expand = n.expand
476
501
  return {
package/src/a11y/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { WindowsA11yHost } from './a11y.js'
2
2
  export type { A11yProcess, WindowsA11yOptions } from './a11y.js'
3
3
  export { A11Y_BOOTSTRAP, A11Y_HELPER_SCRIPT, a11yScriptLine } from './a11y-script.js'
4
- export { A11Y_ENV, a11yDisabledByEnv, createWindowsA11yHost } from './windows.js'
4
+ export { A11Y_ENV, WIN_HELPER_ENV, a11yDisabledByEnv, createWindowsA11yHost } from './windows.js'
5
5
  export type { WindowsA11yFactoryOptions } from './windows.js'
6
6
  export { A11yError } from './interface.js'
7
7
  export type {
@@ -22,3 +22,30 @@ export type {
22
22
  A11yWindow,
23
23
  AccessibilityBackend,
24
24
  } from './interface.js'
25
+ export { MacA11yHost, cgWindowId, createMacA11yHost } from './macos.js'
26
+ export type {
27
+ MacA11yFactoryOptions,
28
+ MacA11yHandle,
29
+ MacActResult,
30
+ MacCapture,
31
+ MacControlAction,
32
+ MacNode,
33
+ MacPermissions,
34
+ MacSelfCheck,
35
+ MacTree,
36
+ MacTreeRequest,
37
+ } from './macos.js'
38
+ export {
39
+ MAC_HELPER_BUNDLE_ID,
40
+ MAC_HELPER_NAME,
41
+ ensureMacHelper,
42
+ macHelperPaths,
43
+ macHelperSourceHash,
44
+ } from './macos-helper.js'
45
+ export type { MacHelperPaths } from './macos-helper.js'
46
+ export {
47
+ ensureSigningIdentity,
48
+ macSigningDir,
49
+ parseFingerprint,
50
+ } from './macos-signing.js'
51
+ export type { MacSigningIdentity } from './macos-signing.js'
@@ -188,6 +188,11 @@ export interface AccessibilityBackend {
188
188
  readonly isReady: boolean
189
189
  /** Starts the backend ahead of the first question. Does not wait; safe to repeat. */
190
190
  warm(): void
191
+ /**
192
+ * Ends the backend's process while nobody is using it; the next `warm()` or question starts it again
193
+ * (a marker taken before is then stale). Optional: a backend that holds no process has nothing to end.
194
+ */
195
+ release?(): void
191
196
  /** Resolves true when the backend is up; false (never throws) when it cannot be. */
192
197
  ready(): Promise<boolean>
193
198
  /** The visible, un-cloaked, non-tool top-level windows, front to back. */