@cello-protocol/daemon 0.0.161 → 0.0.163

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.
Files changed (65) hide show
  1. package/dist/daemon.js +15 -5
  2. package/dist/daemon.js.map +1 -1
  3. package/dist/document-ack-inbound.d.ts +8 -1
  4. package/dist/document-ack-inbound.d.ts.map +1 -1
  5. package/dist/document-ack-inbound.js +31 -8
  6. package/dist/document-ack-inbound.js.map +1 -1
  7. package/dist/document-amendment-store.d.ts +72 -0
  8. package/dist/document-amendment-store.d.ts.map +1 -0
  9. package/dist/document-amendment-store.js +151 -0
  10. package/dist/document-amendment-store.js.map +1 -0
  11. package/dist/document-control-notifier.d.ts +29 -0
  12. package/dist/document-control-notifier.d.ts.map +1 -1
  13. package/dist/document-control-notifier.js +62 -6
  14. package/dist/document-control-notifier.js.map +1 -1
  15. package/dist/document-delivery-transport.d.ts +2 -1
  16. package/dist/document-delivery-transport.d.ts.map +1 -1
  17. package/dist/document-delivery-transport.js +1 -1
  18. package/dist/document-delivery-transport.js.map +1 -1
  19. package/dist/document-delivery.d.ts +6 -1
  20. package/dist/document-delivery.d.ts.map +1 -1
  21. package/dist/document-delivery.js +167 -201
  22. package/dist/document-delivery.js.map +1 -1
  23. package/dist/document-frame-router.d.ts +15 -1
  24. package/dist/document-frame-router.d.ts.map +1 -1
  25. package/dist/document-frame-router.js +22 -1
  26. package/dist/document-frame-router.js.map +1 -1
  27. package/dist/document-gate.js +1 -1
  28. package/dist/document-gate.js.map +1 -1
  29. package/dist/document-handlers.d.ts.map +1 -1
  30. package/dist/document-handlers.js +649 -5
  31. package/dist/document-handlers.js.map +1 -1
  32. package/dist/document-handshake.d.ts +13 -0
  33. package/dist/document-handshake.d.ts.map +1 -1
  34. package/dist/document-handshake.js +24 -0
  35. package/dist/document-handshake.js.map +1 -1
  36. package/dist/document-inbound.d.ts +12 -0
  37. package/dist/document-inbound.d.ts.map +1 -1
  38. package/dist/document-inbound.js +141 -10
  39. package/dist/document-inbound.js.map +1 -1
  40. package/dist/document-join-store.d.ts +80 -0
  41. package/dist/document-join-store.d.ts.map +1 -0
  42. package/dist/document-join-store.js +197 -0
  43. package/dist/document-join-store.js.map +1 -0
  44. package/dist/document-layer.d.ts +52 -2
  45. package/dist/document-layer.d.ts.map +1 -1
  46. package/dist/document-layer.js +457 -12
  47. package/dist/document-layer.js.map +1 -1
  48. package/dist/document-lifecycle.d.ts +32 -1
  49. package/dist/document-lifecycle.d.ts.map +1 -1
  50. package/dist/document-lifecycle.js +88 -20
  51. package/dist/document-lifecycle.js.map +1 -1
  52. package/dist/document-publish.d.ts +7 -0
  53. package/dist/document-publish.d.ts.map +1 -1
  54. package/dist/document-publish.js +20 -4
  55. package/dist/document-publish.js.map +1 -1
  56. package/dist/document-rejection.js +1 -1
  57. package/dist/document-rejection.js.map +1 -1
  58. package/dist/document-store.d.ts +97 -4
  59. package/dist/document-store.d.ts.map +1 -1
  60. package/dist/document-store.js +335 -21
  61. package/dist/document-store.js.map +1 -1
  62. package/dist/vocabulary.d.ts.map +1 -1
  63. package/dist/vocabulary.js +2 -0
  64. package/dist/vocabulary.js.map +1 -1
  65. package/package.json +5 -5
