@cello-protocol/daemon 0.0.181 → 0.0.183
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/agent-id-migration.d.ts +9 -0
- package/dist/agent-id-migration.d.ts.map +1 -1
- package/dist/agent-id-migration.js +73 -1
- package/dist/agent-id-migration.js.map +1 -1
- package/dist/agent-selection.d.ts +73 -0
- package/dist/agent-selection.d.ts.map +1 -0
- package/dist/agent-selection.js +80 -0
- package/dist/agent-selection.js.map +1 -0
- package/dist/agent-settings-keys.d.ts.map +1 -1
- package/dist/agent-settings-keys.js +18 -0
- package/dist/agent-settings-keys.js.map +1 -1
- package/dist/assignment-verify.d.ts +62 -0
- package/dist/assignment-verify.d.ts.map +1 -0
- package/dist/assignment-verify.js +185 -0
- package/dist/assignment-verify.js.map +1 -0
- package/dist/backup-restore.d.ts +102 -0
- package/dist/backup-restore.d.ts.map +1 -0
- package/dist/backup-restore.js +340 -0
- package/dist/backup-restore.js.map +1 -0
- package/dist/bin/cello-daemon.js +91 -49
- package/dist/bin/cello-daemon.js.map +1 -1
- package/dist/close-commitment.d.ts +67 -0
- package/dist/close-commitment.d.ts.map +1 -0
- package/dist/close-commitment.js +78 -0
- package/dist/close-commitment.js.map +1 -0
- package/dist/close-session-handler.d.ts +20 -0
- package/dist/close-session-handler.d.ts.map +1 -1
- package/dist/close-session-handler.js +351 -58
- package/dist/close-session-handler.js.map +1 -1
- package/dist/consortium-bootstrap.d.ts +2 -0
- package/dist/consortium-bootstrap.d.ts.map +1 -1
- package/dist/consortium-bootstrap.js +182 -9
- package/dist/consortium-bootstrap.js.map +1 -1
- package/dist/content-encryption-status.d.ts +97 -0
- package/dist/content-encryption-status.d.ts.map +1 -0
- package/dist/content-encryption-status.js +122 -0
- package/dist/content-encryption-status.js.map +1 -0
- package/dist/content-park-client.d.ts +10 -0
- package/dist/content-park-client.d.ts.map +1 -1
- package/dist/content-park-client.js +84 -3
- package/dist/content-park-client.js.map +1 -1
- package/dist/content-park.d.ts.map +1 -1
- package/dist/content-park.js +323 -21
- package/dist/content-park.js.map +1 -1
- package/dist/daemon.d.ts +13 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +1168 -141
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-session-suspects.d.ts.map +1 -1
- package/dist/delivery-session-suspects.js +5 -0
- package/dist/delivery-session-suspects.js.map +1 -1
- package/dist/directory-auth-posture.d.ts +87 -0
- package/dist/directory-auth-posture.d.ts.map +1 -0
- package/dist/directory-auth-posture.js +134 -0
- package/dist/directory-auth-posture.js.map +1 -0
- package/dist/directory-bootstrap.d.ts +66 -3
- package/dist/directory-bootstrap.d.ts.map +1 -1
- package/dist/directory-bootstrap.js +133 -7
- package/dist/directory-bootstrap.js.map +1 -1
- package/dist/document-delivery-transport.d.ts +22 -2
- package/dist/document-delivery-transport.d.ts.map +1 -1
- package/dist/document-delivery-transport.js +11 -3
- package/dist/document-delivery-transport.js.map +1 -1
- package/dist/document-handlers.d.ts.map +1 -1
- package/dist/document-handlers.js +119 -0
- package/dist/document-handlers.js.map +1 -1
- package/dist/document-layer.d.ts +0 -2
- package/dist/document-layer.d.ts.map +1 -1
- package/dist/document-layer.js.map +1 -1
- package/dist/inbound-sessions.d.ts +31 -1
- package/dist/inbound-sessions.d.ts.map +1 -1
- package/dist/inbound-sessions.js +276 -16
- package/dist/inbound-sessions.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/initiate-session-handler.d.ts.map +1 -1
- package/dist/initiate-session-handler.js +34 -3
- package/dist/initiate-session-handler.js.map +1 -1
- package/dist/ipc-server.d.ts +5 -1
- package/dist/ipc-server.d.ts.map +1 -1
- package/dist/ipc-server.js +19 -3
- package/dist/ipc-server.js.map +1 -1
- package/dist/manifest-deps.d.ts +0 -11
- package/dist/manifest-deps.d.ts.map +1 -1
- package/dist/manifest-deps.js +28 -2
- package/dist/manifest-deps.js.map +1 -1
- package/dist/manifest-validity.d.ts +153 -0
- package/dist/manifest-validity.d.ts.map +1 -0
- package/dist/manifest-validity.js +268 -0
- package/dist/manifest-validity.js.map +1 -0
- package/dist/notification-handlers.d.ts.map +1 -1
- package/dist/notification-handlers.js +15 -0
- package/dist/notification-handlers.js.map +1 -1
- package/dist/outbound-sessions.d.ts +31 -0
- package/dist/outbound-sessions.d.ts.map +1 -1
- package/dist/outbound-sessions.js +217 -17
- package/dist/outbound-sessions.js.map +1 -1
- package/dist/park-envelope.d.ts +95 -1
- package/dist/park-envelope.d.ts.map +1 -1
- package/dist/park-envelope.js +195 -4
- package/dist/park-envelope.js.map +1 -1
- package/dist/refusal-reasons.d.ts +72 -0
- package/dist/refusal-reasons.d.ts.map +1 -0
- package/dist/refusal-reasons.js +69 -0
- package/dist/refusal-reasons.js.map +1 -0
- package/dist/register-handler.d.ts.map +1 -1
- package/dist/register-handler.js +76 -0
- package/dist/register-handler.js.map +1 -1
- package/dist/registration-manager.d.ts.map +1 -1
- package/dist/registration-manager.js +20 -1
- package/dist/registration-manager.js.map +1 -1
- package/dist/relay-only.d.ts +133 -0
- package/dist/relay-only.d.ts.map +1 -0
- package/dist/relay-only.js +183 -0
- package/dist/relay-only.js.map +1 -0
- package/dist/restart-seal-resolver.d.ts.map +1 -1
- package/dist/restart-seal-resolver.js +6 -0
- package/dist/restart-seal-resolver.js.map +1 -1
- package/dist/retry-queue.d.ts +49 -2
- package/dist/retry-queue.d.ts.map +1 -1
- package/dist/retry-queue.js +55 -10
- package/dist/retry-queue.js.map +1 -1
- package/dist/roster-freshness.d.ts +169 -0
- package/dist/roster-freshness.d.ts.map +1 -0
- package/dist/roster-freshness.js +249 -0
- package/dist/roster-freshness.js.map +1 -0
- package/dist/seal-certificate-pull.d.ts +17 -1
- package/dist/seal-certificate-pull.d.ts.map +1 -1
- package/dist/seal-certificate-pull.js +37 -3
- package/dist/seal-certificate-pull.js.map +1 -1
- package/dist/seal-coordinator.d.ts +17 -1
- package/dist/seal-coordinator.d.ts.map +1 -1
- package/dist/seal-coordinator.js +71 -0
- package/dist/seal-coordinator.js.map +1 -1
- package/dist/seal-failure-store.d.ts +104 -0
- package/dist/seal-failure-store.d.ts.map +1 -0
- package/dist/seal-failure-store.js +126 -0
- package/dist/seal-failure-store.js.map +1 -0
- package/dist/seal-flows.d.ts.map +1 -1
- package/dist/seal-flows.js +35 -6
- package/dist/seal-flows.js.map +1 -1
- package/dist/seal-upgrade.d.ts +20 -5
- package/dist/seal-upgrade.d.ts.map +1 -1
- package/dist/seal-upgrade.js +28 -5
- package/dist/seal-upgrade.js.map +1 -1
- package/dist/session-assignment-parser.d.ts +41 -5
- package/dist/session-assignment-parser.d.ts.map +1 -1
- package/dist/session-assignment-parser.js +77 -14
- package/dist/session-assignment-parser.js.map +1 -1
- package/dist/session-ceremony.d.ts +35 -0
- package/dist/session-ceremony.d.ts.map +1 -1
- package/dist/session-ceremony.js +97 -0
- package/dist/session-ceremony.js.map +1 -1
- package/dist/session-connection-gater.d.ts +46 -7
- package/dist/session-connection-gater.d.ts.map +1 -1
- package/dist/session-connection-gater.js +163 -12
- package/dist/session-connection-gater.js.map +1 -1
- package/dist/session-content-handlers.d.ts +12 -0
- package/dist/session-content-handlers.d.ts.map +1 -1
- package/dist/session-content-handlers.js +149 -8
- package/dist/session-content-handlers.js.map +1 -1
- package/dist/session-node-manager.d.ts +653 -40
- package/dist/session-node-manager.d.ts.map +1 -1
- package/dist/session-node-manager.js +5938 -374
- package/dist/session-node-manager.js.map +1 -1
- package/dist/session-read-handlers.d.ts +27 -0
- package/dist/session-read-handlers.d.ts.map +1 -1
- package/dist/session-read-handlers.js +127 -6
- package/dist/session-read-handlers.js.map +1 -1
- package/dist/session-relay-client.d.ts +177 -2
- package/dist/session-relay-client.d.ts.map +1 -1
- package/dist/session-relay-client.js +564 -16
- package/dist/session-relay-client.js.map +1 -1
- package/dist/session-salt-agreement.d.ts +338 -0
- package/dist/session-salt-agreement.d.ts.map +1 -0
- package/dist/session-salt-agreement.js +478 -0
- package/dist/session-salt-agreement.js.map +1 -0
- package/dist/signal-submission.d.ts.map +1 -1
- package/dist/signal-submission.js +10 -1
- package/dist/signal-submission.js.map +1 -1
- package/dist/signaling-connect.d.ts +18 -1
- package/dist/signaling-connect.d.ts.map +1 -1
- package/dist/signaling-connect.js +206 -6
- package/dist/signaling-connect.js.map +1 -1
- package/dist/types.d.ts +75 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +10 -0
- package/dist/vocabulary.js.map +1 -1
- package/dist/wire-content-hash.d.ts +68 -0
- package/dist/wire-content-hash.d.ts.map +1 -1
- package/dist/wire-content-hash.js +83 -0
- package/dist/wire-content-hash.js.map +1 -1
- package/package.json +5 -5
|
@@ -15,6 +15,7 @@ import type { SessionNodeManager } from "./session-node-manager.js";
|
|
|
15
15
|
import type { Logger } from "./types.js";
|
|
16
16
|
import type { ConnState } from "./contact-handlers.js";
|
|
17
17
|
import { type FrontierMismatchStore } from "./frontier-mismatch.js";
|
|
18
|
+
import { type SealFailure } from "./seal-failure-store.js";
|
|
18
19
|
export interface SessionReadDeps {
|
|
19
20
|
/** DOD-FRONTIER-STRAND-1 AC3: retained mismatches, surfaced on the session LIST (the AC's surface). */
|
|
20
21
|
frontierMismatches: FrontierMismatchStore;
|
|
@@ -32,6 +33,31 @@ export interface SessionReadDeps {
|
|
|
32
33
|
who: string;
|
|
33
34
|
whoKnown: boolean;
|
|
34
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Is a seal ceremony in flight for this session — `DOD-M15-CLOSEWAIT-1` review HIGH-2.
|
|
38
|
+
*
|
|
39
|
+
* `cello_status` has carried this since `DOD-M12B-CLOSE-SILENT-WAIT-1`; the session LIST never
|
|
40
|
+
* did, and before CLOSEWAIT-1 nobody could observe the gap because the caller was blocked for the
|
|
41
|
+
* whole ceremony. Now "committed, notarizing in the background" is the normal state for up to
|
|
42
|
+
* eleven minutes — and without this the agent's own session list is byte-identical to a session it
|
|
43
|
+
* never closed. The likely agent response is to close again, which lands on a refusal.
|
|
44
|
+
*
|
|
45
|
+
* The DoD's own counterbalance clause requires it: *"the session must keep reading as sealing
|
|
46
|
+
* until it is not."*
|
|
47
|
+
*/
|
|
48
|
+
isSealing: (agentName: string, sessionId: string) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* DOD-M15-SEAL-FAILED-TERMINAL-1: the last background ceremony failure, if one is remembered.
|
|
51
|
+
*
|
|
52
|
+
* Checked AFTER `isSealing` — a running ceremony outranks an old verdict, because a re-close is
|
|
53
|
+
* the remedy and its marker is cleared on start.
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* REQUIRED — review HIGH-3. As an optional dep, deleting the daemon's wiring for it left tests,
|
|
57
|
+
* lint and typecheck green while the whole unit was inert. One composition root; make the
|
|
58
|
+
* compiler catch it.
|
|
59
|
+
*/
|
|
60
|
+
getSealFailure: (agentName: string, sessionId: string) => SealFailure | undefined;
|
|
35
61
|
/** Never vaults a cursor/watermark past a hole in the delivered sequence. */
|
|
36
62
|
safeCursorAdvance: (connectionId: string, sessionId: string, deliveredSeqs: ReadonlySet<number>) => void;
|
|
37
63
|
safeWatermarkAdvance: (agentName: string, sessionId: string, deliveredSeqs: ReadonlySet<number>) => void;
|
|
@@ -54,6 +80,7 @@ export interface SessionReadDeps {
|
|
|
54
80
|
pullSealCertificate?: (agentName: string, sessionIdHex: string) => Promise<{
|
|
55
81
|
ok: boolean;
|
|
56
82
|
reason?: string;
|
|
83
|
+
verified?: boolean;
|
|
57
84
|
}>;
|
|
58
85
|
}
|
|
59
86
|
export declare function registerSessionReadHandlers(deps: SessionReadDeps): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-read-handlers.d.ts","sourceRoot":"","sources":["../src/session-read-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GA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|
2
2
|
import { validateSessionName } from "./session-name.js";
|
|
3
3
|
import { renderFrontierMismatch } from "./frontier-mismatch.js";
|
|
4
|
+
import { describeSealFailed } from "./seal-failure-store.js";
|
|
5
|
+
import { contentEncryptionGuidanceFor } from "./content-encryption-status.js";
|
|
4
6
|
export function registerSessionReadHandlers(deps) {
|
|
5
|
-
const { handlers, logger, sessionNodeManager, loadedAgents, getConnState, resolveCurrentAgent, NO_CURRENT_AGENT_RESPONSE, resolveWho, safeCursorAdvance, safeWatermarkAdvance, attendanceCount, reapDeadHalfOpenSessions, frontierMismatches, } = deps;
|
|
7
|
+
const { handlers, logger, sessionNodeManager, loadedAgents, getConnState, resolveCurrentAgent, NO_CURRENT_AGENT_RESPONSE, resolveWho, safeCursorAdvance, safeWatermarkAdvance, attendanceCount, reapDeadHalfOpenSessions, frontierMismatches, isSealing, getSealFailure, } = deps;
|
|
6
8
|
// ─── M7-SESSION-004 (AC-005/AC-006): read the sealed certificate's legibility ───
|
|
7
9
|
// The cert-read surface: returns the receipt-not-assent certificate for a sealed session —
|
|
8
10
|
// per-party content frontiers, attestation modes, and whether the final message was answered.
|
|
@@ -44,12 +46,30 @@ export function registerSessionReadHandlers(deps) {
|
|
|
44
46
|
// (content AND the control leaves the seal itself appends). `content_leaf_count` is the
|
|
45
47
|
// messages, and it is the one comparable to a transcript length — conflating them would make
|
|
46
48
|
// the check drift by the number of ctrl leaves and read as a defect when nothing is wrong.
|
|
47
|
-
const
|
|
49
|
+
const tree = sessionNodeManager.getSessionTree(agentName, sessionId);
|
|
50
|
+
const leaves = tree.leaves();
|
|
48
51
|
return {
|
|
49
52
|
ok: true,
|
|
50
53
|
session_id: sessionId,
|
|
51
54
|
session_name: sessionName,
|
|
52
55
|
sealed_root: cert.sealed_root,
|
|
56
|
+
/**
|
|
57
|
+
* DOD-M15-SEALWIRE-1 bullet 8: THIS SIDE'S OWN ROOT, computed from its own leaves — never
|
|
58
|
+
* copied from the certificate.
|
|
59
|
+
*
|
|
60
|
+
* `sealed_root` above is the CERTIFICATE's root. Every spine journey asserted that both
|
|
61
|
+
* parties' `sealed_root` matched, and that assertion is hollow: both sides read the same
|
|
62
|
+
* field out of the same certificate, so it stays green **even if the directory certified a
|
|
63
|
+
* root over a completely different leaf set than the one either party actually holds**. It
|
|
64
|
+
* proves the two clients received identical bytes, which was never the question.
|
|
65
|
+
*
|
|
66
|
+
* The question is whether the certificate covers THIS party's conversation. Only a root
|
|
67
|
+
* derived locally can answer that, and until now nothing exposed one — so no test could
|
|
68
|
+
* make the assertion, which is why ten of them made the weaker one instead.
|
|
69
|
+
*
|
|
70
|
+
* Read-only and derived: `rootHex()` recomputes from the stored leaves.
|
|
71
|
+
*/
|
|
72
|
+
local_tree_root: tree.rootHex(),
|
|
53
73
|
leaf_count: leaves.length,
|
|
54
74
|
content_leaf_count: leaves.filter((l) => l.kind === "msg").length,
|
|
55
75
|
legibility: cert.legibility,
|
|
@@ -65,8 +85,18 @@ export function registerSessionReadHandlers(deps) {
|
|
|
65
85
|
// apart: the session genuinely has not sealed, or it sealed and the `session_sealed` push never
|
|
66
86
|
// reached this daemon. The second is the divergence, and answering `not_sealed_yet` for it is
|
|
67
87
|
// how an operator got sent round the loop into a force-abandon that destroyed their half of a
|
|
68
|
-
// receipt that existed. The pull is what distinguishes them — and it
|
|
69
|
-
//
|
|
88
|
+
// receipt that existed. The pull is what distinguishes them — and it does so by fetching a
|
|
89
|
+
// certificate rather than trusting an answer.
|
|
90
|
+
//
|
|
91
|
+
// ⚠️ IT DOES NOT ALWAYS VERIFY IT, and this comment used to say it did (review N3). The pull
|
|
92
|
+
// refuses a certificate whose signature FAILS. It ACCEPTS one whose signature it cannot check
|
|
93
|
+
// at all — when this daemon holds no key for the signer — and that case stopped being rare
|
|
94
|
+
// once `cello_contact_remove` began clearing a counterparty's pinned identity.
|
|
95
|
+
//
|
|
96
|
+
// Logging that was not enough (review F5). The response below is what the AGENT reads, and it
|
|
97
|
+
// used to be byte-for-byte identical either way — so an operator could clear a contact, pull
|
|
98
|
+
// an old receipt, and hand it to a third party as proof. It is not proof. `verified` now rides
|
|
99
|
+
// on the response, with guidance naming the way back.
|
|
70
100
|
if (deps.pullSealCertificate) {
|
|
71
101
|
const pulled = await deps.pullSealCertificate(agentName, sessionId);
|
|
72
102
|
if (pulled.ok) {
|
|
@@ -86,15 +116,64 @@ export function registerSessionReadHandlers(deps) {
|
|
|
86
116
|
leaf_count: recoveredLeaves.length,
|
|
87
117
|
content_leaf_count: recoveredLeaves.filter((l) => l.kind === "msg").length,
|
|
88
118
|
legibility: recovered.legibility,
|
|
119
|
+
verified: pulled.verified === true,
|
|
120
|
+
...(pulled.verified === true
|
|
121
|
+
? {}
|
|
122
|
+
: {
|
|
123
|
+
verification_note: "THIS RECEIPT'S SIGNATURE WAS NOT CHECKED. It was recovered from the directory " +
|
|
124
|
+
"and recorded on the counterparty's word, because this agent holds no signing " +
|
|
125
|
+
"key for them — most often because their pinned identity was cleared with " +
|
|
126
|
+
"cello_contact_remove. Do not present it to a third party as proof.",
|
|
127
|
+
guidance: "To get a verifiable receipt: start a new session with them, which re-pins " +
|
|
128
|
+
"their identity, then ask them to re-seal. Nothing is wrong with the session " +
|
|
129
|
+
"itself — only with what this side can independently prove about it.",
|
|
130
|
+
}),
|
|
89
131
|
};
|
|
90
132
|
}
|
|
91
133
|
}
|
|
92
134
|
}
|
|
93
|
-
|
|
135
|
+
/**
|
|
136
|
+
* IS THE CEREMONY STILL RUNNING? — `DOD-M15-CLOSEWAIT-1` review HIGH-1.
|
|
137
|
+
*
|
|
138
|
+
* `not_sealed_yet` used to mean one thing, because the close blocked until the ceremony ended:
|
|
139
|
+
* if you were reading this, nothing was in flight. CLOSEWAIT-1 made "committed, notarizing in
|
|
140
|
+
* the background" the normal state for up to eleven minutes, and this answer could not tell
|
|
141
|
+
* that apart from "it finished and failed" — while the daemon knew, in the very maps
|
|
142
|
+
* `cello_status` already reads.
|
|
143
|
+
*
|
|
144
|
+
* Worse, the remedy below became UNREACHABLE by the same change: it says *"close it and
|
|
145
|
+
* confirm it reports sealed"*, and a close can no longer report sealed on this path. The two
|
|
146
|
+
* surfaces contradicted each other — the close said an empty answer means "still running, not
|
|
147
|
+
* failed", this one called it a known daemon defect.
|
|
148
|
+
*/
|
|
149
|
+
if (isSealing(agentName, sessionId)) {
|
|
150
|
+
return {
|
|
151
|
+
ok: false,
|
|
152
|
+
reason: "seal_in_progress",
|
|
153
|
+
seal_status: "committed",
|
|
154
|
+
guidance: "The seal ceremony for this session is RUNNING RIGHT NOW — this is not a failure and " +
|
|
155
|
+
"there is nothing to retry. Your SEAL commitment is recorded; the receipt appears here " +
|
|
156
|
+
"once the counterparty co-closes, or after the escalation to a unilateral seal. Wait and " +
|
|
157
|
+
"call cello_sealed_receipt again. Do NOT close again (it will be refused as already in " +
|
|
158
|
+
"progress) and do NOT use { force: true } — forcing ABANDONS the session and forfeits " +
|
|
159
|
+
"the receipt this ceremony is about to produce.",
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* DOD-M15-SEAL-FAILED-TERMINAL-1 — a ceremony that DIED, which is neither of the two states
|
|
164
|
+
* above. Ordering is load-bearing: `isSealing` was checked first, so a re-close that started a
|
|
165
|
+
* fresh ceremony reports as running rather than as the old failure.
|
|
166
|
+
*/
|
|
167
|
+
const failure = getSealFailure(agentName, sessionId);
|
|
168
|
+
if (failure)
|
|
169
|
+
return describeSealFailed({ sessionId, failure });
|
|
170
|
+
// The session is THIS agent's — it simply has no seal certificate yet, no ceremony is running
|
|
171
|
+
// for it, and none is remembered as having failed.
|
|
94
172
|
return {
|
|
95
173
|
ok: false,
|
|
96
174
|
reason: "not_sealed_yet",
|
|
97
|
-
guidance: "This session exists but is not sealed yet
|
|
175
|
+
guidance: "This session exists but is not sealed yet, and no seal ceremony is currently running for it. " +
|
|
176
|
+
"Close it with cello_close_session (it will answer immediately with seal_status \"committed\" and notarize in the background), then retry this once that finishes. " +
|
|
98
177
|
"IF cello_close_session ALREADY reported session_already_sealed, do not close again — both answers are true and they point at each other. The seal completion never reached this side, so no local certificate exists and none can be produced here. " +
|
|
99
178
|
"Do NOT use { force: true } to break out: it PERMANENTLY forfeits this side's half, and a receipt you cannot yet verify is still recoverable where a forfeited one never is. Leave the session as it is and tell the operator the session id and the counterparty's pubkey — this is a known daemon defect (the seal completion is pushed with no pull twin), not an error they caused.",
|
|
100
179
|
};
|
|
@@ -227,6 +306,23 @@ export function registerSessionReadHandlers(deps) {
|
|
|
227
306
|
...resolveWho(row.agent_name, row.counterparty_pubkey, row.session_id),
|
|
228
307
|
status: row.status,
|
|
229
308
|
category,
|
|
309
|
+
// DOD-M15-REFUSED-INBOUND-SILENT-1: surfaced only when NOT salted. `selectSessions` is a
|
|
310
|
+
// WHITELIST — adding the field to the session record alone left it invisible here, which is
|
|
311
|
+
// the no-reader defect this whole line is about, reproduced inside the fix for it.
|
|
312
|
+
...(row.content_hashes_salted === false ? { contentHashesSalted: false } : {}),
|
|
313
|
+
// 006-CRYPTO: same whitelist, same trap — a field on the record alone never reaches the agent.
|
|
314
|
+
// Carries the GUIDANCE, not the reason code: the code is for a log, and an agent reading this
|
|
315
|
+
// has to be able to tell an operator what it means without looking anything up.
|
|
316
|
+
...(row.content_encrypted === false
|
|
317
|
+
? {
|
|
318
|
+
contentEncrypted: false,
|
|
319
|
+
...(row.content_encryption_reason
|
|
320
|
+
? { contentEncryptionGuidance: contentEncryptionGuidanceFor(row.content_encryption_reason) }
|
|
321
|
+
: {}),
|
|
322
|
+
}
|
|
323
|
+
: {}),
|
|
324
|
+
// Review HIGH-2: present only while a ceremony is actually in flight, so it stays a signal.
|
|
325
|
+
...(isSealing(row.agent_name, row.session_id) ? { sealing: true } : {}),
|
|
230
326
|
messageCount,
|
|
231
327
|
createdAt: new Date(row.created_at).toISOString(),
|
|
232
328
|
updatedAt: new Date(row.updated_at).toISOString(),
|
|
@@ -243,6 +339,31 @@ export function registerSessionReadHandlers(deps) {
|
|
|
243
339
|
const m = frontierMismatches.get(row.agent_name, row.session_id);
|
|
244
340
|
return m ? { frontierMismatch: renderFrontierMismatch(m, row.session_id) } : {};
|
|
245
341
|
})(),
|
|
342
|
+
/**
|
|
343
|
+
* `DOD-M15-SEALWIRE-1` — THE STATE THE INVARIANT ASKED FOR, and it is a FIELD, not an alert.
|
|
344
|
+
*
|
|
345
|
+
* B2b-2 turned salting on. When a session cannot agree a salt it falls back to the hashing
|
|
346
|
+
* every shipped build uses and logs `session.content.unsalted` once — which satisfies the
|
|
347
|
+
* "loud in the log" half of the invariant and nothing at all of the "and in the agent
|
|
348
|
+
* response" half. An operator reading tool output had no way to tell a protected conversation
|
|
349
|
+
* from an unprotected one.
|
|
350
|
+
*
|
|
351
|
+
* ⚠️ PRESENT ON EVERY ROW, INCLUDING THE TRUE ONE — the one place this list breaks its own
|
|
352
|
+
* present-only-when-interesting convention (`sealing`, `frontierMismatch`), and deliberately.
|
|
353
|
+
* Those two say *something is happening*; absence means nothing is. This says *what protects
|
|
354
|
+
* this conversation*, and for that, absence is unreadable: a missing field on an older daemon
|
|
355
|
+
* and a missing field meaning "unprotected" would look identical, which is the collapse
|
|
356
|
+
* Decision #15 spends a whole wire discriminator avoiding. A security property must not be
|
|
357
|
+
* inferable from a gap.
|
|
358
|
+
*
|
|
359
|
+
* Deliberately NOT urgent, per the DoD: an unsalted session is exactly as verifiable as every
|
|
360
|
+
* session shipped before the feature existed. This is the difference between *knowing* and
|
|
361
|
+
* *working*, and it costs one boolean per row rather than an event per message.
|
|
362
|
+
*/
|
|
363
|
+
// `isContentSaltActive`, NOT `getSessionContentSalt` — pass 2, F3. Possession is not
|
|
364
|
+
// protection: a SUSPENDED session still holds its salt and deliberately does not use it, so
|
|
365
|
+
// the possession read reported `true` for a session hashing sha256 on every message.
|
|
366
|
+
contentSalted: sessionNodeManager.isContentSaltActive(row.agent_name, row.session_id),
|
|
246
367
|
}));
|
|
247
368
|
return { ok: true, filter, limit, totalMatched: matched.length, sessions };
|
|
248
369
|
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
|
|
@@ -24,6 +24,37 @@ export declare const RELAY_AUTH_DOMAIN = "CELLO-RELAY-AUTH-v1";
|
|
|
24
24
|
export declare const TERMINAL_RELAY_REFUSALS: ReadonlySet<string>;
|
|
25
25
|
/** True when the relay has ended this session and no later submit can succeed. */
|
|
26
26
|
export declare function isTerminalRelayRefusal(reason: string | undefined): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* DOD-M15-RELAYSLOTS-1 — why a relay refused to let this agent hold a reservation slot, in the
|
|
29
|
+
* shape the daemon and the operator both need.
|
|
30
|
+
*
|
|
31
|
+
* `reason` is the relay's own code, unmodified. `advice` is what the person reading it should DO,
|
|
32
|
+
* chosen for that specific cause. `tryAnotherRelay` is the machine half of the same question.
|
|
33
|
+
*/
|
|
34
|
+
export interface RelayAuthRefusal {
|
|
35
|
+
reason: string;
|
|
36
|
+
advice: string;
|
|
37
|
+
tryAnotherRelay: boolean;
|
|
38
|
+
/** Present when the relay said how many slots are held and what its cap is. */
|
|
39
|
+
slotsHeld?: number;
|
|
40
|
+
slotCap?: number;
|
|
41
|
+
/** Present when the relay said when to come back. */
|
|
42
|
+
retryAfterMs?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Classify a relay's auth refusal: what to tell the operator, and whether another relay would help.
|
|
46
|
+
*
|
|
47
|
+
* Everything not in `RELAY_SIDE_REFUSALS` defaults to "do not try another", and that default is the
|
|
48
|
+
* safe direction. A token problem reproduces identically on every relay in the fleet, so retrying
|
|
49
|
+
* around the fleet spends real time turning a client fault into an apparent outage — and a slot cap
|
|
50
|
+
* IS satisfiable elsewhere, but spreading to another relay papers over sessions that leaked and
|
|
51
|
+
* brings the same wall back on the next one.
|
|
52
|
+
*/
|
|
53
|
+
export declare function classifyRelayAuthRefusal(reason: string, extra?: {
|
|
54
|
+
slotsHeld?: number;
|
|
55
|
+
slotCap?: number;
|
|
56
|
+
retryAfterMs?: number;
|
|
57
|
+
}): RelayAuthRefusal;
|
|
27
58
|
export declare const LEAF_KIND_MSG = 0;
|
|
28
59
|
/** Control leaf (SEAL etc.) — two distinct-sender ctrl leaves trigger directory notarization. */
|
|
29
60
|
export declare const LEAF_KIND_CTRL = 2;
|
|
@@ -63,9 +94,44 @@ export type SubmitResult = {
|
|
|
63
94
|
sequence_number: number;
|
|
64
95
|
structure1_cbor?: Uint8Array;
|
|
65
96
|
structure2_cbor?: Uint8Array;
|
|
97
|
+
/**
|
|
98
|
+
* DOD-M15-SEALWIRE-1 bullet 5, SENT half — OUR signature over `structure1_cbor`.
|
|
99
|
+
*
|
|
100
|
+
* It is already computed on the submit path (`keyProvider.sign(structure1)`) and put on the
|
|
101
|
+
* wire as `sender_signature`; it simply was not handed back, so the transcript row for a
|
|
102
|
+
* message THIS agent sent stored no proof of authorship at all.
|
|
103
|
+
*
|
|
104
|
+
* Why that matters and is not symmetry for its own sake: a RECEIVED row carries the
|
|
105
|
+
* counterparty's pubkey and signature, so a third party can check it. A SENT row carried
|
|
106
|
+
* `attribution: "self_authored"` and nothing else — fine for its owner, who already knows, and
|
|
107
|
+
* **worth nothing to the auditor the bullet exists for.** Half a transcript was provable.
|
|
108
|
+
*
|
|
109
|
+
* Undefined on the relay-degraded path, where no submit happens and there is nothing to sign.
|
|
110
|
+
*/
|
|
111
|
+
sender_signature?: Uint8Array;
|
|
66
112
|
} | {
|
|
67
113
|
ok: false;
|
|
68
114
|
reason: string;
|
|
115
|
+
/**
|
|
116
|
+
* The relay's own words about what went wrong — `relay-types.ts`'s stated invariant is
|
|
117
|
+
* *"`reason` is the class, `detail` is what happened."*
|
|
118
|
+
*
|
|
119
|
+
* ⚠️ THAT INVARIANT HAD NEVER BEEN TRUE END TO END. The relay composed a `detail` on every
|
|
120
|
+
* `hash_submit_error`, and this client read `reason` and **dropped it on the floor** — so the
|
|
121
|
+
* only sentence naming a cause never reached an operator. It defeats two things at once:
|
|
122
|
+
* `DOD-M15-SEALWIRE-1`'s refusal detail (which rule, which leaf kind), and
|
|
123
|
+
* `DOD-M15-TERMINAL-REASON-1`'s F6, where `detail` exists specifically to carry the
|
|
124
|
+
* DIRECTORY's refusal cause out from behind a `seal_refused`.
|
|
125
|
+
*
|
|
126
|
+
* Optional, because an older relay sends none.
|
|
127
|
+
*/
|
|
128
|
+
detail?: string;
|
|
129
|
+
/**
|
|
130
|
+
* DOD-M15-RELAYABUSE-1: milliseconds until the relay's rate-limit window clears, present only
|
|
131
|
+
* with `reason: "rate_limited"`. The relay computes it; nobody guesses it. `#doSubmit` waits
|
|
132
|
+
* this out and resubmits rather than surfacing a throttle — see the retry loop there.
|
|
133
|
+
*/
|
|
134
|
+
retry_after_ms?: number;
|
|
69
135
|
};
|
|
70
136
|
export interface AgentRelayClientOpts {
|
|
71
137
|
relayPeerId: string;
|
|
@@ -88,6 +154,20 @@ export interface AgentRelayClientOpts {
|
|
|
88
154
|
* directory's OFFLINE tree rebuild. Optional — when absent, no leaf log is kept.
|
|
89
155
|
*/
|
|
90
156
|
sealLeafStore?: SessionSealLeafStore;
|
|
157
|
+
/**
|
|
158
|
+
* DOD-M15-RELAYSLOTS-1: the current directory-issued online token for this agent, or `undefined`
|
|
159
|
+
* when the directory has not issued one (not connected yet, or this key is not a registered
|
|
160
|
+
* agent). A relay refuses an auth without it, and refuses to let the peer hold a reservation slot.
|
|
161
|
+
*
|
|
162
|
+
* ⚠️ A FUNCTION, NOT A VALUE, and that is the whole point. The token is short-lived and reissued
|
|
163
|
+
* on every signaling reconnect — which happens far more often than a relay auth. A client
|
|
164
|
+
* constructed with a snapshot would work for the first hour of an agent's life and then present
|
|
165
|
+
* an expired token forever, losing its slot for a reason nothing on this side reports.
|
|
166
|
+
*
|
|
167
|
+
* Optional so a caller with no directory connection at all (tests of unrelated paths) still
|
|
168
|
+
* compiles; production always supplies it.
|
|
169
|
+
*/
|
|
170
|
+
onlineToken?: () => Uint8Array | undefined;
|
|
91
171
|
}
|
|
92
172
|
/**
|
|
93
173
|
* The directory-signed relay assignment a client presents to its chosen relay (a
|
|
@@ -119,6 +199,8 @@ export declare class AgentRelayClient {
|
|
|
119
199
|
#private;
|
|
120
200
|
/** The cause of the most recent reader end, or null if it has not ended. */
|
|
121
201
|
getLastReaderError(): string | null;
|
|
202
|
+
/** The last classified auth refusal from this relay, or null if the last attempt succeeded. */
|
|
203
|
+
getLastAuthRefusal(): RelayAuthRefusal | null;
|
|
122
204
|
constructor(opts: AgentRelayClientOpts);
|
|
123
205
|
/** The agent's K_local public key as hex — the responder identity for auto-acknowledge. */
|
|
124
206
|
get senderPubkeyHex(): string;
|
|
@@ -128,15 +210,63 @@ export declare class AgentRelayClient {
|
|
|
128
210
|
* the shared stream if the node that originally dialed is torn down.
|
|
129
211
|
*/
|
|
130
212
|
registerSession(sessionIdHex: string, node: CelloNode, onLeafDeliver?: (frame: LeafDeliverFrame) => void, assignment?: RelayAssignmentCarry): void;
|
|
213
|
+
/**
|
|
214
|
+
* DOD-M15-RELAYAUTH-1 review H1 — **present the assignment and WAIT for the relay to say it
|
|
215
|
+
* recorded it.**
|
|
216
|
+
*
|
|
217
|
+
* `registerSession` above presents eagerly and forgets: the record is queued onto the submit chain
|
|
218
|
+
* and nobody can observe when it lands. That is correct for the witness relay, where the only
|
|
219
|
+
* requirement is "before the first submit". It is NOT sufficient for the relay that GATES A DIAL,
|
|
220
|
+
* because there the record is a precondition of an action we are about to take on another thread
|
|
221
|
+
* of the protocol — and losing that race denies a legitimate dial (review H1).
|
|
222
|
+
*
|
|
223
|
+
* Chained on `#submitChain` exactly like `#doSubmit`, so it cannot interleave with a submit on the
|
|
224
|
+
* same stream. Idempotent by construction: `#doRecord` returns `true` immediately once the session
|
|
225
|
+
* is recorded, so calling this straight after `registerSession` waits for the record that call
|
|
226
|
+
* already queued rather than sending a second one.
|
|
227
|
+
*
|
|
228
|
+
* Returns whether the relay recorded it. NEVER throws — a caller must be free to proceed on false
|
|
229
|
+
* (a dial that might be denied still beats no dial at all).
|
|
230
|
+
*/
|
|
231
|
+
recordAssignmentAndWait(node: CelloNode, sessionIdHex: string): Promise<boolean>;
|
|
131
232
|
/** Remove a session; caller closes the client when no sessions remain. */
|
|
132
233
|
unregisterSession(sessionIdHex: string): void;
|
|
133
234
|
hasSessions(): boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Is THIS session already registered on this client?
|
|
237
|
+
*
|
|
238
|
+
* DOD-M15-RELAYLEAK-1 (review MEDIUM-5). The detached seal transport releases its registration
|
|
239
|
+
* when the submit finishes, and "did I register it, or did I find it already there?" is the
|
|
240
|
+
* difference between releasing my own and **pulling a live one out from under a concurrent
|
|
241
|
+
* caller** — which closes the client that caller is mid-`submitLeaf` on. `hasSessions()` cannot
|
|
242
|
+
* answer it: it is a count, and by then the id is in the set either way.
|
|
243
|
+
*/
|
|
244
|
+
hasSession(sessionIdHex: string): boolean;
|
|
134
245
|
/**
|
|
135
246
|
* Proactively establish the authenticated stream from `node`. The RECEIVER must connect
|
|
136
247
|
* before the counterparty submits, so the relay has its stream to deliver `leaf_deliver`
|
|
137
248
|
* to (otherwise the relay queues until the recipient connects). Best-effort.
|
|
138
249
|
*/
|
|
139
250
|
connect(node: CelloNode): Promise<boolean>;
|
|
251
|
+
/**
|
|
252
|
+
* DOD-M15-RELAYAUTH-1 review HIGH-1 — prove key possession FROM THIS NODE, on its own stream.
|
|
253
|
+
*
|
|
254
|
+
* ⚠️ **`connect()` CANNOT be used for this, and using it was the defect.** `#ensureConnected`
|
|
255
|
+
* returns `true` the moment `#stream` is non-null, and `#stream` belongs to whichever node
|
|
256
|
+
* connected FIRST. An agent legitimately runs several nodes against one relay — the node promoted
|
|
257
|
+
* into a live session, plus the replacement standing receiver built behind it — and they share
|
|
258
|
+
* one `AgentRelayClient` because the cache is keyed `${agent}::${relay}`. So calling `connect()`
|
|
259
|
+
* from the replacement receiver short-circuited on the session node's stream, sent nothing, and
|
|
260
|
+
* the relay never saw that receiver's transport identity: it revoked the reservation ~15s later,
|
|
261
|
+
* the watchdog rebuilt, and the agent churned on a ~45s loop holding no usable circuit address
|
|
262
|
+
* for as long as the conversation lasted. Any future "reuse the existing connection" optimisation
|
|
263
|
+
* here reintroduces exactly that.
|
|
264
|
+
*
|
|
265
|
+
* So this always opens its own short-lived stream from `node`, and marks it
|
|
266
|
+
* `purpose: "reservation"` so the relay proves possession WITHOUT rebinding the agent's delivery
|
|
267
|
+
* stream (which would steal the live session's inbound leaves — see the relay-side dispatch).
|
|
268
|
+
*/
|
|
269
|
+
proveReservation(node: CelloNode): Promise<boolean>;
|
|
140
270
|
/**
|
|
141
271
|
* Submit a session's CONTENT-leaf hash to the relay. Connects/re-connects from `node` if needed.
|
|
142
272
|
* Globally FIFO across the agent's sessions (the ack has no session_id).
|
|
@@ -147,13 +277,58 @@ export declare class AgentRelayClient {
|
|
|
147
277
|
* `final_message` and from `answered` — guards that could never fire while this method hardcoded
|
|
148
278
|
* MSG for every caller. See `document-leaf-kind-on-the-wire.test.ts` for what that cost.
|
|
149
279
|
*/
|
|
150
|
-
submitMessageHash(node: CelloNode, sessionId: Uint8Array, contentHash: Uint8Array,
|
|
280
|
+
submitMessageHash(node: CelloNode, sessionId: Uint8Array, contentHash: Uint8Array,
|
|
281
|
+
/**
|
|
282
|
+
* REQUIRED — `DOD-M15-SEALWIRE-1` B2b-1 pass-2 F3. This default was the last one on the path,
|
|
283
|
+
* and it is the reason a test passing `undefined` for `leafKind` looked correct: the value was
|
|
284
|
+
* silently rebuilt as MESSAGE one hop below the parameter the fix had just made required. Its
|
|
285
|
+
* one production caller always passes explicitly, so the default was dead and misleading.
|
|
286
|
+
*/
|
|
287
|
+
leafKind: number): Promise<SubmitResult>;
|
|
151
288
|
/**
|
|
152
289
|
* Submit a leaf hash of a given kind (0x00 message / 0x02 control) to the relay. The SEAL
|
|
153
290
|
* ctrl leaf rides this path: two distinct-sender ctrl leaves in the relay's
|
|
154
291
|
* log trigger the directory's FROST notarization (relay `#maybeProcessSeal`).
|
|
292
|
+
*
|
|
293
|
+
* ─── `contentBytes` — `DOD-M15-SEALWIRE-1` bullets 3+4, THE SENDER LEG ───────────────────────
|
|
294
|
+
*
|
|
295
|
+
* The SEAL leaf's own payload, carried alongside its hash. Without it the directory holds a
|
|
296
|
+
* SHA-256 pre-image and nothing else, so the client's SIGNED `final_root` — the one value in the
|
|
297
|
+
* whole seal that the relay cannot produce — is unrecoverable, and every root check the directory
|
|
298
|
+
* can make compares the relay against itself.
|
|
299
|
+
*
|
|
300
|
+
* ⚠️ THIS PARAMETER PUTS LEAF CONTENT ON THE RELAY, AND THE RELAY IS THE PARTY THIS PROTOCOL
|
|
301
|
+
* EXISTS TO KEEP CONTENT AWAY FROM (INV-3: a forwarding relay sees ciphertext).
|
|
302
|
+
*
|
|
303
|
+
* It is safe for a SEAL ctrl leaf and for nothing else. The payload is `[session_id, final_root,
|
|
304
|
+
* close_timestamp, "PENDING"]` and the relay already knows all four — it assigned the session,
|
|
305
|
+
* built the tree the root comes from, and stamped the leaf. Nothing is disclosed. That reasoning
|
|
306
|
+
* stops dead at the next leaf kind: a `msg` leaf's content is the operator's plaintext and a `doc`
|
|
307
|
+
* leaf's is their document.
|
|
308
|
+
*
|
|
309
|
+
* So both directions are REFUSED rather than tidied, and refused HERE rather than at the relay:
|
|
310
|
+
*
|
|
311
|
+
* - content on a non-ctrl leaf → the relay would refuse the whole frame, but only after the
|
|
312
|
+
* operator's words had already crossed the wire to the party that must not have them, and the
|
|
313
|
+
* refusal would destroy their send rather than protect it.
|
|
314
|
+
* - a ctrl leaf with NO payload → this was the actual defect. `submitSealLeaf` computed the
|
|
315
|
+
* payload, hashed it, and had nowhere to put it, so it was dropped. The seal still succeeded,
|
|
316
|
+
* the relay still acked, and three hops later the directory reported `not_carried` and blamed
|
|
317
|
+
* the relay's build version — for a value the client never sent. Four reviewed legs shipped
|
|
318
|
+
* over that silence. A dropped argument now fails on the machine that dropped it.
|
|
319
|
+
*
|
|
320
|
+
* ⚠️ REQUIRED, AND `| null` RATHER THAN `?` — THE TYPE IS THE GUARD.
|
|
321
|
+
*
|
|
322
|
+
* I first wrote this optional and covered it with tests. Then I ran the revert test that mattered:
|
|
323
|
+
* drop the argument at the one call site that must pass it, exactly reproducing the original
|
|
324
|
+
* defect. **All five new tests stayed green.** An optional parameter makes the defect a silent,
|
|
325
|
+
* type-legal omission — which is precisely how it shipped through four reviews the first time.
|
|
326
|
+
*
|
|
327
|
+
* Required means the omission is a COMPILE ERROR, caught by the gate on the machine that made it,
|
|
328
|
+
* before any test runs. Every caller must now say what this leaf carries, and `submitMessageHash`
|
|
329
|
+
* says `null` in one visible place instead of by saying nothing at all.
|
|
155
330
|
*/
|
|
156
|
-
submitLeaf(node: CelloNode, sessionId: Uint8Array, contentHash: Uint8Array, leafKind: number): Promise<SubmitResult>;
|
|
331
|
+
submitLeaf(node: CelloNode, sessionId: Uint8Array, contentHash: Uint8Array, leafKind: number, contentBytes: Uint8Array | null): Promise<SubmitResult>;
|
|
157
332
|
/** The highest relay-assigned sequence observed for a given session (ack or deliver). */
|
|
158
333
|
lastSeenSeq(sessionIdHex: string): number;
|
|
159
334
|
close(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-relay-client.d.ts","sourceRoot":"","sources":["../src/session-relay-client.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AACtD,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,iFAAiF;AACjF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,
|
|
1
|
+
{"version":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