@cello-protocol/transport 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Exports the CelloNode factory, interface, protocol constants, and error types.
5
5
  */
6
- export { createNode } from "./node.js";
6
+ export { createNode, isValidMultiaddr, buildConfiguredHosts } from "./node.js";
7
7
  export type { CelloNode, CreateNodeOptions, CelloStreamHandler } from "./types.js";
8
8
  export type { CelloTransportError, ProtocolNotSupportedError, ConnectionLostError, NodeStoppedError, ListenFailedError, } from "./types.js";
9
9
  export { CELLO_PROTOCOL_ID, CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID, CELLO_CONTENT_PROTOCOL_ID, AUTONAT_PROTOCOL_ID } from "./protocols.js";
@@ -1 +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,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrI,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,eAAe,EACf,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAG9B,OAAO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c,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,eAAe,EACf,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,MAAM,IAAI,yBAAyB,EACnC,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Exports the CelloNode factory, interface, protocol constants, and error types.
5
5
  */
6
- export { createNode } from "./node.js";
6
+ export { createNode, isValidMultiaddr, buildConfiguredHosts } from "./node.js";
7
7
  export { CELLO_PROTOCOL_ID, CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID, CELLO_CONTENT_PROTOCOL_ID, AUTONAT_PROTOCOL_ID } from "./protocols.js";
8
8
  export { LocalAutoNatStub, DEFAULT_DIALABILITY } from "./autonat.js";
9
9
  // CELLO-M7-TRANSPORT-001: real IAutoNatService over a live CelloNode (emits the
package/dist/index.js.map CHANGED
@@ -1 +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,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrI,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACrE,gFAAgF;AAChF,kFAAkF;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO1D,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAgB1D,iDAAiD;AACjD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,8EAA8E;AAC9E,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,aAAa,GACd,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAS/E,OAAO,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrI,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACrE,gFAAgF;AAChF,kFAAkF;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO1D,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAgB1D,iDAAiD;AACjD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,8EAA8E;AAC9E,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,aAAa,GACd,MAAM,wBAAwB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * M7-MANIFEST-002 — Manifest-related interface definitions for the CELLO client daemon.
2
+ * Manifest-related interface definitions for the CELLO client daemon.
3
3
  *
4
4
  * These interfaces decouple the daemon and SignalingManager from their concrete
5
5
  * implementations. All interfaces are narrow by design.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * M7-MANIFEST-002 — Manifest-related interface definitions for the CELLO client daemon.
2
+ * Manifest-related interface definitions for the CELLO client daemon.
3
3
  *
4
4
  * These interfaces decouple the daemon and SignalingManager from their concrete
5
5
  * implementations. All interfaces are narrow by design.
package/dist/node.d.ts CHANGED
@@ -3,66 +3,41 @@
3
3
  *
4
4
  * createNode() and CelloNodeImpl: libp2p node bootstrap for the CELLO protocol.
5
5
  *
6
- * PSEUDOCODE (Phase P) — preserved as reference:
6
+ * createNode() returns the node in STOPPED state start() is a separate call.
7
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)
8
+ * Stream framing: it-length-prefixed (unsigned varint prefix per multiformats spec).
63
9
  * Use lp.encode(source) / lp.decode(source) with it-pipe for composing pipelines.
64
10
  */
65
11
  import type { CelloNode, CreateNodeOptions } from "./types.js";
