@dcl/protocol 1.0.0-34906351243.commit-688d92c → 1.0.0-35089025179.commit-5810768

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.
@@ -0,0 +1,61 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "decentraland.pulse";
3
+ /**
4
+ * Published by Pulse to NATS on `peer.{address}.cluster_change` whenever a peer's post-debounce
5
+ * cluster assignment changes. Pulse is the sole author of cluster membership.
6
+ *
7
+ * A "cluster" is Pulse's own grouping of co-located peers, derived by union-find over occupied
8
+ * area-of-interest grid cells. It is deliberately a different concept from archipelago's "island":
9
+ * clusters have no size cap, are realm-partitioned, and carry no transport connection details.
10
+ * Comms Gatekeeper subscribes here, mints the LiveKit connection string (the ban check is
11
+ * authority-local to gatekeeper), and re-emits the legacy
12
+ * decentraland.kernel.comms.v3.IslandChangedMessage on `engine.peer.{address}.island_changed`,
13
+ * so the WebSocket Connector and clients stay untouched.
14
+ */
15
+ export interface PeerClusterChange {
16
+ /** Cluster the peer now belongs to. Stable across passes for an unchanged crowd. */
17
+ clusterId: string;
18
+ /**
19
+ * The peer's realm. Clusters never span realms, so this qualifies cluster_id and keeps the
20
+ * event self-contained — consumers never have to join against the topology feed.
21
+ */
22
+ realm: string;
23
+ /**
24
+ * Session that owns this assignment: the lower-cased ephemeral address of the auth chain the
25
+ * peer authenticated with (the wallet itself for a chain without a delegation). Two devices of
26
+ * one wallet carry different values; one device's reconnects carry the same one.
27
+ */
28
+ session: string;
29
+ /**
30
+ * Set only on the first publish of a new session for a wallet that still had a retained
31
+ * assignment under another session: that other session, and the cluster it was last published
32
+ * into. Empty on every other event, including a same-session reconnect.
33
+ */
34
+ displacedSession: string;
35
+ displacedClusterId: string;
36
+ }
37
+ export declare namespace PeerClusterChange {
38
+ function encode(message: PeerClusterChange, writer?: _m0.Writer): _m0.Writer;
39
+ function decode(input: _m0.Reader | Uint8Array, length?: number): PeerClusterChange;
40
+ function fromJSON(object: any): PeerClusterChange;
41
+ function toJSON(message: PeerClusterChange): unknown;
42
+ function create<I extends Exact<DeepPartial<PeerClusterChange>, I>>(base?: I): PeerClusterChange;
43
+ function fromPartial<I extends Exact<DeepPartial<PeerClusterChange>, I>>(object: I): PeerClusterChange;
44
+ }
45
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
46
+ export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
47
+ $case: string;
48
+ } ? {
49
+ [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
50
+ } & {
51
+ $case: T["$case"];
52
+ } : T extends {} ? {
53
+ [K in keyof T]?: DeepPartial<T[K]>;
54
+ } : Partial<T>;
55
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
56
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
57
+ [K in keyof P]: Exact<P[K], I[K]>;
58
+ } & {
59
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
60
+ };
61
+ export {};
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PeerClusterChange = exports.protobufPackage = void 0;
7
+ /* eslint-disable */
8
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
+ exports.protobufPackage = "decentraland.pulse";
10
+ function createBasePeerClusterChange() {
11
+ return { clusterId: "", realm: "", session: "", displacedSession: "", displacedClusterId: "" };
12
+ }
13
+ var PeerClusterChange;
14
+ (function (PeerClusterChange) {
15
+ function encode(message, writer = minimal_1.default.Writer.create()) {
16
+ if (message.clusterId !== "") {
17
+ writer.uint32(10).string(message.clusterId);
18
+ }
19
+ if (message.realm !== "") {
20
+ writer.uint32(18).string(message.realm);
21
+ }
22
+ if (message.session !== "") {
23
+ writer.uint32(26).string(message.session);
24
+ }
25
+ if (message.displacedSession !== "") {
26
+ writer.uint32(34).string(message.displacedSession);
27
+ }
28
+ if (message.displacedClusterId !== "") {
29
+ writer.uint32(42).string(message.displacedClusterId);
30
+ }
31
+ return writer;
32
+ }
33
+ PeerClusterChange.encode = encode;
34
+ function decode(input, length) {
35
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
36
+ let end = length === undefined ? reader.len : reader.pos + length;
37
+ const message = createBasePeerClusterChange();
38
+ while (reader.pos < end) {
39
+ const tag = reader.uint32();
40
+ switch (tag >>> 3) {
41
+ case 1:
42
+ if (tag !== 10) {
43
+ break;
44
+ }
45
+ message.clusterId = reader.string();
46
+ continue;
47
+ case 2:
48
+ if (tag !== 18) {
49
+ break;
50
+ }
51
+ message.realm = reader.string();
52
+ continue;
53
+ case 3:
54
+ if (tag !== 26) {
55
+ break;
56
+ }
57
+ message.session = reader.string();
58
+ continue;
59
+ case 4:
60
+ if (tag !== 34) {
61
+ break;
62
+ }
63
+ message.displacedSession = reader.string();
64
+ continue;
65
+ case 5:
66
+ if (tag !== 42) {
67
+ break;
68
+ }
69
+ message.displacedClusterId = reader.string();
70
+ continue;
71
+ }
72
+ if ((tag & 7) === 4 || tag === 0) {
73
+ break;
74
+ }
75
+ reader.skipType(tag & 7);
76
+ }
77
+ return message;
78
+ }
79
+ PeerClusterChange.decode = decode;
80
+ function fromJSON(object) {
81
+ return {
82
+ clusterId: isSet(object.clusterId) ? String(object.clusterId) : "",
83
+ realm: isSet(object.realm) ? String(object.realm) : "",
84
+ session: isSet(object.session) ? String(object.session) : "",
85
+ displacedSession: isSet(object.displacedSession) ? String(object.displacedSession) : "",
86
+ displacedClusterId: isSet(object.displacedClusterId) ? String(object.displacedClusterId) : "",
87
+ };
88
+ }
89
+ PeerClusterChange.fromJSON = fromJSON;
90
+ function toJSON(message) {
91
+ const obj = {};
92
+ message.clusterId !== undefined && (obj.clusterId = message.clusterId);
93
+ message.realm !== undefined && (obj.realm = message.realm);
94
+ message.session !== undefined && (obj.session = message.session);
95
+ message.displacedSession !== undefined && (obj.displacedSession = message.displacedSession);
96
+ message.displacedClusterId !== undefined && (obj.displacedClusterId = message.displacedClusterId);
97
+ return obj;
98
+ }
99
+ PeerClusterChange.toJSON = toJSON;
100
+ function create(base) {
101
+ return PeerClusterChange.fromPartial(base !== null && base !== void 0 ? base : {});
102
+ }
103
+ PeerClusterChange.create = create;
104
+ function fromPartial(object) {
105
+ var _a, _b, _c, _d, _e;
106
+ const message = createBasePeerClusterChange();
107
+ message.clusterId = (_a = object.clusterId) !== null && _a !== void 0 ? _a : "";
108
+ message.realm = (_b = object.realm) !== null && _b !== void 0 ? _b : "";
109
+ message.session = (_c = object.session) !== null && _c !== void 0 ? _c : "";
110
+ message.displacedSession = (_d = object.displacedSession) !== null && _d !== void 0 ? _d : "";
111
+ message.displacedClusterId = (_e = object.displacedClusterId) !== null && _e !== void 0 ? _e : "";
112
+ return message;
113
+ }
114
+ PeerClusterChange.fromPartial = fromPartial;
115
+ })(PeerClusterChange || (exports.PeerClusterChange = PeerClusterChange = {}));
116
+ function isSet(value) {
117
+ return value !== null && value !== undefined;
118
+ }
119
+ //# sourceMappingURL=pulse_clusters.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pulse_clusters.gen.js","sourceRoot":"","sources":["../../../out-ts/decentraland/pulse/pulse_clusters.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AAExB,QAAA,eAAe,GAAG,oBAAoB,CAAC;AAqCpD,SAAS,2BAA2B;IAClC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;AACjG,CAAC;AAED,IAAiB,iBAAiB,CAwGjC;AAxGD,WAAiB,iBAAiB;IAChC,SAAgB,M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K,SAAS,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC5F,OAAO,CAAC,kBAAkB,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAClG,OAAO,GAAG,CAAC;IACb,CAAC;IARe,wBAAM,SAQrB,CAAA;IAED,SAAgB,MAAM,CAAqD,IAAQ;QACjF,OAAO,iBAAiB,CAAC,WAAW,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,CAAC;IACnD,CAAC;IAFe,wBAAM,SAErB,CAAA;IAED,SAAgB,WAAW,CAAqD,MAAS;;QACvF,MAAM,OAAO,GAAG,2BAA2B,EAAE,CAAC;QAC9C,OAAO,CAAC,SAAS,GAAG,MAAA,MAAM,CAAC,SAAS,mCAAI,EAAE,CAAC;QAC3C,OAAO,CAAC,KAAK,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC;QACnC,OAAO,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC;QACvC,OAAO,CAAC,gBAAgB,GAAG,MAAA,MAAM,CAAC,gBAAgB,mCAAI,EAAE,CAAC;QACzD,OAAO,CAAC,kBAAkB,GAAG,MAAA,MAAM,CAAC,kBAAkB,mCAAI,EAAE,CAAC;QAC7D,OAAO,OAAO,CAAC;IACjB,CAAC;IARe,6BAAW,cAQ1B,CAAA;AACH,CAAC,EAxGgB,iBAAiB,iCAAjB,iBAAiB,QAwGjC;AAcD,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,165 @@
1
+ /* eslint-disable */
2
+ import _m0 from "protobufjs/minimal";
3
+
4
+ export const protobufPackage = "decentraland.pulse";
5
+
6
+ /**
7
+ * Published by Pulse to NATS on `peer.{address}.cluster_change` whenever a peer's post-debounce
8
+ * cluster assignment changes. Pulse is the sole author of cluster membership.
9
+ *
10
+ * A "cluster" is Pulse's own grouping of co-located peers, derived by union-find over occupied
11
+ * area-of-interest grid cells. It is deliberately a different concept from archipelago's "island":
12
+ * clusters have no size cap, are realm-partitioned, and carry no transport connection details.
13
+ * Comms Gatekeeper subscribes here, mints the LiveKit connection string (the ban check is
14
+ * authority-local to gatekeeper), and re-emits the legacy
15
+ * decentraland.kernel.comms.v3.IslandChangedMessage on `engine.peer.{address}.island_changed`,
16
+ * so the WebSocket Connector and clients stay untouched.
17
+ */
18
+ export interface PeerClusterChange {
19
+ /** Cluster the peer now belongs to. Stable across passes for an unchanged crowd. */
20
+ clusterId: string;
21
+ /**
22
+ * The peer's realm. Clusters never span realms, so this qualifies cluster_id and keeps the
23
+ * event self-contained — consumers never have to join against the topology feed.
24
+ */
25
+ realm: string;
26
+ /**
27
+ * Session that owns this assignment: the lower-cased ephemeral address of the auth chain the
28
+ * peer authenticated with (the wallet itself for a chain without a delegation). Two devices of
29
+ * one wallet carry different values; one device's reconnects carry the same one.
30
+ */
31
+ session: string;
32
+ /**
33
+ * Set only on the first publish of a new session for a wallet that still had a retained
34
+ * assignment under another session: that other session, and the cluster it was last published
35
+ * into. Empty on every other event, including a same-session reconnect.
36
+ */
37
+ displacedSession: string;
38
+ displacedClusterId: string;
39
+ }
40
+
41
+ function createBasePeerClusterChange(): PeerClusterChange {
42
+ return { clusterId: "", realm: "", session: "", displacedSession: "", displacedClusterId: "" };
43
+ }
44
+
45
+ export namespace PeerClusterChange {
46
+ export function encode(message: PeerClusterChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
47
+ if (message.clusterId !== "") {
48
+ writer.uint32(10).string(message.clusterId);
49
+ }
50
+ if (message.realm !== "") {
51
+ writer.uint32(18).string(message.realm);
52
+ }
53
+ if (message.session !== "") {
54
+ writer.uint32(26).string(message.session);
55
+ }
56
+ if (message.displacedSession !== "") {
57
+ writer.uint32(34).string(message.displacedSession);
58
+ }
59
+ if (message.displacedClusterId !== "") {
60
+ writer.uint32(42).string(message.displacedClusterId);
61
+ }
62
+ return writer;
63
+ }
64
+
65
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): PeerClusterChange {
66
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
67
+ let end = length === undefined ? reader.len : reader.pos + length;
68
+ const message = createBasePeerClusterChange();
69
+ while (reader.pos < end) {
70
+ const tag = reader.uint32();
71
+ switch (tag >>> 3) {
72
+ case 1:
73
+ if (tag !== 10) {
74
+ break;
75
+ }
76
+
77
+ message.clusterId = reader.string();
78
+ continue;
79
+ case 2:
80
+ if (tag !== 18) {
81
+ break;
82
+ }
83
+
84
+ message.realm = reader.string();
85
+ continue;
86
+ case 3:
87
+ if (tag !== 26) {
88
+ break;
89
+ }
90
+
91
+ message.session = reader.string();
92
+ continue;
93
+ case 4:
94
+ if (tag !== 34) {
95
+ break;
96
+ }
97
+
98
+ message.displacedSession = reader.string();
99
+ continue;
100
+ case 5:
101
+ if (tag !== 42) {
102
+ break;
103
+ }
104
+
105
+ message.displacedClusterId = reader.string();
106
+ continue;
107
+ }
108
+ if ((tag & 7) === 4 || tag === 0) {
109
+ break;
110
+ }
111
+ reader.skipType(tag & 7);
112
+ }
113
+ return message;
114
+ }
115
+
116
+ export function fromJSON(object: any): PeerClusterChange {
117
+ return {
118
+ clusterId: isSet(object.clusterId) ? String(object.clusterId) : "",
119
+ realm: isSet(object.realm) ? String(object.realm) : "",
120
+ session: isSet(object.session) ? String(object.session) : "",
121
+ displacedSession: isSet(object.displacedSession) ? String(object.displacedSession) : "",
122
+ displacedClusterId: isSet(object.displacedClusterId) ? String(object.displacedClusterId) : "",
123
+ };
124
+ }
125
+
126
+ export function toJSON(message: PeerClusterChange): unknown {
127
+ const obj: any = {};
128
+ message.clusterId !== undefined && (obj.clusterId = message.clusterId);
129
+ message.realm !== undefined && (obj.realm = message.realm);
130
+ message.session !== undefined && (obj.session = message.session);
131
+ message.displacedSession !== undefined && (obj.displacedSession = message.displacedSession);
132
+ message.displacedClusterId !== undefined && (obj.displacedClusterId = message.displacedClusterId);
133
+ return obj;
134
+ }
135
+
136
+ export function create<I extends Exact<DeepPartial<PeerClusterChange>, I>>(base?: I): PeerClusterChange {
137
+ return PeerClusterChange.fromPartial(base ?? {});
138
+ }
139
+
140
+ export function fromPartial<I extends Exact<DeepPartial<PeerClusterChange>, I>>(object: I): PeerClusterChange {
141
+ const message = createBasePeerClusterChange();
142
+ message.clusterId = object.clusterId ?? "";
143
+ message.realm = object.realm ?? "";
144
+ message.session = object.session ?? "";
145
+ message.displacedSession = object.displacedSession ?? "";
146
+ message.displacedClusterId = object.displacedClusterId ?? "";
147
+ return message;
148
+ }
149
+ }
150
+
151
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
152
+
153
+ export type DeepPartial<T> = T extends Builtin ? T
154
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
155
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
156
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
157
+ : Partial<T>;
158
+
159
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
160
+ export type Exact<P, I extends P> = P extends Builtin ? P
161
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
162
+
163
+ function isSet(value: any): boolean {
164
+ return value !== null && value !== undefined;
165
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/protocol",
3
- "version": "1.0.0-34906351243.commit-688d92c",
3
+ "version": "1.0.0-35089025179.commit-5810768",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,6 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@protobuf-ts/protoc": "^2.8.1",
21
- "proto-compatibility-tool": "^1.1.2-20220925163655.commit-25bd040",
22
21
  "typescript": "^5.0.4"
23
22
  },
