@trycua/cua-driver 0.24.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.
@@ -4,9 +4,9 @@
4
4
  /* eslint-disable */
5
5
  // @ts-nocheck
6
6
  import nativeModule from "./cua_driver_sdk-ffi.js";
7
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterInt32, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol, } from "@ubjs/core";
7
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterInt32, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsyncWithError, uniffiTraitInterfaceCallWithError, uniffiTypeNameSymbol, } from "@ubjs/core";
8
8
  import uniffiCuaDriverContractModule from "./cua_driver_contract.js";
9
- const { FfiConverterTypeActionResult, FfiConverterTypeClickInput, FfiConverterTypeClipboardReadInput, FfiConverterTypeClipboardWriteInput, FfiConverterTypeDragInput, FfiConverterTypeEndSessionInput, FfiConverterTypeEndSessionOutput, FfiConverterTypeEscalateSessionInput, FfiConverterTypeGetAgentCursorStateInput, FfiConverterTypeGetCursorPositionInput, FfiConverterTypeGetDesktopStateInput, FfiConverterTypeGetScreenSizeInput, FfiConverterTypeGetSessionInput, FfiConverterTypeGetSessionStateInput, FfiConverterTypeHotkeyInput, FfiConverterTypeInvokeMenuInput, FfiConverterTypeListSessionsInput, FfiConverterTypeListSessionsOutput, FfiConverterTypeMoveCursorInput, FfiConverterTypePressKeyInput, FfiConverterTypeScrollInput, FfiConverterTypeSessionOutput, FfiConverterTypeSessionStateOutput, FfiConverterTypeSetAgentCursorEnabledInput, FfiConverterTypeSetAgentCursorMotionInput, FfiConverterTypeSetAgentCursorThemeInput, FfiConverterTypeSetWindowFrameInput, FfiConverterTypeStartSessionInput, FfiConverterTypeStartSessionOutput, FfiConverterTypeTypeTextInput, FfiConverterTypeVerifyStateInput, FfiConverterTypeVerifyStateOutput } = uniffiCuaDriverContractModule.converters;
9
+ const { FfiConverterTypeActionResult, FfiConverterTypeClickInput, FfiConverterTypeClipboardReadInput, FfiConverterTypeClipboardWriteInput, FfiConverterTypeDragInput, FfiConverterTypeEndSessionInput, FfiConverterTypeEndSessionOutput, FfiConverterTypeEscalateSessionInput, FfiConverterTypeGetAgentCursorStateInput, FfiConverterTypeGetCursorPositionInput, FfiConverterTypeGetDesktopStateInput, FfiConverterTypeGetScreenSizeInput, FfiConverterTypeGetSessionInput, FfiConverterTypeGetSessionStateInput, FfiConverterTypeGetWindowStateInput, FfiConverterTypeHotkeyInput, FfiConverterTypeInvokeMenuInput, FfiConverterTypeListAppsInput, FfiConverterTypeListAppsOutput, FfiConverterTypeListSessionsInput, FfiConverterTypeListSessionsOutput, FfiConverterTypeListWindowsInput, FfiConverterTypeListWindowsOutput, FfiConverterTypeMoveCursorInput, FfiConverterTypePressKeyInput, FfiConverterTypeScrollInput, FfiConverterTypeSessionOutput, FfiConverterTypeSessionStateOutput, FfiConverterTypeSetAgentCursorEnabledInput, FfiConverterTypeSetAgentCursorMotionInput, FfiConverterTypeSetAgentCursorThemeInput, FfiConverterTypeSetWindowFrameInput, FfiConverterTypeStartSessionInput, FfiConverterTypeStartSessionOutput, FfiConverterTypeTypeTextInput, FfiConverterTypeVerifyStateInput, FfiConverterTypeVerifyStateOutput, FfiConverterTypeWindowStateOutput } = uniffiCuaDriverContractModule.converters;
10
10
  const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
11
11
  const uniffiIsDebug =
12
12
  // @ts-ignore -- The process global might not be defined
@@ -15,6 +15,49 @@ typeof process !== "object" ||
15
15
  process?.env?.NODE_ENV !== "production" ||
16
16
  false;
17
17
  // Public interface members begin here.
