My aggregated monorepo of OCaml code, automaintained
1(*---------------------------------------------------------------------------
2 Copyright (c) 2026 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6(** High-level query interface for changes.
7
8 This module provides convenient functions for querying changes since a
9 specific timestamp and formatting them for broadcast. *)
10
11(** {1 Querying Changes} *)
12
13val changes_since :
14 fs:_ Eio.Path.t ->
15 changes_dir:Fpath.t ->
16 since:Ptime.t ->
17 (Changes_aggregated.entry list, string) result
18(** Get all change entries from aggregated files created after [since].
19 Returns entries from all days after the timestamp. *)
20
21val has_new_changes :
22 fs:_ Eio.Path.t ->
23 changes_dir:Fpath.t ->
24 since:Ptime.t ->
25 bool
26(** Check if there are any new changes since the given timestamp. *)
27
28(** {1 Formatting} *)
29
30val format_for_zulip :
31 entries:Changes_aggregated.entry list ->
32 include_date:bool ->
33 date:string option ->
34 string
35(** Format entries as markdown suitable for Zulip.
36 If [include_date] is true, includes a date header.
37 [date] is used for the header if provided. *)
38
39val format_summary :
40 entries:Changes_aggregated.entry list ->
41 string
42(** Format a brief summary of the changes. *)
43
44(** {1 Daily Changes (Real-time)} *)
45
46val daily_changes_since :
47 fs:_ Eio.Path.t ->
48 changes_dir:Fpath.t ->
49 since:Ptime.t ->
50 Changes_daily.entry list
51(** Get all daily change entries created after [since] timestamp.
52 Uses the per-day-per-repo files for real-time access. *)
53
54val has_new_daily_changes :
55 fs:_ Eio.Path.t ->
56 changes_dir:Fpath.t ->
57 since:Ptime.t ->
58 bool
59(** Check if there are any new daily changes since the given timestamp. *)
60
61val format_daily_for_zulip :
62 entries:Changes_daily.entry list ->
63 include_date:bool ->
64 date:string option ->
65 string
66(** Format daily entries as markdown suitable for Zulip.
67 Groups entries by repository. *)
68
69val format_daily_summary :
70 entries:Changes_daily.entry list ->
71 string
72(** Format a brief summary of daily changes. *)