@agora-sdk/secure-chat-core 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cjs/content/builders.d.ts +40 -0
  2. package/dist/cjs/content/builders.js +85 -0
  3. package/dist/cjs/content/builders.js.map +1 -0
  4. package/dist/cjs/content/cbor.d.ts +48 -0
  5. package/dist/cjs/content/cbor.js +298 -0
  6. package/dist/cjs/content/cbor.js.map +1 -0
  7. package/dist/cjs/content/frame.d.ts +24 -0
  8. package/dist/cjs/content/frame.js +39 -0
  9. package/dist/cjs/content/frame.js.map +1 -0
  10. package/dist/cjs/content/mimi-content.d.ts +194 -0
  11. package/dist/cjs/content/mimi-content.js +289 -0
  12. package/dist/cjs/content/mimi-content.js.map +1 -0
  13. package/dist/cjs/hooks/message-fold.d.ts +91 -0
  14. package/dist/cjs/hooks/message-fold.js +218 -0
  15. package/dist/cjs/hooks/message-fold.js.map +1 -0
  16. package/dist/cjs/hooks/useSecureMessages.d.ts +30 -18
  17. package/dist/cjs/hooks/useSecureMessages.js +190 -238
  18. package/dist/cjs/hooks/useSecureMessages.js.map +1 -1
  19. package/dist/cjs/index.d.ts +7 -0
  20. package/dist/cjs/index.js +27 -1
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/cjs/persistence/repository.d.ts +11 -11
  23. package/dist/cjs/persistence/repository.js +19 -19
  24. package/dist/cjs/persistence/repository.js.map +1 -1
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/content/builders.d.ts +40 -0
  28. package/dist/esm/content/builders.js +77 -0
  29. package/dist/esm/content/builders.js.map +1 -0
  30. package/dist/esm/content/cbor.d.ts +48 -0
  31. package/dist/esm/content/cbor.js +292 -0
  32. package/dist/esm/content/cbor.js.map +1 -0
  33. package/dist/esm/content/frame.d.ts +24 -0
  34. package/dist/esm/content/frame.js +34 -0
  35. package/dist/esm/content/frame.js.map +1 -0
  36. package/dist/esm/content/mimi-content.d.ts +194 -0
  37. package/dist/esm/content/mimi-content.js +283 -0
  38. package/dist/esm/content/mimi-content.js.map +1 -0
  39. package/dist/esm/hooks/message-fold.d.ts +91 -0
  40. package/dist/esm/hooks/message-fold.js +214 -0
  41. package/dist/esm/hooks/message-fold.js.map +1 -0
  42. package/dist/esm/hooks/useSecureMessages.d.ts +30 -18
  43. package/dist/esm/hooks/useSecureMessages.js +192 -240
  44. package/dist/esm/hooks/useSecureMessages.js.map +1 -1
  45. package/dist/esm/index.d.ts +7 -0
  46. package/dist/esm/index.js +6 -0
  47. package/dist/esm/index.js.map +1 -1
  48. package/dist/esm/persistence/repository.d.ts +11 -11
  49. package/dist/esm/persistence/repository.js +19 -19
  50. package/dist/esm/persistence/repository.js.map +1 -1
  51. package/dist/esm/version.d.ts +1 -1
  52. package/dist/esm/version.js +1 -1
  53. package/package.json +3 -2
@@ -31,5 +31,12 @@ export { padPlaintext, unpadPlaintext, nextBucket } from "./util/padding.js";
31
31
  export type { PaddingPolicy } from "./util/padding.js";
32
32
  export { computeSafetyNumber } from "./util/safety-number.js";
33
33
  export type { SafetyNumber } from "./util/safety-number.js";
