@cello-protocol/transport 0.0.4 → 0.0.5

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/node.js CHANGED
@@ -69,17 +69,141 @@ import { noise } from "@chainsafe/libp2p-noise";
69
69
  import { yamux } from "@chainsafe/libp2p-yamux";
70
70
  import { circuitRelayServer, circuitRelayTransport } from "@libp2p/circuit-relay-v2";
71
71
  import { dcutr } from "@libp2p/dcutr";
72
+ import { autoNAT } from "@libp2p/autonat";
72
73
  import { identify } from "@libp2p/identify";
73
74
  import { generateKeyPair, generateKeyPairFromSeed } from "@libp2p/crypto/keys";
74
75
  import { multiaddr } from "@multiformats/multiaddr";
75
76
  import { peerIdFromString } from "@libp2p/peer-id";
77
+ import { DEFAULT_DIALABILITY, } from "./autonat.js";
78
+ // ─── Dialability helpers (CELLO-M7-TRANSPORT-001) ─────────────────────────────
79
+ /**
80
+ * Decide whether a multiaddr string represents a publicly-dialable address.
81
+ *
82
+ * AutoNAT confirms externally-reachable addresses. We treat an address as
83
+ * publicly dialable when it is an IP transport address that is NOT loopback,
84
+ * NOT in a private/link-local range, and NOT a circuit-relay address. This is
85
+ * the same classification libp2p applies to surface externally-reachable
86
+ * addresses via getMultiaddrs() after AutoNAT verification.
87
+ */
88
+ function isPubliclyDialable(addr) {
89
+ if (addr.includes("/p2p-circuit"))
90
+ return false; // relay address, not direct
91
+ // Extract the IPv4/IPv6 host component.
92
+ const ip4 = addr.match(/\/ip4\/([0-9.]+)/);
93
+ const ip6 = addr.match(/\/ip6\/([0-9a-fA-F:]+)/);
94
+ if (ip4) {
95
+ const host = ip4[1];
96
+ if (host === "127.0.0.1" || host.startsWith("127."))
97
+ return false; // loopback
98
+ if (host.startsWith("10."))
99
+ return false; // private
100
+ if (host.startsWith("192.168."))
101
+ return false; // private
102
+ if (host.startsWith("169.254."))
103
+ return false; // link-local
104
+ // 172.16.0.0 – 172.31.255.255 private range
105
+ const m = host.match(/^172\.(\d+)\./);
106
+ if (m) {
107
+ const second = Number(m[1]);
108
+ if (second >= 16 && second <= 31)
109
+ return false;
110
+ }
111
+ if (host === "0.0.0.0")
112
+ return false; // unspecified
113
+ return true;
114
+ }
115
+ if (ip6) {
116
+ const host = ip6[1].toLowerCase();
117
+ if (host === "::1")
118
+ return false; // loopback
119
+ if (host.startsWith("fe80"))
120
+ return false; // link-local
121
+ if (host.startsWith("fc") || host.startsWith("fd"))
122
+ return false; // unique-local
123
+ if (host === "::")
124
+ return false; // unspecified
125
+ return true;
126
+ }
127
+ return false; // no IP transport component — not directly dialable
128
+ }
129
+ /** Extract the IPv4/IPv6 host component of a multiaddr string, or null. */
130
+ function extractHost(addr) {
131
+ const ip4 = addr.match(/\/ip4\/([0-9.]+)/);
132
+ if (ip4)
133
+ return ip4[1];
134
+ const ip6 = addr.match(/\/ip6\/([0-9a-fA-F:]+)/);
135
+ if (ip6)
136
+ return ip6[1].toLowerCase();
137
+ return null;
138
+ }
139
+ /**
140
+ * Derive dialability from the node's current self-reported multiaddrs.
141
+ *
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
144
+ * a public IP that is actually behind a firewall is NOT dialable — advertising
145
+ * that unreachable direct address would deny service. We therefore exclude any
146
+ * address whose host matches the node's own configured listen/announce hosts:
147
+ * those are configured, not dial-back-confirmed. Only an address that appeared
148
+ * dynamically (an AutoNAT-confirmed `observed` address — its host is not one we
149
+ * configured) counts toward dialable:true.
150
+ *
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.
155
+ */
156
+ function deriveDialability(addrs, configuredHosts) {
157
+ const publicAddr = addrs.find((a) => {
158
+ if (!isPubliclyDialable(a))
159
+ return false;
160
+ const host = extractHost(a);
161
+ // A public address on a host we explicitly configured is not proof of
162
+ // external reachability — exclude it (AutoNAT must confirm an observed addr).
163
+ return host !== null && !configuredHosts.has(host);
164
+ }) ?? null;
165
+ return { dialable: publicAddr !== null, publicAddr };
166
+ }
76
167
  // ─── CelloNodeImpl ───────────────────────────────────────────────────────────
