@hypercerts-org/lexicon 0.10.0-beta.6 → 0.10.0-beta.8

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 (44) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +46 -0
  3. package/SCHEMAS.md +114 -104
  4. package/dist/exports.d.ts +186 -20
  5. package/dist/exports.d.ts.map +1 -1
  6. package/dist/generated/exports.d.ts +186 -20
  7. package/dist/generated/exports.d.ts.map +1 -1
  8. package/dist/generated/lexicons.d.ts +376 -54
  9. package/dist/generated/lexicons.d.ts.map +1 -1
  10. package/dist/generated/types/app/bsky/richtext/facet.d.ts +8 -0
  11. package/dist/generated/types/app/bsky/richtext/facet.d.ts.map +1 -0
  12. package/dist/generated/types/org/hypercerts/claim/activity.d.ts +12 -13
  13. package/dist/generated/types/org/hypercerts/claim/activity.d.ts.map +1 -1
  14. package/dist/generated/types/org/hypercerts/claim/collection.d.ts +18 -2
  15. package/dist/generated/types/org/hypercerts/claim/collection.d.ts.map +1 -1
  16. package/dist/generated/types/org/hypercerts/defs.d.ts +44 -0
  17. package/dist/generated/types/org/hypercerts/defs.d.ts.map +1 -1
  18. package/dist/generated/types/org/hypercerts/helper/workScopeTag.d.ts +31 -0
  19. package/dist/generated/types/org/hypercerts/helper/workScopeTag.d.ts.map +1 -0
  20. package/dist/index.cjs +729 -267
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.mjs +721 -263
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/lexicons.cjs +218 -27
  25. package/dist/lexicons.cjs.map +1 -1
  26. package/dist/lexicons.d.ts +376 -54
  27. package/dist/lexicons.d.ts.map +1 -1
  28. package/dist/lexicons.mjs +218 -27
  29. package/dist/lexicons.mjs.map +1 -1
  30. package/dist/types/app/bsky/richtext/facet.d.ts +8 -0
  31. package/dist/types/app/bsky/richtext/facet.d.ts.map +1 -0
  32. package/dist/types/org/hypercerts/claim/activity.d.ts +12 -13
  33. package/dist/types/org/hypercerts/claim/activity.d.ts.map +1 -1
  34. package/dist/types/org/hypercerts/claim/collection.d.ts +18 -2
  35. package/dist/types/org/hypercerts/claim/collection.d.ts.map +1 -1
  36. package/dist/types/org/hypercerts/defs.d.ts +44 -0
  37. package/dist/types/org/hypercerts/defs.d.ts.map +1 -1
  38. package/dist/types/org/hypercerts/helper/workScopeTag.d.ts +31 -0
  39. package/dist/types/org/hypercerts/helper/workScopeTag.d.ts.map +1 -0
  40. package/lexicons/org/hypercerts/claim/activity.json +31 -25
  41. package/lexicons/org/hypercerts/claim/collection.json +33 -2
  42. package/lexicons/org/hypercerts/defs.json +88 -0
  43. package/lexicons/org/hypercerts/helper/workScopeTag.json +65 -0
  44. package/package.json +4 -1
@@ -17,16 +17,32 @@
17
17
  },
18
18
  "shortDescription": {
19
19
  "type": "string",
20
- "description": "Short blurb of the impact work done.",
20
+ "description": "Short summary of this activity claim, suitable for previews and list views. Rich text annotations may be provided via `shortDescriptionFacets`.",
21
21
  "maxLength": 3000,
22
22
  "maxGraphemes": 300
23
23
  },
24
+ "shortDescriptionFacets": {
25
+ "type": "array",
26
+ "description": "Rich text annotations for `shortDescription` (mentions, URLs, hashtags, etc).",
27
+ "items": {
28
+ "type": "ref",
29
+ "ref": "app.bsky.richtext.facet"
30
+ }
31
+ },
24
32
  "description": {
25
33
  "type": "string",
26
- "description": "Optional longer description of the impact work done.",
34
+ "description": "Optional longer description of this activity claim, including context or interpretation. Rich text annotations may be provided via `descriptionFacets`.",
27
35
  "maxLength": 30000,
28
36
  "maxGraphemes": 3000
29
37
  },
