MCPcopy Create free account
hub / github.com/cortexkit/magic-context / initRpcClient

Function initRpcClient

packages/plugin/src/tui/data/context-db.ts:25–32  ·  view source on GitHub ↗
(directory: string)

Source from the content-addressed store, hash-verified

23
24/** Initialize the RPC client. Call once on TUI startup. */
25export function initRpcClient(directory: string): void {
26 const storageDir = getStorageDir();
27 // Bump the generation before replacing the client so late notification
28 // responses from a disposed client are ignored (the WS socket observes the
29 // new generation and abandons its in-flight connect).
30 rpcGeneration += 1;
31 rpcClient = new MagicContextRpcClient(storageDir, directory);
32}
33
34export function getRpcGeneration(): number {
35 return rpcGeneration;

Callers 1

tuiFunction · 0.90

Calls 1

getStorageDirFunction · 0.70

Tested by

no test coverage detected