@estiva-app/protocol 0.21.0 → 0.23.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,8 +4,67 @@ 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.23.0 — 2026-09-24
8
+
9
+ **Wire behaviour: unchanged for every existing builder.** One new builder for
10
+ a kind Peek was already sending from its own hand-rolled copy.
11
+
12
+ - **New: `buildFolderCommand` (`kind:1852`), `KIND.FOLDER_COMMAND` and
13
+ `type FolderOp`** (FOL-4). Tags `h`, `op`, one `a` per address in the order
14
+ given, then an optional `name` — the shape buzz's `handle_folder_command`
15
+ reads (`nfb-demo-kinds`; buzz `main` has no handler). Three of the four new
16
+ wire vectors are **Peek's bytes**: rebuilt from its private `folderCommand`
17
+ in `src/nostr/foreign.ts`, the only 1852 writer in the suite, with matching
18
+ ids.
19
+ - **One deliberate difference from Peek's copy: the name is canonicalised**
20
+ (`canonicalChannelName`), as `buildCreateChannel` and
21
+ `buildEditChannelMetadata` already do. A Folder's state name shadows its
22
+ channel's, so a name with a leading `#` or trailing space used to show one
23
+ spelling in the listing and another on the channel. Plain names produce
24
+ identical bytes; the `folderCommand-set-canonical-name` vector pins the
25
+ difference.
26
+ - **Refused before a round trip:** an unknown `op` (the relay refuses rather
27
+ than defaulting), an empty folder, an empty address, and a name that
28
+ canonicalises to nothing.
29
+
30
+ ## 0.22.0 — 2026-09-18
31
+
32
+ **Wire behaviour: unchanged for every kind that was already published.** One
33
+ new builder for a kind nothing in the suite had sent, and one constant for a
34
+ kind nothing in the suite may ever sign.
35
+
36
+ - **New: `buildDmHide` (`kind:41012`) and `KIND.DM_HIDE`.** One `h` naming the
37
+ DM channel, empty content — mirroring `build_dm_hide`
38
+ (`desktop/src-tauri/src/events.rs`), buzz's only builder for it. The relay
39
+ sets the signer's own `hidden_at` on their membership row and nothing else:
40
+ the DM, its participants and its history survive, and nobody else is told.
41
+ The wire vector is this package's own computation, since the agent that
42
+ wrote it holds no `41012` grant; Peek's DMS-6 live check publishes it as a
43
+ signed-in person and reads the relay's echoed id.
44
+
45
+ - **New: `KIND.DM_VISIBILITY = 30622`, deliberately without a builder.** The
46
+ relay's per-viewer hidden-DM snapshot: parameterized replaceable on
47
+ `d` = viewer, one `h` per hidden channel, relay-signed and result-gated on
48
+ its `p`. It is read with `{ kinds: [30622], '#p': [me], limit: 1 }` and
49
+ never merged — the newest event is the whole set. An app that built one
50
+ would be forging the relay's answer, and `ingest.rs` refuses it anyway.
51
+
52
+ - **Recorded on the constants, because it decides a client's design:** there
53
+ is no unhide kind. `open_dm` clears the caller's `hidden_at` when the DM
54
+ already exists, so a second `buildDmOpen` is the unhide; and a message
55
+ arriving in a hidden DM does not resurface it.
56
+
7
57
  ## 0.21.0 — 2026-09-17
8
58
 
59
+ > **Corrected after publication (2026-09-17).** The entry below said a DM
60
+ > channel's uuid was *derived* from `compute_participant_hash`. It is not:
61
+ > `create_dm` mints `Uuid::new_v4()` and the hash is only the key the lookup
62
+ > resolves. Nothing in the package behaved on the wrong reading — it never
63
+ > tries to compute a uuid, it reads the one the relay answers with — so no
64
+ > code changed and 0.21.0 is not republished. Corrected because the wrong
65
+ > reading invites a client to compute a channel id offline, and the npm copy
66
+ > of this file still carries the old sentence until the next release.
67
+
9
68
  **Wire behaviour: unchanged for every kind that was already published.** The
10
69
  one new builder, `buildDmOpen`, emits a kind nothing in the suite had ever
11
70
  sent; its bytes were checked against the relay before this was written, not
@@ -13,11 +72,11 @@ after (see below).
13
72
 
14
73
  - **New: `buildDmOpen` (`kind:41010`) and `KIND.DM_OPEN`.** One `p` per *other*
15
74
  participant, no `h`, empty content — mirroring `build_dm_open`
