@cello-protocol/protocol-types 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.
@@ -0,0 +1,132 @@
1
+ /**
2
+ * CELLO-M7-MSG-001 — Content-delivery wire types.
3
+ *
4
+ * Three families of frames:
5
+ *
6
+ * 1. Delivery ACK (D-c) — on the Noise-authenticated SESSION channel.
7
+ * Unsigned, transport-authenticated. Levels form an OPEN ladder
8
+ * (received → persisted → future). The protocol acts on 'persisted' ONLY.
9
+ *
10
+ * 2. Content recovery reverse-channel — on the SESSION channel.
11
+ * The receiver asks the sender to resend the content behind a known
12
+ * content_hash (the persisted-ACK channel running in reverse).
13
+ *
14
+ * 3. Park / store-and-forward — on the RELAY channel. The relay holds only
15
+ * ciphertext (SI-001); every datum gets its own named slot (API parsimony).
16
+ *
17
+ * The application content size cap is the existing MAX_CONTENT_BYTES (1 MB),
18
+ * re-exported from ./envelope.js — a single named constant used at both the send
19
+ * and inbound-decode enforcement points (AC-018). It is strictly below the
20
+ * it-length-prefixed transport default below so the app cap always fires first.
21
+ */
22
+ /**
23
+ * The default maximum frame size of it-length-prefixed (`it-length-prefixed`)
24
+ * decoding used by the transport content stream. The application content cap
25
+ * (MAX_CONTENT_BYTES) must stay strictly below this so oversize content is
26
+ * rejected with a clear error before the bare transport decode can fire (SI-003).
27
+ */
28
+ export declare const IT_LENGTH_PREFIX_DEFAULT_MAX: number;
29
+ /** libp2p protocol id for the relay store-and-forward content-park queue. */
30
+ export declare const CONTENT_PARK_PROTOCOL_ID = "/cello/content-park/1.0.0";
31
+ /**
32
+ * Domain separator for the content-park pull/confirm auth signature (I1). The caller
33
+ * signs SHA-256(utf8(CONTENT_PARK_AUTH_DOMAIN) || nonce(32) || recipient_pubkey(32))
34
+ * with its Ed25519 identity key to prove ownership before the relay serves/deletes.
35
+ */
36
+ export declare const CONTENT_PARK_AUTH_DOMAIN = "CELLO-CONTENT-PARK-AUTH-v1";
37
+ /**
38
+ * Canonical content-park auth message: SHA-256( utf8(CONTENT_PARK_AUTH_DOMAIN) ||
39
+ * nonce(32) || recipient_pubkey(32) ). Single source of truth for BOTH the client
40
+ * (signs this with its identity key on pull/confirm) and the relay (verifies it). If
41
+ * this construction ever drifts between the two repos, pull/confirm auth silently
42
+ * breaks — so both sides import this one function (M1: no per-repo redeclaration).
43
+ */
44
+ export declare function buildContentParkAuthMsg(nonce: Uint8Array, recipientPubkey: Uint8Array): Uint8Array;
45
+ /**
46
+ * Delivery-ACK ladder level. OPEN enum: 'received' and 'persisted' are defined
47
+ * today; future levels can be added without a wire break. The protocol acts on
48
+ * 'persisted' ONLY (AC-002). The string-template member keeps the union open.
49
+ */
50
+ export type ContentAckLevel = "received" | "persisted" | (string & {});
51
+ /**
52
+ * Unsigned delivery ACK emitted by the receiver AFTER it durably persists the
53
+ * content AND its content_hash cross-check succeeds. Carries NO signature —
54
+ * authentication is the Noise session channel (D-c, SI-004). Never an input to
55
+ * the seal, the Merkle tree, or last_seen_seq.
56
+ */
57
+ export interface ContentDeliveryAck {
58
+ type: "content_delivery_ack";
59
+ /** Session identifier (raw bytes as carried on the session channel). */
60
+ session_id: Uint8Array;
61
+ /** SHA-256 content hash this ACK acknowledges (32 bytes). */
62
+ content_hash: Uint8Array;
63
+ /** Ladder level; the sender acts on 'persisted' only. */
64
+ level: ContentAckLevel;
65
+ }
66
+ /**
67
+ * Receiver → sender resend request over the session channel. The receiver drained
68
+ * a hash leaf but never got the matching content; it asks the sender to resend
69
+ * the content behind content_hash. Recovery, not desync (AC-009).
70
+ */
71
+ export interface ContentResendRequest {
72
+ type: "content_resend_request";
73
+ session_id: Uint8Array;
74
+ content_hash: Uint8Array;
75
+ }
76
+ /**
77
+ * Sender → relay: deposit ENCRYPTED content into the recipient-keyed
78
+ * store-and-forward queue. The relay holds only ciphertext (SI-001).
79
+ */
80
+ export interface ContentParkDeposit {
81
+ type: "content_park_deposit";
82
+ /** Recipient's stable identity pubkey — the store key (32 bytes). */
83
+ recipient_pubkey: Uint8Array;
84
+ /** SHA-256 hash of the PLAINTEXT content (the relay already sees the hash layer). */
85
+ content_hash: Uint8Array;
86
+ /** Session this content belongs to (so the recipient can route it on pull). */
87
+ session_id: Uint8Array;
88
+ /** The sealed (E2E-encrypted) content blob. Its own named slot — never buried. */
89
+ ciphertext: Uint8Array;
90
+ }
91
+ /** Relay → sender: deposit confirmation / failure. */
92
+ export interface ContentParkDepositAck {
93
+ type: "content_park_deposit_ack";
94
+ content_hash: Uint8Array;
95
+ ok: boolean;
96
+ /** Present only when ok === false. */
97
+ reason?: string;
98
+ }
99
+ /**
100
+ * Relay → recipient: a notification that parked content is available. Fires when
101
+ * an online (or newly-reconnected) recipient has entries in its queue.
102
+ */
103
+ export interface ContentParkNotify {
104
+ type: "content_park_notify";
105
+ recipient_pubkey: Uint8Array;
106
+ content_hash: Uint8Array;
107
+ }
108
+ /**
109
+ * Recipient → relay: pull request. When content_hash is omitted the relay returns
110
+ * all parked entries for the recipient; when present it returns that one entry.
111
+ */
112
+ export interface ContentParkPullRequest {
113
+ type: "content_park_pull_request";
114
+ recipient_pubkey: Uint8Array;
115
+ content_hash?: Uint8Array;
116
+ }
117
+ /**
118
+ * Relay → recipient: a single parked entry (ciphertext). `found` is false when no
119
+ * matching entry exists (recovery falls back to "never parked"). delete-on-pickup
120
+ * happens after the recipient confirms a successful cross-check.
121
+ */
122
+ export interface ContentParkPullResponse {
123
+ type: "content_park_pull_response";
124
+ found: boolean;
125
+ content_hash: Uint8Array;
126
+ session_id?: Uint8Array;
127
+ ciphertext?: Uint8Array;
128
+ }
129
+ export declare function isContentDeliveryAck(frame: unknown): frame is ContentDeliveryAck;
130
+ export declare function isContentResendRequest(frame: unknown): frame is ContentResendRequest;
131
+ export declare function isContentParkDeposit(frame: unknown): frame is ContentParkDeposit;
132
+ //# sourceMappingURL=content-delivery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-delivery.d.ts","sourceRoot":"","sources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EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,YAAY,EAAE,UAAU,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,2BAA2B,CAAC;IAClC,gBAAgB,EAAE,UAAU,CAAC;IAC7B,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,4BAA4B,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,UAAU,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAQD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAShF;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAQpF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAShF"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * CELLO-M7-MSG-001 — Content-delivery wire types.
3
+ *
4
+ * Three families of frames:
5
+ *
6
+ * 1. Delivery ACK (D-c) — on the Noise-authenticated SESSION channel.
7
+ * Unsigned, transport-authenticated. Levels form an OPEN ladder
8
+ * (received → persisted → future). The protocol acts on 'persisted' ONLY.
9
+ *
10
+ * 2. Content recovery reverse-channel — on the SESSION channel.
11
+ * The receiver asks the sender to resend the content behind a known
12
+ * content_hash (the persisted-ACK channel running in reverse).
13
+ *
14
+ * 3. Park / store-and-forward — on the RELAY channel. The relay holds only
15
+ * ciphertext (SI-001); every datum gets its own named slot (API parsimony).
16
+ *
17
+ * The application content size cap is the existing MAX_CONTENT_BYTES (1 MB),
18
+ * re-exported from ./envelope.js — a single named constant used at both the send
19
+ * and inbound-decode enforcement points (AC-018). It is strictly below the
20
+ * it-length-prefixed transport default below so the app cap always fires first.
21
+ */
22
+ import { createHash } from "node:crypto";
23
+ /**
24
+ * The default maximum frame size of it-length-prefixed (`it-length-prefixed`)
25
+ * decoding used by the transport content stream. The application content cap
26
+ * (MAX_CONTENT_BYTES) must stay strictly below this so oversize content is
27
+ * rejected with a clear error before the bare transport decode can fire (SI-003).
28
+ */
29
+ export const IT_LENGTH_PREFIX_DEFAULT_MAX = 4 * 1024 * 1024;
30
+ /** libp2p protocol id for the relay store-and-forward content-park queue. */
31
+ export const CONTENT_PARK_PROTOCOL_ID = "/cello/content-park/1.0.0";
32
+ /**
33
+ * Domain separator for the content-park pull/confirm auth signature (I1). The caller
34
+ * signs SHA-256(utf8(CONTENT_PARK_AUTH_DOMAIN) || nonce(32) || recipient_pubkey(32))
35
+ * with its Ed25519 identity key to prove ownership before the relay serves/deletes.
36
+ */
37
+ export const CONTENT_PARK_AUTH_DOMAIN = "CELLO-CONTENT-PARK-AUTH-v1";
38
+ /**
39
+ * Canonical content-park auth message: SHA-256( utf8(CONTENT_PARK_AUTH_DOMAIN) ||
40
+ * nonce(32) || recipient_pubkey(32) ). Single source of truth for BOTH the client
41
+ * (signs this with its identity key on pull/confirm) and the relay (verifies it). If
42
+ * this construction ever drifts between the two repos, pull/confirm auth silently
43
+ * breaks — so both sides import this one function (M1: no per-repo redeclaration).
44
+ */
45
+ export function buildContentParkAuthMsg(nonce, recipientPubkey) {
46
+ const domain = new TextEncoder().encode(CONTENT_PARK_AUTH_DOMAIN);
47
+ const msg = new Uint8Array(domain.length + nonce.length + recipientPubkey.length);
48
+ msg.set(domain, 0);
49
+ msg.set(nonce, domain.length);
50
+ msg.set(recipientPubkey, domain.length + nonce.length);
51
+ return new Uint8Array(createHash("sha256").update(msg).digest());
52
+ }
53
+ // ─── Type guards ────────────────────────────────────────────────────────────
54
+ function hasBytes(v) {
55
+ return v instanceof Uint8Array || (typeof Buffer !== "undefined" && Buffer.isBuffer(v));
56
+ }
57
+ export function isContentDeliveryAck(frame) {
58
+ if (frame === null || typeof frame !== "object")
59
+ return false;
60
+ const f = frame;
61
+ return (f["type"] === "content_delivery_ack" &&
62
+ hasBytes(f["session_id"]) &&
63
+ hasBytes(f["content_hash"]) &&
64
+ typeof f["level"] === "string");
65
+ }
66
+ export function isContentResendRequest(frame) {
67
+ if (frame === null || typeof frame !== "object")
68
+ return false;
69
+ const f = frame;
70
+ return (f["type"] === "content_resend_request" &&
71
+ hasBytes(f["session_id"]) &&
72
+ hasBytes(f["content_hash"]));
73
+ }
74
+ export function isContentParkDeposit(frame) {
75
+ if (frame === null || typeof frame !== "object")
76
+ return false;
77
+ const f = frame;
78
+ return (f["type"] === "content_park_deposit" &&
79
+ hasBytes(f["recipient_pubkey"]) &&
80
+ hasBytes(f["content_hash"]) &&
81
+ hasBytes(f["ciphertext"]));
82
+ }
83
+ //# sourceMappingURL=content-delivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-delivery.js","sourceRoot":"","sources":["../src/content-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAiB,EAAE,eAA2B;IACpF,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAClE,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MA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C,CAAC,CAAC,YAAY,CAAC,CAAC;QACzB,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CACL,CAAC,CAAC,MAAM,CAAC,KAAK,sBAAsB;QACpC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAC/B,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAC3B,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1B,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export type { MessageEnvelope, MessageEnvelopeV1, EnvelopeError, BuildResult, Bu
2
2
  export { MAX_CONTENT_BYTES, buildEnvelope, serializeEnvelope, deserializeEnvelope, validateEnvelope, buildEnvelopeV1, serializeEnvelopeV1, deserializeEnvelopeV1, validateEnvelopeV1, extractStructure1, } from "./envelope.js";
