@trycua/cua-driver 0.12.5 → 0.14.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.
@@ -1,8 +1,145 @@
1
- import { type ClickInput, type DragInput, type EndSessionInput, type EndSessionOutput, type EscalateSessionInput, type GetCursorPositionInput, type GetDesktopStateInput, type GetScreenSizeInput, type GetSessionStateInput, type HotkeyInput, type MoveCursorInput, type PressKeyInput, type ScrollInput, type SessionStateOutput, type StartSessionInput, type StartSessionOutput, type TypeTextInput } from "./cua_driver_contract.js";
2
- import { type UniffiByteArray, type UniffiGcObject, type UniffiHandle, FfiConverterObject, RustBuffer, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from "@ubjs/core";
1
+ import { type ClickInput, type DragInput, type EndSessionInput, type EndSessionOutput, type EscalateSessionInput, type GetAgentCursorStateInput, type GetCursorPositionInput, type GetDesktopStateInput, type GetScreenSizeInput, type GetSessionStateInput, type HotkeyInput, type MoveCursorInput, type PressKeyInput, type ScrollInput, type SessionStateOutput, type SetAgentCursorEnabledInput, type SetAgentCursorMotionInput, type SetAgentCursorThemeInput, type StartSessionInput, type StartSessionOutput, type TypeTextInput } from "./cua_driver_contract.js";
2
+ import { type UniffiByteArray, type UniffiGcObject, type UniffiHandle, FfiConverterObject, FfiConverterObjectWithCallbacks, RustBuffer, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from "@ubjs/core";
3
+ /**
4
+ * Generated-language host factory for a session-bound action surface.
5
+ *
6
+ * This remains a separate top-level capability instead of adding a required
7
+ * method to the released `CuaDriverProtocol` / `CuaDriverLike` structural
8
+ * interfaces.
9
+ */
10
+ export declare function createTrustedSession(driver: CuaDriverLike, options: TrustedSessionOptions): CuaDriverSessionLike;
3
11
  export declare function currentMacOsPermissionStatus(): MacOsPermissionStatus;
4
12
  export declare function openMacOsScreenRecordingSettings(): void;
5
13
  export declare function requestMacOsPermissions(): MacOsPermissionStatus;
14
+ /**
15
+ * Permission mode chosen by trusted host code for a runtime or session.
16
+ */
17
+ export declare enum SessionPermissionMode {
18
+ Standard = 0,
19
+ Bounded = 1,
20
+ Unrestricted = 2
21
+ }
22
+ /**
23
+ * Immutable authorization ceiling supplied before a runtime accepts actions.
24
+ */
25
+ export type RuntimeAuthorizationOptions = {
26
+ allowedModes: Array<SessionPermissionMode>;
27
+ /**
28
+ * Mode inherited by calls made through the released `CuaDriver` object
29
+ * rather than a trusted session-bound action surface.
30
+ */
31
+ compatibilityMode: SessionPermissionMode;
32
+ /**
33
+ * Required only when `compatibility_mode` is bounded.
34
+ */
35
+ compatibilityBoundedManifestPath?: string;
36
+ unrestrictedAcknowledged: boolean;
37
+ maxSessionTtlSeconds: bigint;
38
+ maxIdleTtlSeconds: bigint;
39
+ };
40
+ /**
41
+ * Generated factory for {@link RuntimeAuthorizationOptions} record objects.
42
+ */
43
+ export declare const RuntimeAuthorizationOptions: Readonly<{
44
+ create: (partial: Partial<RuntimeAuthorizationOptions> & Required<Omit<RuntimeAuthorizationOptions, "compatibilityBoundedManifestPath">>) => RuntimeAuthorizationOptions;
45
+ new: (partial: Partial<RuntimeAuthorizationOptions> & Required<Omit<RuntimeAuthorizationOptions, "compatibilityBoundedManifestPath">>) => RuntimeAuthorizationOptions;
46
+ defaults: () => Partial<RuntimeAuthorizationOptions>;
47
+ }>;
48
+ /**
49
+ * Additive configured-runtime constructor options. Existing callers continue
50
+ * to use [`DriverOptions`] and inherit the compatibility session.
51
+ */
52
+ export type ConfiguredDriverOptions = {
53
+ claudeCodeCompatibility: boolean;
54
+ authorization: RuntimeAuthorizationOptions;
55
+ };
56
+ /**
57
+ * Generated factory for {@link ConfiguredDriverOptions} record objects.
58
+ */
59
+ export declare const ConfiguredDriverOptions: Readonly<{
60
+ create: (partial: Partial<ConfiguredDriverOptions> & Required<Omit<ConfiguredDriverOptions, never>>) => ConfiguredDriverOptions;
61
+ new: (partial: Partial<ConfiguredDriverOptions> & Required<Omit<ConfiguredDriverOptions, never>>) => ConfiguredDriverOptions;
62
+ defaults: () => Partial<ConfiguredDriverOptions>;
63
+ }>;
64
+ export declare enum DriverActivityKind {
65
+ AuthorizedAction = 0,
66
+ AuthorizationRefused = 1,
67
+ ActionFailed = 2,
68
+ GrantIssued = 3,
69
+ GrantRevoked = 4,
70
+ SessionStarted = 5,
71
+ SessionEnded = 6
72
+ }
73
+ /**
74
+ * A content-free lifecycle event emitted after native authorization decides
75
+ * a call. It never carries arguments, page text, paths, typed input, images,
76
+ * or raw resource identities.
77
+ */
78
+ export type DriverActivityEvent = {
79
+ kind: DriverActivityKind;
80
+ unixMs: bigint;
81
+ toolName: string;
82
+ adapterIds: Array<string>;
83
+ riskClass: string;
84
+ publicSession?: string;
85
+ refusalCode?: string;
86
+ };
87
+ /**
88
+ * Generated factory for {@link DriverActivityEvent} record objects.
89
+ */
90
+ export declare const DriverActivityEvent: Readonly<{
91
+ create: (partial: Partial<DriverActivityEvent> & Required<Omit<DriverActivityEvent, "publicSession" | "refusalCode">>) => DriverActivityEvent;
92
+ new: (partial: Partial<DriverActivityEvent> & Required<Omit<DriverActivityEvent, "publicSession" | "refusalCode">>) => DriverActivityEvent;
93
+ defaults: () => Partial<DriverActivityEvent>;
94
+ }>;
95
+ export declare enum DriverAuthorizationAction {
96
+ Allow = 0,
97
+ Deny = 1,
98
+ Cancel = 2
99
+ }
100
+ export type DriverAuthorizationDecision = {
101
+ action: DriverAuthorizationAction;
102
+ requestDigest: string;
103
+ };
104
+ /**
105
+ * Generated factory for {@link DriverAuthorizationDecision} record objects.
106
+ */
107
+ export declare const DriverAuthorizationDecision: Readonly<{
108
+ create: (partial: Partial<DriverAuthorizationDecision> & Required<Omit<DriverAuthorizationDecision, never>>) => DriverAuthorizationDecision;
109
+ new: (partial: Partial<DriverAuthorizationDecision> & Required<Omit<DriverAuthorizationDecision, never>>) => DriverAuthorizationDecision;
110
+ defaults: () => Partial<DriverAuthorizationDecision>;
111
+ }>;
112
+ /**
113
+ * Content-bounded request delivered only to trusted host code.
114
+ *
115
+ * `resource_json` contains an attested resource identity. Hosts must avoid
116
+ * logging it or forwarding it to a model.
117
+ */
118
+ export type DriverAuthorizationRequest = {
119
+ schema: string;
120
+ nonce: string;
121
+ generation: bigint;
122
+ daemonInstance: string;
123
+ permissionMode: string;
124
+ managedPolicySha256?: string;
125
+ userPolicySha256?: string;
126
+ adapterId: string;
127
+ riskClass: string;
128
+ publicSession: string;
129
+ transportSession: string;
130
+ resourceJson: string;
131
+ humanSummary: string;
132
+ expiresUnixMs: bigint;
133
+ requestDigest: string;
134
+ };
135
+ /**
136
+ * Generated factory for {@link DriverAuthorizationRequest} record objects.
137
+ */
138
+ export declare const DriverAuthorizationRequest: Readonly<{
139
+ create: (partial: Partial<DriverAuthorizationRequest> & Required<Omit<DriverAuthorizationRequest, "managedPolicySha256" | "userPolicySha256">>) => DriverAuthorizationRequest;
140
+ new: (partial: Partial<DriverAuthorizationRequest> & Required<Omit<DriverAuthorizationRequest, "managedPolicySha256" | "userPolicySha256">>) => DriverAuthorizationRequest;
141
+ defaults: () => Partial<DriverAuthorizationRequest>;
142
+ }>;
6
143
  /**
7
144
  * Transport-independent daemon identity used to prove that standalone and
8
145
  * embedded SDK/MCP routes reached a compatible Rust implementation.
@@ -120,8 +257,8 @@ export type EmbeddedDriverHostOptions = {
120
257
  * Generated factory for {@link EmbeddedDriverHostOptions} record objects.
121
258
  */
122
259
  export declare const EmbeddedDriverHostOptions: Readonly<{
123
- create: (partial: Partial<EmbeddedDriverHostOptions> & Required<Omit<EmbeddedDriverHostOptions, "socketPath" | "startupTimeoutMs" | "shutdownTimeoutMs" | "permissionMode" | "sessionPolicyPath">>) => EmbeddedDriverHostOptions;
124
- new: (partial: Partial<EmbeddedDriverHostOptions> & Required<Omit<EmbeddedDriverHostOptions, "socketPath" | "startupTimeoutMs" | "shutdownTimeoutMs" | "permissionMode" | "sessionPolicyPath">>) => EmbeddedDriverHostOptions;
260
+ create: (partial: Partial<EmbeddedDriverHostOptions> & Required<Omit<EmbeddedDriverHostOptions, "socketPath" | "permissionMode" | "startupTimeoutMs" | "shutdownTimeoutMs" | "sessionPolicyPath">>) => EmbeddedDriverHostOptions;
261
+ new: (partial: Partial<EmbeddedDriverHostOptions> & Required<Omit<EmbeddedDriverHostOptions, "socketPath" | "permissionMode" | "startupTimeoutMs" | "shutdownTimeoutMs" | "sessionPolicyPath">>) => EmbeddedDriverHostOptions;
125
262
  defaults: () => Partial<EmbeddedDriverHostOptions>;
126
263
  }>;
127
264
  export type ImageContent = {
@@ -153,6 +290,29 @@ export declare const MacOsPermissionStatus: Readonly<{
153
290
  new: (partial: Partial<MacOsPermissionStatus> & Required<Omit<MacOsPermissionStatus, never>>) => MacOsPermissionStatus;
154
291
  defaults: () => Partial<MacOsPermissionStatus>;
155
292
  }>;
293
+ /**
294
+ * Options for a directly supervised process-isolated runtime.
295
+ *
296
+ * The child receives configuration and actions only over inherited stdio. It
297
+ * exposes no socket and cannot be reconnected after the host channel closes.
298
+ */
299
+ export type PrivateWorkerOptions = {
300
+ binaryPath: string;
301
+ hostBundleId: string;
302
+ startupTimeoutMs?: bigint;
303
+ shutdownTimeoutMs?: bigint;
304
+ configuredDriver: ConfiguredDriverOptions;
305
+ environment: Array<EmbeddedEnvironmentVariable>;
306
+ inheritStderr: boolean;
307
+ };
308
+ /**
309
+ * Generated factory for {@link PrivateWorkerOptions} record objects.
310
+ */
311
+ export declare const PrivateWorkerOptions: Readonly<{
312
+ create: (partial: Partial<PrivateWorkerOptions> & Required<Omit<PrivateWorkerOptions, "startupTimeoutMs" | "shutdownTimeoutMs">>) => PrivateWorkerOptions;
313
+ new: (partial: Partial<PrivateWorkerOptions> & Required<Omit<PrivateWorkerOptions, "startupTimeoutMs" | "shutdownTimeoutMs">>) => PrivateWorkerOptions;
314
+ defaults: () => Partial<PrivateWorkerOptions>;
315
+ }>;
156
316
  /**
157
317
  * Transport-neutral result envelope used for open-ended tool calls and
158
318
  * desktop tools whose platform extensions are intentionally preserved as JSON.
@@ -175,13 +335,133 @@ export declare const ToolResult: Readonly<{
175
335
  new: (partial: Partial<ToolResult> & Required<Omit<ToolResult, "errorCode" | "structuredJson" | "verified">>) => ToolResult;
176
336
  defaults: () => Partial<ToolResult>;
177
337
  }>;
338
+ /**
339
+ * Trusted host request for one immutable, connection-bound action surface.
340
+ */
341
+ export type TrustedSessionOptions = {
342
+ publicSession: string;
343
+ mode: SessionPermissionMode;
344
+ ttlSeconds: bigint;
345
+ idleTtlSeconds: bigint;
346
+ boundedManifestPath?: string;
347
+ };
348
+ /**
349
+ * Generated factory for {@link TrustedSessionOptions} record objects.
350
+ */
351
+ export declare const TrustedSessionOptions: Readonly<{
352
+ create: (partial: Partial<TrustedSessionOptions> & Required<Omit<TrustedSessionOptions, "boundedManifestPath">>) => TrustedSessionOptions;
353
+ new: (partial: Partial<TrustedSessionOptions> & Required<Omit<TrustedSessionOptions, "boundedManifestPath">>) => TrustedSessionOptions;
354
+ defaults: () => Partial<TrustedSessionOptions>;
355
+ }>;
356
+ export declare enum ActionCompletion {
357
+ NotStarted = 0,
358
+ Completed = 1,
359
+ Unknown = 2
360
+ }
361
+ export declare enum DriverAuthorizationHostError_Tags {
362
+ Failed = "Failed"
363
+ }
364
+ export declare const DriverAuthorizationHostError: Readonly<{
365
+ instanceOf: (obj: any) => obj is DriverAuthorizationHostError;
366
+ Failed: {
367
+ new (inner: {
368
+ reason: string;
369
+ }): {
370
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
371
+ readonly inner: Readonly<{
372
+ reason: string;
373
+ }>;
374
+ /**
375
+ * @private
376
+ * This field is private and should not be used, use `tag` instead.
377
+ */
378
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
379
+ name: string;
380
+ message: string;
381
+ stack?: string;
382
+ cause?: unknown;
383
+ };
384
+ "new"(inner: {
385
+ reason: string;
386
+ }): {
387
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
388
+ readonly inner: Readonly<{
389
+ reason: string;
390
+ }>;
391
+ /**
392
+ * @private
393
+ * This field is private and should not be used, use `tag` instead.
394
+ */
395
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
396
+ name: string;
397
+ message: string;
398
+ stack?: string;
399
+ cause?: unknown;
400
+ };
401
+ instanceOf(obj: any): obj is {
402
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
403
+ readonly inner: Readonly<{
404
+ reason: string;
405
+ }>;
406
+ /**
407
+ * @private
408
+ * This field is private and should not be used, use `tag` instead.
409
+ */
410
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
411
+ name: string;
412
+ message: string;
413
+ stack?: string;
414
+ cause?: unknown;
415
+ };
416
+ hasInner(obj: any): obj is {
417
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
418
+ readonly inner: Readonly<{
419
+ reason: string;
420
+ }>;
421
+ /**
422
+ * @private
423
+ * This field is private and should not be used, use `tag` instead.
424
+ */
425
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
426
+ name: string;
427
+ message: string;
428
+ stack?: string;
429
+ cause?: unknown;
430
+ };
431
+ getInner(obj: {
432
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
433
+ readonly inner: Readonly<{
434
+ reason: string;
435
+ }>;
436
+ /**
437
+ * @private
438
+ * This field is private and should not be used, use `tag` instead.
439
+ */
440
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
441
+ name: string;
442
+ message: string;
443
+ stack?: string;
444
+ cause?: unknown;
445
+ }): Readonly<{
446
+ reason: string;
447
+ }>;
448
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
449
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
450
+ stackTraceLimit: number;
451
+ };
452
+ }>;
453
+ export type DriverAuthorizationHostError = InstanceType<typeof DriverAuthorizationHostError['Failed']>;
178
454
  export declare enum DriverError_Tags {
179
455
  Configuration = "Configuration",
180
456
  InvalidArguments = "InvalidArguments",
181
457
  Transport = "Transport",
182
458
  Protocol = "Protocol",
183
459
  Tool = "Tool",
184
- Shutdown = "Shutdown"
460
+ Shutdown = "Shutdown",
461
+ RuntimeAlreadyExists = "RuntimeAlreadyExists",
462
+ Worker = "Worker",
463
+ Remote = "Remote",
464
+ ActionInterrupted = "ActionInterrupted"
185
465
  }
186
466
  export declare const DriverError: Readonly<{
187
467
  instanceOf: (obj: any) => obj is DriverError;
@@ -574,9 +854,295 @@ export declare const DriverError: Readonly<{
574
854
  }): {
575
855
  readonly tag: DriverError_Tags.Tool;
576
856
  readonly inner: Readonly<{
577
- tool: string;
578
- message: string;
579
- errorCode: string;
857
+ tool: string;
858
+ message: string;
859
+ errorCode: string;
860
+ }>;
861
+ /**
862
+ * @private
863
+ * This field is private and should not be used, use `tag` instead.
864
+ */
865
+ readonly [uniffiTypeNameSymbol]: "DriverError";
866
+ name: string;
867
+ message: string;
868
+ stack?: string;
869
+ cause?: unknown;
870
+ };
871
+ instanceOf(obj: any): obj is {
872
+ readonly tag: DriverError_Tags.Tool;
873
+ readonly inner: Readonly<{
874
+ tool: string;
875
+ message: string;
876
+ errorCode: string;
877
+ }>;
878
+ /**
879
+ * @private
880
+ * This field is private and should not be used, use `tag` instead.
881
+ */
882
+ readonly [uniffiTypeNameSymbol]: "DriverError";
883
+ name: string;
884
+ message: string;
885
+ stack?: string;
886
+ cause?: unknown;
887
+ };
888
+ hasInner(obj: any): obj is {
889
+ readonly tag: DriverError_Tags.Tool;
890
+ readonly inner: Readonly<{
891
+ tool: string;
892
+ message: string;
893
+ errorCode: string;
894
+ }>;
895
+ /**
896
+ * @private
897
+ * This field is private and should not be used, use `tag` instead.
898
+ */
899
+ readonly [uniffiTypeNameSymbol]: "DriverError";
900
+ name: string;
901
+ message: string;
902
+ stack?: string;
903
+ cause?: unknown;
904
+ };
905
+ getInner(obj: {
906
+ readonly tag: DriverError_Tags.Tool;
907
+ readonly inner: Readonly<{
908
+ tool: string;
909
+ message: string;
910
+ errorCode: string;
911
+ }>;
912
+ /**
913
+ * @private
914
+ * This field is private and should not be used, use `tag` instead.
915
+ */
916
+ readonly [uniffiTypeNameSymbol]: "DriverError";
917
+ name: string;
918
+ message: string;
919
+ stack?: string;
920
+ cause?: unknown;
921
+ }): Readonly<{
922
+ tool: string;
923
+ message: string;
924
+ errorCode: string;
925
+ }>;
926
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
927
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
928
+ stackTraceLimit: number;
929
+ };
930
+ Shutdown: {
931
+ new (): {
932
+ readonly tag: DriverError_Tags.Shutdown;
933
+ /**
934
+ * @private
935
+ * This field is private and should not be used, use `tag` instead.
936
+ */
937
+ readonly [uniffiTypeNameSymbol]: "DriverError";
938
+ name: string;
939
+ message: string;
940
+ stack?: string;
941
+ cause?: unknown;
942
+ };
943
+ "new"(): {
944
+ readonly tag: DriverError_Tags.Shutdown;
945
+ /**
946
+ * @private
947
+ * This field is private and should not be used, use `tag` instead.
948
+ */
949
+ readonly [uniffiTypeNameSymbol]: "DriverError";
950
+ name: string;
951
+ message: string;
952
+ stack?: string;
953
+ cause?: unknown;
954
+ };
955
+ instanceOf(obj: any): obj is {
956
+ readonly tag: DriverError_Tags.Shutdown;
957
+ /**
958
+ * @private
959
+ * This field is private and should not be used, use `tag` instead.
960
+ */
961
+ readonly [uniffiTypeNameSymbol]: "DriverError";
962
+ name: string;
963
+ message: string;
964
+ stack?: string;
965
+ cause?: unknown;
966
+ };
967
+ hasInner(obj: any): obj is {
968
+ readonly tag: DriverError_Tags.Shutdown;
969
+ /**
970
+ * @private
971
+ * This field is private and should not be used, use `tag` instead.
972
+ */
973
+ readonly [uniffiTypeNameSymbol]: "DriverError";
974
+ name: string;
975
+ message: string;
976
+ stack?: string;
977
+ cause?: unknown;
978
+ };
979
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
980
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
981
+ stackTraceLimit: number;
982
+ };
983
+ RuntimeAlreadyExists: {
984
+ new (): {
985
+ readonly tag: DriverError_Tags.RuntimeAlreadyExists;
986
+ /**
987
+ * @private
988
+ * This field is private and should not be used, use `tag` instead.
989
+ */
990
+ readonly [uniffiTypeNameSymbol]: "DriverError";
991
+ name: string;
992
+ message: string;
993
+ stack?: string;
994
+ cause?: unknown;
995
+ };
996
+ "new"(): {
997
+ readonly tag: DriverError_Tags.RuntimeAlreadyExists;
998
+ /**
999
+ * @private
1000
+ * This field is private and should not be used, use `tag` instead.
1001
+ */
1002
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1003
+ name: string;
1004
+ message: string;
1005
+ stack?: string;
1006
+ cause?: unknown;
1007
+ };
1008
+ instanceOf(obj: any): obj is {
1009
+ readonly tag: DriverError_Tags.RuntimeAlreadyExists;
1010
+ /**
1011
+ * @private
1012
+ * This field is private and should not be used, use `tag` instead.
1013
+ */
1014
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1015
+ name: string;
1016
+ message: string;
1017
+ stack?: string;
1018
+ cause?: unknown;
1019
+ };
1020
+ hasInner(obj: any): obj is {
1021
+ readonly tag: DriverError_Tags.RuntimeAlreadyExists;
1022
+ /**
1023
+ * @private
1024
+ * This field is private and should not be used, use `tag` instead.
1025
+ */
1026
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1027
+ name: string;
1028
+ message: string;
1029
+ stack?: string;
1030
+ cause?: unknown;
1031
+ };
1032
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1033
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1034
+ stackTraceLimit: number;
1035
+ };
1036
+ Worker: {
1037
+ new (inner: {
1038
+ reason: string;
1039
+ }): {
1040
+ readonly tag: DriverError_Tags.Worker;
1041
+ readonly inner: Readonly<{
1042
+ reason: string;
1043
+ }>;
1044
+ /**
1045
+ * @private
1046
+ * This field is private and should not be used, use `tag` instead.
1047
+ */
1048
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1049
+ name: string;
1050
+ message: string;
1051
+ stack?: string;
1052
+ cause?: unknown;
1053
+ };
1054
+ "new"(inner: {
1055
+ reason: string;
1056
+ }): {
1057
+ readonly tag: DriverError_Tags.Worker;
1058
+ readonly inner: Readonly<{
1059
+ reason: string;
1060
+ }>;
1061
+ /**
1062
+ * @private
1063
+ * This field is private and should not be used, use `tag` instead.
1064
+ */
1065
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1066
+ name: string;
1067
+ message: string;
1068
+ stack?: string;
1069
+ cause?: unknown;
1070
+ };
1071
+ instanceOf(obj: any): obj is {
1072
+ readonly tag: DriverError_Tags.Worker;
1073
+ readonly inner: Readonly<{
1074
+ reason: string;
1075
+ }>;
1076
+ /**
1077
+ * @private
1078
+ * This field is private and should not be used, use `tag` instead.
1079
+ */
1080
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1081
+ name: string;
1082
+ message: string;
1083
+ stack?: string;
1084
+ cause?: unknown;
1085
+ };
1086
+ hasInner(obj: any): obj is {
1087
+ readonly tag: DriverError_Tags.Worker;
1088
+ readonly inner: Readonly<{
1089
+ reason: string;
1090
+ }>;
1091
+ /**
1092
+ * @private
1093
+ * This field is private and should not be used, use `tag` instead.
1094
+ */
1095
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1096
+ name: string;
1097
+ message: string;
1098
+ stack?: string;
1099
+ cause?: unknown;
1100
+ };
1101
+ getInner(obj: {
1102
+ readonly tag: DriverError_Tags.Worker;
1103
+ readonly inner: Readonly<{
1104
+ reason: string;
1105
+ }>;
1106
+ /**
1107
+ * @private
1108
+ * This field is private and should not be used, use `tag` instead.
1109
+ */
1110
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1111
+ name: string;
1112
+ message: string;
1113
+ stack?: string;
1114
+ cause?: unknown;
1115
+ }): Readonly<{
1116
+ reason: string;
1117
+ }>;
1118
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1119
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1120
+ stackTraceLimit: number;
1121
+ };
1122
+ Remote: {
1123
+ new (inner: {
1124
+ reason: string;
1125
+ }): {
1126
+ readonly tag: DriverError_Tags.Remote;
1127
+ readonly inner: Readonly<{
1128
+ reason: string;
1129
+ }>;
1130
+ /**
1131
+ * @private
1132
+ * This field is private and should not be used, use `tag` instead.
1133
+ */
1134
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1135
+ name: string;
1136
+ message: string;
1137
+ stack?: string;
1138
+ cause?: unknown;
1139
+ };
1140
+ "new"(inner: {
1141
+ reason: string;
1142
+ }): {
1143
+ readonly tag: DriverError_Tags.Remote;
1144
+ readonly inner: Readonly<{
1145
+ reason: string;
580
1146
  }>;
581
1147
  /**
582
1148
  * @private
@@ -589,11 +1155,9 @@ export declare const DriverError: Readonly<{
589
1155
  cause?: unknown;
590
1156
  };
591
1157
  instanceOf(obj: any): obj is {
592
- readonly tag: DriverError_Tags.Tool;
1158
+ readonly tag: DriverError_Tags.Remote;
593
1159
  readonly inner: Readonly<{
594
- tool: string;
595
- message: string;
596
- errorCode: string;
1160
+ reason: string;
597
1161
  }>;
598
1162
  /**
599
1163
  * @private
@@ -606,11 +1170,9 @@ export declare const DriverError: Readonly<{
606
1170
  cause?: unknown;
607
1171
  };
608
1172
  hasInner(obj: any): obj is {
609
- readonly tag: DriverError_Tags.Tool;
1173
+ readonly tag: DriverError_Tags.Remote;
610
1174
  readonly inner: Readonly<{
611
- tool: string;
612
- message: string;
613
- errorCode: string;
1175
+ reason: string;
614
1176
  }>;
615
1177
  /**
616
1178
  * @private
@@ -623,11 +1185,9 @@ export declare const DriverError: Readonly<{
623
1185
  cause?: unknown;
624
1186
  };
625
1187
  getInner(obj: {
626
- readonly tag: DriverError_Tags.Tool;
1188
+ readonly tag: DriverError_Tags.Remote;
627
1189
  readonly inner: Readonly<{
628
- tool: string;
629
- message: string;
630
- errorCode: string;
1190
+ reason: string;
631
1191
  }>;
632
1192
  /**
633
1193
  * @private
@@ -639,17 +1199,22 @@ export declare const DriverError: Readonly<{
639
1199
  stack?: string;
640
1200
  cause?: unknown;
641
1201
  }): Readonly<{
642
- tool: string;
643
- message: string;
644
- errorCode: string;
1202
+ reason: string;
645
1203
  }>;
646
1204
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
647
1205
  prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
648
1206
  stackTraceLimit: number;
649
1207
  };
650
- Shutdown: {
651
- new (): {
652
- readonly tag: DriverError_Tags.Shutdown;
1208
+ ActionInterrupted: {
1209
+ new (inner: {
1210
+ completion: ActionCompletion;
1211
+ reason: string;
1212
+ }): {
1213
+ readonly tag: DriverError_Tags.ActionInterrupted;
1214
+ readonly inner: Readonly<{
1215
+ completion: ActionCompletion;
1216
+ reason: string;
1217
+ }>;
653
1218
  /**
654
1219
  * @private
655
1220
  * This field is private and should not be used, use `tag` instead.
@@ -660,8 +1225,15 @@ export declare const DriverError: Readonly<{
660
1225
  stack?: string;
661
1226
  cause?: unknown;
662
1227
  };
663
- "new"(): {
664
- readonly tag: DriverError_Tags.Shutdown;
1228
+ "new"(inner: {
1229
+ completion: ActionCompletion;
1230
+ reason: string;
1231
+ }): {
1232
+ readonly tag: DriverError_Tags.ActionInterrupted;
1233
+ readonly inner: Readonly<{
1234
+ completion: ActionCompletion;
1235
+ reason: string;
1236
+ }>;
665
1237
  /**
666
1238
  * @private
667
1239
  * This field is private and should not be used, use `tag` instead.
@@ -673,7 +1245,11 @@ export declare const DriverError: Readonly<{
673
1245
  cause?: unknown;
674
1246
  };
675
1247
  instanceOf(obj: any): obj is {
676
- readonly tag: DriverError_Tags.Shutdown;
1248
+ readonly tag: DriverError_Tags.ActionInterrupted;
1249
+ readonly inner: Readonly<{
1250
+ completion: ActionCompletion;
1251
+ reason: string;
1252
+ }>;
677
1253
  /**
678
1254
  * @private
679
1255
  * This field is private and should not be used, use `tag` instead.
@@ -685,7 +1261,11 @@ export declare const DriverError: Readonly<{
685
1261
  cause?: unknown;
686
1262
  };
687
1263
  hasInner(obj: any): obj is {
688
- readonly tag: DriverError_Tags.Shutdown;
1264
+ readonly tag: DriverError_Tags.ActionInterrupted;
1265
+ readonly inner: Readonly<{
1266
+ completion: ActionCompletion;
1267
+ reason: string;
1268
+ }>;
689
1269
  /**
690
1270
  * @private
691
1271
  * This field is private and should not be used, use `tag` instead.
@@ -696,18 +1276,39 @@ export declare const DriverError: Readonly<{
696
1276
  stack?: string;
697
1277
  cause?: unknown;
698
1278
  };
1279
+ getInner(obj: {
1280
+ readonly tag: DriverError_Tags.ActionInterrupted;
1281
+ readonly inner: Readonly<{
1282
+ completion: ActionCompletion;
1283
+ reason: string;
1284
+ }>;
1285
+ /**
1286
+ * @private
1287
+ * This field is private and should not be used, use `tag` instead.
1288
+ */
1289
+ readonly [uniffiTypeNameSymbol]: "DriverError";
1290
+ name: string;
1291
+ message: string;
1292
+ stack?: string;
1293
+ cause?: unknown;
1294
+ }): Readonly<{
1295
+ completion: ActionCompletion;
1296
+ reason: string;
1297
+ }>;
699
1298
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
700
1299
  prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
701
1300
  stackTraceLimit: number;
702
1301
  };
703
1302
  }>;