12
+ /**
13
+ * The set of hosts a node was CONFIGURED to listen on / announce — excluded from
14
+ * dialability because configuration is not dial-back confirmation.
15
+ *
16
+ * DOD-NAT-REACHABILITY-1: do NOT expand a wildcard listen host (0.0.0.0 / ::) to
17
+ * the machine's interface addresses. It looks like the safe thing to do under the
18
+ * 0.0.0.0 default, and it is wrong: libp2p's address manager already handles this
19
+ * exactly right. A PUBLIC transport address starts `verified: false`
20
+ * (libp2p/dist/src/address-manager/transport-addresses.js — `verified:
21
+ * !isNetworkAddress(ma)`, with private addresses verified immediately), and
22
+ * getMultiaddrs() returns ONLY verified addresses. So a firewalled public-IP host
23
+ * never surfaces its public address at all, and there is nothing to suppress.
24
+ * Expanding the wildcard here would instead suppress that address in the one case
25
+ * where it is REAL — a genuinely reachable public host whose address AutoNAT has
26
+ * confirmed — pinning it to dialable:false forever and forcing it onto a relay it
27
+ * does not need. Exported for direct unit-testing.
28
+ */
29
+ export declare function buildConfiguredHosts(listenAddresses: string[], announceAddresses?: string[]): Set<string>;
30
+ /**
31
+ * Is this string a well-formed multiaddr?
32
+ *
33
+ * DOD-NAT-REACHABILITY-1: circuit-relay listen addresses are built from relay
34
+ * endpoints supplied by the DIRECTORY — data from off this machine. A malformed
35
+ * entry (a `wss://` URL, a bare peer id, anything not a multiaddr) throws inside
36
+ * libp2p's node construction, which would take the whole standing receiver down
37
+ * and leave the agent deaf to ALL inbound. Callers validate before listening, so
38
+ * a bad endpoint costs one relay, never the receiver.
39
+ */
40
+ export declare function isValidMultiaddr(addr: string): boolean;
66
41
  /**
67
42
  * Create a new CelloNode in stopped state.
68
43
  *
@@ -76,18 +51,21 @@ import type { CelloNode, CreateNodeOptions } from "./types.js";
76
51
  * - Transports: TCP + WebSockets
77
52
  * - Security: Noise ONLY (XX pattern, RFC: https://noiseprotocol.org/noise.html)
78
53
  * - Muxer: Yamux
79
- * - Services: identify, circuitRelayServer (advertises HOP), AutoNAT, DCuTR
54
+ * - Services: identify, circuitRelayServer (service nodes / opt-in), AutoNAT, DCuTR
80
55
  *
81
- * CELLO-M7-TRANSPORT-001:
56
+ * NAT traversal:
82
57
  * - autoNAT() is added to ALL nodes. On client nodes (session / standing
83
58
  * receiver) it probes connected directory nodes for dial-back to determine
84
59
  * dialability; on directory nodes it serves the responder role, answering
85
- * dial-back requests (AC-011). Protocol: /libp2p/autonat/1.0.0.
86
- * - dcutr() is included for session nodes (and the default/service nodes) so a
87
- * relay-fallback connection can be hole-punch upgraded to direct, but is
88
- * OMITTED for standing-receiver nodes (nodeType==='standing_receiver') a
89
- * standing receiver only needs to know its own dialability, not upgrade
90
- * existing connections (AC-002).
60
+ * dial-back requests. Protocol: /libp2p/autonat/1.0.0.
61
+ * - dcutr() is included on EVERY node type (DOD-NAT-REACHABILITY-1). The
62
+ * protocol's inbound peer is the one that STARTS the hole-punch upgrade
63
+ * (@libp2p/dcutr ignores connections with direction !== 'inbound'), and the
64
+ * inbound peer of a relayed connection is precisely the standing receiver.
65
+ * - circuitRelayServer (HOP) is a SERVICE-node capability: included when
66
+ * nodeType is undefined (directory, relay) or when opts.relayServer.enabled
67
+ * is set. Client nodes (session / standing_receiver) no longer advertise
68
+ * themselves as relays for strangers.
91
69
  */
92
70
  export declare function createNode(opts: CreateNodeOptions): Promise<CelloNode>;
93
71
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAgBH,OAAO,KAAK,EACV,SAAS,EAET,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAkTpB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CA0E5E"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,OAAO,KAAK,EACV,SAAS,EAET,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAiDpB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAOzG;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOtD;AA0TD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CA0F5E"}
package/dist/node.js CHANGED
@@ -3,66 +3,13 @@
3
3
  *
4
4
  * createNode() and CelloNodeImpl: libp2p node bootstrap for the CELLO protocol.
5
5
  *