3
3
  export type { ScanResultSentinel, Structure2, BuildStructure2Result } from "./structure2.js";
4
4
  export { SCAN_RESULT_SENTINEL, buildStructure2, encodeStructure2, encodeScanResultSentinel, verifyStructure2Signature, } from "./structure2.js";
5
- export { computeGenesisPrevRoot, encodeSealPayload, decodeSealPayload, buildSessionEstablishmentTbs, buildSealTbs } from "./session.js";
6
- export type { SessionAssignment, SessionAssignmentFrost, SessionAssignmentSingle, ParticipantInfo, RelayEndpointInfo, SealPayload, SessionAbandoned, SessionSealedSingle, SessionSealedFrost, SessionSealed, SealRejectionReason, SessionSealRejected, SealVerified, } from "./session.js";
5
+ export { computeGenesisPrevRoot, encodeSealPayload, decodeSealPayload, buildSessionEstablishmentTbs, buildSealTbs, SEAL_RECEIPT_DISCLAIMER } from "./session.js";
6
+ export type { SessionAssignment, SessionAssignmentFrost, SessionAssignmentSingle, ParticipantInfo, RelayEndpointInfo, SealPayload, SessionAbandoned, SessionSealedSingle, SessionSealedFrost, SessionSealed, SealRejectionReason, SessionSealRejected, SealVerified, AttestationMode, SealLegibility, SealLegibilityParticipant, SealLegibilityFinalMessage, } from "./session.js";
7
7
  export type { MlDsaKeyProvider, MlDsaVerifier, PseudonymBinding, Endorsement, Attestation, ConnectionPackage, EndorsementValidationStatus, AttestationValidationStatus, ValidatedEndorsement, ValidatedAttestation, PackageValidationResult, BuildPseudonymBindingResult, SignalCondition, SignalRequirement, ConnectionPolicy, DirectoryContext, } from "./connection-package.js";
