@estiva-app/protocol 0.37.0 → 0.38.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
@@ -4,6 +4,30 @@ Every entry answers the wire question explicitly, including when the answer is
4
4
  nothing (ADR 0002 §4b). A change to the bytes an app publishes is a MAJOR — in
5
5
  `0.x`, a MINOR — even when no TypeScript signature moved.
6
6
 
7
+ ## 0.38.0 — 2026-10-16
8
+
9
+ **Wire behaviour: changed — where a link sits decides how it draws in a
10
+ message** (SPEC §13.2, §13.6.2, C21, C26, C27; Widgets 2; record
11
+ where-a-link-sits-decides-how-it-draws). No new tag. Reading: a line that is
12
+ only a reference draws the file's row in place, and draws nothing when that
13
+ file has a card or a part under the message: `lineDrawOf` answers it per line
14
+ (`linesOf`), so Peek and Ship draw by one rule (`isOnlyReferenceLine` and
15
+ `isFolderValue` are its parts; a person or a Folder stays a chip).
16
+ Writing: `defaultCardOf` picks the one file that takes the default
17
+ `["embed", V, "detailed"]` at send or on an edit that names it first; the
18
+ file whose conversation the message is in does not count (Miky, 16 Oct), and
19
+ a value that already has an entry keeps it, so a ✕ after sending holds;
20
+ `withCard` sets one value in a folded set, for ✕ (`none`) or an edit's default;
21
+ `buildEdit` takes `embeds` and `mediaTags`, so an edit can carry the whole
22
+ set, written by `embedTagsOf` (normalised, once per value; a value that is not
23
+ an address or event id throws). Also exported: `valuesIn` (what a body names,
24
+ the count `cardsIn` uses) and `valueOfReference`, which Peek and Ship each
25
+ copied. **Changed:** a bare URL stuck to the end of a word (`seehttps://…`)
26
+ is no longer a link, in `urlRunsIn`, `linksAsReferences` and `cardsIn`, so it
27
+ names nothing and takes no `a`; and `cardsIn` now finds a URL by the same
28
+ rules `linksAsReferences` turns it by, run by run, so the target of a link on
29
+ words (`[the plan](https://…)`) names nothing and draws no card.
30
+
7
31
  ## 0.37.0 — 2026-10-15
8
32
 
9
33
  **Wire behaviour: new — a comment can anchor to a run of blocks and the words
package/dist/embeds.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { PartPointer } from './anchors.js';
2
- import type { RenderBlock } from './render.js';
2
+ import type { RenderBlock, RenderInline } from './render.js';
3
3
  export declare const EMBED_TAG = "embed";
4
4
  /** How much of a referenced object a card shows, or `none` for no card. */
5
5
  export type EmbedLayout = 'compact' | 'detailed' | 'none';
@@ -11,6 +11,13 @@ export interface Embed {
11
11
  }
12
12
  /** The `embed` tag for one reference. */
13
13
  export declare function embedTag(value: string, layout: EmbedLayout): string[];
14
+ /**
15
+ * A whole `embed` set as tags, as a send or an edit writes it: each value
16
+ * normalised as {@link embedsOf} reads it, the first entry per value kept.
17
+ * Throws on a value that is neither an address nor an event id, or on a
18
+ * layout this writer does not know, rather than write a tag readers skip.
19
+ */
20
+ export declare function embedTagsOf(set: readonly Embed[]): string[][];
14
21
  /**
15
22
  * The `embed` tags on one event, one per value, in tag order.
16
23
  *
@@ -34,6 +41,11 @@ export declare function embedsOf(event: {
34
41
  * a real issue's card under a link that does not open it (§7.7).
35
42
  */
36
43
  export type LinkResolver = (url: string) => string | undefined;
44
+ /**
45
+ * The address or event id a `nostr:` reference names — what an `a`, `q` or
46
+ * `embed` carries for it — or undefined for a person or something unreadable.
47
+ */
48
+ export declare function valueOfReference(reference: string): string | undefined;
37
49
  /**
38
50
  * The cards a message asks for, in the order the body first names them.
39
51
  *
@@ -49,6 +61,105 @@ export type LinkResolver = (url: string) => string | undefined;
49
61
  * default a reader has for that value. Filter them out to get the cards to draw.
50
62
  */
51
63
  export declare function cardsIn(embeds: readonly Embed[], blocks: readonly RenderBlock[], parts?: readonly PartPointer[], resolveLink?: LinkResolver): Embed[];