77
168
  class CelloNodeImpl {
78
169
  #libp2p;
79
170
  keyProvider;
80
- constructor(libp2p, keyProvider) {
171
+ // CELLO-M7-TRANSPORT-001: dialability observable, updated on each AutoNAT
172
+ // probe cycle (surfaced by libp2p as a 'self:peer:update' event).
173
+ #dialability = { ...DEFAULT_DIALABILITY };
174
+ #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.
178
+ #configuredHosts;
179
+ constructor(libp2p, keyProvider, configuredHosts) {
81
180
  this.#libp2p = libp2p;
82
181
  this.keyProvider = keyProvider;
182
+ this.#configuredHosts = configuredHosts;
183
+ // Recompute dialability whenever libp2p updates its self-reported addresses.
184
+ // AutoNAT verification of an external address triggers a 'self:peer:update'.
185
+ this.#libp2p.addEventListener("self:peer:update", () => {
186
+ this.#recomputeDialability();
187
+ });
188
+ }
189
+ #recomputeDialability() {
190
+ const next = deriveDialability(this.listenAddresses(), this.#configuredHosts);
191
+ if (next.dialable === this.#dialability.dialable &&
192
+ next.publicAddr === this.#dialability.publicAddr) {
193
+ return; // no change — do not notify
194
+ }
195
+ this.#dialability = next;
196
+ for (const l of this.#dialabilityListeners)
197
+ l({ ...next });
198
+ }
199
+ getDialability() {
200
+ return { ...this.#dialability };
201
+ }
202
+ onDialabilityChange(listener) {
203
+ this.#dialabilityListeners.add(listener);
204
+ return () => {
205
+ this.#dialabilityListeners.delete(listener);
206
+ };
83
207
  }
84
208
  async start() {
85
209
  await this.#libp2p.start();
@@ -158,6 +282,16 @@ class CelloNodeImpl {
158
282
  encryption: c.encryption,
159
283
  }));
160
284
  }
