@keyhive/keyhive 0.0.0-alpha.54i → 0.0.0-alpha.54z
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/package.json +4 -4
- package/pkg/keyhive_wasm.d.ts +21 -0
- package/pkg/keyhive_wasm_bg.js +151 -123
- package/pkg/keyhive_wasm_bg.wasm +0 -0
- package/pkg/keyhive_wasm_bg.wasm.d.ts +94 -93
- package/pkg-node/keyhive_wasm.d.ts +21 -0
- package/pkg-node/keyhive_wasm.js +152 -124
- package/pkg-node/keyhive_wasm_bg.wasm +0 -0
- package/pkg-node/keyhive_wasm_bg.wasm.d.ts +94 -93
- package/pkg-slim/keyhive_wasm.d.ts +115 -93
- package/pkg-slim/keyhive_wasm.js +151 -123
- package/pkg-slim/keyhive_wasm_bg.wasm +0 -0
- package/pkg-slim/keyhive_wasm_bg.wasm.base64.js +1 -1
- package/pkg-slim/keyhive_wasm_bg.wasm.d.ts +94 -93
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyhive/keyhive",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.54z",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "pkg/keyhive_wasm.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "pnpm run build-node && pnpm run build-bundler && pnpm run build-slim",
|
|
54
|
-
"build-node": "wasm-pack build --out-dir pkg-node --target nodejs --
|
|
55
|
-
"build-bundler": "wasm-pack build --out-dir pkg --target bundler --
|
|
56
|
-
"build-web": "wasm-pack build --out-dir pkg-web --target web --
|
|
54
|
+
"build-node": "wasm-pack build --out-dir pkg-node --target nodejs --profiling",
|
|
55
|
+
"build-bundler": "wasm-pack build --out-dir pkg --target bundler --profiling",
|
|
56
|
+
"build-web": "wasm-pack build --out-dir pkg-web --target web --profiling",
|
|
57
57
|
"build-slim": "node build_slim.js",
|
|
58
58
|
"copy-e2e": "cp -r pkg-slim/* e2e/server/pkg/"
|
|
59
59
|
}
|
package/pkg/keyhive_wasm.d.ts
CHANGED
|
@@ -252,6 +252,27 @@ export class Keyhive {
|
|
|
252
252
|
[Symbol.dispose](): void;
|
|
253
253
|
accessForDoc(id: Identifier, doc_id: DocumentId): Promise<Access | undefined>;
|
|
254
254
|
addMember(to_add: Agent, membered: Membered, access: Access, other_relevant_docs: Document[]): Promise<SignedDelegation>;
|
|
255
|
+
/**
|
|
256
|
+
* Returns a two-tier structure for memory-efficient hash/event storage across all agents.
|
|
257
|
+
*
|
|
258
|
+
* Returns a JS object with two fields:
|
|
259
|
+
* - `sources`: Map<string(sourceId), Map<Uint8Array(hash), Uint8Array(eventBytes)>>
|
|
260
|
+
* Each source (group, doc, or identifier) maps to its event hashes and bytes.
|
|
261
|
+
* Each event is serialized exactly once and shared across all agents that reference it.
|
|
262
|
+
* - `index`: Map<Uint8Array(agentId), Array<string(sourceId)>>
|
|
263
|
+
* Each agent maps to the list of source IDs whose events are reachable by that agent.
|
|
264
|
+
*
|
|
265
|
+
* The JS consumer stores sources once and agents just reference source IDs,
|
|
266
|
+
* avoiding duplicating hash sets across agents that share groups/docs.
|
|
267
|
+
* Returns all agent events in a structure optimized for the OpCache.
|
|
268
|
+
*
|
|
269
|
+
* Returns `{ events, prekeySources, agentPrekeySources, agentMembershipHashes }`:
|
|
270
|
+
* - `events`: `Map<Uint8Array(hash), Uint8Array(eventBytes)>` — all events, deduplicated
|
|
271
|
+
* - `prekeySources`: `Map<Uint8Array(identifierBytes), Uint8Array[](hashes)>` — shared prekey sources by identifier
|
|
272
|
+
* - `agentPrekeySources`: `Map<Uint8Array(agentId), Uint8Array[](identifierBytes)>` — agent → prekey source identifiers
|
|
273
|
+
* - `agentMembershipHashes`: `Map<Uint8Array(agentId), Uint8Array[](hashes)>` — agent → membership hashes (flat)
|
|
274
|
+
*/
|
|
275
|
+
allAgentEvents(): Promise<any>;
|
|
255
276
|
contactCard(): Promise<ContactCard>;
|
|
256
277
|
docMemberCapabilities(doc_id: DocumentId): Promise<Membership[]>;
|
|
257
278
|
/**
|