@cello-protocol/transport 0.0.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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @cello-protocol/transport — public API
3
+ *
4
+ * Exports the CelloNode factory, interface, protocol constants, and error types.
5
+ */
6
+ export { createNode } from "./node.js";
7
+ export type { CelloNode, CreateNodeOptions, CelloStreamHandler } from "./types.js";
8
+ export type { CelloTransportError, ProtocolNotSupportedError, ConnectionLostError, NodeStoppedError, ListenFailedError, } from "./types.js";
9
+ export { CELLO_PROTOCOL_ID, CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID, CELLO_CONTENT_PROTOCOL_ID } from "./protocols.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACnF,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @cello-protocol/transport — public API
3
+ *
4
+ * Exports the CelloNode factory, interface, protocol constants, and error types.
5
+ */
6
+ export { createNode } from "./node.js";
7
+ export { CELLO_PROTOCOL_ID, CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID, CELLO_CONTENT_PROTOCOL_ID } from "./protocols.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AASvC,OAAO,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ /**
2
+ * CELLO Transport — node.ts
3
+ *
4
+ * createNode() and CelloNodeImpl: libp2p node bootstrap for the CELLO protocol.
5
+ *
6
+ * PSEUDOCODE (Phase P) — preserved as reference:
7
+ *
8
+ * createNode({ keyProvider, listenAddresses }):
9
+ * 1. Generate a fresh Ed25519 keypair via @libp2p/crypto/keys generateKeyPair('Ed25519').
10
+ * This keypair is the libp2p transport identity (Peer ID + Noise handshake key).
11
+ * It is completely independent of keyProvider — ADR-0001 invariant.
12
+ * Noise spec reference: https://noiseprotocol.org/noise.html (XX pattern)
13
+ * libp2p Noise spec: https://github.com/libp2p/specs/tree/master/noise
14
+ * 2. Call createLibp2p({
15
+ * privateKey: freshKeypair,
16
+ * addresses: { listen: listenAddresses },
17
+ * transports: [tcp(), webSockets()],
18
+ * connectionEncrypters: [noise()], // ONLY Noise — no plaintext. SI-001.
19
+ * streamMuxers: [yamux()],
20
+ * services: {
21
+ * identify: identify(),
22
+ * relay: circuitRelayServer(), // advertises HOP protocol
23
+ * dcutr: dcutr(),
24
+ * },
25
+ * })
26
+ * 3. Do NOT start the libp2p node — return it in stopped state. AC-001 says
27
+ * start() is called separately.
28
+ * 4. Wrap in CelloNodeImpl which stores keyProvider (for MSG-001 use) but
29
+ * never calls keyProvider.getPublicKey() or keyProvider.sign(). SI-002.
30
+ *
31
+ * node.start():
32
+ * - Call libp2p.start()
33
+ * - node is now listening on configured addresses
34
+ *
35
+ * node.stop():
36
+ * - Call libp2p.stop()
37
+ * - All connections/streams are closed
38
+ * - listenAddresses() will return []
39
+ *
40
+ * node.dial(multiaddr):
41
+ * - If stopped: throw { reason: 'node_stopped', message }
42
+ * - multiaddr string → multiaddr object via @multiformats/multiaddr
43
+ * - libp2p.dial(multiaddr) → Connection
44
+ * - Return { peerId: connection.remotePeer.toString() }
45
+ *
46
+ * node.handle(protocolId, handler):
47
+ * - libp2p.handle(protocolId, ({stream}) => handler(stream))
48
+ *
49
+ * node.newStream(peerId, protocolId):
50
+ * - If stopped: throw { reason: 'node_stopped', message }
51
+ * - Get existing connections to peerId
52
+ * - If no open connections: throw { reason: 'connection_lost', peerId, message }
53
+ * - connection.newStream(protocolId):
54
+ * - On protocol negotiation failure (UnsupportedProtocolError): throw { reason: 'protocol_not_supported', protocolId, message }
55
+ * - On connection error: throw { reason: 'connection_lost', peerId, message }
56
+ * - Return stream
57
+ *
58
+ * node.listenAddresses():
59
+ * - Return libp2p.getMultiaddrs().map(ma => ma.toString())
60
+ * - Returns [] when stopped (libp2p returns empty array)
61
+ *
62
+ * Stream framing: it-length-prefixed (unsigned varint prefix per multiformats spec)
63
+ * Use lp.encode(source) / lp.decode(source) with it-pipe for composing pipelines.
64
+ */
65
+ import type { CelloNode, CreateNodeOptions } from "./types.js";
66
+ /**
67
+ * Create a new CelloNode in stopped state.
68
+ *
69
+ * CRITICAL (ADR-0001 / SI-002):
70
+ * - A fresh libp2p-managed Ed25519 keypair is generated here.
71
+ * - This keypair drives the transport Peer ID and Noise handshake.
72
+ * - keyProvider is stored but NEVER called during createNode() or start().
73
+ * - The node's Peer ID will differ from any PeerId derived from keyProvider.
74
+ *
75
+ * Transport stack:
76
+ * - Transports: TCP + WebSockets
77
+ * - Security: Noise ONLY (XX pattern, RFC: https://noiseprotocol.org/noise.html)
78
+ * - Muxer: Yamux
79
+ * - Services: identify, circuitRelayServer (advertises HOP), DCuTR
80
+ */
81
+ export declare function createNode(opts: CreateNodeOptions): Promise<CelloNode>;
82
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAeH,OAAO,KAAK,EACV,SAAS,EAET,iBAAiB,EAClB,MAAM,YAAY,CAAC;AA4KpB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAmC5E"}
package/dist/node.js ADDED
@@ -0,0 +1,261 @@
1
+ /**
2
+ * CELLO Transport — node.ts
3
+ *
4
+ * createNode() and CelloNodeImpl: libp2p node bootstrap for the CELLO protocol.
5
+ *
6
+ * PSEUDOCODE (Phase P) — preserved as reference:
7
+ *
8
+ * createNode({ keyProvider, listenAddresses }):
9
+ * 1. Generate a fresh Ed25519 keypair via @libp2p/crypto/keys generateKeyPair('Ed25519').
10
+ * This keypair is the libp2p transport identity (Peer ID + Noise handshake key).
11
+ * It is completely independent of keyProvider — ADR-0001 invariant.
12
+ * Noise spec reference: https://noiseprotocol.org/noise.html (XX pattern)
13
+ * libp2p Noise spec: https://github.com/libp2p/specs/tree/master/noise
14
+ * 2. Call createLibp2p({
15
+ * privateKey: freshKeypair,
16
+ * addresses: { listen: listenAddresses },
17
+ * transports: [tcp(), webSockets()],
18
+ * connectionEncrypters: [noise()], // ONLY Noise — no plaintext. SI-001.
19
+ * streamMuxers: [yamux()],
20
+ * services: {
21
+ * identify: identify(),
22
+ * relay: circuitRelayServer(), // advertises HOP protocol
23
+ * dcutr: dcutr(),
24
+ * },
25
+ * })
26
+ * 3. Do NOT start the libp2p node — return it in stopped state. AC-001 says
27
+ * start() is called separately.
28
+ * 4. Wrap in CelloNodeImpl which stores keyProvider (for MSG-001 use) but
29
+ * never calls keyProvider.getPublicKey() or keyProvider.sign(). SI-002.
30
+ *
31
+ * node.start():
32
+ * - Call libp2p.start()
33
+ * - node is now listening on configured addresses
34
+ *
35
+ * node.stop():
36
+ * - Call libp2p.stop()
37
+ * - All connections/streams are closed
38
+ * - listenAddresses() will return []
39
+ *
40
+ * node.dial(multiaddr):
41
+ * - If stopped: throw { reason: 'node_stopped', message }
42
+ * - multiaddr string → multiaddr object via @multiformats/multiaddr
43
+ * - libp2p.dial(multiaddr) → Connection
44
+ * - Return { peerId: connection.remotePeer.toString() }
45
+ *
46
+ * node.handle(protocolId, handler):
47
+ * - libp2p.handle(protocolId, ({stream}) => handler(stream))
48
+ *
49
+ * node.newStream(peerId, protocolId):
50
+ * - If stopped: throw { reason: 'node_stopped', message }
51
+ * - Get existing connections to peerId
52
+ * - If no open connections: throw { reason: 'connection_lost', peerId, message }
53
+ * - connection.newStream(protocolId):
54
+ * - On protocol negotiation failure (UnsupportedProtocolError): throw { reason: 'protocol_not_supported', protocolId, message }
55
+ * - On connection error: throw { reason: 'connection_lost', peerId, message }
56
+ * - Return stream
57
+ *
58
+ * node.listenAddresses():
59
+ * - Return libp2p.getMultiaddrs().map(ma => ma.toString())
60
+ * - Returns [] when stopped (libp2p returns empty array)
61
+ *
62
+ * Stream framing: it-length-prefixed (unsigned varint prefix per multiformats spec)
63
+ * Use lp.encode(source) / lp.decode(source) with it-pipe for composing pipelines.
64
+ */
65
+ import { createLibp2p } from "libp2p";
66
+ import { tcp } from "@libp2p/tcp";
67
+ import { webSockets } from "@libp2p/websockets";
68
+ import { noise } from "@chainsafe/libp2p-noise";
69
+ import { yamux } from "@chainsafe/libp2p-yamux";
70
+ import { circuitRelayServer, circuitRelayTransport } from "@libp2p/circuit-relay-v2";
71
+ import { dcutr } from "@libp2p/dcutr";
72
+ import { identify } from "@libp2p/identify";
73
+ import { generateKeyPair, generateKeyPairFromSeed } from "@libp2p/crypto/keys";
74
+ import { multiaddr } from "@multiformats/multiaddr";
75
+ import { peerIdFromString } from "@libp2p/peer-id";
76
+ // ─── CelloNodeImpl ───────────────────────────────────────────────────────────
77
+ class CelloNodeImpl {
78
+ #libp2p;
79
+ keyProvider;
80
+ constructor(libp2p, keyProvider) {
81
+ this.#libp2p = libp2p;
82
+ this.keyProvider = keyProvider;
83
+ }
84
+ async start() {
85
+ await this.#libp2p.start();
86
+ }
87
+ async stop() {
88
+ await this.#libp2p.stop();
89
+ }
90
+ listenAddresses() {
91
+ return this.#libp2p.getMultiaddrs().map((ma) => ma.toString());
92
+ }
93
+ async dial(multiaddrStr) {
94
+ if (this.#libp2p.status === "stopped") {
95
+ throw { reason: "node_stopped", message: "Node is stopped" };
96
+ }
97
+ try {
98
+ const ma = multiaddr(multiaddrStr);
99
+ const conn = await this.#libp2p.dial(ma);
100
+ return { peerId: conn.remotePeer.toString() };
101
+ }
102
+ catch (err) {
103
+ // Re-throw structured errors as-is
104
+ if (isStructuredError(err))
105
+ throw err;
106
+ throw mapDialError(err);
107
+ }
108
+ }
109
+ async handle(protocolId, handler, opts) {
110
+ // libp2p v3 StreamHandler receives (stream, connection); we only need stream
111
+ const streamHandler = (stream) => handler(stream);
112
+ await this.#libp2p.handle(protocolId, streamHandler, opts);
113
+ }
114
+ async newStream(peerIdStr, protocolId) {
115
+ if (this.#libp2p.status === "stopped") {
116
+ throw { reason: "node_stopped", message: "Node is stopped" };
117
+ }
118
+ // Look up existing connections to this peer
119
+ let peerId;
120
+ try {
121
+ peerId = peerIdFromString(peerIdStr);
122
+ }
123
+ catch {
124
+ throw {
125
+ reason: "connection_lost",
126
+ peerId: peerIdStr,
127
+ message: `Invalid peer ID: ${peerIdStr}`,
128
+ };
129
+ }
130
+ const connections = this.#libp2p.getConnections(peerId);
131
+ const openConn = connections.find((c) => c.status === "open");
132
+ if (!openConn) {
133
+ throw {
134
+ reason: "connection_lost",
135
+ peerId: peerIdStr,
136
+ message: `No open connection to peer ${peerIdStr}`,
137
+ };
138
+ }
139
+ try {
140
+ const stream = await openConn.newStream(protocolId);
141
+ return stream;
142
+ }
143
+ catch (err) {
144
+ if (isStructuredError(err))
145
+ throw err;
146
+ throw mapStreamError(err, peerIdStr, protocolId);
147
+ }
148
+ }
149
+ getPeerId() {
150
+ return this.#libp2p.peerId.toString();
151
+ }
152
+ getProtocols() {
153
+ return this.#libp2p.getProtocols();
154
+ }
155
+ getConnections() {
156
+ return this.#libp2p.getConnections().map((c) => ({
157
+ peerId: c.remotePeer.toString(),
158
+ encryption: c.encryption,
159
+ }));
160
+ }
161
+ onPeerConnect(handler) {
162
+ this.#libp2p.addEventListener("peer:connect", (evt) => {
163
+ handler(evt.detail.toString());
164
+ });
165
+ }
166
+ onPeerDisconnect(handler) {
167
+ this.#libp2p.addEventListener("peer:disconnect", (evt) => {
168
+ handler(evt.detail.toString());
169
+ });
170
+ }
171
+ }
172
+ // ─── Error helpers ───────────────────────────────────────────────────────────
173
+ function isStructuredError(err) {
174
+ return (typeof err === "object" &&
175
+ err !== null &&
176
+ "reason" in err &&
177
+ typeof err.reason === "string");
178
+ }
179
+ function mapDialError(err) {
180
+ const msg = err instanceof Error ? err.message : String(err);
181
+ // Node stopped
182
+ if (msg.includes("stopped") || msg.includes("not started")) {
183
+ return { reason: "node_stopped", message: msg };
184
+ }
185
+ return { reason: "connection_lost", peerId: "unknown", message: msg };
186
+ }
187
+ function mapStreamError(err, peerId, protocolId) {
188
+ // Check error name first — most reliable signal from libp2p
189
+ if (err instanceof Error && err.name === "UnsupportedProtocolError") {
190
+ return { reason: "protocol_not_supported", protocolId, message: err.message };
191
+ }
192
+ const msg = err instanceof Error ? err.message : String(err);
193
+ // Protocol negotiation failure — match specific phrases, not generic "stream"
194
+ if (msg.includes("unsupported protocol") ||
195
+ msg.includes("not supported") ||
196
+ msg.includes("protocol negotiation failed") ||
197
+ msg.includes("multistream")) {
198
+ return { reason: "protocol_not_supported", protocolId, message: msg };
199
+ }
200
+ // Connection-level failure — explicit connection/reset/abort signals
201
+ if (msg.includes("reset") ||
202
+ msg.includes("connection closed") ||
203
+ msg.includes("connection reset") ||
204
+ msg.includes("aborted") ||
205
+ msg.includes("connection lost")) {
206
+ return { reason: "connection_lost", peerId, message: msg };
207
+ }
208
+ // Default to connection_lost
209
+ return { reason: "connection_lost", peerId, message: msg };
210
+ }
211
+ // ─── Factory ─────────────────────────────────────────────────────────────────
212
+ /**
213
+ * Create a new CelloNode in stopped state.
214
+ *
215
+ * CRITICAL (ADR-0001 / SI-002):
216
+ * - A fresh libp2p-managed Ed25519 keypair is generated here.
217
+ * - This keypair drives the transport Peer ID and Noise handshake.
218
+ * - keyProvider is stored but NEVER called during createNode() or start().
219
+ * - The node's Peer ID will differ from any PeerId derived from keyProvider.
220
+ *
221
+ * Transport stack:
222
+ * - Transports: TCP + WebSockets
223
+ * - Security: Noise ONLY (XX pattern, RFC: https://noiseprotocol.org/noise.html)
224
+ * - Muxer: Yamux
225
+ * - Services: identify, circuitRelayServer (advertises HOP), DCuTR
226
+ */
227
+ export async function createNode(opts) {
228
+ // ADR-0001: generate a fresh keypair for libp2p transport identity.
229
+ // keyProvider is intentionally NOT touched here — see SI-002.
230
+ const transportKey = opts.transportPrivateKey
231
+ ? await generateKeyPairFromSeed("Ed25519", opts.transportPrivateKey)
232
+ : await generateKeyPair("Ed25519");
233
+ const libp2p = await createLibp2p({
234
+ start: false,
235
+ privateKey: transportKey,
236
+ addresses: {
237
+ listen: opts.listenAddresses,
238
+ },
239
+ transports: [
240
+ tcp(),
241
+ webSockets(),
242
+ // Circuit relay transport enables dialing via relay addresses
243
+ circuitRelayTransport(),
244
+ ],
245
+ connectionEncrypters: [
246
+ // Noise ONLY — no plaintext. SI-001.
247
+ // Noise XX pattern per https://noiseprotocol.org/noise.html
248
+ noise(),
249
+ ],
250
+ streamMuxers: [yamux()],
251
+ services: {
252
+ identify: identify(),
253
+ // circuitRelayServer advertises CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID
254
+ relay: circuitRelayServer(),
255
+ dcutr: dcutr(),
256
+ },
257
+ });
258
+ // Return node in STOPPED state — caller must call start()
259
+ return new CelloNodeImpl(libp2p, opts.keyProvider);
260
+ }
261
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings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,eAAe,CAAC,SAAS,CAAC,CAAC;IAErC,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC;QAChC,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,YAAY;QACxB,SAAS,EAAE;YACT,MAAM,EAAE,IAAI,CAAC,eAAe;SAC7B;QACD,UAAU,EAAE;YACV,GAAG,EAAE;YACL,UAAU,EAAE;YACZ,8DAA8D;YAC9D,qBAAqB,EAAE;SACxB;QACD,oBAAoB,EAAE;YACpB,qCAAqC;YACrC,4DAA4D;YAC5D,KAAK,EAAE;SACR;QACD,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC;QACvB,QAAQ,EAAE;YACR,QAAQ,EAAE,QAAQ,EAAE;YACpB,iEAAiE;YACjE,KAAK,EAAE,kBAAkB,EAAE;YAC3B,KAAK,EAAE,KAAK,EAAE;SACf;KACF,CAAC,CAAC;IAEH,0DAA0D;IAC1D,OAAO,IAAI,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * CELLO Transport — protocols.ts
3
+ *
4
+ * Protocol ID constants for the CELLO transport layer.
5
+ */
6
+ /**
7
+ * CELLO M0 stream protocol identifier.
8
+ * Used for all CELLO envelope exchanges in the walking skeleton (M0) milestone.
9
+ * Stream framing: it-length-prefixed varint-prefixed frames
10
+ * (unsigned varint per https://github.com/multiformats/unsigned-varint).
11
+ */
12
+ export declare const CELLO_PROTOCOL_ID = "/cello/m0/1.0.0";
13
+ /**
14
+ * Circuit Relay v2 HOP protocol identifier.
15
+ * Read from @libp2p/circuit-relay-v2 package (RELAY_V2_HOP_CODEC constant).
16
+ * Value: '/libp2p/circuit/relay/0.2.0/hop'
17
+ * Source: @libp2p/circuit-relay-v2 v4.2.3, src/constants.ts
18
+ */
19
+ export declare const CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID = "/libp2p/circuit/relay/0.2.0/hop";
20
+ /**
21
+ * CELLO content protocol identifier.
22
+ * Used for direct peer-to-peer content exchange after session establishment (SESSION-002).
23
+ * Stream framing: it-length-prefixed varint-prefixed frames.
24
+ */
25
+ export declare const CELLO_CONTENT_PROTOCOL_ID = "/cello/content/1.0.0";
26
+ //# sourceMappingURL=protocols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocols.d.ts","sourceRoot":"","sources":["../src/protocols.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAAyB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * CELLO Transport — protocols.ts
3
+ *
4
+ * Protocol ID constants for the CELLO transport layer.
5
+ */
6
+ /**
7
+ * CELLO M0 stream protocol identifier.
8
+ * Used for all CELLO envelope exchanges in the walking skeleton (M0) milestone.
9
+ * Stream framing: it-length-prefixed varint-prefixed frames
10
+ * (unsigned varint per https://github.com/multiformats/unsigned-varint).
11
+ */
12
+ export const CELLO_PROTOCOL_ID = "/cello/m0/1.0.0";
13
+ /**
14
+ * Circuit Relay v2 HOP protocol identifier.
15
+ * Read from @libp2p/circuit-relay-v2 package (RELAY_V2_HOP_CODEC constant).
16
+ * Value: '/libp2p/circuit/relay/0.2.0/hop'
17
+ * Source: @libp2p/circuit-relay-v2 v4.2.3, src/constants.ts
18
+ */
19
+ export const CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID = "/libp2p/circuit/relay/0.2.0/hop";
20
+ /**
21
+ * CELLO content protocol identifier.
22
+ * Used for direct peer-to-peer content exchange after session establishment (SESSION-002).
23
+ * Stream framing: it-length-prefixed varint-prefixed frames.
24
+ */
25
+ export const CELLO_CONTENT_PROTOCOL_ID = "/cello/content/1.0.0";
26
+ //# sourceMappingURL=protocols.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocols.js","sourceRoot":"","sources":["../src/protocols.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,iCAAiC,CAAC;AAElF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * CELLO Transport — types.ts
3
+ *
4
+ * Defines the CelloNode interface, CreateNodeOptions, StreamHandler, and structured
5
+ * error types for the @cello-protocol/transport package.
6
+ *
7
+ * ARCHITECTURE NOTE (ADR-0001):
8
+ * The KeyProvider is stored on CelloNode for use by higher layers (MSG-001 signing)
9
+ * but is NEVER passed into libp2p's Noise handshake or peer identity. libp2p generates
10
+ * its own internal Ed25519 keypair. This means:
11
+ * - node.getPeerId() returns the TRANSPORT peer ID (libp2p-managed)
12
+ * - KeyProvider.getPublicKey() returns K_local (CELLO signing identity)
13
+ * - These are always different keys serving different trust claims.
14
+ */
15
+ import type { KeyProvider } from "@cello-protocol/crypto";
16
+ import type { Stream } from "@libp2p/interface";
17
+ export interface CreateNodeOptions {
18
+ /**
19
+ * The CELLO KeyProvider holding K_local (Ed25519 signing key).
20
+ * Stored on the node for higher-layer use (MSG-001). NOT wired into libp2p
21
+ * transport identity — see ADR-0001.
22
+ */
23
+ keyProvider: KeyProvider;
24
+ /**
25
+ * libp2p listen multiaddrs. Use '/ip4/127.0.0.1/tcp/0' for ephemeral port.
26
+ */
27
+ listenAddresses: string[];
28
+ /**
29
+ * Optional pre-generated transport private key (raw Ed25519 seed, 32 bytes).
30
+ * When provided, the node uses this key for its libp2p Peer ID instead of
31
+ * generating a fresh one. Use this for services (directory, relay) that need
32
+ * a stable Peer ID across restarts.
33
+ */
34
+ transportPrivateKey?: Uint8Array;
35
+ }
36
+ /**
37
+ * Handler called when a remote peer opens a stream on a registered protocol.
38
+ * The Stream object has `source` (AsyncIterable) and `sink` (async iterable consumer).
39
+ * Use `it-length-prefixed` and `it-pipe` for framed I/O per the it-length-prefixed
40
+ * varint-prefix convention (unsigned varint per https://github.com/multiformats/unsigned-varint).
41
+ */
42
+ export type CelloStreamHandler = (stream: Stream) => void | Promise<void>;
43
+ export interface CelloNode {
44
+ /**
45
+ * Start the node: begin listening on configured addresses.
46
+ * After start(), the node is dialable by remote peers.
47
+ */
48
+ start(): Promise<void>;
49
+ /**
50
+ * Stop the node: close all streams and connections, release all resources.
51
+ * After stop(), listenAddresses() returns [] and all operations fail with node_stopped.
52
+ */
53
+ stop(): Promise<void>;
54
+ /**
55
+ * Returns current listen multiaddrs as strings.
56
+ * Returns [] before start() or after stop().
57
+ */
58
+ listenAddresses(): string[];
59
+ /**
60
+ * Connect to a remote peer by multiaddr string.
61
+ * Returns the remote peer's transport PeerId as a string.
62
+ * Fails with node_stopped if called after stop().
63
+ */
64
+ dial(multiaddr: string): Promise<{
65
+ peerId: string;
66
+ }>;
67
+ /**
68
+ * Register a stream handler for a protocol ID.
69
+ * The handler is called when a remote peer opens a stream on this protocol.
70
+ */
71
+ handle(protocolId: string, handler: CelloStreamHandler, opts?: {
72
+ maxInboundStreams?: number;
73
+ }): Promise<void>;
74
+ /**
75
+ * Open a new multiplexed stream to a connected remote peer.
76
+ * Returns the libp2p Stream object for use with it-length-prefixed framing.
77
+ *
78
+ * Structured errors (thrown as plain objects):
79
+ * { reason: 'protocol_not_supported', protocolId, message }
80
+ * { reason: 'connection_lost', peerId, message }
81
+ * { reason: 'node_stopped', message }
82
+ */
83
+ newStream(peerId: string, protocolId: string): Promise<Stream>;
84
+ /**
85
+ * Returns the node's own transport PeerId as a string.
86
+ * This is the libp2p-managed keypair identity, NOT derived from KeyProvider.
87
+ * See ADR-0001.
88
+ */
89
+ getPeerId(): string;
90
+ /**
91
+ * Returns the libp2p protocol strings advertised by this node.
92
+ * Used by tests to verify Noise is present and plaintext is absent (SI-001, SI-003).
93
+ */
94
+ getProtocols(): string[];
95
+ /**
96
+ * Returns basic info about all current connections.
97
+ * Used by SI-001 test to verify connection-level encryption is Noise.
98
+ * encryption is undefined when libp2p has not yet completed the security handshake.
99
+ */
100
+ getConnections(): Array<{
101
+ peerId: string;
102
+ encryption: string | undefined;
103
+ }>;
104
+ /**
105
+ * Subscribe to peer connect/disconnect events for observability logging.
106
+ * Callback fires whenever a new libp2p connection is established or closed.
107
+ */
108
+ onPeerConnect(handler: (peerId: string) => void): void;
109
+ onPeerDisconnect(handler: (peerId: string) => void): void;
110
+ /**
111
+ * Access the stored KeyProvider for higher-layer use (MSG-001 signing).
112
+ * The transport layer itself never calls any methods on this object.
113
+ */
114
+ readonly keyProvider: KeyProvider;
115
+ }
116
+ /**
117
+ * Thrown (as a thrown plain object, not an Error instance) when a remote peer
118
+ * does not support the requested protocol.
119
+ */
120
+ export interface ProtocolNotSupportedError {
121
+ reason: "protocol_not_supported";
122
+ protocolId: string;
123
+ message: string;
124
+ }
125
+ /**
126
+ * Thrown when the connection to the remote peer has been lost.
127
+ */
128
+ export interface ConnectionLostError {
129
+ reason: "connection_lost";
130
+ peerId: string;
131
+ message: string;
132
+ }
133
+ /**
134
+ * Thrown when the node has been stopped and operations are attempted.
135
+ */
136
+ export interface NodeStoppedError {
137
+ reason: "node_stopped";
138
+ message: string;
139
+ }
140
+ /**
141
+ * Thrown when the node fails to bind to a listen address.
142
+ */
143
+ export interface ListenFailedError {
144
+ reason: "listen_failed";
145
+ multiaddr: string;
146
+ message: string;
147
+ }
148
+ export type CelloTransportError = ProtocolNotSupportedError | ConnectionLostError | NodeStoppedError | ListenFailedError;
149
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OA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O,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IACvD,gBAAgB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IAE1D;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAID;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,wBAAwB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAC3B,yBAAyB,GACzB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * CELLO Transport — types.ts
3
+ *
4
+ * Defines the CelloNode interface, CreateNodeOptions, StreamHandler, and structured
5
+ * error types for the @cello-protocol/transport package.
6
+ *
7
+ * ARCHITECTURE NOTE (ADR-0001):
8
+ * The KeyProvider is stored on CelloNode for use by higher layers (MSG-001 signing)
9
+ * but is NEVER passed into libp2p's Noise handshake or peer identity. libp2p generates
10
+ * its own internal Ed25519 keypair. This means:
11
+ * - node.getPeerId() returns the TRANSPORT peer ID (libp2p-managed)
12
+ * - KeyProvider.getPublicKey() returns K_local (CELLO signing identity)
13
+ * - These are always different keys serving different trust claims.
14
+ */
15
+ export {};
16
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@cello-protocol/transport",
3
+ "version": "0.0.2",
4
+ "private": false,
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=24"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "types": "./dist/index.d.ts"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist/",
22
+ "package.json"
23
+ ],
24
+ "dependencies": {
25
+ "@libp2p/crypto": "^5.0.0",
26
+ "@libp2p/interface": "^3.0.0",
27
+ "@libp2p/peer-id": "^6.0.0",
28
+ "@multiformats/multiaddr": "^13.0.0",
29
+ "@chainsafe/libp2p-noise": "^17.0.0",
30
+ "@chainsafe/libp2p-yamux": "^8.0.1",
31
+ "@libp2p/circuit-relay-v2": "^4.2.3",
32
+ "@libp2p/dcutr": "^3.0.18",
33
+ "@libp2p/identify": "^4.1.3",
34
+ "@libp2p/tcp": "^11.0.18",
35
+ "@libp2p/websockets": "^10.1.11",
36
+ "it-length-prefixed": "^10.0.1",
37
+ "it-pipe": "^3.0.1",
38
+ "libp2p": "^3.2.3",
39
+ "uint8arrays": "^5.1.1",
40
+ "@cello-protocol/crypto": "0.0.2"
41
+ },
42
+ "devDependencies": {
43
+ "@claude-flow/testing": "3.0.0-alpha.6",
44
+ "@types/node": "^25.6.2"
45
+ },
46
+ "scripts": {
47
+ "typecheck": "tsc --build",
48
+ "test": "vitest run"
49
+ }
50
+ }