34
+ export { encodeMimiContent, decodeMimiContent, contentHash, Cardinality, Disposition, HashAlg, PartSemantics, MIMI_LIMITS, } from "./content/mimi-content.js";
35
+ export type { MimiContent, Part, NullPart, SinglePart, ExternalPart, MultiPart, Expiration, } from "./content/mimi-content.js";
36
+ export { buildPost, buildReply, buildEdit, buildDelete, buildReaction, buildUnreact, } from "./content/builders.js";
37
+ export { frameContent, unframe, ContentKind } from "./content/frame.js";
38
+ export type { RenderedContent } from "./hooks/message-fold.js";
39
+ export { encode as encodeCbor, decode as decodeCbor, CborTag } from "./content/cbor.js";
40
+ export type { CborValue, CborMap, CborLimits } from "./content/cbor.js";
34
41
  export { setSecureChatDebug, isSecureChatDebugEnabled } from "./util/debug.js";
35
42
  export type { SecureChatDebugLevel, SecureChatDebugLogger } from "./util/debug.js";
package/dist/esm/index.js CHANGED
@@ -26,6 +26,12 @@ export { SecureChatRepository } from "./persistence/repository.js";
26
26
  export { toBase64, fromBase64, utf8ToBytes, bytesToUtf8 } from "./util/base64.js";
27
27
  export { padPlaintext, unpadPlaintext, nextBucket } from "./util/padding.js";
28
28
  export { computeSafetyNumber } from "./util/safety-number.js";
29
+ // ── MIMI content (CBOR message content + routing frame + fold) ─────────────────
30
+ export { encodeMimiContent, decodeMimiContent, contentHash, Cardinality, Disposition, HashAlg, PartSemantics, MIMI_LIMITS, } from "./content/mimi-content.js";
31
+ export { buildPost, buildReply, buildEdit, buildDelete, buildReaction, buildUnreact, } from "./content/builders.js";
32
+ export { frameContent, unframe, ContentKind } from "./content/frame.js";
33
+ // Low-level CBOR codec (advanced; the IUC control channel reuses it under kind 1).
34
+ export { encode as encodeCbor, decode as decodeCbor, CborTag } from "./content/cbor.js";
29
35
  // ── dev logging (off by default; see util/debug) ──────────────────────────────
30
36
  export { setSecureChatDebug, isSecureChatDebugEnabled } from "./util/debug.js";
