@fluidframework/tree 2.91.0 → 2.93.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 (1023) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +1 -1
  3. package/api-report/tree.alpha.api.md +117 -51
  4. package/api-report/tree.beta.api.md +41 -12
  5. package/api-report/tree.legacy.beta.api.md +41 -12
  6. package/dist/api.d.ts +11 -1
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/codec/codec.d.ts +28 -2
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +1 -0
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/index.d.ts +2 -2
  14. package/dist/codec/index.d.ts.map +1 -1
  15. package/dist/codec/index.js +2 -4
  16. package/dist/codec/index.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +18 -36
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js +46 -59
  20. package/dist/codec/versioned/codec.js.map +1 -1
  21. package/dist/codec/versioned/index.d.ts +1 -1
  22. package/dist/codec/versioned/index.d.ts.map +1 -1
  23. package/dist/codec/versioned/index.js +2 -4
  24. package/dist/codec/versioned/index.js.map +1 -1
  25. package/dist/core/forest/forest.d.ts +5 -2
  26. package/dist/core/forest/forest.d.ts.map +1 -1
  27. package/dist/core/forest/forest.js.map +1 -1
  28. package/dist/core/index.d.ts +1 -1
  29. package/dist/core/index.d.ts.map +1 -1
  30. package/dist/core/index.js +6 -2
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/rebase/changeRebaser.d.ts +8 -1
  33. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  34. package/dist/core/rebase/changeRebaser.js.map +1 -1
  35. package/dist/core/rebase/revisionTagCodec.d.ts +4 -3
  36. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  37. package/dist/core/rebase/revisionTagCodec.js +2 -0
  38. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  39. package/dist/core/rebase/utils.d.ts +2 -2
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +4 -4
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/schema-stored/formatV2.d.ts +1 -1
  44. package/dist/core/schema-stored/formatV2.js +1 -1
  45. package/dist/core/schema-stored/formatV2.js.map +1 -1
  46. package/dist/core/tree/anchorSet.d.ts +8 -0
  47. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  48. package/dist/core/tree/anchorSet.js +63 -7
  49. package/dist/core/tree/anchorSet.js.map +1 -1
  50. package/dist/core/tree/cursor.d.ts +25 -1
  51. package/dist/core/tree/cursor.d.ts.map +1 -1
  52. package/dist/core/tree/cursor.js +45 -1
  53. package/dist/core/tree/cursor.js.map +1 -1
  54. package/dist/core/tree/deltaUtil.d.ts +13 -1
  55. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  56. package/dist/core/tree/deltaUtil.js +34 -1
  57. package/dist/core/tree/deltaUtil.js.map +1 -1
  58. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  59. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  60. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  61. package/dist/core/tree/index.d.ts +2 -2
  62. package/dist/core/tree/index.d.ts.map +1 -1
  63. package/dist/core/tree/index.js +6 -2
  64. package/dist/core/tree/index.js.map +1 -1
  65. package/dist/core/tree/visitDelta.d.ts +11 -0
  66. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  67. package/dist/core/tree/visitDelta.js +1 -1
  68. package/dist/core/tree/visitDelta.js.map +1 -1
  69. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  70. package/dist/core/tree/visitorUtils.js +5 -0
  71. package/dist/core/tree/visitorUtils.js.map +1 -1
  72. package/dist/entrypoints/alpha.d.ts +1 -1
  73. package/dist/entrypoints/alpha.d.ts.map +1 -1
  74. package/dist/entrypoints/alpha.js +5 -6
  75. package/dist/entrypoints/alpha.js.map +1 -1
  76. package/dist/entrypoints/beta.d.ts +1 -1
  77. package/dist/entrypoints/beta.d.ts.map +1 -1
  78. package/dist/entrypoints/beta.js +4 -2
  79. package/dist/entrypoints/beta.js.map +1 -1
  80. package/dist/entrypoints/legacy.d.ts +1 -1
  81. package/dist/entrypoints/legacy.d.ts.map +1 -1
  82. package/dist/entrypoints/legacy.js +4 -2
  83. package/dist/entrypoints/legacy.js.map +1 -1
  84. package/dist/entrypoints/public.js +1 -1
  85. package/dist/entrypoints/public.js.map +1 -1
  86. package/dist/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  87. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  88. package/dist/feature-libraries/changeAtomIdCodec.js +2 -0
  89. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  91. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  92. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -1
  93. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  94. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  95. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  97. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  99. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -6
  101. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  103. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  106. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  109. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -6
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  113. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  115. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  116. package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  118. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  119. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  120. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  121. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +115 -0
  122. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  123. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  124. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  125. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +16 -0
  126. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  127. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  128. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  129. package/dist/feature-libraries/chunked-forest/codec/format/index.js +18 -0
  130. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  131. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  132. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  133. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +29 -0
  134. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  135. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  136. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  138. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  140. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  142. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +6 -4
  145. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  147. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +3 -3
  149. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  151. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  153. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  154. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  155. package/dist/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  156. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  157. package/dist/feature-libraries/cursorComparator.d.ts +23 -0
  158. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -0
  159. package/dist/feature-libraries/cursorComparator.js +65 -0
  160. package/dist/feature-libraries/cursorComparator.js.map +1 -0
  161. package/dist/feature-libraries/forest-summary/codec.d.ts +1 -1
  162. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  163. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  164. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  165. package/dist/feature-libraries/index.d.ts +3 -2
  166. package/dist/feature-libraries/index.d.ts.map +1 -1
  167. package/dist/feature-libraries/index.js +5 -5
  168. package/dist/feature-libraries/index.js.map +1 -1
  169. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -0
  170. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  171. package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -8
  172. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  173. package/dist/feature-libraries/indexing/types.d.ts +4 -3
  174. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  175. package/dist/feature-libraries/indexing/types.js.map +1 -1
  176. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  178. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  180. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  181. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  182. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  183. package/dist/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  184. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  186. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  188. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  191. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  192. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  193. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  194. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  195. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  196. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  197. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
  198. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  199. package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
  200. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  201. package/dist/feature-libraries/object-forest/objectForest.js +2 -2
  202. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  203. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  204. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  205. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  206. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  207. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  208. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  209. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  210. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  211. package/dist/feature-libraries/schema-edits/index.js +2 -3
  212. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  213. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  214. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  215. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -54
  216. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  217. package/dist/feature-libraries/schema-index/codec.d.ts +3 -16
  218. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  219. package/dist/feature-libraries/schema-index/codec.js +1 -21
  220. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  221. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  222. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  223. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  224. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  225. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  226. package/dist/feature-libraries/schema-index/index.js +1 -2
  227. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  229. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  231. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  232. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  233. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  234. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  235. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  236. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  237. package/dist/index.d.ts +2 -2
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +2 -3
  240. package/dist/index.js.map +1 -1
  241. package/dist/packageVersion.d.ts +1 -1
  242. package/dist/packageVersion.js +1 -1
  243. package/dist/packageVersion.js.map +1 -1
  244. package/dist/serializableDomainSchema.d.ts +5 -5
  245. package/dist/serializableDomainSchema.d.ts.map +1 -1
  246. package/dist/serializableDomainSchema.js.map +1 -1
  247. package/dist/shared-tree/independentView.d.ts +1 -1
  248. package/dist/shared-tree/independentView.d.ts.map +1 -1
  249. package/dist/shared-tree/independentView.js +14 -21
  250. package/dist/shared-tree/independentView.js.map +1 -1
  251. package/dist/shared-tree/index.d.ts +2 -2
  252. package/dist/shared-tree/index.d.ts.map +1 -1
  253. package/dist/shared-tree/index.js +1 -2
  254. package/dist/shared-tree/index.js.map +1 -1
  255. package/dist/shared-tree/schematizingTreeView.d.ts +2 -36
  256. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  257. package/dist/shared-tree/schematizingTreeView.js +15 -117
  258. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  259. package/dist/shared-tree/sharedTree.d.ts +3 -22
  260. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  261. package/dist/shared-tree/sharedTree.js +10 -27
  262. package/dist/shared-tree/sharedTree.js.map +1 -1
  263. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  264. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  265. package/dist/shared-tree/sharedTreeChangeCodecs.js +23 -16
  266. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  267. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  268. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  269. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  270. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  271. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  272. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  273. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  274. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  275. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  276. package/dist/shared-tree/sharedTreeChangeFormat.js +13 -5
  277. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  278. package/dist/shared-tree/tree.d.ts.map +1 -1
  279. package/dist/shared-tree/tree.js +2 -1
  280. package/dist/shared-tree/tree.js.map +1 -1
  281. package/dist/shared-tree/treeAlpha.d.ts +17 -1
  282. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  283. package/dist/shared-tree/treeAlpha.js +3 -0
  284. package/dist/shared-tree/treeAlpha.js.map +1 -1
  285. package/dist/shared-tree/treeCheckout.d.ts +34 -69
  286. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  287. package/dist/shared-tree/treeCheckout.js +885 -678
  288. package/dist/shared-tree/treeCheckout.js.map +1 -1
  289. package/dist/shared-tree/unhydratedTreeContext.js +3 -3
  290. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  291. package/dist/shared-tree-core/editManagerCodecs.d.ts +23 -12
  292. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  293. package/dist/shared-tree-core/editManagerCodecs.js +40 -67
  294. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  295. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  296. package/dist/shared-tree-core/editManagerCodecsCommons.js +0 -1
  297. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  298. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  299. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  300. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +18 -13
  301. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  302. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  303. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  304. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +6 -9
  305. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  306. package/dist/shared-tree-core/index.d.ts +3 -3
  307. package/dist/shared-tree-core/index.d.ts.map +1 -1
  308. package/dist/shared-tree-core/index.js +5 -8
  309. package/dist/shared-tree-core/index.js.map +1 -1
  310. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  311. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  312. package/dist/shared-tree-core/messageCodecV1ToV4.js +8 -8
  313. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  314. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  315. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  316. package/dist/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  317. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  318. package/dist/shared-tree-core/messageCodecs.d.ts +15 -14
  319. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  320. package/dist/shared-tree-core/messageCodecs.js +38 -74
  321. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  322. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  323. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  324. package/dist/shared-tree-core/messageFormat.js +1 -2
  325. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  326. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -3
  327. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  328. package/dist/shared-tree-core/sharedTreeCore.js +12 -2
  329. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  330. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  331. package/dist/sharedTreeAttributes.js +3 -0
  332. package/dist/sharedTreeAttributes.js.map +1 -1
  333. package/dist/simple-tree/api/discrepancies.js +4 -1
  334. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  335. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  336. package/dist/simple-tree/api/identifierIndex.js +1 -1
  337. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  338. package/dist/simple-tree/api/index.d.ts +2 -1
  339. package/dist/simple-tree/api/index.d.ts.map +1 -1
  340. package/dist/simple-tree/api/index.js +3 -2
  341. package/dist/simple-tree/api/index.js.map +1 -1
  342. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +33 -4
  345. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  346. package/dist/simple-tree/api/schemaFactoryAlpha.js +17 -1
  347. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  348. package/dist/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  349. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  350. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  351. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  352. package/dist/simple-tree/api/storedSchema.js +10 -7
  353. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  354. package/dist/simple-tree/api/tree.d.ts +7 -19
  355. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  356. package/dist/simple-tree/api/tree.js.map +1 -1
  357. package/dist/simple-tree/api/treeAlpha.d.ts +126 -0
  358. package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -0
  359. package/dist/simple-tree/api/treeAlpha.js +7 -0
  360. package/dist/simple-tree/api/treeAlpha.js.map +1 -0
  361. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  362. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  363. package/dist/simple-tree/api/treeChangeEvents.d.ts +4 -1
  364. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  365. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  366. package/dist/simple-tree/api/treeNodeApi.d.ts +108 -0
  367. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  368. package/dist/simple-tree/api/treeNodeApi.js +104 -3
  369. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  370. package/dist/simple-tree/core/toStored.d.ts +7 -0
  371. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  372. package/dist/simple-tree/core/toStored.js.map +1 -1
  373. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  374. package/dist/simple-tree/core/treeNodeKernel.js +45 -8
  375. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  376. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  377. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  378. package/dist/simple-tree/core/unhydratedFlexTree.js +117 -11
  379. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  380. package/dist/simple-tree/fieldSchema.d.ts +6 -1
  381. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  382. package/dist/simple-tree/fieldSchema.js +3 -0
  383. package/dist/simple-tree/fieldSchema.js.map +1 -1
  384. package/dist/simple-tree/index.d.ts +2 -2
  385. package/dist/simple-tree/index.d.ts.map +1 -1
  386. package/dist/simple-tree/index.js +4 -3
  387. package/dist/simple-tree/index.js.map +1 -1
  388. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  389. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  390. package/dist/simple-tree/node-kinds/array/arrayNode.js +23 -0
  391. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  392. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  393. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  394. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  395. package/dist/simple-tree/node-kinds/array/index.d.ts +2 -2
  396. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  397. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  398. package/dist/simple-tree/node-kinds/index.d.ts +2 -2
  399. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  400. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  401. package/dist/simple-tree/node-kinds/map/index.d.ts +1 -1
  402. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  403. package/dist/simple-tree/node-kinds/map/index.js.map +1 -1
  404. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  405. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  406. package/dist/simple-tree/node-kinds/map/mapNode.js +6 -1
  407. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  408. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  409. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  410. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  411. package/dist/simple-tree/simpleSchema.d.ts +17 -0
  412. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  413. package/dist/simple-tree/simpleSchema.js.map +1 -1
  414. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  415. package/dist/simple-tree/toStoredSchema.js +23 -1
  416. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  417. package/dist/tableSchema.d.ts +4 -5
  418. package/dist/tableSchema.d.ts.map +1 -1
  419. package/dist/tableSchema.js +12 -23
  420. package/dist/tableSchema.js.map +1 -1
  421. package/dist/text/textDomain.d.ts.map +1 -1
  422. package/dist/text/textDomain.js +27 -0
  423. package/dist/text/textDomain.js.map +1 -1
  424. package/dist/text/textDomainFormatted.d.ts +321 -11
  425. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  426. package/dist/text/textDomainFormatted.js +100 -25
  427. package/dist/text/textDomainFormatted.js.map +1 -1
  428. package/dist/treeFactory.d.ts.map +1 -1
  429. package/dist/treeFactory.js +5 -2
  430. package/dist/treeFactory.js.map +1 -1
  431. package/dist/util/index.d.ts +1 -1
  432. package/dist/util/index.d.ts.map +1 -1
  433. package/dist/util/index.js +2 -3
  434. package/dist/util/index.js.map +1 -1
  435. package/dist/util/referenceCounting.d.ts.map +1 -1
  436. package/dist/util/referenceCounting.js +0 -1
  437. package/dist/util/referenceCounting.js.map +1 -1
  438. package/dist/util/utils.d.ts +0 -1
  439. package/dist/util/utils.d.ts.map +1 -1
  440. package/dist/util/utils.js +1 -6
  441. package/dist/util/utils.js.map +1 -1
  442. package/eslint.config.mts +1 -1
  443. package/legacy.d.ts +2 -3
  444. package/lib/api.d.ts +11 -1
  445. package/lib/api.d.ts.map +1 -1
  446. package/lib/api.js.map +1 -1
  447. package/lib/codec/codec.d.ts +28 -2
  448. package/lib/codec/codec.d.ts.map +1 -1
  449. package/lib/codec/codec.js +1 -0
  450. package/lib/codec/codec.js.map +1 -1
  451. package/lib/codec/index.d.ts +2 -2
  452. package/lib/codec/index.d.ts.map +1 -1
  453. package/lib/codec/index.js +1 -1
  454. package/lib/codec/index.js.map +1 -1
  455. package/lib/codec/versioned/codec.d.ts +18 -36
  456. package/lib/codec/versioned/codec.d.ts.map +1 -1
  457. package/lib/codec/versioned/codec.js +45 -56
  458. package/lib/codec/versioned/codec.js.map +1 -1
  459. package/lib/codec/versioned/index.d.ts +1 -1
  460. package/lib/codec/versioned/index.d.ts.map +1 -1
  461. package/lib/codec/versioned/index.js +1 -1
  462. package/lib/codec/versioned/index.js.map +1 -1
  463. package/lib/core/forest/forest.d.ts +5 -2
  464. package/lib/core/forest/forest.d.ts.map +1 -1
  465. package/lib/core/forest/forest.js.map +1 -1
  466. package/lib/core/index.d.ts +1 -1
  467. package/lib/core/index.d.ts.map +1 -1
  468. package/lib/core/index.js +1 -1
  469. package/lib/core/index.js.map +1 -1
  470. package/lib/core/rebase/changeRebaser.d.ts +8 -1
  471. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  472. package/lib/core/rebase/changeRebaser.js.map +1 -1
  473. package/lib/core/rebase/revisionTagCodec.d.ts +4 -3
  474. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  475. package/lib/core/rebase/revisionTagCodec.js +2 -0
  476. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  477. package/lib/core/rebase/utils.d.ts +2 -2
  478. package/lib/core/rebase/utils.d.ts.map +1 -1
  479. package/lib/core/rebase/utils.js +4 -4
  480. package/lib/core/rebase/utils.js.map +1 -1
  481. package/lib/core/schema-stored/formatV2.d.ts +1 -1
  482. package/lib/core/schema-stored/formatV2.js +1 -1
  483. package/lib/core/schema-stored/formatV2.js.map +1 -1
  484. package/lib/core/tree/anchorSet.d.ts +8 -0
  485. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  486. package/lib/core/tree/anchorSet.js +63 -7
  487. package/lib/core/tree/anchorSet.js.map +1 -1
  488. package/lib/core/tree/cursor.d.ts +25 -1
  489. package/lib/core/tree/cursor.d.ts.map +1 -1
  490. package/lib/core/tree/cursor.js +43 -0
  491. package/lib/core/tree/cursor.js.map +1 -1
  492. package/lib/core/tree/deltaUtil.d.ts +13 -1
  493. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  494. package/lib/core/tree/deltaUtil.js +31 -0
  495. package/lib/core/tree/deltaUtil.js.map +1 -1
  496. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  497. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  498. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  499. package/lib/core/tree/index.d.ts +2 -2
  500. package/lib/core/tree/index.d.ts.map +1 -1
  501. package/lib/core/tree/index.js +2 -2
  502. package/lib/core/tree/index.js.map +1 -1
  503. package/lib/core/tree/visitDelta.d.ts +11 -0
  504. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  505. package/lib/core/tree/visitDelta.js +1 -1
  506. package/lib/core/tree/visitDelta.js.map +1 -1
  507. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  508. package/lib/core/tree/visitorUtils.js +5 -0
  509. package/lib/core/tree/visitorUtils.js.map +1 -1
  510. package/lib/entrypoints/alpha.d.ts +1 -1
  511. package/lib/entrypoints/alpha.d.ts.map +1 -1
  512. package/lib/entrypoints/alpha.js +2 -2
  513. package/lib/entrypoints/alpha.js.map +1 -1
  514. package/lib/entrypoints/beta.d.ts +1 -1
  515. package/lib/entrypoints/beta.d.ts.map +1 -1
  516. package/lib/entrypoints/beta.js +2 -2
  517. package/lib/entrypoints/beta.js.map +1 -1
  518. package/lib/entrypoints/legacy.d.ts +1 -1
  519. package/lib/entrypoints/legacy.d.ts.map +1 -1
  520. package/lib/entrypoints/legacy.js +2 -2
  521. package/lib/entrypoints/legacy.js.map +1 -1
  522. package/lib/entrypoints/public.js +1 -1
  523. package/lib/entrypoints/public.js.map +1 -1
  524. package/lib/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  525. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  526. package/lib/feature-libraries/changeAtomIdCodec.js +2 -0
  527. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  528. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  529. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  530. package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -1
  531. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  532. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  533. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  534. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  535. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  536. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  537. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  538. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +4 -4
  539. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  540. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  541. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  542. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  543. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  544. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  546. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  547. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  549. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  550. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  551. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  556. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  557. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  558. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  559. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +112 -0
  560. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  561. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  562. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  563. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +13 -0
  564. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  565. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  566. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/format/index.js +8 -0
  568. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  569. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  570. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  571. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +26 -0
  572. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  573. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  574. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  576. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  577. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  578. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  579. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  581. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +4 -2
  583. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  589. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  591. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  592. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  593. package/lib/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  594. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  595. package/lib/feature-libraries/cursorComparator.d.ts +23 -0
  596. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -0
  597. package/lib/feature-libraries/cursorComparator.js +61 -0
  598. package/lib/feature-libraries/cursorComparator.js.map +1 -0
  599. package/lib/feature-libraries/forest-summary/codec.d.ts +1 -1
  600. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  601. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  602. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  603. package/lib/feature-libraries/index.d.ts +3 -2
  604. package/lib/feature-libraries/index.d.ts.map +1 -1
  605. package/lib/feature-libraries/index.js +3 -2
  606. package/lib/feature-libraries/index.js.map +1 -1
  607. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -0
  608. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  609. package/lib/feature-libraries/indexing/anchorTreeIndex.js +15 -8
  610. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  611. package/lib/feature-libraries/indexing/types.d.ts +4 -3
  612. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  613. package/lib/feature-libraries/indexing/types.js.map +1 -1
  614. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  615. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  616. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  617. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  618. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  623. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  637. package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
  638. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  639. package/lib/feature-libraries/object-forest/objectForest.js +2 -2
  640. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  641. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  642. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  643. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -1
  644. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  645. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  646. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  647. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  648. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  649. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/schema-edits/index.js +1 -1
  651. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  652. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  653. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  654. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -50
  655. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  656. package/lib/feature-libraries/schema-index/codec.d.ts +3 -16
  657. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-index/codec.js +0 -19
  659. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  660. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  661. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  662. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  663. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  664. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  665. package/lib/feature-libraries/schema-index/index.js +1 -1
  666. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  667. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  668. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  669. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  670. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  671. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  672. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
  673. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  674. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  675. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  676. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  677. package/lib/index.d.ts +2 -2
  678. package/lib/index.d.ts.map +1 -1
  679. package/lib/index.js +1 -1
  680. package/lib/index.js.map +1 -1
  681. package/lib/packageVersion.d.ts +1 -1
  682. package/lib/packageVersion.js +1 -1
  683. package/lib/packageVersion.js.map +1 -1
  684. package/lib/serializableDomainSchema.d.ts +5 -5
  685. package/lib/serializableDomainSchema.d.ts.map +1 -1
  686. package/lib/serializableDomainSchema.js +4 -1
  687. package/lib/serializableDomainSchema.js.map +1 -1
  688. package/lib/shared-tree/independentView.d.ts +1 -1
  689. package/lib/shared-tree/independentView.d.ts.map +1 -1
  690. package/lib/shared-tree/independentView.js +4 -11
  691. package/lib/shared-tree/independentView.js.map +1 -1
  692. package/lib/shared-tree/index.d.ts +2 -2
  693. package/lib/shared-tree/index.d.ts.map +1 -1
  694. package/lib/shared-tree/index.js +1 -1
  695. package/lib/shared-tree/index.js.map +1 -1
  696. package/lib/shared-tree/schematizingTreeView.d.ts +2 -36
  697. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  698. package/lib/shared-tree/schematizingTreeView.js +17 -116
  699. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  700. package/lib/shared-tree/sharedTree.d.ts +3 -22
  701. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  702. package/lib/shared-tree/sharedTree.js +11 -27
  703. package/lib/shared-tree/sharedTree.js.map +1 -1
  704. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  705. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  706. package/lib/shared-tree/sharedTreeChangeCodecs.js +19 -12
  707. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  708. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  709. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  710. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  711. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  712. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  713. package/lib/shared-tree/sharedTreeChangeFamily.js +2 -2
  714. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  715. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  716. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  717. package/lib/shared-tree/sharedTreeChangeFormat.js +11 -5
  718. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  719. package/lib/shared-tree/tree.d.ts.map +1 -1
  720. package/lib/shared-tree/tree.js +2 -1
  721. package/lib/shared-tree/tree.js.map +1 -1
  722. package/lib/shared-tree/treeAlpha.d.ts +17 -1
  723. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  724. package/lib/shared-tree/treeAlpha.js +3 -0
  725. package/lib/shared-tree/treeAlpha.js.map +1 -1
  726. package/lib/shared-tree/treeCheckout.d.ts +34 -69
  727. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  728. package/lib/shared-tree/treeCheckout.js +889 -683
  729. package/lib/shared-tree/treeCheckout.js.map +1 -1
  730. package/lib/shared-tree/unhydratedTreeContext.js +1 -1
  731. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts +23 -12
  733. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecs.js +41 -65
  735. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js +0 -1
  738. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +16 -11
  742. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  744. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +5 -8
  746. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  747. package/lib/shared-tree-core/index.d.ts +3 -3
  748. package/lib/shared-tree-core/index.d.ts.map +1 -1
  749. package/lib/shared-tree-core/index.js +3 -3
  750. package/lib/shared-tree-core/index.js.map +1 -1
  751. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  752. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  753. package/lib/shared-tree-core/messageCodecV1ToV4.js +8 -8
  754. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  755. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  756. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  757. package/lib/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  758. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  759. package/lib/shared-tree-core/messageCodecs.d.ts +15 -14
  760. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  761. package/lib/shared-tree-core/messageCodecs.js +38 -71
  762. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  763. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  764. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  765. package/lib/shared-tree-core/messageFormat.js +0 -1
  766. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  767. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -3
  768. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  769. package/lib/shared-tree-core/sharedTreeCore.js +14 -4
  770. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  771. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  772. package/lib/sharedTreeAttributes.js +3 -0
  773. package/lib/sharedTreeAttributes.js.map +1 -1
  774. package/lib/simple-tree/api/discrepancies.js +4 -1
  775. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  776. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  777. package/lib/simple-tree/api/identifierIndex.js +1 -1
  778. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  779. package/lib/simple-tree/api/index.d.ts +2 -1
  780. package/lib/simple-tree/api/index.d.ts.map +1 -1
  781. package/lib/simple-tree/api/index.js +1 -1
  782. package/lib/simple-tree/api/index.js.map +1 -1
  783. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  784. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  785. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +33 -4
  786. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  787. package/lib/simple-tree/api/schemaFactoryAlpha.js +19 -3
  788. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  789. package/lib/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  790. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  791. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  792. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  793. package/lib/simple-tree/api/storedSchema.js +11 -8
  794. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  795. package/lib/simple-tree/api/tree.d.ts +7 -19
  796. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  797. package/lib/simple-tree/api/tree.js.map +1 -1
  798. package/lib/simple-tree/api/treeAlpha.d.ts +126 -0
  799. package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -0
  800. package/lib/simple-tree/api/treeAlpha.js +6 -0
  801. package/lib/simple-tree/api/treeAlpha.js.map +1 -0
  802. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  803. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  804. package/lib/simple-tree/api/treeChangeEvents.d.ts +4 -1
  805. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  806. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  807. package/lib/simple-tree/api/treeNodeApi.d.ts +108 -0
  808. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  809. package/lib/simple-tree/api/treeNodeApi.js +101 -2
  810. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  811. package/lib/simple-tree/core/toStored.d.ts +7 -0
  812. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  813. package/lib/simple-tree/core/toStored.js.map +1 -1
  814. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  815. package/lib/simple-tree/core/treeNodeKernel.js +45 -8
  816. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  817. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  818. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  819. package/lib/simple-tree/core/unhydratedFlexTree.js +118 -12
  820. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  821. package/lib/simple-tree/fieldSchema.d.ts +6 -1
  822. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  823. package/lib/simple-tree/fieldSchema.js +3 -0
  824. package/lib/simple-tree/fieldSchema.js.map +1 -1
  825. package/lib/simple-tree/index.d.ts +2 -2
  826. package/lib/simple-tree/index.d.ts.map +1 -1
  827. package/lib/simple-tree/index.js +1 -1
  828. package/lib/simple-tree/index.js.map +1 -1
  829. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  830. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  831. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -0
  832. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  833. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  834. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  835. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  836. package/lib/simple-tree/node-kinds/array/index.d.ts +2 -2
  837. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  838. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  839. package/lib/simple-tree/node-kinds/index.d.ts +2 -2
  840. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  841. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  842. package/lib/simple-tree/node-kinds/map/index.d.ts +1 -1
  843. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  844. package/lib/simple-tree/node-kinds/map/index.js.map +1 -1
  845. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  846. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  847. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -1
  848. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  849. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  850. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  851. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  852. package/lib/simple-tree/simpleSchema.d.ts +17 -0
  853. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  854. package/lib/simple-tree/simpleSchema.js.map +1 -1
  855. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  856. package/lib/simple-tree/toStoredSchema.js +24 -2
  857. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  858. package/lib/tableSchema.d.ts +4 -5
  859. package/lib/tableSchema.d.ts.map +1 -1
  860. package/lib/tableSchema.js +12 -23
  861. package/lib/tableSchema.js.map +1 -1
  862. package/lib/text/textDomain.d.ts.map +1 -1
  863. package/lib/text/textDomain.js +29 -0
  864. package/lib/text/textDomain.js.map +1 -1
  865. package/lib/text/textDomainFormatted.d.ts +321 -11
  866. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  867. package/lib/text/textDomainFormatted.js +103 -28
  868. package/lib/text/textDomainFormatted.js.map +1 -1
  869. package/lib/treeFactory.d.ts.map +1 -1
  870. package/lib/treeFactory.js +6 -3
  871. package/lib/treeFactory.js.map +1 -1
  872. package/lib/tsdoc-metadata.json +1 -1
  873. package/lib/util/index.d.ts +1 -1
  874. package/lib/util/index.d.ts.map +1 -1
  875. package/lib/util/index.js +1 -1
  876. package/lib/util/index.js.map +1 -1
  877. package/lib/util/referenceCounting.d.ts.map +1 -1
  878. package/lib/util/referenceCounting.js +0 -1
  879. package/lib/util/referenceCounting.js.map +1 -1
  880. package/lib/util/utils.d.ts +0 -1
  881. package/lib/util/utils.d.ts.map +1 -1
  882. package/lib/util/utils.js +0 -1
  883. package/lib/util/utils.js.map +1 -1
  884. package/package.json +35 -40
  885. package/scripts/generate-entrypoint-sources.sh +4 -2
  886. package/src/api.ts +21 -0
  887. package/src/codec/codec.ts +32 -2
  888. package/src/codec/index.ts +2 -3
  889. package/src/codec/versioned/codec.ts +99 -109
  890. package/src/codec/versioned/index.ts +1 -3
  891. package/src/core/forest/forest.ts +5 -2
  892. package/src/core/index.ts +4 -0
  893. package/src/core/rebase/changeRebaser.ts +8 -0
  894. package/src/core/rebase/revisionTagCodec.ts +4 -4
  895. package/src/core/rebase/utils.ts +9 -2
  896. package/src/core/schema-stored/formatV2.ts +1 -1
  897. package/src/core/tree/anchorSet.ts +92 -10
  898. package/src/core/tree/cursor.ts +52 -1
  899. package/src/core/tree/deltaUtil.ts +37 -1
  900. package/src/core/tree/detachedFieldIndexCodecs.ts +4 -4
  901. package/src/core/tree/index.ts +4 -0
  902. package/src/core/tree/visitDelta.ts +13 -1
  903. package/src/core/tree/visitorUtils.ts +5 -0
  904. package/src/entrypoints/alpha.ts +21 -10
  905. package/src/entrypoints/beta.ts +7 -1
  906. package/src/entrypoints/legacy.ts +7 -1
  907. package/src/entrypoints/public.ts +1 -1
  908. package/src/feature-libraries/changeAtomIdCodec.ts +8 -7
  909. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
  910. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -2
  911. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +18 -13
  912. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  913. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -2
  914. package/src/feature-libraries/chunked-forest/codec/codecs.ts +16 -10
  915. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -14
  916. package/src/feature-libraries/chunked-forest/codec/{formatGeneric.ts → format/formatGeneric.ts} +1 -1
  917. package/src/feature-libraries/chunked-forest/codec/{format.ts → format/formatV1.ts} +41 -111
  918. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +31 -0
  919. package/src/feature-libraries/chunked-forest/codec/format/index.ts +31 -0
  920. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +81 -0
  921. package/src/feature-libraries/chunked-forest/codec/index.ts +6 -2
  922. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +19 -12
  923. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +6 -4
  924. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -10
  925. package/src/feature-libraries/chunked-forest/index.ts +2 -1
  926. package/src/feature-libraries/chunked-forest/uniformChunk.ts +42 -20
  927. package/src/feature-libraries/cursorComparator.ts +77 -0
  928. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +5 -5
  929. package/src/feature-libraries/index.ts +5 -3
  930. package/src/feature-libraries/indexing/anchorTreeIndex.ts +21 -10
  931. package/src/feature-libraries/indexing/types.ts +5 -3
  932. package/src/feature-libraries/mitigatedChangeFamily.ts +4 -1
  933. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +4 -5
  934. package/src/feature-libraries/modular-schema/genericFieldKind.ts +0 -1
  935. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +19 -26
  936. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +4 -4
  937. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -5
  938. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +6 -2
  939. package/src/feature-libraries/object-forest/objectForest.ts +8 -2
  940. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +11 -13
  941. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +4 -5
  942. package/src/feature-libraries/schema-edits/index.ts +1 -4
  943. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +10 -78
  944. package/src/feature-libraries/schema-index/codec.ts +0 -25
  945. package/src/feature-libraries/schema-index/formatV2.ts +1 -1
  946. package/src/feature-libraries/schema-index/index.ts +1 -4
  947. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +6 -6
  948. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +8 -5
  949. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -5
  950. package/src/index.ts +14 -3
  951. package/src/packageVersion.ts +1 -1
  952. package/src/serializableDomainSchema.ts +6 -0
  953. package/src/shared-tree/independentView.ts +5 -18
  954. package/src/shared-tree/index.ts +0 -4
  955. package/src/shared-tree/schematizingTreeView.ts +19 -165
  956. package/src/shared-tree/sharedTree.ts +16 -59
  957. package/src/shared-tree/sharedTreeChangeCodecs.ts +23 -29
  958. package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -2
  959. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -0
  960. package/src/shared-tree/sharedTreeChangeFormat.ts +23 -8
  961. package/src/shared-tree/tree.ts +2 -5
  962. package/src/shared-tree/treeAlpha.ts +30 -0
  963. package/src/shared-tree/treeCheckout.ts +275 -99
  964. package/src/shared-tree/unhydratedTreeContext.ts +1 -1
  965. package/src/shared-tree-core/editManagerCodecs.ts +99 -124
  966. package/src/shared-tree-core/editManagerCodecsCommons.ts +0 -1
  967. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +54 -59
  968. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +72 -95
  969. package/src/shared-tree-core/index.ts +4 -8
  970. package/src/shared-tree-core/messageCodecV1ToV4.ts +56 -71
  971. package/src/shared-tree-core/messageCodecVSharedBranches.ts +76 -92
  972. package/src/shared-tree-core/messageCodecs.ts +88 -126
  973. package/src/shared-tree-core/messageFormat.ts +0 -3
  974. package/src/shared-tree-core/sharedTreeCore.ts +14 -21
  975. package/src/sharedTreeAttributes.ts +3 -0
  976. package/src/simple-tree/api/discrepancies.ts +6 -1
  977. package/src/simple-tree/api/identifierIndex.ts +2 -2
  978. package/src/simple-tree/api/index.ts +14 -0
  979. package/src/simple-tree/api/schemaFactory.ts +0 -2
  980. package/src/simple-tree/api/schemaFactoryAlpha.ts +80 -4
  981. package/src/simple-tree/api/simpleTreeIndex.ts +6 -6
  982. package/src/simple-tree/api/storedSchema.ts +12 -20
  983. package/src/simple-tree/api/tree.ts +7 -20
  984. package/src/simple-tree/api/treeAlpha.ts +153 -0
  985. package/src/simple-tree/api/treeBeta.ts +1 -1
  986. package/src/simple-tree/api/treeChangeEvents.ts +4 -1
  987. package/src/simple-tree/api/treeNodeApi.ts +189 -3
  988. package/src/simple-tree/core/toStored.ts +8 -0
  989. package/src/simple-tree/core/treeNodeKernel.ts +53 -7
  990. package/src/simple-tree/core/unhydratedFlexTree.ts +137 -9
  991. package/src/simple-tree/fieldSchema.ts +10 -0
  992. package/src/simple-tree/index.ts +15 -0
  993. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -0
  994. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +25 -1
  995. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  996. package/src/simple-tree/node-kinds/index.ts +3 -0
  997. package/src/simple-tree/node-kinds/map/index.ts +1 -0
  998. package/src/simple-tree/node-kinds/map/mapNode.ts +20 -3
  999. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +6 -6
  1000. package/src/simple-tree/simpleSchema.ts +20 -0
  1001. package/src/simple-tree/toStoredSchema.ts +28 -1
  1002. package/src/tableSchema.ts +16 -28
  1003. package/src/text/textDomain.ts +68 -1
  1004. package/src/text/textDomainFormatted.ts +113 -11
  1005. package/src/treeFactory.ts +10 -5
  1006. package/src/util/index.ts +0 -1
  1007. package/src/util/referenceCounting.ts +0 -1
  1008. package/src/util/utils.ts +0 -2
  1009. package/.mocharc.customBenchmarks.cjs +0 -25
  1010. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  1011. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1012. package/dist/feature-libraries/chunked-forest/codec/format.js +0 -191
  1013. package/dist/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1014. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1015. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1016. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  1017. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1018. package/lib/feature-libraries/chunked-forest/codec/format.js +0 -188
  1019. package/lib/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1020. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1021. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1022. /package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
  1023. /package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"messageCodecV1ToV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAwB,MAAM,mBAAmB,CAAC;AAC9F,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,0BAA0B,CAAC,UAAU,EACpD,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAC1C,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,aAAa,EACtB,OAAO,EACJ,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC/B,UAAU,CACZ,cAAc,CAAC,UAAU,CAAC,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,CACtB,CAmEA"}