64
+ /**
65
+ * Every address and event id a message's body names, once each, in the order
66
+ * it first names them: by a `nostr:` reference, or by an app link that
67
+ * `resolveLink` resolves (§7.7). A person names no value. Text in a code span
68
+ * names nothing (§13.1). What {@link cardsIn} and {@link defaultCardOf} count.
69
+ */
70
+ export declare function valuesIn(blocks: readonly RenderBlock[], resolveLink?: LinkResolver): string[];
71
+ /**
72
+ * A block's lines: its inline runs split at each `\n`, the line break both
73
+ * content models use (§13.2). A run that holds a break is cut in two, marks
74
+ * kept; a reference never holds one.
75
+ */
76
+ export declare function linesOf(block: Pick<RenderBlock, 'inline'>): RenderInline[][];
77
+ /**
78
+ * What a line of a message is only, by §13.2, or undefined when it is a
79
+ * sentence: the `nostr:` reference, or the bare URL, that §13.6.2 draws in its
80
+ * place. `block` is the block the line is in: only a paragraph's and a list
81
+ * item's lines count, never a quote's, a heading's or code's.
82
+ *
83
+ * Whitespace around it is trimmed. Anything else makes it a sentence: other
84
+ * words or punctuation (trailing `.` included), a second reference, a marker
85
+ * around it, a code span, or `[words](url)`. A person (`npub`, `nprofile`)
86
+ * alone on a line stays a chip, so it is not returned. A Folder stays a chip
87
+ * too, but whether a URL names one is known only once it resolves: the reader
88
+ * checks the value ({@link isFolderValue}). A URL returned here still has to
89
+ * resolve by §7.7; one that resolves to nothing, or to something the reader
90
+ * cannot read, stays the URL as written.
91
+ */
92
+ export declare function isOnlyReferenceLine(line: readonly RenderInline[], block: Pick<RenderBlock, 'type'>): string | undefined;
93
+ /** A Folder's address (`39000:…`): alone on its line it stays a chip, and it never takes the default card (§13.6.2). */
94
+ export declare function isFolderValue(value: string): boolean;
95
+ /**
96
+ * What one line of a message draws (§13.2, §13.6.2):
97
+ * - `sentence` — its runs as they are, each reference its chip;
98
+ * - `row` — the line is only a reference to `value`, drawn as its row;
99
+ * - `nothing` — the same, but `value` has a card or a part under the message,
100
+ * which stands for it (C26);
101
+ * - `url` — a lone URL that names nothing (no app claims it, or the answer has
102
+ * not come back), drawn as the URL as written;
103
+ * - `unreadable` — a lone `nostr:` reference that names no address or event
104
+ * id, drawn as the unreadable row.
105
+ */
106
+ export type LineDraw = {
107
+ draw: 'sentence';
108
+ } | {
109
+ draw: 'row' | 'nothing';
110
+ value: string;
111
+ } | {
112
+ draw: 'url';
113
+ url: string;
114
+ } | {
115
+ draw: 'unreadable';
116
+ reference: string;
117
+ };
118
+ /**
119
+ * How a reader draws one of a message's lines ({@link linesOf}) in `block`:
120
+ * {@link isOnlyReferenceLine}, then the value it names, then whether a card
121
+ * stands for it. `cards` is {@link cardsIn}'s answer (its `none` entries draw
122
+ * no card), `parts` the message's `part` pointers. A Folder alone on its line
123
+ * stays a chip, so its line is a sentence. Whether the reader can read a
124
+ * `row`'s object is its own business: one it cannot draws the unreadable row.
125
+ */
126
+ export declare function lineDrawOf(line: readonly RenderInline[], block: Pick<RenderBlock, 'type'>, context?: {
127
+ cards?: readonly Embed[];
128
+ parts?: readonly PartPointer[];
129
+ resolveLink?: LinkResolver;
130
+ }): LineDraw;
131
+ /**
132
+ * The value a writer gives the default card, `["embed", V, "detailed"]`, as
133
+ * it sends or edits a message (§13.6.2), or undefined.
134
+ *
135
+ * `values` is what the body names, resolved ({@link valuesIn}), and `parts`
136
+ * its `part` pointers. A file counts, except a Folder and `here`, the object
137
+ * whose conversation the message is in (Miky, 2026-10-16: the issue a
138
+ * message is about plus one other file gives the other its card); a part's
139
+ * file counts too. A message (an event id) does not. When exactly one file
140
+ * counts, it gets the card, unless a part names it (the part wins, and draws
141
+ * under the message already).
142
+ *
143
+ * On an edit, pass the values the previous folded body named as `previous`,
144
+ * and the folded `embed` set as `embeds`: the default is only for a file the
145
+ * edit names first, so a card its author removed with ✕ before sending, which
146
+ * left no tag, does not come back, and a value that has an entry keeps it, so
147
+ * a ✕ after sending (`none`) holds even when the link is removed and named
148
+ * again. The edit then carries the whole folded set plus this one
149
+ * ({@link withCard}).
150
+ */
151
+ export declare function defaultCardOf(values: readonly string[], parts?: readonly PartPointer[], options?: {
152
+ here?: string;
153
+ previous?: readonly string[];
154
+ embeds?: readonly Embed[];
155
+ }): string | undefined;
156
+ /**
157
+ * A folded `embed` set with `value` set to `layout`, the rest kept as they
158
+ * are: what an edit carries, since a set replaces (§13.6.2). ✕ on a sent card
159
+ * is `withCard(set, V, 'none')`; adding an edit's default card is
160
+ * `withCard(set, V, 'detailed')`.
161
+ */
162
+ export declare function withCard(set: readonly Embed[], value: string, layout: EmbedLayout): Embed[];
52
163
  /**
53
164
  * The `nostr:` reference an app link names, by what `resolveLink` answered for
54
165
  * it (§7.7), or undefined: nothing claims it, the answer has not come back, or
@@ -70,9 +181,10 @@ export declare function urlRunsIn(text: string): {
70
181
  }[];
71
182
  /**
72
183
  * A message's tree with each bare app link turned into the reference it names,
73
- * so a reader draws it as that object's chip (SPEC §13.6.2, OPT-18).
184
+ * so a reader draws it as a reference to that object (SPEC §13.6.2, OPT-18):
185
+ * its chip in a sentence, its row alone on its line.
74
186
  *
75
- * A reference reads as a chip wherever it sits (§13.1), and a link some app
187
+ * A link some app
76
188
  * claims (§7.7) is a reference written as a URL — the form a message has when
77
189
  * it was written before the composer turned pasted links into chips, or by a
78
190
  * client that does not. Without this, the two would read differently for no
@@ -1 +1 @@
1
- {"version":3,"file":"embeds.d.ts","sourceRoot":"","sources":["../src/embeds.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAA;AAE5D,eAAO,MAAM,SAAS,UAAU,CAAA;AAEhC,2EAA2E;AAC3E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAA;AAEzD,6BAA6B;AAC7B,MAAM,WAAW,KAAK;IACpB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,WAAW,CAAA;CACpB;AAED,yCAAyC;AACzC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAErE;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAA;CAAE,GAAG,KA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;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,CAWnF;AAaD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,WAAW,EAAE,YAAY,GAAG,WAAW,EAAE,CA0C1G"}
package/dist/embeds.js CHANGED
@@ -8,9 +8,11 @@
8
8
  * name: `compact` is §7.5's closed `row` and `detailed` its closed `card`, so
9
9
  * a richer card can come later without changing the wire.
10
10
  *
11
- * A reference with no `embed` is drawn by the reader's default (a chip, §13.1).
12
- * An `embed` for a value overrides that default, which is why `none` exists:
13
- * it is the author saying "no card" in an edit that replaces the set (§6.8).
11
+ * A reference with no `embed` draws by where it sits: its chip in a sentence,
12
+ * its row alone on its line ({@link isOnlyReferenceLine}). A reader never adds
13
+ * a card; the default card is the writer's ({@link defaultCardOf}). An `embed`
14
+ * for a value overrides any default, which is why `none` exists: it is the
15
+ * author saying "no card" in an edit that replaces the set (§6.8).
14
16
  *
15
17
  * Like `part` (§13.6.1), the tags are only half the answer. A card is drawn
16
18
  * only while the body — as edited — still names its value, and there is no
@@ -26,6 +28,26 @@ export const EMBED_TAG = 'embed';
26
28
  export function embedTag(value, layout) {
27
29
  return [EMBED_TAG, value, layout];
28
30
  }
31
+ /**
32
+ * A whole `embed` set as tags, as a send or an edit writes it: each value
33
+ * normalised as {@link embedsOf} reads it, the first entry per value kept.
34
+ * Throws on a value that is neither an address nor an event id, or on a
35
+ * layout this writer does not know, rather than write a tag readers skip.
36
+ */
37
+ export function embedTagsOf(set) {
38
+ const seen = new Set();
39
+ return set.flatMap((e) => {
40
+ const value = normalise(e.value);
41
+ if (!value)
42
+ throw new Error(`not an address or event id: ${e.value}`);
43
+ if (e.layout !== 'compact' && e.layout !== 'detailed' && e.layout !== 'none')
44
+ throw new Error(`not an embed layout: ${String(e.layout)}`);
45
+ if (seen.has(value))
46
+ return [];
47
+ seen.add(value);
48
+ return [embedTag(value, e.layout)];
49
+ });
50
+ }
29
51
  // `partsOf`'s shape: an empty `d` is a valid address (NIP-01).
30
52
  const ADDRESS = /^\d+:[0-9a-f]{64}:/;
31
53
  const EVENT_ID = /^[0-9a-f]{64}$/;
@@ -68,7 +90,6 @@ function normalise(value) {
68
90
  return `${kind}:${pubkey.toLowerCase()}:${d.join(':')}`;
69
91
  }
70
92
  const TRAILING = new Set(['.', ',', ';', ':', '!', '?', ')', ']']);
