My agentic slop goes here. Not intended for anyone else!
1type t = {
2 client : Zulip.Client.t;
3 bot_email : string;
4 cache : (string, string) Hashtbl.t;
5}
6
7let create client ~bot_email = {
8 client;
9 bot_email;
10 cache = Hashtbl.create 16;
11}
12
13let get t ~key =
14 Hashtbl.find_opt t.cache key
15
16let put t ~key ~value =
17 Hashtbl.replace t.cache key value;
18 Ok ()
19
20let contains t ~key =
21 Hashtbl.mem t.cache key
22
23let remove t ~key =
24 Hashtbl.remove t.cache key;
25 Ok ()
26
27let keys t =
28 Ok (Hashtbl.fold (fun k _ acc -> k :: acc) t.cache [])