6
- * PSEUDOCODE (Phase P) — preserved as reference:
6
+ * createNode() returns the node in STOPPED state start() is a separate call.
7
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)
8
+ * Stream framing: it-length-prefixed (unsigned varint prefix per multiformats spec).
63
9
  * Use lp.encode(source) / lp.decode(source) with it-pipe for composing pipelines.
64
10
  */
65
11
  import { createLibp2p } from "libp2p";
12
+ import { FaultTolerance } from "@libp2p/interface";
66
13
  import { tcp } from "@libp2p/tcp";
67
14
  import { webSockets } from "@libp2p/websockets";
68
15
  import { noise } from "@chainsafe/libp2p-noise";
@@ -75,7 +22,7 @@ import { generateKeyPair, generateKeyPairFromSeed } from "@libp2p/crypto/keys";
75
22
  import { multiaddr } from "@multiformats/multiaddr";
76
23
  import { peerIdFromString } from "@libp2p/peer-id";
77
24
  import { DEFAULT_DIALABILITY, } from "./autonat.js";
78
- // ─── Dialability helpers (CELLO-M7-TRANSPORT-001) ─────────────────────────────
25
+ // ─── Dialability helpers ──────────────────────────────────────────────────────
79
26
  /**
80
27
  * Decide whether a multiaddr string represents a publicly-dialable address.
81
28
  *
@@ -126,6 +73,51 @@ function isPubliclyDialable(addr) {
126
73
  }
127
74
  return false; // no IP transport component — not directly dialable
128
75
  }
76
+ /**
77
+ * The set of hosts a node was CONFIGURED to listen on / announce — excluded from
78
+ * dialability because configuration is not dial-back confirmation.
79
+ *
80
+ * DOD-NAT-REACHABILITY-1: do NOT expand a wildcard listen host (0.0.0.0 / ::) to
81
+ * the machine's interface addresses. It looks like the safe thing to do under the
82
+ * 0.0.0.0 default, and it is wrong: libp2p's address manager already handles this
83
+ * exactly right. A PUBLIC transport address starts `verified: false`
84
+ * (libp2p/dist/src/address-manager/transport-addresses.js — `verified:
85
+ * !isNetworkAddress(ma)`, with private addresses verified immediately), and
86
+ * getMultiaddrs() returns ONLY verified addresses. So a firewalled public-IP host
87
+ * never surfaces its public address at all, and there is nothing to suppress.
88
+ * Expanding the wildcard here would instead suppress that address in the one case
89
+ * where it is REAL — a genuinely reachable public host whose address AutoNAT has
90
+ * confirmed — pinning it to dialable:false forever and forcing it onto a relay it
91
+ * does not need. Exported for direct unit-testing.
92
+ */
93
+ export function buildConfiguredHosts(listenAddresses, announceAddresses) {
94
+ const configuredHosts = new Set();
95
+ for (const a of [...listenAddresses, ...(announceAddresses ?? [])]) {
96
+ const host = extractHost(a);
97
+ if (host !== null)
98
+ configuredHosts.add(host);
99
+ }
100
+ return configuredHosts;
101
+ }
102
+ /**
103
+ * Is this string a well-formed multiaddr?
104
+ *
105
+ * DOD-NAT-REACHABILITY-1: circuit-relay listen addresses are built from relay
106
+ * endpoints supplied by the DIRECTORY — data from off this machine. A malformed
107
+ * entry (a `wss://` URL, a bare peer id, anything not a multiaddr) throws inside
108
+ * libp2p's node construction, which would take the whole standing receiver down
109
+ * and leave the agent deaf to ALL inbound. Callers validate before listening, so
110
+ * a bad endpoint costs one relay, never the receiver.
111
+ */
112
+ export function isValidMultiaddr(addr) {
113
+ try {
114
+ multiaddr(addr);
115
+ return true;
116
+ }
117
+ catch {
118
+ return false;
119
+ }
120
+ }
129
121
  /** Extract the IPv4/IPv6 host component of a multiaddr string, or null. */
