@fabric-harness/channels 0.17.4 → 0.19.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/README.md +116 -0
- package/dist/buzz-decisions.d.ts +200 -0
- package/dist/buzz-decisions.d.ts.map +1 -0
- package/dist/buzz-decisions.js +300 -0
- package/dist/buzz-decisions.js.map +1 -0
- package/dist/buzz-kinds.d.ts +34 -0
- package/dist/buzz-kinds.d.ts.map +1 -0
- package/dist/buzz-kinds.js +34 -0
- package/dist/buzz-kinds.js.map +1 -0
- package/dist/buzz-postgres.d.ts +33 -0
- package/dist/buzz-postgres.d.ts.map +1 -0
- package/dist/buzz-postgres.js +163 -0
- package/dist/buzz-postgres.js.map +1 -0
- package/dist/buzz-tail.d.ts +162 -0
- package/dist/buzz-tail.d.ts.map +1 -0
- package/dist/buzz-tail.js +487 -0
- package/dist/buzz-tail.js.map +1 -0
- package/dist/buzz.d.ts +183 -0
- package/dist/buzz.d.ts.map +1 -0
- package/dist/buzz.js +423 -0
- package/dist/buzz.js.map +1 -0
- package/dist/compatibility.d.ts +7 -0
- package/dist/compatibility.d.ts.map +1 -1
- package/dist/compatibility.js +1 -0
- package/dist/compatibility.js.map +1 -1
- package/package.json +26 -9
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored Buzz event-kind constants.
|
|
3
|
+
*
|
|
4
|
+
* Buzz (block/buzz) defines every event kind as a compile-time constant in
|
|
5
|
+
* `crates/buzz-core/src/kind.rs` and its relay rejects unknown kinds at ingest.
|
|
6
|
+
* We vendor only the kinds this adapter touches and keep them honest with
|
|
7
|
+
* `scripts/sync-buzz-kinds.mjs`, which diffs this table against a Buzz checkout
|
|
8
|
+
* (the same convention Buzz uses for its own desktop and mobile clients).
|
|
9
|
+
*
|
|
10
|
+
* Key names mirror the Rust constants minus the `KIND_` prefix so the sync
|
|
11
|
+
* script can match them mechanically. Do not add kinds that are not consumed
|
|
12
|
+
* by the adapter — vendoring the whole registry just widens the drift surface.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BUZZ_KINDS: {
|
|
15
|
+
/** NIP-25 reaction — the decision-input event (👍 / 👎 on a request card). */
|
|
16
|
+
readonly REACTION: 7;
|
|
17
|
+
/** Stream (channel chat) message. */
|
|
18
|
+
readonly STREAM_MESSAGE: 9;
|
|
19
|
+
/** NIP-42 client authentication event. */
|
|
20
|
+
readonly AUTH: 22242;
|
|
21
|
+
/** NIP-43 relay membership list (published by `buzz-admin add-member`). */
|
|
22
|
+
readonly NIP43_MEMBERSHIP_LIST: 13534;
|
|
23
|
+
/** NIP-29 group (channel) metadata. */
|
|
24
|
+
readonly NIP29_GROUP_METADATA: 39000;
|
|
25
|
+
/** Forum post (long-form surface). */
|
|
26
|
+
readonly FORUM_POST: 45001;
|
|
27
|
+
/** Forum comment. */
|
|
28
|
+
readonly FORUM_COMMENT: 45003;
|
|
29
|
+
/** Buzz workflow approval grant. Not consumed by the adapter (durable gates
|
|
30
|
+
* live in Temporal) — vendored so the sync script guards the constant we
|
|
31
|
+
* reference in docs and refuse to depend on. */
|
|
32
|
+
readonly APPROVAL_GRANT: 46030;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=buzz-kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buzz-kinds.d.ts","sourceRoot":"","sources":["../src/buzz-kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU;IACrB,8EAA8E;;IAE9E,qCAAqC;;IAErC,0CAA0C;;IAE1C,2EAA2E;;IAE3E,uCAAuC;;IAEvC,sCAAsC;;IAEtC,qBAAqB;;IAErB;;oDAEgD;;CAExC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored Buzz event-kind constants.
|
|
3
|
+
*
|
|
4
|
+
* Buzz (block/buzz) defines every event kind as a compile-time constant in
|
|
5
|
+
* `crates/buzz-core/src/kind.rs` and its relay rejects unknown kinds at ingest.
|
|
6
|
+
* We vendor only the kinds this adapter touches and keep them honest with
|
|
7
|
+
* `scripts/sync-buzz-kinds.mjs`, which diffs this table against a Buzz checkout
|
|
8
|
+
* (the same convention Buzz uses for its own desktop and mobile clients).
|
|
9
|
+
*
|
|
10
|
+
* Key names mirror the Rust constants minus the `KIND_` prefix so the sync
|
|
11
|
+
* script can match them mechanically. Do not add kinds that are not consumed
|
|
12
|
+
* by the adapter — vendoring the whole registry just widens the drift surface.
|
|
13
|
+
*/
|
|
14
|
+
export const BUZZ_KINDS = {
|
|
15
|
+
/** NIP-25 reaction — the decision-input event (👍 / 👎 on a request card). */
|
|
16
|
+
REACTION: 7,
|
|
17
|
+
/** Stream (channel chat) message. */
|
|
18
|
+
STREAM_MESSAGE: 9,
|
|
19
|
+
/** NIP-42 client authentication event. */
|
|
20
|
+
AUTH: 22242,
|
|
21
|
+
/** NIP-43 relay membership list (published by `buzz-admin add-member`). */
|
|
22
|
+
NIP43_MEMBERSHIP_LIST: 13534,
|
|
23
|
+
/** NIP-29 group (channel) metadata. */
|
|
24
|
+
NIP29_GROUP_METADATA: 39000,
|
|
25
|
+
/** Forum post (long-form surface). */
|
|
26
|
+
FORUM_POST: 45001,
|
|
27
|
+
/** Forum comment. */
|
|
28
|
+
FORUM_COMMENT: 45003,
|
|
29
|
+
/** Buzz workflow approval grant. Not consumed by the adapter (durable gates
|
|
30
|
+
* live in Temporal) — vendored so the sync script guards the constant we
|
|
31
|
+
* reference in docs and refuse to depend on. */
|
|
32
|
+
APPROVAL_GRANT: 46030,
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=buzz-kinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buzz-kinds.js","sourceRoot":"","sources":["../src/buzz-kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,8EAA8E;IAC9E,QAAQ,EAAE,CAAC;IACX,qCAAqC;IACrC,cAAc,EAAE,CAAC;IACjB,0CAA0C;IAC1C,IAAI,EAAE,KAAK;IACX,2EAA2E;IAC3E,qBAAqB,EAAE,KAAK;IAC5B,uCAAuC;IACvC,oBAAoB,EAAE,KAAK;IAC3B,sCAAsC;IACtC,UAAU,EAAE,KAAK;IACjB,qBAAqB;IACrB,aAAa,EAAE,KAAK;IACpB;;oDAEgD;IAChD,cAAc,EAAE,KAAK;CACb,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { BuzzDecisionCardDeliveryStore } from "./buzz-decisions.js";
|
|
2
|
+
import type { BuzzCursorStore, BuzzDeadLetterStore } from "./buzz-tail.js";
|
|
3
|
+
/** Structural client contract implemented by `pg.Pool` and Lakebase clients. */
|
|
4
|
+
export interface BuzzPostgresClient {
|
|
5
|
+
query<T = Record<string, unknown>>(sql: string, params?: unknown[]): Promise<{
|
|
6
|
+
rows: T[];
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export interface BuzzPostgresPersistenceOptions {
|
|
10
|
+
client: BuzzPostgresClient;
|
|
11
|
+
/** Stable deployment/consumer identity used to isolate cursors and backlogs. */
|
|
12
|
+
consumerId: string;
|
|
13
|
+
/** Table prefix for shared databases. Default `fabric_harness`. */
|
|
14
|
+
tablePrefix?: string;
|
|
15
|
+
/** Create the three bridge tables before first use. Default true. */
|
|
16
|
+
initialize?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface BuzzPostgresPersistence {
|
|
19
|
+
ready: Promise<void>;
|
|
20
|
+
cursorStore: BuzzCursorStore;
|
|
21
|
+
deadLetterStore: BuzzDeadLetterStore;
|
|
22
|
+
deliveryStore: BuzzDecisionCardDeliveryStore;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create the durable Buzz bridge state used by PostgreSQL and Databricks
|
|
26
|
+
* Lakebase deployments. No `pg` dependency is loaded by the channels package;
|
|
27
|
+
* applications inject their existing pool/client.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createPostgresBuzzPersistence(options: BuzzPostgresPersistenceOptions): BuzzPostgresPersistence;
|
|
30
|
+
export declare function ensurePostgresBuzzTables(client: BuzzPostgresClient, options?: {
|
|
31
|
+
tablePrefix?: string;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=buzz-postgres.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buzz-postgres.d.ts","sourceRoot":"","sources":["../src/buzz-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,6BAA6B,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAwB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEjG,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,EAAE,CAAA;KAAE,CAAC,CAAC;CAC7F;AAED,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,EAAE,6BAA6B,CAAC;CAC9C;AAiBD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CA2IzB;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,kBAAkB,EAC1B,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACrC,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
function identifier(value) {
|
|
2
|
+
if (!/^[a-z_][a-z0-9_]*$/i.test(value))
|
|
3
|
+
throw new Error(`Invalid PostgreSQL identifier: ${value}`);
|
|
4
|
+
return value;
|
|
5
|
+
}
|
|
6
|
+
function nonEmpty(value, name) {
|
|
7
|
+
if (value.trim().length === 0)
|
|
8
|
+
throw new Error(`${name} must not be empty.`);
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
function parsed(value) {
|
|
12
|
+
return typeof value === "string" ? JSON.parse(value) : value;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create the durable Buzz bridge state used by PostgreSQL and Databricks
|
|
16
|
+
* Lakebase deployments. No `pg` dependency is loaded by the channels package;
|
|
17
|
+
* applications inject their existing pool/client.
|
|
18
|
+
*/
|
|
19
|
+
export function createPostgresBuzzPersistence(options) {
|
|
20
|
+
const consumerId = nonEmpty(options.consumerId, "consumerId");
|
|
21
|
+
const prefix = identifier(options.tablePrefix ?? "fabric_harness");
|
|
22
|
+
const cursorTable = `${prefix}_buzz_cursors`;
|
|
23
|
+
const deadLetterTable = `${prefix}_buzz_dead_letters`;
|
|
24
|
+
const deliveryTable = `${prefix}_buzz_card_deliveries`;
|
|
25
|
+
const ready = options.initialize === false
|
|
26
|
+
? Promise.resolve()
|
|
27
|
+
: ensurePostgresBuzzTables(options.client, { tablePrefix: prefix });
|
|
28
|
+
const cursorStore = {
|
|
29
|
+
async load() {
|
|
30
|
+
await ready;
|
|
31
|
+
const result = await options.client.query(`SELECT cursor_seconds FROM ${cursorTable} WHERE consumer_id = $1`, [consumerId]);
|
|
32
|
+
const value = result.rows[0]?.cursor_seconds;
|
|
33
|
+
if (value === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
const cursor = Number(value);
|
|
36
|
+
if (!Number.isSafeInteger(cursor) || cursor < 0)
|
|
37
|
+
throw new Error(`Invalid stored Buzz cursor for ${consumerId}.`);
|
|
38
|
+
return cursor;
|
|
39
|
+
},
|
|
40
|
+
async save(cursorSeconds) {
|
|
41
|
+
await ready;
|
|
42
|
+
if (!Number.isSafeInteger(cursorSeconds) || cursorSeconds < 0) {
|
|
43
|
+
throw new Error("Buzz cursor must be a non-negative safe integer.");
|
|
44
|
+
}
|
|
45
|
+
await options.client.query(`INSERT INTO ${cursorTable} (consumer_id, cursor_seconds, updated_at)
|
|
46
|
+
VALUES ($1, $2, NOW())
|
|
47
|
+
ON CONFLICT (consumer_id) DO UPDATE
|
|
48
|
+
SET cursor_seconds = GREATEST(${cursorTable}.cursor_seconds, EXCLUDED.cursor_seconds),
|
|
49
|
+
updated_at = NOW()`, [consumerId, cursorSeconds]);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const deadLetterStore = {
|
|
53
|
+
async record(record) {
|
|
54
|
+
await ready;
|
|
55
|
+
await options.client.query(`INSERT INTO ${deadLetterTable}
|
|
56
|
+
(consumer_id, event_id, data, first_seen_at, last_seen_at, attempts)
|
|
57
|
+
VALUES ($1, $2, $3::jsonb, $4, $4, 1)
|
|
58
|
+
ON CONFLICT (consumer_id, event_id) DO UPDATE
|
|
59
|
+
SET data = EXCLUDED.data,
|
|
60
|
+
last_seen_at = EXCLUDED.last_seen_at,
|
|
61
|
+
attempts = ${deadLetterTable}.attempts + 1`, [consumerId, record.event.id, JSON.stringify(record), record.recordedAt]);
|
|
62
|
+
},
|
|
63
|
+
async listUnreconciled(limit) {
|
|
64
|
+
await ready;
|
|
65
|
+
if (!Number.isInteger(limit) || limit < 1)
|
|
66
|
+
throw new Error("limit must be a positive integer.");
|
|
67
|
+
const result = await options.client.query(`SELECT data FROM ${deadLetterTable}
|
|
68
|
+
WHERE consumer_id = $1 AND reconciled_at IS NULL
|
|
69
|
+
ORDER BY first_seen_at, event_id
|
|
70
|
+
LIMIT $2`, [consumerId, limit]);
|
|
71
|
+
return result.rows.map((row) => parsed(row.data));
|
|
72
|
+
},
|
|
73
|
+
async markReconciled(eventId, reconciledAt) {
|
|
74
|
+
await ready;
|
|
75
|
+
const result = await options.client.query(`UPDATE ${deadLetterTable}
|
|
76
|
+
SET reconciled_at = COALESCE(reconciled_at, $3)
|
|
77
|
+
WHERE consumer_id = $1 AND event_id = $2
|
|
78
|
+
RETURNING event_id`, [consumerId, eventId, reconciledAt]);
|
|
79
|
+
if (result.rows.length === 0)
|
|
80
|
+
throw new Error(`Unknown Buzz dead letter: ${eventId}`);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const deliveryStore = {
|
|
84
|
+
async prepareDelivery(delivery) {
|
|
85
|
+
await ready;
|
|
86
|
+
const inserted = await options.client.query(`INSERT INTO ${deliveryTable}
|
|
87
|
+
(consumer_id, delivery_key, community, channel_id, card_event_id, data, prepared_at)
|
|
88
|
+
VALUES ($1, $2, $3, $4, $5, $6::jsonb, $7)
|
|
89
|
+
ON CONFLICT DO NOTHING
|
|
90
|
+
RETURNING data`, [
|
|
91
|
+
consumerId,
|
|
92
|
+
delivery.deliveryKey,
|
|
93
|
+
delivery.receipt.community,
|
|
94
|
+
delivery.receipt.channelId,
|
|
95
|
+
delivery.receipt.cardEventId,
|
|
96
|
+
JSON.stringify(delivery),
|
|
97
|
+
delivery.preparedAt,
|
|
98
|
+
]);
|
|
99
|
+
if (inserted.rows[0])
|
|
100
|
+
return parsed(inserted.rows[0].data);
|
|
101
|
+
const existing = await options.client.query(`SELECT data FROM ${deliveryTable} WHERE consumer_id = $1 AND delivery_key = $2`, [consumerId, delivery.deliveryKey]);
|
|
102
|
+
const row = existing.rows[0];
|
|
103
|
+
if (!row)
|
|
104
|
+
throw new Error(`Buzz decision-card event conflicts with another delivery: ${delivery.receipt.cardEventId}`);
|
|
105
|
+
return parsed(row.data);
|
|
106
|
+
},
|
|
107
|
+
async markDeliveryPublished(deliveryKey, publishedAt) {
|
|
108
|
+
await ready;
|
|
109
|
+
const patch = JSON.stringify({ status: "published", publishedAt });
|
|
110
|
+
const result = await options.client.query(`UPDATE ${deliveryTable}
|
|
111
|
+
SET data = CASE WHEN published_at IS NULL THEN data || $3::jsonb ELSE data END,
|
|
112
|
+
published_at = COALESCE(published_at, $4)
|
|
113
|
+
WHERE consumer_id = $1 AND delivery_key = $2
|
|
114
|
+
RETURNING delivery_key`, [consumerId, deliveryKey, patch, publishedAt]);
|
|
115
|
+
if (result.rows.length === 0)
|
|
116
|
+
throw new Error(`Unknown Buzz decision-card delivery: ${deliveryKey}`);
|
|
117
|
+
},
|
|
118
|
+
async findByCardEvent(community, channelId, cardEventId) {
|
|
119
|
+
await ready;
|
|
120
|
+
const result = await options.client.query(`SELECT data FROM ${deliveryTable}
|
|
121
|
+
WHERE consumer_id = $1 AND community = $2 AND channel_id = $3 AND card_event_id = $4`, [consumerId, community, channelId, cardEventId]);
|
|
122
|
+
const row = result.rows[0];
|
|
123
|
+
return row ? parsed(row.data).receipt : undefined;
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
return { ready, cursorStore, deadLetterStore, deliveryStore };
|
|
127
|
+
}
|
|
128
|
+
export async function ensurePostgresBuzzTables(client, options = {}) {
|
|
129
|
+
const prefix = identifier(options.tablePrefix ?? "fabric_harness");
|
|
130
|
+
await client.query(`
|
|
131
|
+
CREATE TABLE IF NOT EXISTS ${prefix}_buzz_cursors (
|
|
132
|
+
consumer_id TEXT PRIMARY KEY,
|
|
133
|
+
cursor_seconds BIGINT NOT NULL CHECK (cursor_seconds >= 0),
|
|
134
|
+
updated_at TIMESTAMPTZ NOT NULL
|
|
135
|
+
);
|
|
136
|
+
CREATE TABLE IF NOT EXISTS ${prefix}_buzz_dead_letters (
|
|
137
|
+
consumer_id TEXT NOT NULL,
|
|
138
|
+
event_id TEXT NOT NULL,
|
|
139
|
+
data JSONB NOT NULL,
|
|
140
|
+
first_seen_at TIMESTAMPTZ NOT NULL,
|
|
141
|
+
last_seen_at TIMESTAMPTZ NOT NULL,
|
|
142
|
+
attempts INTEGER NOT NULL CHECK (attempts > 0),
|
|
143
|
+
reconciled_at TIMESTAMPTZ,
|
|
144
|
+
PRIMARY KEY (consumer_id, event_id)
|
|
145
|
+
);
|
|
146
|
+
CREATE INDEX IF NOT EXISTS ${prefix}_buzz_dead_letters_pending_idx
|
|
147
|
+
ON ${prefix}_buzz_dead_letters (consumer_id, first_seen_at)
|
|
148
|
+
WHERE reconciled_at IS NULL;
|
|
149
|
+
CREATE TABLE IF NOT EXISTS ${prefix}_buzz_card_deliveries (
|
|
150
|
+
consumer_id TEXT NOT NULL,
|
|
151
|
+
delivery_key TEXT NOT NULL,
|
|
152
|
+
community TEXT NOT NULL,
|
|
153
|
+
channel_id TEXT NOT NULL,
|
|
154
|
+
card_event_id TEXT NOT NULL,
|
|
155
|
+
data JSONB NOT NULL,
|
|
156
|
+
prepared_at TIMESTAMPTZ NOT NULL,
|
|
157
|
+
published_at TIMESTAMPTZ,
|
|
158
|
+
PRIMARY KEY (consumer_id, delivery_key),
|
|
159
|
+
UNIQUE (consumer_id, community, channel_id, card_event_id)
|
|
160
|
+
);
|
|
161
|
+
`);
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=buzz-postgres.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buzz-postgres.js","sourceRoot":"","sources":["../src/buzz-postgres.ts"],"names":[],"mappings":"AA6BA,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa,EAAE,IAAY;IAC3C,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,M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CAC5C,MAA0B,EAC1B,UAAoC,EAAE;IAEtC,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,IAAI,gBAAgB,CAAC,CAAC;IACnE,MAAM,MAAM,CAAC,KAAK,CAAC;iCACY,MAAM;;;;;iCAKN,MAAM;;;;;;;;;;iCAUN,MAAM;WAC5B,MAAM;;iCAEgB,MAAM;;;;;;;;;;;;GAYpC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { BuzzEvent } from "./buzz.js";
|
|
2
|
+
/**
|
|
3
|
+
* `buzz-tail` — the durable WebSocket→route consumer for the Buzz channel
|
|
4
|
+
* (Fabric Buzz Collaboration Plan D15, B1-H).
|
|
5
|
+
*
|
|
6
|
+
* Buzz relays push events over Nostr NIP-01 WebSocket subscriptions rather
|
|
7
|
+
* than webhooks. `dedupeKey` downstream only deduplicates what was observed;
|
|
8
|
+
* it cannot prove every relay event was observed. This tail therefore:
|
|
9
|
+
*
|
|
10
|
+
* - keeps a **durable cursor** (max safely-forwarded `created_at`, persisted
|
|
11
|
+
* through the injected {@link BuzzCursorStore}; advanced only after a 2xx
|
|
12
|
+
* forward or a recorded dead-letter),
|
|
13
|
+
* - **backfills over HTTP** (`POST /query`) from `cursor - overlap` on every
|
|
14
|
+
* (re)start before going live, so outages longer than any reconnect window
|
|
15
|
+
* lose nothing (duplicates are collapsed downstream by event-id dedupe),
|
|
16
|
+
* - forwards **in order through one consumer queue** with retry
|
|
17
|
+
* classification: 408/429/5xx/network errors retry with bounded exponential
|
|
18
|
+
* backoff; other 4xx (and exhausted retries) are **dead-lettered** to the
|
|
19
|
+
* reconciliation hook and the cursor moves on,
|
|
20
|
+
* - handles **NIP-42** challenges including `OK` acknowledgement and re-`REQ`
|
|
21
|
+
* after auth or a `CLOSED` subscription,
|
|
22
|
+
* - shuts down cleanly: stops intake, drains the in-flight forward, persists
|
|
23
|
+
* the cursor, and closes the subscription.
|
|
24
|
+
*
|
|
25
|
+
* Runtime: needs a WebSocket implementation. Node ≥ 22 provides a global; on
|
|
26
|
+
* Node 20 pass `webSocketImpl` (e.g. from `undici` or `ws`).
|
|
27
|
+
*
|
|
28
|
+
* Buzz constraint (verified 2026-08-01): relay queries must specify `kinds` —
|
|
29
|
+
* an open-ended filter trips the relay's p-gate. Backfill and subscription
|
|
30
|
+
* always send an explicit kind list.
|
|
31
|
+
*/
|
|
32
|
+
type WebSocketLike = {
|
|
33
|
+
readonly readyState: number;
|
|
34
|
+
send(data: string): void;
|
|
35
|
+
close(): void;
|
|
36
|
+
addEventListener(type: string, listener: (event: {
|
|
37
|
+
data?: unknown;
|
|
38
|
+
code?: number;
|
|
39
|
+
}) => void): void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Durable cursor persistence. Implementations must survive process restarts
|
|
43
|
+
* (file, database, durable object …). {@link inMemoryBuzzCursorStore} exists
|
|
44
|
+
* for tests and explicitly does NOT satisfy plan D15 in production.
|
|
45
|
+
*/
|
|
46
|
+
export interface BuzzCursorStore {
|
|
47
|
+
load(): Promise<number | undefined>;
|
|
48
|
+
save(cursorSeconds: number): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
/** Test/development cursor store. Not durable — never use in production. */
|
|
51
|
+
export declare function inMemoryBuzzCursorStore(initial?: number): BuzzCursorStore & {
|
|
52
|
+
current(): number | undefined;
|
|
53
|
+
};
|
|
54
|
+
export type BuzzDeadLetterReason = "permanent-status" | "retries-exhausted" | "unsigned-event";
|
|
55
|
+
export interface BuzzDeadLetterRecord {
|
|
56
|
+
event: BuzzEvent;
|
|
57
|
+
reason: BuzzDeadLetterReason;
|
|
58
|
+
status?: number;
|
|
59
|
+
recordedAt: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Durable dead-letter backlog. Recording and reconciliation marking must be
|
|
63
|
+
* idempotent by event id; listing must return only unresolved records.
|
|
64
|
+
*/
|
|
65
|
+
export interface BuzzDeadLetterStore {
|
|
66
|
+
record(record: BuzzDeadLetterRecord): Promise<void>;
|
|
67
|
+
listUnreconciled(limit: number): Promise<BuzzDeadLetterRecord[]>;
|
|
68
|
+
markReconciled(eventId: string, reconciledAt: string): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
export interface BuzzTailOptions {
|
|
71
|
+
/** Relay WebSocket URL, e.g. `ws://localhost:3000`. */
|
|
72
|
+
relayUrl: string;
|
|
73
|
+
/** Adapter identity secret key (64-char hex) — signs the NIP-42 AUTH event. */
|
|
74
|
+
secretKey: string;
|
|
75
|
+
/** Server-owned community/tenant forwarded in every envelope (plan D7). */
|
|
76
|
+
community: string;
|
|
77
|
+
/** Absolute URL of the Buzz channel's `/events` route. */
|
|
78
|
+
forwardUrl: string;
|
|
79
|
+
/** Shared secret for the forwarding envelope (must match the channel's). */
|
|
80
|
+
sharedSecret: string;
|
|
81
|
+
/** Durable cursor store (plan D15). Required — choose durability explicitly. */
|
|
82
|
+
cursorStore: BuzzCursorStore;
|
|
83
|
+
/**
|
|
84
|
+
* Channel ids to consume (NIP-29 `h` scope). Required: Buzz delivers live
|
|
85
|
+
* channel events only to `#h`-scoped subscriptions (verified live
|
|
86
|
+
* 2026-08-02 — an unscoped REQ receives stored events but no live fan-out),
|
|
87
|
+
* and scoping is also the membership-correct posture.
|
|
88
|
+
*/
|
|
89
|
+
channels: string[];
|
|
90
|
+
/** Kinds to subscribe to. Default: stream messages, forum posts/comments, reactions. */
|
|
91
|
+
kinds?: number[];
|
|
92
|
+
/** Backfill/subscription overlap window in seconds. Default 300. */
|
|
93
|
+
overlapSeconds?: number;
|
|
94
|
+
/** Backfill page size. Default 500. */
|
|
95
|
+
backfillLimit?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Maximum events collected in one restart snapshot before startup fails
|
|
98
|
+
* closed. Default 50_000. Increase deliberately or reconcile/archive the
|
|
99
|
+
* backlog; the tail never truncates a snapshot silently.
|
|
100
|
+
*/
|
|
101
|
+
maxBackfillEvents?: number;
|
|
102
|
+
/** Max forward attempts per event before dead-lettering. Default 8. */
|
|
103
|
+
maxAttempts?: number;
|
|
104
|
+
/** Retry delay per attempt (injectable for tests). Default bounded exponential. */
|
|
105
|
+
retryDelayMs?: (attempt: number) => number;
|
|
106
|
+
/** Reconnect backoff ceiling in milliseconds. Default 30_000. */
|
|
107
|
+
maxBackoffMs?: number;
|
|
108
|
+
/** Timeout for each relay/forward HTTP request. Default 30_000. */
|
|
109
|
+
requestTimeoutMs?: number;
|
|
110
|
+
/** Cancels startup, relay requests, forwarding, retry waits, and reconnects. */
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
/**
|
|
113
|
+
* NIP-11 connect-time enforcement (plan §5.5, B1-H item 3): NIPs the relay
|
|
114
|
+
* must advertise before the tail will consume from it. Default `[1, 42]`
|
|
115
|
+
* (base protocol + auth). Set to an empty array to disable — an explicit
|
|
116
|
+
* decision, never the default.
|
|
117
|
+
*/
|
|
118
|
+
requiredNips?: number[];
|
|
119
|
+
/** Preferred durable dead-letter backlog for production consumers. */
|
|
120
|
+
deadLetterStore?: Pick<BuzzDeadLetterStore, "record">;
|
|
121
|
+
/**
|
|
122
|
+
* Durable reconciliation sink for events that could not be forwarded.
|
|
123
|
+
* Resolution acknowledges persistence: the cursor advances only afterward.
|
|
124
|
+
* Implementations must be idempotent by event id because checkpoint failure
|
|
125
|
+
* can cause the same dead letter to be recorded again.
|
|
126
|
+
*/
|
|
127
|
+
onDeadLetter?: (event: BuzzEvent, reason: BuzzDeadLetterReason, status?: number) => void | Promise<void>;
|
|
128
|
+
fetchImpl?: typeof fetch;
|
|
129
|
+
webSocketImpl?: new (url: string) => WebSocketLike;
|
|
130
|
+
now?: () => number;
|
|
131
|
+
onError?: (error: unknown) => void;
|
|
132
|
+
}
|
|
133
|
+
export interface BuzzTail {
|
|
134
|
+
/**
|
|
135
|
+
* Resolves once NIP-11 enforcement, the initial cursor load, and the HTTP
|
|
136
|
+
* backfill completed and the live socket is being established. Rejects when
|
|
137
|
+
* the relay fails NIP-11 enforcement — the tail refuses to consume.
|
|
138
|
+
*/
|
|
139
|
+
ready: Promise<void>;
|
|
140
|
+
close(): Promise<void>;
|
|
141
|
+
}
|
|
142
|
+
/** Start tailing a Buzz relay with durable, ordered, at-least-once forwarding. */
|
|
143
|
+
export declare function startBuzzTail(options: BuzzTailOptions): BuzzTail;
|
|
144
|
+
export interface ReconcileBuzzDeadLettersOptions {
|
|
145
|
+
store: BuzzDeadLetterStore;
|
|
146
|
+
/** Re-run the application's ordinary verified/governed ingress path. */
|
|
147
|
+
replay(record: BuzzDeadLetterRecord): Promise<void>;
|
|
148
|
+
/** Maximum records reconciled in this bounded invocation. Default 100. */
|
|
149
|
+
limit?: number;
|
|
150
|
+
now?: () => number;
|
|
151
|
+
signal?: AbortSignal;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Reconcile one bounded dead-letter batch. Records are acknowledged only
|
|
155
|
+
* after replay succeeds, so failed records remain visible for later repair.
|
|
156
|
+
*/
|
|
157
|
+
export declare function reconcileBuzzDeadLetters(options: ReconcileBuzzDeadLettersOptions): Promise<{
|
|
158
|
+
attempted: number;
|
|
159
|
+
reconciled: number;
|
|
160
|
+
}>;
|
|
161
|
+
export {};
|
|
162
|
+
//# sourceMappingURL=buzz-tail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buzz-tail.d.ts","sourceRoot":"","sources":["../src/buzz-tail.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,KAAK,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