@trycua/cua-driver 0.26.1 → 0.27.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.
@@ -20,6 +20,10 @@ export declare function createRemoteTrustedSession(driver: CuaDriverLike, option
20
20
  export declare function createTrustedSession(driver: CuaDriverLike, options: TrustedSessionOptions): CuaDriverSessionLike;
21
21
  export declare function currentMacOsPermissionStatus(): MacOsPermissionStatus;
22
22
  export declare function openMacOsScreenRecordingSettings(): void;
23
+ /**
24
+ * Construct before opening so the owner can invalidate an in-flight initialize.
25
+ */
26
+ export declare function openMcpDriverChannel(transport: DriverServiceTransport, authenticatedPrincipal: string): McpDriverChannelLike;
23
27
  export declare function requestMacOsPermissions(): MacOsPermissionStatus;
24
28
  /**
25
29
  * Permission mode chosen by trusted host code for a runtime or session.
@@ -194,6 +198,46 @@ export declare const DriverOptions: Readonly<{
194
198
  new: (partial: Partial<DriverOptions> & Required<Omit<DriverOptions, never>>) => DriverOptions;
195
199
  defaults: () => Partial<DriverOptions>;
196
200
  }>;
201
+ export type DriverServiceHeader = {
202
+ name: string;
203
+ value: string;
204
+ };
205
+ /**
206
+ * Generated factory for {@link DriverServiceHeader} record objects.
207
+ */
208
+ export declare const DriverServiceHeader: Readonly<{
209
+ create: (partial: Partial<DriverServiceHeader> & Required<Omit<DriverServiceHeader, never>>) => DriverServiceHeader;
210
+ new: (partial: Partial<DriverServiceHeader> & Required<Omit<DriverServiceHeader, never>>) => DriverServiceHeader;
211
+ defaults: () => Partial<DriverServiceHeader>;
212
+ }>;
213
+ export type DriverServiceRequest = {
214
+ method: string;
215
+ path: string;
216
+ headers: Array<DriverServiceHeader>;
217
+ body: ArrayBuffer;
218
+ timeoutMs: bigint;
219
+ };
220
+ /**
221
+ * Generated factory for {@link DriverServiceRequest} record objects.
222
+ */
223
+ export declare const DriverServiceRequest: Readonly<{
224
+ create: (partial: Partial<DriverServiceRequest> & Required<Omit<DriverServiceRequest, never>>) => DriverServiceRequest;
225
+ new: (partial: Partial<DriverServiceRequest> & Required<Omit<DriverServiceRequest, never>>) => DriverServiceRequest;
226
+ defaults: () => Partial<DriverServiceRequest>;
227
+ }>;
228
+ export type DriverServiceResponse = {
229
+ status: number;
230
+ headers: Array<DriverServiceHeader>;
231
+ body: ArrayBuffer;
232
+ };
233
+ /**
234
+ * Generated factory for {@link DriverServiceResponse} record objects.
235
+ */
236
+ export declare const DriverServiceResponse: Readonly<{
237
+ create: (partial: Partial<DriverServiceResponse> & Required<Omit<DriverServiceResponse, never>>) => DriverServiceResponse;
238
+ new: (partial: Partial<DriverServiceResponse> & Required<Omit<DriverServiceResponse, never>>) => DriverServiceResponse;
239
+ defaults: () => Partial<DriverServiceResponse>;
240
+ }>;
197
241
  export type EmbeddedEnvironmentVariable = {
198
242
  name: string;
199
243
  value: string;
@@ -1552,6 +1596,99 @@ export declare enum DriverExecutionMode {
1552
1596
  PrivateWorker = 2,
1553
1597
  Remote = 3
1554
1598
  }
1599
+ export declare enum DriverServiceTransportError_Tags {
1600
+ Failed = "Failed"
1601
+ }
1602
+ export declare const DriverServiceTransportError: Readonly<{
1603
+ instanceOf: (obj: any) => obj is DriverServiceTransportError;
1604
+ Failed: {
1605
+ new (inner: {
1606
+ reason: string;
1607
+ }): {
1608
+ readonly tag: DriverServiceTransportError_Tags.Failed;
1609
+ readonly inner: Readonly<{
1610
+ reason: string;
1611
+ }>;
1612
+ /**
1613
+ * @private
1614
+ * This field is private and should not be used, use `tag` instead.
1615
+ */
1616
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
1617
+ name: string;
1618
+ message: string;
1619
+ stack?: string;
1620
+ cause?: unknown;
1621
+ };
1622
+ "new"(inner: {
1623
+ reason: string;
1624
+ }): {
1625
+ readonly tag: DriverServiceTransportError_Tags.Failed;
1626
+ readonly inner: Readonly<{
1627
+ reason: string;
1628
+ }>;
1629
+ /**
1630
+ * @private
1631
+ * This field is private and should not be used, use `tag` instead.
1632
+ */
1633
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
1634
+ name: string;
1635
+ message: string;
1636
+ stack?: string;
1637
+ cause?: unknown;
1638
+ };
1639
+ instanceOf(obj: any): obj is {
1640
+ readonly tag: DriverServiceTransportError_Tags.Failed;
1641
+ readonly inner: Readonly<{
1642
+ reason: string;
1643
+ }>;
1644
+ /**
1645
+ * @private
1646
+ * This field is private and should not be used, use `tag` instead.
1647
+ */
1648
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
1649
+ name: string;
1650
+ message: string;
1651
+ stack?: string;
1652
+ cause?: unknown;
1653
+ };
1654
+ hasInner(obj: any): obj is {
1655
+ readonly tag: DriverServiceTransportError_Tags.Failed;
1656
+ readonly inner: Readonly<{
1657
+ reason: string;
1658
+ }>;
1659
+ /**
1660
+ * @private
1661
+ * This field is private and should not be used, use `tag` instead.
1662
+ */
1663
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
1664
+ name: string;
1665
+ message: string;
1666
+ stack?: string;
1667
+ cause?: unknown;
1668
+ };
1669
+ getInner(obj: {
1670
+ readonly tag: DriverServiceTransportError_Tags.Failed;
1671
+ readonly inner: Readonly<{
1672
+ reason: string;
1673
+ }>;
1674
+ /**
1675
+ * @private
1676
+ * This field is private and should not be used, use `tag` instead.
1677
+ */
1678
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
1679
+ name: string;
1680
+ message: string;
1681
+ stack?: string;
1682
+ cause?: unknown;
1683
+ }): Readonly<{
1684
+ reason: string;
1685
+ }>;
1686
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1687
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1688
+ stackTraceLimit: number;
1689
+ };
1690
+ }>;
1691
+ export type DriverServiceTransportError = InstanceType<typeof DriverServiceTransportError['Failed']>;
1555
1692
  export declare enum EmbeddedDriverError_Tags {
1556
1693
  Configuration = "Configuration",
1557
1694
  EndpointConflict = "EndpointConflict",
@@ -2844,6 +2981,34 @@ export declare class DriverAuthorizationHostImpl extends UniffiAbstractObject im
2844
2981
  uniffiDestroy(): void;
2845
2982
  static instanceOf(obj_: any): obj_ is DriverAuthorizationHostImpl;
2846
2983
  }
2984
+ /**
2985
+ * A host-bound named service, never a guest-selected URL or authority.
2986
+ * The transport must enforce `timeout_ms` and bound buffered response bytes to
2987
+ * 16 MiB. Rust bounds caller waits independently but deliberately never aborts
2988
+ * an active response stream during receiver teardown.
2989
+ */
2990
+ export interface DriverServiceTransport {
2991
+ send(request: DriverServiceRequest, asyncOpts_?: {
2992
+ signal: AbortSignal;
2993
+ }): Promise<DriverServiceResponse>;
2994
+ }
2995
+ /**
2996
+ * A host-bound named service, never a guest-selected URL or authority.
2997
+ * The transport must enforce `timeout_ms` and bound buffered response bytes to
2998
+ * 16 MiB. Rust bounds caller waits independently but deliberately never aborts
2999
+ * an active response stream during receiver teardown.
3000
+ */
3001
+ export declare class DriverServiceTransportImpl extends UniffiAbstractObject implements DriverServiceTransport {
3002
+ readonly [uniffiTypeNameSymbol] = "DriverServiceTransportImpl";
3003
+ readonly [destructorGuardSymbol]: UniffiGcObject;
3004
+ readonly [pointerLiteralSymbol]: UniffiHandle;
3005
+ private constructor();
3006
+ send(request: DriverServiceRequest, asyncOpts_?: {
3007
+ signal: AbortSignal;
3008
+ }): Promise<DriverServiceResponse>;
3009
+ uniffiDestroy(): void;
3010
+ static instanceOf(obj_: any): obj_ is DriverServiceTransportImpl;
3011
+ }
2847
3012
  export interface EmbeddedCuaDriverHostLike {
2848
3013
  connection(): EmbeddedDriverConnection | undefined;
2849
3014
  restart(asyncOpts_?: {
@@ -2887,6 +3052,36 @@ export declare class EmbeddedCuaDriverHost extends UniffiAbstractObject implemen
2887
3052
  uniffiDestroy(): void;
2888
3053
  static instanceOf(obj_: any): obj_ is EmbeddedCuaDriverHost;
2889
3054
  }
3055
+ export interface McpDriverChannelLike {
3056
+ close(asyncOpts_?: {
3057
+ signal: AbortSignal;
3058
+ }): Promise<void>;
3059
+ driver(): CuaDriverLike;
3060
+ open(asyncOpts_?: {
3061
+ signal: AbortSignal;
3062
+ }): Promise<void>;
3063
+ publicSession(): string;
3064
+ }
3065
+ /**
3066
+ * @deprecated Use `McpDriverChannelLike` instead.
3067
+ */
3068
+ export type McpDriverChannelInterface = McpDriverChannelLike;
3069
+ export declare class McpDriverChannel extends UniffiAbstractObject implements McpDriverChannelLike {
3070
+ readonly [uniffiTypeNameSymbol] = "McpDriverChannel";
3071
+ readonly [destructorGuardSymbol]: UniffiGcObject;
3072
+ readonly [pointerLiteralSymbol]: UniffiHandle;
3073
+ private constructor();
3074
+ close(asyncOpts_?: {
3075
+ signal: AbortSignal;
3076
+ }): Promise<void>;
3077
+ driver(): CuaDriverLike;
3078
+ open(asyncOpts_?: {
3079
+ signal: AbortSignal;
3080
+ }): Promise<void>;
3081
+ publicSession(): string;
3082
+ uniffiDestroy(): void;
3083
+ static instanceOf(obj_: any): obj_ is McpDriverChannel;
3084
+ }
2890
3085
  /**
2891
3086
  * This should be called before anything else.
2892
3087
  *
@@ -3059,6 +3254,105 @@ declare const _default: Readonly<{
3059
3254
  lift(value: UniffiByteArray): DriverOptions;
3060
3255
  lower(value: DriverOptions, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3061
3256
  };
3257
+ FfiConverterTypeDriverServiceHeader: {
3258
+ read(from: RustBuffer): DriverServiceHeader;
3259
+ write(value: DriverServiceHeader, into: RustBuffer): void;
3260
+ allocationSize(value: DriverServiceHeader): number;
3261
+ lift(value: UniffiByteArray): DriverServiceHeader;
3262
+ lower(value: DriverServiceHeader, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3263
+ };
3264
+ FfiConverterTypeDriverServiceRequest: {
3265
+ read(from: RustBuffer): DriverServiceRequest;
3266
+ write(value: DriverServiceRequest, into: RustBuffer): void;
3267
+ allocationSize(value: DriverServiceRequest): number;
3268
+ lift(value: UniffiByteArray): DriverServiceRequest;
3269
+ lower(value: DriverServiceRequest, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3270
+ };
3271
+ FfiConverterTypeDriverServiceResponse: {
3272
+ read(from: RustBuffer): DriverServiceResponse;
3273
+ write(value: DriverServiceResponse, into: RustBuffer): void;
3274
+ allocationSize(value: DriverServiceResponse): number;
3275
+ lift(value: UniffiByteArray): DriverServiceResponse;
3276
+ lower(value: DriverServiceResponse, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3277
+ };
3278
+ FfiConverterTypeDriverServiceTransport: FfiConverterObjectWithCallbacks<DriverServiceTransport>;
3279
+ FfiConverterTypeDriverServiceTransportError: {
3280
+ read(from: RustBuffer): {
3281
+ readonly tag: DriverServiceTransportError_Tags.Failed;
3282
+ readonly inner: Readonly<{
3283
+ reason: string;
3284
+ }>;
3285
+ /**
3286
+ * @private
3287
+ * This field is private and should not be used, use `tag` instead.
3288
+ */
3289
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
3290
+ name: string;
3291
+ message: string;
3292
+ stack?: string;
3293
+ cause?: unknown;
3294
+ };
3295
+ write(value: {
3296
+ readonly tag: DriverServiceTransportError_Tags.Failed;
3297
+ readonly inner: Readonly<{
3298
+ reason: string;
3299
+ }>;
3300
+ /**
3301
+ * @private
3302
+ * This field is private and should not be used, use `tag` instead.
3303
+ */
3304
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
3305
+ name: string;
3306
+ message: string;
3307
+ stack?: string;
3308
+ cause?: unknown;
3309
+ }, into: RustBuffer): void;
3310
+ allocationSize(value: {
3311
+ readonly tag: DriverServiceTransportError_Tags.Failed;
3312
+ readonly inner: Readonly<{
3313
+ reason: string;
3314
+ }>;
3315
+ /**
3316
+ * @private
3317
+ * This field is private and should not be used, use `tag` instead.
3318
+ */
3319
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
3320
+ name: string;
3321
+ message: string;
3322
+ stack?: string;
3323
+ cause?: unknown;
3324
+ }): number;
3325
+ lift(value: UniffiByteArray): {
3326
+ readonly tag: DriverServiceTransportError_Tags.Failed;
3327
+ readonly inner: Readonly<{
3328
+ reason: string;
3329
+ }>;
3330
+ /**
3331
+ * @private
3332
+ * This field is private and should not be used, use `tag` instead.
3333
+ */
3334
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
3335
+ name: string;
3336
+ message: string;
3337
+ stack?: string;
3338
+ cause?: unknown;
3339
+ };
3340
+ lower(value: {
3341
+ readonly tag: DriverServiceTransportError_Tags.Failed;
3342
+ readonly inner: Readonly<{
3343
+ reason: string;
3344
+ }>;
3345
+ /**
3346
+ * @private
3347
+ * This field is private and should not be used, use `tag` instead.
3348
+ */
3349
+ readonly [uniffiTypeNameSymbol]: "DriverServiceTransportError";
3350
+ name: string;
3351
+ message: string;
3352
+ stack?: string;
3353
+ cause?: unknown;
3354
+ }, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3355
+ };
3062
3356
  FfiConverterTypeEmbeddedCuaDriverHost: FfiConverterObject<EmbeddedCuaDriverHostLike>;
3063
3357
  FfiConverterTypeEmbeddedDriverConnection: {
3064
3358
  read(from: RustBuffer): EmbeddedDriverConnection;
@@ -3243,6 +3537,7 @@ declare const _default: Readonly<{
3243
3537
  lift(value: UniffiByteArray): MacOsPermissionStatus;
3244
3538
  lower(value: MacOsPermissionStatus, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray;
3245
3539
  };
3540
+ FfiConverterTypeMcpDriverChannel: FfiConverterObject<McpDriverChannelLike>;
3246
3541
  FfiConverterTypePrivateWorkerOptions: {
3247
3542
  read(from: RustBuffer): PrivateWorkerOptions;
3248
3543
  write(value: PrivateWorkerOptions, into: RustBuffer): void;