8
8
  export { MAX_PSEUDONYM_LABEL_BYTES, ML_DSA_PUBKEY_BYTES, ML_DSA_SIGNATURE_BYTES, buildPseudonymBinding, verifyPseudonymBinding, verifyEndorsement, verifyAttestation, validateConnectionPackage, encodeConnectionPackage, decodeConnectionPackage, } from "./connection-package.js";
9
9
  export type { RegisterRequest, DkgComplete, DkgReady, RegisterSuccess, RegisterError, RegisterErrorReason, AgentProfile, RegistrationState, } from "./registration.js";
@@ -11,4 +11,9 @@ export type { ConnectionRequest, ConnectionRequestInbound, ConnectionResponse, C
11
11
  export type { DkgRound1Broadcast, DkgRound2Share, FrostDkgRound1Request, FrostDkgRound1Response, FrostDkgRound2Request, FrostDkgRound2Response, FrostDkgRound3Request, FrostDkgRound3Response, FrostDkgRequest, FrostDkgResponse, } from "./frost-dkg.js";
12
12
  export type { ConsortiumManifest, ConsortiumNode, OfficerSignature, ManifestError, } from "./manifest.js";
13
13
  export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, } from "./manifest.js";
14
+ export type { SealInterruptedLeaf, SealInterruptedRequest, SealInterruptedAck, SealInterruptedRejection, SessionInterruptedFrame, SealInterruptedSignalingMessage, } from "./seal-interrupted.js";
15
+ export type { ContentAckLevel, ContentDeliveryAck, ContentResendRequest, ContentParkDeposit, ContentParkDepositAck, ContentParkNotify, ContentParkPullRequest, ContentParkPullResponse, } from "./content-delivery.js";
16
+ export { IT_LENGTH_PREFIX_DEFAULT_MAX, CONTENT_PARK_PROTOCOL_ID, CONTENT_PARK_AUTH_DOMAIN, buildContentParkAuthMsg, isContentDeliveryAck, isContentResendRequest, isContentParkDeposit, } from "./content-delivery.js";
17
+ export type { SessionLiveness, SessionLivenessQuery, SessionLivenessResponse, } from "./session-liveness.js";
18
+ export { encodeSessionLivenessQuery, decodeSessionLivenessQuery, encodeSessionLivenessResponse, decodeSessionLivenessResponse, } from "./session-liveness.js";
14
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxI,YAAY,EACV,iBAAiB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EACnH,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB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AAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export { MAX_CONTENT_BYTES, buildEnvelope, serializeEnvelope, deserializeEnvelope, validateEnvelope, buildEnvelopeV1, serializeEnvelopeV1, deserializeEnvelopeV1, validateEnvelopeV1, extractStructure1, } from "./envelope.js";
2
2
  export { SCAN_RESULT_SENTINEL, buildStructure2, encodeStructure2, encodeScanResultSentinel, verifyStructure2Signature, } from "./structure2.js";
3
- export { computeGenesisPrevRoot, encodeSealPayload, decodeSealPayload, buildSessionEstablishmentTbs, buildSealTbs } from "./session.js";
3
+ export { computeGenesisPrevRoot, encodeSealPayload, decodeSealPayload, buildSessionEstablishmentTbs, buildSealTbs, SEAL_RECEIPT_DISCLAIMER } from "./session.js";
4
4
  export { MAX_PSEUDONYM_LABEL_BYTES, ML_DSA_PUBKEY_BYTES, ML_DSA_SIGNATURE_BYTES, buildPseudonymBinding, verifyPseudonymBinding, verifyEndorsement, verifyAttestation, validateConnectionPackage, encodeConnectionPackage, decodeConnectionPackage, } from "./connection-package.js";
