@forgeax/engine-net 0.1.2
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/LICENSE +202 -0
- package/README.md +145 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/endpoint/endpoint.d.ts +36 -0
- package/dist/endpoint/endpoint.d.ts.map +1 -0
- package/dist/endpoint/errors.d.ts +82 -0
- package/dist/endpoint/errors.d.ts.map +1 -0
- package/dist/endpoint/memory.d.ts +13 -0
- package/dist/endpoint/memory.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +903 -0
- package/dist/index.mjs.map +1 -0
- package/dist/replication/authority.d.ts +17 -0
- package/dist/replication/authority.d.ts.map +1 -0
- package/dist/replication/codec.d.ts +26 -0
- package/dist/replication/codec.d.ts.map +1 -0
- package/dist/replication/constants.d.ts +2 -0
- package/dist/replication/constants.d.ts.map +1 -0
- package/dist/replication/errors.d.ts +66 -0
- package/dist/replication/errors.d.ts.map +1 -0
- package/dist/replication/handshake.d.ts +5 -0
- package/dist/replication/handshake.d.ts.map +1 -0
- package/dist/replication/profile.d.ts +31 -0
- package/dist/replication/profile.d.ts.map +1 -0
- package/dist/replication/replica.d.ts +27 -0
- package/dist/replication/replica.d.ts.map +1 -0
- package/dist/session/net-session.d.ts +32 -0
- package/dist/session/net-session.d.ts.map +1 -0
- package/dist/session/session-plugin.d.ts +8 -0
- package/dist/session/session-plugin.d.ts.map +1 -0
- package/package.json +58 -0
- package/src/endpoint/endpoint.ts +50 -0
- package/src/endpoint/errors.ts +164 -0
- package/src/endpoint/memory.ts +172 -0
- package/src/index.ts +46 -0
- package/src/replication/authority.ts +145 -0
- package/src/replication/codec.ts +257 -0
- package/src/replication/constants.ts +1 -0
- package/src/replication/errors.ts +60 -0
- package/src/replication/handshake.ts +18 -0
- package/src/replication/profile.ts +111 -0
- package/src/replication/replica.ts +240 -0
- package/src/session/net-session.ts +118 -0
- package/src/session/session-plugin.ts +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# @forgeax/engine-net
|
|
2
|
+
|
|
3
|
+
> **Host-neutral memory transport and profile-driven ECS replication.**
|
|
4
|
+
>
|
|
5
|
+
> Start at `NetEndpoint`; add `NetSession` to bind a transport to a World; then declare one `defineReplication` profile and attach `AuthorityCoordinator` / `ReplicaCoordinator`. `NetEntityId` is the only cross-World identity. Local ECS handles never cross the boundary.
|
|
6
|
+
|
|
7
|
+
`@forgeax/engine-net` depends on `@forgeax/engine-ecs`, `@forgeax/engine-plugin`, and `@forgeax/engine-types`. WebSocket transport is provided separately by `@forgeax/engine-net-websocket`.
|
|
8
|
+
|
|
9
|
+
## 1. Endpoint: complete bytes and lifecycle
|
|
10
|
+
|
|
11
|
+
`NetEndpoint` is the transport seam: complete `Uint8Array` messages, transport-issued `PeerId`, and connect/disconnect lifecycle. It does not know World, schema, profile, or codec policy.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createMemoryEndpointPair } from '@forgeax/engine-net';
|
|
15
|
+
|
|
16
|
+
const [serverEndpoint, clientEndpoint] = createMemoryEndpointPair();
|
|
17
|
+
const [{ peerId }] = serverEndpoint.poll();
|
|
18
|
+
serverEndpoint.send(peerId, new Uint8Array([1, 2, 3]));
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The memory pair is deterministic and is suitable for headless tests. Its delay, duplicate, malformed-byte, and forced-disconnect controls are test-only fault injection; they are not transport recovery, reconnect, or resync APIs.
|
|
22
|
+
|
|
23
|
+
## 2. Session: host integration
|
|
24
|
+
|
|
25
|
+
`NetSession` owns endpoint polling, peer observation, bounded raw game messages, and attached replication coordinators. Call `receiveEvents()` before simulation work and `publish()` after authoritative work. The session surfaces actual peer IDs; games do not retain a concrete endpoint.
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { NetSession } from '@forgeax/engine-net';
|
|
29
|
+
|
|
30
|
+
const authoritySession = new NetSession({ endpoint: serverEndpoint, maxRawMessages: 32 });
|
|
31
|
+
const replicaSession = new NetSession({ endpoint: clientEndpoint, maxRawMessages: 32 });
|
|
32
|
+
|
|
33
|
+
authoritySession.receiveEvents();
|
|
34
|
+
replicaSession.receiveEvents();
|
|
35
|
+
// World simulation happens here.
|
|
36
|
+
authoritySession.publish();
|
|
37
|
+
replicaSession.receiveEvents();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use `getPeerSnapshot()`, `sendRaw()`, and `drainRawMessages()` only for host/game protocol outside the replication profile. A raw message is not trusted replication state.
|
|
41
|
+
|
|
42
|
+
## 3. Profile: select portable ECS state once
|
|
43
|
+
|
|
44
|
+
`defineReplication` fixes the selected entity query, ordered component list, portable schema projection, limits, and fingerprint. It returns a structured error when a selected component is transient or contains process-local reference data.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { defineComponent, World } from '@forgeax/engine-ecs';
|
|
48
|
+
import {
|
|
49
|
+
createAuthorityCoordinator,
|
|
50
|
+
createReplicaCoordinator,
|
|
51
|
+
defineReplication,
|
|
52
|
+
} from '@forgeax/engine-net';
|
|
53
|
+
|
|
54
|
+
const Networked = defineComponent('Networked', { enabled: 'bool' });
|
|
55
|
+
const Position = defineComponent('Position', { x: 'f32', y: 'f32' });
|
|
56
|
+
const profile = defineReplication({
|
|
57
|
+
name: 'game-state',
|
|
58
|
+
entities: { with: [Networked] },
|
|
59
|
+
components: [Networked, Position],
|
|
60
|
+
}).unwrap();
|
|
61
|
+
|
|
62
|
+
const authority = createAuthorityCoordinator(new World(), profile);
|
|
63
|
+
const replica = createReplicaCoordinator(new World(), profile, clientEndpoint);
|
|
64
|
+
authoritySession.attachAuthority(authority);
|
|
65
|
+
replicaSession.attachReplica(replica, profile.limits);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The authority publishes an initial full snapshot, suppresses canonically unchanged component replacements, sends complete component replacement/add/remove operations, and publishes a fresh full baseline when a peer connects later. `NetEntityId` is non-zero, authority-issued, and never reused; it maps each World’s distinct local `EntityHandle` values.
|
|
69
|
+
|
|
70
|
+
## 4. Replication evidence and failure handling
|
|
71
|
+
|
|
72
|
+
Incoming replication bytes are decoded, bounded, profile-checked, identity-checked, and reference-closed before mutation. Same-batch spawn references may resolve forward; cross-batch unresolved references do not queue. A rejected sender is disconnected and the replica World is unchanged.
|
|
73
|
+
|
|
74
|
+
The deterministic memory model tests prove NetEntityId-keyed semantic convergence between separately allocated Worlds for:
|
|
75
|
+
|
|
76
|
+
- initial full publication, unchanged publication, and late join;
|
|
77
|
+
- scalar and `array<entity>` reference remap;
|
|
78
|
+
- component replacement, add, and removal;
|
|
79
|
+
- spawn/despawn and identity cleanup;
|
|
80
|
+
- malformed, truncated, over-limit, schema, ordering, identity, and unresolved-reference rejection with zero mutation; and
|
|
81
|
+
- fatal stop after a real post-validation ECS write invariant failure.
|
|
82
|
+
|
|
83
|
+
A post-validation ECS apply invariant failure returns `apply-invariant-failed` and permanently stops that `ReplicaCoordinator`; create a new session/coordinator rather than continuing from partial trusted state.
|
|
84
|
+
|
|
85
|
+
## Structured recovery
|
|
86
|
+
|
|
87
|
+
Expected failures are closed unions carrying `.code`, `.expected`, `.hint`, and code-narrowed `.detail`. Exhaustively handle the code; the hint states the supported next action.
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
const errors = replicaSession.receiveEvents();
|
|
91
|
+
for (const error of errors) {
|
|
92
|
+
switch (error.code) {
|
|
93
|
+
case 'decode-invalid-payload':
|
|
94
|
+
case 'decode-limit-exceeded':
|
|
95
|
+
case 'ordering-invalid-tick':
|
|
96
|
+
case 'identity-invalid':
|
|
97
|
+
case 'schema-invalid':
|
|
98
|
+
case 'remap-unresolved-reference':
|
|
99
|
+
// Sender is disconnected; retain the unchanged replica World.
|
|
100
|
+
break;
|
|
101
|
+
case 'apply-invariant-failed':
|
|
102
|
+
// This coordinator is stopped; inspect detail and create a fresh session.
|
|
103
|
+
break;
|
|
104
|
+
case 'handshake-profile-mismatch':
|
|
105
|
+
// Do not attach/apply across incompatible profiles.
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Codec and remap details
|
|
112
|
+
|
|
113
|
+
The replication codec is the sole canonical byte/limit authority. `ReplicationLimits` bound message bytes, entities, component operations, strings, buffers, and arrays before mutation. Component data is reflection-projected through the ECS externalization kernel. Entity and `array<entity>` fields contain NetEntityIds on the wire and are remapped through the replica identity map during apply.
|
|
114
|
+
|
|
115
|
+
## Out of scope
|
|
116
|
+
|
|
117
|
+
This package deliberately does **not** provide:
|
|
118
|
+
|
|
119
|
+
| Capability | Status |
|
|
120
|
+
|:--|:--|
|
|
121
|
+
| WebSocket transport, Node listener, and browser/process E2E | See `@forgeax/engine-net-websocket` |
|
|
122
|
+
| Gameplay/Snake surface | Not implemented |
|
|
123
|
+
| Reconnect, ACK ledger, resync, packet-loss recovery, pending unresolved-reference queue | Not implemented |
|
|
124
|
+
| Client prediction, interpolation, rollback, or lockstep | Not implemented |
|
|
125
|
+
| Per-entity authority, ownership, or authority transfer | Not implemented |
|
|
126
|
+
| Socket-specific retry or automatic recovery after a disconnect/fatal apply | Not implemented |
|
|
127
|
+
|
|
128
|
+
## Entry points
|
|
129
|
+
|
|
130
|
+
| Export | Purpose |
|
|
131
|
+
|:--|:--|
|
|
132
|
+
| `NetEndpoint`, `PeerId` | Transport-only bytes and peer lifecycle contract |
|
|
133
|
+
| `createMemoryEndpointPair` | Deterministic memory transport pair |
|
|
134
|
+
| `NetSession`, `netPlugin` | World-facing session integration |
|
|
135
|
+
| `defineReplication`, `ReplicationProfile` | Portable selected ECS replication contract |
|
|
136
|
+
| `AuthorityCoordinator`, `ReplicaCoordinator` | Authority publication and atomic replica apply |
|
|
137
|
+
| `NetEntityId` | Opaque cross-World entity identity |
|
|
138
|
+
| `NetError`, `EndpointError` | Closed structured expected failures |
|
|
139
|
+
|
|
140
|
+
## Source map
|
|
141
|
+
|
|
142
|
+
- Endpoint contract and memory transport: `src/endpoint/`
|
|
143
|
+
- Session host seam: `src/session/`
|
|
144
|
+
- Profile, codec, identity, authority, and replica: `src/replication/`
|
|
145
|
+
- Convergence and rejection evidence: `__tests__/memory-*.integration.test.ts`, `__tests__/replica-fatal-stop.test.ts`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../types/dist/animation-target.d.ts","../../types/dist/asset-errors.d.ts","../../types/dist/result.d.ts","../../types/dist/asset-evidence.d.ts","../../types/dist/asset.d.ts","../../types/dist/asset-runtime.d.ts","../../types/dist/material/color-space.d.ts","../../types/dist/material/asset.d.ts","../../types/dist/vfx.d.ts","../../types/dist/handle.d.ts","../../types/dist/material/errors.d.ts","../../types/dist/material/resolve.d.ts","../../types/dist/material/index.d.ts","../../types/dist/asset-producer.d.ts","../../types/dist/catalog.d.ts","../../types/dist/runtime-scope.d.ts","../../types/dist/derive-paramschema.d.ts","../../types/dist/import.d.ts","../../types/dist/index.d.ts","../src/endpoint/errors.ts","../src/endpoint/endpoint.ts","../src/endpoint/memory.ts","../../ecs/dist/entity-handle.d.ts","../../ecs/dist/storage/column.d.ts","../../ecs/dist/component-schema.d.ts","../../ecs/dist/component.d.ts","../../ecs/dist/entity.d.ts","../../ecs/dist/errors/query-and-component-errors.d.ts","../../ecs/dist/errors/relationship-errors.d.ts","../../ecs/dist/errors/sprite-and-shared-errors.d.ts","../../ecs/dist/errors/validation-errors.d.ts","../../ecs/dist/world-internal.d.ts","../../ecs/dist/query/query.d.ts","../../ecs/dist/relationship-index.d.ts","../../ecs/dist/shared-ref-store.d.ts","../../ecs/dist/world-change-journal.d.ts","../../ecs/dist/storage/table.d.ts","../../ecs/dist/storage/archetype.d.ts","../../ecs/dist/storage/archetype-graph.d.ts","../../ecs/dist/storage/change-detection.d.ts","../../ecs/dist/time.d.ts","../../ecs/dist/schedule-token.d.ts","../../ecs/dist/world.d.ts","../../ecs/dist/commands.d.ts","../../ecs/dist/schedule.d.ts","../../ecs/dist/execution/shared-kernel.d.ts","../../ecs/dist/errors.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/types/array.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/types/types.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/types/misc.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/types/string.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/types/time.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/types/index.d.ts","../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/utils.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/registry.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/reflect.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/fiber.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/events.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/logger.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/context.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/service.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@deepseek-ai+cordis-plugin-loader@1.0.2/node_modules/@deepseek-ai/cordis/lib/types/index.d.ts","../../tool-runtime/dist/types.d.ts","../../tool-runtime/dist/errors.d.ts","../../tool-runtime/dist/artifacts.d.ts","../../tool-runtime/dist/capability.d.ts","../../tool-runtime/dist/carrier.d.ts","../../tool-runtime/dist/lease.d.ts","../../tool-runtime/dist/migration.d.ts","../../tool-runtime/dist/runtime.d.ts","../../tool-runtime/dist/snapshot.d.ts","../../tool-runtime/dist/timing.d.ts","../../tool-runtime/dist/transport.d.ts","../../tool-runtime/dist/index.d.ts","../../plugin/dist/capability.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/internal.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/config/tree.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/config/group.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/config/entry.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/config/isolate.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/config/utils.d.ts","../../../node_modules/.pnpm/@deepseek-ai+cordis-plugin-loader@1.0.2_patch_hash=6e77a3b82171afbdac249c0e31290cc06386_1a14a168fdebad14b739afc92f305e1c/node_modules/@deepseek-ai/cordis-plugin-loader/lib/types/index.d.ts","../../plugin/dist/tool-plugin.d.ts","../../plugin/dist/loader.d.ts","../../plugin/dist/index.d.ts","../../ecs/dist/plugin-service.d.ts","../../ecs/dist/index.d.ts","../../ecs/dist/externalization/index.d.ts","../src/replication/constants.ts","../src/replication/errors.ts","../src/replication/profile.ts","../src/replication/codec.ts","../src/replication/authority.ts","../src/replication/handshake.ts","../src/replication/replica.ts","../src/session/net-session.ts","../src/session/session-plugin.ts","../src/index.ts"],"fileIdsList":[[122,137,138,142,145],[122,137,139,140,142,145],[112,122,139,140,142,145],[112,122,138,139,140,142,145],[112,122,136,137,138,139,140,141,142,145],[112],[112,114,115,116,117,118,119],[112,115,116,117,118,119,120],[112,113,114,115,116,117,118,119,120],[114,115,116,117,118,119,120,121],[114,115,116,117,118,119,120],[122,142,145],[107,108,109,110,111],[78,82,85,91,102,106],[85],[78,82,83,84],[87,88,89,90,105],[92,101,104],[82,84,85,86,92,93,94,100,101,102,103,104,106,146],[102,145,146],[78,82,85,91,106],[82,85],[78,85,92,101,102,103,106],[78,106],[85,96,97,99],[85,96],[82,85,95,96,98],[82,83,85,99],[82],[78,82,85,91,92,93,94,99,100,101,104,105,106],[78,79],[80],[78,79,80],[79,80,81,150,151,152,153,154,155,156,157],[78,147,148,149,150,151,152],[78,149,150,151],[78,150,151],[78,85,147,148,150],[78,80,85,147,148,150,151,152],[78,79,80,150,151,153,155],[80,145,146,147,156],[122,134,142,145],[122,135,142,143,144,145],[122,134,135,142,143,145],[123,124],[123],[123,124,125,126,127,128,129,130,131,132,133],[123,127],[61,62,64],[61,62,64,78],[63],[64,73],[78],[61,73,74,75,78],[60,61,62,64,65,67,68,69,72,73,74,75,76,77],[65,66,78],[67],[66,67,70,71],[62,67,70],[73,74]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},"89fe170d9a59f81cd9a9d95de3278f108ff91491810b2529cc0ffb502a57b6c0","0b4928041c807c01b33b1fa028236df635c52f7acff5a40f2c2d0d677b53428b","5ad2e5b8b17893d0eb1f11a1b6e8c03b17344be03a6a72a624cd38ab05fe4d5c","6a1e553079e654a1771463e9eeb98ea4f7bb4b6417a5237d4fdf9b546d49647f","7f11be86b9ac5c2cd5127cd9d40ccc7694c58868a3157692a153d452fc171525","8b52dd8be86f44f871db89a6c1f77f7585688d53141ff55b6c5fac3eb67b1241","6e3488ee1183ea915eb43f08aebc5f75e30be25aef1f678d1965324bdd7506e1","59ca967d9cb92088499ce15a1c389e55a39bb2cb905844439565d9f7d8b1ed5d","a318d8734523d9e750681e7b8e685ef817d4049c5612451f4e849da8b2b572a9","99440a4820b8621d65822e29b01afd8a5938ea94ebea634fdd31d32d3e735629","080e7748d9754ccaea8debbc933552c7976c1ef588f9642a6f07e5a4d139d43b","51342c51a9090c0bc8bae60c5ec1a0f46d6d44db84392f12a8cd46e6d8a9f617","ae777307a0baeb9b5d7ba18e6a029a54eb0b612b1491591dcedb020cc8d36f97","464bedfb5186f124eacfc18488346e51dcf1318f5135e1cbb429f917065e5360","ba3e7709ee018a58cbde4f26ba611f89938725472766bcb325c1ed2ce41e9d6f","459b3765e622008ed590474ae6b61ab55107a7b9529a28d05087a6fef51d7248","ce15f7fa66eb0ff73351db6a626a397eb441aa3572707c2a156897c646b2911d","cc943379ee4a2e1023e8ad62c136d1367906e58e29559195e92cbcc1b296e803","bcf485b4f161e232c90d00f14ec27128227cf1cbdf60b93949b47a9365461a1d",{"version":"5bff0d8a5482853a49624e98c6845a3e0cd49fa9a47807cd8641a7e53f4953d0","signature":"19a5feda138f012de02931a69ff011f7a222f7ad526d788c91409e701b9e9f93"},{"version":"5e44175c0f3d05abc12f8cc58196f798414900f92e987a6435b535ebd67ac0cb","signature":"c30dfad3c20fbef9f93e2dc2ddf79008060a78c9155e6a8c41ecc014eee810f8"},{"version":"c176f21d537e68019660ee77535f2a5ce8a2c96e24746d9d8d5e331ad926a7f5","signature":"4833496839e4d6f3b673a2dfd090c1e2eb7f36742f782806e687f7c7a7f24597"},"b866405af1564f0690ea323f070c87509bfeb2ba8afa7c49c255dbe13c176bf8","ce648e4449eb59292b997226148647ce9ca22bc9ff9062959f5f1fe6bfe06cd8","ce3d7045ddbf0f8c968829a4e32d5064af66cba795f8c8490afec9eb677a4f45","6192bdb56ca09fde8176590331c36f3eec2fd5fb3ad7dd7401727efb2398d7fb","0810b73622b33b91f89f5d0f8b1fc0b92841e6b751a84d2c005508c563748d16","9a1b69540b9533e337c81d470724ebb054a15b994a11b759a969367b28e81368","854cbb22c44beb0fe44a46f5428521a27e8b9fb645e6ce803a5622ff44ec74ce","dd6776bc5480997847e4d3c495951de5f0401667e1880b6176f57584c49aa401","5173f8a542f4174c378adfa9a98f92a38b07755e40a14ba139cb46f6986d64d6","2278fcff8ca72dc791b3907ac363bd7370ec04e38653827c14c5dbd3fc99e335","ee7cd212dd2cfef9efd135a36a577fa35cb4af99f7e6fd3023cc9d2f7c6f438b","0bc016e4da8853d924fbfde9820db77121de75539641d02012232396b09e7dd6","6647e4b21b341f971ef92cbdbeaee6a42d77b291a43cdc73b970b2ad505bb912","2f9485d1b731e3d1d373c2a2a20e3ad41b55616b9fa13bf261d2a058cd23149b","d9df407e562a322f63c0cc3f1bcea9c1cbec38d0c92b3f49169291f22374cb6c","ba9d80c5b60b7708524491768da7d44a796042529ed945678f45356beb2504f9","7689fbecdcdb8f32296c94fe5cf5edef16a9db673d696a2aaa40ad54470e5965","2c2b0520a51bf2f420ec605fa5e327ea7d96732cc97a373c167e12ad71dda21f","5f15c8ce469d7e9da71f9ca502370c454eb29629d6c2e548fa722d00700dfb46","ce5251c882968a3ce8fc6c2e3b2c3b739a740f614eebf066b73e8ee7c5dc4f63","2146d63418ecb6b19792c162b39fb1246f4bb28a7eefcdc3e589e880140834f2","8f373e06438a141f82616c5e0b171e0bf613cc95aa1e6b8b41a8ae520dd2948e","5c9cf44d7fea3b0c9876102abc143967f2e7015dd0a89edcbe28a49906621206","6db8a395b3c5f988123adb6cc84b6410a82a060c4acde2491012b9b44b32b300","4c44739d6f89fe451021d088397f7c9fe93c24fcf2de14019c5d011fb442082d",{"version":"fb6f2007d60e8b519a2ef0c5a27026ddfe06418ae6261c4eb0cb670cca5e1bc2","impliedFormat":99},{"version":"a48f1b69ec0b94b16c7ece2cf6d6003cc8d0c329538117c1c364d8525a100850","impliedFormat":99},{"version":"cd5713ac354e4869fdf837e12d24d3ae14fd9d94a5bb2d340df63b899b74e6ca","impliedFormat":99},{"version":"56210599298d6eca6285eab99c7e9333d7e275c3a73a7f401b3055e8d55c67e8","impliedFormat":99},{"version":"2845576622e416da9871e1f3c788ba41dc4f24eb764362b10eceeb0dbaa67208","impliedFormat":99},{"version":"f0421e04e2a5238754cf444bf2a56fe7e7a94a08c14c1f9d063ff51c85825823","impliedFormat":99},{"version":"bdd14f07b4eca0b4b5203b85b8dbc4d084c749fa590bee5ea613e1641dcd3b29","impliedFormat":99},{"version":"967b227fad024ba8a7c32127534089bce5adc800840b0288f44d41c4c849278e","impliedFormat":99},{"version":"ffd229492af3cb444c01e8e51a78dfdbed670940bac40dde083675d57d6984fc","impliedFormat":99},{"version":"57cdef8252cb041b4b646cc9e80dcb27d2180bb78fcf95761136d99be4079cb3","impliedFormat":99},{"version":"eb5fd8d19b0330da4dccb6cab3eae0304f056ac8fbd5bd9589ce48f0920bff78","impliedFormat":99},{"version":"db565a086622cbe616a950186dc90e82a74060864b9cd1d0f25285860daea9b4","impliedFormat":99},{"version":"71087395cc862f52662ab2629a0f3838f8f2aaf84eb40c97f4f4004f2fcbbed6","impliedFormat":99},{"version":"1e2e6cfcab26ae01d7f2dd1f78a1d25ddb7f3b2e27f50c9eb3b54ee206a87884","impliedFormat":99},{"version":"489ec23ef8dc0e869cf3d8d77a39ba83ab24e5e71362320f5662491b3dc5bd04","impliedFormat":99},{"version":"c93dd79fae382105510c69cc8eef95a96c8c43e50b47e16efa98a3f9e76f304b","impliedFormat":99},"4a5b020726455dd70acdf34ccc435273e6333cbb1a3ff08b6c451148c61b21fd","eb4d76417ff2ac49726b2efaf83e5b9924f7040151293d092e1ba38905479a02","3bae912eb95706a507e668cdfe378bb612c81b46323aae337689fabc00c3ae29","129aaa58f8b8ed74d8ef3ab03d3219f1b5a7b2902c4e111e080abdaf043686ef","c0a9cb9a3fe662b66cf598c1e2e6bc799b423699b81249bb62586acbc817b1e7","7d3bbcb2ef65e80202188d77d2e06f30c5d5d2603ca49cde35a6b298565247e9","f90ae41777b29281dcd4aa3fafb9d84c6b328860d639114a8c3fcf36beb23817","eadfe727983087acea4f17095671faba65ba5233acaed7213f140269d4528c9a","6bbe3b367d76debfa83ec26a13d0013f8dad891cddd8909a1fbdcdb719b064d9","9fec96292881b3ee00f9b34d757887223221db25d0fb534b521743e9be298d9f","fbd59a37ab9b1a3a21f2e968b539f91453e560507d9e92748f0623f7118306be","92523b7353d096bd2464e1611035b284803894aa952541021922567dfe9f15aa","49ca23a8e2de57d49da1b5b5aa2f0e0d341b4230a899efe1a6078d3779e2ea53",{"version":"be53d0833468d1d4de05770f4af2d3ec465b7ef5d5181b748997a02bf362ebd0","impliedFormat":99},{"version":"4920f950330f6a8a00a084beb7998de838a15cd54f5c774962b75614c15f8bed","impliedFormat":99},{"version":"e892ea4cf5fc5e5ab078f265c617efa3ab44a1cbd477f91fd29a27698c45eb77","impliedFormat":99},{"version":"6a33bd0416049803becacbdccd852c02f342eedce7dea12956d1176966269eeb","impliedFormat":99},{"version":"f74c6749e3944913d8002c1dd30523c520de426e9113d47b6730565318349154","impliedFormat":99},{"version":"ac5d5fd3358d3f7491400869278ea288df297b4fbc1ba035c7fd09c8df822358","impliedFormat":99},{"version":"0ce13f49afeb385ad05698a5420580c7381d758779b730c1992be7386578e1e7","impliedFormat":99},"8fa74a106f75c2eed4b65fa571e4e9b78e9a3a68f65b6c70261e87f7f47b931d","d82719b8e8a552f66dea370df85e00f9473537bb9c35dcb711d7f48cb5e707cd","a3c435d1e1eb110bb7382103c522bf44e9abb8b6883a493360fc5859db0aee10","1487f3b04d5e9ed9c5d823ff91bedbd7a8ce7a4c44b7ef16fa64a2d930a731e9","18dfdac2f4092e68e453e7a9da3d0e800e597e82fa567c49c2c7bb4c4dfb26ff","4e5baf651dd59df5450dac9570ee16563c88c4beb81003b7c8e78c99b669e635",{"version":"ab784c71757019de0bc00b17a9cfb65787a29be69bc7951eb758433f6d249dea","signature":"cf41ad14f06ed045a2d79f4485f69e76c75be91f43555167f1479d500a4fc0b7"},{"version":"7106ad131f2946087c66a4cde0f11d28b07c18fb0446ae05966a5d7f4a57c449","signature":"82dc124349dbfcf2d4a6087440c6c051ebf776c62af695368435e7eed1859bc1"},{"version":"58812586d581e20020db3ae3b603e802a8afc5f9670d0ca6902218f781eb85cc","signature":"f08d0b19f03d9e47f875b8eb541059e2f164814f9950037410038bf755efdce9"},{"version":"ee7d553a163c0df56fdecdfd52e44f6e6507669c85b265f742dff40403753762","signature":"e2c7999edec7e484a0160a0c9d1c8b19bf78f0a96212f0b84855b815f9deb80d"},{"version":"94118deb017cbaf61b255ae9620760db28a22222bcbe33ab1ae0c7fb71a55c80","signature":"4e4d72ff6bbd44a8e49d05f6af304e45407795f85216e3df418565d0855704e8"},{"version":"150f0228e4808225d53a5359b3839e5af904108fdfab55e36339bb00cce9f0da","signature":"a00a0fe104f3fee90c347b46e85aa47ae8ec1da46756e14fa0415b212175c20f"},{"version":"fba1ae8855ff7259558dab29fd6ab9533be9cdfcb2426657221411d3bf6b0c95","signature":"ba4d70a517900b89781b6a29ee1e9dfaca8f3bb4fcc8107eb70b95835248e689"},{"version":"1377d741864efa5dd27d9a970bde09232f8eb6698aaabf94b8c297885c9affbf","signature":"446883b627e33758207797285313fedcefaec5ea210ea0240e0dad0345ca28e1"},{"version":"7b8ae13c406d357c2b1485d4e693c63230609f72eba7a11c5ebaa5d75b481c13","signature":"8e1266662cfd530bf7a1d4f435befcf51519c9e1b37aa7f7a00ad0277e41754a"},{"version":"21e9147d82673b7682a080c2737fe6118341c25a7571acd80d530400021f8cbf","signature":"1bc2a9ef7e30cef2d9f3a4690c02b605831a15ec71af5b96388a87388204a0a9"}],"root":[[79,81],[149,158]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[139,1],[138,2],[140,3],[137,4],[142,5],[136,6],[120,7],[118,8],[117,9],[122,10],[119,11],[116,8],[115,9],[121,11],[114,12],[112,13],[103,14],[84,15],[85,16],[86,15],[106,17],[90,15],[105,18],[148,15],[147,19],[146,20],[92,21],[93,22],[104,23],[94,24],[98,25],[97,26],[99,27],[83,15],[96,28],[95,29],[102,30],[80,31],[79,32],[81,33],[158,34],[153,35],[152,36],[154,37],[151,38],[155,39],[156,40],[157,41],[135,42],[145,43],[144,44],[143,42],[125,45],[126,46],[124,46],[134,47],[129,46],[130,46],[131,46],[132,46],[133,48],[63,49],[65,50],[64,51],[74,52],[76,53],[69,53],[77,54],[78,55],[67,56],[66,57],[72,58],[71,59],[75,60]],"latestChangedDtsFile":"./index.d.ts","version":"6.0.3"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Result } from '@forgeax/engine-types';
|
|
2
|
+
import type { EndpointError } from './errors';
|
|
3
|
+
declare const __peerIdBrand: unique symbol;
|
|
4
|
+
/** Opaque transport-level peer identity. Never a plain number. */
|
|
5
|
+
export type PeerId = number & {
|
|
6
|
+
readonly [__peerIdBrand]: true;
|
|
7
|
+
};
|
|
8
|
+
/** Transport-level event emitted by NetEndpoint.poll(). */
|
|
9
|
+
export type EndpointEvent = {
|
|
10
|
+
readonly kind: 'peer-connected';
|
|
11
|
+
readonly peerId: PeerId;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'peer-disconnected';
|
|
14
|
+
readonly peerId: PeerId;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'message';
|
|
17
|
+
readonly peerId: PeerId;
|
|
18
|
+
readonly data: Uint8Array;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Transport-only endpoint contract.
|
|
22
|
+
*
|
|
23
|
+
* Delivers complete Uint8Array messages with actual PeerId and connect/disconnect
|
|
24
|
+
* lifecycle. Reliable ordered delivery per peer or explicit connection failure.
|
|
25
|
+
* No ECS, profile, or codec knowledge.
|
|
26
|
+
*/
|
|
27
|
+
export interface NetEndpoint {
|
|
28
|
+
/** Poll for pending events (connect, disconnect, message). Returns empty array when idle. */
|
|
29
|
+
poll(): EndpointEvent[];
|
|
30
|
+
/** Send a complete message to a connected peer. Returns structured error on failure. */
|
|
31
|
+
send(peerId: PeerId, data: Uint8Array): Result<void, EndpointError>;
|
|
32
|
+
/** Close the endpoint. No further send/poll should succeed after close. */
|
|
33
|
+
close(): Result<void, EndpointError>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/endpoint/endpoint.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAM9C,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C,kEAAkE;AAClE,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAMjE,2DAA2D;AAC3D,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAMrF;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,IAAI,IAAI,aAAa,EAAE,CAAC;IAExB,wFAAwF;IACxF,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAEpE,2EAA2E;IAC3E,KAAK,IAAI,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { PeerId } from './endpoint';
|
|
2
|
+
/** Transport-level endpoint error codes (requirements AC-02, AC-13). */
|
|
3
|
+
export type EndpointErrorCode = keyof typeof endpointErrorPolicy;
|
|
4
|
+
export interface EndpointDetailPeerNotFound {
|
|
5
|
+
readonly peerId: PeerId;
|
|
6
|
+
}
|
|
7
|
+
export interface EndpointDetailConnectionClosed {
|
|
8
|
+
readonly peerId: PeerId;
|
|
9
|
+
}
|
|
10
|
+
export interface EndpointDetailSendFailed {
|
|
11
|
+
readonly peerId: PeerId;
|
|
12
|
+
readonly cause: string;
|
|
13
|
+
}
|
|
14
|
+
export interface EndpointDetailAlreadyClosed {
|
|
15
|
+
readonly cause: string;
|
|
16
|
+
}
|
|
17
|
+
export interface EndpointDetailConnectionFailed {
|
|
18
|
+
readonly address: string;
|
|
19
|
+
readonly cause: string;
|
|
20
|
+
}
|
|
21
|
+
export type EndpointErrorDetailFor<C extends EndpointErrorCode> = C extends 'peer-not-found' ? EndpointDetailPeerNotFound : C extends 'connection-closed' ? EndpointDetailConnectionClosed : C extends 'send-failed' ? EndpointDetailSendFailed : C extends 'already-closed' ? EndpointDetailAlreadyClosed : C extends 'connection-failed' ? EndpointDetailConnectionFailed : never;
|
|
22
|
+
/** Tagged union of all endpoint error detail variants. */
|
|
23
|
+
export type EndpointErrorDetail = EndpointErrorDetailFor<EndpointErrorCode>;
|
|
24
|
+
declare class EndpointErrorClass extends Error {
|
|
25
|
+
readonly code: EndpointErrorCode;
|
|
26
|
+
readonly expected: string;
|
|
27
|
+
readonly hint: string;
|
|
28
|
+
readonly detail: EndpointErrorDetail;
|
|
29
|
+
constructor(args: {
|
|
30
|
+
code: EndpointErrorCode;
|
|
31
|
+
expected: string;
|
|
32
|
+
hint: string;
|
|
33
|
+
detail: EndpointErrorDetail;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
type EndpointErrorVariant<C extends EndpointErrorCode> = EndpointErrorClass & {
|
|
37
|
+
readonly code: C;
|
|
38
|
+
readonly detail: EndpointErrorDetailFor<C>;
|
|
39
|
+
};
|
|
40
|
+
export type EndpointError = {
|
|
41
|
+
[C in EndpointErrorCode]: EndpointErrorVariant<C>;
|
|
42
|
+
}[EndpointErrorCode];
|
|
43
|
+
interface EndpointErrorConstructor {
|
|
44
|
+
new <C extends EndpointErrorCode>(args: {
|
|
45
|
+
code: C;
|
|
46
|
+
expected: string;
|
|
47
|
+
hint: string;
|
|
48
|
+
detail: EndpointErrorDetailFor<C>;
|
|
49
|
+
}): EndpointErrorVariant<C>;
|
|
50
|
+
readonly prototype: EndpointErrorClass;
|
|
51
|
+
}
|
|
52
|
+
export declare const EndpointError: EndpointErrorConstructor;
|
|
53
|
+
declare const endpointErrorPolicy: {
|
|
54
|
+
'peer-not-found': {
|
|
55
|
+
expected: string;
|
|
56
|
+
hint: string;
|
|
57
|
+
};
|
|
58
|
+
'connection-closed': {
|
|
59
|
+
expected: string;
|
|
60
|
+
hint: string;
|
|
61
|
+
};
|
|
62
|
+
'send-failed': {
|
|
63
|
+
expected: string;
|
|
64
|
+
hint: string;
|
|
65
|
+
};
|
|
66
|
+
'already-closed': {
|
|
67
|
+
expected: string;
|
|
68
|
+
hint: string;
|
|
69
|
+
};
|
|
70
|
+
'connection-failed': {
|
|
71
|
+
expected: string;
|
|
72
|
+
hint: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
/** Expected-invariant table per error code. */
|
|
76
|
+
export declare const ENDPOINT_EXPECTED: Readonly<Record<EndpointErrorCode, string>>;
|
|
77
|
+
/** Actionable hint table per error code. */
|
|
78
|
+
export declare const ENDPOINT_ERROR_HINTS: Readonly<Record<EndpointErrorCode, string>>;
|
|
79
|
+
/** Type guard for narrowing unknown to EndpointError. */
|
|
80
|
+
export declare function isEndpointError(err: unknown): err is EndpointError;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/endpoint/errors.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMzC,wEAAwE;AACxE,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAMjE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAMD,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,SAAS,gBAAgB,GACxF,0BAA0B,GAC1B,CAAC,SAAS,mBAAmB,GAC3B,8BAA8B,GAC9B,CAAC,SAAS,aAAa,GACrB,wBAAwB,GACxB,CAAC,SAAS,gBAAgB,GACxB,2BAA2B,GAC3B,CAAC,SAAS,mBAAmB,GAC3B,8BAA8B,GAC9B,KAAK,CAAC;AAElB,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;AAM5E,cAAM,kBAAmB,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;gBAEzB,IAAI,EAAE;QAChB,IAAI,EAAE,iBAAiB,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,mBAAmB,CAAC;KAC7B;CAyBF;AAED,KAAK,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,IAAI,kBAAkB,GAAG;IAC5E,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,iBAAiB,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAClD,CAAC,iBAAiB,CAAC,CAAC;AAErB,UAAU,wBAAwB;IAChC,KAAK,CAAC,SAAS,iBAAiB,EAAE,IAAI,EAAE;QACtC,IAAI,EAAE,CAAC,CAAC;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;KACnC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;CACxC;AAED,eAAO,MAAM,aAAa,EAAE,wBAC+B,CAAC;AAI5D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAsBsB,CAAC;AAEhD,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAE1B,CAAC;AAEjD,4CAA4C;AAC5C,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAE7B,CAAC;AAEjD,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,aAAa,CAElE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NetEndpoint } from './endpoint';
|
|
2
|
+
export declare function createMemoryEndpointPair(): [NetEndpoint, NetEndpoint];
|
|
3
|
+
export interface MemoryFaultController {
|
|
4
|
+
delayNextDelivery(ms: number): void;
|
|
5
|
+
duplicateNextDelivery(): void;
|
|
6
|
+
malformNextDelivery(): void;
|
|
7
|
+
disconnectPeer(endpoint: NetEndpoint): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createMemoryEndpointPairWithController(): {
|
|
10
|
+
readonly endpoints: [NetEndpoint, NetEndpoint];
|
|
11
|
+
readonly controller: MemoryFaultController;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/endpoint/memory.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAiB,WAAW,EAAU,MAAM,YAAY,CAAC;AA4HrE,wBAAgB,wBAAwB,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAUrE;AAED,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qBAAqB,IAAI,IAAI,CAAC;IAC9B,mBAAmB,IAAI,IAAI,CAAC;IAC5B,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7C;AAED,wBAAgB,sCAAsC,IAAI;IACxD,QAAQ,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/C,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;CAC5C,CAmBA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { EndpointEvent, NetEndpoint, PeerId } from './endpoint/endpoint';
|
|
2
|
+
export type { EndpointErrorCode, EndpointErrorDetail } from './endpoint/errors';
|
|
3
|
+
export { ENDPOINT_ERROR_HINTS, ENDPOINT_EXPECTED, EndpointError, isEndpointError, } from './endpoint/errors';
|
|
4
|
+
export type { MemoryFaultController } from './endpoint/memory';
|
|
5
|
+
export { createMemoryEndpointPair, createMemoryEndpointPairWithController, } from './endpoint/memory';
|
|
6
|
+
export { AuthorityCoordinator, createAuthorityCoordinator } from './replication/authority';
|
|
7
|
+
export type { NetEntityId, ReplicationBatch, ReplicationComponentRecord, ReplicationEntityRecord, } from './replication/codec';
|
|
8
|
+
export { NetError, type NetErrorCode, type NetErrorDetail } from './replication/errors';
|
|
9
|
+
export { validateHandshake } from './replication/handshake';
|
|
10
|
+
export type { DefineReplicationOptions, ReplicationLimits, ReplicationProfile, } from './replication/profile';
|
|
11
|
+
export { defineReplication } from './replication/profile';
|
|
12
|
+
export { applyReplicaBatch, createReplicaCoordinator, decodeAndApplyReplicaBatch, ReplicaCoordinator, } from './replication/replica';
|
|
13
|
+
export type { NetSessionConfig, PeerSnapshot, RawMessage } from './session/net-session';
|
|
14
|
+
export { NetSession } from './session/net-session';
|
|
15
|
+
export type { NetPluginConfig } from './session/session-plugin';
|
|
16
|
+
export { netPlugin } from './session/session-plugin';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EACL,wBAAwB,EACxB,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC3F,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EACV,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC"}
|