@weaveprotocol/core 0.1.2 → 0.2.1
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/README.md +322 -45
- package/dist/doors/doors.d.ts +139 -0
- package/dist/doors/doors.d.ts.map +1 -0
- package/dist/doors/doors.js +210 -0
- package/dist/doors/doors.js.map +1 -0
- package/dist/doors/index.d.ts +9 -0
- package/dist/doors/index.d.ts.map +1 -0
- package/dist/doors/index.js +7 -0
- package/dist/doors/index.js.map +1 -0
- package/dist/identity/contact-key.d.ts +68 -0
- package/dist/identity/contact-key.d.ts.map +1 -0
- package/dist/identity/contact-key.js +185 -0
- package/dist/identity/contact-key.js.map +1 -0
- package/dist/index.d.ts +16 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/network/index.d.ts +2 -0
- package/dist/network/index.d.ts.map +1 -1
- package/dist/network/index.js +1 -0
- package/dist/network/index.js.map +1 -1
- package/dist/network/mailbox.d.ts +49 -0
- package/dist/network/mailbox.d.ts.map +1 -0
- package/dist/network/mailbox.js +125 -0
- package/dist/network/mailbox.js.map +1 -0
- package/dist/network/mesh.d.ts +6 -0
- package/dist/network/mesh.d.ts.map +1 -1
- package/dist/network/mesh.js +11 -1
- package/dist/network/mesh.js.map +1 -1
- package/dist/network/multi-signaling.d.ts +12 -2
- package/dist/network/multi-signaling.d.ts.map +1 -1
- package/dist/network/multi-signaling.js +86 -14
- package/dist/network/multi-signaling.js.map +1 -1
- package/dist/network/peer-auth.d.ts +50 -16
- package/dist/network/peer-auth.d.ts.map +1 -1
- package/dist/network/peer-auth.js +52 -15
- package/dist/network/peer-auth.js.map +1 -1
- package/dist/node/carrier.d.ts +87 -0
- package/dist/node/carrier.d.ts.map +1 -1
- package/dist/node/carrier.js +180 -59
- package/dist/node/carrier.js.map +1 -1
- package/dist/node/copy.d.ts.map +1 -1
- package/dist/node/copy.js +6 -3
- package/dist/node/copy.js.map +1 -1
- package/dist/node/host.d.ts +117 -0
- package/dist/node/host.d.ts.map +1 -0
- package/dist/node/host.js +192 -0
- package/dist/node/host.js.map +1 -0
- package/dist/node/index.d.ts +6 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +958 -25
- package/dist/node/node.js.map +1 -1
- package/dist/node/space-runtime.d.ts +42 -25
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +734 -35
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/types.d.ts +375 -3
- package/dist/node/types.d.ts.map +1 -1
- package/dist/privacy/space-encryption.d.ts +16 -0
- package/dist/privacy/space-encryption.d.ts.map +1 -1
- package/dist/privacy/space-encryption.js +40 -0
- package/dist/privacy/space-encryption.js.map +1 -1
- package/dist/query/engine.js +1 -1
- package/dist/query/engine.js.map +1 -1
- package/dist/query/types.d.ts +7 -0
- package/dist/query/types.d.ts.map +1 -1
- package/dist/query/types.js.map +1 -1
- package/dist/react/use-query.d.ts +1 -1
- package/dist/react/use-query.d.ts.map +1 -1
- package/dist/records/topics.d.ts +21 -0
- package/dist/records/topics.d.ts.map +1 -0
- package/dist/records/topics.js +86 -0
- package/dist/records/topics.js.map +1 -0
- package/dist/schema/collection-def.d.ts +7 -0
- package/dist/schema/collection-def.d.ts.map +1 -1
- package/dist/schema/collection-def.js +4 -0
- package/dist/schema/collection-def.js.map +1 -1
- package/dist/schema/expression.d.ts +2 -0
- package/dist/schema/expression.d.ts.map +1 -1
- package/dist/schema/expression.js +1 -0
- package/dist/schema/expression.js.map +1 -1
- package/dist/schemas/contacts.d.ts +214 -0
- package/dist/schemas/contacts.d.ts.map +1 -0
- package/dist/schemas/contacts.js +98 -0
- package/dist/schemas/contacts.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.js +15 -3
- package/dist/session/auth.js.map +1 -1
- package/dist/session/connect.d.ts +25 -1
- package/dist/session/connect.d.ts.map +1 -1
- package/dist/session/connect.js +9 -2
- package/dist/session/connect.js.map +1 -1
- package/dist/session/hosting.d.ts +155 -0
- package/dist/session/hosting.d.ts.map +1 -0
- package/dist/session/hosting.js +160 -0
- package/dist/session/hosting.js.map +1 -0
- package/dist/space/account-registry.d.ts +6 -0
- package/dist/space/account-registry.d.ts.map +1 -1
- package/dist/space/account-registry.js +16 -4
- package/dist/space/account-registry.js.map +1 -1
- package/dist/space/notify.d.ts +88 -0
- package/dist/space/notify.d.ts.map +1 -0
- package/dist/space/notify.js +127 -0
- package/dist/space/notify.js.map +1 -0
- package/dist/space/pass.d.ts +6 -0
- package/dist/space/pass.d.ts.map +1 -1
- package/dist/space/pass.js +5 -2
- package/dist/space/pass.js.map +1 -1
- package/dist/space/roles.d.ts +71 -0
- package/dist/space/roles.d.ts.map +1 -1
- package/dist/space/roles.js +114 -0
- package/dist/space/roles.js.map +1 -1
- package/dist/space/space-access.d.ts +24 -0
- package/dist/space/space-access.d.ts.map +1 -1
- package/dist/space/space-access.js +24 -0
- package/dist/space/space-access.js.map +1 -1
- package/dist/space/space-manager.d.ts +35 -1
- package/dist/space/space-manager.d.ts.map +1 -1
- package/dist/space/space-manager.js +72 -25
- package/dist/space/space-manager.js.map +1 -1
- package/dist/storage/blob/memory.d.ts +9 -0
- package/dist/storage/blob/memory.d.ts.map +1 -0
- package/dist/storage/blob/memory.js +20 -0
- package/dist/storage/blob/memory.js.map +1 -0
- package/dist/storage/blob/s3.d.ts +16 -0
- package/dist/storage/blob/s3.d.ts.map +1 -0
- package/dist/storage/blob/s3.js +86 -0
- package/dist/storage/blob/s3.js.map +1 -0
- package/dist/storage/blob-store.d.ts +26 -0
- package/dist/storage/blob-store.d.ts.map +1 -0
- package/dist/storage/blob-store.js +2 -0
- package/dist/storage/blob-store.js.map +1 -0
- package/dist/storage/encrypted-adapter.d.ts +3 -3
- package/dist/storage/encrypted-adapter.js +3 -3
- package/dist/storage/folder-adapter.d.ts +8 -8
- package/dist/storage/folder-adapter.d.ts.map +1 -1
- package/dist/storage/folder-adapter.js +7 -7
- package/dist/storage/folder-reconcile.d.ts +12 -14
- package/dist/storage/folder-reconcile.d.ts.map +1 -1
- package/dist/storage/folder-reconcile.js +20 -14
- package/dist/storage/folder-reconcile.js.map +1 -1
- package/dist/storage/index.d.ts +0 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +0 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
- package/dist/storage/indexeddb-adapter.js +8 -9
- package/dist/storage/indexeddb-adapter.js.map +1 -1
- package/dist/storage/mirror.d.ts +68 -0
- package/dist/storage/mirror.d.ts.map +1 -0
- package/dist/storage/mirror.js +174 -0
- package/dist/storage/mirror.js.map +1 -0
- package/dist/storage/segment.d.ts +20 -0
- package/dist/storage/segment.d.ts.map +1 -0
- package/dist/storage/segment.js +27 -0
- package/dist/storage/segment.js.map +1 -0
- package/dist/storage/storage-provider.d.ts +36 -40
- package/dist/storage/storage-provider.d.ts.map +1 -1
- package/dist/storage/storage-provider.js +208 -117
- package/dist/storage/storage-provider.js.map +1 -1
- package/dist/sync/index.d.ts +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/negentropy.d.ts +68 -0
- package/dist/sync/negentropy.d.ts.map +1 -0
- package/dist/sync/negentropy.js +379 -0
- package/dist/sync/negentropy.js.map +1 -0
- package/dist/sync/sync-engine.d.ts +45 -13
- package/dist/sync/sync-engine.d.ts.map +1 -1
- package/dist/sync/sync-engine.js +290 -207
- package/dist/sync/sync-engine.js.map +1 -1
- package/dist/sync/sync-messages.d.ts +42 -32
- package/dist/sync/sync-messages.d.ts.map +1 -1
- package/dist/sync/sync-messages.js +1 -1
- package/dist/sync/sync-messages.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/hash.d.ts +9 -0
- package/dist/utils/hash.d.ts.map +1 -1
- package/dist/utils/hash.js +33 -0
- package/dist/utils/hash.js.map +1 -1
- package/package.json +8 -3
- package/dist/storage/mst.d.ts +0 -121
- package/dist/storage/mst.d.ts.map +0 -1
- package/dist/storage/mst.js +0 -402
- package/dist/storage/mst.js.map +0 -1
- package/dist/sync/anti-entropy.d.ts +0 -49
- package/dist/sync/anti-entropy.d.ts.map +0 -1
- package/dist/sync/anti-entropy.js +0 -62
- package/dist/sync/anti-entropy.js.map +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module identity/contact-key
|
|
3
|
+
* The contact key: what lets someone seal a message only you can open, while
|
|
4
|
+
* you are offline.
|
|
5
|
+
*
|
|
6
|
+
* It is a P-256 key pair for key agreement (ECDH), derived from the account's
|
|
7
|
+
* seed like the root key but under its own label — the same on every device,
|
|
8
|
+
* and back with the recovery code. It is not the root key: apps never hold the
|
|
9
|
+
* seed, and one key should not both sign and decrypt. It is not a session key
|
|
10
|
+
* either: those change every hour, and a request read next week would be
|
|
11
|
+
* locked to a key that is gone.
|
|
12
|
+
*
|
|
13
|
+
* The public half goes on the account's profile in every space it writes in
|
|
14
|
+
* (`sys.profile`). The private half stays with the account home, and goes to
|
|
15
|
+
* apps the person lets handle contacts.
|
|
16
|
+
*
|
|
17
|
+
* Sealing works like wrapping a space key (`privacy/key-distribution.ts`): a
|
|
18
|
+
* fresh key pair for each message, a secret shared with the recipient's
|
|
19
|
+
* public key, and AES-GCM. The `context` is bound in as additional data, so a
|
|
20
|
+
* sealed message moved anywhere its context no longer matches doesn't open.
|
|
21
|
+
*/
|
|
22
|
+
import { p256 } from '@noble/curves/nist.js';
|
|
23
|
+
import { base64UrlDecode, base64UrlEncode, utf8Decode, utf8Encode } from '../utils/encoding.js';
|
|
24
|
+
/** Domain separation for the contact key. Changing it changes every account's contact key. */
|
|
25
|
+
const CONTACT_KEY_INFO = 'weave/p256-contact-key/v1';
|
|
26
|
+
const SEAL_INFO = 'weave/contact-seal/v1';
|
|
27
|
+
const MEMBER_KEY_INFO = 'weave/p256-member-key/v1';
|
|
28
|
+
const DOOR_KEY_INFO = 'weave/p256-door-key/v1';
|
|
29
|
+
const DOOR_SIGN_KEY_INFO = 'weave/p256-door-sign-key/v1';
|
|
30
|
+
/** 48 bytes reduce to a P-256 scalar without bias, as for the root key (`crypto-p256.ts`) */
|
|
31
|
+
const P256_SEED_BYTES = 48;
|
|
32
|
+
const POINT_BYTES = 65;
|
|
33
|
+
const IV_BYTES = 12;
|
|
34
|
+
async function hkdf(ikm, info, length) {
|
|
35
|
+
const key = await globalThis.crypto.subtle.importKey('raw', ikm, 'HKDF', false, ['deriveBits']);
|
|
36
|
+
const bits = await globalThis.crypto.subtle.deriveBits({ name: 'HKDF', hash: 'SHA-256', salt: new Uint8Array(0), info: utf8Encode(info) }, key, length * 8);
|
|
37
|
+
return new Uint8Array(bits);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The contact key's private scalar, from the account seed — 32 bytes. This is
|
|
41
|
+
* what an account home hands an app it lets handle contacts.
|
|
42
|
+
*/
|
|
43
|
+
export async function deriveContactKeyBytes(seed) {
|
|
44
|
+
return p256.utils.randomSecretKey(await hkdf(seed, CONTACT_KEY_INFO, P256_SEED_BYTES));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* An account's **member key** for one space: the same kind of key pair, derived
|
|
48
|
+
* from the account's vault key and the space id. When a private space's key
|
|
49
|
+
* changes, the new key is sealed to each member's member key (`sys.box`).
|
|
50
|
+
*
|
|
51
|
+
* One per space, not one per account, so an account home can hand an app the
|
|
52
|
+
* member keys for exactly the spaces it grants — and a new space key reaches
|
|
53
|
+
* that app without it holding anything that opens other spaces' keys.
|
|
54
|
+
* @param accountKey The vault key bytes (`deriveVaultKeyBytes(seed)`)
|
|
55
|
+
*/
|
|
56
|
+
export async function deriveMemberKeyBytes(accountKey, spaceId) {
|
|
57
|
+
return p256.utils.randomSecretKey(await hkdf(accountKey, `${MEMBER_KEY_INFO}|${spaceId}`, P256_SEED_BYTES));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A **door key**: the key a door's knocks are sealed to (`doors/doors.ts`).
|
|
61
|
+
* Derived from the contact key and the door's id, so every device and app
|
|
62
|
+
* holding the contact key opens the same doors, and a new door is a new id.
|
|
63
|
+
*
|
|
64
|
+
* Not the contact key itself: that one's public half is on your profile in
|
|
65
|
+
* every space you write in, and a door is handed to people who may not know
|
|
66
|
+
* who you are yet. A door key says nothing about the account behind it.
|
|
67
|
+
* @param contactKey The contact key's private scalar (`deriveContactKeyBytes`)
|
|
68
|
+
* @param doorId The door's id, as its `std.door` record names it
|
|
69
|
+
*/
|
|
70
|
+
export async function deriveDoorKeyBytes(contactKey, doorId) {
|
|
71
|
+
return p256.utils.randomSecretKey(await hkdf(contactKey, `${DOOR_KEY_INFO}|${doorId}`, P256_SEED_BYTES));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A door's **signing key**: what proves you own a door, without saying whose
|
|
75
|
+
* it is — to a relay, when clearing the door's mailbox, and to someone who
|
|
76
|
+
* knocked, when you answer. Separate from the door key, which only opens
|
|
77
|
+
* knocks: one key should not both sign and decrypt.
|
|
78
|
+
*/
|
|
79
|
+
export async function deriveDoorSignKeyBytes(contactKey, doorId) {
|
|
80
|
+
return p256.utils.randomSecretKey(await hkdf(contactKey, `${DOOR_SIGN_KEY_INFO}|${doorId}`, P256_SEED_BYTES));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Signs with a P-256 private scalar: ECDSA over SHA-256, 64 bytes r ‖ s,
|
|
84
|
+
* base64url — for door signing keys.
|
|
85
|
+
*/
|
|
86
|
+
export async function signWithScalar(secret, data) {
|
|
87
|
+
const point = p256.getPublicKey(secret, false);
|
|
88
|
+
const key = await globalThis.crypto.subtle.importKey('jwk', {
|
|
89
|
+
kty: 'EC',
|
|
90
|
+
crv: 'P-256',
|
|
91
|
+
x: base64UrlEncode(point.subarray(1, 33)),
|
|
92
|
+
y: base64UrlEncode(point.subarray(33, 65)),
|
|
93
|
+
d: base64UrlEncode(secret),
|
|
94
|
+
ext: false,
|
|
95
|
+
}, { name: 'ECDSA', namedCurve: 'P-256' }, false, ['sign']);
|
|
96
|
+
return base64UrlEncode(new Uint8Array(await globalThis.crypto.subtle.sign({ name: 'ECDSA', hash: 'SHA-256' }, key, data)));
|
|
97
|
+
}
|
|
98
|
+
/** Checks what `signWithScalar` signed, against a compressed public key (base64url) */
|
|
99
|
+
export async function verifyWithPoint(publicKey, data, signature) {
|
|
100
|
+
try {
|
|
101
|
+
const point = p256.Point.fromBytes(base64UrlDecode(publicKey)).toBytes(false);
|
|
102
|
+
const key = await globalThis.crypto.subtle.importKey('raw', point, { name: 'ECDSA', namedCurve: 'P-256' }, false, ['verify']);
|
|
103
|
+
return await globalThis.crypto.subtle.verify({ name: 'ECDSA', hash: 'SHA-256' }, key, base64UrlDecode(signature), data);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** The public half, from the private scalar */
|
|
110
|
+
export function contactPublicKey(secret) {
|
|
111
|
+
return base64UrlEncode(p256.getPublicKey(secret, true));
|
|
112
|
+
}
|
|
113
|
+
/** Whether a string is a contact key's public half: a point on P-256 */
|
|
114
|
+
export function isContactPublicKey(value) {
|
|
115
|
+
if (typeof value !== 'string' || value.length > 64)
|
|
116
|
+
return false;
|
|
117
|
+
try {
|
|
118
|
+
p256.Point.fromBytes(base64UrlDecode(value)).assertValidity();
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** The key pair, from the private scalar (`deriveContactKeyBytes`) */
|
|
126
|
+
export async function contactKeyPair(secret) {
|
|
127
|
+
const point = p256.getPublicKey(secret, false);
|
|
128
|
+
const privateKey = await globalThis.crypto.subtle.importKey('jwk', {
|
|
129
|
+
kty: 'EC',
|
|
130
|
+
crv: 'P-256',
|
|
131
|
+
x: base64UrlEncode(point.subarray(1, 33)),
|
|
132
|
+
y: base64UrlEncode(point.subarray(33, 65)),
|
|
133
|
+
d: base64UrlEncode(secret),
|
|
134
|
+
ext: false,
|
|
135
|
+
}, { name: 'ECDH', namedCurve: 'P-256' }, false, ['deriveBits']);
|
|
136
|
+
return Object.freeze({ publicKey: contactPublicKey(secret), privateKey });
|
|
137
|
+
}
|
|
138
|
+
/** The AES key two sides agree on, bound to the ephemeral key it came from */
|
|
139
|
+
async function sealKey(shared, ephemeral, usage) {
|
|
140
|
+
const ikm = new Uint8Array([...new Uint8Array(shared), ...ephemeral]);
|
|
141
|
+
const material = await hkdf(ikm, SEAL_INFO, 32);
|
|
142
|
+
return globalThis.crypto.subtle.importKey('raw', material, { name: 'AES-GCM', length: 256 }, false, [usage]);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Seals a value so only the holder of a contact key can open it.
|
|
146
|
+
* @param recipient The contact key's public half, as a profile carries it
|
|
147
|
+
* @param value Anything JSON can carry
|
|
148
|
+
* @param context What the sealed value belongs to; opening needs the same
|
|
149
|
+
* @returns base64url: the ephemeral public point, the IV, and the ciphertext
|
|
150
|
+
*/
|
|
151
|
+
export async function sealFor(recipient, value, context) {
|
|
152
|
+
const recipientKey = await globalThis.crypto.subtle.importKey('raw', p256.Point.fromBytes(base64UrlDecode(recipient)).toBytes(false), { name: 'ECDH', namedCurve: 'P-256' }, false, []);
|
|
153
|
+
const ephemeral = await globalThis.crypto.subtle.generateKey({ name: 'ECDH', namedCurve: 'P-256' }, true, ['deriveBits']);
|
|
154
|
+
const ephemeralPoint = new Uint8Array(await globalThis.crypto.subtle.exportKey('raw', ephemeral.publicKey));
|
|
155
|
+
const shared = await globalThis.crypto.subtle.deriveBits({ name: 'ECDH', public: recipientKey }, ephemeral.privateKey, 256);
|
|
156
|
+
const key = await sealKey(shared, ephemeralPoint, 'encrypt');
|
|
157
|
+
const iv = globalThis.crypto.getRandomValues(new Uint8Array(IV_BYTES));
|
|
158
|
+
const ciphertext = new Uint8Array(await globalThis.crypto.subtle.encrypt({ name: 'AES-GCM', iv: iv, additionalData: utf8Encode(context) }, key, utf8Encode(JSON.stringify(value))));
|
|
159
|
+
return base64UrlEncode(new Uint8Array([...ephemeralPoint, ...iv, ...ciphertext]));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Opens what `sealFor` sealed.
|
|
163
|
+
* @returns The value, or null when it was not sealed for this key, or for this context, or was changed
|
|
164
|
+
*/
|
|
165
|
+
export async function openSealed(privateKey, sealed, context) {
|
|
166
|
+
try {
|
|
167
|
+
const bytes = base64UrlDecode(sealed);
|
|
168
|
+
if (bytes.length <= POINT_BYTES + IV_BYTES)
|
|
169
|
+
return null;
|
|
170
|
+
const ephemeralPoint = bytes.subarray(0, POINT_BYTES);
|
|
171
|
+
const ephemeral = await globalThis.crypto.subtle.importKey('raw', ephemeralPoint, { name: 'ECDH', namedCurve: 'P-256' }, false, []);
|
|
172
|
+
const shared = await globalThis.crypto.subtle.deriveBits({ name: 'ECDH', public: ephemeral }, privateKey, 256);
|
|
173
|
+
const key = await sealKey(shared, ephemeralPoint, 'decrypt');
|
|
174
|
+
const plain = await globalThis.crypto.subtle.decrypt({
|
|
175
|
+
name: 'AES-GCM',
|
|
176
|
+
iv: bytes.subarray(POINT_BYTES, POINT_BYTES + IV_BYTES),
|
|
177
|
+
additionalData: utf8Encode(context),
|
|
178
|
+
}, key, bytes.subarray(POINT_BYTES + IV_BYTES));
|
|
179
|
+
return JSON.parse(utf8Decode(new Uint8Array(plain)));
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=contact-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-key.js","sourceRoot":"","sources":["../../src/identity/contact-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhG,8FAA8F;AAC9F,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AACrD,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C,MAAM,eAAe,GAAG,0BAA0B,CAAC;AACnD,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEzD,6FAA6F;AAC7F,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,QAAQ,GAAG,EAAE,CAAC;AASpB,KAAK,UAAU,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc;IAC/D,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAChH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CACpD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAiB,EAAE,EAClG,GAAG,EACH,MAAM,GAAG,CAAC,CACX,CAAC;IACF,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC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AAE,OAAO,EAAE,EACrC,KAAK,EACL,EAAE,CACH,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;QAC/G,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAClD;YACE,IAAI,EAAE,SAAS;YACf,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,QAAQ,CAAiB;YACvE,cAAc,EAAE,UAAU,CAAC,OAAO,CAAiB;SACpD,EACD,GAAG,EACH,KAAK,CAAC,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAiB,CACvD,CAAC;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAY,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Self-sovereign, peer-to-peer protocol for the browser.
|
|
4
4
|
*
|
|
5
5
|
* Identity via WebAuthn passkeys, data as signed Expressions,
|
|
6
|
-
*
|
|
6
|
+
* sync by range-based set reconciliation (Negentropy),
|
|
7
7
|
* and end-to-end encryption for private Spaces.
|
|
8
8
|
*
|
|
9
9
|
* @module @weaveprotocol/core
|
|
@@ -25,6 +25,8 @@ export type { AccountStore, AccountSummary } from './identity/account-store.js';
|
|
|
25
25
|
export { readFolderVault, writeFolderVault, createVault, ACCOUNT_FILE, } from './identity/folder-account.js';
|
|
26
26
|
export type { FolderState } from './identity/folder-account.js';
|
|
27
27
|
export { wrapSeedWithDeviceKey, unwrapSeedWithDeviceKey, wrapSeedWithPassphrase, unwrapSeedWithPassphrase, deriveVaultKey, deriveVaultKeyBytes, deviceWrapsFor, hasPassphraseWrap, withWrap, withoutWrap, PASSPHRASE_ITERATIONS, } from './identity/account-vault.js';
|
|
28
|
+
export { deriveContactKeyBytes, deriveDoorKeyBytes, deriveDoorSignKeyBytes, contactKeyPair, contactPublicKey, isContactPublicKey, sealFor, openSealed } from './identity/contact-key.js';
|
|
29
|
+
export type { ContactKeyPair } from './identity/contact-key.js';
|
|
28
30
|
export type { AccountVault, SeedWrap, DeviceWrap, PassphraseWrap, } from './identity/account-vault.js';
|
|
29
31
|
export type { IdentityManager, Identity, IdentityConfig, CeremonyPreferences } from './identity/identity-manager.js';
|
|
30
32
|
export { createDeviceKey, getDeviceKey, deleteDeviceKey } from './identity/device-key.js';
|
|
@@ -42,8 +44,6 @@ export { createSigner, } from './schema/signer.js';
|
|
|
42
44
|
export type { Signer } from './schema/signer.js';
|
|
43
45
|
export { createExpression, canonicalize, serializeExpression, deserializeExpression, getExpressionId, signedPart, } from './schema/expression.js';
|
|
44
46
|
export { createIndexedDBAdapter, } from './storage/indexeddb-adapter.js';
|
|
45
|
-
export { createEmptyNode, insertIntoMST, deleteFromMST, lookupInMST, listMSTEntries, collectReachableCids, } from './storage/mst.js';
|
|
46
|
-
export type { MSTNode } from './storage/mst.js';
|
|
47
47
|
export { createStorageProvider, } from './storage/storage-provider.js';
|
|
48
48
|
export type { StorageProvider } from './storage/storage-provider.js';
|
|
49
49
|
export { createFolderAdapter, readFolderFile, writeFolderFile, } from './storage/folder-adapter.js';
|
|
@@ -55,7 +55,7 @@ export type { FolderReconciliation } from './storage/folder-reconcile.js';
|
|
|
55
55
|
export { isFolderStorageAvailable, pickDataFolder, queryFolderPermission, ensureFolderPermission, rememberDataFolder, recallDataFolder, forgetDataFolder, } from './storage/directory-access.js';
|
|
56
56
|
export type { FolderAccessMode } from './storage/directory-access.js';
|
|
57
57
|
export { createSpaceManager, parseSpaceInvite } from './space/space-manager.js';
|
|
58
|
-
export { deriveAccountRegistry, MEMBERSHIP_COLLECTION } from './space/account-registry.js';
|
|
58
|
+
export { deriveAccountRegistry, deriveContactsSpace, MEMBERSHIP_COLLECTION } from './space/account-registry.js';
|
|
59
59
|
export { CATALOG_COLLECTION, checkStoredCollection, checkPublishableSchema, validateJsonSchema, asStandardSchema, toJsonSchema, collection, } from './schema/collection-def.js';
|
|
60
60
|
export type { StoredCollection, JsonSchema, SchemaIssue } from './schema/collection-def.js';
|
|
61
61
|
export type { Membership } from './space/account-registry.js';
|
|
@@ -83,7 +83,8 @@ export type { NetworkManager, NetworkManagerConfig, NetworkEvents } from './netw
|
|
|
83
83
|
export type { SignalingClient, SignalingMessage, SignalKind } from './network/signaling.js';
|
|
84
84
|
export { parseSyncMessage, SYNC_PROTOCOL_VERSION, } from './sync/sync-messages.js';
|
|
85
85
|
export type { SyncMessage } from './sync/sync-messages.js';
|
|
86
|
-
export {
|
|
86
|
+
export { createReconciler, ItemSet, fingerprintOf, } from './sync/negentropy.js';
|
|
87
|
+
export type { Item, Round, Sum } from './sync/negentropy.js';
|
|
87
88
|
export { createSyncEngine, } from './sync/sync-engine.js';
|
|
88
89
|
export type { SyncEngine, SyncEngineConfig, IncomingValidation } from './sync/sync-engine.js';
|
|
89
90
|
export { createCryptoGate, } from './validation/crypto-gate.js';
|
|
@@ -103,8 +104,8 @@ export { protocolError, isProtocolError } from './utils/errors.js';
|
|
|
103
104
|
export type { ProtocolError, ProtocolErrorCode } from './utils/errors.js';
|
|
104
105
|
export { createEmitter } from './utils/events.js';
|
|
105
106
|
export type { Emitter } from './utils/events.js';
|
|
106
|
-
export { createNode, SESSION_CAPABILITY, writeCapability, relayRoom, indexedDBStores, folderStores, copyAccountData, NODE_ACTIONS, runAction, checkActionInput, } from './node/index.js';
|
|
107
|
-
export type { StoreFactory, StoreOptions, CopyAccountParams, CopyResult, NodeAction, ActionSchema, P2PNode, NodeConfig, NodeNetworkConfig, NodeSpaces, NodeRecords, NodeRecord, NodeEvent, SpaceSummary, SpaceStatus, CarrierSummary, SpaceProfile, NewSpace, InvitePreview, ListOptions, ConnectionState, DelegateParams, Delegated, NodeCollection, NodeCollections, DefineCollection, NodeAccount, AccountProfileView, } from './node/index.js';
|
|
107
|
+
export { createNode, SESSION_CAPABILITY, writeCapability, relayRoom, indexedDBStores, folderStores, copyAccountData, NODE_ACTIONS, runAction, checkActionInput, createCarrierNode, createHostNode, NotAllowedError, } from './node/index.js';
|
|
108
|
+
export type { StoreFactory, StoreOptions, CopyAccountParams, CopyResult, NodeAction, ActionSchema, P2PNode, NodeConfig, NodeNetworkConfig, NodeSpaces, NodeRecords, NodeRecord, NodeEvent, SpaceSummary, SpaceStatus, CarrierSummary, SpaceProfile, NewSpace, InvitePreview, ListOptions, ConnectionState, DelegateParams, Delegated, NodeCollection, NodeCollections, DefineCollection, NodeAccount, AccountProfileView, NodeContacts, ContactView, ContactRequest, CarrierConfig, CarrierNode, CarriedSpace, CarrierEvent, HostConfig, HostNode, NodeHosting, HostingView, Subscription, SubscriptionState, Keeper, CacheConfig, NodeNotifications, NotifyView, NotifyWhen, CarriedSubscriptionView, } from './node/index.js';
|
|
108
109
|
export { runQuery } from './query/engine.js';
|
|
109
110
|
export type { QuerySource } from './query/engine.js';
|
|
110
111
|
export { matches, checkQuery, fieldValue, MAX_INCLUDE_DEPTH } from './query/filter.js';
|
|
@@ -113,4 +114,12 @@ export { plainQuery } from './query/types.js';
|
|
|
113
114
|
export { checkRules, onePerKey } from './records/rules.js';
|
|
114
115
|
export { describeCollection } from './records/describe.js';
|
|
115
116
|
export type { CollectionRules, Who } from './records/rules.js';
|
|
117
|
+
export { HOSTING_COLLECTION, REQUEST_WINDOW_SECONDS, newSubscriptionSeed, subscriptionKey, signRequest, verifyRequest, createHostClient, describeHost, signStatus, readStatus, payLink, verifyPayLink, HOST_DESCRIPTION_PATH, PAY_LINK_SECONDS, HostError, } from './session/hosting.js';
|
|
118
|
+
export type { Hosting, SubscriptionKey, HostStatus, SignedStatus, HostDescription, HostClient } from './session/hosting.js';
|
|
119
|
+
export type { BlobStore } from './storage/blob-store.js';
|
|
120
|
+
export { createMemoryBlobStore } from './storage/blob/memory.js';
|
|
121
|
+
export { createS3BlobStore } from './storage/blob/s3.js';
|
|
122
|
+
export type { S3Config } from './storage/blob/s3.js';
|
|
123
|
+
export { createMirror, deleteMirrored } from './storage/mirror.js';
|
|
124
|
+
export type { Mirror, MirrorConfig, Taken } from './storage/mirror.js';
|
|
116
125
|
//# 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;;;;;;;;;GASG;AAGH,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,SAAS,EACT,cAAc,EACd,OAAO,EACP,cAAc,EACd,MAAM,GACP,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EACL,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAChH,OAAO,EACL,aAAa,E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AAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACnE,YAAY,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EACL,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,UAAU,GACX,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,SAAS,E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AAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG5H,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Self-sovereign, peer-to-peer protocol for the browser.
|
|
4
4
|
*
|
|
5
5
|
* Identity via WebAuthn passkeys, data as signed Expressions,
|
|
6
|
-
*
|
|
6
|
+
* sync by range-based set reconciliation (Negentropy),
|
|
7
7
|
* and end-to-end encryption for private Spaces.
|
|
8
8
|
*
|
|
9
9
|
* @module @weaveprotocol/core
|
|
@@ -20,6 +20,7 @@ export { createIdentityManager, } from './identity/identity-manager.js';
|
|
|
20
20
|
export { createFolderAccountStore, createBrowserAccountStore, listFolderAccounts, adoptLegacyFolderAccount, accountDataPath, newAccountId, } from './identity/account-store.js';
|
|
21
21
|
export { readFolderVault, writeFolderVault, createVault, ACCOUNT_FILE, } from './identity/folder-account.js';
|
|
22
22
|
export { wrapSeedWithDeviceKey, unwrapSeedWithDeviceKey, wrapSeedWithPassphrase, unwrapSeedWithPassphrase, deriveVaultKey, deriveVaultKeyBytes, deviceWrapsFor, hasPassphraseWrap, withWrap, withoutWrap, PASSPHRASE_ITERATIONS, } from './identity/account-vault.js';
|
|
23
|
+
export { deriveContactKeyBytes, deriveDoorKeyBytes, deriveDoorSignKeyBytes, contactKeyPair, contactPublicKey, isContactPublicKey, sealFor, openSealed } from './identity/contact-key.js';
|
|
23
24
|
export { createDeviceKey, getDeviceKey, deleteDeviceKey } from './identity/device-key.js';
|
|
24
25
|
export { createLocalRootSigner } from './identity/root-signer.js';
|
|
25
26
|
export { pairingRoomId, derivePairingKey, encodePairingTicket, decodePairingTicket, sealPairingPayload, openPairingPayload, } from './identity/pairing.js';
|
|
@@ -31,7 +32,6 @@ export { createSigner, } from './schema/signer.js';
|
|
|
31
32
|
export { createExpression, canonicalize, serializeExpression, deserializeExpression, getExpressionId, signedPart, } from './schema/expression.js';
|
|
32
33
|
// Phase 3: Local Storage & State
|
|
33
34
|
export { createIndexedDBAdapter, } from './storage/indexeddb-adapter.js';
|
|
34
|
-
export { createEmptyNode, insertIntoMST, deleteFromMST, lookupInMST, listMSTEntries, collectReachableCids, } from './storage/mst.js';
|
|
35
35
|
export { createStorageProvider, } from './storage/storage-provider.js';
|
|
36
36
|
// Storage in a folder the user owns — the one store that is not origin-scoped
|
|
37
37
|
export { createFolderAdapter, readFolderFile, writeFolderFile, } from './storage/folder-adapter.js';
|
|
@@ -40,7 +40,7 @@ export { reconcileFolder } from './storage/folder-reconcile.js';
|
|
|
40
40
|
export { isFolderStorageAvailable, pickDataFolder, queryFolderPermission, ensureFolderPermission, rememberDataFolder, recallDataFolder, forgetDataFolder, } from './storage/directory-access.js';
|
|
41
41
|
// Spaces
|
|
42
42
|
export { createSpaceManager, parseSpaceInvite } from './space/space-manager.js';
|
|
43
|
-
export { deriveAccountRegistry, MEMBERSHIP_COLLECTION } from './space/account-registry.js';
|
|
43
|
+
export { deriveAccountRegistry, deriveContactsSpace, MEMBERSHIP_COLLECTION } from './space/account-registry.js';
|
|
44
44
|
export { CATALOG_COLLECTION, checkStoredCollection, checkPublishableSchema, validateJsonSchema, asStandardSchema, toJsonSchema, collection, } from './schema/collection-def.js';
|
|
45
45
|
export { generateInviteSecret, deriveInviteKey, deriveReadKey, spaceGenesis, spaceIdOf, checkSpace, checkStartingRoles, memberKey, inviteKey, revokeKey, roleKey, signInvite, verifyInvite, } from './space/space-access.js';
|
|
46
46
|
export { replayAccess, permissionMatches, roleHolds, holds, standing, checkRole, MANAGE, INVITE, DEFINE, ROLE_COLLECTION, MEMBER_COLLECTION, INVITE_COLLECTION, REVOKE_COLLECTION, ACCESS_COLLECTIONS, } from './space/roles.js';
|
|
@@ -56,7 +56,7 @@ export { createMesh } from './network/mesh.js';
|
|
|
56
56
|
export { createNetworkManager, } from './network/network-manager.js';
|
|
57
57
|
// Phase 5: Gossip/Sync Protocol
|
|
58
58
|
export { parseSyncMessage, SYNC_PROTOCOL_VERSION, } from './sync/sync-messages.js';
|
|
59
|
-
export {
|
|
59
|
+
export { createReconciler, ItemSet, fingerprintOf, } from './sync/negentropy.js';
|
|
60
60
|
export { createSyncEngine, } from './sync/sync-engine.js';
|
|
61
61
|
// Phase 6: Validation Engine
|
|
62
62
|
export { createCryptoGate, } from './validation/crypto-gate.js';
|
|
@@ -74,7 +74,7 @@ export { sha256, cidFromBytes } from './utils/hash.js';
|
|
|
74
74
|
export { protocolError, isProtocolError } from './utils/errors.js';
|
|
75
75
|
export { createEmitter } from './utils/events.js';
|
|
76
76
|
// Node: identity + spaces + sync, behind one API
|
|
77
|
-
export { createNode, SESSION_CAPABILITY, writeCapability, relayRoom, indexedDBStores, folderStores, copyAccountData, NODE_ACTIONS, runAction, checkActionInput, } from './node/index.js';
|
|
77
|
+
export { createNode, SESSION_CAPABILITY, writeCapability, relayRoom, indexedDBStores, folderStores, copyAccountData, NODE_ACTIONS, runAction, checkActionInput, createCarrierNode, createHostNode, NotAllowedError, } from './node/index.js';
|
|
78
78
|
// Queries: plain-data filters, sorting, paging and includes over a space
|
|
79
79
|
export { runQuery } from './query/engine.js';
|
|
80
80
|
export { matches, checkQuery, fieldValue, MAX_INCLUDE_DEPTH } from './query/filter.js';
|
|
@@ -82,4 +82,9 @@ export { plainQuery } from './query/types.js';
|
|
|
82
82
|
// Rules: who may create, edit and delete a collection's records, what must be unique
|
|
83
83
|
export { checkRules, onePerKey } from './records/rules.js';
|
|
84
84
|
export { describeCollection } from './records/describe.js';
|
|
85
|
+
// Hosting: a subscription key, signed requests to a host, and a client for one
|
|
86
|
+
export { HOSTING_COLLECTION, REQUEST_WINDOW_SECONDS, newSubscriptionSeed, subscriptionKey, signRequest, verifyRequest, createHostClient, describeHost, signStatus, readStatus, payLink, verifyPayLink, HOST_DESCRIPTION_PATH, PAY_LINK_SECONDS, HostError, } from './session/hosting.js';
|
|
87
|
+
export { createMemoryBlobStore } from './storage/blob/memory.js';
|
|
88
|
+
export { createS3BlobStore } from './storage/blob/s3.js';
|
|
89
|
+
export { createMirror, deleteMirrored } from './storage/mirror.js';
|
|
85
90
|
//# 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;;;;;;;;;GASG;AAwBH,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAErC,qCAAqC;AACrC,OAAO,EACL,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EACL,aAAa,EACb,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,YAAY,GACb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAwBH,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAErC,qCAAqC;AACrC,OAAO,EACL,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EACL,aAAa,EACb,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAA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AsB,CAAC;AAK9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/network/index.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ export { createNetworkManager } from './network-manager.js';
|
|
|
14
14
|
export type { NetworkManager, NetworkManagerConfig, NetworkEvents } from './network-manager.js';
|
|
15
15
|
export { createLocalHub } from './local-transport.js';
|
|
16
16
|
export type { LocalHub } from './local-transport.js';
|
|
17
|
+
export { createMailboxClient } from './mailbox.js';
|
|
18
|
+
export type { MailboxClient, MailboxOptions, MailItem } from './mailbox.js';
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEzF,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM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/index.js
CHANGED
|
@@ -7,4 +7,5 @@ export { createWebSocketTransport } from './ws-transport.js';
|
|
|
7
7
|
export { createMesh } from './mesh.js';
|
|
8
8
|
export { createNetworkManager } from './network-manager.js';
|
|
9
9
|
export { createLocalHub } from './local-transport.js';
|
|
10
|
+
export { createMailboxClient } from './mailbox.js';
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAKvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAKvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module network/mailbox
|
|
3
|
+
* Talking to a relay's mailbox: leaving a sealed knock under a door's topic,
|
|
4
|
+
* and reading what was left under one's own (`server/relay.mjs`).
|
|
5
|
+
*
|
|
6
|
+
* Each call opens its own short-lived socket, says one thing, waits for the
|
|
7
|
+
* answer and closes. A mailbox socket never joins a room, so it names no DID,
|
|
8
|
+
* and the relay can't tie a knock to the peer that left it or fetched it.
|
|
9
|
+
*
|
|
10
|
+
* client → { type: 'drop', topic, blob, ttl? } relay → { type: 'dropped', topic, id } | { type: 'refused', topic, reason }
|
|
11
|
+
* client → { type: 'fetch', topic, after? } relay → { type: 'mail', topic, items: [{ seq, id, at, blob }], more }
|
|
12
|
+
* client → { type: 'challenge' } relay → { type: 'challenge', nonce }
|
|
13
|
+
* client → { type: 'purge', topic, sign, ids?, sig } relay → { type: 'purged', topic, count } | { type: 'refused', topic, reason }
|
|
14
|
+
*/
|
|
15
|
+
/** One sealed knock, as a relay holds it */
|
|
16
|
+
export interface MailItem {
|
|
17
|
+
/** Increases with every drop on that relay */
|
|
18
|
+
readonly seq: number;
|
|
19
|
+
/** base64url SHA-256 of the blob: the same on every relay it was left at */
|
|
20
|
+
readonly id: string;
|
|
21
|
+
/** When it was dropped, ms, by the relay's clock */
|
|
22
|
+
readonly at: number;
|
|
23
|
+
readonly blob: string;
|
|
24
|
+
}
|
|
25
|
+
export interface MailboxClient {
|
|
26
|
+
/**
|
|
27
|
+
* Leaves a blob under a topic.
|
|
28
|
+
* @returns The id the relay filed it under
|
|
29
|
+
* @throws When the relay refuses it, or can't be reached
|
|
30
|
+
*/
|
|
31
|
+
drop(relay: string, topic: string, blob: string, ttlSeconds?: number): Promise<string>;
|
|
32
|
+
/** Everything a relay holds under a topic, after a sequence number */
|
|
33
|
+
fetch(relay: string, topic: string, after?: number): Promise<ReadonlyArray<MailItem>>;
|
|
34
|
+
/**
|
|
35
|
+
* Clears knocks from a topic — all of them, or those named — as the door's
|
|
36
|
+
* owner: shows the signing key and signs the relay's challenge with it.
|
|
37
|
+
* @param signChallenge Signs a nonce for these ids (`signPurge`)
|
|
38
|
+
* @returns How many the relay let go
|
|
39
|
+
*/
|
|
40
|
+
purge(relay: string, topic: string, sign: string, ids: ReadonlyArray<string> | null, signChallenge: (nonce: string) => Promise<string>): Promise<number>;
|
|
41
|
+
}
|
|
42
|
+
export interface MailboxOptions {
|
|
43
|
+
/** How long to wait for a relay to answer. Default 8 seconds. */
|
|
44
|
+
readonly timeoutMs?: number;
|
|
45
|
+
/** The WebSocket to use. Default the global one (browsers, Node 22+). */
|
|
46
|
+
readonly WebSocket?: typeof WebSocket;
|
|
47
|
+
}
|
|
48
|
+
export declare function createMailboxClient(options?: MailboxOptions): MailboxClient;
|
|
49
|
+
//# sourceMappingURL=mailbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../src/network/mailbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,4CAA4C;AAC5C,MAAM,WAAW,QAAQ;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvF,sEAAsE;IACtE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtF;;;;;OAKG;IACH,KAAK,CACH,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,EACjC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAChD,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,SAAS,CAAC;CACvC;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CAsG/E"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module network/mailbox
|
|
3
|
+
* Talking to a relay's mailbox: leaving a sealed knock under a door's topic,
|
|
4
|
+
* and reading what was left under one's own (`server/relay.mjs`).
|
|
5
|
+
*
|
|
6
|
+
* Each call opens its own short-lived socket, says one thing, waits for the
|
|
7
|
+
* answer and closes. A mailbox socket never joins a room, so it names no DID,
|
|
8
|
+
* and the relay can't tie a knock to the peer that left it or fetched it.
|
|
9
|
+
*
|
|
10
|
+
* client → { type: 'drop', topic, blob, ttl? } relay → { type: 'dropped', topic, id } | { type: 'refused', topic, reason }
|
|
11
|
+
* client → { type: 'fetch', topic, after? } relay → { type: 'mail', topic, items: [{ seq, id, at, blob }], more }
|
|
12
|
+
* client → { type: 'challenge' } relay → { type: 'challenge', nonce }
|
|
13
|
+
* client → { type: 'purge', topic, sign, ids?, sig } relay → { type: 'purged', topic, count } | { type: 'refused', topic, reason }
|
|
14
|
+
*/
|
|
15
|
+
/** At most this many pages per fetch: 16 knocks each, and a door holds 64 */
|
|
16
|
+
const MAX_PAGES = 8;
|
|
17
|
+
export function createMailboxClient(options = {}) {
|
|
18
|
+
const timeoutMs = options.timeoutMs ?? 8000;
|
|
19
|
+
/** Opens a socket, sends one message, and resolves with the first answer `pick` accepts */
|
|
20
|
+
function ask(relay, message, pick) {
|
|
21
|
+
return talk(relay, (send) => send(message), async (answer) => pick(answer));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Opens a socket and holds a short conversation: `start` says the first
|
|
25
|
+
* thing, `hear` answers what comes back (it may `send` again) and settles it
|
|
26
|
+
* by returning a value.
|
|
27
|
+
*/
|
|
28
|
+
function talk(relay, start, hear) {
|
|
29
|
+
const Socket = options.WebSocket ?? globalThis.WebSocket;
|
|
30
|
+
if (!Socket)
|
|
31
|
+
return Promise.reject(new Error('No WebSocket here to reach a relay with'));
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
let settled = false;
|
|
34
|
+
const ws = new Socket(relay);
|
|
35
|
+
const finish = (error, value) => {
|
|
36
|
+
if (settled)
|
|
37
|
+
return;
|
|
38
|
+
settled = true;
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
try {
|
|
41
|
+
ws.close();
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// already closing
|
|
45
|
+
}
|
|
46
|
+
if (error)
|
|
47
|
+
reject(error);
|
|
48
|
+
else
|
|
49
|
+
resolve(value);
|
|
50
|
+
};
|
|
51
|
+
const timer = setTimeout(() => finish(new Error(`${relay} did not answer`)), timeoutMs);
|
|
52
|
+
const say = (message) => ws.send(JSON.stringify(message));
|
|
53
|
+
ws.onopen = () => start(say);
|
|
54
|
+
ws.onerror = () => finish(new Error(`Could not reach ${relay}`));
|
|
55
|
+
ws.onclose = () => finish(new Error(`${relay} closed the connection`));
|
|
56
|
+
ws.onmessage = (event) => {
|
|
57
|
+
let answer;
|
|
58
|
+
try {
|
|
59
|
+
answer = JSON.parse(String(event.data));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (!answer || typeof answer !== 'object')
|
|
65
|
+
return;
|
|
66
|
+
hear(answer, say).then((value) => {
|
|
67
|
+
if (value !== undefined)
|
|
68
|
+
finish(null, value);
|
|
69
|
+
}, (error) => finish(error instanceof Error ? error : new Error(String(error))));
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const client = {
|
|
74
|
+
drop(relay, topic, blob, ttlSeconds) {
|
|
75
|
+
return ask(relay, { type: 'drop', topic, blob, ...(ttlSeconds ? { ttl: ttlSeconds } : {}) }, (answer) => {
|
|
76
|
+
if (answer.topic !== topic)
|
|
77
|
+
return undefined;
|
|
78
|
+
if (answer.type === 'dropped' && typeof answer.id === 'string')
|
|
79
|
+
return answer.id;
|
|
80
|
+
if (answer.type === 'refused')
|
|
81
|
+
throw new Error(`${relay} refused the knock: ${String(answer.reason ?? 'no reason given')}`);
|
|
82
|
+
return undefined;
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
async fetch(relay, topic, after = 0) {
|
|
86
|
+
const found = [];
|
|
87
|
+
let from = after;
|
|
88
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
89
|
+
const { items, more } = await ask(relay, { type: 'fetch', topic, after: from }, (answer) => answer.type === 'mail' && answer.topic === topic && Array.isArray(answer.items)
|
|
90
|
+
? { items: answer.items.filter(isMailItem), more: answer.more === true }
|
|
91
|
+
: undefined);
|
|
92
|
+
found.push(...items);
|
|
93
|
+
if (!more || items.length === 0)
|
|
94
|
+
break;
|
|
95
|
+
from = Math.max(...items.map((item) => item.seq));
|
|
96
|
+
}
|
|
97
|
+
return found;
|
|
98
|
+
},
|
|
99
|
+
purge(relay, topic, sign, ids, signChallenge) {
|
|
100
|
+
return talk(relay, (send) => send({ type: 'challenge' }), async (answer, send) => {
|
|
101
|
+
if (answer.type === 'challenge' && typeof answer.nonce === 'string') {
|
|
102
|
+
send({ type: 'purge', topic, sign, ...(ids ? { ids: [...ids] } : {}), sig: await signChallenge(answer.nonce) });
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
if (answer.topic !== topic)
|
|
106
|
+
return undefined;
|
|
107
|
+
if (answer.type === 'purged' && typeof answer.count === 'number')
|
|
108
|
+
return answer.count;
|
|
109
|
+
if (answer.type === 'refused')
|
|
110
|
+
throw new Error(`${relay} refused to clear the door: ${String(answer.reason ?? 'no reason given')}`);
|
|
111
|
+
return undefined;
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
return Object.freeze(client);
|
|
116
|
+
}
|
|
117
|
+
function isMailItem(value) {
|
|
118
|
+
const item = value;
|
|
119
|
+
return (!!item &&
|
|
120
|
+
Number.isSafeInteger(item.seq) &&
|
|
121
|
+
typeof item.id === 'string' &&
|
|
122
|
+
typeof item.at === 'number' &&
|
|
123
|
+
typeof item.blob === 'string');
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=mailbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../../src/network/mailbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA4CH,6EAA6E;AAC7E,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,UAAU,mBAAmB,CAAC,UAA0B,EAAE;IAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;IAE5C,2FAA2F;IAC3F,SAAS,GAAG,CAAI,KAAa,EAAE,OAAgB,EAAE,IAAwD;QACvG,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED;;;;OAIG;IACH,SAAS,IAAI,CACX,KAAa,EACb,KAAiD,EACjD,IAAmG;QAEnG,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC;QACzD,IAAI,CAAC,MAAM;YAAE,OAAO,OAAO,CAAC,MAAM,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