5
5
  export { MANIFEST_SIGNATURE_INVALID, MANIFEST_VERSION_ROLLBACK, MANIFEST_EXPIRED, } from "./manifest.js";
6
+ export { IT_LENGTH_PREFIX_DEFAULT_MAX, CONTENT_PARK_PROTOCOL_ID, CONTENT_PARK_AUTH_DOMAIN, buildContentParkAuthMsg, isContentDeliveryAck, isContentResendRequest, isContentParkDeposit, } from "./content-delivery.js";
7
+ export { encodeSessionLivenessQuery, decodeSessionLivenessQuery, encodeSessionLivenessResponse, decodeSessionLivenessResponse, } from "./session-liveness.js";
6
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAyBxI,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAyDjC,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AA0BjK,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAyDjC,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAuBvB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * M7-SESSION-001 — Seal-Interrupted Protocol Types
3
+ *
4
+ * Types for the bilateral seal-interrupted flow:
5
+ * 1. SealInterruptedRequest: initiator → counterparty via directory signaling
6
+ * 2. SealInterruptedAck: counterparty → initiator with signed control leaf
7
+ * 3. SealInterruptedRejection: counterparty → initiator (declined)
8
+ * 4. SealInterruptedLeaf: the SEAL-INTERRUPTED control leaf structure
9
+ *
10
+ * These are signaling-layer frames routed via the directory pass-through.
11
+ * The directory does not validate payloads — it only routes by target pubkey.
12
+ *
13
+ * Design authority: outline.md §Resolved Design Questions Q4.
14
+ * session_interrupted is relay-originated, not a seal. No auto-seal on receipt.
15
+ * The seal-interrupted flow is operator-initiated bilateral agreement.
16
+ *
17
+ * Leaf construction (implementation_notes):
18
+ * - leafCount in the leaf DEFINITION = message leaves at interruption (before SEAL-INTERRUPTED appended)
19
+ * - After appending: total leaf count = leafCountAtInterruption + 1
20
+ * - merkleRootAtInterruption = root AFTER appending the SEAL-INTERRUPTED leaf
21
+ * - FROST TBS leaf_count = leafCountAtInterruption + 1 (same as total after appending)
22
+ */
23
+ /**
24
+ * SEAL-INTERRUPTED control leaf — a new Merkle control leaf type.
25
+ * Both sides produce one of these before the FROST seal ceremony.
26
+ * Signed by the producing agent's K_local.
27
+ */
28
+ export interface SealInterruptedLeaf {
29
+ type: "SEAL_INTERRUPTED";
30
+ /** Hex-encoded session identifier */
31
+ sessionId: string;
32
+ /** Number of message leaves at interruption (before this leaf is appended) */
33
+ leafCount: number;
34
+ /** Hex-encoded Merkle root AFTER appending this SEAL-INTERRUPTED leaf */
35
+ merkleRootAtInterruption: string;
36
+ /** Unix ms timestamp when the leaf was constructed */
37
+ timestamp: number;
38
+ /** Hex-encoded K_local public key of the signing agent */
39
+ signerPubkey: string;
40
+ /** Hex-encoded Ed25519 signature over the canonical leaf content */
41
+ signature: string;
42
+ }
43
+ /**
44
+ * SealInterruptedRequest: initiator → counterparty via directory signaling.
45
+ * Sent when an operator calls cello_close_session on an interrupted session.
46
+ */
47
+ export interface SealInterruptedRequest {
48
+ type: "seal_interrupted_request";
49
+ sessionId: string;
50
+ initiatorPubkey: string;
51
+ counterpartyPubkey: string;
52
+ leafCountAtInterruption: number;
53
+ /**
54
+ * Hex-encoded Merkle root the initiator computed at interruption. The
55
+ * initiator's client (the holder of the session Merkle tree) supplies this;
56
+ * the daemon itself does not compute Merkle roots. Carried so the counterparty
57
+ * co-signs over the same root. Empty string when the initiator's client did not
58
+ * supply one (the bilateral commitment then binds leafCount only).
59
+ */
60
+ merkleRootAtInterruption: string;
61
+ /**
62
+ * Liveness nonce. The counterparty MUST echo this back in its ack so the
63
+ * initiator can reject a stale or replayed response (L-2).
64
+ */
65
+ nonce: string;
66
+ }
67
+ /**
68
+ * SealInterruptedAck: counterparty → initiator via directory signaling.
69
+ * Contains the counterparty's signed SEAL-INTERRUPTED leaf.
70
+ */
71
+ export interface SealInterruptedAck {
72
+ type: "seal_interrupted_ack";
73
+ sessionId: string;
74
+ /**
75
+ * Hex-encoded K_local public key of the original initiator. The directory's
76
+ * signaling decoder routes the reply back by looking up this pubkey, so it is
77
+ * REQUIRED on the wire (the directory does not infer it from session state).
78
+ */
79
+ initiatorPubkey: string;
80
+ /**
81
+ * The nonce from the originating SealInterruptedRequest, echoed verbatim. The
82
+ * initiator rejects the ack if this does not match the nonce it sent (L-2).
83
+ */
84
+ nonce: string;
85
+ sealInterruptedLeaf: SealInterruptedLeaf;
86
+ }
87
+ /**
88
+ * SealInterruptedRejection: counterparty → initiator via directory signaling.
89
+ * The counterparty declines the seal-interrupted request.
90
+ */
91
+ export interface SealInterruptedRejection {
92
+ type: "seal_interrupted_rejection";
93
+ sessionId: string;
94
+ /**
95
+ * Hex-encoded K_local public key of the original initiator. The directory's
96
+ * signaling decoder routes the reply back by looking up this pubkey, so it is
97
+ * REQUIRED on the wire (the directory does not infer it from session state).
98
+ */
99
+ initiatorPubkey: string;
100
+ reason: string;
101
+ }
102
+ /**
103
+ * SessionInterruptedFrame: relay → client control frame.
104
+ * Relay-originated when a participant disconnects mid-session.
105
+ * NOT a seal — no Merkle root, no FROST ceremony.
106
+ */
107
+ export interface SessionInterruptedFrame {
108
+ type: "session_interrupted";
109
+ sessionId: string;
110
+ reason: "peer_disconnected" | "timeout";
111
+ }
112
+ /**
113
+ * Union of seal-interrupted signaling message types.
114
+ * Used by the directory pass-through and the daemon frame handler.
115
+ */
116
+ export type SealInterruptedSignalingMessage = SealInterruptedRequest | SealInterruptedAck | SealInterruptedRejection;
117
+ //# sourceMappingURL=seal-interrupted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seal-interrupted.d.ts","sourceRoot":"","sources":["../src/seal-interrupted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,IA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AClB,wBAAwB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * M7-SESSION-001 — Seal-Interrupted Protocol Types
3
+ *
4
+ * Types for the bilateral seal-interrupted flow:
5
+ * 1. SealInterruptedRequest: initiator → counterparty via directory signaling
6
+ * 2. SealInterruptedAck: counterparty → initiator with signed control leaf
7
+ * 3. SealInterruptedRejection: counterparty → initiator (declined)
8
+ * 4. SealInterruptedLeaf: the SEAL-INTERRUPTED control leaf structure
9
+ *
10
+ * These are signaling-layer frames routed via the directory pass-through.
11
+ * The directory does not validate payloads — it only routes by target pubkey.
12
+ *
13
+ * Design authority: outline.md §Resolved Design Questions Q4.
14
+ * session_interrupted is relay-originated, not a seal. No auto-seal on receipt.
15
+ * The seal-interrupted flow is operator-initiated bilateral agreement.
16
+ *
17
+ * Leaf construction (implementation_notes):
18
+ * - leafCount in the leaf DEFINITION = message leaves at interruption (before SEAL-INTERRUPTED appended)
19
+ * - After appending: total leaf count = leafCountAtInterruption + 1
20
+ * - merkleRootAtInterruption = root AFTER appending the SEAL-INTERRUPTED leaf
21
+ * - FROST TBS leaf_count = leafCountAtInterruption + 1 (same as total after appending)
22
+ */
23
+ export {};
24
+ //# sourceMappingURL=seal-interrupted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seal-interrupted.js","sourceRoot":"","sources":["../src/seal-interrupted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * CELLO-M7-SESSION-003 — session-path liveness wire types + codec
3
+ *
4
+ * The relay is the session-path liveness authority for relay-mode sessions. The
5
+ * client queries it over the relay protocol stream with a session_liveness_query
6
+ * frame and receives a session_liveness_response.
7
+ *
8
+ * WIRE CONVENTION (cross-ref SESSION-001 L-1): on-wire keys are snake_case,
9
+ * matching every other relay frame. session_id is the 16-byte binary session id
10
+ * and counterparty_pubkey is the 32-byte Ed25519 pubkey — identical to the keys
11
+ * the relay uses for its delivery queue. The relay (trustless-cello) re-encodes
12
+ * the SAME shape independently in relay-frames.ts (it cannot import this
13
+ * unpublished package); the two MUST agree byte-for-byte. These tests pin the
14
+ * shape.
15
+ *
16
+ * liveness is exactly 'alive' | 'gone' | 'unknown':
17
+ * - 'alive' : the relay currently holds the recipient's standing connection
18
+ * - 'gone' : the relay positively observed the recipient's disconnect with
19
+ * no subsequent reconnect
20
+ * - 'unknown' : the relay has no tracked entry for the recipient. The relay
21
+ * NEVER fabricates 'gone' from a missing entry (no observation is
22
+ * 'unknown', not 'gone').
23
+ */
24
+ export type SessionLiveness = "alive" | "gone" | "unknown";
25
+ export interface SessionLivenessQuery {
26
+ type: "session_liveness_query";
27
+ /** 16-byte binary session id */
28
+ session_id: Uint8Array;
29
+ /** 32-byte Ed25519 pubkey of the counterparty whose liveness is queried */
30
+ counterparty_pubkey: Uint8Array;
31
+ }
32
+ export interface SessionLivenessResponse {
33
+ type: "session_liveness_response";
34
+ session_id: Uint8Array;
35
+ counterparty_pubkey: Uint8Array;
36
+ liveness: SessionLiveness;
37
+ /** Unix ms timestamp of the relay's most recent observation for this recipient */
38
+ observed_at: number;
39
+ }
40
+ export declare function encodeSessionLivenessQuery(frame: SessionLivenessQuery): Uint8Array;
41
+ export declare function decodeSessionLivenessQuery(bytes: Uint8Array): SessionLivenessQuery | null;
42
+ export declare function encodeSessionLivenessResponse(frame: SessionLivenessResponse): Uint8Array;
43
+ export declare function decodeSessionLivenessResponse(bytes: Uint8Array): SessionLivenessResponse | null;
44
+ //# sourceMappingURL=session-liveness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-liveness.d.ts","sourceRoot":"","sources":["../src/session-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,gCAAgC;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,2EAA2E;IAC3E,mBAAmB,EAAE,UAAU,CAAC;CACjC;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,2BAA2B,CAAC;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,mBAAmB,EAAE,UAAU,CAAC;IAChC,QAAQ,EAAE,eAAe,CAAC;IAC1B,kFAAkF;IAClF,WAAW,EAAE,MAAM,CAAC;CACrB;AAYD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,oBAAoB,GAAG,UAAU,CAMlF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB,GAAG,IAAI,CAezF;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,uBAAuB,GAAG,UAAU,CAQxF;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,UAAU,GAAG,uBAAuB,GAAG,IAAI,CAmB/F"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * CELLO-M7-SESSION-003 — session-path liveness wire types + codec
3
+ *
4
+ * The relay is the session-path liveness authority for relay-mode sessions. The
5
+ * client queries it over the relay protocol stream with a session_liveness_query
6
+ * frame and receives a session_liveness_response.
7
+ *
8
+ * WIRE CONVENTION (cross-ref SESSION-001 L-1): on-wire keys are snake_case,
9
+ * matching every other relay frame. session_id is the 16-byte binary session id
10
+ * and counterparty_pubkey is the 32-byte Ed25519 pubkey — identical to the keys
11
+ * the relay uses for its delivery queue. The relay (trustless-cello) re-encodes
12
+ * the SAME shape independently in relay-frames.ts (it cannot import this
13
+ * unpublished package); the two MUST agree byte-for-byte. These tests pin the
14
+ * shape.
15
+ *
16
+ * liveness is exactly 'alive' | 'gone' | 'unknown':
17
+ * - 'alive' : the relay currently holds the recipient's standing connection
18
+ * - 'gone' : the relay positively observed the recipient's disconnect with
19
+ * no subsequent reconnect
20
+ * - 'unknown' : the relay has no tracked entry for the recipient. The relay
21
+ * NEVER fabricates 'gone' from a missing entry (no observation is
22
+ * 'unknown', not 'gone').
23
+ */
24
+ import { Encoder, decode as cborDecode } from "cbor-x";
25
+ const CBOR_ENC = new Encoder({ tagUint8Array: false });
26
+ function toUint8Array(v) {
27
+ if (v instanceof Uint8Array)
28
+ return v;
29
+ if (Buffer.isBuffer(v))
30
+ return new Uint8Array(v);
31
+ return null;
32
+ }
33
+ function isLiveness(v) {
34
+ return v === "alive" || v === "gone" || v === "unknown";
35
+ }
36
+ export function encodeSessionLivenessQuery(frame) {
37
+ return CBOR_ENC.encode({
38
+ type: "session_liveness_query",
39
+ session_id: frame.session_id,
40
+ counterparty_pubkey: frame.counterparty_pubkey,
41
+ });
42
+ }
43
+ export function decodeSessionLivenessQuery(bytes) {
44
+ let obj;
45
+ try {
46
+ obj = cborDecode(bytes);
47
+ }
48
+ catch {
49
+ return null;
50
+ }
51
+ if (typeof obj !== "object" || obj === null)
52
+ return null;
53
+ const o = obj;
54
+ if (o["type"] !== "session_liveness_query")
55
+ return null;
56
+ const session_id = toUint8Array(o["session_id"]);
57
+ const counterparty_pubkey = toUint8Array(o["counterparty_pubkey"]);
58
+ if (!session_id || session_id.length !== 16)
59
+ return null;
60
+ if (!counterparty_pubkey || counterparty_pubkey.length !== 32)
61
+ return null;
62
+ return { type: "session_liveness_query", session_id, counterparty_pubkey };
63
+ }
64
+ export function encodeSessionLivenessResponse(frame) {
65
+ return CBOR_ENC.encode({
66
+ type: "session_liveness_response",
67
+ session_id: frame.session_id,
68
+ counterparty_pubkey: frame.counterparty_pubkey,
69
+ liveness: frame.liveness,
70
+ observed_at: frame.observed_at,
71
+ });
72
+ }
73
+ export function decodeSessionLivenessResponse(bytes) {
74
+ let obj;
75
+ try {
76
+ obj = cborDecode(bytes);
77
+ }
78
+ catch {
79
+ return null;
80
+ }
81
+ if (typeof obj !== "object" || obj === null)
82
+ return null;
83
+ const o = obj;
84
+ if (o["type"] !== "session_liveness_response")
85
+ return null;
86
+ const session_id = toUint8Array(o["session_id"]);
87
+ const counterparty_pubkey = toUint8Array(o["counterparty_pubkey"]);
88
+ const liveness = o["liveness"];
89
+ const observed_at = o["observed_at"];
90
+ if (!session_id || session_id.length !== 16)
91
+ return null;
92
+ if (!counterparty_pubkey || counterparty_pubkey.length !== 32)
93
+ return null;
94
+ if (!isLiveness(liveness))
95
+ return null;
96
+ if (typeof observed_at !== "number")
97
+ return null;
98
+ return { type: "session_liveness_response", session_id, counterparty_pubkey, liveness, observed_at };
99
+ }
100
+ //# sourceMappingURL=session-liveness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-liveness.js","sourceRoot":"","sources":["../src/session-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEvD,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;AAqBvD,SAAS,YAAY,CAAC,CAAU;IAC9B,IAAI,CAAC,YAAY,UAAU;QAAE,OAAO,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,UAAU,CAAC,CAAU;IAC5B,OAAO,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,SAAS,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAA2B;IACpE,OAAO,QAAQ,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,wBAAwB;QAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;KAC/C,CAAe,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAAiB;IAC1D,IAAI,GAAY,CAAC;IACjB,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,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACzD,MAAM,CAAC,GAAG,GAA8B,CAAC;IACzC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,2BAA2B;QAAE,OAAO,IAAI,CAAC;IAC3D,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACjD,MAAM,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,WAAW,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACzD,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC3E,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,OAAO,WAAW,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjD,OAAO,EAAE,IAAI,EAAE,2BAA2B,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AACvG,CAAC"}
package/dist/session.d.ts CHANGED
@@ -95,6 +95,11 @@ interface SessionAssignmentCommon {
95
95
  session_timestamp: number;
96
96
  directory_pubkey: Uint8Array;
97
97
  directory_signature: Uint8Array;
98
+ initiator_session_peer_id?: string;
99
+ initiator_session_addrs?: string[];
100
+ counterparty_session_peer_id?: string;
101
+ counterparty_session_addrs?: string[];
102
+ transport_mode?: 'direct' | 'relay';
98
103
  }
