@estiva-app/conversation 0.1.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,53 @@ none. A change to how an event is read is a MINOR in `0.x` even when no
6
6
  signature moved, because two apps on different versions would then disagree
7
7
  about a conversation.
8
8
 
9
+ ## 0.3.0 — 2026-10-02
10
+
11
+ **What a composer's pick writes** (CON-27): SPEC §13.1, unchanged. Needs
12
+ protocol 0.24.0, unchanged.
13
+
14
+ - `mentionText` — a person as the body names them: `nostr:npub…`, or `@Name`
15
+ (`!@Name` when urgent) for somebody with no key.
16
+ - `messageReference` — a message as `nostr:nevent…` with its kind and no
17
+ relay hint.
18
+ - `urgentTagsFor` and `URGENT_TAG` — `["urgent", <pubkey>]`, one per urgent
19
+ person the body names (CON-17), moved here from Peek.
20
+
21
+ The bytes are the ones Peek wrote; it takes them from here now, and
22
+ `@estiva-app/ui/editor`'s `@`, `!@` and `[` menus write through them. **SPEC:**
23
+ none changed — this is the writing half of §13.1 an app had to implement
24
+ itself.
25
+
26
+ ## 0.2.0 — 2026-10-01
27
+
28
+ **Read state and membership** (CON-19): SPEC §11, and §11.8 as amended in
29
+ estiva-docs#201, #202 and the placement clarification of 2026-10-01. Needs
30
+ protocol 0.24.0, unchanged.
31
+
32
+ - **Membership** (`membership.ts`, §11.8): `membershipOf`, `membersOf`,
33
+ `streamOf`, the discovery `membershipFilters` with `candidateFilesOf`, and
34
+ `buildMembershipChange` (`kind:1851`, `member:<P>`, tags `a field value h ts
35
+ p`). A placement counts by its `p` alone, and only with a non-empty `value`
36
+ (an unassign places nobody). The creation orders before every other event
37
+ for the file, so an edit does not re-join an author who left. The private mute list
38
+ (`estiva:muted:v1`) and the one-time `mutedFromFollowed` migration, which
39
+ never returns a follow.
40
+ - **Read state** (`readState.ts`, §11.1–§11.6): ported from Peek and Ship.
41
+ Where the two differed: the cap is in **bytes** (Peek; Ship capped at
42
+ 10,000 contexts, which never binds), eviction and the merged cap are
43
+ deterministic to the tie, a coordinate holding another installation's
44
+ `client_id` is reported, and an unreachable relay and an undecryptable own
45
+ slot are kept apart from "no slots" (Ship). Storage, randomness, the relay,
46
+ the signer and NIP-44 are parameters. Peek's `containerContext` is
47
+ `channelContext` here.
48
+ - **Unread** (`unread.ts`): `unreadIn` and `isUnread`, §11.8's four
49
+ conditions over §11.3's effective marker.
50
+ - `peopleNamedInBody`, which `mentionTagsFor` now uses.
51
+
52
+ **SPEC:** §9 C17 (membership fold) and C18 (unread for a member) are
53
+ `test/membership.test.ts`. Nothing about how a conversation is read or
54
+ written in §6 changed.
55
+
9
56
  ## 0.1.0 — 2026-09-30
10
57
 
