atproto libraries implementation in ocaml
1(lang dune 3.20)
2
3(name atproto)
4
5(version 0.1.0)
6
7(generate_opam_files true)
8
9(source
10 ; (tangled @gdiazlo.tngl.sh/atproto)
11 (uri https://tangled.org/gdiazlo.tngl.sh/atproto))
12
13(authors "Gabriel Díaz")
14
15(maintainers "Gabriel Díaz")
16
17(license ISC)
18(homepage https://tangled.org/gdiazlo.tngl.sh/atproto)
19(bug_reports https://tangled.org/gdiazlo.tngl.sh/atproto/issues)
20(documentation https://tangled.org/gdiazlo.tngl.sh/atproto)
21
22; Foundation packages
23(package
24 (name atproto-multibase)
25 (synopsis "Base encoding utilities for AT Protocol")
26 (description "Multibase encoding/decoding including base32-sortable for TIDs and base58btc for did:key")
27 (depends
28 (ocaml (>= 5.4))
29 (alcotest :with-test))
30 (tags (atproto encoding multibase base32 base58)))
31
32(package
33 (name atproto-syntax)
34 (synopsis "Syntax validation for AT Protocol identifiers")
35 (description "Parser-based validation for handles, DIDs, NSIDs, TIDs, AT-URIs, and other AT Protocol syntax")
36 (depends
37 (ocaml (>= 5.4))
38 (atproto-multibase (= :version))
39 (alcotest :with-test))
40 (tags (atproto syntax parser validation)))
41
42(package
43 (name atproto-crypto)
44 (synopsis "Cryptographic operations for AT Protocol")
45 (description "P-256 and K-256 elliptic curve support with low-S normalization, did:key encoding")
46 (depends
47 (ocaml (>= 5.4))
48 (atproto-multibase (= :version))
49 (mirage-crypto-ec (>= 2.0.2))
50 (mirage-crypto-rng (>= 2.0.2))
51 (digestif (>= 1.0))
52 (zarith (>= 1.12))
53 (alcotest :with-test))
54 (tags (atproto crypto ecdsa)))
55
56; Data layer packages
57(package
58 (name atproto-ipld)
59 (synopsis "IPLD support for AT Protocol")
60 (description "Content Identifiers (CID) and DAG-CBOR encoding for AT Protocol")
61 (depends
62 (ocaml (>= 5.4))
63 (atproto-multibase (= :version))
64 (digestif (>= 1.0))
65 (zarith (>= 1.12))
66 (cbor (>= 0.5))
67 (base64 (>= 3.5))
68 (alcotest :with-test))
69 (tags (atproto ipld cid dag-cbor)))
70
71(package
72 (name atproto-mst)
73 (synopsis "Merkle Search Tree for AT Protocol")
74 (description "Content-addressed key-value storage for AT Protocol repositories")
75 (depends
76 (ocaml (>= 5.4))
77 (atproto-ipld (= :version))
78 (digestif (>= 1.0))
79 (alcotest :with-test))
80 (tags (atproto mst merkle repository)))
81
82(package
83 (name atproto-repo)
84 (synopsis "Repository support for AT Protocol")
85 (description "Repository structure, commits, and record operations for AT Protocol")
86 (depends
87 (ocaml (>= 5.4))
88 (atproto-syntax (= :version))
89 (atproto-crypto (= :version))
90 (atproto-ipld (= :version))
91 (atproto-mst (= :version))
92 (digestif (>= 1.0))
93 (alcotest :with-test))
94 (tags (atproto repository commit signing)))
95
96(package
97 (name atproto-lexicon)
98 (synopsis "Lexicon schema support for AT Protocol")
99 (description "Lexicon schema parsing and validation for AT Protocol")
100 (depends
101 (ocaml (>= 5.4))
102 (atproto-syntax (= :version))
103 (atproto-json (= :version))
104 (alcotest :with-test))
105 (tags (atproto lexicon schema)))
106
107; Network layer packages
108(package
109 (name atproto-json)
110 (synopsis "JSON utilities for AT Protocol")
111 (description "JSON wrapper used across AT Protocol packages (currently backed by simdjsont)")
112 (depends
113 (ocaml (>= 5.4))
114 (simdjsont (>= 0.1.0))
115 (alcotest :with-test))
116 (tags (atproto json simdjson)))
117
118
119(package
120 (name atproto-xrpc)
121 (synopsis "XRPC client/server for AT Protocol")
122 (description "XRPC HTTP API protocol implementation for AT Protocol client-server communication")
123 (depends
124 (ocaml (>= 5.4))
125 (atproto-effects (= :version))
126 (atproto-syntax (= :version))
127 (atproto-lexicon (= :version))
128 (atproto-json (= :version))
129 (uri (>= 4.0))
130 (alcotest :with-test))
131 (tags (atproto xrpc api http)))
132
133; Identity layer packages
134(package
135 (name atproto-identity)
136 (synopsis "DID and Handle resolution for AT Protocol")
137 (description "DID and Handle resolution including did:plc, did:web, and DNS/HTTPS handle resolution")
138 (depends
139 (ocaml (>= 5.4))
140 (atproto-effects (= :version))
141 (atproto-syntax (= :version))
142 (atproto-crypto (= :version))
143 (atproto-json (= :version))
144 (uri (>= 4.0))
145 (alcotest :with-test))
146 (tags (atproto identity did handle resolution)))
147
148; Sync layer packages
149(package
150 (name atproto-sync)
151 (synopsis "Repository sync and event streams for AT Protocol")
152 (description "Firehose event stream client and repository synchronization for AT Protocol")
153 (depends
154 (ocaml (>= 5.4))
155 (atproto-effects (= :version))
156 (atproto-syntax (= :version))
157 (atproto-ipld (= :version))
158 (uri (>= 4.0))
159 (alcotest :with-test))
160 (tags (atproto sync firehose websocket)))
161
162; High-level API package
163(package
164 (name atproto-api)
165 (synopsis "High-level API client for AT Protocol")
166 (description "User-friendly API client for AT Protocol with session management, posting, and social actions")
167 (depends
168 (ocaml (>= 5.4))
169 (atproto-syntax (= :version))
170 (atproto-xrpc (= :version))
171 (atproto-identity (= :version))
172 (atproto-ipld (= :version))
173 (atproto-json (= :version))
174 (uri (>= 4.0))
175 (alcotest :with-test))
176 (tags (atproto bluesky api client)))
177
178; Effects abstraction package
179(package
180 (name atproto-effects)
181 (synopsis "Effects-based I/O abstraction for AT Protocol")
182 (description "Unified effect types for HTTP, DNS, WebSocket, time, and random operations. Allows libraries to be runtime-agnostic.")
183 (depends
184 (ocaml (>= 5.4))
185 (uri (>= 4.0))
186 (ptime (>= 1.0))
187 (alcotest :with-test))
188 (tags (atproto effects io abstraction)))
189
190; Main package (umbrella)
191(package
192 (name atproto)
193 (synopsis "AT Protocol implementation in OCaml")
194 (description "Complete AT Protocol implementation including syntax validation, cryptography, IPLD, and identity resolution")
195 (depends
196 (ocaml (>= 5.4))
197 (atproto-multibase (= :version))
198 (atproto-syntax (= :version))
199 (atproto-crypto (= :version))
200 (atproto-ipld (= :version))
201 (atproto-mst (= :version))
202 (atproto-repo (= :version))
203 (atproto-json (= :version))
204 (atproto-lexicon (= :version))
205 (atproto-effects (= :version))
206 (atproto-xrpc (= :version))
207 (atproto-identity (= :version))
208 (atproto-sync (= :version))
209 (atproto-api (= :version))
210 (odoc :with-doc))
211 (tags (atproto bluesky decentralized)))