(raw: string | null)
| 65 | } |
| 66 | |
| 67 | function 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 | |
| 75 | let snapshot: { raw: string | null; value: Readonly<AgentPreferences>; sessionOnly: boolean } | undefined; |
| 76 |
no test coverage detected