38
+ "descriptionFacets": {
39
+ "type": "array",
40
+ "description": "Rich text annotations for `description` (mentions, URLs, hashtags, etc).",
41
+ "items": {
42
+ "type": "ref",
43
+ "ref": "app.bsky.richtext.facet"
44
+ }
45
+ },
30
46
  "image": {
31
47
  "type": "union",
32
48
  "refs": [
@@ -36,9 +52,14 @@
36
52
  "description": "The hypercert visual representation as a URI or image blob."
37
53
  },
38
54
  "workScope": {
39
- "type": "ref",
40
- "ref": "com.atproto.repo.strongRef",
41
- "description": "A strong reference to a record defining the scope of work. The record referenced should describe the logical scope using label-based conditions."
55
+ "type": "union",
56
+ "refs": [
57
+ "org.hypercerts.defs#workScopeAll",
58
+ "org.hypercerts.defs#workScopeAny",
59
+ "org.hypercerts.defs#workScopeNot",
60
+ "org.hypercerts.defs#workScopeAtom"
61
+ ],
62
+ "description": "Work scope logic expression using boolean operators (all/any/not) and atomic scope references."
42
63
  },
43
64
  "startDate": {
44
65
  "type": "string",
@@ -81,21 +102,21 @@
81
102
  },
82
103
  "contributor": {
83
104
  "type": "object",
84
- "required": ["contributorInformation"],
105
+ "required": ["contributorIdentity"],
85
106
  "properties": {
86
- "contributorInformation": {
107
+ "contributorIdentity": {
87
108
  "type": "union",
88
109
  "refs": ["#contributorIdentity", "com.atproto.repo.strongRef"],
89
- "description": "Contributor information as a string (DID or identifier) or strong reference to for instance org.hypercerts.claim.contributorInformation#main."
110
+ "description": "Contributor identity as a string (DID or identifier) via org.hypercerts.claim.activity#contributorIdentity, or a strong reference to a contributor information record."
90
111
  },
91
- "weight": {
112
+ "contributionWeight": {
92
113
  "type": "string",
93
114
  "description": "The relative weight/importance of this contribution (stored as a string to avoid float precision issues). Must be a positive numeric value. Weights do not need to sum to a specific total; normalization can be performed by the consuming application as needed."
94
115
  },
95
116
  "contributionDetails": {
96
117
  "type": "union",
97
118
  "refs": ["#contributorRole", "com.atproto.repo.strongRef"],
98
- "description": "Contribution details as a string or strong reference to org.hypercerts.claim.contributionDetails#main."
119
+ "description": "Contribution details as a string via org.hypercerts.claim.activity#contributorRole, or a strong reference to a contribution details record."
99
120
  }
100
121
  }
101
122
  },
@@ -108,21 +129,6 @@
108
129
  "description": "Contribution details as a string.",
109
130
  "maxLength": 10000,
110
131
  "maxGraphemes": 1000
111
- },
112
- "activityWeight": {
113
- "type": "object",
114
- "required": ["activity", "weight"],
115
- "properties": {
116
- "activity": {
117
- "type": "ref",
118
- "ref": "com.atproto.repo.strongRef",
119
- "description": "A strong reference to a hypercert activity record. This activity must conform to the lexicon org.hypercerts.claim.activity"
120
- },
121
- "weight": {
122
- "type": "string",
123
- "description": "The relative weight/importance of this hypercert activity (stored as a string to avoid float precision issues). Weights can be any positive numeric values and do not need to sum to a specific total; normalization can be performed by the consuming application as needed."
124
- }
125
- }
126
132
  }
127
133
  }
128
134
  }
@@ -31,12 +31,28 @@
31
31
  "ref": "pub.leaflet.pages.linearDocument#main",
32
32
  "description": "Rich-text description, represented as a Leaflet linear document."
33
33
  },
