MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / decode

Function decode

graph-ui/src/browser-ai/agent-preferences.ts:67–73  ·  view source on GitHub ↗
(raw: string | null)

Source from the content-addressed store, hash-verified

65}
66
67function decode(raw: string | null): Readonly<AgentPreferences> {
68 try {
69 const stored = record(JSON.parse(raw ?? 'null'));
70 if (stored?.version === 1) return validated(stored.preferences);
71 } catch { /* Invalid storage is equivalent to no saved preference. */ }
72 return DEFAULT_AGENT_PREFERENCES;
73}
74
75let snapshot: { raw: string | null; value: Readonly<AgentPreferences>; sessionOnly: boolean } | undefined;
76

Callers 1

readAgentPreferencesFunction · 0.70

Calls 2

recordFunction · 0.70
validatedFunction · 0.70

Tested by

no test coverage detected