704
- export type DriverError = InstanceType<typeof DriverError['Configuration' | 'InvalidArguments' | 'Transport' | 'Protocol' | 'Tool' | 'Shutdown']>;
1303
+ export type DriverError = InstanceType<typeof DriverError['Configuration' | 'InvalidArguments' | 'Transport' | 'Protocol' | 'Tool' | 'Shutdown' | 'RuntimeAlreadyExists' | 'Worker' | 'Remote' | 'ActionInterrupted']>;
705
1304
  /**
706
1305
  * Process topology used by this SDK object.
707
1306
  */
708
1307
  export declare enum DriverExecutionMode {
709
1308
  Embedded = 0,
710
- Daemon = 1
1309
+ Daemon = 1,
1310
+ PrivateWorker = 2,
1311
+ Remote = 3
711
1312
  }
712
1313
  export declare enum EmbeddedDriverError_Tags {
713
1314
  Configuration = "Configuration",
@@ -1431,6 +2032,9 @@ export interface CuaDriverLike {
1431
2032
  signal: AbortSignal;
1432
2033
  }): Promise<SessionStateOutput>;
1433
2034
  executionMode(): DriverExecutionMode;
2035
+ getAgentCursorState(input: GetAgentCursorStateInput, asyncOpts_?: {
2036
+ signal: AbortSignal;
2037
+ }): Promise<ToolResult>;
1434
2038
  getCursorPosition(input: GetCursorPositionInput, asyncOpts_?: {
1435
2039
  signal: AbortSignal;
1436
2040
  }): Promise<ToolResult>;