@@ -0,0 +1,80 @@
1
+ /**
2
+ * DOD-MP-JOIN-1 (daemon half) — the join-offer store: pending consent, both roles, settle-once.
3
+ *
4
+ * One table for both sides of a join (the `document_proposals` precedent): the INVITEE holds the
5
+ * offer they received — as RECEIVED BYTES, validated before recording — and the INVITER holds the
6
+ * offer they authored plus the invitee's signed answer when it arrives. Keyed on
7
+ * `(owner, amendment_hash)`: the admitting amendment is the fact being consented to, and a
8
+ * re-invitation after a refusal is a new amendment with a new hash — a new row, never a
9
+ * reopened one.
10
+ *
11
+ * A refused-at-arrival offer (bad chain, wrong invitee, version mismatch) is RECORDED refused
12
+ * with its reason rather than dropped — a dropped offer is indistinguishable from an inviter who
13
+ * never sent one.
14
+ */
15
+ import { type DocumentJoinOffer, type DocumentJoinAnswer } from "@cello-protocol/protocol-types";
16
+ import type { DaemonDatabase } from "./sqlcipher-db.js";
17
+ import type { Logger } from "./types.js";
18
+ export type JoinOfferState = "pending" | "accepted" | "refused";
19
+ export type JoinOfferRole = "invitee" | "inviter";
20
+ export interface JoinOfferRecord {
21
+ documentId: string;
22
+ amendmentHash: string;
23
+ role: JoinOfferRole;
24
+ inviterAgentId: string;
25
+ inviteeAgentId: string;
26
+ offer: DocumentJoinOffer;
27
+ state: JoinOfferState;
28
+ reason: string | null;
29
+ createdAtMs: number;
30
+ decidedAtMs: number | null;
31
+ }
32
+ export declare class DocumentJoinStore {
33
+ #private;
34
+ constructor(db: DaemonDatabase, logger: Logger);
35
+ /**
36
+ * Record an ARRIVING offer under the invitee's key — already validated by the caller; a
37
+ * validation refusal is recorded as `refused` with its reason, never dropped. First arrival's
38
+ * bytes are the permanent record; a redelivery changes nothing.
39
+ */
40
+ recordIncoming(ownerAgentId: string, wire: Uint8Array, amendmentHash: string, verdict: {
41
+ state: "pending";
42
+ } | {
43
+ state: "refused";
44
+ reason: string;
45
+ }, nowMs: number): {
46
+ state: JoinOfferState;
47
+ reason?: string;
48
+ };
49
+ /** Record an offer WE authored, pending the invitee's answer. */
50
+ recordOutgoing(ownerAgentId: string, wire: Uint8Array, amendmentHash: string, nowMs: number): void;
51
+ /**
52
+ * The INVITEE's local decision. Settle-once: only a pending row decides, and the caller learns
53
+ * whether THIS call decided it — an already-decided offer is a fact to report, not an error.
54
+ */
55
+ decide(ownerAgentId: string, amendmentHash: string, accepted: boolean, reason: string | null, nowMs: number): {
56
+ decided: boolean;
57
+ state: JoinOfferState;
58
+ };
59
+ /**
60
+ * Record the invitee's signed ANSWER on the inviter's side. The caller verifies the signature
61
+ * against the invitee named in the STORED offer first. Settle-once: a contradicting second
62
+ * answer is refused with both records retained (the stored answer stands).
63
+ */
64
+ recordAnswer(ownerAgentId: string, wire: Uint8Array, verify: (agentId: string, tbs: Uint8Array, signature: Uint8Array) => boolean, nowMs: number): {
65
+ ok: true;
66
+ answer: DocumentJoinAnswer;
67
+ settled: boolean;
68
+ } | {
69
+ ok: false;
70
+ reason: string;
71
+ };
72
+ get(ownerAgentId: string, amendmentHash: string): JoinOfferRecord | null;
73
+ /** Auto-refused arrivals — surfaced so the refusal sentence reaches an operator. */
74
+ refusedFor(ownerAgentId: string): JoinOfferRecord[];
75
+ /** Offers THIS owner authored — the inviter's view of who has answered what. */
76
+ outgoingFor(ownerAgentId: string): JoinOfferRecord[];
77
+ /** Offers awaiting THIS owner's consent — the inbox surface. */
78
+ pendingFor(ownerAgentId: string): JoinOfferRecord[];
79
+ }
80
+ //# sourceMappingURL=document-join-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-join-store.d.ts","sourceRoot":"","sources":["../src/document-join-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAoBzC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,qBAAa,iBAAiB;;gBAIhB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U,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,EAAE;IAWnD,gFAAgF;IAChF,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,EAAE;IAWpD,gEAAgE;IAChE,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,EAAE;CAUpD"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * DOD-MP-JOIN-1 (daemon half) — the join-offer store: pending consent, both roles, settle-once.
3
+ *
4
+ * One table for both sides of a join (the `document_proposals` precedent): the INVITEE holds the
5
+ * offer they received — as RECEIVED BYTES, validated before recording — and the INVITER holds the
6
+ * offer they authored plus the invitee's signed answer when it arrives. Keyed on
7
+ * `(owner, amendment_hash)`: the admitting amendment is the fact being consented to, and a
8
+ * re-invitation after a refusal is a new amendment with a new hash — a new row, never a
9
+ * reopened one.
10
+ *
11
+ * A refused-at-arrival offer (bad chain, wrong invitee, version mismatch) is RECORDED refused
12
+ * with its reason rather than dropped — a dropped offer is indistinguishable from an inviter who
13
+ * never sent one.
14
+ */
15
+ import { decodeDocumentJoinOffer, decodeDocumentJoinAnswer, buildDocumentJoinAnswerTbs, } from "@cello-protocol/protocol-types";
16
+ const CREATE_SQL = `
17
+ CREATE TABLE IF NOT EXISTS document_join_offers (
18
+ owner_agent_id TEXT NOT NULL,
19
+ document_id TEXT NOT NULL,
20
+ amendment_hash TEXT NOT NULL,
21
+ role TEXT NOT NULL,
22
+ inviter_agent_id TEXT NOT NULL,
23
+ invitee_agent_id TEXT NOT NULL,
24
+ received_bytes BLOB NOT NULL,
25
+ state TEXT NOT NULL,
26
+ reason TEXT,
27
+ answer_bytes BLOB,
28
+ created_at INTEGER NOT NULL,
29
+ decided_at INTEGER,
30
+ PRIMARY KEY (owner_agent_id, amendment_hash)
31
+ );
32
+ `;
33
+ export class DocumentJoinStore {
34
+ #db;
35
+ #logger;
36
+ constructor(db, logger) {
37
+ this.#db = db;
38
+ this.#logger = logger;
39
+ this.#db.exec(CREATE_SQL);
40
+ }
41
+ /**
42
+ * Record an ARRIVING offer under the invitee's key — already validated by the caller; a
43
+ * validation refusal is recorded as `refused` with its reason, never dropped. First arrival's
44
+ * bytes are the permanent record; a redelivery changes nothing.
45
+ */
46
+ recordIncoming(ownerAgentId, wire, amendmentHash, verdict, nowMs) {
47
+ const offer = decodeDocumentJoinOffer(wire);
48
+ this.#db
49
+ .prepare(`INSERT INTO document_join_offers
50
+ (owner_agent_id, document_id, amendment_hash, role, inviter_agent_id, invitee_agent_id,
51
+ received_bytes, state, reason, created_at, decided_at)
52
+ VALUES (?, ?, ?, 'invitee', ?, ?, ?, ?, ?, ?, ?)
53
+ ON CONFLICT (owner_agent_id, amendment_hash) DO NOTHING`)
54
+ .run(ownerAgentId, offer.document_id, amendmentHash, offer.inviter_agent_id, offer.invitee_agent_id, Buffer.from(wire), verdict.state, verdict.state === "refused" ? verdict.reason : null, nowMs, verdict.state === "refused" ? nowMs : null);
55
+ // Read back — on a redelivery the INSERT did nothing and the operator's earlier decision
56
+ // stands; reporting our intended state would announce a decided offer as pending.
57
+ const stored = this.get(ownerAgentId, amendmentHash);
58
+ const state = stored?.state ?? verdict.state;
59
+ const reason = stored?.reason ?? (verdict.state === "refused" ? verdict.reason : undefined);
60
+ this.#logger.info("document.join.offer_recorded", {
61
+ documentId: offer.document_id,
62
+ amendmentHash,
63
+ state,
64
+ });
65
+ return { state, ...(reason ? { reason } : {}) };
66
+ }
67
+ /** Record an offer WE authored, pending the invitee's answer. */
68
+ recordOutgoing(ownerAgentId, wire, amendmentHash, nowMs) {
69
+ const offer = decodeDocumentJoinOffer(wire);
70
+ this.#db
71
+ .prepare(`INSERT INTO document_join_offers
72
+ (owner_agent_id, document_id, amendment_hash, role, inviter_agent_id, invitee_agent_id,
73
+ received_bytes, state, reason, created_at, decided_at)
74
+ VALUES (?, ?, ?, 'inviter', ?, ?, ?, 'pending', NULL, ?, NULL)
75
+ ON CONFLICT (owner_agent_id, amendment_hash) DO NOTHING`)
76
+ .run(ownerAgentId, offer.document_id, amendmentHash, offer.inviter_agent_id, offer.invitee_agent_id, Buffer.from(wire), nowMs);
77
+ }
78
+ /**
79
+ * The INVITEE's local decision. Settle-once: only a pending row decides, and the caller learns
80
+ * whether THIS call decided it — an already-decided offer is a fact to report, not an error.
81
+ */
82
+ decide(ownerAgentId, amendmentHash, accepted, reason, nowMs) {
83
+ const r = this.#db
84
+ .prepare(`UPDATE document_join_offers
85
+ SET state = ?, reason = ?, decided_at = ?
86
+ WHERE owner_agent_id = ? AND amendment_hash = ? AND role = 'invitee' AND state = 'pending'`)
87
+ .run(accepted ? "accepted" : "refused", reason, nowMs, ownerAgentId, amendmentHash);
88
+ const stored = this.get(ownerAgentId, amendmentHash);
89
+ return { decided: (r.changes ?? 0) > 0, state: stored?.state ?? "pending" };
90
+ }
91
+ /**
92
+ * Record the invitee's signed ANSWER on the inviter's side. The caller verifies the signature
93
+ * against the invitee named in the STORED offer first. Settle-once: a contradicting second
94
+ * answer is refused with both records retained (the stored answer stands).
95
+ */
96
+ recordAnswer(ownerAgentId, wire, verify, nowMs) {
97
+ const answer = decodeDocumentJoinAnswer(wire);
98
+ const stored = this.get(ownerAgentId, answer.amendment_hash);
99
+ if (!stored || stored.role !== "inviter") {
100
+ return {
101
+ ok: false,
102
+ reason: `join_answer_unknown_offer: no offer of ours is settled by amendment ` +
103
+ `${answer.amendment_hash.slice(0, 16)}…`,
104
+ };
105
+ }
106
+ if (answer.invitee_agent_id !== stored.inviteeAgentId) {
107
+ return {
108
+ ok: false,
109
+ reason: `join_answer_wrong_invitee: the answer names ${answer.invitee_agent_id} and the ` +
110
+ `offer invited ${stored.inviteeAgentId}`,
111
+ };
112
+ }
113
+ if (!verify(stored.inviteeAgentId, buildDocumentJoinAnswerTbs(answer), answer.signature)) {
114
+ return {
115
+ ok: false,
116
+ reason: `join_answer_signature_invalid: the answer does not verify against the invitee ` +
117
+ `${stored.inviteeAgentId}`,
118
+ };
119
+ }
120
+ if (stored.state !== "pending") {
121
+ const contradicts = (stored.state === "accepted") !== answer.accepted;
122
+ if (contradicts) {
123
+ this.#logger.error("document.join.answer_contradiction", {
124
+ documentId: stored.documentId,
125
+ amendmentHash: answer.amendment_hash,
126
+ stored: stored.state,
127
+ arriving: answer.accepted ? "accepted" : "refused",
128
+ });
129
+ return {
130
+ ok: false,
131
+ reason: "join_answer_contradiction: this offer was already settled with the opposite answer — " +
132
+ "settle once; both signed answers are retained in the log",
133
+ };
134
+ }
135
+ return { ok: true, answer, settled: false };
136
+ }
137
+ this.#db
138
+ .prepare(`UPDATE document_join_offers
139
+ SET state = ?, reason = ?, answer_bytes = ?, decided_at = ?
140
+ WHERE owner_agent_id = ? AND amendment_hash = ? AND state = 'pending'`)
141
+ .run(answer.accepted ? "accepted" : "refused", answer.refusal_reason, Buffer.from(wire), nowMs, ownerAgentId, answer.amendment_hash);
142
+ this.#logger.info("document.join.answer_recorded", {
143
+ documentId: stored.documentId,
144
+ amendmentHash: answer.amendment_hash,
145
+ accepted: answer.accepted,
146
+ });
147
+ return { ok: true, answer, settled: true };
148
+ }
149
+ get(ownerAgentId, amendmentHash) {
150
+ const r = this.#db
151
+ .prepare(`SELECT * FROM document_join_offers WHERE owner_agent_id = ? AND amendment_hash = ?`)
152
+ .get(ownerAgentId, amendmentHash);
153
+ return r ? rowToRecord(r) : null;
154
+ }
155
+ /** Auto-refused arrivals — surfaced so the refusal sentence reaches an operator. */
156
+ refusedFor(ownerAgentId) {
157
+ const rows = this.#db
158
+ .prepare(`SELECT * FROM document_join_offers
159
+ WHERE owner_agent_id = ? AND role = 'invitee' AND state = 'refused'
160
+ ORDER BY created_at ASC`)
161
+ .all(ownerAgentId);
162
+ return rows.map(rowToRecord);
163
+ }
164
+ /** Offers THIS owner authored — the inviter's view of who has answered what. */
165
+ outgoingFor(ownerAgentId) {
166
+ const rows = this.#db
167
+ .prepare(`SELECT * FROM document_join_offers
168
+ WHERE owner_agent_id = ? AND role = 'inviter'
169
+ ORDER BY created_at ASC`)
170
+ .all(ownerAgentId);
171
+ return rows.map(rowToRecord);
172
+ }
173
+ /** Offers awaiting THIS owner's consent — the inbox surface. */
174
+ pendingFor(ownerAgentId) {
175
+ const rows = this.#db
176
+ .prepare(`SELECT * FROM document_join_offers
177
+ WHERE owner_agent_id = ? AND role = 'invitee' AND state = 'pending'
178
+ ORDER BY created_at ASC`)
179
+ .all(ownerAgentId);
180
+ return rows.map(rowToRecord);
181
+ }
182
+ }
183
+ function rowToRecord(r) {
184
+ return {
185
+ documentId: r["document_id"],
186
+ amendmentHash: r["amendment_hash"],
187
+ role: r["role"],
188
+ inviterAgentId: r["inviter_agent_id"],
189
+ inviteeAgentId: r["invitee_agent_id"],
190
+ offer: decodeDocumentJoinOffer(new Uint8Array(r["received_bytes"])),
191
+ state: r["state"],
192
+ reason: r["reason"] ?? null,
193
+ createdAtMs: r["created_at"],
194
+ decidedAtMs: r["decided_at"] ?? null,
195
+ };
196
+ }
197
+ //# sourceMappingURL=document-join-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-join-store.js","sourceRoot":"","sources":["../src/document-join-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,GAG3B,MAAM,gCAAgC,CAAC;AAIxC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;CAgBlB,CAAC;AAkBF,MAAM,OAAO,iBAAiB;IACnB,GAAG,CAAiB;IACpB,OAAO,CAAS;IAEzB,YAAY,EAAkB,EAAE,MAAc;QAC5C,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,cAAc,CACZ,YAAoB,EACpB,IAAgB,EAChB,aAAqB,EACrB,OAAoE,EACpE,KAAa;QAEb,MAAM,KAAK,GAAG,uBAAuB,C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,CAC3B;aACA,GAAG,CAAC,YAAY,CAAmC,CAAC;QACvD,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,SAAS,WAAW,CAAC,CAA0B;IAC7C,OAAO;QACL,UAAU,EAAE,CAAC,CAAC,aAAa,CAAW;QACtC,aAAa,EAAE,CAAC,CAAC,gBAAgB,CAAW;QAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,CAAkB;QAChC,cAAc,EAAE,CAAC,CAAC,kBAAkB,CAAW;QAC/C,cAAc,EAAE,CAAC,CAAC,kBAAkB,CAAW;QAC/C,KAAK,EAAE,uBAAuB,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAe,CAAC,CAAC;QACjF,KAAK,EAAE,CAAC,CAAC,OAAO,CAAmB;QACnC,MAAM,EAAG,CAAC,CAAC,QAAQ,CAAmB,IAAI,IAAI;QAC9C,WAAW,EAAE,CAAC,CAAC,YAAY,CAAW;QACtC,WAAW,EAAG,CAAC,CAAC,YAAY,CAAmB,IAAI,IAAI;KACxD,CAAC;AACJ,CAAC"}
@@ -24,6 +24,8 @@
24
24
  import { DocumentStore } from "./document-store.js";
