@estiva-app/conversation 0.2.0 → 0.4.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,39 @@ 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.4.0 — 2026-10-02
10
+
11
+ **A reference records which message it points at** (CON-25, Miky
12
+ 2026-10-02). Needs protocol 0.24.0, unchanged.
13
+
14
+ - `quoteTagsFor(body, own?)` — `["q", <event id>]`, one per message the body
15
+ references by `nostr:nevent…` or `nostr:note…`, deduplicated, leaving out
16
+ `own`. A writer appends it to a `kind:9` or a `kind:1111` beside the `p`
17
+ and `a` tags the body earns.
18
+ - `eventsNamedInBody` — the ids behind them.
19
+
20
+ **SPEC:** §13.1 gains the `q` rule (estiva-docs, CON-25): a `q` is an index
21
+ of what a message points at, never a reply, and a writer MUST NOT write one
22
+ for an event its body does not name. Reading is unchanged — nothing in this
23
+ package reads `q` yet.
24
+
25
+ ## 0.3.0 — 2026-10-02
26
+
27
+ **What a composer's pick writes** (CON-27): SPEC §13.1, unchanged. Needs
28
+ protocol 0.24.0, unchanged.
29
+
30
+ - `mentionText` — a person as the body names them: `nostr:npub…`, or `@Name`
31
+ (`!@Name` when urgent) for somebody with no key.
32
+ - `messageReference` — a message as `nostr:nevent…` with its kind and no
33
+ relay hint.
34
+ - `urgentTagsFor` and `URGENT_TAG` — `["urgent", <pubkey>]`, one per urgent
35
+ person the body names (CON-17), moved here from Peek.
36
+
37
+ The bytes are the ones Peek wrote; it takes them from here now, and
38
+ `@estiva-app/ui/editor`'s `@`, `!@` and `[` menus write through them. **SPEC:**
39
+ none changed — this is the writing half of §13.1 an app had to implement
40
+ itself.
41
+
9
42
  ## 0.2.0 — 2026-10-01
10
43
 
11
44
  **Read state and membership** (CON-19): SPEC §11, and §11.8 as amended in
