mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
Three modules were each re-implementing the same four concerns — reaching a Storage that can throw, parsing JSON that may be anything, deciding what a bad value means, and writing without letting a quota error escape — with their own try/catch and their own answer to each. createJsonStore owns the first, second and fourth; a caller supplies only its key, its fallback, and how to read its own shape. UI preferences, agent drafts and render settings now sit on it. Validation stays with each caller, since only it knows which fields are meaningful.