25
25
  import { DocumentEngine } from "./document-engine.js";
26
26
  import { DocumentRejections } from "./document-rejection.js";
27
+ import { DocumentAmendmentStore } from "./document-amendment-store.js";
28
+ import { DocumentJoinStore } from "./document-join-store.js";
27
29
  import { DocumentFrameRouter } from "./document-frame-router.js";
28
30
  import { LiveDocuments } from "./document-live-docs.js";
29
31
  import { DocumentLifecycle } from "./document-lifecycle.js";
@@ -63,9 +65,13 @@ export interface DocumentLayerDeps {
63
65
  * stands — this is the narrow exception an agent asked for by name.
64
66
  */
65
67
  nudge?(ownerAgentId: string, documentId: string, paths: readonly string[]): void;
66
- /** Tell the peer about a unilateral end. Injected — the transport is not this layer's. */
68
+ /**
69
+ * Tell EVERY current holder about an end. Injected — the transport is not this layer's.
70
+ * Per-holder because a document has N holders (DOD-MP-CONTROL-N-1), not one counterparty.
71
+ */
67
72
  notifyPeer(documentId: string, verb: "kill" | "close"): Promise<{
68
73
  ok: true;
74
+ holdersNotified: Record<string, boolean>;
69
75
  } | {
70
76
  ok: false;
71
77
  reason: string;
@@ -121,6 +127,50 @@ export interface DocumentLayer {
121
127
  lifecycle: DocumentLifecycle;
122
128
  notifications: DocumentNotifications;
123
129
  rejections: DocumentRejections;
130
+ /** M14B — the amendment chain (write path; reads go through `store.currentDocumentEpoch`). */
131
+ amendments: DocumentAmendmentStore;
132
+ /** M14B — join offers pending consent, both roles. */
133
+ joins: DocumentJoinStore;
134
+ /** The layer's one Ed25519 verifier seam — for handlers that run the replay themselves. */
135
+ verifySignature(agentId: string, tbs: Uint8Array, signature: Uint8Array): boolean;
136
+ /** M14B / FANOUT-1 — current holders derived from the chain; null when underivable. */
137
+ holdersFor(ownerAgentId: string, documentId: string): string[] | null;
138
+ /**
139
+ * Who a control frame must be addressed to — everyone but the owner, derived (DOD-MP-CONTROL-N-1).
140
+ * Refuses by name rather than falling back to the genesis peer, which after a removal is the one
141
+ * party the frame must not reach.
142
+ */
143
+ controlHolders(ownerAgentId: string, documentId: string): {
144
+ ok: true;
145
+ holders: readonly string[];
146
+ } | {
147
+ ok: false;
148
+ reason: string;
149
+ };
150
+ isCurrentHolder(ownerAgentId: string, documentId: string, agentId: string): boolean;
151
+ /** M14B / DOD-MP-JOIN-1 — the invitee's consent decisions. Validate-everything-then-mutate. */
152
+ acceptJoin(ownerAgentId: string, amendmentHash: string, nowMs: number): Promise<{
153
+ ok: true;
154
+ documentId: string;
155
+ inviterAgentId: string;
156
+ documentType: string;
157
+ applied: number;
158
+ answerBytes: Uint8Array;
159
+ } | {
160
+ ok: false;
161
+ reason: string;
162
+ detail: string;
163
+ }>;
164
+ refuseJoin(ownerAgentId: string, amendmentHash: string, reason: string | null, nowMs: number): Promise<{
165
+ ok: true;
166
+ documentId: string;
167
+ inviterAgentId: string;
168
+ answerBytes: Uint8Array;
169
+ } | {
170
+ ok: false;
171
+ reason: string;
172
+ detail: string;
173
+ }>;
124
174
  router: DocumentFrameRouter;
125
175
  /**
126
176
  * The hook `SessionNodeManager.setOnDocumentFrame` takes. Handed out ready-shaped so the
@@ -145,7 +195,7 @@ export interface DocumentLayer {
145
195
  * caller, and a waiter that only listened for future events would then wait out the full grace
146
196
  * period on every fast peer.
147
197
  */
148
- awaitAck(ownerAgentId: string, envelopeHash: string, timeoutMs: number): Promise<{
198
+ awaitAck(ownerAgentId: string, envelopeHash: string, expectedAckerAgentId: string, timeoutMs: number): Promise<{
149
199
  admitted: boolean;
150
200
  } | null>;
151
201
  }
@@ -1 +1 @@
1
- {"version":3,"file":"document-layer.d.ts","sourceRoot":"","sources":["../src/document-layer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAmB,MAAM,sBAAsB,CAAC;AAI9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAe7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,cAAc,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;;;OAUG;IACH,YAAY,CAA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