16
- (`buzz-sdk/src/builders.rs:1544`). A DM channel's uuid is **derived by the
17
- relay** from `compute_participant_hash` over self + the `p` tags, so unlike a
18
- topic the client cannot mint it, cannot pass one, and only learns it from the
19
- answer. `MAX_DM_OTHERS` (8) is enforced here so a tenth participant fails
20
- where a caller can say something about it.
75
+ (`buzz-sdk/src/builders.rs:1544`). A DM channel's uuid is **minted by the
76
+ relay** — randomly, and keyed by the participant set rather than computed
77
+ from it — so unlike a topic the client cannot mint it, cannot pass one, and
78
+ only learns it from the answer. `MAX_DM_OTHERS` (8) is enforced here so a
79
+ tenth participant fails where a caller can say something about it.
21
80
 
22
81
  - **`PublishResult.message`, and `commandPayload` to read it.** The relay's
23
82
  `message` was kept only on the `accepted:false` branch, where it becomes
package/dist/events.d.ts CHANGED
@@ -31,6 +31,12 @@ export declare const KIND: {
31
31
  readonly NIP29_EDIT_METADATA: 9002;
32
32
  readonly NIP29_CREATE_GROUP: 9007;
33
33
  readonly NIP29_DELETE_GROUP: 9008;
34
+ /**
35
+ * Folder command — `KIND_FOLDER_COMMAND` (RFC 0.4 §4.1). A client never signs
36
+ * a Folder's state; it sends one of these and the relay emits the new
37
+ * relay-signed `kind:30890`. See {@link buildFolderCommand}.
38
+ */
39
+ readonly FOLDER_COMMAND: 1852;
34
40
  /**
35
41
  * Estiva assertion — a statement *about* something in the channel, rather
36
42
  * than a message in it (PEEK-128). `resolution` is the first and, for now,
@@ -112,17 +118,61 @@ export declare const KIND: {
112
118
  *
113
119
  * A **command**, not a record, and the difference decides how a client uses
114
120
  * it. There is no `h`, because the channel does not exist yet and the client
115
- * does not choose its id: the relay derives it from `compute_participant_hash`
116
- * over self + the `p` tags, deduplicated, and answers with the uuid. A topic
121
+ * does not choose its id: the relay mints it and answers with it. A topic
117
122
  * mints its own uuid client-side and creates it with a `9007`; a DM cannot,
118
123
  * and {@link buildDmOpen} is the whole of the client's side of that.
119
124
  *
120
- * Because the id is derived, re-opening is idempotent: the same participants
121
- * always name the same channel, so "message this person" never has to ask
122
- * whether a DM already exists. Publish and use what comes back — see
123
- * `commandPayload`, including the one case where nothing comes back.
125
+ * **The uuid is random, and only the lookup is by participants.**
126
+ * `create_dm` takes `Uuid::new_v4()` (`buzz-db/src/dm.rs`); what
127
+ * `compute_participant_hash` — sha256 over the sorted, deduplicated pubkey
128
+ * bytes of self + the `p` tags — produces is the *key* `find_dm_by_participants`
129
+ * resolves, not the id itself. So re-opening is idempotent, because the same
130
+ * participants always hash to the same row and therefore name the same
131
+ * channel; but the uuid cannot be computed offline from the participants,
132
+ * and a client that tried would be inventing a channel nobody else has.
133
+ *
134
+ * Idempotence is what the caller gets to rely on: "message this person" never
135
+ * has to ask whether a DM already exists. Publish and use what comes back —
136
+ * see `commandPayload`, including the one case where nothing comes back.
124
137
  */
125
138
  readonly DM_OPEN: 41010;
139
+ /**
140
+ * Hide a DM from the signer's own sidebar — `KIND_DM_HIDE`
141
+ * (`buzz-core/src/kind.rs`). A command like {@link KIND.DM_OPEN}: one `h`
142
+ * naming the DM channel, no content, and the caller must be a member of it.
143
+ *
144
+ * **Hiding is neither leaving nor deleting.** `handle_dm_hide` sets the
145
+ * caller's own `hidden_at` on their membership row and nothing else: the
146
+ * channel, every participant and every message survive, and the other
147
+ * participants are not told. What changes is the signer's
148
+ * {@link KIND.DM_VISIBILITY} snapshot, which the relay republishes after the
149
+ * hide.
150
+ *
151
+ * **There is no unhide command.** `open_dm` clears the caller's `hidden_at`
152
+ * when the DM already exists (`buzz-db/src/dm.rs`), so re-publishing the
153
+ * same {@link buildDmOpen} is how a hidden DM comes back — the relay
154
+ * republishes the snapshot on that path too. A message arriving in a hidden
155
+ * DM does *not* resurface it: nothing on the `kind:9` path touches
156
+ * `hidden_at`.
157
+ */
158
+ readonly DM_HIDE: 41012;
159
+ /**
160
+ * The relay's per-viewer hidden-DM set — `KIND_DM_VISIBILITY`
161
+ * (`buzz-core/src/kind.rs`). **Relay-signed, and only ever read.** There is
162
+ * no builder for it here on purpose: `ingest.rs` refuses a client-authored
163
+ * one, and an app that signed one would be forging the relay's answer.
164
+ *
165
+ * Parameterized replaceable with `d` = the viewer's pubkey, carrying one `h`
166
+ * per hidden DM channel and a `p` = the viewer. It is result-gated on that
167
+ * `p` (`RESULT_GATED_KINDS`, `filter.rs:reader_authorized_for_event`): the
168
+ * read that works is `{ kinds: [30622], '#p': [me], limit: 1 }`, and a
169
+ * `#p` naming anybody else is refused rather than answered empty.
170
+ *
171
+ * The newest event is the whole set. The relay writes it again after every
172
+ * hide and every re-open, so a client applies the latest one wholesale and
173
+ * never merges successive snapshots.
174
+ */
175
+ readonly DM_VISIBILITY: 30622;
126
176
  };
