MCPcopy
hub / github.com/callstack/agent-device / serializeConnectionState

Function serializeConnectionState

src/cli/commands/connection.ts:643–670  ·  view source on GitHub ↗
(
  state: RemoteConnectionState,
  runtimePreparation?: RuntimePreparationNotice,
)

Source from the content-addressed store, hash-verified

641}
642
643function serializeConnectionState(
644 state: RemoteConnectionState,
645 runtimePreparation?: RuntimePreparationNotice,
646): Record<string, unknown> {
647 const leasePreparation = buildLeasePreparationNotice(state);
648 return {
649 connected: true,
650 session: state.session,
651 tenant: state.tenant,
652 runId: state.runId,
653 leaseAllocated: Boolean(state.leaseId),
654 leaseId: state.leaseId,
655 leaseBackend: state.leaseBackend,
656 leaseProvider: state.leaseProvider,
657 platform: state.platform,
658 target: state.target,
659 remoteConfig: state.remoteConfigPath,
660 remoteConfigHash: state.remoteConfigHash,
661 daemonBaseUrlFingerprint: fingerprint(state.daemon?.baseUrl),
662 metro: state.metro
663 ? { prepared: true, projectRoot: state.metro.projectRoot }
664 : { prepared: false },
665 ...(leasePreparation ? { leasePreparation } : {}),
666 ...(runtimePreparation ? { runtimePreparation } : {}),
667 connectedAt: state.connectedAt,
668 updatedAt: state.updatedAt,
669 };
670}

Callers 2

connectCommandFunction · 0.85
connectionCommandFunction · 0.85

Calls 2

fingerprintFunction · 0.90

Tested by

no test coverage detected