11
58
  **First release** (CON-5). Extracted from Peek (`src/nostr/fileConversation.ts`,
package/README.md CHANGED
@@ -5,9 +5,9 @@ The conversation rules of the [Estiva SPEC](https://github.com/estiva-app/estiva
5
5
  and estiva-agent read conversations through it.
6
6
 
7
7
  **A convenience, never a requirement.** SPEC §9's conversation checks
8
- (C10–C16) are written so an app can build conversations from the specification
8
+ (C10–C18) are written so an app can build conversations from the specification
9
9
  alone, and this package's tests are those checks
10
- (`test/conformance.test.ts`). If you find this package disagreeing with the
10
+ (`test/conformance.test.ts` for C10–C16, `test/membership.test.ts` for C17 and C18). If you find this package disagreeing with the
11
11
  SPEC, the package is wrong.
12
12
 
13
13
  ```bash
@@ -25,18 +25,37 @@ pass, the clock is a `createdAtMs` you pass, and drafts take their storage.
25
25
  | comment or mention | §6.4 | `isCommentOn`, `strengthOn`, `threadStrength`, `anchorsOf`, `isReply`, `namedInBody` |
26
26
  | threading | §6.4 *Replies* | `parentOf`, `groupThreads` |
27
27
  | writing | §6.4 | `buildComment`, `buildReply`, `referenceTagsFor`, `mentionTagsFor` |
28
+ | what a composer's pick writes | §13.1 | `mentionText`, `messageReference`, `urgentTagsFor`, `URGENT_TAG` |
28
29
  | ordering | §6.2, §6.3 | `trustedTs`, `orderingMs`, `byOrder` |
29
30
  | edits and attachments | §6.8 | `editTargetOf`, `foldEdits`, `foldAttachments` |
30
31
  | reactions | §6.6 | `REACTION_HORIZON`, `reactionHorizon`, `reactionTargetOf`, `reactionEmojiOf`, `foldReactions` |
31
32
  | one read for all of the above | §6.6, §6.8 | `decorationsOf` |
32
33
  | which controls to offer | §6.5 | `offersEditAndDelete` |
33
34
  | drafts | — | `createDraftStore`, `draftKeys` |
35
+ | membership | §11.8 | `membershipOf`, `membersOf`, `streamOf`, `membershipFilters`, `candidateFilesOf`, `buildMembershipChange` |
36
+ | muting | §11.8 | `parseMutedBlob`, `serializeMutedBlob`, `buildMutedEvent`, `mutedFilter`, `mutedFromFollowed` |
37
+ | read state | §11.1–§11.6 | `channelContext`, `fileContext`, `threadContext`, `loadSlotIdentity`, `advanceContexts`, `fetchReadState`, `publishReadState`, `mergeSlots`, `effectiveReadAt` |
38
+ | unread | §11.3, §11.8 | `unreadIn`, `isUnread` |
34
39
 
35
40
  Chat, an edit, a reaction and a deletion are built with
36
41
  `@estiva-app/protocol`'s `buildMessage`, `buildEdit`, `buildReaction` and
37
42
  `buildDeletion`.
38
43
 
44
+ Read state takes its environment like the rest: slot storage and randomness
45
+ (`loadSlotIdentity`), the relay query, the signer and NIP-44 (`fetchReadState`,
46
+ `publishReadState`). When to write — the debounce, the dwell before a view
47
+ counts as read — stays the app's.
48
+
49
+ **Light a dot from the files you already load, not from discovery alone.** A
50
+ file's membership comes from `membershipOf` over that file's own events, which
51
+ an app already holds for any file it shows. `membershipFilters` is for listing
52
+ "your files", and a busy person's results are cut short by the relay's limit
53
+ (each filter returned 2,000 events for one person in 90 days on 2026-10-01). A
54
+ dot built only on discovery would miss a file the limit dropped.
55
+
39
56
  ## What is not in it
40
57
 
41
- The views (CON-18), unread (CON-19), the composer's editor, and anything only
42
- one app needs.
58
+ The views (CON-18), the composer's editor and its `@`, `!@`, `[` and `/`
59
+ menus (`@estiva-app/ui/editor`, which writes through `mentionText` and
60
+ `messageReference` above), a Folder's roster (the relay's
61
+ `kind:39002`), and anything only one app needs.
@@ -1 +1 @@
1
- {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA4B,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAqB9G;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,GAC5H,aAAa,CAsBf;AAED,6CAA6C;AAC7C,MAAM,WAAW,UAAU;IACzB,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,GAChH,aAAa,CAsBf;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CA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,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CAG1I"}
package/dist/builders.js CHANGED
@@ -8,8 +8,7 @@
8
8
  * NIP-22 pair below, whose shape the SPEC decided rather than Buzz.
9
9
  */
10
10
  import { imetaTag, toNostrSeconds } from '@estiva-app/protocol';
11
- import { KIND_COMMENT } from './kinds.js';
12
- const FOLDER_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
11
+ import { FOLDER_ID, KIND_COMMENT } from './kinds.js';
13
12
  /**
14
13
  * A `kind:1111` is channel-scoped when it carries an `h` and **global when it
15
14
  * does not**, and the relay accepts both — so a comment without one is stored
@@ -1 +1 @@
1
- {"version":3,"file":"builders.js","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAiD,MAAM,sBAAsB,CAAA;AAC9G,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEzC,MAAM,SAAS,GAAG,uEAAuE,CAAA;AAEzF;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAChH,CAAC;AAED,kEAAkE;AAClE,SAAS,aAAa,CAAC,OAAe;IACpC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACzC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACnF,OAAO,CAAC,IAAI,E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,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YAC1B,CAAC,GAAG,EAAE,IAAI,CAAC;YACX,CAAC,GAAG,EAAE,MAAM,CAAC;YACb,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACtB,CAAC,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YAC3B,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;YACvC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;YACnC,GAAG,MAAM;SACV;QACD,OAAO,EAAE,IAAI,CAAC,IAAI;KACnB,CAAA;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAA6F;IAC/H,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAC3D,OAAO,IAAI,CAAC,WAAW,KAAK,KAAK,CAAA;AACnC,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * What a composer's pick writes — SPEC §13.1, for `@`, `!@` and `[` (CON-27).
3
+ *
4
+ * The menus that offer a person or a message are an editor's, and live in
5
+ * `@estiva-app/ui/editor`; this is the half that is the same in every client,
6
+ * React or not: the text a pick becomes in the body, and the tags the body
7
+ * then earns. Peek wrote these itself until CON-27, and every byte below is
8
+ * the one it wrote.
9
+ *
10
+ * | pick | body | tags |
11
+ * | --- | --- | --- |
12
+ * | a person (`@`) | `nostr:npub…`, or `@Name` with no key | `p`, from {@link mentionTagsFor} |
13
+ * | a person, urgently (`!@`) | the same `nostr:npub…`, or `!@Name` | `p`, and {@link urgentTagsFor}'s `["urgent", <pubkey>]` |
14
+ * | a message (`[`) | `nostr:nevent…` with its kind and no relay | none yet — a `q` from CON-25 (Decided on CON-26) |
15
+ */
16
+ import { type NostrTag } from '@estiva-app/protocol';
17
+ /**
18
+ * A person as the body names them.
19
+ *
20
+ * The key, when there is one: it survives a rename and resolves for a reader
21
+ * who holds no directory. Somebody with no key is still mentioned by name,
22
+ * which is what every message before §13.1 carried — and an urgent one by
23
+ * `!@Name`, the old text form a reader still takes as urgent.
24
+ *
25
+ * **The urgency is not in the text when there is a key.** It is the tag
26
+ * beside the `p` ({@link urgentTagsFor}), so another app draws an ordinary
27
+ * mention rather than a stray `!`.
28
+ */
29
+ export declare function mentionText(person: {
30
+ pubkey?: string | null;
31
+ label: string;
32
+ }, urgent?: boolean): string;
33
+ /**
34
+ * A message as the body references it: `nostr:nevent…` carrying the event's
35
+ * kind, so a reader can fetch the manifest and the event together rather than
36
+ * one after the other.
37
+ *
38
+ * No relay hint: a reader on this relay needs none, and one elsewhere cannot
39
+ * read the event anyway — the omission every `naddr` an app writes makes.
40
+ */
41
+ export declare function messageReference(eventId: string, kind: number): string;
42
+ /** SPEC §13.1's urgent mention: `["urgent", <pubkey>]` beside that person's `p` (CON-17). */
43
+ export declare const URGENT_TAG = "urgent";
44
+ /**
45
+ * The `urgent` tags for a body: one per person in `urgent` the body names, so
46
+ * each carries a `p` beside it (§13.1). A person the body no longer names —
47
+ * their chip deleted — is dropped rather than paged.
48
+ *
49
+ * `urgent` is what the composer's urgent picks name, by pubkey; the text alone
50
+ * cannot say which of the people it names were urgent.
51
+ */
52
+ export declare function urgentTagsFor(body: string, urgent: readonly string[] | undefined): NostrTag[];
53
+ //# sourceMappingURL=compose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG9E;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,UAAQ,GAAG,MAAM,CAGrG;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,6FAA6F;AAC7F,eAAO,MAAM,UAAU,WAAW,CAAA;AAElC;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,QAAQ,EAAE,CAI7F"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * What a composer's pick writes — SPEC §13.1, for `@`, `!@` and `[` (CON-27).
3
+ *
4
+ * The menus that offer a person or a message are an editor's, and live in
5
+ * `@estiva-app/ui/editor`; this is the half that is the same in every client,
6
+ * React or not: the text a pick becomes in the body, and the tags the body
7
+ * then earns. Peek wrote these itself until CON-27, and every byte below is
8
+ * the one it wrote.
9
+ *
10
+ * | pick | body | tags |
11
+ * | --- | --- | --- |
12
+ * | a person (`@`) | `nostr:npub…`, or `@Name` with no key | `p`, from {@link mentionTagsFor} |
13
+ * | a person, urgently (`!@`) | the same `nostr:npub…`, or `!@Name` | `p`, and {@link urgentTagsFor}'s `["urgent", <pubkey>]` |
14
+ * | a message (`[`) | `nostr:nevent…` with its kind and no relay | none yet — a `q` from CON-25 (Decided on CON-26) |
15
+ */
16
+ import { encodeNevent, encodeNpub } from '@estiva-app/protocol';
17
+ import { mentionTagsFor } from './strength.js';
18
+ /**
19
+ * A person as the body names them.
20
+ *
21
+ * The key, when there is one: it survives a rename and resolves for a reader
22
+ * who holds no directory. Somebody with no key is still mentioned by name,
23
+ * which is what every message before §13.1 carried — and an urgent one by
24
+ * `!@Name`, the old text form a reader still takes as urgent.
25
+ *
26
+ * **The urgency is not in the text when there is a key.** It is the tag
27
+ * beside the `p` ({@link urgentTagsFor}), so another app draws an ordinary
28
+ * mention rather than a stray `!`.
29
+ */
30
+ export function mentionText(person, urgent = false) {
31
+ if (person.pubkey)
32
+ return `nostr:${encodeNpub(person.pubkey)}`;
33
+ return `${urgent ? '!@' : '@'}${person.label}`;
34
+ }
35
+ /**
36
+ * A message as the body references it: `nostr:nevent…` carrying the event's
37
+ * kind, so a reader can fetch the manifest and the event together rather than
38
+ * one after the other.
39
+ *
40
+ * No relay hint: a reader on this relay needs none, and one elsewhere cannot
41
+ * read the event anyway — the omission every `naddr` an app writes makes.
42
+ */
43
+ export function messageReference(eventId, kind) {
44
+ return `nostr:${encodeNevent({ id: eventId, relays: [], kind })}`;
45
+ }
46
+ /** SPEC §13.1's urgent mention: `["urgent", <pubkey>]` beside that person's `p` (CON-17). */
47
+ export const URGENT_TAG = 'urgent';
48
+ /**
49
+ * The `urgent` tags for a body: one per person in `urgent` the body names, so
50
+ * each carries a `p` beside it (§13.1). A person the body no longer names —
51
+ * their chip deleted — is dropped rather than paged.
52
+ *
53
+ * `urgent` is what the composer's urgent picks name, by pubkey; the text alone
54
+ * cannot say which of the people it names were urgent.
55
+ */
56
+ export function urgentTagsFor(body, urgent) {
57
+ if (!urgent || urgent.length === 0)
58
+ return [];
59
+ const named = new Set(mentionTagsFor(body).map((tag) => tag[1]));
60
+ return [...new Set(urgent)].filter((pubkey) => named.has(pubkey)).map((pubkey) => [URGENT_TAG, pubkey]);
61
+ }
62
+ //# sourceMappingURL=compose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA;;;;;;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AC,CAAA;AACzG,CAAC"}
package/dist/index.d.ts CHANGED
@@ -12,14 +12,18 @@
12
12
  * apps: it imports no app's data layer, opens no socket, and takes every
13
13
  * environment touch — the relay read, the clock, storage — as a parameter.
14
14
  */
15
- export declare const CONVERSATION_VERSION = "0.1.0";
15
+ export declare const CONVERSATION_VERSION = "0.3.0";
16
16
  export { KIND_MESSAGE, KIND_COMMENT, KIND_EDIT, KIND_REACTION, KIND_DELETION, KIND_ASSERTION, isConversationKind, isEventId, } from './kinds.js';
17
17
  export { trustedTs, orderingMs, byOrder } from './order.js';
18
- export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, MAX_MENTIONED_PEOPLE, type Strength, } from './strength.js';
18
+ export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, peopleNamedInBody, MAX_MENTIONED_PEOPLE, type Strength, } from './strength.js';
19
19
  export { parentOf, groupThreads, type Threaded } from './threads.js';
20
20
  export { editTargetOf, editsByTarget, foldEdits, foldAttachments, type EditFold } from './edits.js';
21
21
  export { REACTION_HORIZON, REACTION_EMOJI, reactionTargetOf, reactionEmojiOf, reactionHorizon, reactionEventsOf, foldReactions, groupReactions, type ReactionHorizon, type ReactionEvent, type Reaction, } from './reactions.js';
22
22
  export { decorationsOf, type Decoration, type Decorations, type Resolution, type QueryFn } from './decorations.js';
23
23
  export { buildComment, buildReply, offersEditAndDelete, type CommentRef } from './builders.js';
24
+ export { mentionText, messageReference, URGENT_TAG, urgentTagsFor } from './compose.js';
25
+ export { KIND_CHANGE, MEMBER_FIELD_PREFIX, memberField, memberOfField, mentions, streamOf, membershipOf, membersOf, membershipFilters, candidateFilesOf, buildMembershipChange, MUTED_D_TAG, APPDATA_TAG, parseMutedBlob, serializeMutedBlob, buildMutedEvent, mutedFilter, mutedFromFollowed, type Membership, type MutedList, } from './membership.js';
26
+ export { READ_STATE_TAG, READ_STATE_D_PREFIX, MAX_CONTEXTS, MAX_CONTEXT_ID_BYTES, MAX_TIMESTAMP, MAX_CLIENT_ID_BYTES, MAX_BLOB_BYTES, MAX_CONTEXTS_BYTES, READ_STATE_HORIZON_DAYS, channelContext, fileContext, threadContext, messageContext, toContextSeconds, isPublishableContextId, loadSlotIdentity, rotateSlotId, readStateDTag, parseReadStateBlob, serializeReadStateBlob, capContextsToBytes, advanceContexts, buildReadStateEvent, allSlotsFilter, mergeSlots, classifyOwnSlots, effectiveReadAt, fetchReadState, publishReadState, type SlotIdentity, type SlotStorage, type SlotSource, type RandomBytes, type ReadStateBlob, type CappedContexts, type SlotBlob, type OwnSlotVerdict, type Nip44, type FetchedReadState, } from './readState.js';
27
+ export { unreadIn, isUnread, type StreamJudge } from './unread.js';
24
28
  export { createDraftStore, draftKeys, NO_DRAFTS, DRAFT_MAX_AGE_MS, DRAFT_MAX_CHARS, type DraftStore, type DraftStorage, } from './drafts.js';
25
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,UAAU,CAAA;AAE3C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3D,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,KAAK,QAAQ,GACd,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO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gB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,KAAK,EACV,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,aAAa,CAAA"}
package/dist/index.js CHANGED
@@ -12,14 +12,18 @@
12
12
  * apps: it imports no app's data layer, opens no socket, and takes every
13
13
  * environment touch — the relay read, the clock, storage — as a parameter.
14
14
  */
15
- export const CONVERSATION_VERSION = '0.1.0';
15
+ export const CONVERSATION_VERSION = '0.3.0';
16
16
  export { KIND_MESSAGE, KIND_COMMENT, KIND_EDIT, KIND_REACTION, KIND_DELETION, KIND_ASSERTION, isConversationKind, isEventId, } from './kinds.js';
17
17
  export { trustedTs, orderingMs, byOrder } from './order.js';
18
- export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, MAX_MENTIONED_PEOPLE, } from './strength.js';
18
+ export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, peopleNamedInBody, MAX_MENTIONED_PEOPLE, } from './strength.js';
19
19
  export { parentOf, groupThreads } from './threads.js';
20
20
  export { editTargetOf, editsByTarget, foldEdits, foldAttachments } from './edits.js';
21
21
  export { REACTION_HORIZON, REACTION_EMOJI, reactionTargetOf, reactionEmojiOf, reactionHorizon, reactionEventsOf, foldReactions, groupReactions, } from './reactions.js';
22
22
  export { decorationsOf } from './decorations.js';
23
23
  export { buildComment, buildReply, offersEditAndDelete } from './builders.js';
24
+ export { mentionText, messageReference, URGENT_TAG, urgentTagsFor } from './compose.js';
25
+ export { KIND_CHANGE, MEMBER_FIELD_PREFIX, memberField, memberOfField, mentions, streamOf, membershipOf, membersOf, membershipFilters, candidateFilesOf, buildMembershipChange, MUTED_D_TAG, APPDATA_TAG, parseMutedBlob, serializeMutedBlob, buildMutedEvent, mutedFilter, mutedFromFollowed, } from './membership.js';
26
+ export { READ_STATE_TAG, READ_STATE_D_PREFIX, MAX_CONTEXTS, MAX_CONTEXT_ID_BYTES, MAX_TIMESTAMP, MAX_CLIENT_ID_BYTES, MAX_BLOB_BYTES, MAX_CONTEXTS_BYTES, READ_STATE_HORIZON_DAYS, channelContext, fileContext, threadContext, messageContext, toContextSeconds, isPublishableContextId, loadSlotIdentity, rotateSlotId, readStateDTag, parseReadStateBlob, serializeReadStateBlob, capContextsToBytes, advanceContexts, buildReadStateEvent, allSlotsFilter, mergeSlots, classifyOwnSlots, effectiveReadAt, fetchReadState, publishReadState, } from './readState.js';
27
+ export { unreadIn, isUnread } from './unread.js';
24
28
  export { createDraftStore, draftKeys, NO_DRAFTS, DRAFT_MAX_AGE_MS, DRAFT_MAX_CHARS, } from './drafts.js';
25
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAE3C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3D,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,W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}
package/dist/kinds.d.ts CHANGED
@@ -10,6 +10,14 @@ export declare const KIND_REACTION: 7;
10
10
  export declare const KIND_DELETION: 5;
11
11
  /** An assertion; with `t=resolution` it resolves or reopens a comment (PEEK-128). */
12
12
  export declare const KIND_ASSERTION: 9101;
13
+ /** A field change (SPEC §6.2). Not in protocol's `KIND`; the number is the SPEC's. */
14
+ export declare const KIND_CHANGE = 1851;
15
+ /** NIP-78 app data: read state (§11.6) and app-private storage (§12). */
16
+ export declare const KIND_APP_DATA: 30078;
17
+ /** A Folder's channel id: a lowercase UUID v4. */
18
+ export declare const FOLDER_ID: RegExp;
19
+ /** A file's address, `<kind>:<pubkey>:<d>`: kind 30000–39999, 64 lowercase hex, `d` verbatim and without whitespace. */
20
+ export declare const FILE_ADDRESS: RegExp;
13
21
  /** Whether the event is a message or a comment — what a conversation lists. */
14
22
  export declare const isConversationKind: (kind: number) => boolean;
15
23
  /** A 64-hex event id. */
@@ -1 +1 @@
1
- {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAMA,uDAAuD;AACvD,eAAO,MAAM,YAAY,GAAsB,CAAA;AAC/C,gEAAgE;AAChE,eAAO,MAAM,YAAY,MAAe,CAAA;AACxC,8CAA8C;AAC9C,eAAO,MAAM,SAAS,OAAoB,CAAA;AAC1C,gCAAgC;AAChC,eAAO,MAAM,aAAa,GAAgB,CAAA;AAC1C,wCAAwC;AACxC,eAAO,MAAM,aAAa,GAAgB,CAAA;AAC1C,qFAAqF;AACrF,eAAO,MAAM,cAAc,MAAiB,CAAA;AAE5C,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,OAAyD,CAAA;AAE3G,yBAAyB;AACzB,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAsE,CAAA"}
1
+ {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAMA,uDAAuD;AACvD,eAAO,MAAM,YAAY,GAAsB,CAAA;AAC/C,gEAAgE;AAChE,eAAO,MAAM,YAAY,MAAe,CAAA;AACxC,8CAA8C;AAC9C,eAAO,MAAM,SAAS,OAAoB,CAAA;AAC1C,gCAAgC;AAChC,eAAO,MAAM,aAAa,GAAgB,CAAA;AAC1C,wCAAwC;AACxC,eAAO,MAAM,aAAa,GAAgB,CAAA;AAC1C,qFAAqF;AACrF,eAAO,MAAM,cAAc,MAAiB,CAAA;AAE5C,sFAAsF;AACtF,eAAO,MAAM,WAAW,OAAO,CAAA;AAC/B,yEAAyE;AACzE,eAAO,MAAM,aAAa,OAAgB,CAAA;AAE1C,kDAAkD;AAClD,eAAO,MAAM,SAAS,QAA0E,CAAA;AAChG,wHAAwH;AACxH,eAAO,MAAM,YAAY,QAAoC,CAAA;AAE7D,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,OAAyD,CAAA;AAE3G,yBAAyB;AACzB,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAsE,CAAA"}
package/dist/kinds.js CHANGED
@@ -15,6 +15,14 @@ export const KIND_REACTION = KIND.REACTION;
15
15
  export const KIND_DELETION = KIND.DELETION;
16
16
  /** An assertion; with `t=resolution` it resolves or reopens a comment (PEEK-128). */
17
17
  export const KIND_ASSERTION = KIND.ASSERTION;
18
+ /** A field change (SPEC §6.2). Not in protocol's `KIND`; the number is the SPEC's. */
19
+ export const KIND_CHANGE = 1851;
20
+ /** NIP-78 app data: read state (§11.6) and app-private storage (§12). */
21
+ export const KIND_APP_DATA = KIND.APP_DATA;
22
+ /** A Folder's channel id: a lowercase UUID v4. */
23
+ export const FOLDER_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
24
+ /** A file's address, `<kind>:<pubkey>:<d>`: kind 30000–39999, 64 lowercase hex, `d` verbatim and without whitespace. */
25
+ export const FILE_ADDRESS = /^3[0-9]{4}:[0-9a-f]{64}:[^\s]*$/;
18
26
  /** Whether the event is a message or a comment — what a conversation lists. */
19
27
  export const isConversationKind = (kind) => kind === KIND_MESSAGE || kind === KIND_COMMENT;
20
28
  /** A 64-hex event id. */
package/dist/kinds.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"kinds.js","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAA;AAC/C,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAA;AACxC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAA;AAC1C,gCAAgC;AAChC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAA;AAC1C,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAA;AAC1C,qFAAqF;AACrF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAA;AAE5C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,YAAY,CAAA;AAE3G,yBAAyB;AACzB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
1
+ {"version":3,"file":"kinds.js","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAA;AAC/C,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAA;AACxC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAA;AAC1C,gCAAgC;AAChC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAA;AAC1C,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAA;AAC1C,qFAAqF;AACrF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAA;AAE5C,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAA;AAC/B,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAA;AAE1C,kDAAkD;AAClD,MAAM,CAAC,MAAM,SAAS,GAAG,uEAAuE,CAAA;AAChG,wHAAwH;AACxH,MAAM,CAAC,MAAM,YAAY,GAAG,iCAAiC,CAAA;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,YAAY,CAAA;AAE3G,yBAAyB;AACzB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Membership — SPEC §11.8: whose unread a file's conversation is.
3
+ *
4
+ * A person is told about a file's conversation when they are a **member** of
5
+ * the file, and every app computes that the same way, from public events: the
6
+ * file's root, the messages in its stream (§11.1) and its `kind:1851`
7
+ * changes. A Folder's members are its channel roster, which is the relay's
8
+ * and not folded here.
9
+ *
10
+ * | join | the event |
11
+ * | --- | --- |
12
+ * | created it | the root, ordered before every other event for the file |
13
+ * | took part | a message in the stream, by `P` |
14
+ * | was mentioned | a message in the stream whose content names `P` (`nostr:npub…`) |
15
+ * | was placed | a `kind:1851` on the file, not a membership field, with a non-empty `value`, carrying `["p", P]` |
16
+ * | was added, or joined | a `kind:1851` setting `member:<P>` to `true`, by anyone |
17
+ *
18
+ * A **leave** is a `member:<P>` = `false` signed by `P`; one signed by anybody
19
+ * else is ignored. Joins and leaves order as §6.3 orders changes, `P` is a
20
+ * member when the last is a join, and a member **since** the earliest join
21
+ * after the last leave.
22
+ *
23
+ * *Placed* is the `p` alone, so membership and the `#p` discovery query are
24
+ * the same set. A placement written without one does not count (on production,
25
+ * most assignee changes before 2026-10-01).
26
+ *
27
+ * Muting is private and separate (§11.8 *Muting is private*): see
28
+ * {@link parseMutedBlob}.
29
+ */
30
+ import type { SignedEvent, UnsignedEvent } from '@estiva-app/protocol';
31
+ import { KIND_CHANGE } from './kinds.js';
32
+ export { KIND_CHANGE };
33
+ /** The field prefix of a membership change: `member:<pubkey>`. */
34
+ export declare const MEMBER_FIELD_PREFIX = "member:";
35
+ type Event = Pick<SignedEvent, 'id' | 'pubkey' | 'kind' | 'created_at' | 'tags' | 'content'>;
36
+ /** A relay filter, as `QueryFn` takes one. */
37
+ type Filter = Record<string, unknown>;
38
+ /** The membership field for a person: `member:<pubkey>`. */
39
+ export declare function memberField(pubkey: string): string;
40
+ /** The person a `member:<pubkey>` field names, or undefined when it is not one. */
41
+ export declare function memberOfField(field: string | undefined): string | undefined;
42
+ /**
43
+ * Does the message's content mention the person — a `nostr:npub…` in its body.
44
+ * A `p` tag alone is not a mention for membership: the comment builders tag
45
+ * the file's author and the parent's on every comment (§6.4), so a `p` would
46
+ * re-join an author who left.
47
+ */
48
+ export declare function mentions(event: Pick<SignedEvent, 'content'>, pubkey: string): boolean;
49
+ /**
50
+ * The messages in a file's stream (§11.1): every root that is a comment on it,
51
+ * and every reply in those threads. A `kind:1111` reply whose root the read
52
+ * does not hold still counts when its `A` is the file — a reply copies its
53
+ * thread's object. A `kind:9` never roots a file's stream (§6.4, CON-20).
54
+ */
55
+ export declare function streamOf<E extends Event>(file: string, events: readonly E[]): E[];
56
+ /** Whether a person is a member of a file, and since which second. */
57
+ export interface Membership {
58
+ member: boolean;
59
+ /** Unix seconds: the `created_at` of the first join after the last leave. Undefined when not a member. */
60
+ since?: number;
61
+ }
62
+ /**
63
+ * One person's membership of one file (§11.8 *The fold*), from the file's own
64
+ * events: its root, its stream and its changes.
65
+ */
66
+ export declare function membershipOf(file: string, person: string, events: readonly Event[]): Membership;
67
+ /** Every member of a file and since when, from the file's own events. People who left are absent. */
68
+ export declare function membersOf(file: string, events: readonly Event[]): Map<string, Membership>;
69
+ /**
70
+ * The filters that find every file a person may be a member of (§11.8): the
71
+ * changes that name them, what they wrote, and what mentions them. Each
72
+ * candidate file is then read and folded with {@link membershipOf}. The files
73
+ * they created are the app's own query; `since` bounds all three.
74
+ */
75
+ export declare function membershipFilters(person: string, since?: number): Filter[];
76
+ /**
77
+ * The files an event can make a person a member of: a change's `a`, a
78
+ * comment's `A` (or every `a` when it has none). A `kind:9` names none — its
79
+ * file, if any, is its root's, which the app resolves by reading the thread.
80
+ */
81
+ export declare function candidateFilesOf(event: Pick<SignedEvent, 'kind' | 'tags'>): string[];
82
+ /**
83
+ * A membership change (§11.8 *The membership change*): `true` adds a person,
84
+ * by anyone; `false` is a leave and counts only when the person signs it
85
+ * themselves. Tag order: `a`, `field`, `value`, `h`, `ts`, `p`.
86
+ *
87
+ * Sign one only when the person chose it — joining, leaving, or adding
88
+ * somebody. Never to migrate a private follow (§11.8 *Following, retired*).
89
+ *
90
+ * `content` is the note an activity feed shows, as for every change: a change
91
+ * with none renders as a blank line in Ship's feed. "Join", "Leave" or "Add"
92
+ * by default.
93
+ */
94
+ export declare function buildMembershipChange(pubkey: string, createdAtMs: number, args: {
95
+ file: string;
96
+ folder: string;
97
+ person: string;
98
+ member: boolean;
99
+ note?: string;
100
+ }): UnsignedEvent;
101
+ /** The `d` of the person's mute list. */
102
+ export declare const MUTED_D_TAG = "estiva:muted:v1";
103
+ /** The `t` every §12 app-private blob carries. */
104
+ export declare const APPDATA_TAG = "estiva-appdata";
105
+ /** The decrypted mute list: file addresses and channel uuids. */
106
+ export interface MutedList {
107
+ v: 1;
108
+ updatedAt: number;
109
+ keys: string[];
110
+ }
111
+ /** The mute list from its decrypted content, or undefined when it is not a v1 list. Unknown keys are dropped. */
112
+ export declare function parseMutedBlob(plaintext: string): MutedList | undefined;
113
+ /** The plaintext to encrypt to self: keys de-duplicated and sorted, so equal lists are equal bytes. */
114
+ export declare function serializeMutedBlob(keys: Iterable<string>, updatedAt: number): string;
115
+ /**
116
+ * The unsigned `kind:30078` holding the encrypted mute list. Whole blob, last
117
+ * write wins (§12.3): a writer reads the current list, changes it, and writes
118
+ * all of it.
119
+ */
120
+ export declare function buildMutedEvent(pubkey: string, createdAtMs: number, ciphertext: string): UnsignedEvent;
121
+ /** The filter for the person's mute list. */
122
+ export declare function mutedFilter(pubkey: string): Filter;
123
+ /**
124
+ * The one migration from a retired `estiva:followed:v1` blob: its `muted`
125
+ * keys, to merge into the mute list. Peek wrote `muted` as a map of key to
126
+ * epoch ms, and for one day as a plain list; both read. Its followed `keys`
127
+ * are **not** returned — the list was private, so nothing may publish them as
128
+ * memberships — and a followed Folder is dropped, since the roster decides a
129
+ * general stream.
130
+ */
131
+ export declare function mutedFromFollowed(followedPlaintext: string): string[];
132
+ //# sourceMappingURL=membership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../src/membership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,EAAqD,WAAW,EAA8B,MAAM,YAAY,CAA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