@open-e2ee/signal-protocol-sdk 7.1.0 → 8.0.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 (698) hide show
  1. package/ADAPTERS.md +55 -6
  2. package/ARCHITECTURE.md +1 -0
  3. package/CHANGELOG.md +565 -0
  4. package/README.md +19 -5
  5. package/SECURITY.md +2 -2
  6. package/THIRD_PARTY_NOTICES.md +429 -0
  7. package/TROUBLESHOOTING.md +10 -0
  8. package/client/README.md +1 -2
  9. package/device/README.md +50 -19
  10. package/dist/client/client.d.ts +31 -5
  11. package/dist/client/client.d.ts.map +1 -1
  12. package/dist/client/client.js +149 -90
  13. package/dist/client/client.js.map +1 -1
  14. package/dist/client/event-hooks.d.ts.map +1 -1
  15. package/dist/client/event-hooks.js +2 -0
  16. package/dist/client/event-hooks.js.map +1 -1
  17. package/dist/client/files.d.ts.map +1 -1
  18. package/dist/client/files.js +19 -2
  19. package/dist/client/files.js.map +1 -1
  20. package/dist/client/headless.d.ts +1 -1
  21. package/dist/client/headless.js +1 -1
  22. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  23. package/dist/client/hosted-anonymous-delivery.js +2 -1
  24. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  25. package/dist/client/hosted-connection.d.ts +1 -1
  26. package/dist/client/hosted-connection.d.ts.map +1 -1
  27. package/dist/client/hosted-connection.js +8 -12
  28. package/dist/client/hosted-connection.js.map +1 -1
  29. package/dist/client/hosted-group-authority.d.ts.map +1 -1
  30. package/dist/client/hosted-group-authority.js +2 -1
  31. package/dist/client/hosted-group-authority.js.map +1 -1
  32. package/dist/client/hosted-groups.d.ts.map +1 -1
  33. package/dist/client/hosted-groups.js +2 -1
  34. package/dist/client/hosted-groups.js.map +1 -1
  35. package/dist/client/hosted-push.d.ts.map +1 -1
  36. package/dist/client/hosted-push.js +2 -1
  37. package/dist/client/hosted-push.js.map +1 -1
  38. package/dist/client/hosted-transport.d.ts.map +1 -1
  39. package/dist/client/hosted-transport.js +10 -11
  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-lifecycle.d.ts +6 -2
  52. package/dist/client/relay-lifecycle.d.ts.map +1 -1
  53. package/dist/client/relay-lifecycle.js.map +1 -1
  54. package/dist/client/relay-work.d.ts +30 -0
  55. package/dist/client/relay-work.d.ts.map +1 -0
  56. package/dist/client/relay-work.js +189 -0
  57. package/dist/client/relay-work.js.map +1 -0
  58. package/dist/client/retry.d.ts.map +1 -1
  59. package/dist/client/retry.js +2 -0
  60. package/dist/client/retry.js.map +1 -1
  61. package/dist/client/sessions.d.ts.map +1 -1
  62. package/dist/client/sessions.js +3 -0
  63. package/dist/client/sessions.js.map +1 -1
  64. package/dist/client/signal-service-cipher.d.ts +39 -16
  65. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  66. package/dist/client/signal-service-cipher.js +100 -60
  67. package/dist/client/signal-service-cipher.js.map +1 -1
  68. package/dist/client/state.d.ts +8 -0
  69. package/dist/client/state.d.ts.map +1 -1
  70. package/dist/client/state.js +11 -0
  71. package/dist/client/state.js.map +1 -1
  72. package/dist/client/types.d.ts +5 -1
  73. package/dist/client/types.d.ts.map +1 -1
  74. package/dist/client/types.js.map +1 -1
  75. package/dist/device/connection.d.ts +1 -1
  76. package/dist/device/connection.d.ts.map +1 -1
  77. package/dist/device/connection.js +4 -11
  78. package/dist/device/connection.js.map +1 -1
  79. package/dist/device/device-id.d.ts +10 -4
  80. package/dist/device/device-id.d.ts.map +1 -1
  81. package/dist/device/device-id.js +15 -9
  82. package/dist/device/device-id.js.map +1 -1
  83. package/dist/device/device-name-crypto.d.ts.map +1 -1
  84. package/dist/device/device-name-crypto.js +2 -2
  85. package/dist/device/device-name-crypto.js.map +1 -1
  86. package/dist/device/expo/index.d.ts +25 -8
  87. package/dist/device/expo/index.d.ts.map +1 -1
  88. package/dist/device/expo/index.js +58 -8
  89. package/dist/device/expo/index.js.map +1 -1
  90. package/dist/device/index.d.ts +2 -2
  91. package/dist/device/index.d.ts.map +1 -1
  92. package/dist/device/index.js +3 -2
  93. package/dist/device/index.js.map +1 -1
  94. package/dist/device/lifecycle/index.d.ts +4 -2
  95. package/dist/device/lifecycle/index.d.ts.map +1 -1
  96. package/dist/device/lifecycle/index.js.map +1 -1
  97. package/dist/device/lifecycle/manager.d.ts +12 -14
  98. package/dist/device/lifecycle/manager.d.ts.map +1 -1
  99. package/dist/device/lifecycle/manager.js +52 -97
  100. package/dist/device/lifecycle/manager.js.map +1 -1
  101. package/dist/device/lifecycle/types.d.ts +26 -16
  102. package/dist/device/lifecycle/types.d.ts.map +1 -1
  103. package/dist/device/lifecycle/utils.d.ts +8 -4
  104. package/dist/device/lifecycle/utils.d.ts.map +1 -1
  105. package/dist/device/lifecycle/utils.js +12 -16
  106. package/dist/device/lifecycle/utils.js.map +1 -1
  107. package/dist/device/provisioning.d.ts.map +1 -1
  108. package/dist/device/provisioning.js +6 -8
  109. package/dist/device/provisioning.js.map +1 -1
  110. package/dist/device/react-native/index.d.ts +40 -0
  111. package/dist/device/react-native/index.d.ts.map +1 -0
  112. package/dist/device/react-native/index.js +74 -0
  113. package/dist/device/react-native/index.js.map +1 -0
  114. package/dist/device/transfer.d.ts +15 -7
  115. package/dist/device/transfer.d.ts.map +1 -1
  116. package/dist/device/transfer.js +30 -22
  117. package/dist/device/transfer.js.map +1 -1
  118. package/dist/device/types.d.ts +15 -7
  119. package/dist/device/types.d.ts.map +1 -1
  120. package/dist/device/types.js.map +1 -1
  121. package/dist/device/vault-text.d.ts +13 -0
  122. package/dist/device/vault-text.d.ts.map +1 -0
  123. package/dist/device/vault-text.js +17 -0
  124. package/dist/device/vault-text.js.map +1 -0
  125. package/dist/hooks/use-key-rotation.d.ts.map +1 -1
  126. package/dist/hooks/use-key-rotation.js +2 -1
  127. package/dist/hooks/use-key-rotation.js.map +1 -1
  128. package/dist/index.d.ts +9 -5
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +9 -5
  131. package/dist/index.js.map +1 -1
  132. package/dist/internal/crypto/index.d.ts +3 -3
  133. package/dist/internal/crypto/index.d.ts.map +1 -1
  134. package/dist/internal/crypto/index.js +3 -3
  135. package/dist/internal/crypto/index.js.map +1 -1
  136. package/dist/internal/crypto/random-host.d.ts +1 -1
  137. package/dist/internal/crypto/random-host.d.ts.map +1 -1
  138. package/dist/internal/crypto/random-host.js +3 -2
  139. package/dist/internal/crypto/random-host.js.map +1 -1
  140. package/dist/internal/crypto/random-host.native.d.ts +6 -1
  141. package/dist/internal/crypto/random-host.native.d.ts.map +1 -1
  142. package/dist/internal/crypto/random-host.native.js +14 -10
  143. package/dist/internal/crypto/random-host.native.js.map +1 -1
  144. package/dist/internal/crypto/random-host.node.d.ts +1 -1
  145. package/dist/internal/crypto/random-host.node.d.ts.map +1 -1
  146. package/dist/internal/crypto/random-host.node.js +1 -1
  147. package/dist/internal/crypto/random-host.node.js.map +1 -1
  148. package/dist/internal/crypto/random.d.ts +12 -3
  149. package/dist/internal/crypto/random.d.ts.map +1 -1
  150. package/dist/internal/crypto/random.js +14 -3
  151. package/dist/internal/crypto/random.js.map +1 -1
  152. package/dist/internal/crypto/utils.d.ts.map +1 -1
  153. package/dist/internal/crypto/utils.js +10 -6
  154. package/dist/internal/crypto/utils.js.map +1 -1
  155. package/dist/internal/encoding/proto/primitives.d.ts +2 -0
  156. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  157. package/dist/internal/encoding/proto/primitives.js +2 -1
  158. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  159. package/dist/internal/encoding/proto/signal-message.d.ts +1 -0
  160. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  161. package/dist/internal/encoding/proto/signal-message.js +2 -1
  162. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  163. package/dist/internal/groups/authority-certificate.d.ts.map +1 -1
  164. package/dist/internal/groups/authority-certificate.js +2 -1
  165. package/dist/internal/groups/authority-certificate.js.map +1 -1
  166. package/dist/internal/groups/encrypted-state.d.ts.map +1 -1
  167. package/dist/internal/groups/encrypted-state.js +9 -7
  168. package/dist/internal/groups/encrypted-state.js.map +1 -1
  169. package/dist/internal/groups/invite-link.d.ts.map +1 -1
  170. package/dist/internal/groups/invite-link.js +2 -1
  171. package/dist/internal/groups/invite-link.js.map +1 -1
  172. package/dist/internal/groups/manager.d.ts.map +1 -1
  173. package/dist/internal/groups/manager.js +5 -5
  174. package/dist/internal/groups/manager.js.map +1 -1
  175. package/dist/internal/groups/sdk-store.d.ts.map +1 -1
  176. package/dist/internal/groups/sdk-store.js +4 -3
  177. package/dist/internal/groups/sdk-store.js.map +1 -1
  178. package/dist/internal/groups/server-engine.d.ts +6 -1
  179. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  180. package/dist/internal/groups/server-engine.js +11 -15
  181. package/dist/internal/groups/server-engine.js.map +1 -1
  182. package/dist/internal/groups/wire.d.ts.map +1 -1
  183. package/dist/internal/groups/wire.js +2 -1
  184. package/dist/internal/groups/wire.js.map +1 -1
  185. package/dist/internal/platform/blob.d.ts +10 -0
  186. package/dist/internal/platform/blob.d.ts.map +1 -0
  187. package/dist/internal/platform/blob.js +30 -0
  188. package/dist/internal/platform/blob.js.map +1 -0
  189. package/dist/internal/platform/env.d.ts +13 -0
  190. package/dist/internal/platform/env.d.ts.map +1 -0
  191. package/dist/internal/platform/env.js +17 -0
  192. package/dist/internal/platform/env.js.map +1 -0
  193. package/dist/internal/platform/index.d.ts +5 -0
  194. package/dist/internal/platform/index.d.ts.map +1 -0
  195. package/dist/internal/platform/index.js +5 -0
  196. package/dist/internal/platform/index.js.map +1 -0
  197. package/dist/internal/platform/url.d.ts +72 -0
  198. package/dist/internal/platform/url.d.ts.map +1 -0
  199. package/dist/internal/platform/url.js +275 -0
  200. package/dist/internal/platform/url.js.map +1 -0
  201. package/dist/internal/platform/utf8.d.ts +28 -0
  202. package/dist/internal/platform/utf8.d.ts.map +1 -0
  203. package/dist/internal/platform/utf8.js +167 -0
  204. package/dist/internal/platform/utf8.js.map +1 -0
  205. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +1 -1
  206. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts.map +1 -1
  207. package/dist/internal/protocol/sealed-sender/delivery-token.js +5 -10
  208. package/dist/internal/protocol/sealed-sender/delivery-token.js.map +1 -1
  209. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  210. package/dist/internal/protocol/sealed-sender/proto/index.js +2 -4
  211. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  212. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  213. package/dist/internal/protocol/sender-keys/manager.js +4 -3
  214. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  215. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts +4 -4
  216. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts.map +1 -1
  217. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +8 -10
  218. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js.map +1 -1
  219. package/dist/internal/protocol/username/hash.d.ts.map +1 -1
  220. package/dist/internal/protocol/username/hash.js +18 -3
  221. package/dist/internal/protocol/username/hash.js.map +1 -1
  222. package/dist/internal/protocol/username/link.d.ts.map +1 -1
  223. package/dist/internal/protocol/username/link.js +2 -1
  224. package/dist/internal/protocol/username/link.js.map +1 -1
  225. package/dist/internal/protocol/username/proof.d.ts.map +1 -1
  226. package/dist/internal/protocol/username/proof.js +2 -1
  227. package/dist/internal/protocol/username/proof.js.map +1 -1
  228. package/dist/internal/sesame/device-registry.d.ts +22 -6
  229. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  230. package/dist/internal/sesame/device-registry.js +18 -12
  231. package/dist/internal/sesame/device-registry.js.map +1 -1
  232. package/dist/internal/sesame/index.d.ts +1 -1
  233. package/dist/internal/sesame/index.d.ts.map +1 -1
  234. package/dist/internal/sesame/manager.d.ts.map +1 -1
  235. package/dist/internal/sesame/manager.js +3 -2
  236. package/dist/internal/sesame/manager.js.map +1 -1
  237. package/dist/internal/session/index.d.ts +1 -2
  238. package/dist/internal/session/index.d.ts.map +1 -1
  239. package/dist/internal/session/index.js +1 -1
  240. package/dist/internal/session/index.js.map +1 -1
  241. package/dist/internal/session/validation.d.ts +0 -80
  242. package/dist/internal/session/validation.d.ts.map +1 -1
  243. package/dist/internal/session/validation.js +0 -134
  244. package/dist/internal/session/validation.js.map +1 -1
  245. package/dist/local/store/device-record.d.ts +18 -0
  246. package/dist/local/store/device-record.d.ts.map +1 -0
  247. package/dist/local/store/device-record.js +34 -0
  248. package/dist/local/store/device-record.js.map +1 -0
  249. package/dist/local/store/expo/adapter.d.ts +59 -238
  250. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  251. package/dist/local/store/expo/adapter.js +83 -640
  252. package/dist/local/store/expo/adapter.js.map +1 -1
  253. package/dist/local/store/expo/driver.d.ts +16 -0
  254. package/dist/local/store/expo/driver.d.ts.map +1 -0
  255. package/dist/local/store/expo/driver.js +141 -0
  256. package/dist/local/store/expo/driver.js.map +1 -0
  257. package/dist/local/store/expo/index.d.ts +3 -12
  258. package/dist/local/store/expo/index.d.ts.map +1 -1
  259. package/dist/local/store/expo/index.js +1 -8
  260. package/dist/local/store/expo/index.js.map +1 -1
  261. package/dist/local/store/expo/maintenance.d.ts +3 -2
  262. package/dist/local/store/expo/maintenance.d.ts.map +1 -1
  263. package/dist/local/store/expo/maintenance.js +5 -34
  264. package/dist/local/store/expo/maintenance.js.map +1 -1
  265. package/dist/local/store/index.d.ts +10 -5
  266. package/dist/local/store/index.d.ts.map +1 -1
  267. package/dist/local/store/index.js +10 -5
  268. package/dist/local/store/index.js.map +1 -1
  269. package/dist/local/store/key-value/adapter.d.ts +326 -0
  270. package/dist/local/store/key-value/adapter.d.ts.map +1 -0
  271. package/dist/local/store/key-value/adapter.js +1472 -0
  272. package/dist/local/store/key-value/adapter.js.map +1 -0
  273. package/dist/local/store/{react-native → key-value}/backend-conformance.d.ts +7 -8
  274. package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -0
  275. package/dist/local/store/{react-native → key-value}/backend-conformance.js +4 -5
  276. package/dist/local/store/key-value/backend-conformance.js.map +1 -0
  277. package/dist/local/store/key-value/batch.d.ts +41 -0
  278. package/dist/local/store/key-value/batch.d.ts.map +1 -0
  279. package/dist/local/store/key-value/batch.js +77 -0
  280. package/dist/local/store/key-value/batch.js.map +1 -0
  281. package/dist/local/store/key-value/device-record.d.ts +23 -0
  282. package/dist/local/store/key-value/device-record.d.ts.map +1 -0
  283. package/dist/local/store/key-value/device-record.js +33 -0
  284. package/dist/local/store/key-value/device-record.js.map +1 -0
  285. package/dist/local/store/key-value/index.d.ts +24 -0
  286. package/dist/local/store/key-value/index.d.ts.map +1 -0
  287. package/dist/local/store/key-value/index.js +8 -0
  288. package/dist/local/store/key-value/index.js.map +1 -0
  289. package/dist/local/store/key-value/realm/index.d.ts +83 -0
  290. package/dist/local/store/key-value/realm/index.d.ts.map +1 -0
  291. package/dist/local/store/key-value/realm/index.js +102 -0
  292. package/dist/local/store/key-value/realm/index.js.map +1 -0
  293. package/dist/local/store/{react-native → key-value}/storage.d.ts +6 -6
  294. package/dist/local/store/key-value/storage.d.ts.map +1 -0
  295. package/dist/local/store/key-value/storage.js.map +1 -0
  296. package/dist/local/store/key-value/transactional-backend.d.ts +50 -0
  297. package/dist/local/store/key-value/transactional-backend.d.ts.map +1 -0
  298. package/dist/local/store/key-value/transactional-backend.js +90 -0
  299. package/dist/local/store/key-value/transactional-backend.js.map +1 -0
  300. package/dist/local/store/key-value/value-key.d.ts +34 -0
  301. package/dist/local/store/key-value/value-key.d.ts.map +1 -0
  302. package/dist/local/store/key-value/value-key.js +83 -0
  303. package/dist/local/store/key-value/value-key.js.map +1 -0
  304. package/dist/local/store/memory/adapter.d.ts +8 -0
  305. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  306. package/dist/local/store/memory/adapter.js +60 -75
  307. package/dist/local/store/memory/adapter.js.map +1 -1
  308. package/dist/local/store/node/adapter.d.ts +74 -130
  309. package/dist/local/store/node/adapter.d.ts.map +1 -1
  310. package/dist/local/store/node/adapter.js +83 -727
  311. package/dist/local/store/node/adapter.js.map +1 -1
  312. package/dist/local/store/node/index.d.ts +8 -6
  313. package/dist/local/store/node/index.d.ts.map +1 -1
  314. package/dist/local/store/node/index.js +3 -7
  315. package/dist/local/store/node/index.js.map +1 -1
  316. package/dist/local/store/node/maintenance.d.ts +5 -0
  317. package/dist/local/store/node/maintenance.d.ts.map +1 -0
  318. package/dist/local/store/node/maintenance.js +7 -0
  319. package/dist/local/store/node/maintenance.js.map +1 -0
  320. package/dist/local/store/node/owner-lock.d.ts +26 -0
  321. package/dist/local/store/node/owner-lock.d.ts.map +1 -0
  322. package/dist/local/store/node/owner-lock.js +88 -0
  323. package/dist/local/store/node/owner-lock.js.map +1 -0
  324. package/dist/local/store/react-native/adapter.d.ts +63 -273
  325. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  326. package/dist/local/store/react-native/adapter.js +80 -1405
  327. package/dist/local/store/react-native/adapter.js.map +1 -1
  328. package/dist/local/store/react-native/index.d.ts +7 -19
  329. package/dist/local/store/react-native/index.d.ts.map +1 -1
  330. package/dist/local/store/react-native/index.js +2 -7
  331. package/dist/local/store/react-native/index.js.map +1 -1
  332. package/dist/local/store/react-native/maintenance.d.ts +5 -0
  333. package/dist/local/store/react-native/maintenance.d.ts.map +1 -0
  334. package/dist/local/store/react-native/maintenance.js +7 -0
  335. package/dist/local/store/react-native/maintenance.js.map +1 -0
  336. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts +38 -0
  337. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts.map +1 -0
  338. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js +196 -0
  339. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js.map +1 -0
  340. package/dist/local/store/sqlite/database.d.ts +20 -0
  341. package/dist/local/store/sqlite/database.d.ts.map +1 -0
  342. package/dist/local/store/sqlite/database.js +41 -0
  343. package/dist/local/store/sqlite/database.js.map +1 -0
  344. package/dist/local/store/sqlite/driver.d.ts +138 -0
  345. package/dist/local/store/sqlite/driver.d.ts.map +1 -0
  346. package/dist/local/store/sqlite/driver.js +10 -0
  347. package/dist/local/store/sqlite/driver.js.map +1 -0
  348. package/dist/local/store/sqlite/encryption.d.ts +61 -0
  349. package/dist/local/store/sqlite/encryption.d.ts.map +1 -0
  350. package/dist/local/store/sqlite/encryption.js +98 -0
  351. package/dist/local/store/sqlite/encryption.js.map +1 -0
  352. package/dist/local/store/sqlite/errors.d.ts +70 -0
  353. package/dist/local/store/sqlite/errors.d.ts.map +1 -0
  354. package/dist/local/store/sqlite/errors.js +101 -0
  355. package/dist/local/store/sqlite/errors.js.map +1 -0
  356. package/dist/local/store/sqlite/executor.d.ts +22 -0
  357. package/dist/local/store/sqlite/executor.d.ts.map +1 -0
  358. package/dist/local/store/sqlite/executor.js +129 -0
  359. package/dist/local/store/sqlite/executor.js.map +1 -0
  360. package/dist/local/store/sqlite/index.d.ts +20 -0
  361. package/dist/local/store/sqlite/index.d.ts.map +1 -0
  362. package/dist/local/store/sqlite/index.js +18 -0
  363. package/dist/local/store/sqlite/index.js.map +1 -0
  364. package/dist/local/store/sqlite/key-storage/account.d.ts +45 -0
  365. package/dist/local/store/sqlite/key-storage/account.d.ts.map +1 -0
  366. package/dist/local/store/sqlite/key-storage/account.js +125 -0
  367. package/dist/local/store/sqlite/key-storage/account.js.map +1 -0
  368. package/dist/local/store/sqlite/key-storage/contact-identities.d.ts +19 -0
  369. package/dist/local/store/sqlite/key-storage/contact-identities.d.ts.map +1 -0
  370. package/dist/local/store/sqlite/key-storage/contact-identities.js +85 -0
  371. package/dist/local/store/sqlite/key-storage/contact-identities.js.map +1 -0
  372. package/dist/local/store/sqlite/key-storage/context.d.ts +19 -0
  373. package/dist/local/store/sqlite/key-storage/context.d.ts.map +1 -0
  374. package/dist/local/store/sqlite/key-storage/context.js +18 -0
  375. package/dist/local/store/sqlite/key-storage/context.js.map +1 -0
  376. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts +18 -0
  377. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts.map +1 -0
  378. package/dist/local/store/sqlite/key-storage/identity-keys.js +88 -0
  379. package/dist/local/store/sqlite/key-storage/identity-keys.js.map +1 -0
  380. package/dist/local/store/sqlite/key-storage/index.d.ts +108 -0
  381. package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -0
  382. package/dist/local/store/sqlite/key-storage/index.js +241 -0
  383. package/dist/local/store/sqlite/key-storage/index.js.map +1 -0
  384. package/dist/local/store/sqlite/key-storage/message-records.d.ts +41 -0
  385. package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -0
  386. package/dist/local/store/sqlite/key-storage/message-records.js +133 -0
  387. package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -0
  388. package/dist/local/store/sqlite/key-storage/metadata.d.ts +16 -0
  389. package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -0
  390. package/dist/local/store/sqlite/key-storage/metadata.js +53 -0
  391. package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -0
  392. package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts +36 -0
  393. package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts.map +1 -0
  394. package/dist/local/store/sqlite/key-storage/one-time-prekeys.js +129 -0
  395. package/dist/local/store/sqlite/key-storage/one-time-prekeys.js.map +1 -0
  396. package/dist/local/store/sqlite/key-storage/session-trust.d.ts +10 -0
  397. package/dist/local/store/sqlite/key-storage/session-trust.d.ts.map +1 -0
  398. package/dist/local/store/sqlite/key-storage/session-trust.js +88 -0
  399. package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -0
  400. package/dist/local/store/sqlite/key-storage/sessions.d.ts +50 -0
  401. package/dist/local/store/sqlite/key-storage/sessions.d.ts.map +1 -0
  402. package/dist/local/store/sqlite/key-storage/sessions.js +209 -0
  403. package/dist/local/store/sqlite/key-storage/sessions.js.map +1 -0
  404. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts +69 -0
  405. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts.map +1 -0
  406. package/dist/local/store/sqlite/key-storage/signed-prekeys.js +219 -0
  407. package/dist/local/store/sqlite/key-storage/signed-prekeys.js.map +1 -0
  408. package/dist/local/store/sqlite/maintenance.d.ts +7 -0
  409. package/dist/local/store/sqlite/maintenance.d.ts.map +1 -0
  410. package/dist/local/store/sqlite/maintenance.js +32 -0
  411. package/dist/local/store/sqlite/maintenance.js.map +1 -0
  412. package/dist/local/store/sqlite/migrations.d.ts +31 -0
  413. package/dist/local/store/sqlite/migrations.d.ts.map +1 -0
  414. package/dist/local/store/sqlite/migrations.js +232 -0
  415. package/dist/local/store/sqlite/migrations.js.map +1 -0
  416. package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.d.ts +17 -22
  417. package/dist/local/store/sqlite/models/ec-one-time-prekey.d.ts.map +1 -0
  418. package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.js +61 -99
  419. package/dist/local/store/sqlite/models/ec-one-time-prekey.js.map +1 -0
  420. package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.d.ts +22 -25
  421. package/dist/local/store/sqlite/models/ec-signed-prekey.d.ts.map +1 -0
  422. package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.js +82 -128
  423. package/dist/local/store/sqlite/models/ec-signed-prekey.js.map +1 -0
  424. package/dist/local/store/sqlite/models/identity-key-id.d.ts.map +1 -0
  425. package/dist/local/store/sqlite/models/identity-key-id.js.map +1 -0
  426. package/dist/local/store/{expo → sqlite}/models/index.d.ts +5 -5
  427. package/dist/local/store/sqlite/models/index.d.ts.map +1 -0
  428. package/dist/local/store/{expo → sqlite}/models/index.js +12 -5
  429. package/dist/local/store/sqlite/models/index.js.map +1 -0
  430. package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.d.ts +17 -20
  431. package/dist/local/store/sqlite/models/kyber-one-time-prekey.d.ts.map +1 -0
  432. package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.js +65 -105
  433. package/dist/local/store/sqlite/models/kyber-one-time-prekey.js.map +1 -0
  434. package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.d.ts +3 -3
  435. package/dist/local/store/sqlite/models/kyber-prekey-used.d.ts.map +1 -0
  436. package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.js +13 -25
  437. package/dist/local/store/sqlite/models/kyber-prekey-used.js.map +1 -0
  438. package/dist/local/store/{expo → sqlite}/models/kyber-prekey.d.ts +16 -19
  439. package/dist/local/store/sqlite/models/kyber-prekey.d.ts.map +1 -0
  440. package/dist/local/store/{expo → sqlite}/models/kyber-prekey.js +67 -111
  441. package/dist/local/store/sqlite/models/kyber-prekey.js.map +1 -0
  442. package/dist/local/store/sqlite/models/local-identity.d.ts +51 -0
  443. package/dist/local/store/sqlite/models/local-identity.d.ts.map +1 -0
  444. package/dist/local/store/sqlite/models/local-identity.js +150 -0
  445. package/dist/local/store/sqlite/models/local-identity.js.map +1 -0
  446. package/dist/local/store/{expo → sqlite}/models/message-record.d.ts +15 -44
  447. package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -0
  448. package/dist/local/store/{expo → sqlite}/models/message-record.js +43 -109
  449. package/dist/local/store/sqlite/models/message-record.js.map +1 -0
  450. package/dist/local/store/sqlite/models/recipient-identity.d.ts +21 -0
  451. package/dist/local/store/sqlite/models/recipient-identity.d.ts.map +1 -0
  452. package/dist/local/store/sqlite/models/recipient-identity.js +59 -0
  453. package/dist/local/store/sqlite/models/recipient-identity.js.map +1 -0
  454. package/dist/local/store/sqlite/models/replaced-prekeys.d.ts +23 -0
  455. package/dist/local/store/sqlite/models/replaced-prekeys.d.ts.map +1 -0
  456. package/dist/local/store/sqlite/models/replaced-prekeys.js +42 -0
  457. package/dist/local/store/sqlite/models/replaced-prekeys.js.map +1 -0
  458. package/dist/local/store/{expo → sqlite}/models/sender-key.d.ts +22 -23
  459. package/dist/local/store/sqlite/models/sender-key.d.ts.map +1 -0
  460. package/dist/local/store/{expo → sqlite}/models/sender-key.js +66 -94
  461. package/dist/local/store/sqlite/models/sender-key.js.map +1 -0
  462. package/dist/local/store/sqlite/models/sesame-user-record.d.ts +32 -0
  463. package/dist/local/store/sqlite/models/sesame-user-record.d.ts.map +1 -0
  464. package/dist/local/store/sqlite/models/sesame-user-record.js +78 -0
  465. package/dist/local/store/sqlite/models/sesame-user-record.js.map +1 -0
  466. package/dist/local/store/{expo → sqlite}/models/session.d.ts +24 -20
  467. package/dist/local/store/sqlite/models/session.d.ts.map +1 -0
  468. package/dist/local/store/{expo → sqlite}/models/session.js +54 -72
  469. package/dist/local/store/sqlite/models/session.js.map +1 -0
  470. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +24 -0
  471. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -0
  472. package/dist/local/store/sqlite/models/skipped-sender-key.js +62 -0
  473. package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -0
  474. package/dist/local/store/sqlite/op-sqlite-driver.d.ts +14 -0
  475. package/dist/local/store/sqlite/op-sqlite-driver.d.ts.map +1 -0
  476. package/dist/local/store/sqlite/op-sqlite-driver.js +180 -0
  477. package/dist/local/store/sqlite/op-sqlite-driver.js.map +1 -0
  478. package/dist/local/store/sqlite/open-store.d.ts +83 -0
  479. package/dist/local/store/sqlite/open-store.d.ts.map +1 -0
  480. package/dist/local/store/sqlite/open-store.js +177 -0
  481. package/dist/local/store/sqlite/open-store.js.map +1 -0
  482. package/dist/local/store/sqlite/schema.d.ts +102 -0
  483. package/dist/local/store/sqlite/schema.d.ts.map +1 -0
  484. package/dist/local/store/sqlite/schema.js +61 -0
  485. package/dist/local/store/sqlite/schema.js.map +1 -0
  486. package/dist/local/store/sqlite/store.d.ts +199 -0
  487. package/dist/local/store/sqlite/store.d.ts.map +1 -0
  488. package/dist/local/store/sqlite/store.js +494 -0
  489. package/dist/local/store/sqlite/store.js.map +1 -0
  490. package/dist/local/store/sqlite/web/driver.d.ts +50 -0
  491. package/dist/local/store/sqlite/web/driver.d.ts.map +1 -0
  492. package/dist/local/store/sqlite/web/driver.js +169 -0
  493. package/dist/local/store/sqlite/web/driver.js.map +1 -0
  494. package/dist/local/store/sqlite/web/protocol.d.ts +80 -0
  495. package/dist/local/store/sqlite/web/protocol.d.ts.map +1 -0
  496. package/dist/local/store/sqlite/web/protocol.js +13 -0
  497. package/dist/local/store/sqlite/web/protocol.js.map +1 -0
  498. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +14526 -0
  499. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.wasm +0 -0
  500. package/dist/local/store/sqlite/web/worker.d.ts +36 -0
  501. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -0
  502. package/dist/local/store/sqlite/web/worker.js +616 -0
  503. package/dist/local/store/sqlite/web/worker.js.map +1 -0
  504. package/dist/local/store/web/adapter.d.ts +5 -14
  505. package/dist/local/store/web/adapter.d.ts.map +1 -1
  506. package/dist/local/store/web/adapter.js +119 -106
  507. package/dist/local/store/web/adapter.js.map +1 -1
  508. package/dist/local/store/web/device-record.d.ts +23 -0
  509. package/dist/local/store/web/device-record.d.ts.map +1 -0
  510. package/dist/local/store/web/device-record.js +31 -0
  511. package/dist/local/store/web/device-record.js.map +1 -0
  512. package/dist/local/store/web-sqlite/adapter.d.ts +98 -0
  513. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -0
  514. package/dist/local/store/web-sqlite/adapter.js +151 -0
  515. package/dist/local/store/web-sqlite/adapter.js.map +1 -0
  516. package/dist/local/store/web-sqlite/index.d.ts +14 -0
  517. package/dist/local/store/web-sqlite/index.d.ts.map +1 -0
  518. package/dist/local/store/web-sqlite/index.js +3 -0
  519. package/dist/local/store/web-sqlite/index.js.map +1 -0
  520. package/dist/local/store/web-sqlite/maintenance.d.ts +5 -0
  521. package/dist/local/store/web-sqlite/maintenance.d.ts.map +1 -0
  522. package/dist/local/store/web-sqlite/maintenance.js +7 -0
  523. package/dist/local/store/web-sqlite/maintenance.js.map +1 -0
  524. package/dist/local/store/web-sqlite/store-locks.d.ts +33 -0
  525. package/dist/local/store/web-sqlite/store-locks.d.ts.map +1 -0
  526. package/dist/local/store/web-sqlite/store-locks.js +60 -0
  527. package/dist/local/store/web-sqlite/store-locks.js.map +1 -0
  528. package/dist/local/vault/electron-safe-storage.d.ts +45 -0
  529. package/dist/local/vault/electron-safe-storage.d.ts.map +1 -0
  530. package/dist/local/vault/electron-safe-storage.js +212 -0
  531. package/dist/local/vault/electron-safe-storage.js.map +1 -0
  532. package/dist/local/vault/index.d.ts +4 -2
  533. package/dist/local/vault/index.d.ts.map +1 -1
  534. package/dist/local/vault/indexed-db.d.ts +37 -0
  535. package/dist/local/vault/indexed-db.d.ts.map +1 -0
  536. package/dist/local/vault/indexed-db.js +102 -0
  537. package/dist/local/vault/indexed-db.js.map +1 -0
  538. package/dist/local/vault/react-native-keychain.d.ts +12 -0
  539. package/dist/local/vault/react-native-keychain.d.ts.map +1 -0
  540. package/dist/local/vault/react-native-keychain.js +71 -0
  541. package/dist/local/vault/react-native-keychain.js.map +1 -0
  542. package/dist/local/vault/require.d.ts +10 -0
  543. package/dist/local/vault/require.d.ts.map +1 -0
  544. package/dist/local/vault/require.js +16 -0
  545. package/dist/local/vault/require.js.map +1 -0
  546. package/dist/logger.d.ts.map +1 -1
  547. package/dist/logger.js +2 -1
  548. package/dist/logger.js.map +1 -1
  549. package/dist/media/index.d.ts.map +1 -1
  550. package/dist/media/index.js +2 -1
  551. package/dist/media/index.js.map +1 -1
  552. package/dist/profile/contact-state.d.ts.map +1 -1
  553. package/dist/profile/contact-state.js +2 -4
  554. package/dist/profile/contact-state.js.map +1 -1
  555. package/dist/profile/index.d.ts +0 -1
  556. package/dist/profile/index.d.ts.map +1 -1
  557. package/dist/profile/index.js +0 -2
  558. package/dist/profile/index.js.map +1 -1
  559. package/dist/profile/profile-key.d.ts +16 -11
  560. package/dist/profile/profile-key.d.ts.map +1 -1
  561. package/dist/profile/profile-key.js +29 -29
  562. package/dist/profile/profile-key.js.map +1 -1
  563. package/dist/profile/update-service.d.ts +6 -0
  564. package/dist/profile/update-service.d.ts.map +1 -1
  565. package/dist/profile/update-service.js +3 -1
  566. package/dist/profile/update-service.js.map +1 -1
  567. package/dist/remote/object-store/validation.d.ts.map +1 -1
  568. package/dist/remote/object-store/validation.js +2 -1
  569. package/dist/remote/object-store/validation.js.map +1 -1
  570. package/dist/remote/relay/memory/adapter.d.ts +2 -3
  571. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  572. package/dist/remote/relay/memory/adapter.js +22 -30
  573. package/dist/remote/relay/memory/adapter.js.map +1 -1
  574. package/dist/remote/relay/memory/failures.d.ts.map +1 -1
  575. package/dist/remote/relay/memory/failures.js +2 -1
  576. package/dist/remote/relay/memory/failures.js.map +1 -1
  577. package/dist/remote/relay/memory/group-server.d.ts +5 -1
  578. package/dist/remote/relay/memory/group-server.d.ts.map +1 -1
  579. package/dist/remote/relay/memory/group-server.js +11 -1
  580. package/dist/remote/relay/memory/group-server.js.map +1 -1
  581. package/dist/safety/url.d.ts.map +1 -1
  582. package/dist/safety/url.js +21 -26
  583. package/dist/safety/url.js.map +1 -1
  584. package/dist/types/api.d.ts +15 -2
  585. package/dist/types/api.d.ts.map +1 -1
  586. package/dist/types/errors.d.ts +97 -1
  587. package/dist/types/errors.d.ts.map +1 -1
  588. package/dist/types/errors.js +105 -1
  589. package/dist/types/errors.js.map +1 -1
  590. package/dist/types/session.d.ts.map +1 -1
  591. package/dist/types/session.js +2 -1
  592. package/dist/types/session.js.map +1 -1
  593. package/dist/utils/retry.d.ts +2 -0
  594. package/dist/utils/retry.d.ts.map +1 -1
  595. package/dist/utils/retry.js +4 -2
  596. package/dist/utils/retry.js.map +1 -1
  597. package/docs/ASSURANCE.md +81 -8
  598. package/docs/CLIENT_COMPOSITION.md +1 -2
  599. package/docs/DEVIATIONS.md +27 -3
  600. package/docs/ERROR_HANDLING.md +6 -0
  601. package/docs/GETTING_STARTED.md +1 -2
  602. package/docs/PACKAGE_SURFACE.md +29 -11
  603. package/docs/RECIPES.md +1 -2
  604. package/examples/browser/index.html +1 -1
  605. package/local/store/README.md +117 -34
  606. package/local/store/expo/README.md +67 -47
  607. package/local/store/key-value/README.md +278 -0
  608. package/local/store/node/README.md +206 -45
  609. package/local/store/react-native/README.md +121 -52
  610. package/local/store/web/README.md +9 -0
  611. package/local/store/web-sqlite/README.md +202 -0
  612. package/local/vault/README.md +115 -2
  613. package/package.json +61 -42
  614. package/profile/README.md +9 -11
  615. package/remote/README.md +1 -2
  616. package/dist/local/store/expo/database-key.d.ts +0 -142
  617. package/dist/local/store/expo/database-key.d.ts.map +0 -1
  618. package/dist/local/store/expo/database-key.js +0 -312
  619. package/dist/local/store/expo/database-key.js.map +0 -1
  620. package/dist/local/store/expo/db.d.ts +0 -95
  621. package/dist/local/store/expo/db.d.ts.map +0 -1
  622. package/dist/local/store/expo/db.js +0 -147
  623. package/dist/local/store/expo/db.js.map +0 -1
  624. package/dist/local/store/expo/key-storage.d.ts +0 -429
  625. package/dist/local/store/expo/key-storage.d.ts.map +0 -1
  626. package/dist/local/store/expo/key-storage.js +0 -1361
  627. package/dist/local/store/expo/key-storage.js.map +0 -1
  628. package/dist/local/store/expo/models/ec-one-time-prekey.d.ts.map +0 -1
  629. package/dist/local/store/expo/models/ec-one-time-prekey.js.map +0 -1
  630. package/dist/local/store/expo/models/ec-signed-prekey.d.ts.map +0 -1
  631. package/dist/local/store/expo/models/ec-signed-prekey.js.map +0 -1
  632. package/dist/local/store/expo/models/identity-key-id.d.ts.map +0 -1
  633. package/dist/local/store/expo/models/identity-key-id.js.map +0 -1
  634. package/dist/local/store/expo/models/index.d.ts.map +0 -1
  635. package/dist/local/store/expo/models/index.js.map +0 -1
  636. package/dist/local/store/expo/models/kyber-one-time-prekey.d.ts.map +0 -1
  637. package/dist/local/store/expo/models/kyber-one-time-prekey.js.map +0 -1
  638. package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +0 -1
  639. package/dist/local/store/expo/models/kyber-prekey-used.js.map +0 -1
  640. package/dist/local/store/expo/models/kyber-prekey.d.ts.map +0 -1
  641. package/dist/local/store/expo/models/kyber-prekey.js.map +0 -1
  642. package/dist/local/store/expo/models/local-identity.d.ts +0 -52
  643. package/dist/local/store/expo/models/local-identity.d.ts.map +0 -1
  644. package/dist/local/store/expo/models/local-identity.js +0 -166
  645. package/dist/local/store/expo/models/local-identity.js.map +0 -1
  646. package/dist/local/store/expo/models/message-record.d.ts.map +0 -1
  647. package/dist/local/store/expo/models/message-record.js.map +0 -1
  648. package/dist/local/store/expo/models/recipient-identity.d.ts +0 -21
  649. package/dist/local/store/expo/models/recipient-identity.d.ts.map +0 -1
  650. package/dist/local/store/expo/models/recipient-identity.js +0 -66
  651. package/dist/local/store/expo/models/recipient-identity.js.map +0 -1
  652. package/dist/local/store/expo/models/replaced-prekey-utils.d.ts +0 -33
  653. package/dist/local/store/expo/models/replaced-prekey-utils.d.ts.map +0 -1
  654. package/dist/local/store/expo/models/replaced-prekey-utils.js +0 -54
  655. package/dist/local/store/expo/models/replaced-prekey-utils.js.map +0 -1
  656. package/dist/local/store/expo/models/sender-key.d.ts.map +0 -1
  657. package/dist/local/store/expo/models/sender-key.js.map +0 -1
  658. package/dist/local/store/expo/models/session.d.ts.map +0 -1
  659. package/dist/local/store/expo/models/session.js.map +0 -1
  660. package/dist/local/store/expo/schema.d.ts +0 -1917
  661. package/dist/local/store/expo/schema.d.ts.map +0 -1
  662. package/dist/local/store/expo/schema.js +0 -197
  663. package/dist/local/store/expo/schema.js.map +0 -1
  664. package/dist/local/store/node/database-encryption.d.ts +0 -109
  665. package/dist/local/store/node/database-encryption.d.ts.map +0 -1
  666. package/dist/local/store/node/database-encryption.js +0 -202
  667. package/dist/local/store/node/database-encryption.js.map +0 -1
  668. package/dist/local/store/node/database-file-commit.d.ts +0 -8
  669. package/dist/local/store/node/database-file-commit.d.ts.map +0 -1
  670. package/dist/local/store/node/database-file-commit.js +0 -62
  671. package/dist/local/store/node/database-file-commit.js.map +0 -1
  672. package/dist/local/store/node/database-key.d.ts +0 -129
  673. package/dist/local/store/node/database-key.d.ts.map +0 -1
  674. package/dist/local/store/node/database-key.js +0 -293
  675. package/dist/local/store/node/database-key.js.map +0 -1
  676. package/dist/local/store/node/database-lock.d.ts +0 -8
  677. package/dist/local/store/node/database-lock.d.ts.map +0 -1
  678. package/dist/local/store/node/database-lock.js +0 -44
  679. package/dist/local/store/node/database-lock.js.map +0 -1
  680. package/dist/local/store/node/database.d.ts +0 -226
  681. package/dist/local/store/node/database.d.ts.map +0 -1
  682. package/dist/local/store/node/database.js +0 -813
  683. package/dist/local/store/node/database.js.map +0 -1
  684. package/dist/local/store/react-native/backend-conformance.d.ts.map +0 -1
  685. package/dist/local/store/react-native/backend-conformance.js.map +0 -1
  686. package/dist/local/store/react-native/reference-backend.d.ts +0 -43
  687. package/dist/local/store/react-native/reference-backend.d.ts.map +0 -1
  688. package/dist/local/store/react-native/reference-backend.js +0 -178
  689. package/dist/local/store/react-native/reference-backend.js.map +0 -1
  690. package/dist/local/store/react-native/storage.d.ts.map +0 -1
  691. package/dist/local/store/react-native/storage.js.map +0 -1
  692. package/dist/profile/storage.d.ts +0 -61
  693. package/dist/profile/storage.d.ts.map +0 -1
  694. package/dist/profile/storage.js +0 -145
  695. package/dist/profile/storage.js.map +0 -1
  696. /package/dist/local/store/{react-native → key-value}/storage.js +0 -0
  697. /package/dist/local/store/{expo → sqlite}/models/identity-key-id.d.ts +0 -0
  698. /package/dist/local/store/{expo → sqlite}/models/identity-key-id.js +0 -0
