@trycua/cua-driver 0.25.0 → 0.26.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/README.md CHANGED
@@ -60,13 +60,15 @@ try {
60
60
  } finally {
61
61
  await driver.endSession(EndSessionInput.new({ session: "demo" }))
62
62
  await driver.shutdown()
63
- driver.uniffiDestroy()
63
+ if ('uniffiDestroy' in driver && typeof driver.uniffiDestroy === 'function') {
64
+ driver.uniffiDestroy()
65
+ }
64
66
  }
65
67
  ```
66
68
 
67
69
  SDK operations are asynchronous and require a native library matching the host
68
70
  OS and architecture. The macOS native package requires macOS 13 or newer.
69
- Desktop calls return a typed `ToolResult` with text,
71
+ Desktop observations return a typed `ToolResult` with text,
70
72
  images, verification/error metadata, and `structuredJson` / `rawJson` for
71
73
  platform-extensible results. Session lifecycle calls return dedicated generated
72
74
  records.
@@ -84,6 +86,30 @@ and installed with the local CLI; SDK and MCP tools select only an installed
84
86
  theme ID. The built-in cursor shows the sanitized public session name in a
85
87
  badge below the pointer.
86
88
 
89
+ ## Typed native-window migration
90
+
91
+ The next breaking release adds typed app and window discovery, window snapshots,
92
+ and token-based clicks. Version 0.25 supports native-window operations through
93
+ the generic tool surface; it does not expose this typed window API. Upgrade the
94
+ bindings and native library together.
95
+
96
+ `listApps` returns `ListAppsOutput`, `listWindows` returns `ListWindowsOutput`,
97
+ and `getWindowState` returns `WindowStateOutput`. `click` takes a required exact
98
+ target, a coordinate or element-token position, and an explicit delivery mode.
99
+ It returns `ActionResult` directly and raises `DriverError.Tool` on refusal.
100
+ Other action methods retain `ToolResult`.
101
+
102
+ Select a unique app and window, resolve an element from a fresh snapshot, request
103
+ background delivery explicitly, then capture again to verify the intended UI
104
+ change. An unsupported background route must not trigger an automatic foreground
105
+ retry. Refresh stale tokens from the same exact window.
106
+
107
+ Window IDs are `bigint`; do not convert them to `number`.
108
+
109
+ See the [migration guide](../docs/native-window-sdk-migration.md) for input and
110
+ return-type changes, and the [complete Python and TypeScript examples](https://cua.ai/docs/how-to-guides/driver/use-sdk-in-process)
111
+ for discovery, token selection, verification, and shutdown.
112
+
87
113
  ## Authorization integrations
88
114
 
89
115
  `standard` is promptless for normal automation. An application that needs to
@@ -130,7 +156,9 @@ try {
130
156
  try {
131
157
  // Application calls use driver; an agent runtime uses connection.mcp.
132
158
  } finally {
133
- driver.uniffiDestroy()
159
+ if ('uniffiDestroy' in driver && typeof driver.uniffiDestroy === 'function') {
160
+ driver.uniffiDestroy()
161
+ }
134
162
  }
135
163
  } finally {
136
164
  await embedded.stop()