@rljson/rljson 0.0.88 → 0.0.90
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.architecture.md +15 -10
- package/README.blog.md +5 -0
- package/README.contributors.md +4 -4
- package/README.public.md +5 -0
- package/dist/README.architecture.md +15 -10
- package/dist/README.blog.md +5 -0
- package/dist/README.contributors.md +4 -4
- package/dist/README.public.md +5 -0
- package/dist/rljson.js +6 -7
- package/dist/rljson_version.d.ts +1 -1
- package/dist/sync/connector-payload.d.ts +11 -0
- package/package.json +14 -14
package/README.architecture.md
CHANGED
|
@@ -624,16 +624,21 @@ only when the corresponding `SyncConfig` flags are set.
|
|
|
624
624
|
|
|
625
625
|
The payload transmitted on the wire between Connector and Server:
|
|
626
626
|
|
|
627
|
-
| Field | Type | Concept | Purpose
|
|
628
|
-
| ------- | ----------------------- | ----------------- |
|
|
629
|
-
| `r` | `string` | existing | The ref being announced
|
|
630
|
-
| `o` | `string` | existing | Ephemeral origin for self-echo filter
|
|
631
|
-
| `c` | `ClientId` | Client identity | Stable client id across reconnections
|
|
632
|
-
| `t` | `number` | Client identity | Client-side wall-clock timestamp (ms)
|
|
633
|
-
| `seq` | `number` | Predecessor chain | Monotonic counter per (client, route)
|
|
634
|
-
| `p` | `InsertHistoryTimeId[]` | Predecessor chain | Causal predecessor timeIds
|
|
635
|
-
| `cksum` | `string` | Acknowledgment | Content checksum for ACK verification
|
|
636
|
-
| `stamp` | `RefStamp` | Hub order | Where a stamping hub placed the ref
|
|
627
|
+
| Field | Type | Concept | Purpose |
|
|
628
|
+
| ------- | ----------------------- | ----------------- | -------------------------------------- |
|
|
629
|
+
| `r` | `string` | existing | The ref being announced |
|
|
630
|
+
| `o` | `string` | existing | Ephemeral origin for self-echo filter |
|
|
631
|
+
| `c` | `ClientId` | Client identity | Stable client id across reconnections |
|
|
632
|
+
| `t` | `number` | Client identity | Client-side wall-clock timestamp (ms) |
|
|
633
|
+
| `seq` | `number` | Predecessor chain | Monotonic counter per (client, route) |
|
|
634
|
+
| `p` | `InsertHistoryTimeId[]` | Predecessor chain | Causal predecessor timeIds |
|
|
635
|
+
| `cksum` | `string` | Acknowledgment | Content checksum for ACK verification |
|
|
636
|
+
| `stamp` | `RefStamp` | Hub order | Where a stamping hub placed the ref |
|
|
637
|
+
| `src` | `string` | Source node | Node to read the ref's data from first |
|
|
638
|
+
|
|
639
|
+
`src` is set by the relaying hub, never by the sender: the node id of the
|
|
640
|
+
client it received the ref from, or nothing when it does not know that node.
|
|
641
|
+
It is a hint for readers; the hub can always serve the data.
|
|
637
642
|
|
|
638
643
|
### AckPayload
|
|
639
644
|
|
package/README.blog.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
# Blog
|
|
2
2
|
|
|
3
3
|
Add latest posts at the end.
|
|
4
|
+
|
|
5
|
+
## 2026-11-02 — ConnectorPayload names its source
|
|
6
|
+
|
|
7
|
+
- `ConnectorPayload.src`: the node a relayed ref came from, set by the relaying hub
|
|
8
|
+
- Post: [pm/en/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md](pm/en/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md), German: [pm/de/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md](pm/de/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md)
|
package/README.contributors.md
CHANGED
|
@@ -15,18 +15,18 @@ found in the LICENSE file in the root of this package.
|
|
|
15
15
|
|
|
16
16
|
## Prepare
|
|
17
17
|
|
|
18
|
-
Read [prepare.md](doc/workflows/prepare.md)
|
|
18
|
+
Read [prepare.md](doc/en/workflows/prepare.md)
|
|
19
19
|
|
|
20
20
|
<!-- ........................................................................-->
|
|
21
21
|
|
|
22
22
|
## Develop
|
|
23
23
|
|
|
24
|
-
Read [develop.md](doc/workflows/develop.md)
|
|
24
|
+
Read [develop.md](doc/en/workflows/develop.md)
|
|
25
25
|
|
|
26
26
|
## Tools
|
|
27
27
|
|
|
28
|
-
Read [tools.md](doc/workflows/tools.md)
|
|
28
|
+
Read [tools.md](doc/en/workflows/tools.md)
|
|
29
29
|
|
|
30
30
|
## Superheros
|
|
31
31
|
|
|
32
|
-
Read [super-hero.md](doc/workflows/super-hero.md)
|
|
32
|
+
Read [super-hero.md](doc/en/workflows/super-hero.md)
|
package/README.public.md
CHANGED
|
@@ -285,9 +285,14 @@ const enriched: ConnectorPayload = {
|
|
|
285
285
|
p: ['prev-timeId'], // causal predecessors
|
|
286
286
|
cksum: 'sha256:...', // content checksum
|
|
287
287
|
stamp: { domain: 'office', epoch: 3, hub: 'node-7', n: 12 }, // hub order
|
|
288
|
+
src: 'node-3', // set by the relaying hub: the node it came from
|
|
288
289
|
};
|
|
289
290
|
```
|
|
290
291
|
|
|
292
|
+
A hub sets `src` when it relays a ref: the node id of the client it received
|
|
293
|
+
the ref from. A receiver may read the ref's data from that node first; the
|
|
294
|
+
field is a hint, and the hub can still serve the data.
|
|
295
|
+
|
|
291
296
|
### AckPayload
|
|
292
297
|
|
|
293
298
|
Server → Client acknowledgment that all (or some) receivers got a ref.
|
|
@@ -624,16 +624,21 @@ only when the corresponding `SyncConfig` flags are set.
|
|
|
624
624
|
|
|
625
625
|
The payload transmitted on the wire between Connector and Server:
|
|
626
626
|
|
|
627
|
-
| Field | Type | Concept | Purpose
|
|
628
|
-
| ------- | ----------------------- | ----------------- |
|
|
629
|
-
| `r` | `string` | existing | The ref being announced
|
|
630
|
-
| `o` | `string` | existing | Ephemeral origin for self-echo filter
|
|
631
|
-
| `c` | `ClientId` | Client identity | Stable client id across reconnections
|
|
632
|
-
| `t` | `number` | Client identity | Client-side wall-clock timestamp (ms)
|
|
633
|
-
| `seq` | `number` | Predecessor chain | Monotonic counter per (client, route)
|
|
634
|
-
| `p` | `InsertHistoryTimeId[]` | Predecessor chain | Causal predecessor timeIds
|
|
635
|
-
| `cksum` | `string` | Acknowledgment | Content checksum for ACK verification
|
|
636
|
-
| `stamp` | `RefStamp` | Hub order | Where a stamping hub placed the ref
|
|
627
|
+
| Field | Type | Concept | Purpose |
|
|
628
|
+
| ------- | ----------------------- | ----------------- | -------------------------------------- |
|
|
629
|
+
| `r` | `string` | existing | The ref being announced |
|
|
630
|
+
| `o` | `string` | existing | Ephemeral origin for self-echo filter |
|
|
631
|
+
| `c` | `ClientId` | Client identity | Stable client id across reconnections |
|
|
632
|
+
| `t` | `number` | Client identity | Client-side wall-clock timestamp (ms) |
|
|
633
|
+
| `seq` | `number` | Predecessor chain | Monotonic counter per (client, route) |
|
|
634
|
+
| `p` | `InsertHistoryTimeId[]` | Predecessor chain | Causal predecessor timeIds |
|
|
635
|
+
| `cksum` | `string` | Acknowledgment | Content checksum for ACK verification |
|
|
636
|
+
| `stamp` | `RefStamp` | Hub order | Where a stamping hub placed the ref |
|
|
637
|
+
| `src` | `string` | Source node | Node to read the ref's data from first |
|
|
638
|
+
|
|
639
|
+
`src` is set by the relaying hub, never by the sender: the node id of the
|
|
640
|
+
client it received the ref from, or nothing when it does not know that node.
|
|
641
|
+
It is a hint for readers; the hub can always serve the data.
|
|
637
642
|
|
|
638
643
|
### AckPayload
|
|
639
644
|
|
package/dist/README.blog.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
# Blog
|
|
2
2
|
|
|
3
3
|
Add latest posts at the end.
|
|
4
|
+
|
|
5
|
+
## 2026-11-02 — ConnectorPayload names its source
|
|
6
|
+
|
|
7
|
+
- `ConnectorPayload.src`: the node a relayed ref came from, set by the relaying hub
|
|
8
|
+
- Post: [pm/en/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md](pm/en/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md), German: [pm/de/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md](pm/de/2026-Q4/blog/2026-11-02-connector-payload-names-its-source.md)
|
|
@@ -15,18 +15,18 @@ found in the LICENSE file in the root of this package.
|
|
|
15
15
|
|
|
16
16
|
## Prepare
|
|
17
17
|
|
|
18
|
-
Read [prepare.md](doc/workflows/prepare.md)
|
|
18
|
+
Read [prepare.md](doc/en/workflows/prepare.md)
|
|
19
19
|
|
|
20
20
|
<!-- ........................................................................-->
|
|
21
21
|
|
|
22
22
|
## Develop
|
|
23
23
|
|
|
24
|
-
Read [develop.md](doc/workflows/develop.md)
|
|
24
|
+
Read [develop.md](doc/en/workflows/develop.md)
|
|
25
25
|
|
|
26
26
|
## Tools
|
|
27
27
|
|
|
28
|
-
Read [tools.md](doc/workflows/tools.md)
|
|
28
|
+
Read [tools.md](doc/en/workflows/tools.md)
|
|
29
29
|
|
|
30
30
|
## Superheros
|
|
31
31
|
|
|
32
|
-
Read [super-hero.md](doc/workflows/super-hero.md)
|
|
32
|
+
Read [super-hero.md](doc/en/workflows/super-hero.md)
|
package/dist/README.public.md
CHANGED
|
@@ -285,9 +285,14 @@ const enriched: ConnectorPayload = {
|
|
|
285
285
|
p: ['prev-timeId'], // causal predecessors
|
|
286
286
|
cksum: 'sha256:...', // content checksum
|
|
287
287
|
stamp: { domain: 'office', epoch: 3, hub: 'node-7', n: 12 }, // hub order
|
|
288
|
+
src: 'node-3', // set by the relaying hub: the node it came from
|
|
288
289
|
};
|
|
289
290
|
```
|
|
290
291
|
|
|
292
|
+
A hub sets `src` when it relays a ref: the node id of the client it received
|
|
293
|
+
the ref from. A receiver may read the ref's data from that node first; the
|
|
294
|
+
field is a hint, and the hub can still serve the data.
|
|
295
|
+
|
|
291
296
|
### AckPayload
|
|
292
297
|
|
|
293
298
|
Server → Client acknowledgment that all (or some) receivers got a ref.
|
package/dist/rljson.js
CHANGED
|
@@ -560,7 +560,7 @@ var exampleRevision = () => ({
|
|
|
560
560
|
id: "flour",
|
|
561
561
|
predecessor: "gZXFSlrl5QAs5hOVsq5sWB",
|
|
562
562
|
successor: "IqeoWJjZQNlr-NVk2QT15B",
|
|
563
|
-
timestamp:
|
|
563
|
+
timestamp: 0x67ec971b
|
|
564
564
|
});
|
|
565
565
|
// src/content/slice-ids.ts
|
|
566
566
|
// @license
|
|
@@ -1864,8 +1864,7 @@ var _isTable = (value) => {
|
|
|
1864
1864
|
*/
|
|
1865
1865
|
var iterateTablesSync = (rljson, callback) => {
|
|
1866
1866
|
for (const tableKey in rljson) {
|
|
1867
|
-
|
|
1868
|
-
if (!_isTable(value)) continue;
|
|
1867
|
+
if (!_isTable(rljson[tableKey])) continue;
|
|
1869
1868
|
callback(tableKey, rljson[tableKey]);
|
|
1870
1869
|
}
|
|
1871
1870
|
};
|
|
@@ -1881,8 +1880,7 @@ var iterateTables = async (rljson, callback) => {
|
|
|
1881
1880
|
const array = [];
|
|
1882
1881
|
const errors = [];
|
|
1883
1882
|
for (const tableKey in rljson) {
|
|
1884
|
-
|
|
1885
|
-
if (!_isTable(value)) continue;
|
|
1883
|
+
if (!_isTable(rljson[tableKey])) continue;
|
|
1886
1884
|
const promise = callback(tableKey, rljson[tableKey]).catch((error) => {
|
|
1887
1885
|
errors.push({
|
|
1888
1886
|
tableKey,
|
|
@@ -1956,7 +1954,7 @@ var connectorPayloadFullExample = () => ({
|
|
|
1956
1954
|
o: "1700000000000:AbCd",
|
|
1957
1955
|
r: "1700000000001:EfGh",
|
|
1958
1956
|
c: "client_ExAmPlE12345",
|
|
1959
|
-
t:
|
|
1957
|
+
t: 0x18bcfe56801,
|
|
1960
1958
|
seq: 42,
|
|
1961
1959
|
p: ["1700000000000:XyZw"],
|
|
1962
1960
|
cksum: "sha256:abc123def456",
|
|
@@ -1965,7 +1963,8 @@ var connectorPayloadFullExample = () => ({
|
|
|
1965
1963
|
epoch: 1,
|
|
1966
1964
|
hub: "hub_ExAmPlE",
|
|
1967
1965
|
n: 1
|
|
1968
|
-
}
|
|
1966
|
+
},
|
|
1967
|
+
src: "node_ExAmPlE"
|
|
1969
1968
|
});
|
|
1970
1969
|
// src/sync/gap-fill.ts
|
|
1971
1970
|
// @license
|
package/dist/rljson_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of the `@rljson/rljson` package. */
|
|
2
|
-
export declare const rljsonVersion = "0.0.
|
|
2
|
+
export declare const rljsonVersion = "0.0.90";
|
|
@@ -19,6 +19,7 @@ import { RefStamp } from './ref-stamp.ts';
|
|
|
19
19
|
* | `p` | Predecessor chain | Causal predecessor timeIds |
|
|
20
20
|
* | `cksum` | Acknowledgment | Content checksum for ACK verification |
|
|
21
21
|
* | `stamp` | Hub order | Where a stamping hub placed the ref |
|
|
22
|
+
* | `src` | Source node | Node to read the ref's data from first |
|
|
22
23
|
*/
|
|
23
24
|
export type ConnectorPayload = {
|
|
24
25
|
/** The ref (InsertHistoryTimeId) being announced. */
|
|
@@ -42,6 +43,16 @@ export type ConnectorPayload = {
|
|
|
42
43
|
* already carrying a stamp forwards it unchanged.
|
|
43
44
|
*/
|
|
44
45
|
stamp?: RefStamp;
|
|
46
|
+
/**
|
|
47
|
+
* The node the relaying hub received the ref from, by its node id.
|
|
48
|
+
*
|
|
49
|
+
* Set by the hub when it relays the ref, never by the sender: a hub
|
|
50
|
+
* overwrites what arrives, and leaves the field out when it does not know
|
|
51
|
+
* the sending node. A receiver may read the ref's data from that node
|
|
52
|
+
* directly before it asks the hub. It is a hint, not a promise: the node
|
|
53
|
+
* may be gone or unreachable, and the hub can still serve the data.
|
|
54
|
+
*/
|
|
55
|
+
src?: string;
|
|
45
56
|
};
|
|
46
57
|
/**
|
|
47
58
|
* Returns a minimal example ConnectorPayload (backward-compatible format).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/rljson",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.90",
|
|
4
4
|
"description": "The RLJSON data format specification",
|
|
5
5
|
"homepage": "https://github.com/rljson/rljson",
|
|
6
6
|
"bugs": "https://github.com/rljson/rljson/issues",
|
|
@@ -20,30 +20,30 @@
|
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@rljson/dna-rljson": "^0.
|
|
24
|
-
"@tssuite/helix-js": "^0.
|
|
25
|
-
"@types/node": "^26.6.
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
27
|
-
"@typescript-eslint/parser": "^8.
|
|
28
|
-
"@vitest/coverage-v8": "^5.
|
|
23
|
+
"@rljson/dna-rljson": "^0.4.0",
|
|
24
|
+
"@tssuite/helix-js": "^0.9.0",
|
|
25
|
+
"@types/node": "^26.6.11",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.74.0",
|
|
27
|
+
"@typescript-eslint/parser": "^8.74.0",
|
|
28
|
+
"@vitest/coverage-v8": "^5.1.2",
|
|
29
29
|
"cross-env": "^10.1.0",
|
|
30
|
-
"eslint": "^10.
|
|
31
|
-
"eslint-plugin-jsdoc": "^65.
|
|
30
|
+
"eslint": "^10.15.0",
|
|
31
|
+
"eslint-plugin-jsdoc": "^65.5.6",
|
|
32
32
|
"eslint-plugin-tsdoc": "^0.5.4",
|
|
33
|
-
"globals": "^17.
|
|
33
|
+
"globals": "^17.14.0",
|
|
34
34
|
"jsdoc": "^4.0.5",
|
|
35
35
|
"read-pkg": "^10.1.0",
|
|
36
36
|
"typescript": "~6.0.3",
|
|
37
|
-
"typescript-eslint": "^8.
|
|
38
|
-
"vite": "^8.
|
|
37
|
+
"typescript-eslint": "^8.74.0",
|
|
38
|
+
"vite": "^8.4.0",
|
|
39
39
|
"vite-node": "^6.0.0",
|
|
40
40
|
"vite-plugin-dts": "^5.1.2",
|
|
41
41
|
"vite-tsconfig-paths": "^6.1.1",
|
|
42
|
-
"vitest": "^5.
|
|
42
|
+
"vitest": "^5.1.2",
|
|
43
43
|
"vitest-dom": "^0.1.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@rljson/hash": "0.0.
|
|
46
|
+
"@rljson/hash": "0.0.22",
|
|
47
47
|
"@rljson/json": "0.0.23",
|
|
48
48
|
"nanoid": "^6.0.2"
|
|
49
49
|
},
|