99
104
  /**
100
105
  * SESSION-004: FROST-signed assignment. `signer_pubkey` is the initiator's
@@ -126,18 +131,28 @@ export type SessionAssignment = SessionAssignmentFrost | SessionAssignmentSingle
126
131
  * (verifier) use identical canonical CBOR encoding. Any drift would silently
127
132
  * break verification.
128
133
  *
129
- * TBS = canonical CBOR([session_id, agent_A_pubkey, agent_B_pubkey, genesis_prev_root, timestamp])
134
+ * Legacy (M1–M6) TBS = canonical CBOR([session_id, pubA, pubB, genesis_prev_root, timestamp])
135
+ * M7+ TBS = canonical CBOR([session_id, pubA, pubB, genesis_prev_root, timestamp,
136
+ * initiatorSessionPeerId, JSON.stringify(initiatorSessionAddrs.slice().sort()),
137
+ * counterpartySessionPeerId, JSON.stringify(counterpartySessionAddrs.slice().sort()),
138
+ * transportMode])
130
139
  *
131
140
  * Per CONTEXT.md: tagUint8Array: false. Timestamp encoded as BigInt when > 0xffffffff.
141
+ * Address arrays are sorted and JSON-stringified for canonical ordering.
132
142
  *
133
143
  * @param sessionId - 16-byte session identifier
134
144
  * @param pubA - 32-byte K_local pubkey of participant A
135
145
  * @param pubB - 32-byte K_local pubkey of participant B
136
146
  * @param genesisPrevRoot - 32-byte genesis prev_root (output of computeGenesisPrevRoot)
137
147
  * @param timestamp - session_timestamp in Unix milliseconds
148
+ * @param initiatorSessionPeerId - M7: session node Peer ID of initiator (optional for backward compat)
149
+ * @param initiatorSessionAddrs - M7: multiaddrs of initiator session node (optional for backward compat)
150
+ * @param counterpartySessionPeerId - M7: session node Peer ID of counterparty (optional for backward compat)
151
+ * @param counterpartySessionAddrs - M7: multiaddrs of counterparty session node (optional for backward compat)
152
+ * @param transportMode - M7: 'direct' or 'relay' (optional for backward compat)
138
153
  * @returns canonical CBOR bytes of the TBS array
139
154
  */
