@estiva-app/protocol 0.28.0 → 0.28.1
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 +11 -0
- package/dist/anchors.d.ts +14 -9
- package/dist/anchors.d.ts.map +1 -1
- package/dist/anchors.js +23 -10
- package/dist/anchors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/anchors.ts +21 -11
- package/src/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ 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.28.1 — 2026-10-07
|
|
8
|
+
|
|
9
|
+
**Wire behaviour: no builder's bytes changed.** `absenceOf` was too trusting
|
|
10
|
+
(COM-2 security review).
|
|
11
|
+
|
|
12
|
+
- A `kind:5` now counts only when its signer is the address's author (NIP-09),
|
|
13
|
+
or when it is the shape Buzz checks: no `e` tag, and the address is its first
|
|
14
|
+
`a`. Buzz validates only the `e` targets, or only the first `a`, and stores
|
|
15
|
+
every tag; a member could add somebody's address as an extra `a` and make a
|
|
16
|
+
hidden object read "deleted". `deletions` items need `pubkey` again.
|
|
17
|
+
|
|
7
18
|
## 0.28.0 — 2026-10-07
|
|
8
19
|
|
|
9
20
|
**Wire behaviour: no builder's bytes changed; one tag is new and one is read
|
package/dist/anchors.d.ts
CHANGED
|
@@ -158,18 +158,23 @@ export declare function resolvePart(block: string, source: PartSource): Part;
|
|
|
158
158
|
* Why a read by address came back empty: `deleted` when the relay holds a
|
|
159
159
|
* deletion of it by address (a `kind:5` with that `a`), else `unreadable`.
|
|
160
160
|
*
|
|
161
|
-
* `deletions` is what `{kinds: [5], "#a": [address]}` returned.
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
161
|
+
* `deletions` is what `{kinds: [5], "#a": [address]}` returned. A deletion
|
|
162
|
+
* counts when either holds:
|
|
163
|
+
*
|
|
164
|
+
* - **its signer is the address's author** — NIP-09, true on any relay; or
|
|
165
|
+
* - **it is the shape the relay checked**: no `e` tag, and the address is its
|
|
166
|
+
* *first* `a`. Buzz accepts that shape from the author or the author's owner
|
|
167
|
+
* (SPEC §6.5), and ownership is visible only to the relay — most objects here
|
|
168
|
+
* are written by an agent and deleted by the person who owns it.
|
|
169
|
+
*
|
|
170
|
+
* Anything else is unchecked. Buzz validates only the `e` targets when there
|
|
171
|
+
* are any, and only the first `a` when there are none, yet stores every tag; a
|
|
172
|
+
* member could otherwise add somebody's address as a second `a` and make their
|
|
173
|
+
* hidden object read "deleted" to everyone who cannot see it.
|
|
170
174
|
*/
|
|
171
175
|
export declare function absenceOf(address: string, deletions: readonly {
|
|
172
176
|
kind: number;
|
|
177
|
+
pubkey: string;
|
|
173
178
|
tags: string[][];
|
|
174
179
|
}[]): 'deleted' | 'unreadable';
|
|
175
180
|
//# sourceMappingURL=anchors.d.ts.map
|
package/dist/anchors.d.ts.map
CHANGED
|
@@ -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,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EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,EAAE,GACvE,SAAS,GAAG,YAAY,CAS1B"}
|
package/dist/anchors.js
CHANGED
|
@@ -128,18 +128,31 @@ export function resolvePart(block, source) {
|
|
|
128
128
|
* Why a read by address came back empty: `deleted` when the relay holds a
|
|
129
129
|
* deletion of it by address (a `kind:5` with that `a`), else `unreadable`.
|
|
130
130
|
*
|
|
131
|
-
* `deletions` is what `{kinds: [5], "#a": [address]}` returned.
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
131
|
+
* `deletions` is what `{kinds: [5], "#a": [address]}` returned. A deletion
|
|
132
|
+
* counts when either holds:
|
|
133
|
+
*
|
|
134
|
+
* - **its signer is the address's author** — NIP-09, true on any relay; or
|
|
135
|
+
* - **it is the shape the relay checked**: no `e` tag, and the address is its
|
|
136
|
+
* *first* `a`. Buzz accepts that shape from the author or the author's owner
|
|
137
|
+
* (SPEC §6.5), and ownership is visible only to the relay — most objects here
|
|
138
|
+
* are written by an agent and deleted by the person who owns it.
|
|
139
|
+
*
|
|
140
|
+
* Anything else is unchecked. Buzz validates only the `e` targets when there
|
|
141
|
+
* are any, and only the first `a` when there are none, yet stores every tag; a
|
|
142
|
+
* member could otherwise add somebody's address as a second `a` and make their
|
|
143
|
+
* hidden object read "deleted" to everyone who cannot see it.
|
|
140
144
|
*/
|
|
141
145
|
export function absenceOf(address, deletions) {
|
|
142
|
-
const
|
|
146
|
+
const author = address.split(':')[1];
|
|
147
|
+
const deleted = deletions.some((event) => {
|
|
148
|
+
if (event.kind !== 5)
|
|
149
|
+
return false;
|
|
150
|
+
if (event.pubkey === author)
|
|
151
|
+
return event.tags.some((t) => t[0] === 'a' && t[1] === address);
|
|
152
|
+
if (event.tags.some((t) => t[0] === 'e'))
|
|
153
|
+
return false;
|
|
154
|
+
return event.tags.find((t) => t[0] === 'a')?.[1] === address;
|
|
155
|
+
});
|
|
143
156
|
return deleted ? 'deleted' : 'unreadable';
|
|
144
157
|
}
|
|
145
158
|
//# sourceMappingURL=anchors.js.map
|
package/dist/anchors.js.map
CHANGED
|
@@ -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,CA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,CAAA;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,SAAS,CACvB,OAAe,EACf,SAAwE;IAExE,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACpC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO,KAAK,CAAA;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAA;QAC5F,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;YAAE,OAAO,KAAK,CAAA;QACtD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,CAAA;IAC9D,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAA;AAC3C,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.28.
|
|
49
|
+
export declare const PROTOCOL_VERSION = "0.28.1";
|
|
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, 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';
|
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.28.
|
|
49
|
+
export const PROTOCOL_VERSION = '0.28.1';
|
|
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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@estiva-app/protocol",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.1",
|
|
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
|
@@ -195,20 +195,30 @@ export function resolvePart(block: string, source: PartSource): Part {
|
|
|
195
195
|
* Why a read by address came back empty: `deleted` when the relay holds a
|
|
196
196
|
* deletion of it by address (a `kind:5` with that `a`), else `unreadable`.
|
|
197
197
|
*
|
|
198
|
-
* `deletions` is what `{kinds: [5], "#a": [address]}` returned.
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
198
|
+
* `deletions` is what `{kinds: [5], "#a": [address]}` returned. A deletion
|
|
199
|
+
* counts when either holds:
|
|
200
|
+
*
|
|
201
|
+
* - **its signer is the address's author** — NIP-09, true on any relay; or
|
|
202
|
+
* - **it is the shape the relay checked**: no `e` tag, and the address is its
|
|
203
|
+
* *first* `a`. Buzz accepts that shape from the author or the author's owner
|
|
204
|
+
* (SPEC §6.5), and ownership is visible only to the relay — most objects here
|
|
205
|
+
* are written by an agent and deleted by the person who owns it.
|
|
206
|
+
*
|
|
207
|
+
* Anything else is unchecked. Buzz validates only the `e` targets when there
|
|
208
|
+
* are any, and only the first `a` when there are none, yet stores every tag; a
|
|
209
|
+
* member could otherwise add somebody's address as a second `a` and make their
|
|
210
|
+
* hidden object read "deleted" to everyone who cannot see it.
|
|
207
211
|
*/
|
|
208
212
|
export function absenceOf(
|
|
209
213
|
address: string,
|
|
210
|
-
deletions: readonly { kind: number; tags: string[][] }[],
|
|
214
|
+
deletions: readonly { kind: number; pubkey: string; tags: string[][] }[],
|
|
211
215
|
): 'deleted' | 'unreadable' {
|
|
212
|
-
const
|
|
216
|
+
const author = address.split(':')[1]
|
|
217
|
+
const deleted = deletions.some((event) => {
|
|
218
|
+
if (event.kind !== 5) return false
|
|
219
|
+
if (event.pubkey === author) return event.tags.some((t) => t[0] === 'a' && t[1] === address)
|
|
220
|
+
if (event.tags.some((t) => t[0] === 'e')) return false
|
|
221
|
+
return event.tags.find((t) => t[0] === 'a')?.[1] === address
|
|
222
|
+
})
|
|
213
223
|
return deleted ? 'deleted' : 'unreadable'
|
|
214
224
|
}
|
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.28.
|
|
50
|
+
export const PROTOCOL_VERSION = '0.28.1'
|
|
51
51
|
|
|
52
52
|
export {
|
|
53
53
|
// types
|