@@ -16,8 +16,8 @@ import type {
1616 NodeSkillDescriptor ,
1717} from "../../packages/gateway-protocol/src/schema/nodes.js" ;
1818import { setActiveNodeContext } from "../infra/active-node-context.js" ;
19+ import type { PairedDeviceNodeBinding } from "../infra/device-pairing-node-state.js" ;
1920import { NODE_MCP_TOOLS_CALL_COMMAND } from "../infra/node-commands.js" ;
20- import type { NodePairingBinding } from "../infra/node-pairing-state.js" ;
2121import { logRejectedLargePayload } from "../logging/diagnostic-payload.js" ;
2222import { normalizeString } from "./node-normalize.js" ;
2323import {
@@ -82,7 +82,7 @@ type PairingBoundNodeSessionLease = {
8282 session : PairingBoundNodeSession ;
8383 nodeId : string ;
8484 connId : string ;
85- binding : NodePairingBinding ;
85+ binding : PairedDeviceNodeBinding ;
8686} ;
8787
8888type PairingLeaseResolution =
@@ -183,24 +183,24 @@ export type NodeEventTransport = {
183183 checkConnectivity ?: ( timeoutMs : number ) => Promise < NodeConnectivityResult > ;
184184} ;
185185
186- type NodePairingStateSnapshot = NodePairingBinding ;
186+ type PairedDeviceNodeBindingSnapshot = PairedDeviceNodeBinding ;
187187
188188type NodeSessionRegistrationOptions = {
189189 remoteIp ?: string | undefined ;
190190 pairingIdentity : string ;
191191 pairingGeneration ?: string | undefined ;
192192} ;
193193
194- function pairingBindingForSession ( node : PairingBoundNodeSession ) : NodePairingBinding {
194+ function pairingBindingForSession ( node : PairingBoundNodeSession ) : PairedDeviceNodeBinding {
195195 return {
196196 identity : node . pairingIdentity ,
197197 ...( node . pairingGeneration ? { generation : node . pairingGeneration } : { } ) ,
198198 } ;
199199}
200200
201201function pairingStateMatchesBinding (
202- binding : NodePairingBinding ,
203- current : NodePairingStateSnapshot | undefined ,
202+ binding : PairedDeviceNodeBinding ,
203+ current : PairedDeviceNodeBindingSnapshot | undefined ,
204204) : boolean {
205205 if ( ! current ) {
206206 return false ;
@@ -217,8 +217,10 @@ export type NodeRegistryOptions = {
217217 | undefined ;
218218 nodePluginToolsEnabled ?: boolean ;
219219 nodeSkillsEnabled ?: boolean ;
220- resolveCurrentPairingState ?: ( nodeId : string ) => Promise < NodePairingStateSnapshot | undefined > ;
221- isPairingStateCurrent ?: ( nodeId : string , expected : NodePairingBinding ) => boolean ;
220+ resolveCurrentPairingState ?: (
221+ nodeId : string ,
222+ ) => Promise < PairedDeviceNodeBindingSnapshot | undefined > ;
223+ isPairingStateCurrent ?: ( nodeId : string , expected : PairedDeviceNodeBinding ) => boolean ;
222224 onPairingGenerationChanged ?: ( params : {
223225 nodeId : string ;
224226 previousPairingGeneration : string ;
@@ -372,7 +374,7 @@ export class NodeRegistry {
372374 ? { status : "current" , session : current }
373375 : { status : "stale" , presenceInvalidated : false } ;
374376 }
375- let currentPairingState : NodePairingStateSnapshot | undefined ;
377+ let currentPairingState : PairedDeviceNodeBindingSnapshot | undefined ;
376378 try {
377379 currentPairingState = await resolveCurrentPairingState ( lease . nodeId ) ;
378380 } catch {
@@ -589,7 +591,7 @@ export class NodeRegistry {
589591
590592 /** Filter connected sessions against an already-loaded pairing-state snapshot. */
591593 listConnectedForPairingStates (
592- currentPairingStates : ReadonlyMap < string , NodePairingStateSnapshot > ,
594+ currentPairingStates : ReadonlyMap < string , PairedDeviceNodeBindingSnapshot > ,
593595 ) : NodeSession [ ] {
594596 return this . listConnectedSessions ( ) . filter ( ( node ) => {
595597 const current = currentPairingStates . get ( node . nodeId ) ;
0 commit comments