285
+ hasDirectConnectionTo(peerIdStr) {
286
+ let peerId;
287
+ try {
288
+ peerId = peerIdFromString(peerIdStr);
289
+ }
290
+ catch {
291
+ return false;
292
+ }
293
+ return this.#libp2p.getConnections(peerId).some((c) => c.status === "open" && !c.remoteAddr.toString().includes("/p2p-circuit"));
294
+ }
161
295
  onPeerConnect(handler) {
162
296
  this.#libp2p.addEventListener("peer:connect", (evt) => {
163
297
  handler(evt.detail.toString());
@@ -222,9 +356,23 @@ function mapStreamError(err, peerId, protocolId) {
222
356
  * - Transports: TCP + WebSockets
223
357
  * - Security: Noise ONLY (XX pattern, RFC: https://noiseprotocol.org/noise.html)
224
358
  * - Muxer: Yamux
225
- * - Services: identify, circuitRelayServer (advertises HOP), DCuTR
359
+ * - Services: identify, circuitRelayServer (advertises HOP), AutoNAT, DCuTR
360
+ *
361
+ * CELLO-M7-TRANSPORT-001:
362
+ * - autoNAT() is added to ALL nodes. On client nodes (session / standing
363
+ * receiver) it probes connected directory nodes for dial-back to determine
364
+ * 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).
226
371
  */
227
372
  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";
228
376
  // ADR-0001: generate a fresh keypair for libp2p transport identity.
229
377
  // keyProvider is intentionally NOT touched here — see SI-002.
230
378
  const transportKey = opts.transportPrivateKey
@@ -248,15 +396,50 @@ export async function createNode(opts) {
248
396
  // Noise XX pattern per https://noiseprotocol.org/noise.html
249
397
  noise(),
250
398
  ],
399
+ // Cast: see the AutoNAT note below. yamux links uint8arraylist v2 while
400
+ // libp2p core links v3; adding the AutoNAT service to the service map shifts
401
+ // the inferred Components type so the muxer's Stream type no longer unifies.
402
+ // Runtime interop is unaffected (all libp2p v3.x). Build-time-only.
403
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
251
404
  streamMuxers: [yamux()],
252
405
  services: {
253
406
  identify: identify(),
254
407
  // circuitRelayServer advertises CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID
255
408
  relay: circuitRelayServer(),
256
- dcutr: dcutr(),
409
+ // AutoNAT (RFC: https://libp2p.io/docs/concepts/nat/autonat/). Client role
410
+ // probes connected directory nodes for dial-back; server role answers
411
+ // probes (directory nodes). Protocol /libp2p/autonat/1.0.0.
412
+ //
413
+ // Cast: @libp2p/autonat@3.0.x links @libp2p/interface@3.2.2 (uint8arraylist
414
+ // v2) while libp2p core links @libp2p/interface@3.2.4 (uint8arraylist v3).
415
+ // The two copies are structurally identical at runtime (same libp2p v3.x
416
+ // wire protocols) but TypeScript treats their Stream/Components types as
417
+ // distinct. The cast erases the version-specific AutoNATComponents param so
418
+ // the service-map inference does not surface this benign duplication. This
419
+ // is a build-time-only concern; runtime interop is unaffected.
420
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
421
+ autonat: autoNAT(),
422
+ ...(includeDcutr ? { dcutr: dcutr() } : {}),
257
423
  },
424
+ ...(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
427
+ // ping aborts the connection (abortConnectionOnPingFailure default true),
428
+ // firing peer:disconnect → counterparty_liveness drives to 'gone'.
429
+ ...(opts.keepAliveIntervalMs !== undefined
430
+ ? { connectionMonitor: { pingInterval: opts.keepAliveIntervalMs } }
431
+ : {}),
258
432
  });
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
+ }
259
442
  // Return node in STOPPED state — caller must call start()
260
- return new CelloNodeImpl(libp2p, opts.keyProvider);
443
+ return new CelloNodeImpl(libp2p, opts.keyProvider, configuredHosts);
261
444
  }
262
445
  //# 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,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AASnD,gFAAgF;AAEhF,MAAM,aAAa;IACR,OAAO,CAAS;IAChB,WAAW,CAAc;IAElC,YAAY,MAAc,EAAE,WAAwB;QAClD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC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AAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AACtE,CAAC"}
@@ -23,4 +23,18 @@ export declare const CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID = "/libp2p/circuit/relay/0
23
23
  * Stream framing: it-length-prefixed varint-prefixed frames.
24
24
  */
25
25
  export declare const CELLO_CONTENT_PROTOCOL_ID = "/cello/content/1.0.0";