@@ -1462,9 +2066,19 @@ export interface CuaDriverLike {
1462
2066
  pressKey(input: PressKeyInput, asyncOpts_?: {
1463
2067
  signal: AbortSignal;
1464
2068
  }): Promise<ToolResult>;
2069
+ runtimeScopePrefix(): string | undefined;
1465
2070
  scroll(input: ScrollInput, asyncOpts_?: {
1466
2071
  signal: AbortSignal;
1467
2072
  }): Promise<ToolResult>;
2073
+ setAgentCursorEnabled(input: SetAgentCursorEnabledInput, asyncOpts_?: {
2074
+ signal: AbortSignal;
2075
+ }): Promise<ToolResult>;
2076
+ setAgentCursorMotion(input: SetAgentCursorMotionInput, asyncOpts_?: {
2077
+ signal: AbortSignal;
2078
+ }): Promise<ToolResult>;
2079
+ setAgentCursorTheme(input: SetAgentCursorThemeInput, asyncOpts_?: {
2080
+ signal: AbortSignal;
2081
+ }): Promise<ToolResult>;
1468
2082
  /**
1469
2083
  * Stop accepting new embedded operations. Repeated calls are harmless;
1470
2084
  * daemon compatibility clients do not own the daemon and therefore no-op.
@@ -1508,6 +2122,60 @@ export declare class CuaDriver extends UniffiAbstractObject implements CuaDriver
1508
2122
  * `cua-driver` and never opens daemon IPC.
1509
2123
  */
1510
2124
  static create(options: DriverOptions | undefined): CuaDriverLike;
2125
+ /**
2126
+ * Create a same-process runtime with an explicit immutable authorization
2127
+ * ceiling. This is a trusted host constructor and is not exposed as an
2128
+ * agent tool. Existing `create()` callers remain unchanged.
2129
+ */
2130
+ static createConfigured(options: ConfiguredDriverOptions): CuaDriverLike;
2131
+ /**
2132
+ * Create a configured same-process runtime with a content-free activity
2133
+ * observer supplied by trusted embedding-host code.
2134
+ */
2135
+ static createConfiguredWithActivityObserver(options: ConfiguredDriverOptions, observer: DriverActivityObserver): CuaDriverLike;
2136
+ /**
2137
+ * Language-package entry point for a configured activity-observer runtime.
2138
+ */
2139
+ static createConfiguredWithActivityObserverAndClientKind(options: ConfiguredDriverOptions, observer: DriverActivityObserver, clientKind: SdkClientKind): CuaDriverLike;
2140
+ /**
2141
+ * Create a configured same-process runtime with an optional residual
2142
+ * authorization callback supplied by trusted embedding-host code.
2143
+ *
2144
+ * The callback object is immutable runtime configuration. Applications
2145
+ * must not expose it to an agent or implement it using ordinary MCP
2146
+ * elicitation, model-visible stdio, or an auto-accepting callback.
2147
+ */
2148
+ static createConfiguredWithAuthorizationHost(options: ConfiguredDriverOptions, host: DriverAuthorizationHost): CuaDriverLike;
2149
+ /**
2150
+ * Language-package entry point for a configured protected-host runtime.
2151
+ */
2152
+ static createConfiguredWithAuthorizationHostAndClientKind(options: ConfiguredDriverOptions, host: DriverAuthorizationHost, clientKind: SdkClientKind): CuaDriverLike;
2153
+ /**
2154
+ * Language-package entry point for an explicitly configured runtime.
2155
+ */
2156
+ static createConfiguredWithClientKind(options: ConfiguredDriverOptions, clientKind: SdkClientKind): CuaDriverLike;
2157
+ /**
2158
+ * Create a configured same-process runtime with both residual
2159
+ * authorization and content-free activity callbacks.
2160
+ */
2161
+ static createConfiguredWithHostIntegrations(options: ConfiguredDriverOptions, host: DriverAuthorizationHost, observer: DriverActivityObserver): CuaDriverLike;
2162
+ /**
2163
+ * Language-package entry point for both trusted host callbacks.
2164
+ */
2165
+ static createConfiguredWithHostIntegrationsAndClientKind(options: ConfiguredDriverOptions, host: DriverAuthorizationHost, observer: DriverActivityObserver, clientKind: SdkClientKind): CuaDriverLike;
2166
+ /**
2167
+ * Create a process-isolated runtime owned by this SDK object.
2168
+ *
2169
+ * This constructor directly spawns the supplied Cua Driver binary and
2170
+ * communicates only over inherited stdio. No daemon or reusable endpoint
2171
+ * is created.
2172
+ */
2173
+ static createPrivateWorker(options: PrivateWorkerOptions): CuaDriverLike;
2174
+ /**
2175
+ * Language-package entry point that preserves the worker constructor
2176
+ * while attaching the importing SDK runtime category.
2177
+ */
2178
+ static createPrivateWorkerWithClientKind(options: PrivateWorkerOptions, clientKind: SdkClientKind): CuaDriverLike;
1511
2179
  /**
1512
2180
  * Language-package entry point for the same-process runtime. The wrapper
1513
2181
  * at each package root selects the client kind automatically.
@@ -1534,6 +2202,9 @@ export declare class CuaDriver extends UniffiAbstractObject implements CuaDriver
1534
2202
  signal: AbortSignal;
1535
2203
  }): Promise<SessionStateOutput>;
1536
2204
  executionMode(): DriverExecutionMode;
2205
+ getAgentCursorState(input: GetAgentCursorStateInput, asyncOpts_?: {
2206
+ signal: AbortSignal;
2207
+ }): Promise<ToolResult>;
1537
2208
  getCursorPosition(input: GetCursorPositionInput, asyncOpts_?: {
1538
2209
  signal: AbortSignal;
1539
2210
  }): Promise<ToolResult>;
@@ -1565,9 +2236,19 @@ export declare class CuaDriver extends UniffiAbstractObject implements CuaDriver
1565
2236
  pressKey(input: PressKeyInput, asyncOpts_?: {
1566
2237
  signal: AbortSignal;
1567
2238
  }): Promise<ToolResult>;
2239
+ runtimeScopePrefix(): string | undefined;
1568
2240
  scroll(input: ScrollInput, asyncOpts_?: {
1569
2241
  signal: AbortSignal;
1570
2242
  }): Promise<ToolResult>;
2243
+ setAgentCursorEnabled(input: SetAgentCursorEnabledInput, asyncOpts_?: {
2244
+ signal: AbortSignal;
2245
+ }): Promise<ToolResult>;
2246
+ setAgentCursorMotion(input: SetAgentCursorMotionInput, asyncOpts_?: {
2247
+ signal: AbortSignal;
2248
+ }): Promise<ToolResult>;
2249
+ setAgentCursorTheme(input: SetAgentCursorThemeInput, asyncOpts_?: {
2250
+ signal: AbortSignal;
2251
+ }): Promise<ToolResult>;
1571
2252
  /**
1572
2253
  * Stop accepting new embedded operations. Repeated calls are harmless;
1573
2254
  * daemon compatibility clients do not own the daemon and therefore no-op.
@@ -1589,6 +2270,202 @@ export declare class CuaDriver extends UniffiAbstractObject implements CuaDriver
1589
2270
  uniffiDestroy(): void;
1590
2271
  static instanceOf(obj_: any): obj_ is CuaDriver;
1591
2272
  }
2273
+ export interface CuaDriverSessionLike {
2274
+ callTool(name: string, argumentsJson: string, asyncOpts_?: {
2275
+ signal: AbortSignal;
2276
+ }): Promise<ToolResult>;
2277
+ click(input: ClickInput, asyncOpts_?: {
2278
+ signal: AbortSignal;
2279
+ }): Promise<ToolResult>;
2280
+ /**
2281
+ * Revoke the session-bound authority and release its native handle.
2282
+ *
2283
+ * This operation is idempotent. Dropping the object performs the same
2284
+ * cleanup, but trusted hosts should call it at their lifecycle boundary.
2285
+ */
2286
+ close(): void;
2287
+ drag(input: DragInput, asyncOpts_?: {
2288
+ signal: AbortSignal;
2289
+ }): Promise<ToolResult>;
2290
+ endSession(input: EndSessionInput, asyncOpts_?: {
2291
+ signal: AbortSignal;
2292
+ }): Promise<EndSessionOutput>;
2293
+ escalateSession(input: EscalateSessionInput, asyncOpts_?: {
2294
+ signal: AbortSignal;
2295
+ }): Promise<SessionStateOutput>;
2296
+ getAgentCursorState(input: GetAgentCursorStateInput, asyncOpts_?: {
2297
+ signal: AbortSignal;
2298
+ }): Promise<ToolResult>;
2299
+ getCursorPosition(input: GetCursorPositionInput, asyncOpts_?: {
2300
+ signal: AbortSignal;
2301
+ }): Promise<ToolResult>;
2302
+ getDesktopState(input: GetDesktopStateInput, asyncOpts_?: {
2303
+ signal: AbortSignal;
2304
+ }): Promise<ToolResult>;
2305
+ getScreenSize(input: GetScreenSizeInput, asyncOpts_?: {
2306
+ signal: AbortSignal;
2307
+ }): Promise<ToolResult>;
2308
+ getSessionState(input: GetSessionStateInput, asyncOpts_?: {
2309
+ signal: AbortSignal;
2310
+ }): Promise<SessionStateOutput>;
2311
+ hotkey(input: HotkeyInput, asyncOpts_?: {
2312
+ signal: AbortSignal;
2313
+ }): Promise<ToolResult>;
2314
+ moveCursor(input: MoveCursorInput, asyncOpts_?: {
2315
+ signal: AbortSignal;
2316
+ }): Promise<ToolResult>;
2317
+ pressKey(input: PressKeyInput, asyncOpts_?: {
2318
+ signal: AbortSignal;
2319
+ }): Promise<ToolResult>;
2320
+ scroll(input: ScrollInput, asyncOpts_?: {
2321
+ signal: AbortSignal;
2322
+ }): Promise<ToolResult>;
2323
+ setAgentCursorEnabled(input: SetAgentCursorEnabledInput, asyncOpts_?: {
2324
+ signal: AbortSignal;
2325
+ }): Promise<ToolResult>;
2326
+ setAgentCursorMotion(input: SetAgentCursorMotionInput, asyncOpts_?: {
2327
+ signal: AbortSignal;
2328
+ }): Promise<ToolResult>;
2329
+ setAgentCursorTheme(input: SetAgentCursorThemeInput, asyncOpts_?: {
2330
+ signal: AbortSignal;
2331
+ }): Promise<ToolResult>;
2332
+ startSession(input: StartSessionInput, asyncOpts_?: {
2333
+ signal: AbortSignal;
2334
+ }): Promise<StartSessionOutput>;
2335
+ typeText(input: TypeTextInput, asyncOpts_?: {
2336
+ signal: AbortSignal;
2337
+ }): Promise<ToolResult>;
2338
+ }
2339
+ /**
2340
+ * @deprecated Use `CuaDriverSessionLike` instead.
2341
+ */
2342
+ export type CuaDriverSessionInterface = CuaDriverSessionLike;
2343
+ export declare class CuaDriverSession extends UniffiAbstractObject implements CuaDriverSessionLike {
2344
+ readonly [uniffiTypeNameSymbol] = "CuaDriverSession";
2345
+ readonly [destructorGuardSymbol]: UniffiGcObject;
2346
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2347
+ private constructor();
2348
+ callTool(name: string, argumentsJson: string, asyncOpts_?: {
2349
+ signal: AbortSignal;
2350
+ }): Promise<ToolResult>;
2351
+ click(input: ClickInput, asyncOpts_?: {
2352
+ signal: AbortSignal;
2353
+ }): Promise<ToolResult>;
2354
+ /**
2355
+ * Revoke the session-bound authority and release its native handle.
2356
+ *
2357
+ * This operation is idempotent. Dropping the object performs the same
2358
+ * cleanup, but trusted hosts should call it at their lifecycle boundary.
2359
+ */
2360
+ close(): void;
2361
+ drag(input: DragInput, asyncOpts_?: {
2362
+ signal: AbortSignal;
2363
+ }): Promise<ToolResult>;
2364
+ endSession(input: EndSessionInput, asyncOpts_?: {
2365
+ signal: AbortSignal;
2366
+ }): Promise<EndSessionOutput>;
2367
+ escalateSession(input: EscalateSessionInput, asyncOpts_?: {
2368
+ signal: AbortSignal;
2369
+ }): Promise<SessionStateOutput>;
2370
+ getAgentCursorState(input: GetAgentCursorStateInput, asyncOpts_?: {
2371
+ signal: AbortSignal;
2372
+ }): Promise<ToolResult>;
2373
+ getCursorPosition(input: GetCursorPositionInput, asyncOpts_?: {
2374
+ signal: AbortSignal;
2375
+ }): Promise<ToolResult>;
2376
+ getDesktopState(input: GetDesktopStateInput, asyncOpts_?: {
2377
+ signal: AbortSignal;
2378
+ }): Promise<ToolResult>;
2379
+ getScreenSize(input: GetScreenSizeInput, asyncOpts_?: {
2380
+ signal: AbortSignal;
2381
+ }): Promise<ToolResult>;
2382
+ getSessionState(input: GetSessionStateInput, asyncOpts_?: {
2383
+ signal: AbortSignal;
2384
+ }): Promise<SessionStateOutput>;
2385
+ hotkey(input: HotkeyInput, asyncOpts_?: {
2386
+ signal: AbortSignal;
2387
+ }): Promise<ToolResult>;
2388
+ moveCursor(input: MoveCursorInput, asyncOpts_?: {
2389
+ signal: AbortSignal;
2390
+ }): Promise<ToolResult>;
2391
+ pressKey(input: PressKeyInput, asyncOpts_?: {
2392
+ signal: AbortSignal;
2393
+ }): Promise<ToolResult>;
2394
+ scroll(input: ScrollInput, asyncOpts_?: {
2395
+ signal: AbortSignal;
2396
+ }): Promise<ToolResult>;
2397
+ setAgentCursorEnabled(input: SetAgentCursorEnabledInput, asyncOpts_?: {
2398
+ signal: AbortSignal;
2399
+ }): Promise<ToolResult>;
2400
+ setAgentCursorMotion(input: SetAgentCursorMotionInput, asyncOpts_?: {
2401
+ signal: AbortSignal;
2402
+ }): Promise<ToolResult>;
2403
+ setAgentCursorTheme(input: SetAgentCursorThemeInput, asyncOpts_?: {
2404
+ signal: AbortSignal;
2405
+ }): Promise<ToolResult>;
2406
+ startSession(input: StartSessionInput, asyncOpts_?: {
2407
+ signal: AbortSignal;
2408
+ }): Promise<StartSessionOutput>;
2409
+ typeText(input: TypeTextInput, asyncOpts_?: {
2410
+ signal: AbortSignal;
2411
+ }): Promise<ToolResult>;
2412
+ uniffiDestroy(): void;
2413
+ static instanceOf(obj_: any): obj_ is CuaDriverSession;
2414
+ }
2415
+ /**
2416
+ * Optional observer implemented by trusted embedding-host code.
2417
+ *
2418
+ * Observations are informational and cannot grant authority or change a tool
2419
+ * result. Implementations should return quickly and hand off expensive work.
2420
+ */
2421
+ export interface DriverActivityObserver {
2422
+ onActivity(event: DriverActivityEvent): void;
2423
+ }
2424
+ /**
2425
+ * Optional observer implemented by trusted embedding-host code.
2426
+ *
2427
+ * Observations are informational and cannot grant authority or change a tool
2428
+ * result. Implementations should return quickly and hand off expensive work.
2429
+ */
2430
+ export declare class DriverActivityObserverImpl extends UniffiAbstractObject implements DriverActivityObserver {
2431
+ readonly [uniffiTypeNameSymbol] = "DriverActivityObserverImpl";
2432
+ readonly [destructorGuardSymbol]: UniffiGcObject;
2433
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2434
+ private constructor();
2435
+ onActivity(event: DriverActivityEvent): void;
2436
+ uniffiDestroy(): void;
2437
+ static instanceOf(obj_: any): obj_ is DriverActivityObserverImpl;
2438
+ }
2439
+ /**
2440
+ * Optional callback implemented by a trusted embedding application.
2441
+ *
2442
+ * Cua invokes this only for a residual boundary whose active permission mode
2443
+ * requires a host grant. Routine standard-mode automation and every
2444
+ * in-manifest bounded operation bypass it.
2445
+ */
2446
+ export interface DriverAuthorizationHost {
2447
+ authorize(request: DriverAuthorizationRequest, asyncOpts_?: {
2448
+ signal: AbortSignal;
2449
+ }): Promise<DriverAuthorizationDecision>;
2450
+ }
2451
+ /**
2452
+ * Optional callback implemented by a trusted embedding application.
2453
+ *
2454
+ * Cua invokes this only for a residual boundary whose active permission mode
2455
+ * requires a host grant. Routine standard-mode automation and every
2456
+ * in-manifest bounded operation bypass it.
2457
+ */
2458
+ export declare class DriverAuthorizationHostImpl extends UniffiAbstractObject implements DriverAuthorizationHost {
2459
+ readonly [uniffiTypeNameSymbol] = "DriverAuthorizationHostImpl";
2460
+ readonly [destructorGuardSymbol]: UniffiGcObject;
2461
+ readonly [pointerLiteralSymbol]: UniffiHandle;
2462
+ private constructor();
2463
+ authorize(request: DriverAuthorizationRequest, asyncOpts_?: {
2464
+ signal: AbortSignal;
2465
+ }): Promise<DriverAuthorizationDecision>;
2466
+ uniffiDestroy(): void;
2467
+ static instanceOf(obj_: any): obj_ is DriverAuthorizationHostImpl;
2468
+ }
1592
2469
  export interface EmbeddedCuaDriverHostLike {
1593
2470
  connection(): EmbeddedDriverConnection | undefined;
1594
2471
  restart(asyncOpts_?: {
@@ -1646,7 +2523,136 @@ declare function uniffiEnsureInitialized(): void;
1646
2523
  declare const _default: Readonly<{
1647
2524
  initialize: typeof uniffiEnsureInitialized;
1648
2525
  converters: {
2526
+ FfiConverterTypeActionCompletion: {
2527
+ read(from: RustBuffer): ActionCompletion;
2528
+ write(value: ActionCompletion, into: RustBuffer): void;
2529
+ allocationSize(value: ActionCompletion): number;
2530
+ lift(value: UniffiByteArray): ActionCompletion;
2531
+ lower(value: ActionCompletion, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2532
+ };
2533
+ FfiConverterTypeConfiguredDriverOptions: {
2534
+ read(from: RustBuffer): ConfiguredDriverOptions;
2535
+ write(value: ConfiguredDriverOptions, into: RustBuffer): void;
2536
+ allocationSize(value: ConfiguredDriverOptions): number;
2537
+ lift(value: UniffiByteArray): ConfiguredDriverOptions;
2538
+ lower(value: ConfiguredDriverOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2539
+ };
1649
2540
  FfiConverterTypeCuaDriver: FfiConverterObject<CuaDriverLike>;
2541
+ FfiConverterTypeCuaDriverSession: FfiConverterObject<CuaDriverSessionLike>;
2542
+ FfiConverterTypeDriverActivityEvent: {
2543
+ read(from: RustBuffer): DriverActivityEvent;
2544
+ write(value: DriverActivityEvent, into: RustBuffer): void;
2545
+ allocationSize(value: DriverActivityEvent): number;
2546
+ lift(value: UniffiByteArray): DriverActivityEvent;
2547
+ lower(value: DriverActivityEvent, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2548
+ };
2549
+ FfiConverterTypeDriverActivityKind: {
2550
+ read(from: RustBuffer): DriverActivityKind;
2551
+ write(value: DriverActivityKind, into: RustBuffer): void;
2552
+ allocationSize(value: DriverActivityKind): number;
2553
+ lift(value: UniffiByteArray): DriverActivityKind;
2554
+ lower(value: DriverActivityKind, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2555
+ };
2556
+ FfiConverterTypeDriverActivityObserver: FfiConverterObjectWithCallbacks<DriverActivityObserver>;
2557
+ FfiConverterTypeDriverAuthorizationAction: {
2558
+ read(from: RustBuffer): DriverAuthorizationAction;
2559
+ write(value: DriverAuthorizationAction, into: RustBuffer): void;
2560
+ allocationSize(value: DriverAuthorizationAction): number;
2561
+ lift(value: UniffiByteArray): DriverAuthorizationAction;
2562
+ lower(value: DriverAuthorizationAction, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2563
+ };
2564
+ FfiConverterTypeDriverAuthorizationDecision: {
2565
+ read(from: RustBuffer): DriverAuthorizationDecision;
2566
+ write(value: DriverAuthorizationDecision, into: RustBuffer): void;
2567
+ allocationSize(value: DriverAuthorizationDecision): number;
2568
+ lift(value: UniffiByteArray): DriverAuthorizationDecision;
2569
+ lower(value: DriverAuthorizationDecision, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2570
+ };
2571
+ FfiConverterTypeDriverAuthorizationHost: FfiConverterObjectWithCallbacks<DriverAuthorizationHost>;
2572
+ FfiConverterTypeDriverAuthorizationHostError: {
2573
+ read(from: RustBuffer): {
2574
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
2575
+ readonly inner: Readonly<{
2576
+ reason: string;
2577
+ }>;
2578
+ /**
2579
+ * @private
2580
+ * This field is private and should not be used, use `tag` instead.
2581
+ */
2582
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
2583
+ name: string;
2584
+ message: string;
2585
+ stack?: string;
2586
+ cause?: unknown;
2587
+ };
2588
+ write(value: {
2589
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
2590
+ readonly inner: Readonly<{
2591
+ reason: string;
2592
+ }>;
2593
+ /**
2594
+ * @private
2595
+ * This field is private and should not be used, use `tag` instead.
2596
+ */
2597
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
2598
+ name: string;
2599
+ message: string;
2600
+ stack?: string;
2601
+ cause?: unknown;
2602
+ }, into: RustBuffer): void;
2603
+ allocationSize(value: {
2604
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
2605
+ readonly inner: Readonly<{
2606
+ reason: string;
2607
+ }>;
2608
+ /**
2609
+ * @private
2610
+ * This field is private and should not be used, use `tag` instead.
2611
+ */
2612
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
2613
+ name: string;
2614
+ message: string;
2615
+ stack?: string;
2616
+ cause?: unknown;
2617
+ }): number;
2618
+ lift(value: UniffiByteArray): {
2619
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
2620
+ readonly inner: Readonly<{
2621
+ reason: string;
2622
+ }>;
2623
+ /**
2624
+ * @private
2625
+ * This field is private and should not be used, use `tag` instead.
2626
+ */
2627
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
2628
+ name: string;
2629
+ message: string;
2630
+ stack?: string;
2631
+ cause?: unknown;
2632
+ };
2633
+ lower(value: {
2634
+ readonly tag: DriverAuthorizationHostError_Tags.Failed;
2635
+ readonly inner: Readonly<{
2636
+ reason: string;
2637
+ }>;
2638
+ /**
2639
+ * @private
2640
+ * This field is private and should not be used, use `tag` instead.
2641
+ */
2642
+ readonly [uniffiTypeNameSymbol]: "DriverAuthorizationHostError";
2643
+ name: string;
2644
+ message: string;
2645
+ stack?: string;
2646
+ cause?: unknown;
2647
+ }, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2648
+ };
2649
+ FfiConverterTypeDriverAuthorizationRequest: {
2650
+ read(from: RustBuffer): DriverAuthorizationRequest;
2651
+ write(value: DriverAuthorizationRequest, into: RustBuffer): void;
2652
+ allocationSize(value: DriverAuthorizationRequest): number;
2653
+ lift(value: UniffiByteArray): DriverAuthorizationRequest;
2654
+ lower(value: DriverAuthorizationRequest, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2655
+ };
1650
2656
  FfiConverterTypeDriverError: {
1651
2657
  read(from: RustBuffer): DriverError;
1652
2658
  write(value: DriverError, into: RustBuffer): void;
@@ -1746,6 +2752,20 @@ declare const _default: Readonly<{
1746
2752
  lift(value: UniffiByteArray): MacOsPermissionStatus;
1747
2753
  lower(value: MacOsPermissionStatus, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
1748
2754
  };
2755
+ FfiConverterTypePrivateWorkerOptions: {
2756
+ read(from: RustBuffer): PrivateWorkerOptions;
2757
+ write(value: PrivateWorkerOptions, into: RustBuffer): void;
2758
+ allocationSize(value: PrivateWorkerOptions): number;
2759
+ lift(value: UniffiByteArray): PrivateWorkerOptions;
2760
+ lower(value: PrivateWorkerOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2761
+ };
2762
+ FfiConverterTypeRuntimeAuthorizationOptions: {
2763
+ read(from: RustBuffer): RuntimeAuthorizationOptions;
2764
+ write(value: RuntimeAuthorizationOptions, into: RustBuffer): void;
2765
+ allocationSize(value: RuntimeAuthorizationOptions): number;
2766
+ lift(value: UniffiByteArray): RuntimeAuthorizationOptions;
2767
+ lower(value: RuntimeAuthorizationOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2768
+ };
1749
2769
  FfiConverterTypeSdkClientKind: {
1750
2770
  read(from: RustBuffer): SdkClientKind;
1751
2771
  write(value: SdkClientKind, into: RustBuffer): void;
@@ -1753,6 +2773,13 @@ declare const _default: Readonly<{
1753
2773
  lift(value: UniffiByteArray): SdkClientKind;
1754
2774
  lower(value: SdkClientKind, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
1755
2775
  };
2776
+ FfiConverterTypeSessionPermissionMode: {
2777
+ read(from: RustBuffer): SessionPermissionMode;
2778
+ write(value: SessionPermissionMode, into: RustBuffer): void;
2779
+ allocationSize(value: SessionPermissionMode): number;
2780
+ lift(value: UniffiByteArray): SessionPermissionMode;
2781
+ lower(value: SessionPermissionMode, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2782
+ };
1756
2783
  FfiConverterTypeToolResult: {
1757
2784
  read(from: RustBuffer): ToolResult;
1758
2785
  write(value: ToolResult, into: RustBuffer): void;
@@ -1760,6 +2787,13 @@ declare const _default: Readonly<{
1760
2787
  lift(value: UniffiByteArray): ToolResult;
1761
2788
  lower(value: ToolResult, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
1762
2789
  };
2790
+ FfiConverterTypeTrustedSessionOptions: {
2791
+ read(from: RustBuffer): TrustedSessionOptions;
2792
+ write(value: TrustedSessionOptions, into: RustBuffer): void;
2793
+ allocationSize(value: TrustedSessionOptions): number;
2794
+ lift(value: UniffiByteArray): TrustedSessionOptions;
2795
+ lower(value: TrustedSessionOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
2796
+ };
1763
2797
  };
1764
2798
  }>;
1765
2799
  export default _default;