18
+ /**
19
+ * Connect the canonical typed Driver to a host-provided remote carrier.
20
+ */
21
+ export function connectRemoteChannel(channel) {
22
+ return FfiConverterTypeCuaDriver.lift(uniffiCaller.rustCallWithError(
23
+ /*liftError:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError),
24
+ /*caller:*/ (callStatus) => {
25
+ return nativeModule().uniffi_cua_driver_sdk_fn_func_connect_remote_channel(FfiConverterTypeForeignDriverEnvelopeChannel.lower(channel, nativeModule().rustbuffer_alloc), callStatus);
26
+ },
27
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString)));
28
+ }
29
+ /**
30
+ * Bind a logical remote session without serializing its authority.
31
+ */
32
+ export async function createRemoteTrustedSession(driver, options, asyncOpts_) {
33
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
34
+ try {
35
+ return await uniffiRustCallAsync(
36
+ /*rustCaller:*/ uniffiCaller,
37
+ /*rustFutureFunc:*/ () => {
38
+ return nativeModule().uniffi_cua_driver_sdk_fn_func_create_remote_trusted_session(FfiConverterTypeCuaDriver.lower(driver, nativeModule().rustbuffer_alloc), FfiConverterTypeTrustedSessionOptions.lower(options, nativeModule().rustbuffer_alloc));
39
+ },
40
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_u64,
41
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_u64,
42
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_u64,
43
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_u64,
44
+ // Async returns always go through the JS-side converter: the
45
+ // FFI symbol returns the future handle (u64), and the user-level
46
+ // RustBuffer comes back via the shared `rust_future_complete_*`
47
+ // export. The bytes the runtime hands back must be deserialized
48
+ // here using the per-callable return-type converter.
49
+ /*liftFunc:*/ FfiConverterTypeCuaDriverSession.lift.bind(FfiConverterTypeCuaDriverSession),
50
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
51
+ /*asyncOpts:*/ asyncOpts_,
52
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
53
+ }
54
+ catch (__error) {
55
+ if (uniffiIsDebug && __error instanceof Error) {
56
+ __error.stack = __stack;
57
+ }
58
+ throw __error;
59
+ }
60
+ }
18
61
  /**
19
62
  * Generated-language host factory for a session-bound action surface.
20
63
  *
@@ -736,36 +779,772 @@ const FfiConverterTypeEmbeddedDriverHostOptions = (() => {
736
779
  };
737
780
  }
738
781
  write(value, into) {
739
- FfiConverterString.write(value.binaryPath, into);
740
- FfiConverterString.write(value.hostBundleId, into);
741
- FfiConverterOptionalString.write(value.socketPath, into);
742
- FfiConverterOptionalUInt64.write(value.startupTimeoutMs, into);
743
- FfiConverterOptionalUInt64.write(value.shutdownTimeoutMs, into);
744
- FfiConverterOptionalTypeEmbeddedPermissionMode.write(value.permissionMode, into);
745
- FfiConverterOptionalString.write(value.capabilityManifestPath, into);
746
- FfiConverterBool.write(value.approveCapabilityManifest, into);
747
- FfiConverterOptionalString.write(value.sessionPolicyPath, into);
748
- FfiConverterBool.write(value.approveSessionPolicy, into);
749
- FfiConverterBool.write(value.dangerouslyBypassApprovals, into);
750
- FfiConverterSequenceTypeEmbeddedEnvironmentVariable.write(value.environment, into);
751
- FfiConverterBool.write(value.inheritStderr, into);
752
- FfiConverterBool.write(value.noOverlay, into);
782
+ FfiConverterString.write(value.binaryPath, into);
783
+ FfiConverterString.write(value.hostBundleId, into);
784
+ FfiConverterOptionalString.write(value.socketPath, into);
785
+ FfiConverterOptionalUInt64.write(value.startupTimeoutMs, into);
786
+ FfiConverterOptionalUInt64.write(value.shutdownTimeoutMs, into);
787
+ FfiConverterOptionalTypeEmbeddedPermissionMode.write(value.permissionMode, into);
788
+ FfiConverterOptionalString.write(value.capabilityManifestPath, into);
789
+ FfiConverterBool.write(value.approveCapabilityManifest, into);
790
+ FfiConverterOptionalString.write(value.sessionPolicyPath, into);
791
+ FfiConverterBool.write(value.approveSessionPolicy, into);
792
+ FfiConverterBool.write(value.dangerouslyBypassApprovals, into);
793
+ FfiConverterSequenceTypeEmbeddedEnvironmentVariable.write(value.environment, into);
794
+ FfiConverterBool.write(value.inheritStderr, into);
795
+ FfiConverterBool.write(value.noOverlay, into);
796
+ }
797
+ allocationSize(value) {
798
+ return FfiConverterString.allocationSize(value.binaryPath) +
799
+ FfiConverterString.allocationSize(value.hostBundleId) +
800
+ FfiConverterOptionalString.allocationSize(value.socketPath) +
801
+ FfiConverterOptionalUInt64.allocationSize(value.startupTimeoutMs) +
802
+ FfiConverterOptionalUInt64.allocationSize(value.shutdownTimeoutMs) +
803
+ FfiConverterOptionalTypeEmbeddedPermissionMode.allocationSize(value.permissionMode) +
804
+ FfiConverterOptionalString.allocationSize(value.capabilityManifestPath) +
805
+ FfiConverterBool.allocationSize(value.approveCapabilityManifest) +
806
+ FfiConverterOptionalString.allocationSize(value.sessionPolicyPath) +
807
+ FfiConverterBool.allocationSize(value.approveSessionPolicy) +
808
+ FfiConverterBool.allocationSize(value.dangerouslyBypassApprovals) +
809
+ FfiConverterSequenceTypeEmbeddedEnvironmentVariable.allocationSize(value.environment) +
810
+ FfiConverterBool.allocationSize(value.inheritStderr) +
811
+ FfiConverterBool.allocationSize(value.noOverlay);
812
+ }
813
+ }
814
+ ;
815
+ return new FFIConverter();
816
+ })();
817
+ /**
818
+ * Generated factory for {@link ForeignDriverChannelIdentity} record objects.
819
+ */
820
+ export const ForeignDriverChannelIdentity = (() => {
821
+ const defaults = () => ({});
822
+ const create = (() => {
823
+ return uniffiCreateRecord(defaults);
824
+ })();
825
+ return Object.freeze({
826
+ create,
827
+ new: create,
828
+ defaults: () => Object.freeze(defaults()),
829
+ });
830
+ })();
831
+ const FfiConverterTypeForeignDriverChannelIdentity = (() => {
832
+ class FFIConverter extends AbstractFfiConverterByteArray {
833
+ read(from) {
834
+ return {
835
+ authenticatedPrincipal: FfiConverterString.read(from),
836
+ connectionGeneration: FfiConverterString.read(from)
837
+ };
838
+ }
839
+ write(value, into) {
840
+ FfiConverterString.write(value.authenticatedPrincipal, into);
841
+ FfiConverterString.write(value.connectionGeneration, into);
842
+ }
843
+ allocationSize(value) {
844
+ return FfiConverterString.allocationSize(value.authenticatedPrincipal) +
845
+ FfiConverterString.allocationSize(value.connectionGeneration);
846
+ }
847
+ }
848
+ ;
849
+ return new FFIConverter();
850
+ })();
851
+ // Error type: ForeignDriverChannelError
852
+ export var ForeignDriverChannelError_Tags;
853
+ (function (ForeignDriverChannelError_Tags) {
854
+ ForeignDriverChannelError_Tags["Failed"] = "Failed";
855
+ })(ForeignDriverChannelError_Tags || (ForeignDriverChannelError_Tags = {}));
856
+ export const ForeignDriverChannelError = (() => {
857
+ class Failed_ extends UniffiError {
858
+ /**
859
+ * @private
860
+ * This field is private and should not be used, use `tag` instead.
861
+ */
862
+ [uniffiTypeNameSymbol] = "ForeignDriverChannelError";
863
+ tag = ForeignDriverChannelError_Tags.Failed;
864
+ inner;
865
+ constructor(inner) {
866
+ super("ForeignDriverChannelError", "Failed");
867
+ this.inner = Object.freeze(inner);
868
+ }
869
+ static new(inner) {
870
+ return new Failed_(inner);
871
+ }
872
+ static instanceOf(obj) {
873
+ return obj.tag === ForeignDriverChannelError_Tags.Failed;
874
+ }
875
+ static hasInner(obj) {
876
+ return Failed_.instanceOf(obj);
877
+ }
878
+ static getInner(obj) {
879
+ return obj.inner;
880
+ }
881
+ }
882
+ function instanceOf(obj) {
883
+ return obj[uniffiTypeNameSymbol] === "ForeignDriverChannelError";
884
+ }
885
+ return Object.freeze({
886
+ instanceOf,
887
+ Failed: Failed_
888
+ });
889
+ })();
890
+ // FfiConverter for enum ForeignDriverChannelError
891
+ const FfiConverterTypeForeignDriverChannelError = (() => {
892
+ const ordinalConverter = FfiConverterInt32;
893
+ class FFIConverter extends AbstractFfiConverterByteArray {
894
+ read(from) {
895
+ switch (ordinalConverter.read(from)) {
896
+ case 1: return new ForeignDriverChannelError.Failed({ reason: FfiConverterString.read(from) });
897
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
898
+ }
899
+ }
900
+ write(value, into) {
901
+ switch (value.tag) {
902
+ case ForeignDriverChannelError_Tags.Failed: {
903
+ ordinalConverter.write(1, into);
904
+ const inner = value.inner;
905
+ FfiConverterString.write(inner.reason, into);
906
+ return;
907
+ }
908
+ default:
909
+ // Throwing from here means that ForeignDriverChannelError_Tags hasn't matched an ordinal.
910
+ throw new UniffiInternalError.UnexpectedEnumCase();
911
+ }
912
+ }
913
+ allocationSize(value) {
914
+ switch (value.tag) {
915
+ case ForeignDriverChannelError_Tags.Failed: {
916
+ const inner = value.inner;
917
+ let size = ordinalConverter.allocationSize(1);
918
+ size += FfiConverterString.allocationSize(inner.reason);
919
+ return size;
920
+ }
921
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
922
+ }
923
+ }
924
+ }
925
+ return new FFIConverter();
926
+ })();
927
+ /**
928
+ * Generated factory for {@link ForeignDriverChannelCapabilities} record objects.
929
+ */
930
+ export const ForeignDriverChannelCapabilities = (() => {
931
+ const defaults = () => ({});
932
+ const create = (() => {
933
+ return uniffiCreateRecord(defaults);
934
+ })();
935
+ return Object.freeze({
936
+ create,
937
+ new: create,
938
+ defaults: () => Object.freeze(defaults()),
939
+ });
940
+ })();
941
+ const FfiConverterTypeForeignDriverChannelCapabilities = (() => {
942
+ class FFIConverter extends AbstractFfiConverterByteArray {
943
+ read(from) {
944
+ return {
945
+ minimumEnvelopeVersion: FfiConverterUInt32.read(from),
946
+ maximumEnvelopeVersion: FfiConverterUInt32.read(from),
947
+ supportsCancellation: FfiConverterBool.read(from)
948
+ };
949
+ }
950
+ write(value, into) {
951
+ FfiConverterUInt32.write(value.minimumEnvelopeVersion, into);
952
+ FfiConverterUInt32.write(value.maximumEnvelopeVersion, into);
953
+ FfiConverterBool.write(value.supportsCancellation, into);
954
+ }
955
+ allocationSize(value) {
956
+ return FfiConverterUInt32.allocationSize(value.minimumEnvelopeVersion) +
957
+ FfiConverterUInt32.allocationSize(value.maximumEnvelopeVersion) +
958
+ FfiConverterBool.allocationSize(value.supportsCancellation);
959
+ }
960
+ }
961
+ ;
962
+ return new FFIConverter();
963
+ })();
964
+ /**
965
+ * Generated factory for {@link ForeignDriverRequestEnvelope} record objects.
966
+ */
967
+ export const ForeignDriverRequestEnvelope = (() => {
968
+ const defaults = () => ({});
969
+ const create = (() => {
970
+ return uniffiCreateRecord(defaults);
971
+ })();
972
+ return Object.freeze({
973
+ create,
974
+ new: create,
975
+ defaults: () => Object.freeze(defaults()),
976
+ });
977
+ })();
978
+ const FfiConverterTypeForeignDriverRequestEnvelope = (() => {
979
+ class FFIConverter extends AbstractFfiConverterByteArray {
980
+ read(from) {
981
+ return {
982
+ envelopeVersion: FfiConverterUInt32.read(from),
983
+ requestId: FfiConverterString.read(from),
984
+ operation: FfiConverterString.read(from),
985
+ name: FfiConverterOptionalString.read(from),
986
+ argumentsJson: FfiConverterOptionalString.read(from),
987
+ deadlineUnixMs: FfiConverterUInt64.read(from)
988
+ };
989
+ }
990
+ write(value, into) {
991
+ FfiConverterUInt32.write(value.envelopeVersion, into);
992
+ FfiConverterString.write(value.requestId, into);
993
+ FfiConverterString.write(value.operation, into);
994
+ FfiConverterOptionalString.write(value.name, into);
995
+ FfiConverterOptionalString.write(value.argumentsJson, into);
996
+ FfiConverterUInt64.write(value.deadlineUnixMs, into);
997
+ }
998
+ allocationSize(value) {
999
+ return FfiConverterUInt32.allocationSize(value.envelopeVersion) +
1000
+ FfiConverterString.allocationSize(value.requestId) +
1001
+ FfiConverterString.allocationSize(value.operation) +
1002
+ FfiConverterOptionalString.allocationSize(value.name) +
1003
+ FfiConverterOptionalString.allocationSize(value.argumentsJson) +
1004
+ FfiConverterUInt64.allocationSize(value.deadlineUnixMs);
1005
+ }
1006
+ }
1007
+ ;
1008
+ return new FFIConverter();
1009
+ })();
1010
+ /**
1011
+ * Generated factory for {@link ForeignDriverResponseEnvelope} record objects.
1012
+ */
1013
+ export const ForeignDriverResponseEnvelope = (() => {
1014
+ const defaults = () => ({});
1015
+ const create = (() => {
1016
+ return uniffiCreateRecord(defaults);
1017
+ })();
1018
+ return Object.freeze({
1019
+ create,
1020
+ new: create,
1021
+ defaults: () => Object.freeze(defaults()),
1022
+ });
1023
+ })();
1024
+ const FfiConverterTypeForeignDriverResponseEnvelope = (() => {
1025
+ class FFIConverter extends AbstractFfiConverterByteArray {
1026
+ read(from) {
1027
+ return {
1028
+ envelopeVersion: FfiConverterUInt32.read(from),
1029
+ requestId: FfiConverterString.read(from),
1030
+ ok: FfiConverterBool.read(from),
1031
+ resultJson: FfiConverterOptionalString.read(from),
1032
+ error: FfiConverterOptionalString.read(from),
1033
+ errorCode: FfiConverterOptionalString.read(from),
1034
+ completionKnown: FfiConverterBool.read(from)
1035
+ };
1036
+ }
1037
+ write(value, into) {
1038
+ FfiConverterUInt32.write(value.envelopeVersion, into);
1039
+ FfiConverterString.write(value.requestId, into);
1040
+ FfiConverterBool.write(value.ok, into);
1041
+ FfiConverterOptionalString.write(value.resultJson, into);
1042
+ FfiConverterOptionalString.write(value.error, into);
1043
+ FfiConverterOptionalString.write(value.errorCode, into);
1044
+ FfiConverterBool.write(value.completionKnown, into);
1045
+ }
1046
+ allocationSize(value) {
1047
+ return FfiConverterUInt32.allocationSize(value.envelopeVersion) +
1048
+ FfiConverterString.allocationSize(value.requestId) +
1049
+ FfiConverterBool.allocationSize(value.ok) +
1050
+ FfiConverterOptionalString.allocationSize(value.resultJson) +
1051
+ FfiConverterOptionalString.allocationSize(value.error) +
1052
+ FfiConverterOptionalString.allocationSize(value.errorCode) +
1053
+ FfiConverterBool.allocationSize(value.completionKnown);
1054
+ }
1055
+ }
1056
+ ;
1057
+ return new FFIConverter();
1058
+ })();
1059
+ /**
1060
+ * Generated factory for {@link TrustedSessionOptions} record objects.
1061
+ */
1062
+ export const TrustedSessionOptions = (() => {
1063
+ const defaults = () => ({
1064
+ capabilityManifestPath: undefined,
1065
+ });
1066
+ const create = (() => {
1067
+ return uniffiCreateRecord(defaults);
1068
+ })();
1069
+ return Object.freeze({
1070
+ create,
1071
+ new: create,
1072
+ defaults: () => Object.freeze(defaults()),
1073
+ });
1074
+ })();
1075
+ const FfiConverterTypeTrustedSessionOptions = (() => {
1076
+ class FFIConverter extends AbstractFfiConverterByteArray {
1077
+ read(from) {
1078
+ return {
1079
+ publicSession: FfiConverterString.read(from),
1080
+ mode: FfiConverterTypeSessionPermissionMode.read(from),
1081
+ ttlSeconds: FfiConverterUInt64.read(from),
1082
+ idleTtlSeconds: FfiConverterUInt64.read(from),
1083
+ capabilityManifestPath: FfiConverterOptionalString.read(from),
1084
+ boundedManifestPath: FfiConverterOptionalString.read(from)
1085
+ };
1086
+ }
1087
+ write(value, into) {
1088
+ FfiConverterString.write(value.publicSession, into);
1089
+ FfiConverterTypeSessionPermissionMode.write(value.mode, into);
1090
+ FfiConverterUInt64.write(value.ttlSeconds, into);
1091
+ FfiConverterUInt64.write(value.idleTtlSeconds, into);
1092
+ FfiConverterOptionalString.write(value.capabilityManifestPath, into);
1093
+ FfiConverterOptionalString.write(value.boundedManifestPath, into);
1094
+ }
1095
+ allocationSize(value) {
1096
+ return FfiConverterString.allocationSize(value.publicSession) +
1097
+ FfiConverterTypeSessionPermissionMode.allocationSize(value.mode) +
1098
+ FfiConverterUInt64.allocationSize(value.ttlSeconds) +
1099
+ FfiConverterUInt64.allocationSize(value.idleTtlSeconds) +
1100
+ FfiConverterOptionalString.allocationSize(value.capabilityManifestPath) +
1101
+ FfiConverterOptionalString.allocationSize(value.boundedManifestPath);
1102
+ }
1103
+ }
1104
+ ;
1105
+ return new FFIConverter();
1106
+ })();
1107
+ /**
1108
+ * Trusted host implementation of the existing remote transport contract.
1109
+ * Identity is captured once when each channel is adapted. A bound channel
1110
+ * must retain its parent's authenticated principal and connection generation.
1111
+ */
1112
+ export class ForeignDriverEnvelopeChannelImpl extends UniffiAbstractObject {
1113
+ [uniffiTypeNameSymbol] = "ForeignDriverEnvelopeChannelImpl";
1114
+ [destructorGuardSymbol];
1115
+ [pointerLiteralSymbol];
1116
+ // No primary constructor declared for this class.
1117
+ constructor(pointer) {
1118
+ super();
1119
+ this[pointerLiteralSymbol] = pointer;
1120
+ this[destructorGuardSymbol] = uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.bless(pointer);
1121
+ }
1122
+ identity() {
1123
+ return ((__rb) => {
1124
+ try {
1125
+ return FfiConverterTypeForeignDriverChannelIdentity.lift(__rb);
1126
+ }
1127
+ finally {
1128
+ nativeModule().rustbuffer_free(__rb);
1129
+ }
1130
+ })(uniffiCaller.rustCallWithError(
1131
+ /*liftError:*/ FfiConverterTypeForeignDriverChannelError.lift.bind(FfiConverterTypeForeignDriverChannelError),
1132
+ /*caller:*/ (callStatus) => {
1133
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_identity(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.clonePointer(this), callStatus);
1134
+ },
1135
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString)));
1136
+ }
1137
+ async negotiate(asyncOpts_) {
1138
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
1139
+ try {
1140
+ return await uniffiRustCallAsync(
1141
+ /*rustCaller:*/ uniffiCaller,
1142
+ /*rustFutureFunc:*/ () => {
1143
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_negotiate(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.clonePointer(this));
1144
+ },
1145
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
1146
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
1147
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
1148
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
1149
+ // Async returns always go through the JS-side converter: the
1150
+ // FFI symbol returns the future handle (u64), and the user-level
1151
+ // RustBuffer comes back via the shared `rust_future_complete_*`
1152
+ // export. The bytes the runtime hands back must be deserialized
1153
+ // here using the per-callable return-type converter.
1154
+ /*liftFunc:*/ FfiConverterTypeForeignDriverChannelCapabilities.lift.bind(FfiConverterTypeForeignDriverChannelCapabilities),
1155
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1156
+ /*asyncOpts:*/ asyncOpts_,
1157
+ /*errorHandler:*/ FfiConverterTypeForeignDriverChannelError.lift.bind(FfiConverterTypeForeignDriverChannelError));
1158
+ }
1159
+ catch (__error) {
1160
+ if (uniffiIsDebug && __error instanceof Error) {
1161
+ __error.stack = __stack;
1162
+ }
1163
+ throw __error;
1164
+ }
1165
+ }
1166
+ async exchange(request, asyncOpts_) {
1167
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
1168
+ try {
1169
+ return await uniffiRustCallAsync(
1170
+ /*rustCaller:*/ uniffiCaller,
1171
+ /*rustFutureFunc:*/ () => {
1172
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_exchange(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.clonePointer(this), FfiConverterTypeForeignDriverRequestEnvelope.lower(request, nativeModule().rustbuffer_alloc));
1173
+ },
1174
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
1175
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
1176
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
1177
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
1178
+ // Async returns always go through the JS-side converter: the
1179
+ // FFI symbol returns the future handle (u64), and the user-level
1180
+ // RustBuffer comes back via the shared `rust_future_complete_*`
1181
+ // export. The bytes the runtime hands back must be deserialized
1182
+ // here using the per-callable return-type converter.
1183
+ /*liftFunc:*/ FfiConverterTypeForeignDriverResponseEnvelope.lift.bind(FfiConverterTypeForeignDriverResponseEnvelope),
1184
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1185
+ /*asyncOpts:*/ asyncOpts_,
1186
+ /*errorHandler:*/ FfiConverterTypeForeignDriverChannelError.lift.bind(FfiConverterTypeForeignDriverChannelError));
1187
+ }
1188
+ catch (__error) {
1189
+ if (uniffiIsDebug && __error instanceof Error) {
1190
+ __error.stack = __stack;
1191
+ }
1192
+ throw __error;
1193
+ }
1194
+ }
1195
+ async bindSession(options, asyncOpts_) {
1196
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
1197
+ try {
1198
+ return await uniffiRustCallAsync(
1199
+ /*rustCaller:*/ uniffiCaller,
1200
+ /*rustFutureFunc:*/ () => {
1201
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_bind_session(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.clonePointer(this), FfiConverterTypeTrustedSessionOptions.lower(options, nativeModule().rustbuffer_alloc));
1202
+ },
1203
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
1204
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
1205
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
1206
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
1207
+ // Async returns always go through the JS-side converter: the
1208
+ // FFI symbol returns the future handle (u64), and the user-level
1209
+ // RustBuffer comes back via the shared `rust_future_complete_*`
1210
+ // export. The bytes the runtime hands back must be deserialized
1211
+ // here using the per-callable return-type converter.
1212
+ /*liftFunc:*/ FfiConverterTypeForeignDriverBoundChannel.lift.bind(FfiConverterTypeForeignDriverBoundChannel),
1213
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1214
+ /*asyncOpts:*/ asyncOpts_,
1215
+ /*errorHandler:*/ FfiConverterTypeForeignDriverChannelError.lift.bind(FfiConverterTypeForeignDriverChannelError));
1216
+ }
1217
+ catch (__error) {
1218
+ if (uniffiIsDebug && __error instanceof Error) {
1219
+ __error.stack = __stack;
1220
+ }
1221
+ throw __error;
1222
+ }
1223
+ }
1224
+ async cancel(requestId, asyncOpts_) {
1225
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
1226
+ try {
1227
+ return await uniffiRustCallAsync(
1228
+ /*rustCaller:*/ uniffiCaller,
1229
+ /*rustFutureFunc:*/ () => {
1230
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_cancel(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.clonePointer(this), FfiConverterString.lower(requestId, nativeModule().rustbuffer_alloc));
1231
+ },
1232
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_void,
1233
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_void,
1234
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_void,
1235
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_void,
1236
+ /*liftFunc:*/ (_v) => { },
1237
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1238
+ /*asyncOpts:*/ asyncOpts_,
1239
+ /*errorHandler:*/ FfiConverterTypeForeignDriverChannelError.lift.bind(FfiConverterTypeForeignDriverChannelError));
1240
+ }
1241
+ catch (__error) {
1242
+ if (uniffiIsDebug && __error instanceof Error) {
1243
+ __error.stack = __stack;
1244
+ }
1245
+ throw __error;
1246
+ }
1247
+ }
1248
+ async close(asyncOpts_) {
1249
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
1250
+ try {
1251
+ return await uniffiRustCallAsync(
1252
+ /*rustCaller:*/ uniffiCaller,
1253
+ /*rustFutureFunc:*/ () => {
1254
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_close(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.clonePointer(this));
1255
+ },
1256
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_void,
1257
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_void,
1258
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_void,
1259
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_void,
1260
+ /*liftFunc:*/ (_v) => { },
1261
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
1262
+ /*asyncOpts:*/ asyncOpts_,
1263
+ /*errorHandler:*/ FfiConverterTypeForeignDriverChannelError.lift.bind(FfiConverterTypeForeignDriverChannelError));
1264
+ }
1265
+ catch (__error) {
1266
+ if (uniffiIsDebug && __error instanceof Error) {
1267
+ __error.stack = __stack;
1268
+ }
1269
+ throw __error;
1270
+ }
1271
+ }
1272
+ uniffiDestroy() {
1273
+ const ptr = this[destructorGuardSymbol];
1274
+ if (ptr !== undefined) {
1275
+ const pointer = uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.pointer(this);
1276
+ uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.freePointer(pointer);
1277
+ uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.unbless(ptr);
1278
+ delete this[destructorGuardSymbol];
1279
+ }
1280
+ }
1281
+ static instanceOf(obj_) {
1282
+ return uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.isConcreteType(obj_);
1283
+ }
1284
+ }
1285
+ const uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory = (() => {
1286
+ /// <reference lib="es2021" />
1287
+ const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry((heldValue) => {
1288
+ uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory.freePointer(heldValue);
1289
+ }) : null;
1290
+ return {
1291
+ create(pointer) {
1292
+ const instance = Object.create(ForeignDriverEnvelopeChannelImpl.prototype);
1293
+ instance[pointerLiteralSymbol] = pointer;
1294
+ instance[destructorGuardSymbol] = this.bless(pointer);
1295
+ instance[uniffiTypeNameSymbol] = "ForeignDriverEnvelopeChannelImpl";
1296
+ return instance;
1297
+ },
1298
+ bless(p) {
1299
+ const ptr = {
1300
+ p, // make sure this object doesn't get optimized away.
1301
+ markDestroyed: () => undefined,
1302
+ };
1303
+ if (registry) {
1304
+ registry.register(ptr, p, ptr);
1305
+ }
1306
+ return ptr;
1307
+ },
1308
+ unbless(ptr_) {
1309
+ if (registry) {
1310
+ registry.unregister(ptr_);
1311
+ }
1312
+ },
1313
+ pointer(obj_) {
1314
+ if (obj_[destructorGuardSymbol] === undefined) {
1315
+ throw new UniffiInternalError.UnexpectedNullPointer();
1316
+ }
1317
+ return obj_[pointerLiteralSymbol];
1318
+ },
1319
+ clonePointer(obj_) {
1320
+ const pointer = this.pointer(obj_);
1321
+ return uniffiCaller.rustCall(
1322
+ /*caller:*/ (callStatus) => nativeModule().uniffi_cua_driver_sdk_fn_clone_foreigndriverenvelopechannel(pointer, callStatus),
1323
+ /*liftString:*/ FfiConverterString.lift);
1324
+ },
1325
+ freePointer(pointer) {
1326
+ uniffiCaller.rustCall(
1327
+ /*caller:*/ (callStatus) => nativeModule().uniffi_cua_driver_sdk_fn_free_foreigndriverenvelopechannel(pointer, callStatus),
1328
+ /*liftString:*/ FfiConverterString.lift);
1329
+ },
1330
+ isConcreteType(obj_) {
1331
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "ForeignDriverEnvelopeChannelImpl";
1332
+ },
1333
+ };
1334
+ })();
1335
+ const FfiConverterTypeForeignDriverEnvelopeChannel = new FfiConverterObjectWithCallbacks(uniffiTypeForeignDriverEnvelopeChannelImplObjectFactory);
1336
+ // Add a vtable for the callbacks that go in ForeignDriverEnvelopeChannel.
1337
+ // Put the implementation in a struct so we don't pollute the top-level namespace
1338
+ const uniffiCallbackInterfaceForeignDriverEnvelopeChannel = {
1339
+ // Create the VTable using a series of closures.
1340
+ // ts automatically converts these into C callback functions.
1341
+ vtable: {
1342
+ identity: (uniffiHandle) => {
1343
+ const uniffiMakeCall = () => {
1344
+ const jsCallback = FfiConverterTypeForeignDriverEnvelopeChannel.lift(uniffiHandle);
1345
+ return jsCallback.identity();
1346
+ };
1347
+ const uniffiResult = UniffiResult.ready();
1348
+ const uniffiHandleSuccess = (obj) => {
1349
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterTypeForeignDriverChannelIdentity.lower(obj, nativeModule().rustbuffer_alloc));
1350
+ };
1351
+ const uniffiHandleError = (code, errBuf) => {
1352
+ UniffiResult.writeError(uniffiResult, code, errBuf);
1353
+ };
1354
+ uniffiTraitInterfaceCallWithError(
1355
+ /*makeCall:*/ uniffiMakeCall,
1356
+ /*handleSuccess:*/ uniffiHandleSuccess,
1357
+ /*handleError:*/ uniffiHandleError,
1358
+ /*isErrorType:*/ ForeignDriverChannelError.instanceOf,
1359
+ /*lowerError:*/ FfiConverterTypeForeignDriverChannelError.lower.bind(FfiConverterTypeForeignDriverChannelError),
1360
+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1361
+ /*alloc:*/ nativeModule().rustbuffer_alloc);
1362
+ return uniffiResult;
1363
+ },
1364
+ negotiate: (uniffiHandle, uniffiFutureCallback, uniffiCallbackData) => {
1365
+ const uniffiMakeCall = async (signal) => {
1366
+ const jsCallback = FfiConverterTypeForeignDriverEnvelopeChannel.lift(uniffiHandle);
1367
+ return await jsCallback.negotiate({ signal });
1368
+ };
1369
+ const uniffiHandleSuccess = (returnValue) => {
1370
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1371
+ /* UniffiForeignFutureResultRustBuffer */ {
1372
+ return_value: FfiConverterTypeForeignDriverChannelCapabilities.lower(returnValue, nativeModule().rustbuffer_alloc),
1373
+ call_status: uniffiCaller.createCallStatus()
1374
+ });
1375
+ };
1376
+ const uniffiHandleError = (code, errorBuf) => {
1377
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1378
+ /* UniffiForeignFutureResultRustBuffer */ {
1379
+ return_value: /*empty*/ new Uint8Array(0),
1380
+ // TODO create callstatus with error.
1381
+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),
1382
+ });
1383
+ };
1384
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
1385
+ /*makeCall:*/ uniffiMakeCall,
1386
+ /*handleSuccess:*/ uniffiHandleSuccess,
1387
+ /*handleError:*/ uniffiHandleError,
1388
+ /*isErrorType:*/ ForeignDriverChannelError.instanceOf,
1389
+ /*lowerError:*/ FfiConverterTypeForeignDriverChannelError.lower.bind(FfiConverterTypeForeignDriverChannelError),
1390
+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1391
+ /*alloc:*/ nativeModule().rustbuffer_alloc);
1392
+ return uniffiForeignFuture;
1393
+ },
1394
+ exchange: (uniffiHandle, request, uniffiFutureCallback, uniffiCallbackData) => {
1395
+ const uniffiMakeCall = async (signal) => {
1396
+ const jsCallback = FfiConverterTypeForeignDriverEnvelopeChannel.lift(uniffiHandle);
1397
+ return await jsCallback.exchange(FfiConverterTypeForeignDriverRequestEnvelope.lift(request), { signal });
1398
+ };
1399
+ const uniffiHandleSuccess = (returnValue) => {
1400
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1401
+ /* UniffiForeignFutureResultRustBuffer */ {
1402
+ return_value: FfiConverterTypeForeignDriverResponseEnvelope.lower(returnValue, nativeModule().rustbuffer_alloc),
1403
+ call_status: uniffiCaller.createCallStatus()
1404
+ });
1405
+ };
1406
+ const uniffiHandleError = (code, errorBuf) => {
1407
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1408
+ /* UniffiForeignFutureResultRustBuffer */ {
1409
+ return_value: /*empty*/ new Uint8Array(0),
1410
+ // TODO create callstatus with error.
1411
+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),
1412
+ });
1413
+ };
1414
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
1415
+ /*makeCall:*/ uniffiMakeCall,
1416
+ /*handleSuccess:*/ uniffiHandleSuccess,
1417
+ /*handleError:*/ uniffiHandleError,
1418
+ /*isErrorType:*/ ForeignDriverChannelError.instanceOf,
1419
+ /*lowerError:*/ FfiConverterTypeForeignDriverChannelError.lower.bind(FfiConverterTypeForeignDriverChannelError),
1420
+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1421
+ /*alloc:*/ nativeModule().rustbuffer_alloc);
1422
+ return uniffiForeignFuture;
1423
+ },
1424
+ bind_session: (uniffiHandle, options, uniffiFutureCallback, uniffiCallbackData) => {
1425
+ const uniffiMakeCall = async (signal) => {
1426
+ const jsCallback = FfiConverterTypeForeignDriverEnvelopeChannel.lift(uniffiHandle);
1427
+ return await jsCallback.bindSession(FfiConverterTypeTrustedSessionOptions.lift(options), { signal });
1428
+ };
1429
+ const uniffiHandleSuccess = (returnValue) => {
1430
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1431
+ /* UniffiForeignFutureResultRustBuffer */ {
1432
+ return_value: FfiConverterTypeForeignDriverBoundChannel.lower(returnValue, nativeModule().rustbuffer_alloc),
1433
+ call_status: uniffiCaller.createCallStatus()
1434
+ });
1435
+ };
1436
+ const uniffiHandleError = (code, errorBuf) => {
1437
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1438
+ /* UniffiForeignFutureResultRustBuffer */ {
1439
+ return_value: /*empty*/ new Uint8Array(0),
1440
+ // TODO create callstatus with error.
1441
+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),
1442
+ });
1443
+ };
1444
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
1445
+ /*makeCall:*/ uniffiMakeCall,
1446
+ /*handleSuccess:*/ uniffiHandleSuccess,
1447
+ /*handleError:*/ uniffiHandleError,
1448
+ /*isErrorType:*/ ForeignDriverChannelError.instanceOf,
1449
+ /*lowerError:*/ FfiConverterTypeForeignDriverChannelError.lower.bind(FfiConverterTypeForeignDriverChannelError),
1450
+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1451
+ /*alloc:*/ nativeModule().rustbuffer_alloc);
1452
+ return uniffiForeignFuture;
1453
+ },
1454
+ cancel: (uniffiHandle, requestId, uniffiFutureCallback, uniffiCallbackData) => {
1455
+ const uniffiMakeCall = async (signal) => {
1456
+ const jsCallback = FfiConverterTypeForeignDriverEnvelopeChannel.lift(uniffiHandle);
1457
+ return await jsCallback.cancel(FfiConverterString.lift(requestId), { signal });
1458
+ };
1459
+ const uniffiHandleSuccess = (returnValue) => {
1460
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1461
+ /* UniffiForeignFutureResultVoid */ {
1462
+ call_status: uniffiCaller.createCallStatus()
1463
+ });
1464
+ };
1465
+ const uniffiHandleError = (code, errorBuf) => {
1466
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1467
+ /* UniffiForeignFutureResultVoid */ {
1468
+ // TODO create callstatus with error.
1469
+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),
1470
+ });
1471
+ };
1472
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
1473
+ /*makeCall:*/ uniffiMakeCall,
1474
+ /*handleSuccess:*/ uniffiHandleSuccess,
1475
+ /*handleError:*/ uniffiHandleError,
1476
+ /*isErrorType:*/ ForeignDriverChannelError.instanceOf,
1477
+ /*lowerError:*/ FfiConverterTypeForeignDriverChannelError.lower.bind(FfiConverterTypeForeignDriverChannelError),
1478
+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1479
+ /*alloc:*/ nativeModule().rustbuffer_alloc);
1480
+ return uniffiForeignFuture;
1481
+ },
1482
+ close: (uniffiHandle, uniffiFutureCallback, uniffiCallbackData) => {
1483
+ const uniffiMakeCall = async (signal) => {
1484
+ const jsCallback = FfiConverterTypeForeignDriverEnvelopeChannel.lift(uniffiHandle);
1485
+ return await jsCallback.close({ signal });
1486
+ };
1487
+ const uniffiHandleSuccess = (returnValue) => {
1488
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1489
+ /* UniffiForeignFutureResultVoid */ {
1490
+ call_status: uniffiCaller.createCallStatus()
1491
+ });
1492
+ };
1493
+ const uniffiHandleError = (code, errorBuf) => {
1494
+ uniffiFutureCallback.call(uniffiFutureCallback, uniffiCallbackData,
1495
+ /* UniffiForeignFutureResultVoid */ {
1496
+ // TODO create callstatus with error.
1497
+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),
1498
+ });
1499
+ };
1500
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
1501
+ /*makeCall:*/ uniffiMakeCall,
1502
+ /*handleSuccess:*/ uniffiHandleSuccess,
1503
+ /*handleError:*/ uniffiHandleError,
1504
+ /*isErrorType:*/ ForeignDriverChannelError.instanceOf,
1505
+ /*lowerError:*/ FfiConverterTypeForeignDriverChannelError.lower.bind(FfiConverterTypeForeignDriverChannelError),
1506
+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),
1507
+ /*alloc:*/ nativeModule().rustbuffer_alloc);
1508
+ return uniffiForeignFuture;
1509
+ },
1510
+ uniffi_free: (uniffiHandle) => {
1511
+ // this will throw a stale handle error if the handle isn't found.
1512
+ FfiConverterTypeForeignDriverEnvelopeChannel.drop(uniffiHandle);
1513
+ },
1514
+ uniffi_clone: (uniffiHandle) => {
1515
+ return FfiConverterTypeForeignDriverEnvelopeChannel.clone(uniffiHandle);
1516
+ }
1517
+ },
1518
+ register: () => {
1519
+ nativeModule().uniffi_cua_driver_sdk_fn_init_callback_vtable_foreigndriverenvelopechannel(uniffiCallbackInterfaceForeignDriverEnvelopeChannel.vtable);
1520
+ },
1521
+ };
1522
+ /**
1523
+ * Generated factory for {@link ForeignDriverBoundChannel} record objects.
1524
+ */
1525
+ export const ForeignDriverBoundChannel = (() => {
1526
+ const defaults = () => ({});
1527
+ const create = (() => {
1528
+ return uniffiCreateRecord(defaults);
1529
+ })();
1530
+ return Object.freeze({
1531
+ create,
1532
+ new: create,
1533
+ defaults: () => Object.freeze(defaults()),
1534
+ });
1535
+ })();
1536
+ const FfiConverterTypeForeignDriverBoundChannel = (() => {
1537
+ class FFIConverter extends AbstractFfiConverterByteArray {
1538
+ read(from) {
1539
+ return {
1540
+ channel: FfiConverterTypeForeignDriverEnvelopeChannel.read(from)
1541
+ };
1542
+ }
1543
+ write(value, into) {
1544
+ FfiConverterTypeForeignDriverEnvelopeChannel.write(value.channel, into);
753
1545
  }
754
1546
  allocationSize(value) {
755
- return FfiConverterString.allocationSize(value.binaryPath) +
756
- FfiConverterString.allocationSize(value.hostBundleId) +
757
- FfiConverterOptionalString.allocationSize(value.socketPath) +
758
- FfiConverterOptionalUInt64.allocationSize(value.startupTimeoutMs) +
759
- FfiConverterOptionalUInt64.allocationSize(value.shutdownTimeoutMs) +
760
- FfiConverterOptionalTypeEmbeddedPermissionMode.allocationSize(value.permissionMode) +
761
- FfiConverterOptionalString.allocationSize(value.capabilityManifestPath) +
762
- FfiConverterBool.allocationSize(value.approveCapabilityManifest) +
763
- FfiConverterOptionalString.allocationSize(value.sessionPolicyPath) +
764
- FfiConverterBool.allocationSize(value.approveSessionPolicy) +
765
- FfiConverterBool.allocationSize(value.dangerouslyBypassApprovals) +
766
- FfiConverterSequenceTypeEmbeddedEnvironmentVariable.allocationSize(value.environment) +
767
- FfiConverterBool.allocationSize(value.inheritStderr) +
768
- FfiConverterBool.allocationSize(value.noOverlay);
1547
+ return FfiConverterTypeForeignDriverEnvelopeChannel.allocationSize(value.channel);
769
1548
  }
770
1549
  }
771
1550
  ;
@@ -943,54 +1722,6 @@ const FfiConverterTypeToolResult = (() => {
943
1722
  ;
944
1723
  return new FFIConverter();
945
1724
  })();
946
- /**
947
- * Generated factory for {@link TrustedSessionOptions} record objects.
948
- */
949
- export const TrustedSessionOptions = (() => {
950
- const defaults = () => ({
951
- capabilityManifestPath: undefined,
952
- });
953
- const create = (() => {
954
- return uniffiCreateRecord(defaults);
955
- })();
956
- return Object.freeze({
957
- create,
958
- new: create,
959
- defaults: () => Object.freeze(defaults()),
960
- });
961
- })();
962
- const FfiConverterTypeTrustedSessionOptions = (() => {
963
- class FFIConverter extends AbstractFfiConverterByteArray {
964
- read(from) {
965
- return {
966
- publicSession: FfiConverterString.read(from),
967
- mode: FfiConverterTypeSessionPermissionMode.read(from),
968
- ttlSeconds: FfiConverterUInt64.read(from),
969
- idleTtlSeconds: FfiConverterUInt64.read(from),
970
- capabilityManifestPath: FfiConverterOptionalString.read(from),
971
- boundedManifestPath: FfiConverterOptionalString.read(from)
972
- };
973
- }
974
- write(value, into) {
975
- FfiConverterString.write(value.publicSession, into);
976
- FfiConverterTypeSessionPermissionMode.write(value.mode, into);
977
- FfiConverterUInt64.write(value.ttlSeconds, into);
978
- FfiConverterUInt64.write(value.idleTtlSeconds, into);
979
- FfiConverterOptionalString.write(value.capabilityManifestPath, into);
980
- FfiConverterOptionalString.write(value.boundedManifestPath, into);
981
- }
982
- allocationSize(value) {
983
- return FfiConverterString.allocationSize(value.publicSession) +
984
- FfiConverterTypeSessionPermissionMode.allocationSize(value.mode) +
985
- FfiConverterUInt64.allocationSize(value.ttlSeconds) +
986
- FfiConverterUInt64.allocationSize(value.idleTtlSeconds) +
987
- FfiConverterOptionalString.allocationSize(value.capabilityManifestPath) +
988
- FfiConverterOptionalString.allocationSize(value.boundedManifestPath);
989
- }
990
- }
991
- ;
992
- return new FFIConverter();
993
- })();
994
1725
  export var ActionCompletion;
995
1726
  (function (ActionCompletion) {
996
1727
  ActionCompletion[ActionCompletion["NotStarted"] = 0] = "NotStarted";
@@ -2207,7 +2938,7 @@ export class CuaDriver extends UniffiAbstractObject {
2207
2938
  // RustBuffer comes back via the shared `rust_future_complete_*`
2208
2939
  // export. The bytes the runtime hands back must be deserialized
2209
2940
  // here using the per-callable return-type converter.
2210
- /*liftFunc:*/ FfiConverterTypeToolResult.lift.bind(FfiConverterTypeToolResult),
2941
+ /*liftFunc:*/ FfiConverterTypeActionResult.lift.bind(FfiConverterTypeActionResult),
2211
2942
  /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
2212
2943
  /*asyncOpts:*/ asyncOpts_,
2213
2944
  /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
@@ -2552,6 +3283,35 @@ export class CuaDriver extends UniffiAbstractObject {
2552
3283
  throw __error;
2553
3284
  }
2554
3285
  }
3286
+ async getWindowState(input, asyncOpts_) {
3287
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3288
+ try {
3289
+ return await uniffiRustCallAsync(
3290
+ /*rustCaller:*/ uniffiCaller,
3291
+ /*rustFutureFunc:*/ () => {
3292
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_cuadriver_get_window_state(uniffiTypeCuaDriverObjectFactory.clonePointer(this), FfiConverterTypeGetWindowStateInput.lower(input, nativeModule().rustbuffer_alloc));
3293
+ },
3294
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
3295
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
3296
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
3297
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
3298
+ // Async returns always go through the JS-side converter: the
3299
+ // FFI symbol returns the future handle (u64), and the user-level
3300
+ // RustBuffer comes back via the shared `rust_future_complete_*`
3301
+ // export. The bytes the runtime hands back must be deserialized
3302
+ // here using the per-callable return-type converter.
3303
+ /*liftFunc:*/ FfiConverterTypeWindowStateOutput.lift.bind(FfiConverterTypeWindowStateOutput),
3304
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
3305
+ /*asyncOpts:*/ asyncOpts_,
3306
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
3307
+ }
3308
+ catch (__error) {
3309
+ if (uniffiIsDebug && __error instanceof Error) {
3310
+ __error.stack = __stack;
3311
+ }
3312
+ throw __error;
3313
+ }
3314
+ }
2555
3315
  async hotkey(input, asyncOpts_) {
2556
3316
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
2557
3317
  try {
@@ -2617,6 +3377,35 @@ export class CuaDriver extends UniffiAbstractObject {
2617
3377
  },
2618
3378
  /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString)));
2619
3379
  }
3380
+ async listApps(input, asyncOpts_) {
3381
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3382
+ try {
3383
+ return await uniffiRustCallAsync(
3384
+ /*rustCaller:*/ uniffiCaller,
3385
+ /*rustFutureFunc:*/ () => {
3386
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_cuadriver_list_apps(uniffiTypeCuaDriverObjectFactory.clonePointer(this), FfiConverterTypeListAppsInput.lower(input, nativeModule().rustbuffer_alloc));
3387
+ },
3388
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
3389
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
3390
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
3391
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
3392
+ // Async returns always go through the JS-side converter: the
3393
+ // FFI symbol returns the future handle (u64), and the user-level
3394
+ // RustBuffer comes back via the shared `rust_future_complete_*`
3395
+ // export. The bytes the runtime hands back must be deserialized
3396
+ // here using the per-callable return-type converter.
3397
+ /*liftFunc:*/ FfiConverterTypeListAppsOutput.lift.bind(FfiConverterTypeListAppsOutput),
3398
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
3399
+ /*asyncOpts:*/ asyncOpts_,
3400
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
3401
+ }
3402
+ catch (__error) {
3403
+ if (uniffiIsDebug && __error instanceof Error) {
3404
+ __error.stack = __stack;
3405
+ }
3406
+ throw __error;
3407
+ }
3408
+ }
2620
3409
  /**
2621
3410
  * Content-free lifecycle summaries for the trusted host's runtime or
2622
3411
  * host-lease namespace. This is deliberately separate from the
@@ -2712,6 +3501,35 @@ export class CuaDriver extends UniffiAbstractObject {
2712
3501
  throw __error;
2713
3502
  }
2714
3503
  }
3504
+ async listWindows(input, asyncOpts_) {
3505
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3506
+ try {
3507
+ return await uniffiRustCallAsync(
3508
+ /*rustCaller:*/ uniffiCaller,
3509
+ /*rustFutureFunc:*/ () => {
3510
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_cuadriver_list_windows(uniffiTypeCuaDriverObjectFactory.clonePointer(this), FfiConverterTypeListWindowsInput.lower(input, nativeModule().rustbuffer_alloc));
3511
+ },
3512
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
3513
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
3514
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
3515
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
3516
+ // Async returns always go through the JS-side converter: the
3517
+ // FFI symbol returns the future handle (u64), and the user-level
3518
+ // RustBuffer comes back via the shared `rust_future_complete_*`
3519
+ // export. The bytes the runtime hands back must be deserialized
3520
+ // here using the per-callable return-type converter.
3521
+ /*liftFunc:*/ FfiConverterTypeListWindowsOutput.lift.bind(FfiConverterTypeListWindowsOutput),
3522
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
3523
+ /*asyncOpts:*/ asyncOpts_,
3524
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
3525
+ }
3526
+ catch (__error) {
3527
+ if (uniffiIsDebug && __error instanceof Error) {
3528
+ __error.stack = __stack;
3529
+ }
3530
+ throw __error;
3531
+ }
3532
+ }
2715
3533
  async metadata(asyncOpts_) {
2716
3534
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
2717
3535
  try {
@@ -3211,7 +4029,7 @@ export class CuaDriverSession extends UniffiAbstractObject {
3211
4029
  // RustBuffer comes back via the shared `rust_future_complete_*`
3212
4030
  // export. The bytes the runtime hands back must be deserialized
3213
4031
  // here using the per-callable return-type converter.
3214
- /*liftFunc:*/ FfiConverterTypeToolResult.lift.bind(FfiConverterTypeToolResult),
4032
+ /*liftFunc:*/ FfiConverterTypeActionResult.lift.bind(FfiConverterTypeActionResult),
3215
4033
  /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
3216
4034
  /*asyncOpts:*/ asyncOpts_,
3217
4035
  /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
@@ -3555,6 +4373,35 @@ export class CuaDriverSession extends UniffiAbstractObject {
3555
4373
  throw __error;
3556
4374
  }
3557
4375
  }
4376
+ async getWindowState(input, asyncOpts_) {
4377
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4378
+ try {
4379
+ return await uniffiRustCallAsync(
4380
+ /*rustCaller:*/ uniffiCaller,
4381
+ /*rustFutureFunc:*/ () => {
4382
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_cuadriversession_get_window_state(uniffiTypeCuaDriverSessionObjectFactory.clonePointer(this), FfiConverterTypeGetWindowStateInput.lower(input, nativeModule().rustbuffer_alloc));
4383
+ },
4384
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
4385
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
4386
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
4387
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
4388
+ // Async returns always go through the JS-side converter: the
4389
+ // FFI symbol returns the future handle (u64), and the user-level
4390
+ // RustBuffer comes back via the shared `rust_future_complete_*`
4391
+ // export. The bytes the runtime hands back must be deserialized
4392
+ // here using the per-callable return-type converter.
4393
+ /*liftFunc:*/ FfiConverterTypeWindowStateOutput.lift.bind(FfiConverterTypeWindowStateOutput),
4394
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
4395
+ /*asyncOpts:*/ asyncOpts_,
4396
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
4397
+ }
4398
+ catch (__error) {
4399
+ if (uniffiIsDebug && __error instanceof Error) {
4400
+ __error.stack = __stack;
4401
+ }
4402
+ throw __error;
4403
+ }
4404
+ }
3558
4405
  async hotkey(input, asyncOpts_) {
3559
4406
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3560
4407
  try {
@@ -3613,6 +4460,35 @@ export class CuaDriverSession extends UniffiAbstractObject {
3613
4460
  throw __error;
3614
4461
  }
3615
4462
  }
4463
+ async listApps(input, asyncOpts_) {
4464
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4465
+ try {
4466
+ return await uniffiRustCallAsync(
4467
+ /*rustCaller:*/ uniffiCaller,
4468
+ /*rustFutureFunc:*/ () => {
4469
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_cuadriversession_list_apps(uniffiTypeCuaDriverSessionObjectFactory.clonePointer(this), FfiConverterTypeListAppsInput.lower(input, nativeModule().rustbuffer_alloc));
4470
+ },
4471
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
4472
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
4473
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
4474
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
4475
+ // Async returns always go through the JS-side converter: the
4476
+ // FFI symbol returns the future handle (u64), and the user-level
4477
+ // RustBuffer comes back via the shared `rust_future_complete_*`
4478
+ // export. The bytes the runtime hands back must be deserialized
4479
+ // here using the per-callable return-type converter.
4480
+ /*liftFunc:*/ FfiConverterTypeListAppsOutput.lift.bind(FfiConverterTypeListAppsOutput),
4481
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
4482
+ /*asyncOpts:*/ asyncOpts_,
4483
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
4484
+ }
4485
+ catch (__error) {
4486
+ if (uniffiIsDebug && __error instanceof Error) {
4487
+ __error.stack = __stack;
4488
+ }
4489
+ throw __error;
4490
+ }
4491
+ }
3616
4492
  async listSessions(input, asyncOpts_) {
3617
4493
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3618
4494
  try {
@@ -3642,6 +4518,35 @@ export class CuaDriverSession extends UniffiAbstractObject {
3642
4518
  throw __error;
3643
4519
  }
3644
4520
  }
4521
+ async listWindows(input, asyncOpts_) {
4522
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4523
+ try {
4524
+ return await uniffiRustCallAsync(
4525
+ /*rustCaller:*/ uniffiCaller,
4526
+ /*rustFutureFunc:*/ () => {
4527
+ return nativeModule().uniffi_cua_driver_sdk_fn_method_cuadriversession_list_windows(uniffiTypeCuaDriverSessionObjectFactory.clonePointer(this), FfiConverterTypeListWindowsInput.lower(input, nativeModule().rustbuffer_alloc));
4528
+ },
4529
+ /*pollFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
4530
+ /*cancelFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_cancel_rust_buffer,
4531
+ /*completeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
4532
+ /*freeFunc:*/ nativeModule().ffi_cua_driver_sdk_rust_future_free_rust_buffer,
4533
+ // Async returns always go through the JS-side converter: the
4534
+ // FFI symbol returns the future handle (u64), and the user-level
4535
+ // RustBuffer comes back via the shared `rust_future_complete_*`
4536
+ // export. The bytes the runtime hands back must be deserialized
4537
+ // here using the per-callable return-type converter.
4538
+ /*liftFunc:*/ FfiConverterTypeListWindowsOutput.lift.bind(FfiConverterTypeListWindowsOutput),
4539
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
4540
+ /*asyncOpts:*/ asyncOpts_,
4541
+ /*errorHandler:*/ FfiConverterTypeDriverError.lift.bind(FfiConverterTypeDriverError));
4542
+ }
4543
+ catch (__error) {
4544
+ if (uniffiIsDebug && __error instanceof Error) {
4545
+ __error.stack = __stack;
4546
+ }
4547
+ throw __error;
4548
+ }
4549
+ }
3645
4550
  async moveCursor(input, asyncOpts_) {
3646
4551
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
3647
4552
  try {
@@ -4545,6 +5450,12 @@ function uniffiEnsureInitialized() {
4545
5450
  if (bindingsContractVersion !== scaffoldingContractVersion) {
4546
5451
  throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
4547
5452
  }
5453
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_func_connect_remote_channel() !== 54784) {
5454
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_func_connect_remote_channel");
5455
+ }
5456
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_func_create_remote_trusted_session() !== 53066) {
5457
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_func_create_remote_trusted_session");
5458
+ }
4548
5459
  if (nativeModule().uniffi_cua_driver_sdk_checksum_func_create_trusted_session() !== 50573) {
4549
5460
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_func_create_trusted_session");
4550
5461
  }
@@ -4602,7 +5513,7 @@ function uniffiEnsureInitialized() {
4602
5513
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_call_tool() !== 24493) {
4603
5514
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_call_tool");
4604
5515
  }
4605
- if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_click() !== 56077) {
5516
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_click() !== 22807) {
4606
5517
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_click");
4607
5518
  }
4608
5519
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_read() !== 58238) {
@@ -4641,6 +5552,9 @@ function uniffiEnsureInitialized() {
4641
5552
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session_state() !== 49966) {
4642
5553
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session_state");
4643
5554
  }
5555
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_get_window_state() !== 62142) {
5556
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_get_window_state");
5557
+ }
4644
5558
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_hotkey() !== 53333) {
4645
5559
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_hotkey");
4646
5560
  }
@@ -4650,6 +5564,9 @@ function uniffiEnsureInitialized() {
4650
5564
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_is_available() !== 42961) {
4651
5565
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_is_available");
4652
5566
  }
5567
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_list_apps() !== 35505) {
5568
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_list_apps");
5569
+ }
4653
5570
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_list_host_sessions_json() !== 13193) {
4654
5571
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_list_host_sessions_json");
4655
5572
  }
@@ -4659,6 +5576,9 @@ function uniffiEnsureInitialized() {
4659
5576
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_list_tools_json() !== 33039) {
4660
5577
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_list_tools_json");
4661
5578
  }
5579
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_list_windows() !== 52601) {
5580
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_list_windows");
5581
+ }
4662
5582
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriver_metadata() !== 55026) {
4663
5583
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriver_metadata");
4664
5584
  }
@@ -4704,7 +5624,7 @@ function uniffiEnsureInitialized() {
4704
5624
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_call_tool() !== 52859) {
4705
5625
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_call_tool");
4706
5626
  }
4707
- if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_click() !== 22303) {
5627
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_click() !== 50816) {
4708
5628
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_click");
4709
5629
  }
4710
5630
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_read() !== 23560) {
@@ -4743,15 +5663,24 @@ function uniffiEnsureInitialized() {
4743
5663
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session_state() !== 55370) {
4744
5664
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session_state");
4745
5665
  }
5666
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_window_state() !== 21266) {
5667
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_window_state");
5668
+ }
4746
5669
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_hotkey() !== 12820) {
4747
5670
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_hotkey");
4748
5671
  }
