jazz-tools 2.0.0-alpha.60 → 2.0.0-alpha.62

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 (719) hide show
  1. package/README.md +1 -1
  2. package/bin/jazz-tools.js +3 -0
  3. package/dist/_dev/native-account-session.d.ts +8 -1
  4. package/dist/_dev/native-account-session.d.ts.map +1 -1
  5. package/dist/_dev/native-account-session.js +10 -0
  6. package/dist/_dev/native-account-session.js.map +1 -1
  7. package/dist/accounts/account-manager-core.d.ts +6 -0
  8. package/dist/accounts/account-manager-core.d.ts.map +1 -1
  9. package/dist/accounts/account-manager-core.js +26 -2
  10. package/dist/accounts/account-manager-core.js.map +1 -1
  11. package/dist/accounts/enrollment.d.ts.map +1 -1
  12. package/dist/accounts/enrollment.js +13 -4
  13. package/dist/accounts/enrollment.js.map +1 -1
  14. package/dist/accounts/exports.d.ts +1 -2
  15. package/dist/accounts/exports.d.ts.map +1 -1
  16. package/dist/accounts/exports.js +4 -1
  17. package/dist/accounts/exports.js.map +1 -1
  18. package/dist/accounts/persistence.d.ts +38 -2
  19. package/dist/accounts/persistence.d.ts.map +1 -1
  20. package/dist/accounts/persistence.js +123 -6
  21. package/dist/accounts/persistence.js.map +1 -1
  22. package/dist/accounts/registry-client.d.ts +29 -0
  23. package/dist/accounts/registry-client.d.ts.map +1 -1
  24. package/dist/accounts/registry-client.js +45 -0
  25. package/dist/accounts/registry-client.js.map +1 -1
  26. package/dist/accounts/state.d.ts.map +1 -1
  27. package/dist/accounts/state.js +2 -1
  28. package/dist/accounts/state.js.map +1 -1
  29. package/dist/backend/create-jazz-context.d.ts +7 -0
  30. package/dist/backend/create-jazz-context.d.ts.map +1 -1
  31. package/dist/backend/create-jazz-context.js +115 -18
  32. package/dist/backend/create-jazz-context.js.map +1 -1
  33. package/dist/backend/create-jazz-session.d.ts +9 -7
  34. package/dist/backend/create-jazz-session.d.ts.map +1 -1
  35. package/dist/backend/create-jazz-session.js +55 -17
  36. package/dist/backend/create-jazz-session.js.map +1 -1
  37. package/dist/backend/create-jazz.d.ts +196 -38
  38. package/dist/backend/create-jazz.d.ts.map +1 -1
  39. package/dist/backend/create-jazz.js +935 -147
  40. package/dist/backend/create-jazz.js.map +1 -1
  41. package/dist/backend/early-db.d.ts.map +1 -1
  42. package/dist/backend/early-db.js +1 -0
  43. package/dist/backend/early-db.js.map +1 -1
  44. package/dist/backend/external-jwt.d.ts.map +1 -1
  45. package/dist/backend/external-jwt.js +34 -10
  46. package/dist/backend/external-jwt.js.map +1 -1
  47. package/dist/backend/from-jwt.d.ts +6 -4
  48. package/dist/backend/from-jwt.d.ts.map +1 -1
  49. package/dist/backend/from-jwt.js +11 -3
  50. package/dist/backend/from-jwt.js.map +1 -1
  51. package/dist/backend/index.d.ts +2 -1
  52. package/dist/backend/index.d.ts.map +1 -1
  53. package/dist/backend/index.js +3 -1
  54. package/dist/backend/index.js.map +1 -1
  55. package/dist/backend/inspect-ui.d.ts +14 -0
  56. package/dist/backend/inspect-ui.d.ts.map +1 -0
  57. package/dist/backend/inspect-ui.js +156 -0
  58. package/dist/backend/inspect-ui.js.map +1 -0
  59. package/dist/backend/inspect.d.ts +133 -0
  60. package/dist/backend/inspect.d.ts.map +1 -0
  61. package/dist/backend/inspect.js +983 -0
  62. package/dist/backend/inspect.js.map +1 -0
  63. package/dist/backend/inspector-ui/0.js +2 -0
  64. package/dist/backend/inspector-ui/1.js +2 -0
  65. package/dist/backend/inspector-ui/10.js +2 -0
  66. package/dist/backend/inspector-ui/11.js +2 -0
  67. package/dist/backend/inspector-ui/12.js +2 -0
  68. package/dist/backend/inspector-ui/13.js +2 -0
  69. package/dist/backend/inspector-ui/14.js +2 -0
  70. package/dist/backend/inspector-ui/15.js +2 -0
  71. package/dist/backend/inspector-ui/16.js +2 -0
  72. package/dist/backend/inspector-ui/17.js +2 -0
  73. package/dist/backend/inspector-ui/18.js +2 -0
  74. package/dist/backend/inspector-ui/19.js +2 -0
  75. package/dist/backend/inspector-ui/2.js +2 -0
  76. package/dist/backend/inspector-ui/20.js +2 -0
  77. package/dist/backend/inspector-ui/3.js +2 -0
  78. package/dist/backend/inspector-ui/4.js +2 -0
  79. package/dist/backend/inspector-ui/5.js +2 -0
  80. package/dist/backend/inspector-ui/6.js +2 -0
  81. package/dist/backend/inspector-ui/7.js +2 -0
  82. package/dist/backend/inspector-ui/8.js +2 -0
  83. package/dist/backend/inspector-ui/9.js +2 -0
  84. package/dist/backend/inspector-ui-files.d.ts +4 -0
  85. package/dist/backend/inspector-ui-files.d.ts.map +1 -0
  86. package/dist/backend/inspector-ui-files.js +25 -0
  87. package/dist/backend/request-auth.d.ts +11 -0
  88. package/dist/backend/request-auth.d.ts.map +1 -1
  89. package/dist/backend/request-auth.js +14 -0
  90. package/dist/backend/request-auth.js.map +1 -1
  91. package/dist/backend/session-expiry.d.ts +61 -0
  92. package/dist/backend/session-expiry.d.ts.map +1 -0
  93. package/dist/backend/session-expiry.js +102 -0
  94. package/dist/backend/session-expiry.js.map +1 -0
  95. package/dist/backend/signing-key.d.ts +10 -0
  96. package/dist/backend/signing-key.d.ts.map +1 -0
  97. package/dist/backend/signing-key.js +15 -0
  98. package/dist/backend/signing-key.js.map +1 -0
  99. package/dist/backend/store-log.d.ts +3 -0
  100. package/dist/backend/store-log.d.ts.map +1 -0
  101. package/dist/backend/store-log.js +16 -0
  102. package/dist/backend/store-log.js.map +1 -0
  103. package/dist/backend/upgrade-status.d.ts +19 -0
  104. package/dist/backend/upgrade-status.d.ts.map +1 -0
  105. package/dist/backend/upgrade-status.js +55 -0
  106. package/dist/backend/upgrade-status.js.map +1 -0
  107. package/dist/backend/vercel-store.d.ts +88 -12
  108. package/dist/backend/vercel-store.d.ts.map +1 -1
  109. package/dist/backend/vercel-store.js +303 -44
  110. package/dist/backend/vercel-store.js.map +1 -1
  111. package/dist/backend/ws-peer.d.ts +32 -0
  112. package/dist/backend/ws-peer.d.ts.map +1 -0
  113. package/dist/backend/ws-peer.js +40 -0
  114. package/dist/backend/ws-peer.js.map +1 -0
  115. package/dist/better-auth-adapter/fixtures/issuer-upgrade-schema.d.ts +134 -0
  116. package/dist/better-auth-adapter/fixtures/issuer-upgrade-schema.d.ts.map +1 -0
  117. package/dist/better-auth-adapter/fixtures/issuer-upgrade-schema.js +121 -0
  118. package/dist/better-auth-adapter/fixtures/issuer-upgrade-schema.js.map +1 -0
  119. package/dist/better-auth-adapter/fixtures/schema.d.ts +2 -1
  120. package/dist/better-auth-adapter/fixtures/schema.d.ts.map +1 -1
  121. package/dist/better-auth-adapter/fixtures/schema.js +2 -1
  122. package/dist/better-auth-adapter/fixtures/schema.js.map +1 -1
  123. package/dist/better-auth-adapter/index.d.ts.map +1 -1
  124. package/dist/better-auth-adapter/index.js +47 -0
  125. package/dist/better-auth-adapter/index.js.map +1 -1
  126. package/dist/classic-api.d.ts.map +1 -1
  127. package/dist/classic-api.js +36 -0
  128. package/dist/classic-api.js.map +1 -1
  129. package/dist/cli.d.ts.map +1 -1
  130. package/dist/cli.js +54 -11
  131. package/dist/cli.js.map +1 -1
  132. package/dist/client/index.d.ts +2 -6
  133. package/dist/client/index.d.ts.map +1 -1
  134. package/dist/client/index.js +2 -3
  135. package/dist/client/index.js.map +1 -1
  136. package/dist/cloud/credentials.d.ts +1 -1
  137. package/dist/cloud/credentials.d.ts.map +1 -1
  138. package/dist/cloud/credentials.js.map +1 -1
  139. package/dist/dev/catalogue-project.d.ts +12 -3
  140. package/dist/dev/catalogue-project.d.ts.map +1 -1
  141. package/dist/dev/catalogue-project.js +29 -4
  142. package/dist/dev/catalogue-project.js.map +1 -1
  143. package/dist/dev/catalogue.d.ts +12 -0
  144. package/dist/dev/catalogue.d.ts.map +1 -1
  145. package/dist/dev/catalogue.js +94 -15
  146. package/dist/dev/catalogue.js.map +1 -1
  147. package/dist/dev/dev-server.d.ts +4 -1
  148. package/dist/dev/dev-server.d.ts.map +1 -1
  149. package/dist/dev/dev-server.js +41 -3
  150. package/dist/dev/dev-server.js.map +1 -1
  151. package/dist/dev/inspector-overlay/embedded/assets/backend-C6JfNAB2.js +1 -0
  152. package/dist/dev/inspector-overlay/embedded/assets/backend-DHeT1LCS.css +1 -0
  153. package/dist/dev/inspector-overlay/embedded/assets/{create-legacy-browser-delegate-X_T_QKCN.js → create-legacy-browser-delegate-Bf58kV5i.js} +1 -1
  154. package/dist/dev/inspector-overlay/embedded/assets/{esm-aRzpnC3u.js → esm-B8Fn7-qJ.js} +1 -1
  155. package/dist/dev/inspector-overlay/embedded/assets/{esm-ezD5H765.js → esm-C3BWHq-S.js} +1 -1
  156. package/dist/dev/inspector-overlay/embedded/assets/esm-DC_mAoiW.js +1 -0
  157. package/dist/dev/inspector-overlay/embedded/assets/{esm-7mP3GQX4.js → esm-D_R-EGgt.js} +1 -1
  158. package/dist/dev/inspector-overlay/embedded/assets/{esm-BX6IY2Mv.js → esm-WihpI9g6.js} +1 -1
  159. package/dist/dev/inspector-overlay/embedded/assets/index-C_pcvEcg.js +1 -0
  160. package/dist/dev/inspector-overlay/embedded/assets/{jazz-broker-worker-XRRxJUcx.js → jazz-broker-worker-Cv6-V0tc.js} +787 -608
  161. package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-Db-pNME-.js +5 -0
  162. package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-CTwPHZcZ.js +1 -0
  163. package/dist/dev/inspector-overlay/embedded/assets/{jazz_wasm_bg-KR7h3v27.wasm → jazz_wasm_bg-HpkRDlj-.wasm} +0 -0
  164. package/dist/dev/inspector-overlay/embedded/assets/src-B5UtjtXQ.js +22 -0
  165. package/dist/dev/inspector-overlay/embedded/assets/{index-C78Pprka.css → src-Cq8gSOLx.css} +1 -1
  166. package/dist/dev/inspector-overlay/embedded/assets/{trace-api-B5CaetI0.js → trace-api-BctnwbUf.js} +1 -1
  167. package/dist/dev/inspector-overlay/embedded/backend.html +16 -0
  168. package/dist/dev/inspector-overlay/embedded/embedded.html +3 -2
  169. package/dist/dev/inspector-overlay/host-bridge.d.ts.map +1 -1
  170. package/dist/dev/inspector-overlay/host-bridge.js +4 -1
  171. package/dist/dev/inspector-overlay/host-bridge.js.map +1 -1
  172. package/dist/dev/inspector-overlay/loader.d.ts +12 -1
  173. package/dist/dev/inspector-overlay/loader.d.ts.map +1 -1
  174. package/dist/dev/inspector-overlay/loader.js +31 -4
  175. package/dist/dev/inspector-overlay/loader.js.map +1 -1
  176. package/dist/dev/migrations.d.ts.map +1 -1
  177. package/dist/dev/migrations.js +53 -7
  178. package/dist/dev/migrations.js.map +1 -1
  179. package/dist/drivers/schema-wire.d.ts +6 -2
  180. package/dist/drivers/schema-wire.d.ts.map +1 -1
  181. package/dist/drivers/schema-wire.js +6 -2
  182. package/dist/drivers/schema-wire.js.map +1 -1
  183. package/dist/effect/jazz.d.ts +12 -5
  184. package/dist/effect/jazz.d.ts.map +1 -1
  185. package/dist/effect/jazz.js +28 -5
  186. package/dist/effect/jazz.js.map +1 -1
  187. package/dist/expo/create-account-manager.d.ts +1 -1
  188. package/dist/expo/create-account-manager.d.ts.map +1 -1
  189. package/dist/expo/create-jazz-session.d.ts +37 -17
  190. package/dist/expo/create-jazz-session.d.ts.map +1 -1
  191. package/dist/expo/create-jazz-session.js +53 -10
  192. package/dist/expo/create-jazz-session.js.map +1 -1
  193. package/dist/expo/index.d.ts +5 -8
  194. package/dist/expo/index.d.ts.map +1 -1
  195. package/dist/expo/index.js +5 -7
  196. package/dist/expo/index.js.map +1 -1
  197. package/dist/expo/metro.d.ts +20 -0
  198. package/dist/expo/metro.d.ts.map +1 -0
  199. package/dist/expo/metro.js +58 -0
  200. package/dist/expo/metro.js.map +1 -0
  201. package/dist/expo/provider.d.ts +6 -3
  202. package/dist/expo/provider.d.ts.map +1 -1
  203. package/dist/expo/provider.js +7 -6
  204. package/dist/expo/provider.js.map +1 -1
  205. package/dist/index.d.ts +3 -2
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +3 -1
  208. package/dist/index.js.map +1 -1
  209. package/dist/inspect/cli.d.ts +12 -0
  210. package/dist/inspect/cli.d.ts.map +1 -0
  211. package/dist/inspect/cli.js +320 -0
  212. package/dist/inspect/cli.js.map +1 -0
  213. package/dist/inspect/client.d.ts +67 -0
  214. package/dist/inspect/client.d.ts.map +1 -0
  215. package/dist/inspect/client.js +254 -0
  216. package/dist/inspect/client.js.map +1 -0
  217. package/dist/inspect/mcp.d.ts +28 -0
  218. package/dist/inspect/mcp.d.ts.map +1 -0
  219. package/dist/inspect/mcp.js +441 -0
  220. package/dist/inspect/mcp.js.map +1 -0
  221. package/dist/inspect/protocol.d.ts +317 -0
  222. package/dist/inspect/protocol.d.ts.map +1 -0
  223. package/dist/inspect/protocol.js +544 -0
  224. package/dist/inspect/protocol.js.map +1 -0
  225. package/dist/inspector/index.d.ts +10 -0
  226. package/dist/inspector/index.d.ts.map +1 -0
  227. package/dist/inspector/index.js +27 -0
  228. package/dist/inspector/index.js.map +1 -0
  229. package/dist/local-first/index.d.ts +2 -0
  230. package/dist/local-first/index.d.ts.map +1 -1
  231. package/dist/local-first/index.js +2 -0
  232. package/dist/local-first/index.js.map +1 -1
  233. package/dist/migrations.d.ts +23 -3
  234. package/dist/migrations.d.ts.map +1 -1
  235. package/dist/migrations.js +28 -6
  236. package/dist/migrations.js.map +1 -1
  237. package/dist/module-interop.d.ts +17 -0
  238. package/dist/module-interop.d.ts.map +1 -0
  239. package/dist/module-interop.js +32 -0
  240. package/dist/module-interop.js.map +1 -0
  241. package/dist/permissions/index.d.ts +1 -1
  242. package/dist/permissions/index.d.ts.map +1 -1
  243. package/dist/permissions/index.js +31 -10
  244. package/dist/permissions/index.js.map +1 -1
  245. package/dist/prosemirror/sync.d.ts.map +1 -1
  246. package/dist/prosemirror/sync.js +43 -21
  247. package/dist/prosemirror/sync.js.map +1 -1
  248. package/dist/react/index.d.ts +4 -9
  249. package/dist/react/index.d.ts.map +1 -1
  250. package/dist/react/index.js +4 -6
  251. package/dist/react/index.js.map +1 -1
  252. package/dist/react/provider-props.d.ts +7 -0
  253. package/dist/react/provider-props.d.ts.map +1 -0
  254. package/dist/react/provider-props.js +15 -0
  255. package/dist/react/provider-props.js.map +1 -0
  256. package/dist/react/provider.d.ts +9 -15
  257. package/dist/react/provider.d.ts.map +1 -1
  258. package/dist/react/provider.js +19 -38
  259. package/dist/react/provider.js.map +1 -1
  260. package/dist/react-core/index.d.ts +3 -4
  261. package/dist/react-core/index.d.ts.map +1 -1
  262. package/dist/react-core/index.js +8 -4
  263. package/dist/react-core/index.js.map +1 -1
  264. package/dist/react-core/provider.d.ts +6 -6
  265. package/dist/react-core/provider.d.ts.map +1 -1
  266. package/dist/react-core/provider.js +5 -6
  267. package/dist/react-core/provider.js.map +1 -1
  268. package/dist/react-core/session.d.ts +41 -33
  269. package/dist/react-core/session.d.ts.map +1 -1
  270. package/dist/react-core/session.js +42 -90
  271. package/dist/react-core/session.js.map +1 -1
  272. package/dist/react-native/account-session.js +1 -1
  273. package/dist/react-native/account-session.js.map +1 -1
  274. package/dist/react-native/create-account-manager.d.ts +1 -1
  275. package/dist/react-native/create-account-manager.d.ts.map +1 -1
  276. package/dist/react-native/create-jazz-session.d.ts +37 -17
  277. package/dist/react-native/create-jazz-session.d.ts.map +1 -1
  278. package/dist/react-native/create-jazz-session.js +53 -10
  279. package/dist/react-native/create-jazz-session.js.map +1 -1
  280. package/dist/react-native/index.d.ts +5 -10
  281. package/dist/react-native/index.d.ts.map +1 -1
  282. package/dist/react-native/index.js +5 -7
  283. package/dist/react-native/index.js.map +1 -1
  284. package/dist/react-native/native-foreground-db.d.ts +21 -0
  285. package/dist/react-native/native-foreground-db.d.ts.map +1 -1
  286. package/dist/react-native/native-foreground-db.js +47 -1
  287. package/dist/react-native/native-foreground-db.js.map +1 -1
  288. package/dist/react-native/provider.d.ts +14 -19
  289. package/dist/react-native/provider.d.ts.map +1 -1
  290. package/dist/react-native/provider.js +19 -18
  291. package/dist/react-native/provider.js.map +1 -1
  292. package/dist/react-native/runtime-source.d.ts +22 -0
  293. package/dist/react-native/runtime-source.d.ts.map +1 -1
  294. package/dist/react-native/runtime-source.js +68 -5
  295. package/dist/react-native/runtime-source.js.map +1 -1
  296. package/dist/removed-api.d.ts +87 -0
  297. package/dist/removed-api.d.ts.map +1 -0
  298. package/dist/removed-api.js +95 -0
  299. package/dist/removed-api.js.map +1 -0
  300. package/dist/runtime/auth-secret-store.d.ts +0 -44
  301. package/dist/runtime/auth-secret-store.d.ts.map +1 -1
  302. package/dist/runtime/auth-secret-store.js +1 -103
  303. package/dist/runtime/auth-secret-store.js.map +1 -1
  304. package/dist/runtime/authority-changed-error.d.ts +5 -3
  305. package/dist/runtime/authority-changed-error.d.ts.map +1 -1
  306. package/dist/runtime/authority-changed-error.js +5 -3
  307. package/dist/runtime/authority-changed-error.js.map +1 -1
  308. package/dist/runtime/browser-worker-assets.d.ts +19 -1
  309. package/dist/runtime/browser-worker-assets.d.ts.map +1 -1
  310. package/dist/runtime/browser-worker-assets.js +23 -1
  311. package/dist/runtime/browser-worker-assets.js.map +1 -1
  312. package/dist/runtime/browser-worker-assets.metro.d.ts +28 -0
  313. package/dist/runtime/browser-worker-assets.metro.d.ts.map +1 -0
  314. package/dist/runtime/browser-worker-assets.metro.js +52 -0
  315. package/dist/runtime/browser-worker-assets.metro.js.map +1 -0
  316. package/dist/runtime/browser-worker-assets.native.d.ts +2 -0
  317. package/dist/runtime/browser-worker-assets.native.d.ts.map +1 -1
  318. package/dist/runtime/browser-worker-assets.native.js +2 -0
  319. package/dist/runtime/browser-worker-assets.native.js.map +1 -1
  320. package/dist/runtime/browser-worker-config.d.ts +23 -0
  321. package/dist/runtime/browser-worker-config.d.ts.map +1 -1
  322. package/dist/runtime/browser-worker-config.js +72 -4
  323. package/dist/runtime/browser-worker-config.js.map +1 -1
  324. package/dist/runtime/client-migrations.d.ts +6 -4
  325. package/dist/runtime/client-migrations.d.ts.map +1 -1
  326. package/dist/runtime/client-migrations.js +20 -2
  327. package/dist/runtime/client-migrations.js.map +1 -1
  328. package/dist/runtime/client.d.ts +46 -6
  329. package/dist/runtime/client.d.ts.map +1 -1
  330. package/dist/runtime/client.js +65 -13
  331. package/dist/runtime/client.js.map +1 -1
  332. package/dist/runtime/connection-manager/browser-connection-manager.d.ts +5 -1
  333. package/dist/runtime/connection-manager/browser-connection-manager.d.ts.map +1 -1
  334. package/dist/runtime/connection-manager/browser-connection-manager.js +38 -2
  335. package/dist/runtime/connection-manager/browser-connection-manager.js.map +1 -1
  336. package/dist/runtime/connection-manager/direct-connection-manager.d.ts +3 -1
  337. package/dist/runtime/connection-manager/direct-connection-manager.d.ts.map +1 -1
  338. package/dist/runtime/connection-manager/direct-connection-manager.js +7 -3
  339. package/dist/runtime/connection-manager/direct-connection-manager.js.map +1 -1
  340. package/dist/runtime/connection-manager/types.d.ts +23 -2
  341. package/dist/runtime/connection-manager/types.d.ts.map +1 -1
  342. package/dist/runtime/connection-manager/types.js +49 -6
  343. package/dist/runtime/connection-manager/types.js.map +1 -1
  344. package/dist/runtime/context.d.ts +5 -1
  345. package/dist/runtime/context.d.ts.map +1 -1
  346. package/dist/runtime/context.js.map +1 -1
  347. package/dist/runtime/core-tick-failed-error.d.ts +31 -0
  348. package/dist/runtime/core-tick-failed-error.d.ts.map +1 -0
  349. package/dist/runtime/core-tick-failed-error.js +45 -0
  350. package/dist/runtime/core-tick-failed-error.js.map +1 -0
  351. package/dist/runtime/credentialed-transport.d.ts +18 -3
  352. package/dist/runtime/credentialed-transport.d.ts.map +1 -1
  353. package/dist/runtime/credentialed-transport.js +34 -11
  354. package/dist/runtime/credentialed-transport.js.map +1 -1
  355. package/dist/runtime/db-replaced-error.d.ts +3 -1
  356. package/dist/runtime/db-replaced-error.d.ts.map +1 -1
  357. package/dist/runtime/db-replaced-error.js +4 -2
  358. package/dist/runtime/db-replaced-error.js.map +1 -1
  359. package/dist/runtime/db.d.ts +40 -8
  360. package/dist/runtime/db.d.ts.map +1 -1
  361. package/dist/runtime/db.js +76 -9
  362. package/dist/runtime/db.js.map +1 -1
  363. package/dist/runtime/default-runtime-source.d.ts.map +1 -1
  364. package/dist/runtime/default-runtime-source.js +6 -1
  365. package/dist/runtime/default-runtime-source.js.map +1 -1
  366. package/dist/runtime/delete-local-first-store.d.ts +12 -0
  367. package/dist/runtime/delete-local-first-store.d.ts.map +1 -0
  368. package/dist/runtime/delete-local-first-store.js +12 -0
  369. package/dist/runtime/delete-local-first-store.js.map +1 -0
  370. package/dist/runtime/index.d.ts +4 -4
  371. package/dist/runtime/index.d.ts.map +1 -1
  372. package/dist/runtime/index.js +2 -2
  373. package/dist/runtime/index.js.map +1 -1
  374. package/dist/runtime/local-first-upgrade.d.ts +9 -0
  375. package/dist/runtime/local-first-upgrade.d.ts.map +1 -1
  376. package/dist/runtime/local-first-upgrade.js.map +1 -1
  377. package/dist/runtime/metro-setup-error.d.ts +20 -0
  378. package/dist/runtime/metro-setup-error.d.ts.map +1 -0
  379. package/dist/runtime/metro-setup-error.js +22 -0
  380. package/dist/runtime/metro-setup-error.js.map +1 -0
  381. package/dist/runtime/native-artifact-fingerprint-napi.d.ts +1 -1
  382. package/dist/runtime/native-artifact-fingerprint-napi.js +1 -1
  383. package/dist/runtime/native-artifact-fingerprint-napi.js.map +1 -1
  384. package/dist/runtime/native-artifact-fingerprint-wasm.d.ts +1 -1
  385. package/dist/runtime/native-artifact-fingerprint-wasm.js +1 -1
  386. package/dist/runtime/native-artifact-fingerprint-wasm.js.map +1 -1
  387. package/dist/runtime/native-artifact-fingerprints.d.ts +2 -2
  388. package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts +4 -1
  389. package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts.map +1 -1
  390. package/dist/runtime/native-runtime/attached-browser-worker-connection.js +3 -0
  391. package/dist/runtime/native-runtime/attached-browser-worker-connection.js.map +1 -1
  392. package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts +34 -0
  393. package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts.map +1 -0
  394. package/dist/runtime/native-runtime/broker-worker-load-failure.js +61 -0
  395. package/dist/runtime/native-runtime/broker-worker-load-failure.js.map +1 -0
  396. package/dist/runtime/native-runtime/browser-follower-connection.d.ts +6 -1
  397. package/dist/runtime/native-runtime/browser-follower-connection.d.ts.map +1 -1
  398. package/dist/runtime/native-runtime/browser-follower-connection.js +9 -3
  399. package/dist/runtime/native-runtime/browser-follower-connection.js.map +1 -1
  400. package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts +12 -1
  401. package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts.map +1 -1
  402. package/dist/runtime/native-runtime/browser-shared-worker-connection.js +140 -7
  403. package/dist/runtime/native-runtime/browser-shared-worker-connection.js.map +1 -1
  404. package/dist/runtime/native-runtime/browser-worker-protocol.d.ts +29 -1
  405. package/dist/runtime/native-runtime/browser-worker-protocol.d.ts.map +1 -1
  406. package/dist/runtime/native-runtime/browser-worker-protocol.js.map +1 -1
  407. package/dist/runtime/native-runtime/http-stream-socket.d.ts +25 -7
  408. package/dist/runtime/native-runtime/http-stream-socket.d.ts.map +1 -1
  409. package/dist/runtime/native-runtime/http-stream-socket.js +148 -44
  410. package/dist/runtime/native-runtime/http-stream-socket.js.map +1 -1
  411. package/dist/runtime/native-runtime/native-error-code.d.ts +1 -1
  412. package/dist/runtime/native-runtime/native-error-code.d.ts.map +1 -1
  413. package/dist/runtime/native-runtime/native-error-code.js +1 -0
  414. package/dist/runtime/native-runtime/native-error-code.js.map +1 -1
  415. package/dist/runtime/native-runtime/native-runtime-adapter.d.ts +105 -7
  416. package/dist/runtime/native-runtime/native-runtime-adapter.d.ts.map +1 -1
  417. package/dist/runtime/native-runtime/native-runtime-adapter.js +306 -27
  418. package/dist/runtime/native-runtime/native-runtime-adapter.js.map +1 -1
  419. package/dist/runtime/native-runtime/session-renewal-wire.d.ts +48 -0
  420. package/dist/runtime/native-runtime/session-renewal-wire.d.ts.map +1 -0
  421. package/dist/runtime/native-runtime/session-renewal-wire.js +107 -0
  422. package/dist/runtime/native-runtime/session-renewal-wire.js.map +1 -0
  423. package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts +22 -0
  424. package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts.map +1 -0
  425. package/dist/runtime/native-runtime/stream-endpoint-memory.js +69 -0
  426. package/dist/runtime/native-runtime/stream-endpoint-memory.js.map +1 -0
  427. package/dist/runtime/native-runtime/websocket.d.ts +51 -1
  428. package/dist/runtime/native-runtime/websocket.d.ts.map +1 -1
  429. package/dist/runtime/native-runtime/websocket.js +187 -7
  430. package/dist/runtime/native-runtime/websocket.js.map +1 -1
  431. package/dist/runtime/page-handle.d.ts +83 -0
  432. package/dist/runtime/page-handle.d.ts.map +1 -0
  433. package/dist/runtime/page-handle.js +151 -0
  434. package/dist/runtime/page-handle.js.map +1 -0
  435. package/dist/runtime/removed-provider-props.d.ts +17 -0
  436. package/dist/runtime/removed-provider-props.d.ts.map +1 -0
  437. package/dist/runtime/removed-provider-props.js +16 -0
  438. package/dist/runtime/removed-provider-props.js.map +1 -0
  439. package/dist/runtime/row-transformer.d.ts.map +1 -1
  440. package/dist/runtime/row-transformer.js +20 -0
  441. package/dist/runtime/row-transformer.js.map +1 -1
  442. package/dist/runtime/runtime-config.d.ts +5 -1
  443. package/dist/runtime/runtime-config.d.ts.map +1 -1
  444. package/dist/runtime/runtime-config.js +5 -1
  445. package/dist/runtime/runtime-config.js.map +1 -1
  446. package/dist/runtime/runtime-source.d.ts +6 -1
  447. package/dist/runtime/runtime-source.d.ts.map +1 -1
  448. package/dist/runtime/runtime-source.js.map +1 -1
  449. package/dist/runtime/schema-metadata.d.ts +17 -0
  450. package/dist/runtime/schema-metadata.d.ts.map +1 -1
  451. package/dist/runtime/schema-metadata.js +28 -0
  452. package/dist/runtime/schema-metadata.js.map +1 -1
  453. package/dist/runtime/store-held-by-another-tab-error.d.ts +11 -0
  454. package/dist/runtime/store-held-by-another-tab-error.d.ts.map +1 -1
  455. package/dist/runtime/store-held-by-another-tab-error.js +11 -0
  456. package/dist/runtime/store-held-by-another-tab-error.js.map +1 -1
  457. package/dist/runtime/sync-status.d.ts +60 -1
  458. package/dist/runtime/sync-status.d.ts.map +1 -1
  459. package/dist/runtime/sync-status.js +64 -4
  460. package/dist/runtime/sync-status.js.map +1 -1
  461. package/dist/runtime/wasm-loader.d.ts.map +1 -1
  462. package/dist/runtime/wasm-loader.js +8 -1
  463. package/dist/runtime/wasm-loader.js.map +1 -1
  464. package/dist/schema-loader.d.ts +2 -0
  465. package/dist/schema-loader.d.ts.map +1 -1
  466. package/dist/schema-loader.js +7 -2
  467. package/dist/schema-loader.js.map +1 -1
  468. package/dist/schema-permissions.d.ts.map +1 -1
  469. package/dist/schema-permissions.js +19 -0
  470. package/dist/schema-permissions.js.map +1 -1
  471. package/dist/schema-source.d.ts.map +1 -1
  472. package/dist/schema-source.js +14 -0
  473. package/dist/schema-source.js.map +1 -1
  474. package/dist/session/backend-watch.d.ts +56 -15
  475. package/dist/session/backend-watch.d.ts.map +1 -1
  476. package/dist/session/backend-watch.js +127 -31
  477. package/dist/session/backend-watch.js.map +1 -1
  478. package/dist/session/config-options.d.ts +15 -0
  479. package/dist/session/config-options.d.ts.map +1 -0
  480. package/dist/session/config-options.js +55 -0
  481. package/dist/session/config-options.js.map +1 -0
  482. package/dist/session/consumer.d.ts +1 -1
  483. package/dist/session/consumer.js +1 -1
  484. package/dist/session/consumer.js.map +1 -1
  485. package/dist/session/create-jazz-session.d.ts +55 -21
  486. package/dist/session/create-jazz-session.d.ts.map +1 -1
  487. package/dist/session/create-jazz-session.js +215 -166
  488. package/dist/session/create-jazz-session.js.map +1 -1
  489. package/dist/session/follow-user.d.ts +30 -11
  490. package/dist/session/follow-user.d.ts.map +1 -1
  491. package/dist/session/follow-user.js +49 -9
  492. package/dist/session/follow-user.js.map +1 -1
  493. package/dist/session/jazz-session.d.ts +182 -0
  494. package/dist/session/jazz-session.d.ts.map +1 -0
  495. package/dist/session/jazz-session.js +459 -0
  496. package/dist/session/jazz-session.js.map +1 -0
  497. package/dist/session/no-kept-device-account-error.d.ts +6 -0
  498. package/dist/session/no-kept-device-account-error.d.ts.map +1 -0
  499. package/dist/session/no-kept-device-account-error.js +8 -0
  500. package/dist/session/no-kept-device-account-error.js.map +1 -0
  501. package/dist/session/replica-ledger.d.ts +164 -0
  502. package/dist/session/replica-ledger.d.ts.map +1 -0
  503. package/dist/session/replica-ledger.js +450 -0
  504. package/dist/session/replica-ledger.js.map +1 -0
  505. package/dist/session/state.d.ts +50 -13
  506. package/dist/session/state.d.ts.map +1 -1
  507. package/dist/session/state.js +158 -29
  508. package/dist/session/state.js.map +1 -1
  509. package/dist/solid/index.d.ts +3 -9
  510. package/dist/solid/index.d.ts.map +1 -1
  511. package/dist/solid/index.js +8 -11
  512. package/dist/solid/index.ssr.js +3 -6
  513. package/dist/solid/provider.d.ts +3 -3
  514. package/dist/solid/provider.d.ts.map +1 -1
  515. package/dist/solid/provider.js +23 -39
  516. package/dist/solid/provider.js.map +1 -1
  517. package/dist/solid/provider.ssr.js +6 -23
  518. package/dist/solid/provider.ssr.js.map +1 -1
  519. package/dist/solid/session.d.ts +42 -12
  520. package/dist/solid/session.d.ts.map +1 -1
  521. package/dist/solid/session.js +82 -35
  522. package/dist/solid/session.js.map +1 -1
  523. package/dist/solid/session.ssr.js +86 -23
  524. package/dist/solid/session.ssr.js.map +1 -1
  525. package/dist/svelte/JazzProvider.svelte +54 -20
  526. package/dist/svelte/JazzProvider.svelte.d.ts +14 -4
  527. package/dist/svelte/JazzProvider.svelte.d.ts.map +1 -1
  528. package/dist/svelte/JazzSvelteClientProvider.svelte +1 -7
  529. package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts +0 -1
  530. package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts.map +1 -1
  531. package/dist/svelte/JazzSvelteProvider.svelte +5 -4
  532. package/dist/svelte/JazzSvelteProvider.svelte.d.ts +2 -2
  533. package/dist/svelte/JazzSvelteProvider.svelte.d.ts.map +1 -1
  534. package/dist/svelte/index.d.ts +4 -12
  535. package/dist/svelte/index.d.ts.map +1 -1
  536. package/dist/svelte/index.js +4 -8
  537. package/dist/svelte/session-state.d.ts +14 -4
  538. package/dist/svelte/session-state.d.ts.map +1 -1
  539. package/dist/svelte/session-state.js +10 -4
  540. package/dist/testing/client-migrations.d.ts +8 -1
  541. package/dist/testing/client-migrations.d.ts.map +1 -1
  542. package/dist/testing/client-migrations.js +11 -0
  543. package/dist/testing/client-migrations.js.map +1 -1
  544. package/dist/testing/policy-test-app.d.ts.map +1 -1
  545. package/dist/testing/policy-test-app.js +5 -4
  546. package/dist/testing/policy-test-app.js.map +1 -1
  547. package/dist/testing/test-jazz.d.ts +2 -2
  548. package/dist/testing/test-jazz.d.ts.map +1 -1
  549. package/dist/testing/test-jazz.js +6 -3
  550. package/dist/testing/test-jazz.js.map +1 -1
  551. package/dist/thin/index.d.ts +7 -10
  552. package/dist/thin/index.d.ts.map +1 -1
  553. package/dist/thin/index.js +28 -11
  554. package/dist/thin/index.js.map +1 -1
  555. package/dist/thin/thin-runtime.d.ts +53 -3
  556. package/dist/thin/thin-runtime.d.ts.map +1 -1
  557. package/dist/thin/thin-runtime.js +256 -33
  558. package/dist/thin/thin-runtime.js.map +1 -1
  559. package/dist/typed-app.d.ts +10 -4
  560. package/dist/typed-app.d.ts.map +1 -1
  561. package/dist/typed-app.js +44 -18
  562. package/dist/typed-app.js.map +1 -1
  563. package/dist/vue/index.d.ts +3 -8
  564. package/dist/vue/index.d.ts.map +1 -1
  565. package/dist/vue/index.js +3 -5
  566. package/dist/vue/index.js.map +1 -1
  567. package/dist/vue/provider.d.ts +6 -27
  568. package/dist/vue/provider.d.ts.map +1 -1
  569. package/dist/vue/provider.js +10 -19
  570. package/dist/vue/provider.js.map +1 -1
  571. package/dist/vue/session.d.ts +29 -28
  572. package/dist/vue/session.d.ts.map +1 -1
  573. package/dist/vue/session.js +80 -23
  574. package/dist/vue/session.js.map +1 -1
  575. package/dist/web/create-jazz-client.d.ts +5 -1
  576. package/dist/web/create-jazz-client.d.ts.map +1 -1
  577. package/dist/web/create-jazz-client.js +30 -3
  578. package/dist/web/create-jazz-client.js.map +1 -1
  579. package/dist/window-client-storage.d.ts +4 -30
  580. package/dist/window-client-storage.d.ts.map +1 -1
  581. package/dist/window-client-storage.js +2 -63
  582. package/dist/window-client-storage.js.map +1 -1
  583. package/dist/worker/jazz-broker-worker-core.d.ts.map +1 -1
  584. package/dist/worker/jazz-broker-worker-core.js +118 -20
  585. package/dist/worker/jazz-broker-worker-core.js.map +1 -1
  586. package/dist/worker/jazz-broker-worker.js +787 -608
  587. package/dist/worker/jazz_wasm_bg.wasm +0 -0
  588. package/dist/worker/runtime-admission.d.ts +19 -0
  589. package/dist/worker/runtime-admission.d.ts.map +1 -0
  590. package/dist/worker/runtime-admission.js +34 -0
  591. package/dist/worker/runtime-admission.js.map +1 -0
  592. package/dist/worker/vite-dev-broker.d.ts +2 -0
  593. package/dist/worker/vite-dev-broker.d.ts.map +1 -0
  594. package/dist/worker/vite-dev-broker.js +8 -0
  595. package/dist/worker/vite-dev-broker.js.map +1 -0
  596. package/package.json +30 -10
  597. package/dist/backend/session-recheck.d.ts +0 -18
  598. package/dist/backend/session-recheck.d.ts.map +0 -1
  599. package/dist/backend/session-recheck.js +0 -57
  600. package/dist/backend/session-recheck.js.map +0 -1
  601. package/dist/dev/inspector-overlay/embedded/assets/esm-k3rsq4Gn.js +0 -1
  602. package/dist/dev/inspector-overlay/embedded/assets/index-C-btvLcw.js +0 -20
  603. package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-CAMcDeUa.js +0 -3
  604. package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-Cc71x_6y.js +0 -1
  605. package/dist/dev/inspector-overlay/serve.d.ts +0 -46
  606. package/dist/dev/inspector-overlay/serve.d.ts.map +0 -1
  607. package/dist/dev/inspector-overlay/serve.js +0 -131
  608. package/dist/dev/inspector-overlay/serve.js.map +0 -1
  609. package/dist/dev-tools/auto-attach.d.ts +0 -11
  610. package/dist/dev-tools/auto-attach.d.ts.map +0 -1
  611. package/dist/dev-tools/auto-attach.js +0 -26
  612. package/dist/dev-tools/auto-attach.js.map +0 -1
  613. package/dist/expo/auth-secret-store.d.ts +0 -37
  614. package/dist/expo/auth-secret-store.d.ts.map +0 -1
  615. package/dist/expo/auth-secret-store.js +0 -139
  616. package/dist/expo/auth-secret-store.js.map +0 -1
  617. package/dist/expo/session.d.ts +0 -10
  618. package/dist/expo/session.d.ts.map +0 -1
  619. package/dist/expo/session.js +0 -5
  620. package/dist/expo/session.js.map +0 -1
  621. package/dist/expo/use-local-first-auth.d.ts +0 -12
  622. package/dist/expo/use-local-first-auth.d.ts.map +0 -1
  623. package/dist/expo/use-local-first-auth.js +0 -13
  624. package/dist/expo/use-local-first-auth.js.map +0 -1
  625. package/dist/react/devtools-auto-attach.d.ts +0 -2
  626. package/dist/react/devtools-auto-attach.d.ts.map +0 -1
  627. package/dist/react/devtools-auto-attach.js +0 -11
  628. package/dist/react/devtools-auto-attach.js.map +0 -1
  629. package/dist/react/session.d.ts +0 -18
  630. package/dist/react/session.d.ts.map +0 -1
  631. package/dist/react/session.js +0 -28
  632. package/dist/react/session.js.map +0 -1
  633. package/dist/react/use-local-first-auth.d.ts +0 -11
  634. package/dist/react/use-local-first-auth.d.ts.map +0 -1
  635. package/dist/react/use-local-first-auth.js +0 -13
  636. package/dist/react/use-local-first-auth.js.map +0 -1
  637. package/dist/react-core/app.d.ts +0 -31
  638. package/dist/react-core/app.d.ts.map +0 -1
  639. package/dist/react-core/app.js +0 -65
  640. package/dist/react-core/app.js.map +0 -1
  641. package/dist/react-core/use-account-state.d.ts +0 -4
  642. package/dist/react-core/use-account-state.d.ts.map +0 -1
  643. package/dist/react-core/use-account-state.js +0 -6
  644. package/dist/react-core/use-account-state.js.map +0 -1
  645. package/dist/react-core/use-local-first-auth.d.ts +0 -12
  646. package/dist/react-core/use-local-first-auth.d.ts.map +0 -1
  647. package/dist/react-core/use-local-first-auth.js +0 -14
  648. package/dist/react-core/use-local-first-auth.js.map +0 -1
  649. package/dist/react-native/session.d.ts +0 -10
  650. package/dist/react-native/session.d.ts.map +0 -1
  651. package/dist/react-native/session.js +0 -5
  652. package/dist/react-native/session.js.map +0 -1
  653. package/dist/react-native/use-local-first-auth.d.ts +0 -15
  654. package/dist/react-native/use-local-first-auth.d.ts.map +0 -1
  655. package/dist/react-native/use-local-first-auth.js +0 -14
  656. package/dist/react-native/use-local-first-auth.js.map +0 -1
  657. package/dist/runtime/local-first-auth-controller.d.ts +0 -29
  658. package/dist/runtime/local-first-auth-controller.d.ts.map +0 -1
  659. package/dist/runtime/local-first-auth-controller.js +0 -101
  660. package/dist/runtime/local-first-auth-controller.js.map +0 -1
  661. package/dist/session/app.d.ts +0 -58
  662. package/dist/session/app.d.ts.map +0 -1
  663. package/dist/session/app.js +0 -325
  664. package/dist/session/app.js.map +0 -1
  665. package/dist/session/create-jazz-app.d.ts +0 -11
  666. package/dist/session/create-jazz-app.d.ts.map +0 -1
  667. package/dist/session/create-jazz-app.js +0 -11
  668. package/dist/session/create-jazz-app.js.map +0 -1
  669. package/dist/session/left-behind-replicas.d.ts +0 -62
  670. package/dist/session/left-behind-replicas.d.ts.map +0 -1
  671. package/dist/session/left-behind-replicas.js +0 -146
  672. package/dist/session/left-behind-replicas.js.map +0 -1
  673. package/dist/solid/app.d.ts +0 -30
  674. package/dist/solid/app.d.ts.map +0 -1
  675. package/dist/solid/app.js +0 -95
  676. package/dist/solid/app.js.map +0 -1
  677. package/dist/solid/app.ssr.js +0 -109
  678. package/dist/solid/app.ssr.js.map +0 -1
  679. package/dist/solid/create-account-state.d.ts +0 -4
  680. package/dist/solid/create-account-state.d.ts.map +0 -1
  681. package/dist/solid/create-account-state.js +0 -10
  682. package/dist/solid/create-account-state.js.map +0 -1
  683. package/dist/solid/create-account-state.ssr.js +0 -12
  684. package/dist/solid/create-account-state.ssr.js.map +0 -1
  685. package/dist/solid/use-local-first-auth.d.ts +0 -11
  686. package/dist/solid/use-local-first-auth.d.ts.map +0 -1
  687. package/dist/solid/use-local-first-auth.js +0 -30
  688. package/dist/solid/use-local-first-auth.js.map +0 -1
  689. package/dist/solid/use-local-first-auth.ssr.js +0 -31
  690. package/dist/solid/use-local-first-auth.ssr.js.map +0 -1
  691. package/dist/svelte/JazzSessionClientProvider.svelte +0 -42
  692. package/dist/svelte/JazzSessionClientProvider.svelte.d.ts +0 -13
  693. package/dist/svelte/JazzSessionClientProvider.svelte.d.ts.map +0 -1
  694. package/dist/svelte/JazzSessionProvider.svelte +0 -68
  695. package/dist/svelte/JazzSessionProvider.svelte.d.ts +0 -19
  696. package/dist/svelte/JazzSessionProvider.svelte.d.ts.map +0 -1
  697. package/dist/svelte/account-state.d.ts +0 -5
  698. package/dist/svelte/account-state.d.ts.map +0 -1
  699. package/dist/svelte/account-state.js +0 -9
  700. package/dist/svelte/auth-state.d.ts +0 -23
  701. package/dist/svelte/auth-state.d.ts.map +0 -1
  702. package/dist/svelte/auth-state.js +0 -16
  703. package/dist/svelte/local-first-auth.svelte.d.ts +0 -50
  704. package/dist/svelte/local-first-auth.svelte.d.ts.map +0 -1
  705. package/dist/svelte/local-first-auth.svelte.js +0 -58
  706. package/dist/vue/app.d.ts +0 -76
  707. package/dist/vue/app.d.ts.map +0 -1
  708. package/dist/vue/app.js +0 -100
  709. package/dist/vue/app.js.map +0 -1
  710. package/dist/vue/use-account-state.d.ts +0 -5
  711. package/dist/vue/use-account-state.d.ts.map +0 -1
  712. package/dist/vue/use-account-state.js +0 -10
  713. package/dist/vue/use-account-state.js.map +0 -1
  714. package/dist/vue/use-local-first-auth.d.ts +0 -53
  715. package/dist/vue/use-local-first-auth.d.ts.map +0 -1
  716. package/dist/vue/use-local-first-auth.js +0 -67
  717. package/dist/vue/use-local-first-auth.js.map +0 -1
  718. /package/dist/dev/inspector-overlay/embedded/assets/{esm-CH5eVyQQ.js → esm-xNe3wI_B.js} +0 -0
  719. /package/dist/dev/inspector-overlay/embedded/assets/{node-foreground-node-lease.browser-Bm3gYjlT.js → node-foreground-node-lease.browser-CH8w-D6S.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"native-foreground-db.js","sourceRoot":"","sources":["../../src/react-native/native-foreground-db.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AA8B7D;;;;;;;GAOG;AACH;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAeV;IACA;IAfX,MAAM,GAAG,KAAK,CAAC;IACf,qBAAqB,CAAoD;IACzE,oBAAoB,CAAyC;IACrE,2EAA2E;IACnE,qBAAqB,GAAG,CAAC,CAAC;IAC1B,uBAAuB,CAAgE;IAC/F,2EAA2E;IACnE,uBAAuB,GAAmD,IAAI,CAAC;IACtE,YAAY,GAAG,IAAI,GAAG,EAAuC,CAAC;IAC/E,oEAAoE;IAC5D,uBAAuB,GAAG,KAAK,CAAC;IAChC,6BAA6B,GAAG,KAAK,CAAC;IAE9C,YACmB,OAAgC,EAChC,QAAgC;QADhC,YAAO,GAAP,OAAO,CAAyB;QAChC,aAAQ,GAAR,QAAQ,CAAwB;IAChD,CAAC;IAEJ,gBAAgB,CAAC,QAAiE;QAChF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,EAAE;YACxC,+DAA+D;YAC/D,qEAAqE;YACrE,sEAAsE;YACtE,yCAAyC;YACzC,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,eAAe,CAAC,QAA6C;QAC3D,IAAI,CAAC,UAAU,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AE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7F,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACpC,MAAM,IAAI,KAAK,CAAC,GAAG,8BAA8B,KAAK,SAAS,iBAAiB,CAAC,CAAC;AACpF,CAAC;AAED,SAAS,UAAU,CAAC,SAAiB,EAAE,QAAgB;IACrD,MAAM,IAAI,KAAK,CACb,kCAAkC,SAAS,wBAAwB,QAAQ,WAAW,CACvF,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAkC;IAC7D,IAAI,KAAK,CAAC,UAAU,KAAK,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,kEAAkE;AAClE,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type * as Relay from \"jazz-rn/relay\";\nimport type { MutationErrorEvent } from \"../runtime/client.js\";\nimport { UnsupportedSnapshotError } from \"../runtime/snapshot-ref.js\";\nimport { REACT_NATIVE_UNSUPPORTED_ERROR } from \"./errors.js\";\n\n// The foreground command vocabulary is owned by jazz-rn. This module is\n// internal: no public declaration of jazz-tools reaches it, so applications\n// never need the optional jazz-rn peer to type-check.\ntype ForegroundCommand = Relay.NativeForegroundCommand;\ntype ForegroundResponse = Relay.NativeForegroundResponse;\ntype ForegroundMutationKind = Extract<ForegroundCommand, { type: \"directMutation\" }>[\"mutation\"];\ntype NativeConnectionStatus = Extract<ForegroundResponse, { type: \"nativeConnectionStatus\" }>;\n/** An upstream connection failure other than a refused credential (#4337). */\nexport type NativeUpstreamFailure = { reason: string; retrying: boolean };\ntype ForegroundMutationOptions = {\n rowId?: Uint8Array;\n branch?: unknown;\n head?: unknown;\n base?: unknown;\n updatedAtMs?: number;\n author?: Uint8Array;\n attribution?: Uint8Array;\n};\n\nexport type NativeForegroundRuntime = Relay.NativeForegroundRuntime;\nexport type NativeForegroundFactory = Relay.NativeForegroundRuntimeFactory;\nexport type NativeForegroundModule = Pick<\n typeof Relay,\n | \"installNativeForegroundRuntime\"\n | \"encodeNativeForegroundCommand\"\n | \"decodeNativeForegroundResponse\"\n>;\n\n/**\n * Narrow NativeDb consumer for the first JSI foreground slice.\n *\n * Rows and subscription deltas stay in the ordinary binding byte format, so\n * NativeRuntimeAdapter remains the sole schema-aware decoder. This is not a\n * second object-shaped database facade and intentionally grows only as the\n * shared Rust command ABI grows.\n */\n/**\n * Thin `NativeDb` adapter over the native foreground command ABI.\n *\n * This deliberately contains no row, query, or mutation interpretation: the\n * normal `NativeRuntimeAdapter` owns the public API and existing codecs. A\n * direct mutation is represented by one ordinary native mergeable transaction;\n * explicit public transactions retain their native transaction handle until\n * commit/rollback.\n */\nexport class NativeForegroundDb {\n private closed = false;\n private mutationErrorCallback: ((event: MutationErrorEvent) => void) | undefined;\n private authRejectedCallback: ((reason: string) => void) | undefined;\n /** The sequence of the refusal last reported, so each is reported once. */\n private reportedAuthRejection = 0;\n private upstreamFailureCallback: ((failure: NativeUpstreamFailure | null) => void) | undefined;\n /** The upstream failure last reported, so each change is reported once. */\n private reportedUpstreamFailure: { sequence: number; retrying: boolean } | null = null;\n private readonly transactions = new Map<string, NativeForegroundTransaction>();\n /** A native build without the (append-only) slow-query commands. */\n private slowQueryLogUnsupported = false;\n private pendingUploadCountUnsupported = false;\n\n constructor(\n private readonly runtime: NativeForegroundRuntime,\n private readonly commands: NativeForegroundModule,\n ) {}\n\n setTickScheduler(callback: (first: Error | string | null, second?: string) => void): void {\n if (!this.runtime.setTickScheduler) {\n throw new Error(\n \"React Native native foreground runtime does not expose owner wake scheduling\",\n );\n }\n this.runtime.setTickScheduler((urgency) => {\n // Native invalidation clears the JSI registration first, but a\n // CallInvoker task may already have crossed into JS when close races\n // teardown. Do not let that stale task re-enter the adapter after its\n // foreground facade has become unusable.\n if (!this.closed) callback(urgency);\n });\n }\n\n onMutationError(callback: (event: MutationErrorEvent) => void): void {\n this.assertOpen();\n this.mutationErrorCallback = callback;\n }\n\n /**\n * Observe the upstream refusing the scope's credential. The refusal is auth\n * state, not a failed tick: local ticks keep running, and the tick that\n * first sees a refusal reports it once, so the app can renew the\n * credential (#4248, #4296).\n */\n onAuthRejected(callback: (reason: string) => void): void {\n this.assertOpen();\n this.authRejectedCallback = callback;\n }\n\n /**\n * Observe the scope's upstream connection failing for a reason other than\n * its credential, and recovering (`null`). A failure is connection state,\n * not a failed tick: local ticks keep running (#4337).\n */\n onUpstreamFailure(callback: (failure: NativeUpstreamFailure | null) => void): void {\n this.assertOpen();\n this.upstreamFailureCallback = callback;\n }\n\n all(\n query: Uint8Array,\n opts: unknown,\n openTransactionId?: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n const transaction =\n openTransactionId === undefined\n ? undefined\n : this.openTransaction(openTransactionId, \"read\").handle;\n // No tick here: the native relay owner applies admitted writes and pumps\n // on its own thread. The read is fenced natively behind every write\n // admitted before it, so it resolves (possibly as pending) with them.\n const response = this.execute({\n type: \"all\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n transaction,\n });\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"all\", response.type);\n }\n\n captureSnapshot(): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n this.assertOpen();\n if (this.runtime.supportsSnapshotCapture !== true) {\n throw new UnsupportedSnapshotError(\n \"Capturing snapshots requires a newer Jazz native build; rebuild the native app to use captureSnapshot()\",\n );\n }\n const response = this.execute({ type: \"captureSnapshot\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"captureSnapshot\", response.type);\n }\n\n // The shared mutation adapter needs one exact local row, without coverage\n // registration or hydration, to merge staged patches synchronously.\n localCurrentRow(table: string, rowId: Uint8Array): Uint8Array {\n const response = this.execute({ type: \"localCurrentRow\", table, rowId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\") return unexpected(\"localCurrentRow\", response.type);\n return response.rows;\n }\n\n subscribe(query: Uint8Array, opts: unknown): NativeForegroundSubscription {\n // Fenced natively like `all()`: the first frame reflects earlier writes.\n const response = this.execute({\n type: \"subscribe\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"subscribed\") return unexpected(\"subscribe\", response.type);\n return new NativeForegroundSubscription(response.subscription, this);\n }\n\n tick(): void {\n this.assertOpen();\n this.runtime.tick();\n if (!this.mutationErrorCallback && !this.authRejectedCallback && !this.upstreamFailureCallback)\n return;\n // One call drains everything a tick reports.\n const response = this.execute({ type: \"drainTickEvents\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"tickEvents\") return unexpected(\"drainTickEvents\", response.type);\n const rejection = response.authRejection;\n if (rejection && rejection.sequence !== this.reportedAuthRejection) {\n this.reportedAuthRejection = rejection.sequence;\n queueMicrotask(() => {\n if (!this.closed) this.authRejectedCallback?.(rejection.reason);\n });\n }\n const failure = response.upstreamFailure;\n const reported = this.reportedUpstreamFailure;\n if (\n failure\n ? failure.sequence !== reported?.sequence || failure.retrying !== reported.retrying\n : reported\n ) {\n this.reportedUpstreamFailure = failure && {\n sequence: failure.sequence,\n retrying: failure.retrying,\n };\n const change = failure && { reason: failure.reason, retrying: failure.retrying };\n queueMicrotask(() => {\n if (!this.closed) this.upstreamFailureCallback?.(change);\n });\n }\n // The drain claims mutation errors; with no observer they are dropped.\n if (!this.mutationErrorCallback) return;\n const events = JSON.parse(response.eventsJson) as MutationErrorEvent[];\n for (const event of events)\n queueMicrotask(() => {\n if (!this.closed) this.mutationErrorCallback?.(event);\n });\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n this.transactions.clear();\n try {\n const response = this.executeAllowClosed(\"close\");\n if (response.type !== \"closed\") return unexpected(\"close\", response.type);\n return response.closed;\n } finally {\n // The command owns logical Db closure. The HostObject close releases the\n // JSI handle and is deliberately safe to call after that transition.\n // It must also run when command execution fails (for example, because a\n // platform logout revoked the capability just before this call).\n this.runtime.close();\n }\n }\n\n /**\n * The slow-query report due now: one line per slow query shape, naming\n * `app`. An older native build without the command reports nothing.\n */\n takeSlowQueryReport(app?: string): string[] {\n if (this.slowQueryLogUnsupported || this.closed) return [];\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"takeSlowQueryReport\", app });\n } catch {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n if (response.type !== \"slowQueryReport\") {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n return response.lines;\n }\n\n /**\n * How many of this foreground's commits still wait for the server's\n * verdict. An older native build without the command reports none.\n */\n pendingUploadCount(): number {\n if (this.pendingUploadCountUnsupported || this.closed) return 0;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"pendingUploadCount\" });\n } catch (error) {\n // An older host rejects the unknown command (InvalidCommand). A busy\n // host or a revoked handle is transient and must not disable the count.\n if (rejectsCommand(error)) this.pendingUploadCountUnsupported = true;\n return 0;\n }\n if (response.type !== \"pendingUploadCount\") {\n this.pendingUploadCountUnsupported = true;\n return 0;\n }\n return response.count;\n }\n\n /** Report query runs of at least `ms` milliseconds; 0 turns the log off. */\n setSlowQueryThresholdMs(ms: number): void {\n if (this.slowQueryLogUnsupported || this.closed) return;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"setSlowQueryThresholdMs\", ms: Math.round(ms) });\n } catch {\n this.slowQueryLogUnsupported = true;\n return;\n }\n if (response.type !== \"slowQueryThresholdSet\") this.slowQueryLogUnsupported = true;\n }\n\n isNativeForegroundClosed(): boolean {\n // Only a typed native closed/revoked receipt suppresses a stale wake.\n // Missing support or any unexpected native/probe failure is not closure.\n return this.closed || this.runtime.isClosed?.() === true;\n }\n\n nativeSessionMetadata(): {\n node: Uint8Array;\n registryAuthority: string;\n accountId: string | null;\n issuer: string;\n userId: string;\n } {\n const response = this.execute({ type: \"nativeSessionMetadata\" });\n if (response.type !== \"nativeSessionMetadata\")\n return unexpected(\"nativeSessionMetadata\", response.type);\n return response;\n }\n\n disconnectNativeUpstream(): void {\n const response = this.execute({ type: \"disconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"disconnectNativeUpstream\", response.type);\n }\n\n reconnectNativeUpstream(): void {\n const response = this.execute({ type: \"reconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"reconnectNativeUpstream\", response.type);\n }\n\n nativeConnectionStatus(): NativeConnectionStatus {\n const response = this.execute({ type: \"nativeConnectionStatus\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"nativeConnectionStatus\", response.type);\n return response;\n }\n\n rejectAuthUpdate(): never {\n throw new Error(\n \"React Native native foreground cannot rotate authentication in place; keep the existing admitted session or revoke the old native capability and create a new Db for the newly admitted session\",\n );\n }\n\n drain(subscription: number, operation?: number): unknown[] | { pendingOperation: number } {\n const response =\n operation === undefined\n ? this.execute({ type: \"drainSubscription\", subscription })\n : this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return { pendingOperation: response.operation };\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground subscription failed: ${response.reason}`,\n });\n }\n if (response.type !== \"subscriptionEvents\")\n return unexpected(\"drainSubscription\", response.type);\n return response.events.map((event) => {\n if (event.type === \"delta\") return event;\n if (event.type === \"closed\") return event;\n return {\n type: \"rejected\",\n reason: { type: \"ServerFailure\", code: event.reason },\n };\n });\n }\n\n unsubscribe(subscription: number): boolean {\n if (this.closed) return false;\n const response = this.execute({ type: \"unsubscribe\", subscription });\n if (response.type !== \"unsubscribed\") return unexpected(\"unsubscribe\", response.type);\n // Native unsubscribe retires the stream handle synchronously but queues\n // its core cleanup for the following ordinary turn. Drive that turn here:\n // after the JS reader stops polling there may be no unrelated operation\n // to do it for us.\n if (response.closed) this.tick();\n return response.closed;\n }\n\n requestInsertPermissionAdvice(table: string, cells: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"insert\", table, cells });\n }\n\n requestReadPermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"read\", table, rowId });\n }\n\n requestUpdatePermissionAdvice(table: string, rowId: Uint8Array, patch: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"update\", table, rowId, patch });\n }\n\n requestDeletePermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"delete\", table, rowId });\n }\n\n private requestPermissionAdvice(action: Relay.NativeForegroundPermissionAdviceAction) {\n let response = this.execute({ type: \"permissionAdvice\", action });\n if (response.type === \"permissionAdvice\") return response.advice;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"pending\") return unexpected(\"permissionAdvice\", response.type);\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): string | null => {\n if (completed || this.closed) return \"unknown\";\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"permissionAdvice\")\n return unexpected(\"permissionAdvice\", response.type);\n return response.advice;\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"permissionAdvice cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n /**\n * Resolve once every local write so far reached `tier`. A wait that does\n * not settle at once is a pollable read, so a caller that stops waiting\n * cancels it.\n */\n waitForPendingWrites(\n tier: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): boolean } {\n let response = this.execute({ type: \"waitForPendingWrites\", tier });\n const settle = (): Uint8Array => {\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\" || response.rows.length !== 0)\n return unexpected(\"waitForPendingWrites\", response.type);\n return response.rows;\n };\n if (response.type !== \"pending\") return settle();\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): Uint8Array | null => {\n if (completed || this.closed) throw new Error(\"waitForPendingWrites was cancelled\");\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n return settle();\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"waitForPendingWrites cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n async waitForTransaction(txId: Uint8Array, tier: string, observeOnly = false): Promise<void> {\n if (![\"local\", \"global\"].includes(tier)) {\n throw new Error(`Unsupported write durability tier: ${tier}`);\n }\n let response = this.execute({ type: \"waitForTransaction\", txId, tier, observeOnly });\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionSettled\")\n return unexpected(\"waitForTransaction\", response.type);\n }\n\n private execute(command: ForegroundCommand): ForegroundResponse {\n this.assertOpen();\n return this.executeAllowClosed(command);\n }\n\n private pendingRows(operation: number): { poll(): Uint8Array | null; cancel(): void } {\n let completed = false;\n return {\n poll: () => {\n if (completed) throw new Error(\"Native foreground read is already complete\");\n this.tick();\n const response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground read failed: ${response.reason}`,\n });\n }\n if (response.type !== \"rows\") return unexpected(\"poll\", response.type);\n return response.rows;\n },\n cancel: () => {\n if (completed || this.closed) return;\n completed = true;\n const response = this.execute({ type: \"cancel\", operation });\n if (response.type !== \"cancelled\") return unexpected(\"read cancellation\", response.type);\n },\n };\n }\n\n private executeAllowClosed(command: ForegroundCommand): ForegroundResponse {\n return this.commands.decodeNativeForegroundResponse(\n this.runtime.execute(this.commands.encodeNativeForegroundCommand(command)),\n );\n }\n\n private assertOpen(): void {\n if (this.closed) throw new Error(\"React Native native foreground runtime is closed\");\n }\n\n // The admitted native host already owns and validates the schema. A schema\n // view therefore shares this foreground rather than opening a second store.\n registerSchema(): NativeForegroundDb {\n return this;\n }\n\n beginTransaction(openTransactionId: string, kind: \"mergeable\" | \"serializable\"): void {\n this.assertOpen();\n if (this.transactions.has(openTransactionId)) {\n throw new Error(\n `React Native native foreground transaction ${openTransactionId} is already open`,\n );\n }\n const response = this.execute({ type: \"beginTransaction\", kind });\n if (response.type !== \"transactionOpened\") return unexpected(\"beginTransaction\", response.type);\n this.transactions.set(openTransactionId, {\n handle: response.transaction,\n kind,\n closed: false,\n });\n }\n\n commitTransaction(openTransactionId: string): NativeForegroundWrite {\n const transaction = this.openTransaction(openTransactionId, \"commit\");\n const response = this.execute({\n type: \"commitTransaction\",\n transaction: transaction.handle,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"commitTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n return nativeWrite(this, response.txId);\n }\n\n rollbackTransaction(openTransactionId: string): void {\n const transaction = this.openTransaction(openTransactionId, \"rollback\");\n const response = this.execute({\n type: \"rollbackTransaction\",\n transaction: transaction.handle,\n });\n if (response.type !== \"transactionRolledBack\")\n return unexpected(\"rollbackTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n }\n\n insert(\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"insert\", table, options?.rowId, cells, options);\n }\n\n insertInTransaction(\n openTransactionId: string,\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n return this.stageMutation(\n this.openTransaction(openTransactionId, \"insert into\"),\n \"insert\",\n table,\n options?.rowId,\n cells,\n options,\n );\n }\n\n update(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"update\", table, rowId, patch, options);\n }\n\n updateInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"update in\"),\n \"update\",\n table,\n rowId,\n patch,\n options,\n );\n }\n\n upsert(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"upsert\", table, rowId, cells, options);\n }\n\n upsertInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"upsert into\"),\n \"upsert\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n delete(\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"delete\", table, rowId, new Uint8Array(), options);\n }\n\n deleteInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"delete from\"),\n \"delete\",\n table,\n rowId,\n new Uint8Array(),\n options,\n );\n }\n\n restore(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"restore\", table, rowId, cells, options);\n }\n\n restoreInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"restore in\"),\n \"restore\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n connectUpstream(): never {\n return unsupported(\"JavaScript upstream transport\");\n }\n\n writeState(txId: Uint8Array): unknown {\n const response = this.execute({ type: \"writeState\", txId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"writeState\") return unexpected(\"writeState\", response.type);\n return JSON.parse(response.stateJson);\n }\n\n updateLargeValues(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n descriptors: readonly unknown[],\n updatedAtMs?: number,\n ): NativeForegroundWrite {\n const response = this.execute({\n type: \"updateLargeValues\",\n table,\n rowId,\n patch,\n descriptorsJson: JSON.stringify(descriptors),\n updatedAtMs,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"updateLargeValues\", response.type);\n return nativeWrite(this, response.txId, rowId);\n }\n\n beginStreamingMutation(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n column: string,\n mutation: \"insert\" | \"update\" | \"upsert\" = \"insert\",\n _author?: Uint8Array,\n _attribution?: Uint8Array,\n updatedAtMs?: number,\n head?: unknown,\n base?: unknown,\n transaction?: string,\n ) {\n if (updatedAtMs !== undefined && (!Number.isSafeInteger(updatedAtMs) || updatedAtMs < 0)) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n const response = this.execute({\n type: \"beginStreamingMutation\",\n mutation,\n table,\n rowId,\n cells,\n column,\n optionsJson: JSON.stringify({ updatedAtMs, head, base, transaction }),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"streamingMutationOpened\")\n return unexpected(\"beginStreamingMutation\", response.type);\n const upload = response.upload;\n let closed = false;\n const assertOpen = () => {\n if (closed) throw new Error(\"streaming mutation is closed\");\n this.assertOpen();\n };\n return {\n push: async (chunk: Uint8Array): Promise<void> => {\n assertOpen();\n const pushed = await this.completeMutationOperation(\n this.execute({ type: \"pushStreamingMutation\", upload, chunk }),\n );\n if (pushed.type === \"operationError\") throw foregroundOperationError(pushed);\n if (pushed.type !== \"streamingMutationPushed\")\n return unexpected(\"pushStreamingMutation\", pushed.type);\n },\n finishInTransaction: async (): Promise<void> => {\n assertOpen();\n const finished = await this.completeMutationOperation(\n this.execute({ type: \"finishStreamingMutation\", upload }),\n );\n closed = true;\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"mutationStaged\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n },\n finish: async (): Promise<NativeForegroundWrite> => {\n assertOpen();\n let finished = this.execute({ type: \"finishStreamingMutation\", upload });\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n closed = true;\n while (finished.type === \"pending\") {\n const operation = finished.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n finished = this.execute({ type: \"poll\", operation });\n }\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"transactionCommitted\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n return nativeWrite(this, finished.txId, rowId);\n },\n abort: async (): Promise<boolean> => {\n if (closed || this.closed) return false;\n const admitted = this.execute({ type: \"abortStreamingMutation\", upload });\n if (admitted.type === \"operationError\") throw foregroundOperationError(admitted);\n closed = true;\n const aborted = await this.completeMutationOperation(admitted);\n if (aborted.type === \"operationError\") throw foregroundOperationError(aborted);\n if (aborted.type !== \"streamingMutationAborted\")\n return unexpected(\"abortStreamingMutation\", aborted.type);\n return aborted.aborted;\n },\n };\n }\n\n private async completeMutationOperation(\n response: ForegroundResponse,\n ): Promise<ForegroundResponse> {\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n return response;\n }\n\n private directMutation(\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n if (mutation === \"upsert\" && options && \"branch\" in options)\n throw new Error(\"upsert option `branch` is not supported; use `head`\");\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n )\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"directMutation\",\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"mutationCommitted\") return unexpected(mutation, response.type);\n return nativeWrite(this, response.txId, response.rowId);\n }\n\n private stageMutation(\n transaction: NativeForegroundTransaction,\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n if (transaction.closed) throw new Error(\"React Native native foreground transaction is closed\");\n if (mutation === \"upsert\" && options && \"branch\" in options) {\n throw new Error(\n \"upsert option `branch` is not supported; use `head` (and optional `base`) for a branch view\",\n );\n }\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n ) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n // Identity belongs to the admitted native capability, never the command.\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"stageMutation\",\n transaction: transaction.handle,\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (mutation === \"insert\" && response.type === \"inserted\") return response.rowId;\n if (mutation !== \"insert\" && response.type === \"mutationStaged\") return rowId!;\n return unexpected(mutation, response.type);\n }\n\n private openTransaction(id: string, operation: string): NativeForegroundTransaction {\n const transaction = this.transactions.get(id);\n if (!transaction || transaction.closed) {\n throw new Error(\n `React Native native foreground cannot ${operation} unknown transaction ${id}`,\n );\n }\n return transaction;\n }\n}\n\ntype NativeForegroundTransaction = {\n handle: number;\n kind: \"mergeable\" | \"serializable\";\n closed: boolean;\n};\n\ntype NativeForegroundWrite = {\n /** Public write identity. Native binding spellings are normalized here. */\n readonly txId: string;\n readonly payload: Uint8Array;\n readonly rowId: Uint8Array;\n wait(tier: string, observeOnly?: boolean): Promise<void>;\n writeState(): unknown;\n close(): boolean;\n};\n\nfunction nativeWrite(\n db: NativeForegroundDb,\n txId: Uint8Array<ArrayBufferLike>,\n rowId: Uint8Array<ArrayBufferLike> = new Uint8Array(16),\n): NativeForegroundWrite {\n const id = formatTransactionId(txId);\n let closed = false;\n return {\n txId: id,\n payload: new Uint8Array(),\n rowId: rowId.slice(),\n async wait(tier: string, observeOnly = false): Promise<void> {\n if (closed) throw new Error(\"write state is unavailable\");\n await db.waitForTransaction(txId, tier, observeOnly);\n },\n writeState: () => {\n if (closed) throw new Error(\"write state is unavailable\");\n return db.writeState(txId);\n },\n close: () => {\n if (closed) return false;\n closed = true;\n return true;\n },\n };\n}\n\nclass NativeForegroundSubscription {\n private closed = false;\n private pendingOperation: number | undefined;\n\n constructor(\n private readonly handle: number,\n private readonly db: NativeForegroundDb,\n ) {}\n\n readAll(): unknown[] | { retryAfterMs(): number } {\n if (this.closed) return [];\n // Native core publication already materializes the canonical event before\n // waking this owner. Keep this pull delivery-only: a foreground read must\n // never run a full relay tick while the JS mutation call is returning.\n const events = this.db.drain(this.handle, this.pendingOperation);\n if (!Array.isArray(events)) {\n this.pendingOperation = events.pendingOperation;\n return { retryAfterMs: () => 0 };\n }\n this.pendingOperation = undefined;\n // An empty batch is a ready native pull with no current event. Returning\n // it lets NativeRuntimeAdapter finish the reader so the next native wake\n // can restart it; a timer here recreates the old relay-polling latency.\n return events;\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n return this.db.unsubscribe(this.handle);\n }\n}\n\n/**\n * The error a failed foreground operation throws: the unchanged reason text as\n * the message, plus the stable core `code` when a core error caused it.\n */\nfunction foregroundOperationError(response: {\n reason: string;\n code?: string;\n reasonName?: string;\n}): Error {\n const error = new Error(response.reason);\n if (response.code !== undefined) Object.assign(error, { code: response.code });\n if (response.reasonName !== undefined) Object.assign(error, { reason: response.reasonName });\n return error;\n}\n\nfunction unsupported(operation: string): never {\n throw new Error(`${REACT_NATIVE_UNSUPPORTED_ERROR}; ${operation} is unavailable`);\n}\n\nfunction unexpected(operation: string, response: string): never {\n throw new Error(\n `React Native native foreground ${operation} returned unexpected ${response} response`,\n );\n}\n\nfunction formatTransactionId(bytes: Uint8Array<ArrayBufferLike>): string {\n if (bytes.byteLength !== 16)\n throw new Error(\"React Native native foreground returned malformed transaction id\");\n const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return hex;\n}\n\n/** Whether the native host refused a command it does not know. */\nfunction rejectsCommand(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return message.includes(\"runtime failed during execute\");\n}\n"]}
1
+ {"version":3,"file":"native-foreground-db.js","sourceRoot":"","sources":["../../src/react-native/native-foreground-db.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAqB,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,8BAA8B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;AACpF,CAAC;AAED,SAAS,UAAU,CAAC,SAAiB,EAAE,QAAgB;IACrD,MAAM,IAAI,KAAK,CACb,kCAAkC,SAAS,wBAAwB,QAAQ,WAAW,CACvF,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAkC;IAC7D,IAAI,KAAK,CAAC,UAAU,KAAK,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,GAAG,CAAC;AACb,CAAC;AAED,kEAAkE;AAClE,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type * as Relay from \"jazz-rn/relay\";\nimport type { MutationErrorEvent } from \"../runtime/client.js\";\nimport { UnsupportedSnapshotError } from \"../runtime/snapshot-ref.js\";\nimport { NO_UPLOADS, uploadStatusFromCount, type UploadStatus } from \"../runtime/sync-status.js\";\nimport { REACT_NATIVE_UNSUPPORTED_ERROR } from \"./errors.js\";\n\n// The foreground command vocabulary is owned by jazz-rn. This module is\n// internal: no public declaration of jazz-tools reaches it, so applications\n// never need the optional jazz-rn peer to type-check.\ntype ForegroundCommand = Relay.NativeForegroundCommand;\ntype ForegroundResponse = Relay.NativeForegroundResponse;\ntype ForegroundMutationKind = Extract<ForegroundCommand, { type: \"directMutation\" }>[\"mutation\"];\ntype NativeConnectionStatus = Extract<ForegroundResponse, { type: \"nativeConnectionStatus\" }>;\n/** An upstream connection failure other than a refused credential (#4337). */\n/**\n * A native upstream failure. `code` is the core's stable error code when the\n * relay refused its upstream (`authority_changed`, say), else null.\n */\nexport type NativeUpstreamFailure = { reason: string; retrying: boolean; code: string | null };\ntype ForegroundMutationOptions = {\n rowId?: Uint8Array;\n branch?: unknown;\n head?: unknown;\n base?: unknown;\n updatedAtMs?: number;\n author?: Uint8Array;\n attribution?: Uint8Array;\n};\n\nexport type NativeForegroundRuntime = Relay.NativeForegroundRuntime;\nexport type NativeForegroundFactory = Relay.NativeForegroundRuntimeFactory;\nexport type NativeForegroundModule = Pick<\n typeof Relay,\n | \"installNativeForegroundRuntime\"\n | \"encodeNativeForegroundCommand\"\n | \"decodeNativeForegroundResponse\"\n>;\n\n/**\n * Narrow NativeDb consumer for the first JSI foreground slice.\n *\n * Rows and subscription deltas stay in the ordinary binding byte format, so\n * NativeRuntimeAdapter remains the sole schema-aware decoder. This is not a\n * second object-shaped database facade and intentionally grows only as the\n * shared Rust command ABI grows.\n */\n/**\n * Thin `NativeDb` adapter over the native foreground command ABI.\n *\n * This deliberately contains no row, query, or mutation interpretation: the\n * normal `NativeRuntimeAdapter` owns the public API and existing codecs. A\n * direct mutation is represented by one ordinary native mergeable transaction;\n * explicit public transactions retain their native transaction handle until\n * commit/rollback.\n */\nexport class NativeForegroundDb {\n private closed = false;\n private mutationErrorCallback: ((event: MutationErrorEvent) => void) | undefined;\n private authRejectedCallback: ((reason: string) => void) | undefined;\n /** The sequence of the refusal last reported, so each is reported once. */\n private reportedAuthRejection = 0;\n private upstreamFailureCallback: ((failure: NativeUpstreamFailure | null) => void) | undefined;\n /** The upstream failure last reported, so each change is reported once. */\n private reportedUpstreamFailure: { sequence: number; retrying: boolean } | null = null;\n private readonly transactions = new Map<string, NativeForegroundTransaction>();\n /** A native build without the (append-only) slow-query commands. */\n private slowQueryLogUnsupported = false;\n private pendingUploadCountUnsupported = false;\n private uploadStatusUnsupported = false;\n\n constructor(\n private readonly runtime: NativeForegroundRuntime,\n private readonly commands: NativeForegroundModule,\n ) {}\n\n setTickScheduler(callback: (first: Error | string | null, second?: string) => void): void {\n if (!this.runtime.setTickScheduler) {\n throw new Error(\n \"React Native native foreground runtime does not expose owner wake scheduling\",\n );\n }\n this.runtime.setTickScheduler((urgency) => {\n // Native invalidation clears the JSI registration first, but a\n // CallInvoker task may already have crossed into JS when close races\n // teardown. Do not let that stale task re-enter the adapter after its\n // foreground facade has become unusable.\n if (!this.closed) callback(urgency);\n });\n }\n\n onMutationError(callback: (event: MutationErrorEvent) => void): void {\n this.assertOpen();\n this.mutationErrorCallback = callback;\n }\n\n /**\n * Observe the upstream refusing the scope's credential. The refusal is auth\n * state, not a failed tick: local ticks keep running, and the tick that\n * first sees a refusal reports it once, so the app can renew the\n * credential (#4248, #4296).\n */\n onAuthRejected(callback: (reason: string) => void): void {\n this.assertOpen();\n this.authRejectedCallback = callback;\n }\n\n /**\n * Observe the scope's upstream connection failing for a reason other than\n * its credential, and recovering (`null`). A failure is connection state,\n * not a failed tick: local ticks keep running (#4337).\n */\n onUpstreamFailure(callback: (failure: NativeUpstreamFailure | null) => void): void {\n this.assertOpen();\n this.upstreamFailureCallback = callback;\n }\n\n all(\n query: Uint8Array,\n opts: unknown,\n openTransactionId?: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n const transaction =\n openTransactionId === undefined\n ? undefined\n : this.openTransaction(openTransactionId, \"read\").handle;\n // No tick here: the native relay owner applies admitted writes and pumps\n // on its own thread. The read is fenced natively behind every write\n // admitted before it, so it resolves (possibly as pending) with them.\n const response = this.execute({\n type: \"all\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n transaction,\n });\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"all\", response.type);\n }\n\n captureSnapshot(): Uint8Array | { poll(): Uint8Array | null; cancel(): void } {\n this.assertOpen();\n if (this.runtime.supportsSnapshotCapture !== true) {\n throw new UnsupportedSnapshotError(\n \"Capturing snapshots requires a newer Jazz native build; rebuild the native app to use captureSnapshot()\",\n );\n }\n const response = this.execute({ type: \"captureSnapshot\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type === \"rows\") return response.rows;\n if (response.type === \"pending\") return this.pendingRows(response.operation);\n return unexpected(\"captureSnapshot\", response.type);\n }\n\n // The shared mutation adapter needs one exact local row, without coverage\n // registration or hydration, to merge staged patches synchronously.\n localCurrentRow(table: string, rowId: Uint8Array): Uint8Array {\n const response = this.execute({ type: \"localCurrentRow\", table, rowId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\") return unexpected(\"localCurrentRow\", response.type);\n return response.rows;\n }\n\n subscribe(query: Uint8Array, opts: unknown): NativeForegroundSubscription {\n // Fenced natively like `all()`: the first frame reflects earlier writes.\n const response = this.execute({\n type: \"subscribe\",\n query,\n optionsJson: JSON.stringify(opts ?? {}),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"subscribed\") return unexpected(\"subscribe\", response.type);\n return new NativeForegroundSubscription(response.subscription, this);\n }\n\n tick(): void {\n this.assertOpen();\n this.runtime.tick();\n if (!this.mutationErrorCallback && !this.authRejectedCallback && !this.upstreamFailureCallback)\n return;\n // One call drains everything a tick reports.\n const response = this.execute({ type: \"drainTickEvents\" });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"tickEvents\") return unexpected(\"drainTickEvents\", response.type);\n const rejection = response.authRejection;\n if (rejection && rejection.sequence !== this.reportedAuthRejection) {\n this.reportedAuthRejection = rejection.sequence;\n queueMicrotask(() => {\n if (!this.closed) this.authRejectedCallback?.(rejection.reason);\n });\n }\n const failure = response.upstreamFailure;\n const reported = this.reportedUpstreamFailure;\n if (\n failure\n ? failure.sequence !== reported?.sequence || failure.retrying !== reported.retrying\n : reported\n ) {\n this.reportedUpstreamFailure = failure && {\n sequence: failure.sequence,\n retrying: failure.retrying,\n };\n const change = failure && {\n reason: failure.reason,\n retrying: failure.retrying,\n code: failure.code,\n };\n queueMicrotask(() => {\n if (!this.closed) this.upstreamFailureCallback?.(change);\n });\n }\n // The drain claims mutation errors; with no observer they are dropped.\n if (!this.mutationErrorCallback) return;\n const events = JSON.parse(response.eventsJson) as MutationErrorEvent[];\n for (const event of events)\n queueMicrotask(() => {\n if (!this.closed) this.mutationErrorCallback?.(event);\n });\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n this.transactions.clear();\n try {\n const response = this.executeAllowClosed(\"close\");\n if (response.type !== \"closed\") return unexpected(\"close\", response.type);\n return response.closed;\n } finally {\n // The command owns logical Db closure. The HostObject close releases the\n // JSI handle and is deliberately safe to call after that transition.\n // It must also run when command execution fails (for example, because a\n // platform logout revoked the capability just before this call).\n this.runtime.close();\n }\n }\n\n /**\n * The slow-query report due now: one line per slow query shape, naming\n * `app`. An older native build without the command reports nothing.\n */\n takeSlowQueryReport(app?: string): string[] {\n if (this.slowQueryLogUnsupported || this.closed) return [];\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"takeSlowQueryReport\", app });\n } catch {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n if (response.type !== \"slowQueryReport\") {\n this.slowQueryLogUnsupported = true;\n return [];\n }\n return response.lines;\n }\n\n /**\n * This foreground's uploads. An older native build without the command\n * reports the pending count alone, and one older still reports none.\n */\n uploadStatus(): UploadStatus {\n if (this.closed) return NO_UPLOADS;\n if (this.uploadStatusUnsupported) return uploadStatusFromCount(this.pendingUploadCount());\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"uploadStatus\" });\n } catch (error) {\n // As for the count: only a host that rejects the command lacks it.\n if (rejectsCommand(error)) this.uploadStatusUnsupported = true;\n return this.uploadStatusUnsupported\n ? uploadStatusFromCount(this.pendingUploadCount())\n : NO_UPLOADS;\n }\n if (response.type !== \"uploadStatus\") {\n this.uploadStatusUnsupported = true;\n return uploadStatusFromCount(this.pendingUploadCount());\n }\n return JSON.parse(response.statusJson) as UploadStatus;\n }\n\n /**\n * Delete this foreground's scope store: the native relay closes every\n * foreground of the scope (this one too) and its relay, then deletes the\n * store's files, keeping the account. Returns how many writes the server\n * had not confirmed it dropped.\n */\n deleteNativeStore(): { pendingUploads: number } {\n const response = this.execute({ type: \"deleteStore\" });\n if (response.type !== \"storeDeleted\") return unexpected(\"deleteStore\", response.type);\n this.closed = true;\n return { pendingUploads: response.pendingUploads };\n }\n\n /**\n * How many of this foreground's commits still wait for the server's\n * verdict. An older native build without the command reports none.\n */\n pendingUploadCount(): number {\n if (this.pendingUploadCountUnsupported || this.closed) return 0;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"pendingUploadCount\" });\n } catch (error) {\n // An older host rejects the unknown command (InvalidCommand). A busy\n // host or a revoked handle is transient and must not disable the count.\n if (rejectsCommand(error)) this.pendingUploadCountUnsupported = true;\n return 0;\n }\n if (response.type !== \"pendingUploadCount\") {\n this.pendingUploadCountUnsupported = true;\n return 0;\n }\n return response.count;\n }\n\n /** Report query runs of at least `ms` milliseconds; 0 turns the log off. */\n setSlowQueryThresholdMs(ms: number): void {\n if (this.slowQueryLogUnsupported || this.closed) return;\n let response: ForegroundResponse;\n try {\n response = this.execute({ type: \"setSlowQueryThresholdMs\", ms: Math.round(ms) });\n } catch {\n this.slowQueryLogUnsupported = true;\n return;\n }\n if (response.type !== \"slowQueryThresholdSet\") this.slowQueryLogUnsupported = true;\n }\n\n isNativeForegroundClosed(): boolean {\n // Only a typed native closed/revoked receipt suppresses a stale wake.\n // Missing support or any unexpected native/probe failure is not closure.\n return this.closed || this.runtime.isClosed?.() === true;\n }\n\n nativeSessionMetadata(): {\n node: Uint8Array;\n registryAuthority: string;\n accountId: string | null;\n issuer: string;\n userId: string;\n } {\n const response = this.execute({ type: \"nativeSessionMetadata\" });\n if (response.type !== \"nativeSessionMetadata\")\n return unexpected(\"nativeSessionMetadata\", response.type);\n return response;\n }\n\n disconnectNativeUpstream(): void {\n const response = this.execute({ type: \"disconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"disconnectNativeUpstream\", response.type);\n }\n\n reconnectNativeUpstream(): void {\n const response = this.execute({ type: \"reconnectNativeUpstream\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"reconnectNativeUpstream\", response.type);\n }\n\n nativeConnectionStatus(): NativeConnectionStatus {\n const response = this.execute({ type: \"nativeConnectionStatus\" });\n if (response.type !== \"nativeConnectionStatus\")\n return unexpected(\"nativeConnectionStatus\", response.type);\n return response;\n }\n\n rejectAuthUpdate(): never {\n throw new Error(\n \"React Native native foreground cannot rotate authentication in place; keep the existing admitted session or revoke the old native capability and create a new Db for the newly admitted session\",\n );\n }\n\n drain(subscription: number, operation?: number): unknown[] | { pendingOperation: number } {\n const response =\n operation === undefined\n ? this.execute({ type: \"drainSubscription\", subscription })\n : this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return { pendingOperation: response.operation };\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground subscription failed: ${response.reason}`,\n });\n }\n if (response.type !== \"subscriptionEvents\")\n return unexpected(\"drainSubscription\", response.type);\n return response.events.map((event) => {\n if (event.type === \"delta\") return event;\n if (event.type === \"closed\") return event;\n return {\n type: \"rejected\",\n reason: { type: \"ServerFailure\", code: event.reason },\n };\n });\n }\n\n unsubscribe(subscription: number): boolean {\n if (this.closed) return false;\n const response = this.execute({ type: \"unsubscribe\", subscription });\n if (response.type !== \"unsubscribed\") return unexpected(\"unsubscribe\", response.type);\n // Native unsubscribe retires the stream handle synchronously but queues\n // its core cleanup for the following ordinary turn. Drive that turn here:\n // after the JS reader stops polling there may be no unrelated operation\n // to do it for us.\n if (response.closed) this.tick();\n return response.closed;\n }\n\n requestInsertPermissionAdvice(table: string, cells: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"insert\", table, cells });\n }\n\n requestReadPermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"read\", table, rowId });\n }\n\n requestUpdatePermissionAdvice(table: string, rowId: Uint8Array, patch: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"update\", table, rowId, patch });\n }\n\n requestDeletePermissionAdvice(table: string, rowId: Uint8Array) {\n return this.requestPermissionAdvice({ type: \"delete\", table, rowId });\n }\n\n private requestPermissionAdvice(action: Relay.NativeForegroundPermissionAdviceAction) {\n let response = this.execute({ type: \"permissionAdvice\", action });\n if (response.type === \"permissionAdvice\") return response.advice;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"pending\") return unexpected(\"permissionAdvice\", response.type);\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): string | null => {\n if (completed || this.closed) return \"unknown\";\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"permissionAdvice\")\n return unexpected(\"permissionAdvice\", response.type);\n return response.advice;\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"permissionAdvice cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n /**\n * Resolve once every local write so far reached `tier`. A wait that does\n * not settle at once is a pollable read, so a caller that stops waiting\n * cancels it.\n */\n waitForPendingWrites(\n tier: string,\n ): Uint8Array | { poll(): Uint8Array | null; cancel(): boolean } {\n let response = this.execute({ type: \"waitForPendingWrites\", tier });\n const settle = (): Uint8Array => {\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"rows\" || response.rows.length !== 0)\n return unexpected(\"waitForPendingWrites\", response.type);\n return response.rows;\n };\n if (response.type !== \"pending\") return settle();\n const operation = response.operation;\n let completed = false;\n return {\n poll: (): Uint8Array | null => {\n if (completed || this.closed) throw new Error(\"waitForPendingWrites was cancelled\");\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n return settle();\n },\n cancel: (): boolean => {\n if (completed || this.closed) return false;\n completed = true;\n const cancelled = this.execute({ type: \"cancel\", operation });\n if (cancelled.type !== \"cancelled\")\n return unexpected(\"waitForPendingWrites cancellation\", cancelled.type);\n return cancelled.cancelled;\n },\n };\n }\n\n async waitForTransaction(txId: Uint8Array, tier: string, observeOnly = false): Promise<void> {\n if (![\"local\", \"global\"].includes(tier)) {\n throw new Error(`Unsupported write durability tier: ${tier}`);\n }\n let response = this.execute({ type: \"waitForTransaction\", txId, tier, observeOnly });\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionSettled\")\n return unexpected(\"waitForTransaction\", response.type);\n }\n\n private execute(command: ForegroundCommand): ForegroundResponse {\n this.assertOpen();\n return this.executeAllowClosed(command);\n }\n\n private pendingRows(operation: number): { poll(): Uint8Array | null; cancel(): void } {\n let completed = false;\n return {\n poll: () => {\n if (completed) throw new Error(\"Native foreground read is already complete\");\n this.tick();\n const response = this.execute({ type: \"poll\", operation });\n if (response.type === \"pending\") return null;\n completed = true;\n if (response.type === \"operationError\") {\n throw foregroundOperationError({\n ...response,\n reason: `React Native native foreground read failed: ${response.reason}`,\n });\n }\n if (response.type !== \"rows\") return unexpected(\"poll\", response.type);\n return response.rows;\n },\n cancel: () => {\n if (completed || this.closed) return;\n completed = true;\n const response = this.execute({ type: \"cancel\", operation });\n if (response.type !== \"cancelled\") return unexpected(\"read cancellation\", response.type);\n },\n };\n }\n\n private executeAllowClosed(command: ForegroundCommand): ForegroundResponse {\n return this.commands.decodeNativeForegroundResponse(\n this.runtime.execute(this.commands.encodeNativeForegroundCommand(command)),\n );\n }\n\n private assertOpen(): void {\n if (this.closed) throw new Error(\"React Native native foreground runtime is closed\");\n }\n\n // The admitted native host already owns and validates the schema. A schema\n // view therefore shares this foreground rather than opening a second store.\n registerSchema(): NativeForegroundDb {\n return this;\n }\n\n beginTransaction(openTransactionId: string, kind: \"mergeable\" | \"serializable\"): void {\n this.assertOpen();\n if (this.transactions.has(openTransactionId)) {\n throw new Error(\n `React Native native foreground transaction ${openTransactionId} is already open`,\n );\n }\n const response = this.execute({ type: \"beginTransaction\", kind });\n if (response.type !== \"transactionOpened\") return unexpected(\"beginTransaction\", response.type);\n this.transactions.set(openTransactionId, {\n handle: response.transaction,\n kind,\n closed: false,\n });\n }\n\n commitTransaction(openTransactionId: string): NativeForegroundWrite {\n const transaction = this.openTransaction(openTransactionId, \"commit\");\n const response = this.execute({\n type: \"commitTransaction\",\n transaction: transaction.handle,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"commitTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n return nativeWrite(this, response.txId);\n }\n\n rollbackTransaction(openTransactionId: string): void {\n const transaction = this.openTransaction(openTransactionId, \"rollback\");\n const response = this.execute({\n type: \"rollbackTransaction\",\n transaction: transaction.handle,\n });\n if (response.type !== \"transactionRolledBack\")\n return unexpected(\"rollbackTransaction\", response.type);\n this.transactions.delete(openTransactionId);\n transaction.closed = true;\n }\n\n insert(\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"insert\", table, options?.rowId, cells, options);\n }\n\n insertInTransaction(\n openTransactionId: string,\n table: string,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n return this.stageMutation(\n this.openTransaction(openTransactionId, \"insert into\"),\n \"insert\",\n table,\n options?.rowId,\n cells,\n options,\n );\n }\n\n update(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"update\", table, rowId, patch, options);\n }\n\n updateInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"update in\"),\n \"update\",\n table,\n rowId,\n patch,\n options,\n );\n }\n\n upsert(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"upsert\", table, rowId, cells, options);\n }\n\n upsertInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"upsert into\"),\n \"upsert\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n delete(\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"delete\", table, rowId, new Uint8Array(), options);\n }\n\n deleteInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"delete from\"),\n \"delete\",\n table,\n rowId,\n new Uint8Array(),\n options,\n );\n }\n\n restore(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n return this.directMutation(\"restore\", table, rowId, cells, options);\n }\n\n restoreInTransaction(\n openTransactionId: string,\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): void {\n this.stageMutation(\n this.openTransaction(openTransactionId, \"restore in\"),\n \"restore\",\n table,\n rowId,\n cells,\n options,\n );\n }\n\n connectUpstream(): never {\n return unsupported(\"JavaScript upstream transport\");\n }\n\n writeState(txId: Uint8Array): unknown {\n const response = this.execute({ type: \"writeState\", txId });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"writeState\") return unexpected(\"writeState\", response.type);\n return JSON.parse(response.stateJson);\n }\n\n updateLargeValues(\n table: string,\n rowId: Uint8Array,\n patch: Uint8Array,\n descriptors: readonly unknown[],\n updatedAtMs?: number,\n ): NativeForegroundWrite {\n const response = this.execute({\n type: \"updateLargeValues\",\n table,\n rowId,\n patch,\n descriptorsJson: JSON.stringify(descriptors),\n updatedAtMs,\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"transactionCommitted\")\n return unexpected(\"updateLargeValues\", response.type);\n return nativeWrite(this, response.txId, rowId);\n }\n\n beginStreamingMutation(\n table: string,\n rowId: Uint8Array,\n cells: Uint8Array,\n column: string,\n mutation: \"insert\" | \"update\" | \"upsert\" = \"insert\",\n _author?: Uint8Array,\n _attribution?: Uint8Array,\n updatedAtMs?: number,\n head?: unknown,\n base?: unknown,\n transaction?: string,\n ) {\n if (updatedAtMs !== undefined && (!Number.isSafeInteger(updatedAtMs) || updatedAtMs < 0)) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n const response = this.execute({\n type: \"beginStreamingMutation\",\n mutation,\n table,\n rowId,\n cells,\n column,\n optionsJson: JSON.stringify({ updatedAtMs, head, base, transaction }),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"streamingMutationOpened\")\n return unexpected(\"beginStreamingMutation\", response.type);\n const upload = response.upload;\n let closed = false;\n const assertOpen = () => {\n if (closed) throw new Error(\"streaming mutation is closed\");\n this.assertOpen();\n };\n return {\n push: async (chunk: Uint8Array): Promise<void> => {\n assertOpen();\n const pushed = await this.completeMutationOperation(\n this.execute({ type: \"pushStreamingMutation\", upload, chunk }),\n );\n if (pushed.type === \"operationError\") throw foregroundOperationError(pushed);\n if (pushed.type !== \"streamingMutationPushed\")\n return unexpected(\"pushStreamingMutation\", pushed.type);\n },\n finishInTransaction: async (): Promise<void> => {\n assertOpen();\n const finished = await this.completeMutationOperation(\n this.execute({ type: \"finishStreamingMutation\", upload }),\n );\n closed = true;\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"mutationStaged\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n },\n finish: async (): Promise<NativeForegroundWrite> => {\n assertOpen();\n let finished = this.execute({ type: \"finishStreamingMutation\", upload });\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n closed = true;\n while (finished.type === \"pending\") {\n const operation = finished.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n finished = this.execute({ type: \"poll\", operation });\n }\n if (finished.type === \"operationError\") throw foregroundOperationError(finished);\n if (finished.type !== \"transactionCommitted\")\n return unexpected(\"finishStreamingMutation\", finished.type);\n return nativeWrite(this, finished.txId, rowId);\n },\n abort: async (): Promise<boolean> => {\n if (closed || this.closed) return false;\n const admitted = this.execute({ type: \"abortStreamingMutation\", upload });\n if (admitted.type === \"operationError\") throw foregroundOperationError(admitted);\n closed = true;\n const aborted = await this.completeMutationOperation(admitted);\n if (aborted.type === \"operationError\") throw foregroundOperationError(aborted);\n if (aborted.type !== \"streamingMutationAborted\")\n return unexpected(\"abortStreamingMutation\", aborted.type);\n return aborted.aborted;\n },\n };\n }\n\n private async completeMutationOperation(\n response: ForegroundResponse,\n ): Promise<ForegroundResponse> {\n while (response.type === \"pending\") {\n const operation = response.operation;\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n this.tick();\n response = this.execute({ type: \"poll\", operation });\n }\n return response;\n }\n\n private directMutation(\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): NativeForegroundWrite {\n if (mutation === \"upsert\" && options && \"branch\" in options)\n throw new Error(\"upsert option `branch` is not supported; use `head`\");\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n )\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"directMutation\",\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (response.type !== \"mutationCommitted\") return unexpected(mutation, response.type);\n return nativeWrite(this, response.txId, response.rowId);\n }\n\n private stageMutation(\n transaction: NativeForegroundTransaction,\n mutation: ForegroundMutationKind,\n table: string,\n rowId: Uint8Array | undefined,\n cells: Uint8Array,\n options?: ForegroundMutationOptions,\n ): Uint8Array {\n if (transaction.closed) throw new Error(\"React Native native foreground transaction is closed\");\n if (mutation === \"upsert\" && options && \"branch\" in options) {\n throw new Error(\n \"upsert option `branch` is not supported; use `head` (and optional `base`) for a branch view\",\n );\n }\n if (\n options?.updatedAtMs !== undefined &&\n (!Number.isSafeInteger(options.updatedAtMs) || options.updatedAtMs < 0)\n ) {\n throw new Error(\"updatedAtMs must be a non-negative safe integer\");\n }\n // Identity belongs to the admitted native capability, never the command.\n const {\n rowId: _rowId,\n author: _author,\n attribution: _attribution,\n ...wireOptions\n } = options ?? {};\n const response = this.execute({\n type: \"stageMutation\",\n transaction: transaction.handle,\n mutation,\n table,\n rowId,\n cells,\n optionsJson: JSON.stringify(wireOptions),\n });\n if (response.type === \"operationError\") throw foregroundOperationError(response);\n if (mutation === \"insert\" && response.type === \"inserted\") return response.rowId;\n if (mutation !== \"insert\" && response.type === \"mutationStaged\") return rowId!;\n return unexpected(mutation, response.type);\n }\n\n private openTransaction(id: string, operation: string): NativeForegroundTransaction {\n const transaction = this.transactions.get(id);\n if (!transaction || transaction.closed) {\n throw new Error(\n `React Native native foreground cannot ${operation} unknown transaction ${id}`,\n );\n }\n return transaction;\n }\n}\n\ntype NativeForegroundTransaction = {\n handle: number;\n kind: \"mergeable\" | \"serializable\";\n closed: boolean;\n};\n\ntype NativeForegroundWrite = {\n /** Public write identity. Native binding spellings are normalized here. */\n readonly txId: string;\n readonly payload: Uint8Array;\n readonly rowId: Uint8Array;\n wait(tier: string, observeOnly?: boolean): Promise<void>;\n writeState(): unknown;\n close(): boolean;\n};\n\nfunction nativeWrite(\n db: NativeForegroundDb,\n txId: Uint8Array<ArrayBufferLike>,\n rowId: Uint8Array<ArrayBufferLike> = new Uint8Array(16),\n): NativeForegroundWrite {\n const id = formatTransactionId(txId);\n let closed = false;\n return {\n txId: id,\n payload: new Uint8Array(),\n rowId: rowId.slice(),\n async wait(tier: string, observeOnly = false): Promise<void> {\n if (closed) throw new Error(\"write state is unavailable\");\n await db.waitForTransaction(txId, tier, observeOnly);\n },\n writeState: () => {\n if (closed) throw new Error(\"write state is unavailable\");\n return db.writeState(txId);\n },\n close: () => {\n if (closed) return false;\n closed = true;\n return true;\n },\n };\n}\n\nclass NativeForegroundSubscription {\n private closed = false;\n private pendingOperation: number | undefined;\n\n constructor(\n private readonly handle: number,\n private readonly db: NativeForegroundDb,\n ) {}\n\n readAll(): unknown[] | { retryAfterMs(): number } {\n if (this.closed) return [];\n // Native core publication already materializes the canonical event before\n // waking this owner. Keep this pull delivery-only: a foreground read must\n // never run a full relay tick while the JS mutation call is returning.\n const events = this.db.drain(this.handle, this.pendingOperation);\n if (!Array.isArray(events)) {\n this.pendingOperation = events.pendingOperation;\n return { retryAfterMs: () => 0 };\n }\n this.pendingOperation = undefined;\n // An empty batch is a ready native pull with no current event. Returning\n // it lets NativeRuntimeAdapter finish the reader so the next native wake\n // can restart it; a timer here recreates the old relay-polling latency.\n return events;\n }\n\n close(): boolean {\n if (this.closed) return false;\n this.closed = true;\n return this.db.unsubscribe(this.handle);\n }\n}\n\n/**\n * The error a failed foreground operation throws: the unchanged reason text as\n * the message, plus the stable core `code` when a core error caused it.\n */\nfunction foregroundOperationError(response: {\n reason: string;\n code?: string;\n reasonName?: string;\n}): Error {\n const error = new Error(response.reason);\n if (response.code !== undefined) Object.assign(error, { code: response.code });\n if (response.reasonName !== undefined) Object.assign(error, { reason: response.reasonName });\n return error;\n}\n\nfunction unsupported(operation: string): never {\n throw new Error(`${REACT_NATIVE_UNSUPPORTED_ERROR}; ${operation} is unavailable`);\n}\n\nfunction unexpected(operation: string, response: string): never {\n throw new Error(\n `React Native native foreground ${operation} returned unexpected ${response} response`,\n );\n}\n\nfunction formatTransactionId(bytes: Uint8Array<ArrayBufferLike>): string {\n if (bytes.byteLength !== 16)\n throw new Error(\"React Native native foreground returned malformed transaction id\");\n const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return hex;\n}\n\n/** Whether the native host refused a command it does not know. */\nfunction rejectsCommand(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return message.includes(\"runtime failed during execute\");\n}\n"]}
@@ -1,35 +1,30 @@
1
- import type { ReactNode } from "react";
2
- import { type JazzAppViewProps } from "../react-core/app.js";
3
- import type { JazzSession } from "../session/state.js";
4
- import { type JazzClientConfig } from "./create-jazz-session.js";
5
1
  import type { PublicSession } from "../runtime/context.js";
6
2
  import type { Db } from "../runtime/db.js";
7
3
  import { useSession } from "../react-core/provider.js";
8
- import { type JazzClient as CreatedJazzClient } from "./create-jazz-client.js";
9
- import type { OpenJazzClientConfig as DbConfig } from "./create-jazz-client.js";
4
+ import { type JazzSessionSourceProps, type JazzSessionViewProps } from "../react-core/session.js";
5
+ import type { SessionCore } from "../session/state.js";
6
+ import { type JazzClientConfig } from "./create-jazz-session.js";
7
+ import type { JazzClient as CreatedJazzClient } from "./create-jazz-client.js";
10
8
  export { JazzClientProvider, type JazzClientProviderProps } from "../react-core/provider.js";
11
9
  interface JazzClientContextValue {
12
10
  db: Db;
13
11
  session: PublicSession | null;
14
12
  shutdown: CreatedJazzClient["shutdown"];
15
13
  }
16
- export type LegacyJazzProviderProps = {
17
- config: DbConfig;
18
- fallback?: ReactNode;
19
- children: ReactNode;
20
- };
21
- export type JazzAppProviderProps = JazzClientConfig & JazzAppViewProps<CreatedJazzClient>;
22
- export type JazzProviderProps = LegacyJazzProviderProps | JazzAppProviderProps;
14
+ export type JazzProviderProps = JazzSessionSourceProps<JazzClientConfig, CreatedJazzClient> & JazzSessionViewProps<CreatedJazzClient>;
15
+ /**
16
+ * Jazz for a React Native app: owns a session (`config`) or shows yours
17
+ * (`session`), renders `children` with its client once someone is signed in,
18
+ * and `signedOut`, `loading` or `error` otherwise. Read the session anywhere
19
+ * below with `useJazzSession()`.
20
+ */
23
21
  export declare function JazzProvider(props: JazzProviderProps): import("react/jsx-runtime").JSX.Element;
24
22
  export declare function useJazzClient(): JazzClientContextValue;
25
23
  export declare function useDb(): Db;
26
24
  export { useSession };
27
25
  export type { JazzClientContextValue };
28
- /** The app shell shared by React Native and Expo, with native default loading and error views. */
29
- export declare function NativeJazzAppProvider<Config extends {
30
- initial?: unknown;
31
- }>({ config, createJazzClient, loading, error, ...view }: JazzAppViewProps<CreatedJazzClient> & {
32
- config: Config;
33
- createJazzClient: (config: Config) => Promise<JazzSession<CreatedJazzClient>>;
26
+ /** @internal The provider shared by React Native and Expo, with native default views. */
27
+ export declare function NativeJazzProvider<Config>(props: JazzSessionSourceProps<Config, CreatedJazzClient> & JazzSessionViewProps<CreatedJazzClient> & {
28
+ openCore: (config: Config) => Promise<SessionCore<CreatedJazzClient>>;
34
29
  }): import("react/jsx-runtime").JSX.Element;
35
30
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CA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AAiB,CAAC,GACtD,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC;CACvE,2CAkCJ"}
@@ -1,16 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { View, Text, Pressable } from "react-native";
3
- import { ConfiguredJazzAppProvider } from "../react-core/app.js";
4
- import { createJazzClient } from "./create-jazz-session.js";
5
- import { JazzProvider as CoreJazzProvider, useDb as useCoreDb, useJazzClient as useCoreJazzClient, useSession, } from "../react-core/provider.js";
6
- import { openJazzClient } from "./create-jazz-client.js";
7
- const createClient = (config) => openJazzClient(config);
3
+ import { useDb as useCoreDb, useJazzClient as useCoreJazzClient, useSession, } from "../react-core/provider.js";
4
+ import { JazzSessionProvider, } from "../react-core/session.js";
5
+ import { refuseRemovedProviderProps } from "../react/provider-props.js";
6
+ import { assertNoClassicProviderProps } from "../classic-api.js";
7
+ import { openNativeSessionCore } from "./create-jazz-session.js";
8
8
  export { JazzClientProvider } from "../react-core/provider.js";
9
+ /**
10
+ * Jazz for a React Native app: owns a session (`config`) or shows yours
11
+ * (`session`), renders `children` with its client once someone is signed in,
12
+ * and `signedOut`, `loading` or `error` otherwise. Read the session anywhere
13
+ * below with `useJazzSession()`.
14
+ */
9
15
  export function JazzProvider(props) {
10
- if (!("config" in props))
11
- return _jsx(ApplicationJazzProvider, { ...props });
12
- const { config, fallback, children } = props;
13
- return (_jsx(CoreJazzProvider, { config: config, fallback: fallback, openJazzClient: createClient, children: children }));
16
+ return _jsx(NativeJazzProvider, { ...props, openCore: openNativeSessionCore });
14
17
  }
15
18
  export function useJazzClient() {
16
19
  return useCoreJazzClient();
@@ -19,15 +22,13 @@ export function useDb() {
19
22
  return useCoreDb();
20
23
  }
21
24
  export { useSession };
22
- function ApplicationJazzProvider(props) {
23
- const { children, signedOut, loading, error, ...config } = props;
24
- const view = { children, signedOut, loading, error };
25
- return _jsx(NativeJazzAppProvider, { ...view, config: config, createJazzClient: createJazzClient });
26
- }
27
- /** The app shell shared by React Native and Expo, with native default loading and error views. */
28
- export function NativeJazzAppProvider({ config, createJazzClient, loading, error, ...view }) {
29
- return (_jsx(ConfiguredJazzAppProvider, { ...view, config: config, createJazzClient: createJazzClient, loading: loading === undefined ? (_jsx(View, { children: _jsx(Text, { children: "Loading\u2026" }) })) : (loading), error: error === undefined
30
- ? (state) => (_jsxs(View, { accessibilityRole: "alert", children: [_jsx(Text, { children: "We couldn\u2019t connect to your account. Please try again." }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void state.retry(), children: _jsx(Text, { children: "Try again" }) })] }))
25
+ /** @internal The provider shared by React Native and Expo, with native default views. */
26
+ export function NativeJazzProvider(props) {
27
+ assertNoClassicProviderProps("JazzProvider", props);
28
+ refuseRemovedProviderProps(props);
29
+ const { loading, error, ...rest } = props;
30
+ return (_jsx(JazzSessionProvider, { ...rest, loading: loading === undefined ? (_jsx(View, { children: _jsx(Text, { children: "Loading\u2026" }) })) : (loading), error: error === undefined
31
+ ? (state) => (_jsxs(View, { accessibilityRole: "alert", children: [_jsx(Text, { children: "Jazz couldn\u2019t start. Please try again." }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => void state.retry().catch(() => { }), children: _jsx(Text, { children: "Try again" }) })] }))
31
32
  : error }));
32
33
  }
33
34
  //# sourceMappingURL=provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAyB,MAAM,sBAAsB,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAyB,MAAM,0BAA0B,CAAC;AAGnF,OAAO,EACL,YAAY,IAAI,gBAAgB,EAChC,KAAK,IAAI,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P,KAAK,EACL,GAAG,IAAI,EAIR;IACC,OAAO,CACL,KAAC,yBAAyB,OACpB,IAAI,EACR,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EACL,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,cACH,KAAC,IAAI,gCAAgB,GAChB,CACR,CAAC,CAAC,CAAC,CACF,OAAO,CACR,EAEH,KAAK,EACH,KAAK,KAAK,SAAS;YACjB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,MAAC,IAAI,IAAC,iBAAiB,EAAC,OAAO,aAC7B,KAAC,IAAI,8EAA8D,EACnE,KAAC,SAAS,IAAC,iBAAiB,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,EAAE,YACrE,KAAC,IAAI,4BAAiB,GACZ,IACP,CACR;YACH,CAAC,CAAC,KAAK,GAEX,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { View, Text, Pressable } from \"react-native\";\nimport { ConfiguredJazzAppProvider, type JazzAppViewProps } from \"../react-core/app.js\";\nimport type { JazzSession } from \"../session/state.js\";\nimport { createJazzClient, type JazzClientConfig } from \"./create-jazz-session.js\";\nimport type { PublicSession } from \"../runtime/context.js\";\nimport type { Db } from \"../runtime/db.js\";\nimport {\n JazzProvider as CoreJazzProvider,\n useDb as useCoreDb,\n useJazzClient as useCoreJazzClient,\n useSession,\n type OpenJazzClient,\n} from \"../react-core/provider.js\";\nimport { openJazzClient, type JazzClient as CreatedJazzClient } from \"./create-jazz-client.js\";\nimport type { OpenJazzClientConfig as DbConfig } from \"./create-jazz-client.js\";\n\nconst createClient: OpenJazzClient = (config) =>\n openJazzClient(config as DbConfig) as Promise<CreatedJazzClient>;\n\nexport { JazzClientProvider, type JazzClientProviderProps } from \"../react-core/provider.js\";\n\ninterface JazzClientContextValue {\n db: Db;\n session: PublicSession | null;\n shutdown: CreatedJazzClient[\"shutdown\"];\n}\n\nexport type LegacyJazzProviderProps = {\n config: DbConfig;\n fallback?: ReactNode;\n children: ReactNode;\n};\n\nexport type JazzAppProviderProps = JazzClientConfig & JazzAppViewProps<CreatedJazzClient>;\nexport type JazzProviderProps = LegacyJazzProviderProps | JazzAppProviderProps;\n\nexport function JazzProvider(props: JazzProviderProps) {\n if (!(\"config\" in props)) return <ApplicationJazzProvider {...props} />;\n const { config, fallback, children } = props;\n return (\n <CoreJazzProvider config={config} fallback={fallback} openJazzClient={createClient}>\n {children}\n </CoreJazzProvider>\n );\n}\n\nexport function useJazzClient(): JazzClientContextValue {\n return useCoreJazzClient() as JazzClientContextValue;\n}\n\nexport function useDb(): Db {\n return useCoreDb<Db>();\n}\n\nexport { useSession };\nexport type { JazzClientContextValue };\n\nfunction ApplicationJazzProvider(props: JazzAppProviderProps) {\n const { children, signedOut, loading, error, ...config } = props;\n const view = { children, signedOut, loading, error };\n return <NativeJazzAppProvider {...view} config={config} createJazzClient={createJazzClient} />;\n}\n\n/** The app shell shared by React Native and Expo, with native default loading and error views. */\nexport function NativeJazzAppProvider<Config extends { initial?: unknown }>({\n config,\n createJazzClient,\n loading,\n error,\n ...view\n}: JazzAppViewProps<CreatedJazzClient> & {\n config: Config;\n createJazzClient: (config: Config) => Promise<JazzSession<CreatedJazzClient>>;\n}) {\n return (\n <ConfiguredJazzAppProvider\n {...view}\n config={config}\n createJazzClient={createJazzClient}\n loading={\n loading === undefined ? (\n <View>\n <Text>Loading…</Text>\n </View>\n ) : (\n loading\n )\n }\n error={\n error === undefined\n ? (state) => (\n <View accessibilityRole=\"alert\">\n <Text>We couldn’t connect to your account. Please try again.</Text>\n <Pressable accessibilityRole=\"button\" onPress={() => void state.retry()}>\n <Text>Try again</Text>\n </Pressable>\n </View>\n )\n : error\n }\n />\n );\n}\n"]}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/react-native/provider.tsx"],"names":[],"mappings":";AAAA,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AAC,CACT,MAAC,IAAI,IAAC,iBAAiB,EAAC,OAAO,aAC7B,KAAC,IAAI,8DAA8C,EACnD,KAAC,SAAS,IACR,iBAAiB,EAAC,QAAQ,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,YAEjD,KAAC,IAAI,4BAAiB,GACZ,IACP,CACR;YACH,CAAC,CAAC,KAAK,GAEX,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { View, Text, Pressable } from \"react-native\";\nimport type { PublicSession } from \"../runtime/context.js\";\nimport type { Db } from \"../runtime/db.js\";\nimport {\n useDb as useCoreDb,\n useJazzClient as useCoreJazzClient,\n useSession,\n} from \"../react-core/provider.js\";\nimport {\n JazzSessionProvider,\n type JazzSessionSourceProps,\n type JazzSessionViewProps,\n} from \"../react-core/session.js\";\nimport type { SessionCore } from \"../session/state.js\";\nimport { refuseRemovedProviderProps } from \"../react/provider-props.js\";\nimport { assertNoClassicProviderProps } from \"../classic-api.js\";\nimport { openNativeSessionCore, type JazzClientConfig } from \"./create-jazz-session.js\";\nimport type { JazzClient as CreatedJazzClient } from \"./create-jazz-client.js\";\n\nexport { JazzClientProvider, type JazzClientProviderProps } from \"../react-core/provider.js\";\n\ninterface JazzClientContextValue {\n db: Db;\n session: PublicSession | null;\n shutdown: CreatedJazzClient[\"shutdown\"];\n}\n\nexport type JazzProviderProps = JazzSessionSourceProps<JazzClientConfig, CreatedJazzClient> &\n JazzSessionViewProps<CreatedJazzClient>;\n\n/**\n * Jazz for a React Native app: owns a session (`config`) or shows yours\n * (`session`), renders `children` with its client once someone is signed in,\n * and `signedOut`, `loading` or `error` otherwise. Read the session anywhere\n * below with `useJazzSession()`.\n */\nexport function JazzProvider(props: JazzProviderProps) {\n return <NativeJazzProvider {...props} openCore={openNativeSessionCore} />;\n}\n\nexport function useJazzClient(): JazzClientContextValue {\n return useCoreJazzClient() as JazzClientContextValue;\n}\n\nexport function useDb(): Db {\n return useCoreDb<Db>();\n}\n\nexport { useSession };\nexport type { JazzClientContextValue };\n\n/** @internal The provider shared by React Native and Expo, with native default views. */\nexport function NativeJazzProvider<Config>(\n props: JazzSessionSourceProps<Config, CreatedJazzClient> &\n JazzSessionViewProps<CreatedJazzClient> & {\n openCore: (config: Config) => Promise<SessionCore<CreatedJazzClient>>;\n },\n) {\n assertNoClassicProviderProps(\"JazzProvider\", props);\n refuseRemovedProviderProps(props);\n const { loading, error, ...rest } = props;\n return (\n <JazzSessionProvider\n {...rest}\n loading={\n loading === undefined ? (\n <View>\n <Text>Loading…</Text>\n </View>\n ) : (\n loading\n )\n }\n error={\n error === undefined\n ? (state) => (\n <View accessibilityRole=\"alert\">\n <Text>Jazz couldn’t start. Please try again.</Text>\n <Pressable\n accessibilityRole=\"button\"\n onPress={() => void state.retry().catch(() => {})}\n >\n <Text>Try again</Text>\n </Pressable>\n </View>\n )\n : error\n }\n />\n );\n}\n"]}
@@ -35,6 +35,28 @@ export declare class ReactNativeRuntimeSource extends RuntimeSource<ReactNativeD
35
35
  admitConfig(config: ReactNativeDbConfig): void;
36
36
  createClient(context: RuntimeClientContext<ReactNativeDbConfig>): JazzClient;
37
37
  shutdown(): Promise<void>;
38
+ /**
39
+ * Reconnect the upstream of a scope this source admitted. A worker whose
40
+ * credential the sync server refused is handed the app's bearer first: it
41
+ * would only be refused again with the one it has. Any other reconnect goes
42
+ * straight through, without waiting on the app.
43
+ */
44
+ private reconnectOwnedUpstream;
45
+ /**
46
+ * Whether the worker's credential was refused. Without a foreground to ask
47
+ * (no client opened yet) it may have been.
48
+ */
49
+ private credentialMayBeRefused;
50
+ /**
51
+ * A user signed in through the app's backend syncs with the app's bearer,
52
+ * which the native socket worker was handed when the account was admitted.
53
+ * Once it expires the sync server refuses it, and a reconnect with the same
54
+ * one is refused again: so a reconnect (the one `followUser` asks for after
55
+ * a refusal, or the app's own) asks the app for its bearer again first, and
56
+ * a different one replaces the worker's. The app's bearer failing leaves the
57
+ * worker's as it was: the reconnect still happens.
58
+ */
59
+ private presentCurrentBearer;
38
60
  refreshAccountToken(token: string): boolean;
39
61
  }
40
62
  //# sourceMappingURL=runtime-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-source.d.ts","sourceRoot":"","sources":["../../src/react-native/runtime-source.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAUvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA0BjD;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG;IAC3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;CACtC,CAAC;AAMF,qBAAa,wBAAyB,SAAQ,aAAa,CAAC,mBAAmB,CAAC;IAC9E,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,kBAAkB,CAA2B;IACrD,OAAO,CAAC,gBAAgB,CAAuC;IAC/D,OAAO,CAAC,iBAAiB,CAAwC;IACjE,OAAO,CAAC,mBAAmB,CAAmC;IAC9D,OAAO,CAAC,iBAAiB,CAA2B;IACpD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,iBAAiB,CAAS;IAEzB,WAAW,IAAI,WAAW;IAcpB,IAAI,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgHtD,uBAAuB,IAAI,KAAK;IAMhC,WAA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