@kraki/head 0.15.2 → 0.15.3
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/dist/pulse-hub.d.ts +42 -1
- package/dist/pulse-hub.js +96 -2
- package/dist/pulse-hub.js.map +1 -1
- package/package.json +2 -2
package/dist/pulse-hub.d.ts
CHANGED
|
@@ -23,6 +23,22 @@
|
|
|
23
23
|
import type Database from 'better-sqlite3';
|
|
24
24
|
import { decodeFrame, encodeFrame } from '@coinfra/pulse';
|
|
25
25
|
import { type PulseFrameField, type UnicastEnvelope } from '@kraki/protocol';
|
|
26
|
+
/** GC policy — how aggressively the hub reclaims per-device outbox memory
|
|
27
|
+
* for peers that stay disconnected. Zero disables that step. Defaults tuned
|
|
28
|
+
* for a store-and-forward hub with many long-lived-but-often-offline peers
|
|
29
|
+
* (browser tabs closed, phones off, iPad in a drawer). See spec §11. */
|
|
30
|
+
export interface PulseHubGcConfig {
|
|
31
|
+
/** After this many ms Disconnected, drop the endpoint's non-durable outbox
|
|
32
|
+
* (via `endpoint.purgeNonDurable`). Durable entries survive; they persist
|
|
33
|
+
* in `pulse_meta` via `snapshotDurable`. Default 5 * 60_000 (5 min). */
|
|
34
|
+
purgeNonDurableAfterMs?: number;
|
|
35
|
+
/** After this many ms Disconnected, drop the endpoint entirely from memory.
|
|
36
|
+
* Durable snapshot remains in SQLite so a future reconnect can rebuild it
|
|
37
|
+
* via `ep()`. Default 24 * 3600_000 (24 h). */
|
|
38
|
+
evictEndpointAfterMs?: number;
|
|
39
|
+
/** How often the GC scan runs. Default 60_000 (1 min). */
|
|
40
|
+
intervalMs?: number;
|
|
41
|
+
}
|
|
26
42
|
/** How the hub reaches out: send bytes to a device, and resolve where a
|
|
27
43
|
* delivered payload should be forwarded. Injected so the hub stays decoupled
|
|
28
44
|
* from the WebSocket layer and testable. */
|
|
@@ -46,7 +62,9 @@ export declare class PulseHub {
|
|
|
46
62
|
private readonly db;
|
|
47
63
|
private readonly host;
|
|
48
64
|
private readonly devices;
|
|
49
|
-
|
|
65
|
+
private readonly gc;
|
|
66
|
+
private gcTimer;
|
|
67
|
+
constructor(db: Database.Database, host: PulseHubHost, gc?: PulseHubGcConfig);
|
|
50
68
|
private initSchema;
|
|
51
69
|
/** Ensure an endpoint exists for a device (restoring from SQLite if present).
|
|
52
70
|
* head endpoints are durable-supported (head is always-on + has disk). */
|
|
@@ -87,6 +105,29 @@ export declare class PulseHub {
|
|
|
87
105
|
recoverOnBoot(): void;
|
|
88
106
|
/** Test/introspection: how many durable rows are held for a device. */
|
|
89
107
|
outboxCount(device: string): number;
|
|
108
|
+
/** In-memory endpoint count. Test/introspection. */
|
|
109
|
+
endpointCount(): number;
|
|
110
|
+
/** Stop the periodic GC scan. Call on shutdown. */
|
|
111
|
+
close(): void;
|
|
112
|
+
private startGc;
|
|
113
|
+
/**
|
|
114
|
+
* Two-tier GC per endpoint (see spec §11.4):
|
|
115
|
+
*
|
|
116
|
+
* L1 (purgeNonDurableAfterMs, default 5 min)
|
|
117
|
+
* Endpoint disconnected ≥ L1 → `purgeNonDurable()`. Streaming deltas,
|
|
118
|
+
* idle markers, and other ephemera queued during the offline window
|
|
119
|
+
* get dropped. Durable messages (delete_session) survive.
|
|
120
|
+
*
|
|
121
|
+
* L2 (evictEndpointAfterMs, default 24 h)
|
|
122
|
+
* Endpoint disconnected ≥ L2 → delete the in-memory endpoint entirely.
|
|
123
|
+
* Durable outbox rows remain in SQLite (via `pulse_meta` from prior
|
|
124
|
+
* `snapshotDurable` writes), so a future reconnect rebuilds the
|
|
125
|
+
* endpoint via `ep()` and picks them up.
|
|
126
|
+
*
|
|
127
|
+
* Only Disconnected endpoints are candidates. Endpoints without a
|
|
128
|
+
* `disconnectedAtMs` (never disconnected in this run) are skipped.
|
|
129
|
+
*/
|
|
130
|
+
gcTick(): void;
|
|
90
131
|
}
|
|
91
132
|
export { decodeFrame, encodeFrame };
|
|
92
133
|
export type { UnicastEnvelope };
|
package/dist/pulse-hub.js
CHANGED
|
@@ -22,16 +22,26 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { decodeFrame, encodeFrame, Endpoint } from '@coinfra/pulse';
|
|
24
24
|
import { HEAD_PULSE_TARGET } from '@kraki/protocol';
|
|
25
|
+
import { getLogger } from './logger.js';
|
|
26
|
+
const DEFAULT_GC = {
|
|
27
|
+
purgeNonDurableAfterMs: 5 * 60_000,
|
|
28
|
+
evictEndpointAfterMs: 24 * 3600_000,
|
|
29
|
+
intervalMs: 60_000,
|
|
30
|
+
};
|
|
25
31
|
const b64encode = (u) => Buffer.from(u).toString('base64');
|
|
26
32
|
const b64decode = (s) => new Uint8Array(Buffer.from(s, 'base64'));
|
|
27
33
|
export class PulseHub {
|
|
28
34
|
db;
|
|
29
35
|
host;
|
|
30
36
|
devices = new Map();
|
|
31
|
-
|
|
37
|
+
gc;
|
|
38
|
+
gcTimer = null;
|
|
39
|
+
constructor(db, host, gc) {
|
|
32
40
|
this.db = db;
|
|
33
41
|
this.host = host;
|
|
42
|
+
this.gc = { ...DEFAULT_GC, ...(gc ?? {}) };
|
|
34
43
|
this.initSchema();
|
|
44
|
+
this.startGc();
|
|
35
45
|
}
|
|
36
46
|
initSchema() {
|
|
37
47
|
this.db.exec(`CREATE TABLE IF NOT EXISTS pulse_outbox (
|
|
@@ -166,9 +176,15 @@ export class PulseHub {
|
|
|
166
176
|
const d = this.devices.get(device);
|
|
167
177
|
if (!d)
|
|
168
178
|
return;
|
|
179
|
+
// Use snapshotDurable() (pulse §11.3) — persisting non-durable entries to
|
|
180
|
+
// disk both violates their "in-memory only, may be lost on restart"
|
|
181
|
+
// contract AND is the exact root cause of the 2026-07-07 head OOM
|
|
182
|
+
// (each save re-serialized an ever-growing in-memory outbox for offline
|
|
183
|
+
// peers). Durable entries (currently just delete_session in kraki) are
|
|
184
|
+
// preserved so a future reconnect delivers them.
|
|
169
185
|
this.db
|
|
170
186
|
.prepare('INSERT OR REPLACE INTO pulse_meta (device, snapshot) VALUES (?, ?)')
|
|
171
|
-
.run(device, JSON.stringify(d.endpoint.
|
|
187
|
+
.run(device, JSON.stringify(d.endpoint.snapshotDurable()));
|
|
172
188
|
}
|
|
173
189
|
loadSnapshot(device) {
|
|
174
190
|
const row = this.db.prepare('SELECT snapshot FROM pulse_meta WHERE device = ?').get(device);
|
|
@@ -188,6 +204,84 @@ export class PulseHub {
|
|
|
188
204
|
.get(device);
|
|
189
205
|
return row.n;
|
|
190
206
|
}
|
|
207
|
+
/** In-memory endpoint count. Test/introspection. */
|
|
208
|
+
endpointCount() {
|
|
209
|
+
return this.devices.size;
|
|
210
|
+
}
|
|
211
|
+
/** Stop the periodic GC scan. Call on shutdown. */
|
|
212
|
+
close() {
|
|
213
|
+
if (this.gcTimer) {
|
|
214
|
+
clearInterval(this.gcTimer);
|
|
215
|
+
this.gcTimer = null;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// ── GC scan (spec §11.4) ────────────────────────────────────────────────
|
|
219
|
+
startGc() {
|
|
220
|
+
if (this.gc.intervalMs <= 0)
|
|
221
|
+
return;
|
|
222
|
+
this.gcTimer = setInterval(() => {
|
|
223
|
+
try {
|
|
224
|
+
this.gcTick();
|
|
225
|
+
}
|
|
226
|
+
catch (err) {
|
|
227
|
+
getLogger().error('pulse-hub gc tick failed', { error: err.message });
|
|
228
|
+
}
|
|
229
|
+
}, this.gc.intervalMs);
|
|
230
|
+
if (this.gcTimer && typeof this.gcTimer.unref === 'function') {
|
|
231
|
+
this.gcTimer.unref();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Two-tier GC per endpoint (see spec §11.4):
|
|
236
|
+
*
|
|
237
|
+
* L1 (purgeNonDurableAfterMs, default 5 min)
|
|
238
|
+
* Endpoint disconnected ≥ L1 → `purgeNonDurable()`. Streaming deltas,
|
|
239
|
+
* idle markers, and other ephemera queued during the offline window
|
|
240
|
+
* get dropped. Durable messages (delete_session) survive.
|
|
241
|
+
*
|
|
242
|
+
* L2 (evictEndpointAfterMs, default 24 h)
|
|
243
|
+
* Endpoint disconnected ≥ L2 → delete the in-memory endpoint entirely.
|
|
244
|
+
* Durable outbox rows remain in SQLite (via `pulse_meta` from prior
|
|
245
|
+
* `snapshotDurable` writes), so a future reconnect rebuilds the
|
|
246
|
+
* endpoint via `ep()` and picks them up.
|
|
247
|
+
*
|
|
248
|
+
* Only Disconnected endpoints are candidates. Endpoints without a
|
|
249
|
+
* `disconnectedAtMs` (never disconnected in this run) are skipped.
|
|
250
|
+
*/
|
|
251
|
+
gcTick() {
|
|
252
|
+
const now = this.host.now();
|
|
253
|
+
let purged = 0;
|
|
254
|
+
let evicted = 0;
|
|
255
|
+
for (const [deviceId, d] of this.devices) {
|
|
256
|
+
const disconnectedAt = d.endpoint.disconnectedAtMs;
|
|
257
|
+
if (d.endpoint.link !== 'disconnected' || disconnectedAt === null)
|
|
258
|
+
continue;
|
|
259
|
+
const offlineMs = now - disconnectedAt;
|
|
260
|
+
if (this.gc.evictEndpointAfterMs > 0 && offlineMs >= this.gc.evictEndpointAfterMs) {
|
|
261
|
+
// L2: release the endpoint. Durable state stays in pulse_meta.
|
|
262
|
+
this.devices.delete(deviceId);
|
|
263
|
+
evicted += 1;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
if (this.gc.purgeNonDurableAfterMs > 0
|
|
267
|
+
&& offlineMs >= this.gc.purgeNonDurableAfterMs
|
|
268
|
+
&& d.endpoint.nonDurableCount > 0) {
|
|
269
|
+
// L1: drop non-durable outbox entries only.
|
|
270
|
+
const { droppedSeqs } = d.endpoint.purgeNonDurable('gc-idle');
|
|
271
|
+
if (droppedSeqs.length > 0) {
|
|
272
|
+
purged += droppedSeqs.length;
|
|
273
|
+
this.saveSnapshot(deviceId);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (purged > 0 || evicted > 0) {
|
|
278
|
+
getLogger().info('pulse-hub gc', {
|
|
279
|
+
purgedSeqs: purged,
|
|
280
|
+
evictedEndpoints: evicted,
|
|
281
|
+
totalEndpoints: this.devices.size,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
191
285
|
}
|
|
192
286
|
// Re-export the frame codec for the server to build/inspect pulse envelopes.
|
|
193
287
|
export { decodeFrame, encodeFrame };
|
package/dist/pulse-hub.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulse-hub.js","sourceRoot":"","sources":["../src/pulse-hub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,WAAW,EAAe,WAAW,EAAE,QAAQ,EAAiB,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAA8C,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"pulse-hub.js","sourceRoot":"","sources":["../src/pulse-hub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,WAAW,EAAe,WAAW,EAAE,QAAQ,EAAiB,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAA8C,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAmBxC,MAAM,UAAU,GAA+B;IAC7C,sBAAsB,EAAE,CAAC,GAAG,MAAM;IAClC,oBAAoB,EAAE,EAAE,GAAG,QAAQ;IACnC,UAAU,EAAE,MAAM;CACnB,CAAC;AAsBF,MAAM,SAAS,GAAG,CAAC,CAAa,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC/E,MAAM,SAAS,GAAG,CAAC,CAAS,EAAc,EAAE,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AAUtF,MAAM,OAAO,QAAQ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|
4
4
|
"description": "Kraki relay server — the brain that routes messages between tentacles and apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"kraki-relay": "dist/cli.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@coinfra/pulse": "^0.
|
|
27
|
+
"@coinfra/pulse": "^0.2.0",
|
|
28
28
|
"better-sqlite3": "^11.0.0",
|
|
29
29
|
"dotenv": "^17.3.1",
|
|
30
30
|
"uuid": "^13.0.0",
|