@@ -143,12 +143,12 @@ export class PluginWrapper<TInfo = unknown> {
143143 const info = this . #plugin. checkSupportsHidDevice ( hidDevice )
144144 if ( ! info ) return null
145145
146- return this . #openDeviceInner( surfaceId , info . description , info . pluginInfo )
146+ return this . #openDeviceInner( surfaceId , info . description , info . pluginInfo , false )
147147 }
148148
149149 async #offerOpenDevice(
150150 info : DetectionSurfaceInfo < TInfo > ,
151- mode : string ,
151+ mode : 'detection' | 'outbound' ,
152152 rejectFn : ( info : DetectionSurfaceInfo < TInfo > ) => void ,
153153 ) : Promise < void > {
154154 if ( this . #openSurfaces. has ( info . surfaceId ) ) {
@@ -173,7 +173,12 @@ export class PluginWrapper<TInfo = unknown> {
173173 }
174174
175175 // All clear, open it
176- const openInfo = await this . #openDeviceInner( shouldOpen . resolvedSurfaceId , info . description , info . pluginInfo )
176+ const openInfo = await this . #openDeviceInner(
177+ shouldOpen . resolvedSurfaceId ,
178+ info . description ,
179+ info . pluginInfo ,
180+ mode === 'outbound' ,
181+ )
177182 if ( ! openInfo ) return
178183
179184 this . #logger. info ( `Opened discovered ${ mode } surface: ${ openInfo . surfaceId } ` )
@@ -189,6 +194,7 @@ export class PluginWrapper<TInfo = unknown> {
189194 resolvedSurfaceId : string ,
190195 description : string ,
191196 pluginInfo : TInfo ,
197+ isRemote : boolean ,
192198 ) : Promise < OpenDeviceResult | null > {
193199 if ( this . #openSurfaces. has ( resolvedSurfaceId ) ) {
194200 throw new Error ( `Surface with id ${ resolvedSurfaceId } is already opened` )
@@ -231,6 +237,7 @@ export class PluginWrapper<TInfo = unknown> {
231237 surfaceLayout : surface . registerProps . surfaceLayout ,
232238 transferVariables : surface . registerProps . transferVariables ?? null ,
233239 location : surface . registerProps . location ?? null ,
240+ isRemote,
234241 configFields : structuredClone ( surface . registerProps . configFields ) ?? null ,
235242 }
236243 }
@@ -281,7 +288,7 @@ export class PluginWrapper<TInfo = unknown> {
281288
282289 this . #logger. info ( `Opening scanned device ${ surfaceId } ` )
283290
284- return this . #openDeviceInner( surfaceId , cachedInfo . description , cachedInfo . pluginInfo )
291+ return this . #openDeviceInner( surfaceId , cachedInfo . description , cachedInfo . pluginInfo , false )
285292 }
286293
287294 #cleanupSurfaceById( surfaceId : string ) : void {
0 commit comments