127
177
  /** `build_reaction` (builders.rs:463) caps the emoji at 64 chars. */
128
178
  export declare const MAX_EMOJI_CHARS = 64;
@@ -258,6 +308,36 @@ export declare function buildEditChannelMetadata(pubkey: string, createdAtMs: nu
258
308
  name?: string;
259
309
  about?: string;
260
310
  }): UnsignedEvent;
311
+ /** A Folder command's `op`. `handle_folder_command` refuses anything else. */
312
+ export type FolderOp = 'add' | 'remove' | 'set';
313
+ /**
314
+ * kind:1852 Folder command — the tag shape `handle_folder_command` reads
315
+ * (`buzz-relay/src/handlers/side_effects.rs`, `nfb-demo-kinds`). Buzz has no
316
+ * builder for it: the kind is the relay's own and only clients send it.
317
+ *
318
+ * Tag order: h, op, a…, [name]. `a` tags keep the order given, because the
319
+ * relay appends them in that order and a Folder's order is the Folder's.
320
+ *
321
+ * - `add` and `remove` act on the addresses named and leave the rest alone;
322
+ * `set` replaces the list wholesale. `add` with no addresses keeps the
323
+ * contents and is how a name alone is changed — there is no `rename` op.
324
+ * - `name` is sticky: a command without one keeps the Folder's name.
325
+ * - The name goes through `canonicalChannelName`, as the channel's does. The
326
+ * state's name shadows the channel's wherever a Folder is listed, so the two
327
+ * homes must not disagree about a leading `#` or trailing space.
328
+ *
329
+ * **The relay computes the next state from the existing one, and a Folder with
330
+ * no `kind:30890` has none**, so any command against it emits state listing
331
+ * only what the command names — which hides everything filed in it by `h`.
332
+ * Whether that is safe is the caller's to know; the planners in
333
+ * `@estiva-app/interop` take it as an argument.
334
+ */
335
+ export declare function buildFolderCommand(pubkey: string, createdAtMs: number, args: {
336
+ folder: string;
337
+ op: FolderOp;
338
+ addresses?: string[];
339
+ name?: string;
340
+ }): UnsignedEvent;
261
341
  export type MemberRole = 'owner' | 'admin' | 'member';
