@trycua/cua-driver 0.31.0 → 0.32.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
@@ -110,7 +110,7 @@ retry. Refresh stale tokens from the same exact window.
110
110
  Window IDs are `bigint`; do not convert them to `number`.
111
111
 
112
112
  See the [migration guide](../docs/native-window-sdk-migration.md) for input and
113
- return-type changes, and the [complete Python and TypeScript examples](https://cua.ai/docs/how-to-guides/driver/use-sdk-in-process)
113
+ return-type changes, and the [complete Python and TypeScript examples](https://cua.ai/docs/cua-driver/guides/use-the-sdk)
114
114
  for discovery, token selection, verification, and shutdown.
115
115
 
116
116
  ## Authorization integrations
@@ -127,7 +127,7 @@ content-free action, refusal, grant, and session events. The observer cannot
127
127
  change authorization or tool results. Use
128
128
  `createConfiguredWithHostIntegrations` when the application needs both.
129
129
 
130
- See the [SDK reference](https://cua.ai/docs/reference/cua-driver/sdk-reference)
130
+ See the [SDK reference](https://cua.ai/docs/cua-driver/guides/use-the-sdk#constructors)
131
131
  for complete examples and the callback trust rules.
132
132
 
133
133
  `CuaDriver.connect(socketPath)` remains available while existing applications
@@ -600,6 +600,10 @@ export type DragInput = {
600
600
  fromY: number;
601
601
  toX: number;
602
602
  toY: number;
603
+ /**
604
+ * Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the
605
+ * primary desktop (`kind="desktop"`, `display_id="primary"`).
606
+ */
603
607
  target?: ActionTarget;
604
608
  /**
605
609
  * Deprecated flat desktop target retained for wire compatibility.
@@ -709,7 +713,13 @@ export declare enum EscalationReason {
709
713
  Other = 4
710
714
  }
711
715
  export type EscalateSessionInput = {
716
+ /**
717
+ * Public label of the legacy capture-scope session to escalate.
718
+ */
712
719
  session: string;
720
+ /**
721
+ * Why the window-scoped attempt failed and desktop capture is needed.
722
+ */
713
723
  reason: EscalationReason;
714
724
  /**
715
725
  * Optional bounded diagnostic detail. Never use secrets or page content.
@@ -725,6 +735,9 @@ export declare const EscalateSessionInput: Readonly<{
725
735
  defaults: () => Partial<EscalateSessionInput>;
726
736
  }>;
727
737
  export type GetAgentCursorStateInput = {
738
+ /**
739
+ * Public label of the session whose cursor to inspect.
740
+ */
728
741
  session: string;
729
742
  };
730
743
  /**
@@ -869,6 +882,10 @@ export declare const GetWindowStateInput: Readonly<{
869
882
  }>;
870
883
  export type HotkeyInput = {
871
884
  keys: Array<string>;
885
+ /**
886
+ * Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the
887
+ * primary desktop (`kind="desktop"`, `display_id="primary"`).
888
+ */
872
889
  target?: ActionTarget;
873
890
  /**
874
891
  * Deprecated flat desktop target retained for wire compatibility.
@@ -894,8 +911,18 @@ export declare const HotkeyInput: Readonly<{
894
911
  * trimming surrounding whitespace and otherwise remain case-sensitive.
895
912
  */
896
913
  export type InvokeMenuInput = {
914
+ /**
915
+ * Process ID of the application that owns the menu.
916
+ */
897
917
  pid: number;
918
+ /**
919
+ * Window ID from list_windows whose menu is invoked.
920
+ */
898
921
  windowId: bigint;
922
+ /**
923
+ * Menu labels from the top-level menu to the item, e.g. `["File", "Save As..."]`
924
+ * (1 to 16 labels).
925
+ */
899
926
  path: Array<string>;
900
927
  /**
901
928
  * For multi-call work, prefer a short public session label and repeat it on every call that
@@ -1068,10 +1095,18 @@ export declare const ListWindowsOutput: Readonly<{
1068
1095
  defaults: () => Partial<ListWindowsOutput>;
1069
1096
  }>;
1070
1097
  export type MoveCursorInput = {
1098
+ /**
1099
+ * Destination X: window-local screenshot pixels for a window target, native
1100
+ * get_desktop_state screenshot pixels for the desktop.
1101
+ */
1071
1102
  x: number;
1103
+ /**
1104
+ * Destination Y, in the same space as `x`.
1105
+ */
1072
1106
  y: number;
1073
1107
  /**
1074
- * Preferred per-call target. New callers should set this field.
1108
+ * Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the
1109
+ * primary desktop (`kind="desktop"`, `display_id="primary"`).
1075
1110
  */
1076
1111
  target?: ActionTarget;
1077
1112
  /**
@@ -1100,8 +1135,17 @@ export declare enum VisualRegionKind {
1100
1135
  * Optional, model-neutral controls for one bounded parse.
1101
1136
  */
1102
1137
  export type ParseVisualRegionsOptions = {
1138
+ /**
1139
+ * Region kinds to return (`text`, `icon`). Omit for all kinds.
1140
+ */
1103
1141
  kinds?: Array<VisualRegionKind>;
1142
+ /**
1143
+ * Drop regions below this confidence (0 to 1).
1144
+ */
1104
1145
  minConfidence?: number;
1146
+ /**
1147
+ * Return at most this many regions.
1148
+ */
1105
1149
  maxRegions?: number;
1106
1150
  };
1107
1151
  /**
@@ -1118,6 +1162,9 @@ export declare const ParseVisualRegionsOptions: Readonly<{
1118
1162
  * resolves it to the exact pixels and action-coordinate transform.
1119
1163
  */
1120
1164
  export type ParseVisualRegionsInput = {
1165
+ /**
1166
+ * `capture_id` of a screenshot returned by get_window_state or get_desktop_state.
1167
+ */
1121
1168
  captureId: string;
1122
1169
  options: ParseVisualRegionsOptions;
1123
1170
  };
@@ -1532,6 +1579,10 @@ export declare const PredicateOutcome: Readonly<{
1532
1579
  }>;
1533
1580
  export type PressKeyInput = {
1534
1581
  key: string;
1582
+ /**
1583
+ * Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the
1584
+ * primary desktop (`kind="desktop"`, `display_id="primary"`).
1585
+ */
1535
1586
  target?: ActionTarget;
1536
1587
  /**
1537
1588
  * Deprecated flat desktop target retained for wire compatibility.
@@ -1566,6 +1617,10 @@ export type ScrollInput = {
1566
1617
  x: number;
1567
1618
  y: number;
1568
1619
  direction: ScrollDirection;
1620
+ /**
1621
+ * Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the
1622
+ * primary desktop (`kind="desktop"`, `display_id="primary"`).
1623
+ */
1569
1624
  target?: ActionTarget;
1570
1625
  /**
1571
1626
  * Deprecated flat desktop target retained for wire compatibility.
@@ -1625,7 +1680,13 @@ export declare const SessionStateOutput: Readonly<{
1625
1680
  defaults: () => Partial<SessionStateOutput>;
1626
1681
  }>;
1627
1682
  export type SetAgentCursorEnabledInput = {
1683
+ /**
1684
+ * Public label of the session that owns the cursor.
1685
+ */
1628
1686
  session: string;
1687
+ /**
1688
+ * `true` shows the session's agent cursor overlay; `false` hides it.
1689
+ */
1629
1690
  enabled: boolean;
1630
1691
  };
1631
1692
  /**
@@ -1649,15 +1710,53 @@ export declare const SetAgentCursorEnabledOutput: Readonly<{
1649
1710
  defaults: () => Partial<SetAgentCursorEnabledOutput>;
1650
1711
  }>;
1651
1712
  export type SetAgentCursorMotionInput = {
1713
+ /**
1714
+ * Public label of the session that owns the cursor. Omitted or null motion fields keep
1715
+ * their current value.
1716
+ */
1652
1717
  session: string;
1718
+ /**
1719
+ * Path control-point offset from the start, as a fraction of the distance. Clamped to
1720
+ * 0..1 (default 0.3).
1721
+ */
1653
1722
  startHandle?: number;
1723
+ /**
1724
+ * Path control-point offset from the end, as a fraction of the distance. Clamped to 0..1
1725
+ * (default 0.3).
1726
+ */
1654
1727
  endHandle?: number;
1728
+ /**
1729
+ * Sideways arc deflection as a fraction of the distance. Clamped to 0..1 (default 0.25).
1730
+ */
1655
1731
  arcSize?: number;
1732
+ /**
1733
+ * Arc asymmetry: positive puts the apex near the destination, negative near the start.
1734
+ * Clamped to -1..1 (default 0).
1735
+ */
1656
1736
  arcFlow?: number;
1737
+ /**
1738
+ * Post-arrival spring damping: 1 is critically damped, 0.3 is bouncy. Clamped to 0.3..1
1739
+ * (default 0.72).
1740
+ */
1657
1741
  spring?: number;
1742
+ /**
1743
+ * Fixed glide duration in milliseconds. 0 (the default) uses speed-based timing. Clamped
1744
+ * to 0..5000.
1745
+ */
1658
1746
  glideDurationMs?: number;
1747
+ /**
1748
+ * Pause after a click animation, in milliseconds. Clamped to 0..5000 (default 80).
1749
+ */
1659
1750
  dwellAfterClickMs?: number;
1751
+ /**
1752
+ * Hide the cursor after this many idle milliseconds; 0 never hides it. Clamped to
1753
+ * 0..60000 (default 15000).
1754
+ */
1660
1755
  idleHideMs?: number;
1756
+ /**
1757
+ * Minimum turning radius of the glide path, in points; smaller turns tighter. Clamped to
1758
+ * 1..1000 (default 80).
1759
+ */
1661
1760
  turnRadius?: number;
1662
1761
  };
1663
1762
  /**
@@ -1681,8 +1780,18 @@ export declare const SetAgentCursorMotionOutput: Readonly<{
1681
1780
  defaults: () => Partial<SetAgentCursorMotionOutput>;
1682
1781
  }>;
1683
1782
  export type SetAgentCursorThemeInput = {
1783
+ /**
1784
+ * Public label of the session that owns the cursor.
1785
+ */
1684
1786
  session: string;
1787
+ /**
1788
+ * Id of an installed cursor theme (see `cua-driver cursor-theme list`).
1789
+ */
1685
1790
  themeId: string;
1791
+ /**
1792
+ * Theme animation policy: `on` uses the theme's reduced-motion frames, `off` always
1793
+ * animates, `auto` (default) leaves the choice to the host.
1794
+ */
1686
1795
  reducedMotion: CursorReducedMotion;
1687
1796
  };
1688
1797
  /**
@@ -1706,11 +1815,29 @@ export declare const SetAgentCursorThemeOutput: Readonly<{
1706
1815
  defaults: () => Partial<SetAgentCursorThemeOutput>;
1707
1816
  }>;
1708
1817
  export type SetWindowFrameInput = {
1818
+ /**
1819
+ * Process ID that owns the window.
1820
+ */
1709
1821
  pid: number;
1822
+ /**
1823
+ * Window ID from list_windows.
1824
+ */
1710
1825
  windowId: bigint;
1826
+ /**
1827
+ * New left edge in the desktop coordinate space reported by list_windows.
1828
+ */
1711
1829
  x: number;
1830
+ /**
1831
+ * New top edge in the desktop coordinate space reported by list_windows.
1832
+ */
1712
1833
  y: number;
1834
+ /**
1835
+ * New width, in the same units as list_windows bounds.
1836
+ */
1713
1837
  width: number;
1838
+ /**
1839
+ * New height, in the same units as list_windows bounds.
1840
+ */
1714
1841
  height: number;
1715
1842
  /**
1716
1843
  * For multi-call work, prefer a short public session label and repeat it on every call that
@@ -1806,6 +1933,10 @@ export declare const StatePredicate: Readonly<{
1806
1933
  }>;
1807
1934
  export type TypeTextInput = {
1808
1935
  text: string;
1936
+ /**
1937
+ * Preferred per-call target: an exact window (`kind="window"`, `pid`, `window_id`) or the
1938
+ * primary desktop (`kind="desktop"`, `display_id="primary"`).
1939
+ */
1809
1940
  target?: ActionTarget;
1810
1941
  /**
1811
1942
  * Deprecated flat desktop target retained for wire compatibility.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycua/cua-driver",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "Rust-backed Cua Driver SDK and embedded Node host",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,11 +48,11 @@
48
48
  "@ubjs/node": "0.31.0-3"
49
49
  },
50
50
  "optionalDependencies": {
51
- "@trycua/cua-driver-darwin-arm64": "0.31.0",
52
- "@trycua/cua-driver-darwin-x64": "0.31.0",
53
- "@trycua/cua-driver-linux-arm64-gnu": "0.31.0",
54
- "@trycua/cua-driver-linux-x64-gnu": "0.31.0",
55
- "@trycua/cua-driver-win32-arm64-msvc": "0.31.0",
56
- "@trycua/cua-driver-win32-x64-msvc": "0.31.0"
51
+ "@trycua/cua-driver-darwin-arm64": "0.32.0",
52
+ "@trycua/cua-driver-darwin-x64": "0.32.0",
53
+ "@trycua/cua-driver-linux-arm64-gnu": "0.32.0",
54
+ "@trycua/cua-driver-linux-x64-gnu": "0.32.0",
55
+ "@trycua/cua-driver-win32-arm64-msvc": "0.32.0",
56
+ "@trycua/cua-driver-win32-x64-msvc": "0.32.0"
57
57
  }
58
58
  }