MCPcopy Index your code
hub / github.com/callstack/agent-device / readActiveConnectionSession

Function readActiveConnectionSession

src/remote/remote-connection-state.ts:209–218  ·  view source on GitHub ↗
(stateDir: string)

Source from the content-addressed store, hash-verified

207}
208
209function readActiveConnectionSession(stateDir: string): string | undefined {
210 const activePath = activeConnectionStatePath(stateDir);
211 if (!fs.existsSync(activePath)) return undefined;
212 try {
213 const parsed = JSON.parse(fs.readFileSync(activePath, 'utf8')) as Record<string, unknown>;
214 return typeof parsed.session === 'string' ? parsed.session : undefined;
215 } catch {
216 return undefined;
217 }
218}
219
220export function fingerprint(value: string | undefined): string | undefined {
221 if (!value) return undefined;

Callers 2

Calls 2

parseMethod · 0.45

Tested by

no test coverage detected