262
342
  /**
263
343
  * kind:9000 add member — mirrors `build_add_member` (builders.rs:565).
@@ -288,6 +368,19 @@ export declare const MAX_DM_OTHERS = 8;
288
368
  export declare function buildDmOpen(pubkey: string, createdAtMs: number, args: {
289
369
  otherPubkeys: string[];
290
370
  }): UnsignedEvent;
371
+ /**
372
+ * kind:41012 hide a DM — mirrors `build_dm_hide` (`desktop/src-tauri/src/events.rs`).
373
+ *
374
+ * One `h` naming the DM channel, no content. The channel uuid is the one the
375
+ * relay answered a {@link buildDmOpen} with — there is no other way to hold
376
+ * one — and the relay rejects the hide unless the signer is a member of it.
377
+ *
378
+ * Undone by publishing the same `buildDmOpen` again, not by any event of this
379
+ * kind: see {@link KIND.DM_HIDE}.
380
+ */
381
+ export declare function buildDmHide(pubkey: string, createdAtMs: number, args: {
382
+ channelUuid: string;
383
+ }): UnsignedEvent;
291
384
  /**
292
385
  * kind:7 reaction — mirrors `build_reaction` (builders.rs:463).
293
386
  *
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,aAAa,CAAA;AAExE,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAA;AAE/B,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,oDAAoD;AACpD,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,EAAE,EAAE,MAAM,CAA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MAAM,yBAAyB,KAAK,CAAA;AAE3C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEvD;AAeD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAA;IAChB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAA;IACjB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,aAAa,CAWhB"}
package/dist/events.js CHANGED
@@ -52,6 +52,12 @@ export const KIND = {
52
52
  NIP29_EDIT_METADATA: 9002,
53
53
  NIP29_CREATE_GROUP: 9007,
54
54
  NIP29_DELETE_GROUP: 9008,
55
+ /**
56
+ * Folder command — `KIND_FOLDER_COMMAND` (RFC 0.4 §4.1). A client never signs
57
+ * a Folder's state; it sends one of these and the relay emits the new
58
+ * relay-signed `kind:30890`. See {@link buildFolderCommand}.
59
+ */
60
+ FOLDER_COMMAND: 1852,
55
61
  /**
56
62
  * Estiva assertion — a statement *about* something in the channel, rather
57
63
  * than a message in it (PEEK-128). `resolution` is the first and, for now,
@@ -133,17 +139,61 @@ export const KIND = {
133
139
  *
134
140
  * A **command**, not a record, and the difference decides how a client uses
135
141
  * it. There is no `h`, because the channel does not exist yet and the client
136
- * does not choose its id: the relay derives it from `compute_participant_hash`
137
- * over self + the `p` tags, deduplicated, and answers with the uuid. A topic
142
+ * does not choose its id: the relay mints it and answers with it. A topic
138
143
  * mints its own uuid client-side and creates it with a `9007`; a DM cannot,
139
144
  * and {@link buildDmOpen} is the whole of the client's side of that.
140
145
  *
141
- * Because the id is derived, re-opening is idempotent: the same participants
142
- * always name the same channel, so "message this person" never has to ask
143
- * whether a DM already exists. Publish and use what comes back — see
144
- * `commandPayload`, including the one case where nothing comes back.
146
+ * **The uuid is random, and only the lookup is by participants.**
147
+ * `create_dm` takes `Uuid::new_v4()` (`buzz-db/src/dm.rs`); what
148
+ * `compute_participant_hash` — sha256 over the sorted, deduplicated pubkey
149
+ * bytes of self + the `p` tags — produces is the *key* `find_dm_by_participants`
150
+ * resolves, not the id itself. So re-opening is idempotent, because the same
151
+ * participants always hash to the same row and therefore name the same
152
+ * channel; but the uuid cannot be computed offline from the participants,
153
+ * and a client that tried would be inventing a channel nobody else has.
154
+ *
155
+ * Idempotence is what the caller gets to rely on: "message this person" never
156
+ * has to ask whether a DM already exists. Publish and use what comes back —
157
+ * see `commandPayload`, including the one case where nothing comes back.
145
158
  */
146
159
  DM_OPEN: 41010,
160
+ /**
161
+ * Hide a DM from the signer's own sidebar — `KIND_DM_HIDE`
162
+ * (`buzz-core/src/kind.rs`). A command like {@link KIND.DM_OPEN}: one `h`
163
+ * naming the DM channel, no content, and the caller must be a member of it.
164
+ *
165
+ * **Hiding is neither leaving nor deleting.** `handle_dm_hide` sets the
166
+ * caller's own `hidden_at` on their membership row and nothing else: the
167
+ * channel, every participant and every message survive, and the other
168
+ * participants are not told. What changes is the signer's
169
+ * {@link KIND.DM_VISIBILITY} snapshot, which the relay republishes after the
170
+ * hide.
171
+ *
172
+ * **There is no unhide command.** `open_dm` clears the caller's `hidden_at`
173
+ * when the DM already exists (`buzz-db/src/dm.rs`), so re-publishing the
174
+ * same {@link buildDmOpen} is how a hidden DM comes back — the relay
175
+ * republishes the snapshot on that path too. A message arriving in a hidden
176
+ * DM does *not* resurface it: nothing on the `kind:9` path touches
177
+ * `hidden_at`.
178
+ */
179
+ DM_HIDE: 41012,
180
+ /**
181
+ * The relay's per-viewer hidden-DM set — `KIND_DM_VISIBILITY`
182
+ * (`buzz-core/src/kind.rs`). **Relay-signed, and only ever read.** There is
183
+ * no builder for it here on purpose: `ingest.rs` refuses a client-authored
184
+ * one, and an app that signed one would be forging the relay's answer.
185
+ *
186
+ * Parameterized replaceable with `d` = the viewer's pubkey, carrying one `h`
187
+ * per hidden DM channel and a `p` = the viewer. It is result-gated on that
188
+ * `p` (`RESULT_GATED_KINDS`, `filter.rs:reader_authorized_for_event`): the
189
+ * read that works is `{ kinds: [30622], '#p': [me], limit: 1 }`, and a
190
+ * `#p` naming anybody else is refused rather than answered empty.
191
+ *
192
+ * The newest event is the whole set. The relay writes it again after every
193
+ * hide and every re-open, so a client applies the latest one wholesale and
194
+ * never merges successive snapshots.
195
+ */
196
+ DM_VISIBILITY: 30622,
147
197
  };