130
122
  function extractHost(addr) {
131
123
  const ip4 = addr.match(/\/ip4\/([0-9.]+)/);
@@ -139,8 +131,8 @@ function extractHost(addr) {
139
131
  /**
140
132
  * Derive dialability from the node's current self-reported multiaddrs.
141
133
  *
142
- * CELLO-M7-TRANSPORT-001 (review I5): dialability MUST reflect AutoNAT dial-back
143
- * confirmation, not mere configuration. A node configured to listen on / announce
134
+ * Dialability MUST reflect AutoNAT dial-back confirmation, not mere
135
+ * configuration. A node configured to listen on / announce
144
136
  * a public IP that is actually behind a firewall is NOT dialable — advertising
145
137
  * that unreachable direct address would deny service. We therefore exclude any
146
138
  * address whose host matches the node's own configured listen/announce hosts:
@@ -148,10 +140,12 @@ function extractHost(addr) {
148
140
  * dynamically (an AutoNAT-confirmed `observed` address — its host is not one we
149
141
  * configured) counts toward dialable:true.
150
142
  *
151
- * CELLO session and standing-receiver nodes listen on loopback
152
- * (/ip4/127.0.0.1/tcp/0), so in practice the only public address that can appear
153
- * in getMultiaddrs() is one AutoNAT confirmed this exclusion simply makes the
154
- * invariant explicit and robust for any future public-bound node.
143
+ * DOD-NAT-REACHABILITY-1: standing receivers now listen on 0.0.0.0 by default,
144
+ * which does NOT weaken this. libp2p only surfaces VERIFIED addresses through
145
+ * getMultiaddrs(), and a public transport address stays unverified until AutoNAT
146
+ * confirms it (see buildConfiguredHosts) so a firewalled public-IP host never
147
+ * offers one here at all, and a wildcard bind on a NAT'd machine yields only
148
+ * private interface addresses, which isPubliclyDialable already rejects.
155
149
  */
156
150
  function deriveDialability(addrs, configuredHosts) {
157
151
  const publicAddr = addrs.find((a) => {
@@ -168,18 +162,28 @@ function deriveDialability(addrs, configuredHosts) {
168
162
  class CelloNodeImpl {
169
163
  #libp2p;
170
164
  keyProvider;
171
- // CELLO-M7-TRANSPORT-001: dialability observable, updated on each AutoNAT
172
- // probe cycle (surfaced by libp2p as a 'self:peer:update' event).
165
+ // Dialability observable, updated on each AutoNAT probe cycle (surfaced by
166
+ // libp2p as a 'self:peer:update' event).
173
167
  #dialability = { ...DEFAULT_DIALABILITY };
174
168
  #dialabilityListeners = new Set();
175
- // CELLO-M7-TRANSPORT-001 (I5): hosts this node was explicitly configured to
176
- // listen on / announce. These are NOT dial-back-confirmed, so they are excluded
177
- // from dialability — only AutoNAT-confirmed observed addresses count.
169
+ // Hosts this node was explicitly configured to listen on / announce. These are
170
+ // NOT dial-back-confirmed, so they are excluded from dialability — only
171
+ // AutoNAT-confirmed observed addresses count.
178
172
  #configuredHosts;
179
- constructor(libp2p, keyProvider, configuredHosts) {
173
+ // DOD-NAT-REACHABILITY-1: whether a non-circuit (TCP/WS) listen address was
174
+ // configured. When circuit listen entries force NO_FATAL fault tolerance,
175
+ // start() re-checks that the non-circuit listeners actually materialised —
176
+ // NO_FATAL must not silently absorb a real EADDRINUSE.
177
+ #expectsDirectListener;
178
+ // Whether ANY circuit listen entry was configured (drives the circuit-only
179
+ // zero-listener refusal in start()).
180
+ #hasCircuitListen;
181
+ constructor(libp2p, keyProvider, configuredHosts, expectsDirectListener, hasCircuitListen) {
180
182
  this.#libp2p = libp2p;
181
183
  this.keyProvider = keyProvider;
182
184
  this.#configuredHosts = configuredHosts;
185
+ this.#expectsDirectListener = expectsDirectListener;
186
+ this.#hasCircuitListen = hasCircuitListen;
183
187
  // Recompute dialability whenever libp2p updates its self-reported addresses.
184
188
  // AutoNAT verification of an external address triggers a 'self:peer:update'.
185
189
  this.#libp2p.addEventListener("self:peer:update", () => {
@@ -207,6 +211,27 @@ class CelloNodeImpl {
207
211
  }
208
212
  async start() {
209
213
  await this.#libp2p.start();
214
+ // Restore the invariant NO_FATAL relaxed: if a direct (non-circuit) listen
215
+ // address was configured, at least one direct listener must exist. A failed
216
+ // circuit reservation is a tolerated degradation; a failed TCP bind is not.
217
+ if (this.#expectsDirectListener &&
218
+ !this.#libp2p.getMultiaddrs().some((ma) => !ma.toString().includes("/p2p-circuit"))) {
219
+ await this.#libp2p.stop();
220
+ throw {
221
+ reason: "listen_failed",
222
+ message: "no direct (non-circuit) listener materialised for the configured listen addresses",
223
+ };
224
+ }
225
+ // Circuit-ONLY listen set (no direct addr configured): NO_FATAL applies and
226
+ // the direct-listener check above is vacuous, so a dead relay would yield a
227
+ // running node with ZERO listeners — indistinguishable from healthy. Refuse.
228
+ if (!this.#expectsDirectListener && this.#hasCircuitListen && this.#libp2p.getMultiaddrs().length === 0) {
229
+ await this.#libp2p.stop();
230
+ throw {
231
+ reason: "listen_failed",
232
+ message: "no listener of any kind materialised for a circuit-only listen set (every relay unreachable)",
233
+ };
234
+ }
210
235
  }
211
236
  async stop() {
212
237
  await this.#libp2p.stop();
@@ -233,7 +258,12 @@ class CelloNodeImpl {
233
258
  async handle(protocolId, handler, opts) {
234
259
  // libp2p v3 StreamHandler receives (stream, connection); we only need stream
235
260
  const streamHandler = (stream) => handler(stream);
236
- await this.#libp2p.handle(protocolId, streamHandler, opts);
261
+ // DOD-NAT-REACHABILITY-1: every CELLO protocol must run over a LIMITED relayed
262
+ // connection — a punch-failed session lives on one, and refusing the stream
263
+ // there silently converts "NAT'd but online" into "unreachable" (the mailbox
264
+ // then masks it). There is no CELLO protocol that should refuse a relayed
265
+ // connection, so this is unconditional rather than a per-handler option.
266
+ await this.#libp2p.handle(protocolId, streamHandler, { ...opts, runOnLimitedConnection: true });
237
267
  }
238
268
  async newStream(peerIdStr, protocolId) {
239
269
  if (this.#libp2p.status === "stopped") {
@@ -261,7 +291,9 @@ class CelloNodeImpl {
261
291
  };
262
292
  }
263
293
  try {
264
- const stream = await openConn.newStream(protocolId);
294
+ // runOnLimitedConnection: see handle() — the relayed-fallback session must
295
+ // be able to open CELLO streams in both directions.
296
+ const stream = await openConn.newStream(protocolId, { runOnLimitedConnection: true });
265
297
  return stream;
266
298
  }
267
299
  catch (err) {
@@ -324,6 +356,12 @@ function mapStreamError(err, peerId, protocolId) {
324
356
  return { reason: "protocol_not_supported", protocolId, message: err.message };
325
357
  }
326
358
  const msg = err instanceof Error ? err.message : String(err);
359
+ // A limited-connection refusal is a POLICY refusal, not a network failure —
360
+ // do not collapse it into connection_lost. CELLO's own paths always set
361
+ // runOnLimitedConnection, so seeing this means a protocol/handler missed it.
362
+ if ((err instanceof Error && err.name === "LimitedConnectionError") || msg.includes("limited connection")) {
363
+ return { reason: "limited_connection_refused", protocolId, message: msg };
364
+ }
327
365
  // Protocol negotiation failure — match specific phrases, not generic "stream"
328
366
  if (msg.includes("unsupported protocol") ||
329
367
  msg.includes("not supported") ||
@@ -356,28 +394,40 @@ function mapStreamError(err, peerId, protocolId) {
356
394
  * - Transports: TCP + WebSockets
357
395
  * - Security: Noise ONLY (XX pattern, RFC: https://noiseprotocol.org/noise.html)
358
396
  * - Muxer: Yamux
359
- * - Services: identify, circuitRelayServer (advertises HOP), AutoNAT, DCuTR
397
+ * - Services: identify, circuitRelayServer (service nodes / opt-in), AutoNAT, DCuTR
360
398
  *
361
- * CELLO-M7-TRANSPORT-001:
399
+ * NAT traversal:
362
400
  * - autoNAT() is added to ALL nodes. On client nodes (session / standing
363
401
  * receiver) it probes connected directory nodes for dial-back to determine
364
402
  * dialability; on directory nodes it serves the responder role, answering
365
- * dial-back requests (AC-011). Protocol: /libp2p/autonat/1.0.0.
366
- * - dcutr() is included for session nodes (and the default/service nodes) so a
367
- * relay-fallback connection can be hole-punch upgraded to direct, but is
368
- * OMITTED for standing-receiver nodes (nodeType==='standing_receiver') a
369
- * standing receiver only needs to know its own dialability, not upgrade
370
- * existing connections (AC-002).
403
+ * dial-back requests. Protocol: /libp2p/autonat/1.0.0.
404
+ * - dcutr() is included on EVERY node type (DOD-NAT-REACHABILITY-1). The
405
+ * protocol's inbound peer is the one that STARTS the hole-punch upgrade
406
+ * (@libp2p/dcutr ignores connections with direction !== 'inbound'), and the
407
+ * inbound peer of a relayed connection is precisely the standing receiver.
408
+ * - circuitRelayServer (HOP) is a SERVICE-node capability: included when
409
+ * nodeType is undefined (directory, relay) or when opts.relayServer.enabled
410
+ * is set. Client nodes (session / standing_receiver) no longer advertise
411
+ * themselves as relays for strangers.
371
412
  */
372
413
  export async function createNode(opts) {
373
- // dcutr is for dialers upgrading relay-fallback connections. A standing
374
- // receiver is a receiver, not a dialer — omit dcutr there (AC-002).
375
- const includeDcutr = opts.nodeType !== "standing_receiver";
414
+ // HOP relay: service nodes keep it (deployed-relay compatibility); client node
415
+ // types must opt in explicitly via relayServer.
416
+ const includeRelayServer = opts.relayServer?.enabled ?? opts.nodeType === undefined;
417
+ const reservations = opts.relayServer?.reservations;
376
418
  // ADR-0001: generate a fresh keypair for libp2p transport identity.
377
419
  // keyProvider is intentionally NOT touched here — see SI-002.
378
420
  const transportKey = opts.transportPrivateKey
379
421
  ? await generateKeyPairFromSeed("Ed25519", opts.transportPrivateKey)
380
422
  : await generateKeyPair("Ed25519");
423
+ // DOD-NAT-REACHABILITY-1: a circuit-relay listen entry fails at start() when its
424
+ // relay is unreachable, and libp2p's default fault tolerance makes ANY listener
425
+ // failure fatal. One dead relay must never kill the node (sovereign-redundancy:
426
+ // reservations are taken with several relays precisely so one can die), so relax
427
+ // to NO_FATAL when circuit addrs are present. CelloNodeImpl.start() restores the
428
+ // invariant that matters: the non-circuit (TCP) listeners must have materialised,
429
+ // else start() throws loudly — NO_FATAL must not mask a real EADDRINUSE.
430
+ const hasCircuitListen = opts.listenAddresses.some((a) => a.includes("/p2p-circuit"));
381
431
  const libp2p = await createLibp2p({
382
432
  start: false,
383
433
  privateKey: transportKey,
@@ -385,6 +435,7 @@ export async function createNode(opts) {
385
435
  listen: opts.listenAddresses,
386
436
  ...(opts.announceAddresses?.length ? { announce: opts.announceAddresses } : {}),
387
437
  },
438
+ ...(hasCircuitListen ? { transportManager: { faultTolerance: FaultTolerance.NO_FATAL } } : {}),
388
439
  transports: [
389
440
  tcp(),
390
441
  webSockets(),
@@ -404,8 +455,12 @@ export async function createNode(opts) {
404
455
  streamMuxers: [yamux()],
405
456
  services: {
406
457
  identify: identify(),
407
- // circuitRelayServer advertises CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID
408
- relay: circuitRelayServer(),
458
+ // circuitRelayServer advertises CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID — service
459
+ // nodes only (see header). The relay passes `reservations` to raise
460
+ // maxReservations / drop the default 2-min/128-KiB connection limits.
461
+ ...(includeRelayServer
462
+ ? { relay: circuitRelayServer(reservations ? { reservations } : {}) }
463
+ : {}),
409
464
  // AutoNAT (RFC: https://libp2p.io/docs/concepts/nat/autonat/). Client role
410
465
  // probes connected directory nodes for dial-back; server role answers
411
466
  // probes (directory nodes). Protocol /libp2p/autonat/1.0.0.
@@ -419,27 +474,26 @@ export async function createNode(opts) {
419
474
  // is a build-time-only concern; runtime interop is unaffected.
420
475
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
421
476
  autonat: autoNAT(),
422
- ...(includeDcutr ? { dcutr: dcutr() } : {}),
477
+ // DOD-NAT-REACHABILITY-1: dcutr on every node — the standing receiver is
478
+ // the inbound side of a relayed connection, and the inbound side starts
479
+ // the upgrade. See the header note.
480
+ dcutr: dcutr(),
423
481
  },
424
482
  ...(opts.connectionGater ? { connectionGater: opts.connectionGater } : {}),
425
- // M7-SESSION-003 AC-005: configure the keepalive ping interval so a peer that
426
- // vanished without a clean close is detected within a bounded window. A failed
483
+ // Keepalive ping interval, so a peer that vanished without a clean close is
484
+ // detected within a bounded window. A failed
427
485
  // ping aborts the connection (abortConnectionOnPingFailure default true),
428
486
  // firing peer:disconnect → counterparty_liveness drives to 'gone'.
429
487
  ...(opts.keepAliveIntervalMs !== undefined
430
488
  ? { connectionMonitor: { pingInterval: opts.keepAliveIntervalMs } }
431
489
  : {}),
432
490
  });
433
- // CELLO-M7-TRANSPORT-001 (I5): record the hosts this node was configured to
434
- // listen on / announce. deriveDialability excludes these so dialability reflects
435
- // AutoNAT dial-back confirmation, not configuration.
436
- const configuredHosts = new Set();
437
- for (const a of [...opts.listenAddresses, ...(opts.announceAddresses ?? [])]) {
438
- const host = extractHost(a);
439
- if (host !== null)
440
- configuredHosts.add(host);
441
- }
491
+ // Record the hosts this node was configured to listen on / announce.
492
+ // deriveDialability excludes these so dialability reflects AutoNAT dial-back
493
+ // confirmation, not configuration.
494
+ const configuredHosts = buildConfiguredHosts(opts.listenAddresses, opts.announceAddresses);
442
495
  // Return node in STOPPED state — caller must call start()
443
- return new CelloNodeImpl(libp2p, opts.keyProvider, configuredHosts);
496
+ const expectsDirectListener = hasCircuitListen && opts.listenAddresses.some((a) => !a.includes("/p2p-circuit"));
497
+ return new CelloNodeImpl(libp2p, opts.keyProvider, configuredHosts, expectsDirectListener, hasCircuitListen);
444
498
  }
445
499
  //# sourceMappingURL=node.js.map
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EA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AC3E,yEAAyE;YACzE,yEAAyE;YACzE,4EAA4E;YAC5E,2EAA2E;YAC3E,+DAA+D;YAC/D,8DAA8D;YAC9D,OAAO,EAAE,OAAO,EAAS;YACzB,yEAAyE;YACzE,wEAAwE;YACxE,oCAAoC;YACpC,KAAK,EAAE,KAAK,EAAE;SACf;QACD,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,4EAA4E;QAC5E,6CAA6C;QAC7C,0EAA0E;QAC1E,mEAAmE;QACnE,GAAG,CAAC,IAAI,CAAC,mBAAmB,KAAK,SAAS;YACxC,CAAC,CAAC,EAAE,iBAAiB,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,mBAAmB,EAAE,EAAE;YACnE,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;IAEH,qEAAqE;IACrE,6EAA6E;IAC7E,mCAAmC;IACnC,MAAM,eAAe,GAAG,oBAAoB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAE3F,0DAA0D;IAC1D,MAAM,qBAAqB,GACzB,gBAAgB,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IACpF,OAAO,IAAI,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,eAAe,EAAE,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;AAC/G,CAAC"}
package/dist/types.d.ts CHANGED
@@ -48,18 +48,37 @@ export interface CreateNodeOptions {
48
48
  */
49
49
  connectionGater?: ConnectionGater;
50
50
  /**
51
- * CELLO-M7-TRANSPORT-001: the role of this node, which tunes the libp2p service
52
- * set:
53
- * - 'session' — ephemeral per-session dialer; includes dcutr so a
54
- * relay-fallback connection can be hole-punch upgraded.
55
- * - 'standing_receiver' pre-warmed inbound receiver; OMITS dcutr (it only
56
- * needs to know its own dialability, not upgrade
57
- * existing connections).
58
- * - undefined — service/default node (directory, relay, client):
59
- * dcutr included for backward compatibility.
60
- * AutoNAT is included for every nodeType.
51
+ * CELLO-M7-TRANSPORT-001 / DOD-NAT-REACHABILITY-1: the role of this node,
52
+ * which tunes the libp2p service set:
53
+ * - 'session' — ephemeral per-session dialer.
54
+ * - 'standing_receiver' pre-warmed inbound receiver.
55
+ * - undefined service node (directory, relay): additionally
56
+ * serves circuit-relay HOP (see relayServer).
57
+ * AutoNAT and dcutr are included for EVERY nodeType. dcutr on the standing
58
+ * receiver is load-bearing: the inbound peer of a relayed connection is the
59
+ * one that initiates the hole-punch upgrade.
61
60
  */
62
61
  nodeType?: "session" | "standing_receiver";
62
+ /**
63
+ * DOD-NAT-REACHABILITY-1: circuit-relay HOP server configuration.
64
+ * By default HOP is served only by service nodes (nodeType === undefined) —
65
+ * a client node must not advertise itself as a relay for strangers.
66
+ * The CELLO relay passes `reservations` to raise the libp2p defaults, which
67
+ * are sized for a public DHT (15 reservations, 2-minute/128-KiB connection
68
+ * limits) and would cap CELLO's inbound reachability at toy scale.
69
+ */
70
+ relayServer?: {
71
+ /** Force the HOP service on (true) or off (false) regardless of nodeType. */
72
+ enabled: boolean;
73
+ /** Passed through to circuitRelayServer({ reservations }). */
74
+ reservations?: {
75
+ maxReservations?: number;
76
+ applyDefaultLimit?: boolean;
77
+ reservationTtl?: number;
78
+ defaultDurationLimit?: number;
79
+ defaultDataLimit?: bigint;
80
+ };
81
+ };
63
82
  /**
64
83
  * CELLO-M7-SESSION-003 (AC-005): transport keepalive interval in milliseconds.
65
84
  * Wires libp2p's connectionMonitor pingInterval so that a counterparty that
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,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;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC;;;;OAIG;IACH,cAAc,IAAI,WAAW,CAAC;IAE9B;;;OAGG;IACH,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,GAAG,WAAW,CAAC;CACtE;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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/transport",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -39,8 +39,8 @@
39
39
  "it-pipe": "^3.0.1",
40
40
  "libp2p": "^3.2.3",
41
41
  "uint8arrays": "^5.1.1",
42
- "@cello-protocol/protocol-types": "0.0.21",
43
- "@cello-protocol/crypto": "0.0.20"
42
+ "@cello-protocol/crypto": "0.0.21",
43
+ "@cello-protocol/protocol-types": "0.0.22"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@claude-flow/testing": "3.0.0-alpha.6",