140
- export declare function buildSessionEstablishmentTbs(sessionId: Uint8Array, pubA: Uint8Array, pubB: Uint8Array, genesisPrevRoot: Uint8Array, timestamp: number | bigint): Uint8Array;
155
+ export declare function buildSessionEstablishmentTbs(sessionId: Uint8Array, pubA: Uint8Array, pubB: Uint8Array, genesisPrevRoot: Uint8Array, timestamp: number | bigint, initiatorSessionPeerId?: string, initiatorSessionAddrs?: string[], counterpartySessionPeerId?: string, counterpartySessionAddrs?: string[], transportMode?: 'direct' | 'relay'): Uint8Array;
141
156
  /**
142
157
  * SEAL control payload carried as the content_bytes of a ctrl leaf.
143
158
  * Canonical CBOR encoding: [session_id, final_root, close_timestamp, "PENDING"].
@@ -190,6 +205,7 @@ export interface SessionSealedSingle {
190
205
  sealed_root: Uint8Array;
191
206
  directory_signature: Uint8Array;
192
207
  close_timestamp: number;
208
+ legibility?: SealLegibility;
193
209
  }
194
210
  /**
195
211
  * M2 session_sealed frame (FROST-notarized ceremony signature).
@@ -204,9 +220,65 @@ export interface SessionSealedFrost {
204
220
  signer_pubkey: Uint8Array;
205
221
  close_timestamp: number;
206
222
  leaf_count?: number;
223
+ legibility?: SealLegibility;
207
224
  }
208
225
  /** Discriminated union: M2 sends SessionSealedFrost; old M1 wire format is SessionSealedSingle. */