package/docs/ASSURANCE.md CHANGED
@@ -16,16 +16,16 @@ Private testing also exists in other open-source projects. [SQLite publishes som
16
16
 
17
17
  Engineering CI runs the default automated checks on pull requests and changes to the main branch. Release preparation requires a passing run.
18
18
 
19
- Most recent full run on 2026-09-26:
19
+ Most recent full run on 2026-09-28:
20
20
 
21
21
  | | |
22
22
  |---|---|
23
- | Test modules | 432 |
24
- | Test cases | 7,620 |
25
- | Passed | 7,618 |
26
- | Skipped | 2 |
23
+ | Test modules | 466 |
24
+ | Test cases | 8,563 |
25
+ | Passed | 8,559 |
26
+ | Skipped | 4 |
27
27
  | Failed | 0 |
28
- | Wall time | 219 s |
28
+ | Wall time | 434 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,14 +38,87 @@ 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 Hermes.
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
+ - **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.
43
44
  - **Errors:** check construction sites for exported error classes and codes. Reject unresolved code forwarding.
44
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
47
 
47
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.
48
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 pull request and each change to the main branch, unless its row says otherwise.
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 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. | 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
+ | 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. |
103
+
104
+ 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. In the browser storage job for Chromium and Firefox and in the WebKit store job, a check that skips for want of OPFS fails.
105
+
106
+ The code-generation check in public CI runs the README example with the memory store. It does not load a SQLite store.
107
+
108
+ ### Tauri
109
+
110
+ 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.
111
+
112
+ ### UNVERIFIED
113
+
114
+ No CI job checks these items:
115
+
116
+ - **Safari.** The WebKit store job runs Playwright's WebKit, not Safari. No check ran the web store in Safari.
117
+ - **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.
118
+ - **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.
119
+ - **iOS devices.** No CI job runs on iOS. The manual checks used only the iOS simulator.
120
+ - **A packaged Electron app.** The Electron store job runs Electron from its npm package, not from an app build.
121
+
49
122
  ## Runtime checks for 2.0.1
50
123
 
51
124
  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.
@@ -54,7 +127,7 @@ The Expo example completed encrypted exchanges in development and release builds
54
127
 
55
128
  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.
56
129
 
57
- These application checks are separate from the recurring browser-storage and Hermes backend-contract jobs.
130
+ These application checks are separate from the recurring browser-storage and Hermes flow jobs.
58
131
 
59
132
  ## Review status
60
133
 
@@ -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.
@@ -82,7 +82,7 @@ model and what is out of scope.
82
82
  | **Padding** | — | **Extension.** ISO 7816-4 bit padding to 160-byte buckets inside the library | Length hiding by default rather than left to the application | `libsignal` does not pad at this layer; Signal Messenger's apps do. PKCS#7 then adds a block, so ciphertext lands 16 bytes past each boundary |
83
83
  | **SPQR / ML-KEM Braid** | ML-KEM Braid rev. 1 | **Deviation.** Same protocol, same KDF labels, same Reed–Solomon parameters, byte-identical message framing — except `hek = SHA3-256(ek_seed ‖ ek_vector)`, the operand order the specification states, which is the reverse of `libsignal`'s implementation | The normative text was followed over the executable reference | Wire-visible. Headers, ciphertexts, and shared secrets diverge; a braid session cannot complete a single epoch against `libsignal`'s implementation. Also means the KEM is not FIPS 203 in braid mode |
84
84
  | **Triple Ratchet** | `libsignal` `triple_ratchet.rs` | **Faithful.** The PQ secret enters as the HKDF salt at message-key expansion, same label, same order | — | The braiding construction follows the ML-KEM Braid specification |
85
- | **Sesame** | Sesame rev. 2 | **Deviation** on session expiry (§4.2 applies only to unacknowledged sessions) and on deleted devices (hard-removed rather than marked stale). **Extensions:** QR provisioning, device transfer, encrypted device names, identity-change gating, a 5-device cap | Product requirements the specification does not address | Hard deletion **drops the MAXLATENCY window, so in-flight messages from a just-removed device become permanently undecryptable**. Device transfer clones ratchet state, which weakens the forward-secrecy bound |
85
+ | **Sesame** | Sesame rev. 2 | **Deviation** on session expiry (§4.2 applies only to unacknowledged sessions), on deleted devices (hard-removed rather than marked stale), and on device-list currency (the sender reads the relay's list at most once per 60 s instead of the server rejecting a stale send). **Extensions:** QR provisioning, device transfer, encrypted device names, identity-change gating, a 5-device cap | Product requirements the specification does not address | Hard deletion **drops the MAXLATENCY window, so in-flight messages from a just-removed device become permanently undecryptable**. A device linked or removed less than 60 s ago can miss a send or still receive one. Device transfer clones ratchet state, which weakens the forward-secrecy bound |
86
86
  | **Sealed sender** | `libsignal` `sealed_sender.rs` | **Faithful** on the multi-recipient transport labels, KEM, AES-256-GCM-SIV, binary format, and `0x3FFF` registration-ID mask. **Extension:** sender and server certificates require signed Relay scope and issuer validity under operator-owned Ed25519 roots | Binds anonymous delivery to one Relay deployment and supports explicit issuer rotation and revocation | The transport follows `libsignal`; certificates are not interchangeable with Signal Messenger or another deployment |
87
87
  | **Delivery token** | `libsignal` `profile_key.rs` | **Faithful.** `deriveAccessKey` follows `libsignal`'s `ProfileKey::derive_access_key`, and reproduces `libsignal`'s published known-answer values | — | Not an SDK invention, despite what the module name suggests |
88
88
  | **Sender keys** | `libsignal` `sender_keys.rs` | **Deviation.** Protobuf field numbers and `0x33` framing match, and the `0x01`/`0x02` seeds match, but message-key derivation **omits HKDF-Extract**, signatures are Ed25519 not XEdDSA, and `distributionUuid` carries a UTF-8 string rather than 16 UUID bytes | The Ed25519 choice follows the identity profile; the missing Extract appears unintentional | Group message keys differ from `libsignal`'s for the same chain key. Confirmed numerically, not merely by inspection |
@@ -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
@@ -681,7 +681,8 @@ The per-user identity model is one of the two models the specification permits
681
681
  §3.1 and §3.3 require an implementation to mark a removed device's record stale
682
682
  and keep it for MAXLATENCY. Messages already in flight from that device then
683
683
  still decrypt. The SDK removes the record immediately
684
- (`internal/sesame/manager.ts:2098-2102`).
684
+ (`internal/sesame/manager.ts:2098-2102`). A send also removes, immediately, each
685
+ device record that the relay no longer lists for the recipient (§5.5).
685
686
 
686
687
  **State the consequence plainly. A message that a device sent moments before its
687
688
  removal becomes permanently undecryptable.** The specification's staleness window
@@ -753,6 +754,29 @@ sign a server-issued nonce with its identity private key. Registration therefore
753
754
  trusts the relay more than §6.3 assumes. A deployment that needs proof of
754
755
  possession must add it at the application layer.
755
756
 
757
+ ### 5.5 The sender reads the device list; the server does not reject a stale send
758
+
759
+ §3.3 steps 3 and 4 make the server the check. The server accepts a send only
760
+ when the sender's list of device IDs is current, and otherwise rejects it with
761
+ the old and new device IDs. The Signal Protocol Relay takes one message per
762
+ device and has no whole-user device-set check, so it cannot reject a send
763
+ that omits a device.
764
+
765
+ The SDK therefore reads the recipient's device list from the relay
766
+ (`getActiveDevices`) before a direct send or a sender key distribution, when
767
+ the last read for that recipient is more than 60 s old
768
+ (`RECIPIENT_DEVICE_LIST_FRESH_MILLISECONDS` in
769
+ `client/signal-service-cipher.ts`). It makes a session for each listed device
770
+ that has none, and removes each local device record that the relay does not
771
+ list. The time of the last read is kept in memory only, so a restarted client
772
+ reads the list on its first send to each recipient.
773
+
774
+ **Consequence.** A device linked less than 60 s before a send can miss that
775
+ send, and a device removed less than 60 s before a send can still receive it.
776
+ The SESAME stale-device-list retry loop (`StaleDeviceListError`) stays in
777
+ `internal/sesame/manager.ts`, but no caller supplies a device-list version, so
778
+ it never runs.
779
+
756
780
  ---
757
781
 
758
782
  ## 6. Sealed sender
@@ -117,12 +117,18 @@ holds each member to a production construction site.
117
117
  |---|---|---|
118
118
  | `KEY_STORAGE_ERROR` | A key-storage operation failed. | Inspect `originalError`, then retry or reinitialize storage. |
119
119
  | `STORAGE_QUOTA_EXCEEDED` | The storage origin ran out of space. | Free storage space, then retry the rejected write. |
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,30 @@ 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`
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)
158
165
  - `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
166
+ - `WebSqliteSignalProtocolStore` / `await webSqliteStore()` for browsers with
167
+ the origin private file system (the SDK owns the SQLite database in a Wasm
168
+ worker, its key, and its migrations; the page's Content Security Policy
169
+ needs `'wasm-unsafe-eval'`)
170
+ - `KeyValueSignalProtocolStore` / `keyValueStore()` for an application that
171
+ brings its own key-value engine (provide your own key-value backend and
172
+ verify it with the exported
173
+ backend-conformance kit, or use `createRealmKeyValueBackend()` from
174
+ `local/store/key-value/realm`; the value key lives in a secret vault)
175
+ - `NodeSignalProtocolStore` / `await nodeStore({ directory, vault })` for Node
176
+ and the Electron main process (the SDK owns the SQLCipher database on the
177
+ `better-sqlite3-multiple-ciphers` peer, its key, and its migrations;
178
+ `resetNodeStore()` deletes the database and opens an empty store;
179
+ `createPreKeyMaintenanceStore(store)` runs replaced-prekey maintenance on an
180
+ open store; `sqliteDatabaseKeySlot(path)` names the vault slot of the key)
163
181
  - `InMemorySignalProtocolStore` / `inMemoryStore()` for local development
164
182
  - custom implementations via `SignalProtocolLocalStore`
165
183
 
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.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/v7.1.0/examples/browser">Edit on StackBlitz</a></p>
22
+ <p><a href="https://github.com/open-e2ee/signal-protocol-js/tree/v8.0.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.0.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
 
@@ -34,17 +32,49 @@ and recovery helpers. It graduated from experimental by completing every
34
32
  gate on the checklist below. Deployment still requires the origin-security
35
33
  review described in the [web adapter guide](./web/README.md).
36
34
 
35
+ - `webSqliteStore` and `WebSqliteSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web-sqlite`
36
+ - `resetWebSqliteStore` and `createPreKeyMaintenanceStore` from the same entry
37
+
38
+ This store keeps the same state in an SDK-owned SQLite database in the origin
39
+ private file system. SQLite3 Multiple Ciphers encrypts the whole file in a Wasm
40
+ worker, and the database key lives in a secret vault, by default IndexedDB in
41
+ the same origin. The page's Content Security Policy must allow
42
+ `'wasm-unsafe-eval'`. A context without the origin private file system gets
43
+ `OPFS_UNAVAILABLE`. The [web SQLite store guide](./web-sqlite/README.md) covers
44
+ the policy, the tabs, and the security boundary. This store is experimental:
45
+ one item on its graduation checklist below is open.
46
+
47
+ A Tauri 2 app uses this store in its webview. See the
48
+ [Tauri section](./web-sqlite/README.md#tauri).
49
+
37
50
  ### Bare React Native
38
51
 
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)
52
+ - `reactNativeStore` and `ReactNativeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/react-native`
53
+ - `resetReactNativeStore` and `createPreKeyMaintenanceStore` from the same entry
54
+
55
+ Use this for bare React Native applications. It opens an SDK-owned SQLCipher
56
+ database on op-sqlite, with its key in the react-native-keychain vault, on the
57
+ same SQLite core as the Expo store. It needs the op-sqlite SQLCipher build and
58
+ a native build of the app. The [React Native SQLite guide](./react-native/README.md)
59
+ covers the setup and the iOS build conflicts.
40
60
 
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.
61
+ ### Own key-value engine
62
+
63
+ - `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)
64
+ - `createRealmKeyValueBackend` from `@open-e2ee/signal-protocol-sdk/local/store/key-value/realm` (a key-value backend over an open Realm that your application installs)
65
+
66
+ Use this for applications that supply their own key-value backend, for
67
+ example Realm on bare React Native. It implements the full core store
68
+ contract, including SESAME records, sender-key state, retry message records,
69
+ and recovery helpers. It graduated from experimental by completing every gate
70
+ on the checklist below.
45
71
  The supplied backend is the application's responsibility: verify it with the
46
72
  exported backend-conformance kit described in the
47
- [React Native adapter guide](./react-native/README.md).
73
+ [key-value store guide](./key-value/README.md).
74
+ The value key lives only in the supplied vault. Data without its key is an
75
+ error, not a reset. The store reads random bytes from the global
76
+ `crypto.getRandomValues`, so a React Native application installs
77
+ `react-native-get-random-values` 2.x or `react-native-quick-crypto`.
48
78
 
49
79
  #### Graduation checklist
50
80
 
@@ -89,13 +119,52 @@ environment an adapter must honor its promises in, not the subject of a test.
89
119
  source repository, and `npm run soak:web-store` runs longer sessions
90
120
  on demand.
91
121
 
92
- `ReactNativeSignalProtocolStore` (graduated, and the gates keep running):
122
+ `WebSqliteSignalProtocolStore` (experimental, with one item open):
123
+
124
+ - [x] Storage contract suites pass in real Chromium, Firefox, and WebKit.
125
+ The suites are the same modules the jest gate runs. They run against
126
+ the store on the web driver in a real tab, under a Content Security
127
+ Policy that adds only `'wasm-unsafe-eval'`. Chromium and Firefox run
128
+ on every change to the source repository. Linux WebKit (WebKitGTK) has
129
+ no origin private file system, so the web SQLite store does not run
130
+ there, and the Linux job proves only `OPFS_UNAVAILABLE` in it. A macOS
131
+ WebKit job runs the suites on each change to the web SQLite store, the
132
+ SQLite core, the storage contract, the key vault, the gate, or a
133
+ dependency, not on every change. In each job, a suite that skips for
134
+ want of the origin private file system fails.
135
+ - [x] Interruption tests. The gate closes a real tab inside an open
136
+ `BEGIN IMMEDIATE` transaction, the kind of transaction that each store
137
+ commit runs in, while a second tab waits to open the same file. The
138
+ second tab reads the file without the uncommitted writes,
139
+ `PRAGMA integrity_check` returns `ok`, and a new write lands. A crashed
140
+ worker gives `SQLITE_ENGINE_UNAVAILABLE`, and the next open starts a
141
+ new worker. Runs in the three engines on the schedule above.
142
+ - [x] Multi-tab tests. Two real tabs share one open file, and each reads
143
+ the other's writes. A read from the second tab waits while the first
144
+ tab holds a write transaction, then sees the committed rows. Two tabs
145
+ that open a new store at the same time write one database key, and
146
+ that key opens the file. A reset gives `INVALID_STATE` while another
147
+ tab has the store open. Runs in the three engines on the schedule
148
+ above.
149
+ - [x] Storage-pressure tests. A real Chromium run clamps the origin quota
150
+ and fills the file in the origin private file system until a write
151
+ fails. A single write and an atomic session and trust commit each
152
+ reject with the typed `StorageQuotaExceededError`
153
+ (`STORAGE_QUOTA_EXCEEDED`). The rejected writes leave no partial state:
154
+ no row of the write, no pinned identity, and the one-time prekey stays.
155
+ The store stays open. After the clamp is removed, the same commit
156
+ succeeds, new writes land, and `PRAGMA integrity_check` returns `ok`.
157
+ Runs in Chromium on the schedule above. The quota clamp is a DevTools
158
+ protocol call, so Firefox and WebKit do not run it.
159
+ - [ ] Soak evidence. No soak gate runs against this store.
160
+
161
+ `KeyValueSignalProtocolStore` (graduated, and the gates keep running):
93
162
 
94
163
  - [x] Exported backend-conformance kit. The SDK cannot test an
95
164
  application-supplied `storage` backend. Instead it ships the contract
96
165
  suite the application runs against its own backend. The kit exports
97
166
  `runBackendConformance` and `assertBackendConformance`, which execute
98
- thirteen cases against any `ReactNativeKeyValueStorage`:
167
+ thirteen cases against any `KeyValueStorage`:
99
168
 
100
169
  - round-trips
101
170
  - key listing
@@ -111,14 +180,14 @@ environment an adapter must honor its promises in, not the subject of a test.
111
180
  A jest gate proves the kit catches a non-atomic backend, a
112
181
  prefix-matching session removal, and an unserialized backend, on every
113
182
  change to the source repository.
114
- - [x] Reference backend passes that kit on Hermes in CI. The SDK ships
115
- `createReferenceReactNativeBackend`, which specifies the backend
116
- contract in executable form. A named gate bundles the kit with esbuild
117
- and runs it against the reference backend. That gate uses the
118
- sha256-pinned Hermes CLI, the engine React Native ships with. It runs
119
- on every change to the source repository. The runner requires an
120
- explicit pass sentinel because Hermes exits 0 on an unhandled async
121
- rejection.
183
+ - [x] Reference backend passes that kit on Hermes in CI. The source
184
+ repository holds an in-memory reference backend, which specifies the
185
+ backend contract in executable form. It is not part of the package. On
186
+ each source-repository change, a named gate bundles the kit and runs it
187
+ on the reference backend. That gate uses the Hermes V1 CLI that React
188
+ Native 0.86 uses, with only the globals of a bare React Native app. The
189
+ runner requires an explicit pass line for each case because Hermes
190
+ exits 0 on an unhandled async rejection.
122
191
  - [x] Interruption tests against the reference backend. A simulated process
123
192
  kill before commit leaves each atomic security write fully absent
124
193
  after reopen. Those writes are a session/trust commit, an identity
@@ -134,26 +203,29 @@ environment an adapter must honor its promises in, not the subject of a test.
134
203
 
135
204
  ### Node
136
205
 
137
- - `NodeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/node`
206
+ - `nodeStore` and `NodeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/node`
138
207
 
139
- Use this for non-mobile environments that need a filesystem-backed store. It
140
- implements the full core store contract, including SESAME records, sender-key
141
- state, retry message records, and recovery helpers.
208
+ Use this for Node and the Electron main process. `await nodeStore({ directory,
209
+ vault })` opens an SDK-owned SQLCipher database on the
210
+ `better-sqlite3-multiple-ciphers` peer, with its key in the vault that the app
211
+ passes. The [Node guide](./node/README.md) covers the owner lock, a lost key,
212
+ and reset.
142
213
 
143
214
  ## Composition
144
215
 
145
216
  <!-- doc-snippet:skip requires-external-context -->
146
217
  ```ts
147
218
  import { DefaultSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
148
- import { ExpoSignalProtocolStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
219
+ import { expoStore } from '@open-e2ee/signal-protocol-sdk/local/store/expo';
149
220
 
150
- // Configure the application-owned Expo/SQLCipher database bindings first.
151
221
  const signal = await DefaultSignalProtocolClient.create(userId, {
152
- storage: new ExpoSignalProtocolStore(),
222
+ storage: await expoStore(),
153
223
  });
154
224
  ```
155
225
 
156
- The [Expo guide](./expo/README.md) shows the required database bootstrap.
226
+ The [Expo guide](./expo/README.md) covers the native build and the database key.
227
+ The [React Native SQLite guide](./react-native/README.md) covers the same for
228
+ bare React Native.
157
229
 
158
230
  ## Storage Responsibilities
159
231
 
@@ -195,7 +267,7 @@ security transition. The shared adapter contract verifies
195
267
  failure rollback, compare-and-swap behavior, one-time-prekey replay rejection,
196
268
  and exact per-user session deletion.
197
269
 
198
- For React Native, the supplied backend's `atomicWrite` is a security boundary,
270
+ For the key-value store, the supplied backend's `atomicWrite` is a security boundary,
199
271
  not a batching optimization. It must commit `check`, `set`, `remove`, and
200
272
  `removeSessionsForUser` operations in one crash-durable transaction. The final
201
273
  operation must enumerate exact plaintext session metadata inside that same
@@ -211,10 +283,16 @@ The `commitSessionTrust` method commits received content, ratchet state, contact
211
283
  The `storeSenderKeyRecord` method commits received content and skipped-key consumption together.
212
284
 
213
285
  An adapter must reject the complete transaction if any write fails.
286
+ When the database file of a SQLite store cannot grow because the disk or the
287
+ storage quota is full, the write rejects with `StorageQuotaExceededError`
288
+ (`STORAGE_QUOTA_EXCEEDED`). SQLite rolls the write back, and the store stays
289
+ open. Free space, then retry the write.
214
290
  `getReceivedContent`, `deleteReceivedContent`, and `deleteExpiredReceivedContent`
215
291
  own recovery and cleanup. Generic unencrypted metadata cannot hold this content.
216
- The Node adapter uses its encrypted security document. Expo uses SQLCipher.
217
- Web and React Native encrypt each content record with their existing store key.
292
+ Expo, bare React Native, and Node use SQLCipher, and the web SQLite store
293
+ encrypts its whole file with SQLite3 Multiple Ciphers. The IndexedDB web store
294
+ and the key-value store encrypt each content record with their existing store
295
+ key.
218
296
 
219
297
  The SDK removes content after durable handling and retains separate bounded
220
298
  duplicate evidence. Cleanup uses the existing thirty-day retry horizon.
@@ -224,9 +302,12 @@ The host application must use idempotent writes keyed by message ID.
224
302
  still requires review of key custody, backups, and host security.
225
303
  - `@open-e2ee/signal-protocol-sdk/local/store/expo` is also the package home for Expo-specific
226
304
  integration helpers that a real app composes directly.
305
+ - `@open-e2ee/signal-protocol-sdk/local/store/react-native` is the same SQLite
306
+ store for bare React Native, on op-sqlite and the react-native-keychain vault.
227
307
  - An adapter carries the experimental label until every item on its
228
- graduation checklist is a named, continuously running CI gate. Both the web
229
- and bare React Native adapters completed theirs.
308
+ graduation checklist is a named, continuously running CI gate. The IndexedDB
309
+ web adapter and the key-value adapter completed theirs. The web SQLite store
310
+ has one item open.
230
311
  - Storage adapters should expose the real package contract instead of app-specific wrappers.
231
312
 
232
313
  ## Related Docs
@@ -236,6 +317,8 @@ The host application must use idempotent writes keyed by message ID.
236
317
  - [remote/README.md](../../remote/README.md)
237
318
  - [Expo adapter](./expo/README.md)
238
319
  - [Node adapter](./node/README.md)
239
- - [Bare React Native adapter](./react-native/README.md)
320
+ - [Web SQLite store](./web-sqlite/README.md)
321
+ - [React Native SQLite store](./react-native/README.md)
322
+ - [Key-value store](./key-value/README.md)
240
323
  - [Web adapter](./web/README.md)
241
324
  - [In-memory adapter](./memory/README.md)