@open-e2ee/signal-protocol-sdk 7.2.0 → 8.1.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 (721) hide show
  1. package/ADAPTERS.md +55 -8
  2. package/ARCHITECTURE.md +1 -0
  3. package/CHANGELOG.md +538 -0
  4. package/README.md +10 -6
  5. package/SECURITY.md +2 -2
  6. package/THIRD_PARTY_NOTICES.md +429 -0
  7. package/client/README.md +1 -2
  8. package/device/README.md +50 -19
  9. package/dist/client/client.d.ts +31 -5
  10. package/dist/client/client.d.ts.map +1 -1
  11. package/dist/client/client.js +151 -91
  12. package/dist/client/client.js.map +1 -1
  13. package/dist/client/event-hooks.d.ts.map +1 -1
  14. package/dist/client/event-hooks.js +2 -0
  15. package/dist/client/event-hooks.js.map +1 -1
  16. package/dist/client/files.d.ts.map +1 -1
  17. package/dist/client/files.js +19 -2
  18. package/dist/client/files.js.map +1 -1
  19. package/dist/client/headless.d.ts +1 -1
  20. package/dist/client/headless.js +1 -1
  21. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  22. package/dist/client/hosted-anonymous-delivery.js +2 -1
  23. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  24. package/dist/client/hosted-connection.d.ts +1 -1
  25. package/dist/client/hosted-connection.d.ts.map +1 -1
  26. package/dist/client/hosted-connection.js +8 -12
  27. package/dist/client/hosted-connection.js.map +1 -1
  28. package/dist/client/hosted-group-authority.d.ts.map +1 -1
  29. package/dist/client/hosted-group-authority.js +2 -1
  30. package/dist/client/hosted-group-authority.js.map +1 -1
  31. package/dist/client/hosted-groups.d.ts.map +1 -1
  32. package/dist/client/hosted-groups.js +2 -1
  33. package/dist/client/hosted-groups.js.map +1 -1
  34. package/dist/client/hosted-push.d.ts.map +1 -1
  35. package/dist/client/hosted-push.js +2 -1
  36. package/dist/client/hosted-push.js.map +1 -1
  37. package/dist/client/hosted-transport.d.ts +9 -0
  38. package/dist/client/hosted-transport.d.ts.map +1 -1
  39. package/dist/client/hosted-transport.js +59 -24
  40. package/dist/client/hosted-transport.js.map +1 -1
  41. package/dist/client/hosted-trust.d.ts +11 -11
  42. package/dist/client/hosted-trust.d.ts.map +1 -1
  43. package/dist/client/hosted-trust.js +12 -12
  44. package/dist/client/hosted-trust.js.map +1 -1
  45. package/dist/client/messages.d.ts.map +1 -1
  46. package/dist/client/messages.js +6 -1
  47. package/dist/client/messages.js.map +1 -1
  48. package/dist/client/multi-device.d.ts.map +1 -1
  49. package/dist/client/multi-device.js +2 -1
  50. package/dist/client/multi-device.js.map +1 -1
  51. package/dist/client/relay-work.d.ts +30 -0
  52. package/dist/client/relay-work.d.ts.map +1 -0
  53. package/dist/client/relay-work.js +189 -0
  54. package/dist/client/relay-work.js.map +1 -0
  55. package/dist/client/retry.d.ts.map +1 -1
  56. package/dist/client/retry.js +2 -0
  57. package/dist/client/retry.js.map +1 -1
  58. package/dist/client/sessions.d.ts.map +1 -1
  59. package/dist/client/sessions.js +3 -0
  60. package/dist/client/sessions.js.map +1 -1
  61. package/dist/client/signal-service-cipher.d.ts +19 -11
  62. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  63. package/dist/client/signal-service-cipher.js +48 -46
  64. package/dist/client/signal-service-cipher.js.map +1 -1
  65. package/dist/client/state.d.ts +8 -0
  66. package/dist/client/state.d.ts.map +1 -1
  67. package/dist/client/state.js +11 -0
  68. package/dist/client/state.js.map +1 -1
  69. package/dist/device/connection.d.ts +1 -1
  70. package/dist/device/connection.d.ts.map +1 -1
  71. package/dist/device/connection.js +4 -11
  72. package/dist/device/connection.js.map +1 -1
  73. package/dist/device/device-id.d.ts +10 -4
  74. package/dist/device/device-id.d.ts.map +1 -1
  75. package/dist/device/device-id.js +15 -9
  76. package/dist/device/device-id.js.map +1 -1
  77. package/dist/device/device-name-crypto.d.ts.map +1 -1
  78. package/dist/device/device-name-crypto.js +2 -2
  79. package/dist/device/device-name-crypto.js.map +1 -1
  80. package/dist/device/expo/index.d.ts +25 -8
  81. package/dist/device/expo/index.d.ts.map +1 -1
  82. package/dist/device/expo/index.js +58 -8
  83. package/dist/device/expo/index.js.map +1 -1
  84. package/dist/device/index.d.ts +2 -2
  85. package/dist/device/index.d.ts.map +1 -1
  86. package/dist/device/index.js +3 -2
  87. package/dist/device/index.js.map +1 -1
  88. package/dist/device/lifecycle/index.d.ts +4 -2
  89. package/dist/device/lifecycle/index.d.ts.map +1 -1
  90. package/dist/device/lifecycle/index.js.map +1 -1
  91. package/dist/device/lifecycle/manager.d.ts +12 -14
  92. package/dist/device/lifecycle/manager.d.ts.map +1 -1
  93. package/dist/device/lifecycle/manager.js +52 -97
  94. package/dist/device/lifecycle/manager.js.map +1 -1
  95. package/dist/device/lifecycle/types.d.ts +26 -16
  96. package/dist/device/lifecycle/types.d.ts.map +1 -1
  97. package/dist/device/lifecycle/utils.d.ts +8 -4
  98. package/dist/device/lifecycle/utils.d.ts.map +1 -1
  99. package/dist/device/lifecycle/utils.js +12 -16
  100. package/dist/device/lifecycle/utils.js.map +1 -1
  101. package/dist/device/provisioning.d.ts.map +1 -1
  102. package/dist/device/provisioning.js +6 -8
  103. package/dist/device/provisioning.js.map +1 -1
  104. package/dist/device/react-native/index.d.ts +40 -0
  105. package/dist/device/react-native/index.d.ts.map +1 -0
  106. package/dist/device/react-native/index.js +74 -0
  107. package/dist/device/react-native/index.js.map +1 -0
  108. package/dist/device/transfer.d.ts +15 -7
  109. package/dist/device/transfer.d.ts.map +1 -1
  110. package/dist/device/transfer.js +30 -22
  111. package/dist/device/transfer.js.map +1 -1
  112. package/dist/device/types.d.ts +15 -7
  113. package/dist/device/types.d.ts.map +1 -1
  114. package/dist/device/types.js.map +1 -1
  115. package/dist/device/vault-text.d.ts +13 -0
  116. package/dist/device/vault-text.d.ts.map +1 -0
  117. package/dist/device/vault-text.js +17 -0
  118. package/dist/device/vault-text.js.map +1 -0
  119. package/dist/index.d.ts +9 -5
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +9 -5
  122. package/dist/index.js.map +1 -1
  123. package/dist/internal/crypto/index.d.ts +3 -3
  124. package/dist/internal/crypto/index.d.ts.map +1 -1
  125. package/dist/internal/crypto/index.js +3 -3
  126. package/dist/internal/crypto/index.js.map +1 -1
  127. package/dist/internal/crypto/random-host.d.ts +1 -1
  128. package/dist/internal/crypto/random-host.d.ts.map +1 -1
  129. package/dist/internal/crypto/random-host.js +3 -2
  130. package/dist/internal/crypto/random-host.js.map +1 -1
  131. package/dist/internal/crypto/random-host.native.d.ts +6 -1
  132. package/dist/internal/crypto/random-host.native.d.ts.map +1 -1
  133. package/dist/internal/crypto/random-host.native.js +14 -10
  134. package/dist/internal/crypto/random-host.native.js.map +1 -1
  135. package/dist/internal/crypto/random-host.node.d.ts +1 -1
  136. package/dist/internal/crypto/random-host.node.d.ts.map +1 -1
  137. package/dist/internal/crypto/random-host.node.js +1 -1
  138. package/dist/internal/crypto/random-host.node.js.map +1 -1
  139. package/dist/internal/crypto/random.d.ts +12 -3
  140. package/dist/internal/crypto/random.d.ts.map +1 -1
  141. package/dist/internal/crypto/random.js +14 -3
  142. package/dist/internal/crypto/random.js.map +1 -1
  143. package/dist/internal/crypto/utils.d.ts.map +1 -1
  144. package/dist/internal/crypto/utils.js +10 -6
  145. package/dist/internal/crypto/utils.js.map +1 -1
  146. package/dist/internal/encoding/proto/primitives.d.ts +2 -0
  147. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  148. package/dist/internal/encoding/proto/primitives.js +2 -1
  149. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  150. package/dist/internal/encoding/proto/signal-message.d.ts +1 -0
  151. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  152. package/dist/internal/encoding/proto/signal-message.js +2 -1
  153. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  154. package/dist/internal/groups/authority-certificate.d.ts.map +1 -1
  155. package/dist/internal/groups/authority-certificate.js +2 -1
  156. package/dist/internal/groups/authority-certificate.js.map +1 -1
  157. package/dist/internal/groups/encrypted-state.d.ts.map +1 -1
  158. package/dist/internal/groups/encrypted-state.js +9 -7
  159. package/dist/internal/groups/encrypted-state.js.map +1 -1
  160. package/dist/internal/groups/invite-link.d.ts.map +1 -1
  161. package/dist/internal/groups/invite-link.js +2 -1
  162. package/dist/internal/groups/invite-link.js.map +1 -1
  163. package/dist/internal/groups/manager.d.ts.map +1 -1
  164. package/dist/internal/groups/manager.js +5 -5
  165. package/dist/internal/groups/manager.js.map +1 -1
  166. package/dist/internal/groups/sdk-store.d.ts.map +1 -1
  167. package/dist/internal/groups/sdk-store.js +4 -3
  168. package/dist/internal/groups/sdk-store.js.map +1 -1
  169. package/dist/internal/groups/server-engine.d.ts +6 -1
  170. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  171. package/dist/internal/groups/server-engine.js +11 -15
  172. package/dist/internal/groups/server-engine.js.map +1 -1
  173. package/dist/internal/groups/wire.d.ts.map +1 -1
  174. package/dist/internal/groups/wire.js +2 -1
  175. package/dist/internal/groups/wire.js.map +1 -1
  176. package/dist/internal/platform/blob.d.ts +10 -0
  177. package/dist/internal/platform/blob.d.ts.map +1 -0
  178. package/dist/internal/platform/blob.js +30 -0
  179. package/dist/internal/platform/blob.js.map +1 -0
  180. package/dist/internal/platform/env.d.ts +13 -0
  181. package/dist/internal/platform/env.d.ts.map +1 -0
  182. package/dist/internal/platform/env.js +17 -0
  183. package/dist/internal/platform/env.js.map +1 -0
  184. package/dist/internal/platform/index.d.ts +5 -0
  185. package/dist/internal/platform/index.d.ts.map +1 -0
  186. package/dist/internal/platform/index.js +5 -0
  187. package/dist/internal/platform/index.js.map +1 -0
  188. package/dist/internal/platform/url.d.ts +72 -0
  189. package/dist/internal/platform/url.d.ts.map +1 -0
  190. package/dist/internal/platform/url.js +275 -0
  191. package/dist/internal/platform/url.js.map +1 -0
  192. package/dist/internal/platform/utf8.d.ts +28 -0
  193. package/dist/internal/platform/utf8.d.ts.map +1 -0
  194. package/dist/internal/platform/utf8.js +167 -0
  195. package/dist/internal/platform/utf8.js.map +1 -0
  196. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +1 -1
  197. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts.map +1 -1
  198. package/dist/internal/protocol/sealed-sender/delivery-token.js +5 -10
  199. package/dist/internal/protocol/sealed-sender/delivery-token.js.map +1 -1
  200. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  201. package/dist/internal/protocol/sealed-sender/proto/index.js +2 -4
  202. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  203. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  204. package/dist/internal/protocol/sender-keys/manager.js +4 -3
  205. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  206. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts +4 -4
  207. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts.map +1 -1
  208. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +8 -10
  209. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js.map +1 -1
  210. package/dist/internal/protocol/username/hash.d.ts.map +1 -1
  211. package/dist/internal/protocol/username/hash.js +18 -3
  212. package/dist/internal/protocol/username/hash.js.map +1 -1
  213. package/dist/internal/protocol/username/link.d.ts.map +1 -1
  214. package/dist/internal/protocol/username/link.js +2 -1
  215. package/dist/internal/protocol/username/link.js.map +1 -1
  216. package/dist/internal/protocol/username/proof.d.ts.map +1 -1
  217. package/dist/internal/protocol/username/proof.js +2 -1
  218. package/dist/internal/protocol/username/proof.js.map +1 -1
  219. package/dist/internal/protocol/zk/credentials/attributes.d.ts.map +1 -1
  220. package/dist/internal/protocol/zk/credentials/attributes.js +2 -1
  221. package/dist/internal/protocol/zk/credentials/attributes.js.map +1 -1
  222. package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
  223. package/dist/internal/protocol/zk/credentials/credentials.js +8 -6
  224. package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
  225. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  226. package/dist/internal/protocol/zk/credentials/presentation.js +19 -13
  227. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  228. package/dist/internal/protocol/zk/groups/lizard.d.ts +8 -0
  229. package/dist/internal/protocol/zk/groups/lizard.d.ts.map +1 -1
  230. package/dist/internal/protocol/zk/groups/lizard.js +18 -5
  231. package/dist/internal/protocol/zk/groups/lizard.js.map +1 -1
  232. package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts.map +1 -1
  233. package/dist/internal/protocol/zk/groups/profile-key-commitment.js +7 -6
  234. package/dist/internal/protocol/zk/groups/profile-key-commitment.js.map +1 -1
  235. package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts.map +1 -1
  236. package/dist/internal/protocol/zk/groups/profile-key-encryption.js +3 -2
  237. package/dist/internal/protocol/zk/groups/profile-key-encryption.js.map +1 -1
  238. package/dist/internal/protocol/zk/groups/uid-encryption.d.ts.map +1 -1
  239. package/dist/internal/protocol/zk/groups/uid-encryption.js +3 -2
  240. package/dist/internal/protocol/zk/groups/uid-encryption.js.map +1 -1
  241. package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts +53 -0
  242. package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts.map +1 -0
  243. package/dist/internal/protocol/zk/proofs/point-multiplication.js +164 -0
  244. package/dist/internal/protocol/zk/proofs/point-multiplication.js.map +1 -0
  245. package/dist/internal/protocol/zk/proofs/sho.d.ts +1 -0
  246. package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -1
  247. package/dist/internal/protocol/zk/proofs/sho.js.map +1 -1
  248. package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -1
  249. package/dist/internal/protocol/zk/proofs/statement.js +11 -11
  250. package/dist/internal/protocol/zk/proofs/statement.js.map +1 -1
  251. package/dist/internal/sesame/device-registry.d.ts +16 -3
  252. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  253. package/dist/internal/sesame/device-registry.js +10 -7
  254. package/dist/internal/sesame/device-registry.js.map +1 -1
  255. package/dist/internal/sesame/index.d.ts +1 -1
  256. package/dist/internal/sesame/index.d.ts.map +1 -1
  257. package/dist/internal/sesame/manager.d.ts.map +1 -1
  258. package/dist/internal/sesame/manager.js +3 -2
  259. package/dist/internal/sesame/manager.js.map +1 -1
  260. package/dist/internal/session/index.d.ts +1 -2
  261. package/dist/internal/session/index.d.ts.map +1 -1
  262. package/dist/internal/session/index.js +1 -1
  263. package/dist/internal/session/index.js.map +1 -1
  264. package/dist/internal/session/validation.d.ts +0 -80
  265. package/dist/internal/session/validation.d.ts.map +1 -1
  266. package/dist/internal/session/validation.js +0 -134
  267. package/dist/internal/session/validation.js.map +1 -1
  268. package/dist/local/store/device-record.d.ts +18 -0
  269. package/dist/local/store/device-record.d.ts.map +1 -0
  270. package/dist/local/store/device-record.js +34 -0
  271. package/dist/local/store/device-record.js.map +1 -0
  272. package/dist/local/store/expo/adapter.d.ts +59 -238
  273. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  274. package/dist/local/store/expo/adapter.js +83 -640
  275. package/dist/local/store/expo/adapter.js.map +1 -1
  276. package/dist/local/store/expo/driver.d.ts +16 -0
  277. package/dist/local/store/expo/driver.d.ts.map +1 -0
  278. package/dist/local/store/expo/driver.js +141 -0
  279. package/dist/local/store/expo/driver.js.map +1 -0
  280. package/dist/local/store/expo/index.d.ts +3 -12
  281. package/dist/local/store/expo/index.d.ts.map +1 -1
  282. package/dist/local/store/expo/index.js +1 -8
  283. package/dist/local/store/expo/index.js.map +1 -1
  284. package/dist/local/store/expo/maintenance.d.ts +3 -2
  285. package/dist/local/store/expo/maintenance.d.ts.map +1 -1
  286. package/dist/local/store/expo/maintenance.js +5 -34
  287. package/dist/local/store/expo/maintenance.js.map +1 -1
  288. package/dist/local/store/index.d.ts +11 -6
  289. package/dist/local/store/index.d.ts.map +1 -1
  290. package/dist/local/store/index.js +11 -6
  291. package/dist/local/store/index.js.map +1 -1
  292. package/dist/local/store/key-value/adapter.d.ts +326 -0
  293. package/dist/local/store/key-value/adapter.d.ts.map +1 -0
  294. package/dist/local/store/key-value/adapter.js +1472 -0
  295. package/dist/local/store/key-value/adapter.js.map +1 -0
  296. package/dist/local/store/{react-native → key-value}/backend-conformance.d.ts +6 -6
  297. package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -0
  298. package/dist/local/store/{react-native → key-value}/backend-conformance.js +3 -3
  299. package/dist/local/store/key-value/backend-conformance.js.map +1 -0
  300. package/dist/local/store/key-value/batch.d.ts +41 -0
  301. package/dist/local/store/key-value/batch.d.ts.map +1 -0
  302. package/dist/local/store/key-value/batch.js +77 -0
  303. package/dist/local/store/key-value/batch.js.map +1 -0
  304. package/dist/local/store/key-value/device-record.d.ts +23 -0
  305. package/dist/local/store/key-value/device-record.d.ts.map +1 -0
  306. package/dist/local/store/key-value/device-record.js +33 -0
  307. package/dist/local/store/key-value/device-record.js.map +1 -0
  308. package/dist/local/store/key-value/index.d.ts +24 -0
  309. package/dist/local/store/key-value/index.d.ts.map +1 -0
  310. package/dist/local/store/key-value/index.js +8 -0
  311. package/dist/local/store/key-value/index.js.map +1 -0
  312. package/dist/local/store/key-value/realm/index.d.ts +83 -0
  313. package/dist/local/store/key-value/realm/index.d.ts.map +1 -0
  314. package/dist/local/store/key-value/realm/index.js +102 -0
  315. package/dist/local/store/key-value/realm/index.js.map +1 -0
  316. package/dist/local/store/{react-native → key-value}/storage.d.ts +6 -6
  317. package/dist/local/store/key-value/storage.d.ts.map +1 -0
  318. package/dist/local/store/key-value/storage.js.map +1 -0
  319. package/dist/local/store/key-value/transactional-backend.d.ts +50 -0
  320. package/dist/local/store/key-value/transactional-backend.d.ts.map +1 -0
  321. package/dist/local/store/key-value/transactional-backend.js +90 -0
  322. package/dist/local/store/key-value/transactional-backend.js.map +1 -0
  323. package/dist/local/store/key-value/value-key.d.ts +34 -0
  324. package/dist/local/store/key-value/value-key.d.ts.map +1 -0
  325. package/dist/local/store/key-value/value-key.js +83 -0
  326. package/dist/local/store/key-value/value-key.js.map +1 -0
  327. package/dist/local/store/memory/adapter.d.ts +8 -0
  328. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  329. package/dist/local/store/memory/adapter.js +60 -75
  330. package/dist/local/store/memory/adapter.js.map +1 -1
  331. package/dist/local/store/node/adapter.d.ts +74 -130
  332. package/dist/local/store/node/adapter.d.ts.map +1 -1
  333. package/dist/local/store/node/adapter.js +83 -727
  334. package/dist/local/store/node/adapter.js.map +1 -1
  335. package/dist/local/store/node/index.d.ts +8 -6
  336. package/dist/local/store/node/index.d.ts.map +1 -1
  337. package/dist/local/store/node/index.js +3 -7
  338. package/dist/local/store/node/index.js.map +1 -1
  339. package/dist/local/store/node/maintenance.d.ts +5 -0
  340. package/dist/local/store/node/maintenance.d.ts.map +1 -0
  341. package/dist/local/store/node/maintenance.js +7 -0
  342. package/dist/local/store/node/maintenance.js.map +1 -0
  343. package/dist/local/store/node/owner-lock.d.ts +26 -0
  344. package/dist/local/store/node/owner-lock.d.ts.map +1 -0
  345. package/dist/local/store/node/owner-lock.js +88 -0
  346. package/dist/local/store/node/owner-lock.js.map +1 -0
  347. package/dist/local/store/react-native/adapter.d.ts +63 -274
  348. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  349. package/dist/local/store/react-native/adapter.js +80 -1406
  350. package/dist/local/store/react-native/adapter.js.map +1 -1
  351. package/dist/local/store/react-native/index.d.ts +7 -19
  352. package/dist/local/store/react-native/index.d.ts.map +1 -1
  353. package/dist/local/store/react-native/index.js +2 -7
  354. package/dist/local/store/react-native/index.js.map +1 -1
  355. package/dist/local/store/react-native/maintenance.d.ts +5 -0
  356. package/dist/local/store/react-native/maintenance.d.ts.map +1 -0
  357. package/dist/local/store/react-native/maintenance.js +7 -0
  358. package/dist/local/store/react-native/maintenance.js.map +1 -0
  359. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts +38 -0
  360. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts.map +1 -0
  361. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js +196 -0
  362. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js.map +1 -0
  363. package/dist/local/store/sqlite/database.d.ts +20 -0
  364. package/dist/local/store/sqlite/database.d.ts.map +1 -0
  365. package/dist/local/store/sqlite/database.js +41 -0
  366. package/dist/local/store/sqlite/database.js.map +1 -0
  367. package/dist/local/store/sqlite/driver.d.ts +138 -0
  368. package/dist/local/store/sqlite/driver.d.ts.map +1 -0
  369. package/dist/local/store/sqlite/driver.js +10 -0
  370. package/dist/local/store/sqlite/driver.js.map +1 -0
  371. package/dist/local/store/sqlite/encryption.d.ts +61 -0
  372. package/dist/local/store/sqlite/encryption.d.ts.map +1 -0
  373. package/dist/local/store/sqlite/encryption.js +98 -0
  374. package/dist/local/store/sqlite/encryption.js.map +1 -0
  375. package/dist/local/store/sqlite/errors.d.ts +70 -0
  376. package/dist/local/store/sqlite/errors.d.ts.map +1 -0
  377. package/dist/local/store/sqlite/errors.js +101 -0
  378. package/dist/local/store/sqlite/errors.js.map +1 -0
  379. package/dist/local/store/sqlite/executor.d.ts +22 -0
  380. package/dist/local/store/sqlite/executor.d.ts.map +1 -0
  381. package/dist/local/store/sqlite/executor.js +129 -0
  382. package/dist/local/store/sqlite/executor.js.map +1 -0
  383. package/dist/local/store/sqlite/index.d.ts +20 -0
  384. package/dist/local/store/sqlite/index.d.ts.map +1 -0
  385. package/dist/local/store/sqlite/index.js +18 -0
  386. package/dist/local/store/sqlite/index.js.map +1 -0
  387. package/dist/local/store/sqlite/key-storage/account.d.ts +45 -0
  388. package/dist/local/store/sqlite/key-storage/account.d.ts.map +1 -0
  389. package/dist/local/store/sqlite/key-storage/account.js +125 -0
  390. package/dist/local/store/sqlite/key-storage/account.js.map +1 -0
  391. package/dist/local/store/sqlite/key-storage/contact-identities.d.ts +19 -0
  392. package/dist/local/store/sqlite/key-storage/contact-identities.d.ts.map +1 -0
  393. package/dist/local/store/sqlite/key-storage/contact-identities.js +85 -0
  394. package/dist/local/store/sqlite/key-storage/contact-identities.js.map +1 -0
  395. package/dist/local/store/sqlite/key-storage/context.d.ts +19 -0
  396. package/dist/local/store/sqlite/key-storage/context.d.ts.map +1 -0
  397. package/dist/local/store/sqlite/key-storage/context.js +18 -0
  398. package/dist/local/store/sqlite/key-storage/context.js.map +1 -0
  399. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts +18 -0
  400. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts.map +1 -0
  401. package/dist/local/store/sqlite/key-storage/identity-keys.js +88 -0
  402. package/dist/local/store/sqlite/key-storage/identity-keys.js.map +1 -0
  403. package/dist/local/store/sqlite/key-storage/index.d.ts +108 -0
  404. package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -0
  405. package/dist/local/store/sqlite/key-storage/index.js +241 -0
  406. package/dist/local/store/sqlite/key-storage/index.js.map +1 -0
  407. package/dist/local/store/sqlite/key-storage/message-records.d.ts +41 -0
  408. package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -0
  409. package/dist/local/store/sqlite/key-storage/message-records.js +133 -0
  410. package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -0
  411. package/dist/local/store/sqlite/key-storage/metadata.d.ts +16 -0
  412. package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -0
  413. package/dist/local/store/sqlite/key-storage/metadata.js +53 -0
  414. package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -0
  415. package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts +36 -0
  416. package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts.map +1 -0
  417. package/dist/local/store/sqlite/key-storage/one-time-prekeys.js +129 -0
  418. package/dist/local/store/sqlite/key-storage/one-time-prekeys.js.map +1 -0
  419. package/dist/local/store/sqlite/key-storage/session-trust.d.ts +10 -0
  420. package/dist/local/store/sqlite/key-storage/session-trust.d.ts.map +1 -0
  421. package/dist/local/store/sqlite/key-storage/session-trust.js +88 -0
  422. package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -0
  423. package/dist/local/store/sqlite/key-storage/sessions.d.ts +50 -0
  424. package/dist/local/store/sqlite/key-storage/sessions.d.ts.map +1 -0
  425. package/dist/local/store/sqlite/key-storage/sessions.js +209 -0
  426. package/dist/local/store/sqlite/key-storage/sessions.js.map +1 -0
  427. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts +69 -0
  428. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts.map +1 -0
  429. package/dist/local/store/sqlite/key-storage/signed-prekeys.js +219 -0
  430. package/dist/local/store/sqlite/key-storage/signed-prekeys.js.map +1 -0
  431. package/dist/local/store/sqlite/maintenance.d.ts +7 -0
  432. package/dist/local/store/sqlite/maintenance.d.ts.map +1 -0
  433. package/dist/local/store/sqlite/maintenance.js +32 -0
  434. package/dist/local/store/sqlite/maintenance.js.map +1 -0
  435. package/dist/local/store/sqlite/migrations.d.ts +31 -0
  436. package/dist/local/store/sqlite/migrations.d.ts.map +1 -0
  437. package/dist/local/store/sqlite/migrations.js +232 -0
  438. package/dist/local/store/sqlite/migrations.js.map +1 -0
  439. package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.d.ts +17 -22
  440. package/dist/local/store/sqlite/models/ec-one-time-prekey.d.ts.map +1 -0
  441. package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.js +61 -99
  442. package/dist/local/store/sqlite/models/ec-one-time-prekey.js.map +1 -0
  443. package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.d.ts +22 -25
  444. package/dist/local/store/sqlite/models/ec-signed-prekey.d.ts.map +1 -0
  445. package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.js +82 -128
  446. package/dist/local/store/sqlite/models/ec-signed-prekey.js.map +1 -0
  447. package/dist/local/store/sqlite/models/identity-key-id.d.ts.map +1 -0
  448. package/dist/local/store/sqlite/models/identity-key-id.js.map +1 -0
  449. package/dist/local/store/{expo → sqlite}/models/index.d.ts +5 -5
  450. package/dist/local/store/sqlite/models/index.d.ts.map +1 -0
  451. package/dist/local/store/{expo → sqlite}/models/index.js +12 -5
  452. package/dist/local/store/sqlite/models/index.js.map +1 -0
  453. package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.d.ts +17 -20
  454. package/dist/local/store/sqlite/models/kyber-one-time-prekey.d.ts.map +1 -0
  455. package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.js +65 -105
  456. package/dist/local/store/sqlite/models/kyber-one-time-prekey.js.map +1 -0
  457. package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.d.ts +3 -3
  458. package/dist/local/store/sqlite/models/kyber-prekey-used.d.ts.map +1 -0
  459. package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.js +13 -25
  460. package/dist/local/store/sqlite/models/kyber-prekey-used.js.map +1 -0
  461. package/dist/local/store/{expo → sqlite}/models/kyber-prekey.d.ts +16 -19
  462. package/dist/local/store/sqlite/models/kyber-prekey.d.ts.map +1 -0
  463. package/dist/local/store/{expo → sqlite}/models/kyber-prekey.js +67 -111
  464. package/dist/local/store/sqlite/models/kyber-prekey.js.map +1 -0
  465. package/dist/local/store/sqlite/models/local-identity.d.ts +51 -0
  466. package/dist/local/store/sqlite/models/local-identity.d.ts.map +1 -0
  467. package/dist/local/store/sqlite/models/local-identity.js +150 -0
  468. package/dist/local/store/sqlite/models/local-identity.js.map +1 -0
  469. package/dist/local/store/{expo → sqlite}/models/message-record.d.ts +15 -44
  470. package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -0
  471. package/dist/local/store/{expo → sqlite}/models/message-record.js +43 -109
  472. package/dist/local/store/sqlite/models/message-record.js.map +1 -0
  473. package/dist/local/store/sqlite/models/recipient-identity.d.ts +21 -0
  474. package/dist/local/store/sqlite/models/recipient-identity.d.ts.map +1 -0
  475. package/dist/local/store/sqlite/models/recipient-identity.js +59 -0
  476. package/dist/local/store/sqlite/models/recipient-identity.js.map +1 -0
  477. package/dist/local/store/sqlite/models/replaced-prekeys.d.ts +23 -0
  478. package/dist/local/store/sqlite/models/replaced-prekeys.d.ts.map +1 -0
  479. package/dist/local/store/sqlite/models/replaced-prekeys.js +42 -0
  480. package/dist/local/store/sqlite/models/replaced-prekeys.js.map +1 -0
  481. package/dist/local/store/{expo → sqlite}/models/sender-key.d.ts +22 -23
  482. package/dist/local/store/sqlite/models/sender-key.d.ts.map +1 -0
  483. package/dist/local/store/{expo → sqlite}/models/sender-key.js +66 -94
  484. package/dist/local/store/sqlite/models/sender-key.js.map +1 -0
  485. package/dist/local/store/sqlite/models/sesame-user-record.d.ts +32 -0
  486. package/dist/local/store/sqlite/models/sesame-user-record.d.ts.map +1 -0
  487. package/dist/local/store/sqlite/models/sesame-user-record.js +78 -0
  488. package/dist/local/store/sqlite/models/sesame-user-record.js.map +1 -0
  489. package/dist/local/store/{expo → sqlite}/models/session.d.ts +24 -20
  490. package/dist/local/store/sqlite/models/session.d.ts.map +1 -0
  491. package/dist/local/store/{expo → sqlite}/models/session.js +54 -72
  492. package/dist/local/store/sqlite/models/session.js.map +1 -0
  493. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +24 -0
  494. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -0
  495. package/dist/local/store/sqlite/models/skipped-sender-key.js +62 -0
  496. package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -0
  497. package/dist/local/store/sqlite/op-sqlite-driver.d.ts +14 -0
  498. package/dist/local/store/sqlite/op-sqlite-driver.d.ts.map +1 -0
  499. package/dist/local/store/sqlite/op-sqlite-driver.js +180 -0
  500. package/dist/local/store/sqlite/op-sqlite-driver.js.map +1 -0
  501. package/dist/local/store/sqlite/open-store.d.ts +83 -0
  502. package/dist/local/store/sqlite/open-store.d.ts.map +1 -0
  503. package/dist/local/store/sqlite/open-store.js +177 -0
  504. package/dist/local/store/sqlite/open-store.js.map +1 -0
  505. package/dist/local/store/sqlite/schema.d.ts +102 -0
  506. package/dist/local/store/sqlite/schema.d.ts.map +1 -0
  507. package/dist/local/store/sqlite/schema.js +61 -0
  508. package/dist/local/store/sqlite/schema.js.map +1 -0
  509. package/dist/local/store/sqlite/store.d.ts +199 -0
  510. package/dist/local/store/sqlite/store.d.ts.map +1 -0
  511. package/dist/local/store/sqlite/store.js +494 -0
  512. package/dist/local/store/sqlite/store.js.map +1 -0
  513. package/dist/local/store/sqlite/web/driver.d.ts +50 -0
  514. package/dist/local/store/sqlite/web/driver.d.ts.map +1 -0
  515. package/dist/local/store/sqlite/web/driver.js +171 -0
  516. package/dist/local/store/sqlite/web/driver.js.map +1 -0
  517. package/dist/local/store/sqlite/web/protocol.d.ts +80 -0
  518. package/dist/local/store/sqlite/web/protocol.d.ts.map +1 -0
  519. package/dist/local/store/sqlite/web/protocol.js +13 -0
  520. package/dist/local/store/sqlite/web/protocol.js.map +1 -0
  521. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +14526 -0
  522. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.wasm +0 -0
  523. package/dist/local/store/sqlite/web/worker.d.ts +39 -0
  524. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -0
  525. package/dist/local/store/sqlite/web/worker.js +646 -0
  526. package/dist/local/store/sqlite/web/worker.js.map +1 -0
  527. package/dist/local/store/web/adapter.d.ts +5 -14
  528. package/dist/local/store/web/adapter.d.ts.map +1 -1
  529. package/dist/local/store/web/adapter.js +119 -106
  530. package/dist/local/store/web/adapter.js.map +1 -1
  531. package/dist/local/store/web/device-record.d.ts +23 -0
  532. package/dist/local/store/web/device-record.d.ts.map +1 -0
  533. package/dist/local/store/web/device-record.js +31 -0
  534. package/dist/local/store/web/device-record.js.map +1 -0
  535. package/dist/local/store/web-sqlite/adapter.d.ts +101 -0
  536. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -0
  537. package/dist/local/store/web-sqlite/adapter.js +154 -0
  538. package/dist/local/store/web-sqlite/adapter.js.map +1 -0
  539. package/dist/local/store/web-sqlite/index.d.ts +14 -0
  540. package/dist/local/store/web-sqlite/index.d.ts.map +1 -0
  541. package/dist/local/store/web-sqlite/index.js +3 -0
  542. package/dist/local/store/web-sqlite/index.js.map +1 -0
  543. package/dist/local/store/web-sqlite/maintenance.d.ts +5 -0
  544. package/dist/local/store/web-sqlite/maintenance.d.ts.map +1 -0
  545. package/dist/local/store/web-sqlite/maintenance.js +7 -0
  546. package/dist/local/store/web-sqlite/maintenance.js.map +1 -0
  547. package/dist/local/store/web-sqlite/store-locks.d.ts +33 -0
  548. package/dist/local/store/web-sqlite/store-locks.d.ts.map +1 -0
  549. package/dist/local/store/web-sqlite/store-locks.js +60 -0
  550. package/dist/local/store/web-sqlite/store-locks.js.map +1 -0
  551. package/dist/local/vault/electron-safe-storage.d.ts +45 -0
  552. package/dist/local/vault/electron-safe-storage.d.ts.map +1 -0
  553. package/dist/local/vault/electron-safe-storage.js +212 -0
  554. package/dist/local/vault/electron-safe-storage.js.map +1 -0
  555. package/dist/local/vault/index.d.ts +4 -2
  556. package/dist/local/vault/index.d.ts.map +1 -1
  557. package/dist/local/vault/indexed-db.d.ts +37 -0
  558. package/dist/local/vault/indexed-db.d.ts.map +1 -0
  559. package/dist/local/vault/indexed-db.js +102 -0
  560. package/dist/local/vault/indexed-db.js.map +1 -0
  561. package/dist/local/vault/react-native-keychain.d.ts +12 -0
  562. package/dist/local/vault/react-native-keychain.d.ts.map +1 -0
  563. package/dist/local/vault/react-native-keychain.js +71 -0
  564. package/dist/local/vault/react-native-keychain.js.map +1 -0
  565. package/dist/local/vault/require.d.ts +10 -0
  566. package/dist/local/vault/require.d.ts.map +1 -0
  567. package/dist/local/vault/require.js +16 -0
  568. package/dist/local/vault/require.js.map +1 -0
  569. package/dist/logger.d.ts.map +1 -1
  570. package/dist/logger.js +2 -1
  571. package/dist/logger.js.map +1 -1
  572. package/dist/media/index.d.ts.map +1 -1
  573. package/dist/media/index.js +2 -1
  574. package/dist/media/index.js.map +1 -1
  575. package/dist/profile/contact-state.d.ts.map +1 -1
  576. package/dist/profile/contact-state.js +2 -4
  577. package/dist/profile/contact-state.js.map +1 -1
  578. package/dist/profile/index.d.ts +0 -1
  579. package/dist/profile/index.d.ts.map +1 -1
  580. package/dist/profile/index.js +0 -2
  581. package/dist/profile/index.js.map +1 -1
  582. package/dist/profile/profile-key.d.ts +16 -11
  583. package/dist/profile/profile-key.d.ts.map +1 -1
  584. package/dist/profile/profile-key.js +29 -29
  585. package/dist/profile/profile-key.js.map +1 -1
  586. package/dist/profile/update-service.d.ts +6 -0
  587. package/dist/profile/update-service.d.ts.map +1 -1
  588. package/dist/profile/update-service.js +3 -1
  589. package/dist/profile/update-service.js.map +1 -1
  590. package/dist/remote/object-store/validation.d.ts.map +1 -1
  591. package/dist/remote/object-store/validation.js +2 -1
  592. package/dist/remote/object-store/validation.js.map +1 -1
  593. package/dist/remote/relay/memory/adapter.d.ts +2 -3
  594. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  595. package/dist/remote/relay/memory/adapter.js +22 -30
  596. package/dist/remote/relay/memory/adapter.js.map +1 -1
  597. package/dist/remote/relay/memory/failures.d.ts.map +1 -1
  598. package/dist/remote/relay/memory/failures.js +2 -1
  599. package/dist/remote/relay/memory/failures.js.map +1 -1
  600. package/dist/remote/relay/memory/group-server.d.ts +5 -1
  601. package/dist/remote/relay/memory/group-server.d.ts.map +1 -1
  602. package/dist/remote/relay/memory/group-server.js +11 -1
  603. package/dist/remote/relay/memory/group-server.js.map +1 -1
  604. package/dist/safety/url.d.ts.map +1 -1
  605. package/dist/safety/url.js +21 -26
  606. package/dist/safety/url.js.map +1 -1
  607. package/dist/types/api.d.ts +15 -2
  608. package/dist/types/api.d.ts.map +1 -1
  609. package/dist/types/errors.d.ts +97 -1
  610. package/dist/types/errors.d.ts.map +1 -1
  611. package/dist/types/errors.js +105 -1
  612. package/dist/types/errors.js.map +1 -1
  613. package/dist/types/session.d.ts.map +1 -1
  614. package/dist/types/session.js +2 -1
  615. package/dist/types/session.js.map +1 -1
  616. package/dist/utils/retry.d.ts +2 -0
  617. package/dist/utils/retry.d.ts.map +1 -1
  618. package/dist/utils/retry.js +4 -2
  619. package/dist/utils/retry.js.map +1 -1
  620. package/docs/ASSURANCE.md +84 -11
  621. package/docs/CLIENT_COMPOSITION.md +1 -2
  622. package/docs/DEVIATIONS.md +1 -1
  623. package/docs/ERROR_HANDLING.md +7 -1
  624. package/docs/GETTING_STARTED.md +1 -2
  625. package/docs/PACKAGE_SURFACE.md +32 -12
  626. package/docs/RECIPES.md +1 -2
  627. package/examples/browser/index.html +1 -1
  628. package/local/store/README.md +142 -42
  629. package/local/store/expo/README.md +67 -47
  630. package/local/store/key-value/README.md +278 -0
  631. package/local/store/node/README.md +206 -46
  632. package/local/store/react-native/README.md +120 -61
  633. package/local/store/web/README.md +14 -0
  634. package/local/store/web-sqlite/README.md +210 -0
  635. package/local/vault/README.md +115 -2
  636. package/package.json +42 -23
  637. package/profile/README.md +9 -11
  638. package/remote/README.md +1 -2
  639. package/dist/local/store/expo/database-key.d.ts +0 -142
  640. package/dist/local/store/expo/database-key.d.ts.map +0 -1
  641. package/dist/local/store/expo/database-key.js +0 -312
  642. package/dist/local/store/expo/database-key.js.map +0 -1
  643. package/dist/local/store/expo/db.d.ts +0 -95
  644. package/dist/local/store/expo/db.d.ts.map +0 -1
  645. package/dist/local/store/expo/db.js +0 -147
  646. package/dist/local/store/expo/db.js.map +0 -1
  647. package/dist/local/store/expo/key-storage.d.ts +0 -429
  648. package/dist/local/store/expo/key-storage.d.ts.map +0 -1
  649. package/dist/local/store/expo/key-storage.js +0 -1361
  650. package/dist/local/store/expo/key-storage.js.map +0 -1
  651. package/dist/local/store/expo/models/ec-one-time-prekey.d.ts.map +0 -1
  652. package/dist/local/store/expo/models/ec-one-time-prekey.js.map +0 -1
  653. package/dist/local/store/expo/models/ec-signed-prekey.d.ts.map +0 -1
  654. package/dist/local/store/expo/models/ec-signed-prekey.js.map +0 -1
  655. package/dist/local/store/expo/models/identity-key-id.d.ts.map +0 -1
  656. package/dist/local/store/expo/models/identity-key-id.js.map +0 -1
  657. package/dist/local/store/expo/models/index.d.ts.map +0 -1
  658. package/dist/local/store/expo/models/index.js.map +0 -1
  659. package/dist/local/store/expo/models/kyber-one-time-prekey.d.ts.map +0 -1
  660. package/dist/local/store/expo/models/kyber-one-time-prekey.js.map +0 -1
  661. package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +0 -1
  662. package/dist/local/store/expo/models/kyber-prekey-used.js.map +0 -1
  663. package/dist/local/store/expo/models/kyber-prekey.d.ts.map +0 -1
  664. package/dist/local/store/expo/models/kyber-prekey.js.map +0 -1
  665. package/dist/local/store/expo/models/local-identity.d.ts +0 -52
  666. package/dist/local/store/expo/models/local-identity.d.ts.map +0 -1
  667. package/dist/local/store/expo/models/local-identity.js +0 -166
  668. package/dist/local/store/expo/models/local-identity.js.map +0 -1
  669. package/dist/local/store/expo/models/message-record.d.ts.map +0 -1
  670. package/dist/local/store/expo/models/message-record.js.map +0 -1
  671. package/dist/local/store/expo/models/recipient-identity.d.ts +0 -21
  672. package/dist/local/store/expo/models/recipient-identity.d.ts.map +0 -1
  673. package/dist/local/store/expo/models/recipient-identity.js +0 -66
  674. package/dist/local/store/expo/models/recipient-identity.js.map +0 -1
  675. package/dist/local/store/expo/models/replaced-prekey-utils.d.ts +0 -33
  676. package/dist/local/store/expo/models/replaced-prekey-utils.d.ts.map +0 -1
  677. package/dist/local/store/expo/models/replaced-prekey-utils.js +0 -54
  678. package/dist/local/store/expo/models/replaced-prekey-utils.js.map +0 -1
  679. package/dist/local/store/expo/models/sender-key.d.ts.map +0 -1
  680. package/dist/local/store/expo/models/sender-key.js.map +0 -1
  681. package/dist/local/store/expo/models/session.d.ts.map +0 -1
  682. package/dist/local/store/expo/models/session.js.map +0 -1
  683. package/dist/local/store/expo/schema.d.ts +0 -1917
  684. package/dist/local/store/expo/schema.d.ts.map +0 -1
  685. package/dist/local/store/expo/schema.js +0 -197
  686. package/dist/local/store/expo/schema.js.map +0 -1
  687. package/dist/local/store/node/database-encryption.d.ts +0 -109
  688. package/dist/local/store/node/database-encryption.d.ts.map +0 -1
  689. package/dist/local/store/node/database-encryption.js +0 -202
  690. package/dist/local/store/node/database-encryption.js.map +0 -1
  691. package/dist/local/store/node/database-file-commit.d.ts +0 -8
  692. package/dist/local/store/node/database-file-commit.d.ts.map +0 -1
  693. package/dist/local/store/node/database-file-commit.js +0 -62
  694. package/dist/local/store/node/database-file-commit.js.map +0 -1
  695. package/dist/local/store/node/database-key.d.ts +0 -129
  696. package/dist/local/store/node/database-key.d.ts.map +0 -1
  697. package/dist/local/store/node/database-key.js +0 -293
  698. package/dist/local/store/node/database-key.js.map +0 -1
  699. package/dist/local/store/node/database-lock.d.ts +0 -8
  700. package/dist/local/store/node/database-lock.d.ts.map +0 -1
  701. package/dist/local/store/node/database-lock.js +0 -44
  702. package/dist/local/store/node/database-lock.js.map +0 -1
  703. package/dist/local/store/node/database.d.ts +0 -226
  704. package/dist/local/store/node/database.d.ts.map +0 -1
  705. package/dist/local/store/node/database.js +0 -813
  706. package/dist/local/store/node/database.js.map +0 -1
  707. package/dist/local/store/react-native/backend-conformance.d.ts.map +0 -1
  708. package/dist/local/store/react-native/backend-conformance.js.map +0 -1
  709. package/dist/local/store/react-native/reference-backend.d.ts +0 -43
  710. package/dist/local/store/react-native/reference-backend.d.ts.map +0 -1
  711. package/dist/local/store/react-native/reference-backend.js +0 -178
  712. package/dist/local/store/react-native/reference-backend.js.map +0 -1
  713. package/dist/local/store/react-native/storage.d.ts.map +0 -1
  714. package/dist/local/store/react-native/storage.js.map +0 -1
  715. package/dist/profile/storage.d.ts +0 -61
  716. package/dist/profile/storage.d.ts.map +0 -1
  717. package/dist/profile/storage.js +0 -145
  718. package/dist/profile/storage.js.map +0 -1
  719. /package/dist/local/store/{react-native → key-value}/storage.js +0 -0
  720. /package/dist/local/store/{expo → sqlite}/models/identity-key-id.d.ts +0 -0
  721. /package/dist/local/store/{expo → sqlite}/models/identity-key-id.js +0 -0
