@hypercerts-org/lexicon 0.10.0-beta.9 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/CHANGELOG.md +907 -0
  2. package/README.md +420 -168
  3. package/SCHEMAS.md +897 -142
  4. package/dist/exports.d.ts +1876 -453
  5. package/dist/exports.d.ts.map +1 -1
  6. package/dist/generated/exports.d.ts +1876 -453
  7. package/dist/generated/exports.d.ts.map +1 -1
  8. package/dist/generated/lexicons.d.ts +3709 -1113
  9. package/dist/generated/lexicons.d.ts.map +1 -1
  10. package/dist/generated/types/app/bsky/richtext/facet.d.ts +44 -7
  11. package/dist/generated/types/app/bsky/richtext/facet.d.ts.map +1 -1
  12. package/dist/generated/types/app/certified/actor/organization.d.ts +32 -0
  13. package/dist/generated/types/app/certified/actor/organization.d.ts.map +1 -0
  14. package/dist/generated/types/app/certified/actor/profile.d.ts +30 -0
  15. package/dist/generated/types/app/certified/actor/profile.d.ts.map +1 -0
  16. package/dist/generated/types/app/certified/badge/award.d.ts +4 -3
  17. package/dist/generated/types/app/certified/badge/award.d.ts.map +1 -1
  18. package/dist/generated/types/app/certified/badge/definition.d.ts +3 -3
  19. package/dist/generated/types/app/certified/badge/definition.d.ts.map +1 -1
  20. package/dist/generated/types/app/certified/badge/response.d.ts +3 -3
  21. package/dist/generated/types/app/certified/badge/response.d.ts.map +1 -1
  22. package/dist/generated/types/app/certified/defs.d.ts +11 -1
  23. package/dist/generated/types/app/certified/defs.d.ts.map +1 -1
  24. package/dist/generated/types/app/certified/link/evm.d.ts +45 -0
  25. package/dist/generated/types/app/certified/link/evm.d.ts.map +1 -0
  26. package/dist/generated/types/app/certified/location.d.ts +13 -5
  27. package/dist/generated/types/app/certified/location.d.ts.map +1 -1
  28. package/dist/generated/types/org/hyperboards/board.d.ts +75 -0
  29. package/dist/generated/types/org/hyperboards/board.d.ts.map +1 -0
  30. package/dist/generated/types/org/hyperboards/displayProfile.d.ts +31 -0
  31. package/dist/generated/types/org/hyperboards/displayProfile.d.ts.map +1 -0
  32. package/dist/generated/types/org/hypercerts/claim/activity.d.ts +33 -11
  33. package/dist/generated/types/org/hypercerts/claim/activity.d.ts.map +1 -1
  34. package/dist/generated/types/org/hypercerts/claim/{contributionDetails.d.ts → contribution.d.ts} +6 -6
  35. package/dist/generated/types/org/hypercerts/claim/contribution.d.ts.map +1 -0
  36. package/dist/generated/types/org/hypercerts/claim/contributorInformation.d.ts +2 -2
  37. package/dist/generated/types/org/hypercerts/claim/contributorInformation.d.ts.map +1 -1
  38. package/dist/generated/types/org/hypercerts/claim/rights.d.ts +3 -3
  39. package/dist/generated/types/org/hypercerts/claim/rights.d.ts.map +1 -1
  40. package/dist/generated/types/org/hypercerts/collection.d.ts +48 -0
  41. package/dist/generated/types/org/hypercerts/collection.d.ts.map +1 -0
  42. package/dist/generated/types/org/hypercerts/context/acknowledgement.d.ts +25 -0
  43. package/dist/generated/types/org/hypercerts/context/acknowledgement.d.ts.map +1 -0
  44. package/dist/generated/types/org/hypercerts/context/attachment.d.ts +37 -0
  45. package/dist/generated/types/org/hypercerts/context/attachment.d.ts.map +1 -0
  46. package/dist/{types/org/hypercerts/claim → generated/types/org/hypercerts/context}/evaluation.d.ts +15 -15
  47. package/dist/generated/types/org/hypercerts/context/evaluation.d.ts.map +1 -0
  48. package/dist/generated/types/org/hypercerts/context/measurement.d.ts +43 -0
  49. package/dist/generated/types/org/hypercerts/context/measurement.d.ts.map +1 -0
  50. package/dist/generated/types/org/hypercerts/defs.d.ts +19 -44
  51. package/dist/generated/types/org/hypercerts/defs.d.ts.map +1 -1
  52. package/dist/generated/types/org/hypercerts/funding/receipt.d.ts +18 -6
  53. package/dist/generated/types/org/hypercerts/funding/receipt.d.ts.map +1 -1
  54. package/dist/generated/types/org/hypercerts/workscope/cel.d.ts +20 -0
  55. package/dist/generated/types/org/hypercerts/workscope/cel.d.ts.map +1 -0
  56. package/dist/generated/types/org/hypercerts/workscope/tag.d.ts +36 -0
  57. package/dist/generated/types/org/hypercerts/workscope/tag.d.ts.map +1 -0
  58. package/dist/generated/types/pub/leaflet/blocks/blockquote.d.ts +13 -0
  59. package/dist/generated/types/pub/leaflet/blocks/blockquote.d.ts.map +1 -0
  60. package/dist/generated/types/pub/leaflet/blocks/bskyPost.d.ts +13 -0
  61. package/dist/generated/types/pub/leaflet/blocks/bskyPost.d.ts.map +1 -0
  62. package/dist/generated/types/pub/leaflet/blocks/button.d.ts +12 -0
  63. package/dist/generated/types/pub/leaflet/blocks/button.d.ts.map +1 -0
  64. package/dist/generated/types/pub/leaflet/blocks/code.d.ts +13 -0
  65. package/dist/generated/types/pub/leaflet/blocks/code.d.ts.map +1 -0
  66. package/dist/generated/types/pub/leaflet/blocks/header.d.ts +14 -0
  67. package/dist/generated/types/pub/leaflet/blocks/header.d.ts.map +1 -0
  68. package/dist/generated/types/pub/leaflet/blocks/horizontalRule.d.ts +10 -0
  69. package/dist/generated/types/pub/leaflet/blocks/horizontalRule.d.ts.map +1 -0
  70. package/dist/generated/types/pub/leaflet/blocks/iframe.d.ts +12 -0
  71. package/dist/generated/types/pub/leaflet/blocks/iframe.d.ts.map +1 -0
  72. package/dist/generated/types/pub/leaflet/blocks/image.d.ts +21 -0
  73. package/dist/generated/types/pub/leaflet/blocks/image.d.ts.map +1 -0
  74. package/dist/generated/types/pub/leaflet/blocks/math.d.ts +11 -0
  75. package/dist/generated/types/pub/leaflet/blocks/math.d.ts.map +1 -0
  76. package/dist/generated/types/pub/leaflet/blocks/orderedList.d.ts +31 -0
  77. package/dist/generated/types/pub/leaflet/blocks/orderedList.d.ts.map +1 -0
  78. package/dist/generated/types/pub/leaflet/blocks/page.d.ts +11 -0
  79. package/dist/generated/types/pub/leaflet/blocks/page.d.ts.map +1 -0
  80. package/dist/generated/types/pub/leaflet/blocks/poll.d.ts +12 -0
  81. package/dist/generated/types/pub/leaflet/blocks/poll.d.ts.map +1 -0
  82. package/dist/generated/types/pub/leaflet/blocks/text.d.ts +14 -0
  83. package/dist/generated/types/pub/leaflet/blocks/text.d.ts.map +1 -0
  84. package/dist/generated/types/pub/leaflet/blocks/unorderedList.d.ts +29 -0
  85. package/dist/generated/types/pub/leaflet/blocks/unorderedList.d.ts.map +1 -0
  86. package/dist/generated/types/pub/leaflet/blocks/website.d.ts +14 -0
  87. package/dist/generated/types/pub/leaflet/blocks/website.d.ts.map +1 -0
  88. package/dist/generated/types/pub/leaflet/pages/linearDocument.d.ts +54 -1
  89. package/dist/generated/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -1
  90. package/dist/generated/types/pub/leaflet/richtext/facet.d.ts +97 -0
  91. package/dist/generated/types/pub/leaflet/richtext/facet.d.ts.map +1 -0
  92. package/dist/index.cjs +5682 -1668
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.mjs +5554 -1640
  95. package/dist/index.mjs.map +1 -1
  96. package/dist/lexicons.cjs +1846 -419
  97. package/dist/lexicons.cjs.map +1 -1
  98. package/dist/lexicons.d.ts +3709 -1113
  99. package/dist/lexicons.d.ts.map +1 -1
  100. package/dist/lexicons.mjs +1846 -419
  101. package/dist/lexicons.mjs.map +1 -1
  102. package/dist/tests/validate-external-lexicons.test.d.ts +2 -0
  103. package/dist/tests/validate-external-lexicons.test.d.ts.map +1 -0
  104. package/dist/tests/validate-funding-receipt.test.d.ts +2 -0
  105. package/dist/tests/validate-funding-receipt.test.d.ts.map +1 -0
  106. package/dist/tests/validate-link-evm.test.d.ts +2 -0
  107. package/dist/tests/validate-link-evm.test.d.ts.map +1 -0
  108. package/dist/tests/validate-rights.test.d.ts +2 -0
  109. package/dist/tests/validate-rights.test.d.ts.map +1 -0
  110. package/dist/types/app/bsky/richtext/facet.d.ts +44 -7
  111. package/dist/types/app/bsky/richtext/facet.d.ts.map +1 -1
  112. package/dist/types/app/certified/actor/organization.d.ts +32 -0
  113. package/dist/types/app/certified/actor/organization.d.ts.map +1 -0
  114. package/dist/types/app/certified/actor/profile.d.ts +30 -0
  115. package/dist/types/app/certified/actor/profile.d.ts.map +1 -0
  116. package/dist/types/app/certified/badge/award.d.ts +4 -3
  117. package/dist/types/app/certified/badge/award.d.ts.map +1 -1
  118. package/dist/types/app/certified/badge/definition.d.ts +3 -3
  119. package/dist/types/app/certified/badge/definition.d.ts.map +1 -1
  120. package/dist/types/app/certified/badge/response.d.ts +3 -3
  121. package/dist/types/app/certified/badge/response.d.ts.map +1 -1
  122. package/dist/types/app/certified/defs.d.ts +11 -1
  123. package/dist/types/app/certified/defs.d.ts.map +1 -1
  124. package/dist/types/app/certified/link/evm.d.ts +45 -0
  125. package/dist/types/app/certified/link/evm.d.ts.map +1 -0
  126. package/dist/types/app/certified/location.d.ts +13 -5
  127. package/dist/types/app/certified/location.d.ts.map +1 -1
  128. package/dist/types/org/hyperboards/board.d.ts +75 -0
  129. package/dist/types/org/hyperboards/board.d.ts.map +1 -0
  130. package/dist/types/org/hyperboards/displayProfile.d.ts +31 -0
  131. package/dist/types/org/hyperboards/displayProfile.d.ts.map +1 -0
  132. package/dist/types/org/hypercerts/claim/activity.d.ts +33 -11
  133. package/dist/types/org/hypercerts/claim/activity.d.ts.map +1 -1
  134. package/dist/types/org/hypercerts/claim/{contributionDetails.d.ts → contribution.d.ts} +6 -6
  135. package/dist/types/org/hypercerts/claim/contribution.d.ts.map +1 -0
  136. package/dist/types/org/hypercerts/claim/contributorInformation.d.ts +2 -2
  137. package/dist/types/org/hypercerts/claim/contributorInformation.d.ts.map +1 -1
  138. package/dist/types/org/hypercerts/claim/rights.d.ts +3 -3
  139. package/dist/types/org/hypercerts/claim/rights.d.ts.map +1 -1
  140. package/dist/types/org/hypercerts/collection.d.ts +48 -0
  141. package/dist/types/org/hypercerts/collection.d.ts.map +1 -0
  142. package/dist/types/org/hypercerts/context/acknowledgement.d.ts +25 -0
  143. package/dist/types/org/hypercerts/context/acknowledgement.d.ts.map +1 -0
  144. package/dist/types/org/hypercerts/context/attachment.d.ts +37 -0
  145. package/dist/types/org/hypercerts/context/attachment.d.ts.map +1 -0
  146. package/dist/{generated/types/org/hypercerts/claim → types/org/hypercerts/context}/evaluation.d.ts +15 -15
  147. package/dist/types/org/hypercerts/context/evaluation.d.ts.map +1 -0
  148. package/dist/types/org/hypercerts/context/measurement.d.ts +43 -0
  149. package/dist/types/org/hypercerts/context/measurement.d.ts.map +1 -0
  150. package/dist/types/org/hypercerts/defs.d.ts +19 -44
  151. package/dist/types/org/hypercerts/defs.d.ts.map +1 -1
  152. package/dist/types/org/hypercerts/funding/receipt.d.ts +18 -6
  153. package/dist/types/org/hypercerts/funding/receipt.d.ts.map +1 -1
  154. package/dist/types/org/hypercerts/workscope/cel.d.ts +20 -0
  155. package/dist/types/org/hypercerts/workscope/cel.d.ts.map +1 -0
  156. package/dist/types/org/hypercerts/workscope/tag.d.ts +36 -0
  157. package/dist/types/org/hypercerts/workscope/tag.d.ts.map +1 -0
  158. package/dist/types/pub/leaflet/blocks/blockquote.d.ts +13 -0
  159. package/dist/types/pub/leaflet/blocks/blockquote.d.ts.map +1 -0
  160. package/dist/types/pub/leaflet/blocks/bskyPost.d.ts +13 -0
  161. package/dist/types/pub/leaflet/blocks/bskyPost.d.ts.map +1 -0
  162. package/dist/types/pub/leaflet/blocks/button.d.ts +12 -0
  163. package/dist/types/pub/leaflet/blocks/button.d.ts.map +1 -0
  164. package/dist/types/pub/leaflet/blocks/code.d.ts +13 -0
  165. package/dist/types/pub/leaflet/blocks/code.d.ts.map +1 -0
  166. package/dist/types/pub/leaflet/blocks/header.d.ts +14 -0
  167. package/dist/types/pub/leaflet/blocks/header.d.ts.map +1 -0
  168. package/dist/types/pub/leaflet/blocks/horizontalRule.d.ts +10 -0
  169. package/dist/types/pub/leaflet/blocks/horizontalRule.d.ts.map +1 -0
  170. package/dist/types/pub/leaflet/blocks/iframe.d.ts +12 -0
  171. package/dist/types/pub/leaflet/blocks/iframe.d.ts.map +1 -0
  172. package/dist/types/pub/leaflet/blocks/image.d.ts +21 -0
  173. package/dist/types/pub/leaflet/blocks/image.d.ts.map +1 -0
  174. package/dist/types/pub/leaflet/blocks/math.d.ts +11 -0
  175. package/dist/types/pub/leaflet/blocks/math.d.ts.map +1 -0
  176. package/dist/types/pub/leaflet/blocks/orderedList.d.ts +31 -0
  177. package/dist/types/pub/leaflet/blocks/orderedList.d.ts.map +1 -0
  178. package/dist/types/pub/leaflet/blocks/page.d.ts +11 -0
  179. package/dist/types/pub/leaflet/blocks/page.d.ts.map +1 -0
  180. package/dist/types/pub/leaflet/blocks/poll.d.ts +12 -0
  181. package/dist/types/pub/leaflet/blocks/poll.d.ts.map +1 -0
  182. package/dist/types/pub/leaflet/blocks/text.d.ts +14 -0
  183. package/dist/types/pub/leaflet/blocks/text.d.ts.map +1 -0
  184. package/dist/types/pub/leaflet/blocks/unorderedList.d.ts +29 -0
  185. package/dist/types/pub/leaflet/blocks/unorderedList.d.ts.map +1 -0
  186. package/dist/types/pub/leaflet/blocks/website.d.ts +14 -0
  187. package/dist/types/pub/leaflet/blocks/website.d.ts.map +1 -0
  188. package/dist/types/pub/leaflet/pages/linearDocument.d.ts +54 -1
  189. package/dist/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -1
  190. package/dist/types/pub/leaflet/richtext/facet.d.ts +97 -0
  191. package/dist/types/pub/leaflet/richtext/facet.d.ts.map +1 -0
  192. package/lexicons/app/bsky/richtext/facet.json +51 -0
  193. package/lexicons/app/certified/actor/organization.json +70 -0
  194. package/lexicons/app/certified/actor/profile.json +61 -0
  195. package/lexicons/app/certified/badge/award.json +10 -3
  196. package/lexicons/app/certified/badge/definition.json +17 -4
  197. package/lexicons/app/certified/badge/response.json +5 -4
  198. package/lexicons/app/certified/defs.json +11 -3
  199. package/lexicons/app/certified/link/evm.json +88 -0
  200. package/lexicons/app/certified/location.json +29 -6
  201. package/lexicons/org/hyperboards/board.json +152 -0
  202. package/lexicons/org/hyperboards/displayProfile.json +64 -0
  203. package/lexicons/org/hypercerts/claim/activity.json +61 -39
  204. package/lexicons/org/hypercerts/claim/{contributionDetails.json → contribution.json} +4 -4
  205. package/lexicons/org/hypercerts/claim/contributorInformation.json +3 -2
  206. package/lexicons/org/hypercerts/claim/rights.json +5 -3
  207. package/lexicons/org/hypercerts/{claim/collection.json → collection.json} +33 -11
  208. package/lexicons/org/hypercerts/context/acknowledgement.json +42 -0
  209. package/lexicons/org/hypercerts/context/attachment.json +88 -0
  210. package/lexicons/org/hypercerts/{claim → context}/evaluation.json +25 -22
  211. package/lexicons/org/hypercerts/context/measurement.json +107 -0
  212. package/lexicons/org/hypercerts/defs.json +35 -89
  213. package/lexicons/org/hypercerts/funding/receipt.json +40 -14
  214. package/lexicons/org/hypercerts/workscope/cel.json +39 -0
  215. package/lexicons/org/hypercerts/workscope/tag.json +87 -0
  216. package/lexicons/pub/leaflet/blocks/blockquote.json +22 -0
  217. package/lexicons/pub/leaflet/blocks/bskyPost.json +19 -0
  218. package/lexicons/pub/leaflet/blocks/button.json +19 -0
  219. package/lexicons/pub/leaflet/blocks/code.json +21 -0
  220. package/lexicons/pub/leaflet/blocks/header.json +27 -0
  221. package/lexicons/pub/leaflet/blocks/horizontalRule.json +11 -0
  222. package/lexicons/pub/leaflet/blocks/iframe.json +21 -0
  223. package/lexicons/pub/leaflet/blocks/image.json +37 -0
  224. package/lexicons/pub/leaflet/blocks/math.json +15 -0
  225. package/lexicons/pub/leaflet/blocks/orderedList.json +54 -0
  226. package/lexicons/pub/leaflet/blocks/page.json +15 -0
  227. package/lexicons/pub/leaflet/blocks/poll.json +16 -0
  228. package/lexicons/pub/leaflet/blocks/text.json +26 -0
  229. package/lexicons/pub/leaflet/blocks/unorderedList.json +50 -0
  230. package/lexicons/pub/leaflet/blocks/website.json +27 -0
  231. package/lexicons/pub/leaflet/pages/linearDocument.json +98 -0
  232. package/lexicons/pub/leaflet/richtext/facet.json +149 -0
  233. package/package.json +4 -5
  234. package/dist/generated/types/org/hypercerts/claim/collection.d.ts +0 -41
  235. package/dist/generated/types/org/hypercerts/claim/collection.d.ts.map +0 -1
  236. package/dist/generated/types/org/hypercerts/claim/contributionDetails.d.ts.map +0 -1
  237. package/dist/generated/types/org/hypercerts/claim/evaluation.d.ts.map +0 -1
  238. package/dist/generated/types/org/hypercerts/claim/evidence.d.ts +0 -29
  239. package/dist/generated/types/org/hypercerts/claim/evidence.d.ts.map +0 -1
  240. package/dist/generated/types/org/hypercerts/claim/measurement.d.ts +0 -30
  241. package/dist/generated/types/org/hypercerts/claim/measurement.d.ts.map +0 -1
  242. package/dist/generated/types/org/hypercerts/helper/workScopeTag.d.ts +0 -31
  243. package/dist/generated/types/org/hypercerts/helper/workScopeTag.d.ts.map +0 -1
  244. package/dist/types/org/hypercerts/claim/collection.d.ts +0 -41
  245. package/dist/types/org/hypercerts/claim/collection.d.ts.map +0 -1
  246. package/dist/types/org/hypercerts/claim/contributionDetails.d.ts.map +0 -1
  247. package/dist/types/org/hypercerts/claim/evaluation.d.ts.map +0 -1
  248. package/dist/types/org/hypercerts/claim/evidence.d.ts +0 -29
  249. package/dist/types/org/hypercerts/claim/evidence.d.ts.map +0 -1
  250. package/dist/types/org/hypercerts/claim/measurement.d.ts +0 -30
  251. package/dist/types/org/hypercerts/claim/measurement.d.ts.map +0 -1
  252. package/dist/types/org/hypercerts/helper/workScopeTag.d.ts +0 -31
  253. package/dist/types/org/hypercerts/helper/workScopeTag.d.ts.map +0 -1
  254. package/lexicons/org/hypercerts/claim/evidence.json +0 -57
  255. package/lexicons/org/hypercerts/claim/measurement.json +0 -70
  256. package/lexicons/org/hypercerts/helper/workScopeTag.json +0 -65