34
+ "avatar": {
35
+ "type": "union",
36
+ "refs": [
37
+ "org.hypercerts.defs#uri",
38
+ "org.hypercerts.defs#smallImage"
39
+ ],
40
+ "description": "The collection's avatar/profile image as a URI or image blob."
41
+ },
42
+ "banner": {
43
+ "type": "union",
44
+ "refs": [
45
+ "org.hypercerts.defs#uri",
46
+ "org.hypercerts.defs#largeImage"
47
+ ],
48
+ "description": "Larger horizontal image to display behind the collection view."
49
+ },
34
50
  "items": {
35
51
  "type": "array",
36
- "description": "Array of strong references to items in this collection. Items can be activities (org.hypercerts.claim.activity) and/or other collections (org.hypercerts.claim.collection).",
52
+ "description": "Array of items in this collection with optional weights.",
37
53
  "items": {
38
54
  "type": "ref",
39
- "ref": "com.atproto.repo.strongRef"
55
+ "ref": "#item"
40
56
  }
41
57
  },
42
58
  "createdAt": {
@@ -46,6 +62,21 @@
46
62
  }
47
63
  }
48
64
  }
65
+ },
66
+ "item": {
67
+ "type": "object",
68
+ "required": ["itemIdentifier"],
69
+ "properties": {
70
+ "itemIdentifier": {
71
+ "type": "ref",
72
+ "ref": "com.atproto.repo.strongRef",
73
+ "description": "Strong reference to an item in this collection. Items can be activities (org.hypercerts.claim.activity) and/or other collections (org.hypercerts.claim.collection)."
74
+ },
75
+ "itemWeight": {
76
+ "type": "string",
77
+ "description": "Optional weight for this item (positive numeric value stored as string). Weights do not need to sum to a specific total; normalization can be performed by the consuming application as needed."
78
+ }
79
+ }
49
80
  }
50
81
  }
51
82
  }
@@ -66,6 +66,94 @@
66
66
  "description": "Image (up to 10MB)"
67
67
  }
68
68
  }
69
+ },
70
+ "workScopeAll": {
71
+ "type": "object",
72
+ "required": ["op", "args"],
73
+ "description": "Logical AND operation: all arguments must be satisfied.",
74
+ "properties": {
75
+ "op": {
76
+ "type": "string",
77
+ "const": "all",
78
+ "description": "Operator type: 'all' (logical AND)"
79
+ },
80
+ "args": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "union",
84
+ "refs": [
85
+ "#workScopeAll",
86
+ "#workScopeAny",
87
+ "#workScopeNot",
88
+ "#workScopeAtom"
89
+ ]
90
+ },
91
+ "minLength": 1,
92
+ "maxLength": 100,
93
+ "description": "Array of work scope expressions that must all be satisfied"
94
+ }
95
+ }
96
+ },
97
+ "workScopeAny": {
98
+ "type": "object",
99
+ "required": ["op", "args"],
100
+ "description": "Logical OR operation: at least one argument must be satisfied.",
101
+ "properties": {
102
+ "op": {
103
+ "type": "string",
104
+ "const": "any",
105
+ "description": "Operator type: 'any' (logical OR)"
106
+ },
107
+ "args": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "union",
111
+ "refs": [
112
+ "#workScopeAll",
113
+ "#workScopeAny",
114
+ "#workScopeNot",
115
+ "#workScopeAtom"
116
+ ]
117
+ },
118
+ "minLength": 1,
119
+ "maxLength": 100,
120
+ "description": "Array of work scope expressions, at least one of which must be satisfied"
121
+ }
122
+ }
123
+ },
124
+ "workScopeNot": {
125
+ "type": "object",
126
+ "required": ["op", "arg"],
127
+ "description": "Logical NOT operation: the argument must not be satisfied.",
128
+ "properties": {
129
+ "op": {
130
+ "type": "string",
131
+ "const": "not",
132
+ "description": "Operator type: 'not' (logical NOT)"
133
+ },
134
+ "arg": {
135
+ "type": "union",
136
+ "refs": [
137
+ "#workScopeAll",
138
+ "#workScopeAny",
139
+ "#workScopeNot",
140
+ "#workScopeAtom"
141
+ ],
142
+ "description": "Work scope expression that must not be satisfied"
143
+ }
144
+ }
145
+ },
146
+ "workScopeAtom": {
147
+ "type": "object",
148
+ "required": ["atom"],
149
+ "description": "Atomic scope reference: a strong reference to a scope record.",
150
+ "properties": {
151
+ "atom": {
152
+ "type": "ref",
153
+ "ref": "com.atproto.repo.strongRef",
154
+ "description": "Strong reference to an org.hypercerts.helper.workScopeTag record"
155
+ }
156
+ }
69
157
  }