209
226
  export type SessionSealed = SessionSealedSingle | SessionSealedFrost;
227
+ /**
228
+ * Per-attestation marker.
229
+ * 'live' — the participant produced their SEAL acknowledgement leaf
230
+ * contemporaneously in this ceremony (full-bilateral / present-party).
231
+ * 'absent' — the participant produced no acknowledgement (counterparty ABSENT;
232
+ * populated by the unilateral-notarization flow, Workstream A).
233
+ * 'recovered' — the acknowledgement was added post-hoc on return (populated by the
234
+ * bilateral-upgrade flow, Workstream C).
235
+ */
236
+ export type AttestationMode = "live" | "recovered" | "absent";
237
+ /**
238
+ * Canonical, human-readable receipt-not-assent disclaimer carried on every seal
239
+ * certificate. Constant — the receipt-not-assent property is not session-specific.
240
+ */
241
+ export declare const SEAL_RECEIPT_DISCLAIMER: string;
242
+ export interface SealLegibilityParticipant {
243
+ /** 32-byte K_local pubkey of this participant. */
244
+ pubkey: Uint8Array;
245
+ /**
246
+ * The highest counterparty sequence number this party PROVABLY received —
247
+ * the maximum signed last_seen_seq across that party's OWN signed leaves.
248
+ * Tree sequence numbers greater than this were merely sent/committed, not
249
+ * provably received by this party.
250
+ */
251
+ content_frontier_seq: number;
252
+ /** The highest sequence number this party authored. */
253
+ last_authored_seq: number;
254
+ /** Per-attestation live-vs-recovered-vs-absent marker. */
255
+ attestation_mode: AttestationMode;
256
+ }
257
+ export interface SealLegibilityFinalMessage {
258
+ /** 32-byte pubkey of the author of the highest-sequence content (non-control) leaf. */
259
+ sender_pubkey: Uint8Array;
260
+ /** Sequence number of that final content leaf. */
261
+ seq: number;
262
+ /**
263
+ * false => the final-message-unanswered case: composition + submission is
264
+ * proven, receipt by the counterparty is not. A malicious tail
265
+ * ("…you agreed to send me $1000") reads as delivered-but-unanswered.
266
+ */
267
+ answered: boolean;
268
+ }
269
+ /**
270
+ * Reader-facing legibility object attached to the SessionSealed certificate.
271
+ * Built by the directory at seal time; persisted client-side; exposed intact to
272
+ * any reader (human, agent, arbitrator). NO field asserts, implies, or can be
273
+ * parsed as agreement; `implies_assent` is always the literal `false`.
274
+ */
275
+ export interface SealLegibility {
276
+ attests: "receipt";
277
+ implies_assent: false;
278
+ disclaimer: string;
279
+ participants: SealLegibilityParticipant[];
280
+ final_message: SealLegibilityFinalMessage;
281
+ }
210
282
  export type SealRejectionReason = "merkle_root_mismatch" | "leaf_signature_invalid" | "prev_root_chain_broken" | "causal_chain_violated" | "seal_leaves_invalid" | "seal_signature_invalid";
