Optionaloptions: { filePath?: string; onError?: (err: unknown, op: "write" | "read") => void } = {}OptionalfilePath?: stringOverride the default location.
OptionalonError?: (err: unknown, op: "write" | "read") => voidOptional sink for IO errors. Defaults to a no-op so a busted home directory can't crash the TUI on first launch.
Open (or create) the state store. Reads the file once at construction; subsequent mutators write through synchronously. The store keeps an in-memory copy so the hot path (rendering the recent list) doesn't re-read the file on every frame.