148
198
  /** `build_reaction` (builders.rs:463) caps the emoji at 64 chars. */
149
199
  export const MAX_EMOJI_CHARS = 64;
@@ -339,6 +389,59 @@ export function buildEditChannelMetadata(pubkey, createdAtMs, args) {
339
389
  content: '',
340
390
  };
341
391
  }
392
+ const FOLDER_OPS = ['add', 'remove', 'set'];
393
+ /**
394
+ * kind:1852 Folder command — the tag shape `handle_folder_command` reads
395
+ * (`buzz-relay/src/handlers/side_effects.rs`, `nfb-demo-kinds`). Buzz has no
396
+ * builder for it: the kind is the relay's own and only clients send it.
397
+ *
398
+ * Tag order: h, op, a…, [name]. `a` tags keep the order given, because the
399
+ * relay appends them in that order and a Folder's order is the Folder's.
400
+ *
401
+ * - `add` and `remove` act on the addresses named and leave the rest alone;
402
+ * `set` replaces the list wholesale. `add` with no addresses keeps the
403
+ * contents and is how a name alone is changed — there is no `rename` op.
404
+ * - `name` is sticky: a command without one keeps the Folder's name.
405
+ * - The name goes through `canonicalChannelName`, as the channel's does. The
406
+ * state's name shadows the channel's wherever a Folder is listed, so the two
407
+ * homes must not disagree about a leading `#` or trailing space.
408
+ *
409
+ * **The relay computes the next state from the existing one, and a Folder with
410
+ * no `kind:30890` has none**, so any command against it emits state listing
411
+ * only what the command names — which hides everything filed in it by `h`.
412
+ * Whether that is safe is the caller's to know; the planners in
413
+ * `@estiva-app/interop` take it as an argument.
414
+ */
415
+ export function buildFolderCommand(pubkey, createdAtMs, args) {
416
+ assertHex64(pubkey, 'pubkey');
417
+ if (!args.folder)
418
+ throw new Error('a folder command names the folder');
419
+ // The relay refuses an unknown op rather than defaulting it; so do we.
420
+ if (!FOLDER_OPS.includes(args.op))
421
+ throw new Error(`unknown folder op: ${String(args.op)}`);
422
+ const tags = [
423
+ ['h', args.folder],
424
+ ['op', args.op],
425
+ ];
426
+ for (const address of args.addresses ?? []) {
427
+ if (!address)
428
+ throw new Error('a folder command address must not be empty');
429
+ tags.push(['a', address]);
430
+ }
431
+ if (args.name !== undefined) {
432
+ const name = canonicalChannelName(args.name);
433
+ if (name.trim() === '')
434
+ throw new Error('folder name is required');
435
+ tags.push(['name', name]);
436
+ }
437
+ return {
438
+ pubkey,
439
+ created_at: toNostrSeconds(createdAtMs),
440
+ kind: KIND.FOLDER_COMMAND,
441
+ tags,
442
+ content: '',
443
+ };
444
+ }
342
445
  /**
343
446
  * kind:9000 add member — mirrors `build_add_member` (builders.rs:565).
344
447
  * Tag order: h, p, [role]. The target pubkey is lowercased by Buzz.
@@ -396,6 +499,28 @@ export function buildDmOpen(pubkey, createdAtMs, args) {
396
499
  content: '',
397
500
  };
398
501
  }
502
+ /**
503
+ * kind:41012 hide a DM — mirrors `build_dm_hide` (`desktop/src-tauri/src/events.rs`).
504
+ *
505
+ * One `h` naming the DM channel, no content. The channel uuid is the one the
506
+ * relay answered a {@link buildDmOpen} with — there is no other way to hold
507
+ * one — and the relay rejects the hide unless the signer is a member of it.
508
+ *
509
+ * Undone by publishing the same `buildDmOpen` again, not by any event of this
510
+ * kind: see {@link KIND.DM_HIDE}.
511
+ */
512
+ export function buildDmHide(pubkey, createdAtMs, args) {
513
+ assertHex64(pubkey, 'pubkey');
514
+ if (!args.channelUuid)
515
+ throw new Error('a DM hide names the channel to hide');
516
+ return {
517
+ pubkey,
518
+ created_at: toNostrSeconds(createdAtMs),
519
+ kind: KIND.DM_HIDE,
520
+ tags: [['h', args.channelUuid]],
521
+ content: '',
522
+ };
523
+ }
399
524
  /**
400
525
  * kind:7 reaction — mirrors `build_reaction` (builders.rs:463).
401
526
  *
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M,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;QACjC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;IAChD,CAAC;IACD,OAAO;QACL,MAAM;QACN,UAAU,EAAE,cAAc,CAAC,WAAW,CAAC;QACvC,IAAI,EAAE,IAAI,CAAC,SAAS;QACpB,IAAI;QACJ,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAE3C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,MAAM,CAAA;AACnC,CAAC;AAeD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAS3C;IACC,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;QACzD,IAAI,EAAE,IAAI,CAAC,UAAU;QACrB,IAAI,EAAE;YACJ,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC;SAC9B;QACD,OAAO,EAAE,EAAE;KACZ,CAAA;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -46,8 +46,8 @@
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.21.0";
50
- export { type NostrTag, type UnsignedEvent, type SignedEvent, type Profile, type ThreadRef, type ChannelVisibility, type ChannelKind, type MemberRole, 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, buildAddMember, buildDmOpen, buildReaction, buildDeletion, buildEdit, buildMessage, buildResolution, buildBareFile, buildComponent, buildHighlight, buildUnsignedRelayAuthEvent, } from './events.js';
49
+ export declare const PROTOCOL_VERSION = "0.23.0";
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, buildComponent, 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';
53
53
  export { type Signer, type SignerKind, publicKeyFromSecret, signEvent, secretKeySigner, } from './sign.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,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,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY,EACZ,eAAe,EACf,aAAa,EACb,cAAc,EACd,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,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAA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AAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,KAAK,WAAW,EAChB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,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,IAAI,EACJ,YAAY,E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
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.21.0';
49
+ export const PROTOCOL_VERSION = '0.23.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,
53
53
  // the id preimage and the pieces that feed it
54
54
  computeEventId, toNostrSeconds, canonicalChannelName, threadTags, addr, relayAuthUrl,
55
55
  // builders
56
- buildProfile, parseProfile, buildCreateChannel, buildDeleteChannel, buildEditChannelMetadata, buildAddMember, buildDmOpen, buildReaction, buildDeletion, buildEdit, buildMessage, buildResolution, buildBareFile, buildComponent, buildHighlight, buildUnsignedRelayAuthEvent, } from './events.js';
56
+ buildProfile, parseProfile, buildCreateChannel, buildDeleteChannel, buildEditChannelMetadata, buildFolderCommand, buildAddMember, buildDmOpen, buildDmHide, buildReaction, buildDeletion, buildEdit, buildMessage, buildResolution, buildBareFile, buildComponent, buildHighlight, buildUnsignedRelayAuthEvent, } from './events.js';
57
57
  export { 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';
58
58
  export { TIMESTAMP_TOLERANCE_SECS, normalizeUrl, buildUnsignedAuthEvent, base64, authorizationHeaderFor, authorizationHeader, } from './nip98.js';
59
59
  export { publicKeyFromSecret, signEvent, secretKeySigner, } from './sign.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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b,MAAM,aAAa,CAAA;AAEpB,OAAO,EAKL,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAEL,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAGL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,OAAO,EAIP,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.21.0",
3
+ "version": "0.23.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/events.ts CHANGED
@@ -71,6 +71,12 @@ export const KIND = {
71
71
  NIP29_EDIT_METADATA: 9002,
72
72
  NIP29_CREATE_GROUP: 9007,
73
73
  NIP29_DELETE_GROUP: 9008,
74
+ /**
75
+ * Folder command — `KIND_FOLDER_COMMAND` (RFC 0.4 §4.1). A client never signs
76
+ * a Folder's state; it sends one of these and the relay emits the new
77
+ * relay-signed `kind:30890`. See {@link buildFolderCommand}.
78
+ */
79
+ FOLDER_COMMAND: 1852,
74
80
  /**
75
81
  * Estiva assertion — a statement *about* something in the channel, rather
76
82
  * than a message in it (PEEK-128). `resolution` is the first and, for now,
@@ -152,17 +158,61 @@ export const KIND = {
152
158
  *
153
159
  * A **command**, not a record, and the difference decides how a client uses
154
160
  * it. There is no `h`, because the channel does not exist yet and the client
155
- * does not choose its id: the relay derives it from `compute_participant_hash`
156
- * over self + the `p` tags, deduplicated, and answers with the uuid. A topic
161
+ * does not choose its id: the relay mints it and answers with it. A topic
157
162
  * mints its own uuid client-side and creates it with a `9007`; a DM cannot,
158
163
  * and {@link buildDmOpen} is the whole of the client's side of that.
159
164
  *
160
- * Because the id is derived, re-opening is idempotent: the same participants
161
- * always name the same channel, so "message this person" never has to ask
162
- * whether a DM already exists. Publish and use what comes back — see
163
- * `commandPayload`, including the one case where nothing comes back.
165
+ * **The uuid is random, and only the lookup is by participants.**
166
+ * `create_dm` takes `Uuid::new_v4()` (`buzz-db/src/dm.rs`); what
167
+ * `compute_participant_hash` — sha256 over the sorted, deduplicated pubkey
168
+ * bytes of self + the `p` tags — produces is the *key* `find_dm_by_participants`
169
+ * resolves, not the id itself. So re-opening is idempotent, because the same
170
+ * participants always hash to the same row and therefore name the same
171
+ * channel; but the uuid cannot be computed offline from the participants,
172
+ * and a client that tried would be inventing a channel nobody else has.
173
+ *
174
+ * Idempotence is what the caller gets to rely on: "message this person" never
175
+ * has to ask whether a DM already exists. Publish and use what comes back —
176
+ * see `commandPayload`, including the one case where nothing comes back.
164
177
  */