package/README.md CHANGED
@@ -25,6 +25,7 @@ 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` |
@@ -54,5 +55,7 @@ dot built only on discovery would miss a file the limit dropped.
54
55
 
55
56
  ## What is not in it
56
57
 
57
- The views (CON-18), the composer's editor, a Folder's roster (the relay's
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
58
61
  `kind:39002`), and anything only one app needs.
@@ -0,0 +1,65 @@
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 | `q`, from {@link quoteTagsFor} (CON-25) |
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
+ /** The events a body references by `nostr:nevent…` or `nostr:note…` (§13.1), in the order it names them. */
54
+ export declare function eventsNamedInBody(body: string): Set<string>;
55
+ /**
56
+ * The `q` tags a body earns: `["q", <event id>]`, one per event it references
57
+ * (SPEC §13.1, CON-25). NIP-18's quote, as an index of *which message this one
58
+ * points at* — never a reply, which is `e` (§6.4). Two elements: the relay is
59
+ * the workspace's, and a `[` pick's `nevent` carries no author to fill a third.
60
+ *
61
+ * `own`, when given, is left out — the event a reply already names by `e`, so
62
+ * one message is not both answered and quoted.
63
+ */
64
+ export declare function quoteTagsFor(body: string, own?: string): NostrTag[];
65
+ //# 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,EAAoF,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAGtI;;;;;;;;;;;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;AAWD,4GAA4G;AAC5G,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAY3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,QAAQ,EAAE,CAI/D"}
@@ -0,0 +1,103 @@
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 | `q`, from {@link quoteTagsFor} (CON-25) |
15
+ */
16
+ import { bech32Decode, convertBits, decodeNevent, encodeNevent, encodeNpub, findNostrUris } 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
+ /** The event id a `note1…` names: its 32 bytes, as hex. Throws on anything else. */
63
+ function decodeNote(encoded) {
64
+ const { hrp, data } = bech32Decode(encoded.toLowerCase());
65
+ if (hrp !== 'note')
66
+ throw new Error(`expected a note, got ${hrp}`);
67
+ const bytes = convertBits(data, 5, 8, false);
68
+ if (bytes.length !== 32)
69
+ throw new Error('a note is 32 bytes');
70
+ return bytes.map((b) => b.toString(16).padStart(2, '0')).join('');
71
+ }
72
+ /** The events a body references by `nostr:nevent…` or `nostr:note…` (§13.1), in the order it names them. */
73
+ export function eventsNamedInBody(body) {
74
+ const ids = new Set();
75
+ for (const uri of findNostrUris(body)) {
76
+ const bech = uri.slice('nostr:'.length);
77
+ try {
78
+ if (bech.startsWith('nevent1'))
79
+ ids.add(decodeNevent(bech).id);
80
+ else if (bech.startsWith('note1'))
81
+ ids.add(decodeNote(bech));
82
+ }
83
+ catch {
84
+ // A malformed pointer is prose.
85
+ }
86
+ }
87
+ return ids;
88
+ }
89
+ /**
90
+ * The `q` tags a body earns: `["q", <event id>]`, one per event it references
91
+ * (SPEC §13.1, CON-25). NIP-18's quote, as an index of *which message this one
92
+ * points at* — never a reply, which is `e` (§6.4). Two elements: the relay is
93
+ * the workspace's, and a `[` pick's `nevent` carries no author to fill a third.
94
+ *
95
+ * `own`, when given, is left out — the event a reply already names by `e`, so
96
+ * one message is not both answered and quoted.
97
+ */
98
+ export function quoteTagsFor(body, own = '') {
99
+ const ids = eventsNamedInBody(body);
100
+ ids.delete(own);
101
+ return [...ids].map((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,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,gCAAgC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,GAAG,EAAE;IACjD,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;IACnC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACf,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAA;AACxC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@
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.2.0";
15
+ export declare const CONVERSATION_VERSION = "0.4.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
18
  export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, peopleNamedInBody, MAX_MENTIONED_PEOPLE, type Strength, } from './strength.js';
@@ -21,6 +21,7 @@ export { editTargetOf, editsByTarget, foldEdits, foldAttachments, type EditFold
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 { eventsNamedInBody, mentionText, messageReference, quoteTagsFor, URGENT_TAG, urgentTagsFor } from './compose.js';
24
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';
25
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';
26
27
  export { unreadIn, isUnread, type StreamJudge } from './unread.js';
@@ -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,WAA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,EACV,gBAAgB,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,7 +12,7 @@
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.2.0';
15
+ export const CONVERSATION_VERSION = '0.4.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
18
  export { namedInBody, isReply, anchorsOf, isCommentOn, referencesAddress, strengthOn, threadStrength, referenceTagsFor, mentionTagsFor, peopleNamedInBody, MAX_MENTIONED_PEOPLE, } from './strength.js';
@@ -21,6 +21,7 @@ export { editTargetOf, editsByTarget, foldEdits, foldAttachments } from './edits
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 { eventsNamedInBody, mentionText, messageReference, quoteTagsFor, URGENT_TAG, urgentTagsFor } from './compose.js';
24
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';
25
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';
26
27
  export { unreadIn, isUnread } from './unread.js';
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,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GAErB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAiB,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAA;AAEnG,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,cAAc,GAIf,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAoE,MAAM,kBAAkB,CAAA;AAElH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAmB,MAAM,eAAe,CAAA;AAE9F,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,GAGlB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,GAWjB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAoB,MAAM,aAAa,CAAA;AAElE,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,GAGhB,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;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AO,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,GAWjB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAoB,MAAM,aAAa,CAAA;AAElE,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,GAGhB,MAAM,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/conversation",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "The conversation rules of the Estiva SPEC (§6.2–§6.8, §11): comment and mention strengths, threading, the edit, reaction and attachment folds, NIP-22 comment and reply builders, drafts, NIP-RS read state, membership and unread. A convenience an app adopts, never a requirement.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/compose.ts ADDED
@@ -0,0 +1,102 @@
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 | `q`, from {@link quoteTagsFor} (CON-25) |
15
+ */
16
+ import { bech32Decode, convertBits, decodeNevent, encodeNevent, encodeNpub, findNostrUris, type NostrTag } from '@estiva-app/protocol'
17
+ import { mentionTagsFor } from './strength.js'
18
+
19
+ /**
20
+ * A person as the body names them.
21
+ *
22
+ * The key, when there is one: it survives a rename and resolves for a reader
23
+ * who holds no directory. Somebody with no key is still mentioned by name,
24
+ * which is what every message before §13.1 carried — and an urgent one by
25
+ * `!@Name`, the old text form a reader still takes as urgent.
26
+ *
27
+ * **The urgency is not in the text when there is a key.** It is the tag
28
+ * beside the `p` ({@link urgentTagsFor}), so another app draws an ordinary
29
+ * mention rather than a stray `!`.
30
+ */
31
+ export function mentionText(person: { pubkey?: string | null; label: string }, urgent = false): string {
32
+ if (person.pubkey) return `nostr:${encodeNpub(person.pubkey)}`
33
+ return `${urgent ? '!@' : '@'}${person.label}`
34
+ }
35
+
36
+ /**
37
+ * A message as the body references it: `nostr:nevent…` carrying the event's
38
+ * kind, so a reader can fetch the manifest and the event together rather than
39
+ * one after the other.
40
+ *
41
+ * No relay hint: a reader on this relay needs none, and one elsewhere cannot
42
+ * read the event anyway — the omission every `naddr` an app writes makes.
43
+ */
44
+ export function messageReference(eventId: string, kind: number): string {
45
+ return `nostr:${encodeNevent({ id: eventId, relays: [], kind })}`
46
+ }
47
+
48
+ /** SPEC §13.1's urgent mention: `["urgent", <pubkey>]` beside that person's `p` (CON-17). */
49
+ export const URGENT_TAG = 'urgent'
50
+
51
+ /**
52
+ * The `urgent` tags for a body: one per person in `urgent` the body names, so
53
+ * each carries a `p` beside it (§13.1). A person the body no longer names —
54
+ * their chip deleted — is dropped rather than paged.
55
+ *
56
+ * `urgent` is what the composer's urgent picks name, by pubkey; the text alone
57
+ * cannot say which of the people it names were urgent.
58
+ */
59
+ export function urgentTagsFor(body: string, urgent: readonly string[] | undefined): NostrTag[] {
60
+ if (!urgent || urgent.length === 0) return []
61
+ const named = new Set(mentionTagsFor(body).map((tag) => tag[1]))
62
+ return [...new Set(urgent)].filter((pubkey) => named.has(pubkey)).map((pubkey) => [URGENT_TAG, pubkey])
63
+ }
64
+
65
+ /** The event id a `note1…` names: its 32 bytes, as hex. Throws on anything else. */
66
+ function decodeNote(encoded: string): string {
67
+ const { hrp, data } = bech32Decode(encoded.toLowerCase())
68
+ if (hrp !== 'note') throw new Error(`expected a note, got ${hrp}`)
69
+ const bytes = convertBits(data, 5, 8, false)
70
+ if (bytes.length !== 32) throw new Error('a note is 32 bytes')
71
+ return bytes.map((b) => b.toString(16).padStart(2, '0')).join('')
72
+ }
73
+
74
+ /** The events a body references by `nostr:nevent…` or `nostr:note…` (§13.1), in the order it names them. */
75
+ export function eventsNamedInBody(body: string): Set<string> {
76
+ const ids = new Set<string>()
77
+ for (const uri of findNostrUris(body)) {
78
+ const bech = uri.slice('nostr:'.length)
79
+ try {
80
+ if (bech.startsWith('nevent1')) ids.add(decodeNevent(bech).id)
81
+ else if (bech.startsWith('note1')) ids.add(decodeNote(bech))
82
+ } catch {
83
+ // A malformed pointer is prose.
84
+ }
85
+ }
86
+ return ids
87
+ }
88
+
89
+ /**
90
+ * The `q` tags a body earns: `["q", <event id>]`, one per event it references
91
+ * (SPEC §13.1, CON-25). NIP-18's quote, as an index of *which message this one
92
+ * points at* — never a reply, which is `e` (§6.4). Two elements: the relay is
93
+ * the workspace's, and a `[` pick's `nevent` carries no author to fill a third.
94
+ *
95
+ * `own`, when given, is left out — the event a reply already names by `e`, so
96
+ * one message is not both answered and quoted.
97
+ */
98
+ export function quoteTagsFor(body: string, own = ''): NostrTag[] {
99
+ const ids = eventsNamedInBody(body)
100
+ ids.delete(own)
101
+ return [...ids].map((id) => ['q', id])
102
+ }
package/src/index.ts CHANGED
@@ -12,7 +12,7 @@
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.2.0'
15
+ export const CONVERSATION_VERSION = '0.4.0'
16
16
 
17
17
  export {
18
18
  KIND_MESSAGE,
@@ -64,6 +64,8 @@ export { decorationsOf, type Decoration, type Decorations, type Resolution, type
64
64
 
65
65
  export { buildComment, buildReply, offersEditAndDelete, type CommentRef } from './builders.js'
66
66
 
67
+ export { eventsNamedInBody, mentionText, messageReference, quoteTagsFor, URGENT_TAG, urgentTagsFor } from './compose.js'
68
+
67
69
  export {
68
70
  KIND_CHANGE,
69
71
  MEMBER_FIELD_PREFIX,