26
+ /**
27
+ * AutoNAT protocol identifier (CELLO-M7-TRANSPORT-001).
28
+ * Read from @libp2p/autonat constants: `/${prefix}/${name}/${version}` =>
29
+ * `/libp2p/autonat/1.0.0`. Registered on every CELLO node — client role
30
+ * (session / standing receiver nodes probing directory nodes for dial-back) and
31
+ * server/responder role (directory nodes answering dial-back requests, AC-011).
32
+ *
33
+ * NOTE: AC-011 references `/libp2p/autonat/2.0.0` (AutoNAT v2). CELLO uses
34
+ * AutoNAT v1 (@libp2p/autonat) to stay version-aligned with the rest of the
35
+ * libp2p v3.0.x service stack (dcutr, identify, circuit-relay-v2). The responder
36
+ * semantics required by AC-011 are identical; only the wire protocol version
37
+ * string differs.
38
+ */
39
+ export declare const AUTONAT_PROTOCOL_ID = "/libp2p/autonat/1.0.0";
26
40
  //# sourceMappingURL=protocols.d.ts.map
@@ -1 +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"}
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;AAEhE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC"}
package/dist/protocols.js CHANGED
@@ -23,4 +23,18 @@ export const CIRCUIT_RELAY_V2_HOP_PROTOCOL_ID = "/libp2p/circuit/relay/0.2.0/hop
23
23
  * Stream framing: it-length-prefixed varint-prefixed frames.
24
24
  */
25
25
  export const CELLO_CONTENT_PROTOCOL_ID = "/cello/content/1.0.0";
26
+ /**
27
+ * AutoNAT protocol identifier (CELLO-M7-TRANSPORT-001).
28
+ * Read from @libp2p/autonat constants: `/${prefix}/${name}/${version}` =>
29
+ * `/libp2p/autonat/1.0.0`. Registered on every CELLO node — client role
30
+ * (session / standing receiver nodes probing directory nodes for dial-back) and
31
+ * server/responder role (directory nodes answering dial-back requests, AC-011).
32
+ *
33
+ * NOTE: AC-011 references `/libp2p/autonat/2.0.0` (AutoNAT v2). CELLO uses
34
+ * AutoNAT v1 (@libp2p/autonat) to stay version-aligned with the rest of the
35
+ * libp2p v3.0.x service stack (dcutr, identify, circuit-relay-v2). The responder
36
+ * semantics required by AC-011 are identical; only the wire protocol version
37
+ * string differs.
38
+ */
39
+ export const AUTONAT_PROTOCOL_ID = "/libp2p/autonat/1.0.0";
26
40
  //# sourceMappingURL=protocols.js.map