24
23
  "config": {
@@ -36,5 +35,5 @@
36
35
  "protoc-gen-bitwise/*.js",
37
36
  "protoc-gen-bitwise/runtime"
38
37
  ],
39
- "commit": "688d92c45ad07976de367201da021f365f68d964"
38
+ "commit": "5810768d778c7348477ddeb89effb1bccf33b291"
40
39
  }
@@ -0,0 +1,33 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.pulse;
4
+
5
+ // Published by Pulse to NATS on `peer.{address}.cluster_change` whenever a peer's post-debounce
6
+ // cluster assignment changes. Pulse is the sole author of cluster membership.
7
+ //
8
+ // A "cluster" is Pulse's own grouping of co-located peers, derived by union-find over occupied
9
+ // area-of-interest grid cells. It is deliberately a different concept from archipelago's "island":
10
+ // clusters have no size cap, are realm-partitioned, and carry no transport connection details.
11
+ // Comms Gatekeeper subscribes here, mints the LiveKit connection string (the ban check is
12
+ // authority-local to gatekeeper), and re-emits the legacy
13
+ // decentraland.kernel.comms.v3.IslandChangedMessage on `engine.peer.{address}.island_changed`,
14
+ // so the WebSocket Connector and clients stay untouched.
15
+ message PeerClusterChange {
16
+ // Cluster the peer now belongs to. Stable across passes for an unchanged crowd.
17
+ string cluster_id = 1;
18
+
19
+ // The peer's realm. Clusters never span realms, so this qualifies cluster_id and keeps the
20
+ // event self-contained — consumers never have to join against the topology feed.
21
+ string realm = 2;
22
+
23
+ // Session that owns this assignment: the lower-cased ephemeral address of the auth chain the
24
+ // peer authenticated with (the wallet itself for a chain without a delegation). Two devices of
25
+ // one wallet carry different values; one device's reconnects carry the same one.
26
+ string session = 3;
27
+
28
+ // Set only on the first publish of a new session for a wallet that still had a retained
29
+ // assignment under another session: that other session, and the cluster it was last published
30
+ // into. Empty on every other event, including a same-session reconnect.
31
+ string displaced_session = 4;
32
+ string displaced_cluster_id = 5;
33
+ }
@@ -2,4 +2,5 @@ syntax = "proto3";
2
2
 
3
3
  import public "decentraland/kernel/comms/v3/archipelago.proto";
4
4
  import public "decentraland/kernel/comms/rfc4/comms.proto";
5
- import public "decentraland/kernel/comms/rfc5/ws_comms.proto";
5
+ import public "decentraland/kernel/comms/rfc5/ws_comms.proto";
6
+ import public "decentraland/pulse/pulse_clusters.proto";