31
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,EAAE;AACF,6FAA6F;AAC7F,+FAA+F;AAC/F,4DAA4D;AAE5D,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,+EAA+E;AAC/E,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAMrF,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAMjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAKrE,OAAO,EAAE,eAAe,EAAE,MA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,iBAAiB,CAAC"}
@@ -28,29 +28,29 @@ export declare class SecureChatRepository {
28
28
  /** List the conversation ids that have persisted group state. */
29
29
  listGroupConversationIds(): Promise<string[]>;
30
30
  /**
31
- * Persist the decrypted plaintext of a message (local-only, decrypt-once history).
31
+ * Persist the decrypted content-frame bytes of a message (local-only, decrypt-once history).
32
32
  *
33
- * Called after a message is successfully decrypted (or, for our own sends, the known plaintext).
34
- * The single-use MLS key is consumed by that one decrypt, so this stored copy not the ratchet —
35
- * is what renders the message on every later reload. The blind server never receives this; it lives
33
+ * Stores the `[kind][payload]` frame exactly as decrypted (raw bytes NOT text): MLS application
34
+ * keys are single-use (forward secrecy), so a message decrypts exactly once; this stored copy is what
35
+ * the hook re-decodes + re-folds on every later reload. The blind server never receives this; it lives
36
36
  * only in the platform store (web: IndexedDB; tests: MemoryStore).
37
37
  *
38
38
  * @param conversationId - The conversation the message belongs to.
39
39
  * @param messageId - The globally-unique server message id.
40
- * @param plaintext - The decoded UTF-8 message text.
40
+ * @param content - The decrypted content-frame bytes (`[kind][payload]`, post-unpadding).
41
41
  */
42
- saveMessagePlaintext(conversationId: string, messageId: string, plaintext: string): Promise<void>;
42
+ saveMessageContent(conversationId: string, messageId: string, content: Uint8Array): Promise<void>;
43
43
  /**
44
- * Load a message's previously-decrypted plaintext, or `null` if it was never stored.
44
+ * Load a message's previously-decrypted content-frame bytes, or `null` if never stored.
45
45
  *
46
- * A non-null result lets the decrypt path short-circuit BEFORE touching the MLS ratchet — essential
47
- * because re-decrypting would throw `"Desired gen in the past"` (the key is gone after first use).
46
+ * A non-null result lets the decrypt path short-circuit BEFORE touching the MLS ratchet — re-decrypting
47
+ * would throw `"Desired gen in the past"` (the key is gone after first use).
48
48
  *
49
49
  * @param conversationId - The conversation the message belongs to.
50
50
  * @param messageId - The globally-unique server message id.
51
- * @returns The stored UTF-8 plaintext, or `null` on a miss.
51
+ * @returns The stored content-frame bytes, or `null` on a miss.
52
52
  */
53
- loadMessagePlaintext(conversationId: string, messageId: string): Promise<string | null>;
53
+ loadMessageContent(conversationId: string, messageId: string): Promise<Uint8Array | null>;
54
54
  /** Load this device row's persisted handshake delivery cursor (`seq`), or `null`. */
55
55
  loadHandshakeCursor(deviceRowId: string): Promise<string | null>;
56
56
  /** Persist this device row's handshake delivery cursor (`seq`). */
@@ -12,11 +12,12 @@ const GROUP_PREFIX = "group:";
12
12
  // and receives its own Welcome. A global key let a stale cursor outlive its device and mask the
13
13
  // Welcome whose `seq` it had already passed (the handshakes query is strictly `seq > since`).
14
14
  const CURSOR_PREFIX = "handshake:cursor:";
15
- // Decrypted message plaintext, keyed `msg:<conversationId>:<messageId>` (messageId is a globally-
16
- // unique server uuid). This is the durable conversation history: MLS application keys are single-use
17
- // (forward secrecy), so a message can be decrypted exactly once — we persist that one plaintext so
18
- // reload renders history from the store instead of replaying the (consumed) ratchet. Plaintext at
19
- // rest here is LOCAL ONLY; the blind server never sees it. See store.ts for the at-rest posture.
15
+ // Decrypted content-frame bytes (`[kind][payload]`), keyed `msg:<conversationId>:<messageId>`
16
+ // (messageId is a globally-unique server uuid). This is the durable conversation history: MLS
17
+ // application keys are single-use (forward secrecy), so a message can be decrypted exactly once —
18
+ // we persist these bytes so reload re-decodes + re-folds from the store instead of replaying the
19
+ // (consumed) ratchet. Stored LOCAL ONLY; the blind server never sees it. See store.ts for the
20
+ // at-rest posture.
20
21
  const MESSAGE_PREFIX = "msg:";
21
22
  /** Typed persistence for device identity, per-conversation group state, and the handshake cursor. */
22
23
  export class SecureChatRepository {
@@ -62,33 +63,32 @@ export class SecureChatRepository {
62
63
  return keys.map((k) => k.slice(GROUP_PREFIX.length));
63
64
  }
64
65
  /**
65
- * Persist the decrypted plaintext of a message (local-only, decrypt-once history).
66
+ * Persist the decrypted content-frame bytes of a message (local-only, decrypt-once history).
66
67
  *
67
- * Called after a message is successfully decrypted (or, for our own sends, the known plaintext).
68
- * The single-use MLS key is consumed by that one decrypt, so this stored copy not the ratchet —
69
- * is what renders the message on every later reload. The blind server never receives this; it lives
68
+ * Stores the `[kind][payload]` frame exactly as decrypted (raw bytes NOT text): MLS application
69
+ * keys are single-use (forward secrecy), so a message decrypts exactly once; this stored copy is what
70
+ * the hook re-decodes + re-folds on every later reload. The blind server never receives this; it lives
70
71
  * only in the platform store (web: IndexedDB; tests: MemoryStore).
71
72
  *
72
73
  * @param conversationId - The conversation the message belongs to.
73
74
  * @param messageId - The globally-unique server message id.
74
- * @param plaintext - The decoded UTF-8 message text.
75
+ * @param content - The decrypted content-frame bytes (`[kind][payload]`, post-unpadding).
75
76
  */
76
- async saveMessagePlaintext(conversationId, messageId, plaintext) {
77
- await this.store.set(MESSAGE_PREFIX + conversationId + ":" + messageId, utf8ToBytes(plaintext));
77
+ async saveMessageContent(conversationId, messageId, content) {
78
+ await this.store.set(MESSAGE_PREFIX + conversationId + ":" + messageId, content);
78
79
  }
79
80
  /**
80
- * Load a message's previously-decrypted plaintext, or `null` if it was never stored.
81
+ * Load a message's previously-decrypted content-frame bytes, or `null` if never stored.
81
82
  *
82
- * A non-null result lets the decrypt path short-circuit BEFORE touching the MLS ratchet — essential
83
- * because re-decrypting would throw `"Desired gen in the past"` (the key is gone after first use).
83
+ * A non-null result lets the decrypt path short-circuit BEFORE touching the MLS ratchet — re-decrypting
84
+ * would throw `"Desired gen in the past"` (the key is gone after first use).
84
85
  *
85
86
  * @param conversationId - The conversation the message belongs to.
86
87
  * @param messageId - The globally-unique server message id.
87
- * @returns The stored UTF-8 plaintext, or `null` on a miss.
88
+ * @returns The stored content-frame bytes, or `null` on a miss.
88
89
  */
89
- async loadMessagePlaintext(conversationId, messageId) {
90
- const bytes = await this.store.get(MESSAGE_PREFIX + conversationId + ":" + messageId);
91
- return bytes ? bytesToUtf8(bytes) : null;
90
+ async loadMessageContent(conversationId, messageId) {
91
+ return this.store.get(MESSAGE_PREFIX + conversationId + ":" + messageId);
92
92
  }
93
93
  /** Load this device row's persisted handshake delivery cursor (`seq`), or `null`. */
94
94
  async loadHandshakeC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AG,cAAc,GAAG,GAAG,GAAG,SAAS,CAAC,CAAC;IAC3E,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,mBAAmB,CAAC,WAAmB;QAC3C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,GAAG,WAAW,CAAC,CAAC;QAChE,OAAO,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED,mEAAmE;IACnE,KAAK,CAAC,mBAAmB,CAAC,WAAmB,EAAE,GAAW;QACxD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,GAAG,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,uEAAuE;IACvE,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF"}
@@ -10,4 +10,4 @@
10
10
  * console.log(`secure-chat SDK ${VERSION}`);
11
11
  * ```
12
12
  */
13
- export declare const VERSION = "0.7.0";
13
+ export declare const VERSION = "0.8.0";
@@ -12,5 +12,5 @@
12
12
  * console.log(`secure-chat SDK ${VERSION}`);
13
13
  * ```
14
14
  */
15
- export const VERSION = "0.7.0";
15
+ export const VERSION = "0.8.0";
16
16
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agora-sdk/secure-chat-core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "author": "Agora SDK Plus, maintained by Jenova Marie",
@@ -36,9 +36,10 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@agora-server/contract": "^0.9.3",
39
+ "@noble/hashes": "2.0.1",
39
40
  "axios": "^1.4.0",
40
41
  "socket.io-client": "^4.8.1",
41
- "@agora-sdk/secure-chat-crypto": "0.7.0"
42
+ "@agora-sdk/secure-chat-crypto": "0.8.0"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "react": "^18.0.0 || ^19.0.0"