@@ -78,7 +78,69 @@ import type {
7878// ============================================================================
7979
8080export type StrongRef = ComAtprotoRepoStrongRef . Main ;
81+
82+ /**
83+ * Hypercert claim (activity) record.
84+ *
85+ * Represents a single hypercert activity with metadata including descriptions,
86+ * time periods, work scope, contributors, and optional rich text annotations.
87+ *
88+ * @remarks
89+ * **Rich Text Facets (beta.7+):**
90+ * - `shortDescriptionFacets` - Annotations for the short description text
91+ * - `descriptionFacets` - Annotations for the full description text
92+ *
93+ * Facets enable rich text features like mentions (@user), URLs, hashtags (#tag),
94+ * and other inline annotations. Each facet specifies:
95+ * - `index`: Byte range in the UTF-8 encoded text (byteStart, byteEnd)
96+ * - `features`: Array of feature objects (mention, link, tag, etc.)
97+ *
98+ * @example Basic claim without facets
99+ * ```typescript
100+ * const claim: HypercertClaim = {
101+ * $type: "org.hypercerts.claim.activity",
102+ * createdAt: new Date().toISOString(),
103+ * shortDescription: "Community cleanup project",
104+ * description: "Monthly beach cleanup initiative",
105+ * startDate: "2024-01-01T00:00:00Z",
106+ * endDate: "2024-12-31T23:59:59Z",
107+ * // ... other fields
108+ * };
109+ * ```
110+ *
111+ * @example Claim with rich text facets
112+ * ```typescript
113+ * const claimWithFacets: HypercertClaim = {
114+ * $type: "org.hypercerts.claim.activity",
115+ * createdAt: new Date().toISOString(),
116+ * shortDescription: "Organized by @alice for #sustainability",
117+ * shortDescriptionFacets: [
118+ * {
119+ * index: { byteStart: 13, byteEnd: 19 }, // "@alice"
120+ * features: [{ $type: "app.bsky.richtext.facet#mention", did: "did:plc:alice123" }]
121+ * },
122+ * {
123+ * index: { byteStart: 24, byteEnd: 39 }, // "#sustainability"
124+ * features: [{ $type: "app.bsky.richtext.facet#tag", tag: "sustainability" }]
125+ * }
126+ * ],
127+ * description: "Visit https://example.com/cleanup for more info",
128+ * descriptionFacets: [
129+ * {
130+ * index: { byteStart: 6, byteEnd: 33 }, // URL
131+ * features: [{ $type: "app.bsky.richtext.facet#link", uri: "https://example.com/cleanup" }]
132+ * }
133+ * ],
134+ * startDate: "2024-01-01T00:00:00Z",
135+ * endDate: "2024-12-31T23:59:59Z",
136+ * // ... other fields
137+ * };
138+ * ```
139+ *
140+ * @see {@link https://atproto.com/specs/richtext#facets|AT Protocol Rich Text Facets }
141+ */
81142export type HypercertClaim = OrgHypercertsClaimActivity . Main ;
143+
82144export type HypercertRights = OrgHypercertsClaimRights . Main ;
83145export type HypercertContributionDetails = OrgHypercertsClaimContributionDetails . Main ;
84146export type HypercertContributorInformation = OrgHypercertsClaimContributorInformation . Main ;
@@ -88,7 +150,51 @@ export type HypercertMeasurement = OrgHypercertsClaimMeasurement.Main;
88150export type HypercertEvaluation = OrgHypercertsClaimEvaluation . Main ;
89151export type HypercertEvidence = OrgHypercertsClaimEvidence . Main ;
90152export type HypercertCollection = OrgHypercertsClaimCollection . Main ;
91- /** Collection item with optional weight */
153+
154+ /**
155+ * Collection item with optional weight.
156+ *
157+ * Represents a single item in a collection's `items` array. Each item can reference
158+ * either an activity or another collection (nested collections), with an optional
159+ * weight for proportional attribution.
160+ *
161+ * @remarks
162+ * Structure (beta.7+):
163+ * - `itemIdentifier` (required): StrongRef to the item (activity or collection)
164+ * - `itemWeight` (optional): Positive numeric value as string for proportional weighting
165+ *
166+ * @example Basic item without weight
167+ * ```typescript
168+ * const item: HypercertCollectionItem = {
169+ * itemIdentifier: {
170+ * uri: "at://did:plc:abc123/org.hypercerts.claim.activity/xyz789",
171+ * cid: "bafyreiabc123..."
172+ * }
173+ * };
174+ * ```
175+ *
176+ * @example Item with weight for proportional attribution
177+ * ```typescript
178+ * const weightedItem: HypercertCollectionItem = {
179+ * itemIdentifier: {
180+ * uri: "at://did:plc:abc123/org.hypercerts.claim.activity/xyz789",
181+ * cid: "bafyreiabc123..."
182+ * },
183+ * itemWeight: "2.5" // This activity has 2.5x weight compared to items with weight "1"
184+ * };
185+ * ```
186+ *
187+ * @example Nested collection
188+ * ```typescript
189+ * const nestedCollection: HypercertCollectionItem = {
190+ * itemIdentifier: {
191+ * uri: "at://did:plc:abc123/org.hypercerts.claim.collection/sub789",
192+ * cid: "bafyreiabc456..."
193+ * },
194+ * itemWeight: "1.0"
195+ * };
196+ * ```
197+ */
92198export type HypercertCollectionItem = OrgHypercertsClaimCollection . Item ;
93199/** Work scope tag for creating reusable scope atoms */
94200export type HypercertWorkScopeTag = OrgHypercertsHelperWorkScopeTag . Main ;
@@ -144,6 +250,26 @@ export type { OrgHypercertsClaimCollection as CollectionLexicon } from "@hyperce
144250// SDK Input Helper Types (Derived from Lexicon)
145251// ============================================================================
146252
253+ /**
254+ * Input type for collection items.
255+ *
256+ * Same as {@link HypercertCollectionItem} but with `$type` field optional since
257+ * the SDK will automatically populate it when creating records.
258+ *
259+ * @example
260+ * ```typescript
261+ * const items: CollectionItemInput[] = [
262+ * {
263+ * itemIdentifier: { uri: "at://did:plc:abc/org.hypercerts.claim.activity/123", cid: "bafyrei..." },
264+ * itemWeight: "1.0"
265+ * },
266+ * {
267+ * itemIdentifier: { uri: "at://did:plc:abc/org.hypercerts.claim.activity/456", cid: "bafyrei..." },
268+ * itemWeight: "2.5" // This activity weighted 2.5x more
269+ * }
270+ * ];
271+ * ```
272+ */
147273export type CollectionItemInput = SetOptional < OrgHypercertsClaimCollection . Item , "$type" > ;
148274
149275/**
0 commit comments