165
178
  DM_OPEN: 41010,
179
+ /**
180
+ * Hide a DM from the signer's own sidebar — `KIND_DM_HIDE`
181
+ * (`buzz-core/src/kind.rs`). A command like {@link KIND.DM_OPEN}: one `h`
182
+ * naming the DM channel, no content, and the caller must be a member of it.
183
+ *
184
+ * **Hiding is neither leaving nor deleting.** `handle_dm_hide` sets the
185
+ * caller's own `hidden_at` on their membership row and nothing else: the
186
+ * channel, every participant and every message survive, and the other
187
+ * participants are not told. What changes is the signer's
188
+ * {@link KIND.DM_VISIBILITY} snapshot, which the relay republishes after the
189
+ * hide.
190
+ *
191
+ * **There is no unhide command.** `open_dm` clears the caller's `hidden_at`
192
+ * when the DM already exists (`buzz-db/src/dm.rs`), so re-publishing the
193
+ * same {@link buildDmOpen} is how a hidden DM comes back — the relay
194
+ * republishes the snapshot on that path too. A message arriving in a hidden
195
+ * DM does *not* resurface it: nothing on the `kind:9` path touches
196
+ * `hidden_at`.
197
+ */
198
+ DM_HIDE: 41012,
199
+ /**
200
+ * The relay's per-viewer hidden-DM set — `KIND_DM_VISIBILITY`
201
+ * (`buzz-core/src/kind.rs`). **Relay-signed, and only ever read.** There is
202
+ * no builder for it here on purpose: `ingest.rs` refuses a client-authored
203
+ * one, and an app that signed one would be forging the relay's answer.
204
+ *
205
+ * Parameterized replaceable with `d` = the viewer's pubkey, carrying one `h`
206
+ * per hidden DM channel and a `p` = the viewer. It is result-gated on that
207
+ * `p` (`RESULT_GATED_KINDS`, `filter.rs:reader_authorized_for_event`): the
208
+ * read that works is `{ kinds: [30622], '#p': [me], limit: 1 }`, and a
209
+ * `#p` naming anybody else is refused rather than answered empty.
210
+ *
211
+ * The newest event is the whole set. The relay writes it again after every
212
+ * hide and every re-open, so a client applies the latest one wholesale and
213
+ * never merges successive snapshots.
214
+ */
215
+ DM_VISIBILITY: 30622,
166
216
  } as const
