@seedprotocol/sdk 0.7.8 → 0.7.9-next.1177.ga3e08ed

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 (419) hide show
  1. package/README.md +1 -1
  2. package/dist/{ClientManager-B1r_8P5Z.js → ClientManager-GZfXErDX.js} +187 -1451
  3. package/dist/ClientManager-GZfXErDX.js.map +1 -0
  4. package/dist/{Item-CjTEShfk.js → Item-0oDoTPhi.js} +175 -238
  5. package/dist/Item-0oDoTPhi.js.map +1 -0
  6. package/dist/{ModelProperty-C3749Wjq.js → ModelProperty-i5flwzQG.js} +41 -40
  7. package/dist/ModelProperty-i5flwzQG.js.map +1 -0
  8. package/dist/{Schema-CX9CTtho.js → Schema-PFZwG9Nl.js} +88 -1623
  9. package/dist/Schema-PFZwG9Nl.js.map +1 -0
  10. package/dist/{SchemaValidationService-T5mqnY8q.js → SchemaValidationService-DnGKel4V.js} +7 -6
  11. package/dist/{SchemaValidationService-T5mqnY8q.js.map → SchemaValidationService-DnGKel4V.js.map} +1 -1
  12. package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js → backfillMetadataPropertyIds-BbxgavEQ.js} +4 -4
  13. package/dist/{backfillMetadataPropertyIds-DWWkh-Ex.js.map → backfillMetadataPropertyIds-BbxgavEQ.js.map} +1 -1
  14. package/dist/{changeFeed-DcsZ7deG.js → changeFeed-DKdVlUmt.js} +8 -7
  15. package/dist/changeFeed-DKdVlUmt.js.map +1 -0
  16. package/dist/configurePlatform-CrMafpMW.js +29 -0
  17. package/dist/configurePlatform-CrMafpMW.js.map +1 -0
  18. package/dist/db/drizzle/0024_merge_republished_ghost_seeds.sql +29 -0
  19. package/dist/db/drizzle/meta/0024_snapshot.json +1645 -0
  20. package/dist/db/drizzle/meta/_journal.json +7 -0
  21. package/dist/{detachRowsBeforeDelete-Bo_pky-R.js → detachRowsBeforeDelete-DXFYSHRR.js} +2 -3
  22. package/dist/{detachRowsBeforeDelete-Bo_pky-R.js.map → detachRowsBeforeDelete-DXFYSHRR.js.map} +1 -1
  23. package/dist/dist/{ClientManager-B1r_8P5Z.d.ts → ClientManager-GZfXErDX.d.ts} +323 -406
  24. package/dist/dist/ClientManager-GZfXErDX.d.ts.map +1 -0
  25. package/dist/dist/{Item-CjTEShfk.d.ts → Item-0oDoTPhi.d.ts} +85 -91
  26. package/dist/dist/Item-0oDoTPhi.d.ts.map +1 -0
  27. package/dist/dist/{ModelProperty-C3749Wjq.d.ts → ModelProperty-i5flwzQG.d.ts} +1 -1
  28. package/dist/dist/{ModelProperty-C3749Wjq.d.ts.map → ModelProperty-i5flwzQG.d.ts.map} +1 -1
  29. package/dist/dist/{Schema-CX9CTtho.d.ts → Schema-PFZwG9Nl.d.ts} +7 -183
  30. package/dist/dist/Schema-PFZwG9Nl.d.ts.map +1 -0
  31. package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts → SchemaValidationService-DnGKel4V.d.ts} +1 -1
  32. package/dist/dist/{SchemaValidationService-T5mqnY8q.d.ts.map → SchemaValidationService-DnGKel4V.d.ts.map} +1 -1
  33. package/dist/dist/{backfillMetadataPropertyIds-DWWkh-Ex.d.ts → backfillMetadataPropertyIds-BbxgavEQ.d.ts} +1 -1
  34. package/dist/dist/backfillMetadataPropertyIds-BbxgavEQ.d.ts.map +1 -0
  35. package/dist/dist/{changeFeed-DcsZ7deG.d.ts → changeFeed-DKdVlUmt.d.ts} +17 -20
  36. package/dist/dist/changeFeed-DKdVlUmt.d.ts.map +1 -0
  37. package/dist/dist/configurePlatform-CrMafpMW.d.ts +5 -0
  38. package/dist/dist/configurePlatform-CrMafpMW.d.ts.map +1 -0
  39. package/dist/dist/{detachRowsBeforeDelete-Bo_pky-R.d.ts → detachRowsBeforeDelete-DXFYSHRR.d.ts} +1 -1
  40. package/dist/dist/detachRowsBeforeDelete-DXFYSHRR.d.ts.map +1 -0
  41. package/dist/dist/{eas--9vtNkma.d.ts → eas-dyepi5jz.d.ts} +1 -1
  42. package/dist/dist/eas-dyepi5jz.d.ts.map +1 -0
  43. package/dist/dist/{errors-Do7v6RKu.d.ts → errors-C1qUEZ7A.d.ts} +5 -2
  44. package/dist/dist/errors-C1qUEZ7A.d.ts.map +1 -0
  45. package/dist/dist/{errors-rIWK7gwJ.d.ts → errors-D1zHAqjr.d.ts} +1 -1
  46. package/dist/dist/{errors-rIWK7gwJ.d.ts.map → errors-D1zHAqjr.d.ts.map} +1 -1
  47. package/dist/dist/eventBus-7vxTCc3a.d.ts +18 -0
  48. package/dist/dist/eventBus-7vxTCc3a.d.ts.map +1 -0
  49. package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts +13 -0
  50. package/dist/dist/findSeedRowsByUid-CT3sOXXw.d.ts.map +1 -0
  51. package/dist/dist/{getItem-5j22EWWE.d.ts → getItem-Bhjecbia.d.ts} +1 -1
  52. package/dist/dist/getItem-Bhjecbia.d.ts.map +1 -0
  53. package/dist/dist/{getPublishPayload-BGl2SaGK.d.ts → getPublishPayload-DH4rMqXG.d.ts} +1 -1
  54. package/dist/dist/getPublishPayload-DH4rMqXG.d.ts.map +1 -0
  55. package/dist/dist/{getPublishUploads-DVsDx6Xf.d.ts → getPublishUploads-BzUIDA2G.d.ts} +5 -5
  56. package/dist/dist/getPublishUploads-BzUIDA2G.d.ts.map +1 -0
  57. package/dist/dist/index-CkYb3wcU.d.ts +14 -0
  58. package/dist/dist/index-CkYb3wcU.d.ts.map +1 -0
  59. package/dist/dist/{index-Dp4uyZYx.d.ts → index-DJmWkVIK.d.ts} +5 -5
  60. package/dist/dist/index-DJmWkVIK.d.ts.map +1 -0
  61. package/dist/dist/{index-C0SetTd1.d.ts → index-Dx_GTdyQ.d.ts} +1457 -1513
  62. package/dist/dist/index-Dx_GTdyQ.d.ts.map +1 -0
  63. package/dist/dist/{index-CZQrNqvq.d.ts → index-PbnKw2es.d.ts} +1 -1
  64. package/dist/dist/{index-CZQrNqvq.d.ts.map → index-PbnKw2es.d.ts.map} +1 -1
  65. package/dist/dist/{index.browser-Ll71Y_Dl.d.ts → index.browser-i9uPJice.d.ts} +13 -40
  66. package/dist/dist/{index.browser-Ll71Y_Dl.d.ts.map → index.browser-i9uPJice.d.ts.map} +1 -1
  67. package/dist/dist/{index.node-CgltN0cC.d.ts → index.node-CzMwMr_d.d.ts} +2 -45
  68. package/dist/dist/{index.node-CgltN0cC.d.ts.map → index.node-CzMwMr_d.d.ts.map} +1 -1
  69. package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts +9 -0
  70. package/dist/dist/minimumUpgradeVersion-BDhHvHtr.d.ts.map +1 -0
  71. package/dist/dist/{modelPropertyRecordSchemas-C_lYTzMr.d.ts → modelPropertyRecordSchemas-C5lW9aA-.d.ts} +1 -1
  72. package/dist/dist/modelPropertyRecordSchemas-C5lW9aA-.d.ts.map +1 -0
  73. package/dist/dist/platform.browser.d.ts +2 -2
  74. package/dist/dist/platform.node.d.ts +2 -2
  75. package/dist/dist/{property-pcDxNEpy.d.ts → property-BwYtg5Q_.d.ts} +3 -3
  76. package/dist/dist/property-BwYtg5Q_.d.ts.map +1 -0
  77. package/dist/dist/{propertyValidationRules-BEjN0f3-.d.ts → propertyValidationRules-CyHdpcPP.d.ts} +1 -1
  78. package/dist/dist/propertyValidationRules-CyHdpcPP.d.ts.map +1 -0
  79. package/dist/dist/{publishDraftGraph-I5yKe1Xz.d.ts → publishDraftGraph-C5F6b7GK.d.ts} +23 -6
  80. package/dist/dist/publishDraftGraph-C5F6b7GK.d.ts.map +1 -0
  81. package/dist/dist/{resolveModelForSyncedSeed-C5KXn6ex.d.ts → resolveModelForSyncedSeed-4gO9Hfn2.d.ts} +1 -1
  82. package/dist/dist/resolveModelForSyncedSeed-4gO9Hfn2.d.ts.map +1 -0
  83. package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts +13 -0
  84. package/dist/dist/syncDbWithEas-DUu_wjUG.d.ts.map +1 -0
  85. package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts → tolerantWebAccess-DecKDGen.d.ts} +1 -1
  86. package/dist/dist/{tolerantWebAccess-CIpS7RLk.d.ts.map → tolerantWebAccess-DecKDGen.d.ts.map} +1 -1
  87. package/dist/dist/{updateSeedRevokedAt-CR4zwn-6.d.ts → updateSeedRevokedAt-CP606vKs.d.ts} +1 -1
  88. package/dist/dist/updateSeedRevokedAt-CP606vKs.d.ts.map +1 -0
  89. package/dist/{eas--9vtNkma.js → eas-dyepi5jz.js} +3 -4
  90. package/dist/eas-dyepi5jz.js.map +1 -0
  91. package/dist/{errors-Do7v6RKu.js → errors-C1qUEZ7A.js} +12 -6
  92. package/dist/errors-C1qUEZ7A.js.map +1 -0
  93. package/dist/{errors-rIWK7gwJ.js → errors-D1zHAqjr.js} +46 -98
  94. package/dist/errors-D1zHAqjr.js.map +1 -0
  95. package/dist/eventBus-7vxTCc3a.js +64 -0
  96. package/dist/eventBus-7vxTCc3a.js.map +1 -0
  97. package/dist/findSeedRowsByUid-CT3sOXXw.js +47 -0
  98. package/dist/findSeedRowsByUid-CT3sOXXw.js.map +1 -0
  99. package/dist/{getItem-5j22EWWE.js → getItem-Bhjecbia.js} +5 -5
  100. package/dist/{getItem-5j22EWWE.js.map → getItem-Bhjecbia.js.map} +1 -1
  101. package/dist/{getPublishPayload-BGl2SaGK.js → getPublishPayload-DH4rMqXG.js} +27 -27
  102. package/dist/getPublishPayload-DH4rMqXG.js.map +1 -0
  103. package/dist/{getPublishUploads-DVsDx6Xf.js → getPublishUploads-BzUIDA2G.js} +64 -95
  104. package/dist/getPublishUploads-BzUIDA2G.js.map +1 -0
  105. package/dist/{index-CJK3F_MK.js → index-CkYb3wcU.js} +9 -8
  106. package/dist/index-CkYb3wcU.js.map +1 -0
  107. package/dist/{index-Dp4uyZYx.js → index-DJmWkVIK.js} +9 -8
  108. package/dist/index-DJmWkVIK.js.map +1 -0
  109. package/dist/{index-C0SetTd1.js → index-Dx_GTdyQ.js} +27 -463
  110. package/dist/index-Dx_GTdyQ.js.map +1 -0
  111. package/dist/{index-CZQrNqvq.js → index-PbnKw2es.js} +2 -2
  112. package/dist/index-PbnKw2es.js.map +1 -0
  113. package/dist/{index.browser-Ll71Y_Dl.js → index.browser-i9uPJice.js} +239 -179
  114. package/dist/index.browser-i9uPJice.js.map +1 -0
  115. package/dist/{index.node-CgltN0cC.js → index.node-CzMwMr_d.js} +51 -216
  116. package/dist/index.node-CzMwMr_d.js.map +1 -0
  117. package/dist/main.js +165 -241
  118. package/dist/main.js.map +1 -1
  119. package/dist/minimumUpgradeVersion-BDhHvHtr.js +81 -0
  120. package/dist/minimumUpgradeVersion-BDhHvHtr.js.map +1 -0
  121. package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js → modelPropertyRecordSchemas-C5lW9aA-.js} +5 -5
  122. package/dist/{modelPropertyRecordSchemas-C_lYTzMr.js.map → modelPropertyRecordSchemas-C5lW9aA-.js.map} +1 -1
  123. package/dist/node.js +14 -221
  124. package/dist/node.js.map +1 -1
  125. package/dist/platform.browser.js +8 -7
  126. package/dist/platform.browser.js.map +1 -1
  127. package/dist/platform.node.js +7 -7
  128. package/dist/{property-pcDxNEpy.js → property-BwYtg5Q_.js} +8 -9
  129. package/dist/property-BwYtg5Q_.js.map +1 -0
  130. package/dist/{propertyValidationRules-BEjN0f3-.js → propertyValidationRules-CyHdpcPP.js} +10 -10
  131. package/dist/{propertyValidationRules-BEjN0f3-.js.map → propertyValidationRules-CyHdpcPP.js.map} +1 -1
  132. package/dist/{publishDraftGraph-I5yKe1Xz.js → publishDraftGraph-C5F6b7GK.js} +104 -35
  133. package/dist/publishDraftGraph-C5F6b7GK.js.map +1 -0
  134. package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js → resolveModelForSyncedSeed-4gO9Hfn2.js} +3 -2
  135. package/dist/{resolveModelForSyncedSeed-C5KXn6ex.js.map → resolveModelForSyncedSeed-4gO9Hfn2.js.map} +1 -1
  136. package/dist/seedSchema/PendingWriteSchema.ts +3 -2
  137. package/dist/src/Item/Item.d.ts +1 -0
  138. package/dist/src/Item/Item.d.ts.map +1 -1
  139. package/dist/src/Item/service/actors/runPublish.d.ts.map +1 -1
  140. package/dist/src/ItemProperty/ItemProperty.d.ts +2 -2
  141. package/dist/src/ItemProperty/ItemProperty.d.ts.map +1 -1
  142. package/dist/src/ItemProperty/service/propertyMachine.d.ts +1 -1
  143. package/dist/src/ItemProperty/service/propertyMachine.d.ts.map +1 -1
  144. package/dist/src/Model/Model.d.ts.map +1 -1
  145. package/dist/src/Model/service/modelMachine.d.ts +0 -20
  146. package/dist/src/Model/service/modelMachine.d.ts.map +1 -1
  147. package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +0 -20
  148. package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts.map +1 -1
  149. package/dist/src/Schema/service/schemaMachine.d.ts +1 -107
  150. package/dist/src/Schema/service/schemaMachine.d.ts.map +1 -1
  151. package/dist/src/Schema/validation.d.ts +0 -1
  152. package/dist/src/Schema/validation.d.ts.map +1 -1
  153. package/dist/src/browser/db/Db.d.ts +8 -3
  154. package/dist/src/browser/db/Db.d.ts.map +1 -1
  155. package/dist/src/browser/db/createSqlocalDrizzle.d.ts +20 -2
  156. package/dist/src/browser/db/createSqlocalDrizzle.d.ts.map +1 -1
  157. package/dist/src/browser/db/drizzleFiles.d.ts +3 -2
  158. package/dist/src/browser/db/drizzleFiles.d.ts.map +1 -1
  159. package/dist/src/browser/workers/FileDownloader.d.ts +1 -1
  160. package/dist/src/browser/workers/FileDownloader.d.ts.map +1 -1
  161. package/dist/src/browser/workers/filesDownload.d.ts.map +1 -1
  162. package/dist/src/client/actors/fileSystemInit.d.ts.map +1 -1
  163. package/dist/src/client/actors/platformClassesInit.d.ts +1 -1
  164. package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
  165. package/dist/src/client/actors/processSchemaFiles.d.ts.map +1 -1
  166. package/dist/src/client/clientManagerMachine.d.ts.map +1 -1
  167. package/dist/src/client/constants.d.ts +0 -51
  168. package/dist/src/client/constants.d.ts.map +1 -1
  169. package/dist/src/db/minimumUpgradeVersion.d.ts +33 -0
  170. package/dist/src/db/minimumUpgradeVersion.d.ts.map +1 -0
  171. package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts +2 -1
  172. package/dist/src/db/read/batchLatestPublishedVersionBySeedLocalIds.d.ts.map +1 -1
  173. package/dist/src/db/read/findSeedRowsByUid.d.ts +13 -0
  174. package/dist/src/db/read/findSeedRowsByUid.d.ts.map +1 -0
  175. package/dist/src/db/read/getItemData.d.ts.map +1 -1
  176. package/dist/src/db/read/getLatestPublishedVersionRow.d.ts +2 -1
  177. package/dist/src/db/read/getLatestPublishedVersionRow.d.ts.map +1 -1
  178. package/dist/src/db/read/getLatestVersionRow.d.ts +1 -1
  179. package/dist/src/db/read/getLatestVersionRow.d.ts.map +1 -1
  180. package/dist/src/db/read/getPublishPayload.d.ts +4 -0
  181. package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
  182. package/dist/src/db/read/getPublishUploads.d.ts +1 -3
  183. package/dist/src/db/read/getPublishUploads.d.ts.map +1 -1
  184. package/dist/src/db/read/getRelatedItemsForPublish.d.ts +2 -0
  185. package/dist/src/db/read/getRelatedItemsForPublish.d.ts.map +1 -1
  186. package/dist/src/db/read/itemLoads.d.ts +20 -0
  187. package/dist/src/db/read/itemLoads.d.ts.map +1 -0
  188. package/dist/src/db/read/publishDraftGraph.d.ts +7 -0
  189. package/dist/src/db/read/publishDraftGraph.d.ts.map +1 -1
  190. package/dist/src/db/read/resolveRelatedSeedRef.d.ts +4 -4
  191. package/dist/src/db/read/resolveRelatedSeedRef.d.ts.map +1 -1
  192. package/dist/src/db/read/subqueries/latestVersion.d.ts +14 -0
  193. package/dist/src/db/read/subqueries/latestVersion.d.ts.map +1 -0
  194. package/dist/src/db/read/subqueries/versionData.d.ts +2 -2
  195. package/dist/src/db/read/subqueries/versionData.d.ts.map +1 -1
  196. package/dist/src/db/read/summarizePublishWork.d.ts.map +1 -1
  197. package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts +6 -0
  198. package/dist/src/db/write/applyPropertyAttestationUidsFromPublish.d.ts.map +1 -1
  199. package/dist/src/db/write/easSyncProcess.d.ts +1 -1
  200. package/dist/src/db/write/easSyncProcess.d.ts.map +1 -1
  201. package/dist/src/db/write/updateVersionUid.d.ts +2 -2
  202. package/dist/src/db/write/updateVersionUid.d.ts.map +1 -1
  203. package/dist/src/events/files/download.d.ts +1 -10
  204. package/dist/src/events/files/download.d.ts.map +1 -1
  205. package/dist/src/events/item/easSyncManager.d.ts +0 -1
  206. package/dist/src/events/item/easSyncManager.d.ts.map +1 -1
  207. package/dist/src/events/item/index.d.ts.map +1 -1
  208. package/dist/src/events/item/syncDbWithEas.d.ts +0 -10
  209. package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
  210. package/dist/src/helpers/FileManager/BaseFileManager.d.ts +1 -1
  211. package/dist/src/helpers/FileManager/BaseFileManager.d.ts.map +1 -1
  212. package/dist/src/helpers/FileManager/IFileManager.d.ts +7 -0
  213. package/dist/src/helpers/FileManager/IFileManager.d.ts.map +1 -1
  214. package/dist/src/helpers/FileManager/errors.d.ts +4 -1
  215. package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
  216. package/dist/src/helpers/arweaveContentTags.d.ts +1 -2
  217. package/dist/src/helpers/arweaveContentTags.d.ts.map +1 -1
  218. package/dist/src/helpers/constants.d.ts +3 -12
  219. package/dist/src/helpers/constants.d.ts.map +1 -1
  220. package/dist/src/helpers/db.d.ts +3 -28
  221. package/dist/src/helpers/db.d.ts.map +1 -1
  222. package/dist/src/helpers/ethereumUtils.d.ts +0 -2
  223. package/dist/src/helpers/ethereumUtils.d.ts.map +1 -1
  224. package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts +2 -1
  225. package/dist/src/helpers/htmlEmbeddedDataUriPublish.d.ts.map +1 -1
  226. package/dist/src/helpers/index.d.ts +0 -7
  227. package/dist/src/helpers/index.d.ts.map +1 -1
  228. package/dist/src/helpers/itemStorageFile.d.ts +2 -2
  229. package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +2 -1
  230. package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +1 -1
  231. package/dist/src/helpers/schema.d.ts +0 -73
  232. package/dist/src/helpers/schema.d.ts.map +1 -1
  233. package/dist/src/helpers/updateSchema.d.ts +0 -46
  234. package/dist/src/helpers/updateSchema.d.ts.map +1 -1
  235. package/dist/src/imports/index.d.ts +0 -1
  236. package/dist/src/imports/index.d.ts.map +1 -1
  237. package/dist/src/imports/json.d.ts +2 -1
  238. package/dist/src/imports/json.d.ts.map +1 -1
  239. package/dist/src/index.d.ts +4 -6
  240. package/dist/src/index.d.ts.map +1 -1
  241. package/dist/src/node/db/Db.d.ts.map +1 -1
  242. package/dist/src/node/helpers/dotSeedDir.d.ts +7 -0
  243. package/dist/src/node/helpers/dotSeedDir.d.ts.map +1 -0
  244. package/dist/src/node/index.d.ts +0 -5
  245. package/dist/src/node/index.d.ts.map +1 -1
  246. package/dist/src/outbox/index.d.ts +1 -1
  247. package/dist/src/outbox/index.d.ts.map +1 -1
  248. package/dist/src/outbox/itemAppliers.d.ts.map +1 -1
  249. package/dist/src/outbox/outbox.d.ts +3 -19
  250. package/dist/src/outbox/outbox.d.ts.map +1 -1
  251. package/dist/src/platform/configurePlatform.d.ts.map +1 -1
  252. package/dist/src/platform/index.browser.d.ts.map +1 -1
  253. package/dist/src/platform/index.node.d.ts.map +1 -1
  254. package/dist/src/platform/types.d.ts +0 -2
  255. package/dist/src/platform/types.d.ts.map +1 -1
  256. package/dist/src/query/createLocalQueryDataSource.d.ts.map +1 -1
  257. package/dist/src/seedSchema/PendingWriteSchema.d.ts.map +1 -1
  258. package/dist/src/services/write/actors/validateEntity.d.ts +1 -1
  259. package/dist/src/services/write/actors/validateEntity.d.ts.map +1 -1
  260. package/dist/src/services/write/actors/writeToDatabase.d.ts.map +1 -1
  261. package/dist/src/services/write/writeProcessMachine.d.ts +1 -23
  262. package/dist/src/services/write/writeProcessMachine.d.ts.map +1 -1
  263. package/dist/src/stores/eas.d.ts +0 -1
  264. package/dist/src/stores/eas.d.ts.map +1 -1
  265. package/dist/src/types/index.d.ts +1 -18
  266. package/dist/src/types/index.d.ts.map +1 -1
  267. package/dist/src/types/machines.d.ts +1 -32
  268. package/dist/src/types/machines.d.ts.map +1 -1
  269. package/dist/{syncDbWithEas-b4fESZ7C.js → syncDbWithEas-DUu_wjUG.js} +37 -105
  270. package/dist/syncDbWithEas-DUu_wjUG.js.map +1 -0
  271. package/dist/{tolerantWebAccess-CIpS7RLk.js → tolerantWebAccess-DecKDGen.js} +9 -8
  272. package/dist/{tolerantWebAccess-CIpS7RLk.js.map → tolerantWebAccess-DecKDGen.js.map} +1 -1
  273. package/dist/{updateSeedRevokedAt-CR4zwn-6.js → updateSeedRevokedAt-CP606vKs.js} +3 -3
  274. package/dist/{updateSeedRevokedAt-CR4zwn-6.js.map → updateSeedRevokedAt-CP606vKs.js.map} +1 -1
  275. package/package.json +6 -8
  276. package/dist/ClientManager-B1r_8P5Z.js.map +0 -1
  277. package/dist/Item-CjTEShfk.js.map +0 -1
  278. package/dist/ModelProperty-C3749Wjq.js.map +0 -1
  279. package/dist/Schema-CX9CTtho.js.map +0 -1
  280. package/dist/changeFeed-DcsZ7deG.js.map +0 -1
  281. package/dist/configurePlatform-AWild9o4.js +0 -81
  282. package/dist/configurePlatform-AWild9o4.js.map +0 -1
  283. package/dist/dist/ClientManager-B1r_8P5Z.d.ts.map +0 -1
  284. package/dist/dist/Item-CjTEShfk.d.ts.map +0 -1
  285. package/dist/dist/Schema-CX9CTtho.d.ts.map +0 -1
  286. package/dist/dist/backfillMetadataPropertyIds-DWWkh-Ex.d.ts.map +0 -1
  287. package/dist/dist/changeFeed-DcsZ7deG.d.ts.map +0 -1
  288. package/dist/dist/configurePlatform-AWild9o4.d.ts +0 -30
  289. package/dist/dist/configurePlatform-AWild9o4.d.ts.map +0 -1
  290. package/dist/dist/detachRowsBeforeDelete-Bo_pky-R.d.ts.map +0 -1
  291. package/dist/dist/eas--9vtNkma.d.ts.map +0 -1
  292. package/dist/dist/errors-Do7v6RKu.d.ts.map +0 -1
  293. package/dist/dist/getItem-5j22EWWE.d.ts.map +0 -1
  294. package/dist/dist/getPublishPayload-BGl2SaGK.d.ts.map +0 -1
  295. package/dist/dist/getPublishUploads-DVsDx6Xf.d.ts.map +0 -1
  296. package/dist/dist/index-C0SetTd1.d.ts.map +0 -1
  297. package/dist/dist/index-CJK3F_MK.d.ts +0 -14
  298. package/dist/dist/index-CJK3F_MK.d.ts.map +0 -1
  299. package/dist/dist/index-Dp4uyZYx.d.ts.map +0 -1
  300. package/dist/dist/modelPropertyRecordSchemas-C_lYTzMr.d.ts.map +0 -1
  301. package/dist/dist/property-pcDxNEpy.d.ts.map +0 -1
  302. package/dist/dist/propertyValidationRules-BEjN0f3-.d.ts.map +0 -1
  303. package/dist/dist/publishDraftGraph-I5yKe1Xz.d.ts.map +0 -1
  304. package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts +0 -17
  305. package/dist/dist/resetAmbiguousLegacyItemData-0Tin9-JK.d.ts.map +0 -1
  306. package/dist/dist/resolveModelForSyncedSeed-C5KXn6ex.d.ts.map +0 -1
  307. package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts +0 -22
  308. package/dist/dist/syncDbWithEas-b4fESZ7C.d.ts.map +0 -1
  309. package/dist/dist/updateSeedRevokedAt-CR4zwn-6.d.ts.map +0 -1
  310. package/dist/eas--9vtNkma.js.map +0 -1
  311. package/dist/errors-Do7v6RKu.js.map +0 -1
  312. package/dist/errors-rIWK7gwJ.js.map +0 -1
  313. package/dist/getPublishPayload-BGl2SaGK.js.map +0 -1
  314. package/dist/getPublishUploads-DVsDx6Xf.js.map +0 -1
  315. package/dist/index-C0SetTd1.js.map +0 -1
  316. package/dist/index-CJK3F_MK.js.map +0 -1
  317. package/dist/index-CZQrNqvq.js.map +0 -1
  318. package/dist/index-Dp4uyZYx.js.map +0 -1
  319. package/dist/index.browser-Ll71Y_Dl.js.map +0 -1
  320. package/dist/index.node-CgltN0cC.js.map +0 -1
  321. package/dist/property-pcDxNEpy.js.map +0 -1
  322. package/dist/publishDraftGraph-I5yKe1Xz.js.map +0 -1
  323. package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js +0 -98
  324. package/dist/resetAmbiguousLegacyItemData-0Tin9-JK.js.map +0 -1
  325. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts +0 -5
  326. package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +0 -1
  327. package/dist/src/browser/db/sqlWasmClient.d.ts +0 -1
  328. package/dist/src/browser/db/sqlWasmClient.d.ts.map +0 -1
  329. package/dist/src/browser/helpers/PathResolver.d.ts +0 -41
  330. package/dist/src/browser/helpers/PathResolver.d.ts.map +0 -1
  331. package/dist/src/browser/index.d.ts +0 -3
  332. package/dist/src/browser/index.d.ts.map +0 -1
  333. package/dist/src/browser/seed.d.ts +0 -21
  334. package/dist/src/browser/seed.d.ts.map +0 -1
  335. package/dist/src/browser/workers/content-hash.d.ts +0 -2
  336. package/dist/src/browser/workers/content-hash.d.ts.map +0 -1
  337. package/dist/src/browser/workers/dbWorker.d.ts +0 -1
  338. package/dist/src/browser/workers/dbWorker.d.ts.map +0 -1
  339. package/dist/src/client/BaseClientManager.d.ts +0 -7
  340. package/dist/src/client/BaseClientManager.d.ts.map +0 -1
  341. package/dist/src/client/actions/setAddresses.d.ts +0 -2
  342. package/dist/src/client/actions/setAddresses.d.ts.map +0 -1
  343. package/dist/src/db/alignRowPublishers.d.ts +0 -25
  344. package/dist/src/db/alignRowPublishers.d.ts.map +0 -1
  345. package/dist/src/db/clearStoredDisplayUrls.d.ts +0 -18
  346. package/dist/src/db/clearStoredDisplayUrls.d.ts.map +0 -1
  347. package/dist/src/db/migrateLegacyItemStorageRows.d.ts +0 -57
  348. package/dist/src/db/migrateLegacyItemStorageRows.d.ts.map +0 -1
  349. package/dist/src/db/read/getExistingItem.d.ts +0 -12
  350. package/dist/src/db/read/getExistingItem.d.ts.map +0 -1
  351. package/dist/src/db/read/getModels.d.ts +0 -5
  352. package/dist/src/db/read/getModels.d.ts.map +0 -1
  353. package/dist/src/db/read/getVersionsForVersionUids.d.ts +0 -10
  354. package/dist/src/db/read/getVersionsForVersionUids.d.ts.map +0 -1
  355. package/dist/src/db/removeForeignAttestationRows.d.ts +0 -27
  356. package/dist/src/db/removeForeignAttestationRows.d.ts.map +0 -1
  357. package/dist/src/db/resetAmbiguousLegacyItemData.d.ts +0 -17
  358. package/dist/src/db/resetAmbiguousLegacyItemData.d.ts.map +0 -1
  359. package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts +0 -14
  360. package/dist/src/db/write/applyArweaveL1TransactionIdLocal.d.ts.map +0 -1
  361. package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts +0 -44
  362. package/dist/src/db/write/convertVerbatimItemStorageRow.d.ts.map +0 -1
  363. package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts +0 -18
  364. package/dist/src/db/write/restoreDataItemIdsOverwrittenByL1.d.ts.map +0 -1
  365. package/dist/src/db/write/saveAppState.d.ts +0 -2
  366. package/dist/src/db/write/saveAppState.d.ts.map +0 -1
  367. package/dist/src/eslint-rules/align-imports.d.ts +0 -12
  368. package/dist/src/eslint-rules/align-imports.d.ts.map +0 -1
  369. package/dist/src/events/files/index.d.ts +0 -4
  370. package/dist/src/events/files/index.d.ts.map +0 -1
  371. package/dist/src/events/index.d.ts +0 -13
  372. package/dist/src/events/index.d.ts.map +0 -1
  373. package/dist/src/events/services/allItems.d.ts +0 -6
  374. package/dist/src/events/services/allItems.d.ts.map +0 -1
  375. package/dist/src/events/services/index.d.ts +0 -3
  376. package/dist/src/events/services/index.d.ts.map +0 -1
  377. package/dist/src/helpers/ArweaveClient/index.d.ts +0 -30
  378. package/dist/src/helpers/ArweaveClient/index.d.ts.map +0 -1
  379. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts +0 -26
  380. package/dist/src/helpers/PathResolver/BasePathResolver.d.ts.map +0 -1
  381. package/dist/src/helpers/PathResolver/IPathResolver.d.ts +0 -16
  382. package/dist/src/helpers/PathResolver/IPathResolver.d.ts.map +0 -1
  383. package/dist/src/helpers/easRevokedFilter.d.ts +0 -2
  384. package/dist/src/helpers/easRevokedFilter.d.ts.map +0 -1
  385. package/dist/src/helpers/file/fetchAll/actors.d.ts +0 -16
  386. package/dist/src/helpers/file/fetchAll/actors.d.ts.map +0 -1
  387. package/dist/src/helpers/file/fetchAll/index.d.ts +0 -58
  388. package/dist/src/helpers/file/fetchAll/index.d.ts.map +0 -1
  389. package/dist/src/helpers/files.d.ts +0 -10
  390. package/dist/src/helpers/files.d.ts.map +0 -1
  391. package/dist/src/helpers/updateMachineContext.d.ts +0 -7
  392. package/dist/src/helpers/updateMachineContext.d.ts.map +0 -1
  393. package/dist/src/imports/markdown.d.ts +0 -40
  394. package/dist/src/imports/markdown.d.ts.map +0 -1
  395. package/dist/src/node/constants.d.ts +0 -2
  396. package/dist/src/node/constants.d.ts.map +0 -1
  397. package/dist/src/node/db/index.d.ts +0 -5
  398. package/dist/src/node/db/index.d.ts.map +0 -1
  399. package/dist/src/node/helpers/PathResolver.d.ts +0 -44
  400. package/dist/src/node/helpers/PathResolver.d.ts.map +0 -1
  401. package/dist/src/node/helpers/scripts.d.ts +0 -14
  402. package/dist/src/node/helpers/scripts.d.ts.map +0 -1
  403. package/dist/src/node/seed.d.ts +0 -1
  404. package/dist/src/node/seed.d.ts.map +0 -1
  405. package/dist/src/node/webpack/fs-proxy.d.ts +0 -4
  406. package/dist/src/node/webpack/fs-proxy.d.ts.map +0 -1
  407. package/dist/src/node/webpack/index.d.ts +0 -7
  408. package/dist/src/node/webpack/index.d.ts.map +0 -1
  409. package/dist/src/services/events.d.ts +0 -2
  410. package/dist/src/services/events.d.ts.map +0 -1
  411. package/dist/src/testing/platformTestHandle.d.ts +0 -8
  412. package/dist/src/testing/platformTestHandle.d.ts.map +0 -1
  413. package/dist/src/types/browser.d.ts +0 -24
  414. package/dist/src/types/browser.d.ts.map +0 -1
  415. package/dist/src/types/seedProtocol.d.ts +0 -16
  416. package/dist/src/types/seedProtocol.d.ts.map +0 -1
  417. package/dist/src/types/services.d.ts +0 -1
  418. package/dist/src/types/services.d.ts.map +0 -1
  419. package/dist/syncDbWithEas-b4fESZ7C.js.map +0 -1
@@ -1,83 +1,22 @@
1
- import { B as BasePathResolver } from './configurePlatform-AWild9o4.js';
2
- import { d as withDbTabLock, n as notifyFilesWrittenOutsideCache, f as createSessionObjectUrl, g as withSeedDbLock, h as countDbStatements, s as startChangeFeed, j as countLiveQueryRuns } from './changeFeed-DcsZ7deG.js';
3
- import { G as BaseDb, h as appState, aE as contentSha256TagMatches, Q as BaseFileManager, aT as withSqliteBusyRetry } from './index-C0SetTd1.js';
1
+ import { d as withDbTabLock, n as notifyFilesWrittenOutsideCache, f as createSessionObjectUrl, g as withSeedDbLock, h as countDbStatements, s as startChangeFeed, j as countLiveQueryRuns } from './changeFeed-DKdVlUmt.js';
2
+ import { L as BaseDb, h as appState, av as contentSha256TagMatches, Q as BaseFileManager, aK as withSqliteBusyRetry } from './index-Dx_GTdyQ.js';
4
3
  import { eq, sql } from 'drizzle-orm';
5
4
  import { M as MIME_TO_EXTENSION } from './mimeTypes-C9r76DCH.js';
6
5
  import debug from 'debug';
7
- import { F as FileSystemLockedError, D as DatabaseNotPersistentError } from './errors-Do7v6RKu.js';
6
+ import { F as FileSystemLockedError, D as DatabaseNotPersistentError } from './errors-C1qUEZ7A.js';
8
7
  import { drizzle } from 'drizzle-orm/sqlite-proxy';
9
8
  import { sha256 } from '@noble/hashes/sha256';
10
9
  import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils';
11
- import { s as schema } from './index-CZQrNqvq.js';
10
+ import { s as schema } from './index-PbnKw2es.js';
12
11
  import { SQLocalDrizzle } from 'sqlocal/drizzle';
12
+ import { r as recreateIfOlderThanMinimumUpgradeVersion } from './minimumUpgradeVersion-BDhHvHtr.js';
13
13
  import { throwError, Observable, distinctUntilChanged, finalize, share, ReplaySubject } from 'rxjs';
14
14
  import { BaseArweaveClient, fetchTransactionStatusAcrossGateways, getPreferredArweaveReadBaseUrls, fetchArweaveRawFromBaseUrl, GET_TRANSACTION_TAGS } from '@seedprotocol/arweave';
15
15
  import { GraphQLClient } from 'graphql-request';
16
16
  import Arweave from 'arweave';
17
17
  import { getEasEndpoint, createEasGraphQLClient, BaseEasClient, BaseQueryClient } from '@seedprotocol/eas';
18
18
  import { QueryClient } from '@tanstack/query-core';
19
-
20
- class BrowserPathResolver {
21
- /** @deprecated Prefer BasePathResolver static methods or configure(). */
22
- static getInstance() {
23
- return BasePathResolver.getInstance();
24
- }
25
- /**
26
- * Gets the root directory containing node_modules
27
- * Note: In browser, this returns a virtual path based on OPFS
28
- */
29
- getRootWithNodeModules() {
30
- // In browser, we use OPFS which doesn't have traditional paths
31
- // Return a virtual root path
32
- return '/';
33
- }
34
- /**
35
- * Gets the SDK root directory
36
- * Note: In browser, this returns a virtual path
37
- */
38
- getSdkRootDir() {
39
- // In browser, SDK is bundled, so we return a virtual path
40
- return '/sdk';
41
- }
42
- getNodeModulesDir() {
43
- // In browser, node_modules don't exist in the traditional sense
44
- return '/node_modules';
45
- }
46
- /**
47
- * Gets the .seed directory path
48
- * Note: In browser, this returns the OPFS path where .seed data is stored
49
- */
50
- getDotSeedDir(_schemaFileDir) {
51
- // In browser, .seed directory is stored in OPFS
52
- // The actual path is handled by the FileManager
53
- return '/.seed';
54
- }
55
- /**
56
- * Finds the Seed Protocol config file
57
- * Note: In browser, config files are not accessible via filesystem
58
- */
59
- findConfigFile(_searchDir) {
60
- // In browser, config files are typically embedded in the bundle
61
- // or loaded via fetch/import
62
- return null;
63
- }
64
- /**
65
- * Gets paths for app-specific directories
66
- * Note: In browser, these are virtual paths for OPFS
67
- */
68
- getAppPaths(schemaFileDir) {
69
- const dotSeedDir = this.getDotSeedDir(schemaFileDir);
70
- return {
71
- sdkRootDir: this.getSdkRootDir(),
72
- dotSeedDir,
73
- nodeModulesDir: this.getNodeModulesDir(),
74
- appSchemaDir: `${dotSeedDir}/schema`,
75
- appDbDir: `${dotSeedDir}/db`,
76
- appMetaDir: `${dotSeedDir}/db/meta`,
77
- };
78
- }
79
- }
80
- BasePathResolver.configure(new BrowserPathResolver());
19
+ import './configurePlatform-CrMafpMW.js';
81
20
 
82
21
  const KEY = 'excludedTransactions';
83
22
  /**
@@ -458,7 +397,81 @@ var filesDownload = `const SEED_MIME_TO_EXTENSION = ${JSON.stringify(MIME_TO_EXT
458
397
  }
459
398
  return path;
460
399
  };
461
- const downloadFiles = async ({ transactionIds, arweaveHost, arweaveBaseUrls, filesRoot = '/files', expectedContentHashes, compositeChildPaths, }) => {
400
+ /** The OPFS directory at `path`, or undefined when it does not exist. Creates nothing. */
401
+ const getExistingDirectory = async (path) => {
402
+ let dir = await navigator.storage.getDirectory();
403
+ for (const segment of path.split('/').filter(Boolean)) {
404
+ try {
405
+ dir = await dir.getDirectoryHandle(segment);
406
+ }
407
+ catch {
408
+ return undefined;
409
+ }
410
+ }
411
+ return dir;
412
+ };
413
+ const isNonEmptyFile = async (filePath) => {
414
+ const segments = filePath.split('/').filter(Boolean);
415
+ const fileName = segments.pop();
416
+ const dir = fileName ? await getExistingDirectory(segments.join('/')) : undefined;
417
+ if (!dir || !fileName)
418
+ return false;
419
+ try {
420
+ return (await (await dir.getFileHandle(fileName)).getFile()).size > 0;
421
+ }
422
+ catch {
423
+ return false;
424
+ }
425
+ };
426
+ /**
427
+ * Which of `transactionIds` already have a non-empty file where a download would put them:
428
+ * `<txId>` or `<txId>.<ext>` in images/, html/, json/ or files/. Each directory is listed once.
429
+ */
430
+ const listStoredTransactionIds = async (filesRoot, transactionIds) => {
431
+ const wanted = new Set(transactionIds);
432
+ const stored = new Set();
433
+ for (const dirName of ['images', 'html', 'json', 'files']) {
434
+ const dir = await getExistingDirectory(getFilesPath(filesRoot, dirName));
435
+ if (!dir)
436
+ continue;
437
+ for await (const handle of dir.values()) {
438
+ if (handle.kind !== 'file')
439
+ continue;
440
+ // Transaction ids never contain a dot.
441
+ const transactionId = handle.name.split('.')[0];
442
+ if (!wanted.has(transactionId) || stored.has(transactionId))
443
+ continue;
444
+ try {
445
+ if ((await handle.getFile()).size > 0)
446
+ stored.add(transactionId);
447
+ }
448
+ catch {
449
+ /* unreadable: download it again */
450
+ }
451
+ }
452
+ }
453
+ return stored;
454
+ };
455
+ /**
456
+ * True when a transaction needs no download. A composite with child paths counts as stored only
457
+ * when every routed child is on disk, so a child that got its path after an earlier run is placed.
458
+ */
459
+ const isAlreadyStored = async (transactionId, stored, filesRoot, childPaths) => {
460
+ const routed = Object.values(childPaths ?? {})
461
+ .map(safeRelativePath)
462
+ .filter((path) => !!path);
463
+ if (routed.length === 0)
464
+ return stored.has(transactionId);
465
+ for (const path of routed) {
466
+ if (!(await isNonEmptyFile(getFilesPath(filesRoot, path))))
467
+ return false;
468
+ }
469
+ return true;
470
+ };
471
+ const downloadFiles = async ({ transactionIds, arweaveHost, arweaveBaseUrls, filesRoot = '/files', expectedContentHashes, compositeChildPaths, skipExisting, }) => {
472
+ const stored = skipExisting
473
+ ? await listStoredTransactionIds(filesRoot, transactionIds).catch(() => new Set())
474
+ : new Set();
462
475
  // Preferred / resolved gateways first, then the configured host; deduped.
463
476
  const baseUrls = [];
464
477
  for (const candidate of (arweaveBaseUrls || []).concat([arweaveHost])) {
@@ -470,7 +483,10 @@ var filesDownload = `const SEED_MIME_TO_EXTENSION = ${JSON.stringify(MIME_TO_EXT
470
483
  for (const transactionId of transactionIds) {
471
484
  // One bad file (failed OPFS write, quota, malformed content) must not stall or abort the batch.
472
485
  try {
473
- await downloadFile(transactionId, baseUrls, filesRoot, expectedContentHashes?.[transactionId], compositeChildPaths?.[transactionId]);
486
+ const skip = skipExisting &&
487
+ (await isAlreadyStored(transactionId, stored, filesRoot, compositeChildPaths?.[transactionId]));
488
+ if (!skip)
489
+ await downloadFile(transactionId, baseUrls, filesRoot, expectedContentHashes?.[transactionId], compositeChildPaths?.[transactionId]);
474
490
  }
475
491
  catch (error) {
476
492
  globalThis.postMessage({ message: 'fileError', transactionId, error: errorInfo(error) });
@@ -689,7 +705,7 @@ const toError = (raw, fallback) => {
689
705
  class FileDownloader {
690
706
  constructor(options = {}) {
691
707
  this.options = options;
692
- this.downloadAll = async ({ transactionIds, arweaveHost, arweaveBaseUrls, excludedTransactions, expectedContentHashes, compositeChildPaths, }) => {
708
+ this.downloadAll = async ({ transactionIds, arweaveHost, arweaveBaseUrls, excludedTransactions, expectedContentHashes, compositeChildPaths, skipExisting, }) => {
693
709
  // One download per instance at a time: a newer call replaces the older one, which rejects
694
710
  // instead of waiting forever on a terminated worker.
695
711
  this.abortCurrent?.(new FileDownloadWorkerError('Superseded by a newer download'));
@@ -821,6 +837,7 @@ class FileDownloader {
821
837
  arweaveBaseUrls,
822
838
  expectedContentHashes,
823
839
  compositeChildPaths,
840
+ skipExisting,
824
841
  debug: logger$5.enabled,
825
842
  filesRoot: BaseFileManager.getWorkingDir(),
826
843
  });
@@ -895,7 +912,7 @@ var imageResize = `(
895
912
  mime = 'image/jpeg';
896
913
  else if (bytes[0] === 0x89 && bytes[1] === 0x50 && bytes[2] === 0x4e && bytes[3] === 0x47)
897
914
  mime = 'image/png';
898
- else if (bytes[0] === 0x52 && bytes[1] === 0x49 && bytes[2] === 0x46 && bytes[3] === 0x52 && bytes[8] === 0x57 && bytes[9] === 0x45 && bytes[10] === 0x42 && bytes[11] === 0x50)
915
+ else if (bytes[0] === 0x52 && bytes[1] === 0x49 && bytes[2] === 0x46 && bytes[3] === 0x46 && bytes[8] === 0x57 && bytes[9] === 0x45 && bytes[10] === 0x42 && bytes[11] === 0x50)
899
916
  mime = 'image/webp';
900
917
  else if (bytes[0] === 0x47 && bytes[1] === 0x49 && bytes[2] === 0x46)
901
918
  mime = 'image/gif';
@@ -1448,9 +1465,9 @@ class BrowserFileManager {
1448
1465
  }
1449
1466
  async initializeFileSystem(_workingDir) {
1450
1467
  const zenfs = await this.getFs();
1451
- const { TolerantWebAccess, TolerantWebAccessFS } = await import('./tolerantWebAccess-CIpS7RLk.js');
1452
- const _mod_0 = await import('./changeFeed-DcsZ7deG.js');
1453
- const _ns_0 = _mod_0.H;
1468
+ const { TolerantWebAccess, TolerantWebAccessFS } = await import('./tolerantWebAccess-DecKDGen.js');
1469
+ const _mod_0 = await import('./changeFeed-DKdVlUmt.js');
1470
+ const _ns_0 = _mod_0.G;
1454
1471
  const { queueFilesChangedNotice } = _ns_0;
1455
1472
  const { configureSingle } = zenfs;
1456
1473
  const configureRoot = async () => {
@@ -1518,7 +1535,7 @@ class BrowserFileManager {
1518
1535
  }
1519
1536
  async invalidateNow(filePaths) {
1520
1537
  const { mounts } = await this.getFs();
1521
- const { TolerantWebAccessFS } = await import('./tolerantWebAccess-CIpS7RLk.js');
1538
+ const { TolerantWebAccessFS } = await import('./tolerantWebAccess-DecKDGen.js');
1522
1539
  const mounted = mounts.get('/');
1523
1540
  if (!(mounted instanceof TolerantWebAccessFS))
1524
1541
  return;
@@ -2339,6 +2356,36 @@ END;
2339
2356
  CREATE TRIGGER \`entity_changes_metadata_delete\` AFTER DELETE ON \`metadata\` BEGIN
2340
2357
  INSERT INTO \`entity_changes\` (\`tbl\`, \`seed_local_id\`, \`seed_uid\`, \`property_name\`, \`at\`) VALUES ('metadata', OLD.\`seed_local_id\`, OLD.\`seed_uid\`, OLD.\`property_name\`, CAST((julianday('now') - 2440587.5) * 86400000 AS INTEGER));
2341
2358
  END;`;
2359
+ const migrationSql_0024_merge_republished_ghost_seeds = `-- A sync after an unpublish and republish inserted the old seed uid as a second seed row with no
2360
+ -- versions, while the item's old version rows still record that uid in versions.seed_uid. Property
2361
+ -- rows sync attached to that row move to the item, then the row is deleted.
2362
+ UPDATE \`metadata\` SET \`seed_local_id\` = (
2363
+ SELECT \`v\`.\`seed_local_id\` FROM \`versions\` \`v\`
2364
+ JOIN \`seeds\` \`owner\` ON \`owner\`.\`local_id\` = \`v\`.\`seed_local_id\`
2365
+ JOIN \`seeds\` \`ghost\` ON \`ghost\`.\`uid\` = \`v\`.\`seed_uid\`
2366
+ WHERE \`ghost\`.\`local_id\` = \`metadata\`.\`seed_local_id\` AND \`owner\`.\`local_id\` != \`ghost\`.\`local_id\`
2367
+ LIMIT 1
2368
+ )
2369
+ WHERE \`seed_local_id\` IN (
2370
+ SELECT \`ghost\`.\`local_id\` FROM \`seeds\` \`ghost\`
2371
+ WHERE \`ghost\`.\`uid\` IS NOT NULL
2372
+ AND NOT EXISTS (SELECT 1 FROM \`versions\` WHERE \`versions\`.\`seed_local_id\` = \`ghost\`.\`local_id\`)
2373
+ AND EXISTS (
2374
+ SELECT 1 FROM \`versions\` \`v\` JOIN \`seeds\` \`owner\` ON \`owner\`.\`local_id\` = \`v\`.\`seed_local_id\`
2375
+ WHERE \`v\`.\`seed_uid\` = \`ghost\`.\`uid\` AND \`owner\`.\`local_id\` != \`ghost\`.\`local_id\`
2376
+ )
2377
+ );
2378
+ --> statement-breakpoint
2379
+ DELETE FROM \`seeds\` WHERE \`local_id\` IN (
2380
+ SELECT \`ghost\`.\`local_id\` FROM \`seeds\` \`ghost\`
2381
+ WHERE \`ghost\`.\`uid\` IS NOT NULL
2382
+ AND NOT EXISTS (SELECT 1 FROM \`versions\` WHERE \`versions\`.\`seed_local_id\` = \`ghost\`.\`local_id\`)
2383
+ AND EXISTS (
2384
+ SELECT 1 FROM \`versions\` \`v\` JOIN \`seeds\` \`owner\` ON \`owner\`.\`local_id\` = \`v\`.\`seed_local_id\`
2385
+ WHERE \`v\`.\`seed_uid\` = \`ghost\`.\`uid\` AND \`owner\`.\`local_id\` != \`ghost\`.\`local_id\`
2386
+ )
2387
+ );
2388
+ `;
2342
2389
  // Journal JSON file
2343
2390
  const journalJson = `{
2344
2391
  "version": "7",
@@ -2511,16 +2558,23 @@ const journalJson = `{
2511
2558
  "when": 1792455641631,
2512
2559
  "tag": "0023_add_entity_changes",
2513
2560
  "breakpoints": true
2561
+ },
2562
+ {
2563
+ "idx": 24,
2564
+ "version": "6",
2565
+ "when": 1792576238054,
2566
+ "tag": "0024_merge_republished_ghost_seeds",
2567
+ "breakpoints": true
2514
2568
  }
2515
2569
  ]
2516
2570
  }`;
2517
2571
  // Snapshot JSON file - this is large, so we'll import it dynamically if needed
2518
2572
  // For now, we'll read it from the actual file if ?raw works, otherwise we'll need to embed it
2519
2573
  const snapshotJson = `{
2574
+ "id": "3264e54f-0bb8-4116-87e8-b059b4ac1ae7",
2575
+ "prevId": "7767667b-3cf0-4630-b1ff-02913f2f35ad",
2520
2576
  "version": "6",
2521
2577
  "dialect": "sqlite",
2522
- "id": "7767667b-3cf0-4630-b1ff-02913f2f35ad",
2523
- "prevId": "781ce7c2-f397-4df2-a32c-9267c4a4163d",
2524
2578
  "tables": {
2525
2579
  "appState": {
2526
2580
  "name": "appState",
@@ -3131,15 +3185,15 @@ const snapshotJson = `{
3131
3185
  "metadata_property_id_properties_id_fk": {
3132
3186
  "name": "metadata_property_id_properties_id_fk",
3133
3187
  "tableFrom": "metadata",
3134
- "tableTo": "properties",
3135
3188
  "columnsFrom": [
3136
3189
  "property_id"
3137
3190
  ],
3191
+ "tableTo": "properties",
3138
3192
  "columnsTo": [
3139
3193
  "id"
3140
3194
  ],
3141
- "onDelete": "no action",
3142
- "onUpdate": "no action"
3195
+ "onUpdate": "no action",
3196
+ "onDelete": "no action"
3143
3197
  }
3144
3198
  },
3145
3199
  "compositePrimaryKeys": {},
@@ -3301,28 +3355,28 @@ const snapshotJson = `{
3301
3355
  "properties_model_id_models_id_fk": {
3302
3356
  "name": "properties_model_id_models_id_fk",
3303
3357
  "tableFrom": "properties",
3304
- "tableTo": "models",
3305
3358
  "columnsFrom": [
3306
3359
  "model_id"
3307
3360
  ],
3361
+ "tableTo": "models",
3308
3362
  "columnsTo": [
3309
3363
  "id"
3310
3364
  ],
3311
- "onDelete": "no action",
3312
- "onUpdate": "no action"
3365
+ "onUpdate": "no action",
3366
+ "onDelete": "no action"
3313
3367
  },
3314
3368
  "properties_ref_model_id_models_id_fk": {
3315
3369
  "name": "properties_ref_model_id_models_id_fk",
3316
3370
  "tableFrom": "properties",
3317
- "tableTo": "models",
3318
3371
  "columnsFrom": [
3319
3372
  "ref_model_id"
3320
3373
  ],
3374
+ "tableTo": "models",
3321
3375
  "columnsTo": [
3322
3376
  "id"
3323
3377
  ],
3324
- "onDelete": "no action",
3325
- "onUpdate": "no action"
3378
+ "onUpdate": "no action",
3379
+ "onDelete": "no action"
3326
3380
  }
3327
3381
  },
3328
3382
  "compositePrimaryKeys": {},
@@ -3359,28 +3413,28 @@ const snapshotJson = `{
3359
3413
  "model_schemas_model_id_models_id_fk": {
3360
3414
  "name": "model_schemas_model_id_models_id_fk",
3361
3415
  "tableFrom": "model_schemas",
3362
- "tableTo": "models",
3363
3416
  "columnsFrom": [
3364
3417
  "model_id"
3365
3418
  ],
3419
+ "tableTo": "models",
3366
3420
  "columnsTo": [
3367
3421
  "id"
3368
3422
  ],
3369
- "onDelete": "no action",
3370
- "onUpdate": "no action"
3423
+ "onUpdate": "no action",
3424
+ "onDelete": "no action"
3371
3425
  },
3372
3426
  "model_schemas_schema_id_schemas_id_fk": {
3373
3427
  "name": "model_schemas_schema_id_schemas_id_fk",
3374
3428
  "tableFrom": "model_schemas",
3375
- "tableTo": "schemas",
3376
3429
  "columnsFrom": [
3377
3430
  "schema_id"
3378
3431
  ],
3432
+ "tableTo": "schemas",
3379
3433
  "columnsTo": [
3380
3434
  "id"
3381
3435
  ],
3382
- "onDelete": "no action",
3383
- "onUpdate": "no action"
3436
+ "onUpdate": "no action",
3437
+ "onDelete": "no action"
3384
3438
  }
3385
3439
  },
3386
3440
  "compositePrimaryKeys": {},
@@ -3425,15 +3479,15 @@ const snapshotJson = `{
3425
3479
  "model_uids_model_id_models_id_fk": {
3426
3480
  "name": "model_uids_model_id_models_id_fk",
3427
3481
  "tableFrom": "model_uids",
3428
- "tableTo": "models",
3429
3482
  "columnsFrom": [
3430
3483
  "model_id"
3431
3484
  ],
3485
+ "tableTo": "models",
3432
3486
  "columnsTo": [
3433
3487
  "id"
3434
3488
  ],
3435
- "onDelete": "no action",
3436
- "onUpdate": "no action"
3489
+ "onUpdate": "no action",
3490
+ "onDelete": "no action"
3437
3491
  }
3438
3492
  },
3439
3493
  "compositePrimaryKeys": {},
@@ -3647,15 +3701,15 @@ const snapshotJson = `{
3647
3701
  "property_uids_property_id_properties_id_fk": {
3648
3702
  "name": "property_uids_property_id_properties_id_fk",
3649
3703
  "tableFrom": "property_uids",
3650
- "tableTo": "properties",
3651
3704
  "columnsFrom": [
3652
3705
  "property_id"
3653
3706
  ],
3707
+ "tableTo": "properties",
3654
3708
  "columnsTo": [
3655
3709
  "id"
3656
3710
  ],
3657
- "onDelete": "no action",
3658
- "onUpdate": "no action"
3711
+ "onUpdate": "no action",
3712
+ "onDelete": "no action"
3659
3713
  }
3660
3714
  },
3661
3715
  "compositePrimaryKeys": {},
@@ -4153,9 +4207,9 @@ const snapshotJson = `{
4153
4207
  "views": {},
4154
4208
  "enums": {},
4155
4209
  "_meta": {
4210
+ "columns": {},
4156
4211
  "schemas": {},
4157
- "tables": {},
4158
- "columns": {}
4212
+ "tables": {}
4159
4213
  },
4160
4214
  "internal": {
4161
4215
  "indexes": {}
@@ -4189,6 +4243,7 @@ var drizzleFiles = /*#__PURE__*/Object.freeze({
4189
4243
  migrationSql_0021_add_pending_write_error_name: migrationSql_0021_add_pending_write_error_name,
4190
4244
  migrationSql_0022_add_read_indexes: migrationSql_0022_add_read_indexes,
4191
4245
  migrationSql_0023_add_entity_changes: migrationSql_0023_add_entity_changes,
4246
+ migrationSql_0024_merge_republished_ghost_seeds: migrationSql_0024_merge_republished_ghost_seeds,
4192
4247
  snapshotJson: snapshotJson
4193
4248
  });
4194
4249
 
@@ -4259,14 +4314,59 @@ function shouldBlobWrapModuleWorker(scriptURL, options) {
4259
4314
  return false;
4260
4315
  return HTTP_MODULE_WORKER_URL.test(String(scriptURL));
4261
4316
  }
4262
- function createBlobModuleWorkerSource(scriptURL) {
4263
- return `import ${JSON.stringify(String(scriptURL))};`;
4317
+ /**
4318
+ * Source of a module that replaces `self.Worker` inside sqlocal's worker. SQLite's OPFS VFS starts
4319
+ * its async proxy from there with `new Worker(new URL('sqlite3-opfs-async-proxy.js', import.meta.url))`,
4320
+ * and some Chromium builds fail any worker started from a worker with an http(s) URL (an `error`
4321
+ * event with no message). They do start a blob worker, so an http(s) URL is started from a blob that
4322
+ * loads it: `import` for a module worker, `importScripts` for a classic one. The classic blob also
4323
+ * resolves later `importScripts` calls against the original URL, because Vite dev prepends a
4324
+ * root-relative `importScripts("/@vite/env")`, which has no base inside a blob worker.
4325
+ *
4326
+ * Plain JS in a string so bundlers and transpilers can't add helpers that don't exist in the worker.
4327
+ */
4328
+ const NESTED_WORKER_SHIM_SOURCE = `(() => {
4329
+ const OriginalWorker = self.Worker;
4330
+ if (typeof OriginalWorker !== 'function' || OriginalWorker.__seedNestedWorkerWrap) return;
4331
+ const HTTP_URL = /^https?:/i;
4332
+ const classicSource = (url) =>
4333
+ 'const __seedWorkerUrl = ' + JSON.stringify(url) + ';\\n' +
4334
+ 'const __seedImportScripts = self.importScripts.bind(self);\\n' +
4335
+ 'self.importScripts = (...urls) => __seedImportScripts(...urls.map((u) => new URL(String(u), __seedWorkerUrl).href));\\n' +
4336
+ '__seedImportScripts(__seedWorkerUrl);\\n';
4337
+ function NestedWorker(scriptURL, options) {
4338
+ const url = String(scriptURL);
4339
+ if (!HTTP_URL.test(url)) return new OriginalWorker(scriptURL, options);
4340
+ const isModule = options && options.type === 'module';
4341
+ const source = isModule ? 'import ' + JSON.stringify(url) + ';\\n' : classicSource(url);
4342
+ const blobUrl = URL.createObjectURL(new Blob([source], { type: 'text/javascript' }));
4343
+ const worker = new OriginalWorker(blobUrl, options);
4344
+ worker.addEventListener('error', (event) => {
4345
+ console.warn('[seed] A worker started inside the SQLite worker failed to load: ' + url, event.message || '');
4346
+ });
4347
+ return worker;
4348
+ }
4349
+ NestedWorker.prototype = OriginalWorker.prototype;
4350
+ Object.setPrototypeOf(NestedWorker, OriginalWorker);
4351
+ NestedWorker.__seedNestedWorkerWrap = true;
4352
+ self.Worker = NestedWorker;
4353
+ })();
4354
+ `;
4355
+ /**
4356
+ * Source of the blob module that starts sqlocal's worker. The shim is a separate import ahead of
4357
+ * the worker's: static imports are hoisted, so shim code in this module's body would run after the
4358
+ * worker module, while imports evaluate in the order they're written.
4359
+ */
4360
+ function createBlobModuleWorkerSource(scriptURL, shimURL) {
4361
+ const workerImport = `import ${JSON.stringify(String(scriptURL))};`;
4362
+ return shimURL ? `import ${JSON.stringify(shimURL)};\n${workerImport}` : workerImport;
4264
4363
  }
4265
4364
  /**
4266
4365
  * Construct SQLocal while starting its HTTPS module worker from a blob that
4267
4366
  * only imports the bundled worker URL. Some Chrome profiles kill
4268
4367
  * `new Worker(https://…/worker-HASH.js, { type: 'module' })` as an entry
4269
- * script; importing the same URL from a blob worker reaches connect.
4368
+ * script; importing the same URL from a blob worker reaches connect. The blob also installs
4369
+ * {@link NESTED_WORKER_SHIM_SOURCE} first, for the OPFS proxy worker SQLite starts inside it.
4270
4370
  *
4271
4371
  * The `Worker` patch is scoped to `factory()` so Vite still sees sqlocal's
4272
4372
  * own `new Worker(new URL('./worker', import.meta.url))` and emits a real
@@ -4311,10 +4411,9 @@ function installModuleWorkerBlobWrap(onWorkerFailed) {
4311
4411
  return () => { };
4312
4412
  }
4313
4413
  function WrappedWorker(scriptURL, options) {
4414
+ const toBlobURL = (source) => URL.createObjectURL(new Blob([source], { type: 'text/javascript' }));
4314
4415
  const worker = shouldBlobWrapModuleWorker(scriptURL, options)
4315
- ? new OriginalWorker(URL.createObjectURL(new Blob([createBlobModuleWorkerSource(scriptURL)], {
4316
- type: 'text/javascript',
4317
- })), { ...options, type: 'module' })
4416
+ ? new OriginalWorker(toBlobURL(createBlobModuleWorkerSource(scriptURL, toBlobURL(NESTED_WORKER_SHIM_SOURCE))), { ...options, type: 'module' })
4318
4417
  : new OriginalWorker(scriptURL, options);
4319
4418
  const fail = (event) => {
4320
4419
  const filename = 'filename' in event && typeof event.filename === 'string'
@@ -4360,6 +4459,35 @@ class BrowserDb {
4360
4459
  // one-time data fixes one tab at a time. See docs/MULTI_TAB.md.
4361
4460
  return withSeedDbLock('migrate', filesDir, () => this.prepareDbLocked(filesDir));
4362
4461
  }
4462
+ /**
4463
+ * Starts SQLocal on `<filesDir>/db/seed.db` and checks it opened the OPFS file. SQLocal opens an
4464
+ * in-memory database instead when its OPFS open throws, which also happens when another tab keeps
4465
+ * the file's sync access handle for longer than sqlite-wasm retries (about 4.5 s), e.g. while that
4466
+ * tab runs its first queries after migrating. That clears up, so a memory database is closed and
4467
+ * the open tried again, waiting 1, 2 and 4 s, before it's reported as DatabaseNotPersistentError.
4468
+ */
4469
+ async openPersistentSqlocal() {
4470
+ const retryWaitsMs = [1000, 2000, 4000];
4471
+ for (let attempt = 0;; attempt++) {
4472
+ // reactive: true enables reactive queries. Blob-wrap sqlocal's HTTPS module worker so Chrome
4473
+ // profiles that kill `new Worker(https://…/worker-HASH.js, { type: 'module' })` as an entry
4474
+ // still reach connect via `import` of the same URL.
4475
+ const { instance: sqlocalDrizzle, workerFailed } = createSqlocalDrizzle(() => new SQLocalDrizzle({
4476
+ databasePath: `${this.filesDir}/db/seed.db`,
4477
+ reactive: true,
4478
+ }));
4479
+ const { storageType } = await raceSqlocalStartup(sqlocalDrizzle.getDatabaseInfo(), workerFailed);
4480
+ if (storageType === 'opfs')
4481
+ return { sqlocalDrizzle, workerFailed };
4482
+ await sqlocalDrizzle.destroy().catch(() => { });
4483
+ const waitMs = retryWaitsMs[attempt];
4484
+ if (waitMs === undefined) {
4485
+ throw new DatabaseNotPersistentError(`SQLocal opened a "${storageType}" database instead of OPFS`, globalThis.crossOriginIsolated === true ? 'vfs' : 'headers');
4486
+ }
4487
+ logger$1(`[Db.prepareDb] SQLocal opened a "${storageType}" database; retrying in ${waitMs} ms`);
4488
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
4489
+ }
4490
+ }
4363
4491
  async prepareDbLocked(filesDir) {
4364
4492
  try {
4365
4493
  // Copy drizzle migration files from src/db/drizzle to filesDir/db
@@ -4389,14 +4517,7 @@ class BrowserDb {
4389
4517
  ? 'the page is not cross-origin isolated, so SharedArrayBuffer is unavailable'
4390
4518
  : 'SharedArrayBuffer is unavailable');
4391
4519
  }
4392
- // Initialize SQLocalDrizzle with reactive: true to enable reactive queries.
4393
- // Blob-wrap sqlocal's HTTPS module worker so Chrome profiles that kill
4394
- // `new Worker(https://…/worker-HASH.js, { type: 'module' })` as an entry
4395
- // still reach connect via `import` of the same URL.
4396
- const { instance: sqlocalDrizzle, workerFailed } = createSqlocalDrizzle(() => new SQLocalDrizzle({
4397
- databasePath: `${this.filesDir}/db/seed.db`,
4398
- reactive: true,
4399
- }));
4520
+ const { sqlocalDrizzle, workerFailed } = await this.openPersistentSqlocal();
4400
4521
  const { batchDriver } = sqlocalDrizzle;
4401
4522
  const driver = countDbStatements(withSqliteBusyRetry(sqlocalDrizzle.driver));
4402
4523
  // Store SQLocalDrizzle instance for reactive queries
@@ -4411,18 +4532,11 @@ class BrowserDb {
4411
4532
  });
4412
4533
  logger$1('[Db.prepareDb] database prepared');
4413
4534
  await raceSqlocalStartup((async () => {
4414
- // OPFS can still fail inside the worker (e.g. storage blocked); SQLocal then reports memory.
4415
- const { storageType } = await sqlocalDrizzle.getDatabaseInfo();
4416
- if (storageType !== 'opfs') {
4417
- throw new DatabaseNotPersistentError(`SQLocal opened a "${storageType}" database instead of OPFS`);
4418
- }
4535
+ await recreateIfOlderThanMinimumUpgradeVersion(db);
4419
4536
  await this.runMigrations(db);
4420
4537
  this.appDb = db;
4421
- const { backfillMetadataPropertyIds } = await import('./backfillMetadataPropertyIds-DWWkh-Ex.js');
4538
+ const { backfillMetadataPropertyIds } = await import('./backfillMetadataPropertyIds-BbxgavEQ.js');
4422
4539
  await backfillMetadataPropertyIds();
4423
- // One-time: clear item data whose model can't be determined (seeds.model_file_id, migration 0015)
4424
- const { resetAmbiguousLegacyItemData } = await import('./resetAmbiguousLegacyItemData-0Tin9-JK.js');
4425
- await resetAmbiguousLegacyItemData();
4426
4540
  // Loaded Items and ItemProperties hear about row changes through it (ADR 0020). Started
4427
4541
  // after the fixups above, so their log rows aren't dispatched.
4428
4542
  await startChangeFeed(db, {
@@ -4437,61 +4551,8 @@ class BrowserDb {
4437
4551
  throw error;
4438
4552
  }
4439
4553
  }
4440
- // static async prepareDb(filesDir: string) {
4441
- // console.log('prepareDb', filesDir)
4442
- // if (Db.sqliteWasmClient) {
4443
- // return this.dbId
4444
- // }
4445
- // this.filesDir = filesDir
4446
- // this.pathToDb = `${filesDir}/db/${DB_NAME_APP}.db`
4447
- // if (typeof document === 'undefined') {
4448
- // return
4449
- // }
4450
- // let promiser
4451
- // try {
4452
- // let sqlite3Worker1Promiser
4453
- // const sqliteWasm = await import('@sqlite.org/sqlite-wasm')
4454
- // if (sqliteWasm && sqliteWasm.sqlite3Worker1Promiser) {
4455
- // sqlite3Worker1Promiser = sqliteWasm.sqlite3Worker1Promiser
4456
- // }
4457
- // if (!sqlite3Worker1Promiser && window.sqlite3Worker1Promiser) {
4458
- // sqlite3Worker1Promiser = window.sqlite3Worker1Promiser
4459
- // }
4460
- // if (!sqlite3Worker1Promiser) {
4461
- // throw new Error('Failed to load sqlite3Worker1Promiser')
4462
- // }
4463
- // promiser = await new Promise<(event: string, config: Record<string, unknown>) => Promise<any>>((resolve) => {
4464
- // const _promiser = sqlite3Worker1Promiser({
4465
- // onready: () => {
4466
- // resolve(_promiser);
4467
- // },
4468
- // });
4469
- // }).catch((error) => {
4470
- // console.error('Error from sqlite proxy server: ', JSON.stringify(error))
4471
- // });
4472
- // } catch ( e ) {
4473
- // console.error('Error from sqlite proxy server: ', JSON.stringify(e))
4474
- // }
4475
- // if (!promiser) {
4476
- // throw new Error('Failed to create promiser')
4477
- // }
4478
- // this.sqliteWasmClient = promiser
4479
- // const responseGet = await this.sqliteWasmClient('config-get', {});
4480
- // logger('[Db.prepareDb] Running SQLite3 version', responseGet.result.version.libVersion);
4481
- // const responseOpen = await this.sqliteWasmClient('open', {
4482
- // filename: `file:${filesDir}/db/${DB_NAME_APP}.db?vfs=opfs`,
4483
- // });
4484
- // const { dbId } = responseOpen;
4485
- // logger(
4486
- // '[Db.prepareDb] OPFS is available, created persisted database at',
4487
- // responseOpen.result.filename.replace(/^file:(.*?)\?vfs=opfs/, '$1'),
4488
- // );
4489
- // logger('[Db.prepareDb] dbId', dbId)
4490
- // this.dbId = dbId
4491
- // await this.migrate()
4492
- // }
4493
4554
  async connectToDb(_filesDir) {
4494
- return this.dbId;
4555
+ return undefined;
4495
4556
  }
4496
4557
  async copyDrizzleFiles(filesDir) {
4497
4558
  logger$1('[Db.copyDrizzleFiles] copying drizzle migration files');
@@ -4932,7 +4993,6 @@ BaseQueryClient.configure(new BrowserQueryClient());
4932
4993
 
4933
4994
  function createPlatformServices() {
4934
4995
  return {
4935
- pathResolver: new BrowserPathResolver(),
4936
4996
  fileManager: new BrowserFileManager(),
4937
4997
  db: new BrowserDb(),
4938
4998
  arweaveClient: new BrowserArweaveClient(),
@@ -4949,4 +5009,4 @@ function resolveFilesDir(filesDir) {
4949
5009
  }
4950
5010
 
4951
5011
  export { createPlatformServices as c, isSkippableOpfsEntryError as i, resolveFilesDir as r };
4952
- //# sourceMappingURL=index.browser-Ll71Y_Dl.js.map
5012
+ //# sourceMappingURL=index.browser-i9uPJice.js.map