71
- const URL_RUN = /https?:\/\/[^\s<>"'`]+/g;
72
93
  /** A URL run without the sentence's trailing punctuation; stripped by a loop, which stays linear on a hostile run of dots. */
73
94
  function trimUrl(url) {
74
95
  let end = url.length;
@@ -76,12 +97,15 @@ function trimUrl(url) {
76
97
  end--;
77
98
  return url.slice(0, end);
78
99
  }
79
- /** The http(s) links in a text. Trailing punctuation is the sentence's, not the link's. */
80
- function urlsIn(text) {
81
- return (text.match(URL_RUN) ?? []).map(trimUrl);
100
+ /** A URL stuck to the end of a word (`seehttps://…`) is the word's, not a link. */
101
+ function stuckToWord(text, start) {
102
+ return start > 0 && /[\p{L}\p{N}]/u.test(text[start - 1]);
82
103
  }
83
- /** The address or event id a `nostr:` reference names, or undefined for a person or something unreadable. */
84
- function valueOfReference(reference) {
104
+ /**
105
+ * The address or event id a `nostr:` reference names — what an `a`, `q` or
106
+ * `embed` carries for it — or undefined for a person or something unreadable.
107
+ */
108
+ export function valueOfReference(reference) {
85
109
  const bare = reference.replace(/^nostr:/i, '').toLowerCase();
86
110
  try {
87
111
  if (bare.startsWith('naddr1'))
@@ -120,42 +144,44 @@ export function cardsIn(embeds, blocks, parts = [], resolveLink) {
120
144
  return [];
121
145
  const byValue = new Map(embeds.map((e) => [e.value, e]));
122
146
  const withPart = new Set(parts.map((p) => normalise(p.address)).filter((v) => !!v));
147
+ return valuesIn(blocks, resolveLink).flatMap((value) => {
148
+ const embed = withPart.has(value) ? undefined : byValue.get(value);
149
+ return embed ? [embed] : [];
150
+ });
151
+ }
152
+ /**
153
+ * Every address and event id a message's body names, once each, in the order
154
+ * it first names them: by a `nostr:` reference, or by an app link that
155
+ * `resolveLink` resolves (§7.7). A person names no value. Text in a code span
156
+ * names nothing (§13.1). What {@link cardsIn} and {@link defaultCardOf} count.
157
+ */
158
+ export function valuesIn(blocks, resolveLink) {
123
159
  const out = [];
124
160
  const seen = new Set();
125
161
  const take = (value) => {
126
- if (!value || seen.has(value) || withPart.has(value))
127
- return;
128
- const embed = byValue.get(value);
129
- if (!embed)
162
+ if (!value || seen.has(value))
130
163
  return;
131
164
  seen.add(value);
132
- out.push(embed);
133
- };
134
- // Adjacent plain runs are read as one text, so a link a mark splits in two is still one link.
135
- const scan = (text) => {
136
- if (!resolveLink || !text.includes('://'))
137
- return;
138
- for (const url of urlsIn(text)) {
139
- const value = resolveLink(url);
140
- if (value)
141
- take(normalise(value));
142
- }
165
+ out.push(value);
143
166
  };
167
+ const resolve = (url) => resolveLink && take(normalise(resolveLink(url) ?? ''));
168
+ // Run by run, by the rules {@link linksAsReferences} turns links by, so a URL names a value exactly where it draws as a reference.
144
169
  const walk = (bs) => {
145
170
  for (const block of bs) {
146
171
  if (block.type !== 'codeBlock') {
147
- let text = '';
148
172
  for (const run of block.inline ?? []) {
149
- if (run.reference || run.marks.includes('code')) {
150
- scan(text);
151
- text = '';
152
- if (run.reference)
153
- take(valueOfReference(run.reference));
173
+ if (run.reference)
174
+ take(valueOfReference(run.reference));
175
+ else if (run.marks.includes('code'))
176
+ continue;
177
+ else if (run.href !== undefined) {
178
+ if (run.text === run.href)
179
+ resolve(run.href);
154
180
  }
155
181
  else
156
- text += run.text;
182
+ for (const { url } of urlRunsIn(run.text))
183
+ resolve(url);
157
184
  }
158
- scan(text);
159
185
  }
160
186
  if (block.children)
161
187
  walk(block.children);
@@ -164,6 +190,130 @@ export function cardsIn(embeds, blocks, parts = [], resolveLink) {
164
190
  walk(blocks);
165
191
  return out;
166
192
  }
193
+ /**
194
+ * A block's lines: its inline runs split at each `\n`, the line break both
195
+ * content models use (§13.2). A run that holds a break is cut in two, marks
196
+ * kept; a reference never holds one.
197
+ */
198
+ export function linesOf(block) {
199
+ const lines = [[]];
200
+ for (const run of block.inline ?? []) {
201
+ const pieces = run.reference ? [run.text] : run.text.split('\n');
202
+ pieces.forEach((text, i) => {
203
+ if (i > 0)
204
+ lines.push([]);
205
+ if (text)
206
+ lines[lines.length - 1].push(pieces.length === 1 ? run : { ...run, text });
207
+ });
208
+ }
209
+ return lines;
210
+ }
211
+ const LONE_URL = /^https?:\/\/[^\s<>"'`]+$/;
212
+ const PERSON = /^nostr:(npub1|nprofile1)/i;
213
+ /**
214
+ * What a line of a message is only, by §13.2, or undefined when it is a
215
+ * sentence: the `nostr:` reference, or the bare URL, that §13.6.2 draws in its
216
+ * place. `block` is the block the line is in: only a paragraph's and a list
217
+ * item's lines count, never a quote's, a heading's or code's.
218
+ *
219
+ * Whitespace around it is trimmed. Anything else makes it a sentence: other
220
+ * words or punctuation (trailing `.` included), a second reference, a marker
221
+ * around it, a code span, or `[words](url)`. A person (`npub`, `nprofile`)
222
+ * alone on a line stays a chip, so it is not returned. A Folder stays a chip
223
+ * too, but whether a URL names one is known only once it resolves: the reader
224
+ * checks the value ({@link isFolderValue}). A URL returned here still has to
225
+ * resolve by §7.7; one that resolves to nothing, or to something the reader
226
+ * cannot read, stays the URL as written.
227
+ */
228
+ export function isOnlyReferenceLine(line, block) {
229
+ if (block.type !== 'paragraph' && block.type !== 'listItem')
230
+ return undefined;
231
+ const runs = line.filter((run) => run.reference || run.text.trim() !== '');
232
+ if (runs.length !== 1 || runs[0].marks.length > 0 || runs[0].href !== undefined)
233
+ return undefined;
234
+ const [run] = runs;
235
+ if (run.reference)
236
+ return PERSON.test(run.reference) ? undefined : run.reference;
237
+ const text = run.text.trim();
238
+ return LONE_URL.test(text) && trimUrl(text) === text ? text : undefined;
239
+ }
240
+ /** A Folder's address (`39000:…`): alone on its line it stays a chip, and it never takes the default card (§13.6.2). */
241
+ export function isFolderValue(value) {
242
+ return value.startsWith('39000:');
243
+ }
244
+ /**
245
+ * How a reader draws one of a message's lines ({@link linesOf}) in `block`:
246
+ * {@link isOnlyReferenceLine}, then the value it names, then whether a card
247
+ * stands for it. `cards` is {@link cardsIn}'s answer (its `none` entries draw
248
+ * no card), `parts` the message's `part` pointers. A Folder alone on its line
249
+ * stays a chip, so its line is a sentence. Whether the reader can read a
250
+ * `row`'s object is its own business: one it cannot draws the unreadable row.
251
+ */
252
+ export function lineDrawOf(line, block, context = {}) {
253
+ const only = isOnlyReferenceLine(line, block);
254
+ if (!only)
255
+ return { draw: 'sentence' };
256
+ const isReference = /^nostr:/i.test(only);
257
+ const value = isReference ? valueOfReference(only) : normalise(context.resolveLink?.(only) ?? '');
258
+ if (!value)
259
+ return isReference ? { draw: 'unreadable', reference: only } : { draw: 'url', url: only };
260
+ if (isFolderValue(value))
261
+ return { draw: 'sentence' };
262
+ const carded = (context.cards ?? []).some((e) => e.value === value && e.layout !== 'none') ||
263
+ (context.parts ?? []).some((p) => normalise(p.address) === value);
264
+ return { draw: carded ? 'nothing' : 'row', value };
265
+ }
266
+ /**
267
+ * The value a writer gives the default card, `["embed", V, "detailed"]`, as
268
+ * it sends or edits a message (§13.6.2), or undefined.
269
+ *
270
+ * `values` is what the body names, resolved ({@link valuesIn}), and `parts`
271
+ * its `part` pointers. A file counts, except a Folder and `here`, the object
272
+ * whose conversation the message is in (Miky, 2026-10-16: the issue a
273
+ * message is about plus one other file gives the other its card); a part's
274
+ * file counts too. A message (an event id) does not. When exactly one file
275
+ * counts, it gets the card, unless a part names it (the part wins, and draws
276
+ * under the message already).
277
+ *
278
+ * On an edit, pass the values the previous folded body named as `previous`,
279
+ * and the folded `embed` set as `embeds`: the default is only for a file the
280
+ * edit names first, so a card its author removed with ✕ before sending, which
281
+ * left no tag, does not come back, and a value that has an entry keeps it, so
282
+ * a ✕ after sending (`none`) holds even when the link is removed and named
283
+ * again. The edit then carries the whole folded set plus this one
284
+ * ({@link withCard}).
285
+ */
286
+ export function defaultCardOf(values, parts = [], options = {}) {
287
+ const here = normalise(options.here ?? '');
288
+ const withPart = new Set(parts.map((p) => normalise(p.address)).filter((v) => !!v));
289
+ const isFile = (v) => !!v && ADDRESS.test(v) && !isFolderValue(v) && v !== here;
290
+ const files = new Set([...values.map(normalise), ...withPart].filter(isFile));
291
+ if (files.size !== 1)
292
+ return undefined;
293
+ const [file] = files;
294
+ if (withPart.has(file))
295
+ return undefined;
296
+ if (options.previous?.some((v) => normalise(v) === file))
297
+ return undefined;
298
+ if (options.embeds?.some((e) => normalise(e.value) === file))
299
+ return undefined;
300
+ return file;
301
+ }
302
+ /**
303
+ * A folded `embed` set with `value` set to `layout`, the rest kept as they
304
+ * are: what an edit carries, since a set replaces (§13.6.2). ✕ on a sent card
305
+ * is `withCard(set, V, 'none')`; adding an edit's default card is
306
+ * `withCard(set, V, 'detailed')`.
307
+ */
308
+ export function withCard(set, value, layout) {
309
+ const v = normalise(value);
310
+ if (!v)
311
+ throw new Error(`not an address or event id: ${value}`);
312
+ const out = set.filter((e) => e.value !== v);
313
+ const at = set.findIndex((e) => e.value === v);
314
+ out.splice(at === -1 ? out.length : at, 0, { value: v, layout });
315
+ return out;
316
+ }
167
317
  /**
168
318
  * The `nostr:` reference an app link names, by what `resolveLink` answered for
169
319
  * it (§7.7), or undefined: nothing claims it, the answer has not come back, or
@@ -193,7 +343,7 @@ export function urlRunsIn(text) {
193
343
  return [];
194
344
  const out = [];
195
345
  for (const m of text.matchAll(LINK_OR_URL)) {
196
- if (m[1])
346
+ if (m[1] || stuckToWord(text, m.index))
197
347
  continue;
198
348
  const start = m.index;
199
349
  if (text.slice(Math.max(0, start - 2), start) === '](' || text[start - 1] === '[')
@@ -215,9 +365,10 @@ export function urlRunsIn(text) {
215
365
  const LINK_OR_URL = /(\[[^[\]\n]+\]\((?:https?:\/\/|mailto:)[^\s)]+\))|(https?:\/\/[^\s<>"'`]+)/g;
216
366
  /**
217
367
  * A message's tree with each bare app link turned into the reference it names,
218
- * so a reader draws it as that object's chip (SPEC §13.6.2, OPT-18).
368
+ * so a reader draws it as a reference to that object (SPEC §13.6.2, OPT-18):
369
+ * its chip in a sentence, its row alone on its line.
219
370
  *
220
- * A reference reads as a chip wherever it sits (§13.1), and a link some app
371
+ * A link some app
221
372
  * claims (§7.7) is a reference written as a URL — the form a message has when
222
373
  * it was written before the composer turned pasted links into chips, or by a
223
374
  * client that does not. Without this, the two would read differently for no
@@ -251,7 +402,7 @@ export function linksAsReferences(blocks, resolveLink) {
251
402
  let at = 0;
252
403
  for (const m of run.text.matchAll(LINK_OR_URL)) {
253
404
  // A link on words: neither its target nor a URL in its words is taken.
254
- if (m[1])
405
+ if (m[1] || stuckToWord(run.text, m.index))
255
406
  continue;
256
407
  const start = m.index;
257
408
  // A link on words whose words carry a mark arrives split across runs: its target follows `](`, and a URL as its words follows `[`.
@@ -1 +1 @@
1
- {"version":3,"file":"embeds.js","sourceRoot":"","sources":["../src/embeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAI5G,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAA;AAYhC,yCAAyC;AACzC,MAAM,UAAU,QAAQ,CAAC,KAAa,EAAE,MAAmB;IACzD,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AACnC,CAAC;AAED,+DAA+D;AAC/D,MAAM,OAAO,GAAG,oBAAoB,CAAA;AACpC,MAAM,QAAQ,GAAG,gBAAgB,CAAA;AAEjC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,KAA+C;IACtE,MAAM,GAAG,GAAY,EAAE,C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,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9E,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACnF,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;IACtG,CAAC,CAAC,CAAA;IACJ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;AACrB,CAAC"}
package/dist/events.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type BlockDocument } from './blocks.js';
2
+ import { type Embed } from './embeds.js';
2
3
  /** A Nostr tag: an array of strings whose first element is the tag name. */
3
4
  export type NostrTag = string[];
4
5
  /** An event before signing. `pubkey` is 64-char lowercase hex. */
@@ -471,6 +472,15 @@ export declare function buildEdit(pubkey: string, createdAtMs: number, args: {
471
472
  targetEventId: string;
472
473
  /** The new body, in the target's own format. */
473
474
  body: string;
475
+ /**
476
+ * The message's whole `embed` set after this edit, when the edit changes it
477
+ * (SPEC §13.6.2): a set replaces, so every card it keeps is listed, and
478
+ * `none` for each it removes (`withCard`). Omitted or empty, the edit
479
+ * carries none and leaves the set as it was.
480
+ */
481
+ embeds?: readonly Embed[];
482
+ /** The whole `imeta` set after this edit, when it changes it; it folds the same way (§6.8). */
483
+ mediaTags?: NostrTag[];
474
484
  }): UnsignedEvent;
475
485
  /**
476
486
  * NIP-10 reply context.
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.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AM,CAAA;IACjB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,aAAa,CAWhB"}
package/dist/events.js CHANGED
@@ -35,6 +35,7 @@
35
35
  import { sha256 } from '@noble/hashes/sha256';
36
36
  import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils';
37
37
  import { serializeBlockDocument } from './blocks.js';
38
+ import { embedTagsOf } from './embeds.js';
38
39
  /**
39
40
  * Buzz kind numbers used across the suite (crates/buzz-core/src/kind.rs).
40
41
  *
@@ -635,6 +636,8 @@ export function buildEdit(pubkey, createdAtMs, args) {
635
636
  // and a rounded `ts` could land in the next second and be discarded by
636
637
  // its own agreement rule.
637
638
  ['ts', String(Math.floor(createdAtMs))],
639
+ ...embedTagsOf(args.embeds ?? []),
640
+ ...(args.mediaTags ?? []),
638
641
  ],
639
642
  content: args.body,
640
643
  };
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAsB,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAoBxE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,IAAI;IACpB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,kBAAkB,EAAE,IAAI;IACxB;;;;OAIG;IACH,cAAc,EAAE,IAAI;IACpB;;;;;;;;;;OAUG;IACH,SAAS,EAAE,IAAI;IACf;;;;;;;;OAQG;IACH,OAAO,EAAE,IAAI;IACb,wBAAwB;I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the two together. It exists so "the upgrade reached the app" can be
48
48
  * checked by grepping a built bundle rather than by trusting a lockfile. */
49
- export declare const PROTOCOL_VERSION = "0.37.0";
49
+ export declare const PROTOCOL_VERSION = "0.38.0";
50
50
  export { type NostrTag, type UnsignedEvent, type SignedEvent, type Profile, type ThreadRef, type ChannelVisibility, type ChannelKind, type MemberRole, type FolderOp, type Label, type ResolutionAction, KIND, MAX_EMOJI_CHARS, MAX_MESSAGE_BYTES, MAX_MENTIONS, MAX_DM_OTHERS, MAX_RATIONALE_BYTES, RELAY_AUTH_TOLERANCE_SECS, ASSERTION_SUBTYPE, computeEventId, toNostrSeconds, canonicalChannelName, threadTags, addr, relayAuthUrl, buildProfile, parseProfile, buildCreateChannel, buildDeleteChannel, buildEditChannelMetadata, buildFolderCommand, buildAddMember, buildDmOpen, buildDmHide, buildReaction, buildDeletion, buildEdit, buildMessage, buildResolution, buildBareFile, buildDocument, buildHighlight, buildUnsignedRelayAuthEvent, } from './events.js';
51
51
  export { type AddressPointer, type EventPointer, encodeNevent, decodeNevent, convertBits, bech32Encode, bech32Decode, encodeNaddr, decodeNaddr, pointerToAddress, addressToPointer, addrToNaddr, naddrToAddr, referenceToPointer, NADDR_RE, findNaddrs, stripNaddrs, encodeNpub, decodeNpub, NOSTR_URI_RE, findNostrUris, } from './nip19.js';
52
52
  export { type AuthEventArgs, TIMESTAMP_TOLERANCE_SECS, normalizeUrl, buildUnsignedAuthEvent, base64, authorizationHeaderFor, authorizationHeader, } from './nip98.js';
@@ -62,6 +62,6 @@ export { descriptionTextToBlockDocument, tableToDescriptionText } from './descri
62
62
  export { type EditorNode, type EditorDocument, EDITOR_BLOCK_TYPES, UNKNOWN_BLOCK_NODE, REFERENCE_NODE, documentForEditing, toEditorDocument, fromEditorDocument, publishableFromEditor, } from './editor.js';
63
63
  export { type BlockAnchor, type Part, type PartPointer, type PartSource, BLOCK_ANCHOR_TAG, PART_TAG, absenceOf, blockAnchorOf, partTag, partsOf, resolveBlockAnchor, resolvePart, } from './anchors.js';
64
64
  export { type CommentAnchor, type Quote, type TextPoint, MAX_RUN_ENTRIES_READ, MAX_RUN_IDS, QUOTE_CONTEXT_LENGTH, QUOTE_END_LENGTH, QUOTE_TAG, QUOTE_WHOLE_MAX, blockRunOf, blockRunTag, quoteOf, quoteTag, readRunIds, resolveBlockRun, resolveCommentAnchor, selectionAnchorTags, } from './comment-anchor.js';
65
- export { type Embed, type EmbedLayout, type LinkResolver, EMBED_TAG, cardsIn, embedTag, embedsOf, linksAsReferences, referenceOfLink, urlRunsIn } from './embeds.js';
65
+ export { type Embed, type EmbedLayout, type LineDraw, type LinkResolver, EMBED_TAG, cardsIn, defaultCardOf, embedTag, embedTagsOf, embedsOf, isFolderValue, isOnlyReferenceLine, lineDrawOf, linesOf, linksAsReferences, referenceOfLink, urlRunsIn, valueOfReference, valuesIn, withCard, } from './embeds.js';
66
66
  export { type BlossomVerb, type Imeta, BLOSSOM_AUTH_TTL_SECS, buildBlossomAuth, blossomAuthHeader, imetaTag, imetaOf, imetaFromAttrs, attachmentsInDocument, type BlobFetchLike, type BlobResponseLike, type FetchedBlob, sha256FromMediaUrl, fetchBlob, sha256Of, uploadBlob, imetaFor, canonicalizeImage, type UploadedBlob, type BlobUploadFetchLike, } from './media.js';
67
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH;;4EAE4E;AAC5E,eAAO,MAAM,gBAAgB,WAAW,CAAA;AAExC,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,gBAAgB,EAErB,I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BAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,WAAW,GACZ,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACpK,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH;;4EAE4E;AAC5E,eAA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d,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@
46
46
  /** Bumped by hand with the version in package.json — `test/version.test.ts`
47
47
  * pins the two together. It exists so "the upgrade reached the app" can be
48
48
  * checked by grepping a built bundle rather than by trusting a lockfile. */
49
- export const PROTOCOL_VERSION = '0.37.0';
49
+ export const PROTOCOL_VERSION = '0.38.0';
50
50
  export {
51
51
  // constants
52
52
  KIND, MAX_EMOJI_CHARS, MAX_MESSAGE_BYTES, MAX_MENTIONS, MAX_DM_OTHERS, MAX_RATIONALE_BYTES, RELAY_AUTH_TOLERANCE_SECS, ASSERTION_SUBTYPE,
@@ -68,6 +68,6 @@ export { descriptionTextToBlockDocument, tableToDescriptionText } from './descri
68
68
  export { EDITOR_BLOCK_TYPES, UNKNOWN_BLOCK_NODE, REFERENCE_NODE, documentForEditing, toEditorDocument, fromEditorDocument, publishableFromEditor, } from './editor.js';
69
69
  export { BLOCK_ANCHOR_TAG, PART_TAG, absenceOf, blockAnchorOf, partTag, partsOf, resolveBlockAnchor, resolvePart, } from './anchors.js';
70
70
  export { MAX_RUN_ENTRIES_READ, MAX_RUN_IDS, QUOTE_CONTEXT_LENGTH, QUOTE_END_LENGTH, QUOTE_TAG, QUOTE_WHOLE_MAX, blockRunOf, blockRunTag, quoteOf, quoteTag, readRunIds, resolveBlockRun, resolveCommentAnchor, selectionAnchorTags, } from './comment-anchor.js';
71
- export { EMBED_TAG, cardsIn, embedTag, embedsOf, linksAsReferences, referenceOfLink, urlRunsIn } from './embeds.js';
71
+ export { EMBED_TAG, cardsIn, defaultCardOf, embedTag, embedTagsOf, embedsOf, isFolderValue, isOnlyReferenceLine, lineDrawOf, linesOf, linksAsReferences, referenceOfLink, urlRunsIn, valueOfReference, valuesIn, withCard, } from './embeds.js';
72
72
  export { BLOSSOM_AUTH_TTL_SECS, buildBlossomAuth, blossomAuthHeader, imetaTag, imetaOf, imetaFromAttrs, attachmentsInDocument, sha256FromMediaUrl, fetchBlob, sha256Of, uploadBlob, imetaFor, canonicalizeImage, } from './media.js';
73
73
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH;;4EAE4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAA;AAExC,OAAO;AAaL,YAAY;AACZ,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB;AACjB,8CAA8C;AAC9C,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,IAAI,EACJ,YAAY;AACZ,WAAW;AACX,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,cAAc,EACd,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AAEpB,OAAO,EAGL,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAA;AAEnB,OAAO,EAEL,wBAAwB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,cAAc,EACd,mBAAmB,EACnB,YAAY,EAEZ,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAE1B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAE9F,OAAO,EAGL,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAKL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,WAAW,GACZ,MAAM,cAAc,CAAA;AACrB,OAAO,EAIL,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAKL,SAAS,EACT,OAAO,EACP,aAAa,EACb,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,OAAO,EAGL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,cAAc,EACd,qBAAqB,EAIrB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,iBAAiB,GAGlB,MAAM,YAAY,CAAA"}
package/dist/render.d.ts CHANGED
@@ -179,11 +179,11 @@ export declare function renderTreeText(blocks: readonly RenderBlock[]): string;
179
179
  * on its line is alone on its line whether or not somebody left a space after
180
180
  * it.
181
181
  *
182
- * @deprecated Since 0.33.0 a reference reads as its chip wherever it sits, in a
183
- * message (§13.6.2) and in a block document (§13.3, "A reference's card"); a
184
- * card comes only from what its writer chose. Use {@link blockCards} for a
185
- * document and `cardsIn` for a message. Kept for one release so a reader on it
186
- * still builds.
182
+ * @deprecated A whole paragraph is not the unit: since 0.38.0 a message's line
183
+ * that is only a reference draws its row (§13.2, §13.6.2), which
184
+ * `isOnlyReferenceLine` decides per line, list items and app URLs included. A
185
+ * block document reads a reference as its chip (§13.3); use {@link blockCards}
186
+ * for its cards.
187
187
  */
188
188
  export declare function standaloneReference(block: RenderBlock): string | undefined;
189
189
  /**
package/dist/render.js CHANGED
@@ -241,11 +241,11 @@ export function renderTreeText(blocks) {
241
241
  * on its line is alone on its line whether or not somebody left a space after
242
242
  * it.
243
243
  *
244
- * @deprecated Since 0.33.0 a reference reads as its chip wherever it sits, in a
245
- * message (§13.6.2) and in a block document (§13.3, "A reference's card"); a
246
- * card comes only from what its writer chose. Use {@link blockCards} for a
247
- * document and `cardsIn` for a message. Kept for one release so a reader on it
248
- * still builds.
244
+ * @deprecated A whole paragraph is not the unit: since 0.38.0 a message's line
245
+ * that is only a reference draws its row (§13.2, §13.6.2), which
246
+ * `isOnlyReferenceLine` decides per line, list items and app URLs included. A
247
+ * block document reads a reference as its chip (§13.3); use {@link blockCards}
248
+ * for its cards.
249
249
  */
250
250
  export function standaloneReference(block) {
251
251
  if (block.type !== 'paragraph' || block.children?.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/protocol",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "The Estiva wire format: Buzz-shaped Nostr event builders, NIP-01 ids, NIP-19 naddr, NIP-98 HTTP auth, and the relay clients. Speaks the protocol; interprets nothing.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/embeds.ts CHANGED
@@ -8,9 +8,11 @@
8
8
  * name: `compact` is §7.5's closed `row` and `detailed` its closed `card`, so
9
9
  * a richer card can come later without changing the wire.
10
10
  *
11
- * A reference with no `embed` is drawn by the reader's default (a chip, §13.1).
12
- * An `embed` for a value overrides that default, which is why `none` exists:
13
- * it is the author saying "no card" in an edit that replaces the set (§6.8).
11
+ * A reference with no `embed` draws by where it sits: its chip in a sentence,
12
+ * its row alone on its line ({@link isOnlyReferenceLine}). A reader never adds
13
+ * a card; the default card is the writer's ({@link defaultCardOf}). An `embed`
14
+ * for a value overrides any default, which is why `none` exists: it is the
15
+ * author saying "no card" in an edit that replaces the set (§6.8).
14
16
  *
15
17
  * Like `part` (§13.6.1), the tags are only half the answer. A card is drawn
16
18
  * only while the body — as edited — still names its value, and there is no
@@ -41,6 +43,24 @@ export function embedTag(value: string, layout: EmbedLayout): string[] {
41
43
  return [EMBED_TAG, value, layout]
42
44
  }
43
45
 
46
+ /**
47
+ * A whole `embed` set as tags, as a send or an edit writes it: each value
48
+ * normalised as {@link embedsOf} reads it, the first entry per value kept.
49
+ * Throws on a value that is neither an address nor an event id, or on a
50
+ * layout this writer does not know, rather than write a tag readers skip.
51
+ */
52
+ export function embedTagsOf(set: readonly Embed[]): string[][] {
53
+ const seen = new Set<string>()
54
+ return set.flatMap((e) => {
55
+ const value = normalise(e.value)
56
+ if (!value) throw new Error(`not an address or event id: ${e.value}`)
57
+ if (e.layout !== 'compact' && e.layout !== 'detailed' && e.layout !== 'none') throw new Error(`not an embed layout: ${String(e.layout)}`)
58
+ if (seen.has(value)) return []
59
+ seen.add(value)
60
+ return [embedTag(value, e.layout)]
61
+ })
62
+ }
63
+
44
64
  // `partsOf`'s shape: an empty `d` is a valid address (NIP-01).
45
65
  const ADDRESS = /^\d+:[0-9a-f]{64}:/
46
66
  const EVENT_ID = /^[0-9a-f]{64}$/
@@ -92,7 +112,6 @@ function normalise(value: string): string | undefined {
92
112
  export type LinkResolver = (url: string) => string | undefined
93
113
 
94
114
  const TRAILING = new Set(['.', ',', ';', ':', '!', '?', ')', ']'])
95
- const URL_RUN = /https?:\/\/[^\s<>"'`]+/g
96
115
 
97
116
  /** A URL run without the sentence's trailing punctuation; stripped by a loop, which stays linear on a hostile run of dots. */
98
117
  function trimUrl(url: string): string {
@@ -101,13 +120,16 @@ function trimUrl(url: string): string {
101
120
  return url.slice(0, end)
102
121
  }
103
122
 
104
- /** The http(s) links in a text. Trailing punctuation is the sentence's, not the link's. */
105
- function urlsIn(text: string): string[] {
106
- return (text.match(URL_RUN) ?? []).map(trimUrl)
123
+ /** A URL stuck to the end of a word (`seehttps://…`) is the word's, not a link. */
124
+ function stuckToWord(text: string, start: number): boolean {
125
+ return start > 0 && /[\p{L}\p{N}]/u.test(text[start - 1])
107
126
  }
108
127
 
109
- /** The address or event id a `nostr:` reference names, or undefined for a person or something unreadable. */
110
- function valueOfReference(reference: string): string | undefined {
128
+ /**
129
+ * The address or event id a `nostr:` reference names — what an `a`, `q` or
130
+ * `embed` carries for it — or undefined for a person or something unreadable.
131
+ */
132
+ export function valueOfReference(reference: string): string | undefined {
111
133
  const bare = reference.replace(/^nostr:/i, '').toLowerCase()
112
134
  try {
113
135
  if (bare.startsWith('naddr1')) return normalise(naddrToAddr(bare))
@@ -142,35 +164,38 @@ export function cardsIn(embeds: readonly Embed[], blocks: readonly RenderBlock[]
142
164
  if (embeds.length === 0) return []
143
165
  const byValue = new Map(embeds.map((e) => [e.value, e]))
144
166
  const withPart = new Set(parts.map((p) => normalise(p.address)).filter((v): v is string => !!v))
145
- const out: Embed[] = []
167
+ return valuesIn(blocks, resolveLink).flatMap((value) => {
168
+ const embed = withPart.has(value) ? undefined : byValue.get(value)
169
+ return embed ? [embed] : []
170
+ })
171
+ }
172
+
173
+ /**
174
+ * Every address and event id a message's body names, once each, in the order
175
+ * it first names them: by a `nostr:` reference, or by an app link that
176
+ * `resolveLink` resolves (§7.7). A person names no value. Text in a code span
177
+ * names nothing (§13.1). What {@link cardsIn} and {@link defaultCardOf} count.
178
+ */
179
+ export function valuesIn(blocks: readonly RenderBlock[], resolveLink?: LinkResolver): string[] {
180
+ const out: string[] = []
146
181
  const seen = new Set<string>()
147
182
  const take = (value: string | undefined) => {
148
- if (!value || seen.has(value) || withPart.has(value)) return
149
- const embed = byValue.get(value)
150
- if (!embed) return
183
+ if (!value || seen.has(value)) return
151
184
  seen.add(value)
152
- out.push(embed)
153
- }
154
- // Adjacent plain runs are read as one text, so a link a mark splits in two is still one link.
155
- const scan = (text: string) => {
156
- if (!resolveLink || !text.includes('://')) return
157
- for (const url of urlsIn(text)) {
158
- const value = resolveLink(url)
159
- if (value) take(normalise(value))
160
- }
185
+ out.push(value)
161
186
  }
187
+ const resolve = (url: string) => resolveLink && take(normalise(resolveLink(url) ?? ''))
188
+ // Run by run, by the rules {@link linksAsReferences} turns links by, so a URL names a value exactly where it draws as a reference.
162
189
  const walk = (bs: readonly RenderBlock[]) => {
163
190
  for (const block of bs) {
164
191
  if (block.type !== 'codeBlock') {
165
- let text = ''
166
192
  for (const run of block.inline ?? []) {
167
- if (run.reference || run.marks.includes('code')) {
168
- scan(text)
169
- text = ''
170
- if (run.reference) take(valueOfReference(run.reference))
171
- } else text += run.text
193
+ if (run.reference) take(valueOfReference(run.reference))
194
+ else if (run.marks.includes('code')) continue
195
+ else if (run.href !== undefined) {
196
+ if (run.text === run.href) resolve(run.href)
197
+ } else for (const { url } of urlRunsIn(run.text)) resolve(url)
172
198
  }
173
- scan(text)
174
199
  }
175
200
  if (block.children) walk(block.children)
176
201
  }
@@ -179,6 +204,150 @@ export function cardsIn(embeds: readonly Embed[], blocks: readonly RenderBlock[]
179
204
  return out
180
205
  }
181
206
 
207
+ /**
208
+ * A block's lines: its inline runs split at each `\n`, the line break both
209
+ * content models use (§13.2). A run that holds a break is cut in two, marks
210
+ * kept; a reference never holds one.
211
+ */
212
+ export function linesOf(block: Pick<RenderBlock, 'inline'>): RenderInline[][] {
213
+ const lines: RenderInline[][] = [[]]
214
+ for (const run of block.inline ?? []) {
215
+ const pieces = run.reference ? [run.text] : run.text.split('\n')
216
+ pieces.forEach((text, i) => {
217
+ if (i > 0) lines.push([])
218
+ if (text) lines[lines.length - 1].push(pieces.length === 1 ? run : { ...run, text })
219
+ })
220
+ }
221
+ return lines
222
+ }
223
+
224
+ const LONE_URL = /^https?:\/\/[^\s<>"'`]+$/
225
+ const PERSON = /^nostr:(npub1|nprofile1)/i
226
+
227
+ /**
228
+ * What a line of a message is only, by §13.2, or undefined when it is a
229
+ * sentence: the `nostr:` reference, or the bare URL, that §13.6.2 draws in its
230
+ * place. `block` is the block the line is in: only a paragraph's and a list
231
+ * item's lines count, never a quote's, a heading's or code's.
232
+ *
233
+ * Whitespace around it is trimmed. Anything else makes it a sentence: other
234
+ * words or punctuation (trailing `.` included), a second reference, a marker
235
+ * around it, a code span, or `[words](url)`. A person (`npub`, `nprofile`)
236
+ * alone on a line stays a chip, so it is not returned. A Folder stays a chip
237
+ * too, but whether a URL names one is known only once it resolves: the reader
238
+ * checks the value ({@link isFolderValue}). A URL returned here still has to
239
+ * resolve by §7.7; one that resolves to nothing, or to something the reader
240
+ * cannot read, stays the URL as written.
241
+ */
242
+ export function isOnlyReferenceLine(line: readonly RenderInline[], block: Pick<RenderBlock, 'type'>): string | undefined {
243
+ if (block.type !== 'paragraph' && block.type !== 'listItem') return undefined
244
+ const runs = line.filter((run) => run.reference || run.text.trim() !== '')
245
+ if (runs.length !== 1 || runs[0].marks.length > 0 || runs[0].href !== undefined) return undefined
246
+ const [run] = runs
247
+ if (run.reference) return PERSON.test(run.reference) ? undefined : run.reference
248
+ const text = run.text.trim()
249
+ return LONE_URL.test(text) && trimUrl(text) === text ? text : undefined
250
+ }
251
+
252
+ /** A Folder's address (`39000:…`): alone on its line it stays a chip, and it never takes the default card (§13.6.2). */
253
+ export function isFolderValue(value: string): boolean {
254
+ return value.startsWith('39000:')
255
+ }
256
+
257
+ /**
258
+ * What one line of a message draws (§13.2, §13.6.2):
259
+ * - `sentence` — its runs as they are, each reference its chip;
260
+ * - `row` — the line is only a reference to `value`, drawn as its row;
261
+ * - `nothing` — the same, but `value` has a card or a part under the message,
262
+ * which stands for it (C26);
263
+ * - `url` — a lone URL that names nothing (no app claims it, or the answer has
264
+ * not come back), drawn as the URL as written;
265
+ * - `unreadable` — a lone `nostr:` reference that names no address or event
266
+ * id, drawn as the unreadable row.
267
+ */
268
+ export type LineDraw =
269
+ | { draw: 'sentence' }
270
+ | { draw: 'row' | 'nothing'; value: string }
271
+ | { draw: 'url'; url: string }
272
+ | { draw: 'unreadable'; reference: string }
273
+
274
+ /**
275
+ * How a reader draws one of a message's lines ({@link linesOf}) in `block`:
276
+ * {@link isOnlyReferenceLine}, then the value it names, then whether a card
277
+ * stands for it. `cards` is {@link cardsIn}'s answer (its `none` entries draw
278
+ * no card), `parts` the message's `part` pointers. A Folder alone on its line
279
+ * stays a chip, so its line is a sentence. Whether the reader can read a
280
+ * `row`'s object is its own business: one it cannot draws the unreadable row.
281
+ */
282
+ export function lineDrawOf(
283
+ line: readonly RenderInline[],
284
+ block: Pick<RenderBlock, 'type'>,
285
+ context: { cards?: readonly Embed[]; parts?: readonly PartPointer[]; resolveLink?: LinkResolver } = {},
286
+ ): LineDraw {
287
+ const only = isOnlyReferenceLine(line, block)
288
+ if (!only) return { draw: 'sentence' }
289
+ const isReference = /^nostr:/i.test(only)
290
+ const value = isReference ? valueOfReference(only) : normalise(context.resolveLink?.(only) ?? '')
291
+ if (!value) return isReference ? { draw: 'unreadable', reference: only } : { draw: 'url', url: only }
292
+ if (isFolderValue(value)) return { draw: 'sentence' }
293
+ const carded =
294
+ (context.cards ?? []).some((e) => e.value === value && e.layout !== 'none') ||
295
+ (context.parts ?? []).some((p) => normalise(p.address) === value)
296
+ return { draw: carded ? 'nothing' : 'row', value }
297
+ }
298
+
299
+ /**
300
+ * The value a writer gives the default card, `["embed", V, "detailed"]`, as
301
+ * it sends or edits a message (§13.6.2), or undefined.
302
+ *
303
+ * `values` is what the body names, resolved ({@link valuesIn}), and `parts`
304
+ * its `part` pointers. A file counts, except a Folder and `here`, the object
305
+ * whose conversation the message is in (Miky, 2026-10-16: the issue a
306
+ * message is about plus one other file gives the other its card); a part's
307
+ * file counts too. A message (an event id) does not. When exactly one file
308
+ * counts, it gets the card, unless a part names it (the part wins, and draws
309
+ * under the message already).
310
+ *
311
+ * On an edit, pass the values the previous folded body named as `previous`,
312
+ * and the folded `embed` set as `embeds`: the default is only for a file the
313
+ * edit names first, so a card its author removed with ✕ before sending, which
314
+ * left no tag, does not come back, and a value that has an entry keeps it, so
315
+ * a ✕ after sending (`none`) holds even when the link is removed and named
316
+ * again. The edit then carries the whole folded set plus this one
317
+ * ({@link withCard}).
318
+ */
319
+ export function defaultCardOf(
320
+ values: readonly string[],
321
+ parts: readonly PartPointer[] = [],
322
+ options: { here?: string; previous?: readonly string[]; embeds?: readonly Embed[] } = {},
323
+ ): string | undefined {
324
+ const here = normalise(options.here ?? '')
325
+ const withPart = new Set(parts.map((p) => normalise(p.address)).filter((v): v is string => !!v))
326
+ const isFile = (v: string | undefined): v is string => !!v && ADDRESS.test(v) && !isFolderValue(v) && v !== here
327
+ const files = new Set([...values.map(normalise), ...withPart].filter(isFile))
328
+ if (files.size !== 1) return undefined
329
+ const [file] = files
330
+ if (withPart.has(file)) return undefined
331
+ if (options.previous?.some((v) => normalise(v) === file)) return undefined
332
+ if (options.embeds?.some((e) => normalise(e.value) === file)) return undefined
333
+ return file
334
+ }
335
+
336
+ /**
337
+ * A folded `embed` set with `value` set to `layout`, the rest kept as they
338
+ * are: what an edit carries, since a set replaces (§13.6.2). ✕ on a sent card
339
+ * is `withCard(set, V, 'none')`; adding an edit's default card is
340
+ * `withCard(set, V, 'detailed')`.
341
+ */
342
+ export function withCard(set: readonly Embed[], value: string, layout: EmbedLayout): Embed[] {
343
+ const v = normalise(value)
344
+ if (!v) throw new Error(`not an address or event id: ${value}`)
345
+ const out = set.filter((e) => e.value !== v)
346
+ const at = set.findIndex((e) => e.value === v)
347
+ out.splice(at === -1 ? out.length : at, 0, { value: v, layout })
348
+ return out
349
+ }
350
+
182
351
  /**
183
352
  * The `nostr:` reference an app link names, by what `resolveLink` answered for
184
353
  * it (§7.7), or undefined: nothing claims it, the answer has not come back, or
@@ -206,7 +375,7 @@ export function urlRunsIn(text: string): { url: string; from: number; to: number
206
375
  if (!text.includes('://')) return []
207
376
  const out: { url: string; from: number; to: number }[] = []
208
377
  for (const m of text.matchAll(LINK_OR_URL)) {
209
- if (m[1]) continue
378
+ if (m[1] || stuckToWord(text, m.index)) continue
210
379
  const start = m.index
211
380
  if (text.slice(Math.max(0, start - 2), start) === '](' || text[start - 1] === '[') continue
212
381
  const url = trimUrl(m[0])
@@ -228,9 +397,10 @@ const LINK_OR_URL = /(\[[^[\]\n]+\]\((?:https?:\/\/|mailto:)[^\s)]+\))|(https?:\
228
397
 
229
398
  /**
230
399
  * A message's tree with each bare app link turned into the reference it names,
231
- * so a reader draws it as that object's chip (SPEC §13.6.2, OPT-18).
400
+ * so a reader draws it as a reference to that object (SPEC §13.6.2, OPT-18):
401
+ * its chip in a sentence, its row alone on its line.
232
402
  *
233
- * A reference reads as a chip wherever it sits (§13.1), and a link some app
403
+ * A link some app
234
404
  * claims (§7.7) is a reference written as a URL — the form a message has when
235
405
  * it was written before the composer turned pasted links into chips, or by a
236
406
  * client that does not. Without this, the two would read differently for no
@@ -262,7 +432,7 @@ export function linksAsReferences(blocks: readonly RenderBlock[], resolveLink: L
262
432
  let at = 0
263
433
  for (const m of run.text.matchAll(LINK_OR_URL)) {
264
434
  // A link on words: neither its target nor a URL in its words is taken.
265
- if (m[1]) continue
435
+ if (m[1] || stuckToWord(run.text, m.index)) continue
266
436
  const start = m.index
267
437
  // A link on words whose words carry a mark arrives split across runs: its target follows `](`, and a URL as its words follows `[`.
268
438
  if (run.text.slice(Math.max(0, start - 2), start) === '](' || run.text[start - 1] === '[') continue
package/src/events.ts CHANGED
@@ -35,6 +35,7 @@
35
35
  import { sha256 } from '@noble/hashes/sha256'
36
36
  import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils'
37
37
  import { type BlockDocument, serializeBlockDocument } from './blocks.js'
38
+ import { type Embed, embedTagsOf } from './embeds.js'
38
39
 
39
40
  /** A Nostr tag: an array of strings whose first element is the tag name. */
40
41
  export type NostrTag = string[]
@@ -716,6 +717,15 @@ export function buildEdit(
716
717
  targetEventId: string
717
718
  /** The new body, in the target's own format. */
718
719
  body: string
720
+ /**
721
+ * The message's whole `embed` set after this edit, when the edit changes it
722
+ * (SPEC §13.6.2): a set replaces, so every card it keeps is listed, and
723
+ * `none` for each it removes (`withCard`). Omitted or empty, the edit
724
+ * carries none and leaves the set as it was.
725
+ */
726
+ embeds?: readonly Embed[]
727
+ /** The whole `imeta` set after this edit, when it changes it; it folds the same way (§6.8). */
728
+ mediaTags?: NostrTag[]
719
729
  },
720
730
  ): UnsignedEvent {
721
731
  assertHex64(pubkey, 'pubkey')
@@ -735,6 +745,8 @@ export function buildEdit(
735
745
  // and a rounded `ts` could land in the next second and be discarded by
736
746
  // its own agreement rule.
737
747
  ['ts', String(Math.floor(createdAtMs))],
748
+ ...embedTagsOf(args.embeds ?? []),
749
+ ...(args.mediaTags ?? []),
738
750
  ],
739
751
  content: args.body,
740
752
  }
package/src/index.ts CHANGED
@@ -47,7 +47,7 @@
47
47
  /** Bumped by hand with the version in package.json — `test/version.test.ts`
48
48
  * pins the two together. It exists so "the upgrade reached the app" can be
49
49
  * checked by grepping a built bundle rather than by trusting a lockfile. */
50
- export const PROTOCOL_VERSION = '0.37.0'
50
+ export const PROTOCOL_VERSION = '0.38.0'
51
51
 
52
52
  export {
53
53
  // types
@@ -284,7 +284,28 @@ export {
284
284
  resolveCommentAnchor,
285
285
  selectionAnchorTags,
286
286
  } from './comment-anchor.js'
287
- export { type Embed, type EmbedLayout, type LinkResolver, EMBED_TAG, cardsIn, embedTag, embedsOf, linksAsReferences, referenceOfLink, urlRunsIn } from './embeds.js'
287
+ export {
288
+ type Embed,
289
+ type EmbedLayout,
290
+ type LineDraw,
291
+ type LinkResolver,
292
+ EMBED_TAG,
293
+ cardsIn,
294
+ defaultCardOf,
295
+ embedTag,
296
+ embedTagsOf,
297
+ embedsOf,
298
+ isFolderValue,
299
+ isOnlyReferenceLine,
300
+ lineDrawOf,
301
+ linesOf,
302
+ linksAsReferences,
303
+ referenceOfLink,
304
+ urlRunsIn,
305
+ valueOfReference,
306
+ valuesIn,
307
+ withCard,
308
+ } from './embeds.js'
288
309
  export {
289
310
  type BlossomVerb,
290
311
  type Imeta,
package/src/render.ts CHANGED
@@ -349,11 +349,11 @@ export function renderTreeText(blocks: readonly RenderBlock[]): string {
349
349
  * on its line is alone on its line whether or not somebody left a space after
350
350
  * it.
351
351
  *
352
- * @deprecated Since 0.33.0 a reference reads as its chip wherever it sits, in a
353
- * message (§13.6.2) and in a block document (§13.3, "A reference's card"); a
354
- * card comes only from what its writer chose. Use {@link blockCards} for a
355
- * document and `cardsIn` for a message. Kept for one release so a reader on it
356
- * still builds.
352
+ * @deprecated A whole paragraph is not the unit: since 0.38.0 a message's line
353
+ * that is only a reference draws its row (§13.2, §13.6.2), which
354
+ * `isOnlyReferenceLine` decides per line, list items and app URLs included. A
355
+ * block document reads a reference as its chip (§13.3); use {@link blockCards}
356
+ * for its cards.
357
357
  */
358
358
  export function standaloneReference(block: RenderBlock): string | undefined {
359
359
  if (block.type !== 'paragraph' || block.children?.length) return undefined