4749
5672
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_invoke_menu() !== 2742) {
4750
5673
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_invoke_menu");
4751
5674
  }
5675
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_apps() !== 51520) {
5676
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_apps");
5677
+ }
4752
5678
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_sessions() !== 32840) {
4753
5679
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_sessions");
4754
5680
  }
5681
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_windows() !== 20571) {
5682
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_windows");
5683
+ }
4755
5684
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_cuadriversession_move_cursor() !== 35768) {
4756
5685
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_cuadriversession_move_cursor");
4757
5686
  }
@@ -4812,6 +5741,25 @@ function uniffiEnsureInitialized() {
4812
5741
  if (nativeModule().uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_wait_for_exit() !== 21124) {
4813
5742
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_wait_for_exit");
4814
5743
  }
5744
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_identity() !== 13418) {
5745
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_identity");
5746
+ }
5747
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_negotiate() !== 29939) {
5748
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_negotiate");
5749
+ }
5750
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_exchange() !== 707) {
5751
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_exchange");
5752
+ }
5753
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_bind_session() !== 6555) {
5754
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_bind_session");
5755
+ }
5756
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_cancel() !== 60148) {
5757
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_cancel");
5758
+ }
5759
+ if (nativeModule().uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_close() !== 42601) {
5760
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_close");
5761
+ }
5762
+ uniffiCallbackInterfaceForeignDriverEnvelopeChannel.register();
4815
5763
  uniffiCallbackInterfaceDriverActivityObserver.register();
4816
5764
  uniffiCallbackInterfaceDriverAuthorizationHost.register();
4817
5765
  }
@@ -4843,6 +5791,13 @@ export default Object.freeze({
4843
5791
  FfiConverterTypeEmbeddedEnvironmentVariable,
4844
5792
  FfiConverterTypeEmbeddedMcpConfiguration,
4845
5793
  FfiConverterTypeEmbeddedPermissionMode,
5794
+ FfiConverterTypeForeignDriverBoundChannel,
5795
+ FfiConverterTypeForeignDriverChannelCapabilities,
5796
+ FfiConverterTypeForeignDriverChannelError,
5797
+ FfiConverterTypeForeignDriverChannelIdentity,
5798
+ FfiConverterTypeForeignDriverEnvelopeChannel,
5799
+ FfiConverterTypeForeignDriverRequestEnvelope,
5800
+ FfiConverterTypeForeignDriverResponseEnvelope,
4846
5801
  FfiConverterTypeImageContent,
4847
5802
  FfiConverterTypeMacOsPermissionStatus,
4848
5803
  FfiConverterTypePrivateWorkerOptions,