@@ -1 +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"}
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;AAEhE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,274 @@
1
+ /**
2
+ * CELLO SignalingManager — directory signaling stream lifecycle + step-6 auth + manifest polling.
3
+ *
4
+ * Owns:
5
+ * - Heartbeat keepalive (ping every N seconds, pong timeout N seconds)
6
+ * - Exponential backoff reconnect (1s → maxBackoffMs cap, max N attempts)
7
+ * - directory_signaling status observable: 'connected' | 'reconnecting' | 'lost'
8
+ * - Outbound operation queue during reconnect (bounded FIFO)
9
+ * - Step-6 directory challenge verification (MANIFEST-002, RFC 8032)
10
+ * - Background manifest polling
11
+ *
12
+ * Connection lifecycle pseudocode:
13
+ * 1. constructor(opts):
14
+ * a. Store config (heartbeat/backoff/queue params)
15
+ * b. Set status = 'reconnecting'
16
+ * c. Begin connection loop immediately (no pre-attempt state)
17
+ *
18
+ * 2. connectionLoop():
19
+ * a. Call connect() (injectable — full 7-step handshake in prod)
20
+ * b. On success: set status = 'connected', log directory.signaling.connected,
21
+ * drain outbound queue, then start heartbeat loop
22
+ * c. On failure: log directory.signaling.reconnecting with attempt/backoffMs,
23
+ * wait backoffMs, increment attempt. If attempt > max, transition to 'lost'.
24
+ *
25
+ * 3. heartbeatLoop():
26
+ * a. Every heartbeatIntervalMs, send { type: 'ping', ts: counter++ }
27
+ * b. Start pong timeout timer (heartbeatTimeoutMs)
28
+ * c. On pong received: reset timeout timer
29
+ * d. On timeout: declare stream dead, transition to 'reconnecting'
30
+ * e. On send error: declare stream dead immediately
31
+ *
32
+ * 4. submitMcpOperation():
33
+ * a. If 'connected': return { ok: true }
34
+ * b. If 'reconnecting': return { ok: false, reason: 'signaling_reconnecting', guidance }
35
+ * c. If 'lost': return { ok: false, reason: 'signaling_lost', guidance }
36
+ *
37
+ * 5. submitInternalOperation(execute):
38
+ * a. If 'connected': execute immediately, return result
39
+ * b. If 'reconnecting' + queue not full: queue, return pending promise
40
+ * c. If 'reconnecting' + queue full: return { ok: false, reason: 'signaling_queue_full' }
41
+ * d. If 'lost': return { ok: false, reason: 'signaling_lost', guidance }
42
+ *
43
+ * 6. drainQueue():
44
+ * a. For each queued op in FIFO order: call execute(), resolve/reject caller promise
45
+ * b. On execute() failure: reject that op, continue with next
46
+ *
47
+ * 7. flushQueue(reason):
48
+ * a. Reject all pending ops with the given error response
49
+ * b. Clear queue
50
+ *
51
+ * 8. stop():
52
+ * a. Set stopped = true
53
+ * b. Cancel backoff wait (if in progress)
54
+ * c. Cancel heartbeat timers
55
+ * d. Close current stream (if any)
56
+ * e. Flush queue with shutdown error
57
+ * f. Do NOT transition to 'lost'
58
+ *
59
+ * Step-6 directory challenge verification (RFC 8032):
60
+ * processStep5Frame() is called inside production connect() after auth_ok.
61
+ * TBS format (authoritative):
62
+ * UTF-8('cello-directory-auth-challenge-v1\n') +
63
+ * UTF-8(nodeId) + '\n' + UTF-8(agentPubkeyHex) + '\n' +
64
+ * UTF-8(nonceHex) + '\n' + UTF-8(isoTimestamp)
65
+ */
66
+ import type { ConsortiumManifest } from "@cello-protocol/protocol-types";
67
+ import type { IDirectoryChallengeVerifier, IManifestPollScheduler, IManifestVersionStore, IManifestProvider } from "./manifest-interfaces.js";
68
+ export type { ChallengeVerifyResult } from "./manifest-interfaces.js";
69
+ export interface Logger {
70
+ info(event: string, context: Record<string, unknown>): void;
71
+ warn(event: string, context: Record<string, unknown>): void;
72
+ error(event: string, context: Record<string, unknown>): void;
73
+ }
74
+ export type SignalingLogger = Logger;
75
+ export interface ISignalingOutboundQueue {
76
+ enqueue(frame: Record<string, unknown>): void;
77
+ }
78
+ export declare class InMemorySignalingOutboundQueue implements ISignalingOutboundQueue {
79
+ #private;
80
+ enqueue(frame: Record<string, unknown>): void;
81
+ getFrames(): ReadonlyArray<Record<string, unknown>>;
82
+ drain(): Array<Record<string, unknown>>;
83
+ }
84
+ /**
85
+ * Augmented signaling_auth_ok frame with step-5 directory identity proof.
86
+ * nodeId/signature/timestamp are optional — pre-MANIFEST-002 directories omit them.
87
+ */
88
+ export interface SignalingAuthOkFrame {
89
+ type: "signaling_auth_ok";
90
+ nodeId?: string;
91
+ signature?: string;
92
+ timestamp?: string;
93
+ }
94
+ export interface ManifestPollResponseFrame {
95
+ type: "manifest_poll_response";
96
+ manifest: ConsortiumManifest;
97
+ }
98
+ export interface SignalingStream {
99
+ send(frame: unknown): Promise<void>;
100
+ onMessage(handler: (frame: unknown) => void): void;
101
+ close(): void;
102
+ }
103
+ export interface ConnectResult {
104
+ stream: SignalingStream;
105
+ directoryNodeId: string;
106
+ manifestVersion: number;
107
+ }
108
+ export interface OperationSuccess {
109
+ ok: true;
110
+ }
111
+ export type SignalingFailureReason = "signaling_reconnecting" | "signaling_lost" | "signaling_queue_full" | "signaling_shutdown";
112
+ export interface OperationFailure {
113
+ ok: false;
114
+ reason: SignalingFailureReason;
115
+ guidance: string;
116
+ }
117
+ export type OperationResult = OperationSuccess | OperationFailure;
118
+ export type ProcessStep5Result = {
119
+ verified: true;
120
+ } | {
121
+ verified: false;
122
+ reason: string;
123
+ };
124
+ export interface SignalingManagerOptions {
125
+ connect?: () => Promise<ConnectResult>;
126
+ logger: Logger;
127
+ heartbeatIntervalMs?: number;
128
+ heartbeatTimeoutMs?: number;
129
+ maxReconnectAttempts?: number;
130
+ initialBackoffMs?: number;
131
+ maxBackoffMs?: number;
132
+ outboundQueueCap?: number;
133
+ challengeVerifier?: IDirectoryChallengeVerifier;
134
+ pollScheduler?: IManifestPollScheduler;
135
+ manifestVersionStore?: IManifestVersionStore;
136
+ manifestProvider?: IManifestProvider;
137
+ correlationId?: string;
138
+ rootKeys?: readonly string[];
139
+ threshold?: number;
140
+ }
141
+ export type SignalingManagerConfig = SignalingManagerOptions;
142
+ type SignalingStatus = "connected" | "reconnecting" | "lost";
143
+ export declare class SignalingManager {
144
+ #private;
145
+ private _status;
146
+ private _stopped;
147
+ private _currentStream;
148
+ private _currentDirectoryNodeId;
149
+ private _queue;
150
+ private _pingCounter;
151
+ private _heartbeatInterval;
152
+ private _heartbeatTimeout;
153
+ private _backoffTimeout;
154
+ private _backoffResolve;
155
+ private _draining;
156
+ private readonly _connect;
157
+ private readonly _logger;
158
+ private readonly _heartbeatIntervalMs;
159
+ private readonly _heartbeatTimeoutMs;
160
+ private readonly _maxReconnectAttempts;
161
+ private readonly _initialBackoffMs;
162
+ private readonly _maxBackoffMs;
163
+ private readonly _outboundQueueCap;
164
+ private readonly _challengeVerifier;
165
+ private _pendingNonce;
166
+ private _agentPubkeyHex;
167
+ private _inboundHandlers;
168
+ private readonly _pollScheduler;
169
+ private readonly _manifestVersionStore;
170
+ private readonly _manifestProvider;
171
+ private readonly _correlationId;
172
+ private readonly _rootKeys;
173
+ private readonly _threshold;
174
+ constructor(opts: SignalingManagerOptions);
175
+ get status(): SignalingStatus;
176
+ get queueDepth(): number;
177
+ /**
178
+ * M7-SESSION-001: Send a frame directly on the active signaling stream.
179
+ * Returns ok:true when connected and send succeeded.
180
+ * Returns ok:false with reason when not connected or send failed.
181
+ */
182
+ sendRaw(frame: unknown): Promise<OperationResult>;
183
+ /**
184
+ * M7-SESSION-001: Register a handler for inbound signaling frames.
185
+ * Called for every frame not consumed by the built-in heartbeat/manifest logic.
186
+ * Returns an unregister function.
187
+ */
188
+ registerInboundHandler(handler: (frame: Record<string, unknown>) => void): () => void;
189
+ /**
190
+ * Submit an MCP tool call operation.
191
+ * When connected: returns { ok: true }.
192
+ * When reconnecting/lost: returns immediately with rejection + guidance.
193
+ * NEVER queued.
194
+ */
195
+ submitMcpOperation(): Promise<OperationResult>;
196
+ /**
197
+ * Submit an internal protocol operation (FROST ceremony, manifest poll).
198
+ * When connected: executes immediately, returns result.
199
+ * When reconnecting: queues if capacity allows, returns pending promise.
200
+ * When lost: rejects immediately.
201
+ * When queue full: rejects immediately with signaling_queue_full.
202
+ */
203
+ submitInternalOperation<T>(execute: () => Promise<T>): Promise<T | OperationFailure>;
204
+ /**
205
+ * Graceful shutdown. Cancels reconnect loop, flushes queue with shutdown error.
206
+ * Does NOT transition to 'lost'.
207
+ */
208
+ stop(): Promise<void>;
209
+ /**
210
+ * Store the nonce and agent pubkey from handshake steps 2–3.
211
+ * Must be called before processStep5Frame().
212
+ */
213
+ setHandshakeContext(nonceHex: string, agentPubkeyHex: string): void;
214
+ /**
215
+ * Process a signaling_auth_ok frame (step 6 of the 7-step handshake).
216
+ * Called inside production connect() after receiving auth_ok.
217
+ *
218
+ * Pseudocode (RFC 8032 — Ed25519 verify):
219
+ * 1. If frame has no nodeId/signature/timestamp: log warn, return no_identity_proof.
220
+ * 2. Validate handshake context was set.
221
+ * 3. Build TBS bytes.
222
+ * 4. Call challengeVerifier.verifyChallenge(nodeId, tbsBytes, signature).
223
+ * 5. Log directory.auth.challenge.verified (INFO) or directory.auth.challenge.failed (ERROR).
224
+ */
225
+ processStep5Frame(frame: SignalingAuthOkFrame): ProcessStep5Result;
226
+ /**
227
+ * Handle a manifest_poll_response frame from the directory.
228
+ */
229
+ handleManifestPollResponse(manifest: ConsortiumManifest): Promise<void>;
230
+ /**
231
+ * Dispatch a manifest_poll_request frame over the LIVE signaling stream. Mints a fresh
232
+ * per-cycle correlation id so the dispatch and its eventual response are correlatable.
233
+ * A no-op send when not connected — the next interval still fires (see #schedulePoll),
234
+ * and a clean reconnect restarts polling via runConnectedPhase.
235
+ */
236
+ dispatchManifestPoll(): void;
237
+ /** Start background polling after step-6 authentication completes. */
238
+ startPolling(): void;
239
+ /** Cancel pending poll timer (called on disconnect). */
240
+ stopPolling(): void;
241
+ private reconnectLoop;
242
+ private runReconnectCycle;
243
+ private attemptConnect;
244
+ private runConnectedPhase;
245
+ private startHeartbeat;
246
+ private sendPing;
247
+ private handleMessage;
248
+ private cancelHeartbeat;
249
+ private _streamDeathResolve;
250
+ private _lastDisconnectReason;
251
+ private waitForStreamDeath;
252
+ private declareStreamDead;
253
+ private backoffWait;
254
+ private cancelBackoffWait;
255
+ private drainQueue;
256
+ private flushQueue;
257
+ }
258
+ /**
259
+ * Build the TBS (to-be-signed) bytes for step-5 directory identity verification.
260
+ *
261
+ * Authoritative format:
262
+ * UTF-8('cello-directory-auth-challenge-v1\n') +
263
+ * UTF-8(nodeId) + '\n' + UTF-8(agentPubkeyHex) + '\n' +
264
+ * UTF-8(nonceHex) + '\n' + UTF-8(isoTimestamp)
265
+ *
266
+ * Crypto reference: RFC 8032 (the signing input is these bytes verbatim).
267
+ */
268
+ export declare function buildStep5Tbs(opts: {
269
+ nodeId: string;
270
+ agentPubkeyHex: string;
271
+ nonceHex: string;
272
+ isoTimestamp: string;
273
+ }): Uint8Array;
274
+ //# sourceMappingURL=signaling-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signaling-manager.d.ts","sourceRoot":"","sources":["../src/signaling-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAOtE,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OA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