1
+ {"version":3,"file":"messageCodecV1ToV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,0BAA0B,CAAC,UAAU,EACpD,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAC1C,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EACJ,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC/B,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC,CAyDpE"}
@@ -6,16 +6,17 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.makeV1ToV4CodecWithVersion = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../codec/index.js");
10
- const index_js_2 = require("../util/index.js");
9
+ const index_js_1 = require("../util/index.js");
11
10
  const messageFormatV1ToV4_js_1 = require("./messageFormatV1ToV4.js");
12
- function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version) {
13
- return (0, index_js_1.withSchemaValidation)((0, messageFormatV1ToV4_js_1.Message)(changeCodec.encodedSchema ?? index_js_2.JsonCompatibleReadOnlySchema), {
11
+ function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, version) {
12
+ const schema = (0, messageFormatV1ToV4_js_1.Message)(changeCodec.encodedSchema ?? index_js_1.JsonCompatibleReadOnlySchema);
13
+ return {
14
+ schema,
14
15
  encode: (decoded, context) => {
15
16
  (0, internal_1.assert)(decoded.type === "commit", 0xc68 /* Only commit messages are supported */);
16
17
  (0, internal_1.assert)(decoded.branchId === "main", 0xc69 /* Only commit messages to main are supported */);
17
18
  const { commit, sessionId: originatorId } = decoded;
18
- const message = {
19
+ return {
19
20
  revision: revisionTagCodec.encode(commit.revision, {
20
21
  originatorId,
21
22
  idCompressor: context.idCompressor,
@@ -30,10 +31,9 @@ function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, vers
30
31
  }),
31
32
  version,
32
33
  };
33
- return message;
34
34
  },
35
35
  decode: (encoded, context) => {
36
- const { revision: encodedRevision, originatorId, changeset, } = encoded;
36
+ const { revision: encodedRevision, originatorId, changeset } = encoded;
37
37
  const revision = revisionTagCodec.decode(encodedRevision, {
38
38
  originatorId,
39
39
  revision: undefined,
@@ -53,7 +53,7 @@ function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, vers
53
53
  sessionId: originatorId,
54
54
  };
55
55
  },
56
- }, options.jsonValidator);
56
+ };
57
57
  }
58
58
  exports.makeV1ToV4CodecWithVersion = makeV1ToV4CodecWithVersion;
59
59
  //# sourceMappingURL=messageCodecV1ToV4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageCodecV1ToV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,gDAA8F;AAQ9F,+CAAgE;AAIhE,qEAAmD;AAGnD,SAAgB,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AC,CAAC;YAEH,OAAO;gBACN,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACP,QAAQ;oBACR,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;wBACrC,YAAY;wBACZ,QAAQ;wBACR,YAAY,EAAE,OAAO,CAAC,YAAY;qBAClC,CAAC;iBACF;gBACD,SAAS,EAAE,YAAY;aACvB,CAAC;QACH,CAAC;KACD,EACD,OAAO,CAAC,aAAa,CACrB,CAAC;AACH,CAAC;AAvFD,gEAuFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport { type ICodecOptions, type IJsonCodec, withSchemaValidation } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\nimport { JsonCompatibleReadOnlySchema } from \"../util/index.js\";\n\nimport type { MessageEncodingContext } from \"./messageCodecs.js\";\nimport type { MessageFormatVersion } from \"./messageFormat.js\";\nimport { Message } from \"./messageFormatV1ToV4.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport function makeV1ToV4CodecWithVersion<TChangeset>(\n\tchangeCodec: ChangeFamilyCodec<TChangeset>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n\tversion:\n\t\t| typeof MessageFormatVersion.v1\n\t\t| typeof MessageFormatVersion.v2\n\t\t| typeof MessageFormatVersion.v3\n\t\t| typeof MessageFormatVersion.v4\n\t\t| typeof MessageFormatVersion.v6,\n): IJsonCodec<\n\tDecodedMessage<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tMessageEncodingContext\n> {\n\treturn withSchemaValidation<\n\t\tDecodedMessage<TChangeset>,\n\t\tTAnySchema | typeof JsonCompatibleReadOnlySchema,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tMessageEncodingContext\n\t>(\n\t\tMessage(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema),\n\t\t{\n\t\t\tencode: (decoded: DecodedMessage<TChangeset>, context: MessageEncodingContext) => {\n\t\t\t\tassert(decoded.type === \"commit\", 0xc68 /* Only commit messages are supported */);\n\t\t\t\tassert(\n\t\t\t\t\tdecoded.branchId === \"main\",\n\t\t\t\t\t0xc69 /* Only commit messages to main are supported */,\n\t\t\t\t);\n\t\t\t\tconst { commit, sessionId: originatorId } = decoded;\n\t\t\t\tconst message: Message = {\n\t\t\t\t\trevision: revisionTagCodec.encode(commit.revision, {\n\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t}),\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tchangeset: changeCodec.encode(commit.change, {\n\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\tschema: context.schema,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\trevision: commit.revision,\n\t\t\t\t\t}),\n\t\t\t\t\tversion,\n\t\t\t\t};\n\t\t\t\treturn message as unknown as JsonCompatibleReadOnly;\n\t\t\t},\n\t\t\tdecode: (\n\t\t\t\tencoded: JsonCompatibleReadOnly,\n\t\t\t\tcontext: MessageEncodingContext,\n\t\t\t): DecodedMessage<TChangeset> => {\n\t\t\t\tconst {\n\t\t\t\t\trevision: encodedRevision,\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tchangeset,\n\t\t\t\t} = encoded as unknown as Message;\n\n\t\t\t\tconst revision = revisionTagCodec.decode(encodedRevision, {\n\t\t\t\t\toriginatorId,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t});\n\n\t\t\t\treturn {\n\t\t\t\t\tbranchId: \"main\",\n\t\t\t\t\ttype: \"commit\",\n\t\t\t\t\tcommit: {\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\tchange: changeCodec.decode(changeset, {\n\t\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\t\trevision,\n\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\tsessionId: originatorId,\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t\toptions.jsonValidator,\n\t);\n}\n"]}
1
+ {"version":3,"file":"messageCodecV1ToV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAS7D,+CAG0B;AAI1B,qEAAmD;AAGnD,SAAgB,0BAA0B,CACzC,WAA0C,EAC1C,gBAKC,EACD,OAKiC;IAEjC,MAAM,MAAM,GAAG,IAAA,gCAAO,EAAC,WAAW,CAAC,aAAa,IAAI,uCAA4B,CAAC,CAAC;IAClF,OAAO;QACN,MAAM;QACN,MAAM,EAAE,CACP,OAAmC,EACnC,OAA+B,EACsB,EAAE;YACvD,IAAA,iBAAM,EAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAClF,IAAA,iBAAM,EACL,OAAO,CAAC,QAAQ,KAAK,MAAM,EAC3B,KAAK,CAAC,gDAAgD,CACtD,CAAC;YACF,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;YACpD,OAAO;gBACN,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;oBAClD,YAAY;oBACZ,YAAY,EAAE,OAAO,CAAC,YAAY;oBAClC,QAAQ,EAAE,SAAS;iBACnB,CAAC;gBACF,YAAY;gBACZ,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC5C,YAAY;oBACZ,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,YAAY,EAAE,OAAO,CAAC,YAAY;oBAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ;iBACzB,CAAC;gBACF,OAAO;aACP,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CACP,OAA2D,EAC3D,OAA+B,EACF,EAAE;YAC/B,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;YAEvE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,eAAe,EAAE;gBACzD,YAAY;gBACZ,QAAQ,EAAE,SAAS;gBACnB,YAAY,EAAE,OAAO,CAAC,YAAY;aAClC,CAAC,CAAC;YAEH,OAAO;gBACN,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACP,QAAQ;oBACR,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;wBACrC,YAAY;wBACZ,QAAQ;wBACR,YAAY,EAAE,OAAO,CAAC,YAAY;qBAClC,CAAC;iBACF;gBACD,SAAS,EAAE,YAAY;aACvB,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AAvED,gEAuEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { CodecAndSchema, IJsonCodec, Versioned } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n} from \"../util/index.js\";\n\nimport type { MessageEncodingContext } from \"./messageCodecs.js\";\nimport type { MessageFormatVersion } from \"./messageFormat.js\";\nimport { Message } from \"./messageFormatV1ToV4.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport function makeV1ToV4CodecWithVersion<TChangeset>(\n\tchangeCodec: ChangeFamilyCodec<TChangeset>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion:\n\t\t| typeof MessageFormatVersion.v1\n\t\t| typeof MessageFormatVersion.v2\n\t\t| typeof MessageFormatVersion.v3\n\t\t| typeof MessageFormatVersion.v4\n\t\t| typeof MessageFormatVersion.v6,\n): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext> {\n\tconst schema = Message(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);\n\treturn {\n\t\tschema,\n\t\tencode: (\n\t\t\tdecoded: DecodedMessage<TChangeset>,\n\t\t\tcontext: MessageEncodingContext,\n\t\t): Message & JsonCompatibleReadOnlyObject & Versioned => {\n\t\t\tassert(decoded.type === \"commit\", 0xc68 /* Only commit messages are supported */);\n\t\t\tassert(\n\t\t\t\tdecoded.branchId === \"main\",\n\t\t\t\t0xc69 /* Only commit messages to main are supported */,\n\t\t\t);\n\t\t\tconst { commit, sessionId: originatorId } = decoded;\n\t\t\treturn {\n\t\t\t\trevision: revisionTagCodec.encode(commit.revision, {\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t}),\n\t\t\t\toriginatorId,\n\t\t\t\tchangeset: changeCodec.encode(commit.change, {\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tschema: context.schema,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: commit.revision,\n\t\t\t\t}),\n\t\t\t\tversion,\n\t\t\t};\n\t\t},\n\t\tdecode: (\n\t\t\tencoded: Message & JsonCompatibleReadOnlyObject & Versioned,\n\t\t\tcontext: MessageEncodingContext,\n\t\t): DecodedMessage<TChangeset> => {\n\t\t\tconst { revision: encodedRevision, originatorId, changeset } = encoded;\n\n\t\t\tconst revision = revisionTagCodec.decode(encodedRevision, {\n\t\t\t\toriginatorId,\n\t\t\t\trevision: undefined,\n\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tbranchId: \"main\",\n\t\t\t\ttype: \"commit\",\n\t\t\t\tcommit: {\n\t\t\t\t\trevision,\n\t\t\t\t\tchange: changeCodec.decode(changeset, {\n\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\tsessionId: originatorId,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
@@ -2,11 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ICodecOptions, type IJsonCodec } from "../codec/index.js";
5
+ import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
6
6
  import type { ChangeEncodingContext, ChangeFamilyCodec, EncodedRevisionTag, RevisionTag } from "../core/index.js";
7
- import type { JsonCompatibleReadOnly } from "../util/index.js";
8
7
  import type { MessageEncodingContext } from "./messageCodecs.js";
9
8
  import type { MessageFormatVersion } from "./messageFormat.js";
10
9
  import type { DecodedMessage } from "./messageTypes.js";
11
- export declare function makeSharedBranchesCodecWithVersion<TChangeset>(changeCodec: ChangeFamilyCodec<TChangeset>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, version: typeof MessageFormatVersion.vSharedBranches): IJsonCodec<DecodedMessage<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, MessageEncodingContext>;
10
+ export declare function makeSharedBranchesCodecWithVersion<TChangeset>(changeCodec: ChangeFamilyCodec<TChangeset>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, version: typeof MessageFormatVersion.vSharedBranches): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext>;
12
11
  //# sourceMappingURL=messageCodecVSharedBranches.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageCodecVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAwB,MAAM,mBAAmB,CAAC;AAC9F,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAC1C,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,oBAAoB,CAAC,eAAe,GAClD,UAAU,CACZ,cAAc,CAAC,UAAU,CAAC,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,CACtB,CA8FA"}
1
+ {"version":3,"file":"messageCodecVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAC1C,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,OAAO,oBAAoB,CAAC,eAAe,GAClD,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC,CAoFpE"}
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.makeSharedBranchesCodecWithVersion = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const typebox_1 = require("@sinclair/typebox");
10
- const index_js_1 = require("../codec/index.js");
11
10
  const branchIdCodec_js_1 = require("./branchIdCodec.js");
12
11
  const messageFormatVSharedBranches_js_1 = require("./messageFormatVSharedBranches.js");
13
- function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, options, version) {
14
- return (0, index_js_1.withSchemaValidation)((0, messageFormatVSharedBranches_js_1.Message)(changeCodec.encodedSchema ?? typebox_1.Type.Any()), {
12
+ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, version) {
13
+ const schema = (0, messageFormatVSharedBranches_js_1.Message)(changeCodec.encodedSchema ?? typebox_1.Type.Any());
14
+ return {
15
+ schema,
15
16
  encode: (message, context) => {
16
17
  const type = message.type;
17
18
  switch (type) {
@@ -73,7 +74,7 @@ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, optio
73
74
  sessionId: originatorId,
74
75
  };
75
76
  },
76
- }, options.jsonValidator);
77
+ };
77
78
  }
78
79
  exports.makeSharedBranchesCodecWithVersion = makeSharedBranchesCodecWithVersion;
79
80
  //# sourceMappingURL=messageCodecVSharedBranches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageCodecVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAC9E,+CAA0D;AAE1D,gDAA8F;AAS9F,yDAAoE;AAGpE,uFAA4D;AAG5D,SAAgB,kCAAkC,CACjD,WAA0C,EAC1C,gBAKC,EACD,OAAsB,EACtB,OAAoD;IAOpD,OAAO,IAAA,+BAAoB,EAO1B,IAAA,yCAAO,EAAC,WAAW,CAAC,aAAa,IAAI,cAAI,CAAC,GAAG,EAAE,CAAC,EAChD;QACC,MAAM,EAAE,CACP,OAAmC,EACnC,OAA+B,EACN,EAAE;YAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACf,MAAM,aAAa,GAA0B;wBAC5C,YAAY,EAAE,OAAO,CAAC,SAAS;wBAC/B,MAAM,EAAE,OAAO,CAAC,MAAM;wBACtB,YAAY,EAAE,OAAO,CAAC,YAAY;wBAClC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;qBACjC,CAAC;oBAEF,OAAO;wBACN,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;4BAC1D,YAAY,EAAE,OAAO,CAAC,SAAS;4BAC/B,YAAY,EAAE,OAAO,CAAC,YAAY;4BAClC,QAAQ,EAAE,SAAS;yBACnB,CAAC;wBACF,YAAY,EAAE,OAAO,CAAC,SAAS;wB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zE,OAAO;gBACN,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACP,QAAQ;oBACR,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;wBACrC,YAAY;wBACZ,QAAQ;wBACR,YAAY,EAAE,OAAO,CAAC,YAAY;qBAClC,CAAC;iBACF;gBACD,QAAQ;gBACR,SAAS,EAAE,YAAY;aACvB,CAAC;QACH,CAAC;KACD,EACD,OAAO,CAAC,aAAa,CACrB,CAAC;AACH,CAAC;AA7GD,gFA6GC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { type TAnySchema, Type } from \"@sinclair/typebox\";\n\nimport { type ICodecOptions, type IJsonCodec, withSchemaValidation } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport { decodeBranchId, encodeBranchId } from \"./branchIdCodec.js\";\nimport type { MessageEncodingContext } from \"./messageCodecs.js\";\nimport type { MessageFormatVersion } from \"./messageFormat.js\";\nimport { Message } from \"./messageFormatVSharedBranches.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport function makeSharedBranchesCodecWithVersion<TChangeset>(\n\tchangeCodec: ChangeFamilyCodec<TChangeset>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n\tversion: typeof MessageFormatVersion.vSharedBranches,\n): IJsonCodec<\n\tDecodedMessage<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tMessageEncodingContext\n> {\n\treturn withSchemaValidation<\n\t\tDecodedMessage<TChangeset>,\n\t\tTAnySchema,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tMessageEncodingContext\n\t>(\n\t\tMessage(changeCodec.encodedSchema ?? Type.Any()),\n\t\t{\n\t\t\tencode: (\n\t\t\t\tmessage: DecodedMessage<TChangeset>,\n\t\t\t\tcontext: MessageEncodingContext,\n\t\t\t): JsonCompatibleReadOnly => {\n\t\t\t\tconst type = message.type;\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase \"commit\": {\n\t\t\t\t\t\tconst changeContext: ChangeEncodingContext = {\n\t\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\t\tschema: context.schema,\n\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\trevision: message.commit.revision,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trevision: revisionTagCodec.encode(message.commit.revision, {\n\t\t\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\t\tchangeset: changeCodec.encode(message.commit.change, changeContext),\n\t\t\t\t\t\t\tbranchId: encodeBranchId(context.idCompressor, message.branchId),\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t} satisfies Message & JsonCompatibleReadOnly;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"branch\": {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\t\tbranchId: encodeBranchId(context.idCompressor, message.branchId),\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t} satisfies Message & JsonCompatibleReadOnly;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tunreachableCase(type);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdecode: (\n\t\t\t\tencoded: JsonCompatibleReadOnly,\n\t\t\t\tcontext: MessageEncodingContext,\n\t\t\t): DecodedMessage<TChangeset> => {\n\t\t\t\tconst {\n\t\t\t\t\trevision: encodedRevision,\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tchangeset,\n\t\t\t\t\tbranchId: encodedBranchId,\n\t\t\t\t} = encoded as unknown as Message;\n\n\t\t\t\tconst changeContext = {\n\t\t\t\t\toriginatorId,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t};\n\n\t\t\t\tconst branchId = decodeBranchId(context.idCompressor, encodedBranchId, changeContext);\n\n\t\t\t\tif (changeset === undefined) {\n\t\t\t\t\treturn { type: \"branch\", sessionId: originatorId, branchId };\n\t\t\t\t}\n\n\t\t\t\tassert(\n\t\t\t\t\tencodedRevision !== undefined,\n\t\t\t\t\t0xc6a /* Commit messages must have a revision */,\n\t\t\t\t);\n\t\t\t\tconst revision = revisionTagCodec.decode(encodedRevision, changeContext);\n\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"commit\",\n\t\t\t\t\tcommit: {\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\tchange: changeCodec.decode(changeset, {\n\t\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\t\trevision,\n\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\tbranchId,\n\t\t\t\t\tsessionId: originatorId,\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t\toptions.jsonValidator,\n\t);\n}\n"]}
1
+ {"version":3,"file":"messageCodecVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAC9E,+CAA0D;AAW1D,yDAAoE;AAGpE,uFAA4D;AAG5D,SAAgB,kCAAkC,CACjD,WAA0C,EAC1C,gBAKC,EACD,OAAoD;IAEpD,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C,IAAI,CAAC,CAAC;gBACvB,CAAC;YACF,CAAC;QACF,CAAC;QACD,MAAM,EAAE,CACP,OAA2D,EAC3D,OAA+B,EACF,EAAE;YAC/B,MAAM,EACL,QAAQ,EAAE,eAAe,EACzB,YAAY,EACZ,SAAS,EACT,QAAQ,EAAE,eAAe,GACzB,GAAG,OAAO,CAAC;YAEZ,MAAM,aAAa,GAAG;gBACrB,YAAY;gBACZ,QAAQ,EAAE,SAAS;gBACnB,YAAY,EAAE,OAAO,CAAC,YAAY;aAClC,CAAC;YAEF,MAAM,QAAQ,GAAG,IAAA,iCAAc,EAAC,OAAO,CAAC,YAAY,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;YAEtF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC7B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;YAC9D,CAAC;YAED,IAAA,iBAAM,EAAC,eAAe,KAAK,SAAS,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;YACxF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;YAEzE,OAAO;gBACN,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACP,QAAQ;oBACR,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE;wBACrC,YAAY;wBACZ,QAAQ;wBACR,YAAY,EAAE,OAAO,CAAC,YAAY;qBAClC,CAAC;iBACF;gBACD,QAAQ;gBACR,SAAS,EAAE,YAAY;aACvB,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AA7FD,gFA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { type TAnySchema, Type } from \"@sinclair/typebox\";\n\nimport type { CodecAndSchema, IJsonCodec, Versioned } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../core/index.js\";\nimport type { JsonCompatibleReadOnlyObject } from \"../util/index.js\";\n\nimport { decodeBranchId, encodeBranchId } from \"./branchIdCodec.js\";\nimport type { MessageEncodingContext } from \"./messageCodecs.js\";\nimport type { MessageFormatVersion } from \"./messageFormat.js\";\nimport { Message } from \"./messageFormatVSharedBranches.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport function makeSharedBranchesCodecWithVersion<TChangeset>(\n\tchangeCodec: ChangeFamilyCodec<TChangeset>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion: typeof MessageFormatVersion.vSharedBranches,\n): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext> {\n\tconst schema: TAnySchema = Message(changeCodec.encodedSchema ?? Type.Any());\n\n\treturn {\n\t\tschema,\n\t\tencode: (\n\t\t\tmessage: DecodedMessage<TChangeset>,\n\t\t\tcontext: MessageEncodingContext,\n\t\t): Message & JsonCompatibleReadOnlyObject & Versioned => {\n\t\t\tconst type = message.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"commit\": {\n\t\t\t\t\tconst changeContext: ChangeEncodingContext = {\n\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\tschema: context.schema,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\trevision: message.commit.revision,\n\t\t\t\t\t};\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\trevision: revisionTagCodec.encode(message.commit.revision, {\n\t\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\tchangeset: changeCodec.encode(message.commit.change, changeContext),\n\t\t\t\t\t\tbranchId: encodeBranchId(context.idCompressor, message.branchId),\n\t\t\t\t\t\tversion,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"branch\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\tbranchId: encodeBranchId(context.idCompressor, message.branchId),\n\t\t\t\t\t\tversion,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(type);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdecode: (\n\t\t\tencoded: Message & JsonCompatibleReadOnlyObject & Versioned,\n\t\t\tcontext: MessageEncodingContext,\n\t\t): DecodedMessage<TChangeset> => {\n\t\t\tconst {\n\t\t\t\trevision: encodedRevision,\n\t\t\t\toriginatorId,\n\t\t\t\tchangeset,\n\t\t\t\tbranchId: encodedBranchId,\n\t\t\t} = encoded;\n\n\t\t\tconst changeContext = {\n\t\t\t\toriginatorId,\n\t\t\t\trevision: undefined,\n\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t};\n\n\t\t\tconst branchId = decodeBranchId(context.idCompressor, encodedBranchId, changeContext);\n\n\t\t\tif (changeset === undefined) {\n\t\t\t\treturn { type: \"branch\", sessionId: originatorId, branchId };\n\t\t\t}\n\n\t\t\tassert(encodedRevision !== undefined, 0xc6a /* Commit messages must have a revision */);\n\t\t\tconst revision = revisionTagCodec.decode(encodedRevision, changeContext);\n\n\t\t\treturn {\n\t\t\t\ttype: \"commit\",\n\t\t\t\tcommit: {\n\t\t\t\t\trevision,\n\t\t\t\t\tchange: changeCodec.decode(changeset, {\n\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\tbranchId,\n\t\t\t\tsessionId: originatorId,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
@@ -4,9 +4,8 @@
4
4
  */
5
5
  import type { IIdCompressor } from "@fluidframework/id-compressor";
6
6
  import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
7
- import { type CodecTree, type CodecWriteOptions, type DependentFormatVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../codec/index.js";
7
+ import { ClientVersionDispatchingCodecBuilder, type CodecTree, type DependentFormatVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../codec/index.js";
8
8
  import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag, SchemaAndPolicy } from "../core/index.js";
9
- import { type JsonCompatibleReadOnly } from "../util/index.js";
10
9
  import { MessageFormatVersion } from "./messageFormat.js";
11
10
  import type { DecodedMessage } from "./messageTypes.js";
12
11
  export interface MessageEncodingContext {
@@ -14,22 +13,24 @@ export interface MessageEncodingContext {
14
13
  schema?: SchemaAndPolicy;
15
14
  }
16
15
  /**
17
- * Convert a MinimumVersionForCollab to a MessageFormatVersion.
18
- * @param clientVersion - The MinimumVersionForCollab to convert.
19
- * @returns The MessageFormatVersion that corresponds to the provided MinimumVersionForCollab.
16
+ * Codec name used to identify the message codec, see {@link makeMessageCodecBuilder}.
20
17
  */
21
- export declare function clientVersionToMessageFormatVersion(clientVersion: MinimumVersionForCollab, writeVersionOverride?: MessageFormatVersion): MessageFormatVersion;
22
- export interface MessageCodecOptions {
23
- readonly messageFormatSelector?: (minVersionForCollab: MinimumVersionForCollab) => MessageFormatVersion;
24
- }
18
+ export declare const messageCodecName = "Message";
25
19
  /**
26
- * Returns the version that should be used for testing shared branches.
20
+ * Options for constructing a message codec, see {@link makeMessageCodecBuilder}.
27
21
  */
28
- export declare function messageFormatVersionSelectorForSharedBranches(clientVersion: MinimumVersionForCollab): MessageFormatVersion;
29
- export declare function makeMessageCodec<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, dependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: MessageCodecOptions & CodecWriteOptions): IJsonCodec<DecodedMessage<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, MessageEncodingContext>;
22
+ interface MessageCodecBuilderOptions<TChangeset> extends ICodecOptions {
23
+ /** Codecs for encoding changesets. */
24
+ changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>;
25
+ /** Maps each MessageFormatVersion to the corresponding changeset format version. */
26
+ dependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>;
27
+ /** Codec for encoding revision tags within changesets. */
28
+ revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>;
29
+ }
30
30
  /**
31
- * @privateRemarks Exported for testing.
31
+ * Creates a {@link ClientVersionDispatchingCodecBuilder} for encoding/decoding messages.
32
32
  */
33
- export declare function makeMessageCodecs<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, dependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions): ICodecFamily<DecodedMessage<TChangeset>, MessageEncodingContext>;
33
+ export declare function makeMessageCodecBuilder<TChangeset>(): ClientVersionDispatchingCodecBuilder<MessageCodecBuilderOptions<TChangeset>, DecodedMessage<TChangeset>, MessageEncodingContext, MessageFormatVersion | undefined, typeof messageCodecName>;
34
34
  export declare function getCodecTreeForMessageFormatWithChange(clientVersion: MinimumVersionForCollab, changeFormat: CodecTree): CodecTree;
35
+ export {};
35
36
  //# sourceMappingURL=messageCodecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B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AC,UAAU,CAAE,SAAQ,aAAa;IACrE,sCAAsC;IACtC,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC;IAC9D,oFAAoF;IACpF,4BAA4B,EAAE,sBAAsB,CAAC,oBAAoB,CAAC,CAAC;IAC3E,0DAA0D;IAC1D,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,CAAC;CACF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,KAAK,oCAAoC,CAC1F,0BAA0B,CAAC,UAAU,CAAC,EACtC,cAAc,CAAC,UAAU,CAAC,EAC1B,sBAAsB,EACtB,oBAAoB,GAAG,SAAS,EAChC,OAAO,gBAAgB,CACvB,CAgEA;AAED,wBAAgB,sCAAsC,CACrD,aAAa,EAAE,uBAAuB,EACtC,YAAY,EAAE,SAAS,GACrB,SAAS,CAMX"}
@@ -4,91 +4,55 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getCodecTreeForMessageFormatWithChange = exports.makeMessageCodecs = exports.makeMessageCodec = exports.messageFormatVersionSelectorForSharedBranches = exports.clientVersionToMessageFormatVersion = void 0;
8
- const internal_1 = require("@fluidframework/core-utils/internal");
9
- const internal_2 = require("@fluidframework/runtime-utils/internal");
7
+ exports.getCodecTreeForMessageFormatWithChange = exports.makeMessageCodecBuilder = exports.messageCodecName = void 0;
8
+ const internal_1 = require("@fluidframework/runtime-utils/internal");
10
9
  const index_js_1 = require("../codec/index.js");
11
- const index_js_2 = require("../util/index.js");
12
10
  const messageCodecV1ToV4_js_1 = require("./messageCodecV1ToV4.js");
13
11
  const messageCodecVSharedBranches_js_1 = require("./messageCodecVSharedBranches.js");
14
12
  const messageFormat_js_1 = require("./messageFormat.js");
15
13
  /**
16
- * Convert a MinimumVersionForCollab to a MessageFormatVersion.
17
- * @param clientVersion - The MinimumVersionForCollab to convert.
18
- * @returns The MessageFormatVersion that corresponds to the provided MinimumVersionForCollab.
14
+ * Codec name used to identify the message codec, see {@link makeMessageCodecBuilder}.
19
15
  */
20
- function clientVersionToMessageFormatVersion(clientVersion, writeVersionOverride) {
21
- const compatibleVersion = (0, index_js_2.brand)((0, internal_2.getConfigForMinVersionForCollab)(clientVersion, {
22
- [internal_2.lowestMinVersionForCollab]: messageFormat_js_1.MessageFormatVersion.v3,
23
- [index_js_1.FluidClientVersion.v2_43]: messageFormat_js_1.MessageFormatVersion.v4,
24
- [index_js_1.FluidClientVersion.v2_80]: messageFormat_js_1.MessageFormatVersion.v6,
25
- }));
26
- return writeVersionOverride ?? compatibleVersion;
27
- }
28
- exports.clientVersionToMessageFormatVersion = clientVersionToMessageFormatVersion;
29
- function messageFormatVersionFromOptions(options) {
30
- const selector = options.messageFormatSelector ?? clientVersionToMessageFormatVersion;
31
- return selector(options.minVersionForCollab);
32
- }
33
- /**
34
- * Returns the version that should be used for testing shared branches.
35
- */
36
- function messageFormatVersionSelectorForSharedBranches(clientVersion) {
37
- return (0, index_js_2.brand)(messageFormat_js_1.MessageFormatVersion.vSharedBranches);
38
- }
39
- exports.messageFormatVersionSelectorForSharedBranches = messageFormatVersionSelectorForSharedBranches;
40
- function makeMessageCodec(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options) {
41
- const family = makeMessageCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options);
42
- const writeVersion = messageFormatVersionFromOptions(options);
43
- return (0, index_js_1.makeVersionDispatchingCodec)(family, { ...options, writeVersion });
44
- }
45
- exports.makeMessageCodec = makeMessageCodec;
16
+ exports.messageCodecName = "Message";
46
17
  /**
47
- * @privateRemarks Exported for testing.
18
+ * Creates a {@link ClientVersionDispatchingCodecBuilder} for encoding/decoding messages.
48
19
  */
49
- function makeMessageCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options) {
50
- const registry = [...messageFormat_js_1.messageFormatVersions].map((version) => {
51
- switch (version) {
52
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.undefined):
53
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.v1):
54
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.v2): {
55
- const versionOrUndefined = version === (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.undefined) ? undefined : version;
56
- return [
57
- versionOrUndefined,
58
- (0, index_js_1.makeDiscontinuedCodecVersion)(options, versionOrUndefined, "2.73.0"),
59
- ];
60
- }
61
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.v3):
62
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.v4):
63
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.v6): {
64
- const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
65
- return [
66
- version,
67
- (0, messageCodecV1ToV4_js_1.makeV1ToV4CodecWithVersion)(changeCodec, revisionTagCodec, options, version),
68
- ];
69
- }
70
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.v5): {
71
- return [version, (0, index_js_1.makeDiscontinuedCodecVersion)(options, version, "2.74.0")];
72
- }
73
- case (0, index_js_2.unbrand)(messageFormat_js_1.MessageFormatVersion.vSharedBranches): {
74
- const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
75
- return [
76
- version,
77
- (0, messageCodecVSharedBranches_js_1.makeSharedBranchesCodecWithVersion)(changeCodec, revisionTagCodec, options, version),
78
- ];
79
- }
80
- default: {
81
- (0, internal_1.unreachableCase)(version);
82
- }
83
- }
84
- });
85
- return (0, index_js_1.makeCodecFamily)(registry);
20
+ function makeMessageCodecBuilder() {
21
+ // See MessageFormatVersion and its members for documentation on what changed in each version.
22
+ const versions = [
23
+ // The "undefined" wire format (no version field) is discontinued.
24
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(undefined, "2.73.0"),
25
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(messageFormat_js_1.MessageFormatVersion.v1, "2.73.0"),
26
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(messageFormat_js_1.MessageFormatVersion.v2, "2.73.0"),
27
+ {
28
+ minVersionForCollab: internal_1.lowestMinVersionForCollab,
29
+ formatVersion: messageFormat_js_1.MessageFormatVersion.v3,
30
+ codec: (options) => (0, messageCodecV1ToV4_js_1.makeV1ToV4CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(messageFormat_js_1.MessageFormatVersion.v3)), options.revisionTagCodec, messageFormat_js_1.MessageFormatVersion.v3),
31
+ },
32
+ {
33
+ minVersionForCollab: index_js_1.FluidClientVersion.v2_43,
34
+ formatVersion: messageFormat_js_1.MessageFormatVersion.v4,
35
+ codec: (options) => (0, messageCodecV1ToV4_js_1.makeV1ToV4CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(messageFormat_js_1.MessageFormatVersion.v4)), options.revisionTagCodec, messageFormat_js_1.MessageFormatVersion.v4),
36
+ },
37
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(messageFormat_js_1.MessageFormatVersion.v5, "2.74.0"),
38
+ {
39
+ minVersionForCollab: index_js_1.FluidClientVersion.v2_80,
40
+ formatVersion: messageFormat_js_1.MessageFormatVersion.v6,
41
+ codec: (options) => (0, messageCodecV1ToV4_js_1.makeV1ToV4CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(messageFormat_js_1.MessageFormatVersion.v6)), options.revisionTagCodec, messageFormat_js_1.MessageFormatVersion.v6),
42
+ },
43
+ {
44
+ minVersionForCollab: undefined,
45
+ formatVersion: messageFormat_js_1.MessageFormatVersion.vSharedBranches,
46
+ codec: (options) => (0, messageCodecVSharedBranches_js_1.makeSharedBranchesCodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(messageFormat_js_1.MessageFormatVersion.vSharedBranches)), options.revisionTagCodec, messageFormat_js_1.MessageFormatVersion.vSharedBranches),
47
+ },
48
+ ];
49
+ return index_js_1.ClientVersionDispatchingCodecBuilder.build(exports.messageCodecName, versions);
86
50
  }
