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

Function getStorageDir

packages/plugin/src/tui/data/context-db.ts:15–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13let rpcGeneration = 0;
14
15function getStorageDir(): string {
16 // Plugin v0.16+ uses the shared cortexkit/magic-context path so OpenCode
17 // and Pi can share state. The TUI just needs to point its RPC client at
18 // the same storage directory the server plugin uses for the lock-file
19 // discovery convention.
20 const dataDir = process.env.XDG_DATA_HOME ?? path.join(os.homedir(), ".local", "share");
21 return path.join(dataDir, "cortexkit", "magic-context");
22}
23
24/** Initialize the RPC client. Call once on TUI startup. */
25export function initRpcClient(directory: string): void {

Callers 1

initRpcClientFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected