@cello-protocol/protocol-types 0.0.44 → 0.0.46
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/cbor.d.ts +16 -0
- package/dist/cbor.d.ts.map +1 -1
- package/dist/cbor.js +56 -0
- package/dist/cbor.js.map +1 -1
- package/dist/document-ack.d.ts +111 -0
- package/dist/document-ack.d.ts.map +1 -0
- package/dist/document-ack.js +228 -0
- package/dist/document-ack.js.map +1 -0
- package/dist/document-control.d.ts +74 -0
- package/dist/document-control.d.ts.map +1 -0
- package/dist/document-control.js +174 -0
- package/dist/document-control.js.map +1 -0
- package/dist/document-envelope.d.ts +132 -0
- package/dist/document-envelope.d.ts.map +1 -0
- package/dist/document-envelope.js +243 -0
- package/dist/document-envelope.js.map +1 -0
- package/dist/document-proposal-ack.d.ts +98 -0
- package/dist/document-proposal-ack.d.ts.map +1 -0
- package/dist/document-proposal-ack.js +203 -0
- package/dist/document-proposal-ack.js.map +1 -0
- package/dist/document-proposal.d.ts +127 -0
- package/dist/document-proposal.d.ts.map +1 -0
- package/dist/document-proposal.js +244 -0
- package/dist/document-proposal.js.map +1 -0
- package/dist/document-rejection-envelope.d.ts +87 -0
- package/dist/document-rejection-envelope.d.ts.map +1 -0
- package/dist/document-rejection-envelope.js +189 -0
- package/dist/document-rejection-envelope.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOD-DOC-HANDSHAKE-1 — the document PROPOSAL envelope (§16.3).
|
|
3
|
+
*
|
|
4
|
+
* A distinct wire type from `document-envelope.ts`'s UPDATE envelope. The two share the word
|
|
5
|
+
* "envelope" and nothing else: this one is proposed once, consented to once, and its hash becomes
|
|
6
|
+
* the `document_id` that every subsequent update names.
|
|
7
|
+
*
|
|
8
|
+
* **`document_id` is the hash of this envelope** — globally unique with no minting authority and
|
|
9
|
+
* no coordination round. That is the property that makes the whole scheme federated, and it is why
|
|
10
|
+
* the proposal must be canonically encodable: two parties that hash it differently are on two
|
|
11
|
+
* different documents while believing they are on one.
|
|
12
|
+
*
|
|
13
|
+
* ── THE SEAM (§3.4, §11.1) ────────────────────────────────────────────────────────────────────
|
|
14
|
+
*
|
|
15
|
+
* Three properties are DECLARED in V1 but support exactly one value each, and the pattern is
|
|
16
|
+
* deliberate — §3.3 chose it for `schema_enforcement` and §16.1 generalized it. Declaring a field
|
|
17
|
+
* that only accepts one value looks redundant until you need the second value: the field is
|
|
18
|
+
* already on the wire and already signed, so V2 is a validation change rather than a wire break
|
|
19
|
+
* that strands every document created before it.
|
|
20
|
+
*
|
|
21
|
+
* Refused at BOTH ends — at proposal and again at accept. Not belt-and-braces: the proposer and
|
|
22
|
+
* the accepter run different builds. A V2 peer proposing `topology: "mesh"` to a V1 peer must be
|
|
23
|
+
* refused by the V1 accepter, and a V1 proposer must not be able to emit a value it cannot honour.
|
|
24
|
+
* One-sided validation means whichever side is newer silently decides for both.
|
|
25
|
+
*
|
|
26
|
+
* ── THE FEATURE VERSION (§16.7-8) ─────────────────────────────────────────────────────────────
|
|
27
|
+
*
|
|
28
|
+
* Alpha owes no backward compatibility, so this is not a negotiation — it is the difference
|
|
29
|
+
* between a human answer and a timeout. A peer whose client predates documents does not understand
|
|
30
|
+
* the proposal at all, and without a version the symptom is silence: the proposal is never
|
|
31
|
+
* answered and the operator sees a hang. `documentFeatureIncompatibility` turns that into "your
|
|
32
|
+
* peer's client doesn't support shared documents yet — ask them to upgrade".
|
|
33
|
+
*/
|
|
34
|
+
import { createHash } from "node:crypto";
|
|
35
|
+
import { encodeCbor, decodeCbor } from "./cbor.js";
|
|
36
|
+
/** Domain tag in slot 0 of the to-be-signed array. Distinct from the UPDATE envelope's domain. */
|
|
37
|
+
export const DOCUMENT_PROPOSAL_DOMAIN = "CELLO-DOCUMENT-PROPOSAL-v1";
|
|
38
|
+
/**
|
|
39
|
+
* The document feature version this build speaks. Bumped when the document wire changes in a way
|
|
40
|
+
* a peer must understand; see `documentFeatureIncompatibility` for what a mismatch produces.
|
|
41
|
+
*/
|
|
42
|
+
export const DOCUMENT_FEATURE_VERSION = 1;
|
|
43
|
+
/** §6 — Tier 1. Tier 2 (attested) is V2; the field exists so V2 is a validation change. */
|
|
44
|
+
export const ASSURANCE_TIER_V1 = "authenticated";
|
|
45
|
+
/** §11 — the pairwise two-document form. Mesh is deferred (§11.1). */
|
|
46
|
+
export const TOPOLOGY_V1 = "hub-and-spoke";
|
|
47
|
+
/**
|
|
48
|
+
* The canonical to-be-signed preimage: a fixed-order CBOR ARRAY with the domain in slot 0.
|
|
49
|
+
*
|
|
50
|
+
* The properties are flattened into their own slots rather than nested as a map. `encodeCbor` is
|
|
51
|
+
* not deterministic for maps — keys follow insertion order — so a nested `properties` object would
|
|
52
|
+
* make the signature depend on the order the proposer happened to build it in, and two honest
|
|
53
|
+
* builds of the same proposal would produce different `document_id`s. For this envelope that is
|
|
54
|
+
* worse than a bad signature: the id IS the hash, so the two parties would be on two documents.
|
|
55
|
+
*/
|
|
56
|
+
export function buildDocumentProposalTbs(env, opts = {}) {
|
|
57
|
+
const preimage = encodeCbor([
|
|
58
|
+
DOCUMENT_PROPOSAL_DOMAIN,
|
|
59
|
+
env.feature_version,
|
|
60
|
+
env.proposer_agent_id,
|
|
61
|
+
env.peer_agent_id,
|
|
62
|
+
env.document_type,
|
|
63
|
+
env.properties.assurance_tier,
|
|
64
|
+
env.properties.schema_enforcement,
|
|
65
|
+
env.properties.topology,
|
|
66
|
+
env.properties.append_only,
|
|
67
|
+
env.starting_content,
|
|
68
|
+
env.nonce,
|
|
69
|
+
// BIGINT past 0xffffffff — the same coercion three sibling builders carry and which
|
|
70
|
+
// primary-transfer.ts names as a defect it shipped without. cbor-x encodes a JS number that
|
|
71
|
+
// large as an IEEE float64 (`fb`), not a uint64 (`1b`), so any implementation encoding RFC
|
|
72
|
+
// 8949-canonically would compute a DIFFERENT document_id from the same proposal — and for this
|
|
73
|
+
// envelope the id IS the hash, so the two parties would be on two documents.
|
|
74
|
+
//
|
|
75
|
+
// Fixed now rather than left as a known wart: M14 is unreleased, nothing is wired, and no
|
|
76
|
+
// proposal has ever been signed. The frozen vector below is reissued deliberately, which is
|
|
77
|
+
// exactly the case its own comment describes.
|
|
78
|
+
typeof env.proposed_at_ms === "number" && env.proposed_at_ms > 0xffffffff
|
|
79
|
+
? BigInt(env.proposed_at_ms)
|
|
80
|
+
: env.proposed_at_ms,
|
|
81
|
+
]);
|
|
82
|
+
if (opts.preHash === false)
|
|
83
|
+
return preimage;
|
|
84
|
+
return new Uint8Array(createHash("sha256").update(preimage).digest());
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* `document_id` = the hash of the proposal envelope (§16.3).
|
|
88
|
+
*
|
|
89
|
+
* Over the same preimage that is signed, and therefore NOT over the signature — so the id a party
|
|
90
|
+
* computes is the id of the thing whose signature it verified, and re-signing cannot change the
|
|
91
|
+
* identity of an already-accepted document.
|
|
92
|
+
*/
|
|
93
|
+
export function documentIdFromProposal(env) {
|
|
94
|
+
return createHash("sha256")
|
|
95
|
+
.update(buildDocumentProposalTbs(env, { preHash: false }))
|
|
96
|
+
.digest("hex");
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Refuse any seam value this build cannot honour, at proposal AND at accept.
|
|
100
|
+
*
|
|
101
|
+
* Returns the reason, or null when the properties are acceptable. A REASON rather than a boolean
|
|
102
|
+
* because the operator on the refusing side has to be able to tell "your peer asked for mesh
|
|
103
|
+
* topology, which this version does not support" from a generic refusal — a handshake that fails
|
|
104
|
+
* without saying which property failed is indistinguishable from the peer being unreachable.
|
|
105
|
+
*/
|
|
106
|
+
export function seamViolation(props) {
|
|
107
|
+
if (props.assurance_tier !== ASSURANCE_TIER_V1) {
|
|
108
|
+
return (`document_seam_assurance_tier: this version supports "${ASSURANCE_TIER_V1}" only, and the ` +
|
|
109
|
+
`proposal asks for "${props.assurance_tier}" — attested documents (§6 Tier 2) are not yet built`);
|
|
110
|
+
}
|
|
111
|
+
if (props.schema_enforcement !== false) {
|
|
112
|
+
return ("document_seam_schema_enforcement: this version supports schema_enforcement: false only — " +
|
|
113
|
+
"schema-as-first-update validation (§3.3) is not yet built");
|
|
114
|
+
}
|
|
115
|
+
if (props.topology !== TOPOLOGY_V1) {
|
|
116
|
+
return (`document_seam_topology: this version supports "${TOPOLOGY_V1}" only, and the proposal asks ` +
|
|
117
|
+
`for "${props.topology}" — mesh documents (§11.1) are not yet built`);
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A human answer for a version mismatch, or null when the peer is compatible.
|
|
123
|
+
*
|
|
124
|
+
* Deliberately phrased for the operator rather than for a log: the alternative to this string is a
|
|
125
|
+
* proposal that is never answered, which surfaces as a hang and gets diagnosed as a network fault.
|
|
126
|
+
*/
|
|
127
|
+
export function documentFeatureIncompatibility(peerFeatureVersion) {
|
|
128
|
+
if (peerFeatureVersion === null) {
|
|
129
|
+
return ("your peer's client doesn't support shared documents yet — ask them to upgrade to a version " +
|
|
130
|
+
"that speaks the document protocol");
|
|
131
|
+
}
|
|
132
|
+
if (peerFeatureVersion > DOCUMENT_FEATURE_VERSION) {
|
|
133
|
+
return (`your peer's client speaks document feature version ${peerFeatureVersion} and this one ` +
|
|
134
|
+
`speaks ${DOCUMENT_FEATURE_VERSION} — upgrade this client to collaborate with them`);
|
|
135
|
+
}
|
|
136
|
+
if (peerFeatureVersion < DOCUMENT_FEATURE_VERSION) {
|
|
137
|
+
return (`your peer's client speaks document feature version ${peerFeatureVersion} and this one ` +
|
|
138
|
+
`speaks ${DOCUMENT_FEATURE_VERSION} — ask them to upgrade`);
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
export function encodeDocumentProposal(env) {
|
|
143
|
+
return encodeCbor({
|
|
144
|
+
type: env.type,
|
|
145
|
+
feature_version: env.feature_version,
|
|
146
|
+
proposer_agent_id: env.proposer_agent_id,
|
|
147
|
+
peer_agent_id: env.peer_agent_id,
|
|
148
|
+
document_type: env.document_type,
|
|
149
|
+
properties: {
|
|
150
|
+
assurance_tier: env.properties.assurance_tier,
|
|
151
|
+
schema_enforcement: env.properties.schema_enforcement,
|
|
152
|
+
topology: env.properties.topology,
|
|
153
|
+
append_only: env.properties.append_only,
|
|
154
|
+
},
|
|
155
|
+
starting_content: env.starting_content,
|
|
156
|
+
nonce: env.nonce,
|
|
157
|
+
proposed_at_ms: env.proposed_at_ms,
|
|
158
|
+
signature: env.signature,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function present(map, field) {
|
|
162
|
+
// `in`, not a nullish check — see document-envelope.ts. A defaulted seam field is a property the
|
|
163
|
+
// peer never actually declared, admitted under this build's own preference.
|
|
164
|
+
if (!(field in map)) {
|
|
165
|
+
throw new Error(`document_proposal_missing_field: ${field} is mandatory and was not present`);
|
|
166
|
+
}
|
|
167
|
+
return map[field];
|
|
168
|
+
}
|
|
169
|
+
function str(map, field) {
|
|
170
|
+
const v = present(map, field);
|
|
171
|
+
if (typeof v !== "string" || v.length === 0) {
|
|
172
|
+
throw new Error(`document_proposal_field_type: ${field} must be a non-empty text string`);
|
|
173
|
+
}
|
|
174
|
+
return v;
|
|
175
|
+
}
|
|
176
|
+
function bytes(map, field) {
|
|
177
|
+
const v = present(map, field);
|
|
178
|
+
if (!(v instanceof Uint8Array)) {
|
|
179
|
+
throw new Error(`document_proposal_field_type: ${field} must be a CBOR byte string`);
|
|
180
|
+
}
|
|
181
|
+
// COPIED — cbor-x returns byte strings as views into the decoded buffer, so a caller reusing a
|
|
182
|
+
// pooled read buffer would mutate the starting content after it was validated and hashed.
|
|
183
|
+
return new Uint8Array(v);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Decode and validate. Does NOT check the seam — `seamViolation` is called separately at both the
|
|
187
|
+
* proposal and the accept step, because a decoder that refused seam values would make a
|
|
188
|
+
* V2 proposal undecodable and therefore unanswerable, which is exactly the silent hang the feature
|
|
189
|
+
* version exists to replace.
|
|
190
|
+
*/
|
|
191
|
+
export function decodeDocumentProposal(input) {
|
|
192
|
+
const decoded = decodeCbor(input);
|
|
193
|
+
if (typeof decoded !== "object" || decoded === null || Array.isArray(decoded)) {
|
|
194
|
+
throw new Error("document_proposal_malformed: not a CBOR map");
|
|
195
|
+
}
|
|
196
|
+
const map = decoded;
|
|
197
|
+
const type = str(map, "type");
|
|
198
|
+
if (type !== "document_proposal") {
|
|
199
|
+
throw new Error(`document_proposal_type: expected document_proposal, got ${type}`);
|
|
200
|
+
}
|
|
201
|
+
const featureVersion = present(map, "feature_version");
|
|
202
|
+
if (typeof featureVersion !== "number" || !Number.isInteger(featureVersion) || featureVersion < 1) {
|
|
203
|
+
throw new Error(`document_proposal_feature_version: must be a positive integer, got ${String(featureVersion)}`);
|
|
204
|
+
}
|
|
205
|
+
const rawProps = present(map, "properties");
|
|
206
|
+
if (typeof rawProps !== "object" || rawProps === null || Array.isArray(rawProps)) {
|
|
207
|
+
throw new Error("document_proposal_properties: must be a CBOR map");
|
|
208
|
+
}
|
|
209
|
+
const p = rawProps;
|
|
210
|
+
const schemaEnforcement = present(p, "schema_enforcement");
|
|
211
|
+
if (typeof schemaEnforcement !== "boolean") {
|
|
212
|
+
throw new Error("document_proposal_field_type: properties.schema_enforcement must be a boolean");
|
|
213
|
+
}
|
|
214
|
+
const appendOnly = present(p, "append_only");
|
|
215
|
+
if (typeof appendOnly !== "boolean") {
|
|
216
|
+
throw new Error("document_proposal_field_type: properties.append_only must be a boolean");
|
|
217
|
+
}
|
|
218
|
+
const startingContent = present(map, "starting_content");
|
|
219
|
+
if (startingContent !== null && !(startingContent instanceof Uint8Array)) {
|
|
220
|
+
throw new Error("document_proposal_field_type: starting_content must be a CBOR byte string or explicit null");
|
|
221
|
+
}
|
|
222
|
+
const proposedAt = present(map, "proposed_at_ms");
|
|
223
|
+
if (typeof proposedAt !== "number" || !Number.isInteger(proposedAt)) {
|
|
224
|
+
throw new Error(`document_proposal_field_type: proposed_at_ms must be an integer`);
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
type: "document_proposal",
|
|
228
|
+
feature_version: featureVersion,
|
|
229
|
+
proposer_agent_id: str(map, "proposer_agent_id"),
|
|
230
|
+
peer_agent_id: str(map, "peer_agent_id"),
|
|
231
|
+
document_type: str(map, "document_type"),
|
|
232
|
+
properties: {
|
|
233
|
+
assurance_tier: str(p, "assurance_tier"),
|
|
234
|
+
schema_enforcement: schemaEnforcement,
|
|
235
|
+
topology: str(p, "topology"),
|
|
236
|
+
append_only: appendOnly,
|
|
237
|
+
},
|
|
238
|
+
starting_content: startingContent === null ? null : new Uint8Array(startingContent),
|
|
239
|
+
nonce: bytes(map, "nonce"),
|
|
240
|
+
proposed_at_ms: proposedAt,
|
|
241
|
+
signature: bytes(map, "signature"),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=document-proposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-proposal.js","sourceRoot":"","sources":["../src/document-proposal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,kGAAkG;AAClG,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC;AAErE;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,2FAA2F;AAC3F,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,sEAAsE;AACtE,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AA2C3C;;;;;;;;GAQG;AACH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,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC;QAC1B,cAAc,EAAE,UAAU;QAC1B,SAAS,EAAE,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOD-DOC-REJECT-2 — the rejection's signed preimage, and its wire type.
|
|
3
|
+
*
|
|
4
|
+
* A `0x05` rejection leaf has carried a `signature` field since REJECT-1, and nothing defined what
|
|
5
|
+
* that signature was OVER. The field was required — rightly, because an all-zero placeholder in an
|
|
6
|
+
* immutable log is indistinguishable from a real signature that fails to verify — but with no
|
|
7
|
+
* canonical to-be-signed structure it could only ever be filled dishonestly. Writing the
|
|
8
|
+
* composition-root signer is what surfaced it: the only thing available to sign was an empty buffer.
|
|
9
|
+
*
|
|
10
|
+
* ── WHAT A REJECTION HAS TO BIND ──────────────────────────────────────────────────────────────
|
|
11
|
+
*
|
|
12
|
+
* A rejection is a claim with consequences for the other party: they stop retrying, roll back local
|
|
13
|
+
* work, and supersede. So it binds
|
|
14
|
+
*
|
|
15
|
+
* `document_id` — a rejection cannot be moved to another document,
|
|
16
|
+
* `rejected_envelope_hash` — nor to another envelope,
|
|
17
|
+
* `reason` — the sender acts on it, so it must not be substitutable,
|
|
18
|
+
* `rejecting_agent_id` — who refused; the counterpart of the ack's `acker_agent_id`,
|
|
19
|
+
* `round` — which retry this is. Unbound, a captured round-1 rejection replayed
|
|
20
|
+
* twice more would drive a document to `stalled` without the rejecting
|
|
21
|
+
* party ever having refused again.
|
|
22
|
+
*
|
|
23
|
+
* ── WHY IT IS A SEPARATE TYPE FROM THE ACK ────────────────────────────────────────────────────
|
|
24
|
+
*
|
|
25
|
+
* They look similar and are not the same statement. An ACK answers "did you take my envelope" and
|
|
26
|
+
* settles delivery. A REJECTION is a §3.2 protocol act that goes in the log as a leaf, carries a
|
|
27
|
+
* retry round, and is what supersession resolves. One type carrying both would need a mode flag,
|
|
28
|
+
* and a mode flag on a signed structure is how a signature over one meaning gets read as the other.
|
|
29
|
+
*/
|
|
30
|
+
/** Domain tag in slot 0. Distinct from the update, proposal and ack domains. */
|
|
31
|
+
export declare const DOCUMENT_REJECTION_DOMAIN = "CELLO-DOCUMENT-REJECTION-v1";
|
|
32
|
+
/** On the wire, so a version skew is DETECTED rather than surfacing as a signature failure. */
|
|
33
|
+
export declare const DOCUMENT_REJECTION_VERSION = 1;
|
|
34
|
+
/** Peer-controlled display text; capped for the same reason the ack's reason is. */
|
|
35
|
+
export declare const MAX_REJECTION_DETAIL_LENGTH = 500;
|
|
36
|
+
export interface DocumentRejectionEnvelope {
|
|
37
|
+
type: "document_rejection";
|
|
38
|
+
rejection_version: number;
|
|
39
|
+
document_id: string;
|
|
40
|
+
/** The envelope being refused. */
|
|
41
|
+
rejected_envelope_hash: string;
|
|
42
|
+
/** Who refused. The counterpart of the ack's `acker_agent_id`. */
|
|
43
|
+
rejecting_agent_id: string;
|
|
44
|
+
/** The §3.2 machine-readable reason the sender acts on. */
|
|
45
|
+
reason: string;
|
|
46
|
+
detail?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Which retry round this is (1-based). SIGNED, because unbound a captured round-1 rejection
|
|
49
|
+
* replayed twice more drives the document to `stalled` without the rejecting party ever having
|
|
50
|
+
* refused again.
|
|
51
|
+
*/
|
|
52
|
+
round: number;
|
|
53
|
+
rejected_at_ms: number;
|
|
54
|
+
/** Ed25519 (RFC 8032) over `buildDocumentRejectionTbs`. */
|
|
55
|
+
signature: Uint8Array;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The canonical to-be-signed preimage: a fixed-order CBOR ARRAY with the domain in slot 0.
|
|
59
|
+
*
|
|
60
|
+
* An array rather than a map, for the reason `cbor.ts` gives — this encoder is deliberately not
|
|
61
|
+
* deterministic for maps, so a map preimage would make the signature depend on the order the
|
|
62
|
+
* rejecting party happened to build the object in.
|
|
63
|
+
*
|
|
64
|
+
* `detail` is encoded as explicit `null` when absent so the slot is always occupied and no field's
|
|
65
|
+
* meaning depends on whether the one before it was present. The timestamp is coerced to a BigInt
|
|
66
|
+
* past `0xffffffff`, because cbor-x encodes a JS number that large as an IEEE float64 rather than a
|
|
67
|
+
* uint64 — measured on the ack, where it would have made a genuine signature read as a forgery to
|
|
68
|
+
* any implementation encoding canonically.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildDocumentRejectionTbs(env: DocumentRejectionEnvelope, opts?: {
|
|
71
|
+
preHash?: boolean;
|
|
72
|
+
}): Uint8Array;
|
|
73
|
+
/**
|
|
74
|
+
* The rejection's identity — the `0x05` leaf's envelope hash.
|
|
75
|
+
*
|
|
76
|
+
* Over the same preimage that is signed, so the leaf commits to exactly the bytes whose signature
|
|
77
|
+
* was verified, and excludes the signature so re-signing does not orphan anything pointing at it.
|
|
78
|
+
*
|
|
79
|
+
* This replaces REJECT-1's local `sha256("rejection:" + hash + reason + nonce)` construction, which
|
|
80
|
+
* was a placeholder: it bound no signature, no round, and no rejecting party.
|
|
81
|
+
*/
|
|
82
|
+
export declare function documentRejectionHash(env: DocumentRejectionEnvelope): string;
|
|
83
|
+
/** The cross-field rules, applied on BOTH encode and decode so the two cannot drift. */
|
|
84
|
+
export declare function assertDocumentRejectionConsistent(env: DocumentRejectionEnvelope): void;
|
|
85
|
+
export declare function encodeDocumentRejection(env: DocumentRejectionEnvelope): Uint8Array;
|
|
86
|
+
export declare function decodeDocumentRejection(bytes: Uint8Array): DocumentRejectionEnvelope;
|
|
87
|
+
//# sourceMappingURL=document-rejection-envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-rejection-envelope.d.ts","sourceRoot":"","sources":["../src/document-rejection-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,gFAAgF;AAChF,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE,+FAA+F;AAC/F,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAI/C,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,yBAAyB,EAC9B,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,UAAU,CAiBZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,yBAAyB,GAAG,MAAM,CAI5E;AAED,wFAAwF;AACxF,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,yBAAyB,GAAG,IAAI,CActF;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,yBAAyB,GAAG,UAAU,CAclF;AAWD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,yBAAyB,CA8EpF"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOD-DOC-REJECT-2 — the rejection's signed preimage, and its wire type.
|
|
3
|
+
*
|
|
4
|
+
* A `0x05` rejection leaf has carried a `signature` field since REJECT-1, and nothing defined what
|
|
5
|
+
* that signature was OVER. The field was required — rightly, because an all-zero placeholder in an
|
|
6
|
+
* immutable log is indistinguishable from a real signature that fails to verify — but with no
|
|
7
|
+
* canonical to-be-signed structure it could only ever be filled dishonestly. Writing the
|
|
8
|
+
* composition-root signer is what surfaced it: the only thing available to sign was an empty buffer.
|
|
9
|
+
*
|
|
10
|
+
* ── WHAT A REJECTION HAS TO BIND ──────────────────────────────────────────────────────────────
|
|
11
|
+
*
|
|
12
|
+
* A rejection is a claim with consequences for the other party: they stop retrying, roll back local
|
|
13
|
+
* work, and supersede. So it binds
|
|
14
|
+
*
|
|
15
|
+
* `document_id` — a rejection cannot be moved to another document,
|
|
16
|
+
* `rejected_envelope_hash` — nor to another envelope,
|
|
17
|
+
* `reason` — the sender acts on it, so it must not be substitutable,
|
|
18
|
+
* `rejecting_agent_id` — who refused; the counterpart of the ack's `acker_agent_id`,
|
|
19
|
+
* `round` — which retry this is. Unbound, a captured round-1 rejection replayed
|
|
20
|
+
* twice more would drive a document to `stalled` without the rejecting
|
|
21
|
+
* party ever having refused again.
|
|
22
|
+
*
|
|
23
|
+
* ── WHY IT IS A SEPARATE TYPE FROM THE ACK ────────────────────────────────────────────────────
|
|
24
|
+
*
|
|
25
|
+
* They look similar and are not the same statement. An ACK answers "did you take my envelope" and
|
|
26
|
+
* settles delivery. A REJECTION is a §3.2 protocol act that goes in the log as a leaf, carries a
|
|
27
|
+
* retry round, and is what supersession resolves. One type carrying both would need a mode flag,
|
|
28
|
+
* and a mode flag on a signed structure is how a signature over one meaning gets read as the other.
|
|
29
|
+
*/
|
|
30
|
+
import { createHash } from "node:crypto";
|
|
31
|
+
import { encodeCbor, decodeCbor } from "./cbor.js";
|
|
32
|
+
/** Domain tag in slot 0. Distinct from the update, proposal and ack domains. */
|
|
33
|
+
export const DOCUMENT_REJECTION_DOMAIN = "CELLO-DOCUMENT-REJECTION-v1";
|
|
34
|
+
/** On the wire, so a version skew is DETECTED rather than surfacing as a signature failure. */
|
|
35
|
+
export const DOCUMENT_REJECTION_VERSION = 1;
|
|
36
|
+
/** Peer-controlled display text; capped for the same reason the ack's reason is. */
|
|
37
|
+
export const MAX_REJECTION_DETAIL_LENGTH = 500;
|
|
38
|
+
const HEX32 = /^[0-9a-f]{64}$/;
|
|
39
|
+
/**
|
|
40
|
+
* The canonical to-be-signed preimage: a fixed-order CBOR ARRAY with the domain in slot 0.
|
|
41
|
+
*
|
|
42
|
+
* An array rather than a map, for the reason `cbor.ts` gives — this encoder is deliberately not
|
|
43
|
+
* deterministic for maps, so a map preimage would make the signature depend on the order the
|
|
44
|
+
* rejecting party happened to build the object in.
|
|
45
|
+
*
|
|
46
|
+
* `detail` is encoded as explicit `null` when absent so the slot is always occupied and no field's
|
|
47
|
+
* meaning depends on whether the one before it was present. The timestamp is coerced to a BigInt
|
|
48
|
+
* past `0xffffffff`, because cbor-x encodes a JS number that large as an IEEE float64 rather than a
|
|
49
|
+
* uint64 — measured on the ack, where it would have made a genuine signature read as a forgery to
|
|
50
|
+
* any implementation encoding canonically.
|
|
51
|
+
*/
|
|
52
|
+
export function buildDocumentRejectionTbs(env, opts = {}) {
|
|
53
|
+
assertDocumentRejectionConsistent(env);
|
|
54
|
+
const preimage = encodeCbor([
|
|
55
|
+
DOCUMENT_REJECTION_DOMAIN,
|
|
56
|
+
env.rejection_version,
|
|
57
|
+
env.document_id,
|
|
58
|
+
env.rejected_envelope_hash,
|
|
59
|
+
env.rejecting_agent_id,
|
|
60
|
+
env.reason,
|
|
61
|
+
env.detail ?? null,
|
|
62
|
+
env.round,
|
|
63
|
+
typeof env.rejected_at_ms === "number" && env.rejected_at_ms > 0xffffffff
|
|
64
|
+
? BigInt(env.rejected_at_ms)
|
|
65
|
+
: env.rejected_at_ms,
|
|
66
|
+
]);
|
|
67
|
+
if (opts.preHash === false)
|
|
68
|
+
return preimage;
|
|
69
|
+
return new Uint8Array(createHash("sha256").update(preimage).digest());
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The rejection's identity — the `0x05` leaf's envelope hash.
|
|
73
|
+
*
|
|
74
|
+
* Over the same preimage that is signed, so the leaf commits to exactly the bytes whose signature
|
|
75
|
+
* was verified, and excludes the signature so re-signing does not orphan anything pointing at it.
|
|
76
|
+
*
|
|
77
|
+
* This replaces REJECT-1's local `sha256("rejection:" + hash + reason + nonce)` construction, which
|
|
78
|
+
* was a placeholder: it bound no signature, no round, and no rejecting party.
|
|
79
|
+
*/
|
|
80
|
+
export function documentRejectionHash(env) {
|
|
81
|
+
return createHash("sha256")
|
|
82
|
+
.update(buildDocumentRejectionTbs(env, { preHash: false }))
|
|
83
|
+
.digest("hex");
|
|
84
|
+
}
|
|
85
|
+
/** The cross-field rules, applied on BOTH encode and decode so the two cannot drift. */
|
|
86
|
+
export function assertDocumentRejectionConsistent(env) {
|
|
87
|
+
if (env.reason.length === 0) {
|
|
88
|
+
// The sender is being told to stop and supersede; without the reason it cannot know what to
|
|
89
|
+
// change. The whole rejection protocol exists to avoid exactly that.
|
|
90
|
+
throw new Error("document_rejection_reason: a rejection must carry its reason");
|
|
91
|
+
}
|
|
92
|
+
if (!Number.isInteger(env.round) || env.round < 1) {
|
|
93
|
+
throw new Error(`document_rejection_round: must be a positive integer, got ${env.round}`);
|
|
94
|
+
}
|
|
95
|
+
if (env.detail !== undefined && env.detail.length > MAX_REJECTION_DETAIL_LENGTH) {
|
|
96
|
+
throw new Error(`document_rejection_detail: at most ${MAX_REJECTION_DETAIL_LENGTH} characters, got ${env.detail.length}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export function encodeDocumentRejection(env) {
|
|
100
|
+
assertDocumentRejectionConsistent(env);
|
|
101
|
+
return encodeCbor({
|
|
102
|
+
type: env.type,
|
|
103
|
+
rejection_version: env.rejection_version,
|
|
104
|
+
document_id: env.document_id,
|
|
105
|
+
rejected_envelope_hash: env.rejected_envelope_hash,
|
|
106
|
+
rejecting_agent_id: env.rejecting_agent_id,
|
|
107
|
+
reason: env.reason,
|
|
108
|
+
detail: env.detail ?? null,
|
|
109
|
+
round: env.round,
|
|
110
|
+
rejected_at_ms: env.rejected_at_ms,
|
|
111
|
+
signature: env.signature,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function present(map, field) {
|
|
115
|
+
// `in`, not a nullish check — the same discipline as every sibling envelope. A defaulted field is
|
|
116
|
+
// a claim the rejecting party never made.
|
|
117
|
+
if (!(field in map)) {
|
|
118
|
+
throw new Error(`document_rejection_missing_field: ${field} is mandatory and was not present`);
|
|
119
|
+
}
|
|
120
|
+
return map[field];
|
|
121
|
+
}
|
|
122
|
+
export function decodeDocumentRejection(bytes) {
|
|
123
|
+
const decoded = decodeCbor(bytes);
|
|
124
|
+
if (typeof decoded !== "object" || decoded === null || Array.isArray(decoded)) {
|
|
125
|
+
throw new Error("document_rejection_malformed: not a CBOR map");
|
|
126
|
+
}
|
|
127
|
+
const map = decoded;
|
|
128
|
+
if (present(map, "type") !== "document_rejection") {
|
|
129
|
+
throw new Error("document_rejection_type: expected document_rejection");
|
|
130
|
+
}
|
|
131
|
+
const version = present(map, "rejection_version");
|
|
132
|
+
if (typeof version !== "number" || !Number.isInteger(version)) {
|
|
133
|
+
throw new Error("document_rejection_version: must be an integer");
|
|
134
|
+
}
|
|
135
|
+
if (version !== DOCUMENT_REJECTION_VERSION) {
|
|
136
|
+
throw new Error(`document_rejection_version: this build speaks version ${DOCUMENT_REJECTION_VERSION} and the ` +
|
|
137
|
+
`frame declares ${version} — one of the two clients needs upgrading`);
|
|
138
|
+
}
|
|
139
|
+
for (const field of ["document_id", "rejected_envelope_hash"]) {
|
|
140
|
+
const value = present(map, field);
|
|
141
|
+
if (typeof value !== "string" || !HEX32.test(value)) {
|
|
142
|
+
throw new Error(`document_rejection_${field}: must be a 32-byte hex digest`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const rejecting = present(map, "rejecting_agent_id");
|
|
146
|
+
if (typeof rejecting !== "string" || rejecting.length === 0) {
|
|
147
|
+
throw new Error("document_rejection_agent: rejecting_agent_id must be a non-empty text string");
|
|
148
|
+
}
|
|
149
|
+
const reason = present(map, "reason");
|
|
150
|
+
if (typeof reason !== "string") {
|
|
151
|
+
throw new Error("document_rejection_reason: must be a text string");
|
|
152
|
+
}
|
|
153
|
+
const rawDetail = present(map, "detail");
|
|
154
|
+
if (rawDetail !== null && typeof rawDetail !== "string") {
|
|
155
|
+
throw new Error("document_rejection_detail: must be a text string or explicit null");
|
|
156
|
+
}
|
|
157
|
+
// Empty string means ABSENT — the same normalisation the ack needed, for the same reason: a peer
|
|
158
|
+
// in a language where a non-nullable string defaults to "" must not be refused for a field it
|
|
159
|
+
// never filled in.
|
|
160
|
+
const detail = rawDetail === "" ? null : rawDetail;
|
|
161
|
+
const round = present(map, "round");
|
|
162
|
+
if (typeof round !== "number" || !Number.isInteger(round) || round < 1) {
|
|
163
|
+
throw new Error(`document_rejection_round: must be a positive integer, got ${String(round)}`);
|
|
164
|
+
}
|
|
165
|
+
const rejectedAt = present(map, "rejected_at_ms");
|
|
166
|
+
if (typeof rejectedAt !== "number" || !Number.isSafeInteger(rejectedAt) || rejectedAt <= 0) {
|
|
167
|
+
throw new Error("document_rejection_time: rejected_at_ms must be a positive safe integer");
|
|
168
|
+
}
|
|
169
|
+
const signature = present(map, "signature");
|
|
170
|
+
if (!(signature instanceof Uint8Array)) {
|
|
171
|
+
throw new Error("document_rejection_signature: must be a CBOR byte string");
|
|
172
|
+
}
|
|
173
|
+
const env = {
|
|
174
|
+
type: "document_rejection",
|
|
175
|
+
rejection_version: version,
|
|
176
|
+
document_id: map["document_id"],
|
|
177
|
+
rejected_envelope_hash: map["rejected_envelope_hash"],
|
|
178
|
+
rejecting_agent_id: rejecting,
|
|
179
|
+
reason,
|
|
180
|
+
...(detail === null ? {} : { detail }),
|
|
181
|
+
round,
|
|
182
|
+
rejected_at_ms: rejectedAt,
|
|
183
|
+
// COPIED — cbor-x returns byte strings as views into the buffer it decoded.
|
|
184
|
+
signature: new Uint8Array(signature),
|
|
185
|
+
};
|
|
186
|
+
assertDocumentRejectionConsistent(env);
|
|
187
|
+
return env;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=document-rejection-envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-rejection-envelope.js","sourceRoot":"","sources":["../src/document-rejection-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEvE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,oFAAoF;AACpF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,MAAM,KAAK,GAAG,gBAAgB,CAAC;AAwB/B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,yBAAyB,CACvC,GAA8B,EAC9B,OAA8B,EAAE;IAEhC,iCAAiC,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,UAAU,CAAC;QAC1B,yBAAyB;QACzB,GAAG,CAAC,iBAAiB;QACrB,GAAG,CAAC,WAAW;QACf,GAAG,CAAC,sBAAsB;QAC1B,GAAG,CAAC,kBAAkB;QACtB,GAAG,CAAC,MAAM;QACV,GAAG,CAAC,MAAM,IAAI,IAAI;QAClB,GAAG,CAAC,KAAK;QACT,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ,IAAI,GAAG,CAAC,cAAc,GAAG,UAAU;YACvE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;YAC5B,CAAC,CAAC,GAAG,CAAC,cAAc;KACvB,CAAC,CAAC;IACH,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5C,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,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TENT_PARK_AU
|
|
|
28
28
|
export type { SessionLiveness, SessionLivenessQuery, SessionLivenessResponse, } from "./session-liveness.js";
|
|
29
29
|
export { encodeSessionLivenessQuery, decodeSessionLivenessQuery, encodeSessionLivenessResponse, decodeSessionLivenessResponse, } from "./session-liveness.js";
|
|
30
30
|
export { MONIKER_RE, validateMoniker } from "./moniker.js";
|
|
31
|
+
export { DOCUMENT_UPDATE_DOMAIN, DOCUMENT_UPDATE_ENCODING_V1, DOCUMENT_EPOCH_V1, buildDocumentUpdateTbs, encodeDocumentUpdateEnvelope, decodeDocumentUpdateEnvelope, documentEnvelopeHash, verifyDocumentChainLink, } from "./document-envelope.js";
|
|
32
|
+
export type { DocumentUpdateEnvelope } from "./document-envelope.js";
|
|
33
|
+
export { DOCUMENT_PROPOSAL_DOMAIN, DOCUMENT_FEATURE_VERSION, ASSURANCE_TIER_V1, TOPOLOGY_V1, buildDocumentProposalTbs, documentIdFromProposal, encodeDocumentProposal, decodeDocumentProposal, seamViolation, documentFeatureIncompatibility, } from "./document-proposal.js";
|
|
34
|
+
export type { DocumentProposalEnvelope, DocumentProperties, DocumentConsentState, } from "./document-proposal.js";
|
|
35
|
+
export { DOCUMENT_ACK_DOMAIN, buildDocumentAckTbs, encodeDocumentAck, decodeDocumentAck, } from "./document-ack.js";
|
|
36
|
+
export type { DocumentAck } from "./document-ack.js";
|
|
37
|
+
export { encodeDocumentProposalAck, decodeDocumentProposalAck, buildDocumentProposalAckTbs, assertDocumentProposalAckConsistent, DOCUMENT_PROPOSAL_ACK_DOMAIN, DOCUMENT_PROPOSAL_ACK_VERSION, MAX_PROPOSAL_REFUSAL_REASON_LENGTH, } from "./document-proposal-ack.js";
|
|
38
|
+
export type { DocumentProposalAck } from "./document-proposal-ack.js";
|
|
39
|
+
export { encodeDocumentControl, decodeDocumentControl, buildDocumentControlTbs, assertDocumentControlConsistent, DOCUMENT_CONTROL_DOMAIN, DOCUMENT_CONTROL_VERSION, DOCUMENT_CONTROL_VERBS, MAX_CONTROL_REASON_LENGTH, } from "./document-control.js";
|
|
40
|
+
export type { DocumentControl, DocumentControlVerb } from "./document-control.js";
|
|
41
|
+
export { DOCUMENT_REJECTION_DOMAIN, DOCUMENT_REJECTION_VERSION, MAX_REJECTION_DETAIL_LENGTH, buildDocumentRejectionTbs, documentRejectionHash, assertDocumentRejectionConsistent, encodeDocumentRejection, decodeDocumentRejection, } from "./document-rejection-envelope.js";
|
|
42
|
+
export type { DocumentRejectionEnvelope } from "./document-rejection-envelope.js";
|
|
31
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKnD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,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,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,E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B,mCAAmC,EACnC,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,+BAA+B,EAC/B,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,4 +19,10 @@ export { IT_LENGTH_PREFIX_DEFAULT_MAX, CONTENT_PARK_PROTOCOL_ID, CONTENT_PARK_AU
|
|
|
19
19
|
export { encodeSessionLivenessQuery, decodeSessionLivenessQuery, encodeSessionLivenessResponse, decodeSessionLivenessResponse, } from "./session-liveness.js";
|
|
20
20
|
// MONIKER-0 — the single home of the agent-name / moniker charset rule (wire contract).
|
|
21
21
|
export { MONIKER_RE, validateMoniker } from "./moniker.js";
|
|
22
|
+
export { DOCUMENT_UPDATE_DOMAIN, DOCUMENT_UPDATE_ENCODING_V1, DOCUMENT_EPOCH_V1, buildDocumentUpdateTbs, encodeDocumentUpdateEnvelope, decodeDocumentUpdateEnvelope, documentEnvelopeHash, verifyDocumentChainLink, } from "./document-envelope.js";
|
|
23
|
+
export { DOCUMENT_PROPOSAL_DOMAIN, DOCUMENT_FEATURE_VERSION, ASSURANCE_TIER_V1, TOPOLOGY_V1, buildDocumentProposalTbs, documentIdFromProposal, encodeDocumentProposal, decodeDocumentProposal, seamViolation, documentFeatureIncompatibility, } from "./document-proposal.js";
|
|
24
|
+
export { DOCUMENT_ACK_DOMAIN, buildDocumentAckTbs, encodeDocumentAck, decodeDocumentAck, } from "./document-ack.js";
|
|
25
|
+
export { encodeDocumentProposalAck, decodeDocumentProposalAck, buildDocumentProposalAckTbs, assertDocumentProposalAckConsistent, DOCUMENT_PROPOSAL_ACK_DOMAIN, DOCUMENT_PROPOSAL_ACK_VERSION, MAX_PROPOSAL_REFUSAL_REASON_LENGTH, } from "./document-proposal-ack.js";
|
|
26
|
+
export { encodeDocumentControl, decodeDocumentControl, buildDocumentControlTbs, assertDocumentControlConsistent, DOCUMENT_CONTROL_DOMAIN, DOCUMENT_CONTROL_VERSION, DOCUMENT_CONTROL_VERBS, MAX_CONTROL_REASON_LENGTH, } from "./document-control.js";
|
|
27
|
+
export { DOCUMENT_REJECTION_DOMAIN, DOCUMENT_REJECTION_VERSION, MAX_REJECTION_DETAIL_LENGTH, buildDocumentRejectionTbs, documentRejectionHash, assertDocumentRejectionConsistent, encodeDocumentRejection, decodeDocumentRejection, } from "./document-rejection-envelope.js";
|
|
22
28
|
//# 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":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,8FAA8F;AAC9F,wFAAwF;AACxF,2BAA2B;AAC3B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAO3B,+FAA+F;AAC/F,qGAAqG;AACrG,wFAAwF;AACxF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC;AAezB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aA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
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"cbor-x": "^1.6.4",
|
|
29
|
-
"@cello-protocol/crypto": "0.0.
|
|
29
|
+
"@cello-protocol/crypto": "0.0.42"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@claude-flow/testing": "3.0.0-alpha.6",
|