@estiva-app/protocol 0.46.1 → 0.47.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,22 @@ 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.47.0 — 2026-10-30
8
+
9
+ **Wire behaviour: nothing an app publishes changes** (SPEC §13.6.1, "Five
10
+ states, and deleted is not not-permitted"; widget review, item 56). Telling a
11
+ deleted file from one the reader may not see, once for every app, so a card
12
+ can say "deleted" rather than "not available" as a part already can. New:
13
+ `absenceFilters(address)`, the read §13.6.1 asks for — `{kinds: [5], "#a":
14
+ [address]}`, and the same of the address's author alone, so other members'
15
+ deletions naming the address further along cannot fill the window and push
16
+ the author's own out (Ship's part read asked it so; Peek's asked only the
17
+ first). `readAbsence(address, query)` asks it through the app's own read and
18
+ answers `deleted` or `unreadable`; a failed read throws. `absenceOf` takes
19
+ `{ relayChecksOwner: false }` for a relay that does not apply §6.5's check,
20
+ where only the author's own deletions count. A value that is not an address
21
+ (an artifact's id) asks nothing and reads `unreadable`.
22
+
7
23
  ## 0.46.1 — 2026-10-28
8
24
 
9
25
  **Wire behaviour: fewer asks of a busy or rate-limited relay; nothing an app
package/dist/anchors.d.ts CHANGED
@@ -156,27 +156,63 @@ export type PartSource = {
156
156
  } | 'deleted' | 'unreadable';
157
157
  /** Which of the five states a part is in, against its object as it is now. */
158
158
  export declare function resolvePart(block: string, source: PartSource): Part;
159
+ /** A deletion as {@link absenceOf} reads it: its kind, its signer and its tags. */
160
+ export interface DeletionEvent {
161
+ kind: number;
162
+ pubkey: string;
163
+ tags: string[][];
164
+ }
165
+ export interface AbsenceOptions {
166
+ /**
167
+ * Whether the relay applies §6.5's check to a deletion: Buzz does, so the
168
+ * default is true. On a relay that does not, only the author's own deletions
169
+ * count (§13.6.1).
170
+ */
171
+ relayChecksOwner?: boolean;
172
+ }
159
173
  /**
160
174
  * Why a read by address came back empty: `deleted` when the relay holds a
161
175
  * deletion of it by address (a `kind:5` with that `a`), else `unreadable`.
162
176
  *
163
- * `deletions` is what `{kinds: [5], "#a": [address]}` returned. A deletion
164
- * counts when either holds:
177
+ * `deletions` is what {@link absenceFilters} returned — `{kinds: [5], "#a":
178
+ * [address]}` — and may hold deletions of other addresses too, so one read
179
+ * can answer for several. A deletion counts when either holds:
165
180
  *
166
181
  * - **its signer is the address's author** — NIP-09, true on any relay; or
167
182
  * - **it is the shape the relay checked**: no `e` tag, and the address is its
168
183
  * *first* `a`. Buzz accepts that shape from the author or the author's owner
169
184
  * (SPEC §6.5), and ownership is visible only to the relay — most objects here
170
- * are written by an agent and deleted by the person who owns it.
185
+ * are written by an agent and deleted by the person who owns it. Not counted
186
+ * when `options.relayChecksOwner` is false.
171
187
  *
172
188
  * Anything else is unchecked. Buzz validates only the `e` targets when there
173
189
  * are any, and only the first `a` when there are none, yet stores every tag; a
174
190
  * member could otherwise add somebody's address as a second `a` and make their
175
191
  * hidden object read "deleted" to everyone who cannot see it.
176
192
  */
177
- export declare function absenceOf(address: string, deletions: readonly {
178
- kind: number;
179
- pubkey: string;
180
- tags: string[][];
181
- }[]): 'deleted' | 'unreadable';
193
+ export declare function absenceOf(address: string, deletions: readonly DeletionEvent[], options?: AbsenceOptions): 'deleted' | 'unreadable';
194
+ /**
195
+ * The read that tells deleted from unreadable, once a read by address came
196
+ * back empty (§13.6.1): `{kinds: [5], "#a": [address]}`, and the same asked of
197
+ * the address's author alone. The relay checks only a deletion's first `a`, so
198
+ * other members' deletions naming the address further along could fill the
199
+ * first filter's window and push out the author's own. Pass what they return
200
+ * to {@link absenceOf}; the filters of several addresses may go in one read.
201
+ *
202
+ * Empty for a value that is not an address (an artifact's id, an event id): no
203
+ * deletion names it by `a`, so it reads as `unreadable` without asking.
204
+ */
205
+ export declare function absenceFilters(address: string): {
206
+ kinds: number[];
207
+ authors?: string[];
208
+ '#a': string[];
209
+ limit: number;
210
+ }[];
211
+ /**
212
+ * {@link absenceFilters} asked through the app's own read, answered by
213
+ * {@link absenceOf}: `deleted` or `unreadable`, for an address whose read came
214
+ * back empty. A read that fails throws, as `query` does: neither answer is
215
+ * known, and saying `unreadable` would be a guess.
216
+ */
217
+ export declare function readAbsence(address: string, query: (filters: Record<string, unknown>[]) => Promise<readonly DeletionEvent[]>, options?: AbsenceOptions): Promise<'deleted' | 'unreadable'>;
182
218
  //# sourceMappingURL=anchors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchors.d.ts","sourceRoot":"","sources":["../src/anchors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,KAAK,KAAK,EAAqD,MAAM,aAAa,CAAA;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,kCAAkC;AAClC,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC;;;;;;GAMG;AACH,MAAM,MAAM,WAAW;AACrB,wEAAwE;AACtE;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE;AACzB,6CAA6C;GAC3C;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE;AACjD;;;;;GAKG;GACD;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE;AACxC,+DAA+D;GAC7D;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAErC;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAI5F;AAED;;;;;;;GAO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SAAS,GAAG,YAAY,CAUtI;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAOxH;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,EAChF,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,CAInC"}
package/dist/anchors.js CHANGED
@@ -130,31 +130,68 @@ export function resolvePart(block, source) {
130
130
  * Why a read by address came back empty: `deleted` when the relay holds a
131
131
  * deletion of it by address (a `kind:5` with that `a`), else `unreadable`.
132
132
  *
133
- * `deletions` is what `{kinds: [5], "#a": [address]}` returned. A deletion
134
- * counts when either holds:
133
+ * `deletions` is what {@link absenceFilters} returned — `{kinds: [5], "#a":
134
+ * [address]}` — and may hold deletions of other addresses too, so one read
135
+ * can answer for several. A deletion counts when either holds:
135
136
  *
136
137
  * - **its signer is the address's author** — NIP-09, true on any relay; or
137
138
  * - **it is the shape the relay checked**: no `e` tag, and the address is its
138
139
  * *first* `a`. Buzz accepts that shape from the author or the author's owner
139
140
  * (SPEC §6.5), and ownership is visible only to the relay — most objects here
140
- * are written by an agent and deleted by the person who owns it.
141
+ * are written by an agent and deleted by the person who owns it. Not counted
142
+ * when `options.relayChecksOwner` is false.
141
143
  *
142
144
  * Anything else is unchecked. Buzz validates only the `e` targets when there
143
145
  * are any, and only the first `a` when there are none, yet stores every tag; a
144
146
  * member could otherwise add somebody's address as a second `a` and make their
145
147
  * hidden object read "deleted" to everyone who cannot see it.
146
148
  */
147
- export function absenceOf(address, deletions) {
149
+ export function absenceOf(address, deletions, options = {}) {
148
150
  const author = address.split(':')[1];
151
+ const ownerChecked = options.relayChecksOwner ?? true;
149
152
  const deleted = deletions.some((event) => {
150
153
  if (event.kind !== 5)
151
154
  return false;
152
155
  if (event.pubkey === author)
153
156
  return event.tags.some((t) => t[0] === 'a' && t[1] === address);
154
- if (event.tags.some((t) => t[0] === 'e'))
157
+ if (!ownerChecked || event.tags.some((t) => t[0] === 'e'))
155
158
  return false;
156
159
  return event.tags.find((t) => t[0] === 'a')?.[1] === address;
157
160
  });
158
161
  return deleted ? 'deleted' : 'unreadable';
159
162
  }
163
+ /** How many deletions each of {@link absenceFilters}' filters asks for. */
164
+ const ABSENCE_LIMIT = 20;
165
+ /**
166
+ * The read that tells deleted from unreadable, once a read by address came
167
+ * back empty (§13.6.1): `{kinds: [5], "#a": [address]}`, and the same asked of
168
+ * the address's author alone. The relay checks only a deletion's first `a`, so
169
+ * other members' deletions naming the address further along could fill the
170
+ * first filter's window and push out the author's own. Pass what they return
171
+ * to {@link absenceOf}; the filters of several addresses may go in one read.
172
+ *
173
+ * Empty for a value that is not an address (an artifact's id, an event id): no
174
+ * deletion names it by `a`, so it reads as `unreadable` without asking.
175
+ */
176
+ export function absenceFilters(address) {
177
+ if (!isAddress(address))
178
+ return [];
179
+ const author = address.split(':')[1];
180
+ return [
181
+ { kinds: [5], authors: [author], '#a': [address], limit: ABSENCE_LIMIT },
182
+ { kinds: [5], '#a': [address], limit: ABSENCE_LIMIT },
183
+ ];
184
+ }
185
+ /**
186
+ * {@link absenceFilters} asked through the app's own read, answered by
187
+ * {@link absenceOf}: `deleted` or `unreadable`, for an address whose read came
188
+ * back empty. A read that fails throws, as `query` does: neither answer is
189
+ * known, and saying `unreadable` would be a guess.
190
+ */
191
+ export async function readAbsence(address, query, options = {}) {
192
+ const filters = absenceFilters(address);
193
+ if (filters.length === 0)
194
+ return 'unreadable';
195
+ return absenceOf(address, await query(filters), options);
196
+ }
160
197
  //# sourceMappingURL=anchors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchors.js","sourceRoot":"","sources":["../src/anchors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAkC,SAAS,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAG3F,kCAAkC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAwBvC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAA0C;IACtE,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACrE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACjE,OAAO,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAA;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,EAAsB,EACtB,KAAa,EACb,MAAqB;IAErB,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;IACjE,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAA;IAC9D,IAAI,QAAuB,CAAA;IAC3B,IAAI,CAAC;QACH,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAA;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAA;IACvC,CAAC;IACD,MAAM,KAAK,GAAG,SAAS,CAA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AAW,CAC/B,OAAe,EACf,KAAgF,EAChF,UAA0B,EAAE;IAE5B,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;IACvC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAY,CAAA;IAC7C,OAAO,SAAS,CAAC,OAAO,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;AAC1D,CAAC"}
package/dist/index.d.ts 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 declare const PROTOCOL_VERSION = "0.46.1";
49
+ export declare const PROTOCOL_VERSION = "0.47.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';
@@ -60,7 +60,7 @@ export { type RenderInline, type RenderBlock, type RenderFormat, type ContentFor
60
60
  export { markerTextToBlockDocument, blockDocumentToMarkerText, type DescriptionTextOptions, } from './bridge-content.js';
61
61
  export { descriptionTextToBlockDocument, tableToDescriptionText } from './description-text.js';
62
62
  export { type EditorNode, type EditorDocument, EDITOR_BLOCK_TYPES, UNKNOWN_BLOCK_NODE, REFERENCE_NODE, documentForEditing, toEditorDocument, fromEditorDocument, publishableFromEditor, } from './editor.js';
63
- export { type BlockAnchor, type Part, type PartPointer, type PartSource, BLOCK_ANCHOR_TAG, PART_TAG, absenceOf, blockAnchorOf, partTag, partsOf, resolveBlockAnchor, resolvePart, } from './anchors.js';
63
+ export { type AbsenceOptions, type BlockAnchor, type DeletionEvent, type Part, type PartPointer, type PartSource, BLOCK_ANCHOR_TAG, PART_TAG, absenceFilters, absenceOf, blockAnchorOf, partTag, partsOf, readAbsence, 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
65
  export { type DocumentLineDraw, type Embed, type EmbedLayout, type LineDraw, type LinkResolver, EMBED_TAG, cardsIn, defaultCardOf, documentLineDrawOf, documentLineDraws, embedTag, embedTagsOf, embedsOf, isFolderValue, isOnlyReferenceLine, lineDrawOf, linesOf, linksAsReferences, linksOnWordsOf, 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';
@@ -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,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EAEjB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,IAAI,EACJ,YAAY,EAEZ,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,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,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,YA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ACL,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,SAAS,EACT,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,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,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,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EAEjB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,IA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M,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.46.1';
49
+ export const PROTOCOL_VERSION = '0.47.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,
@@ -66,7 +66,7 @@ export { CONTENT_FORMAT_TAG, BLOCK_DOCUMENT_FORMAT, contentFormatOf, toRenderTre
66
66
  export { markerTextToBlockDocument, blockDocumentToMarkerText, } from './bridge-content.js';
67
67
  export { descriptionTextToBlockDocument, tableToDescriptionText } from './description-text.js';
68
68
  export { EDITOR_BLOCK_TYPES, UNKNOWN_BLOCK_NODE, REFERENCE_NODE, documentForEditing, toEditorDocument, fromEditorDocument, publishableFromEditor, } from './editor.js';
69
- export { BLOCK_ANCHOR_TAG, PART_TAG, absenceOf, blockAnchorOf, partTag, partsOf, resolveBlockAnchor, resolvePart, } from './anchors.js';
69
+ export { BLOCK_ANCHOR_TAG, PART_TAG, absenceFilters, absenceOf, blockAnchorOf, partTag, partsOf, readAbsence, 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
71
  export { EMBED_TAG, cardsIn, defaultCardOf, documentLineDrawOf, documentLineDraws, embedTag, embedTagsOf, embedsOf, isFolderValue, isOnlyReferenceLine, lineDrawOf, linesOf, linksAsReferences, linksOnWordsOf, 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';
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,EACxB,YAAY,EACZ,s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,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,EAML,SAAS,EACT,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,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"}
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,UAA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AAM,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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/protocol",
3
- "version": "0.46.1",
3
+ "version": "0.47.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/anchors.ts CHANGED
@@ -193,34 +193,89 @@ export function resolvePart(block: string, source: PartSource): Part {
193
193
  return { state: 'unaddressable' }
194
194
  }
195
195
 
196
+ /** A deletion as {@link absenceOf} reads it: its kind, its signer and its tags. */
197
+ export interface DeletionEvent {
198
+ kind: number
199
+ pubkey: string
200
+ tags: string[][]
201
+ }
202
+
203
+ export interface AbsenceOptions {
204
+ /**
205
+ * Whether the relay applies §6.5's check to a deletion: Buzz does, so the
206
+ * default is true. On a relay that does not, only the author's own deletions
207
+ * count (§13.6.1).
208
+ */
209
+ relayChecksOwner?: boolean
210
+ }
211
+
196
212
  /**
197
213
  * Why a read by address came back empty: `deleted` when the relay holds a
198
214
  * deletion of it by address (a `kind:5` with that `a`), else `unreadable`.
199
215
  *
200
- * `deletions` is what `{kinds: [5], "#a": [address]}` returned. A deletion
201
- * counts when either holds:
216
+ * `deletions` is what {@link absenceFilters} returned — `{kinds: [5], "#a":
217
+ * [address]}` — and may hold deletions of other addresses too, so one read
218
+ * can answer for several. A deletion counts when either holds:
202
219
  *
203
220
  * - **its signer is the address's author** — NIP-09, true on any relay; or
204
221
  * - **it is the shape the relay checked**: no `e` tag, and the address is its
205
222
  * *first* `a`. Buzz accepts that shape from the author or the author's owner
206
223
  * (SPEC §6.5), and ownership is visible only to the relay — most objects here
207
- * are written by an agent and deleted by the person who owns it.
224
+ * are written by an agent and deleted by the person who owns it. Not counted
225
+ * when `options.relayChecksOwner` is false.
208
226
  *
209
227
  * Anything else is unchecked. Buzz validates only the `e` targets when there
210
228
  * are any, and only the first `a` when there are none, yet stores every tag; a
211
229
  * member could otherwise add somebody's address as a second `a` and make their
212
230
  * hidden object read "deleted" to everyone who cannot see it.
213
231
  */
214
- export function absenceOf(
215
- address: string,
216
- deletions: readonly { kind: number; pubkey: string; tags: string[][] }[],
217
- ): 'deleted' | 'unreadable' {
232
+ export function absenceOf(address: string, deletions: readonly DeletionEvent[], options: AbsenceOptions = {}): 'deleted' | 'unreadable' {
218
233
  const author = address.split(':')[1]
234
+ const ownerChecked = options.relayChecksOwner ?? true
219
235
  const deleted = deletions.some((event) => {
220
236
  if (event.kind !== 5) return false
221
237
  if (event.pubkey === author) return event.tags.some((t) => t[0] === 'a' && t[1] === address)
222
- if (event.tags.some((t) => t[0] === 'e')) return false
238
+ if (!ownerChecked || event.tags.some((t) => t[0] === 'e')) return false
223
239
  return event.tags.find((t) => t[0] === 'a')?.[1] === address
224
240
  })
225
241
  return deleted ? 'deleted' : 'unreadable'
226
242
  }
243
+
244
+ /** How many deletions each of {@link absenceFilters}' filters asks for. */
245
+ const ABSENCE_LIMIT = 20
246
+
247
+ /**
248
+ * The read that tells deleted from unreadable, once a read by address came
249
+ * back empty (§13.6.1): `{kinds: [5], "#a": [address]}`, and the same asked of
250
+ * the address's author alone. The relay checks only a deletion's first `a`, so
251
+ * other members' deletions naming the address further along could fill the
252
+ * first filter's window and push out the author's own. Pass what they return
253
+ * to {@link absenceOf}; the filters of several addresses may go in one read.
254
+ *
255
+ * Empty for a value that is not an address (an artifact's id, an event id): no
256
+ * deletion names it by `a`, so it reads as `unreadable` without asking.
257
+ */
258
+ export function absenceFilters(address: string): { kinds: number[]; authors?: string[]; '#a': string[]; limit: number }[] {
259
+ if (!isAddress(address)) return []
260
+ const author = address.split(':')[1]!
261
+ return [
262
+ { kinds: [5], authors: [author], '#a': [address], limit: ABSENCE_LIMIT },
263
+ { kinds: [5], '#a': [address], limit: ABSENCE_LIMIT },
264
+ ]
265
+ }
266
+
267
+ /**
268
+ * {@link absenceFilters} asked through the app's own read, answered by
269
+ * {@link absenceOf}: `deleted` or `unreadable`, for an address whose read came
270
+ * back empty. A read that fails throws, as `query` does: neither answer is
271
+ * known, and saying `unreadable` would be a guess.
272
+ */
273
+ export async function readAbsence(
274
+ address: string,
275
+ query: (filters: Record<string, unknown>[]) => Promise<readonly DeletionEvent[]>,
276
+ options: AbsenceOptions = {},
277
+ ): Promise<'deleted' | 'unreadable'> {
278
+ const filters = absenceFilters(address)
279
+ if (filters.length === 0) return 'unreadable'
280
+ return absenceOf(address, await query(filters), options)
281
+ }
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.46.1'
50
+ export const PROTOCOL_VERSION = '0.47.0'
51
51
 
52
52
  export {
53
53
  // types
@@ -259,16 +259,20 @@ export {
259
259
  } from './editor.js'
260
260
 
261
261
  export {
262
+ type AbsenceOptions,
262
263
  type BlockAnchor,
264
+ type DeletionEvent,
263
265
  type Part,
264
266
  type PartPointer,
265
267
  type PartSource,
266
268
  BLOCK_ANCHOR_TAG,
267
269
  PART_TAG,
270
+ absenceFilters,
268
271
  absenceOf,
269
272
  blockAnchorOf,
270
273
  partTag,
271
274
  partsOf,
275
+ readAbsence,
272
276
  resolveBlockAnchor,
273
277
  resolvePart,
274
278
  } from './anchors.js'