@estiva-app/protocol 0.19.0 → 0.21.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 +58 -0
- package/dist/bridge.d.ts +32 -0
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +44 -1
- package/dist/bridge.js.map +1 -1
- package/dist/events.d.ts +76 -11
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +93 -11
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bridge.ts +56 -1
- package/src/events.ts +98 -16
- package/src/index.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,64 @@ 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.21.0 — 2026-09-17
|
|
8
|
+
|
|
9
|
+
**Wire behaviour: unchanged for every kind that was already published.** The
|
|
10
|
+
one new builder, `buildDmOpen`, emits a kind nothing in the suite had ever
|
|
11
|
+
sent; its bytes were checked against the relay before this was written, not
|
|
12
|
+
after (see below).
|
|
13
|
+
|
|
14
|
+
- **New: `buildDmOpen` (`kind:41010`) and `KIND.DM_OPEN`.** One `p` per *other*
|
|
15
|
+
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.
|
|
21
|
+
|
|
22
|
+
- **`PublishResult.message`, and `commandPayload` to read it.** The relay's
|
|
23
|
+
`message` was kept only on the `accepted:false` branch, where it becomes
|
|
24
|
+
`reason`; on the accepted branch it was dropped. For an ordinary event that
|
|
25
|
+
costs nothing, but a **command kind answers there** — `41010` replies
|
|
26
|
+
`response:{"channel_id":…,"created":…}`, and that uuid exists nowhere else.
|
|
27
|
+
Until now a caller could open a DM through `Relay.publish` and not learn what
|
|
28
|
+
it had opened (found by DMS-2, `estiva-agent#47`).
|
|
29
|
+
|
|
30
|
+
- **`duplicate` is now set on the accepted branch too**, when the message says
|
|
31
|
+
so. Measured against production on 2026-09-17: a *byte-identical* replay of a
|
|
32
|
+
command event is answered `accepted:true`, `"duplicate: already processed"`,
|
|
33
|
+
**and no payload** — `persist_command_event` keys on the event id, so the
|
|
34
|
+
relay never re-runs the handler and has nothing to report. That is not a
|
|
35
|
+
corner case: two clients opening the same DM in the same wall-clock second
|
|
36
|
+
sign identical bytes. A caller that could not see `duplicate` there would read
|
|
37
|
+
the missing payload as a command that simply answered nothing.
|
|
38
|
+
|
|
39
|
+
Both duplicate shapes now report the same two fields, which is the point:
|
|
40
|
+
`accepted:false` `"duplicate: channel already exists"` (a `9007` losing a
|
|
41
|
+
race) and `accepted:true` `"duplicate: already processed"` (a command event
|
|
42
|
+
replayed) mean the same thing to a caller.
|
|
43
|
+
|
|
44
|
+
## 0.20.0 — 2026-09-11
|
|
45
|
+
|
|
46
|
+
**Wire behaviour: the shape of `kind:30840` changes, and nothing already
|
|
47
|
+
published can disagree** — production held zero of them when the shape changed
|
|
48
|
+
(measured 2026-09-10), and no consumer called the old builder.
|
|
49
|
+
|
|
50
|
+
- **New: `buildBareFile`, replacing `buildFile`.** `kind:30840` is now the
|
|
51
|
+
**bare file** — SPEC §6.7, decided in RFC 0.5 §10.7: a file no app owns,
|
|
52
|
+
which a Peek topic now is. Tag order is normative: `d`, `title`, `h`, then at
|
|
53
|
+
most one `a` naming the file it sits under, **of any kind**. `h` is required
|
|
54
|
+
by the builder even though the relay only says SHOULD, for the reason issues
|
|
55
|
+
already give: several apps write these and one forgetting it puts an
|
|
56
|
+
unreachable object in the shared space. Content is a §13.3 block document or
|
|
57
|
+
empty — not NIP-FC's component list, which blocks having ids (RIC-5) and
|
|
58
|
+
attachments being blocks (RFC 0.6 §3) made redundant.
|
|
59
|
+
- **Deprecated: `buildComponent`.** Nothing publishes or reads a `30841`; kept
|
|
60
|
+
until COM-3 decides whether the number is retired or repurposed.
|
|
61
|
+
- The `file` wire vector is re-recorded as `bare-file`, with the reason in its
|
|
62
|
+
note. This is the one case where re-recording is right: the guard exists to
|
|
63
|
+
catch an app's bytes *drifting*, and here no app had ever produced any.
|
|
64
|
+
|
|
7
65
|
## 0.19.0 — 2026-09-10
|
|
8
66
|
|
|
9
67
|
**Wire behaviour: the bytes an upload sends change.** `uploadBlob` now strips
|
package/dist/bridge.d.ts
CHANGED
|
@@ -8,7 +8,39 @@ export interface PublishResult {
|
|
|
8
8
|
duplicate?: boolean;
|
|
9
9
|
/** The HTTP status, for a caller that wants to distinguish 403 from 500. */
|
|
10
10
|
httpStatus?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The relay's own `message`, on the branch where the publish succeeded.
|
|
13
|
+
*
|
|
14
|
+
* For an ordinary event this is absent or uninteresting. For a **command
|
|
15
|
+
* kind** it is the answer: `handle_dm_open` (`41010`) replies
|
|
16
|
+
* `response:{"channel_id":…,"created":…}`, and that uuid is the only place
|
|
17
|
+
* the created channel is named — the client cannot derive it, and no query
|
|
18
|
+
* returns it. Until DMS-3 this branch dropped `message`, so a caller opening
|
|
19
|
+
* a DM through {@link Relay.publish} could not learn what it had opened.
|
|
20
|
+
*
|
|
21
|
+
* Kept raw. {@link commandPayload} parses the `response:` form; a message
|
|
22
|
+
* that is not one (`"duplicate: already processed"`) is still readable here.
|
|
23
|
+
*/
|
|
24
|
+
message?: string;
|
|
11
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* The JSON a command kind answered with, or `undefined` if it did not answer.
|
|
28
|
+
*
|
|
29
|
+
* Buzz command kinds put their result in `IngestResult.message` as the string
|
|
30
|
+
* `response:<json>`. Two ways there is nothing to parse, and a caller must
|
|
31
|
+
* handle both because neither is an error:
|
|
32
|
+
*
|
|
33
|
+
* - **A replay.** `persist_command_event` keys on the *event id*, not on what
|
|
34
|
+
* the command means, so re-publishing byte-identical bytes short-circuits to
|
|
35
|
+
* `accepted:true`, `"duplicate: already processed"`, **no payload**. Measured
|
|
36
|
+
* on production 2026-09-17; the relay does not re-run the handler, so it has
|
|
37
|
+
* nothing to say. Two clients opening the same DM in the same wall-clock
|
|
38
|
+
* second sign identical events, so this is a race, not a corner case — and
|
|
39
|
+
* the way through is a *distinct* event (bump `created_at`), which re-runs
|
|
40
|
+
* the handler and answers with the payload again.
|
|
41
|
+
* - **A plain-language message**, which some kinds answer with instead.
|
|
42
|
+
*/
|
|
43
|
+
export declare function commandPayload(result: Pick<PublishResult, 'message'>): Record<string, unknown> | undefined;
|
|
12
44
|
/**
|
|
13
45
|
* The relay's answer to `POST /events`, interpreted.
|
|
14
46
|
*
|
package/dist/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,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AK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAOvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACG,QAAQ,CACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAClC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,WAAW,EAAE,CAAC;IA0GzB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;YACW,eAAe;IA+E7B;;;;;OAKG;YACW,UAAU;CA2EzB"}
|
package/dist/bridge.js
CHANGED
|
@@ -25,6 +25,35 @@
|
|
|
25
25
|
* reading `200` as success is a way to fail that no test notices.
|
|
26
26
|
*/
|
|
27
27
|
import { authorizationHeader } from './nip98.js';
|
|
28
|
+
/**
|
|
29
|
+
* The JSON a command kind answered with, or `undefined` if it did not answer.
|
|
30
|
+
*
|
|
31
|
+
* Buzz command kinds put their result in `IngestResult.message` as the string
|
|
32
|
+
* `response:<json>`. Two ways there is nothing to parse, and a caller must
|
|
33
|
+
* handle both because neither is an error:
|
|
34
|
+
*
|
|
35
|
+
* - **A replay.** `persist_command_event` keys on the *event id*, not on what
|
|
36
|
+
* the command means, so re-publishing byte-identical bytes short-circuits to
|
|
37
|
+
* `accepted:true`, `"duplicate: already processed"`, **no payload**. Measured
|
|
38
|
+
* on production 2026-09-17; the relay does not re-run the handler, so it has
|
|
39
|
+
* nothing to say. Two clients opening the same DM in the same wall-clock
|
|
40
|
+
* second sign identical events, so this is a race, not a corner case — and
|
|
41
|
+
* the way through is a *distinct* event (bump `created_at`), which re-runs
|
|
42
|
+
* the handler and answers with the payload again.
|
|
43
|
+
* - **A plain-language message**, which some kinds answer with instead.
|
|
44
|
+
*/
|
|
45
|
+
export function commandPayload(result) {
|
|
46
|
+
const message = result.message;
|
|
47
|
+
if (!message?.startsWith('response:'))
|
|
48
|
+
return undefined;
|
|
49
|
+
try {
|
|
50
|
+
const parsed = JSON.parse(message.slice('response:'.length));
|
|
51
|
+
return typeof parsed === 'object' && parsed !== null ? parsed : undefined;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
28
57
|
/**
|
|
29
58
|
* The relay's answer to `POST /events`, interpreted.
|
|
30
59
|
*
|
|
@@ -115,7 +144,21 @@ export function parsePublishResponse(status, text) {
|
|
|
115
144
|
const duplicate = (parsed.message ?? '').startsWith('duplicate:');
|
|
116
145
|
return { ok: duplicate, duplicate, eventId: parsed.event_id, reason: parsed.message, httpStatus: status };
|
|
117
146
|
}
|
|
118
|
-
|
|
147
|
+
/*
|
|
148
|
+
`duplicate:` arrives on *both* branches and means the same thing on each —
|
|
149
|
+
the relay already had this state. A channel create that loses the race says
|
|
150
|
+
it with `accepted:false`; a command event replayed byte-for-byte says it
|
|
151
|
+
with `accepted:true` (measured). A caller that reads `duplicate` to decide
|
|
152
|
+
whether to expect a payload must see it either way, or the accepted replay
|
|
153
|
+
looks like a command that simply answered nothing.
|
|
154
|
+
*/
|
|
155
|
+
const result = { ok: true, eventId: parsed.event_id, httpStatus: status };
|
|
156
|
+
if (parsed.message !== undefined) {
|
|
157
|
+
result.message = parsed.message;
|
|
158
|
+
if (parsed.message.startsWith('duplicate:'))
|
|
159
|
+
result.duplicate = true;
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
119
162
|
}
|
|
120
163
|
/** The relay's answer to `POST /query`, interpreted. */
|
|
121
164
|
export function parseQueryResponse(status, text) {
|
package/dist/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAchD;;;;;;;;GAQG;AACH;;;;;;;;;;;;;;;;;GA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CAAC,MAAM,CAAA;YACtF,IAAI,MAAM,CAAC,MAAM,GAAG,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB;gBAAE,MAAK;YAE/E,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;YAC3D,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;gBAC3C,IAAI,MAAM,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;oBAC9B,MAAM,IAAI,KAAK,CACb,uBAAuB,QAAQ,4BAA4B,KAAK,iCAAiC,CAClG,CAAA;gBACH,CAAC;gBACD,MAAK;YACP,CAAC;YACD,KAAK,GAAG,MAAM,CAAA;QAChB,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF"}
|
package/dist/events.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BlockDocument } from './blocks.js';
|
|
1
2
|
/** A Nostr tag: an array of strings whose first element is the tag name. */
|
|
2
3
|
export type NostrTag = string[];
|
|
3
4
|
/** An event before signing. `pubkey` is 64-char lowercase hex. */
|
|
@@ -106,6 +107,22 @@ export declare const KIND: {
|
|
|
106
107
|
* the first.
|
|
107
108
|
*/
|
|
108
109
|
readonly MESSAGE_EDIT: 40003;
|
|
110
|
+
/**
|
|
111
|
+
* Open a DM — `KIND_DM_OPEN` (`buzz-core/src/kind.rs:423`).
|
|
112
|
+
*
|
|
113
|
+
* A **command**, not a record, and the difference decides how a client uses
|
|
114
|
+
* 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
|
|
117
|
+
* mints its own uuid client-side and creates it with a `9007`; a DM cannot,
|
|
118
|
+
* and {@link buildDmOpen} is the whole of the client's side of that.
|
|
119
|
+
*
|
|
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.
|
|
124
|
+
*/
|
|
125
|
+
readonly DM_OPEN: 41010;
|
|
109
126
|
};
|
|
110
127
|
/** `build_reaction` (builders.rs:463) caps the emoji at 64 chars. */
|
|
111
128
|
export declare const MAX_EMOJI_CHARS = 64;
|
|
@@ -251,6 +268,26 @@ export declare function buildAddMember(pubkey: string, createdAtMs: number, args
|
|
|
251
268
|
targetPubkey: string;
|
|
252
269
|
role?: MemberRole;
|
|
253
270
|
}): UnsignedEvent;
|
|
271
|
+
/** `handle_dm_open` (command_executor.rs:328) rejects more than this many `p` tags. */
|
|
272
|
+
export declare const MAX_DM_OTHERS = 8;
|
|
273
|
+
/**
|
|
274
|
+
* kind:41010 open a DM — mirrors `build_dm_open` (builders.rs:1544).
|
|
275
|
+
*
|
|
276
|
+
* One `p` per **other** participant, in the order given; no `h`, no content.
|
|
277
|
+
*
|
|
278
|
+
* **Do not include your own pubkey.** The relay adds the signer to the set
|
|
279
|
+
* itself, so passing it once is harmless — `handle_dm_open` deduplicates before
|
|
280
|
+
* hashing — but it spends one of the eight slots the relay counts, because the
|
|
281
|
+
* cap is checked on the `p` tags as sent, before deduplication.
|
|
282
|
+
*
|
|
283
|
+
* The cap is rejected here rather than by the relay so nine participants fail
|
|
284
|
+
* where the caller can say something useful about it, instead of arriving as
|
|
285
|
+
* `invalid: pubkeys may contain at most 8 other participants` after a round
|
|
286
|
+
* trip. `p_tags.is_empty()` is refused the same way.
|
|
287
|
+
*/
|
|
288
|
+
export declare function buildDmOpen(pubkey: string, createdAtMs: number, args: {
|
|
289
|
+
otherPubkeys: string[];
|
|
290
|
+
}): UnsignedEvent;
|
|
254
291
|
/**
|
|
255
292
|
* kind:7 reaction — mirrors `build_reaction` (builders.rs:463).
|
|
256
293
|
*
|
|
@@ -418,26 +455,54 @@ export interface Label {
|
|
|
418
455
|
value: string;
|
|
419
456
|
}
|
|
420
457
|
/**
|
|
421
|
-
* kind:30840
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
458
|
+
* kind:30840 — the bare file. SPEC §6.7, decided in RFC 0.5 §10.7.
|
|
459
|
+
*
|
|
460
|
+
* A file **no app owns**. A Peek topic is one; so is any subject nobody has
|
|
461
|
+
* built a specialized app for. Typed kinds — a project, an issue — add
|
|
462
|
+
* properties on top of this shape; the bare file adds none, and that absence is
|
|
463
|
+
* the point: its projection is built into `@estiva-app/interop` rather than
|
|
464
|
+
* published, so no `kind:31990` can claim it.
|
|
465
|
+
*
|
|
466
|
+
* **Tag order is normative** (SPEC §6.1 — it is part of the id preimage):
|
|
467
|
+
* `d`, `title`, `h`, then `a` if the file sits under another. The `h` is
|
|
468
|
+
* REQUIRED by SPEC even though the relay only says SHOULD: several apps write
|
|
469
|
+
* bare files, and one forgetting it would put an unreachable object in the
|
|
470
|
+
* shared space, which is the argument the relay already makes for issues.
|
|
471
|
+
*
|
|
472
|
+
* The parent may be of **any kind** — a project, an issue, another bare file,
|
|
473
|
+
* or a kind this package has never heard of. Re-parenting later is a `parent`
|
|
474
|
+
* change event (`kind:1851`), not a republish; the root tag seeds the value.
|
|
475
|
+
*
|
|
476
|
+
* `content` is a §13.3 block document, or empty. A topic that is only a
|
|
477
|
+
* conversation has nothing here; the day somebody types a brief at the top,
|
|
478
|
+
* this is where it goes, and nothing about the file "converts".
|
|
479
|
+
*
|
|
480
|
+
* This replaces the NIP-FC `buildFile`, whose component list was made
|
|
481
|
+
* redundant by blocks having ids (RIC-5) and attachments being blocks
|
|
482
|
+
* (RFC 0.6 §3). Zero NIP-FC files existed on production when the shape
|
|
483
|
+
* changed (measured 2026-09-10), and no consumer called the old builder.
|
|
425
484
|
*/
|
|
426
|
-
export declare function
|
|
427
|
-
/** Stable
|
|
485
|
+
export declare function buildBareFile(pubkey: string, createdAtMs: number, args: {
|
|
486
|
+
/** Stable id, an opaque uuid (RFC 0.4 §4.3). Never a slug. */
|
|
428
487
|
fileId: string;
|
|
429
488
|
title: string;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
489
|
+
/** The team's channel. Required — see above. */
|
|
490
|
+
channelUuid: string;
|
|
491
|
+
/** Address of the file this one sits under, of any kind. At most one. */
|
|
492
|
+
parent?: string;
|
|
493
|
+
/** The body, when there is one. Serialized with `serializeBlockDocument`. */
|
|
494
|
+
document?: BlockDocument;
|
|
435
495
|
}): UnsignedEvent;
|
|
436
496
|
/**
|
|
437
497
|
* kind:30841 Component — NIP-FC.
|
|
438
498
|
*
|
|
439
499
|
* `type` must be namespaced `<namespace>/<name>`. The protocol defines the
|
|
440
500
|
* container; the payload shape belongs to the type.
|
|
501
|
+
*
|
|
502
|
+
* @deprecated Nothing publishes one and nothing reads one: blocks carry their
|
|
503
|
+
* own ids (SPEC §13.3), attachments are blocks (RFC 0.6 §3), and the bare file
|
|
504
|
+
* above needs no component list. Kept until COM-3 decides whether `30841` is
|
|
505
|
+
* retired or repurposed; do not build on it.
|
|
441
506
|
*/
|
|
442
507
|
export declare function buildComponent(pubkey: string, createdAtMs: number, args: {
|
|
443
508
|
componentId: string;
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"
|
|
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,U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,KAAK,EAAE,CAAA;CACjB,GACA,aAAa,CA0Bf;AAED;;;;;;;;GAQG;AACH,eAAO,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
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
*/
|
|
35
35
|
import { sha256 } from '@noble/hashes/sha256';
|
|
36
36
|
import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils';
|
|
37
|
+
import { serializeBlockDocument } from './blocks.js';
|
|
37
38
|
/**
|
|
38
39
|
* Buzz kind numbers used across the suite (crates/buzz-core/src/kind.rs).
|
|
39
40
|
*
|
|
@@ -127,6 +128,22 @@ export const KIND = {
|
|
|
127
128
|
* the first.
|
|
128
129
|
*/
|
|
129
130
|
MESSAGE_EDIT: 40003,
|
|
131
|
+
/**
|
|
132
|
+
* Open a DM — `KIND_DM_OPEN` (`buzz-core/src/kind.rs:423`).
|
|
133
|
+
*
|
|
134
|
+
* A **command**, not a record, and the difference decides how a client uses
|
|
135
|
+
* 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
|
|
138
|
+
* mints its own uuid client-side and creates it with a `9007`; a DM cannot,
|
|
139
|
+
* and {@link buildDmOpen} is the whole of the client's side of that.
|
|
140
|
+
*
|
|
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.
|
|
145
|
+
*/
|
|
146
|
+
DM_OPEN: 41010,
|
|
130
147
|
};
|
|
131
148
|
/** `build_reaction` (builders.rs:463) caps the emoji at 64 chars. */
|
|
132
149
|
export const MAX_EMOJI_CHARS = 64;
|
|
@@ -344,6 +361,41 @@ export function buildAddMember(pubkey, createdAtMs, args) {
|
|
|
344
361
|
content: '',
|
|
345
362
|
};
|
|
346
363
|
}
|
|
364
|
+
/** `handle_dm_open` (command_executor.rs:328) rejects more than this many `p` tags. */
|
|
365
|
+
export const MAX_DM_OTHERS = 8;
|
|
366
|
+
/**
|
|
367
|
+
* kind:41010 open a DM — mirrors `build_dm_open` (builders.rs:1544).
|
|
368
|
+
*
|
|
369
|
+
* One `p` per **other** participant, in the order given; no `h`, no content.
|
|
370
|
+
*
|
|
371
|
+
* **Do not include your own pubkey.** The relay adds the signer to the set
|
|
372
|
+
* itself, so passing it once is harmless — `handle_dm_open` deduplicates before
|
|
373
|
+
* hashing — but it spends one of the eight slots the relay counts, because the
|
|
374
|
+
* cap is checked on the `p` tags as sent, before deduplication.
|
|
375
|
+
*
|
|
376
|
+
* The cap is rejected here rather than by the relay so nine participants fail
|
|
377
|
+
* where the caller can say something useful about it, instead of arriving as
|
|
378
|
+
* `invalid: pubkeys may contain at most 8 other participants` after a round
|
|
379
|
+
* trip. `p_tags.is_empty()` is refused the same way.
|
|
380
|
+
*/
|
|
381
|
+
export function buildDmOpen(pubkey, createdAtMs, args) {
|
|
382
|
+
assertHex64(pubkey, 'pubkey');
|
|
383
|
+
const others = args.otherPubkeys.map((p) => p.toLowerCase());
|
|
384
|
+
if (others.length === 0)
|
|
385
|
+
throw new Error('a DM needs at least one other participant');
|
|
386
|
+
if (others.length > MAX_DM_OTHERS) {
|
|
387
|
+
throw new Error(`a DM takes at most ${MAX_DM_OTHERS} other participants (${others.length} given)`);
|
|
388
|
+
}
|
|
389
|
+
for (const other of others)
|
|
390
|
+
assertHex64(other, 'otherPubkey');
|
|
391
|
+
return {
|
|
392
|
+
pubkey,
|
|
393
|
+
created_at: toNostrSeconds(createdAtMs),
|
|
394
|
+
kind: KIND.DM_OPEN,
|
|
395
|
+
tags: others.map((other) => ['p', other]),
|
|
396
|
+
content: '',
|
|
397
|
+
};
|
|
398
|
+
}
|
|
347
399
|
/**
|
|
348
400
|
* kind:7 reaction — mirrors `build_reaction` (builders.rs:463).
|
|
349
401
|
*
|
|
@@ -573,28 +625,53 @@ export function buildResolution(pubkey, createdAtMs, args) {
|
|
|
573
625
|
};
|
|
574
626
|
}
|
|
575
627
|
/**
|
|
576
|
-
* kind:30840
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
*
|
|
628
|
+
* kind:30840 — the bare file. SPEC §6.7, decided in RFC 0.5 §10.7.
|
|
629
|
+
*
|
|
630
|
+
* A file **no app owns**. A Peek topic is one; so is any subject nobody has
|
|
631
|
+
* built a specialized app for. Typed kinds — a project, an issue — add
|
|
632
|
+
* properties on top of this shape; the bare file adds none, and that absence is
|
|
633
|
+
* the point: its projection is built into `@estiva-app/interop` rather than
|
|
634
|
+
* published, so no `kind:31990` can claim it.
|
|
635
|
+
*
|
|
636
|
+
* **Tag order is normative** (SPEC §6.1 — it is part of the id preimage):
|
|
637
|
+
* `d`, `title`, `h`, then `a` if the file sits under another. The `h` is
|
|
638
|
+
* REQUIRED by SPEC even though the relay only says SHOULD: several apps write
|
|
639
|
+
* bare files, and one forgetting it would put an unreachable object in the
|
|
640
|
+
* shared space, which is the argument the relay already makes for issues.
|
|
641
|
+
*
|
|
642
|
+
* The parent may be of **any kind** — a project, an issue, another bare file,
|
|
643
|
+
* or a kind this package has never heard of. Re-parenting later is a `parent`
|
|
644
|
+
* change event (`kind:1851`), not a republish; the root tag seeds the value.
|
|
645
|
+
*
|
|
646
|
+
* `content` is a §13.3 block document, or empty. A topic that is only a
|
|
647
|
+
* conversation has nothing here; the day somebody types a brief at the top,
|
|
648
|
+
* this is where it goes, and nothing about the file "converts".
|
|
649
|
+
*
|
|
650
|
+
* This replaces the NIP-FC `buildFile`, whose component list was made
|
|
651
|
+
* redundant by blocks having ids (RIC-5) and attachments being blocks
|
|
652
|
+
* (RFC 0.6 §3). Zero NIP-FC files existed on production when the shape
|
|
653
|
+
* changed (measured 2026-09-10), and no consumer called the old builder.
|
|
580
654
|
*/
|
|
581
|
-
export function
|
|
655
|
+
export function buildBareFile(pubkey, createdAtMs, args) {
|
|
582
656
|
assertHex64(pubkey, 'pubkey');
|
|
657
|
+
if (!args.channelUuid)
|
|
658
|
+
throw new Error('a bare file must name the team channel it lives in (h)');
|
|
659
|
+
if (args.parent !== undefined && !/^\d+:[0-9a-f]{64}:/.test(args.parent)) {
|
|
660
|
+
throw new Error(`parent must be an address "<kind>:<pubkey>:<d>", got "${args.parent}"`);
|
|
661
|
+
}
|
|
583
662
|
const tags = [
|
|
584
663
|
['d', args.fileId],
|
|
585
664
|
['title', args.title],
|
|
665
|
+
['h', args.channelUuid],
|
|
586
666
|
];
|
|
587
|
-
if (args.
|
|
588
|
-
tags.push(['
|
|
589
|
-
for (const d of args.componentDTags) {
|
|
590
|
-
tags.push(['a', addr(KIND.COMPONENT, pubkey, d)]);
|
|
591
|
-
}
|
|
667
|
+
if (args.parent)
|
|
668
|
+
tags.push(['a', args.parent]);
|
|
592
669
|
return {
|
|
593
670
|
pubkey,
|
|
594
671
|
created_at: toNostrSeconds(createdAtMs),
|
|
595
672
|
kind: KIND.FILE,
|
|
596
673
|
tags,
|
|
597
|
-
content: args.
|
|
674
|
+
content: args.document ? serializeBlockDocument(args.document) : '',
|
|
598
675
|
};
|
|
599
676
|
}
|
|
600
677
|
/**
|
|
@@ -602,6 +679,11 @@ export function buildFile(pubkey, createdAtMs, args) {
|
|
|
602
679
|
*
|
|
603
680
|
* `type` must be namespaced `<namespace>/<name>`. The protocol defines the
|
|
604
681
|
* container; the payload shape belongs to the type.
|
|
682
|
+
*
|
|
683
|
+
* @deprecated Nothing publishes one and nothing reads one: blocks carry their
|
|
684
|
+
* own ids (SPEC §13.3), attachments are blocks (RFC 0.6 §3), and the bare file
|
|
685
|
+
* above needs no component list. Kept until COM-3 decides whether `30841` is
|
|
686
|
+
* retired or repurposed; do not build on it.
|
|
605
687
|
*/
|
|
606
688
|
export function buildComponent(pubkey, createdAtMs, args) {
|
|
607
689
|
assertHex64(pubkey, 'pubkey');
|
package/dist/events.js.map
CHANGED
|
@@ -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;AAoB7D;;;;;;;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;;;;;;;;;;OAUG;IACH,SAAS,EAAE,IAAI;IACf;;;;;;;;OAQG;IACH,OAAO,EAAE,IAAI;IACb,wBAAwB;IACxB,SAAS,EAAE,IAAI;IACf;;;;;;;;;;;;;;OAcG;IACH,QAAQ,EAAE,KAAK;IACf,0EAA0E;IAC1E,IAAI,EAAE,KAAK;IACX,wBAAwB;IACxB,SAAS,EAAE,KAAK;IAChB;;;;;;;;OAQG;IACH,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,KAAK;IAChB;;;;;;OAMG;IACH,YAAY,EAAE,KAAK;IACnB;;;;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,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,12 +46,12 @@
|
|
|
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.
|
|
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_RATIONALE_BYTES, RELAY_AUTH_TOLERANCE_SECS, ASSERTION_SUBTYPE, computeEventId, toNostrSeconds, canonicalChannelName, threadTags, addr, relayAuthUrl, buildProfile, parseProfile, buildCreateChannel, buildDeleteChannel, buildEditChannelMetadata, buildAddMember, buildReaction, buildDeletion, buildEdit, buildMessage, buildResolution,
|
|
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';
|
|
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';
|
|
54
|
-
export { type PublishResult, type QueryResult, type RelayHeaders, type RelayOptions, type FetchLike, type QueryAllOptions, parsePublishResponse, parseQueryResponse, RELAY_PAGE_CEILING, DEFAULT_QUERY_CONCURRENCY, MAX_FILTERS_PER_QUERY, Relay, } from './bridge.js';
|
|
54
|
+
export { type PublishResult, type QueryResult, type RelayHeaders, type RelayOptions, type FetchLike, type QueryAllOptions, parsePublishResponse, parseQueryResponse, commandPayload, RELAY_PAGE_CEILING, DEFAULT_QUERY_CONCURRENCY, MAX_FILTERS_PER_QUERY, Relay, } from './bridge.js';
|
|
55
55
|
export { type RelayState, type SocketLike, type RelayCredential, type LiveRelayOptions, type Subscription, type LiveRelay, toWebSocketUrl, parseFrame, createLiveRelay, } from './live.js';
|
|
56
56
|
export { type ChannelEventHandler, type ChannelSubscription, type ChannelSubscriptions, createChannelSubscriptions, } from './subscriptions.js';
|
|
57
57
|
export { type InlineMark, type InlineMarkSpan, type BodySegment, type InlineMarkNode, type InlineTextNode, parseInlineMarks, wrapInlineMarks, parseBodySegments, stripInlineFormatting, markersToInlineNodes, inlineNodesToMarkers, inlineNodesToText, } from './content.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,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,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY,EACZ,eAAe,EACf,
|
|
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;AAEnB,OAAO,EACL,KAAK,aAAa,EAClB,wBAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,MAAM,EACN,sB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AClB,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"}
|
package/dist/index.js
CHANGED
|
@@ -46,18 +46,18 @@
|
|
|
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.
|
|
49
|
+
export const PROTOCOL_VERSION = '0.21.0';
|
|
50
50
|
export {
|
|
51
51
|
// constants
|
|
52
|
-
KIND, MAX_EMOJI_CHARS, MAX_MESSAGE_BYTES, MAX_MENTIONS, MAX_RATIONALE_BYTES, RELAY_AUTH_TOLERANCE_SECS, ASSERTION_SUBTYPE,
|
|
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, buildReaction, buildDeletion, buildEdit, buildMessage, buildResolution,
|
|
56
|
+
buildProfile, parseProfile, buildCreateChannel, buildDeleteChannel, buildEditChannelMetadata, buildAddMember, buildDmOpen, 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';
|
|
60
|
-
export { parsePublishResponse, parseQueryResponse, RELAY_PAGE_CEILING, DEFAULT_QUERY_CONCURRENCY, MAX_FILTERS_PER_QUERY, Relay, } from './bridge.js';
|
|
60
|
+
export { parsePublishResponse, parseQueryResponse, commandPayload, RELAY_PAGE_CEILING, DEFAULT_QUERY_CONCURRENCY, MAX_FILTERS_PER_QUERY, Relay, } from './bridge.js';
|
|
61
61
|
export { toWebSocketUrl, parseFrame, createLiveRelay, } from './live.js';
|
|
62
62
|
export { createChannelSubscriptions, } from './subscriptions.js';
|
|
63
63
|
export { parseInlineMarks, wrapInlineMarks, parseBodySegments, stripInlineFormatting, markersToInlineNodes, inlineNodesToMarkers, inlineNodesToText, } from './content.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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Q,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.
|
|
3
|
+
"version": "0.21.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/bridge.ts
CHANGED
|
@@ -36,6 +36,48 @@ export interface PublishResult {
|
|
|
36
36
|
duplicate?: boolean
|
|
37
37
|
/** The HTTP status, for a caller that wants to distinguish 403 from 500. */
|
|
38
38
|
httpStatus?: number
|
|
39
|
+
/**
|
|
40
|
+
* The relay's own `message`, on the branch where the publish succeeded.
|
|
41
|
+
*
|
|
42
|
+
* For an ordinary event this is absent or uninteresting. For a **command
|
|
43
|
+
* kind** it is the answer: `handle_dm_open` (`41010`) replies
|
|
44
|
+
* `response:{"channel_id":…,"created":…}`, and that uuid is the only place
|
|
45
|
+
* the created channel is named — the client cannot derive it, and no query
|
|
46
|
+
* returns it. Until DMS-3 this branch dropped `message`, so a caller opening
|
|
47
|
+
* a DM through {@link Relay.publish} could not learn what it had opened.
|
|
48
|
+
*
|
|
49
|
+
* Kept raw. {@link commandPayload} parses the `response:` form; a message
|
|
50
|
+
* that is not one (`"duplicate: already processed"`) is still readable here.
|
|
51
|
+
*/
|
|
52
|
+
message?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The JSON a command kind answered with, or `undefined` if it did not answer.
|
|
57
|
+
*
|
|
58
|
+
* Buzz command kinds put their result in `IngestResult.message` as the string
|
|
59
|
+
* `response:<json>`. Two ways there is nothing to parse, and a caller must
|
|
60
|
+
* handle both because neither is an error:
|
|
61
|
+
*
|
|
62
|
+
* - **A replay.** `persist_command_event` keys on the *event id*, not on what
|
|
63
|
+
* the command means, so re-publishing byte-identical bytes short-circuits to
|
|
64
|
+
* `accepted:true`, `"duplicate: already processed"`, **no payload**. Measured
|
|
65
|
+
* on production 2026-09-17; the relay does not re-run the handler, so it has
|
|
66
|
+
* nothing to say. Two clients opening the same DM in the same wall-clock
|
|
67
|
+
* second sign identical events, so this is a race, not a corner case — and
|
|
68
|
+
* the way through is a *distinct* event (bump `created_at`), which re-runs
|
|
69
|
+
* the handler and answers with the payload again.
|
|
70
|
+
* - **A plain-language message**, which some kinds answer with instead.
|
|
71
|
+
*/
|
|
72
|
+
export function commandPayload(result: Pick<PublishResult, 'message'>): Record<string, unknown> | undefined {
|
|
73
|
+
const message = result.message
|
|
74
|
+
if (!message?.startsWith('response:')) return undefined
|
|
75
|
+
try {
|
|
76
|
+
const parsed: unknown = JSON.parse(message.slice('response:'.length))
|
|
77
|
+
return typeof parsed === 'object' && parsed !== null ? (parsed as Record<string, unknown>) : undefined
|
|
78
|
+
} catch {
|
|
79
|
+
return undefined
|
|
80
|
+
}
|
|
39
81
|
}
|
|
40
82
|
|
|
41
83
|
/**
|
|
@@ -147,7 +189,20 @@ export function parsePublishResponse(status: number, text: string): PublishResul
|
|
|
147
189
|
const duplicate = (parsed.message ?? '').startsWith('duplicate:')
|
|
148
190
|
return { ok: duplicate, duplicate, eventId: parsed.event_id, reason: parsed.message, httpStatus: status }
|
|
149
191
|
}
|
|
150
|
-
|
|
192
|
+
/*
|
|
193
|
+
`duplicate:` arrives on *both* branches and means the same thing on each —
|
|
194
|
+
the relay already had this state. A channel create that loses the race says
|
|
195
|
+
it with `accepted:false`; a command event replayed byte-for-byte says it
|
|
196
|
+
with `accepted:true` (measured). A caller that reads `duplicate` to decide
|
|
197
|
+
whether to expect a payload must see it either way, or the accepted replay
|
|
198
|
+
looks like a command that simply answered nothing.
|
|
199
|
+
*/
|
|
200
|
+
const result: PublishResult = { ok: true, eventId: parsed.event_id, httpStatus: status }
|
|
201
|
+
if (parsed.message !== undefined) {
|
|
202
|
+
result.message = parsed.message
|
|
203
|
+
if (parsed.message.startsWith('duplicate:')) result.duplicate = true
|
|
204
|
+
}
|
|
205
|
+
return result
|
|
151
206
|
}
|
|
152
207
|
|
|
153
208
|
export interface QueryResult {
|
package/src/events.ts
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
*/
|
|
35
35
|
import { sha256 } from '@noble/hashes/sha256'
|
|
36
36
|
import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils'
|
|
37
|
+
import { type BlockDocument, serializeBlockDocument } from './blocks.js'
|
|
37
38
|
|
|
38
39
|
/** A Nostr tag: an array of strings whose first element is the tag name. */
|
|
39
40
|
export type NostrTag = string[]
|
|
@@ -146,6 +147,22 @@ export const KIND = {
|
|
|
146
147
|
* the first.
|
|
147
148
|
*/
|
|
148
149
|
MESSAGE_EDIT: 40003,
|
|
150
|
+
/**
|
|
151
|
+
* Open a DM — `KIND_DM_OPEN` (`buzz-core/src/kind.rs:423`).
|
|
152
|
+
*
|
|
153
|
+
* A **command**, not a record, and the difference decides how a client uses
|
|
154
|
+
* 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
|
|
157
|
+
* mints its own uuid client-side and creates it with a `9007`; a DM cannot,
|
|
158
|
+
* and {@link buildDmOpen} is the whole of the client's side of that.
|
|
159
|
+
*
|
|
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.
|
|
164
|
+
*/
|
|
165
|
+
DM_OPEN: 41010,
|
|
149
166
|
} as const
|
|
150
167
|
|
|
151
168
|
/** `build_reaction` (builders.rs:463) caps the emoji at 64 chars. */
|
|
@@ -413,6 +430,41 @@ export function buildAddMember(
|
|
|
413
430
|
}
|
|
414
431
|
}
|
|
415
432
|
|
|
433
|
+
/** `handle_dm_open` (command_executor.rs:328) rejects more than this many `p` tags. */
|
|
434
|
+
export const MAX_DM_OTHERS = 8
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* kind:41010 open a DM — mirrors `build_dm_open` (builders.rs:1544).
|
|
438
|
+
*
|
|
439
|
+
* One `p` per **other** participant, in the order given; no `h`, no content.
|
|
440
|
+
*
|
|
441
|
+
* **Do not include your own pubkey.** The relay adds the signer to the set
|
|
442
|
+
* itself, so passing it once is harmless — `handle_dm_open` deduplicates before
|
|
443
|
+
* hashing — but it spends one of the eight slots the relay counts, because the
|
|
444
|
+
* cap is checked on the `p` tags as sent, before deduplication.
|
|
445
|
+
*
|
|
446
|
+
* The cap is rejected here rather than by the relay so nine participants fail
|
|
447
|
+
* where the caller can say something useful about it, instead of arriving as
|
|
448
|
+
* `invalid: pubkeys may contain at most 8 other participants` after a round
|
|
449
|
+
* trip. `p_tags.is_empty()` is refused the same way.
|
|
450
|
+
*/
|
|
451
|
+
export function buildDmOpen(pubkey: string, createdAtMs: number, args: { otherPubkeys: string[] }): UnsignedEvent {
|
|
452
|
+
assertHex64(pubkey, 'pubkey')
|
|
453
|
+
const others = args.otherPubkeys.map((p) => p.toLowerCase())
|
|
454
|
+
if (others.length === 0) throw new Error('a DM needs at least one other participant')
|
|
455
|
+
if (others.length > MAX_DM_OTHERS) {
|
|
456
|
+
throw new Error(`a DM takes at most ${MAX_DM_OTHERS} other participants (${others.length} given)`)
|
|
457
|
+
}
|
|
458
|
+
for (const other of others) assertHex64(other, 'otherPubkey')
|
|
459
|
+
return {
|
|
460
|
+
pubkey,
|
|
461
|
+
created_at: toNostrSeconds(createdAtMs),
|
|
462
|
+
kind: KIND.DM_OPEN,
|
|
463
|
+
tags: others.map((other): NostrTag => ['p', other]),
|
|
464
|
+
content: '',
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
416
468
|
/**
|
|
417
469
|
* kind:7 reaction — mirrors `build_reaction` (builders.rs:463).
|
|
418
470
|
*
|
|
@@ -726,40 +778,65 @@ export interface Label {
|
|
|
726
778
|
}
|
|
727
779
|
|
|
728
780
|
/**
|
|
729
|
-
* kind:30840
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
781
|
+
* kind:30840 — the bare file. SPEC §6.7, decided in RFC 0.5 §10.7.
|
|
782
|
+
*
|
|
783
|
+
* A file **no app owns**. A Peek topic is one; so is any subject nobody has
|
|
784
|
+
* built a specialized app for. Typed kinds — a project, an issue — add
|
|
785
|
+
* properties on top of this shape; the bare file adds none, and that absence is
|
|
786
|
+
* the point: its projection is built into `@estiva-app/interop` rather than
|
|
787
|
+
* published, so no `kind:31990` can claim it.
|
|
788
|
+
*
|
|
789
|
+
* **Tag order is normative** (SPEC §6.1 — it is part of the id preimage):
|
|
790
|
+
* `d`, `title`, `h`, then `a` if the file sits under another. The `h` is
|
|
791
|
+
* REQUIRED by SPEC even though the relay only says SHOULD: several apps write
|
|
792
|
+
* bare files, and one forgetting it would put an unreachable object in the
|
|
793
|
+
* shared space, which is the argument the relay already makes for issues.
|
|
794
|
+
*
|
|
795
|
+
* The parent may be of **any kind** — a project, an issue, another bare file,
|
|
796
|
+
* or a kind this package has never heard of. Re-parenting later is a `parent`
|
|
797
|
+
* change event (`kind:1851`), not a republish; the root tag seeds the value.
|
|
798
|
+
*
|
|
799
|
+
* `content` is a §13.3 block document, or empty. A topic that is only a
|
|
800
|
+
* conversation has nothing here; the day somebody types a brief at the top,
|
|
801
|
+
* this is where it goes, and nothing about the file "converts".
|
|
802
|
+
*
|
|
803
|
+
* This replaces the NIP-FC `buildFile`, whose component list was made
|
|
804
|
+
* redundant by blocks having ids (RIC-5) and attachments being blocks
|
|
805
|
+
* (RFC 0.6 §3). Zero NIP-FC files existed on production when the shape
|
|
806
|
+
* changed (measured 2026-09-10), and no consumer called the old builder.
|
|
733
807
|
*/
|
|
734
|
-
export function
|
|
808
|
+
export function buildBareFile(
|
|
735
809
|
pubkey: string,
|
|
736
810
|
createdAtMs: number,
|
|
737
811
|
args: {
|
|
738
|
-
/** Stable
|
|
812
|
+
/** Stable id, an opaque uuid (RFC 0.4 §4.3). Never a slug. */
|
|
739
813
|
fileId: string
|
|
740
814
|
title: string
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
815
|
+
/** The team's channel. Required — see above. */
|
|
816
|
+
channelUuid: string
|
|
817
|
+
/** Address of the file this one sits under, of any kind. At most one. */
|
|
818
|
+
parent?: string
|
|
819
|
+
/** The body, when there is one. Serialized with `serializeBlockDocument`. */
|
|
820
|
+
document?: BlockDocument
|
|
746
821
|
},
|
|
747
822
|
): UnsignedEvent {
|
|
748
823
|
assertHex64(pubkey, 'pubkey')
|
|
824
|
+
if (!args.channelUuid) throw new Error('a bare file must name the team channel it lives in (h)')
|
|
825
|
+
if (args.parent !== undefined && !/^\d+:[0-9a-f]{64}:/.test(args.parent)) {
|
|
826
|
+
throw new Error(`parent must be an address "<kind>:<pubkey>:<d>", got "${args.parent}"`)
|
|
827
|
+
}
|
|
749
828
|
const tags: NostrTag[] = [
|
|
750
829
|
['d', args.fileId],
|
|
751
830
|
['title', args.title],
|
|
831
|
+
['h', args.channelUuid],
|
|
752
832
|
]
|
|
753
|
-
if (args.
|
|
754
|
-
for (const d of args.componentDTags) {
|
|
755
|
-
tags.push(['a', addr(KIND.COMPONENT, pubkey, d)])
|
|
756
|
-
}
|
|
833
|
+
if (args.parent) tags.push(['a', args.parent])
|
|
757
834
|
return {
|
|
758
835
|
pubkey,
|
|
759
836
|
created_at: toNostrSeconds(createdAtMs),
|
|
760
837
|
kind: KIND.FILE,
|
|
761
838
|
tags,
|
|
762
|
-
content: args.
|
|
839
|
+
content: args.document ? serializeBlockDocument(args.document) : '',
|
|
763
840
|
}
|
|
764
841
|
}
|
|
765
842
|
|
|
@@ -768,6 +845,11 @@ export function buildFile(
|
|
|
768
845
|
*
|
|
769
846
|
* `type` must be namespaced `<namespace>/<name>`. The protocol defines the
|
|
770
847
|
* container; the payload shape belongs to the type.
|
|
848
|
+
*
|
|
849
|
+
* @deprecated Nothing publishes one and nothing reads one: blocks carry their
|
|
850
|
+
* own ids (SPEC §13.3), attachments are blocks (RFC 0.6 §3), and the bare file
|
|
851
|
+
* above needs no component list. Kept until COM-3 decides whether `30841` is
|
|
852
|
+
* retired or repurposed; do not build on it.
|
|
771
853
|
*/
|
|
772
854
|
export function buildComponent(
|
|
773
855
|
pubkey: string,
|
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.
|
|
50
|
+
export const PROTOCOL_VERSION = '0.21.0'
|
|
51
51
|
|
|
52
52
|
export {
|
|
53
53
|
// types
|
|
@@ -66,6 +66,7 @@ export {
|
|
|
66
66
|
MAX_EMOJI_CHARS,
|
|
67
67
|
MAX_MESSAGE_BYTES,
|
|
68
68
|
MAX_MENTIONS,
|
|
69
|
+
MAX_DM_OTHERS,
|
|
69
70
|
MAX_RATIONALE_BYTES,
|
|
70
71
|
RELAY_AUTH_TOLERANCE_SECS,
|
|
71
72
|
ASSERTION_SUBTYPE,
|
|
@@ -83,12 +84,13 @@ export {
|
|
|
83
84
|
buildDeleteChannel,
|
|
84
85
|
buildEditChannelMetadata,
|
|
85
86
|
buildAddMember,
|
|
87
|
+
buildDmOpen,
|
|
86
88
|
buildReaction,
|
|
87
89
|
buildDeletion,
|
|
88
90
|
buildEdit,
|
|
89
91
|
buildMessage,
|
|
90
92
|
buildResolution,
|
|
91
|
-
|
|
93
|
+
buildBareFile,
|
|
92
94
|
buildComponent,
|
|
93
95
|
buildHighlight,
|
|
94
96
|
buildUnsignedRelayAuthEvent,
|
|
@@ -145,6 +147,7 @@ export {
|
|
|
145
147
|
type QueryAllOptions,
|
|
146
148
|
parsePublishResponse,
|
|
147
149
|
parseQueryResponse,
|
|
150
|
+
commandPayload,
|
|
148
151
|
RELAY_PAGE_CEILING,
|
|
149
152
|
DEFAULT_QUERY_CONCURRENCY,
|
|
150
153
|
MAX_FILTERS_PER_QUERY,
|