70
158
  }
71
159
  }
@@ -0,0 +1,65 @@
1
+ {
2
+ "lexicon": 1,
3
+ "id": "org.hypercerts.helper.workScopeTag",
4
+ "defs": {
5
+ "main": {
6
+ "type": "record",
7
+ "description": "A reusable scope atom for work scope logic expressions. Scopes can represent topics, languages, domains, deliverables, methods, regions, tags, or other categorical labels.",
8
+ "key": "tid",
9
+ "record": {
10
+ "type": "object",
11
+ "required": ["createdAt", "key", "label"],
12
+ "properties": {
13
+ "createdAt": {
14
+ "type": "string",
15
+ "format": "datetime",
16
+ "description": "Client-declared timestamp when this record was originally created"
17
+ },
18
+ "key": {
19
+ "type": "string",
20
+ "description": "Lowercase, hyphenated machine-readable key for this scope (e.g., 'ipfs', 'go-lang', 'filecoin').",
21
+ "maxLength": 120
22
+ },
23
+ "label": {
24
+ "type": "string",
25
+ "description": "Human-readable label for this scope.",
26
+ "maxLength": 200
27
+ },
28
+ "kind": {
29
+ "type": "string",
30
+ "description": "Category type of this scope. Recommended values: topic, language, domain, method, tag.",
31
+ "maxLength": 50
32
+ },
33
+ "description": {
34
+ "type": "string",
35
+ "description": "Optional longer description of this scope.",
36
+ "maxLength": 10000,
37
+ "maxGraphemes": 1000
38
+ },
39
+ "parent": {
40
+ "type": "ref",
41
+ "ref": "com.atproto.repo.strongRef",
42
+ "description": "Optional strong reference to a parent scope record for taxonomy/hierarchy support."
43
+ },
44
+ "aliases": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string",
48
+ "maxLength": 200
49
+ },
50
+ "maxLength": 50,
51
+ "description": "Optional array of alternative names or identifiers for this scope."
52
+ },
53
+ "externalReference": {
54
+ "type": "union",
55
+ "refs": [
56
+ "org.hypercerts.defs#uri",
57
+ "org.hypercerts.defs#smallBlob"
58
+ ],
59
+ "description": "Optional external reference for this scope as a URI or blob."
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypercerts-org/lexicon",
3
- "version": "0.10.0-beta.6",
3
+ "version": "0.10.0-beta.8",
4
4
  "description": "ATProto lexicon definitions and TypeScript types for the Hypercerts protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -57,6 +57,7 @@
57
57
  "eslint": "eslint generated/exports.ts",
58
58
  "typecheck": "tsc --noEmit",
59
59
  "clean": "rm -rf dist generated",
60
+ "style:check": "node ./scripts/check-lexicon-style.js",
60
61
  "prepublishOnly": "npm run check",
61
62
  "changeset": "changeset",
62
63
  "version-packages": "changeset version && npm install --package-lock-only",
@@ -64,6 +65,7 @@
64
65
  "prepare": "husky && ./scripts/setup-merge-driver.sh"
65
66
  },
66
67
  "dependencies": {
68
+ "@atcute/bluesky": "^3.2.15",
67
69
  "@atcute/leaflet": "^1.0.15",
68
70
  "@atproto/lexicon": "^0.6.0",
69
71
  "multiformats": "^13.3.6"
@@ -83,6 +85,7 @@
83
85
  "husky": "^9.1.7",
84
86
  "prettier": "^3.2.5",
85
87
  "rollup": "^4.53.3",
88
+ "string-width": "^8.1.0",
86
89
  "tslib": "^2.8.1",
87
90
  "typescript": "^5.7.2",
88
91
  "typescript-eslint": "^8.51.0",