87
- exports.makeMessageCodecs = makeMessageCodecs;
51
+ exports.makeMessageCodecBuilder = makeMessageCodecBuilder;
88
52
  function getCodecTreeForMessageFormatWithChange(clientVersion, changeFormat) {
53
+ const builder = makeMessageCodecBuilder();
89
54
  return {
90
- name: "Message",
91
- version: clientVersionToMessageFormatVersion(clientVersion),
55
+ ...builder.getCodecTree(clientVersion),
92
56
  children: [changeFormat],
93
57
  };
94
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"messageCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AAGtE,qEAGgD;AAEhD,gDAY2B;AAO3B,+CAA+E;AAE/E,mEAAqE;AACrE,qFAAsF;AACtF,yDAAiF;AAQjF;;;;GAIG;AACH,SAAgB,mCAAmC,CAClD,aAAsC,EACtC,oBAA2C;IAE3C,MAAM,iBAAiB,GAAyB,IAAA,gBAAK,EACpD,IAAA,0CAA+B,EAAC,aAAa,EAAE;QAC9C,CAAC,oCAAyB,CAAC,EAAE,uCAAoB,CAAC,EAAE;QACpD,CAAC,6BAAkB,CAAC,KAAK,CAAC,EAAE,uCAAoB,CAAC,EAAE;QACnD,CAAC,6BAAkB,CAAC,KAAK,CAAC,EAAE,uCAAoB,CAAC,EAAE;KACnD,CAAC,CACF,CAAC;IACF,OAAO,oBAAoB,IAAI,iBAAiB,CAAC;AAClD,CAAC;AAZD,kFAYC;AAQD,SAAS,+BAA+B,CACvC,OAAgD;IAEhD,MAAM,QAAQ,GAAG,OAAO,CAAC,qBAAqB,IAAI,mCAAmC,CAAC;IACtF,OAAO,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,SAAgB,6CAA6C,CAC5D,aAAsC;IAEtC,OAAO,IA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All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollab,\n\tlowestMinVersionForCollab,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype DependentFormatVersion,\n\tFluidClientVersion,\n\ttype FormatVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeDiscontinuedCodecVersion,\n\tmakeVersionDispatchingCodec,\n} from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { brand, unbrand, type JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport { makeV1ToV4CodecWithVersion } from \"./messageCodecV1ToV4.js\";\nimport { makeSharedBranchesCodecWithVersion } from \"./messageCodecVSharedBranches.js\";\nimport { MessageFormatVersion, messageFormatVersions } from \"./messageFormat.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport interface MessageEncodingContext {\n\tidCompressor: IIdCompressor;\n\tschema?: SchemaAndPolicy;\n}\n\n/**\n * Convert a MinimumVersionForCollab to a MessageFormatVersion.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n * @returns The MessageFormatVersion that corresponds to the provided MinimumVersionForCollab.\n */\nexport function clientVersionToMessageFormatVersion(\n\tclientVersion: MinimumVersionForCollab,\n\twriteVersionOverride?: MessageFormatVersion,\n): MessageFormatVersion {\n\tconst compatibleVersion: MessageFormatVersion = brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: MessageFormatVersion.v3,\n\t\t\t[FluidClientVersion.v2_43]: MessageFormatVersion.v4,\n\t\t\t[FluidClientVersion.v2_80]: MessageFormatVersion.v6,\n\t\t}),\n\t);\n\treturn writeVersionOverride ?? compatibleVersion;\n}\n\nexport interface MessageCodecOptions {\n\treadonly messageFormatSelector?: (\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t) => MessageFormatVersion;\n}\n\nfunction messageFormatVersionFromOptions(\n\toptions: MessageCodecOptions & CodecWriteOptions,\n): MessageFormatVersion {\n\tconst selector = options.messageFormatSelector ?? clientVersionToMessageFormatVersion;\n\treturn selector(options.minVersionForCollab);\n}\n\n/**\n * Returns the version that should be used for testing shared branches.\n */\nexport function messageFormatVersionSelectorForSharedBranches(\n\tclientVersion: MinimumVersionForCollab,\n): MessageFormatVersion {\n\treturn brand(MessageFormatVersion.vSharedBranches);\n}\n\nexport function makeMessageCodec<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: MessageCodecOptions & CodecWriteOptions,\n): IJsonCodec<\n\tDecodedMessage<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tMessageEncodingContext\n> {\n\tconst family = makeMessageCodecs(\n\t\tchangeCodecs,\n\t\tdependentChangeFormatVersion,\n\t\trevisionTagCodec,\n\t\toptions,\n\t);\n\tconst writeVersion = messageFormatVersionFromOptions(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * @privateRemarks Exported for testing.\n */\nexport function makeMessageCodecs<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n): ICodecFamily<DecodedMessage<TChangeset>, MessageEncodingContext> {\n\tconst registry: [\n\t\tFormatVersion,\n\t\tIJsonCodec<\n\t\t\tDecodedMessage<TChangeset>,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tMessageEncodingContext\n\t\t>,\n\t][] = [...messageFormatVersions].map((version) => {\n\t\tswitch (version) {\n\t\t\tcase unbrand(MessageFormatVersion.undefined):\n\t\t\tcase unbrand(MessageFormatVersion.v1):\n\t\t\tcase unbrand(MessageFormatVersion.v2): {\n\t\t\t\tconst versionOrUndefined =\n\t\t\t\t\tversion === unbrand(MessageFormatVersion.undefined) ? undefined : version;\n\t\t\t\treturn [\n\t\t\t\t\tversionOrUndefined,\n\t\t\t\t\tmakeDiscontinuedCodecVersion(options, versionOrUndefined, \"2.73.0\"),\n\t\t\t\t];\n\t\t\t}\n\t\t\tcase unbrand(MessageFormatVersion.v3):\n\t\t\tcase unbrand(MessageFormatVersion.v4):\n\t\t\tcase unbrand(MessageFormatVersion.v6): {\n\t\t\t\tconst changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\t}\n\t\t\tcase unbrand(MessageFormatVersion.v5): {\n\t\t\t\treturn [version, makeDiscontinuedCodecVersion(options, version, \"2.74.0\")];\n\t\t\t}\n\t\t\tcase unbrand(MessageFormatVersion.vSharedBranches): {\n\t\t\t\tconst changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(version);\n\t\t\t}\n\t\t}\n\t});\n\treturn makeCodecFamily(registry);\n}\n\nexport function getCodecTreeForMessageFormatWithChange(\n\tclientVersion: MinimumVersionForCollab,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\treturn {\n\t\tname: \"Message\",\n\t\tversion: clientVersionToMessageFormatVersion(clientVersion),\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
1
+ {"version":3,"file":"messageCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,qEAAmF;AAEnF,gDAU2B;AAQ3B,mEAAqE;AACrE,qFAAsF;AACtF,yDAA0D;AAQ1D;;GAEG;AACU,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAmB1C;;GAEG;AACH,SAAgB,uBAAuB;IAOtC,8FAA8F;IAC9F,MAAM,QAAQ,GAKR;QACL,kEAAkE;QAClE,IAAA,yCAA8B,EAAC,SAAS,EAAE,QAAQ,CAAC;QACnD,IAAA,yCAA8B,EAAC,uCAAoB,CAAC,EAAE,EAAE,QAAQ,CAAC;QACjE,IAAA,yCAA8B,EAAC,uCAAoB,CAAC,EAAE,EAAE,QAAQ,CAAC;QACjE;YACC,mBAAmB,EAAE,oCAAyB;YAC9C,aAAa,EAAE,uCAAoB,CAAC,EAAE;YACtC,KAAK,EAAE,CAAC,OAA+C,EAAE,EAAE,CAC1D,IAAA,kDAA0B,EACzB,OAAO,CAAC,YAAY,CAAC,OAAO,CAC3B,OAAO,CAAC,4BAA4B,CAAC,MAAM,CAAC,uCAAoB,CAAC,EAAE,CAAC,CACpE,EACD,OAAO,CAAC,gBAAgB,EACxB,uCAAoB,CAAC,EAAE,CACvB;SACF;QACD;YACC,mBAAmB,EAAE,6BAAkB,CAAC,KAAK;YAC7C,aAAa,EAAE,uCAAoB,CAAC,EAAE;YACtC,KAAK,EAAE,CAAC,OAA+C,EAAE,EAAE,CAC1D,IAAA,kDAA0B,EACzB,OAAO,CAAC,YAAY,CAA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ights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecTree,\n\ttype CodecVersion,\n\ttype DependentFormatVersion,\n\tFluidClientVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeDiscontinuedCodecAndSchema,\n} from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\n\nimport { makeV1ToV4CodecWithVersion } from \"./messageCodecV1ToV4.js\";\nimport { makeSharedBranchesCodecWithVersion } from \"./messageCodecVSharedBranches.js\";\nimport { MessageFormatVersion } from \"./messageFormat.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport interface MessageEncodingContext {\n\tidCompressor: IIdCompressor;\n\tschema?: SchemaAndPolicy;\n}\n\n/**\n * Codec name used to identify the message codec, see {@link makeMessageCodecBuilder}.\n */\nexport const messageCodecName = \"Message\";\n\n/**\n * Options for constructing a message codec, see {@link makeMessageCodecBuilder}.\n */\ninterface MessageCodecBuilderOptions<TChangeset> extends ICodecOptions {\n\t/** Codecs for encoding changesets. */\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>;\n\t/** Maps each MessageFormatVersion to the corresponding changeset format version. */\n\tdependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>;\n\t/** Codec for encoding revision tags within changesets. */\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>;\n}\n\n/**\n * Creates a {@link ClientVersionDispatchingCodecBuilder} for encoding/decoding messages.\n */\nexport function makeMessageCodecBuilder<TChangeset>(): ClientVersionDispatchingCodecBuilder<\n\tMessageCodecBuilderOptions<TChangeset>,\n\tDecodedMessage<TChangeset>,\n\tMessageEncodingContext,\n\tMessageFormatVersion | undefined,\n\ttypeof messageCodecName\n> {\n\t// See MessageFormatVersion and its members for documentation on what changed in each version.\n\tconst versions: CodecVersion<\n\t\tDecodedMessage<TChangeset>,\n\t\tMessageEncodingContext,\n\t\tMessageFormatVersion | undefined,\n\t\tMessageCodecBuilderOptions<TChangeset>\n\t>[] = [\n\t\t// The \"undefined\" wire format (no version field) is discontinued.\n\t\tmakeDiscontinuedCodecAndSchema(undefined, \"2.73.0\"),\n\t\tmakeDiscontinuedCodecAndSchema(MessageFormatVersion.v1, \"2.73.0\"),\n\t\tmakeDiscontinuedCodecAndSchema(MessageFormatVersion.v2, \"2.73.0\"),\n\t\t{\n\t\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\t\tformatVersion: MessageFormatVersion.v3,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v3),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v3,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_43,\n\t\t\tformatVersion: MessageFormatVersion.v4,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v4),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v4,\n\t\t\t\t),\n\t\t},\n\t\tmakeDiscontinuedCodecAndSchema(MessageFormatVersion.v5, \"2.74.0\"),\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_80,\n\t\t\tformatVersion: MessageFormatVersion.v6,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v6),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v6,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: undefined,\n\t\t\tformatVersion: MessageFormatVersion.vSharedBranches,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeSharedBranchesCodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.vSharedBranches),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.vSharedBranches,\n\t\t\t\t),\n\t\t},\n\t];\n\n\treturn ClientVersionDispatchingCodecBuilder.build(messageCodecName, versions);\n}\n\nexport function getCodecTreeForMessageFormatWithChange(\n\tclientVersion: MinimumVersionForCollab,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\tconst builder = makeMessageCodecBuilder();\n\treturn {\n\t\t...builder.getCodecTree(clientVersion),\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
@@ -18,5 +18,4 @@ export declare const MessageFormatVersion: {
18
18
  };
19
19
  export type MessageFormatVersion = Values<typeof MessageFormatVersion>;
20
20
  export declare const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion>;
21
- export declare const messageFormatVersions: ReadonlySet<MessageFormatVersion>;
22
21
  //# sourceMappingURL=messageFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageFormat.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CAiD/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,oBAAoB,CAK3E,CAAC;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,oBAAoB,CAEnE,CAAC"}
1
+ {"version":3,"file":"messageFormat.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CAiD/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,oBAAoB,CAK3E,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.messageFormatVersions = exports.supportedMessageFormatVersions = exports.MessageFormatVersion = void 0;
7
+ exports.supportedMessageFormatVersions = exports.MessageFormatVersion = void 0;
8
8
  const index_js_1 = require("../util/index.js");
9
9
  /**
10
10
  * The format version for the message.
@@ -65,5 +65,4 @@ exports.supportedMessageFormatVersions = new Set([
65
65
  exports.MessageFormatVersion.v6,
66
66
  exports.MessageFormatVersion.vSharedBranches,
67
67
  ]);
68
- exports.messageFormatVersions = new Set(Object.values(exports.MessageFormatVersion));
69
68
  //# sourceMappingURL=messageFormat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageFormat.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA2D;AAE3D;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAU,EAAC,sBAAsB,EAAE;IACtE;;;;OAIG;IACH,SAAS,EAAE,CAAC;IACZ;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;;OAIG;IACH,EAAE,EAAE,CAAC;IACL;;;;;;;OAOG;IACH,EAAE,EAAE,CAAC;IACL;;;;;OAKG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,eAAe,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAsC,IAAI,GAAG,CAAC;IACxF,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,eAAe;CACpC,CAAC,CAAC;AACU,QAAA,qBAAqB,GAAsC,IAAI,GAAG,CAC9E,MAAM,CAAC,MAAM,CAAC,4BAAoB,CAAC,CACnC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strictEnum, type Values } from \"../util/index.js\";\n\n/**\n * The format version for the message.\n */\nexport const MessageFormatVersion = strictEnum(\"MessageFormatVersion\", {\n\t/**\n\t * NOTE: this is written as `undefined` rather than `0` in the wire format.\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tundefined: 0,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv1: 1,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv2: 2,\n\t/**\n\t * Introduced prior to 2.0 and used beyond.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.\n\t */\n\tv3: 3,\n\t/**\n\t * Introduced in 2.2.0.\n\t * Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability could be dropped in favor of {@link MessageFormatVersion.v3},\n\t * but doing so would make the pattern of writable versions more complex and gain little\n\t * because most of the logic for this format is shared with {@link MessageFormatVersion.v3}.\n\t */\n\tv4: 4,\n\t/**\n\t * This version number was used internally for testing shared branches.\n\t * This format was never made stable.\n\t * This version number is kept here solely to avoid reusing the number: it is not supported for either reading or writing.\n\t * @deprecated Use {@link MessageFormatVersion.vSharedBranches} for testing shared branches.\n\t */\n\tv5: 5,\n\t/**\n\t * Introduced and made available for writing in 2.80.0\n\t * Adds support for \"no change\" constraints.\n\t */\n\tv6: 6,\n\t/**\n\t * Not yet released.\n\t * Only used for testing shared branches.\n\t */\n\tvSharedBranches: \"shared-branches|v0.1\",\n});\nexport type MessageFormatVersion = Values<typeof MessageFormatVersion>;\nexport const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([\n\tMessageFormatVersion.v3,\n\tMessageFormatVersion.v4,\n\tMessageFormatVersion.v6,\n\tMessageFormatVersion.vSharedBranches,\n]);\nexport const messageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set(\n\tObject.values(MessageFormatVersion),\n);\n"]}
1
+ {"version":3,"file":"messageFormat.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA2D;AAE3D;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAU,EAAC,sBAAsB,EAAE;IACtE;;;;OAIG;IACH,SAAS,EAAE,CAAC;IACZ;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;;OAIG;IACH,EAAE,EAAE,CAAC;IACL;;;;;;;OAOG;IACH,EAAE,EAAE,CAAC;IACL;;;;;OAKG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,eAAe,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAsC,IAAI,GAAG,CAAC;IACxF,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,eAAe;CACpC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strictEnum, type Values } from \"../util/index.js\";\n\n/**\n * The format version for the message.\n */\nexport const MessageFormatVersion = strictEnum(\"MessageFormatVersion\", {\n\t/**\n\t * NOTE: this is written as `undefined` rather than `0` in the wire format.\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tundefined: 0,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv1: 1,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv2: 2,\n\t/**\n\t * Introduced prior to 2.0 and used beyond.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.\n\t */\n\tv3: 3,\n\t/**\n\t * Introduced in 2.2.0.\n\t * Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability could be dropped in favor of {@link MessageFormatVersion.v3},\n\t * but doing so would make the pattern of writable versions more complex and gain little\n\t * because most of the logic for this format is shared with {@link MessageFormatVersion.v3}.\n\t */\n\tv4: 4,\n\t/**\n\t * This version number was used internally for testing shared branches.\n\t * This format was never made stable.\n\t * This version number is kept here solely to avoid reusing the number: it is not supported for either reading or writing.\n\t * @deprecated Use {@link MessageFormatVersion.vSharedBranches} for testing shared branches.\n\t */\n\tv5: 5,\n\t/**\n\t * Introduced and made available for writing in 2.80.0\n\t * Adds support for \"no change\" constraints.\n\t */\n\tv6: 6,\n\t/**\n\t * Not yet released.\n\t * Only used for testing shared branches.\n\t */\n\tvSharedBranches: \"shared-branches|v0.1\",\n});\nexport type MessageFormatVersion = Values<typeof MessageFormatVersion>;\nexport const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([\n\tMessageFormatVersion.v3,\n\tMessageFormatVersion.v4,\n\tMessageFormatVersion.v6,\n\tMessageFormatVersion.vSharedBranches,\n]);\n"]}
@@ -14,9 +14,7 @@ import { type JsonCompatibleReadOnly, type Breakable, type WithBreakable } from
14
14
  import type { BranchId, SharedTreeBranch } from "./branch.js";
15
15
  import { BranchCommitEnricher } from "./branchCommitEnricher.js";
16
16
  import type { ChangeEnricher } from "./changeEnricher.js";
17
- import { type EditManagerCodecOptions } from "./editManagerCodecs.js";
18
17
  import type { EditManagerFormatVersion } from "./editManagerFormatCommons.js";
19
- import { type MessageCodecOptions } from "./messageCodecs.js";
20
18
  import type { MessageFormatVersion } from "./messageFormat.js";
21
19
  import type { ResubmitMachine } from "./resubmitMachine.js";
22
20
  import { type SharedTreeSummaryFormatVersion, type Summarizable, type SummaryElementParser, type SummaryElementStringifier } from "./summaryTypes.js";
@@ -24,7 +22,7 @@ import { VersionedSummarizer } from "./versionedSummarizer.js";
24
22
  export interface ClonableSchemaAndPolicy extends SchemaAndPolicy {
25
23
  schema: TreeStoredSchemaRepository;
26
24
  }
27
- export interface SharedTreeCoreOptionsInternal extends CodecWriteOptions, EditManagerCodecOptions, MessageCodecOptions {
25
+ export interface SharedTreeCoreOptionsInternal extends CodecWriteOptions {
28
26
  }
29
27
  export interface EnrichmentConfig<TChange> {
30
28
  readonly enricher: ChangeEnricher<TChange>;
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeCore.d.ts","sourceRoot":"","sources":["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AAC,EAAE,eAAe,CAAC,OAAO,CAAC,GACxC,IAAI;IASP,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAItB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAI3E,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,mBAAmB;CAG3B"}
@@ -110,13 +110,23 @@ let SharedTreeCore = (() => {
110
110
  this.editManager = new editManager_js_1.EditManager(changeFamily, localSessionId, this.mintRevisionTag, (branchId) => this.registerSharedBranch(branchId), rebaseLogger);
111
111
  this.registerSharedBranch("main");
112
112
  const revisionTagCodec = new index_js_1.RevisionTagCodec(idCompressor);
113
- const editManagerCodec = (0, editManagerCodecs_js_1.makeEditManagerCodec)(this.editManager.changeFamily.codecs, changeFormatVersionForEditManager, revisionTagCodec, options);
113
+ const editManagerCodec = (0, editManagerCodecs_js_1.makeEditManagerCodecBuilder)().build({
114
+ ...options,
115
+ changeCodecs: this.editManager.changeFamily.codecs,
116
+ dependentChangeFormatVersion: changeFormatVersionForEditManager,
117
+ revisionTagCodec,
118
+ });
114
119
  this.summarizables = [
115
120
  new editManagerSummarizer_js_1.EditManagerSummarizer(this.editManager, editManagerCodec, this.idCompressor, options.minVersionForCollab, this.schemaAndPolicy),
116
121
  ...summarizables,
117
122
  ];
118
123
  (0, internal_1.assert)(new Set(this.summarizables.map((e) => e.key)).size === this.summarizables.length, 0x350 /* Index summary element keys must be unique */);
119
- this.messageCodec = (0, messageCodecs_js_1.makeMessageCodec)(changeFamily.codecs, changeFormatVersionForMessage, new index_js_1.RevisionTagCodec(idCompressor), options);
124
+ this.messageCodec = (0, messageCodecs_js_1.makeMessageCodecBuilder)().build({
125
+ ...options,
126
+ changeCodecs: changeFamily.codecs,
127
+ dependentChangeFormatVersion: changeFormatVersionForMessage,
128
+ revisionTagCodec: new index_js_1.RevisionTagCodec(idCompressor),
129
+ });
120
130
  if (enrichmentConfig !== undefined) {
121
131
  this.registerSharedBranchForEditing("main", enrichmentConfig.enricher, enrichmentConfig.resubmitMachine);
122
132
  }