167
217
 
168
218
  /** `build_reaction` (builders.rs:463) caps the emoji at 64 chars. */
@@ -402,6 +452,63 @@ export function buildEditChannelMetadata(
402
452
  }
403
453
  }
404
454
 
455
+ /** A Folder command's `op`. `handle_folder_command` refuses anything else. */
456
+ export type FolderOp = 'add' | 'remove' | 'set'
457
+ const FOLDER_OPS: readonly string[] = ['add', 'remove', 'set']
458
+
459
+ /**
460
+ * kind:1852 Folder command — the tag shape `handle_folder_command` reads
461
+ * (`buzz-relay/src/handlers/side_effects.rs`, `nfb-demo-kinds`). Buzz has no
462
+ * builder for it: the kind is the relay's own and only clients send it.
463
+ *
464
+ * Tag order: h, op, a…, [name]. `a` tags keep the order given, because the
465
+ * relay appends them in that order and a Folder's order is the Folder's.
466
+ *
467
+ * - `add` and `remove` act on the addresses named and leave the rest alone;
468
+ * `set` replaces the list wholesale. `add` with no addresses keeps the
469
+ * contents and is how a name alone is changed — there is no `rename` op.
470
+ * - `name` is sticky: a command without one keeps the Folder's name.
471
+ * - The name goes through `canonicalChannelName`, as the channel's does. The
472
+ * state's name shadows the channel's wherever a Folder is listed, so the two
473
+ * homes must not disagree about a leading `#` or trailing space.
474
+ *
475
+ * **The relay computes the next state from the existing one, and a Folder with
476
+ * no `kind:30890` has none**, so any command against it emits state listing
477
+ * only what the command names — which hides everything filed in it by `h`.
478
+ * Whether that is safe is the caller's to know; the planners in
479
+ * `@estiva-app/interop` take it as an argument.
480
+ */
481
+ export function buildFolderCommand(
482
+ pubkey: string,
483
+ createdAtMs: number,
484
+ args: { folder: string; op: FolderOp; addresses?: string[]; name?: string },
485
+ ): UnsignedEvent {
486
+ assertHex64(pubkey, 'pubkey')
487
+ if (!args.folder) throw new Error('a folder command names the folder')
488
+ // The relay refuses an unknown op rather than defaulting it; so do we.
489
+ if (!FOLDER_OPS.includes(args.op)) throw new Error(`unknown folder op: ${String(args.op)}`)
490
+ const tags: NostrTag[] = [
491
+ ['h', args.folder],
492
+ ['op', args.op],
493
+ ]
494
+ for (const address of args.addresses ?? []) {
495
+ if (!address) throw new Error('a folder command address must not be empty')
496
+ tags.push(['a', address])
497
+ }
498
+ if (args.name !== undefined) {
499
+ const name = canonicalChannelName(args.name)
500
+ if (name.trim() === '') throw new Error('folder name is required')
501
+ tags.push(['name', name])
502
+ }
503
+ return {
504
+ pubkey,
505
+ created_at: toNostrSeconds(createdAtMs),
506
+ kind: KIND.FOLDER_COMMAND,
507
+ tags,
508
+ content: '',
509
+ }
510
+ }
511
+
405
512
  export type MemberRole = 'owner' | 'admin' | 'member'
