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

Function resolveStateDir

src/daemon/config.ts:42–48  ·  view source on GitHub ↗
(raw: string | undefined, options: ResolveDaemonPathsOptions)

Source from the content-addressed store, hash-verified

40}
41
42function resolveStateDir(raw: string | undefined, options: ResolveDaemonPathsOptions): string {
43 const value = (raw ?? '').trim();
44 if (!value) {
45 return resolveDefaultDaemonStateDir(options);
46 }
47 return resolveUserPath(value, { env: options.env });
48}
49
50function resolveDefaultDaemonStateDir(options: ResolveDaemonPathsOptions = {}): string {
51 const globalStateDir = path.join(expandUserHomePath('~', { env: options.env }), '.agent-device');

Callers 1

resolveDaemonPathsFunction · 0.85

Calls 2

resolveUserPathFunction · 0.90

Tested by

no test coverage detected