package/README.md CHANGED
@@ -1,39 +1,180 @@
1
- # Hypercerts Lexicon Documentation
2
-
3
- This repository contains ATProto lexicon definitions for the
4
- Hypercerts protocol. Each lexicon defines a record type that can be
5
- stored on the ATProto network.
6
-
7
- ## Entity Relationship Diagram
1
+ # @hypercerts-org/lexicon
2
+
3
+ ATProto lexicon definitions and TypeScript types for the
4
+ [Hypercerts](https://hypercerts.org) protocol a system for tracking,
5
+ evaluating, and funding impact work on the
6
+ [AT Protocol](https://atproto.com) network.
7
+
8
+ ## Lexicon Map
9
+
10
+ ```text
11
+ CLAIMS ─ the core impact record and its parts
12
+ ──────────────────────────────────────────────────────────────────────
13
+ activity ──────────┬──► collection ◄──┐ (recursive nesting)
14
+ (the hypercert) │ │ │
15
+ │ ▼ │
16
+ ├──► contribution (role, timeframe)
17
+ ├──► contributorInformation (identity, avatar)
18
+ ├──► rights (licensing terms)
19
+ └──► workScope
20
+ ├── cel (CEL expression)
21
+ └── tag (reusable scope atom)
22
+
23
+ CONTEXT ─ evidence, data, and social verification
24
+ ──────────────────────────────────────────────────────────────────────
25
+ attachment ─────────────► activity / evaluation / ...
26
+ measurement ────────────► activity / ...
27
+ evaluation ─────────────► activity / attachment
28
+ └──────► measurement
29
+ acknowledgement ────────► activity / collection (bidirectional link)
30
+
31
+ FUNDING ─ payment records
32
+ ──────────────────────────────────────────────────────────────────────
33
+ receipt ────────────────► activity (from funder → to recipient)
34
+
35
+ HYPERBOARDS ─ visual display layer (hyperboards.org)
36
+ ──────────────────────────────────────────────────────────────────────
37
+ board ──────────────────► activity / collection
38
+ └── contributorConfig ► contributorInformation
39
+ displayProfile (per-user visual defaults)
40
+
41
+ CERTIFIED ─ shared lexicons (certified.app)
42
+ ──────────────────────────────────────────────────────────────────────
43
+ location (geo coordinates, GeoJSON, H3, …)
44
+ actor/profile (user profile)
45
+ actor/organization (org metadata)
46
+ badge/definition ──► badge/award ──► badge/response
47
+ ```
8
48
 
9
- The following diagrams show the relationship between:
49
+ Every arrow (`►`) is a `strongRef` or union reference stored on the
50
+ AT Protocol network. Full field-level documentation is in
51
+ [SCHEMAS.md](SCHEMAS.md).
10
52
 
11
- - data classes represented by ATProto lexicons, which model the data
12
- sets relating to hypercerts
53
+ ## Consuming These Lexicons
13
54
 
14
- - contributors to activity records (modelled/identified by ATProto
15
- DIDs rather than lexicons)
55
+ If you are building a downstream application on top of these lexicons,
56
+ we strongly recommend **NOT** reading from `main` or other development
57
+ branches of the repository, but instead via the following published
58
+ releases:
16
59
 
17
- - hypercerts protocol tokens which are onchain representations of
18
- activity records in ATProto
60
+ - **For TypeScript / JavaScript code** use [the npm package
61
+ `@hypercerts-org/lexicon`](https://www.npmjs.com/package/@hypercerts-org/lexicon),
62
+ which includes generated types, validation helpers, and schema
63
+ constants.
64
+ - **For other languages** — use the [tagged
65
+ releases](https://github.com/hypercerts-org/hypercerts-lexicon/releases)
66
+ published in this GitHub repository.
19
67
 
20
- Note that contributors and tokens do not require lexicons.
68
+ Both npm releases and git tags follow [SemVer](https://semver.org/).
69
+ For npm, you can depend on a version range to receive compatible
70
+ updates automatically. For GitHub releases/tags, pin a specific tag
71
+ or upgrade manually to a newer compatible SemVer release.
21
72
 
22
- To distinguish these in the diagrams, each class has one of the
23
- following icons:
73
+ The raw lexicons published on ATProto can also be used, but they are
74
+ (unavoidably) missing useful context such as full documentation
75
+ (including changelogs), TypeScript type definitions, SemVer
76
+ guarantees, git history, and other tooling provided by the packaged
77
+ releases.
24
78
 
25
- - "D" means "data class"
26
- - "E" means "entity"
27
- - "P" means "protocol"
79
+ ### AI Agent Skill
28
80
 
29
- ![Hypercert ERD](ERD.svg)
81
+ If you use AI coding assistants (e.g. Claude Code, OpenCode), you can
82
+ install a skill that teaches your agent how to build with these
83
+ lexicons:
30
84
 
31
- <details>
32
- <summary>View ERD with field details</summary>
85
+ ```bash
86
+ npx skills add hypercerts-org/hypercerts-lexicon
87
+ ```
33
88
 
34
- ![Hypercert ERD with fields](ERD-with-fields.svg)
89
+ This installs the
90
+ [`building-with-hypercerts-lexicons`](.agents/skills/building-with-hypercerts-lexicons/SKILL.md)
91
+ skill, which provides your agent with guidance on package entry points,
92
+ TypeScript types, validation, all lexicon schemas, code examples, and
93
+ AT Protocol conventions.
94
+
95
+ ## Maintenance and publishing releases
96
+
97
+ Clearly stability and predictability for users and developers are
98
+ essential.
99
+
100
+ Unfortunately AT Protocol doesn't support any kind of native
101
+ versioning or migrations which could support lexicon schema changes.
102
+ Instead, the AT Protocol community recommends minimising changes to
103
+ lexicons in general, and to avoid breaking changes wherever possible:
104
+
105
+ - https://atproto.com/guides/lexicon-style-guide
106
+ - https://www.pfrazee.com/blog/lexicon-guidance
107
+
108
+ This project intends to follow that guidance as much as possible
109
+ whilst retaining a pragmatic approach. In practice that means:
110
+
111
+ - Changes to other tooling within this repository which _do not touch
112
+ lexicons_ may be made at any time as long as they follow
113
+ [SemVer](https://semver.org/) to avoid negative impact on
114
+ developers.
115
+
116
+ - Non-breaking changes to lexicons, such as adding an optional
117
+ property or updating a `description`, may be made sparingly. While
118
+ these changes are backwards-compatible at the protocol level, they
119
+ may still require consuming applications and indexers to update
120
+ their schemas for consistent UX.
121
+
122
+ - Breaking changes to lexicons will only be made in exceptional
123
+ circumstances. Specifically, a breaking change will only proceed
124
+ **if and only if**:
125
+ - the broader community — not just the Hypercerts core team —
126
+ agrees that the benefits clearly outweigh the cost of the
127
+ breakage, **and**
128
+ - full consideration is given to all affected parties across the
129
+ community and wider ecosystem, not only those involved in the
130
+ decision, **and**
131
+ - no viable alternative exists, such as releasing a new `.v2`
132
+ version of the lexicon or introducing a `v2` field.
133
+
134
+ To date, breaking changes have only occurred during the early
135
+ stages of launching Hypercerts on AT Protocol, before external
136
+ consumers were building against the lexicons. We intend to keep
137
+ it that way.
138
+
139
+ It is also worth noting that members of the ATProto community have
140
+ been working on tooling to make these problems easier to deal with in
141
+ future, e.g. see https://panproto.dev/
142
+
143
+ ## Use of branches
144
+
145
+ `main` is the only evergreen branch and the default branch on GitHub.
146
+ We aim to minimise deviations between `main` and versions published on
147
+ npm and ATProto. However the publishing processes involve several
148
+ moving parts (including third-party systems), and it is technically
149
+ impossible to update all three at the same time. So **please do not
150
+ assume they will always be perfectly in sync**.
151
+
152
+ See [docs/PUBLISHING.md](docs/PUBLISHING.md) for the full release workflow.
153
+
154
+ > If you see a `develop` branch, it is a stale leftover from a
155
+ > previous workflow and is no longer used; do not open pull requests
156
+ > against it.
157
+
158
+ ## Contributing / development
159
+
160
+ Please see [CONTRIBUTING.md](CONTRIBUTING.md).
161
+
162
+ ### Project Structure
163
+
164
+ ```text
165
+ lexicons/ Source of truth (committed)
166
+ org/hypercerts/ Hypercerts protocol lexicons
167
+ org/hyperboards/ Hyperboards visual layer lexicons
168
+ app/certified/ Shared/certified lexicons
169
+ com/atproto/ ATProto external references
170
+
171
+ generated/ Auto-generated TypeScript (gitignored)
172
+ dist/ Built bundles (gitignored)
173
+ scripts/ Build and codegen scripts
174
+ ```
35
175
 
36
- </details>
176
+ > **Never edit `generated/` or `dist/` directly** — they are
177
+ > regenerated from lexicon JSON files.
37
178
 
38
179
  ## Installation
39
180
 
@@ -41,9 +182,7 @@ following icons:
41
182
  npm install @hypercerts-org/lexicon
42
183
  ```
43
184
 
44
- ## Usage
45
-
46
- ### Basic Import
185
+ ## Quick Start
47
186
 
48
187
  ```typescript
49
188
  import {
@@ -51,8 +190,6 @@ import {
51
190
  ACTIVITY_NSID,
52
191
  validate,
53
192
  } from "@hypercerts-org/lexicon";
54
-
55
- // Use with AT Protocol Agent
56
193
  import { Agent } from "@atproto/api";
57
194
 
58
195
  const agent = new Agent({ service: "https://bsky.social" });
@@ -60,116 +197,152 @@ const agent = new Agent({ service: "https://bsky.social" });
60
197
  // Register lexicons with the agent
61
198
  agent.api.lex.add(...HYPERCERTS_SCHEMAS);
62
199
 
63
- // Create a record
64
- const activityRecord = {
200
+ // Build a record
201
+ const record = {
65
202
  $type: ACTIVITY_NSID,
66
- title: "My Impact Work",
67
- shortDescription: "Description here",
68
- workScope: {
69
- uri: "at://did:plc:alice/org.hypercerts.claim.workscope/abc123",
70
- cid: "...",
71
- },
72
- startDate: "2023-01-01T00:00:00Z",
73
- endDate: "2023-12-31T23:59:59Z",
203
+ title: "Reforestation in Amazon Basin 2024",
204
+ shortDescription: "Planted 5,000 native trees across 12 hectares",
74
205
  createdAt: new Date().toISOString(),
75
206
  };
76
207
 
77
- // Validate before creating
78
- const validation = validate(ACTIVITY_NSID, activityRecord);
79
- if (!validation.valid) {
80
- console.error("Validation failed:", validation.errors);
81
- }
208
+ // Validate before writing
209
+ const result = validate(ACTIVITY_NSID, record);
210
+ if (!result.valid) throw new Error(JSON.stringify(result.errors));
82
211
 
212
+ // Write to the network
83
213
  await agent.api.com.atproto.repo.createRecord({
84
214
  repo: agent.session?.did,
85
215
  collection: ACTIVITY_NSID,
86
- record: activityRecord,
216
+ record,
87
217
  });
88
218
  ```
89
219
 
90
- ### Accessing NSIDs (Lexicon IDs)
220
+ ## Lexicon Reference
221
+
222
+ ### Claims (`org.hypercerts.claim.*`)
223
+
224
+ | Lexicon | NSID | Description |
225
+ | --------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
226
+ | **Activity** | `org.hypercerts.claim.activity` | The main hypercert record — describes impact work with title, description, contributors, work scope, timeframe, locations, and rights. |
227
+ | **Contribution** | `org.hypercerts.claim.contribution` | Details about a specific contribution: role, description, and timeframe. |
228
+ | **Contributor Information** | `org.hypercerts.claim.contributorInformation` | Identity record for a contributor: identifier (DID or URI), display name, and avatar. |
229
+ | **Rights** | `org.hypercerts.claim.rights` | Licensing and rights terms (e.g. "CC BY-SA 4.0") attached to an activity. |
230
+
231
+ ### Collections (`org.hypercerts.*`)
232
+
233
+ | Lexicon | NSID | Description |
234
+ | -------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
235
+ | **Collection** | `org.hypercerts.collection` | A named, weighted group of activities and/or other collections. Supports recursive nesting. Used for projects, portfolios, favourites, funding rounds, etc. |
236
+
237
+ ### Context (`org.hypercerts.context.*`)
238
+
239
+ | Lexicon | NSID | Description |
240
+ | ------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------- |
241
+ | **Attachment** | `org.hypercerts.context.attachment` | Documents, reports, evidence, or other files linked to a record. |
242
+ | **Measurement** | `org.hypercerts.context.measurement` | Quantitative data point (metric + unit + value) linked to one or more records. |
243
+ | **Evaluation** | `org.hypercerts.context.evaluation` | An assessment of a record with evaluators, summary, score, and supporting measurements. |
244
+ | **Acknowledgement** | `org.hypercerts.context.acknowledgement` | Bidirectional link: confirms or rejects inclusion of a record in another context. |
245
+
246
+ ### Work Scope (`org.hypercerts.workscope.*`)
247
+
248
+ | Lexicon | NSID | Description |
249
+ | ------------------ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
250
+ | **Tag** | `org.hypercerts.workscope.tag` | Reusable scope atom (topic, domain, method, …) with taxonomy support, aliases, and linked ontologies. |
251
+ | **CEL Expression** | `org.hypercerts.workscope.cel` | Structured work scope using [CEL](https://github.com/google/cel-spec) expressions over tags. Embedded inline in activity records. |
252
+
253
+ ### Funding (`org.hypercerts.funding.*`)
254
+
255
+ | Lexicon | NSID | Description |
256
+ | ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
257
+ | **Receipt** | `org.hypercerts.funding.receipt` | Records a payment to a recipient, with amount, currency, payment rail, and optional transaction ID. The sender (`from`) is optional to support anonymous funders. |
91
258
 
92
- **Recommended**: Use individual NSID constants for cleaner, more readable code:
259
+ ### Hyperboards (`org.hyperboards.*`)
260
+
261
+ | Lexicon | NSID | Description |
262
+ | ------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
263
+ | **Board** | `org.hyperboards.board` | Visual presentation layer wrapping an activity or collection with background, colors, aspect ratio, and per-contributor styling. |
264
+ | **Display Profile** | `org.hyperboards.displayProfile` | Per-user visual defaults (avatar, hover image, video, click-through URL) reusable across boards. Singleton record (`literal:self`). |
265
+
266
+ ### Certified (`app.certified.*`)
267
+
268
+ | Lexicon | NSID | Description |
269
+ | -------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
270
+ | **Location** | `app.certified.location` | Geographic reference using the [Location Protocol](https://spec.decentralizedgeo.org) (coordinates, GeoJSON, H3, WKT, etc.). |
271
+ | **Profile** | `app.certified.actor.profile` | User account profile with display name, bio, avatar, and banner. |
272
+ | **Organization** | `app.certified.actor.organization` | Organization metadata: legal structure, URLs, location, founding date. |
273
+ | **Badge Definition** | `app.certified.badge.definition` | Defines a badge type with title, icon, and optional issuer allowlist. |
274
+ | **Badge Award** | `app.certified.badge.award` | Awards a badge to a user, project, or activity. |
275
+ | **Badge Response** | `app.certified.badge.response` | Recipient accepts or rejects a badge award. |
276
+ | **EVM Link** | `app.certified.link.evm` | Verifiable ATProto DID ↔ EVM wallet link via EIP-712 signature. Extensible for future proof methods (e.g. ERC-1271, ERC-6492). |
277
+
278
+ > **Full property tables** → [SCHEMAS.md](SCHEMAS.md)
279
+
280
+ ## Entity Relationship Diagram
281
+
282
+ ![Hypercert ERD](ERD.svg)
283
+
284
+ <details>
285
+ <summary>View ERD with field details</summary>
286
+
287
+ ![Hypercert ERD with fields](ERD-with-fields.svg)
288
+
289
+ </details>
290
+
291
+ ## Usage
292
+
293
+ ### Accessing NSIDs
294
+
295
+ Individual constants (recommended):
93
296
 
94
297
  ```typescript
95
298
  import { ACTIVITY_NSID, COLLECTION_NSID } from "@hypercerts-org/lexicon";
96
-
97
- // Clean and explicit
98
- const record = {
99
- $type: ACTIVITY_NSID,
100
- // ...
101
- };
102
299
  ```
103
300
 
104
- **Alternative**: Use the semantic NSID object when you need multiple NSIDs:
301
+ Semantic object:
105
302
 
106
303
  ```typescript
107
304
  import { HYPERCERTS_NSIDS } from "@hypercerts-org/lexicon";
108
305
 
109
- // Access via semantic keys
110
- const activityId = HYPERCERTS_NSIDS.ACTIVITY;
111
- const collectionId = HYPERCERTS_NSIDS.COLLECTION;
112
- const rightsId = HYPERCERTS_NSIDS.RIGHTS;
306
+ const id = HYPERCERTS_NSIDS.ACTIVITY;
113
307
  ```
114
308
 
115
- **Type-based mapping**: If you need to map TypeScript type namespaces to NSIDs:
309
+ Type-based mapping:
116
310
 
117
311
  ```typescript
118
312
  import { HYPERCERTS_NSIDS_BY_TYPE } from "@hypercerts-org/lexicon";
119
313
 
120
- // Access via type namespace names
121
- const activityId = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimActivity;
122
- const collectionId = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimCollection;
314
+ const id = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimActivity;
123
315
  ```
124
316
 
125
- **Lightweight Bundle**: Import from `/lexicons` for runtime validation without TypeScript types (smaller bundle size):
317
+ Lightweight bundle (no TypeScript types, smaller bundle):
126
318
 
127
319
  ```typescript
128
320
  import { schemas, validate, ids } from "@hypercerts-org/lexicon/lexicons";
129
-
130
- // Lighter bundle, type-based namespace access
131
- const result = validate(ids.OrgHypercertsClaimActivity, record);
132
321
  ```
133
322
 
134
- **Note**: Individual constants (e.g., `ACTIVITY_NSID`) are the recommended approach for most use cases as they provide the best developer experience with clear, concise naming.
135
-
136
323
  ### TypeScript Types
137
324
 
138
- All lexicon types are exported as namespaces:
139
-
140
325
  ```typescript
141
326
  import { OrgHypercertsClaimActivity } from "@hypercerts-org/lexicon";
142
327
 
143
- // Use the Main type
144
328
  const activity: OrgHypercertsClaimActivity.Main = {
145
329
  $type: "org.hypercerts.claim.activity",
146
330
  title: "My Impact Work",
147
- // ... other fields
331
+ shortDescription: "...",
332
+ createdAt: new Date().toISOString(),
148
333
  };
149
334
  ```
150
335
 
151
- ### Individual Lexicon Imports
152
-
153
- Each lexicon is available in two forms as individual constants:
336
+ ### Lexicon Documents
154
337
 
155
338
  ```typescript
156
339
  import {
157
- // Raw JSON (untyped) - direct import from JSON files
158
- ACTIVITY_LEXICON_JSON,
159
- RIGHTS_LEXICON_JSON,
160
-
161
- // Typed LexiconDoc - from lexicons.get() at module initialization
162
- ACTIVITY_LEXICON_DOC,
163
- RIGHTS_LEXICON_DOC,
340
+ ACTIVITY_LEXICON_JSON, // raw JSON (untyped)
341
+ ACTIVITY_LEXICON_DOC, // LexiconDoc (typed)
164
342
  } from "@hypercerts-org/lexicon";
165
343
  ```
166
344
 
167
- | Suffix | Type | Source | Use Case |
168
- | ------- | -------------------- | ------------------------- | ------------------------------ |
169
- | `_JSON` | Untyped JSON | Direct JSON import | Raw schema data |
170
- | `_DOC` | `LexiconDoc` (typed) | `lexicons.get()` instance | Type-safe lexicon manipulation |
171
-
172
- Or access all lexicons via semantic mapping objects:
345
+ Or via semantic mapping objects:
173
346
 
174
347
  ```typescript
175
348
  import {
@@ -177,126 +350,205 @@ import {
177
350
  HYPERCERTS_LEXICON_DOC,
178
351
  } from "@hypercerts-org/lexicon";
179
352
 
180
- // Access via semantic keys (same keys as HYPERCERTS_NSIDS)
181
- const activityJSON = HYPERCERTS_LEXICON_JSON.ACTIVITY;
182
- const activityDoc = HYPERCERTS_LEXICON_DOC.ACTIVITY;
183
- const rightsJSON = HYPERCERTS_LEXICON_JSON.RIGHTS;
184
- const rightsDoc = HYPERCERTS_LEXICON_DOC.RIGHTS;
353
+ const doc = HYPERCERTS_LEXICON_DOC.ACTIVITY;
185
354
  ```
186
355
 
187
- ## Schema Documentation
356
+ ## Examples
188
357
 
189
- For complete schema documentation with all lexicon definitions and
190
- property tables, see [SCHEMAS.md](SCHEMAS.md).
358
+ ### Creating Activities with Work Scope
191
359
 
192
- ## Examples
360
+ ```typescript
361
+ import { ACTIVITY_NSID } from "@hypercerts-org/lexicon";
193
362
 
194
- ### Creating a Collection with Nested Items
363
+ const activity = {
364
+ $type: ACTIVITY_NSID,
365
+ title: "Mangrove Restoration in Mombasa",
366
+ shortDescription: "Restored 3 hectares of mangrove forest",
367
+ // Structured work scope via CEL expression:
368
+ workScope: {
369
+ $type: "org.hypercerts.workscope.cel",
370
+ expression:
371
+ "scope.hasAll(['mangrove_restoration']) && location.country == 'KE'",
372
+ usedTags: [
373
+ {
374
+ uri: "at://did:plc:alice/org.hypercerts.workscope.tag/3k2abc",
375
+ cid: "...",
376
+ },
377
+ ],
378
+ version: "v1",
379
+ createdAt: new Date().toISOString(),
380
+ },
381
+ startDate: "2024-01-01T00:00:00Z",
382
+ endDate: "2024-12-31T23:59:59Z",
383
+ createdAt: new Date().toISOString(),
384
+ };
385
+ ```
386
+
387
+ ### Creating Collections (Projects, Portfolios, etc.)
195
388
 
196
389
  ```typescript
197
- import { TID } from "@atproto/common";
390
+ import { COLLECTION_NSID } from "@hypercerts-org/lexicon";
198
391
 
199
- const collectionRecord = {
200
- $type: "org.hypercerts.claim.collection",
201
- title: "Climate Action Projects",
202
- shortDescription:
203
- "A collection of climate-related activities and sub-collections",
392
+ const project = {
393
+ $type: COLLECTION_NSID,
394
+ type: "project",
395
+ title: "Carbon Offset Initiative",
396
+ shortDescription: "Activities focused on carbon reduction and reforestation",
204
397
  items: [
205
- // Reference to an activity
206
398
  {
207
- uri: "at://did:plc:alice/org.hypercerts.claim.activity/3k2abc",
208
- cid: "...",
399
+ itemIdentifier: {
400
+ uri: "at://did:plc:alice/org.hypercerts.claim.activity/3k2abc",
401
+ cid: "...",
402
+ },
209
403
  },
210
- // Reference to another activity
211
404
  {
212
- uri: "at://did:plc:bob/org.hypercerts.claim.activity/7x9def",
213
- cid: "...",
405
+ itemIdentifier: {
406
+ uri: "at://did:plc:bob/org.hypercerts.claim.activity/7x9def",
407
+ cid: "...",
408
+ },
214
409
  },
215
- // Reference to another collection (recursive!)
410
+ // Collections can contain other collections (recursive nesting):
216
411
  {
217
- uri: "at://did:plc:carol/org.hypercerts.claim.collection/4m5ghi",
218
- cid: "...",
412
+ itemIdentifier: {
413
+ uri: "at://did:plc:carol/org.hypercerts.collection/4m5ghi",
414
+ cid: "...",
415
+ },
219
416
  },
220
417
  ],
221
418
  createdAt: new Date().toISOString(),
222
419
  };
223
420
  ```
224
421
 
225
- ### Creating a Project
422
+ ### Creating Location Records
423
+
424
+ ```typescript
425
+ import { LOCATION_NSID } from "@hypercerts-org/lexicon";
426
+
427
+ // Decimal coordinates
428
+ const location = {
429
+ $type: LOCATION_NSID,
430
+ lpVersion: "1.0",
431
+ srs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
432
+ locationType: "coordinate-decimal",
433
+ location: { string: "-3.4653, -62.2159" },
434
+ name: "Amazon Research Station",
435
+ createdAt: new Date().toISOString(),
436
+ };
437
+
438
+ // GeoJSON
439
+ const geoLocation = {
440
+ $type: LOCATION_NSID,
441
+ lpVersion: "1.0",
442
+ srs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
443
+ locationType: "geojson-point",
444
+ location: { string: '{"type":"Point","coordinates":[-62.2159,-3.4653]}' },
445
+ name: "Research Station Alpha",
446
+ createdAt: new Date().toISOString(),
447
+ };
448
+ ```
449
+
450
+ ### Acknowledging Inclusion
226
451
 
227
- Projects are collections with a `type` field set to "project" and can
228
- include rich-text descriptions:
452
+ When one user includes another's record (e.g. adding an activity to a
453
+ collection), the owner can confirm or reject with an acknowledgement:
229
454
 
230
455
  ```typescript
231
- const projectRecord = {
232
- $type: "org.hypercerts.claim.collection",
233
- type: "project",
234
- title: "Carbon Offset Initiative",
235
- shortDescription: "A project focused on carbon reduction and reforestation",
236
- description: {
237
- uri: "at://did:plc:alice/pub.leaflet.pages.linearDocument/abc123",
238
- cid: "...",
456
+ import { ACKNOWLEDGEMENT_NSID } from "@hypercerts-org/lexicon";
457
+
458
+ const ack = {
459
+ $type: ACKNOWLEDGEMENT_NSID,
460
+ subject: {
461
+ uri: "at://did:plc:bob/org.hypercerts.claim.activity/3k2abc",
462
+ cid: "bafy...",
239
463
  },
240
- items: [
241
- {
242
- uri: "at://did:plc:alice/org.hypercerts.claim.activity/3k2abc",
243
- cid: "...",
244
- },
464
+ context: {
465
+ uri: "at://did:plc:alice/org.hypercerts.collection/7x9def",
466
+ cid: "bafy...",
467
+ },
468
+ acknowledged: true, // false to reject
469
+ createdAt: new Date().toISOString(),
470
+ };
471
+ ```
472
+
473
+ ### Creating Attachments
474
+
475
+ ```typescript
476
+ import { ATTACHMENT_NSID } from "@hypercerts-org/lexicon";
477
+
478
+ const attachment = {
479
+ $type: ATTACHMENT_NSID,
480
+ title: "Field Survey Report",
481
+ contentType: "report",
482
+ subjects: [
245
483
  {
246
- uri: "at://did:plc:bob/org.hypercerts.claim.activity/7x9def",
484
+ uri: "at://did:plc:alice/org.hypercerts.claim.activity/abc123",
247
485
  cid: "...",
248
486
  },
249
487
  ],
488
+ content: [
489
+ { uri: "https://example.com/reports/survey-2024.pdf" },
490
+ { uri: "ipfs://Qm..." },
491
+ ],
492
+ shortDescription: "Quarterly field survey documenting project progress",
250
493
  createdAt: new Date().toISOString(),
251
494
  };
252
495
  ```
253
496
 
254
- **Note**: The `type` field is optional and can be set to "project",
255
- "favorites", or any other collection type. The `description` field
256
- supports rich-text via Leaflet linear documents.
497
+ ## Development
257
498
 
258
- ### Adding Visual Representation to Collections
499
+ ### Commands
259
500
 
260
- Collections can include `avatar` and `banner` fields for visual representation:
501
+ ```bash
502
+ npm run gen-api # Regenerate TypeScript types from lexicons
503
+ npm run build # Build distributable bundles (ESM, CJS, types)
504
+ npm run check # Validate + typecheck + build (run before committing)
505
+ npm run lint # Check formatting (Prettier + ESLint)
506
+ npm run format # Auto-fix formatting
507
+ npm run gen-schemas-md # Regenerate SCHEMAS.md
508
+ npm run test # Run tests
509
+ ```
261
510
 
262
- ```typescript
263
- import { COLLECTION_NSID } from "@hypercerts-org/lexicon";
511
+ ### Linking ATProto Identity to EVM Wallets
264
512
 
265
- const collectionRecord = {
266
- $type: COLLECTION_NSID,
267
- title: "Climate Action Projects",
268
- avatar: {
269
- image: blobRef, // or { uri: "https://..." }
270
- },
271
- banner: {
272
- image: largeBlobRef, // or { uri: "https://..." }
513
+ The `app.certified.link.evm` record enables verifiable linking between
514
+ an ATProto DID and an EVM wallet address. The link is proven via a
515
+ cryptographic signature, allowing any verifier to confirm that the
516
+ wallet owner authorized the binding. Currently supports EOA wallets
517
+ via EIP-712 typed data signatures; the `proof` field is an open union
518
+ to allow future signature methods (e.g. ERC-1271, ERC-6492).
519
+
520
+ ```typescript
521
+ import { LINK_EVM_NSID } from "@hypercerts-org/lexicon";
522
+
523
+ const evmLinkRecord = {
524
+ $type: LINK_EVM_NSID,
525
+ address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
526
+ proof: {
527
+ $type: "app.certified.link.evm#eip712Proof",
528
+ signature: "0xabc123...", // truncated for readability; real signatures are 130-132 hex chars
529
+ message: {
530
+ $type: "app.certified.link.evm#eip712Message",
531
+ did: "did:plc:alice",
532
+ evmAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
533
+ chainId: "1",
534
+ timestamp: "1709500000",
535
+ nonce: "0",
536
+ },
273
537
  },
274
- items: [
275
- // ... collection items
276
- ],
277
538
  createdAt: new Date().toISOString(),
278
539
  };
279
540
  ```
280
541
 
281
- **Note**: Both `avatar` (up to 5MB) and `banner` (up to 10MB) fields
282
- are optional and support either embedded image blobs or URI references to
283
- external images.
284
-
285
- ### Adding Locations to Activities
286
-
287
- The `locations` field in activity records is an array of strong references
288
- (`com.atproto.repo.strongRef`) pointing to `app.certified.location` records.
289
- Each strong reference contains two required fields:
542
+ **Key fields:**
290
543
 
291
- - `uri`: The ATProto URI of the location record (e.g., `at://did:plc:alice/app.certified.location/abc123`)
292
- - `cid`: The content identifier (CID) of the location record, ensuring referential integrity
544
+ - `address` (required): 0x-prefixed EVM wallet address (EIP-55
545
+ checksummed, 42 chars)
546
+ - `proof` (required): Open union containing the cryptographic proof of
547
+ wallet ownership. Each variant bundles its signature with the
548
+ corresponding message format. Currently the only variant is
549
+ `#eip712Proof` for EOA wallets.
550
+ - `createdAt` (required): Timestamp when the record was created
293
551
 
294
- **Validation and Expectations**:
552
+ ## License
295
553
 
296
- - All location records referenced in the `locations` array must conform to the
297
- `app.certified.location` lexicon schema
298
- - The `uri` field must be a valid ATProto URI pointing to an existing location record
299
- - The `cid` field must match the current CID of the referenced location record
300
- - The `locations` field is optional; activities can be created without location data
301
- - When using the sidecar pattern (same TID), ensure the location record is created
302
- or updated alongside the activity record for consistency
554
+ MIT