406
513
 
407
514
  /**
@@ -465,6 +572,28 @@ export function buildDmOpen(pubkey: string, createdAtMs: number, args: { otherPu
465
572
  }
466
573
  }
467
574
 
575
+ /**
576
+ * kind:41012 hide a DM — mirrors `build_dm_hide` (`desktop/src-tauri/src/events.rs`).
577
+ *
578
+ * One `h` naming the DM channel, no content. The channel uuid is the one the
579
+ * relay answered a {@link buildDmOpen} with — there is no other way to hold
580
+ * one — and the relay rejects the hide unless the signer is a member of it.
581
+ *
582
+ * Undone by publishing the same `buildDmOpen` again, not by any event of this
583
+ * kind: see {@link KIND.DM_HIDE}.
584
+ */
585
+ export function buildDmHide(pubkey: string, createdAtMs: number, args: { channelUuid: string }): UnsignedEvent {
586
+ assertHex64(pubkey, 'pubkey')
587
+ if (!args.channelUuid) throw new Error('a DM hide names the channel to hide')
588
+ return {
589
+ pubkey,
590
+ created_at: toNostrSeconds(createdAtMs),
591
+ kind: KIND.DM_HIDE,
592
+ tags: [['h', args.channelUuid]],
593
+ content: '',
594
+ }
595
+ }
596
+
468
597
  /**
469
598
  * kind:7 reaction — mirrors `build_reaction` (builders.rs:463).
470
599
  *
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.21.0'
50
+ export const PROTOCOL_VERSION = '0.23.0'
51
51
 
52
52
  export {
53
53
  // types
@@ -59,6 +59,7 @@ export {
59
59
  type ChannelVisibility,
60
60
  type ChannelKind,
61
61
  type MemberRole,
62
+ type FolderOp,
62
63
  type Label,
63
64
  type ResolutionAction,
64
65
  // constants
@@ -83,8 +84,10 @@ export {
83
84
  buildCreateChannel,
84
85
  buildDeleteChannel,
85
86
  buildEditChannelMetadata,
87
+ buildFolderCommand,
86
88
  buildAddMember,
87
89
  buildDmOpen,
90
+ buildDmHide,
88
91
  buildReaction,
89
92
  buildDeletion,
90
93
  buildEdit,