211
283
  export interface SessionSealRejected {
212
284
  type: "session_seal_rejected";
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AASH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,+DAA+D;AAC/D,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AAyB,EAAE,CAAC;IAC1C,aAAa,EAAE,0BAA0B,CAAC;CAC3C;AAED,MAAM,MAAM,mBAAmB,GAC3B,sBAAsB,GACtB,wBAAwB,GACxB,wBAAwB,GACxB,uBAAuB,GACvB,qBAAqB,GACrB,wBAAwB,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAClC,UAAU,CAiBZ"}
package/dist/session.js CHANGED
@@ -87,24 +87,55 @@ const CBOR_ENC = new Encoder({ tagUint8Array: false });
87
87
  * (verifier) use identical canonical CBOR encoding. Any drift would silently
88
88
  * break verification.
89
89
  *
90
- * TBS = canonical CBOR([session_id, agent_A_pubkey, agent_B_pubkey, genesis_prev_root, timestamp])
90
+ * Legacy (M1–M6) TBS = canonical CBOR([session_id, pubA, pubB, genesis_prev_root, timestamp])
91
+ * M7+ TBS = canonical CBOR([session_id, pubA, pubB, genesis_prev_root, timestamp,
92
+ * initiatorSessionPeerId, JSON.stringify(initiatorSessionAddrs.slice().sort()),
93
+ * counterpartySessionPeerId, JSON.stringify(counterpartySessionAddrs.slice().sort()),
94
+ * transportMode])
91
95
  *
92
96
  * Per CONTEXT.md: tagUint8Array: false. Timestamp encoded as BigInt when > 0xffffffff.
97
+ * Address arrays are sorted and JSON-stringified for canonical ordering.
93
98
  *
94
99
  * @param sessionId - 16-byte session identifier
95
100
  * @param pubA - 32-byte K_local pubkey of participant A
96
101
  * @param pubB - 32-byte K_local pubkey of participant B
97
102
  * @param genesisPrevRoot - 32-byte genesis prev_root (output of computeGenesisPrevRoot)
98
103
  * @param timestamp - session_timestamp in Unix milliseconds
104
+ * @param initiatorSessionPeerId - M7: session node Peer ID of initiator (optional for backward compat)
105
+ * @param initiatorSessionAddrs - M7: multiaddrs of initiator session node (optional for backward compat)
106
+ * @param counterpartySessionPeerId - M7: session node Peer ID of counterparty (optional for backward compat)
107
+ * @param counterpartySessionAddrs - M7: multiaddrs of counterparty session node (optional for backward compat)
108
+ * @param transportMode - M7: 'direct' or 'relay' (optional for backward compat)
99
109
  * @returns canonical CBOR bytes of the TBS array
100
110
  */
101
- export function buildSessionEstablishmentTbs(sessionId, pubA, pubB, genesisPrevRoot, timestamp) {
111
+ export function buildSessionEstablishmentTbs(sessionId, pubA, pubB, genesisPrevRoot, timestamp, initiatorSessionPeerId, initiatorSessionAddrs, counterpartySessionPeerId, counterpartySessionAddrs, transportMode) {
112
+ const tsEncoded = typeof timestamp === "bigint" || timestamp > 0xffffffff ? BigInt(timestamp) : timestamp;
113
+ // M7+: when all new fields are provided, encode all 10 fields
114
+ if (initiatorSessionPeerId !== undefined &&
115
+ initiatorSessionAddrs !== undefined &&
116
+ counterpartySessionPeerId !== undefined &&
117
+ counterpartySessionAddrs !== undefined &&
118
+ transportMode !== undefined) {
119
+ return CBOR_ENC.encode([
120
+ sessionId,
121
+ pubA,
122
+ pubB,
123
+ genesisPrevRoot,
124
+ tsEncoded,
125
+ initiatorSessionPeerId,
126
+ JSON.stringify(initiatorSessionAddrs.slice().sort()),
127
+ counterpartySessionPeerId,
128
+ JSON.stringify(counterpartySessionAddrs.slice().sort()),
129
+ transportMode,
130
+ ]);
131
+ }
132
+ // Legacy (M1–M6): encode only the original 5 fields
102
133
  return CBOR_ENC.encode([
103
134
  sessionId,
104
135
  pubA,
105
136
  pubB,
106
137
  genesisPrevRoot,
107
- typeof timestamp === "bigint" || timestamp > 0xffffffff ? BigInt(timestamp) : timestamp,
138
+ tsEncoded,
108
139
  ]);
109
140
  }
110
141
  /**
@@ -172,6 +203,14 @@ export function buildSealTbs(sessionId, sealedRoot, leafCount, timestamp) {
172
203
  timestamp > 0xffffffff ? BigInt(timestamp) : timestamp,
173
204
  ]);
174
205
  }
206
+ /**
207
+ * Canonical, human-readable receipt-not-assent disclaimer carried on every seal
208
+ * certificate. Constant — the receipt-not-assent property is not session-specific.
209
+ */
210
+ export const SEAL_RECEIPT_DISCLAIMER = "This certificate attests faithful receipt, integrity, and ordering of the " +
211
+ "transcript. No signature in this certificate implies agreement to, or assent " +
212
+ "to, the contents of any message. Agreement is always a separate, explicit act " +
213
+ "(its own signed reply). A sealed transcript is a receipt, never a record of agreement.";
175
214
  // ─── End session outcome notification frame types ─────────────────────────────
176
215
  /**
177
216
  * Compute the genesis prev_root for a two-party CELLO session.
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEvD,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;AAsDvD,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAqB,EACrB,IAAgB,EAChB,IAAgB,EAChB,eAA2B,EAC3B,SAA0B;IAE1B,OAAO,QAAQ,CAAC,MAAM,CAAC;QACrB,SAAS;QACT,IAAI;QACJ,IAAI;QACJ,eAAe;QACf,OAAO,SAA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CAAC,SAAS,CAAC;SACjB,MAAM,CAAC,IAAI,CAAC;SACZ,MAAM,EAAE,CACZ,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/protocol-types",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {