@dialecte/core 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist/assets/hub.worker-35vzG0HK.js +2 -0
  2. package/dist/dialecte/create-dialecte-project.d.ts +1 -2
  3. package/dist/dialecte/create-dialecte-project.d.ts.map +1 -1
  4. package/dist/dialecte/create-project-factory.d.ts +5 -5
  5. package/dist/dialecte/create-project-factory.d.ts.map +1 -1
  6. package/dist/dialecte/define-dialecte.d.ts +2 -2
  7. package/dist/dialecte/dialecte.types.d.ts +11 -23
  8. package/dist/dialecte/dialecte.types.d.ts.map +1 -1
  9. package/dist/{dialecte-gIPrRzni.js → dialecte-CVLWSkgW.js} +1726 -1673
  10. package/dist/document/document.d.ts +1 -1
  11. package/dist/document/query/get/record/get-record.d.ts +14 -1
  12. package/dist/document/query/get/record/get-record.d.ts.map +1 -1
  13. package/dist/document/query/get/record/get-records.d.ts +12 -2
  14. package/dist/document/query/get/record/get-records.d.ts.map +1 -1
  15. package/dist/{engine-store-CIEqgPUb.js → engine-store-Deo9XNhr.js} +21 -21
  16. package/dist/engine.constants-Bi4gw6BR.js +205 -0
  17. package/dist/errors/{codes.d.ts → codes.constants.d.ts} +33 -105
  18. package/dist/errors/{codes.d.ts.map → codes.constants.d.ts.map} +1 -1
  19. package/dist/errors/core-codes.constants.d.ts +3 -0
  20. package/dist/errors/core-codes.constants.d.ts.map +1 -0
  21. package/dist/errors/errors.constants.d.ts +5 -0
  22. package/dist/errors/errors.constants.d.ts.map +1 -1
  23. package/dist/errors/errors.d.ts.map +1 -1
  24. package/dist/errors/index.d.ts +1 -1
  25. package/dist/errors/index.d.ts.map +1 -1
  26. package/dist/errors/types.d.ts +1 -1
  27. package/dist/errors/types.d.ts.map +1 -1
  28. package/dist/{helpers-DVShv41E.js → helpers-D8p0KiJu.js} +1 -1
  29. package/dist/helpers.js +2 -2
  30. package/dist/{in-process-link-DBeAOZRp.js → in-process-link-B-TCHrlb.js} +996 -993
  31. package/dist/index.js +8 -7
  32. package/dist/project/index.d.ts +1 -1
  33. package/dist/project/index.d.ts.map +1 -1
  34. package/dist/project/io/store-runtime.types.d.ts +1 -3
  35. package/dist/project/io/store-runtime.types.d.ts.map +1 -1
  36. package/dist/project/project.d.ts +13 -15
  37. package/dist/project/project.d.ts.map +1 -1
  38. package/dist/project/types.d.ts +24 -19
  39. package/dist/project/types.d.ts.map +1 -1
  40. package/dist/{project-key-Ch34EtFa.js → project-key-2ccZ-0gu.js} +195 -205
  41. package/dist/running-operations-DCKvzlU7.js +107 -0
  42. package/dist/{same-json-value-C6kUaoyt.js → same-json-value-_AChwM_n.js} +41 -41
  43. package/dist/sqlite-engine.d.ts +7 -0
  44. package/dist/sqlite-engine.d.ts.map +1 -0
  45. package/dist/{engine.js → sqlite-engine.js} +4144 -4079
  46. package/dist/sqlite.d.ts +27 -2
  47. package/dist/sqlite.d.ts.map +1 -1
  48. package/dist/sqlite.js +1118 -917
  49. package/dist/store/in-memory/in-memory-state.constants.d.ts +14 -0
  50. package/dist/store/in-memory/in-memory-state.constants.d.ts.map +1 -0
  51. package/dist/store/in-memory/in-memory-state.d.ts +0 -4
  52. package/dist/store/in-memory/in-memory-state.d.ts.map +1 -1
  53. package/dist/store/in-memory/in-memory-store.d.ts.map +1 -1
  54. package/dist/store/in-memory/types.d.ts +1 -2
  55. package/dist/store/in-memory/types.d.ts.map +1 -1
  56. package/dist/store/index.d.ts +2 -1
  57. package/dist/store/index.d.ts.map +1 -1
  58. package/dist/store/lost-write.d.ts +8 -8
  59. package/dist/store/lost-write.d.ts.map +1 -1
  60. package/dist/store/lost-write.types.d.ts +1 -1
  61. package/dist/store/lost-write.types.d.ts.map +1 -1
  62. package/dist/store/{engine/project-key.d.ts → project-key.d.ts} +0 -5
  63. package/dist/store/project-key.d.ts.map +1 -0
  64. package/dist/store/resolve-store.d.ts +6 -18
  65. package/dist/store/resolve-store.d.ts.map +1 -1
  66. package/dist/store/sqlite/adapter/in-process-link.constants.d.ts +12 -0
  67. package/dist/store/sqlite/adapter/in-process-link.constants.d.ts.map +1 -0
  68. package/dist/store/sqlite/adapter/in-process-link.d.ts +1 -1
  69. package/dist/store/sqlite/adapter/in-process-link.d.ts.map +1 -1
  70. package/dist/store/sqlite/adapter/sqlite-connector.d.ts +12 -11
  71. package/dist/store/sqlite/adapter/sqlite-connector.d.ts.map +1 -1
  72. package/dist/store/sqlite/adapter/sqlite-connector.types.d.ts +7 -0
  73. package/dist/store/sqlite/adapter/sqlite-connector.types.d.ts.map +1 -0
  74. package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts +8 -3
  75. package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts.map +1 -1
  76. package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts +12 -1
  77. package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts.map +1 -1
  78. package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts +2 -2
  79. package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts.map +1 -1
  80. package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts +1 -1
  81. package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts.map +1 -1
  82. package/dist/store/sqlite/engine/engine.types.d.ts +2 -2
  83. package/dist/store/sqlite/engine/engine.types.d.ts.map +1 -1
  84. package/dist/store/sqlite/engine/schema.d.ts.map +1 -1
  85. package/dist/store/sqlite/engine/sqlite-engine.d.ts.map +1 -1
  86. package/dist/store/{hub-public.d.ts → sqlite/hub-public.d.ts} +9 -9
  87. package/dist/store/sqlite/hub-public.d.ts.map +1 -0
  88. package/dist/store/sqlite/packaging/engine-packaging.constants.d.ts +15 -0
  89. package/dist/store/sqlite/packaging/engine-packaging.constants.d.ts.map +1 -0
  90. package/dist/store/sqlite/runtime/close-engine.d.ts +5 -2
  91. package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -1
  92. package/dist/store/sqlite/runtime/engine-control-loop.d.ts +11 -0
  93. package/dist/store/sqlite/runtime/engine-control-loop.d.ts.map +1 -0
  94. package/dist/store/sqlite/runtime/install-pool.d.ts +1 -1
  95. package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -1
  96. package/dist/store/sqlite/runtime/progress-beat.d.ts +1 -1
  97. package/dist/store/sqlite/runtime/progress-beat.d.ts.map +1 -1
  98. package/dist/store/sqlite/runtime/runtime.types.d.ts +7 -4
  99. package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -1
  100. package/dist/store/sqlite/runtime/serve-sqlite-engine.d.ts +9 -0
  101. package/dist/store/sqlite/runtime/serve-sqlite-engine.d.ts.map +1 -0
  102. package/dist/store/sqlite/runtime/serve-sqlite-engine.types.d.ts +27 -0
  103. package/dist/store/sqlite/runtime/serve-sqlite-engine.types.d.ts.map +1 -0
  104. package/dist/store/sqlite/served/client/check-engine-wire.d.ts.map +1 -0
  105. package/dist/store/{engine → sqlite/served}/client/client.constants.d.ts +3 -3
  106. package/dist/store/sqlite/served/client/client.constants.d.ts.map +1 -0
  107. package/dist/store/{engine → sqlite/served}/client/client.types.d.ts +13 -8
  108. package/dist/store/sqlite/served/client/client.types.d.ts.map +1 -0
  109. package/dist/store/{engine → sqlite/served}/client/engine-client.d.ts +1 -1
  110. package/dist/store/sqlite/served/client/engine-client.d.ts.map +1 -0
  111. package/dist/store/sqlite/served/client/engine-control.d.ts.map +1 -0
  112. package/dist/store/sqlite/served/client/heartbeat-watch.d.ts.map +1 -0
  113. package/dist/store/{engine → sqlite/served}/client/hub-connector.d.ts +1 -1
  114. package/dist/store/sqlite/served/client/hub-connector.d.ts.map +1 -0
  115. package/dist/store/{engine → sqlite/served}/client/hub-connector.types.d.ts +6 -7
  116. package/dist/store/sqlite/served/client/hub-connector.types.d.ts.map +1 -0
  117. package/dist/store/sqlite/served/client/worker-connector.d.ts.map +1 -0
  118. package/dist/store/sqlite/served/creation-refusal.d.ts.map +1 -0
  119. package/dist/store/sqlite/served/dialecte-refusal.d.ts +19 -0
  120. package/dist/store/sqlite/served/dialecte-refusal.d.ts.map +1 -0
  121. package/dist/store/sqlite/served/engine-lock.d.ts +6 -0
  122. package/dist/store/sqlite/served/engine-lock.d.ts.map +1 -0
  123. package/dist/store/sqlite/served/engine-store.constants.d.ts +3 -0
  124. package/dist/store/sqlite/served/engine-store.constants.d.ts.map +1 -0
  125. package/dist/store/{engine → sqlite/served}/engine-store.d.ts +6 -6
  126. package/dist/store/sqlite/served/engine-store.d.ts.map +1 -0
  127. package/dist/store/sqlite/served/engine-store.types.d.ts.map +1 -0
  128. package/dist/store/sqlite/served/engine.constants.d.ts.map +1 -0
  129. package/dist/store/{engine → sqlite/served}/engine.types.d.ts +2 -4
  130. package/dist/store/sqlite/served/engine.types.d.ts.map +1 -0
  131. package/dist/store/sqlite/served/host/changed.d.ts +5 -0
  132. package/dist/store/sqlite/served/host/changed.d.ts.map +1 -0
  133. package/dist/store/sqlite/served/host/engine-wire.d.ts.map +1 -0
  134. package/dist/store/{engine → sqlite/served}/host/heartbeat.d.ts +1 -1
  135. package/dist/store/sqlite/served/host/heartbeat.d.ts.map +1 -0
  136. package/dist/store/sqlite/served/host/host.constants.d.ts.map +1 -0
  137. package/dist/store/{engine → sqlite/served}/host/host.types.d.ts +4 -3
  138. package/dist/store/sqlite/served/host/host.types.d.ts.map +1 -0
  139. package/dist/store/sqlite/served/host/store-events.constants.d.ts +9 -0
  140. package/dist/store/sqlite/served/host/store-events.constants.d.ts.map +1 -0
  141. package/dist/store/sqlite/served/host/store-events.d.ts.map +1 -0
  142. package/dist/store/sqlite/served/hub/hub-client.constants.d.ts.map +1 -0
  143. package/dist/store/sqlite/served/hub/hub-client.d.ts.map +1 -0
  144. package/dist/store/{engine → sqlite/served}/hub/hub-client.types.d.ts +2 -9
  145. package/dist/store/sqlite/served/hub/hub-client.types.d.ts.map +1 -0
  146. package/dist/store/sqlite/served/hub/hub-protocol.types.d.ts.map +1 -0
  147. package/dist/store/sqlite/served/hub/hub-router.d.ts.map +1 -0
  148. package/dist/store/sqlite/served/hub/hub-shell.d.ts.map +1 -0
  149. package/dist/store/sqlite/served/hub/hub-shell.types.d.ts.map +1 -0
  150. package/dist/store/{engine → sqlite/served}/hub/hub.constants.d.ts +3 -3
  151. package/dist/store/sqlite/served/hub/hub.constants.d.ts.map +1 -0
  152. package/dist/store/{engine → sqlite/served}/hub/hub.types.d.ts +2 -2
  153. package/dist/store/sqlite/served/hub/hub.types.d.ts.map +1 -0
  154. package/dist/store/sqlite/served/hub/hub.worker.d.ts.map +1 -0
  155. package/dist/store/sqlite/served/hub/realm-host.d.ts.map +1 -0
  156. package/dist/store/{engine → sqlite/served}/hub/realm-host.types.d.ts +3 -3
  157. package/dist/store/sqlite/served/hub/realm-host.types.d.ts.map +1 -0
  158. package/dist/store/sqlite/served/wire/error-envelope.d.ts.map +1 -0
  159. package/dist/store/sqlite/served/wire/wire-values.d.ts.map +1 -0
  160. package/dist/store/sqlite/served/wire/wire.constants.d.ts.map +1 -0
  161. package/dist/store/{engine → sqlite/served}/wire/wire.types.d.ts +1 -1
  162. package/dist/store/sqlite/served/wire/wire.types.d.ts.map +1 -0
  163. package/dist/store/sqlite/sqlite-connector-params.d.ts +13 -0
  164. package/dist/store/sqlite/sqlite-connector-params.d.ts.map +1 -0
  165. package/dist/store/sqlite/sqlite-engine-registration.d.ts +30 -0
  166. package/dist/store/sqlite/sqlite-engine-registration.d.ts.map +1 -0
  167. package/dist/store/sqlite/sqlite-error-entry.d.ts +10 -0
  168. package/dist/store/sqlite/sqlite-error-entry.d.ts.map +1 -0
  169. package/dist/store/sqlite/sqlite-errors.constants.d.ts +110 -0
  170. package/dist/store/sqlite/sqlite-errors.constants.d.ts.map +1 -0
  171. package/dist/store/sqlite/sqlite-errors.types.d.ts +7 -0
  172. package/dist/store/sqlite/sqlite-errors.types.d.ts.map +1 -0
  173. package/dist/store/sqlite/sqlite-storage-kind.constants.d.ts +10 -0
  174. package/dist/store/sqlite/sqlite-storage-kind.constants.d.ts.map +1 -0
  175. package/dist/store/sqlite/sqlite-storage-kind.d.ts +3 -0
  176. package/dist/store/sqlite/sqlite-storage-kind.d.ts.map +1 -0
  177. package/dist/store/sqlite/sqlite-storage.constants.d.ts +24 -0
  178. package/dist/store/sqlite/sqlite-storage.constants.d.ts.map +1 -0
  179. package/dist/store/sqlite/sqlite-storage.types.d.ts +27 -0
  180. package/dist/store/sqlite/sqlite-storage.types.d.ts.map +1 -0
  181. package/dist/store/sqlite/sqlite-store-of.d.ts +8 -3
  182. package/dist/store/sqlite/sqlite-store-of.d.ts.map +1 -1
  183. package/dist/store/storage-kinds.constants.d.ts +16 -0
  184. package/dist/store/storage-kinds.constants.d.ts.map +1 -0
  185. package/dist/store/storage-kinds.d.ts +43 -0
  186. package/dist/store/storage-kinds.d.ts.map +1 -0
  187. package/dist/store/storage-kinds.types.d.ts +46 -0
  188. package/dist/store/storage-kinds.types.d.ts.map +1 -0
  189. package/dist/store/store.types.d.ts +6 -4
  190. package/dist/store/store.types.d.ts.map +1 -1
  191. package/dist/test/assert-xml/assert-xml.d.ts +4 -2
  192. package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
  193. package/dist/test/assert-xml/index.d.ts +1 -0
  194. package/dist/test/assert-xml/index.d.ts.map +1 -1
  195. package/dist/test/assert-xml/xml-assertion-error.d.ts +8 -0
  196. package/dist/test/assert-xml/xml-assertion-error.d.ts.map +1 -0
  197. package/dist/test/create-test-dialecte.constants.d.ts +4 -0
  198. package/dist/test/create-test-dialecte.constants.d.ts.map +1 -0
  199. package/dist/test/create-test-dialecte.d.ts.map +1 -1
  200. package/dist/test/indexeddb-storage.setup.d.ts +1 -0
  201. package/dist/test/indexeddb-storage.setup.d.ts.map +1 -0
  202. package/dist/test/test-storage/index.d.ts +1 -1
  203. package/dist/test/test-storage/index.d.ts.map +1 -1
  204. package/dist/test/test-storage/sqlite-test-store.d.ts +15 -0
  205. package/dist/test/test-storage/sqlite-test-store.d.ts.map +1 -0
  206. package/dist/test/test-storage/test-storage.types.d.ts +12 -0
  207. package/dist/test/test-storage/test-storage.types.d.ts.map +1 -1
  208. package/dist/test/test-storage/test-store-for.d.ts +18 -6
  209. package/dist/test/test-storage/test-store-for.d.ts.map +1 -1
  210. package/dist/test/test-storage/test-store-providers.constants.d.ts +8 -0
  211. package/dist/test/test-storage/test-store-providers.constants.d.ts.map +1 -0
  212. package/dist/test/test-storage/test-store-providers.d.ts +11 -0
  213. package/dist/test/test-storage/test-store-providers.d.ts.map +1 -0
  214. package/dist/test.js +805 -765
  215. package/dist/{utils-USNkj4sT.js → utils-Cv4oHia0.js} +63 -137
  216. package/dist/utils.js +1 -1
  217. package/package.json +40 -8
  218. package/skills/dialecte/SKILL.md +8 -6
  219. package/skills/dialecte/references/api.json +93 -66
  220. package/skills/dialecte/references/api.md +463 -461
  221. package/skills/dialecte/references/core-api.md +42 -15
  222. package/skills/dialecte/references/testing.md +167 -11
  223. package/skills/dialecte-contributing/SKILL.md +1 -1
  224. package/skills/dialecte-contributing/references/code-rules.md +7 -0
  225. package/skills/dialecte-contributing/references/landing-changes.md +4 -4
  226. package/skills/dialecte-lot/SKILL.md +67 -28
  227. package/skills/dialecte-lot/references/briefs.md +30 -6
  228. package/skills/dialecte-lot/references/standard-check.md +2 -2
  229. package/skills/dialecte-lot/references/stations.md +5 -3
  230. package/dist/assets/hub.worker-B1HcVDhn.js +0 -2
  231. package/dist/engine.constants-DBMjMmV9.js +0 -98
  232. package/dist/engine.d.ts +0 -9
  233. package/dist/engine.d.ts.map +0 -1
  234. package/dist/running-operations-vnijBvn7.js +0 -76
  235. package/dist/store/engine/client/check-engine-wire.d.ts.map +0 -1
  236. package/dist/store/engine/client/client.constants.d.ts.map +0 -1
  237. package/dist/store/engine/client/client.types.d.ts.map +0 -1
  238. package/dist/store/engine/client/engine-client.d.ts.map +0 -1
  239. package/dist/store/engine/client/engine-control.d.ts.map +0 -1
  240. package/dist/store/engine/client/heartbeat-watch.d.ts.map +0 -1
  241. package/dist/store/engine/client/hub-connector.d.ts.map +0 -1
  242. package/dist/store/engine/client/hub-connector.types.d.ts.map +0 -1
  243. package/dist/store/engine/client/worker-connector.d.ts.map +0 -1
  244. package/dist/store/engine/creation-refusal.d.ts.map +0 -1
  245. package/dist/store/engine/dialecte-refusal.d.ts +0 -18
  246. package/dist/store/engine/dialecte-refusal.d.ts.map +0 -1
  247. package/dist/store/engine/engine-store.d.ts.map +0 -1
  248. package/dist/store/engine/engine-store.types.d.ts.map +0 -1
  249. package/dist/store/engine/engine.constants.d.ts.map +0 -1
  250. package/dist/store/engine/engine.types.d.ts.map +0 -1
  251. package/dist/store/engine/host/engine-wire.d.ts.map +0 -1
  252. package/dist/store/engine/host/heartbeat.d.ts.map +0 -1
  253. package/dist/store/engine/host/host.constants.d.ts.map +0 -1
  254. package/dist/store/engine/host/host.types.d.ts.map +0 -1
  255. package/dist/store/engine/host/store-events.d.ts.map +0 -1
  256. package/dist/store/engine/hub/hub-client.constants.d.ts.map +0 -1
  257. package/dist/store/engine/hub/hub-client.d.ts.map +0 -1
  258. package/dist/store/engine/hub/hub-client.types.d.ts.map +0 -1
  259. package/dist/store/engine/hub/hub-protocol.types.d.ts.map +0 -1
  260. package/dist/store/engine/hub/hub-router.d.ts.map +0 -1
  261. package/dist/store/engine/hub/hub-shell.d.ts.map +0 -1
  262. package/dist/store/engine/hub/hub-shell.types.d.ts.map +0 -1
  263. package/dist/store/engine/hub/hub.constants.d.ts.map +0 -1
  264. package/dist/store/engine/hub/hub.types.d.ts.map +0 -1
  265. package/dist/store/engine/hub/hub.worker.d.ts.map +0 -1
  266. package/dist/store/engine/hub/realm-host.d.ts.map +0 -1
  267. package/dist/store/engine/hub/realm-host.types.d.ts.map +0 -1
  268. package/dist/store/engine/project-key.d.ts.map +0 -1
  269. package/dist/store/engine/wire/error-envelope.d.ts.map +0 -1
  270. package/dist/store/engine/wire/wire-values.d.ts.map +0 -1
  271. package/dist/store/engine/wire/wire.constants.d.ts.map +0 -1
  272. package/dist/store/engine/wire/wire.types.d.ts.map +0 -1
  273. package/dist/store/hub-public.d.ts.map +0 -1
  274. package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts +0 -16
  275. package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts.map +0 -1
  276. package/dist/store/sqlite-storage.constants.d.ts +0 -14
  277. package/dist/store/sqlite-storage.constants.d.ts.map +0 -1
  278. package/dist/store/sqlite-storage.d.ts +0 -22
  279. package/dist/store/sqlite-storage.d.ts.map +0 -1
  280. package/dist/store/sqlite-storage.types.d.ts +0 -24
  281. package/dist/store/sqlite-storage.types.d.ts.map +0 -1
  282. package/dist/test/test-dialecte.worker.d.ts +0 -2
  283. package/dist/test/test-dialecte.worker.d.ts.map +0 -1
  284. /package/dist/store/{engine → sqlite/served}/client/check-engine-wire.d.ts +0 -0
  285. /package/dist/store/{engine → sqlite/served}/client/engine-control.d.ts +0 -0
  286. /package/dist/store/{engine → sqlite/served}/client/heartbeat-watch.d.ts +0 -0
  287. /package/dist/store/{engine → sqlite/served}/client/worker-connector.d.ts +0 -0
  288. /package/dist/store/{engine → sqlite/served}/creation-refusal.d.ts +0 -0
  289. /package/dist/store/{engine → sqlite/served}/engine-store.types.d.ts +0 -0
  290. /package/dist/store/{engine → sqlite/served}/engine.constants.d.ts +0 -0
  291. /package/dist/store/{engine → sqlite/served}/host/engine-wire.d.ts +0 -0
  292. /package/dist/store/{engine → sqlite/served}/host/host.constants.d.ts +0 -0
  293. /package/dist/store/{engine → sqlite/served}/host/store-events.d.ts +0 -0
  294. /package/dist/store/{engine → sqlite/served}/hub/hub-client.constants.d.ts +0 -0
  295. /package/dist/store/{engine → sqlite/served}/hub/hub-client.d.ts +0 -0
  296. /package/dist/store/{engine → sqlite/served}/hub/hub-protocol.types.d.ts +0 -0
  297. /package/dist/store/{engine → sqlite/served}/hub/hub-router.d.ts +0 -0
  298. /package/dist/store/{engine → sqlite/served}/hub/hub-shell.d.ts +0 -0
  299. /package/dist/store/{engine → sqlite/served}/hub/hub-shell.types.d.ts +0 -0
  300. /package/dist/store/{engine → sqlite/served}/hub/hub.worker.d.ts +0 -0
  301. /package/dist/store/{engine → sqlite/served}/hub/realm-host.d.ts +0 -0
  302. /package/dist/store/{engine → sqlite/served}/wire/error-envelope.d.ts +0 -0
  303. /package/dist/store/{engine → sqlite/served}/wire/wire-values.d.ts +0 -0
  304. /package/dist/store/{engine → sqlite/served}/wire/wire.constants.d.ts +0 -0
@@ -1,5 +1,10 @@
1
1
  // src/errors/errors.constants.ts
2
- var e = "https://dialecte.github.io/core", t = {
2
+ var e = "https://dialecte.github.io/core", t = /* @__PURE__ */ new Set([
3
+ "throwDialecteError",
4
+ "createDialecteError",
5
+ "invariant",
6
+ "reportFailure"
7
+ ]), n = {
3
8
  UNKNOWN: {
4
9
  code: "D0001",
5
10
  message: "An unknown error occurred",
@@ -13,7 +18,7 @@ var e = "https://dialecte.github.io/core", t = {
13
18
  code: "D0002",
14
19
  message: "Assertion failed",
15
20
  explanation: {
16
- when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, an engine running an sqlite-wasm older than 3.54.1, which removes a project on a failed install).",
21
+ when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, a store running on a dependency older than the one it supports).",
17
22
  fix: "Read `detail`: it names the condition. Give `invariant` a key of its own when the failure is one a caller should handle.",
18
23
  docs: `${e}/guide/development/state-and-errors#error-catalog`
19
24
  }
@@ -22,8 +27,8 @@ var e = "https://dialecte.github.io/core", t = {
22
27
  code: "D1001",
23
28
  message: "Failed to open database",
24
29
  explanation: {
25
- when: "The project's database could not be opened (the SQLite file or its worker did not start), or the origin's hub could not be joined: its SharedWorker failed to start or was blocked, or a child's port went unanswered past the welcome budget (its page unbound it).",
26
- fix: "Check the browser supports the store (OPFS, workers, SharedWorker for the hub) and that no other tab holds the project; reload, or open the project with another storage. A child view refused so is bound again by its page (`createHubPort`, then `adoptHubPort`).",
30
+ when: "The store could not open the project's data, or could not reach what serves it (its database, a worker, a server): it failed to start, was blocked, or went unanswered; the failure is the `cause` when there is one.",
31
+ fix: "Check the browser supports what the store needs and that no other tab holds the project; reload, or open the project with another storage. The store's own docs name what it needs.",
27
32
  docs: `${e}/api/project#store-errors`
28
33
  }
29
34
  },
@@ -112,38 +117,11 @@ var e = "https://dialecte.github.io/core", t = {
112
117
  code: "D1011",
113
118
  message: "Failed to read from database",
114
119
  explanation: {
115
- when: "The SQLite store's database failed under a read; the failure is the `cause`.",
120
+ when: "The store's database failed under a read; the failure is the `cause`.",
116
121
  fix: "Read `cause`; reopen the project. A lasting failure means the file is damaged: import its documents again.",
117
122
  docs: `${e}/api/project#store-errors`
118
123
  }
119
124
  },
120
- STORE_PROTOCOL_MISMATCH: {
121
- code: "D1012",
122
- message: "Another version of the library holds the shared store connection",
123
- explanation: {
124
- when: "Another version of the library already holds the shared store connection (another tab runs an older or newer build).",
125
- fix: "Close the other tabs of the app, or reload them all on the same version.",
126
- docs: `${e}/api/project#store-errors`
127
- }
128
- },
129
- STORE_REALM_ID_TAKEN: {
130
- code: "D1013",
131
- message: "A view with this id is already connected to the shared store",
132
- explanation: {
133
- when: "A view joined the shared store with an id another connected view already uses.",
134
- fix: "Give each view its own id; reload the page that reused one.",
135
- docs: `${e}/api/project#store-errors`
136
- }
137
- },
138
- STORE_REALM_UNKNOWN: {
139
- code: "D1014",
140
- message: "The shared store does not know this view",
141
- explanation: {
142
- when: "A view spoke to the shared store without having joined it, or after it left.",
143
- fix: "Join (open the project) before reading or writing; reload a view that was disconnected.",
144
- docs: `${e}/api/project#store-errors`
145
- }
146
- },
147
125
  STORE_VALUE_NOT_JSON: {
148
126
  code: "D1015",
149
127
  message: "A value handed to the store is not JSON",
@@ -157,8 +135,8 @@ var e = "https://dialecte.github.io/core", t = {
157
135
  code: "D1016",
158
136
  message: "This browser gives the page no storage for a project",
159
137
  explanation: {
160
- when: "The browser gives the page no private file system (a private window), or a worker no synchronous file access, so the SQLite project store cannot create, open or destroy the project; nothing is changed.",
161
- fix: "Open the app in a normal (not private) window of a browser that supports the origin private file system.",
138
+ when: "The browser gives the page none of the storage the store needs (a private window, an API the browser lacks), so it cannot create, open or destroy the project; nothing is changed.",
139
+ fix: "Open the app in a normal (not private) window of a browser that supports what the project's store needs, or open the project with another storage.",
162
140
  docs: `${e}/api/project#store-errors`
163
141
  }
164
142
  },
@@ -166,27 +144,27 @@ var e = "https://dialecte.github.io/core", t = {
166
144
  code: "D1017",
167
145
  message: "Not enough storage left for the project",
168
146
  explanation: {
169
- when: "The origin has too little storage left: for a new project's files, for an import (eight times the file's size and at least 1 MiB, less the project's free pages), or the file system refused a write for want of space; nothing of the call applied. The SQLite project store answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`) until it moves to SQLite; the in-memory store has no limit.",
147
+ when: "The origin has too little storage left for what the call needs (a new project's files, an import's room ahead of it), or the store's storage refused a write for want of space; nothing of the call applied. A store that checks the room it needs answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`); the in-memory store has no limit.",
170
148
  fix: "Free storage for the origin (delete projects no longer needed) or import a smaller file, then try again; `meta.needed` and `meta.available` give the sizes when known.",
171
149
  docs: `${e}/api/project#store-errors`
172
150
  }
173
151
  },
174
- STORE_ENGINE_LOST: {
152
+ STORE_CONNECTION_LOST: {
175
153
  code: "D1018",
176
- message: "The project engine stopped answering",
154
+ message: "The store lost its connection",
177
155
  explanation: {
178
- when: "A call to a project engine served from a worker lost that engine: it ended with what hosted it or gave no answer within its budget (`meta.reason` `'host-gone'`), it sent nothing for too long while the call waited (`'no-heartbeat'`, it may still finish), or the hub dropped this view with the page that bound it - frozen, gone, or unbinding it (`'realm-dropped'`: every call, `getWriteOutcome` too, is refused so until the view is bound again).",
179
- fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (a silent engine may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. For `'realm-dropped'`, every call is refused until the page binds the view again once it is back (`onRejoined`, then `createHubPort`, its port handed to the view's `adoptHubPort`).",
180
- docs: `${e}/api/project#store-errors`
156
+ when: "A call to a store whose project is served elsewhere (a worker, another realm, a server) lost its connection to what serves it: that went away or gave no answer within its budget, sent nothing for too long while the call waited (the call may still finish), or dropped this view. `meta.reason` is the store's own word for why, listed in its docs; a write's refusal carries `meta.writeId`.",
157
+ fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (what serves the store may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. The store's docs say what each `meta.reason` asks of the app.",
158
+ docs: `${e}/api/project#a-lost-connection`
181
159
  }
182
160
  },
183
- STORE_HUB_SPAWNERS_FIXED: {
184
- code: "D1019",
185
- message: "The page's hub connection runs another version of this dialecte's engine",
161
+ STORE_KIND_TAKEN: {
162
+ code: "D1021",
163
+ message: "This storage type is registered already by another kind",
186
164
  explanation: {
187
- when: "`connectHub({ spawners })` named a dialecte whose engine the page's connection already runs at another version, or a project was opened (or destroyed by name) on `sqlite` from a factory of such a version (the project offers its engine to the hub as it opens): a page runs one version of each dialecte's engine (two would split a project's views between two engines). A later call adds the engines of dialectes the page does not run yet. `meta.spawners` names the dialectes (id and version) refused; nothing of the call was added, nothing opened.",
188
- fix: "Ship one version of each dialecte in the app: register each dialecte's `factory.spawner` from the copy the app opens its projects with.",
189
- docs: `${e}/api/project#store-errors`
165
+ when: "`registerStorageKind({ type, kind })` named a type a kind of another `id` holds already: the first registration in the realm is kept, nothing replaced (the same `id` again does nothing: a module evaluated twice, or another copy of the package). `meta`: `type`, `registered` (the id kept), `asked` (the id refused).",
166
+ fix: "Register each storage type once, from one package: import the entry that registers it from a single copy, or give the other kind a type of its own.",
167
+ docs: `${e}/guide/development/implementing-a-store#register-a-storage-kind`
190
168
  }
191
169
  },
192
170
  ELEMENT_NOT_FOUND: {
@@ -477,47 +455,20 @@ var e = "https://dialecte.github.io/core", t = {
477
455
  docs: `${e}/api/project#blobs`
478
456
  }
479
457
  },
480
- PROJECT_LAYOUT_OUTDATED: {
481
- code: "D7005",
482
- message: "Project stored by another version of the library",
483
- explanation: {
484
- when: "The project file was stored by another version of the library (another layout); nothing was written to it.",
485
- fix: "Delete the project and import its files again with this version.",
486
- docs: `${e}/api/project#store-errors`
487
- }
488
- },
489
- PROJECT_ENGINE_UNAVAILABLE: {
490
- code: "D7006",
491
- message: "No view can start the project engine",
492
- explanation: {
493
- when: "The project's engine could not be started or reached: its worker failed to load or never answered its open within the open budget; through the origin's hub, no open view offers an engine for the project's dialecte, or the engine never said it opened; a destroy still running past the open budget, or one asked by a page suspended before the hub granted it.",
494
- fix: "Keep one tab of the app open and reload; check the dialecte's `engineUrl` points at its worker and that it loads (the console names a script that fails); a destroy refused so is asked again once the project is closed elsewhere.",
495
- docs: `${e}/api/project#store-errors`
496
- }
497
- },
498
- PROJECT_ENGINE_BUSY: {
499
- code: "D7007",
500
- message: "The project is still held by another engine",
501
- explanation: {
502
- when: "Another engine still holds the project (another tab or a worker that did not stop).",
503
- fix: "Close the other tabs of the app, then open the project again.",
504
- docs: `${e}/api/project#store-errors`
505
- }
506
- },
507
458
  PROJECT_DIALECTE_MISMATCH: {
508
459
  code: "D7008",
509
- message: "The project's engine or file is of another dialecte",
460
+ message: "The project's data is of another dialecte",
510
461
  explanation: {
511
- when: "A project file stored by another dialecte was opened (nothing of it written); or an engine was asked for a project of another dialecte than its own - the dialecte's `engineUrl` (its project factory's, or a hub spawner's) pointing at another dialecte's worker. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `projectDialecteId` (the engine's or the file's), `realmDialecteId` (the one asked).",
512
- fix: "Open the project with the dialecte it was created with; point the dialecte's `engineUrl` at its own worker.",
462
+ when: "A project stored by another dialecte was opened (nothing of it written), or what serves the store (a worker, a server) was asked for a project of a dialecte it does not serve. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `realmDialecteId` (the one asked), and `projectDialecteId` (the project's), or the dialectes served, as the store's docs name them.",
463
+ fix: "Open the project with the dialecte it was created with; serve every dialecte the app opens projects of, as the store's docs say.",
513
464
  docs: `${e}/api/project#store-errors`
514
465
  }
515
466
  },
516
467
  PROJECT_DIALECTE_VERSION_MISMATCH: {
517
468
  code: "D7009",
518
- message: "The project engine runs another version of the dialecte",
469
+ message: "The project's store runs another version of the dialecte",
519
470
  explanation: {
520
- when: "The project's engine runs another version of the dialecte than this view.",
471
+ when: "What serves the project's store (a worker, a server) runs another version of the dialecte than this view: another tab's, or one this page runs already for the project (a page runs one version of each dialecte).",
521
472
  fix: "Reload every tab of the app so they run the same version.",
522
473
  docs: `${e}/api/project#store-errors`
523
474
  }
@@ -526,7 +477,7 @@ var e = "https://dialecte.github.io/core", t = {
526
477
  code: "D7010",
527
478
  message: "The project could not be deleted",
528
479
  explanation: {
529
- when: "Destroying a project left its files in place: another tab or worker still holds one.",
480
+ when: "Destroying a project left its data in place: another tab, window or connection still holds it.",
530
481
  fix: "Close the other tabs or windows of the app that have the project open, then destroy it again.",
531
482
  docs: `${e}/api/project#lifecycle`
532
483
  }
@@ -540,20 +491,11 @@ var e = "https://dialecte.github.io/core", t = {
540
491
  docs: `${e}/api/project#lifecycle`
541
492
  }
542
493
  },
543
- PROJECT_DATABASE_LOST: {
544
- code: "D7012",
545
- message: "The project's database is gone",
546
- explanation: {
547
- when: "The project's files hold data but none of them is its database any more: the database file's header was damaged (by the disk, another program, or site data changed outside the app). Nothing is opened or changed: no empty database is made in its place. `meta.project` names the project.",
548
- fix: "The project's data cannot be read back. Offer the user a reset, never automatically: `destroy()` on the same Project instance whose `open` was refused (keep it: `const project = new Project(params)`, then `await project.open(name)`) removes what the refused store holds, without opening it; `open(name)` then makes it again, empty, and its documents can be imported again.",
549
- docs: `${e}/api/project#lifecycle`
550
- }
551
- },
552
494
  PROJECT_DESTROYED_WHILE_AWAY: {
553
495
  code: "D7013",
554
496
  message: "The project was deleted while this view was away",
555
497
  explanation: {
556
- when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, its engine started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",
498
+ when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, what serves its store started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",
557
499
  fix: "Tell the user the project was deleted elsewhere; close it in this view (`project.close()`), then open it again by its name for what is there now, or choose another.",
558
500
  docs: `${e}/api/project#lifecycle`
559
501
  }
@@ -562,27 +504,18 @@ var e = "https://dialecte.github.io/core", t = {
562
504
  code: "D7014",
563
505
  message: "The project's name cannot name its files",
564
506
  explanation: {
565
- when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a SQLite project's files sit in a directory named after both, which no directory can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",
507
+ when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a store may name its files after both, which no file can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",
566
508
  fix: "Give the project a name of its own (and the dialecte an id) other than an empty one, `.` or `..`.",
567
509
  docs: `${e}/api/project#lifecycle`
568
510
  }
569
511
  },
570
- PROJECT_ENGINE_NOT_DECLARED: {
571
- code: "D7015",
572
- message: "This project has no engine to open it on SQLite",
512
+ PROJECT_STORAGE_NOT_REGISTERED: {
513
+ code: "D7018",
514
+ message: "The project's storage type is not registered",
573
515
  explanation: {
574
- when: "A project was opened on `storage: { type: 'sqlite' }` but made by no dialecte's project factory: its engine (the dialecte's id, its version and its engine worker's URL) is known to no one, so nothing can start it. Nothing was opened.",
575
- fix: "Make the project with the dialecte's project factory (`createProjectFactory({ dialecte, engineUrl })`, as a dialecte package exports it), or open it on another storage.",
576
- docs: `${e}/api/project#sqlite-storage`
577
- }
578
- },
579
- PROJECT_SQLITE_NOT_IMPORTED: {
580
- code: "D7016",
581
- message: "SQLite storage needs `import '@dialecte/core/sqlite'`",
582
- explanation: {
583
- when: "A project was opened (or destroyed by name) on `storage: { type: 'sqlite' }`, or a test asked for the `sqlite` test store, but the app never imported `@dialecte/core/sqlite`: the SQLite storage kind lives behind that entry, so an app that never imports it neither emits nor downloads the SQLite engine, its wasm or the hub. Nothing was opened.",
584
- fix: "Add `import '@dialecte/core/sqlite'` once to the app's entry (for tests, to the test runner's setup file), before the first project is opened on SQLite; or open the project on another storage. Imported already? The import registers the kind for every copy of @dialecte/core of the same SQLite storage version in the realm: a copy of another one (a dialecte bringing its own core) does not see it - align the core versions.",
585
- docs: `${e}/api/project#sqlite-storage`
516
+ when: "A project was opened (or destroyed by name), or a test asked for a test store, on a `storage.type` no kind is registered for in this realm: core serves `local`, `inMemory` and `custom` itself, every other type comes from the entry that registers it (`registerStorageKind`). Nothing was opened. `meta`: `project`, `type`.",
517
+ fix: "Import the entry that registers the type once in the app's entry (for tests, in the test runner's setup file), before the first project opens on it; or open the project on another storage. Imported already? A kind is shared by every copy of @dialecte/core of the same storage version in the realm: one registered by a copy of another version (a package bringing its own core) is not seen - align the core versions.",
518
+ docs: `${e}/guide/development/implementing-a-store#register-a-storage-kind`
586
519
  }
587
520
  },
588
521
  DOCUMENT_PATH_INVALID: {
@@ -603,54 +536,47 @@ var e = "https://dialecte.github.io/core", t = {
603
536
  docs: `${e}/api/project#a-document-s-path`
604
537
  }
605
538
  }
606
- };
539
+ }, r = new Set(Object.values(n).map((e) => e.code));
607
540
  // src/errors/errors.ts
608
- function n(e, t) {
609
- throw r(e, t);
541
+ function i(e, t) {
542
+ throw a(e, t);
610
543
  }
611
- function r(e, n) {
544
+ function a(e, t) {
612
545
  let r = typeof e == "string" ? {
613
546
  key: e,
614
- ...t[e]
547
+ ...n[e]
615
548
  } : e, i = {
616
549
  code: r.code,
617
550
  key: r.key,
618
- message: n.message ?? r.message,
619
- detail: n.detail,
551
+ message: t.message ?? r.message,
552
+ detail: t.detail,
620
553
  method: l((/* @__PURE__ */ Error()).stack),
621
- ref: n.ref,
622
- meta: n.meta,
623
- cause: n.cause
624
- }, a = Error(n.detail);
554
+ ref: t.ref,
555
+ meta: t.meta,
556
+ cause: t.cause
557
+ }, a = Error(t.detail);
625
558
  return a.cause = i, a;
626
559
  }
627
- function i(e) {
628
- let r = {}, i = /* @__PURE__ */ new Map();
560
+ function o(e) {
561
+ let t = {}, a = /* @__PURE__ */ new Map();
629
562
  for (let [o, s] of Object.entries(e)) {
630
- Object.hasOwn(t, o) && n("ASSERTION_FAILED", { detail: `defineErrors: "${o}" is a key of the core catalogue` }), a.has(s.code) && n("ASSERTION_FAILED", { detail: `defineErrors: "${o}" uses "${s.code}", a code of the core catalogue` });
631
- let e = i.get(s.code);
632
- e && n("ASSERTION_FAILED", { detail: `defineErrors: "${o}" uses "${s.code}", the code of "${e}"` }), i.set(s.code, o), r[o] = {
563
+ Object.hasOwn(n, o) && i("ASSERTION_FAILED", { detail: `defineErrors: "${o}" is a key of the core catalogue` }), r.has(s.code) && i("ASSERTION_FAILED", { detail: `defineErrors: "${o}" uses "${s.code}", a code of the core catalogue` });
564
+ let e = a.get(s.code);
565
+ e && i("ASSERTION_FAILED", { detail: `defineErrors: "${o}" uses "${s.code}", the code of "${e}"` }), a.set(s.code, o), t[o] = {
633
566
  key: o,
634
567
  ...s
635
568
  };
636
569
  }
637
- return r;
570
+ return t;
638
571
  }
639
- var a = new Set(Object.values(t).map((e) => e.code));
640
- function o(e) {
572
+ function s(e) {
641
573
  if (!(e instanceof Error)) return;
642
574
  let t = e.cause;
643
575
  if (!(!t || t instanceof Error) && typeof t.key == "string" && typeof t.code == "string") return t;
644
576
  }
645
- function s(e, n) {
646
- return Object.hasOwn(t, e.key) ? !0 : n.catalogues.some((t) => Object.hasOwn(t, e.key) && t[e.key]?.code === e.code);
577
+ function c(e, t) {
578
+ return Object.hasOwn(n, e.key) ? !0 : t.catalogues.some((t) => Object.hasOwn(t, e.key) && t[e.key]?.code === e.code);
647
579
  }
648
- var c = /* @__PURE__ */ new Set([
649
- "throwDialecteError",
650
- "createDialecteError",
651
- "invariant",
652
- "reportFailure"
653
- ]);
654
580
  function l(e) {
655
581
  if (!e) return "unknown";
656
582
  let t = e.split("\n").slice(1).map((e) => e.match(/\bat\s+(?:async\s+)?(\S+)(?:\s+\[as\s+[^\]]+\])?\s+\(([^)]+)\)/)).find((e) => !u(e?.[1])), n = t?.[1]?.replace(/^Object\./, ""), r = t?.[2];
@@ -659,7 +585,7 @@ function l(e) {
659
585
  return i ? `${i[1].replace(/\.[^/.]+$/, "")}::${n}` : n;
660
586
  }
661
587
  function u(e) {
662
- return e ? c.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
588
+ return e ? t.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
663
589
  }
664
590
  // src/utils/xml-whitespace.constants.ts
665
591
  var d = /[ \t\r\n]+/g;
@@ -1062,9 +988,9 @@ function le(e, t = {}) {
1062
988
  // src/utils/invariant.ts
1063
989
  function ue(e, t) {
1064
990
  if (e) return;
1065
- let { detail: r, key: i = "ASSERTION_FAILED", ref: a, meta: o } = t;
1066
- n(i, {
1067
- detail: r,
991
+ let { detail: n, key: r = "ASSERTION_FAILED", ref: a, meta: o } = t;
992
+ i(r, {
993
+ detail: n,
1068
994
  ref: a,
1069
995
  meta: o
1070
996
  });
@@ -1272,4 +1198,4 @@ function Ce(e) {
1272
1198
  return t;
1273
1199
  };
1274
1200
  }
1275
- export { S as A, f as B, k as C, C as D, x as E, te as F, o as G, i as H, ne as I, t as K, ee as L, g as M, _ as N, w as O, b as P, y as R, ae as S, T, s as U, r as V, n as W, R as _, me as a, M as b, pe as c, fe as d, ue as f, L as g, z as h, X as i, v as j, E as k, K as l, B as m, Q as n, q as o, le as p, ye as r, J as s, Ce as t, de as u, I as v, O as w, oe as x, se as y, m as z };
1201
+ export { S as A, f as B, k as C, C as D, x as E, te as F, s as G, o as H, ne as I, n as K, ee as L, g as M, _ as N, w as O, b as P, y as R, ae as S, T, c as U, a as V, i as W, R as _, me as a, M as b, pe as c, fe as d, ue as f, L as g, z as h, X as i, v as j, E as k, K as l, B as m, Q as n, q as o, le as p, e as q, ye as r, J as s, Ce as t, de as u, I as v, O as w, oe as x, se as y, m as z };
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- export { C as admittedXsiTypes, T as canonicalXsiType, v as childOccurrences, o as compareQualifiedAttributes, t as createSeededRandomUuid, g as enumeratedValues, y as extractLocalName, p as formatEmbeddedXml, m as formatXml, b as getAttributeRules, f as invariant, s as isNamespaceAllowedByWildcard, x as isSchemaDefaultValue, c as orderAttributesBySequence, a as orderByConfigSequence, i as requiredChoices, w as resolveDefinition, l as resolveNamespaceByPrefix, u as resolveNamespaceByScope, d as resolvePrefixByNamespaceScope, S as resolveSchemaAttributeValue, D as resolveXsiType, r as saveToDisk, _ as valuePatterns } from "./utils-USNkj4sT.js";
1
+ export { C as admittedXsiTypes, T as canonicalXsiType, v as childOccurrences, o as compareQualifiedAttributes, t as createSeededRandomUuid, g as enumeratedValues, y as extractLocalName, p as formatEmbeddedXml, m as formatXml, b as getAttributeRules, f as invariant, s as isNamespaceAllowedByWildcard, x as isSchemaDefaultValue, c as orderAttributesBySequence, a as orderByConfigSequence, i as requiredChoices, w as resolveDefinition, l as resolveNamespaceByPrefix, u as resolveNamespaceByScope, d as resolvePrefixByNamespaceScope, S as resolveSchemaAttributeValue, D as resolveXsiType, r as saveToDisk, _ as valuePatterns } from "./utils-Cv4oHia0.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialecte/core",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "description": "Dialecte - Core functionality for Dialecte SDK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,10 +36,6 @@
36
36
  "types": "./dist/helpers.d.ts",
37
37
  "default": "./dist/helpers.js"
38
38
  },
39
- "./engine": {
40
- "types": "./dist/engine.d.ts",
41
- "default": "./dist/engine.js"
42
- },
43
39
  "./sqlite": {
44
40
  "types": "./dist/sqlite.d.ts",
45
41
  "default": "./dist/sqlite.js"
@@ -56,9 +52,11 @@
56
52
  "doc:preview": "vitepress preview",
57
53
  "//====== TEST ======//": "",
58
54
  "test": "npm run test:node && npm run test:browser",
59
- "test:node": "vitest run --project node --project node-indexeddb --project node-sqlite",
55
+ "test:node": "vitest run --project node --project node-indexeddb --project node-sqlite --project node-indexeddb-documents",
56
+ "test:scope": "tsx scripts/test-scope/run-test-scope.ts",
60
57
  "test:browser": "vitest run --project browser",
61
58
  "test:browser:all": "vitest run --project browser-all",
59
+ "test:browser:release": "STORE_CONTRACT_FULL_TABLE=1 vitest run --project browser-all",
62
60
  "test:perf": "VITE_BENCH=1 vitest run --project perf --mode bench --reporter=verbose",
63
61
  "test:perf:node": "VITE_BENCH=1 vitest run --project perf-node --mode bench --reporter=verbose",
64
62
  "test:hook": "dialecte gate --hook",
@@ -90,7 +88,7 @@
90
88
  "sax": "^1.4.3"
91
89
  },
92
90
  "devDependencies": {
93
- "@dialecte/cli": "0.3.1",
91
+ "@dialecte/cli": "0.4.0",
94
92
  "@tsconfig/node24": "^24.0.4",
95
93
  "@types/node": "^24.12.4",
96
94
  "@typescript/native": "npm:typescript@^7.0.2",
@@ -162,8 +160,42 @@
162
160
  },
163
161
  {
164
162
  "name": "browser tests",
165
- "run": "npx vitest run --project browser",
163
+ "run": "npm run test:scope",
164
+ "counts": "tests",
165
+ "scoped": true
166
+ }
167
+ ],
168
+ "release": [
169
+ {
170
+ "name": "check",
171
+ "run": "npm run check"
172
+ },
173
+ {
174
+ "name": "skills",
175
+ "run": "npm run skills:check"
176
+ },
177
+ {
178
+ "name": "build",
179
+ "run": "npm run build"
180
+ },
181
+ {
182
+ "name": "tests",
183
+ "run": "npm run test:node",
166
184
  "counts": "tests"
185
+ },
186
+ {
187
+ "name": "browser tests",
188
+ "run": "npm run test:browser:release",
189
+ "counts": "tests",
190
+ "heavy": true
191
+ },
192
+ {
193
+ "name": "type narrowing",
194
+ "run": "npm run type-narrowing"
195
+ },
196
+ {
197
+ "name": "type bench",
198
+ "run": "npm run type-bench:check"
167
199
  }
168
200
  ]
169
201
  }
@@ -21,7 +21,7 @@ uuid/name fix-up that a hook already performs on every write. This skill exists
21
21
 
22
22
  ```
23
23
  your app custom extensions, services, UI (yours)
24
- dialecte package @dialecte/<id>, @acme/widget (domain)
24
+ a dialecte package @dialecte/<id>, @acme/widget (domain)
25
25
  ├ definition/*.generated.ts generated from the XSD - never edited by hand
26
26
  ├ config/ wires the definition into core, `namespace <Name>` types
27
27
  ├ hooks/ automatic coherence on every write and on import
@@ -237,8 +237,9 @@ doc.query.myFeature.findOrphanParts({ assembly }) // first param is bound away
237
237
  (no service, store, composable, component, policy file) and carries none of your product's rules.
238
238
  Where your product decides differently from the plain behaviour, see policies below.
239
239
  - **Tests on the node tier**: table-driven with the package's runner (`<package>/<version>/test` →
240
- `run<Name>TestCases`), inline XML fixtures, the function called directly with `source.query` / `tx`,
241
- not through the bound method. No test names a store: the runner runs them in Node on the in-memory
240
+ `run<Name>TestCases`), whole-document XML fixtures, one call of the unit per test (the function
241
+ with `source.query` / `tx`, or its bound method; never both), see references/testing.md. No test
242
+ names a store: the runner runs them in Node on the in-memory
242
243
  store. See [Testing](#testing).
243
244
 
244
245
  ### Policies: your product's choices, passed per call
@@ -289,9 +290,10 @@ composable then imports them with `import type`): do not wrap a type only to re-
289
290
  Each dialecte package exports table-driven runners from its `/test` entry
290
291
  (`<package>/<version>/test` → `run<Name>TestCases`; core's own: `@dialecte/core/test`). Details
291
292
  and the case format: [references/testing.md](references/testing.md). Short version: one table per
292
- behaviour, inline XML fixtures with `dev:db-id` ids that say intent, `.withExport` asserts the
293
- resulting XML with XPath, `.withoutExport` asserts inside `act`, `.generic` for pure functions.
294
- Red first, one case at a time. No test names its store: the runner chooses it (in Node on the
293
+ behaviour, whole-document XML fixtures (inline up to 40 lines, else a sibling `?raw` file) with
294
+ `dev:db-id` ids that say intent, one call of the unit per `act`, `.withExport` asserts the resulting
295
+ XML with hand-written XPath, `.withoutExport` asserts inside `act`, `.generic` for pure functions.
296
+ Refusals assert the error key and nothing staged, never a spy. Red first, one case at a time. No test names its store: the runner chooses it (in Node on the
295
297
  in-memory store under a node vitest project whose setup file calls `useTestStorage`, core 0.8+).
296
298
  Assertions take XML text; on a big file, check record expectations (tag, attributes, parent,
297
299
  count) with the query API instead of XPath on the whole export.