package/docs/ASSURANCE.md CHANGED
@@ -14,18 +14,18 @@ Private testing also exists in other open-source projects. [SQLite publishes som
14
14
 
15
15
  ## Reported engineering results
16
16
 
17
- Engineering CI runs the default automated checks on pull requests and changes to the main branch. Release preparation requires a passing run.
17
+ Engineering CI runs the default automated checks on pull requests that are ready for review and on changes to the main branch. Release preparation requires a passing run.
18
18
 
19
- Most recent full run on 2026-09-27:
19
+ Most recent full run on 2026-09-29:
20
20
 
21
21
  | | |
22
22
  |---|---|
23
- | Test modules | 435 |
24
- | Test cases | 7,655 |
25
- | Passed | 7,653 |
26
- | Skipped | 2 |
23
+ | Test modules | 470 |
24
+ | Test cases | 8,602 |
25
+ | Passed | 8,598 |
26
+ | Skipped | 4 |
27
27
  | Failed | 0 |
28
- | Wall time | 194 s |
28
+ | Wall time | 149 s |
29
29
 
30
30
  The total counts test cases. One test case can contain several assertions. Separate commands run the longer performance and endurance checks.
31
31
 
@@ -38,15 +38,88 @@ Release tooling generates this table from a completed run. It refuses results fr
38
38
  - **Generated inputs:** check protocol and encoding properties across randomized inputs.
39
39
  - **Messaging flows:** exercise device fanout, groups, device linking, provisioning, PNI-to-ACI changes, and relay delivery.
40
40
  - **Storage contracts:** check persistence, concurrency, interruption, recovery, and storage pressure at adapter boundaries.
41
- - **Runtime behavior:** run the browser storage contracts in Chromium, Firefox, and WebKit. Run the React Native backend contract on the Hermes v0.13.0 command-line engine. Run a release build of the Expo example on an Android emulator. That build uses Expo SDK 57, React Native 0.86, and Hermes V1.
41
+ - **Runtime behavior:** run the browser storage contracts in Chromium, Firefox, and WebKit. Run each public flow on the Hermes V1 command-line engine that React Native 0.86 uses, with only the globals of a bare React Native app. A committed list records each flow step that fails on that engine and its error. The job fails when a result differs from that list. Run release builds of the Expo example and the bare React Native example on an Android emulator. Both use Hermes V1. The Expo build uses Expo SDK 57 and React Native 0.86, and the bare build uses React Native 0.87.1.
42
42
  - **Public API:** check exported types, import paths, documented calls, and expected example output against the packed package.
43
43
  - **React Native hosts:** add the packed package to React Native and Expo projects without an override of peer conflicts. The projects cover React Native 0.83 through 0.87 and the Expo SDK 55 through 57 lines. Build the Expo example's Hermes bundle on Expo SDK 55 and 57.
44
44
  - **Errors:** check construction sites for exported error classes and codes. Reject unresolved code forwarding.
45
45
 
46
- The browser storage job also runs 2,000 open, write, read, and close cycles. It checks for upward memory and latency drift.
46
+ The browser storage job also runs 2,000 open, write, read, and close cycles of the IndexedDB store, and a soak of the web SQLite store. Each checks for upward memory and latency drift.
47
47
 
48
48
  A storage contract check does not prove a full encrypted exchange. The [browser example](../examples/browser/README.md) and [Expo example](../examples/expo/README.md) exercise message encryption, delivery, and decryption.
49
49
 
50
+ ## SQLite store checks
51
+
52
+ Four package entries keep device-local state in a SQLite database: `./local/store/node`, `./local/store/expo`, `./local/store/react-native`, and `./local/store/web-sqlite`. A Tauri app uses `./local/store/web-sqlite`. Each row gives one runtime claim and the check that proves it. Rows that do not name public CI run in the project's engineering CI. A check runs on each change to the main branch and on each pull request that is ready for review, unless its row says otherwise. On a pull request, a job on macOS or Windows runs only when a maintainer requests it. Without that request, a pull request runs the Node store job only on Linux with Node 22, and the default automated checks run its tests on Linux with Node 26.
53
+
54
+ ### Node and the Electron main process: `./local/store/node`
55
+
56
+ | Claim | Check | What the check runs |
57
+ |---|---|---|
58
+ | The store passes the shared storage contract on an encrypted file. | Default automated checks: Linux, Node 26 | The storage contract on `nodeStore` and the `better-sqlite3-multiple-ciphers` binding. |
59
+ | The driver writes SQLCipher 4 files. An encrypted file has no SQLite header, and a wrong key fails with a typed error. | Node store job: Linux, macOS, and Windows, each with Node 22 and Node 26 | Real files on the prebuilt binding. |
60
+ | Without `encryptionAtRest: false`, the store refuses a binding that has no cipher. The store refuses a file that has the other encryption setting. | Node store job: the same six runners | Real files on the prebuilt binding. |
61
+ | The store writes its key to the vault before it creates the file. A file without a key fails as a lost key and does not change. | Node store job: the same six runners | Real files and a vault. |
62
+ | One process at a time owns a store. After the owner process is killed, the next open succeeds and reads the committed data. | Node store job: the same six runners | A child process holds the store. The parent process tries to open it, then kills the child and opens it. |
63
+ | Every part of the store interface survives a close and a new open of the directory. | Node store job: the same six runners | Real files on the prebuilt binding. |
64
+ | In the Electron main process, the store passes the shared storage contract with its key in the real `safeStorage`. The file has no SQLite header, and the vault file keeps only a ciphertext of the key. | Electron store job: Linux, macOS, and Windows | Electron from its npm package, with the GNOME keyring through libsecret on Linux, the Keychain on macOS, and DPAPI on Windows. A push to the main branch or a pull request runs this job only when it changes the store, the vault, the storage contract, the job, or a dependency. |
65
+ | On Linux, the vault refuses the `basic_text` backend of `safeStorage`. The store does not open, and no key reaches the disk. | Electron store job: Linux | Electron with `--password-store=basic`. |
66
+ | On Linux, the vault refuses the fixed fallback key that `safeStorage` uses when no secret service answers. The store does not open, and no key reaches the disk. | Electron store job: Linux | Electron with `--password-store=gnome-libsecret` and no unlocked keyring on the D-Bus session. |
67
+
68
+ ### Expo: `./local/store/expo`
69
+
70
+ | Claim | Check | What the check runs |
71
+ |---|---|---|
72
+ | The store passes the shared storage contract. | Default automated checks: Linux, Node 26 | The storage contract on the `expo-sqlite` JavaScript layer over `node:sqlite`. This check runs no native module and no SQLCipher. |
73
+ | A release build of the Expo example stores its state with SQLCipher on Android and keeps it across a process restart. | Android emulator job | A release APK on Hermes V1, run twice on an Android API 36 x86_64 emulator. Each run must log a SQLCipher version and a database header that is not the SQLite header. The second run must resume the stored identity and complete an exchange. This job runs on a change to the main branch that can reach the React Native runtime, and on demand. It does not run on a pull request. |
74
+ | The Expo example, which imports this entry, bundles with the Hermes compiler that React Native pins. | Public CI (`Checks`) | The Android bundle of the Expo example with the packed package, on Expo SDK 55 and Expo SDK 57. |
75
+
76
+ The Hermes flow job does not load a SQLite store. Its flows use the memory and key-value stores. The Android emulator job is the only CI job that runs the Expo store on Hermes.
77
+
78
+ ### Bare React Native: `./local/store/react-native`
79
+
80
+ | Claim | Check | What the check runs |
81
+ |---|---|---|
82
+ | The store passes the shared storage contract on an encrypted file. | Default automated checks: Linux, Node 26 | The storage contract on `reactNativeStore` over a Node test double of op-sqlite. The double runs SQLite3 Multiple Ciphers in its SQLCipher 4 mode through the `better-sqlite3-multiple-ciphers` binding. |
83
+ | The first open writes a new 32-byte key to the keychain, with access after the first unlock on this device only. The file has no SQLite header, and that key opens it. A key that does not open the file fails with `KEY_STORAGE_ERROR`. | Default automated checks: Linux, Node 26 | The entry on the op-sqlite test double, with a test double of `react-native-keychain`. |
84
+ | A file without its key fails with `LOCAL_STORE_KEY_LOST` and does not change. A reset opens an empty store with a new key. | Default automated checks: Linux, Node 26 | The same test doubles. |
85
+ | Without `encryptionAtRest: false`, the store refuses an op-sqlite build without SQLCipher and creates no file. A plaintext file opened with encryption fails as a key mismatch and does not change. | Default automated checks: Linux, Node 26 | The same test doubles. The double answers as an op-sqlite build without SQLCipher. |
86
+ | Two parallel first opens of one name write one key, and the second open fails with `INVALID_STATE`. An open or a reset of a name that an open store holds fails with `INVALID_STATE`. | Default automated checks: Linux, Node 26 | The same test doubles. |
87
+ | A release build of the bare React Native example stores its state with SQLCipher on Android, with the default keychain vault, and keeps it across a process restart. A key that does not open the file fails with `KEY_STORAGE_ERROR`. | Android emulator job | A release APK on Hermes V1 with the native op-sqlite SQLCipher build, run twice on an Android API 36 x86_64 emulator. Each run must log a SQLCipher version, a database header that is not the SQLite header, and a wrong-key open that fails with `SqliteKeyMismatchError`. The second run must resume the stored identity and complete an exchange. This job runs on a change to the main branch that can reach the React Native runtime, and on demand. It does not run on a pull request. |
88
+ | The bare React Native example, which imports this entry, bundles with the Hermes compiler that React Native pins. | Public CI (`Checks`) | The Android release bundle of the bare React Native example with the packed package. |
89
+
90
+ The Android emulator job is the only CI job that runs this store on Hermes with the native op-sqlite module. No CI job runs it on iOS. On 2026-09-28, a manual check of a development build of the SDK before 8.0.0 ran the bare React Native example in the iOS 26.2 simulator with Xcode 26.3. Each of four launches logged a SQLCipher version, a database header that is not the SQLite header, and the wrong-key failure. Each launch after the first resumed the stored identity.
91
+
92
+ ### Web: `./local/store/web-sqlite`
93
+
94
+ | Claim | Check | What the check runs |
95
+ |---|---|---|
96
+ | The store passes the shared storage contract in a real browser, with the Wasm engine in its worker and the file in the origin private file system (OPFS). | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit on macOS | The page has a Content Security Policy that adds only `'wasm-unsafe-eval'`. |
97
+ | An encrypted file keeps no plaintext in OPFS. A wrong key and no key cannot read it. The web driver reads a SQLCipher 4 file that the Node driver wrote. | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit on macOS | Real files in OPFS. |
98
+ | Two tabs share one file, and a tab hands it over only between transactions. A tab that dies in a transaction leaves the file readable without the writes of that transaction. | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit on macOS | Two real tabs of one origin. |
99
+ | Two tabs that open a new store at the same time write one key. A reset fails with `INVALID_STATE` while another tab has the store open. | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit on macOS | Two real tabs of one origin. |
100
+ | Without `'wasm-unsafe-eval'`, the open fails with `SQLITE_ENGINE_UNAVAILABLE` and writes no key. | Browser storage job: Chromium and Firefox on Linux. WebKit store job: WebKit on macOS | A page under a policy without `'wasm-unsafe-eval'`. |
101
+ | When the origin quota is full, a write and an atomic commit reject with `STORAGE_QUOTA_EXCEEDED` and leave no partial state. The store stays open, and after the clamp is removed, the same commit succeeds. A first open under a full quota rejects with `STORAGE_QUOTA_EXCEEDED`, writes no key and no database file, and succeeds after the clamp is removed. A store with two pool files opens, reads, and writes under a quota that has no room for a new pool. | Browser storage job: Chromium on Linux | A DevTools protocol call clamps the origin quota, and the store fills its real file in OPFS. Firefox and WebKit have no such call, so they do not run this check. |
102
+ | Over a long run, the store holds latency, memory, and file size flat. A closed store leaves no worker and no lock of the store. Two tabs that write in turn each read the last write of the other. | Browser storage job: Chromium on Linux | 150 open, write, read, and close cycles, one session of 2,000 churn operations over 250 sessions, and 100 writes that two tabs make in turn. The check compares the medians of the early and late thirds of the run. It reads the page heap, and the heap and Wasm memory of the store's worker, through the DevTools protocol. Firefox and WebKit have no such protocol in the test runner, and no CI job runs this check in them. |
103
+ | A worker without OPFS synchronous access handles fails with `OPFS_UNAVAILABLE` before it loads the engine. | Browser storage job: Chromium, Firefox, and WebKit on Linux | WebKit on Linux (WebKitGTK) has no OPFS synchronous access handles, so there WebKit runs only these checks and the checks that need no OPFS. |
104
+
105
+ The WebKit store job runs Playwright's WebKit on macOS, where WebKit has OPFS synchronous access handles. It runs only on a change to the web SQLite store, the SQLite core, the storage contract, the key vault, the job, or a dependency. On a pull request, it runs only when a maintainer requests it. In the browser storage job for Chromium and Firefox and in the WebKit store job, a check that skips for want of OPFS fails.
106
+
107
+ The code-generation check in public CI runs the README example with the memory store. It does not load a SQLite store.
108
+
109
+ ### Tauri
110
+
111
+ No CI job runs a Tauri app. A Tauri 2 app uses `./local/store/web-sqlite` in its webview, with no Tauri-specific SDK code, so the web rows above check the same code in browsers. The [web SQLite store guide](../local/store/web-sqlite/README.md#tauri) gives the Tauri setup. On 2026-09-28, a manual check of a development build of the SDK before 8.0.0, in a Tauri 2.12.0 app, passed in WKWebView on macOS 15.7.2 and in the iOS 18.0 simulator. The check covered a two-device exchange, a close and reopen, an app relaunch, a relaunch after the app was killed with both stores open, and the store locks.
112
+
113
+ ### UNVERIFIED
114
+
115
+ No CI job checks these items:
116
+
117
+ - **Safari.** The WebKit store job runs Playwright's WebKit, not Safari. No check ran the web store in Safari.
118
+ - **Tauri on WebView2 (Windows), the Android WebView, and WebKitGTK (Linux).** WebKitGTK 2.54 has no OPFS synchronous access handles, so the expected result of the open is `OPFS_UNAVAILABLE`. No run observed it.
119
+ - **The React Native store on iOS and on physical devices.** No CI job opens `./local/store/react-native` on iOS. The manual check used only the iOS simulator. No check ran the store on a physical Android or iOS device.
120
+ - **iOS devices.** No CI job runs on iOS. The manual checks used only the iOS simulator.
121
+ - **A packaged Electron app.** The Electron store job runs Electron from its npm package, not from an app build.
122
+
50
123
  ## Runtime checks for 2.0.1
51
124
 
52
125
  On 2026-09-12, the browser example completed encrypted exchanges in Chromium, Firefox, and WebKit. Nine checks covered fresh messages, replies, repeated runs, cancellation, reset, and worker-load errors under CSP.
@@ -55,7 +128,7 @@ The Expo example completed encrypted exchanges in development and release builds
55
128
 
56
129
  Both platforms used SQLCipher 4.7.0. After a process restart, Alice retained her identity and completed another exchange. Release builds ran with Metro stopped. These results establish behavior on the listed targets, not device performance.
57
130
 
58
- These application checks are separate from the recurring browser-storage and Hermes backend-contract jobs.
131
+ These application checks are separate from the recurring browser-storage and Hermes flow jobs.
59
132
 
60
133
  ## Review status
61
134
 
@@ -67,7 +140,7 @@ This statement describes our process. It is not an independent security assessme
67
140
 
68
141
  ## Checks you can run
69
142
 
70
- [Public CI](https://github.com/open-e2ee/signal-protocol-js/actions/workflows/ci.yml) runs on pushes and pull requests. Its logs show these checks:
143
+ [Public CI](https://github.com/open-e2ee/signal-protocol-js/actions/workflows/ci.yml) runs on pushes and pull requests. On a draft pull request, it runs only the first two checks. Its logs show these checks:
71
144
 
72
145
  - Install from the committed lockfile, compile the SDK, and check its types.
73
146
  - Check dependencies for known advisories at moderate severity or higher.
@@ -34,11 +34,10 @@ const signal = await createSignalProtocolClient({
34
34
  import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
35
35
  import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
36
36
 
37
- // Initialize the application-owned Expo/SQLCipher database bindings first.
38
37
  const signal = await createHostedSignalProtocolClient({
39
38
  adapters: {
40
39
  // Expo storage owns this device's private keys and session state.
41
- storage: expoStore(),
40
+ storage: await expoStore(),
42
41
  },
43
42
  hosted: {
44
43
  // The environment-scoped connection URL from the OpenE2EE console.
@@ -474,7 +474,7 @@ Two related extensions go with this. A `processedChains` map rejects messages
474
474
  that bear a ratchet key from a retired chain
475
475
  (`internal/protocol/double-ratchet/ratchet.ts:141-153`), which closes a replay gap
476
476
  that `libsignal` handles only through its five-chain window. Self-sessions get a
477
- finite 100,000-message skip limit (`internal/session/validation.ts:453-461`)
477
+ finite 100,000-message skip limit (`internal/session/validation.ts:252-260`)
478
478
  where `libsignal` uses `usize::MAX`.
479
479
 
480
480
  ### 3.4 Session archiving and serialization
@@ -116,13 +116,19 @@ holds each member to a production construction site.
116
116
  | Code | Cause | Application response |
117
117
  |---|---|---|
118
118
  | `KEY_STORAGE_ERROR` | A key-storage operation failed. | Inspect `originalError`, then retry or reinitialize storage. |
119
- | `STORAGE_QUOTA_EXCEEDED` | The storage origin ran out of space. | Free storage space, then retry the rejected write. |
119
+ | `STORAGE_QUOTA_EXCEEDED` | The storage origin ran out of space. | Free storage space, then retry the rejected write or open. |
120
+ | `SECRET_VAULT_REQUIRED` | An operation that keeps a local secret ran without a `SignalProtocolLocalSecretVault`. | Pass a vault, such as `ExpoSecureStoreSignalProtocolSecretVault`, or the application's own. |
121
+ | `LOCAL_STORE_KEY_LOST` | A local store holds data, but its secret vault holds no key for that data. | Restore the vault entry, or reset the store. A reset deletes the local data. |
122
+ | `SQLITE_ENGINE_UNAVAILABLE` | The SQLite Wasm engine did not load in its web worker. Usually the worker's Content Security Policy does not allow `'wasm-unsafe-eval'`. | Allow `'wasm-unsafe-eval'` in `script-src` on the worker script response, and serve the Wasm file as `application/wasm`. |
123
+ | `OPFS_UNAVAILABLE` | The browser cannot keep a SQLite database in the origin private file system, for example in a private or ephemeral context. | Use the IndexedDB store in this runtime. |
124
+ | `OPFS_FILE_BUSY` | The web SQLite store could not open its database file this time, usually because another tab of the origin still holds the file. The file is unchanged. | Retry later. Do not change to another store: the data stays in this one. |
120
125
 
121
126
  ### Initialization and Protocol Policy Errors
122
127
 
123
128
  | Code | Cause | Application response |
124
129
  |---|---|---|
125
130
  | `INITIALIZATION_FAILED` | Client or group initialization failed. | Inspect `originalError` and the configuration. |
131
+ | `SECURE_RANDOM_UNAVAILABLE` | The runtime has no global `crypto.getRandomValues`. The SDK throws `SecureRandomUnavailableError` from `@open-e2ee/signal-protocol-sdk/types`. | On React Native and Expo, install `react-native-get-random-values` 2.x or `react-native-quick-crypto` and load it before the first SDK call. |
126
132
  | `PQXDH_REQUIRED` | Policy requires PQXDH, but the peer lacks required keys. | Wait for new peer keys or queue the message. |
127
133
  | `PQXDH_FAILED` | The PQXDH exchange failed. | Abort setup and inspect `originalError`. |
128
134
  | `TRIPLE_RATCHET_REQUIRED` | Triple Ratchet policy lacks a PQXDH session. | Establish the required PQXDH session first. |
@@ -324,11 +324,10 @@ hosted client:
324
324
  import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
325
325
  import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
326
326
 
327
- // Initialize the application-owned Expo/SQLCipher database bindings first.
328
327
  const signal = await createHostedSignalProtocolClient({
329
328
  adapters: {
330
329
  // Expo storage owns this device's private keys and session state.
331
- storage: expoStore(),
330
+ storage: await expoStore(),
332
331
  },
333
332
  hosted: {
334
333
  // The environment-scoped connection URL from the OpenE2EE console.
@@ -83,6 +83,7 @@ Expo storage or the Convex R2 object store.
83
83
  - `@open-e2ee/signal-protocol-sdk/device/expo`
84
84
  - `@open-e2ee/signal-protocol-sdk/device/lifecycle`
85
85
  - `@open-e2ee/signal-protocol-sdk/device/provisioning`
86
+ - `@open-e2ee/signal-protocol-sdk/device/react-native`
86
87
  - `@open-e2ee/signal-protocol-sdk/encoding`
87
88
  - `@open-e2ee/signal-protocol-sdk/encoding/hex`
88
89
  - `@open-e2ee/signal-protocol-sdk/files`
@@ -101,14 +102,17 @@ Expo storage or the Convex R2 object store.
101
102
  - `@open-e2ee/signal-protocol-sdk/server-clock`
102
103
  - `@open-e2ee/signal-protocol-sdk/local/store`
103
104
  - `@open-e2ee/signal-protocol-sdk/local/store/expo`
104
- - `@open-e2ee/signal-protocol-sdk/local/store/expo/db`
105
- - `@open-e2ee/signal-protocol-sdk/local/store/expo/schema`
105
+ - `@open-e2ee/signal-protocol-sdk/local/store/key-value`
106
+ - `@open-e2ee/signal-protocol-sdk/local/store/key-value/realm`
106
107
  - `@open-e2ee/signal-protocol-sdk/local/store/memory`
107
108
  - `@open-e2ee/signal-protocol-sdk/local/store/node`
108
109
  - `@open-e2ee/signal-protocol-sdk/local/store/react-native`
109
110
  - `@open-e2ee/signal-protocol-sdk/local/store/web`
111
+ - `@open-e2ee/signal-protocol-sdk/local/store/web-sqlite`
110
112
  - `@open-e2ee/signal-protocol-sdk/local/vault`
113
+ - `@open-e2ee/signal-protocol-sdk/local/vault/electron-safe-storage`
111
114
  - `@open-e2ee/signal-protocol-sdk/local/vault/expo-secure-store`
115
+ - `@open-e2ee/signal-protocol-sdk/local/vault/react-native-keychain`
112
116
  - `@open-e2ee/signal-protocol-sdk/types`
113
117
  - `@open-e2ee/signal-protocol-sdk/types/address`
114
118
  - `@open-e2ee/signal-protocol-sdk/types/messages`
@@ -150,16 +154,32 @@ Expo storage or the Convex R2 object store.
150
154
 
151
155
  ### Storage implementations
152
156
 
153
- - `ExpoSignalProtocolStore` for Expo / React Native
154
- - `expoStore()` for Expo / React Native composition
155
- - `@open-e2ee/signal-protocol-sdk/local/store/expo` also exports the Expo helpers
156
- Signal Protocol composes directly: `getKeyStorage`, `getDatabaseKeyManager`,
157
- `clearDatabaseKeyCache`, and `createPreKeyMaintenanceStore`
158
- - `IndexedDbSignalProtocolStore` / `indexedDbStore()` for browsers
159
- - `ReactNativeSignalProtocolStore` / `reactNativeStore()` for bare React Native
160
- (provide your own key-value backend and verify it with the exported
161
- backend-conformance kit)
162
- - `NodeSignalProtocolStore` / `nodeStore()` for Node environments
157
+ - `ExpoSignalProtocolStore` / `await expoStore()` for Expo (the SDK owns the
158
+ SQLCipher database, its key, and its migrations; `resetExpoStore()` deletes
159
+ the database and opens an empty store; `createPreKeyMaintenanceStore(store)`
160
+ runs replaced-prekey maintenance on an open store)
161
+ - `ReactNativeSignalProtocolStore` / `await reactNativeStore()` for
162
+ bare React Native (the SDK owns the SQLCipher database on op-sqlite, its key
163
+ in the react-native-keychain vault, and its migrations;
164
+ `resetReactNativeStore()` deletes the database and opens an empty store)
165
+ - `WebSqliteSignalProtocolStore` / `await webSqliteStore()` for browsers with
166
+ the origin private file system (the SDK owns the SQLite database in a Wasm
167
+ worker, its key, and its migrations; the page's Content Security Policy
168
+ needs `'wasm-unsafe-eval'`)
169
+ - `IndexedDbSignalProtocolStore` / `indexedDbStore()` for browsers without the
170
+ origin private file system, where `webSqliteStore()` fails with
171
+ `OPFS_UNAVAILABLE`
172
+ - `KeyValueSignalProtocolStore` / `keyValueStore()` for an application that
173
+ brings its own key-value engine (provide your own key-value backend and
174
+ verify it with the exported
175
+ backend-conformance kit, or use `createRealmKeyValueBackend()` from
176
+ `local/store/key-value/realm`; the value key lives in a secret vault)
177
+ - `NodeSignalProtocolStore` / `await nodeStore({ directory, vault })` for Node
178
+ and the Electron main process (the SDK owns the SQLCipher database on the
179
+ `better-sqlite3-multiple-ciphers` peer, its key, and its migrations;
180
+ `resetNodeStore()` deletes the database and opens an empty store;
181
+ `createPreKeyMaintenanceStore(store)` runs replaced-prekey maintenance on an
182
+ open store; `sqliteDatabaseKeySlot(path)` names the vault slot of the key)
163
183
  - `InMemorySignalProtocolStore` / `inMemoryStore()` for local development
164
184
  - custom implementations via `SignalProtocolLocalStore`
165
185
 
package/docs/RECIPES.md CHANGED
@@ -100,11 +100,10 @@ through the `onMessageDecrypted` hook.
100
100
  import { createHostedSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
101
101
  import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
102
102
 
103
- // Initialize the application-owned Expo/SQLCipher database bindings first.
104
103
  const signal = await createHostedSignalProtocolClient({
105
104
  adapters: {
106
105
  // Expo storage owns this device's private keys and session state.
107
- storage: expoStore(),
106
+ storage: await expoStore(),
108
107
  },
109
108
  hosted: {
110
109
  // The environment-scoped connection URL from the OpenE2EE console.
@@ -19,7 +19,7 @@
19
19
  <p id="status" role="status">Ready</p>
20
20
  <pre id="output" aria-label="Execution output" tabindex="0"></pre>
21
21
  <p>The browser console shows the same results. Ciphertext changes on each run.</p>
22
- <p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/v7.2.0/examples/browser/src/exchange.ts">Read the exchange code</a> · <a href="https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v7.2.0/examples/browser">Edit on StackBlitz</a></p>
22
+ <p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/v8.1.0/examples/browser/src/exchange.ts">Read the exchange code</a> · <a href="https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v8.1.0/examples/browser">Edit on StackBlitz</a></p>
23
23
  <p>Continue with <a href="https://docs.open-e2ee.dev/start/browser">browser storage</a>, <a href="https://docs.open-e2ee.dev/start/expo">Expo / Hermes setup</a>, or <a href="https://open-e2ee.dev/relay">the OpenE2EE Signal Protocol Relay for separate devices</a>.</p>
24
24
  </main>
25
25
  <script type="module" src="/src/main.ts"></script>
@@ -15,10 +15,8 @@ without coupling the client to a database or platform.
15
15
 
16
16
  ### Primary supported adapter
17
17
 
18
- - `ExpoSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/expo`
19
- - Expo integration helpers from `@open-e2ee/signal-protocol-sdk/local/store/expo`, including
20
- `getKeyStorage`, `getDatabaseKeyManager`, `clearDatabaseKeyCache`, and
21
- `createPreKeyMaintenanceStore`
18
+ - `expoStore` and `ExpoSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/expo`
19
+ - `resetExpoStore` and `createPreKeyMaintenanceStore` from the same entry
22
20
 
23
21
  ### Local development
24
22
 
@@ -26,27 +24,59 @@ without coupling the client to a database or platform.
26
24
 
27
25
  ### Web
28
26
 
27
+ - `webSqliteStore` and `WebSqliteSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web-sqlite`
28
+ - `resetWebSqliteStore` and `createPreKeyMaintenanceStore` from the same entry
29
+
30
+ Use this for browser applications where the origin private file system
31
+ works. It keeps the full core store state in an SDK-owned SQLite database in
32
+ the origin private file system. SQLite3 Multiple Ciphers encrypts the whole
33
+ file in a Wasm worker, and the database key lives in a secret vault, by
34
+ default IndexedDB in the same origin. The page's Content Security Policy must
35
+ allow `'wasm-unsafe-eval'`. A context without the origin private file system
36
+ gets `OPFS_UNAVAILABLE`. The [web SQLite store guide](./web-sqlite/README.md)
37
+ covers the policy, the tabs, and the security boundary. It graduated from
38
+ experimental by completing every gate on the checklist below.
39
+
40
+ A Tauri 2 app uses this store in its webview. See the
41
+ [Tauri section](./web-sqlite/README.md#tauri).
42
+
29
43
  - `IndexedDbSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web`
30
44
 
31
- Use this for browser applications. It implements the full core store
32
- contract, including SESAME records, sender-key state, retry message records,
33
- and recovery helpers. It graduated from experimental by completing every
34
- gate on the checklist below. Deployment still requires the origin-security
35
- review described in the [web adapter guide](./web/README.md).
45
+ Use this where the origin private file system is not available, and
46
+ `webSqliteStore` fails with `OPFS_UNAVAILABLE`. It implements the full core
47
+ store contract, including SESAME records, sender-key state, retry message
48
+ records, and recovery helpers. It graduated from experimental by completing
49
+ every gate on the checklist below. Deployment still requires the
50
+ origin-security review described in the [web adapter guide](./web/README.md).
36
51
 
37
52
  ### Bare React Native
38
53
 
39
- - `ReactNativeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/react-native` (create it with `await ReactNativeSignalProtocolStore.create({ storage })` and provide your own key-value backend)
54
+ - `reactNativeStore` and `ReactNativeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/react-native`
55
+ - `resetReactNativeStore` and `createPreKeyMaintenanceStore` from the same entry
40
56
 
41
- Use this for bare React Native applications that supply their own key-value
42
- backend. It implements the full core store contract, including SESAME records,
43
- sender-key state, retry message records, and recovery helpers. It graduated
44
- from experimental by completing every gate on the checklist below.
57
+ Use this for bare React Native applications. It opens an SDK-owned SQLCipher
58
+ database on op-sqlite, with its key in the react-native-keychain vault, on the
59
+ same SQLite core as the Expo store. It needs the op-sqlite SQLCipher build and
60
+ a native build of the app. The [React Native SQLite guide](./react-native/README.md)
61
+ covers the setup and the iOS build conflicts.
62
+
63
+ ### Own key-value engine
64
+
65
+ - `KeyValueSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/key-value` (create it with `await KeyValueSignalProtocolStore.create({ storage, vault })` and provide your own key-value backend and secret vault)
66
+ - `createRealmKeyValueBackend` from `@open-e2ee/signal-protocol-sdk/local/store/key-value/realm` (a key-value backend over an open Realm that your application installs)
67
+
68
+ Use this for applications that supply their own key-value backend, for
69
+ example Realm on bare React Native. It implements the full core store
70
+ contract, including SESAME records, sender-key state, retry message records,
71
+ and recovery helpers. It graduated from experimental by completing every gate
72
+ on the checklist below.
45
73
  The supplied backend is the application's responsibility: verify it with the
46
74
  exported backend-conformance kit described in the
47
- [React Native adapter guide](./react-native/README.md).
48
- The store uses `expo-crypto` for random bytes, so a bare application must
49
- install Expo modules.
75
+ [key-value store guide](./key-value/README.md).
76
+ The value key lives only in the supplied vault. Data without its key is an
77
+ error, not a reset. The store reads random bytes from the global
78
+ `crypto.getRandomValues`, so a React Native application installs
79
+ `react-native-get-random-values` 2.x or `react-native-quick-crypto`.
50
80
 
51
81
  #### Graduation checklist
52
82
 
@@ -91,13 +121,70 @@ environment an adapter must honor its promises in, not the subject of a test.
91
121
  source repository, and `npm run soak:web-store` runs longer sessions
92
122
  on demand.
93
123
 
94
- `ReactNativeSignalProtocolStore` (graduated, and the gates keep running):
124
+ `WebSqliteSignalProtocolStore` (graduated, and the gates keep running):
125
+
126
+ - [x] Storage contract suites pass in real Chromium, Firefox, and WebKit.
127
+ The suites are the same modules the jest gate runs. They run against
128
+ the store on the web driver in a real tab, under a Content Security
129
+ Policy that adds only `'wasm-unsafe-eval'`. Chromium and Firefox run
130
+ on every change to the source repository. Linux WebKit (WebKitGTK) has
131
+ no origin private file system, so the web SQLite store does not run
132
+ there, and the Linux job proves only `OPFS_UNAVAILABLE` in it. A macOS
133
+ WebKit job runs the suites on each change to the web SQLite store, the
134
+ SQLite core, the storage contract, the key vault, the gate, or a
135
+ dependency, not on every change. In each job, a suite that skips for
136
+ want of the origin private file system fails.
137
+ - [x] Interruption tests. The gate closes a real tab inside an open
138
+ `BEGIN IMMEDIATE` transaction, the kind of transaction that each store
139
+ commit runs in, while a second tab waits to open the same file. The
140
+ second tab reads the file without the uncommitted writes,
141
+ `PRAGMA integrity_check` returns `ok`, and a new write lands. A crashed
142
+ worker gives `SQLITE_ENGINE_UNAVAILABLE`, and the next open starts a
143
+ new worker. Runs in the three engines on the schedule above.
144
+ - [x] Multi-tab tests. Two real tabs share one open file, and each reads
145
+ the other's writes. A read from the second tab waits while the first
146
+ tab holds a write transaction, then sees the committed rows. Two tabs
147
+ that open a new store at the same time write one database key, and
148
+ that key opens the file. A reset gives `INVALID_STATE` while another
149
+ tab has the store open. Runs in the three engines on the schedule
150
+ above.
151
+ - [x] Storage-pressure tests. A real Chromium run clamps the origin quota
152
+ and fills the file in the origin private file system until a write
153
+ fails. A single write and an atomic session and trust commit each
154
+ reject with the typed `StorageQuotaExceededError`
155
+ (`STORAGE_QUOTA_EXCEEDED`). The rejected writes leave no partial state:
156
+ no row of the write, no pinned identity, and the one-time prekey stays.
157
+ The store stays open. After the clamp is removed, the same commit
158
+ succeeds, new writes land, and `PRAGMA integrity_check` returns `ok`.
159
+ A first open under a 1 MB and a 4 MB quota rejects with the same typed
160
+ error, and it writes no database key and no database file. After the
161
+ clamp is removed, the open succeeds. A store with two pool files opens,
162
+ reads, and writes under a 3 MB quota that has no room for a new pool.
163
+ Runs in Chromium on the schedule above. The quota clamp is a DevTools
164
+ protocol call, so Firefox and WebKit do not run it.
165
+ - [x] Soak evidence: a long run holds latency, memory, and file size flat.
166
+ A soak gate drives the store in real Chromium tabs in three phases:
167
+ 150 open/write/read/close cycles in one tab, one session of 2,000
168
+ churn operations over 250 sessions, and 100 writes that two tabs make
169
+ in turn, so that the file moves to the other tab at each write. Each
170
+ write is read back, and `PRAGMA integrity_check` returns `ok` after
171
+ each phase and after each open. A closed store leaves no worker in the
172
+ tab and no lock of the store in the origin. The gate fails if the
173
+ late-run median of latency, of the page heap, or of the worker heap
174
+ grows beyond a small tolerance over the early-run median, if the Wasm
175
+ memory of the worker grows after the first third of the churn, or if
176
+ the database file grows by more than 10% and 64 KiB over the churn.
177
+ Runs in Chromium on each change to the main branch and on each pull
178
+ request that is ready for review. `npm run soak:web-sqlite` also runs
179
+ it in Firefox and WebKit on demand, without the memory checks.
180
+
181
+ `KeyValueSignalProtocolStore` (graduated, and the gates keep running):
95
182
 
96
183
  - [x] Exported backend-conformance kit. The SDK cannot test an
97
184
  application-supplied `storage` backend. Instead it ships the contract
98
185
  suite the application runs against its own backend. The kit exports
99
186
  `runBackendConformance` and `assertBackendConformance`, which execute
100
- thirteen cases against any `ReactNativeKeyValueStorage`:
187
+ thirteen cases against any `KeyValueStorage`:
101
188
 
102
189
  - round-trips
103
190
  - key listing
@@ -113,15 +200,14 @@ environment an adapter must honor its promises in, not the subject of a test.
113
200
  A jest gate proves the kit catches a non-atomic backend, a
114
201
  prefix-matching session removal, and an unserialized backend, on every
115
202
  change to the source repository.
116
- - [x] Reference backend passes that kit on Hermes in CI. The SDK ships
117
- `createReferenceReactNativeBackend`, which specifies the backend
118
- contract in executable form. On each source-repository change, a named
119
- gate bundles the kit with esbuild and runs it on the reference backend.
120
- That gate uses the sha256-pinned Hermes v0.13.0 CLI,
121
- the last standalone Hermes release. It does not cover Hermes V1, which
122
- React Native 0.84 and later ship. The
123
- runner requires an explicit pass sentinel because Hermes exits 0 on an
124
- unhandled async rejection.
203
+ - [x] Reference backend passes that kit on Hermes in CI. The source
204
+ repository holds an in-memory reference backend, which specifies the
205
+ backend contract in executable form. It is not part of the package. On
206
+ each source-repository change, a named gate bundles the kit and runs it
207
+ on the reference backend. That gate uses the Hermes V1 CLI that React
208
+ Native 0.86 uses, with only the globals of a bare React Native app. The
209
+ runner requires an explicit pass line for each case because Hermes
210
+ exits 0 on an unhandled async rejection.
125
211
  - [x] Interruption tests against the reference backend. A simulated process
126
212
  kill before commit leaves each atomic security write fully absent
127
213
  after reopen. Those writes are a session/trust commit, an identity
@@ -137,26 +223,29 @@ environment an adapter must honor its promises in, not the subject of a test.
137
223
 
138
224
  ### Node
139
225
 
140
- - `NodeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/node`
226
+ - `nodeStore` and `NodeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/node`
141
227
 
142
- Use this for non-mobile environments that need a filesystem-backed store. It
143
- implements the full core store contract, including SESAME records, sender-key
144
- state, retry message records, and recovery helpers.
228
+ Use this for Node and the Electron main process. `await nodeStore({ directory,
229
+ vault })` opens an SDK-owned SQLCipher database on the
230
+ `better-sqlite3-multiple-ciphers` peer, with its key in the vault that the app
231
+ passes. The [Node guide](./node/README.md) covers the owner lock, a lost key,
232
+ and reset.
145
233
 
146
234
  ## Composition
147
235
 
148
236
  <!-- doc-snippet:skip requires-external-context -->
149
237
  ```ts
150
238
  import { DefaultSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
151
- import { ExpoSignalProtocolStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
239
+ import { expoStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
152
240
 
153
- // Configure the application-owned Expo/SQLCipher database bindings first.
154
241
  const signal = await DefaultSignalProtocolClient.create(userId, {
155
- storage: new ExpoSignalProtocolStore(),
242
+ storage: await expoStore(),
156
243
  });
157
244
  ```
158
245
 
159
- The [Expo guide](./expo/README.md) shows the required database bootstrap.
246
+ The [Expo guide](./expo/README.md) covers the native build and the database key.
247
+ The [React Native SQLite guide](./react-native/README.md) covers the same for
248
+ bare React Native.
160
249
 
161
250
  ## Storage Responsibilities
162
251
 
@@ -198,7 +287,7 @@ security transition. The shared adapter contract verifies
198
287
  failure rollback, compare-and-swap behavior, one-time-prekey replay rejection,
199
288
  and exact per-user session deletion.
200
289
 
201
- For React Native, the supplied backend's `atomicWrite` is a security boundary,
290
+ For the key-value store, the supplied backend's `atomicWrite` is a security boundary,
202
291
  not a batching optimization. It must commit `check`, `set`, `remove`, and
203
292
  `removeSessionsForUser` operations in one crash-durable transaction. The final
204
293
  operation must enumerate exact plaintext session metadata inside that same
@@ -214,10 +303,16 @@ The `commitSessionTrust` method commits received content, ratchet state, contact
214
303
  The `storeSenderKeyRecord` method commits received content and skipped-key consumption together.
215
304
 
216
305
  An adapter must reject the complete transaction if any write fails.
306
+ When the database file of a SQLite store cannot grow because the disk or the
307
+ storage quota is full, the write rejects with `StorageQuotaExceededError`
308
+ (`STORAGE_QUOTA_EXCEEDED`). SQLite rolls the write back, and the store stays
309
+ open. Free space, then retry the write.
217
310
  `getReceivedContent`, `deleteReceivedContent`, and `deleteExpiredReceivedContent`
218
311
  own recovery and cleanup. Generic unencrypted metadata cannot hold this content.
219
- The Node adapter uses its encrypted security document. Expo uses SQLCipher.
220
- Web and React Native encrypt each content record with their existing store key.
312
+ Expo, bare React Native, and Node use SQLCipher, and the web SQLite store
313
+ encrypts its whole file with SQLite3 Multiple Ciphers. The IndexedDB web store
314
+ and the key-value store encrypt each content record with their existing store
315
+ key.
221
316
 
222
317
  The SDK removes content after durable handling and retains separate bounded
223
318
  duplicate evidence. Cleanup uses the existing thirty-day retry horizon.
@@ -227,9 +322,12 @@ The host application must use idempotent writes keyed by message ID.
227
322
  still requires review of key custody, backups, and host security.
228
323
  - `@open-e2ee/signal-protocol-sdk/local/store/expo` is also the package home for Expo-specific
229
324
  integration helpers that a real app composes directly.
325
+ - `@open-e2ee/signal-protocol-sdk/local/store/react-native` is the same SQLite
326
+ store for bare React Native, on op-sqlite and the react-native-keychain vault.
230
327
  - An adapter carries the experimental label until every item on its
231
- graduation checklist is a named, continuously running CI gate. Both the web
232
- and bare React Native adapters completed theirs.
328
+ graduation checklist is a named, continuously running CI gate. The web
329
+ SQLite store, the IndexedDB web adapter, and the key-value adapter completed
330
+ theirs.
233
331
  - Storage adapters should expose the real package contract instead of app-specific wrappers.
234
332
 
235
333
  ## Related Docs
@@ -239,6 +337,8 @@ The host application must use idempotent writes keyed by message ID.
239
337
  - [remote/README.md](../../remote/README.md)
240
338
  - [Expo adapter](./expo/README.md)
241
339
  - [Node adapter](./node/README.md)
242
- - [Bare React Native adapter](./react-native/README.md)
340
+ - [Web SQLite store](./web-sqlite/README.md)
341
+ - [React Native SQLite store](./react-native/README.md)
342
+ - [Key-value store](./key-value/README.md)
243
343
  - [Web adapter](./web/README.md)
244
344
  - [In-memory adapter](./memory/README.md)